Files
ai/charting_library/static/tv-chart.html
Eugene 4c0dccabf5 Auto Focus when mouse cursor is inside the chart. #452
Widget Event method callbacks for onIntervalChange, onAutoSaveNeeded, saveChart are not executed sometimes and intermittent in IE. #597
2015-07-23 11:15:53 +03:00

5057 lines
2.6 MiB

<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style>.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#6b6b6d}.ui-widget-content a{color:#6b6b6d}.ui-widget-header{border:1px solid #c9cbcd;background:#fafafa;color:#6b6b6d}.ui-widget-header a{color:#6b6b6d}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#fafafa;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-widget :active{outline:0}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #FDE763;background:#FFF8CF;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}// .ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}// .ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}// .ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}// .ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}// .ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}// .ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}// .ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}// .ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;margin:5px 0;background:0 0}.ui-tabs .ui-tabs-hide{position:absolute;left:-10000px}.ui-datepicker{padding:0;border:0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;height:53px;line-height:53px;border:0;padding:0;background-color:#00b9db;color:#fff;// arrows .ui-datepicker-prev,.ui-datepicker-next{opacity:.8;position:absolute;top:0;width:40px;height:100%;background:0 0;border:0;cursor:pointer;&.ui-state-disabled{opacity:.4}}.ui-datepicker-prev-hover:not(.ui-state-disabled),.ui-datepicker-next-hover:not(.ui-state-disabled){opacity:1;background:0 0;border:0}.ui-datepicker-next{right:0;span{.icon-absolute("white_arrow_small_r.png")}}.ui-datepicker-prev{left:0;span{.icon-absolute("white_arrow_small_l.png")}}}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:12px;border-collapse:collapse;margin:0;border:1px solid #d6d6d6;border-top:0}.ui-datepicker th{width:40px;height:28px;border-bottom:1px solid red;padding:0;border:0;border-bottom:1px solid #d6d6d6;text-align:center;font-weight:400;color:#8d9196;background-color:#f8f8f8}.ui-datepicker td{border:0;padding:0;margin:0;span,a,span.ui-state-default,a.ui-state-default{display:block;position:relative;height:39px;padding:0;margin:0;text-align:center;line-height:40px;background:#fff;border:0;border-bottom:1px solid #f6f7f8;border-right:1px solid #f6f7f8;text-decoration:none;&.ui-state-highlight{color:#00b9db;&:after{position:absolute;top:0;right:0;content:" ";width:0;height:0;border-style:solid;border-width:0 11px 11px 0;border-color:transparent #00badb transparent transparent}}&.ui-state-hover{background:#eceff2}}&.ui-datepicker-current-day{span,a{border:2px solid #00b9db;color:#00b9db;height:36px;line-height:37px}}}.ui-datepicker td:last-child span:not(.ui-state-highlight),.ui-datepicker td:last-child a:not(.ui-state-highlight){border-right:0}.ui-datepicker tr:last-child td span:not(.ui-state-highlight),.ui-datepicker tr:last-child td a:not(.ui-state-highlight){border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%}html.min-width-auto,html.min-width-auto body{min-width:0}.chart-section{background:#eaeff4;.not-moderated &{background-color:#F5F4E0}}.view-chart{.view-chart-header{padding:20px 0 22px;.avatar{float:left;img{width:70px;height:70px;.border-radius(2px)}}h1{margin:0;font-weight:600;font-size:21px;text-transform:uppercase;display:inline-block;color:#3b3e44;vertical-align:middle;line-height:24px}.header-icons{display:inline-block;margin-left:3px;vertical-align:middle;span{line-height:18px}}.chart-name-author{padding-left:90px}.chart-author{padding-top:7px;font-size:14px;font-weight:600;.creation-date{margin-left:8px;font-size:13px;color:#9BA9B7;font-weight:400}.user-badge{margin:1px 3px 0 5px;vertical-align:top}.follow-link{display:inline-block;position:static;margin-top:2px;vertical-align:top}}}.chart-symbol{display:inline-block;.follow-symbol{top:2px}}.symbol-quote{font-size:13px;font-weight:600;&>div{white-space:nowrap}a{margin-right:7px}.symbol-quote-stats{margin-left:3px;>span{padding:0 3px;&:empty{display:none};.border-radius(2px)}}}}.viewchart-column-main{.chart-view-top{padding-bottom:16px;.creation-date{float:right;color:#707070;padding-left:10px}}.chart-buttons-wrap{position:absolute;top:60px;left:7px;z-index:3;.chart-relation-buttons{position:static;margin-bottom:10px}.chart-share-button{position:relative}}}body.viewchart-body{.tv-layout-width{margin:0 auto;width:980px;@media (min-width:1000px){width:96%}@media (min-width:1400px){width:94%}}.tv-layout-width .tv-index-footer-wrap{padding-left:0;padding-right:0}}.viewchart-column-main{padding:10px 0 15px}.viewchart-body-popup{height:auto}.viewchart-column-main .chart-title{height:45px;border:1px dotted red;border-width:0}.viewchart-column-main .chart-container-wrap{position:relative}.viewchart-column-main .chart-actions-float{float:right}.viewchart-column-main .chart-actions-float .button{background:#00b8c9;line-height:20px;display:inline-block;padding:0 8px;.border-radius(1px);color:#fff;font-weight:700;cursor:pointer;&:hover{background:lighten(#00b8c9,5%)}}.viewchart-column-main #chart-container,.viewchart-column-main .chart-place{height:100%;position:relative}.viewchart-column-main #published-loading-indicator{z-index:14}.viewchart-column-main .chart-stats{float:right;font:700 15px Calibri,Arial;color:#828282;position:relative;top:5px}.viewchart-column-main .chart-footmeta{.chart-tags{padding:15px 100px 0 0}.chart-tag{@chart_tag_bg:#E2E9F0;float:left;line-height:16px;height:22px;white-space:nowrap;padding:4px 7px 0 10px;margin:4px 20px 4px 0;position:relative;background:@chart_tag_bg;color:#8C919A;&:after{content:' ';position:absolute;top:0;right:-7px;width:0;height:0;border-top:13px solid transparent;border-bottom:13px solid transparent;border-left:7px solid @chart_tag_bg}&:hover{color:#fff;background:#06b2ce;&:after{border-left-color:#06b2ce}}}}.viewchart-column-main .symbol-quote .symbol-change-pt:before{content:'('}.viewchart-column-main .symbol-quote .symbol-change-pt:after{content:')'}.viewchart-column-main .symbol-quote .symbol-change-pt:empty:before{content:''}.viewchart-column-main .symbol-quote .symbol-change-pt:empty:after{content:''}.view-chart.is-my-chart .chart-relation-buttons .agree{cursor:default}.view-chart .chart-status-buttons{display:none;margin-left:40px}.view-chart.is-my-chart .chart-status-buttons{display:inline}.view-chart.is-staff .chart-status-buttons{display:inline}.viewchart-column-main .chart-actions-agree-wrapper{overflow:hidden;height:0}.viewchart-column-main .chart-actions-agree{clear:both;position:relative;padding:15px 9px;margin:5px 0 0;font-size:12px;background:#f2f5f8;border:1px solid #BFBFBF;border-radius:2px}.viewchart-column-main .chart-actions-agree .close{position:absolute;top:5px;right:5px;display:block;width:13px;height:13px;background:transparent url(images/icons.png) -80px -100px;cursor:pointer}.viewchart-column-main .chart-actions-agree .close:hover{background-position:-100px -100px}.chart-actions-agree-comment-block{position:relative;margin:12px 0 0}.viewchart-column-main .chart-actions-agree-comment-block textarea{width:670px;min-height:46px}.viewchart-column-main .chart-actions .chart-opinion-sum .positive{color:#390}.viewchart-column-main .chart-actions .chart-opinion-sum .positive:before{content:"+"}.viewchart-column-main .chart-actions .chart-opinion-sum .negative{color:#C00}.viewchart-column-main .chart-actions .chart-followers-count span{color:#ea9207}.viewchart-column-main .chart-actions .tv-button.with-arrow span{font-family:Arial;vertical-align:baseline}.user-list-popup{width:400px;position:fixed}.user-list-popup .likes-col{width:50%;float:left}.user-list-popup .dislikes-col{width:50%;float:left}.user-list-popup .col-head{padding:4px 0 12px;font-size:15px;line-height:19px}.user-list-popup .col-head:before{width:12px;height:14px;background:url(images/icons.png) no-repeat;display:inline-block;content:" ";margin-right:6px;vertical-align:top;margin-top:1px}.user-list-popup .likes-col .col-head:before{background-position:-20px -180px}.user-list-popup .dislikes-col .col-head:before{background-position:-180px -180px;margin-top:5px}.search-results .chart-actions{opacity:.5;.transition(opacity .1s ease)}.search-results .item:hover .chart-actions{opacity:1}.viewchart-column-main .chart-actions{float:right}.chart-actions-agree .controls{float:right}.chart-actions-agree .tv-button{text-transform:uppercase;padding:6px 14px 5px}.chart-actions-agree-comment-field{overflow:hidden}.chart-actions-agree-comment-field-sizer{margin:0 14px 0 0}.chart-actions-agree-comment-block .chart-actions-agree-comment-field-sizer textarea{display:block;width:100%}.viewchart-column-main textarea{color:#595959;border:1px solid #c9cbcd;background:#FAFAFA;border-radius:1px;margin:0;padding:2px 3px;font-family:sans-serif;font-size:14px}.viewchart-column-main textarea::-webkit-input-placeholder{color:#777}.viewchart-column-main textarea:-moz-placeholder{color:#777}.viewchart-column-main textarea:-ms-input-placeholder{color:#777}.viewchart-column-main textarea:focus::-webkit-input-placeholder{color:transparent}.viewchart-column-main textarea:focus:-moz-placeholder{color:transparent}.viewchart-column-main textarea:focus:-ms-input-placeholder{color:transparent}.viewchart-column-main .chart-description{position:relative;margin-top:25px;padding:3px 60px 3px 3px;color:#3b3e44;font-size:15px;line-height:25px}.viewchart-column-main .chart-description div{overflow-x:hidden;text-overflow:ellipsis}.viewchart-column-main .chart-description .tv-button{border:0;border-radius:0}.viewchart-column-main .chart-description .edit{position:absolute;top:3px;right:3px;.button-base-color();color:#fff!important;width:35px;text-align:center;&.pending{background:url(images/button-base-process.gif)}}.chart-related-block{padding:10px 0;background:#EAEFF4;>.tv-layout-width{padding-top:12px;border-top:#D9E1EA 1px solid}.chart-related-col.half{float:left;width:50%}.head{position:relative;color:#5CB888;font-size:16px;font-weight:600;text-transform:uppercase;margin:12px 0 0;padding-left:21px;&:before{content:' ';display:block;position:absolute;margin-top:-8px;top:50%;left:0;.sprite("related-chart-green.png",true)}&.rebounds:before{.sprite("rebound-chart-green.png",true)}}.related-charts-wrap{margin:15px 0;font-size:0}}.related-chart{margin:15px 35px 15px 0;.avatar{position:relative;top:4px;float:left;margin-right:10px}.chart-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;.chart-name{font-size:14px;font-weight:600}.chart-info{margin:4px 0 0;color:#8c919a;font-size:12px;a{font-weight:600}span{margin-left:8px}.comments{color:#3A3D44}.icon-comments{margin-left:5px;display:inline-block;.sprite("comments-small.png",true);vertical-align:bottom;vertical-align:text-bottom}.user-badge{margin-left:3px}}}}.chart-comment-form-container{margin-bottom:30px}.comment-block .chart-comment-form{margin:10px 0 0}.chart-comment-form-avatar{width:53px}.chart-comment-form-avatar>div{width:41px;height:41px;margin:0 6px 0 0;background:#fff;border:1px solid #C4CED6}.chart-comment-form-textarea{position:relative;overflow:hidden}.chart-comment-form-textarea textarea{display:block;height:78px;font:14px 'Open Sans',sans-serif;margin:0;padding:6px 8px;padding-right:30px;border:solid 1px #d5d9de;width:100%;.box-sizing(border-box);&:focus{border-color:#1fb2cc};&.process{background:rgba(255,255,255,.5)}}.chart-comment-form-textarea textarea.disabled,.chart-comment-form-textarea textarea:focus.disabled{border:1px solid #D22}.chart-comment-form-textarea .non-latin-warning{display:none;color:#D22;font-size:12px;padding-top:4px}.chart-comment-form-controls{margin-top:15px;height:32px}.chart-comment-form-controls .button{.button-base();float:right}.reply-form-block{width:100%;clear:both;.chart-comment-form-controls{margin-bottom:8px}.chart-comment-form{margin-top:15px}}.insert-chart-tag{display:block;width:22px;height:22px;position:absolute;top:7px;right:7px;cursor:pointer;background:#f2f5f8;&:hover{background:darken(#f2f5f8,5%)}&:before{.pseudo();.icon-absolute("chart-small.png");top:5px;left:5px}.border-radius(2px)}.attach-chart-toolbar{position:absolute;top:-29px;right:7px;&.active{top:7px}.transition(top .1s ease);input{.box-sizing(content-box);float:left;width:290px;height:24px;line-height:24px;border:solid 1px #d5d9de;margin:0;padding:0 5px;&.error{background:#FFEFEF;color:#9E2E30}}.button{float:left;margin-left:7px;.button-base(13px,26px)}}.chart-comments-list{margin-left:-9px;.comment-form-toolbar{height:21px;padding:0 5px;border-radius:4px 4px 0 0;background:url(images/gallery/nav-bg.png);border:1px solid #c5c5c5;border-bottom-color:#a5a5a5;box-shadow:0 1px 0 rgba(0,0,0,.1);position:relative;top:3px}.comment-form-toolbar a{display:inline-block;text-align:center;float:left;margin:0 1px;width:21px;height:21px;cursor:default}.comment-form-toolbar a:hover{margin:0;border-left:1px solid #ccc;border-right:1px solid #ccc}.comment-form-toolbar a:active{margin:0;border-left:1px solid #ccc;border-right:1px solid #ccc;background:url(images/button-bg.png) 0 -52px}.post-comment-button{margin:1px 0 0 10px;float:left}.chart-comments{margin:7px 0 20px 7px}.comment-block{padding:9px 9px 3px;font-size:14px;color:#3b3e44;overflow:hidden;margin-bottom:15px;background:#f2f5f8;&:hover,&.active{background:#eaeff4}}.comment-block .spam_message{border:solid 1px red;background:#EDBEBF;padding:10px;margin-bottom:10px}.comment-header-text{margin-left:50px}.comment-header{position:relative}.comment-header .avatar-middle{float:left;margin-top:2px}.comment-block .comment-author a.userlink{color:#0099D4;font-size:14px;font-weight:600}.comment-block .comment-author .user-badge{margin-left:4px}.comment-block .comment-date{color:#8c919a;font-size:12px;margin-left:8px}.comment-block .comment-body{margin:5px 0 0;word-wrap:break-word;padding-right:50px;line-height:20px;font-size:13px}.comment-actions-inline{font-size:13px;// opacity:0;// .transition(opacity .2s ease-in);line-height:20px;padding-top:5px;height:27px}.comment-block:hover .comment-actions-inline{// opacity:1}.comment-actions-inline a{text-decoration:none;cursor:pointer}.comment-actions-inline .separator{width:2px;height:2px;display:inline-block;margin:3px 3px 2px;background:0 0;overflow:hidden;&.rating-indent{margin-right:6px}}.comment-actions-inline .rating{.rating-sum{padding:0 7px;.border-radius(2px);color:#fff;font-weight:600;&.positive{background-color:#5CB888;&:before{content:"+"}}&.negative{background-color:#E0735E}&.zero{padding:0;font-size:0;margin-left:-17px;visibility:hidden}}.vote{margin-left:15px;font-size:0;vertical-align:middle}.agree,.disagree{vertical-align:middle;display:inline-block;position:relative;font-size:0;width:15px;height:16px;opacity:.7;&:hover{opacity:1}}.agree:before{.pseudo();.icon-absolute-center("wi_up_icon.png");margin-top:-7px!important}.agree.active:before{.icon-absolute-center("wi_up_active_icon.png")}.disagree:before{.pseudo();.icon-absolute-center("wi_down_icon.png")}.disagree.active:before{.icon-absolute-center("wi_down_active_icon.png")}.active{font-weight:700;opacity:1}.separator{display:none}}.comment-block .comment-body.notice{font-style:italic;margin:10px 0 7px;color:#909090}.comment-0{margin-left:0}.comment-1{margin-left:30px}.comment-2{margin-left:60px}.comment-3{margin-left:90px}.comment-4{margin-left:120px}.comment-5{margin-left:150px}.comment-6{margin-left:180px}.comment-7{margin-left:210px}.comment-8{margin-left:240px}.comment-9{margin-left:270px}.comment-10{margin-left:300px}.comment-11{margin-left:330px}.comment-12{margin-left:360px}.comment-13{margin-left:390px}.comment-14{margin-left:420px}.comment-15{margin-left:450px}}.share-options{display:none;background:#f2f5f8;position:absolute;z-index:14;width:930px;min-height:315px;top:50%;left:50%;margin-top:-157px;margin-left:-465px;.box-shadow(0 0 10px rgba(0,0,0,.2));.tab-arrow{position:absolute;left:398px;top:-10px}.close-button{position:absolute;right:10px;top:10px;width:10px;height:10px;background:url(images/icons.png) no-repeat -103px -340px;cursor:pointer}p{margin:13px 3px 7px;font-size:14px}a.embed{cursor:pointer;border-bottom:1px dashed #5590d1;font-weight:700}a.embed.active{border:0;color:#636565}input[type=text]:not(.tv-dialog-text-input){color:#3e4040;width:300px;height:28px;border:1px solid #bfbfbf;margin:0;padding:0 5px;background:#f7f9fc}input[type=text]:not(.tv-dialog-text-input):focus{background:#f1f1f1;margin:0}.addthis{position:relative;top:-1px;.custom_button_stocktwits{display:inline-block;float:left;width:20px;height:18px;margin:0 2px;padding:6px 6px 8px;background:#890A0A;cursor:pointer;.icon{display:inline-block;position:relative;vertical-align:middle;width:22px;height:14px;background:url(images/icons.png) -140px -300px no-repeat}}}.share-warapper{padding:10px 20px;max-width:910px;margin:0 auto}.share-base{float:left;width:315px}.make-it-mine label{.button-base();width:300px+12px;padding:0}}.embed-options{margin:0 0 5px;padding-left:335px}.embed-options textarea{color:#3e4040;height:80px;border:1px solid #bfbfbf;margin:0;padding:5px;background:#f7f9fc;resize:both;width:100%;.box-sizing(border-box)}.embed-options textarea:focus{background:#f1f1f1;margin:0}.embed-options p.desc{font-size:12px}.embed-options .size-select{.clearfix();padding-bottom:10px}.embed-options .size-button{cursor:pointer;width:60px;height:37px;float:left;background:#ececec;border:1px solid silver;position:relative;margin:14px 12px 0 0}.embed-options .size-button.active{background:#cceaff;border:1px solid #528cde}.embed-options .size-button.b2{width:96px;height:60px}.embed-options .size-button.b3{width:108px;height:72px}.embed-options .size-button.b4{width:119px;height:71px}.embed-options .size-button div{position:absolute;width:100%;top:50%;text-align:center;margin:-7px 0 0}.embed-options .size-custom{float:left;font-size:12px}.embed-options .size-custom input[type=text]{width:40px}.viewchart-column-right{float:right;width:320px}.viewchart-column-right .carousel-item{margin:9px 0 0}.viewchart-column-right .carousel-item.active{border:2px solid #007FB9}.viewchart-column-right .show-more{margin:6px 5px 50px 0;.button{.button-base-hollow();display:block;font-weight:600;width:60%;margin:0 auto}}.viewchart-column-right .related-charts+.clear{height:15px}.viewchart-column-right h2{font:700 16px Arial;color:#5A5A5A;text-transform:uppercase;margin:0}.viewchart-column-right h2 .icon{top:3px;margin:0 3px 0 0}.exit-fullscreen{z-index:16;position:fixed;top:-1px;left:50%;opacity:.6;background:#FFF;color:#848487;border-radius:0 0 3px 3px;border:1px solid #c9cbcd;font-size:11px;width:116px;font-weight:700;padding:2px 4px;cursor:default;margin:0 0 0 -62px}.exit-fullscreen:hover{opacity:1}.viewchart-body .chart-status-picture{z-index:50;position:absolute}.chart-additional{padding:40px 0 0;.head{color:#26282f;font-size:16px;font-weight:700;text-transform:uppercase;padding-bottom:15px}.similar-charts{margin:-5px 0 0 -5px}}.chart-comments{padding-right:350px;padding-bottom:25px;.embeded-image,.embeded-chart-image{cursor:pointer;margin-top:4px}.embeded-image img,.embeded-chart-image img{border:1px solid #C4CED6;max-width:100%}.comment-body iframe{margin-top:4px;max-width:100%}}.chart-additional.no-similar .chart-comments{padding-right:0}.embeded-image-popup{position:fixed;z-index:100;border:1px solid #C4CED6;padding:10px;border-radius:5px;background:#fff}.chart-direction-label,.chart-activity-label{text-transform:uppercase;color:#fff;font-size:11px;border-radius:1px;padding:0 4px;display:inline-block;line-height:18px;vertical-align:top;margin:0 0 0 3px;position:relative;font-weight:700;cursor:default;white-space:nowrap}.chart-activity-label{padding:0}.chart-activity-label-plate,.chart-activity-label-help{display:inline-block;vertical-align:top;background:#888;padding:0 4px}.chart-activity-label-help{padding:0 2px;margin-left:1px;color:rgba(255,255,255,.75)}.chart-activity-label-help:hover{color:#fff}.chart-activity-label-active .chart-activity-label-plate,.chart-activity-label-active .chart-activity-label-help{background:#008ccc}.chart-direction-label.direction-0{background:#E7C400;display:none}.chart-direction-label.direction-1{background:#60b789}.chart-direction-label.direction-2{background:#dc7d6e}.chart-title .chart-direction-label,.chart-title .chart-activity-label,.chart-title .icon-chart-recommended{vertical-align:middle}.chart-actions .button-set{font-size:0;white-space:nowrap}.chart-actions .button-set .tv-button{border-radius:0;margin-left:1px;border:0;background:#e2e8ef}.chart-actions .button-set .tv-button:hover:not(.disabled){background:lighten(#e2e8ef,1%)}.chart-actions .tv-button.active:not(.chart-active-button){color:#fff!important;box-shadow:none;background:#64c581;border:0}.chart-actions .tv-button.active:hover:not(.chart-active-button):not(.chart-closed-button){background:saturate(#64c581,5%)}.chart-agree-button.active{background:#7dbc52!important;border-color:#4e812d!important}.chart-agree-button.active+.chart-disagree-button{border-left-color:#4e812d!important}.chart-disagree-button.active{background:#c15135!important;border-color:#843825!important}.chart-actions .tv-button .tooltip{display:none}.chart-actions .tv-button.chart-active-button.active{position:relative;background:#d9e1e9!important;box-shadow:none}.chart-actions .tv-button.chart-closedbullseye-button.active{position:relative}.chart-actions .tv-button.chart-closed-button.active{position:relative;background:#c15135!important}.icon-chartstate-active{background-position:-80px -300px;width:18px;height:15px;margin:-7px 2px -7px 0;vertical-align:middle}.icon-chartstate-closed{background-position:-40px -300px;width:17px;height:17px;margin:-7px 2px -5px 0;vertical-align:middle}.tv-button.active .icon-chartstate-closed{background-position:-60px -300px}.icon-chartstate-closedbullseye{background-position:0 -300px;width:17px;height:17px;margin:-7px 2px -5px 0;vertical-align:middle}.tv-button.active .icon-chartstate-closedbullseye{background-position:-20px -300px}.share-button{position:relative}.share-button.active{background:#fb611a!important;border-color:#d55415!important}.share-button img.tab-arrow{position:absolute;left:23px;bottom:-7px;z-index:1;display:none}.share-button.active img.tab-arrow{display:block}#chart-favorites-button.active{background:#fc9c21!important;border-color:#c97c18!important}.chart-comment-form textarea:focus,.viewchart-column-main .chart-actions-agree-comment-block textarea:focus{background:#fff}.similar-charts .item{margin-bottom:28px}.modal-page-chart{background:#f2f5f8;.fancybox-skin{background:#f2f5f8}.tv-layout-width{width:auto!important;padding-left:28px!important;padding-right:28px!important}.chart-popup-iframe-wraper{margin:0 27px 0 28px;position:relative}.view-chart .view-chart-header{padding-top:28px}.chart-popup-iframe-wraper iframe{width:100%;height:475px;position:absolute;top:165px;z-index:1;margin:-1px 0 0 -1px}.chart-comments{padding-right:0}}.script-source-block{position:relative;margin:0 1px;.script-source{background:#fff;font-size:13px;margin:0;padding:0;font-family:Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;max-height:225px;overflow:auto}.script-actions{z-index:10;position:absolute;top:5px;right:5px}.pubscript-button{float:left}.script-unwrap{display:none;cursor:pointer;position:absolute;bottom:1px;right:20px;background:rgba(40,41,42,.05);width:59px;height:52px;&:hover{background:rgba(40,41,42,.1)}i{.sprite("roll-down.png");display:block;width:15px;height:11px;margin:21px auto 0}&.active i{.sprite("roll-up.png")}}}.script-updateinfo{margin-bottom:20px;font-style:italic}.pseudo{content:" "}.absolute-center{position:absolute;top:50%;left:50%}.text-overflow-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.frame-flat-arrow-down{padding-right:20px;position:relative}.frame-flat-arrow-down:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}.textfield-flat{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;margin:0;vertical-align:top;font-weight:700}.textfield-flat-numticker{position:relative}.textfield-flat-numticker>input{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;margin:0;vertical-align:top;font-weight:700;padding-right:20px;position:relative;padding-right:26px}.textfield-flat-numticker>input:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}.textfield-flat-numticker i{display:block;width:26px;height:50%;position:absolute;cursor:pointer;right:0}.textfield-flat-numticker i:after{content:'';display:block;width:0;height:0;position:absolute;right:12px;border-style:solid}.textfield-flat-numticker i.up{top:0}.textfield-flat-numticker i.up:after{border-color:transparent transparent #96989c;border-width:0 4px 4px;bottom:2px}.textfield-flat-numticker i.down{bottom:0}.textfield-flat-numticker i.down:after{border-color:#96989c transparent transparent;border-width:4px 4px 0;top:2px}.select-flat{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;cursor:default;background-color:#fff;padding-right:20px;position:relative}.select-flat:hover{background-color:#f8f8f8}.select-flat.active,.select-flat:active{background-color:#f2f5f8}.select-flat:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}svg use{pointer-events:none}.avatar-small{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;width:32px;height:32px;overflow:hidden;position:relative}.avatar-small img{width:32px;height:32px;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.avatar-small.online:after,.avatar-small.is-online:after{content:'';display:block;width:10px;height:10px;border-radius:50%;position:absolute;top:-3px;right:-3px;background:#5cb888;border:3px solid #f2f5f8}.avatar-middle{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;width:39px;height:39px;overflow:hidden;position:relative}.avatar-middle img{width:39px;height:39px;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.avatar-middle.online:after,.avatar-middle.is-online:after{content:'';display:block;width:10px;height:10px;border-radius:50%;position:absolute;top:-3px;right:-3px;background:#5cb888;border:3px solid #f2f5f8}.user-stats-small{text-decoration:none;font-size:14px;font-weight:600}.user-stats-small .user-stats-charts{margin-right:14px}.user-stats-small .user-stats-charts:before{height:12px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -880px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-right:3px;top:-2px}.user-stats-small .user-stats-followers{margin-right:14px}.user-stats-small .user-stats-followers:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2220px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.user-stats-small .user-stats-reputation{margin-right:14px;color:#3cbf81}.user-stats-small .user-stats-reputation:before{height:13px;width:10px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2485px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.user-stats-small .user-stats-chat-rating{color:#3883df}.user-stats-small .user-stats-chat-rating:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -902px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-right:5px;top:-2px}.user-stats-small .user-stats-chat-rating.user-stats-chat-rating-negative{color:#e05c5e}.user-stats{text-decoration:none;color:#1380b7;font-size:19px}.user-stats .user-stats-charts{margin-right:14px}.user-stats .user-stats-charts:before{height:13px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -553px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:3px;top:-3px}.user-stats .user-stats-followers{margin-right:14px}.user-stats .user-stats-followers:before{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1804px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px}.user-stats .user-stats-reputation{color:#3cbf81}.user-stats .user-stats-reputation:before{height:15px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2460px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.chart-stats-middle{text-decoration:none;color:#3b3e44;font-weight:700;font-size:14px}.chart-stats-middle .chart-stats-comments{margin-right:6px}.chart-stats-middle .chart-stats-comments:before{height:15px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1043px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:6px}.chart-stats-middle .chart-stats-views:before{height:12px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2815px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:5px;top:-1px}.chart-stats-small{text-decoration:none;color:#3b3e44;font-weight:700;font-size:12px}.chart-stats-small .chart-stats-comments{margin-right:9px}.chart-stats-small .chart-stats-comments:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1068px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:5px}.chart-stats-small .chart-stats-views:before{height:11px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2837px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:4px;top:-1px}.symbol-change-direction.up{color:#41a771}.symbol-change-direction.down{color:#de7255}body.fullscreen-mode{overflow:hidden}.tv-layout-width{width:1000px;margin:0 auto}.tv-layout-half-width{width:500px;margin:0 auto}.tv-layout-half-width.left{float:left}.tv-layout-half-width.right{float:right}.tv-header{min-width:720px;background:#26282f;color:#fff;font-size:small}.is-not-authenticated .index-page .tv-header{background:#18b9d9}.is-not-authenticated .index-page .tv-header .index-learnmore-header{background:#18b9d9 url(images/index/learnmore-header-bg.png) 50% -25px repeat-x}.tv-footer{margin:-460px 0 0;height:460px;background:#26282f}.tv-content{padding:0 0 460px}.tv-overwrap{min-height:100%;overflow:hidden}.tv-main{height:auto!important;min-height:100%;background:#f2f5f8}.tv-content{background:#f2f5f8;height:auto!important;min-height:100%}.tv-side-toolbar{float:left;position:static;height:100%;overflow-x:visible;overflow-y:hidden}.tv-main-panel{position:relative;background-color:#f1f3f6;overflow:hidden}.tv-side-panel{float:right;position:relative;z-index:15;height:100%}.is-mobile .tv-side-panel{display:none}.tv-panels{height:100%}.chart-page .tv-content{padding:0}.clear{clear:both}.clearfix:after{clear:both;display:block;content:""}.hide{display:none!important}.show{display:block!important}.tv-right{float:right!important}.tv-left{float:left!important}#_atssh{position:absolute;margin-top:-20px}.js-right-boundary{margin-right:0}.hl-bg{background:#eaeff4}.content-page .bl-bg{background:#00b8dc;color:#fff}.content-page .bl-bg h1,.content-page .bl-bg h2,.content-page .bl-bg h3,.content-page .bl-bg h4,.content-page .bl-bg h5,.content-page .bl-bg h6{color:#fff}.content-page .bl-bg a,.content-page .bl-bg a:hover,.content-page .bl-bg a:visited{color:#c8cfd8}.content-page .bl-bg .contacts{color:inherit;background-color:#008da9}.content-page .bl-bg .contacts .title{color:#fff}.icon{display:inline-block;background:url(images/icons.png) 0 0 no-repeat;position:relative;vertical-align:middle}.tv-button:hover .icon-share{background-position:-100px -60px}.tv-button.active .icon-share{background-position:-120px -260px}.tv-button.disabled .icon-share{background-position:-80px -60px}.icon-favorites{background-position:-140px -60px;width:16px;height:15px;vertical-align:top;left:-3px;top:-1px}.tv-button:hover .icon-favorites{background-position:-160px -60px}.tv-button.active .icon-favorites{background-position:-140px -260px}.tv-button.disabled .icon-favorites{background-position:-140px -60px}.tv-button .icon-dropdown{position:relative;left:5px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.tv-button.active .icon-dropdown{background-position:2px -15px}.tv-button.load-more-button{width:88px}.tv-button.tv-button-fontstyle{height:14px;padding-left:0;padding-right:0;width:25px;text-align:center}.tv-button.process,.ajax-process-bg{background:url(images/bar-loader.gif)!important;background-repeat:repeat!important;background-position:0 0!important;pointer-events:none}.tv-button.tv-button-fontstyle .icon-fontstyle-bold,.tv-button.tv-button-fontstyle .icon-fontstyle-italic{display:block;height:11px;margin:auto;background:url(images/icons.png) 0 0 no-repeat;position:relative;top:1px}.tv-button.tv-button-fontstyle .icon-fontstyle-bold{width:10px;background-position:-40px -260px}.tv-button.tv-button-fontstyle .icon-fontstyle-italic{width:7px;background-position:-60px -260px}.tv-button{cursor:default;padding:6px 10px 5px;height:15px;display:inline-block;vertical-align:top;text-decoration:none!important;color:#6f7073!important;border:1px solid #c9cbcd;font-size:11px;font-family:arial,sans-serif;font-weight:700;text-align:center;background:url(images/button-bg.png) 0 0 repeat-x;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-webkit-appearance:none}.tv-button:hover{background-position:0 -26px;color:#68696b}.tv-button:active:not([disabled]),.tv-button.active,.tv-button.toolbutton:active,.tv-button.toolbutton.active,.tv-select-container.sbHolderOpen,.tv-select-container:active{background:#f4f7f9;color:#f5f5f5}.tv-button.ok{min-width:30px;background:#06b2ce;border-color:#06b2ce;color:#fff!important}.tv-button.ok:hover{background:#06bfdd;border-color:#06bfdd}.tv-button.ok:active{background:#06a5bf;border-color:#06a5bf}.tv-button.ok.process{background:url(images/button-base-process.gif) 0 0 repeat!important}.tv-button.block{display:block;text-align:center}.tv-button.slim{padding:3px 8px;font-weight:400}.chart-description .tv-button.slim{line-height:normal}.tv-button.icon{padding:5px}.tv-button.icon.active{background:#cfe1ff}.tv-button.toolbutton{width:24px;height:25px;padding:0!important;text-align:center}.tv-button.wide{padding:5px 15px;min-width:50px}.tv-button.xwide{padding:5px 0;width:175px}.tv-button.xxwide{padding:5px 0;width:185px}.tv-button.disabled{color:#848484;background-position:0 -78px;opacity:.7;cursor:default}.tv-button.disabled:hover{background-position:0 -78px}.tv-button.disabled:active{background-position:0 -78px}.tv-button.theblueone{background:#4387f6 url(images/publish-chart-bg.png);color:#fff!important;border:1px solid #346bc2;padding:4px 10px 5px}.tv-button.theblueone:active{background-position:0 -26px}.tv-button.half-left{border-radius:3px 0 0 3px;border-right:0}.tv-button.half-right{border-radius:0 3px 3px 0}.tv-button.cancel{background:#9ca0a6;border-color:#9ca0a6;color:#fff!important}.tv-button.cancel:hover{background:#a4a8ad;border-color:#a4a8ad}.tv-button.cancel:active{background:#94989f;border-color:#94989f}.tv-button.process{background:url(images/bar-loader.gif) 0 0 repeat}.tv-button.delete{background:#d75442;border-color:#d75442;color:#fff!important}.tv-button.delete:hover{background:#da5f4f;border-color:#da5f4f}.tv-button.delete:active{background:#d44935;border-color:#d44935}.tv-button.with-arrow{position:relative;margin-left:2px}.tv-button.with-arrow.arrow-left:after,.tv-button.with-arrow.arrow-left:before{right:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.tv-button.with-arrow.arrow-left:after{border-color:rgba(249,249,249,0);border-right-color:#f9f9f9;border-width:5px;top:50%;margin-top:-5px}.tv-button.with-arrow.arrow-left:before{border-color:rgba(188,188,188,0);border-right-color:#bcbcbc;border-width:6px;top:50%;margin-top:-6px}.tv-button.with-arrow.arrow-left:active:after{border-color:rgba(227,231,233,0);border-right-color:#e3e7e9;margin-right:-1px}.tv-uppercase{text-transform:uppercase}.tv-select{display:none}.tv-select-container{background-color:#fafafa;border:1px solid #c9cbcd;border-radius:0;height:26px;position:relative;display:inline-block;vertical-align:top;color:#6b6b6d}.tv-select-container a{color:#6b6b6d}.tv-select-container.sbHolderOpen{color:#000}.tv-select-container.sbHolderOpen a{color:#000}.tv-select-container.sbHolderDisabled{background-color:#fff;border-color:#e3e5e6;color:gray}.tv-select-container.sbHolderDisabled a{color:gray}.tv-select-container.sbHolderDisabled .sbToggle{opacity:.2}.tv-select-container:hover:not(.sbHolderDisabled){color:#000}.tv-select-container:hover:not(.sbHolderDisabled) a{color:#000}.tv-select-container:hover:not(.sbHolderDisabled) .sbToggle:after{border-color:#000 transparent transparent}.tv-select-container .sbSelector{cursor:default;display:block;height:26px;line-height:26px;outline:0;overflow:hidden;padding:0 23px 0 10px;color:#6b6b6d}.tv-select-container .sbSelector:hover{outline:0;text-decoration:none}.tv-select-container .sbToggle{cursor:default;position:absolute;right:5px;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.tv-select-container.dialog{height:25px;vertical-align:middle}.tv-select-container.dialog .sbSelector{height:25px;line-height:25px;padding:0 20px 0 10px;min-width:80px;width:calc(100% - 30px)}.tv-select-container.dialog .sbOptions{min-width:100%}.tv-select.inset+.tv-select-container{background:#eff3f6;box-shadow:inset 0 1px 2px rgba(0,0,0,.15);color:#6f7073}.tv-unstyled-select-container{position:relative}.property-wide-select .tv-select-container.dialog .sbSelector{width:90px}.tv-select-container .sbHolderDisabled{background-color:#3c3c3c;border:solid 1px #515151}.tv-unstyled-select-container .sbOptions,.tv-select-container .sbOptions{list-style:none;margin:0;padding:0;position:absolute;top:30px;min-width:150px;z-index:1;overflow-y:auto;background:#fff;border:1px solid #c9cbcd;overflow-x:hidden}.tv-unstyled-select-container .sbOptions a,.tv-select-container .sbOptions a{display:block;white-space:nowrap;outline:0;padding:7px 12px;font-weight:400;font-size:13px;line-height:16px;color:#595959}.tv-unstyled-select-container .sbOptions a:link,.sbOptions a:visited,.tv-select-container .sbOptions a:link,.sbOptions a:visited{color:#595959;text-decoration:none}.tv-unstyled-select-container .sbOptions a:hover,.tv-select-container .sbOptions a:hover{background:#f4f7f9}.tv-unstyled-select-container .sbOptions a.active,.tv-select-container .sbOptions a.active{background:#f4f7f9;border-left:3px solid #5cb888;padding-left:9px;color:#333}.tv-unstyled-select-container .sbOptions li.last a,.tv-select-container .sbOptions li.last a{border-bottom:0}.tv-unstyled-select-container .sbOptions .sbDisabled,.tv-select-container .sbOptions .sbDisabled{display:block;padding:7px 0 7px 10px}.tv-unstyled-select-container .sbOptions .sbGroup,.tv-select-container .sbOptions .sbGroup{display:block;font-weight:700;padding:7px 0 7px 3px}.tv-unstyled-select-container .sbOptions .sbSub,.tv-select-container .sbOptions .sbSub{padding-left:17px}.tv-select-container.tv-select-container-fontsize .sbSelector{width:26px}.tv-select-container.tv-select-container-fontsize .sbOptions{min-width:54px}.tv-text-input{color:#5a5a5a;margin:0;border:1px solid #c9cbcd;display:inline-block;overflow:hidden;width:100px;height:26px;vertical-align:top;padding:0 5px}.tv-text-input:focus{border-color:#4c82ce}.tv-text-input.inset{background:#fff}.tv-text-input.ticker{height:25px;width:60px}.tv-ticker{display:inline;position:absolute;width:13px;height:27px;margin:0 0 0 -13px}.tv-ticker .icon{background:url(images/ticker-icons.png);position:absolute;width:13px}.tv-ticker .icon.up{height:13px}.tv-ticker .icon.up:hover{background-position:0 -27px}.tv-ticker .icon.up:active{background-position:0 -54px}.tv-ticker .icon.down{height:14px;background-position:0 -13px;top:13px}.tv-ticker .icon.down:hover{background-position:0 -40px}.tv-ticker .icon.down:active{background-position:0 -67px}input:focus+.tv-ticker{border-left:1px solid #4c82ce}input:focus+.tv-ticker .icon{width:12px}input:focus+.tv-ticker .icon.up{background-position:-1px 0}input:focus+.tv-ticker .icon.up:hover{background-position:-1px -27px}input:focus+.tv-ticker .icon.up:active{background-position:-1px -54px}input:focus+.tv-ticker .icon.down{background-position:-1px -13px;top:13px}input:focus+.tv-ticker .icon.down:hover{background-position:-1px -40px}input:focus+.tv-ticker .icon.down:active{background-position:-1px -67px}.tv-close-panel{width:5px;height:25px;border:solid #c9cbcd;border-width:1px 0;background:#fff no-repeat 50% 50%}.tv-close-panel.top,.tv-close-panel.bottom{width:25px;height:5px;border-width:0 1px}.tv-close-panel.left,.hidden .tv-close-panel.right{background-image:url(data:image/gif;base64,R0lGODlhAwAFAPABAMnLzf///yH5BAUAAAEALAAAAAADAAUAAAIGTHCgqAYFADs=)}.tv-close-panel.right,.hidden .tv-close-panel.left{background-image:url(data:image/gif;base64,R0lGODlhAwAFAPABAMnLzf///yH5BAUAAAEALAAAAAADAAUAAAIFRAKWi1cAOw==)}.tv-close-panel.bottom,.hidden .tv-close-panel.top{background-image:url(data:image/gif;base64,R0lGODlhBQADAIABAMnLzf///yH5BAEKAAEALAAAAAAFAAMAAAIFhB0XC1sAOw==)}.tv-close-panel.top,.hidden .tv-close-panel.bottom{background-image:url(data:image/gif;base64,R0lGODlhBQADAIABAMnLzf///yH5BAEKAAEALAAAAAAFAAMAAAIFTGAHuF0AOw==)}html,body{margin:0;padding:0;background:#fff;color:#000;font-family:'Open Sans',sans-serif;font-size:small;height:100%!important}body{min-width:1000px}body.viewchart-body{min-width:1050px}body.extension{min-width:0}img{border:0}textarea{resize:none}:focus{outline:0!important}input::-ms-clear{display:none}input,textarea{-webkit-border-radius:0;-webkit-background-clip:padding-box;-moz-border-radius:0;-moz-background-clip:padding;border-radius:0;background-clip:padding-box}.chart-page :not(input):not(textarea):not(.selectable),.unselectable,.tv-profile .tags,.quote-area{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input,textarea,.selectable{-moz-user-select:text;-webkit-user-select:text;user-select:text}.mt{border:0 #000 none;border-style:none;border-collapse:collapse;text-align:left;vertical-align:top;margin:0;padding:0}a{color:#0099d4;text-decoration:none}a:visited{color:#0099d4;text-decoration:none}a:hover{color:#0099d4;text-decoration:none}a:active{color:#0099d4;text-decoration:none}.auto-size{min-width:100%;min-height:100%;height:100%;width:100%;border:0 #000 none;border-style:none;border-collapse:collapse;text-align:left;vertical-align:top;margin:0;padding:0}.auto-w{min-width:100%;width:100%}.auto-h{min-height:100%;height:100%}.text-center{text-align:center}.center-align{text-align:center;vertical-align:middle}.l-align{text-align:left;vertical-align:middle}.r-align{text-align:right;vertical-align:middle}.simple-page{background-color:#626262;color:#fff}.form-page{background-color:#626262}.form-container{background-color:#626262}.form-at-all{background-color:#d3d3d3;padding:5px 5px 3px}.form-header{font-size:xx-large;font-weight:700}.form-content{margin-top:10px;text-align:center}td.form-table{text-align:left;vertical-align:middle}.submit-button{margin-top:10px}.form-error{color:red;font-weight:700;margin-bottom:10px}#footer{background:#dbdbdb;color:#626262;border-top:1px #999 solid;height:24px;font-size:small}.copyright{margin-left:10px}.terms-of-use{margin-right:15px}#chart-area{background:0 0}#chart-area,.chart-container,.chart-place{position:relative;-ms-touch-action:none}#chart-area.fullscreen{position:fixed;z-index:15;left:0;top:0;width:100%!important;height:100%!important;background:#f1f3f6}.chart-page .chart-container{border:solid #c9cbcd 1px;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chart-page .chart-container.multiple.active{border:solid #007fb9 1px}.is-mobile .chart-page .chart-container.multiple.active{z-index:1}.chart-page .chart-container.inactive .chart-status-picture,.chart-page .chart-container.inactive .pane-legend{opacity:.6}.chart-page .chart-container.inactive .pane-legend-line.study,.chart-page .chart-container.inactive .back-to-present,.chart-page .chart-container.inactive .control-bar-wrapper{display:none}.viewchart-body .chart-container.multiple{border:solid #c9cbcd 1px;margin:-1px}#detailed-panel{background-color:#e8e8e8;height:100px;background-color:#f0f0f0;padding-left:7px}.detailed-header{text-align:left;vertical-align:middle}.detailed-header-symbol{font-size:xx-large;color:#484848}.detailed-header-value{font-size:x-large;color:#484848}.detailed-header-delta{font-size:x-large;color:#d84128}.detailed-date{font-size:small;color:#8f8f8f}.detailed-column{border-left:1px #c8c8c8 solid;width:100px}.detailed-param-name{text-align:right;vertical-align:middle;font-size:x-small;color:#8f8f8f}.detailed-param-value{text-align:left;vertical-align:middle;font-size:x-small;font-weight:700;color:#000}.gray-border-left{border-left:1px #c8c8c8 solid}.gray-border-right{border-left:1px #c8c8c8 solid}.q-search{background-color:#ebebeb;height:20px}.q-s{background-color:#ebebeb;border:1px #bdbdbd solid;color:#a4a4a4;margin:2px;padding:3px}.q-header{height:22px}.q-h{text-align:center;vertical-align:middle;background-color:#e8e8e8;font-weight:700;color:#545454;font-size:x-small}.q-even-row{background-color:#fbfbfb}.q-odd-row{background-color:#fff}.q-c-0{color:#363636;text-align:center;vertical-align:middle;font-weight:700}.q-c-1{color:#626262;text-align:center;vertical-align:middle}.q-c-2-3{color:#0f9900;text-align:center;vertical-align:middle}.o-c-t{border-bottom:2px #ccc solid;color:#363636;padding-left:10px;font-size:medium;font-weight:700}.chart-info-1{font-weight:700;color:#666}.chart-info-2{color:#666}.action-button{border-radius:3px;background:-moz-linear-gradient(-90deg,#fdfdfd,#e7e7e7);background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#e7e7e7),color-stop(1,#fdfdfd));border:1px #919191 solid;color:#636363;text-align:center;font-weight:700;font-size:x-small;padding-top:5px;padding-bottom:5px;width:100px}.info-text{color:#576069;text-align:center;font-weight:700;font-size:small;padding-top:5px;padding-bottom:5px;width:100px}.o-c-i{border:1px #cdcdcd solid}.o-c-1{font-weight:700;font-size:medium}.o-c-2{font-size:small}.ui-tabs .ui-tabs-nav li a{font-size:x-small}table.save-chart-dialog{width:400px}input[type=text].save-chart-dialog{width:100%}input[type=button].save-chart-dialog{width:100;display:inline}textarea.save-chart-dialog{width:100%;height:100px}.input-reset{width:16px;height:16px;position:absolute;top:9px;right:7px;cursor:pointer;display:none;border-radius:50%}.input-reset:before{content:" ";display:block;width:10px;height:10px;background:url(images/icons.png) no-repeat -103px -340px;position:absolute;top:50%;left:50%;margin:-5px 0 0 -5px}.input-reset:hover{background-color:#f2f5f8}.input-reset:active{opacity:.6}.insert-study-dialog{position:absolute;width:830px;overflow:hidden;z-index:14;background:#fff;border:1px solid #d6d6d6;box-shadow:0 0 30px 0 rgba(0,0,0,.15)}.insert-study-row{overflow:auto;-webkit-overflow-scrolling:touch}.is-mobile .scrollbar{overflow:auto;-webkit-overflow-scrolling:touch}.custom-scroll-container{position:relative}.custom-scroll-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.custom-scroll-container .sb-scrollbar-top,.custom-scroll-container .sb-scrollbar-bottom{display:none}.load-chart .touch{visibility:visible;opacity:.3}.load-chart .touch:hover,.load-chart .touch.active{opacity:1}.load-chart .columns{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .columns.name{width:50%}.load-chart .columns.modified{width:30%}.load-chart .columns.symbol{width:20%}.load-chart .new-chart{padding-top:12px;border-left:1px solid #d6d6d6;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6;height:38px;width:140px;color:#8b8c8e;font-size:11px;font-weight:700;float:right;display:block;position:relative;cursor:pointer;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .new-chart:hover{color:#00c3e6}.load-chart .new-chart:active,.load-chart .new-chart.active{background-color:#f4f7f9;color:#00c3e6}.load-chart .chart-search{width:514px;position:relative;cursor:default;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.load-chart .chart-search input{width:514px;padding:9px 34px;height:36px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:0}.load-chart .chart-search .input-reset{top:10px;right:10px}.load-chart .chart-search .search-icon{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.load-chart .please-log-in{height:452px;color:#8f8f8f;font-style:italic;text-align:center}.load-chart .please-log-in:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.load-chart .list-header{height:32px;color:#989797;padding:7px 30px 0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .list-header .item{display:inline-block;cursor:pointer;text-transform:uppercase;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .list-header .item.name{width:50%}.load-chart .list-header .item.modified{width:30%}.load-chart .list-header .item.symbol{width:20%}.load-chart .list-header .item:hover,.load-chart .list-header .item.active{color:#68696b}.load-chart .list-header .item.active{font-weight:700}.load-chart .list-header .item.name{padding-left:24px}.load-chart .charts-list-container{height:420px;position:relative}.load-chart .charts-list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.load-chart .charts-list-container .sb-scrollbar-top,.load-chart .charts-list-container .sb-scrollbar-bottom{display:none}.load-chart .charts-list-container .charts-list{position:absolute;width:100%}.load-chart .charts-list-container .charts-list .item{position:relative;cursor:pointer;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 30px 0 10px}.load-chart .charts-list-container .charts-list .item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:18px;display:inline-block;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .charts-list-container .charts-list .item .value.name{width:50%}.load-chart .charts-list-container .charts-list .item .value.modified{width:30%}.load-chart .charts-list-container .charts-list .item .value.symbol{width:20%}.load-chart .charts-list-container .charts-list .item .value span.match{color:#4c82ce;font-weight:700}.load-chart .charts-list-container .charts-list .item .value.name{padding-left:24px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite{visibility:hidden;display:inline-block;width:16px;height:16px;position:absolute;top:1px;left:1px;background:url(images/icons.png);background-position:-40px -280px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover{visibility:visible;background-position:-120px -363px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite.active{visibility:visible;background-position:-20px -280px}.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite{visibility:visible;opacity:.3}.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover,.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite.active,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite.active{opacity:1}.load-chart .charts-list-container .charts-list .item .actions{visibility:hidden;position:absolute;top:7px;right:16px}.load-chart .charts-list-container .charts-list .item .actions .icon-delete{display:inline-block;background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px}.load-chart .charts-list-container .charts-list .item .actions .icon-delete:hover{background-position:-81px -362px}.is-mobile .load-chart .charts-list-container .charts-list .item .actions,.feature-touch .load-chart .charts-list-container .charts-list .item .actions{visibility:visible;opacity:.3}.is-mobile .load-chart .charts-list-container .charts-list .item .actions:hover,.feature-touch .load-chart .charts-list-container .charts-list .item .actions:hover,.is-mobile .load-chart .charts-list-container .charts-list .item .actions.active,.feature-touch .load-chart .charts-list-container .charts-list .item .actions.active{opacity:1}.load-chart .charts-list-container .charts-list .item:hover{background:#f2f5f8}.load-chart .charts-list-container .charts-list .item:hover .value.name{color:#4c82ce}.load-chart .charts-list-container .charts-list .item:hover .actions{visibility:visible}.load-chart .charts-list-container .charts-list .item:hover .icon-favorite{visibility:visible}.load-chart .charts-list-container .charts-list .item.active .name{font-weight:700}.load-chart .charts-list-container .charts-list .item.active{background:#f2f5f8}.load-chart .charts-list-container .charts-list .item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#5cb888}.open-script .touch{visibility:visible;opacity:.3}.open-script .touch:hover,.open-script .touch.active{opacity:1}.open-script .columns{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .columns.name{width:40%}.open-script .columns.source{width:35%}.open-script .columns.modified{width:25%}.open-script .no-scripts{height:420px;color:#8f8f8f;font-style:italic;text-align:center;display:none}.open-script .no-scripts:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.open-script .search{position:relative;cursor:default;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.open-script .search input{width:514px;padding:9px 34px;height:36px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:0}.open-script .search .input-reset{top:10px;right:10px}.open-script .search .search-icon{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.open-script .list-header{height:32px;color:#989797;padding:7px 30px 0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-header .item{display:inline-block;cursor:pointer;text-transform:uppercase;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-header .item.name{width:40%}.open-script .list-header .item.source{width:35%}.open-script .list-header .item.modified{width:25%}.open-script .list-header .item:hover,.open-script .list-header .item.active{color:#68696b}.open-script .list-header .item.active{font-weight:700}.open-script .list-header .item.name{padding-left:24px}.open-script .list-container{height:420px;position:relative}.open-script .list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.open-script .list-container .sb-scrollbar-top,.open-script .list-container .sb-scrollbar-bottom{display:none}.open-script .list-container .list{position:absolute;width:100%}.open-script .list-container .list .item{position:relative;cursor:pointer;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 30px 0 10px}.open-script .list-container .list .item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:18px;display:inline-block;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-container .list .item .value.name{width:40%}.open-script .list-container .list .item .value.source{width:35%}.open-script .list-container .list .item .value.modified{width:25%}.open-script .list-container .list .item .value span.match{color:#4c82ce;font-weight:700}.open-script .list-container .list .item .value.name{padding-left:24px}.open-script .list-container .list .item .value .icon-favorite{visibility:hidden;display:inline-block;width:16px;height:16px;position:absolute;top:1px;left:1px;background:url(images/icons.png);background-position:-40px -280px}.open-script .list-container .list .item .value .icon-favorite:hover{visibility:visible;background-position:-120px -363px}.open-script .list-container .list .item .value .icon-favorite.active{visibility:visible;background-position:-20px -280px}.is-mobile .open-script .list-container .list .item .value .icon-favorite,.feature-touch .open-script .list-container .list .item .value .icon-favorite{visibility:visible;opacity:.3}.is-mobile .open-script .list-container .list .item .value .icon-favorite:hover,.feature-touch .open-script .list-container .list .item .value .icon-favorite:hover,.is-mobile .open-script .list-container .list .item .value .icon-favorite.active,.feature-touch .open-script .list-container .list .item .value .icon-favorite.active{opacity:1}.open-script .list-container .list .item .actions{visibility:hidden;position:absolute;top:7px;right:16px}.open-script .list-container .list .item .actions .icon-delete{display:inline-block;background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px}.open-script .list-container .list .item .actions .icon-delete:hover{background-position:-81px -362px}.is-mobile .open-script .list-container .list .item .actions,.feature-touch .open-script .list-container .list .item .actions{visibility:visible;opacity:.3}.is-mobile .open-script .list-container .list .item .actions:hover,.feature-touch .open-script .list-container .list .item .actions:hover,.is-mobile .open-script .list-container .list .item .actions.active,.feature-touch .open-script .list-container .list .item .actions.active{opacity:1}.open-script .list-container .list .item:hover{background:#f2f5f8}.open-script .list-container .list .item:hover .value.name{color:#4c82ce}.open-script .list-container .list .item:hover .actions{visibility:visible}.open-script .list-container .list .item:hover .icon-favorite{visibility:visible}.open-script .list-container .list .item.active .name{font-weight:700}.open-script .list-container .list .item.active{background:#f2f5f8}.open-script .list-container .list .item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#5cb888}.script-search{border:solid #d6d6d6;border-width:1px 0}.script-search .script-search-fld{margin:0;cursor:text;display:block;position:relative}.script-search .script-search-fld .script-search-spacer{padding:9px 34px}.script-search .script-search-fld .script-search-spacer input{height:19px;width:100%;border:0;padding:0;margin:0;display:block}.script-search .script-search-fld .search-icon{position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.script-search .script-search-fld .input-reset{top:10px;right:10px}.ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.insert-study-tabs{width:187px;height:100%;float:left;display:block;font-size:13px;line-height:13px;border-right:1px solid #d6d6d6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.insert-study-tabs .search{position:relative;padding:0;width:100%;height:38px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:default;border-top:1px solid #d6d6d6;border-bottom:1px solid #d6d6d6}.insert-study-tabs .search.active{border-top:1px solid #4c82ce;border-bottom:1px solid #4c82ce}.insert-study-tabs .search.active .left-border,.insert-study-tabs .search.active .right-border{display:block}.insert-study-tabs .search input{display:block;padding:11px 9px 11px 29px;width:100%;height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:0}.insert-study-tabs .search div{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.insert-study-tabs .search .left-border,.insert-study-tabs .search .right-border{display:none;width:1px;height:38px;top:-1px;background:#4c82ce}.insert-study-tabs .search .left-border{left:0}.insert-study-tabs .search .right-border{left:100%}.insert-study-tabs .search .input-reset{top:10px;right:10px}.insert-study-tabs .insert-study-tabs-list-container{height:calc(100% - 38px);position:relative}.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-top,.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-bottom{display:none}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list{margin:0;padding:0;position:absolute;width:100%}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li{padding:11px 26px 9px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;clear:both;color:#595959;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li:hover{background:#f4f7f9}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.active:not(.search){border:0;padding-left:22px;font-weight:700;background:#f4f7f9;border-left:4px solid #5cb888}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs{padding:0;position:relative}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs:hover{background:0 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text{padding:11px 26px 9px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text:before{content:" ";position:absolute;display:block;width:5px;height:9px;top:12px;left:14px;background:url(images/select-bg.png);background-position:10px 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text.open:before{width:9px;height:5px;top:14px;left:12px;background-position:0 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul{width:100%;padding:0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:hover,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:active{padding-left:34px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li.active,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:hover.active,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:active.active{padding-left:30px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li .beta-sign{color:#5cb888;font-size:10px;position:relative;top:-2px;font-style:italic;margin-left:3px}.insert-study-pages .economy-page{padding:20px 28px}.insert-study-main{width:calc(100% - 187px);height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:-1px;border-left:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.insert-study-pages{height:calc(100% - 47px);position:relative;display:block}.insert-study-pages>div:after{clear:both;display:table;content:""}.insert-study-pages .page-with-popular>div{margin:0;width:100%;float:left}.insert-study-pages .page-with-popular>div .header-container{margin:0;padding-left:28px;padding-right:12px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.insert-study-pages .page-with-popular>div .header-container .group-header{font-weight:700;font-size:14px;padding:20px 0 8px;margin:0}.insert-study-pages .page-with-popular>div .header-container.with-divider{margin-top:15px}.insert-study-pages .page-with-popular>div .header-container.with-divider .group-header{padding-top:24px;border-top:1px solid #d6d6d6}.insert-study-pages .page-with-popular>div .column-left,.insert-study-pages .page-with-popular>div .column-right{width:50%;float:left}.insert-study-pages .page-with-popular>div .column-left .subgroup-header,.insert-study-pages .page-with-popular>div .column-right .subgroup-header{font-weight:700;margin:0;padding:8px 0 8px 28px}.insert-study-pages .insert-study-pages-loading{display:none;width:100%;height:100%;position:absolute;background:#fff;opacity:.6}.insert-study-pages.loading .insert-study-pages-loading{display:block}.insert-study-items{margin:0;padding:0}.insert-study-items ul{margin:0 0 8px;padding:0}.insert-study-items ul.column{float:left;width:199px}.insert-study-items li{display:block;vertical-align:top;padding:8px 0 8px 28px;font-size:13px;position:relative;-webkit-transform:translate3d(0,0,0)}.insert-study-items li>span{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.insert-study-items li .text{box-sizing:border-box;padding-right:15px;width:100%}.insert-study-items li.grayed .text{opacity:.3}.insert-study-items li.grayed .fav.in-fav{visibility:hidden}.insert-study-items li.custom-script,.insert-study-items li.published-script{padding-right:68px}.insert-study-items li.custom-script .text,.insert-study-items li.published-script .text{width:70%}.insert-study-items li:not(.placeholder){color:#595959;cursor:pointer}.insert-study-items li:hover:not(.placeholder){background:#f4f7f9}.insert-study-items li .fav{display:block;position:absolute;top:10px;left:6px;visibility:hidden;width:16px;height:14px;background:url(images/icons.png) -40px -280px}.insert-study-items li:not(.grayed) .fav:hover:not(.in-fav){background-position:-120px -363px}.insert-study-items li:not(.grayed) .in-fav{background-position:-20px -280px}.insert-study-items li.custom-script .source,.insert-study-items li .open-chart-popup,.insert-study-items li .delete{display:block;position:absolute;top:9px;width:18px;height:18px;text-align:center;line-height:17px;border:1px solid #d6d6d6;background:#fff;color:#8c8c8c}.insert-study-items li.custom-script .source:hover,.insert-study-items li .open-chart-popup:hover,.insert-study-items li .delete:hover{border-color:#b5b7b9}.insert-study-items li.custom-script .source{right:33px}.insert-study-items li .open-chart-popup{right:8px}.insert-study-items li .delete{right:8px}.insert-study-items li .delete i{margin:3px 4px;height:12px;width:10px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2761px;display:block;position:absolute;overflow:hidden}.insert-study-items li .agrees{color:#919597;width:13%;text-align:right}.insert-study-items li:hover .fav,.insert-study-items li.custom-script:hover .source,.insert-study-items li .fav.in-fav,.is-mobile .insert-study-items li .fav,.is-mobile .insert-study-items li .agrees{visibility:visible}.insert-study-items li .fav.in-fav,.favored-list .item.quicked .to-quick,.favored-list .item .to-quick.quicked{opacity:.35}.insert-study-items li:hover .fav.in-fav,.favored-list .item.quicked:hover .to-quick,.favored-list .item:hover .to-quick.quicked{opacity:1;-webkit-transition:opacity .4s ease;-moz-transition:opacity .4s ease;-ms-transition:opacity .4s ease;-o-transition:opacity .4s ease;transition:opacity .4s ease}.insert-study-items li .match{color:#4c82ce}.insert-study-pages .search-header{padding:0;margin:0 14px 9px 28px;height:13px;font-weight:700;clear:both}.insert-study-pages .search-header:not(:first-child){margin-top:29px;padding-top:31px;border-top:1px solid #f0f0f0}.insert-study-pages .search-header:first-child{padding-top:20px}.insert-study-items li .author{width:17%}.insert-study-items li .remove{display:none;position:absolute;top:8px;right:8px;width:14px;height:14px;background:url(images/icons.png) no-repeat scroll -102px -362px transparent}.insert-study-items li .remove:hover{background-position:-81px -362px}.insert-study-items li:hover .remove{display:block}.insert-study-offer-container{min-height:614px;margin-left:199px;display:block;border-left:1px solid #d6d6d6;background-color:#f4f7f9;position:relative}.insert-study-offer-header{font-size:11px;padding:12px 12px 0 15px;color:#666464;position:relative}.insert-study-offer-info,.insert-study-offer-description{position:relative;font-size:13px;line-height:1.65;color:#545454}.insert-study-offer-info{padding:15px}.insert-study-body{height:615px;overflow:hidden}.insert-study-offer-description{padding:15px 0;margin:15px 15px 0;border-top:1px solid #dfdfdf;font-size:10px}.insert-study-offer-info-header{font-size:24px}.insert-study-offer-info-subheader,.insert-study-offer-info-subheader a{font-size:11px;color:#b8b8b8}.insert-study-offer-info-logo{position:absolute;right:15px;max-width:150px;max-height:30px}.insert-study-subscribe-button,.insert-study-button,.insert-study-subscribe-button:hover,.insert-study-button:hover,.insert-study-subscribe-button:active,.insert-study-button:active,.insert-study-subscribe-button:visited,.insert-study-button:visited{display:inline-block;padding:5px 17px;margin:16px 0 6px;font-size:12px;font-weight:700;background:#00b2d0;border:1px solid #00a8c4;color:#fff;cursor:pointer;margin-right:15px}.insert-study-offer-info-screenshots img{width:184px;margin:8px 16px 8px 0;border:1px solid #dce1e6}.scrollbar .insert-study-offer-info-screenshots img{width:179px}.insert-study-offer-info-screenshots a:last-child img{margin-right:0}.insert-study-header .header-text{font-weight:700;font-size:14px;padding:20px 0 8px 28px}.insert-study-header .tv-dialogs-label-hint{margin-left:4px;position:relative;top:2px}table.quote-bar{width:100%;text-align:center;white-space:nowrap}tr.quote-bar{height:26px}td.quote-bar{border:1px solid #ddd}.quote-bar.header{background-color:silver;font-weight:700}.quote-bar.data-row{font-family:verdana;font-size:9pt}.quote-bar.data-row.odd{background-color:#0ff}div.background-blur{width:100%;height:100%;position:absolute;left:0;top:0;opacity:.5;background-color:#fff;z-index:1000;display:none}div.missed-connection{width:500px;height:300px;color:#fff;background-color:red;font-size:36pt;text-align:center;vertical-align:middle;position:absolute;left:50%;top:50%;margin-left:-250px;margin-top:-150px;padding-top:50px;display:none}div.critical-error{width:500px;height:300px;color:#fff;background-color:red;font-size:36pt;text-align:center;vertical-align:middle;position:absolute;left:50%;top:50%;margin-left:-250px;margin-top:-150px;padding-top:50px;display:none}.loading-indicator{width:100%;height:100%;position:absolute;z-index:150;background:#fff}.loading-indicator img{position:absolute;top:50%;left:50%;margin:-58px 0 0 -58px}.loading-indicator img.small{margin:-12px 0 0 -12px}.ui-slider-horizontal{margin:7px 0 0;background:#f4f7f9!important;background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-o-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:linear-gradient(top,#f2f7fa,#f4f7f9)!important;border:1px solid #c9cbcd!important;height:5px!important;box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.ui-slider-handle{width:15px!important;height:15px!important;background:url(images/icons.png) -20px -80px!important;border:0!important;top:-5px!important;margin-left:-7px!important;z-index:0!important}.ui-slider-horizontal.linewidth-slider{width:101px;margin:7px 10px;background:url(images/dialogs/linewidth-slider.png) 0 0 no-repeat!important;height:12px!important;border:0!important;box-shadow:none;display:inline-block;vertical-align:middle}.ui-slider-horizontal.linewidth-slider:before,.ui-slider-horizontal.linewidth-slider:after{content:none}.ui-slider-horizontal.transparency-slider{width:99px;height:8px!important;margin:7px 10px;background:url(images/dialogs/opacity-slider.png)!important}.ui-slider-horizontal.transparency-slider .gradient{width:100%;height:100%;position:absolute;top:0;left:0;background:-moz-linear-gradient(left,transparent 0,#7db9e8 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,transparent),color-stop(100%,#7db9e8));background:-webkit-linear-gradient(left,transparent 0,#7db9e8 100%);background:-o-linear-gradient(left,transparent 0,#7db9e8 100%);background:-ms-linear-gradient(left,transparent 0,#7db9e8 100%);background:linear-gradient(to right,transparent 0,#7db9e8 100%)}.ui-slider-horizontal.linewidth-slider .ui-slider-handle,.ui-slider-horizontal.transparency-slider .ui-slider-handle{width:20px!important;height:20px!important;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABvElEQVR42r1U2U7CUBD1D9V36oP4R/AHrmFRChFsQSExKihtFB804oOJLAXKcllEifU6pwkEuYVQH2hykpuZOZNZTmdtZV+11vDk8gWfnEgrh+GEBsjxtHJ9e++rGA1p6USs29tQzq9294OnL4QWYUj4BvCGDT7EMNbbWJisVm9uByJKlggsJCctrfDMS4bJO70P3uoO7Dds8CEGscTxzqtsPXCi3KCKi8s73mJ9PhqNHAEfYij2kzhZ4oqVpjJZtNmhwB+QlsA4KUP7MwswPZhLUFatRZWJlQ44OOD+WVROe/Rh2PmHJwS6gkYc4rZJEf5JwihJA/MoVU2B8PpW5uFoioeiSbwF/3u1wcENykl1khAaI6OFbc4QkAwEG+FYSvC3afvgHh0ndLcJUaXg7/SHdsKDUFyfblm1Wzbmtgw4tlwmji2fiKpOL8WPpUC0bpcCjrAUo2ZKY9k0/yebIslmy0nYDGJ1KewuCXvP8SjgN8I8XPx6X8TJEXdz3nHwjo8D6cqC0KFNbB/AG7aZ47Cz7PkqYtiomGABeMMGH9pErJsDK2FzMkmKdKpTa3rsLKPSgfVXjLq0skv/C1tGuRhzjqXzAAAAAElFTkSuQmCC) 0 0 no-repeat!important;top:50%!important;margin:-10px 0 0 -10px!important}.falling,.growing,.index-charts-tab .item .symbol-last.growing,.index-charts-tab .item .symbol-last.falling,.quotes-item .symbol-last.growing,.quotes-item .symbol-last.falling,.search-results .symbol-last.growing,.search-results .symbol-last.falling,.viewchart-column-main .symbol-quote .symbol-last.growing,.viewchart-column-main .symbol-quote .symbol-last.falling,.search-additional-info .symbol-quote .symbol-last.growing,.search-additional-info .symbol-quote .symbol-last.falling{color:#fff}.growing{background:#298755}.falling{background:#da563e}.font-awesome{font-weight:700;font-family:FontAwesome}@media (orientation:landscape){html.ipad.ios7,html.ipad.ios7 body{position:fixed;bottom:0;width:100%;height:672px!important}}.common-tooltip-wrapper{position:fixed;margin:2px 0;pointer-events:none;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;-ms-transition:opacity .15s linear;transition:opacity .15s linear;z-index:200}.common-tooltip-wrapper.vertical{margin:0 2px}.common-tooltip-wrapper.farther{margin:8px 0}.common-tooltip-wrapper.farther.vertical{margin:0 8px}.common-tooltip-wrapper.no-pointer-events{margin:8px 0}.common-tooltip-wrapper.no-pointer-events.vertical{margin:0 8px}.common-tooltip-wrapper.no-pointer-events.farther{margin:14px 0}.common-tooltip-wrapper.no-pointer-events.farther.vertical{margin:0 14px}.common-tooltip-wrapper .common-tooltip-body{position:relative;padding:7px 9px;background-color:#000;color:#fff;border:#fff 1px solid;font-size:11px;font-weight:600;white-space:pre}.common-tooltip-wrapper:before,.common-tooltip-wrapper:after{content:"";display:block;position:absolute;width:0;height:0}.common-tooltip-wrapper.below:before{top:-7px;left:50%;margin-left:-8px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-bottom:#fff 8px solid}.common-tooltip-wrapper.below:after{top:-5px;left:50%;margin-left:-6px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-bottom:#000 6px solid}.common-tooltip-wrapper.above:before{bottom:-7px;left:50%;margin-left:-8px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-top:#fff 8px solid}.common-tooltip-wrapper.above:after{bottom:-5px;left:50%;margin-left:-6px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-top:#000 6px solid}.common-tooltip-wrapper.otr:before{left:-7px;top:50%;margin-top:-8px;border-top:transparent 8px solid;border-bottom:transparent 8px solid;border-right:#fff 8px solid}.common-tooltip-wrapper.otr:after{left:-5px;top:50%;margin-top:-6px;border-top:transparent 6px solid;border-bottom:transparent 6px solid;border-right:#000 6px solid}.common-tooltip-wrapper.otl:before{right:-7px;top:50%;margin-top:-8px;border-top:transparent 8px solid;border-bottom:transparent 8px solid;border-left:#fff 8px solid}.common-tooltip-wrapper.otl:after{right:-5px;top:50%;margin-top:-6px;border-top:transparent 6px solid;border-bottom:transparent 6px solid;border-left:#000 6px solid}.footer-sponsored-by{display:none}.sp-active .footer-sponsored-by{display:block}#chart-area .onchart-sponsored-by,#chart-container .onchart-sponsored-by{display:none}.sp-active #chart-area .onchart-sponsored-by,.sp-active #chart-container .onchart-sponsored-by{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;position:absolute;bottom:55px;left:10px;padding:0 6px;width:0;background-color:rgba(255,255,255,.5);overflow:hidden;opacity:0;-webkit-transition:width .5s ease-in-out;-moz-transition:width .5s ease-in-out;-o-transition:width .5s ease-in-out;-ms-transition:width .5s ease-in-out;transition:width .5s ease-in-out}.sp-active #chart-area .onchart-sponsored-by.expanded,.sp-active #chart-container .onchart-sponsored-by.expanded{width:129px;opacity:1}.sp-active #chart-area .onchart-sponsored-by>img,.sp-active #chart-container .onchart-sponsored-by>img{width:117px;height:35px}.sp-active #chart-container .onchart-sponsored-by{bottom:30px}.tv-dialog.popup-exante{max-width:500px}.tv-dialog.popup-exante .tv-dialog-title .tv-dialog-title-close{top:5px;right:5px}.tv-dialog.popup-exante .tv-dialog-content{background:#fff url(images/exante-logo-popup-bg.png) left -20px bottom -30px no-repeat;font-size:13px}.tv-dialog.popup-exante .tv-dialog-content .message{padding:35px 20px 20px}.tv-dialog.popup-exante .tv-dialog-content .actions-block{padding:10px 20px 20px;text-align:right}.tv-dialog.popup-exante .tv-dialog-content .actions-block *{display:inline-block;line-height:30px;white-space:nowrap}.tv-dialog.popup-exante .tv-dialog-content .actions-block .no-button{margin-right:30px;cursor:pointer}.tv-dialog.popup-exante .tv-dialog-content .actions-block .yes-button{background-color:#00b8d6;color:#fff;text-transform:uppercase;font-weight:600;padding:0 15px}.tv-dialog.popup-exante .tv-dialog-content .actions-block .yes-button:hover{background-color:#00c6e7}.decks .ad-pack .left-column,.decks .ad-pack .right-column{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:50%;vertical-align:top}.decks .ad-pack .left-column{padding-right:13px}.decks .ad-pack .right-column{padding-left:13px}.decks .ad-pack table{width:100%;margin-bottom:30px}.decks .ad-pack table td{padding:10px 0}.decks .ad-pack table td:last-child{width:75%}.decks .ad-pack table td:last-child textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:80px}.tv-dialog-shadowbox{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.5);z-index:120;-webkit-transform:translate3d(0,0,0)}.tv-dialog-shadowbox.transparent{background:0 0}.tv-dialog{position:absolute;max-width:95%;min-height:18px;left:50%;top:50%;background:#fff;border:1px solid #c9cbcd;box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.tv-dialog.tv-dialog-min-width{min-width:400px}.tv-dialog.ui-resizable{position:absolute}.tv-dialog-title{color:#4c4848;font-weight:700;font-size:15px;padding:17px 35px 17px 20px;cursor:default}.tv-dialog-title.tv-dialog-title-no-close{padding-right:20px}.tv-dialog-title.tv-dialog-title-hidden{padding:0}.tv-dialog-title .tv-dialog-title-minimize,.tv-dialog-title .tv-dialog-title-close{width:21px;height:21px;display:block;position:absolute;right:15px;top:13px;cursor:pointer}.tv-dialog-title .tv-dialog-title-minimize:after,.tv-dialog-title .tv-dialog-title-close:after{width:9px;height:9px;content:" ";position:absolute;top:6px;left:6px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAASCAYAAACJgPRIAAAAUElEQVR42pWQMQoAIAwD++d+x8HJbyoOWXJDSSBgwpVS62vtc8ulXg/ZAZkFMycNoBJgXoUcX1cm9N1NSL0esgMyC2ZOGkAlwLwKObhu/qcHp/zWImEdH8EAAAAASUVORK5CYII=);display:block}.tv-dialog-title .tv-dialog-title-minimize:hover:after,.tv-dialog-title .tv-dialog-title-close:hover:after{background-position:center bottom}.tv-dialog-title .tv-dialog-title-minimize:after{background:url(images/dialogs/minimize-flat.gif)}.tv-dialog-content{color:#595959;max-width:100%}.tv-dialog-content .main{padding:0 20px 20px}.tv-dialog-content .main p:first-child{margin-top:0}.tv-dialog-content .main p:last-child{margin-bottom:0}.tv-dialog-content .main-signup{padding:20px 15px 15px}.tv-dialog-content .main-tree{padding:0}.tv-dialog-content .main-properties,.tv-dialog-content .alert-dialog-content{padding:25px}.tv-dialog-content .main-properties.main-properties-aftertabs,.tv-dialog-content .alert-dialog-content.main-properties-aftertabs,.tv-dialog-content .main-properties.alert-aftertabs,.tv-dialog-content .alert-dialog-content.alert-aftertabs{padding-top:5px}.tv-dialog-content .main-properties.main-properties-tabless,.tv-dialog-content .alert-dialog-content.main-properties-tabless{padding-top:40px}.tv-dialog-content .alert-dialog-content{padding-top:10px}.tv-dialog-content .properties-separator{border-bottom:1px solid #c9cbcd}.tv-dialog-content table.tv-dialog-form{width:100%}.tv-dialog-content .tv-dialog-form td{vertical-align:middle;padding:3px 5px;color:#595959}.tv-dialog-content .tv-dialog-form td img{vertical-align:middle}.tv-dialog-content .tv-dialog-chart-container{height:220px;border:1px solid #828282}.tv-dialog-content .tv-dialog-termsofservice{width:390px;height:80px;border:1px solid #999;padding:5px;margin:0 0 10px}.tv-dialog-content .tv-dialog-termsofservice .content{width:100%;height:100%;overflow:auto}.tv-dialog-content .tv-dialog-checkbox-mask{width:18px;height:16px;position:absolute;top:2px;left:2px;background:url(images/dialogs/checkbox.png) 0 0}.tv-dialog-content .tv-dialog-checkbox-mask.radio{background:#fff url(images/icons.png);background-position:-100px -140px;width:16px}.tv-dialog-content .tv-dialog-checkbox-mask.disabled{background-position:0 -32px}.tv-dialog-content .tv-dialog-checkbox-mask-active{background:url(images/dialogs/checkbox.png) 0 -16px}.tv-dialog-content .tv-dialog-checkbox-mask-active.radio{background-position:-120px -140px}.tv-dialog-content .tv-dialogs-label-hint{position:relative;top:1px;margin:-1px 5px 0}.tv-dialogs-label-hint{width:14px;height:14px;padding:0;display:inline-block;border-radius:14px;background:url(images/help/help-icon.png) no-repeat center center}.tv-dialog-content form input[type=text],.tv-dialog-content form input[type=password],.tv-dialog-text-input{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:33px;border:1px solid #c9cbcd;margin:1px;padding:0 5px;background:#fff;color:#65676a}.tv-dialog-content form input[type=text]:disabled,.tv-dialog-content form input[type=password]:disabled,.tv-dialog-text-input:disabled{opacity:.5}.tv-dialog-content .alert-dialog-content input[type=text],.tv-dialog-content .alert-dialog-content input[type=password],.tv-dialog-content .tv-dialog-text-input{height:27px}.tv-dialog-text-input.disabled{color:#909292!important}.tv-dialog-content form input[type=text].error,.tv-dialog-content form input[type=password].error{margin:0;border:2px solid #de5764;background:#f7e4e6;color:#e06571}.tv-dialog-content textarea{color:#5a5a5a;font:12px/18px Arial,sans;border:1px solid #c9cbcd;padding:8px 5px;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-content form input.prompt-value{margin-top:15px}.tv-dialog-content form input.tv-dialog-content-textactive,.tv-dialog-text-input:focus{background:#fff;border-color:#4c82ce;color:#595959}.tv-dialog-text-input.tv-dialog-text-input-error{background:#fff;border-color:#d75442;color:#595959}.tv-dialog-content textarea{border:1px solid #c9cbcd;background:#fff}.tv-dialog-content textarea.tv-dialog-content-textareaactive{color:#595959;border-color:#4c82ce}.tv-dialog-content .tv-dialog-button-big{color:#576069;padding:10px 16px;border-radius:4px;font-weight:700;border:2px solid #a4a4a4;background:url(images/dialogs/big-button-bg.png)}.tv-dialog-content .tv-dialog-button-big:hover{background-position:0 -38px}.tv-dialog-content .tv-dialog-button-big:active{background-position:0 -76px}.tv-dialog-content .tv-dialog-button{color:#576069;padding:2px 12px;border-radius:4px;font-weight:700;border:1px solid #a4a4a4;background:url(images/dialogs/button-bg.png)}.tv-dialog-content .tv-dialog-button:hover{background:url(images/dialogs/big-button-bg.png);background-position:0 -48px}.tv-dialog-content .tv-dialog-button:active{background:url(images/dialogs/big-button-bg.png);background-position:0 -76px}.tv-dialog-content .tv-dialog-button-blue{cursor:default;background:#00b8d6;color:#fff;padding:5px 15px;font-size:12px;font-weight:700;height:15px;display:block}.tv-dialog-content .tv-dialog-button-blue:hover{background:#00c6e7}.tv-dialog-content .tv-dialog-button-blue:active{background:#00c6e7}.tv-dialog-content .caption{font-size:11px;color:#576069;margin-bottom:3px;margin-top:7px;font-weight:700}.tv-dialog-content .caption.half{float:left;width:50%}.tv-dialog-content .caption-text{font-size:12px;color:#576069;margin:5px 0 0;position:relative}.tv-dialog-content .caption-big{font-size:12px;color:#576069;margin:15px 0}.tv-dialog-content .caption-big-center{font-size:12px;color:#576069;margin:15px 0;text-align:center}.tv-dialog-content .caption-big-center.slim{margin:0;text-align:left}.tv-dialog-content .caption.first{margin-top:0}.tv-dialog-content .empty-caption{height:7px}.publish-dialog .tv-dialog-content .publish-text.autowidth textarea{width:100%;margin:0}.publish-dialog .tv-dialog-content .publish-text.jsfluid{height:175px}.publish-dialog .tv-dialog-content .publish-text.jsfluid textarea{height:100%;margin:0}.publish-dialog .tv-dialog-content .publish-text textarea{width:658px;height:175px}.publish-dialog .tv-dialog-content .published-text textarea{width:360px}.tv-dialog-content .tv-dialog-captcha-row input{float:left}.tv-dialog-content .tv-dialog-captcha{height:31px;float:left;margin:0 0 0 5px}.tv-dialog-content .instruct{background:#eaf3fb;border:1px solid #d1dee9;padding:10px;margin:0 0 10px;font-size:12px;line-height:15px;border-radius:2px}.tv-dialog-content .tv-dialogs-bottom{padding:12px 10px;color:#bdbdbd;font-size:12px}.tv-dialog-content .tv-dialogs-bottom .text-top{margin:0 0 5px;color:#595959}.tv-dialog-content .tv-dialogs-bottom .text{margin:8px 0 0;color:#9a9a9a;font-style:italic}.tv-dialog-content .tv-dialogs-bottom a{text-decoration:underline}.tv-dialog-content .tv-dialogs-bottom-signup{padding:20px 40px 20px 150px}.tv-dialog-content .tv-dialogs-bottom-button{margin:24px 0 0;height:31px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to{color:#858181;font-size:10px;height:31px;padding:0 1px 0 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input{display:none}.tv-dialog-content .tv-dialogs-bottom-button .repost-to .repost-to-label{float:left;padding:8px 10px 0;height:21px;white-space:nowrap;border:solid #c9c9c9;border-width:1px 0 1px 1px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label{float:left;width:35px;height:29px;background:#f1f1f1;border:solid #c9c9c9 1px;margin:0 -1px 0 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label:hover{background:#fff}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label .icon{display:block;background:url(images/icons.png) 100px 100px no-repeat}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label.repost-to-twitter .icon{width:22px;height:18px;background-position:-50px -320px;margin:6px auto 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-twitter{background:#9adff6;border-color:#72c3de;position:relative}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-twitter .icon{background-position:-75px -320px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label.repost-to-stocktwits .icon{width:22px;height:14px;background-position:0 -320px;margin:8px auto 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-stocktwits{background:#f6b09a;border-color:#de8672;position:relative}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-stocktwits .icon{background-position:-25px -320px}.tv-dialog-readbefore{border-bottom:dashed #858181 1px;cursor:pointer;margin:0 0 0 10px}.tv-dialog-readbefore a{font-weight:400;font-size:10px;color:#858181}.tv-dialog-title .tv-dialog-readbefore{position:relative;top:-3px}.tv-dialog-title .tv-dialog-readbefore a{position:relative;top:2px}.tv-dialog-content .tv-dialogs-bottom-button #publish-dialog-do-publish{height:16px;padding-top:7px;padding-bottom:6px}.tv-dialog-content .caption-text input[type=checkbox]{visibility:hidden}.tv-dialogs-name{margin-top:13px;margin-bottom:4px;vertical-align:middle}.auth-dialog .page{display:none}.auth-dialog .page.active{display:block}.auth-dialog .main{padding:0 28px;width:402px}.auth-dialog .main .auth-dialog-socials{margin:19px 0;overflow:hidden}.auth-dialog .main .auth-dialog-socials a{cursor:pointer;float:left;width:32%;min-width:35px;height:17px;margin:1%;padding:11px 0;background:#999;color:#fff;text-align:center;font-size:14px;line-height:17px}.auth-dialog .main .auth-dialog-socials a:nth-child(3n - 2){margin-left:0}.auth-dialog .main .auth-dialog-socials a:nth-child(3n){margin-right:0}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-facebook{background:#38569a}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-facebook:hover{background:#4c67a4}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-twitter{background:#06b1cd}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-twitter:hover{background:#1fbad3}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-google{background:#4587f7}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-google:hover{background:#5893f7}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-stocktwits{background:#8a1100}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-stocktwits:hover{background:#97291a}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-linkedin{background:#327eae}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-linkedin:hover{background:#488bb6}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-yahoo{background:#851e8d}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-yahoo:hover{background:#913599}.auth-dialog .main .auth-dialog-separator{position:relative;overflow:hidden;height:15px;text-align:center;margin:39px 0 34px}.auth-dialog .main .auth-dialog-separator-copy{display:inline-block;position:relative;height:15px;padding:0 17px;font-size:12px;line-height:15px;color:#a4a7ab;vertical-align:top;text-transform:uppercase}.auth-dialog .main .auth-dialog-separator-copy::before,.auth-dialog .main .auth-dialog-separator-copy::after{content:" ";position:absolute;top:7px;height:0;border-top:solid 1px #dbdfe4;width:200px}.auth-dialog .main .auth-dialog-separator-copy::before{margin:0 100% 0 0;right:0}.auth-dialog .main .auth-dialog-separator-copy::after{margin:0 0 0 100%;left:0}.auth-dialog .main form .auth-dialog-field{display:block;position:relative;margin:17px 0}.auth-dialog .main form .auth-dialog-field .auth-dialog-field .auth-dialog-field-placeholder,.auth-dialog .main form .auth-dialog-field .auth-dialog-field input{cursor:text;font-size:14px}.auth-dialog .main form .auth-dialog-field input{vertical-align:top;width:100%;border:solid 1px #e1e7ef;background:#e1e7ef;line-height:17px;padding:0 9px;height:41px;color:#26282f;margin:1px 0}.auth-dialog .main form .auth-dialog-field input:hover{background:#e4e9f1}.auth-dialog .main form .auth-dialog-field input:focus,.auth-dialog .main form .auth-dialog-field input.tv-dialog-content-textactive{background:#f4f7fa;border-color:#e1e7ef}.auth-dialog .main form .auth-dialog-field input.error{border-color:#b92f2f}.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder{pointer-events:none;position:absolute;left:11px;top:13px;color:#8891a3}.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder.disabled{display:none}.auth-dialog .main form .auth-dialog-field input:focus+.auth-dialog-field-placeholder{display:none}.auth-dialog .main form .auth-dialog-field input.empty:focus+.auth-dialog-field-placeholder{display:block;color:#a8b1c3}.auth-dialog .main form .auth-dialog-group{overflow:hidden;margin:21px 0}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember{cursor:pointer}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo{position:relative;display:inline-block;height:16px;width:16px;vertical-align:top;overflow:hidden}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo input{position:absolute;visibility:hidden;padding:0;margin:0;width:100%;height:100%}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo input:checked+.auth-dialog-remember-view{background-position:0 -16px}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-view{display:block;width:16px;height:16px;background:url(data:image/gif;base64,R0lGODlhEAAgAPABAF24iP///yH5BAUAAAEALAAAAAAQACAAAAI9hI+pq+EPHYo0zAovlmc/vYGYWJGUGaFZ51nMC8fyrH6sV3OGrfUJDwDudEHi0HVsEIVFZDN0gx6ltKqhAAA7) 0 0 no-repeat}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-text{font-size:12px;line-height:16px;vertical-align:top;color:#8891a3;margin:0 0 0 6px}.auth-dialog .main form .auth-dialog-group .auth-dialog-recover{cursor:pointer;float:right;font-size:12px;line-height:16px;vertical-align:top}.auth-dialog .main form .auth-dialog-submit{margin:34px 0 29px}.auth-dialog .main form .auth-dialog-submit button{cursor:pointer;display:block;margin:0 0 0 auto;border:0;padding:0;height:47px;width:162px;font-size:14px;line-height:normal;text-align:center;font-weight:700;text-transform:uppercase;background-color:#1fb2cc;color:#fff}.auth-dialog .main form .auth-dialog-submit button::-moz-focus-inner{border:0;padding:0}.auth-dialog .main form .auth-dialog-submit button:hover{background:#1eb9d2}.auth-dialog .main form .auth-dialog-submit button.process{background-image:url(images/button-base-process.gif)}.auth-dialog .main form .auth-dialog-notice{color:#8891a3;font-size:12px;line-height:14px;margin:-3px 3px -6px 3px}.auth-dialog .main form .auth-dialog-notice p{margin:0}.auth-dialog .main .auth-dialog-footnote{display:none}.auth-dialog h2{display:none;color:#26282f;font-size:26px;font-weight:400;margin:24px 0 19px;text-transform:uppercase}.auth-dialog h2.recover{display:block}.auth-dialog .properties-tabs-label{color:#26282f;font-size:26px;text-transform:uppercase}.auth-dialog .properties-tabs-label.active{font-weight:400!important}.tv-dialog-text-content{font-size:12px}.tv-dialog-text-content ul{margin:7px 0;padding:0}.tv-dialog-text-content ul li{list-style:none;background:url(images/index/bullet.png) 0 3px no-repeat;padding:0 0 0 15px}.tv-dialog-text-content ul.spacious{margin-left:12px}.tv-dialog-text-content ul.spacious li{padding-right:20px;margin:5px 0}.tv-dialog-text-content h3{margin:15px 0 7px}.tv-dialog-text-content p{margin:7px 0}.tv-dialog-text-content .standsout-link{background:#ededed;padding:10px 21px;display:inline-block;margin:0 auto}.tv-dialog-content .small-text{color:#9a9a9a;font-size:11px;padding:5px 0}.tv-dialog-content .input input{width:298px!important}.tv-dialog-content .dual-input{margin:7px 0}.tv-dialog-content .dual-input input{width:138px!important;float:right}.tv-dialog-content .dual-input input:first-child{float:left}.tv-dialog-content .input{margin-bottom:7px}.tv-dialog-content .dual{margin:8px 1px 2px}.tv-dialog-content .dual .left{float:left;text-align:left;width:50%}.tv-dialog-content .dual .left.checkbox{margin:3px 0 0}.tv-dialog-content .dual .right{float:right;text-align:right;width:50%}.tv-dialog-content .dual .tv-button{padding:5px 30px}.tv-dialog-content .big-button .tv-button{padding:10px 50px;background:#fff}.tv-dialog-content .big-button .tv-button:hover{background:#fcfcfc}.tv-dialog-content label{color:#595959}.no-drawings{width:450px;color:#8f8f8f;font-style:italic;text-align:center}.no-drawings:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.main-tree-container{position:relative;width:450px;border-top:#e5e4e4 1px solid}.no-top-border .main-tree-container{border-top:0}.main-tree-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.main-tree-container .sb-scrollbar-top,.main-tree-container .sb-scrollbar-bottom{display:none}.main-tree-container .main-tree-wrap{position:absolute;width:100%}.tv-dialog-title .button-filter,.properties-tabs-label .button-filter{display:inline-block;position:relative;width:21px;height:16px;vertical-align:top;margin:3px 0 0 10px}.tv-dialog-title .button-filter:before,.properties-tabs-label .button-filter:before,.tv-dialog-title .button-filter:after,.properties-tabs-label .button-filter:after{content:'';position:absolute;top:50%}.tv-dialog-title .button-filter:before,.properties-tabs-label .button-filter:before{left:0;margin-top:-5px;width:12px;height:10px;background-image:url(images/icons.png);background-position:-61px -462px}.tv-dialog-title .button-filter:after,.properties-tabs-label .button-filter:after{right:0;width:0;margin-top:-1px;height:0;border-color:#929393;border-width:3px;border-style:solid;border-bottom:0;border-left-color:transparent!important;border-right-color:transparent!important}.tv-dialog-title .button-filter:hover:before,.properties-tabs-label .button-filter:hover:before{background-position:-78px -462px}.tv-dialog-title .button-filter:hover:after,.properties-tabs-label .button-filter:hover:after{border-color:#666769}.tv-dialog-title .button-filter:active:before,.properties-tabs-label .button-filter:active:before,.tv-dialog-title .button-filter.active:before,.properties-tabs-label .button-filter.active:before{background-position:-95px -462px}.tv-dialog-title .button-filter:active:after,.properties-tabs-label .button-filter:active:after,.tv-dialog-title .button-filter.active:after,.properties-tabs-label .button-filter.active:after{border-color:#49b5d6}.properties-tabs-label .button-filter{visibility:hidden}.properties-tabs-label.active .button-filter{visibility:visible}.tv-dialog-tree-group.empty{display:none}.tv-dialog-content .tv-dialog-tree-head{border-top:1px solid #c9cbcd;content:"";cursor:default}.tv-dialog-content .tv-dialog-tree-item{display:block;color:#3e4040;padding:2px 0 0 21px;position:relative;border-bottom:1px solid #f4f7f9;height:34px;cursor:pointer}.tv-dialog-content .tv-dialog-tree-item .name{display:inline-block;margin-top:7px;vertical-align:top;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:250px}.tv-dialog-content .tv-dialog-tree-item .symbol{display:inline-block;margin-top:7px;vertical-align:top}.tv-dialog-content .tv-dialog-tree-item .tree-icon-container{position:absolute;right:15px;top:6px}.tv-dialog-content .tv-dialog-tree-item:hover{background:#f7f9fb}.tv-dialog-content .tv-dialog-tree-item:hover .tree-icon-container{display:inline-block}.tv-dialog-content .tv-dialog-tree-item.active .tree-icon-container{display:inline-block}.tv-dialog-content .tv-dialog-tree-item.hidden{color:#969898}.tv-dialog-content .tv-dialog-tree-item.hidden .button.icon-hide .icon{background-position:-14px 14px}.tv-dialog-content .tv-dialog-tree-item .button.icon-hide .icon{background-position:-14px -28px}.tv-dialog-content .tv-dialog-tree-item.locked .button.icon-lock .icon{background-position:-71px -14px}.tv-dialog-content .tv-dialog-tree-item .button.icon-lock .icon{background-position:-71px -28px}.tv-dialog-content .tv-dialog-tree-item.active{background:#f1f3f6}.tv-dialog-content .tv-dialog-tree-item.active .name{font-weight:700}.tv-dialog-content .tv-dialog-tree-item.last{border-bottom:0}.tv-dialog-content .tv-dialog-tree-item.last .button.down{display:none}.tv-dialog-content .tv-dialog-tree-item.first .button.up{visibility:hidden}.tv-dialog-content .tv-dialog-tree-item.objects .name-column{width:80%}.tv-dialog-content .tv-dialog-tree-item .name-column{width:55%;display:inline-block}.tv-dialog-content .tv-dialog-tree-item .instrument{display:inline-block;margin-left:6px}.tv-dialog-content .tv-dialog-tree-item .instrument.linetool{width:30px;height:30px;background:url(images/sidetoolbar/instruments.png) no-repeat}.tv-dialog-content .tv-dialog-tree-item .instrument.series{width:19px;height:19px;margin-top:5px;background:url(chart-client/css/images/bartype-icons.png) no-repeat}.tv-dialog-content .tv-dialog-tree-item .instrument.lineicon{font-weight:700;font-family:FontAwesome;padding-top:7px;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#777;font-size:19px}.tv-dialog-content .tv-dialog-tree-item.skipped{display:none}.tv-dialog-content .with-drawings .tv-dialog-tree-item{padding-left:25px}.tv-dialog-content .tv-dialog-tree-item.hidden .instrument{opacity:.6}.tv-dialog-content .tv-dialog-tree-item .button{display:inline-block;width:22px;height:22px;margin:0 0 0 3px;cursor:pointer;padding:1px 0 0 4px;opacity:.5;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-content .tv-dialog-tree-item .button:hover{opacity:1}.tv-dialog-content .tv-dialog-tree-item .button:hover:before{display:none!important}.tv-dialog-content .tv-dialog-tree-item .button.hidden{visibility:hidden}.tv-dialog-content .tv-dialog-tree-item.active .button{opacity:.7}.tv-dialog-content .tv-dialog-tree-item.active .button:hover{opacity:1}.tv-dialog-content .tv-dialog-tree-item .icon{background:url(images/dialogs/objects-tree.png);width:14px;height:14px;display:inline-block;margin-top:-1px}.feature-touch .tv-dialog-content .tv-dialog-tree-item .icon{-webkit-transform:scale(1.1);transform:scale(1.1)}.tv-dialog-tree-item .button.delete .icon{background-position:0 -28px}.tv-dialog-tree-item .button.delete:active .icon{background-position:0 14px}.tv-dialog-tree-item .button.up .icon{background-position:-42px -28px}.tv-dialog-tree-item .button.up:active .icon{background-position:-42px 14px}.tv-dialog-tree-item .button.down .icon{background-position:-28px -28px}.tv-dialog-tree-item .button.down:active .icon{background-position:-28px 14px}.tv-dialog-tree-item .button.format .icon{background-position:-56px -28px}.tv-dialog-tree-item .button.format:active .icon{background-position:-56px 14px}.tv-dialog-tree-item-list-header{height:24px;padding:3px 0 0 25px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-tree-item-list-header .item{display:inline-block;font-size:11px}.tv-dialog-tree-item-list-header .item .label:hover,.tv-dialog-tree-item-list-header .item .label.active{color:#68696b}.tv-dialog-tree-item-list-header .item .label.active{font-weight:700}.tv-dialog-tree-item-list-header .item .label{cursor:pointer;color:#989797}.tv-dialog-tree-item-list-header .tool{width:55%}.main-tree-page{display:none}.main-tree-page.active{display:block}.main-tree-page.compare{padding:22px 28px}.tv-dialog-content .tv-dialog-small{font-size:11px}.tv-dialog-content .tv-dialog-medium{font-size:13px}.tv-dialog-content .tv-dialog-left{text-align:left}.tv-dialog-content .tv-dialog-center{text-align:center}.tv-dialog-content .tv-dialog-right{text-align:right}.tv-dialog-content .tv-dialog-float-right{float:right}.tv-dialog-content td.tv-dialog-vtop{vertical-align:top}.tv-dialog-content .tv-dialog-relative{position:relative}.tv-dialog-content .tv-dialog-field-error{display:none;font-size:11px;color:#c34c36;border-top:2px solid #fcc;border-right:2px solid #fcc;border-bottom:2px solid #fcc;background:#f8dde0;padding:6px 10px;border-radius:0 3px 3px 0;width:144px;height:14px;float:right}.tv-dialog-error,.tv-dialog-message{display:none;position:absolute;top:10px;font-size:12px;z-index:100;border:1px solid;padding:10px;text-align:center}.tv-dialog-error{color:#c34c36;border-color:#fcc;background:#f8dde0;background:rgba(248,221,224,.8)}.tv-dialog-message{color:#0a8415;border-color:#cfffcc;background:#e2fde1;background:rgba(226,253,225,.8)}.tv-dialog-content .dialog-buttons{text-align:right;margin:10px 7px 0}.tv-dialog-content .dialog-buttons a:not(.tv-dialogs-label-hint){margin:0 0 0 5px;min-width:50px;text-align:center;position:relative;left:7px}.tv-dialog-content .dialog-buttons a.tv-left{left:-7px}.tv-dialog-content .dialog-buttons a.tv-left:not(.tv-dialogs-label-hint){margin:0 5px 0 0}.tv-dialog-content .dialog-buttons a.tv-left.tv-left.tv-dialogs-label-hint{margin-left:0;margin-right:0}.tv-dialog-content .dialog-buttons .tv-dialogs-label-hint{margin-top:7px}.tv-dialog-content .publish-options{color:#595959;height:105px}.tv-dialog-content .publish-option{border:1px solid #d0d3d6;border-radius:4px;position:relative;float:left;padding:10px 10px 10px 32px;width:285px;height:70px;cursor:pointer}.tv-dialog-content .publish-option.active{background:#f9f9f9}.tv-dialog-content .publish-option:last-child{float:right}.tv-dialog-content .publish-option-header{font-weight:700}.tv-dialog-content .publish-option-text{font-size:11px}.publish-radiobutton{background-position:-100px -140px;width:16px;height:16px;position:absolute;top:11px;left:9px}.publish-option.active .publish-radiobutton{background-position:-120px -140px}.tv-dialog-content .dialog-theme-buttons .tv-button{float:left;margin-right:6px}.tv-dialog-content .dialog-trail-checkbox{float:left}.tv-dialog-socials{text-align:right}.tv-dialog-social{display:inline-block;margin:0 0 0 11px;vertical-align:top}.tv-dialog-social-fbshare{margin-top:1px}.publish-direction-buttons{height:33px;margin:0 1px;position:relative}.publish-direction-buttons .col-long,.publish-direction-buttons .col-neutral,.publish-direction-buttons .col-short{height:33px;margin:0 -1px;padding:0 1px}.publish-direction-buttons .col-long{width:33.3%;float:left}.publish-direction-buttons .col-long .tv-button:active,.publish-direction-buttons .col-long .tv-button.active{background:#71db1b;border-color:#66a51c}.publish-direction-buttons .col-neutral{margin:0 33.3%}.publish-direction-buttons .col-neutral .tv-button:active,.publish-direction-buttons .col-neutral .tv-button.active{background:#f0cc00;border-color:#e0a300}.publish-direction-buttons .col-short{width:33.3%;float:right}.publish-direction-buttons .col-short .tv-button:active,.publish-direction-buttons .col-short .tv-button.active{background:#ff6c4a;border-color:#cb401f}.publish-direction-buttons .tv-button{display:block;margin:0 -1px;line-height:31px;height:31px;width:100%;padding:0;text-align:center;background:#fff;text-shadow:0 1px 0 rgba(255,255,255,.4);font-size:14px;border-radius:0}.publish-direction-buttons .tv-button:hover{background:#fff}.publish-direction-buttons .tv-button:active,.publish-direction-buttons .tv-button.active{background:#fff;color:#444!important;box-shadow:none;position:relative}.survey-dialog{box-shadow:0 2px 20px rgba(0,0,0,.4);border-radius:7px;font-size:14px}.survey-dialog .main{padding:20px 25px 15px}.survey-dialog h3{text-align:center;margin:10px 0}.survey-button-container{margin:15px 0 5px!important;text-align:center;position:relative}.survey-dialog .survey-button{font-size:19px;font-weight:700;display:inline-block;border-radius:5px;background:#4387f6;border:1px solid #346bc2;color:#fff;text-align:center;padding:10px 50px}.survey-dialog .survey-button:hover{background:#4d8cf3}.survey-dialog #no-button{position:absolute;top:6px;right:20px;padding:7px 15px;font-size:14px;font-weight:400;border-color:#474549;background:#716e73}.survey-dialog #no-button:hover{background:#767278}.tv-dialog.gopro-dialog .tv-dialog-content{padding:0;position:relative;background:#f2f5f8;width:814px;color:#3b414d;font-size:16px;line-height:28px}.gopro-dialog .col-main{float:left;width:447px;padding:0 22px 0 27px;margin:0 0 85px}.gopro-dialog h2{font-weight:400;font-size:26px;line-height:32px;margin:24px 0 10px;color:#26282f}.gopro-dialog .col-main h2{text-transform:uppercase}.gopro-dialog h2 em{font-style:normal;color:#da4739;text-transform:uppercase}.gopro-dialog .col-main p{margin:15px 0}.gopro-dialog .col-main .actions-block{position:absolute;height:47px;width:447px;left:27px;bottom:24px}.gopro-dialog .col-main .actions-block .no-button{position:absolute;color:#1380b7;left:0;top:8px;cursor:pointer}.gopro-dialog .col-main .actions-block .yes-button{position:absolute;top:0;right:0;font-size:16px;line-height:19px;height:19px;white-space:nowrap;padding:14px 22px;background:#63b68a;color:#fff;text-transform:uppercase;cursor:pointer}.gopro-dialog .actions-block .yes-button:hover{background:#70be95}.gopro-dialog .actions-block .yes-button .arrow-icon{display:inline-block;vertical-align:top;margin:6px -4px 0 21px;width:33px;height:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAHCAYAAACGESREAAAAPklEQVR4AWOgN/j///80IGZlGEjwHwL2AbHwwDkCAe4AsRZEcOAB10CGxC0gVhvI6NgNxIIDmSamAjELshgAEhnDI93qERIAAAAASUVORK5CYII=) 0 0 no-repeat}.gopro-dialog .col-aside{float:left;width:318px;margin:0 0 168px}.gopro-dialog .col-aside .col-bg{position:absolute;width:318px;top:0;bottom:0;right:0;background:#eaeff4 url(images/gopro/dialog-bg.png) 0 100% no-repeat}.gopro-dialog .col-aside .col-copy{position:relative;margin:0 10px 0 28px}.gopro-dialog .col-aside ul{display:block;margin:19px 0 15px;padding:0}.gopro-dialog .col-aside li{display:block;margin:0;padding:0 0 0 21px;line-height:20px;margin:10px 0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAALklEQVR4AWMAgZgdHROB+C0UT0QSbP8PpMEYxAZLQlX9j4VgmIK3OCVwGoXTcgAth09hyVizGQAAAABJRU5ErkJggg==) 3px 7px no-repeat}.go-prorealtime{width:500px}.go-prorealtime .main-properties{padding:5px 0}.go-prorealtime .dialog-buttons{margin:0}.go-prorealtime .dialog-buttons a{margin:0;position:static}.go-prorealtime p:nth-child(1){font-weight:700}.tv-dialog .ui-resizable-handle{width:11px;height:11px;background:url(images/dialogs/resize-handle.png) 0 0 no-repeat}.main.billing-cycle-dialog{padding:0 28px}.bcd-title{font-weight:400;font-size:26px;line-height:32px;margin:24px 0 20px;color:#26282f;text-transform:uppercase}.bcd-subtitle{font-weight:400;font-size:14px;margin:0 0 10px;color:#26282f}.bcd-title.right{width:48%;padding-left:2%}.bcd-choice-container{position:relative;overflow:hidden;background:#e1e7ef}.bcd-choice{position:relative;width:196px;float:left;cursor:pointer;-webkit-tap-highlight-color:transparent}.bcd-choice.active{cursor:default}.bcd-choice.disabled{cursor:default}.bcd-choice-bg{position:absolute;top:0;left:0;width:100%;height:400px}.bcd-choice-marker{position:absolute;top:25px;left:11px;width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAwCAYAAAAYX/pXAAAARUlEQVR4AWM4fOL8f0ow9QxgIBEMNwNGDRg1YOBzY8yOjv8UYOoZQHIgDkcDRg0YNYAcPOgNGC0PcPmXtgaMGjBaHlCCAe5lHJmu4YfrAAAAAElFTkSuQmCC) 0 0 no-repeat}.bcd-choice:hover .bcd-choice-marker{background-position:0 -16px}.bcd-choice.active .bcd-choice-marker{background-position:0 -32px}.bcd-choice.disabled .bcd-choice-marker{background-position:0 0}.bcd-choice-copy{position:relative;padding:5px 3px 30px 44px;font-size:14px;line-height:17px;color:#3b414e}.bcd-choice-copy p{margin:7px 0}.bcd-choice-copy h5{margin:17px 0;color:#4a4d54;font-weight:700;text-transform:uppercase;font-size:18px;line-height:24px}.bcd-choice.disabled .bcd-choice-copy,.bcd-choice.disabled .bcd-choice-copy h5{color:#c3c8cf}.bcd-continue{margin:31px 0 29px;overflow:hidden;text-align:right}.bcd-continue a{cursor:pointer;display:inline-block;vertical-align:top;border:0;padding:15px 45px;font-size:14px;line-height:17px;line-height:normal;text-align:center;font-weight:700;text-transform:uppercase;background:#1fb2cc;color:#fff}.bcd-continue a:hover{background:#1eb9d2}.prorttrial-dialog,.trialconfirm-dialog{font:400 16px Arial,Helvetica,Tahoma,sans-serif;border:0;border-radius:0;box-shadow:none}.prorttrial-dialog .main,.trialconfirm-dialog .main{width:600px;padding:10px 28px 20px}.prorttrial-dialog h3,.trialconfirm-dialog h3{font-size:26px;font-weight:400;text-transform:uppercase;color:#26282f;margin:14px 0 20px}.prorttrial-dialog p,.trialconfirm-dialog p,.prorttrial-dialog li,.trialconfirm-dialog li{font-size:16px;line-height:28px;margin:0}.prorttrial-dialog p,.trialconfirm-dialog p,.prorttrial-dialog ul,.trialconfirm-dialog ul{margin:12px 0}.prorttrial-dialog .big-button,.trialconfirm-dialog .big-button{display:block;width:262px;margin:0 auto;background:#dbe1ea;color:#666c7d;text-transform:uppercase;text-align:center;font-size:14px;line-height:21px;padding:13px 0;text-decoration:none}.prorttrial-dialog .big-button:hover,.trialconfirm-dialog .big-button:hover{background:#e2e7ee}.prorttrial-dialog .big-button.ok,.trialconfirm-dialog .big-button.ok{width:183px;padding-left:20px;padding-right:20px}.prorttrial-dialog .big-button.ok,.trialconfirm-dialog .big-button.ok,.prorttrial-dialog .big-button.trial,.trialconfirm-dialog .big-button.trial{background:#05b2ce;color:#fff}.prorttrial-dialog .big-button.ok:hover,.trialconfirm-dialog .big-button.ok:hover,.prorttrial-dialog .big-button.trial:hover,.trialconfirm-dialog .big-button.trial:hover{background:#37c1d7}.prorttrial-dialog .big-button.ordernow,.trialconfirm-dialog .big-button.ordernow{background:#60b789;color:#fff}.prorttrial-dialog .big-button.ordernow:hover,.trialconfirm-dialog .big-button.ordernow:hover{background:#7fc5a0}.prorttrial-dialog .big-buttons,.trialconfirm-dialog .big-buttons{margin:14px 0 0;overflow:hidden}.prorttrial-dialog .big-buttons.two-buttons .big-button.later,.trialconfirm-dialog .big-buttons.two-buttons .big-button.later,.prorttrial-dialog .big-buttons.two-buttons .big-button.nothanks,.trialconfirm-dialog .big-buttons.two-buttons .big-button.nothanks{margin:0;float:left;width:183px}.prorttrial-dialog .big-buttons.two-buttons .big-button.trial,.trialconfirm-dialog .big-buttons.two-buttons .big-button.trial{margin:0;float:right;width:272px}.prorttrial-dialog .more-controls,.trialconfirm-dialog .more-controls{overflow:hidden;margin:18px 0 0;text-align:right}.prorttrial-dialog .more-controls a,.trialconfirm-dialog .more-controls a{font-size:16px;color:#007fb9;text-decoration:underline}.prorttrial-dialog .actions-block,.trialconfirm-dialog .actions-block{position:relative;margin:30px 0 0;height:47px}.prorttrial-dialog .actions-block .no-button,.trialconfirm-dialog .actions-block .no-button{position:absolute;color:#1380b7;left:0;top:12px;cursor:pointer}.prorttrial-dialog .actions-block .yes-button,.trialconfirm-dialog .actions-block .yes-button{position:absolute;top:0;right:0;font-size:16px;line-height:19px;height:19px;white-space:nowrap;padding:14px 22px;background:#63b68a;color:#fff;text-transform:uppercase;cursor:pointer}.prorttrial-dialog .actions-block .yes-button:hover,.trialconfirm-dialog .actions-block .yes-button:hover{background:#70be95}.tv-dialog-layoutpicker.hidden{display:none}.tv-dialog-cancel-button,.tv-dialog-layout-button{display:inline-block;font-weight:700;font-size:12px;height:16px;margin-right:5px;padding:6px 10px 5px;color:#6f7073;cursor:default;border:1px solid #c9cbcd}.tv-dialog-layout-button .arrow-icon{float:right;margin:5px 0 0 5px;background:url(images/select-bg.png) 0 0 no-repeat;height:5px;width:9px}.tv-dialog-layout-button.open .arrow-icon{background-position:0 -20px}.tv-dialog-layout-button .icon,.tv-dialog-layout-popup .icon{background:url(images/bottomtoolbar/layout-buttons.png) -6px -3px no-repeat;width:17px;height:17px}.tv-dialog-layout-button .icon{float:left;margin:-1px 4px 0 -4px}.charts-popup-list .item.tv-dialog-layout-popup .icon{width:17px;height:17px}.tv-dialog-layout-2h .icon{background-position:-35px -3px}.tv-dialog-layout-2v .icon{background-position:-64px -3px}.tv-dialog-layout-3h .icon{background-position:-93px -3px}.tv-dialog-layout-3v .icon{background-position:-122px -3px}.tv-dialog-layout-3s .icon{background-position:-151px -3px}.tv-dialog-layout-4 .icon{background-position:-180px -3px}.tv-dialog-layout-6 .icon{background-position:-209px -3px}.tv-dialog-layout-8 .icon{background-position:-238px -3px}.tv-dialog-layout-s.active .icon{background-position:-6px -26px}.tv-dialog-layout-2h.active .icon{background-position:-35px -26px}.tv-dialog-layout-2v.active .icon{background-position:-64px -26px}.tv-dialog-layout-3h.active .icon{background-position:-93px -26px}.tv-dialog-layout-3v.active .icon{background-position:-122px -26px}.tv-dialog-layout-3s.active .icon{background-position:-151px -26px}.tv-dialog-layout-4.active .icon{background-position:-180px -26px}.tv-dialog-layout-6.active .icon{background-position:-209px -26px}.tv-dialog-layout-8.active .icon{background-position:-238px -26px}.tv-dialog-cancel-button{border-color:transparent;text-transform:uppercase}.tv-dialog-cancel-button:hover{border-color:#c9cbcd}.publish-dialog-privacy{display:block;padding:7px 5px 8px;background:#25c6e0}.publish-dialog-privacy input{display:none}.publish-dialog-privacy .publish-dialog-privacy-icon{display:block;width:19px;height:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2122px}.publish-dialog-privacy input:checked+.publish-dialog-privacy-icon{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2146px}.publish-dialog-privacy input:active+.publish-dialog-privacy-icon,.publish-dialog-privacy:active .publish-dialog-privacy-icon{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2098px}#publish-chart-form .publish-text input,#publish-chart-form .publish-text textarea{margin:0;display:block}#publish-chart-form .bbcode-buttons{position:relative}#publish-chart-form .bbcode-button{position:relative;z-index:1;float:left;height:29px;width:40px;margin:0 -1px 0 0;border:1px solid #c9cbcd;border-bottom:0;cursor:default}#publish-chart-form .bbcode-button svg{display:block;margin:0 auto;fill:#8e9092}#publish-chart-form .bbcode-button:hover,#publish-chart-form .bbcode-button.active,#publish-chart-form .bbcode-button:active{background:#f2f5f8;border-color:#b5b7b9;z-index:2}#publish-chart-form .bbcode-button:hover svg,#publish-chart-form .bbcode-button.active svg,#publish-chart-form .bbcode-button:active svg{fill:#444}#publish-chart-form .bbcode-button.active svg,#publish-chart-form .bbcode-button:active svg{fill:#5ec6e8}#publish-chart-form .bbcode-embed-block{position:relative;overflow:hidden;float:left}#publish-chart-form .bbcode-embed-block .bbcode-embed-form{transition:top .2s;position:relative;padding:2px 4px 0;top:-30px;left:0}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed{float:left;height:25px;width:250px;margin:0 2px 0 0}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed:focus{border-color:#4c82ce}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed-submit{float:left}#publish-chart-form .bbcode-embed-block .bbcode-embed-form.active{top:0}.tv-dialog.change-interval-dialog .tv-dialog-title{text-align:center;font-size:13px;padding:28px 0 23px}.tv-dialog.change-interval-dialog .tv-dialog-content{padding:0 50px 13px;text-align:center}.tv-dialog.change-interval-dialog .tv-dialog-content .change-interval-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:130px;height:76px;border:#4c82ce 1px solid;text-align:inherit;font-size:43px;color:#545454;text-transform:uppercase}.tv-dialog.change-interval-dialog .tv-dialog-content .change-interval-input.error{border-color:#d75442;background-color:#ffefef}.tv-dialog.change-interval-dialog .tv-dialog-content i{display:block;font-style:normal}.tv-dialog.change-interval-dialog .tv-dialog-content i.interval-caption{margin:8px 0 15px;color:#a8a8a8;font-size:12px;font-weight:600;cursor:default}.tv-dialog.change-interval-dialog .tv-dialog-content i.interval-caption.error{color:#d75442}.tv-dialog.change-interval-dialog .tv-dialog-content i.help-tooltip-trigger{margin:0 auto;width:12px;height:12px;font-size:11px;font-weight:700;line-height:12px;border:rgba(0,0,0,.5) 1px solid;-webkit-border-radius:50%;-webkit-background-clip:padding-box;-moz-border-radius:50%;-moz-background-clip:padding;border-radius:50%;background-clip:padding-box;cursor:default}.tv-dialog-colomn-table{border-spacing:0;border:0}.tv-dialog-colomn-table>thead>tr>td,.tv-dialog-colomn-table>tbody>tr>td,.tv-dialog-colomn-table>tr>td{padding:0;border:0;text-align:left;vertical-align:top}@media (max-height:645px),(max-width:460px){.tv-dialog-modal.auth-dialog{margin:1px;width:300px}.tv-dialog-modal.auth-dialog .properties-tabs{display:none!important}.tv-dialog-modal.auth-dialog h2{display:block}.tv-dialog-modal.auth-dialog .main{padding:0 10px;width:auto}.tv-dialog-modal.auth-dialog .main .auth-dialog-title{margin:10px 0;font-size:24px}.tv-dialog-modal.auth-dialog .main .auth-dialog-socials{margin:0 0 10px;overflow:hidden}.tv-dialog-modal.auth-dialog .main .auth-dialog-socials a{padding:6px 0}.tv-dialog-modal.auth-dialog .main .auth-dialog-separator{margin:0 0 10px}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field{margin:0 0 10px}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field input{height:30px}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder{pointer-events:none;position:absolute;left:11px;top:7px;color:#8891a3}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder.disabled{display:none}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field input:focus+.auth-dialog-field-placeholder{display:none}.tv-dialog-modal.auth-dialog .main form .auth-dialog-field input.empty:focus+.auth-dialog-field-placeholder{display:block;color:#a8b1c3}.tv-dialog-modal.auth-dialog .main form .auth-dialog-group{margin:0 0 10px}.tv-dialog-modal.auth-dialog .main form .auth-dialog-submit{margin:0 0 10px}.tv-dialog-modal.auth-dialog .main form .auth-dialog-submit button{height:auto;width:auto;padding:8px 10px;font-size:13px;font-weight:400}.tv-dialog-modal.auth-dialog .main form .auth-dialog-notice{margin:0 3px 5px 0;font-size:11px}.tv-dialog-modal.auth-dialog .main .auth-dialog-footnote{display:block;position:absolute;bottom:3px;left:10px;margin:0 75px 0 0;height:20px;font-size:11px;line-height:14px;color:#8891a3}.tv-dialog-modal.auth-dialog .main .auth-dialog-footnote a{cursor:pointer}}.charts-popup-list{overflow-y:auto;display:none;right:7px;top:46px;z-index:50;position:absolute;border:1px solid #aaadb1;background:#fff;z-index:120;margin:0}.charts-popup-list .icon-white-arrow-up{position:absolute;top:-9px;right:53px}.charts-popup-list .item{display:block;padding:7px 30px 7px 7px;height:16px;position:relative}.charts-popup-list .item.special{background:rgba(248,248,248,.9)}.charts-popup-list .item:hover,.charts-popup-list .item.active{background:#f4f7f9}.charts-popup-list .item.first{border-top-left-radius:3px;border-top-right-radius:3px}.charts-popup-list .item:last-child{border-bottom-left-radius:3px}.charts-popup-list .item span{color:#595959;display:inline-block}.charts-popup-list .item.active{background:#f4f7f9}.charts-popup-list .item.special.disabled{cursor:default}.charts-popup-list .item.special.disabled span{color:#9d9d9d}.charts-popup-list .item.special.disabled:hover{background:rgba(248,248,248,.9)}.charts-popup-list .item .title{width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.charts-popup-list .item .title-expanded{width:225px;max-width:100%;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.charts-popup-list .item .date{width:65px;padding-right:20px;vertical-align:top;white-space:nowrap;float:right}.charts-popup-list .separator{display:block;margin:0;height:0;overflow:hidden;border-top:1px solid #c9cbcd}.charts-popup-list .charts-popup-tab-headers{overflow:hidden;padding:8px 0;font-size:14px}.charts-popup-list .charts-popup-tab-header{float:left;margin:0 10px 5px}.charts-popup-list .charts-popup-tab-header-label{padding:0;font-weight:700;border-bottom:dashed 1px;cursor:pointer}.charts-popup-list .charts-popup-tab-header.active .charts-popup-tab-header-label{color:#595959;border-bottom:0;cursor:default}.charts-popup-list .item.item-twobuttons{padding-right:52px}.charts-popup-list .item.item-twobuttons .title-expanded{width:203px}.charts-popup-list .item.with-indent{padding-left:28px}.charts-popup-list .item .icon-delete{background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px;position:absolute;top:9px;right:7px}.charts-popup-list .item .icon-delete:hover{background-position:-81px -362px}.charts-popup-list .item .icon-delete{visibility:hidden}.is-mobile .charts-popup-list .item .icon-delete{visibility:visible;opacity:.3}.is-mobile .charts-popup-list .item .icon-delete:hover{opacity:1}.charts-popup-list .item:hover .icon-delete{visibility:visible}.charts-popup-list .item .icon-save{background:url(images/icons.png) -120px -280px;width:14px;height:14px;position:absolute;top:9px;right:23px}.charts-popup-list .item .icon-save:hover{background-position:-100px -280px}.charts-popup-list .item .icon-save{visibility:hidden}.charts-popup-list .item:hover .icon-save{visibility:visible}.charts-popup-list .item .icon{display:inline-block;width:16px;height:16px;margin:0 5px 0 0;vertical-align:top}.charts-popup-list.iconed .item{height:32px;padding:2px;line-height:34px}.charts-popup-list.iconed .item{white-space:nowrap;position:relative;overflow:hidden}.charts-popup-list.iconed .item .title{padding-right:20px}.charts-popup-list.iconed .item .icon{width:32px;height:32px;margin:0 5px}.charts-popup-list.iconed.thin .title{width:50px}.charts-popup-list.narrow{width:155px}.charts-popup-list.narrow .item .title-expanded{width:112px}.charts-popup-list.narrow.with-scroll .item .title-expanded{width:100px}.charts-popup-list.thin{width:110px}.charts-popup-list.thin .item .title-expanded{width:67px}.charts-popup-list .item .counter{position:absolute;top:8px;right:6px;color:#b8b8b8}.charts-popup-list .item:hover .counter{color:#595959}.charts-popup-list .item .counter.blue{background:#4e8ff6;color:#fff;padding:2px 3px;border-radius:2px;top:5px}.charts-popup-list .item.grayed span{opacity:.3}.charts-popup-list.small-font{font-size:12px}.charts-popup-list.small-font .item{height:12px}.charts-popup-list.intervals-list{right:auto;width:auto;max-height:100%;overflow-y:auto}.charts-popup-list.intervals-list .item{cursor:pointer;padding:7px;min-width:180px;color:#595959}.charts-popup-itemheader{padding:3px 8px 4px;border-top:1px solid #dbdbdb;cursor:pointer;color:#595959;background:rgba(204,204,204,.2)}.charts-popup-group-collapsible.collapsed .item{display:none}.charts-popup-group-collapsible .charts-popup-itemheader-icon{display:inline-block;vertical-align:middle;position:relative;top:-1px;width:11px;height:11px;margin:0 5px 0 -3px;background:url(images/icons.png) -180px -280px no-repeat}.charts-popup-group-collapsible.collapsed .charts-popup-itemheader-icon{background-position:-160px -280px}.favored-list .to-quick{position:absolute;display:block;width:16px;height:16px;background:url(images/icons.png);background-position:-80px -100px;top:7px;right:7px;visibility:hidden}.favored-list .delete{position:absolute;display:block;width:16px;height:16px;background:url(images/icons.png) -102px -362px;top:6px;right:30px;visibility:hidden}.favored-list .item:hover .delete{visibility:visible}.favored-list .item:hover .delete:hover{background-position:-81px -362px}.is-mobile .favored-list .delete{visibility:visible;opacity:.3}.is-mobile .favored-list .delete:hover{background-position:-81px -362px;opacity:1}.favored-list .item:hover .to-quick,.intervals-list .item:hover .delete,.intervals-list.touch .delete,.feature-touch .favored-list .to-quick{visibility:visible}.favored-list .item .to-quick{background-position:-40px -280px}.favored-list .item .to-quick:hover{background-position:-120px -363px}.favored-list .item.quicked .to-quick,.favored-list .item .to-quick.quicked{background-position:-20px -280px;visibility:visible}.favored-list .item.disabled{color:#c4c4c4}.intervals-list .item-add{min-width:230px}.intervals-list .item-add-wrap{overflow:hidden;white-space:nowrap}.intervals-list .item-add>span{margin:5px;display:block;overflow-x:hidden}.intervals-list input[type=text]{width:45px;height:25px}.intervals-list .mins,.intervals-list .add{text-transform:uppercase;margin-left:5px;height:14px}.intervals-list .mins{width:75px;position:relative;text-align:left}.intervals-list .add{width:45px;text-align:center}.intervals-list .mins i{background:url(images/select-bg.png) 0 0;display:block;width:9px;height:5px;position:absolute;right:7px;top:11px}.drawings-popup-list.favored-list .to-quick{top:11px}.drawings-popup-list.favored-list .item .title{padding-right:28px}.drawings-popup-list.favored-list.popup-with-scroll .title{padding-right:40px}/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */.fancybox-wrap,.fancybox-skin,.fancybox-outer,.fancybox-inner,.fancybox-image,.fancybox-wrap iframe,.fancybox-wrap object,.fancybox-nav,.fancybox-nav span,.fancybox-tmp{padding:0;margin:0;border:0;outline:0;vertical-align:top}.fancybox-wrap{position:absolute;top:0;left:0;z-index:17;cursor:default}.fancybox-skin{position:relative;background:#f9f9f9;color:#444;text-shadow:none}.fancybox-opened{z-index:18}.fancybox-outer,.fancybox-inner{position:relative}.fancybox-inner{overflow:hidden}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch}.fancybox-error{color:#444;font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;margin:0;padding:15px;white-space:nowrap}.fancybox-image,.fancybox-iframe{display:block;width:100%;height:100%}.fancybox-image{max-width:100%;max-height:100%}#fancybox-loading,.fancybox-prev span,.fancybox-next span{background-image:url(css/fancybox/fancybox_sprite.png)}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:1104}#fancybox-loading div{width:44px;height:44px;background:url(css/fancybox/fancybox_loading.gif) center center no-repeat}.fancybox-close-outer{position:absolute;top:0;right:0}.fancybox-close{position:absolute;right:0;display:block;top:0;width:36px;height:36px;cursor:pointer;z-index:40;margin-right:-36px;opacity:.8}.fancybox-close:hover{opacity:1}.fancybox-close:before{content:" ";height:12px;width:12px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1091px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-6px;margin-top:-6px}.fancybox-close-outer .fancybox-close{position:fixed;right:auto;top:20px}.fancybox-nav{position:absolute;top:0;width:40%;height:100%;cursor:pointer;text-decoration:none;background:transparent url(css/fancybox/blank.gif);-webkit-tap-highlight-color:rgba(0,0,0,0);z-index:40}.fancybox-prev{left:0}.fancybox-next{right:0}.fancybox-nav span{position:absolute;top:50%;width:36px;height:34px;margin-top:-18px;cursor:pointer;z-index:40;visibility:hidden}.fancybox-prev span{left:10px;background-position:0 -36px}.fancybox-next span{right:10px;background-position:0 -72px}.fancybox-nav:hover span{visibility:visible}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;visibility:hidden;max-width:99999px;max-height:99999px;overflow:visible!important}.fancybox-lock{overflow:hidden;width:auto}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:1104;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzA2QzgxNjNDMEY0MTFFNDk1RTZGNzBENTU3RDMyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzA2QzgxNjRDMEY0MTFFNDk1RTZGNzBENTU3RDMyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3MDZDODE2MUMwRjQxMUU0OTVFNkY3MEQ1NTdEMzI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3MDZDODE2MkMwRjQxMUU0OTVFNkY3MEQ1NTdEMzI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvnoHEgAAAAPSURBVHjaYhDg4dkAEGAAATEA2alCfCIAAAAASUVORK5CYII=);cursor:pointer}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.fancybox-title{visibility:hidden;font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;text-shadow:none;z-index:50}.fancybox-opened .fancybox-title{visibility:visible}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-35px;z-index:50;text-align:center}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:0 0;background:rgba(0,0,0,.8);-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;text-shadow:0 1px 2px #222;color:#fff;font-weight:700;line-height:24px;white-space:nowrap}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff}.fancybox-title-inside-wrap{padding-top:10px}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8)}a.fancy-box-arrow{display:block;position:fixed;z-index:39;top:0;height:100%;width:40px;color:#fff;font-size:50px;line-height:50px;text-align:center}a.fancy-box-arrow:hover{background:rgba(0,0,0,.3);background:rgba(0,0,0,.2)}.fancy-box-arrow.left{left:0}.fancy-box-arrow.right{right:15px}.fancy-box-arrow span{text-indent:-10000px;height:44px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2858px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-8px;margin-top:-22px}.fancy-box-arrow.right span{height:44px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2912px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-8px;margin-top:-22px}.mobile-safari .fancybox-wrap,.mobile-safari .fancybox-skin{-webkit-transform:translate3d(0,0,0)}.mobile-safari .fancybox-close{position:absolute;top:0}.header-menu-wrap{height:58px}.header-menu.header-logo{height:32px;margin:13px 20px 0 0}.header-menu.header-logo ul{width:192px}.header-menu.header-logo ul li a{position:relative}.header-menu.header-logo ul li a[target='_blank']:after{content:" ";display:inline-block;margin-left:10px;width:10px;height:10px;background-image:url(images/external-link/ext-bright.png);background-repeat:no-repeat}.is-not-authenticated .index-page .header-menu.header-logo ul li a[target='_blank']:after{background-image:url(images/external-link/ext-blue.png)}.header-menu.header-logo ul li a:hover[target='_blank']:after{background-position:0 -10px}.is-not-authenticated .index-page .header-menu.header-logo ul li a:hover[target='_blank']:after{background-position:0 0}.header-menu.header-logo>a{display:block;height:32px;padding-left:40px;padding-right:21px;margin-left:10px;background-image:url(images/logo.png);background-position:0 4px;background-repeat:no-repeat;font-size:14px;line-height:32px}.is-not-authenticated .index-page .header-menu.header-logo>a{background-image:url(images/logo-white.png);background-position:0 0}.is-not-authenticated .index-page .header-menu.header-logo.open>a{background-position:0 -32px}.header-button{display:block;height:32px;margin-top:13px;padding:0 15px;color:#dbdfeb;line-height:32px;text-decoration:none}.is-not-authenticated .header-button{font-size:13px;text-transform:uppercase}.header-button.with-icon:before{content:" ";position:relative;top:-2px;margin-right:10px}.header-button.with-icon.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1286px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1689px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1443px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1366px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;top:-2px;left:1px}.header-button.with-icon.active.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1234px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1633px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1393px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1312px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1260px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1661px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1418px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1339px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu{position:relative;margin-top:13px;height:32px;-ms-touch-action:none}.header-menu a{color:#fff}.header-menu>a{display:inline-block;height:32px;line-height:32px}.header-menu.with-sub>a:after{content:" ";position:absolute;right:5px;top:11px;width:6px;height:6px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;border-width:0 1px 1px 0;border-style:solid;border-color:#fff}.is-authenticated .header-menu.with-sub:hover>a:after,.is-authenticated .header-menu.with-sub.open>a:after{border-color:#58c3e5}.header-menu ul{list-style:none;margin:0;padding:0}.header-menu>ul,.header-menu .popup-subblock{display:none;position:absolute;left:0;top:45px;width:165px;padding:0 0 3px;border:1px solid #343541;background:#292b32;background:rgba(41,43,50,.97);border-radius:0 0 2px 2px;-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-webkit-box-shadow:0 0 10px rgba(0,0,0,.1);-moz-box-shadow:0 0 10px rgba(0,0,0,.1);box-shadow:0 0 10px rgba(0,0,0,.1);opacity:1;z-index:70}.is-not-authenticated .index-page .header-menu>ul,.is-not-authenticated .index-page .header-menu .popup-subblock{top:42px;padding:3px 0;background:#fff;background:rgba(255,255,255,.95);-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.header-menu.open ul,.header-menu.open .popup-subblock{display:block}.header-menu .popup-subblock ul{display:block;width:auto;position:relative;left:0;top:0;margin:2px 0;box-shadow:none;border-radius:0 0 4px 4px}.header-menu li a{display:block;padding:10px 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c4c7d1}.is-not-authenticated .index-page .header-menu li a{color:#333}.header-menu li a:hover{color:#fff}.is-not-authenticated .index-page .header-menu li a:hover{color:#02a3c3}.header-menu li.separator{background:#3f4148;height:1px;font-size:0}.is-not-authenticated .index-page .header-menu li.separator{background:#d5e6e9}.header-menu.to-left ul{left:auto;right:0}.header-menu .counter-blue{position:absolute;color:#fff;right:8px;background:#286ed1;font-weight:700;padding:0 4px;border-radius:2px}.header-menu .counter{position:absolute;color:#dbdfeb;right:12px;font-size:13px}.header-menu a:hover .counter{color:#fff}.header-button,a.header-button,.header-menu>a{font-size:14px;color:#fff}.is-not-authenticated .header-button:hover,.is-not-authenticated .header-button.active,.is-not-authenticated .header-menu:hover>a,.is-not-authenticated .header-menu.open>a{opacity:.85}.is-authenticated .header-button:hover,.is-authenticated .header-button.active,.is-authenticated .header-menu:hover>a,.is-authenticated .header-menu.open>a{color:#58c3e5}.header-logo,.header-item-ideas,.header-item-chart,.header-search,.header-menu-group a{float:left}.header-item-profile,.header-item-gopro,.header-item-signin,.header-item-market-summary,.header-item-signup,.header-item-earlyaccess{float:right}.header-item-ideas,.header-item-scripts{float:left}.header-item-ideas.header-button,.header-item-chart.header-button,.header-item-scripts.header-button,.header-item-ideas.header-menu>a,.header-item-chart.header-menu>a,.header-item-scripts.header-menu>a{padding-left:35px!important;padding-right:18px!important;position:relative}.header-item-ideas.header-menu.with-sub>a,.header-item-chart.header-menu.with-sub>a,.header-item-scripts.header-menu.with-sub>a{padding-right:23px!important}.header-item-ideas.header-button:before,.header-item-ideas.header-menu>a:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1880px;display:block;position:absolute;overflow:hidden;left:10px;top:5px}.header-item-ideas:hover.header-button:before,.header-item-ideas.active.header-button:before,.header-item-ideas.open.header-button:before,.header-item-ideas:hover.header-menu>a:before,.header-item-ideas.active.header-menu>a:before,.header-item-ideas.open.header-menu>a:before{height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1909px;display:block;position:absolute;overflow:hidden}.header-item-chart.header-button:before,.header-item-chart.header-menu>a:before{content:" ";height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1830px;display:block;position:absolute;overflow:hidden;left:8px;top:8px}.header-item-chart:hover.header-button:before,.header-item-chart.active.header-button:before,.header-item-chart.open.header-button:before,.header-item-chart:hover.header-menu>a:before,.header-item-chart.active.header-menu>a:before,.header-item-chart.open.header-menu>a:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1855px;display:block;position:absolute;overflow:hidden}.header-item-scripts.header-button:before,.header-item-scripts.header-menu>a:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1938px;display:block;position:absolute;overflow:hidden;left:10px;top:6px}.header-item-scripts:hover.header-button:before,.header-item-scripts.active.header-button:before,.header-item-scripts.open.header-button:before,.header-item-scripts:hover.header-menu>a:before,.header-item-scripts.active.header-menu>a:before,.header-item-scripts.open.header-menu>a:before{height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1967px;display:block;position:absolute;overflow:hidden}.header-item-ideas.header-menu{display:none}.header-item-chart .popup-subblock{width:233px;max-height:415px}.header-item-chart .popup-subblock .sb-scrollbar-wrap{z-index:71}.header-item-chart .popup-subblock .sb-scrollbar{z-index:71}.header-item-chart li a{padding-right:30px}.header-item-chart li a.new-chart{padding:15px 30px 15px 25px;background-image:url(images/new-chart-icon.png);background-repeat:no-repeat;background-position:6px 20px}.header-item-chart li:hover span{color:#fff}.header-item-chart li:hover span.icon{visibility:visible}html.feature-touch .header-item-chart li span.icon{visibility:visible}.header-item-chart .name,.header-item-chart .subscript{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-item-chart .name{font-weight:700}.header-item-chart .subscript{font-size:10px;color:#9e9e9e;height:14px}.header-item-chart span.icon-carousel-item-delete-dark{position:absolute;top:15px;right:10px;visibility:hidden}.is-not-authenticated .index-page .header-search{display:none}.header-search{height:58px;position:relative;margin-left:10px}.header-search input{height:36px;line-height:36px;width:180px;margin:10px 0 0;padding:0 30px 0 12px;border:1px solid #343541;font-size:14px;background:#26282f;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;color:#d4d4d4;box-shadow:none;font-family:'Open Sans',sans-serif;transition:background .3s}.is-trial .header-search input{width:160px}.three-columns .header-search input{width:180px}.header-search input:focus{border-color:#454652;color:#fff}.header-search.not-empty input{text-transform:uppercase}.header-search>span{position:absolute;top:10px;right:0;height:36px;width:36px;cursor:pointer}.header-search>span:before{content:" ";position:absolute;top:15px;right:15px;width:6px;height:6px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;border-top:2px solid #d4d4d4;border-right:2px solid #d4d4d4}.header-search>span:hover:before{border-color:#58c3e5}.header-search .header-item-chart{position:absolute;right:4px;top:0;background:#26282f}.header-search .header-item-chart.header-menu>a{padding-right:0!important;padding-left:0!important;width:20px}.header-search .header-item-chart.header-menu>a:before{display:none}.header-search .header-item-chart.header-menu.open .popup-subblock{top:34px;left:-211px}.header-search span.placeholder{color:#929292;line-height:24px}.header-menu.header-item-profile>a,.header-menu.header-item-profile>a:link,.header-menu.header-item-profile>a:visited{padding:0 25px 0 6px;height:32px}.header-menu.header-item-profile>a:after{right:10px}.header-menu.header-item-profile .user-info-username{display:inline-block;margin:0 3px 0 10px;max-width:115px;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.is-trial .header-menu.header-item-profile .user-info-username{max-width:60px}.three-columns .header-menu.header-item-profile .user-info-username{max-width:115px}.header-menu.header-item-profile .icon-profilemenu-settings{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2170px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-settings{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2195px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-profile{height:14px;width:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2293px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-profile{height:14px;width:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2317px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-signout{height:13px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2652px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-signout{height:13px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2675px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-status{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2243px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-status{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2268px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-settings{top:-1px;left:-1px}.header-menu.header-item-profile .icon-profilemenu-profile{top:-2px;left:-1px}.header-menu.header-item-profile .icon-profilemenu-status{top:-1px;left:-1px}.header-menu.header-item-profile ul{width:209px;opacity:1!important}.user-picture,.user-picture img{height:32px;width:32px}.user-picture{text-align:center;float:left}.user-picture img{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.is-not-authenticated .header-menu.header-item-profile{display:none}.is-not-pro .header-menu.header-item-profile strong.badge{display:none}.header-button.header-item-signin{padding-left:20px;padding-right:25px}.is-authenticated .header-item-gopro-signup{display:none}.is-authenticated .header-button.header-item-signin{display:none}.is-authenticated .header-button.header-item-signup{display:none}.gopro-page .header-button.header-item-gopro{display:none}.header-item-gopro,.header-item-gopro:link,.header-item-gopro:hover{padding:0;margin-top:12px;margin-right:10px;height:32px;border:#4bc2e8 1px solid;background:0 0;line-height:32px;text-transform:uppercase}.is-not-authenticated .index-page .header-item-gopro,.is-not-authenticated .index-page .header-item-gopro:link,.is-not-authenticated .index-page .header-item-gopro:hover{border:#fff 1px solid}.header-item-gopro-signup,.header-item-gopro-btn{float:left;height:16px;padding:0 6px;color:#4bc2e8}.is-not-authenticated .index-page .header-item-gopro-signup,.is-not-authenticated .index-page .header-item-gopro-btn{color:#fff}.header-item-gopro-signup .gopro-btn-big,.header-item-gopro-btn .gopro-btn-big{margin-top:4px;font-size:12px;font-weight:600;line-height:14px;text-align:center}.header-item-gopro-signup .gopro-btn-small,.header-item-gopro-btn .gopro-btn-small{font-size:10px;font-weight:700;line-height:11px;text-align:center;color:#b66052}.is-pro .header-item-gopro{display:none}.is-trial .header-item-gopro{display:block}.is-not-authenticated .header-item-gopro-main,.is-trial .header-item-gopro-main,.is-trial-available .header-item-gopro-main,.is-authenticated.is-not-trial.is-pro .header-item-gopro-main{display:none}.header-item-gopro-earlyaccess{display:none}.is-trial .header-item-gopro-earlyaccess{display:block}.header-item-gopro-trial{display:none}.is-trial-available .header-item-gopro-trial{display:block}.is-trial .header-item-gopro-trial{display:none}.tv-index-header-bg{background:#ebeff2;padding:0 0 10px}.tv-index-header-login{font:12px Arial,sans-serif;display:none;color:#5a5a5a}.tv-index-header-login-wrap{padding:10px 7px 0;position:relative}.tv-index-header-login .user-avatar{float:left;height:30px}.tv-index-header-login .user-avatar a{display:inline-block;height:30px}.tv-index-header-login .user-bar{background:#eaf3fb;border-radius:2px;padding:5px 7px;height:30px;border:1px solid #d1dee9}.tv-index-header-login .user-bar a{text-decoration:underline}.dashed-link{border-bottom:1px dashed #256dd0;color:#256dd0;cursor:pointer;font-size:13px;margin:5px 15px 0 0;text-decoration:none!important}.users-table-header .dashed-link{margin:0 15px 0 0}.dashed-link.active{border-bottom:0;color:#666}.tv-index-header-login .user-username{float:left;font-size:13px;font-weight:700;text-decoration:underline;margin:6px 0 0 10px}.tv-index-header-login .user-username a{text-decoration:underline}.tv-index-header-login .user-rating{float:left;font-size:13px;font-weight:700;margin:5px 0 0 12px}.tv-index-header-login .user-rating a{font-size:13px;text-decoration:underline}.tv-index-header-login .user-rating-position{float:left;margin:7px 0 0 7px}.tv-index-header-login .index-user-carousel-nav{width:100%;height:100%;position:absolute;left:0;top:0}.tv-index-header-login .nav-button{z-index:2;position:absolute;background:#edf0f2;width:27px;height:137px;top:0;opacity:.5;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;transition:opacity .5s}.tv-index-header-login .nav-button:hover{opacity:.8;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;transition:opacity .5s}.tv-index-header-login .nav-button-left{left:0;border-right:1px solid #dadcde}.tv-index-header-login .nav-button-right{right:0;border-left:1px solid #dadcde}.tv-index-header-login .icon-nav-left-disabled{display:none}.tv-index-header-login .icon-nav-right-disabled{display:none}.tv-index-header-login .user-profile-follow-links{float:left;margin:3px 0 0 8px}.tv-index-header-login .show-more-link{background:#fff;border:1px solid #bfbfbf;margin:0 auto;display:block;text-align:center;color:#646464;position:relative;top:-1px;width:173px;padding:6px 0 0;border-radius:0 0 3px 3px;border-top:1px dashed #bfbfbf;height:21px;cursor:pointer;font:700 12px Calibri,Arial}.is-not-authenticated .logged-user-menu{display:none}.is-authenticated .guest-menu{display:none}.ISwraper{position:relative}.ISwraper .IStoggle{position:absolute;height:27px;width:13px;top:1px;right:0;cursor:pointer}.ISwraper .IStoggle:after{content:" ";position:absolute;right:0;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.ISwraper ul.ISdropdown{position:absolute;left:1px;top:0;border:1px solid #c9cbcd;background:#fff;z-index:120;margin:2px 0 0;padding:0;overflow:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ISwraper ul.ISdropdown li{display:block;padding:7px;height:16px;overflow:hidden;cursor:pointer}.ISwraper ul.ISdropdown li:hover{background:#f4f7f9}.ISwraper ul.ISdropdown li .IStext{display:inline-block;width:100%;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tv-dialog-content form .ISwraper .IStoggle{height:33px;width:25px}.tv-dialog-content form .ISwraper .IStoggle:after{top:10px;right:6px}.content-page{font-size:15px;color:#4b4b4d}.content-page p{line-height:28px;margin-bottom:20px}.content-page h1{font-size:40px;color:#2a2d33;line-height:normal;font-weight:400;margin:26px 0}.content-page h1:first-child{margin-top:0}.content-page h2{font-size:29px;color:#2a2d33;line-height:normal;font-weight:400;margin:25px 0}.content-page h2:first-child{margin-top:0}.content-page h3{font-size:21px;color:#2a2d33;line-height:normal;font-weight:400;margin:20px 0 15px}.content-page h3:first-child{margin-top:0}.content-page .more-languages{border:1px solid silver;padding:10px;background:#fff;cursor:pointer}.content-page .languages-list{width:350px;height:265px;border:1px solid silver;background:#fff;padding:10px 0;position:absolute;right:0;top:-11px;z-index:100}.content-page .languages-list li{width:33%;list-style-type:none;float:left;padding:5px 0;white-space:nowrap;text-align:left}.content-page .languages-list li.large{width:100%;padding:0}.content-page .languages-list li.large .content{margin-left:15px}.content-page .languages-list li.large.top{border-bottom:1px solid silver;margin-bottom:10px;padding-bottom:10px;cursor:pointer}.content-page .languages-list li.large.bottom{border-top:1px solid silver;margin-top:10px;padding-top:10px}.content-page ul li span.mark{color:#60b789;font-weight:700}.content-page .separator{margin:45px 0 35px;background:#ccd8e4;height:1px;overflow:hidden}.content-page .vindent{padding:36px 0}.content-page .vindent-top{padding-top:36px}.content-page .vindent-bottom{padding-bottom:36px}.content-page .hvindent{padding:36px 10px}.content-page .tv-content-button{display:inline-block;height:45px;padding:0 30px;color:#fff;text-align:center;text-transform:uppercase;font-size:15px;line-height:46px;cursor:pointer;border-width:0;outline:0;outline-style:none;-webkit-border-radius:0;-webkit-background-clip:padding-box;-moz-border-radius:0;-moz-background-clip:padding;border-radius:0;background-clip:padding-box}.content-page .tv-content-button::-moz-focus-inner{border:0;padding:0}.content-page .tv-content-button.float-bottom{position:absolute;bottom:0}.content-page .tv-content-button.blue{background-color:#00b8dc}.content-page .tv-content-button.blue:hover{background-color:#00c1e6}.content-page .tv-content-button.blue:active{background-color:#00c9f0}.content-page .tv-content-button.green{background-color:#5cb888}.content-page .tv-content-button.green:hover{background-color:#63bb8d}.content-page .tv-content-button.green:active{background-color:#6abe92}.content-page .tv-content-button.yellow{background-color:#e5c35f}.content-page .tv-content-button.yellow:hover{background-color:#e6c668}.content-page .tv-content-button.yellow:active{background-color:#e8ca71}.content-page .tv-content-button.black{background-color:#26282f}.content-page .tv-content-button.black:hover{background-color:#2b2d35}.content-page .tv-content-button.black:active{background-color:#2f323a}.content-page.how-it-works{overflow:hidden}.content-page.how-it-works .intro{height:497px;padding-top:52px}.content-page.how-it-works .intro .tv-layout-width{position:relative}.content-page.how-it-works .intro .text{width:415px;float:left}.content-page.how-it-works .intro img{position:absolute;top:0;left:392px}.content-page.how-it-works .watch-link{padding:47px 0 52px;border-bottom:solid 1px #d3d8de}.content-page.how-it-works .watch-link:after{clear:both;display:table;content:""}.content-page.how-it-works .watch-link a{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3147px;float:left;height:89px;padding-left:191px;padding-top:26px;font-size:24px;line-height:normal;color:#2a2d33;font-style:italic;width:120px}.content-page.how-it-works .mission{padding:30px 0 60px}.content-page.how-it-works table.stats{table-layout:fixed;padding-top:50px;width:100%}.content-page.how-it-works table.stats td{padding-left:40px}.content-page.how-it-works table.stats div{height:77px;display:inline-block;color:#7e848e;font-size:20px;padding-top:7px;text-align:left}.content-page.how-it-works table.stats div span{font-size:46px;color:#33353e;display:block}.content-page.how-it-works table.stats div.investors{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1977px;padding-left:85px}.content-page.how-it-works table.stats div.ideas{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1890px;padding-left:91px}.content-page.how-it-works table.stats div.charts{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -511px;padding-left:100px}.content-page.how-it-works .how{padding:30px 0}.content-page.how-it-works .how table{width:100%;margin:50px 0 30px}.content-page.how-it-works .how table td{padding:0 20px 50px 0}.content-page.how-it-works .how table td i{width:69px;float:left;text-align:right;padding-right:16px}.content-page.how-it-works .how table td div{padding-left:85px;line-height:22px}.content-page.how-it-works .how table td h2{color:#2a2d33;font-size:24px;padding:0 0 10px;margin:0;font-weight:400;text-transform:uppercase}.content-page.how-it-works .how table td i:before{content:" "}.content-page.how-it-works .how table td.create i:before{height:43px;width:60px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -42px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .how table td.learn i:before{height:36px;width:42px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -95px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .how table td.share i:before{height:44px;width:34px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -141px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:11px}.content-page.how-it-works .how table td.colloborate i:before{height:32px;width:63px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 0;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .trading-ideas h1{text-align:center}.content-page.how-it-works .trading-ideas .image{height:185px;width:120px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2952px;float:left;margin-top:45px}.content-page.how-it-works .trading-ideas .text{padding-left:160px}.content-page.how-it-works .trading-ideas .text p.half.first{float:left;width:50%;margin-right:8%}.content-page.how-it-works .trading-ideas .text p.half.second{float:left;width:42%}.content-page.how-it-works .saying-about{padding-top:56px}.content-page.how-it-works .saying-about h1{text-align:center;margin-bottom:45px}.content-page.how-it-works .saying-about blockquote{color:#818284;font-size:17px;line-height:28px;font-weight:400;font-style:italic;margin:0 0 35px;padding:0 0 0 34px}.content-page.how-it-works .saying-about blockquote:before{content:" ";height:18px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2559px;display:block;position:absolute;overflow:hidden;margin-left:-32px}.content-page.how-it-works .saying-about .quote{width:47%;float:left}.content-page.how-it-works .saying-about .quote.r{float:right}.content-page.how-it-works .saying-about .quote .author{text-align:right;padding-left:34px;font-size:17px}.content-page.how-it-works .saying-about .quote .author .name{color:#2a2d33}.content-page.how-it-works .saying-about .quote .author .post{color:#818284}.content-page.how-it-works .saying-about .press-about{padding:80px 0 40px}.content-page.how-it-works .saying-about .press-about:after{clear:both;display:table;content:""}.content-page.how-it-works .saying-about .press-about .line{height:1px;background:#ced5db;overflow:hidden;margin-top:10px}.content-page.how-it-works .saying-about .press-about .head{color:silver;font-size:20px;background:#eaeff4;display:block;margin:-14px auto 30px;width:350px;text-align:center;text-transform:uppercase}.content-page.how-it-works .saying-about .press-about .item{width:228px;float:left;margin-right:27px}.content-page.how-it-works .saying-about .press-about .item:last-child{margin-right:0}.content-page.how-it-works .saying-about .press-about .item .balloon{background:#fff;position:relative;height:106px;font-size:14px;color:#818284;text-align:center;display:table-cell;vertical-align:middle;padding:0 21px}.content-page.how-it-works .saying-about .press-about .item .balloon:before{content:" ";height:20px;width:20px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -331px;display:block;position:absolute;overflow:hidden;top:100%;right:24px}.content-page.how-it-works .saying-about .press-about .item .image{float:right;margin-right:3px}.content-page.how-it-works .saying-about .press-about .item:nth-child(1) .image{height:36px;width:130px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2114px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:22px}.content-page.how-it-works .saying-about .press-about .item:nth-child(2) .image{height:24px;width:133px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2918px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:32px}.content-page.how-it-works .saying-about .press-about .item:nth-child(3) .image{height:43px;width:141px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3371px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:24px}.content-page.how-it-works .saying-about .press-about .item:nth-child(4) .image{height:22px;width:193px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1078px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:32px}.content-page.features .intro .head{text-align:center;padding-top:25px;overflow:hidden}.content-page.features .intro .head h1{margin-bottom:35px}.content-page.features .broad-market{padding-top:20px;text-align:center}.content-page.features .broad-market-icon-container{text-align:center;overflow:hidden}.content-page.features .broad-market-icon-container .broad-market-icon{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .mobile{position:relative}.content-page.features .mobile .text{width:620px}.content-page.features .mobile .text p{padding-right:15px}.content-page.features .mobile .image{float:right;margin:53px 10px 0 0;height:240px;width:341px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1210px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .mobile:after{clear:both;display:table;content:""}.content-page.features .chart-types .chart-types-list{height:140px;width:795px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -361px;width:auto;margin:30px 0 10px 53px}.content-page.features .chart-types .chart-types-list div{line-height:54px;height:54px;margin-bottom:32px}.content-page.features .chart-types .chart-types-list div span{float:left;width:171px;padding-left:73px;font-size:18px;color:#595e67}.content-page.features .chart-types .chart-types-list div span:last-child{width:auto}.content-page.features .chart-types .spread-charts .text{padding-left:200px}.content-page.features .chart-types .spread-charts .image{height:96px;width:96px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2636px;margin-left:-161px;float:left;margin-top:5px}.content-page.features .drawings{text-align:center}.content-page.features .drawings .image{height:32px;width:937px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1110px;margin:10px auto 25px}.content-page.features .technical-analysis{text-align:center}.content-page.features .technical-analysis .list{color:#4b5662;font-size:25px;text-align:center;margin-bottom:45px;margin-top:40px}.content-page.features .technical-analysis .list span:before{content:" "}.content-page.features .technical-analysis .list span:nth-child(1):before{height:40px;width:51px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2064px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:10px}.content-page.features .technical-analysis .list span:nth-child(2):before{height:45px;width:46px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2392px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:75px;margin-right:15px}.content-page.features .technical-analysis .list span:nth-child(3):before{height:42px;width:38px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1026px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:75px;margin-right:24px}.content-page.features .features-item.half{padding-top:56px}.content-page.features .features-item.half>div:nth-child(1){float:left;width:47%}.content-page.features .features-item.half>div:nth-child(2){float:right;width:47%}.content-page.features .features-item.center{text-align:center}.content-page.features .features-item h2 .image{margin-top:-23px;margin-right:6px}.content-page.features .features-item .image.fundamentals{height:40px;width:54px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1736px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.compare{height:41px;width:60px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -929px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.price-scaling{height:57px;width:69px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2447px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.multi-charts{height:48px;width:49px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2160px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.study-template{height:52px;width:54px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2856px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.extended-hours{height:48px;width:174px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1152px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.hotlist{height:45px;width:34px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1835px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.repeat{height:39px;width:53px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2587px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.headlines{height:39px;width:40px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1786px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.conversation{height:36px;width:42px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -980px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.publish{height:35px;width:36px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2514px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item:after{clear:both;display:table;content:""}.content-page.features .addons .text{padding-left:247px}.content-page.features .addons .image{float:left;margin-left:-200px;margin-top:8px;height:126px;width:136px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -195px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .woo-gopro{padding:65px 0 50px;background:#14b8da;text-align:center}.content-page .woo-gopro .title{font-size:34px;color:#f2f5f8;margin-bottom:15px}.content-page .woo-gopro p{font-size:16px;color:#f2f5f8;font-style:italic}.content-page .woo-gopro a{margin-top:20px;background:#1098b5;border:solid 1px #fff;color:#fff;font-size:18px;text-transform:uppercase;width:202px;height:45px;line-height:45px;display:inline-block}.content-page.licensing{overflow:hidden}.content-page.licensing .intro{text-align:center;padding-top:52px;padding-bottom:0}.content-page.licensing .intro .tv-layout-width{position:relative}.content-page.licensing .intro img{display:block;margin:55px 0 0 -62px}.content-page.licensing .base-info{padding:105px 0 75px}.content-page.licensing .base-info h3{color:#2a2d33;font-size:24px;font-weight:400;margin:0 0 15px}.content-page.licensing .base-info .three-colomns-layout .colomn-left,.content-page.licensing .base-info .three-colomns-layout .colomn-center,.content-page.licensing .base-info .three-colomns-layout .colomn-right{float:left;position:relative;height:453px;width:305px;width:calc((100% - 81px)/3);margin-right:40px;padding-bottom:45px}.content-page.licensing .base-info .three-colomns-layout .colomn-left.colomn-right,.content-page.licensing .base-info .three-colomns-layout .colomn-center.colomn-right,.content-page.licensing .base-info .three-colomns-layout .colomn-right.colomn-right{margin-right:0}.content-page.licensing .base-info .three-colomns-layout .colomn-left h3,.content-page.licensing .base-info .three-colomns-layout .colomn-center h3,.content-page.licensing .base-info .three-colomns-layout .colomn-right h3{font-size:17px;font-weight:700;color:#2a2d33}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image-container,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image-container,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image-container{height:100px;line-height:100px;text-align:center;margin-bottom:40px}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.window-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.window-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.window-chart{height:89px;width:110px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3272px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.cloud-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.cloud-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.cloud-chart{height:81px;width:115px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -838px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.pages-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.pages-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.pages-chart{height:100px;width:100px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2218px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .tv-content-button,.content-page.licensing .base-info .three-colomns-layout .colomn-center .tv-content-button,.content-page.licensing .base-info .three-colomns-layout .colomn-right .tv-content-button{padding:0;width:100%}.content-page.licensing>.vindent:last-child{padding:70px 0}.content-page.charting-library .intro{position:relative;text-align:center;padding-bottom:0}.content-page.charting-library .intro .image{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:-45px;margin-top:-8px}.content-page.charting-library .buttons-container{position:relative;margin-top:45px;text-align:center;z-index:1}.content-page.charting-library .buttons-container .tv-content-button{margin-right:15px}.content-page.charting-library .buttons-container .tv-content-button:last-child{margin-right:0}.content-page.charting-library .chart-container.vindent{padding-top:65px;text-align:center}.content-page.charting-library #chart{width:100%;height:605px}.content-page .advantages .list{padding:25px 310px 0 75px}.content-page .advantages h2{font-size:25px;position:relative}.content-page .advantages h2 .image,.content-page .advantages h2 .rounded-number{position:absolute;left:-75px;top:-10px}.content-page .advantages h2 .rounded-number{top:-12px;width:50px;height:50px;line-height:50px;text-align:center;border:2px solid #14b8da;-webkit-border-radius:50px;-webkit-background-clip:padding-box;-moz-border-radius:50px;-moz-background-clip:padding;border-radius:50px;background-clip:padding-box;color:#14b8da}.content-page .advantages h2.blue{color:#14b8da}.content-page .advantages h2.blue .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -598px}.content-page .advantages h2.blue .rounded-number{border-color:#14b8da;color:#14b8da}.content-page .advantages h2.green{color:#60b789}.content-page .advantages h2.green .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -658px}.content-page .advantages h2.green .rounded-number{border-color:#60b789;color:#60b789}.content-page .advantages h2.yellow{color:#dbb710}.content-page .advantages h2.yellow .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -778px}.content-page .advantages h2.yellow .rounded-number{border-color:#dbb710;color:#dbb710}.content-page .advantages h2.red{color:#e26346}.content-page .advantages h2.red .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -718px}.content-page .advantages h2.red .rounded-number{border-color:#e26346;color:#e26346}.content-page .advantages p{padding-bottom:25px}.content-page .contacts{margin-top:17px;float:right;position:relative;width:237px;padding:16px 18px;background:#eaeff4;border-radius:5px;color:#5e646f;line-height:20px;font-size:14px}.content-page .contacts .title{color:#2a2d33;padding-bottom:15px;font-weight:700;text-transform:uppercase}.content-page .contacts .fn,.content-page .contacts .email,.content-page .contacts .tel{display:block}.content-page .contacts:after{content:" ";height:54px;width:30px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2328px;display:block;position:absolute;overflow:hidden;bottom:0;right:11px}.content-page .hl-bg .contacts{background:#f2f5f8}.content-page.tv-widget-page .intro{text-align:center;overflow:hidden;padding-bottom:0}.content-page.tv-widget-page .intro .image{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.tv-widget-page .browser-container{margin-top:50px}.content-page [class^=flag-small-]{position:relative;top:-2px;margin-right:4px}.content-page .flag-small-greatbritain{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1535px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-taiwan{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1685px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-russian{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1635px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-japanese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1585px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-german{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1510px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-portuguese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1610px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-chinese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1460px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-italy{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1560px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-spain{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1660px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-france{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1485px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-vietnam{height:16px;width:23px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1710px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets){list-style-type:none}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets) li{background:0 0;display:block;margin:0 0 0 22px;padding:8px 0;line-height:30px}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets) a.user-badge{position:relative;top:3px;margin-left:8px}.charting-library-page-dialog{text-align:left;line-height:1.7;font-size:15px}.clients-list{background:#e0e5eb}.clients-list img{margin-right:30px;margin-top:30px}.clients-list .hint{margin:-20px 0 0 0}.clients-list .logo-list{padding-bottom:30px}@-webkit-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-moz-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-ms-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-o-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}.header-chart-panel{display:block;position:relative;z-index:1;padding:5px 5px 0;background-color:#f1f3f6}.header-chart-panel:after{clear:both;display:table;content:""}.is-mobile .header-chart-panel{background-color:#fff;padding:14px 28px;border-bottom:1px solid #c9cbcd}.is-mobile .header-chart-panel .symbol-edit-widget{width:170px;height:40px;margin-right:8px}.is-mobile .header-chart-panel .chart-style-widget .quick i{position:relative;top:-4px}.is-mobile .header-chart-panel .button i{display:block;position:relative;background-image:url(images/mobile/icons.png)}.is-mobile .header-chart-panel .button.properties i{top:-2px;left:-1px;background-position:0 20px}.is-mobile .header-chart-panel .button.compare i{display:block;top:-2px;left:-1px;background-position:-60px -18px}.is-mobile .header-chart-panel .button.indicators i{display:block;top:-2px;background-position:-20px -18px}.is-mobile .header-chart-panel .button.load{margin-right:7px}.is-mobile .header-chart-panel .button.save.process{background:url(images/bar-loader.gif) 0 0 repeat!important;border:0;padding:14px 19px 12px}.is-mobile .header-chart-panel .button.save.no-change{color:#ddd!important}.is-mobile .header-chart-panel .button.options{padding-right:12px!important}.is-mobile .header-chart-panel .mobile-back-button{-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;width:40px;height:40px;border:2px solid #b5b7ba;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff;position:relative;margin-right:30px}.is-mobile .header-chart-panel .mobile-back-button:hover,.is-mobile .header-chart-panel .mobile-back-button:active,.is-mobile .header-chart-panel .mobile-back-button.active{background:#fff}.is-mobile .header-chart-panel .mobile-back-button:hover,.is-mobile .header-chart-panel .mobile-back-button:active,.is-mobile .header-chart-panel .mobile-back-button.active,.is-mobile .header-chart-panel .mobile-back-button.selected{background:#fff;border:2px solid #b5b7ba}.is-mobile .header-chart-panel .mobile-back-button i{position:absolute;top:11px;left:9px;display:block;width:19px;height:16px;background-image:url(images/mobile/icons.png);background-position:-40px -20px}.header-chart-panel .tv-close-panel{position:absolute;cursor:pointer;bottom:-5px;left:5px}.header-chart-panel.hidden{padding:0}.header-chart-panel.hidden .left,.header-chart-panel.hidden .right{display:none}.header-chart-panel .right{float:right}.header-chart-panel .left{margin:0 0 -5px 0}.header-chart-panel .group{display:inline-block;white-space:nowrap;padding:0;margin:0 0 5px;vertical-align:top}.is-mobile .header-chart-panel .group{margin:0}.header-chart-panel .symbol-edit-widget{margin-right:-1px;width:100px}.header-chart-panel .space-single,.chart-top-toolbar .space-single{padding:0 4px 0 0}.is-mobile .header-chart-panel .space-single,.is-mobile .chart-top-toolbar .space-single{padding-right:7px}.header-chart-panel .button,.hotlist-controls .button,.symbol-edit-widget .button{cursor:default;padding:7px 12px;border:1px solid #c9cbcd;height:14px;background:#fff;color:#555;font-size:11px;font-weight:600;float:left;display:block;position:relative}.is-mobile .header-chart-panel .button.iconed,.is-mobile .hotlist-controls .button.iconed,.is-mobile .symbol-edit-widget .button.iconed,.is-mobile .header-chart-panel .button,.is-mobile .hotlist-controls .button,.is-mobile .symbol-edit-widget .button{padding:12px 17px 10px;border:2px solid #b5b7ba;height:14px;background:#b5b7ba;color:#fff;font-size:12px;font-weight:400}.is-mobile .header-chart-panel .button.iconed:hover,.is-mobile .hotlist-controls .button.iconed:hover,.is-mobile .symbol-edit-widget .button.iconed:hover,.is-mobile .header-chart-panel .button:hover,.is-mobile .hotlist-controls .button:hover,.is-mobile .symbol-edit-widget .button:hover,.is-mobile .header-chart-panel .button.iconed:active,.is-mobile .hotlist-controls .button.iconed:active,.is-mobile .symbol-edit-widget .button.iconed:active,.is-mobile .header-chart-panel .button:active,.is-mobile .hotlist-controls .button:active,.is-mobile .symbol-edit-widget .button:active,.is-mobile .header-chart-panel .button.iconed.active:hover,.is-mobile .hotlist-controls .button.iconed.active:hover,.is-mobile .symbol-edit-widget .button.iconed.active:hover,.is-mobile .header-chart-panel .button.active:hover,.is-mobile .hotlist-controls .button.active:hover,.is-mobile .symbol-edit-widget .button.active:hover,.is-mobile .header-chart-panel .button.iconed.active,.is-mobile .hotlist-controls .button.iconed.active,.is-mobile .symbol-edit-widget .button.iconed.active,.is-mobile .header-chart-panel .button.active,.is-mobile .hotlist-controls .button.active,.is-mobile .symbol-edit-widget .button.active{background:#b5b7ba!important;color:#fff!important}.is-mobile .header-chart-panel .button.iconed .arrow-icon,.is-mobile .hotlist-controls .button.iconed .arrow-icon,.is-mobile .symbol-edit-widget .button.iconed .arrow-icon,.is-mobile .header-chart-panel .button .arrow-icon,.is-mobile .hotlist-controls .button .arrow-icon,.is-mobile .symbol-edit-widget .button .arrow-icon{right:8px;top:13px;background:url(images/mobile/select-bg.png) repeat scroll 0 0 transparent;height:8px;width:14px}.is-mobile .header-chart-panel .button.iconed .arrow-icon:before,.is-mobile .hotlist-controls .button.iconed .arrow-icon:before,.is-mobile .symbol-edit-widget .button.iconed .arrow-icon:before,.is-mobile .header-chart-panel .button .arrow-icon:before,.is-mobile .hotlist-controls .button .arrow-icon:before,.is-mobile .symbol-edit-widget .button .arrow-icon:before{position:absolute;content:" ";width:1px;height:24px;background:#cbcdcf;top:-8px;right:24px}.header-chart-panel .left:not(.captions) .toggle-caption span.caption{display:none}.header-chart-panel .left.captions .toggle-caption{padding:7px 10px}.header-chart-panel .left.captions .toggle-caption.active{color:#4ab2dc}.is-mobile .header-chart-panel .left.captions .toggle-caption{padding:12px 17px 10px}.header-chart-panel .left.captions .toggle-caption i{display:none}.header-chart-panel .button .arrow-icon,.hotlist-controls .arrow-icon,.symbol-edit-widget .arrow-icon,.ch-settings.button .arrow-icon{position:absolute;right:7px;top:12px;background:url(images/select-bg.png) repeat scroll 0 0 transparent;height:5px;width:9px}.header-chart-panel .button.with-arrow,.symbol-edit-widget .button.with-arrow{padding-right:25px}.is-mobile .header-chart-panel .button.with-arrow,.is-mobile .symbol-edit-widget .button.with-arrow{padding-right:46px}.symbol-edit-widget{height:27px;-webkit-user-select:none;position:relative}.is-mobile .symbol-edit-widget{width:170px}.symbol-edit-widget.no-button{width:110px}input.symbol-edit,.symbol-search-dialog input{background-color:#fff;border:1px solid #c9cbcd;width:291px;height:28px;padding:0 0 0 7px;color:#524f4f;font:13px 'Open Sans',sans-serif;font-weight:600;float:left}input.symbol-edit .is-mobile,.symbol-search-dialog input .is-mobile{color:#fff}.symbol-edit-widget .symbol-edit-wrap{position:absolute;z-index:1;width:100px;height:27px;top:0;left:0;transition:width .2s}.symbol-edit-widget .symbol-edit-wrap.expanded{width:484px;box-shadow:#f1f3f6 0 0 10px 10px;transition:width .4s;z-index:2}.is-mobile .symbol-edit-widget .symbol-edit-wrap{width:170px;height:40px}.is-mobile .symbol-edit-widget .symbol-edit-wrap.expanded{box-shadow:#fff 0 0 10px 10px;width:554px}.symbol-edit-widget .symbol-edit-inputspacer{padding:0 9px 0 0;overflow:hidden}.is-mobile .symbol-edit-widget .symbol-edit-inputspacer{height:40px;padding-right:11px}.is-mobile .symbol-edit-widget .symbol-edit-inputspacer input.symbol-edit{height:36px;border-width:2px;border-color:#b5b7ba}.symbol-edit-widget .symbol-edit-inputspacer input.symbol-edit{width:100%}.symbol-edit-wrap .symbol-edit-buttonswrap{height:30px;width:0;position:relative;overflow:hidden;background:#ff0;float:right;transition:width .2s}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap{height:40px}.symbol-edit-wrap.expanded .symbol-edit-buttonswrap{width:101px;transition:width .4s}.is-mobile .symbol-edit-wrap.expanded .symbol-edit-buttonswrap{width:172px}.symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions{position:absolute;top:0;right:0;width:100px}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions{height:36px;border:2px solid #b5b7ba;width:170px}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button{height:36px;width:34px;border-right:2px solid #b5b7ba}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button:last-child{border-right:0}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button .action-icon{top:8px;left:6px}input.symbol-edit.with-plus{padding-right:26px}input.symbol-edit.incomplete,.symbol-search-dialog input.incomplete{background-color:#ffffef}input.symbol-edit.error,input.symbol-edit.interval-error,.symbol-search-dialog input.error,.symbol-search-dialog input.interval-error{background-color:#ffefef}.symbol-search-loading{background:url(images/loading-small.gif) 50% 50% no-repeat;width:24px;height:24px;padding:3px;margin:0 auto}.property-page input.symbol-edit{padding:0 5px}div.symbol-edit-popup{position:absolute;width:550px;display:block;border:1px solid #c9cbcd;z-index:111;background:#fff;background:rgba(255,255,255,.9)}div.symbol-edit-popup .table-wrapper{border-top:1px solid #e5e4e4;overflow-y:auto;width:550px}table.symbol-edit-popup{border-collapse:collapse}table.symbol-edit-popup tr.group-title{cursor:default}table.symbol-edit-popup tr.group-title td:first-child div{position:relative;border-color:#ccc;-webkit-transition:-webkit-border-color .1s linear;-moz-transition:-moz-border-color .1s linear;-o-transition:border-color .1s linear;-ms-transition:border-color .1s linear;transition:border-color .1s linear}table.symbol-edit-popup tr.group-title td:first-child div:before{content:'';display:block;position:absolute;top:50%;left:-13px;margin-top:-2px;width:0;height:0;border-color:inherit;border-style:solid;border-left-width:4px;border-right-width:4px;border-top-width:7px;border-bottom-width:0}table.symbol-edit-popup tr.group-title:not(.collapsed) td:first-child div:before{border-left-color:transparent;border-right-color:transparent}table.symbol-edit-popup tr.group-title.collapsed td:first-child div{border-color:#ccc}table.symbol-edit-popup tr.group-title.collapsed td:first-child div:before{left:-12px;margin-top:-3px;border-top-width:4px;border-bottom-width:4px;border-top-color:transparent;border-bottom-color:transparent;border-left-width:7px;border-right-width:0}table.symbol-edit-popup tr.group-title.symbol-edit-popup-active td:first-child div,table.symbol-edit-popup tr.group-title:hover td:first-child div{border-color:#555}table.symbol-edit-popup tr.group-close{pointer-events:none}table.symbol-edit-popup tr.group-close td{padding:0;height:0;font-size:0;background-color:transparent}table.symbol-edit-popup tr.hidden{display:none}table.symbol-edit-popup td{padding:7px}table.symbol-edit-popup td:first-child{padding-left:20px}table.symbol-edit-popup td:last-child{max-width:130px;padding-right:20px}tr.symbol-edit-popup{cursor:pointer;height:25px}tr.symbol-edit-popup td:first-child{max-width:105px}span.symbol-edit-highlight{color:#4c82ce;font-weight:700}.symbol-edit-popup-td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:230px;line-height:14px;vertical-align:middle}.symbol-edit-popup-td.name{font-weight:700}.symbol-edit-popup-td.desc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.symbol-edit-popup-td.name strong,.symbol-edit-popup-td.desc strong{font-weight:700;color:#4c82ce}.symbol-edit-popup-td.type{font-size:11px;color:#999;white-space:nowrap;text-align:right}tr.symbol-edit-popup:hover:not(.group-title):not(.group-close){background:#f2f5f8}.symbol-edit-popup-active{background:#d1e1f8}.symbol-edit-popup i.eod,.symbol-edit-popup i.pro{display:inline-block;height:auto;width:auto;font-size:10px;color:#fff;text-transform:uppercase;font-style:normal;line-height:12px;vertical-align:0;padding:1px 3px 0;overflow:visible}.symbol-edit-popup i.eod{background:#c9cbcd}.symbol-edit-popup i.pro{background:#bf645c}.symbol-edit-plus{display:block;width:25px;height:28px;position:absolute;top:1px;right:0;cursor:pointer}.symbol-edit-plus span{display:block;width:15px;height:15px;position:relative;top:7px;left:3px;background:url(images/icons.png) no-repeat -80px -220px}.symbol-edit-plus:hover span{background-position:-120px -300px}.symbol-edit-history-popup{padding:1px;overflow-y:auto;border:1px solid #999;z-index:11;cursor:pointer;background:#fff;background:rgba(255,255,255,.9);box-shadow:0 1px 2px rgba(0,0,0,.3);width:410px}.symbol-edit-history-popup .heading{background:#ddd;cursor:pointer;padding:4px 5px;color:#626262;font-size:11px;font-weight:700;cursor:default}.symbol-edit-history-popup .symbol{cursor:pointer;height:14px;padding:5px;color:#595959;font:12px Arial;clear:both;position:relative}.symbol-edit-history-popup .symbol .s{float:left;width:70px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.symbol-edit-history-popup .symbol .d{float:left;width:247px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.symbol-edit-history-popup .symbol .t{position:absolute;right:3px;top:5px;color:#999;font-size:11px;text-align:right}.symbol-edit-history-popup .symbol:hover{background:#e5edf7;color:#29313c}.symbol-search-dialog .symbol-block{width:auto;margin:0;overflow:hidden}.symbol-search-dialog .symbol-block .spread-actions{height:36px;border-top:0;border-right:0;background:#fff}.symbol-search-dialog .symbol-block button{width:30px;height:36px;border-left:1px solid #c9cbcd}.symbol-search-dialog .symbol-block button:first-child{border-left:0}.symbol-search-dialog .symbol-block button .action-icon{top:8px;left:4px}.symbol-search-dialog .symbol-block-inputspacer{overflow:hidden}.symbol-search-dialog .symbol-block-inputspacer input{width:100%;height:37px;font-size:13px;margin:0;padding:0 7px 0 34px;border-width:0;border-bottom-width:1px;border-radius:0;float:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.symbol-search-dialog .symbol-block-inputspacer .search-cion{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.symbol-search-dialog .filter{padding:0 20px;border-bottom:1px solid #e5e4e4}.symbol-search-dialog .filter a.type-filter,.symbol-search-dialog .filter .exchange-filter{position:relative;display:inline-block;margin-right:20px;padding:10px 0;color:#595959}.symbol-search-dialog .filter a.type-filter a,.symbol-search-dialog .filter .exchange-filter a{color:#595959}.symbol-search-dialog .filter a.type-filter.active,.symbol-search-dialog .filter .exchange-filter.active{font-weight:700}.symbol-search-dialog .filter a.type-filter.active:after,.symbol-search-dialog .filter .exchange-filter.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.symbol-search-dialog .filter a.type-filter:last-child,.symbol-search-dialog .filter .exchange-filter:last-child{margin-right:0}.symbol-search-dialog .results{height:500px;overflow-x:hidden;overflow-y:auto;margin:0}.symbol-search-dialog .results table{width:100%;border-collapse:collapse}.symbol-search-dialog .results table .symbol-edit-popup-td:first-child{padding-left:20px}.symbol-search-dialog .results table .symbol-edit-popup-td:last-child{padding-right:20px}.symbol-search-dialog .results table tr:first-child .symbol-edit-popup-td{padding-top:12px}.spread-actions{float:right;height:28px;border:1px solid #c9cbcd;background:#fff;margin:0}.spread-actions button::-moz-focus-inner{padding:0!important;margin:0!important}.spread-actions button{position:relative;float:left;width:20px;height:25px;background:0 0;padding:0;margin:0;border:0;cursor:pointer}.spread-actions button.disabled{cursor:default}.spread-actions button .action-icon{position:absolute;top:3px;left:0;width:20px;height:20px;display:block;overflow:hidden}.spread-actions button .action-icon .sprite{height:60px;width:20px;background:url(images/dialogs/spread-actions.png) 0 0 no-repeat;position:absolute;left:0;top:0;margin-top:1px}.spread-actions button:hover .action-icon .sprite{top:-20px}.spread-actions button.disabled .action-icon .sprite{top:-40px}.spread-actions button.div .action-icon .sprite{background-position:0 0}.spread-actions button.minus .action-icon .sprite{background-position:-20px 0}.spread-actions button.plus .action-icon .sprite{background-position:-40px 0}.spread-actions button.mult .action-icon .sprite{background-position:-60px 0}.spread-actions button.open .action-icon .sprite{background-position:-80px 0}.spread-actions button.close .action-icon .sprite{background-position:-100px 0}.spread-actions button.flip .action-icon .sprite{background-position:-120px 0}div.symbol-edit-popup .exchange-filter,.symbol-search-dialog .exchange-filter{float:right}div.symbol-edit-popup .exchange-filter .tv-unstyled-select-container{display:inline-block}.symbol-search-dialog .exchange-filter .sbSelector{display:block;margin:0 12px 0 0}div.symbol-edit-popup .exchange-filter .sbSelector{display:block;margin:0 10px 0 0;font-weight:700;font-size:11px;height:13px}div.symbol-edit-popup .exchange-filter .sbToggle,.symbol-search-dialog .exchange-filter .sbToggle{width:9px;height:5px;position:absolute;top:6px;right:0;background:url(images/select-bg.png) 0 0}.symbol-edit-popup .filter{padding:0 20px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.symbol-edit-popup .filter a.type-filter,.symbol-edit-popup .filter .exchange-filter{padding:6px 0;margin-right:20px;font-weight:700;font-size:11px;display:inline-block;border-bottom:0;position:relative;color:#595959}.symbol-edit-popup .filter a.type-filter a,.symbol-edit-popup .filter .exchange-filter a{color:#595959}.symbol-edit-popup .filter a.type-filter.active:after,.symbol-edit-popup .filter .exchange-filter.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.symbol-edit-popup .filter a.type-filter:last-child,.symbol-edit-popup .filter .exchange-filter:last-child{margin-right:0}.symbol-edit-popup .filter .exchange-filter{margin:0}.compare-widget,.addsymbol-widget{position:relative}.compare-widget .symbol-edit-widget,.addsymbol-widget .symbol-edit-widget{margin:0 0 10px;width:300px}.compare-widget .symbol-edit-widget input.symbol-edit,.addsymbol-widget .symbol-edit-widget input.symbol-edit{width:265px;font-weight:400}.compare-widget .symbol-edit-widget input.symbol-edit:focus,.addsymbol-widget .symbol-edit-widget input.symbol-edit:focus{border-color:#4c82ce}.compare-widget .close-button,.addsymbol-widget .close-button{position:absolute;right:5px;top:5px}.compare-widget p,.addsymbol-widget p{margin:0;color:#8b8c8e;font-weight:700}.compare-widget p.vspace{margin:6px 0}.compare-widget p.note{font-weight:400;font-size:11px;margin-top:9px}.compare-widget p.note a{display:inline-block;border-bottom:dashed 1px #007fb9;font-weight:700}.compare-widget .tab-arrow{position:absolute;left:27px;top:-10px}.compare-widget .tv-button{padding:5px 18px;color:#8b8c8e}.compare-widget .predefine-section{float:left;margin:0 10px 0 0;font-size:12px}.compare-widget .predefine-heading{text-transform:uppercase;color:#000;margin:0 0 5px 3px}.addsymbol-widget .opts-line,.compare-widget .predefine-line{color:#4c5151}.addsymbol-widget .opts-line{margin:5px 0}.addsymbol-widget .opts-line label,.compare-widget .predefine-line label{position:relative;top:-2px;padding:0 0 0 4px}.header-chart-panel .button:hover,.symbol-edit-widget .button:hover{background:#fff;color:#333}.header-chart-panel .button:active,.header-chart-panel .button.active,.header-chart-panel .button.active:hover,.symbol-edit-widget .button:active,.symbol-edit-widget .button.active,.save-load-buttons a:not(.link):active,.save-load-buttons .active,.save-load-buttons .active:hover,.hotlist-controls .button.active,.hotlist-controls .button:active,.ch-controls .button.active,.ch-controls .button:active{background:#f2f5f8!important;color:#333}.header-chart-panel .icon-container-toggle{width:70px;margin:0}.header-chart-panel .icon-container-toggle a{height:14px}.header-chart-panel .button.no-last{border-top-right-radius:0;border-bottom-right-radius:0}.header-chart-panel .button.no-first{border-top-left-radius:0;border-bottom-left-radius:0;border-left:0}.is-mobile .favored-list-container{background:#b5b7ba;color:#fff}.favored-list-container>span,.favored-list-container>div{vertical-align:top}.favored-list-container>div{display:inline-block}.favored-list-container span{display:inline-block;height:14px;position:relative;vertical-align:top;color:#524f4f;font-size:11px;font-weight:700;background:#fff;border:1px solid #c9cbcd;border-width:1px 1px 1px 0;padding:7px 12px;cursor:default}.is-mobile .favored-list-container span{padding:15px 17px 11px;background:#b5b7ba;color:#fff;border:0}.is-mobile .favored-list-container span:active,.is-mobile .favored-list-container span.active,.is-mobile .favored-list-container span.selected{background:#b5b7ba!important;color:#58c3e5}.is-mobile .favored-list-container span:hover{background:#b5b7ba;color:#fff}.is-mobile .favored-list-container span.disabled,.is-mobile .favored-list-container span.disabled:active,.is-mobile .favored-list-container span.disabled.active{color:#ddd;background:#c2c4c6!important}.favored-list-container span:active,.favored-list-container span.active,.favored-list-container span.selected{background:#f2f5f8!important;color:#58c3e5}.favored-list-container span:hover{background:#fff;color:#68696b}.favored-list-container span.disabled,.favored-list-container span.disabled:active,.favored-list-container span.disabled.active{color:#adafb3;background:#f1f3f6!important;border-color:#c9cbcd;box-shadow:none}.favored-list-container .quick span:first-child{border-width:1px}.favored-list-container:not(.no-first) .favored-list-container .quick span:first-child{border-width:1px}.favored-list-container span.submenu{padding:0;width:20px;height:28px;position:relative}.is-mobile .favored-list-container span.submenu{width:30px;height:40px}.favored-list-container span.submenu i{display:block;width:9px;height:5px;position:absolute;top:12px;right:6px;background:url(images/select-bg.png)}.is-mobile .favored-list-container span.submenu i{background:#b5b7ba;background:url(images/mobile/select-bg.png);width:14px;height:8px;top:15px;right:8px}.is-mobile .favored-list-container span.submenu i:before{position:absolute;content:" ";width:1px;height:24px;background:#cbcdcf;top:-7px;left:-9px}.is-mobile .favored-list-container span.submenu i.study-template-icon{background:url(images/mobile/icons.png) -21px -18px}.is-mobile .favored-list-container span.submenu i.study-template-icon:before{display:none}.favored-list-container span.submenu.interval-dialog-button{border-right-style:dotted}.favored-list-container span.submenu.interval-dialog-button i{background:#8b8c8e;top:50%;left:50%;margin-top:-1px;margin-left:-1px;width:3px;height:3px}.is-mobile .favored-list-container span.submenu.interval-dialog-button i{background-color:#fff}.favored-list-container span.submenu.interval-dialog-button i:before,.favored-list-container span.submenu.interval-dialog-button i:after{content:'';display:block;position:absolute;left:0;width:3px;height:3px;background:inherit}.favored-list-container span.submenu.interval-dialog-button i:before{top:-6px}.favored-list-container span.submenu.interval-dialog-button i:after{bottom:-6px}.favored-list-container span.submenu.interval-dialog-button.active i{background:#5ec6e8}.is-mobile .favored-list-container span.submenu.interval-dialog-button.active i{background-color:#fff}.favored-list-container.active span.submenu,.favored-list-container span.submenu.active{color:#adafb3;background:#f1f3f6!important;border-color:#c9cbcd}.favored-list-container.active span.submenu i,.favored-list-container span.submenu.active i{background-position:0 -20px}.is-mobile .favored-list-container.active span.submenu i,.is-mobile .favored-list-container span.submenu.active i{background-position:0 -24px}.button.iconed,.header-chart-panel .button.iconed{padding:6px 10px 8px}.header-chart-panel .button.disabled,.header-chart-panel .button.disabled:active,.header-chart-panel .button.disabled.active{background:#fff!important;border-color:#e5e4e4;box-shadow:none}.header-chart-panel .button.disabled i{opacity:.5}.button.iconed i{display:inline-block;width:15px;height:15px;background-image:url(images/icons.png)}.button.undo,.button.redo{padding:8px 5px 6px}.button.undo svg,.button.redo svg{width:15px;height:14px;fill:#8a8b8d}.button.undo.disabled svg,.button.redo.disabled svg{fill:#a5a5a5}.header-chart-panel .button.redo{left:-1px}.button.fullscreen,.header-chart-panel .button.fullscreen{padding:5px 6px 9px}.button.fullscreen i{width:18px;height:18px;background-position:-180px -100px}.button.properties i{width:17px;height:17px;background-position:-160px -240px}.button.properties:hover i,.button.properties.active i{background-position:-40px -340px}.button.properties.active i{background-position:0 -440px}.button.alerts svg{width:20px;height:18px;fill:#8a8b8d}.button.alerts:hover svg,.button.alerts:active svg,.button.alerts.active svg{fill:#747474}.button.indicators i{width:17px;height:17px;background-position:-60px -420px}.button.indicators:not(:only-child){border-right:0}.button.indicators.active i{background-position:-93px -440px}.button.compare i{width:17px;height:17px;background-position:-120px -220px}.button.compare.active i{background-position:-126px -439px}.button.script-editor i{width:21px;height:17px;background-position:-38px -420px}.button.script-editor.active i{background-position:-71px -440px}.button.bars,.header-chart-panel .button.bars{padding:3px 22px 8px 9px}.button.bars i i,.chart-style-widget span i{display:inline-block;width:19px;height:19px;background:url(chart-client/css/images/bartype-icons.png)}.favored-list.study-template-popup{width:268px}.favored-list.study-template-popup .item .title-expanded{width:190px}.header-chart-panel .button.objects-tree{padding:6px 7px 8px 6px!important}.header-chart-panel .button.objects-tree i{width:18px;height:16px;background-position:1px -461px}.header-chart-panel .button.objects-tree:active i,.header-chart-panel .button.objects-tree.active i{background-position:-19px -461px}.favored-list-container.study-template-widget{float:left}.favored-list-container.study-template-widget .submenu{border-left-style:dotted;border-left-width:1px}.is-mobile .favored-list-container.study-template-widget .submenu{border-left:0}.favored-list-container.study-template-widget .quick>span{padding:7px 4px}.favored-list-container.study-template-widget .quick>span i{display:block;background:url(images/icons.png) 0 -380px;width:13px;margin-top:1px;height:13px}.favored-list-container.study-template-widget .quick>span:first-child{border-left-width:1px}.favored-list-container.study-template-widget .quick>span:last-child{border-right-style:none}.header-chart-panel .button.published-timeline{padding:4px 7px 10px}.header-chart-panel .button.published-timeline:not(:only-child){border-right-style:dotted}.header-chart-panel .button.published-timeline i{width:19px;height:19px;background-position:-119px -340px}.header-chart-panel .button.published-timeline:active i,.header-chart-panel .button.published-timeline.active i{background-position:-139px -340px}.header-chart-panel .button.published-settings{position:relative;border:1px solid #c9cbcd;border-width:1px 1px 1px 0;cursor:default;padding:0;width:20px;height:28px;display:inline-block}.header-chart-panel .button.published-settings i{display:block;width:9px;height:5px;position:absolute;top:12px;right:6px;background:url(images/select-bg.png)}.header-chart-panel .button.published-settings:active i,.header-chart-panel .button.published-settings.active i{background-position:0 -20px}.is-mobile .header-chart-panel .button.published-settings:active i,.is-mobile .header-chart-panel .button.published-settings.active i{background-position:0 -24px}.up-active{position:relative}.charts-popup-list.chart-style-popup{width:195px}.charts-popup-list.chart-style-popup .item .title{width:120px}.chart-style-popup .item{padding:7px 7px 6px;height:18px}.chart-style-popup .item span.icon{width:19px;height:19px;margin-top:-1px}.chart-style-popup .item.active span.icon{background-position-y:-19px!important}.chart-style-widget span{padding:4px 8px 10px}.header-chart-panel .button.eotpro-button{color:#fff;background:#0071bc;border-color:#276b91}.header-chart-panel .button.eotpro-button:hover{color:#eee;background:#1088cb}.header-chart-panel .button.eotpro-button:hover .arrow-icon{border-color:#eee transparent transparent}.header-chart-panel .button.eotpro-button.active,.header-chart-panel .button.eotpro-button:active{color:#eee;background:#1088cb!important}.header-chart-panel .button.eotpro-button.active .arrow-icon,.header-chart-panel .button.eotpro-button:active .arrow-icon{border-color:#eee transparent transparent}.header-chart-panel .button.eotpro-button .arrow-icon{width:0;height:0;border-style:solid;border-width:5px 4.5px 0;border-color:#fff transparent transparent}@media (max-width:550px){div.symbol-edit-popup{width:100%}div.symbol-edit-popup .filter{padding:0 10px}div.symbol-edit-popup .filter a.type-filter,div.symbol-edit-popup .filter .exchange-filter{margin-left:0;margin-right:10px}div.symbol-edit-popup .table-wrapper{width:100%}table.symbol-edit-popup{width:100%;table-layout:fixed}table.symbol-edit-popup td{padding:5px}table.symbol-edit-popup td:first-child{padding-left:10px}.symbol-edit-popup-td{overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.symbol-edit-popup-td.name{width:30%}.symbol-edit-popup-td.desc{width:40%}.symbol-edit-popup-td.type{width:30%}}#footer-chart-panel{min-height:28px;padding:0 5px 5px;background-color:#f1f3f6;position:relative;text-align:center}.is-mobile #footer-chart-panel{padding:6px 0;background-color:#fff}.is-mobile #footer-chart-panel .tools-group{float:left}.is-mobile #footer-chart-panel .publish-buttons{margin-top:8px}.is-mobile #footer-chart-panel .publish-buttons a.getimage,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button{margin-right:30px}.is-mobile #footer-chart-panel .publish-buttons a.getimage .icon,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage .icon,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage .icon,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button .icon{background:url(images/mobile/icons.png) no-repeat}.is-mobile #footer-chart-panel .publish-buttons a.getimage{width:40px;height:40px;border:2px solid #91b521;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.getimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.getimage:active,.is-mobile #footer-chart-panel .publish-buttons a.getimage.active,.is-mobile #footer-chart-panel .publish-buttons a.getimage.selected{background:#fff;border:2px solid #91b521}.is-mobile #footer-chart-panel .publish-buttons a.getimage:not([disabled]),.is-mobile #footer-chart-panel .publish-buttons a.getimage:active:not([disabled]),.is-mobile #footer-chart-panel .publish-buttons a.getimage.active:not([disabled]){background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.getimage .icon{top:2px;width:20px;height:17px;background-position:0 0}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage{width:40px;height:40px;border:2px solid #f46f35;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage:active,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage.active,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage.selected{background:#fff;border:2px solid #f46f35}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage .icon{top:2px;width:20px;height:17px;background-position:-20px 0}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage{width:40px;height:40px;border:2px solid #af3b37;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage:active,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage.active,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage.selected{background:#fff;border:2px solid #af3b37}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage .icon{top:1px;width:20px;height:17px;background-position:-40px 0}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button{padding-left:3px;padding-right:3px;width:40px;height:40px;border:2px solid #00adce;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button:hover,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button:active,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button.active,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button.selected{background:#fff;border:2px solid #00adce}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button .icon{top:1px;left:3px;width:24px;height:17px;background-position:-60px 0}#footer-chart-panel.publish-widget{min-height:41px;border-top:1px solid #d9dadb;padding:5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#footer-chart-panel.publish-widget label.usage-help{font-size:12px;line-height:30px;margin-left:5px}#footer-chart-panel a.bottom-panel-button,#footer-chart-panel a.bottom-panel-options-button{position:relative;z-index:1;float:left;vertical-align:top;background:#fff;border:1px solid #c9cbcd;height:15px;padding:7px 10px 6px 6px;color:#555;font-size:11px;font-weight:600;cursor:default}#footer-chart-panel a.bottom-panel-button:hover,#footer-chart-panel a.bottom-panel-options-button:hover{z-index:2;border-color:#b5b7b9}#footer-chart-panel a.bottom-panel-button.active,#footer-chart-panel a.bottom-panel-options-button.active,#footer-chart-panel a.bottom-panel-button:active,#footer-chart-panel a.bottom-panel-options-button:active{border-left-style:solid;background-color:#f2f5f8;color:#4ab2dc}#footer-chart-panel .bottom-panel-options-button.disabled{display:none}#footer-chart-panel .trading-indicator{color:#a00;height:14px;width:10px;padding-right:5px}#footer-chart-panel .trading-indicator.connected{fill:#00a000}#footer-chart-panel .trading-indicator.connecting{fill:#ff0}#footer-chart-panel .trading-indicator.disconnected{fill:gray}#footer-chart-panel .trading-indicator.failed{fill:red}#footer-chart-panel .trading-indicator.logout{fill:gray}#footer-chart-panel input.bottom-panel-button.disabled{color:#999}#footer-chart-panel input.bottom-panel-button.connected{color:#0a0}#footer-chart-panel a.bottom-panel-button{margin-left:4px}#footer-chart-panel a.bottom-panel-options-button{margin-left:-1px;width:20px;border-left-style:dotted;padding-left:0;padding-right:0}#footer-chart-panel a.bottom-panel-options-button i{display:block;width:12px;height:12px;margin:1px auto;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1190px}#footer-chart-panel a.bottom-panel-options-button.active i,#footer-chart-panel a.bottom-panel-options-button:active i{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1212px}table.footer-chart-panel-wrapper{height:32px;border-collapse:collapse}table.footer-chart-panel-wrapper td{padding:0;vertical-align:top}#footer-chart-panel a.publish-chart-button{cursor:default;background:#00b2d0;color:#fff;padding:8px 14px 7px;font-size:12px;font-weight:700;float:left;height:15px;margin:0 0 0 7px}#footer-chart-panel a.publish-chart-button.inprogress{background:#ffb03b}#footer-chart-panel a.getimage,#footer-chart-panel a.tweetimage,#footer-chart-panel a.stocktwitimage{float:left;margin:0 0 0 7px;position:relative}#footer-chart-panel a.getimage .icon,#footer-chart-panel a.tweetimage .icon,#footer-chart-panel a.stocktwitimage .icon{fill:#fff;background-image:none}a.getimage{padding:8px 5px 7px;border:0}a.getimage:not([disabled]),a.getimage:active:not([disabled]),a.getimage.active:not([disabled]){background:#5cb888}a.getimage .icon{width:20px;height:16px;position:relative;top:-1px}#footer-chart-panel a.tweetimage{padding:8px 5px 7px;background:#00c9ff}#footer-chart-panel a.tweetimage .icon{width:20px;height:16px;position:relative;top:-1px}#footer-chart-panel a.stocktwitimage{padding:8px 5px 7px;background:#ae3836}#footer-chart-panel a.stocktwitimage .icon{width:22px;height:14px}.icon-container,.icon-container-toggle,#footer-chart-panel .icon-container-select{float:right;margin:0 5px 0 0}.icon-container-add-space{margin-right:10px}.icon-container-extra-space{margin-right:20px}.icon-container a{cursor:default;padding:4px 5px 3px;border:1px solid #c9cbcd;border-right:0;float:left;height:19px;background:url(images/button-bg.png) 0 0;text-align:center;color:#606060;font-size:11px;font-weight:700}.icon-container a:hover{background:#fff}.icon-container a:active{background:#f4f7f9;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.icon-container-toggle a{cursor:default;padding:6px 0 5px;border:1px solid #c9cbcd;border-right:0;float:left;height:15px;background:url(images/button-bg.png) 0 0;text-align:center;color:#8b8c8e;font:700 12px Calibri,Arial,sans-serif;width:29px;text-decoration:none!important}.icon-container-toggle a:hover{color:#68696b;background:#fff}.icon-container-toggle a:active,.icon-container-toggle a.active{background:#f4f7f9;color:#68696b;border-color:#c9cbcd;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.icon-container-toggle a.active+a,.icon-container-toggle a:active+a{border-left-color:#c9cbcd}.icon-container a img{vertical-align:baseline}.icon-container .icon-right,.icon-container-toggle .icon-right{border-right:1px solid #c9cbcd;border-top-right-radius:3px;border-bottom-right-radius:3px}.icon-container .icon-left,.icon-container-toggle .icon-left{border-top-left-radius:3px;border-bottom-left-radius:3px}.icon-container-toggle a.disabled,.icon-container-toggle a.disabled:hover,.icon-container-toggle a.disabled:active{color:silver;background:#fff!important;box-shadow:none}.icon-container .icon-individual{border-radius:2px;border-right:1px solid #c9cbcd}.icon-container-toggle a:active,.icon-container-toggle a.active,.icon-container a:active{background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9);background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9);background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9);background:-o-linear-gradient(top,#f2f7fa,#f4f7f9);background:linear-gradient(top,#f2f7fa,#f4f7f9)}.load-charts-list{width:145px;border:1px solid #999;border-radius:2px;padding:1px;background:#fff;box-shadow:0 1px 2px #bfbfbf;z-index:10;overflow-y:auto}.load-charts-list>div{padding:4px 5px;color:#3e4040;cursor:default}.load-charts-list>div:hover{background:#f4f7f9}.load-charts-list>div.selected{background:#d1e1f8}.load-charts-list>div div:first-child{font-weight:700}.load-charts-list>div div:last-child{font-size:11px}.publish-buttons{float:right}.publish-buttons .tv-button{border-width:0}.save-load-buttons{margin:0;float:left}.save-load-buttons>span{display:block;float:left;height:15px;max-width:80px;border:1px solid #c9cbcd;border-width:1px 0 1px 1px;padding:7px 12px 6px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#fff;text-align:center;color:#555;font-size:11px;font-weight:600;cursor:default}.save-load-buttons>span:hover{color:#333}.save-load-buttons>span:active,.save-load-buttons>span.active{background-color:#f4f7f9}.save-load-buttons>span.first{border-left:1px solid #c9cbcd}.save-load-buttons>span.last{border-right:1px solid #c9cbcd}.save-load-buttons .save.titled,.save-load-buttons .copy.titled{border-right:0;position:relative;padding-right:15px}.save-load-buttons .title.read-only{cursor:default}.save-load-buttons .read-only{color:#8b8c8e}.save-load-buttons .separator{display:none;width:7px;height:28px;position:absolute;top:0;right:0;background:url(images/save-load-separator-inv.png) 0 50% no-repeat}.save-load-buttons .separator.clicked{background-position:-7px 50%}.save-load-buttons .save.titled .separator,.save-load-buttons .copy.titled .separator{display:block}.save-load-buttons .load{border-right:0}.save-load-buttons .arrow-icon{display:inline-block;height:5px;width:9px;margin:0 0 0 6px;padding-top:1px;background:url(images/select-bg.png) repeat scroll 0 0 transparent}.save-load-buttons .options .arrow-icon{margin:0}.save-load-buttons .options{padding-left:3px;padding-right:3px}.save-load-buttons .active .arrow-icon{background-position:0 -20px}.save-load-buttons .title{position:relative;max-width:136px;padding-left:5px;padding-right:5px;border-left:0;background:#e6e6e6;cursor:pointer}.save-load-buttons .title .sizer{display:block;min-width:50px;height:10px;visibility:hidden;margin:0;padding:0;border:0;font:700 11px sans-serif;text-align:right}.save-load-buttons input,.save-load-buttons .input{position:absolute;top:7px;left:5px;width:50px;margin:0;padding:0;border:0;background:0 0;color:#737475;font:700 11px sans-serif;text-align:left;cursor:pointer}.save-load-buttons input:focus,.save-load-buttons .input:focus{color:#404040;cursor:text}.save-load-buttons .input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.save-load-buttons .no-change{background:#e6e6e6}.save-load-buttons .process,.save-load-buttons .no-change.process{background:url(images/bar-loader.gif) 0 0 repeat!important;box-shadow:none!important}.layout-toggle-container{float:left;margin-right:4px}.layout-toggle-container .tv-button{padding:0;width:45px;height:28px;position:relative;background:#fff}.layout-toggle-container .tv-button:before{content:" ";position:absolute;top:12px;right:7px;width:0;height:0;border-style:solid;border-width:5px 4.5px 0;border-color:#8f9091 transparent transparent}.layout-toggle-container .tv-button.active{background:#f1f3f6!important}.layout-toggle-container .tv-button.active:before{border-width:0 4.5px 5px;border-color:transparent transparent #81bde2}.layout-toggle-container .tv-button i{position:absolute;width:29px;height:23px;top:2px;left:1px;background-image:url(images/bottomtoolbar/layout-buttons.png)}.layout-widget{position:absolute;z-index:120;border:1px solid #c9cbcd;padding:12px 12px 8px;background:#fff;color:#4c5151}.layout-widget .layout-button{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:31px;height:25px;border:1px solid transparent;background-image:url(images/bottomtoolbar/layout-buttons.png);cursor:pointer}.layout-widget .layout-button.active{border-color:#c9cbcd;background-color:#f2f5f8}.layout-widget .input-row{margin:4px}.layout-widget .input-row label{position:relative;top:-2px;padding:0 0 0 4px}.tv-side-toolbar{background:#fff;width:51px;color:#babdc2;border-right:1px solid #c9cbcd}.is-mobile .tv-side-toolbar{width:auto;border-right:0;border-top:1px solid #c9cbcd;width:100%}.is-mobile .tv-side-toolbar .tools-group{display:inline-block;margin:3px 0 5px}.is-mobile .tv-side-toolbar .tools-group .button{position:relative;display:inline-block;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;width:40px;height:40px;border:2px solid #b5b7ba;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff;background:0 0;margin-left:15px;margin-right:15px}.is-mobile .tv-side-toolbar .tools-group .button:hover,.is-mobile .tv-side-toolbar .tools-group .button:active,.is-mobile .tv-side-toolbar .tools-group .button.active{background:#fff}.is-mobile .tv-side-toolbar .tools-group .button:hover,.is-mobile .tv-side-toolbar .tools-group .button:active,.is-mobile .tv-side-toolbar .tools-group .button.active,.is-mobile .tv-side-toolbar .tools-group .button.selected{background:#fff;border:2px solid #b5b7ba}.is-mobile .tv-side-toolbar .tools-group .button .main{top:3px;left:3px;margin:0;border:0;background:transparent!important}.is-mobile .tv-side-toolbar .tools-group .button .main .text-as-icon{left:3.5px;top:2px}.is-mobile .tv-side-toolbar .tools-group .button .side{content:" ";position:absolute;visibility:visible;top:-12px;left:16px;width:0;height:0;border-style:solid;border-width:0 3px 3px;border-color:transparent transparent #c9cbcd;background:0 0}.is-mobile .tv-side-toolbar .tools-group .button .side::-moz-focus-inner{border:0}.is-mobile .tv-side-toolbar .tools-group .button i{top:3px;left:7px}.is-mobile .tv-side-toolbar .tools-group .button:hover i{top:3px;left:7px}.tv-side-toolbar.two-column{width:97px}.tv-side-toolbar.two-column .tv-close-panel{left:98px}.tv-side-toolbar.two-column .tools-group{margin-right:0}.tv-side-toolbar.two-column .tools-group:not(:first-child):not(.no-delimiter):before{width:87px}.tv-side-toolbar.two-column .tools-group:first-child{margin-bottom:-5px}.tv-side-toolbar.two-column .tools-group .button{display:inline-block;width:39px;margin-right:5px}.tv-side-toolbar.hidden{width:0;overflow:hidden}.tv-side-toolbar.hidden>div{display:none}.tv-side-toolbar.hidden .tv-close-panel{left:1px}.tv-side-toolbar .tv-close-panel{position:absolute;top:50%;left:52px;margin-top:-20px;z-index:1}.charts-popup-list.main-menu-popup{margin-top:0}.tv-side-toolbar .main-menu{display:block;width:39px;height:39px;margin:auto;background:url(images/small-logo.png) center center no-repeat;position:relative;cursor:pointer}.tv-side-toolbar .main-menu:hover,.tv-side-toolbar .main-menu:active,.tv-side-toolbar .main-menu.active{background-color:#e3e5e8}.tv-side-toolbar .main-menu.with-avatar{background:#fff}.tv-side-toolbar .main-menu a{position:absolute;top:0;right:0;padding:1px;background:#5091f7;color:#fff;font-size:10px;font-weight:700;text-align:center;z-index:1;margin-top:1px;margin-right:1px}.tv-side-toolbar .main-menu img{display:block;width:39px;height:39px;position:relative;top:0;left:0}.tv-side-toolbar .tools-group:not(:first-child):not(.no-delimiter):before{content:"";display:block;width:41px;height:1px;position:relative;left:0;background:#cecfd1}.is-mobile .tv-side-toolbar .tools-group:not(:first-child):not(.no-delimiter):before{width:1px;height:36px;position:absolute;top:7px}.tv-side-toolbar .tools-group.bottom-delimiter:after{content:"";display:block;width:41px;height:1px;position:relative;left:0;background:#cecfd1}.tv-side-toolbar .tools-group{margin:5px;position:relative}.tv-side-toolbar .tools-group .button,.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{border:1px solid transparent;cursor:default}.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{display:inline-block}.tv-side-toolbar .tools-group .button{display:block;height:30px;margin:6px 0 0;position:relative}.tv-side-toolbar .tools-group .button.hidden{display:none}.tv-side-toolbar .tools-group .button .main.grayed{opacity:.3}.tv-side-toolbar .help-button-container{position:absolute;left:0;bottom:0;z-index:1;height:38px;width:50px;background:#fff}.tv-side-toolbar .help-button-container:before{content:'';display:block;width:100%;height:5px;position:absolute;top:-5px;left:0;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ffffff', GradientType=0)}.tv-side-toolbar .tools-group .button .main{position:absolute;top:0;left:0;width:30px;height:30px}.tv-side-toolbar .tools-group .button .main.text-as-icon{font-weight:700;font-family:FontAwesome;padding-top:7px;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#777;font-size:19px}.tv-side-toolbar .tools-group .button:hover .main.text-as-icon,.charts-popup-list.font-awesome .item span{color:#7d7d7d}.tv-side-toolbar .tools-group .button.selected .main.text-as-icon{color:#5ec6e8}.tv-side-toolbar .tools-group .button .side{position:absolute;top:0;left:30px;width:8px;height:30px;border-left:1px dotted #b6b9be;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAK0lEQVR4AWPYvufAfwYYWLxs9f+tu/b9h3NAeNPO/f/hnI07gLLIylAMAADDBCS+f7PA8AAAAABJRU5ErkJggg==) center center no-repeat;visibility:hidden}.tv-side-toolbar .tools-group .button:hover,.tv-side-toolbar .tools-group .button:active,.tv-side-toolbar .tools-group .button.active,.tv-side-toolbar .tools-group .button.selected,.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{background-color:#fff;border-color:#c9cbcd}.tv-side-toolbar .tools-group .button:not(.subgroup):active,.tv-side-toolbar .tools-group .button:not(.subgroup).active,.tv-side-toolbar .tools-group .button:not(.subgroup).selected,.properties-toolbar .tools-group .button:active,.properties-toolbar .tools-group .button.active,.drawing-favorites-toolbar .tools-group .button:active,.drawing-favorites-toolbar .tools-group .button.active,.tv-side-toolbar .tools-group .button.selected .main,.tv-side-toolbar .tools-group .button:active .side,.tv-side-toolbar .tools-group .button.active .side{background-color:#f2f5f8}.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup):active,.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup).active,.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup).selected,.is-mobile .properties-toolbar .tools-group .button:active,.is-mobile .properties-toolbar .tools-group .button.active,.is-mobile .drawing-favorites-toolbar .tools-group .button:active,.is-mobile .drawing-favorites-toolbar .tools-group .button.active,.is-mobile .tv-side-toolbar .tools-group .button.selected .main,.is-mobile .tv-side-toolbar .tools-group .button:active .side,.is-mobile .tv-side-toolbar .tools-group .button.active .side{background-color:transparent}.tv-side-toolbar .tools-group .button:hover .side,.tv-side-toolbar .tools-group .button:active .side,.tv-side-toolbar .tools-group .button.active .side,.tv-side-toolbar .tools-group .button.selected .side{visibility:visible}.tv-side-toolbar .tools-group .button.subgroup:hover:after,.tv-side-toolbar .tools-group .button.subgroup:active:after,.tv-side-toolbar .tools-group .button.subgroup.active:after,.tv-side-toolbar .tools-group .button.subgroup.selected:after{background-position:0 -10px}.tv-side-toolbar .tools-group .button i,.tv-side-toolbar .tools-group .button:hover i{display:block;width:30px;height:30px;position:absolute;top:1px;left:8px;background:url(images/sidetoolbar/instruments.png) no-repeat}.tv-side-toolbar .tools-group .button.subgroup i,.tv-side-toolbar .tools-group .button.subgroup:hover i{position:absolute;left:0;top:0}.tv-side-toolbar .tools-group .button.objects-tree i{background-position:-1px -2561px}.tv-side-toolbar .tools-group .button.objects-tree:active i{background-position:-33px -2561px}.tv-side-toolbar .tools-group .button.action:hover{background:#efeff2;border-color:#c9cbcd}.tv-side-toolbar .label{display:block;margin:10px 0 2px;font-size:9px;text-align:center;color:#a1a2a4;cursor:default}.tv-side-toolbar .tools-group .tvcolorpicker-widget{border-color:#babdc2;margin:0 7px 7px}.tv-side-toolbar .tools-group.hide-square div:nth-child(1) span.square{display:none}.tv-side-toolbar .slider{display:block;position:relative;left:13px;width:16px;height:102px}.tv-side-toolbar .slider i{display:block;width:16px;height:16px;border-radius:8px;background:url(images/sidetoolbar/slider-control.png) no-repeat;cursor:pointer;z-index:1}.tv-side-toolbar .slider span{display:block;height:79px;width:14px;position:absolute;left:1px;top:8px;background:url(images/sidetoolbar/slider-bg.png) no-repeat}.help-menu{position:absolute;padding:1px;background:#fff;border:1px solid #c9cbcd;z-index:16}.help-menu span{display:block;position:relative;color:#5a5d66;font-size:13px;padding:7px 24px;cursor:pointer}.help-menu span.external:after{content:'';position:absolute;top:11px;right:7px;width:10px;height:10px;background:url(images/external-link/ext-onwhite.png) no-repeat center right}.help-menu span:hover{color:#414349;background-color:#f4f7f9}.keyboard-help{width:560px}.keyboard-help:after,.keyboard-help>.column:nth-child(2n):after{content:'';display:block;clear:both}.keyboard-help>.column{float:left;width:50%}.keyboard-help>.column-chart{width:290px}.keyboard-help>.column-watch{width:265px}.keyboard-help h4{margin:0}.keyboard-help p{line-height:1.85;margin:3px 0}.keyboard-help kbd{font-size:11px;border:1px solid #777;padding:2px 5px;-webkit-box-shadow:0 2px 0 #777;-moz-box-shadow:0 2px 0 #777;box-shadow:0 2px 0 #777}.line-tool-icons-popup{width:358px;font-size:19px}.line-tool-icons-popup .item{display:inline-block;padding:7px;height:19px;text-align:center}.line-tool-icons-popup .item.active span{color:#5ec6e8}.line-tool-icons-popup .item .title-expanded{width:20px;height:20px}.widgetbar-wrap{top:0;right:0;position:absolute;height:100%}.widgetbar-wrap.fullscreen{width:100%}.widgetbar-place .widgetbar-wrap{position:fixed;z-index:15}.widgetbar-handle{position:absolute;top:0;left:-3px;height:100%;width:5px;background:rgba(0,0,0,0);cursor:ew-resize}html.feature-touch .widgetbar-handle{left:-8px;width:15px}.widgetbar-tabs{position:absolute;height:100%;width:45px;right:0;top:0;background:#f1f3f6}.widgetbar-tabscontrols{position:absolute;width:100%;bottom:0}.widgetbar-tabscontrols-button{cursor:pointer;height:34px;width:34px;margin:auto}.widgetbar-tabscontrols-button:hover{background:#eee}.widgetbar-minimizebutton .icon{height:16px;width:20px;margin:9px 7px;background-position:-20px -360px}.widgetbar-minimizebutton.minimized .icon{height:16px;width:20px;margin:9px 7px;background-position:-40px -360px}.widgetbar-configbutton .icon{width:20px;height:20px;margin:7px;background-position:-60px -360px}.layout-edit-mode .widgetbar-configbutton .icon{width:22px;height:19px;margin:7px 6px;background-position:-175px -340px}.layout-edit-mode .widgetbar-configbutton,.layout-edit-mode .widgetbar-minimizebutton{display:none}.widgetbar-tab{cursor:pointer;position:relative;border-bottom:solid #c9cbcd 1px;background:#f1f3f6;padding:9px 0}.widgetbar-tab:hover,.widgetbar-tab.active{background:#fff}.widgetbar-tab.active .widgetbar-icon{fill:#5dc5e7}.widgetbar-tab-spacer{height:28px;background:#e7eaef;border-bottom:solid #c9cbcd 1px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:700;line-height:29px;color:#555;cursor:default}.widgetbar-newpage-button{cursor:pointer;position:relative}.widgetbar-newpage-button{display:none}.layout-edit-mode .widgetbar-newpage-button{display:block}.widgetbar-iconplace{display:block;position:relative;margin:1px;padding:6px 0}.widgetbar-newpage-icon,.widgetbar-newwidget-icon,.widgetbar-delete-icon,.widgetbar-icon{display:block;margin:0 auto;width:21px;height:21px;fill:#7d7d7d}.widgetbar-chart-helpbutton .widgetbar-icon{width:30px;height:30px}.widgetbar-icon.active{fill:#5dc5e7}.widgetbar-icon-watchlist{background-position:0 -63px}.widgetbar-icon-watchlist.active{background-position:-21px -63px}.widgetbar-icon-hotlist{background-position:0 -84px}.widgetbar-icon-hotlist.active{background-position:-21px -84px}.widgetbar-icon-detail{background-position:0 -105px}.widgetbar-icon-detail.active{background-position:-21px -105px}.widgetbar-icon-news,.widgetbar-icon-news_yahoo{background-position:0 -126px}.widgetbar-icon-news.active,.widgetbar-icon-news_yahoo.active{background-position:-21px -126px}.widgetbar-icon-chat{background-position:0 -147px}.widgetbar-icon-chat.active{background-position:-21px -147px}.widgetbar-icon-messages{background-position:0 -234px}.widgetbar-icon-messages.active{background-position:-21px -234px}.widgetbar-icon-news_stocktwits{background-position:0 -168px}.widgetbar-icon-news_stocktwits.active{background-position:-21px -168px}.widgetbar-icon-news_fxwirepro{background-position:0 -189px}.widgetbar-icon-news_fxwirepro.active{background-position:-21px -189px}.widgetbar-icon-news_futuresmag{background-position:0 -210px}.widgetbar-icon-news_futuresmag.active{background-position:-21px -210px}.widgetbar-icon-calendar{background-position:0 -334px}.widgetbar-icon-calendar.active{background-position:-21px -334px}.widgetpage-icon-svg-base{width:27px;height:22px}.widgetpage-icon-svg-chat{width:23px}.widgetpage-icon-svg-hotlists{height:23px}.widgetpage-icon-svg-calendar{height:23px}.widgetpage-icon-svg-messages{width:23px}.widgetpage-icon-svg-datawindow{width:23px}.widgetpage-icon-svg-notes{width:26px;height:26px}.widgetbar-newwidget-iconplace{cursor:pointer;display:none;position:relative;width:13px;height:13px;padding:6px;border-radius:12px;margin:0 0 0 5px}.layout-edit-mode .widgetbar-tab.active .widgetbar-newwidget-iconplace{display:block}.widgetbar-newwidget-icon{display:block;height:13px;width:13px;background-position:-5px -26px}.widgetbar-newpage-iconplace{position:relative;margin:0 0 0 -1px;padding:12px 7px;background:#39b978;display:block}.widgetbar-newwidget-iconplace,.widgetbar-newpage-iconplace,.widgetbar-applybutton{background:#39b978}.widgetbar-newpage-iconplace:hover,.widgetbar-newpage-iconplace.active,.widgetbar-newwidget-iconplace:hover,.widgetbar-newwidget-iconplace.active,.widgetbar-applybutton:hover{background:#4cbf85}.widgetbar-newpage-icon{width:23px;height:23px;background-position:0 -21px}.widgetbar-delete{position:absolute;top:3px;right:3px;width:28px;height:19px;padding:4px 0 5px;cursor:pointer}.widgetbar-delete:hover{background:#dd6e5b}.widgetbar-delete-icon{display:block;width:16px;height:19px;background-position:-26px -42px;margin:0 auto}.widgetbar-delete:hover .widgetbar-delete-icon{background-position:-26px -21px}.widgetbar-notification-wrap{display:none;position:absolute;bottom:-1px;width:100%;text-align:right}.widgetbar-notification{display:inline-block;font-size:12px;line-height:15px;padding:0 3px;min-width:9px;border-radius:3px;background:#e0745f;color:#fff;text-align:center;border:solid 1px #fff}.widgetbar-pages{position:absolute;top:0;right:45px;height:100%;background:#fff;border-left:solid #c9cbcd 1px;border-right:solid #c9cbcd 1px}.widgetbar-pages.hidden{border-right:0}.widgetbar-pages.hidden .widgetbar-pagescontent{display:none}.widgetbar-pagescontent{height:100%;overflow:hidden}.widgetbar-pages.layered{box-shadow:0 0 10px rgba(0,0,0,.15)}.widgetbar-pages .tv-close-panel{position:absolute;top:50%;left:-6px;margin-top:-20px;z-index:1}.widgetbar-page{display:none;height:100%}.widgetbar-page.active{display:block}.widgetbar-widget{margin:0 0 1px;position:relative;background-color:#fff}.widgetbar-widget.widgetbar-widget-maximized{position:absolute;top:0;left:0;width:100%;height:100%;z-index:6}.widgetbar-widget.widgetbar-widget-maximized .widgetbar-widgetbody{position:absolute;top:40px;bottom:0;left:0;width:100%;height:auto!important}.widgetbar-widgetheader{background:#f1f3f6;height:34px;cursor:default;margin:3px;-moz-box-sizing:border-box;box-sizing:border-box}.widgetbar-headerspace{position:relative;float:right;overflow:hidden;padding:2px 2px 0 0}.widgetbar-widgetheader-icon{float:left;background:#e8ebed;height:21px;width:21px;margin:7px 0 0 10px;background:url(images/widget-icons.png) 0 0 no-repeat}.widgetbar-widgetbody{position:relative;overflow:hidden}.widgetbar-widgetbody .widgetbody-overlay{position:absolute;top:0;height:100%;width:100%;z-index:5;background:rgba(255,255,255,.8)}.widgetbar-addwidgetpopup-itemtitle,.widgetbar-widgettitle{height:15px;padding:10px 0 9px 11px;white-space:nowrap;font-size:13px;line-height:15px;font-weight:700;color:#5a5c62}.widgetbar-widgettitle{overflow:hidden;text-overflow:ellipsis}.widgetbar-widgethandle{display:none;position:absolute;height:5px;top:-3px;left:0;width:100%;background:rgba(0,0,0,0)}html.feature-touch .widgetbar-widgethandle{height:15px;top:-8px}.widgetbar-widgethandle,.widgetbar-page.widget-resize-mode,.widgetbar-page.widget-resize-mode *{cursor:ns-resize}.widgetbar-widget+.widgetbar-widget .widgetbar-widgethandle{display:block}.layout-move-mode .widgetbar-widget .widgetbar-widgethandle{display:none}.layout-edit-mode .widgetbar-widgetbody{opacity:.2}.layout-edit-mode .widgetbar-headerspace{display:none}.widgetbar-tab-shield,.widgetbar-movemarker-self,.widgetbar-eventshield,.widgetbar-editshield{position:absolute;top:0;left:0;background:rgba(0,0,0,0);bottom:0;right:0}.widgetbar-tab-shield,.widgetbar-editshield,.widgetbar-movemarker-self{display:none}.widgetbar-tab-shield.highlighted,.widgetbar-movemarker-self{border:solid #52c3e7 2px;background:rgba(82,195,231,.2)}.layout-edit-mode .widgetbar-editshield{display:block}.widgetbar-editshield.highlighted .widgetbar-movemarker-self{display:block}.widgetbar-editshield-top,.widgetbar-editshield-bottom{display:none;position:absolute;z-index:10;background:rgba(0,0,0,0)}.widgetbar-editshield-top{top:0;left:0;right:0;bottom:50%}.widgetbar-editshield-bottom{top:50%;left:0;right:0;bottom:-1px}.widgetbar-eventshield,.layout-move-mode .widgetbar-editshield-top,.layout-move-mode .widgetbar-editshield-bottom,.layout-move-mode .widgetbar-tab-shield{display:block;cursor:move}.widgetbar-movemarker{display:none;position:absolute;left:0;width:100%;height:3px;background:#52c3e7}.widgetbar-movemarker-top{top:-2px}.widgetbar-movemarker-bottom{bottom:-2px}.widgetbar-movemarker:before,.widgetbar-movemarker:after{content:" ";position:absolute;height:7px;top:-2px;width:1px;background:#52c3e7}.widgetbar-movemarker:before{left:0}.widgetbar-movemarker:after{right:0}.widgetbar-movemarker.highlighted{display:block}.widgetbar-addwidgetpopup{position:absolute;z-index:100;top:-1px;right:38px;background:#fff;fill:#fff;border:solid #d6dadf 1px;stroke:#d6dadf;stroke-width:1px}.widgetbar-newwidget-iconplace .widgetbar-addwidgetpopup{right:32px;top:-12px}.widgetbar-addwidgetpopup-list{overflow:auto}.widgetbar-addwidgetpopup-ear{position:absolute;width:10px;height:19px;top:14px;right:-10px}.widgetbar-addwidgetpopup-item{overflow:hidden;height:21px;margin:1px;cursor:pointer;padding:8px 10px}.widgetbar-addwidgetpopup-item:hover{background:#f2f5f8}.widgetbar-addwidgetpopup-itemtitle{padding:2px 0;margin:0 3px 0 30px;min-width:160px}.widgetbar-addwidgetpopup-item .widgetbar-icon{float:left}.widgetbar-editblock{display:none;position:absolute;width:100%;left:0;bottom:0;background:#dee4ec;height:50px}.layout-edit-mode .widgetbar-editblock{display:block}.widgetbar-applybutton,.widgetbar-applybutton:hover{cursor:pointer;display:block;height:15px;color:#fff;font-size:12px;line-height:15px;padding:8px 2px 7px;text-align:center;text-transform:uppercase;margin:10px}.widgetbar-headerspace .button{padding-top:5px;background-color:#fff;border:1px #c9cbcd solid;font-size:12px;line-height:15px;width:39px;height:30px;float:left;display:block;position:relative;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;margin-left:4px}.widgetbar-headerspace .button.button-half{width:20px}.widgetbar-headerspace .button.button-half.button-nomarginleft{margin-left:0;border-left-width:0}.widgetbar-headerspace .button.detach-chat{margin-left:4px}.widgetbar-headerspace .button.with-arrow:after{content:" ";width:9px;height:5px;display:inline-block;vertical-align:middle;background:url(images/select-bg.png) 0 0 no-repeat;margin:0 0 0 4px}.widgetbar-headerspace .button .icon-list{width:18px;height:14px;background-position:0 -280px}.widgetbar-headerspace .button:hover .icon-list{background-position:0 -360px}.widgetbar-headerspace .button.active .icon-list{background-position:-122px -421px}.widgetbar-headerspace .button .icon-list-dots{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2018px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:2px}.widgetbar-headerspace .button:hover .icon-list-dots,.widgetbar-headerspace .button.active .icon-list-dots{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2044px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.widgetbar-headerspace .button .icon-config{width:17px;height:17px;background-position:-160px -240px}.widgetbar-headerspace .button:hover .icon-config{background-position:-40px -340px}.widgetbar-headerspace .button.active .icon-config{background-position:0 -440px}.widgetbar-headerspace .button .icon-find{width:17px;height:17px;background-position:-23px -337px}.widgetbar-headerspace .button .icon-mentions{width:17px;height:17px;background-position:-80px -400px}.widgetbar-headerspace .button:hover .icon-mentions{background-position:-19px -440px}.widgetbar-headerspace .button.active .icon-mentions{background-position:-37px -440px}.widgetbar-headerspace .button .icon-detach{width:10px;height:10px;margin:3px 0 2px;background-position:-140px -140px}.widgetbar-headerspace .button:hover .icon-detach,.widgetbar-headerspace .button.active .icon-detach{background-position:-140px -150px}.widgetbar-headerspace .button .icon-maximize{width:8px;height:18px;background-position:-112px -460px}.widgetbar-headerspace .button:hover .icon-maximize{background-position:-125px -460px}.widgetbar-headerspace .button.active .icon-maximize{background-position:-138px -460px}.widgetbar-headerspace .button .icon-plus{width:16px;height:14px;left:0;margin:1px 0 0;background-position:-179px -162px}.widgetbar-headerspace .button:hover .icon-plus,.widgetbar-headerspace .button.active .icon-plus{background-position:1px -162px}.widgetbar-headerspace .button .icon-phone{width:20px;height:20px;left:0;margin:-1px 0 0;background-position:-80px -380px}.widgetbar-headerspace .button:hover .icon-phone,.widgetbar-headerspace .button.active .icon-phone{background-position:-60px -380px}.widgetbar-headerspace .button .icon-hangup{width:20px;height:20px;left:0;margin:-1px 0 0;background-position:-40px -380px}.widgetbar-headerspace .button:hover .icon-hangup,.widgetbar-headerspace .button.active .icon-hangup{background-position:-20px -380px}.widgetbar-headerspace .button .icon-members{width:15px;height:15px;background-position:-158px -20px}.widgetbar-headerspace .button:hover .icon-members,.widgetbar-headerspace .button.active .icon-members{background-position:-158 -20px}.widgetbar-headerspace .button.active{background-color:#f2f5f8!important}.widgetbar-headerspace .button svg{width:17px;height:17px;fill:#7d7d7d}.widgetbar-headerspace .button.active svg{fill:#49b6d8}.widgetbar-widget-messages .input-reset:before{margin-top:-6px}.widgetbar-tabscontrols .widgetbar-chart-helpbutton{margin:5px auto;width:30px;height:30px;cursor:pointer}.widgetbar-tabscontrols .widgetbar-chart-helpbutton:hover .widgetbar-tabscontrols .widgetbar-chart-helpbutton.active{opacity:.8}.horizontal{height:100%}.horizontal .widgetbar-wrap{position:relative;width:100%}.horizontal .widgetbar-pages{width:100%;top:45px;right:0;left:0;bottom:0;border:0}.horizontal .widgetbar-tabs{width:100%;height:auto}.horizontal .widgetbar-tabs .widgetbar-tab-spacer{display:inline-block;height:45px;line-height:46px;padding:0 6px;margin:0;float:left}.horizontal .widgetbar-tabs .widgetbar-tab{display:inline-block;width:36px;height:45px;padding:0;border-bottom:0}.horizontal .widgetbar-tabs .widgetbar-tab .widgetbar-iconplace{padding-top:11px}.extension .widgetbar-tabs{background:#2e3540}.extension .widgetbar-tabs .widgetbar-tab-spacer{display:none}.extension .widgetbar-tabs .widgetbar-tab{box-sizing:border-box;width:25%;background:0 0}.extension .widgetbar-tabs .widgetbar-tab:hover,.extension .widgetbar-tabs .widgetbar-tab.active{background:0 0}.extension .widgetbar-tabs .widgetbar-tab:last-child{width:24%}.extension .widgetbar-widget{margin:0}.extension .widgetbar-headerspace{padding:0}.extension .widgetbar-widgetheader{margin:0}.extension .tv-messages-header{padding:0}.extension .ch-input .wrap{padding:0}.extension .msg-window-body.chat-page .ch-input .wrap{padding:0}.extension .pc-data{margin:0}.extension .msg-data{margin:0}.extension .symbol-list-item{margin-left:0;margin-right:0}.extension .widgetbar-widgetheader .standalone-chat-select{height:34px}.extension .widgetbar-widgetheader .standalone-chat-select:after{top:15px}.extension .widgetbar-widgetheader .standalone-chat-list{left:0}.extension .widgetbar-widgetheader .button{height:34px;line-height:33px;text-align:center;width:30px;border:0;margin:0;padding:0;background:0 0}.extension .widgetbar-widgetheader .button:hover{border:0;background:0 0}.extension .widgetbar-widgetheader .button .icon{display:inline-block}.extension .widgetbar-widgetheader .button .icon-plus{width:14px;height:14px;background-position:-180px -162px}.extension .widgetbar-widgetheader .msg-empty{line-height:34px}.extension .widgetbar-widgetheader .wl-symbol-edit{text-transform:none;font-weight:400;height:34px;border:0;line-height:34px;background:0 0}.extension .widgetbar-widgetheader .wl-symbol-edit:focus{background:rgba(255,255,255,.6)}.drawing-favorites-toolbar{top:140px;left:100px;position:absolute;height:39px;z-index:15;background:#fff;border:1px solid #c9cbcd;white-space:nowrap;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,.15);box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.drawing-favorites-toolbar .tools-group{display:inline-block;padding:3px 0 0 3px;vertical-align:top}.drawing-favorites-toolbar .drag-handler{display:inline-block;height:39px;width:16px;position:relative}.drawing-favorites-toolbar .drag-handler i{margin:7px;position:absolute;width:6px;height:26px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAFUlEQVR4AWPYs2fPfxBmgAKEANEAAL6kDM2cESQVAAAAAElFTkSuQmCC)}.drawing-favorites-toolbar .button{width:36px;height:31px;position:relative;margin-right:3px;text-align:center}.drawing-favorites-toolbar .button.active:after,.drawing-favorites-toolbar .button:active:after,.drawing-favorites-toolbar .button:focus:after{border-color:#00c3e6 transparent transparent}.drawing-favorites-toolbar .button i{width:30px;height:30px;display:inline-block;background-image:url(images/sidetoolbar/instruments.png);margin-top:1px}.properties-toolbar{position:absolute;top:70px;left:40%;height:39px;z-index:15;background:#fff;border:1px solid #c9cbcd;white-space:nowrap;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,.15);box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.properties-toolbar:after{clear:both;display:table;content:""}.properties-toolbar>div,.properties-toolbar .tools-group{display:inline-block;vertical-align:top}.properties-toolbar>div>div,.properties-toolbar .tools-group>div,.properties-toolbar>div>input,.properties-toolbar .tools-group>input{display:inline-block;vertical-align:top}.properties-toolbar .tools-group{position:relative;height:27px;padding:6px 3px}.properties-toolbar .tools-group>div,.properties-toolbar .tools-group>span,.properties-toolbar .tools-group>a,.properties-toolbar .tools-group>.colorpicker-widget{margin-right:3px}.properties-toolbar .tools-group.properties-tools-group>div,.properties-toolbar .tools-group.properties-tools-group>span,.properties-toolbar .tools-group.properties-tools-group>a,.properties-toolbar .tools-group.properties-tools-group>.colorpicker-widget{margin-right:-1px}.properties-toolbar .tools-group.properties-tools-group>div:last-child,.properties-toolbar .tools-group.properties-tools-group>span:last-child,.properties-toolbar .tools-group.properties-tools-group>a:last-child,.properties-toolbar .tools-group.properties-tools-group>.colorpicker-widget:last-child{margin-right:3px}.properties-toolbar .tools-group.properties-tools-group .divider{height:27px;width:5px}.properties-toolbar .tools-group .button{width:36px;height:25px;display:inline-block;position:relative}.properties-toolbar .tools-group .button.with-arrow{width:40px}.properties-toolbar .tools-group .button.with-arrow:after{position:relative;top:14px;left:30px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0;border-color:#707275 transparent transparent;border-style:inset}.properties-toolbar .tools-group .button.active:after,.properties-toolbar .tools-group .button:active:after,.properties-toolbar .tools-group .button:focus:after{border-color:#00c3e6 transparent transparent}.properties-toolbar .tools-group .colorpicker-widget{border-color:#c9cbcd;width:40px;height:25px;cursor:default}.properties-toolbar .tools-group .colorpicker-widget[class*=icon-]{background-image:url(images/linetool-properties/colorpicker-icons.png)}.properties-toolbar .tools-group .custom-select .switcher{padding:0;width:40px;min-width:40px;background-color:#fff}.properties-toolbar .tools-group .custom-select .switcher .title{width:40px;height:25px;padding:0}.properties-toolbar .tools-group .custom-select .switcher .icon{position:absolute;right:9px;top:12px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0;border-color:#707275 transparent transparent;border-style:inset}.properties-toolbar .tools-group .custom-select .switcher:active .icon,.properties-toolbar .tools-group .custom-select .switcher:active .icon{border-color:#00c3e6 transparent transparent}.properties-toolbar .tools-group .custom-select .items{padding:6px 5px;width:auto}.properties-toolbar .tools-group .custom-select .items span{display:inline-block}.properties-toolbar .tools-group .custom-select .items .item{padding:0;display:inline-block;height:25px}.properties-toolbar .tools-group .custom-select .items .item.selected{border:1px solid #c9cbcd}.properties-toolbar .tools-group .custom-select.simple .title .combobox-simple{line-height:25px;color:#333;font-weight:600;padding-left:7px}.properties-toolbar .tools-group .custom-select.simple .items{padding:0}.properties-toolbar .tools-group .custom-select.simple .items .item{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;min-width:40px;line-height:25px;color:#333;padding:0 7px}.properties-toolbar .tools-group .custom-select.simple .items .item.selected{border:0;font-weight:600}.properties-toolbar .tools-group .custom-select.simple .icon{right:6px}.properties-toolbar .tools-group .custom-select .combobox-icon{display:inline-block;width:32px;height:25px}.properties-toolbar .drag-handler{height:39px;width:16px;position:relative}.properties-toolbar .drag-handler i{margin:7px;position:absolute;width:6px;height:26px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAFUlEQVR4AWPYs2fPfxBmgAKEANEAAL6kDM2cESQVAAAAAElFTkSuQmCC)}.properties-toolbar [class*=icon-]{background-image:url(images/linetool-properties/icons.png)}.properties-toolbar [class*=icon-] svg{margin:4px 8.5px;fill:#727272}.properties-toolbar [class*=icon-].icon-pencil{background-position:0 0}.properties-toolbar [class*=icon-].icon-bucket{background-position:0 -25px}.properties-toolbar [class*=icon-].icon-font{background-position:0 -50px}.properties-toolbar [class*=icon-].icon-list{background-position:0 -75px}.properties-toolbar [class*=icon-].icon-line{background-position:0 -100px}.properties-toolbar [class*=icon-].icon-line-left-arrow{background-position:0 -125px}.properties-toolbar [class*=icon-].icon-line-right-arrow{background-position:0 -150px}.properties-toolbar [class*=icon-].icon-line-two-arrow{background-position:0 -175px}.properties-toolbar [class*=icon-].icon-ray-left{background-position:0 -200px}.properties-toolbar [class*=icon-].icon-ray-right{background-position:0 -225px}.properties-toolbar [class*=icon-].icon-ray-segment{background-position:0 -250px}.properties-toolbar [class*=icon-].icon-line-dashed{background-position:0 -275px}.properties-toolbar [class*=icon-].icon-line-dotted{background-position:0 -300px}.properties-toolbar [class*=icon-].icon-line-width-1{background-position:0 -100px}.properties-toolbar [class*=icon-].icon-line-width-2{background-position:0 -325px}.properties-toolbar [class*=icon-].icon-line-width-3{background-position:0 -350px}.properties-toolbar [class*=icon-].icon-line-width-4{background-position:0 -375px}.properties-toolbar [class*=icon-].icon-settings{background-position:0 -400px}.properties-toolbar [class*=icon-].icon-clone{background-position:0 -425px}.properties-toolbar [class*=icon-].icon-remove{background-position:0 -450px}.properties-toolbar [class*=icon-].icon-hide{background-position:0 -475px}.properties-toolbar [class*=icon-].icon-zorder{background-position:0 -500px}.properties-toolbar [class*=icon-].icon-line-left-normal{background-position:0 -525px}.properties-toolbar [class*=icon-].icon-line-right-normal{background-position:0 -550px}.properties-toolbar [class*=icon-].icon-line-left-extend{background-position:0 -575px}.properties-toolbar [class*=icon-].icon-line-right-extend{background-position:0 -600px}.properties-toolbar [class*=icon-].icon-lock{background-position:0 -625px}.properties-toolbar [class*=icon-].icon-alert{background-image:none}.properties-toolbar [class*=icon-].icon-alert svg{width:17px;height:17px}.properties-toolbar [class*=icon-].icon-add-alert{background-image:none}.properties-toolbar [class*=icon-].icon-add-alert svg{width:22px;height:19px}.properties-toolbar [class*=icon-].active.icon-pencil,.properties-toolbar [class*=icon-]:active.icon-pencil,.properties-toolbar [class*=icon-]:focus.icon-pencil{background-position:-40px 0}.properties-toolbar [class*=icon-].active.icon-bucket,.properties-toolbar [class*=icon-]:active.icon-bucket,.properties-toolbar [class*=icon-]:focus.icon-bucket{background-position:-40px -25px}.properties-toolbar [class*=icon-].active.icon-font,.properties-toolbar [class*=icon-]:active.icon-font,.properties-toolbar [class*=icon-]:focus.icon-font{background-position:-40px -50px}.properties-toolbar [class*=icon-].active.icon-list,.properties-toolbar [class*=icon-]:active.icon-list,.properties-toolbar [class*=icon-]:focus.icon-list{background-position:-40px -75px}.properties-toolbar [class*=icon-].active.icon-line,.properties-toolbar [class*=icon-]:active.icon-line,.properties-toolbar [class*=icon-]:focus.icon-line{background-position:-40px -100px}.properties-toolbar [class*=icon-].active.icon-line-left-arrow,.properties-toolbar [class*=icon-]:active.icon-line-left-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-left-arrow{background-position:-40px -125px}.properties-toolbar [class*=icon-].active.icon-line-right-arrow,.properties-toolbar [class*=icon-]:active.icon-line-right-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-right-arrow{background-position:-40px -150px}.properties-toolbar [class*=icon-].active.icon-line-two-arrow,.properties-toolbar [class*=icon-]:active.icon-line-two-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-two-arrow{background-position:-40px -175px}.properties-toolbar [class*=icon-].active.icon-ray-left,.properties-toolbar [class*=icon-]:active.icon-ray-left,.properties-toolbar [class*=icon-]:focus.icon-ray-left{background-position:-40px -200px}.properties-toolbar [class*=icon-].active.icon-ray-right,.properties-toolbar [class*=icon-]:active.icon-ray-right,.properties-toolbar [class*=icon-]:focus.icon-ray-right{background-position:-40px -225px}.properties-toolbar [class*=icon-].active.icon-ray-segment,.properties-toolbar [class*=icon-]:active.icon-ray-segment,.properties-toolbar [class*=icon-]:focus.icon-ray-segment{background-position:-40px -250px}.properties-toolbar [class*=icon-].active.icon-line-dashed,.properties-toolbar [class*=icon-]:active.icon-line-dashed,.properties-toolbar [class*=icon-]:focus.icon-line-dashed{background-position:-40px -275px}.properties-toolbar [class*=icon-].active.icon-line-dotted,.properties-toolbar [class*=icon-]:active.icon-line-dotted,.properties-toolbar [class*=icon-]:focus.icon-line-dotted{background-position:-40px -300px}.properties-toolbar [class*=icon-].active.icon-line-width-1,.properties-toolbar [class*=icon-]:active.icon-line-width-1,.properties-toolbar [class*=icon-]:focus.icon-line-width-1{background-position:-40px -100px}.properties-toolbar [class*=icon-].active.icon-line-width-2,.properties-toolbar [class*=icon-]:active.icon-line-width-2,.properties-toolbar [class*=icon-]:focus.icon-line-width-2{background-position:-40px -325px}.properties-toolbar [class*=icon-].active.icon-line-width-3,.properties-toolbar [class*=icon-]:active.icon-line-width-3,.properties-toolbar [class*=icon-]:focus.icon-line-width-3{background-position:-40px -350px}.properties-toolbar [class*=icon-].active.icon-line-width-4,.properties-toolbar [class*=icon-]:active.icon-line-width-4,.properties-toolbar [class*=icon-]:focus.icon-line-width-4{background-position:-40px -375px}.properties-toolbar [class*=icon-].active.icon-settings,.properties-toolbar [class*=icon-]:active.icon-settings,.properties-toolbar [class*=icon-]:focus.icon-settings{background-position:-40px -400px}.properties-toolbar [class*=icon-].active.icon-clone,.properties-toolbar [class*=icon-]:active.icon-clone,.properties-toolbar [class*=icon-]:focus.icon-clone{background-position:-40px -425px}.properties-toolbar [class*=icon-].active.icon-remove,.properties-toolbar [class*=icon-]:active.icon-remove,.properties-toolbar [class*=icon-]:focus.icon-remove{background-position:-40px -450px}.properties-toolbar [class*=icon-].active.icon-hide,.properties-toolbar [class*=icon-]:active.icon-hide,.properties-toolbar [class*=icon-]:focus.icon-hide{background-position:-40px -475px}.properties-toolbar [class*=icon-].active.icon-zorder,.properties-toolbar [class*=icon-]:active.icon-zorder,.properties-toolbar [class*=icon-]:focus.icon-zorder{background-position:-40px -500px}.properties-toolbar [class*=icon-].active.icon-line-left-normal,.properties-toolbar [class*=icon-]:active.icon-line-left-normal,.properties-toolbar [class*=icon-]:focus.icon-line-left-normal{background-position:-40px -525px}.properties-toolbar [class*=icon-].active.icon-line-right-normal,.properties-toolbar [class*=icon-]:active.icon-line-right-normal,.properties-toolbar [class*=icon-]:focus.icon-line-right-normal{background-position:-40px -550px}.properties-toolbar [class*=icon-].active.icon-line-left-extend,.properties-toolbar [class*=icon-]:active.icon-line-left-extend,.properties-toolbar [class*=icon-]:focus.icon-line-left-extend{background-position:-40px -575px}.properties-toolbar [class*=icon-].active.icon-line-right-extend,.properties-toolbar [class*=icon-]:active.icon-line-right-extend,.properties-toolbar [class*=icon-]:focus.icon-line-right-extend{background-position:-40px -600px}.properties-toolbar [class*=icon-].active.icon-lock,.properties-toolbar [class*=icon-]:active.icon-lock,.properties-toolbar [class*=icon-]:focus.icon-lock{background-position:-40px -625px}.properties-toolbar [class*=icon-].active.icon-alert,.properties-toolbar [class*=icon-]:active.icon-alert,.properties-toolbar [class*=icon-]:focus.icon-alert{background-image:none}.properties-toolbar [class*=icon-].active.icon-alert svg,.properties-toolbar [class*=icon-]:active.icon-alert svg,.properties-toolbar [class*=icon-]:focus.icon-alert svg{margin:4px 9px;width:17px;height:17px;fill:#5dc5e7}.properties-toolbar .active [class*=icon-].icon-pencil,.properties-toolbar .selected [class*=icon-].icon-pencil{background-position:-40px 0}.properties-toolbar .active [class*=icon-].icon-bucket,.properties-toolbar .selected [class*=icon-].icon-bucket{background-position:-40px -25px}.properties-toolbar .active [class*=icon-].icon-font,.properties-toolbar .selected [class*=icon-].icon-font{background-position:-40px -50px}.properties-toolbar .active [class*=icon-].icon-list,.properties-toolbar .selected [class*=icon-].icon-list{background-position:-40px -75px}.properties-toolbar .active [class*=icon-].icon-line,.properties-toolbar .selected [class*=icon-].icon-line{background-position:-40px -100px}.properties-toolbar .active [class*=icon-].icon-line-left-arrow,.properties-toolbar .selected [class*=icon-].icon-line-left-arrow{background-position:-40px -125px}.properties-toolbar .active [class*=icon-].icon-line-right-arrow,.properties-toolbar .selected [class*=icon-].icon-line-right-arrow{background-position:-40px -150px}.properties-toolbar .active [class*=icon-].icon-line-two-arrow,.properties-toolbar .selected [class*=icon-].icon-line-two-arrow{background-position:-40px -175px}.properties-toolbar .active [class*=icon-].icon-ray-left,.properties-toolbar .selected [class*=icon-].icon-ray-left{background-position:-40px -200px}.properties-toolbar .active [class*=icon-].icon-ray-right,.properties-toolbar .selected [class*=icon-].icon-ray-right{background-position:-40px -225px}.properties-toolbar .active [class*=icon-].icon-ray-segment,.properties-toolbar .selected [class*=icon-].icon-ray-segment{background-position:-40px -250px}.properties-toolbar .active [class*=icon-].icon-line-dashed,.properties-toolbar .selected [class*=icon-].icon-line-dashed{background-position:-40px -275px}.properties-toolbar .active [class*=icon-].icon-line-dotted,.properties-toolbar .selected [class*=icon-].icon-line-dotted{background-position:-40px -300px}.properties-toolbar .active [class*=icon-].icon-line-width-1,.properties-toolbar .selected [class*=icon-].icon-line-width-1{background-position:-40px -100px}.properties-toolbar .active [class*=icon-].icon-line-width-2,.properties-toolbar .selected [class*=icon-].icon-line-width-2{background-position:-40px -325px}.properties-toolbar .active [class*=icon-].icon-line-width-3,.properties-toolbar .selected [class*=icon-].icon-line-width-3{background-position:-40px -350px}.properties-toolbar .active [class*=icon-].icon-line-width-4,.properties-toolbar .selected [class*=icon-].icon-line-width-4{background-position:-40px -375px}.properties-toolbar .active [class*=icon-].icon-settings,.properties-toolbar .selected [class*=icon-].icon-settings{background-position:-40px -400px}.properties-toolbar .active [class*=icon-].icon-clone,.properties-toolbar .selected [class*=icon-].icon-clone{background-position:-40px -425px}.properties-toolbar .active [class*=icon-].icon-remove,.properties-toolbar .selected [class*=icon-].icon-remove{background-position:-40px -450px}.properties-toolbar .active [class*=icon-].icon-hide,.properties-toolbar .selected [class*=icon-].icon-hide{background-position:-40px -475px}.properties-toolbar .active [class*=icon-].icon-zorder,.properties-toolbar .selected [class*=icon-].icon-zorder{background-position:-40px -500px}.properties-toolbar .active [class*=icon-].icon-line-left-normal,.properties-toolbar .selected [class*=icon-].icon-line-left-normal{background-position:-40px -525px}.properties-toolbar .active [class*=icon-].icon-line-right-normal,.properties-toolbar .selected [class*=icon-].icon-line-right-normal{background-position:-40px -550px}.properties-toolbar .active [class*=icon-].icon-line-left-extend,.properties-toolbar .selected [class*=icon-].icon-line-left-extend{background-position:-40px -575px}.properties-toolbar .active [class*=icon-].icon-line-right-extend,.properties-toolbar .selected [class*=icon-].icon-line-right-extend{background-position:-40px -600px}.properties-toolbar .active [class*=icon-].icon-lock,.properties-toolbar .selected [class*=icon-].icon-lock{background-position:-40px -625px}.properties-toolbar .active [class*=icon-].icon-alert,.properties-toolbar .selected [class*=icon-].icon-alert{background-image:none}.properties-toolbar .active [class*=icon-].icon-alert svg,.properties-toolbar .selected [class*=icon-].icon-alert svg{margin:4px 9px;width:17px;height:17px;fill:#5dc5e7}.mini-widget{overflow:hidden;color:#5b5e61;background-color:#fff}.tv-mediumwidget{background-color:#fff;overflow:hidden}#miniwidget .tabs,.tv-mediumwidget .tv-mediumwidget-labels{border:1px solid #dde1e6}#miniwidget .tabs.empty,.tv-mediumwidget .tv-mediumwidget-labels.empty{border:0}.mini-widget .tab,.tv-mediumwidget .tv-mediumwidget-label{margin:0 10px;padding:8px 0;display:inline-block;cursor:pointer;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.mini-widget .tab a,.tv-mediumwidget .tv-mediumwidget-label a{color:#999}.mini-widget .tab.active,.tv-mediumwidget .tv-mediumwidget-label.active{padding-bottom:7px;margin-bottom:-1px;border-bottom:2px solid #58b987;font-weight:700}.mini-widget .tab.active a,.tv-mediumwidget .tv-mediumwidget-label a{color:#5b5e61}.tv-mediumwidget .mini-chart-timeframes,.mini-widget .mini-chart-timeframes{position:absolute;top:14px;left:14px}.tv-mediumwidget .mini-chart-timeframes>a,.mini-widget .mini-chart-timeframes>a{font-size:11px;color:#999;padding:1px;margin-right:18px}.tv-mediumwidget .mini-chart-timeframes>a:last-child,.mini-widget .mini-chart-timeframes>a:last-child{margin-right:0}.tv-mediumwidget .mini-chart-timeframes>a.active,.mini-widget .mini-chart-timeframes>a.active{color:#333;border-bottom:1px solid #58b987}.tv-mediumwidget .footer,.mini-widget .footer{padding:6px 10px;font-size:11px;text-align:right}.tv-mediumwidget .footer .fade,.mini-widget .footer .fade{color:#b4b4b4}.mini-widget .graph{overflow:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6;border-bottom:0}.mini-widget .graph>div{height:100%;position:relative}.mini-widget .graph .mini-chart-timeframes{top:14px;left:14px}.mini-widget .divider{display:block;height:2px;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6}.mini-widget .pages{overflow-y:auto;overflow-x:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6}.mini-widget .pages table{width:100%;border-collapse:collapse;position:relative;border-spacing:10px}.mini-widget .pages table thead td{padding:2px 0 4px;color:#999;text-align:right;border-bottom:#e5e4e4 1px solid;font-size:.85em}.mini-widget .pages table thead td:first-child{padding-left:10px;text-align:left}.mini-widget .pages table thead td:last-child{padding-right:6px;padding-left:5px}.mini-widget .pages table thead td.symbol-last{padding-left:5px;padding-right:5px;text-align:right}.mini-widget .pages table .ticker{font-size:14px;overflow:hidden;background-color:#fff}.mini-widget .pages table .ticker.active{background-color:#edf0f3}.mini-widget .pages table .ticker td{position:relative;border-bottom:1px solid #e5e4e4;cursor:default;text-align:center;padding:6px 0}.mini-widget .pages table .ticker td.symbol-short-name-container{width:35%;padding-left:10px;text-align:left;white-space:nowrap}.mini-widget .pages table .ticker td.symbol-last{width:35%;padding-left:5px;padding-right:5px;text-align:right}.mini-widget .pages table .ticker td.symbol-change{width:30%;padding-left:5px;text-align:right}.mini-widget .pages table .ticker td.symbol-change-pt{width:0;padding-right:6px;padding-left:5px;text-align:right}.mini-widget .footer{overflow:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6;border-bottom:1px solid #dde1e6}.tv-mediumwidget{color:#26282f}.tv-mediumwidget .tv-mediumwidget-pages{border-left:1px solid #e5e4e4;border-right:1px solid #e5e4e4}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page{display:none}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page.active{display:block}.tv-mediumwidget .tv-mediumwidget-pages .mini-chart-timeframes{top:17px;left:19px}.tv-mediumwidget .footer{border:1px solid #e5e4e4;border-top:0}.tv-mediumwidget .ticker-fundamental-container{width:100%}.tv-mediumwidget .ticker-fundamental-container .fundamentals-cell{vertical-align:top}.tv-mediumwidget .tv-mediumwidget-ticker,.tv-mediumwidget .tv-mediumwidget-fundamentals{height:97px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:15px 15px 0;position:relative}.tv-mediumwidget .tv-mediumwidget-ticker{white-space:nowrap}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-ticker-name{vertical-align:top}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-ticker-value{vertical-align:bottom;white-space:nowrap}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-short-name,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-short-name-container{font-size:22px;text-transform:uppercase}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-last{display:inline-block;font-size:28px;font-weight:700;margin-right:5px;padding:0}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-container{white-space:nowrap;display:inline-block}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-pt{display:inline-block;font-weight:700;font-size:18px}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-pt{margin-left:5px}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-description-name,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-industry-sector-container{font-size:11px;color:#787878}.tv-mediumwidget .tv-mediumwidget-fundamentals{min-width:210px}.tv-mediumwidget .tv-mediumwidget-fundamentals table{width:100%;border:0;border-collapse:collapse}.tv-mediumwidget .tv-mediumwidget-fundamentals table td{padding:8px 0}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-name{width:24%;border-bottom:1px solid #e5e4e4;text-align:left;color:#878c94;padding-right:5px}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-value{width:24%;border-bottom:1px solid #e5e4e4;text-align:right}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-divider{width:4%;min-width:20px}.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:first-child td{padding-top:0}.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:last-child td.fundamental-name,.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:last-child td.fundamental-value{border-bottom:0}.tv-mediumwidget .tv-mediumwidget-divider{float:left;height:1px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:30px 15px;background-color:#e5e4e4}.tv-mediumwidget .tv-mediumwidget-minichart{float:left;width:100%;margin-top:10px;position:relative}.tv-mediumwidget .tv-mediumwidget-minichart canvas{display:block}.chart-widget{border-style:none;position:absolute;left:0;top:0;width:512px;height:256px;margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chart-header{background-color:#fff;border-bottom:1px solid gray;color:#fff}.chart-header-form{background-color:#fff;color:#000;margin:3px}.chart-header-input-text{border:1px solid #000;color:#000}.chart-header-status{border:0}table.chart-markup-table{border:0;border-collapse:collapse;border-spacing:0;line-height:0;margin:0;padding:0}.chart-markup-table tr{margin:0;padding:0}td.chart-markup-table{border:0;text-align:left;vertical-align:top;line-height:0;margin:0;padding:0}.chart-data-window{position:absolute;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-collapse:collapse;margin:0;padding:0;background-color:#fff;text-align:left;color:#5a5c62}.chart-data-window .box{margin:3px}.chart-data-window .box.with-actions{cursor:pointer}.chart-data-window .box:first-child .chart-data-window-header:first-child{margin-top:0}.chart-data-window .hover .chart-data-window-header .hover-source-icon{display:block}.chart-data-window .active{border-left:2px solid #528cde}.chart-data-window .active .chart-data-window-header{background:#e9f8ff}.chart-data-window .active .chart-data-window-header,.chart-data-window .active .chart-data-window-item .chart-data-window-item-title{padding-left:8px}.chart-data-window .active .chart-data-window-item{font-weight:700}.chart-data-window .hidden{opacity:.3}.chart-data-window .hidden .chart-data-window-item{display:none}.chart-data-window .chart-data-window-header,.chart-data-window .chart-data-window-item{margin-bottom:3px;position:relative}.chart-data-window .chart-data-window-header{padding:9px 10px;background:#f2f5f8;font-weight:700;font-size:12px}.chart-data-window .chart-data-window-header .toggle-source-icon{display:block;position:absolute;right:14px;top:11px;width:16px;height:10px;background-image:url(images/icons.png);background-position:-80px -80px;cursor:pointer}.chart-data-window .chart-data-window-header .toggle-source-icon:hover{background-position:-60px -100px}.chart-data-window .chart-data-window-header .hover-source-icon{display:none;position:absolute;right:40px;top:11px;width:10px;height:10px;-webkit-border-radius:10px;-webkit-background-clip:padding-box;-moz-border-radius:10px;-moz-background-clip:padding;border-radius:10px;background-clip:padding-box;background:#528cde}.chart-data-window .chart-data-window-item:last-child{margin-bottom:0}.chart-data-window .chart-data-window-item .chart-data-window-item-title,.chart-data-window .chart-data-window-item .chart-data-window-item-value{width:50%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:4px 10px;display:inline-block;white-space:nowrap}.chart-data-window .chart-data-window-item .chart-data-window-item-title .real-color,.chart-data-window .chart-data-window-item .chart-data-window-item-value .real-color{display:inline-block;width:15px;height:8px;margin-right:15px;border:1px dotted #ccc;cursor:help}.chart-data-window .chart-data-window-item .chart-data-window-item-value{text-align:right}span.insert-study-dialog{cursor:pointer}table.insert-study-dialog{z-index:10}div.insert-study-dialog p{margin:0;padding:21px 28px;color:#8b8c8e;text-align:center}.pane{overflow:hidden}.pane-legend{background-color:transparent;color:#444;border:0;top:5px;left:5px;white-space:nowrap;margin:0 85px 0 0;padding:0;z-index:3;position:absolute;font-size:9pt;line-height:normal;pointer-events:none}.pane-legend-line{border:0;text-align:left;margin:0;padding:0;cursor:pointer;white-space:pre-line}.pane-legend-line span{pointer-events:auto}.pane-legend-line>span.pane-legend-line:not(.no-context-menu){margin-right:17px}.pane-legend-line>span.pane-legend-line{display:inline-block;position:relative}.pane-legend-line>span.pane-legend-line:not(.no-context-menu):after{content:'';display:block;position:absolute;top:50%;right:-12px;margin-top:-1px;border-style:solid;border-width:4px;border-top-color:#c9cbcd;border-left-color:transparent;border-right-color:transparent;border-bottom-width:0}.pane-legend-line>span.pane-legend-line:hover:after{border-top-color:inherit}.viewchart-column-main .pane-legend-line>span.pane-legend-line:after{display:none}.pane-legend-line button.follow-symbol{display:none;pointer-events:auto;margin-right:4px;opacity:.3;position:relative;top:3px;vertical-align:top}.pane-legend-line:hover button.follow-symbol{opacity:1}.is-mobile .pane-legend-line button.follow-symbol{opacity:.8}.view-chart .pane-legend-line button.follow-symbol{display:none}.pane-legend-item-value-container{display:inline-block}.pane-legend-item-value,.pane-legend-item-value-title,.pane-legend-item-additional{font-size:9pt;font-weight:400;cursor:default;pointer-events:none!important}.pane-legend-item-value{padding-left:5px;padding-right:5px}.pane-legend-item-value:first-child{padding-left:0}.pane-legend-line.disabled{color:#d8dada!important;border-color:#d8dada!important}.pane-legend-icon-container{display:inline-block;vertical-align:baseline;position:relative;left:3px;top:3px;padding-right:10px;margin-right:5px}.main .pane-legend-icon-container{top:1px}.pane-controls{position:absolute;right:5px;top:5px}.pane-legend-icon{background:url(images/legend-icons.png);width:14px;height:14px;display:inline-block;margin:0 0 0 3px;cursor:pointer;opacity:.3}.is-mobile .pane-legend-icon{-webkit-transform:scale(1.1);transform:scale(1.1);margin:0 0 0 10px;background:url(images/mobile/legend-icons.png);width:16px;height:16px}.pane-legend-icon.delete{background-position:0 -14px}.pane-legend-icon.delete.active{background-position:0 -28px}.is-mobile .pane-legend-icon.delete{opacity:.8;background-position:0 -16px}.is-mobile .pane-legend-icon.delete.active{background-position:0 -32px}.pane-legend-icon.icon-hide{background-position:-14px -14px}.pane-legend-icon.icon-hide.active{background-position:-14px -28px}.is-mobile .pane-legend-icon.icon-hide{opacity:.8;background-position:-16px -16px}.is-mobile .pane-legend-icon.icon-hide.active{background-position:-16px -32px}.pane-legend-icon.down{background-position:-28px -14px}.pane-legend-icon.down.active{background-position:-28px -28px}.is-mobile .pane-legend-icon.down{opacity:.8;background-position:-32px -16px}.is-mobile .pane-legend-icon.down.active{background-position:-32px -32px}.pane-legend-icon.up{background-position:-42px -14px}.pane-legend-icon.up.active{background-position:-42px -28px}.is-mobile .pane-legend-icon.up{opacity:.8;background-position:-48px -16px}.is-mobile .pane-legend-icon.up.active{background-position:-48px -32px}.pane-legend-icon.format{background-position:-56px -14px}.pane-legend-icon.format.active{background-position:-56px -28px}.is-mobile .pane-legend-icon.format{opacity:.8;background-position:-64px -16px}.is-mobile .pane-legend-icon.format.active{background-position:-64px -32px}.pane-legend-icon.source{background-position:-70px -14px}.pane-legend-icon.source.active{background-position:-70px -28px}.is-mobile .pane-legend-icon.source{opacity:.8;background-position:-80px -16px}.is-mobile .pane-legend-icon.source.active{background-position:-80px -32px}.pane-legend-line:hover .pane-legend-icon.delete,.pane-controls:hover .pane-legend-icon.delete{opacity:1;background-position:0 -14px}.pane-legend-line:hover .pane-legend-icon.delete:hover,.pane-controls:hover .pane-legend-icon.delete:hover{background-position:0 -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.delete,.is-mobile .pane-controls:hover .pane-legend-icon.delete{background-position:0 -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.delete:hover,.is-mobile .pane-controls:hover .pane-legend-icon.delete:hover{background-position:0 -32px}.pane-legend-line:hover .pane-legend-icon.icon-hide,.pane-controls:hover .pane-legend-icon.icon-hide{opacity:1;background-position:-14px -14px}.pane-legend-line:hover .pane-legend-icon.icon-hide:hover,.pane-controls:hover .pane-legend-icon.icon-hide:hover{background-position:-14px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.icon-hide,.is-mobile .pane-controls:hover .pane-legend-icon.icon-hide{background-position:-16px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.icon-hide:hover,.is-mobile .pane-controls:hover .pane-legend-icon.icon-hide:hover{background-position:-16px -32px}.pane-legend-line:hover .pane-legend-icon.down,.pane-controls:hover .pane-legend-icon.down{opacity:1;background-position:-28px -14px}.pane-legend-line:hover .pane-legend-icon.down:hover,.pane-controls:hover .pane-legend-icon.down:hover{background-position:-28px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.down,.is-mobile .pane-controls:hover .pane-legend-icon.down{background-position:-32px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.down:hover,.is-mobile .pane-controls:hover .pane-legend-icon.down:hover{background-position:-32px -32px}.pane-legend-line:hover .pane-legend-icon.up,.pane-controls:hover .pane-legend-icon.up{opacity:1;background-position:-42px -14px}.pane-legend-line:hover .pane-legend-icon.up:hover,.pane-controls:hover .pane-legend-icon.up:hover{background-position:-42px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.up,.is-mobile .pane-controls:hover .pane-legend-icon.up{background-position:-48px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.up:hover,.is-mobile .pane-controls:hover .pane-legend-icon.up:hover{background-position:-48px -32px}.pane-legend-line:hover .pane-legend-icon.format,.pane-controls:hover .pane-legend-icon.format{opacity:1;background-position:-56px -14px}.pane-legend-line:hover .pane-legend-icon.format:hover,.pane-controls:hover .pane-legend-icon.format:hover{background-position:-56px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.format,.is-mobile .pane-controls:hover .pane-legend-icon.format{background-position:-64px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.format:hover,.is-mobile .pane-controls:hover .pane-legend-icon.format:hover{background-position:-64px -32px}.pane-legend-line:hover .pane-legend-icon.source,.pane-controls:hover .pane-legend-icon.source{opacity:1;background-position:-70px -14px}.pane-legend-line:hover .pane-legend-icon.source:hover,.pane-controls:hover .pane-legend-icon.source:hover{background-position:-70px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.source,.is-mobile .pane-controls:hover .pane-legend-icon.source{background-position:-80px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.source:hover,.is-mobile .pane-controls:hover .pane-legend-icon.source:hover{background-position:-80px -32px}.pane-legend-line.disabled .pane-legend-icon.icon-hide{opacity:1;background-position:-14px -28px}.is-mobile .pane-legend-line.disabled .pane-legend-icon.icon-hide{background-position:-16px -32px}.pane-legend-line .exchange-warning{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAA7UlEQVR4XpWTgQaDUBSGI8YYl4iIGAMD2GP0BiNijAFgbxYRYwAYY2CMwIiIGCM27cfPzdGOLT44X76uOjnyeu+dBOTgAXrQggwkjnrZQMhAr3AGCy2yBA0Dd57K0HlgA2r6ejQG4YIrIzkwA9cO7vPBgbETcGUopayARyFDNmZPtpahjCKlkCE52zGUSVFTBD+GQoYqKXrwEg0tNGGok6Kh8EdCx39OlFOkYm7AChjlHelfjfOY81jES/vV9D2ach6BLYgYmYFisOHut81uGbtxk326gMFS2+xhbP7Dv3bRImObXoCOgScfkGqBD+IWI88/wYc0AAAAAElFTkSuQmCC);display:inline-block;width:18px;height:15px;margin:0 4px 0 0;vertical-align:-1px;cursor:pointer}.pane-separator{padding:0;margin:0}.pane-separator .handle{background-color:rgba(255,255,255,.02);position:absolute;height:5px;width:100%;z-index:50}.context-menu-wrapper{position:absolute;z-index:500;overflow:auto;border:1px solid #aaadb1;background:#fff;white-space:nowrap}tr.context-menu.disabled{color:#9d9d9d}tr.context-menu.spinner>td{background:url(images/loading-small.gif) center center no-repeat;cursor:default}.submenu.center{background-color:#fff}.context-menu{font-size:8.5pt;white-space:nowrap}tr.context-menu{cursor:pointer;height:29px}tr.context-menu-hover{background:#f4f7f9}td.context-menu{opacity:1;cursor:pointer;padding-left:4px}.context-menu-item-separated{border-bottom:1px solid #cecece}.context-menu .text{min-width:100px}.context-menu .spacer{width:18px}.context-menu .icon{height:27px;width:18px}.context-menu .shortcut{color:#aaa;padding:0 2px}.submenu-arrow{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKElEQVR4AWOgExgFo6Cvr+8/1Q0EYaoaCMNUNBCBB68LqRvLIxiMAgAKDyqRblYs2AAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center;width:20px}.submenu-arrow.expanded{width:20px}.popup{position:absolute;display:block}div.submenu{background-image:url(chart-client/css/images/submenu_arrow.png);background-repeat:no-repeat;padding-left:25px}.checked-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAQ0lEQVR4AWPABcIjI6eBCGYsEjOB+D+IsRShACEBxMcYoIwVIAVAPAcmAcQ8IMntUIGHyBIwYzihChAScIBQ0IsuAQBi0S/426FUkgAAAABJRU5ErkJggg==);background-position:center;background-repeat:no-repeat}.unchecked-icon{background:0 0}.context-menu .action-separator{height:1px!important;background-color:#c9cbcd}.context-menu .action-separator{height:0;cursor:default}.context-menu .action-separator td{height:0;border-top:solid 1px #c9cbcd}.spacer.delete-spacer{width:23px}.context-menu-delete-button{display:none;vertical-align:middle;width:14px;height:14px;background:url(images/icons.png) no-repeat scroll -102px -362px transparent}tr:hover .context-menu-delete-button{display:inline-block}.context-menu-delete-button:hover{background-position:-81px -362px}.study_icon{background-image:url(chart-client/css/images/icon_study.png);background-position:50% 50%;background-repeat:no-repeat}.drawing_icon{background-image:url(chart-client/css/images/icon_drawing.png);background-position:50% 50%;background-repeat:no-repeat}.treeview-link{cursor:pointer}.property-page-column-2{display:inline-block;width:50%;vertical-align:top}.property-page{color:#595959}.property-page td{padding:3px 4px;height:27px}.property-page td:empty{padding:0}.property-page td:first-child{padding-left:0}.property-page td:last-child{padding-right:0}.property-page.study-properties{margin-top:10px}.property-page-fullwidth-wrapper{margin:0 13px 0 0}.property-page-small-select .tv-select-container{width:80px}.property-page-bandwidth{margin-left:8px;width:55px;vertical-align:middle}.property-page input[type=checkbox]{vertical-align:middle}.property-page td:first-child input[type=checkbox]{margin-left:0}.property-page .tv-text-input{height:25px}.property-page .visibility-switch-icon{background:url(images/legend-icons.png) -14px -14px;width:14px;height:14px;position:absolute;cursor:pointer;z-index:1}.property-page .visibility-switch-icon:hover{background-position:-14px -28px}.property-page-unpadded{border-collapse:collapse}.property-page-unpadded>tbody>tr>td,.property-page-unpadded>tbody>tr>th{padding:0}.property-page .property-page-separator-cell{height:21px;padding:0}.property-page .offset-row td:first-child{padding-left:30px}.propertypage-name-label{text-transform:capitalize}.colorpicker.main{border:1px solid #c9cbcd;box-shadow:0 1px 3px rgba(0,0,0,.4)}.custom-select{background-color:#fff;position:relative;display:inline-block;vertical-align:middle;height:27px}.custom-select .switcher{background:#fafafa;border:1px solid #c9cbcd;clear:both;height:25px;min-width:65px}.custom-select .switcher .title{display:block;background-repeat:repeat-x;float:left;height:10px;overflow:hidden;padding:5px 20px 5px 12px;vertical-align:middle;width:78px}.custom-select .switcher .icon{position:absolute;right:5px;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.custom-select .items{background:#fff;border:1px solid #c9cbcd;clear:both;cursor:pointer;display:none;position:absolute;top:28px;z-index:3;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%}.custom-select .items .item{cursor:pointer;padding:7px 12px}.custom-select .items .item:hover{background:#f4f7f9}.custom-select .items .item.selected{padding-left:8px;background:#f4f7f9;border-left:4px solid #5cb888}.custom-select .items .item .linestyle{width:100%}.linestyle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAABACAAAAADkRqISAAAAAnRSTlMAAHaTzTgAAAAiSURBVHjaY6hEBgyDCaC6bGi6czi4egj4AQtvcLkTgdB4AKeLTYXhQE1YAAAAAElFTkSuQmCC);background-repeat:repeat-x;height:15px}.solidline{background-position:0 -4px}.dottedline{background-position:0 -55px}.dashedline{background-position:0 -44px}.clearing{clear:both;display:block;height:0;line-height:0;width:100%}div.tooltip{background-color:#ffffc2;border:1px solid #b2b2b2;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:5px;z-index:100}.zoom-selector{background-color:rgba(80,80,80,.15);border:1px solid rgba(80,80,80,.5);position:absolute}.tooltip-selector{position:absolute;font-weight:700;font-size:10px;line-height:normal;opacity:.8;white-space:nowrap}.tooltip-selector-hidden{display:none}.toolbarbuttonicon{width:24px;height:24px;position:absolute;top:1px;left:1px}.toolbarbuttonicon.wide{width:33px}.toolbarpopupbutton{width:32px;height:32px}.chart-note-tooltip{pointer-events:none;position:absolute;line-height:normal}.chart-note-tooltip:before{content:"";display:block;position:absolute;width:0;height:0}.chart-note-tooltip.below:before{top:-7px;left:50%;margin-left:-7px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-bottom:red 8px solid;border-bottom-color:inherit}.chart-note-tooltip.above:before{bottom:-7px;left:50%;margin-left:-7px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-top:red 8px solid;border-top-color:inherit}.chart-note-tooltip .chart-note-tooltip-bgcaret{display:block;position:absolute;width:0;height:0;border-style:solid;border-width:0}.chart-note-tooltip.below .chart-note-tooltip-bgcaret{top:-5px;left:50%;margin-left:-5px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-bottom-width:6px}.chart-note-tooltip.above .chart-note-tooltip-bgcaret{bottom:-5px;left:50%;margin-left:-5px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-top-width:6px}.chart-note-tooltip.no-caret:before,.chart-note-tooltip.no-caret .chart-note-tooltip-bgcaret{display:none}.chart-note-tooltip.hidden{display:none}.chart-note-tooltip .chart-note-tooltip-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:10px;background-color:#fff;border-width:1px;border-style:solid;border-color:inherit}#big-load-more-button-wrap{display:none;position:absolute;right:0;bottom:50%;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}#big-load-more-button-wrap.state-progress,#big-load-more-button-wrap.state-enabled{display:block}#big-load-more-button-wrap.state-hidden *,#big-load-more-button-wrap.state-disabled{display:none}.big-load-more-button{display:inline-block;margin-bottom:-50%;cursor:pointer;opacity:1}.big-load-more-button::before{content:' ';display:block;width:64px;height:64px;background:url(images/button-load-new-bars.png) no-repeat}#big-load-more-button-wrap.state-progress .big-load-more-button::before{opacity:.42}.tooltip-pad-wrap,.tooltip-newbars-wrap{position:absolute;right:50%;bottom:100%}.tooltip-pad,.tooltip-newbars{position:relative;left:50%;display:none;border:1px solid #fff;background:rgba(0,0,0,.75);-webkit-box-shadow:0 0 10px rgba(0,0,0,.15);-moz-box-shadow:0 0 10px rgba(0,0,0,.15);box-shadow:0 0 10px rgba(0,0,0,.15);white-space:nowrap;text-align:center;font-size:13px;color:#41474d}.tooltip-pad{padding:5px 10px;margin-bottom:5px}.tooltip-newbars{padding:13px}.tooltip-pad::after,.tooltip-newbars::after{content:' ';position:absolute;left:50%;bottom:0;display:inline-block;width:19px;height:11px;margin:-11px 0 -11px -9px;background:url(images/icons.png) 0 -80px no-repeat}#big-load-more-button-wrap.state-progress .big-load-more-button,.big-load-more-button:hover{opacity:1}#big-load-more-button-wrap.state-progress .big-load-more-button .tooltip-newbars,.big-load-more-button:hover .tooltip-newbars{display:inline-block;color:#fff}#big-load-more-button-wrap.state-enabled .big-load-more-button:hover::before{background-position:0 -64px}.themesMenu{border:1px solid #000;position:absolute;background:#fff;left:100px}.tvcolorpicker-widget{vertical-align:middle;background-image:url(images/tvcolorpicker-bg.png);background-position:0 0;background-repeat:no-repeat;border:1px solid #cacaca;overflow:hidden;padding:0;width:25px;height:25px;cursor:pointer;font-size:0;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none}.tvcolorpicker-popup{position:absolute;z-index:1000;padding:4px;background:#fff;border:1px solid #9d9d9d;box-shadow:0 1px 2px rgba(0,0,0,.3)}.tvcolorpicker-table{border-collapse:collapse;table-layout:fixed;margin:0 0 6px}.tvcolorpicker-popup .tvcolorpicker-table:last-of-type{margin-bottom:0}.tvcolorpicker-table td{padding:0;width:18px;height:18px}.tvcolorpicker-swatch{width:16px;height:16px;border:0 0;margin:1px;cursor:pointer;overflow:hidden}.tvcolorpicker-swatch.low-contrast{margin:0;border:solid #ccc 1px}.tvcolorpicker-swatch.tvcolorpicker-user{border:solid #eee 1px;margin:0}.tvcolorpicker-cell:hover .tvcolorpicker-swatch{border:solid #000 1px;margin:0}.tvcolorpicker-swatch.active{background:url(images/tvcolorpicker-check.png) 50% 50% no-repeat;border:solid #fff 1px;outline:solid #000 1px;margin:0}.tvcolorpicker-custom-button{display:block}.tvcolorpicker-hsv{position:relative;top:13px;height:130px;width:160px;margin:0 auto}.tvcolorpicker-hs{position:absolute;top:0;left:0;width:128px;height:128px;background:url(images/tvcolorpicker-sprite.png) 0 0 no-repeat;border:solid #eee 1px}.tvcolorpicker-hs-area,.tvcolorpicker-v-area{position:absolute;top:0;left:0;width:100%;height:100%}.tvcolorpicker-v{position:absolute;top:0;left:140px;width:9px;height:128px;background:url(images/tvcolorpicker-sprite.png) -128px 0 no-repeat;border:solid #eee 1px}.tvcolorpicker-hs-handle{width:11px;height:11px;position:absolute;left:0;top:0;margin:-5px 0 0 -5px;background:url(images/tvcolorpicker-sprite.png) 0 -128px no-repeat}.tvcolorpicker-v-handle{position:absolute;left:0;top:0;width:25px;height:11px;margin:-5px 0 0 -8px;background:url(images/tvcolorpicker-sprite.png) -11px -128px no-repeat}.tvcolorpicker-custom-button{margin:6px 0 0}.tvcolorpicker-user-swatches{margin:6px 0 0}.some-colorpicker .tvcolorpicker-widget{margin-right:8px}.properties-tabs{padding:0 25px;border-bottom:1px solid #e5e4e4}.properties-tabs a.properties-tabs-label{padding:20px 0 14px;margin-left:45px;display:inline-block;position:relative;color:#595959}.properties-tabs a.properties-tabs-label.active{font-weight:700}.properties-tabs a.properties-tabs-label.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.properties-tabs a.properties-tabs-label:first-child{margin-left:0}.properties-tabs a.properties-tabs-label:last-child{margin-right:40px}.chart-status-picture{position:absolute;right:5px;top:10px;z-index:5;white-space:nowrap}.series-status-text .status,.series-status-text{display:inline-block;height:13px;vertical-align:top;font-size:11px;font-weight:400;pointer-events:none!important}.series-status-text .dot{width:8px;height:8px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;display:inline-block}.series-status-text.eod{color:#a953ae}.series-status-text.eod .dot{background-color:#a953ae}.series-status-text.connecting{color:#48abc0}.series-status-text.connecting .dot{background-color:#48abc0}.series-status-text.loading{color:#256ed0}.series-status-text.loading .dot{background-color:#256ed0}.series-status-text.delayed{color:#a953ae}.series-status-text.delayed .dot{background-color:#a953ae}.series-status-text.delayed-streaming{color:#ff9247}.series-status-text.delayed-streaming .dot{background-color:#ff9247}.series-status-text.invalid{color:#bd3820}.series-status-text.invalid .dot{background-color:#bd3820}.series-status-text.pre-market{color:#feb300}.series-status-text.pre-market .dot{background-color:#feb300}.series-status-text.post-market{color:#0073d2}.series-status-text.post-market .dot{background-color:#0073d2}.series-status-text.out-of-session{color:#939393}.series-status-text.out-of-session .dot{background-color:#939393}.series-status-text.market,.series-status-text.realtime{color:#318757}.series-status-text.market .dot,.series-status-text.realtime .dot{background-color:#318757}.series-status-text.snapshot{display:none}.chart-status-picture .bats-warning{height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAA7UlEQVR4XpWTgQaDUBSGI8YYl4iIGAMD2GP0BiNijAFgbxYRYwAYY2CMwIiIGCM27cfPzdGOLT44X76uOjnyeu+dBOTgAXrQggwkjnrZQMhAr3AGCy2yBA0Dd57K0HlgA2r6ejQG4YIrIzkwA9cO7vPBgbETcGUopayARyFDNmZPtpahjCKlkCE52zGUSVFTBD+GQoYqKXrwEg0tNGGok6Kh8EdCx39OlFOkYm7AChjlHelfjfOY81jES/vV9D2ach6BLYgYmYFisOHut81uGbtxk326gMFS2+xhbP7Dv3bRImObXoCOgScfkGqBD+IWI88/wYc0AAAAAElFTkSuQmCC) 0 0 no-repeat;cursor:pointer;margin-right:3px;margin-top:-1px;display:none}.chart-status-picture .bats-warning.warn-bats{display:inline-block}.panel-ext{display:none;position:absolute;top:0;right:0;width:11px;height:32px;border:1px solid #c9cbcd;background:#fff}.panel-ext:hover{background:#fff;color:#68696b}.panel-ext.active{background:#f4f7f9;background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9);background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9);background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9);background:-o-linear-gradient(top,#f2f7fa,#f4f7f9);background:linear-gradient(top,#f2f7fa,#f4f7f9);color:#68696b;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.panel-ext-arrow{width:100%;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAQAAADxPw1zAAAAGElEQVR4XmPoqe/5D4b1DAwQTj0DBEAYAPmhC2SlApAHAAAAAElFTkSuQmCC) 50% 50% no-repeat}.chart-loading-screen{position:absolute;top:0;left:0;width:0;height:0;z-index:4}.chart-loading-screen .chart-loading-screen-shield{width:100%;height:100%;opacity:0;background:red}.chart-loading-screen.fade{width:100%;height:100%}.chart-loading-screen.fade .chart-loading-screen-shield{opacity:.5;-webkit-transition:opacity 300ms ease;-moz-transition:opacity 300ms ease;-ms-transition:opacity 300ms ease;-o-transition:opacity 300ms ease;transition:opacity 300ms ease}.control-bar-wrapper{margin-left:-82px;left:50%;position:absolute;bottom:33px;height:28px;z-index:13}.control-bar>svg{float:left;width:16px;height:16px;margin-left:6px;padding:5px;cursor:pointer;border:1px solid #8a8b8d;background:#eee;border-radius:15px;opacity:.4}.control-bar>svg:hover{opacity:.8}.control-bar>svg:active{background:#ddd}.control-bar>svg:first-child{margin-left:0}.back-to-present{display:block;width:12px;height:12px;padding:7px;position:absolute;right:2px;bottom:33px;border-radius:15px;border:1px solid #8a8b8d;background:#eee;opacity:.4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;z-index:13}.back-to-present.hidden{display:none}.back-to-present:hover{opacity:.8}.back-to-present:active{background:#ddd}.property-page .symbol-edit-widget{margin:0}.properties-tabs .help{width:15px;height:15px;background:url(images/dialogs/study-help.png);float:right;margin:1px 10px 0 0}.bar-mark-tooltip{display:none;position:absolute;z-index:14;padding:8px 10px 8px 8px;background:rgba(255,255,255,.9);min-height:18px;border:solid 1px;border-color:gray}.bar-mark-tooltip .text{padding-left:4px;padding-top:2px;max-width:250px;overflow:hidden;text-overflow:ellipsis;display:inline-block;font-size:13px;line-height:13px}.published-charts-tooltip{display:none;position:absolute;z-index:14;padding:8px 30px 8px 8px;background:rgba(255,255,255,.9);border:solid 1px;height:32px;cursor:default;margin-top:-25px}.published-charts-tooltip .avatar{position:absolute;top:8px;left:8px;width:32px;height:32px}.published-charts-tooltip .avatar img{width:32px;height:32px}.published-charts-tooltip .pin{background-image:url(images/pin.png);width:16px;height:16px;vertical-align:top;position:absolute;top:9px;right:9px;cursor:pointer}.published-charts-tooltip .pin:hover{background-position:32px 0}.published-charts-tooltip .pin.pinned,.published-charts-tooltip .pin.pinned:hover{background-position:16px 0}.published-charts-tooltip .text{padding-left:39px;max-width:250px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;font-size:13px;line-height:15px;font-weight:700}.published-charts-tooltip .text:hover{text-decoration:underline}.published-charts-tooltip .username{font-size:11px;color:#8f8f8f;font-weight:400;padding-top:2px;padding-left:39px;white-space:nowrap;line-height:13px}.published-charts-tooltip:after,.published-charts-tooltip:before{left:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.published-charts-tooltip:after{border-width:1em;top:50%;margin-top:-1em}.published-charts-tooltip:before{border-width:1.1em;top:50%;margin-top:-1.1em}.published-charts-tooltip:after{border-color:rgba(255,255,255,0);border-left-color:#fff}.published-charts-tooltip.right:after{border-color:rgba(255,255,255,0);border-right-color:#fff}.published-charts-tooltip.right:before{left:-2.2em}.published-charts-tooltip.right:after{left:-2em}.published-charts-tooltip.green{border-color:#78c143}.published-charts-tooltip.red{border-color:#cc4545}.published-charts-tooltip.neutral{border-color:#eac300}.published-charts-tooltip.green:before{border-color:rgba(120,193,67,0);border-left-color:#78c143}.published-charts-tooltip.red:before{border-color:rgba(204,69,69,0);border-left-color:#cc4545}.published-charts-tooltip.neutral:before{border-color:rgba(234,195,0,0);border-left-color:#eac300}.published-charts-tooltip.green.right:before{border-color:rgba(120,193,67,0);border-right-color:#78c143}.published-charts-tooltip.red.right:before{border-color:rgba(204,69,69,0);border-right-color:#cc4545}.published-charts-tooltip.neutral.right:before{border-color:rgba(234,195,0,0);border-right-color:#eac300}.blue-tooltip{position:absolute;width:230px;border:1px solid #fff;background:rgba(0,0,0,.75);-webkit-box-shadow:0 0 10px rgba(0,0,0,.15);-moz-box-shadow:0 0 10px rgba(0,0,0,.15);box-shadow:0 0 10px rgba(0,0,0,.15);z-index:111;word-wrap:break-word}.blue-tooltip .double-width{width:460px}.blue-tooltip .short{width:150px}.blue-tooltip-text{margin:8px 10px;font-size:13px;color:#eee}.blue-tooltip-text small{font-size:12px}.blue-tooltip-hidden{display:none}.tooltip-pad::before,.tooltip-newbars::before,.blue-tooltip-icon{position:absolute;width:19px;height:11px;margin:-11px 0 -11px -9px}.tooltip-pad::before,.tooltip-newbars::before,.blue-tooltip-top .blue-tooltip-icon{bottom:0;background-position:0 -80px}.blue-tooltip-bottom .blue-tooltip-icon{top:0;background-position:-180px -80px}.blue-tooltip-bottom.ch-smiles-popup .blue-tooltip-icon{background-position:-167px -441px}.chart-controls-bar{position:absolute;height:22px;width:100%;left:0;bottom:0;background:#e6e9ed;overflow:hidden}.chart-container.inactive .chart-controls-bar{background:#f3f5f6}.chart-series-controls{float:right}.chart-controls-bar-buttons{overflow:hidden}.chart-controls-bar-buttons a{cursor:pointer;float:left;position:relative;padding:4px 13px;margin:0 0 1px;color:#8b8c8e;stroke:#8b8c8e;fill:#8b8c8e;font-size:11px;line-height:14px;font-weight:700}.chart-controls-bar-buttons a:not(.disabled):hover{background:#eceef1;color:#555;stroke:#555;fill:#555}.chart-controls-bar-buttons a.active,.chart-controls-bar-buttons a.active:hover{color:#58c3e5;stroke:#58c3e5;fill:#58c3e5}.chart-controls-bar-buttons a.disabled{color:#aaa;stroke:#aaa;fill:#aaa;cursor:default}.chart-controls-bar-buttons a:before{content:" ";display:block;position:absolute;top:4px;left:-1px;width:0;height:14px;border-left:solid 1px #d0d4d9}.chart-container.inactive .chart-controls-bar-buttons a{color:#d0d4d9;stroke:#d0d4d9;fill:#d0d4d9}.chart-container.inactive .chart-controls-bar-buttons a:not(.disabled):hover{background:#eceef1;color:#666;stroke:#666;fill:#666}.chart-container.inactive .chart-controls-bar-buttons a.active{color:#a2ddf0;stroke:#a2ddf0;fill:#a2ddf0}.chart-container.inactive .chart-controls-bar-buttons a.active:hover{color:#58c3e5;stroke:#58c3e5;fill:#58c3e5}.onchart-messages-wrapper{position:absolute;bottom:28px;right:9px;z-index:14}.onchart-message-top,.onchart-message-bottom{background:#fff;background:rgba(255,255,255,.92);border:solid #c9c9c9}.onchart-message-top{border-width:1px 1px 0;font-size:14px;line-height:17px;padding:1px 18px;text-align:center}.onchart-message p,.onchart-message h3{color:#595959;font-size:14px;line-height:17px;margin:7px 0}.onchart-message .submit-button{margin:15px 0 0;text-align:center}.onchart-message .submit-button a{cursor:pointer;pointer-events:auto;display:inline-block;vertical-align:top;color:#fff;padding:6px 20px 5px;background:#1fb2cc}.onchart-message .submit-button a:hover{background:#1fbad3}.onchart-message .onchart-message-close{cursor:pointer;pointer-events:auto;position:absolute;width:23px;height:23px;top:0;right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANklEQVR4AWMAgcjIyGUMqAAuDmcA8X8khRjiGAIYfBw6H8MVYANICh7DxIg2Ca+bSPUd4XACAJL9StMP8XreAAAAAElFTkSuQmCC) 50% 50% no-repeat}.onchart-message-bottom{height:23px;border-width:0 1px 1px;margin:0 0 0 23px}.onchart-message-ear{position:absolute;height:23px;width:23px;bottom:0;left:0;border-top:1px solid #c9c9c9;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAASUlEQVR4AbXMgQAAIBAAsVHl8u7vUhLdAGZmzu7e3yDJIckhySHJIckhySHJIckhySHJIckhySHJIckhySHJIckhySHJIckhyR97eKuLN6YbhwAAAABJRU5ErkJggg==) 100% 0 no-repeat}.onchart-message-copy{position:relative;top:9px}@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?v=4.0.3);src:url(fonts/fontawesome-webfont.eot?#iefix&v=4.0.3) format('embedded-opentype'),url(fonts/fontawesome-webfont.woff?v=4.0.3) format('woff'),url(fonts/fontawesome-webfont.ttf?v=4.0.3) format('truetype'),url(fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.ui-draggable{-ms-touch-action:none}.chart-gui-button-pseudo-border{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}.header-chart-panel .button,.properties-toolbar .button,.tv-dialog .button,.header-chart-panel .favored-list-container span,.properties-toolbar .favored-list-container span,.tv-dialog .favored-list-container span,.header-chart-panel .submenu,.properties-toolbar .submenu,.tv-dialog .submenu,.header-chart-panel .custom-select .switcher,.properties-toolbar .custom-select .switcher,.tv-dialog .custom-select .switcher{position:relative}.header-chart-panel .button:not(.disabled):not(.selected):hover:before,.properties-toolbar .button:not(.disabled):not(.selected):hover:before,.tv-dialog .button:not(.disabled):not(.selected):hover:before,.header-chart-panel .favored-list-container span:not(.disabled):not(.selected):hover:before,.properties-toolbar .favored-list-container span:not(.disabled):not(.selected):hover:before,.tv-dialog .favored-list-container span:not(.disabled):not(.selected):hover:before,.header-chart-panel .submenu:not(.disabled):not(.selected):hover:before,.properties-toolbar .submenu:not(.disabled):not(.selected):hover:before,.tv-dialog .submenu:not(.disabled):not(.selected):hover:before,.header-chart-panel .custom-select .switcher:not(.disabled):not(.selected):hover:before,.properties-toolbar .custom-select .switcher:not(.disabled):not(.selected):hover:before,.tv-dialog .custom-select .switcher:not(.disabled):not(.selected):hover:before{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}.header-chart-panel .colorpicker-widget:not(.disabled):not(.selected),.properties-toolbar .colorpicker-widget:not(.disabled):not(.selected),.tv-dialog .colorpicker-widget:not(.disabled):not(.selected){position:relative}.header-chart-panel .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover,.properties-toolbar .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover,.tv-dialog .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover{border:#b5b7b9 1px solid;z-index:1}.header-chart-panel .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.properties-toolbar .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.tv-dialog .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.header-chart-panel .tv-select-container:not(.sbHolderDisabled):hover,.properties-toolbar .tv-select-container:not(.sbHolderDisabled):hover,.tv-dialog .tv-select-container:not(.sbHolderDisabled):hover{border:#b5b7b9 1px solid}.widgetbar-widgetheader .button:hover{border:#b5b7b9 1px solid}#footer-chart-panel .layout-toggle-container .tv-button{position:relative}#footer-chart-panel .layout-toggle-container .tv-button:hover:after{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}#footer-chart-panel .save-load-buttons .button{position:relative}#footer-chart-panel .save-load-buttons .button:hover{border:#b5b7b9 1px solid;z-index:1}#footer-chart-panel .save-load-buttons .button:hover:not(.last){margin-right:-1px}#footer-chart-panel .save-load-buttons .button.save.titled:hover{overflow:visible;border-right:0;margin-right:0}#footer-chart-panel .save-load-buttons .button.save.titled:hover .separator{margin-top:-1px;border-top:#c9cbcd 1px solid;border-bottom:#c9cbcd 1px solid}.charts-popup-list.sound-selector .item .title-expanded{width:109px}.manage-sound-button{display:inline-block;float:right;cursor:pointer;width:18px;height:18px;position:relative}.manage-sound-button:before{content:" ";position:absolute;top:5px;left:5px}.manage-sound-button.play:before{width:0;height:0;border-style:solid;border-width:4px 0 4px 8px;border-color:transparent transparent transparent #a0a8b5}.manage-sound-button.stop:before{width:8px;height:8px;background-color:#a0a8b5}.manage-sound-button:hover.play:before{border-color:transparent transparent transparent #8791a1}.manage-sound-button:hover.stop:before{background-color:#8791a1}.manage-sound-button:active.play:before{border-color:transparent transparent transparent #cdd3db}.manage-sound-button:active.stop:before{background-color:#cdd3db}.chart-sidebar{position:relative;width:270px;height:100%;top:0;right:0;overflow:hidden}.chart-sidebar.hidden{width:12px}.chart-sidebar .separator{width:13px;height:100%;position:absolute;left:0;z-index:10;cursor:pointer}.chart-sidebar .separator-bar{height:100%;width:1px;border-left:1px solid #c9cbcd;border-right:1px solid #c9cbcd;position:absolute;left:0;background:#fff;overflow:hidden}.chart-sidebar .separator:hover .separator-bar{background:#f4f7f9;width:11px;-moz-transition:all .2s;-webkit-transition:all .2s;-o-transition:all .2s;-ms-transition:all .2s;transition:all .2s}.chart-sidebar.hidden .separator-bar{background:#f4f7f9;width:11px}.chart-sidebar .separator-icon{background:url(images/sidebar.png) no-repeat;width:7px;height:43px;position:absolute;top:50%;left:2px;margin:-21px 0 0}.chart-sidebar.hidden .separator-icon{background-position:-7px 0}.chart-sidebar-pane{margin:34px 0 0 3px;position:relative}.chart-sidebar-pane .header{position:absolute;top:-34px;height:23px;padding:11px 7px 0;width:100%;color:#6f7073;background:#f1f3f6;font-weight:700;font-size:12px}.chart-sidebar-pane .header:hover{background:#f4f7f9;cursor:pointer}.chart-sidebar-pane .header>.icon{width:7px;height:4px;background-position:-184px -140px;vertical-align:middle;margin:0 6px 0 0}.chart-sidebar-pane.minimized .header>.icon{background-position:-192px -140px;height:7px;top:-1px}.chart-sidebar-pane .header .reorder-button{display:none;width:26px;height:26px;border:1px solid #f4f7f9;position:absolute;margin:-8px 0 0 4px;vertical-align:top}.chart-sidebar-pane .header .reorder-button:hover{background:#e0e5ea;border:1px solid #c9cbcd;border-radius:3px}.chart-sidebar-pane .header:hover .reorder-button{display:inline-block}.chart-sidebar-pane .header .reorder-button .icon{width:10px;height:11px;position:absolute;top:7px;left:8px;background-position:-180px -149px}.chart-sidebar-pane .header .reorder-button .icon.down{background-position:-190px -149px}.chart-sidebar-pane .container{height:100%}.chart-sidebar-vseparator{height:1px;background:#c9cbcd;position:relative;z-index:1;-ms-touch-action:none}.chart-sidebar-vseparator .handle{height:5px;width:100%;top:-2px;position:absolute;background:#fff;opacity:.01;cursor:url(chart-client/css/light/cursor_size_vertical.cur),w-resize}.chart-sidebar-vseparator .handle{cursor:url(chart-client/css/light/cursor_size_vertical.cur) 16 15,w-resize}.sb-inner-shadow{box-shadow:0 -1px 4px rgba(0,0,0,.15);position:absolute;bottom:-10px;width:100%;height:10px;background:#fff;z-index:5}.sb-inner-shadow.top{box-shadow:0 1px 4px rgba(0,0,0,.15);top:-10px}.sb-scrollbar{position:absolute;opacity:0;position:absolute!important;width:7px;height:100px;top:73px;right:1px;z-index:1;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-o-transition:opacity .3s;-ms-transition:opacity .3s;transition:opacity .3s}.sb-scrollbar.active,.sb-scrollbar.active-always{opacity:1}.sb-scrollbar-wrap{position:absolute;top:0;right:1px;width:6px;height:100%;z-index:1}.sb-scrollbar-wrap .sb-scrollbar{right:0}.sb-scrollbar-body{width:5px;border:0;background:#d8d8d8;width:6px}.gray .sb-scrollbar-body{background:#75757a;border-color:#75757a;border-radius:3px}.sb-scrollbar-top,.sb-scrollbar-bottom{display:none}.gray,.active-always.gray{opacity:.5}.chart-sidebar-pane .header.selectable .title{color:#007fb9;border-bottom:1px dashed #007fb9}.chart-sidebar-pane .header.selectable .title:hover{color:#3592bd;border-color:#3592bd}.chart-sidebar-pane .header.selectable .dropdown{display:inline-block;width:16px;height:12px;position:relative;top:1px;left:0}.chart-sidebar-pane .header.selectable .dropdown:after{content:'';display:block;width:0;height:0;border:4px solid transparent;border-top-color:#007fb9;position:relative;top:6px;left:6px}.symbol-list-container,.symbol-list{position:relative}.minimized .symbol-list-container,.minimized .symbol-list-header{display:none}.symbol-list-header{height:21px;z-index:1;margin:0 3px;border-bottom:1px solid #ebedf0;color:#888989;cursor:default}.symbol-list-header.sortable{cursor:default}.symbol-list-header.sortable .sorter:hover{cursor:pointer;color:#4c4f66}.symbol-list-item{display:block;height:32px;position:relative;color:#8f8f8f;margin:0 3px;cursor:pointer}.symbol-list-item:nth-child(even){background-color:#f8fafb}.symbol-list-item:hover{background:#edf1f2}.symbol-list-item>div,.symbol-list-header div{display:inline-block}.symbol-list-item .symbol{overflow:hidden}.symbol-list-item .symbol,.symbol-list-item .last-block,.symbol-list-item .change{margin:8px 0 0;white-space:nowrap;vertical-align:top}.symbol-list-item .symbol,.symbol-list-header .header-symbol{width:30%;text-indent:10px}.symbol-list-item .estimate,.symbol-list-header .header-estimate{width:10%;text-align:right}.symbol-list-item .last-block,.symbol-list-header .header-last{width:25%;text-align:right}.symbol-list-item .last-block .last{padding:0 2px}.symbol-list-item .change,.symbol-list-header .header-change{width:45%;text-align:right}.symbol-list-header .header-change div{margin:0 3px 0 0}.symbol-list-item .change .percent,.symbol-list-header .header-change div:last-child{margin:0 8px 0 0}.symbol-list-item.active{background:#ebf8ff}.symbol-list-item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#3e98cd}.symbol-list .controls{display:none;position:absolute;top:6px;right:100%;overflow:hidden;height:100%}.symbol-list-item:hover .controls{right:8px;display:block}.controls-delete{display:none}.symbol-list.deletable .controls-delete{display:block;width:20px;height:20px;background:#da563e url(data:image/gif;base64,R0lGODlhBwAHAPIFAPLHv/vt6v///+eVhtpWPgAAAAAAAAAAACH5BAUKAAUALAAAAAAHAAcAAAMTOEAMKgtAIsNkNjAqbJySszRDAgA7) 50% 50% no-repeat;cursor:pointer;opacity:.75}.symbol-list.deletable .controls-delete:hover{opacity:1}.symbol-list-item.success{color:#333}.symbol-list-item.error{color:#da563e}.symbol-list-item .change.success .percent:before{content:'('}.symbol-list-item .change.success .percent:after{content:'%)'}.symbol-list-item .plus{color:#238859}.symbol-list-item .minus{color:#dc5538}.symbol-list-item .plus-bg,.symbol-list-item .minus-bg{color:#fff}.symbol-list-item .plus-bg{background-color:#238859}.symbol-list-item .minus-bg{background-color:#dc5538}.symbol-list-item .session-status{display:inline-block;width:4px;height:4px;margin:6px 0 5px 4px;border-radius:2px;position:relative}.symbol-list-item .session-status.market{background:0 0}.symbol-list-item .session-status.pre_market{background:#f79d16}.symbol-list-item .session-status.post_market{background:#0a8dff}.symbol-list-item .session-status.out_of_session{background:#9c9c9c}.wl-symbol-edit{float:left;background:#fff;color:#cfd2d4;font-size:12px;width:100px;padding:0 5px;border:solid #c9cbcd 1px;color:#000;height:30px;font-family:'Open Sans',sans-serif;box-sizing:border-box;-moz-box-sizing:border-box}.wl-symbol-edit:focus{border-color:#4c82ce}.symbol-list-item sup{font-size:80%;vertical-align:top}.tv-detail{height:100%;position:relative;overflow:hidden;-webkit-overflow-scrolling:touch}.tv-detail sup{vertical-align:25%;font-size:80%}.dl-header{padding:9px 10px 5px}.dl-header-figures{clear:both;white-space:nowrap}.dl-header-price{font-size:28px;font-weight:700;color:#42434a;min-height:34px}.dl-header-change{font-size:17px;font-weight:700;margin:0 0 0 8px}.dl-header-session-status{font-size:11px;color:#9e9e9e;margin-top:-2px}.dl-header-price .plus,.dl-header-price-extended .plus,.dl-header-change.plus,.dl-header-change-extended.plus{color:#238853}.dl-header-price .minus,.dl-header-price-extended .minus,.dl-header-change.minus,.dl-header-change-extended.minus{color:#dd5538}.dl-header-extended-data{clear:both;white-space:nowrap;margin:6px 0 0}.dl-header-price-extended{font-size:22px;font-weight:700;color:#42434a}.dl-header-change-extended{font-size:16px;font-weight:700;margin:0 0 0 8px}.dl-header .market-status-marker{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:3px;margin-right:5px}.dl-header .market-status-marker.open{background:#68a582}.dl-header .market-status-marker.closed{background:#9c9c9c}.dl-header .market-status-marker.pre-market{background:#f79d16}.dl-header .market-status-marker.post-market{background:#0a8dff}.dl-header #showExtendedHoursLink a{border-bottom:1px dashed #007fb9}.dl-header-symbol{color:#43464e;font-size:15px}.dl-header-symbol-desc{color:#333;font-weight:700;font-size:15px;margin:0 7px 0 0}.dl-header-earning{float:right;width:28px;height:28px;text-align:center;cursor:default;border:1px solid #c9cbcd;color:#c9cbcd;padding-top:5px;box-sizing:border-box;-moz-box-sizing:border-box}.dl-header-earning.soon{border:1px solid #dc5538;color:#dc5538}.dl-header-industry{padding:3px 0 4px;font-size:11px;color:#787878}.dl-bidoffer-spread{margin:10px 0 0}.dl-bidoffer-spread span{display:inline-block;font-size:12px;margin-right:1px;padding:2px 8px;border-radius:9px}.dl-bidoffer-spread span.dl-bid{color:#5b85bf;background:#d4e6fe;margin-right:5px}.dl-bidoffer-spread span.dl-ask{color:#b35b46;background:#f5d8d3}.dl-bidoffer-spread span b{color:#5b85bf}.dl-data{position:relative;padding:0 3px 10px}.dl-item-nodata{display:none;margin:10px;color:#666}.dl-item-group{display:none;margin:12px 10px 0}.dl-item-group-col{float:left;width:48%}.dl-item-group-col:nth-child(even){float:right}.dl-item-group-header{height:20px;cursor:default;color:#343649;font-weight:700;border-bottom:1px solid #343649;padding:3px 0 0 3%}.dl-item{color:#5a5d66;border-bottom:1px solid #eaeaea;height:21px;cursor:default;position:relative;float:left;width:50%}.dl-item.full{float:none;width:100%}.dl-item:hover{background:#edf0f3}.dl-item.drag{background:#edf0f3;box-shadow:0 1px 1px rgba(0,0,0,.2)}.dl-item:hover .wl-icon-delete,.dl-item.drag .wl-icon-delete{display:inline-block}.dl-col{float:left;height:18px;padding:3px 0 0;overflow:hidden}.dl-col-field{width:42%;font-size:11px;color:#888989;padding-left:4%;padding-top:4px;white-space:nowrap;text-overflow:ellipsis}.dl-col-val{width:50%;padding-right:4%;white-space:nowrap;text-overflow:ellipsis;text-align:right;font-weight:700}.dl-col-del{width:15px;position:absolute;right:0}.dl-col-del .wl-icon-delete{top:0}.dl-item.full .dl-col-field{width:69%}.dl-item.full .dl-col-val{width:23%;font-weight:700;color:#7c7c7c}.dl-minichart{height:80px;margin:10px 10px 19px;position:relative;overflow:hidden}.dl-range{height:43px;position:relative;margin:0 10px}.dl-range.first-child{margin:5px 10px 0}.dl-range-mark{width:9px;height:13px;background-position:-140px -220px;position:absolute;margin-left:-5px;left:0;top:2px;-moz-transition:all .3s;-webkit-transition:all .3s;-o-transition:all .3s;-ms-transition:all .3s;transition:all .3s;z-index:1}.dl-range-mark.bid{background-position:0 -337px;opacity:.5;z-index:2}.dl-range-mark.ask{background-position:-9px -337px;opacity:.5;z-index:2}.dl-range-mark.low{margin-left:-4px}.dl-range-bar-bg{height:7px;position:absolute;top:16px;width:100%;background:#d8d8d8}.dl-range-bar{height:7px;background:#51a076;position:absolute;-moz-transition:all .3s;-webkit-transition:all .3s;-o-transition:all .3s;-ms-transition:all .3s;transition:all .3s;border:solid #fff;border-width:0 1px;margin-left:-1px}.dl-range-bar.low{background:#b35b46}.dl-range-bar.hl{background:#aaa}.dl-range-price-l,.dl-range-price-r{position:absolute;font-weight:700;color:#42434a;top:25px}.dl-range-price-r{right:0}.dl-range-caption{position:absolute;bottom:2px;width:100%;text-align:center;color:#787878;font-size:11px}.dl-dialog{height:500px;overflow-y:scroll}.dl-dialog-data{margin:10px 0 0}.dl-dialog-header{font-size:12px;margin:0 0 5px}.dl-dialog-header>strong{font-size:14px}.dl-dialog-header>a{margin:0 0 0 8px;text-decoration:underline}.dl-company-desc{font-size:12px;color:#787878;height:46px}.dl-dialog-more{display:inline-block;cursor:pointer;border-bottom:1px dashed #007fb9;height:14px}.dl-followsymbol button.follow-symbol{vertical-align:top;margin:3px 0 0 4px}.dl-estimate-tooltip>div{margin-top:4px}.depth-widget-notice{padding:2px 10px;color:#666}.depth-widget-notice p{margin:8px 0;text-align:center}.depth-widget-notice p.hint{font-size:12px;font-style:italic}.depth-zoom-wrapper{pointer-events:none;position:absolute;top:2%;left:50%;margin:6px 0 0 -53px;width:99px;background:#d8d8d8;padding:0 0 0 6px;height:4px}.depth-zoom-handle{pointer-events:auto;z-index:11;position:absolute;left:0;top:-8px;width:6px;height:18px;background:#b0b0b0;border-radius:2px;border:1px solid #fff;margin:0 0 0 -1px}.depth-zoom-plus,.depth-zoom-minus{pointer-events:auto;cursor:pointer;position:absolute;top:-8px;width:20px;height:18px;background:#b0b0b0 50% 50% no-repeat;border:1px solid #fff;border-radius:2px}.depth-zoom-plus{right:-22px;background-image:url(data:image/gif;base64,R0lGODlhCAAIAKECAPX19f39/f///////yH5BAEKAAMALAAAAAAIAAgAAAISnBWmI7LnYJsC2GaBao/FhSgFADs=)}.depth-zoom-minus{left:-22px;background-image:url(data:image/gif;base64,R0lGODlhCAAIAPACAPX19f///yH5BAUKAAIALAAAAAAIAAgAQAIMlG+gEQoIozSs1jkLADs=)}.depth-zoom-plus:hover,.depth-zoom-minus:hover{background-color:#b7b7b7}.depth-zoom-plus:active,.depth-zoom-minus:active{background-color:#aaa}.depth-zoom-plus.disabled,.depth-zoom-minus.disabled{opacity:.5;cursor:default;pointer-events:none;background-color:#b0b0b0}.depth-widget-wrap.dragging,.depth-widget-wrap.dragging .depth-zoom-plus,.depth-widget-wrap.dragging .depth-zoom-minus,.depth-zoom-handle{cursor:ew-resize}.tv-news{height:100%;position:relative}.ns-data{position:absolute;width:100%;-moz-transition:opacity .3s;-webkit-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.ns-data.loading{opacity:.5}.ns-item{border-bottom:1px solid #ebedf0;padding:6px 0;position:relative;margin:0 3px}.ns-item:hover{background:#edf0f3}.ns-item-title{margin:0 12px;color:#5a5d66;font-size:13px}.ns-item-title a:hover{text-decoration:underline}.ns-item-desc,.ns-item-date{color:#8f8f8f;font-size:10px}.ns-item-desc{margin:2px 30px 0 12px;min-height:13px}.ns-item-desc .source{font-weight:700}.ns-item-date{position:absolute;bottom:6px;right:12px}.ns-fxwire-message{margin:30px 15px 0;text-align:center;font-size:14px;color:#595959}.ns-fxwire-message h3{margin:5px 0}.ns-fxwire-message a{cursor:pointer;pointer-events:auto;display:inline-block;vertical-align:top;color:#fff;padding:6px 20px 5px;background:#1fb2cc}.ns-fxwire-message-close{cursor:pointer;pointer-events:auto;position:absolute;width:23px;height:23px;top:0;right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANklEQVR4AWMAgcjIyGUMqAAuDmcA8X8khRjiGAIYfBw6H8MVYANICh7DxIg2Ca+bSPUd4XACAJL9StMP8XreAAAAAElFTkSuQmCC) 50% 50% no-repeat}div.widgetbar-widgetheader-icon-economic-calendar{background-position:0 -338px}div.widgetbar-widgetheader-icon-earnings-calendar{background-position:-2px -387px}div.calendar-widget-scnt{height:100%;position:relative;overflow:hidden;-webkit-overflow-scrolling:touch}div.calendar-widget-dcnt{position:absolute;width:100%}div.calendar-widget,div.calendar-widget.header{font-size:.9em;height:18px;padding:7px 0 7px 11px;color:#5a5d66;cursor:default;display:block;overflow:hidden;margin:0 3px}div.calendar-widget.header{height:17px;padding:0 0 0 11px}div.calendar-widget div{white-space:nowrap;display:inline-block;z-index:2;overflow:hidden;box-sizing:border-box}div.calendar-widget.day{padding:8px 5px 6px 10px;display:block;background:#eff9ff;font-weight:700;color:#2f5d7a;margin:3px;text-transform:uppercase}div.calendar-widget.day.green{background:#e4f3d5;color:#4c6e28}div.calendar-widget.green{background:#f7fbf3}div.calendar-widget.day.hand{cursor:pointer}div.calendar-widget div a{color:#5d8ed5}div.calendar-widget.regular{margin-left:3px;position:relative}div.calendar-widget.regular:hover{background:#ecf6e1;cursor:pointer}div.calendar-widget.regular:hover div{cursor:pointer}div.calendar-widget.regular.active,div.calendar-widget.regular.active:hover{background:#ebf8ff}div.calendar-widget.regular.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#3e98cd}div.calendar-widget.hidden{display:none;visibility:hidden;height:0}div.calendar-widget.regular div.symbol{color:#303030}div.calendar-widget div img{margin:0 0 0 10px;width:11px;height:11px;border:0 solid #000;display:inline}div.calendar-widget div.bold{font-weight:700}div.calendar-widget div.ar{text-align:right}div.calendar-widget div.actual{text-align:right;color:#5a5d66}div.calendar-widget div.calendar-widget-w-15{width:20%}div.calendar-widget div.calendar-widget-w-23{width:23%}div.calendar-widget div.calendar-widget-w-15-l{width:15%;padding:0 2% 0 0}div.calendar-widget div.calendar-widget-w-30{width:30%}div.calendar-widget div.calendar-widget-w-35{width:35%}div.calendar-widget div.calendar-widget-w-25-l{width:30%}div.calendar-widget.header div.calendar-widget-w-15,div.calendar-widget.header div.calendar-widget-w-23,div.calendar-widget.header div.calendar-widget-w-15-l,div.calendar-widget.header div.calendar-widget-w-30,div.calendar-widget.header div.calendar-widget-w-35,div.calendar-widget.header div.calendar-widget-w-25-l{color:#888989;font-weight:400}html,body{background:0 0;overflow:hidden;min-width:240px;height:100%}body{min-width:600px}#library-container{border:1px solid #d9dadb;background:#fff}#library-container #showExtendedHoursLink{display:none}#library-container .header-chart-panel{min-height:0;padding:0 0 0 5px}.insert-study-dialog.minimized{width:490px}.insert-study-dialog.minimized .insert-study-tabs{display:none}.insert-study-dialog.minimized .insert-study-page-content.page-padded{padding:10px 0 0 10px}.insert-study-dialog.scrollbar.minimized{width:498px}.minimized .insert-study-header .header-text{display:none}.minimized .insert-study-items li{height:13px;padding:8px 5px 8px 20px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.minimized .insert-study-items li:hover{overflow:visible;z-index:18;position:relative;width:auto;min-width:140px}.minimized .insert-study-items li .fav{display:none}.minimized .insert-study-main{width:490px}.minimized .insert-study-pages .search-header{padding-left:4px}.minimized .insert-study-items ul.column{width:150px}.minimized .search-header{display:none}.on-widget .getimage,.on-widget .open-popup{margin-left:4px;padding:7px;border-width:0!important}.on-widget .getimage:hover{background:#5ece93}.on-widget .open-popup{border:0;background:#6798bb}.on-widget .open-popup:hover{background:#69a3cc}.on-widget .open-popup:active{background:#71acd6}.on-widget .open-popup i{width:16px;height:14px;background-image:url(images/icons.png);background-position:-180px -400px}.on-widget .widgetbar-widget-hotlist .widgetbar-widgetheader .widgetbar-headerspace{display:none}.onchart-tv-logo,.onchart-cme-logo,.onchart-custom-logo{display:block;position:absolute;z-index:10}.onchart-cme-logo{left:10px;bottom:25px;width:135px}.onchart-tv-logo,.onchart-custom-logo{left:1px;bottom:22px;width:auto}.onchart-tv-logo.on-pane,.onchart-custom-logo.on-pane{bottom:1px}.onchart-custom-logo .inner{display:block;padding:2px 9px;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease;background-color:rgba(255,255,255,.8)}.onchart-custom-logo .wrapper{display:block;padding:3px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease;background-color:rgba(255,255,255,.4)}.onchart-custom-logo table.inner{border-collapse:collapse;border:0}.onchart-custom-logo table.inner tbody{opacity:.6}.onchart-custom-logo table.inner td{padding:0}.onchart-custom-logo table.inner td.custom-logo{line-height:0}.onchart-custom-logo table.inner td.tv-link{text-align:center;line-height:10px}.onchart-custom-logo .text{font-size:10px}.onchart-tv-logo .wrapper{display:block;padding:3px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease}.onchart-tv-logo.expanded .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.expanded.grey .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.expanded.blue .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.black .wrapper{background-color:rgba(0,0,0,.3)}.onchart-tv-logo.expanded.black .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo .inner{display:block;height:32px;line-height:31px;padding:0 9px;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease}.onchart-tv-logo.expanded .inner{background-color:rgba(255,255,255,.8)}.onchart-tv-logo.expanded.grey .inner{background-color:rgba(224,222,222,.8)}.onchart-tv-logo.expanded.blue .inner{background-color:rgba(209,232,255,.8)}.onchart-tv-logo.expanded.black .inner{background-color:rgba(0,0,0,.8)}.onchart-tv-logo img{width:33px;height:23px;display:inline-block;vertical-align:middle;-webkit-transition:display .7s ease;-moz-transition:display .7s ease;-ms-transition:display .7s ease;-o-transition:display .7s ease;transition:display .7s ease}.onchart-tv-logo .text{display:inline-block;width:0;overflow:hidden;padding-left:36px;vertical-align:middle;-webkit-transition:width .7s ease;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease}.onchart-tv-logo.expanded .text{width:145px}.onchart-tv-logo img{display:block;position:absolute;top:8px;-webkit-transition:opacity .7s ease;-moz-transition:opacity .7s ease;-ms-transition:opacity .7s ease;-o-transition:opacity .7s ease;transition:opacity .7s ease}.onchart-tv-logo img.faded{opacity:1}.onchart-tv-logo.expanded img.faded{opacity:0}.text .logo-highlighted{font-weight:700;text-decoration:underline}.onchart-cme-logo img{width:inherit;opacity:.55}.onchart-cme-logo a.onchart-logo{width:inherit;white-space:nowrap;position:relative;top:-6px;left:0;color:#007fb9;opacity:.7;font-size:12px}.onchart-cme-logo a.onchart-logo .logo-fade{color:#231f20;opacity:.85}.on-cme-widget .symbol-search-dialog .filter,.on-cme-widget .symbol-edit-popup .filter,.on-cme-widget .compare-widget .predefine-section,.on-cme-widget .compare-widget .vspace{display:none}.on-cme-widget .symbol-search-dialog .results{height:450px}.tv-embed-buttons-contaner{float:right}.on-cme-widget .getimage:hover{background:#5ece93}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container{position:absolute;left:1px;bottom:1px;height:38px;width:50px;background:#fff}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container:before{content:'';display:block;width:100%;height:5px;position:absolute;top:-5px;left:0;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ffffff', GradientType=0)}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container .getimage{margin:6px 11px}.on-cme-widget #library-container>.cme-saveimage-container{position:absolute;left:8px;bottom:7px}.on-cme-widget #library-container>.cme-saveimage-container .getimage{margin:0;padding:3px 7px 2px 6px;border:0}.tv-side-toolbar .tv-close-panel{margin-left:1px}.onchart-tv-logo img.custom-image{position:relative;top:0;left:0;width:auto;height:auto}.save-load-buttons.in-header{margin-left:0}.header-chart-panel .button.iconed.screenshot.process{background:url(images/bar-loader.gif) 0 0 repeat!important}.header-chart-panel .button.iconed.screenshot{padding:6px 8px 8px;margin-left:3px}.header-chart-panel .button.iconed.screenshot i{background:url(images/icons.png) 0 0 no-repeat;background-position:-60px -240px;width:16px;height:13px}.header-chart-panel .left{margin:0}.header-chart-panel .group{margin:5px 0 0}.load-chart .chart-search,.load-chart .chart-search input{width:100%}</style></head><body class="chart-page on-widget"><svg style="display:none;"><symbol viewBox="0 0 17.5 16" id="svg-alarm-clock-plus"><title>alarm-clock-plus</title><path d="M2.766.016c-1.515 0-2.75 1.235-2.75 2.75 0 .518.155.992.406 1.406.981-1.569 2.539-2.737 4.375-3.219-.504-.564-1.218-.938-2.031-.938zm7.781 0c-.813 0-1.527.374-2.031.938 1.841.479 3.391 1.648 4.375 3.219.251-.415.406-.888.406-1.406 0-1.515-1.235-2.75-2.75-2.75zm-3.875 1.719c-3.489 0-6.313 2.854-6.313 6.344 0 1.363.423 2.625 1.156 3.656l-.906 1.156a.857.857 0 1 0 1.344 1.063l.75-.969c1.083.875 2.466 1.406 3.969 1.406.668 0 1.298-.123 1.906-.313v-1.719c-.581.26-1.226.406-1.906.406-2.596 0-4.688-2.092-4.688-4.688 0-2.596 2.092-4.719 4.688-4.719 2.261 0 4.147 1.619 4.594 3.75h1.625c-.463-3.036-3.057-5.375-6.219-5.375zm-.063 2.438a.65.65 0 0 0-.094.031.65.65 0 0 0-.5.656v2.938l-1.25 1.313a.652.652 0 1 0 .938.906l1.438-1.5.188-.188v-3.469a.65.65 0 0 0-.719-.688zm6.375 4.625v2.687h-2.719v1.813h2.719v2.688h1.781v-2.688h2.719v-1.813h-2.719v-2.687h-1.781z"/></symbol><symbol viewBox="0 0 13.3 14.4" id="svg-alarm-clock"><title>alarm-clock</title><path d="M2.759.013c-1.515 0-2.75 1.235-2.75 2.75 0 .518.155.992.406 1.406.981-1.569 2.539-2.737 4.375-3.219-.504-.564-1.218-.938-2.031-.938zm7.781 0c-.813 0-1.527.374-2.031.938 1.841.479 3.391 1.648 4.375 3.219.251-.415.406-.888.406-1.406 0-1.515-1.235-2.75-2.75-2.75zm-3.875 1.719c-3.489 0-6.313 2.854-6.313 6.344 0 1.363.423 2.625 1.156 3.656l-.906 1.156a.857.857 0 1 0 1.344 1.063l.75-.969c1.083.875 2.466 1.406 3.969 1.406 1.496 0 2.888-.507 3.969-1.375l.719.938a.857.857 0 1 0 1.344-1.063l-.875-1.125c.742-1.035 1.156-2.316 1.156-3.687 0-3.489-2.823-6.344-6.313-6.344zm0 1.625c2.596 0 4.688 2.123 4.688 4.719 0 1.234-.476 2.352-1.25 3.187a.85.85 0 0 0-.063.063c-.852.885-2.045 1.438-3.375 1.438-2.596 0-4.688-2.092-4.688-4.687 0-2.596 2.092-4.719 4.688-4.719zm-.063.813a.65.65 0 0 0-.094.031.65.65 0 0 0-.5.656v2.938l-1.25 1.313a.652.652 0 1 0 .938.906l1.438-1.5.188-.188v-3.469a.65.65 0 0 0-.719-.688z"/></symbol><symbol viewBox="2 6 27 22" id="svg-base"><title>base</title><path d="M12.1 24h-2v-1h.4c-.5-.3-.9-.7-1.4-1.2v.2H4v-1h4.3c-.3-.3-.5-.7-.7-1H4v-1h3c-.2-.3-.3-.7-.4-1H4v-1h2.3c-.2-.8-.3-1.6-.3-2.5 0-1.6.4-3.1 1-4.5H2v18h15v-3h-.5c-1.6 0-3.1-.4-4.4-1zM9 26H4v-1h5v1zm0-2H4v-1h5v1zm6 2h-5v-1h5v1zm8.5-6.6c1-1.4 1.5-3 1.5-4.9C25 9.8 21.2 6 16.5 6S8 9.8 8 14.5s3.8 8.5 8.5 8.5c1.8 0 3.5-.6 4.9-1.5l5.6 5.6 2.1-2.1-5.6-5.6zM22 18.1L20.1 20c-1 .7-2.3 1.1-3.6 1.1-3.6 0-6.5-2.9-6.5-6.5S12.9 8 16.5 8s6.5 2.9 6.5 6.5c0 1.3-.4 2.5-1 3.6z"/></symbol><symbol viewBox="4 4 21 23" id="svg-calendar"><title>calendar</title><path d="M23 9v15H7V9H5v17h20V9h-2zm-4-3h-2v4h2V6zm-6 0h-2v4h2V6zm-2 8H9v2h2v-2zm5 0h-2v2h2v-2zm5 0h-2v2h2v-2zm-2 7h2v-2h-2v2zm-3-2h-2v2h2v-2zm-5 0H9v2h2v-2z"/></symbol><symbol viewBox="4 6 23 21" id="svg-chat"><title>chat</title><path d="M22 6H5v12h1v4l4-4h3v-6h9V6zm-8 7v10h8l4 3v-3h1V13H14z"/></symbol><symbol viewBox="5 7 23 21" id="svg-datawindow"><title>datawindow</title><path d="M6 7v18h20V7H6zm18 16H8V9h16v14zm-2-8H10v2h12v-2zm0-4H10v2h12v-2zm0 8H10v2h12v-2z"/></symbol><symbol viewBox="0 0 595.3 841.9" id="svg-help"><title>help</title><path d="M297 127.5c-161.8 0-293 131.2-293 293s131.2 293 293 293 293-131.2 293-293-131.2-293-293-293zm0 537.2c-134.8 0-244.2-109.3-244.2-244.2S162.2 176.3 297 176.3s244.2 109.3 244.2 244.2S431.8 664.7 297 664.7zm-24.4-122.1h48.8v-48.8h-48.8v48.8zM368 319c-17.7-13.9-41.6-20.9-71.5-20.9-28.5 0-51.5 6.9-69 20.6-17.5 13.7-26.8 33.2-28.2 52.9h48.8c3.3-13.7 8.4-21.5 17.3-28.2 8.9-6.7 20-10.1 33.3-10.1 13.7 0 24.7 3.2 32.8 9.6 8.1 6.4 12.2 14.2 12.2 23.2 0 6.5-2.3 12.4-6.9 17.8-3 3.4-12.1 10.6-27.3 21.6-15.2 11-25.4 20.9-30.5 29.7-5.1 8.8-7.6 20-7.6 33.6 0 1.3 1-5.7 1.2.4h48.8c-.2-12.7-1.5-10.9 1.2-15.9 2.7-4.9 9.5-11.5 20.5-19.6 21.3-15.7 35.2-28.1 41.7-37.3 6.5-9.1 9.8-18.8 9.8-29 0-18.3-8.9-34.5-26.6-48.4z"/></symbol><symbol viewBox="6 6 21 23" id="svg-hotlists"><title>hotlists</title><path d="M22 14s-.8 1.8-1 4c0 0-1.6-8.8-8.3-13 0 0 2.8 4.5.9 6.5 0 0-1.2 1.4-1.6 3.5 0 0-.4 1.5 0 3 .3 1-2-.6-2-3 0 0-1.4 1.7 1 6 0 0 1.3 1.7 1 3 0 0-2.7-.6-4-4 0 0 .1 4.2 2 6 2 1.8 4.5 2 6 2 0 0 6.6 0 7-5 .5-5.2-1.6-6.5-1-9z"/></symbol><symbol viewBox="-80 -25 140 140" id="svg-left"><title>left</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M10 12l-10.7-11.3-40.3 42.5.1.1-.1.1 40.3 42.5 10-10.6-29.7-31.2z"/></symbol><symbol viewBox="4 6 23 21" id="svg-messages"><title>messages</title><path d="M16 18h3v-3h-3v3zm-2-5v10h9l3 3v-3h1V13H14zm6 2v4h-4v3h-1v-8h5v1zm6 0v7h-1v-6h-1v1h-1v-1h-1v6h-1v-8h1v1h1v1h1v-1h1v-1h1v1zm-4-9H5v12h1v4l4-4h3v-6h9V6z"/></symbol><symbol viewBox="0 0 120 120" id="svg-minus"><title>minus</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M28 50h65v17h-65z"/></symbol><symbol viewBox="300 310 0.3 216.9" id="svg-notes"><title>notes</title><path d="M363.5 411.5v17H406v-17h-42.5zm-59.5-102h-17V352h17v-42.5zm76.3 42l-12-12-30.1 30.1 12 12 30.1-30.1zm-169.6 137l12 12 30.1-30.1-12-12-30.1 30.1zm42.4-123.1L222.6 335l-12.2 12.2 30.4 30.4 12.3-12.2zm84.8 109.2l30.4 30.4 12.2-12.2-30.4-30.4-12.2 12.2zM277.5 497h-.2v23.9l5.9 3.8 5.6 5.9h13.7l5.3-5.9 6.1-3.8V497h-36.4zm68.6-74.5c.8-6.6.3-11.3.3-11.3-2.8-19.3-13.3-29.7-23.5-35.4-7.4-4.2-16.2-6.7-24.9-6.8h-2.5c-15.8.5-27 7-33.8 12.5-5.1 4.1-7.7 7.7-7.7 7.7-6.9 8.7-9.4 17.7-9.5 25.9-.1 10.7 3.7 20.2 7.1 26.5 2.6 4.9 5 7.8 5 7.8 3.6 4.6 5.8 10.1 7 15.1 1.8 7.4 1.7 10.2 1.7 10.2.3 6.5 2.5 10.1 4.1 11 .5.3 1.3.7 2.3.7l4.2 3.9h39.7l3.9-3.9h.7c3.6-.5 5.6-6.6 6-10.5.4-4 .5-6 .5-6 0-.4.1-.9.1-1.5.9-9.4 9.9-23.1 9.9-23.1.5-.6.9-1.1 1.3-1.7 5.2-6.9 7.3-14.8 8.1-21.1zm-118.6-11H185v17h42.5v-17z"/></symbol><symbol viewBox="5 6 21 21" id="svg-notifications"><title>notifications</title><path d="M15.5 27c1.2 0 2.2-.9 2.4-2H13c.3 1.1 1.3 2 2.5 2zm6.5-7v-6c-.2-2.9-2.3-5.3-5.1-5.9 0-.2.1-.4.1-.6 0-.8-.7-1.5-1.5-1.5S14 6.7 14 7.5c0 .2.1.4.2.6-2.8.6-4.9 3-5.1 5.9v5.9C9 22.7 7 23 7 23v1h17v-1s-2-.3-2-3z"/></symbol><symbol viewBox="0 0 140 140" id="svg-plus"><title>plus</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M112 60h-34v-34h-17v34h-34v17h34v34h17v-34h34z"/></symbol><symbol viewBox="0 0 15 15" id="svg-redo"><title>redo</title><path d="M7.5 8.2v3.2l7.5-4.9-7.5-4.8v3.3s-7.5-.9-7.5 8.4c0-.1 1.7-5.2 7.5-5.2z"/></symbol><symbol viewBox="-58 -18 120 120" id="svg-restore"><title>restore</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M31 13c-7.6-7.7-18.2-12.5-29.9-12.5-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8c-4.8 3.6-10.8 5.7-17.3 5.7-16.2 0-29.3-13.2-29.3-29.4s13.1-29.4 29.3-29.4c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5v-32.8l-12.3 12.5z"/></symbol><symbol viewBox="0 0 14.8 13.4" id="svg-right-stop"><title>right-stop</title><path fill="#8A8B8D" d="M8 6.7l-6.3-6.7-1.6 1.7 4.7 4.9-4.8 5 1.7 1.8 6.3-6.7zm6.8 0l-6.4-6.7-1.6 1.7 4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></symbol><symbol viewBox="-90 -55 140 140" id="svg-right"><title>right</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M10 12l-40.3-42.5-10 10.6 29.7 31.2-30.4 32.1 10.7 11.3 40.3-42.5-.1-.1z"/></symbol><symbol viewBox="0 0 15 11.5" id="svg-snapshot"><title>snapshot</title><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zm5.5-2.9h-2.2c0-1-.9-1.9-2-1.9h-2.7c-1.1 0-1.9.9-1.9 1.9h-2.3c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9h11.1c1.1 0 1.9-.9 1.9-1.9v-5.7c.1-1.1-.8-2-1.9-2zm-5.5 8.3c-1.9 0-3.5-1.6-3.5-3.5s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></symbol><symbol viewBox="0 0 14.8 9.4" id="svg-stocktwits"><title>stocktwits</title><path d="M3.9 4c-.7-.3-1.1-.5-1.3-.6l-.4-.4c-.1-.1-.1-.3-.1-.5 0-.3.1-.5.3-.7.2-.2.5-.3.9-.3.3 0 .7 0 1 .1.3.2.7.4 1.2.5l.7-1.5c-.5-.2-1-.4-1.4-.5l-1.4-.1c-1.1 0-1.9.2-2.4.7s-.9 1.1-.9 1.9c0 .4.1.8.3 1.1s.4.6.7.8c.3.2.7.5 1.3.8l1.2.6c.2.2.4.3.5.4.1.1.2.3.2.5 0 .3-.1.6-.4.7-.2.2-.6.2-1 .2s-.8-.1-1.2-.2c-.5 0-1.1-.2-1.7-.5v1.8c.8.4 1.7.6 2.7.6 1.1 0 2-.2 2.6-.7.7-.5 1-1.2 1-2 0-.6-.2-1.1-.5-1.5-.4-.4-1-.8-1.9-1.2zm3.1-4v1.6h3.1v7.8h1.6v-7.8h3.1v-1.6h-7.8z"/></symbol><symbol viewBox="0 0 10 14" id="svg-trading-connect"><title>trading-connect</title><circle cx="5" cy="7" r="3"/></symbol><symbol viewBox="0 0 15 11.6" id="svg-twitter"><title>twitter</title><path d="M15 1.4c-.3.1-1 .4-1.7.5.4-.2 1.1-1 1.3-1.6-.4.3-1.4.7-1.9.7-.6-.7-1.4-1-2.3-1-1.7 0-3.1 1.3-3.1 3 0 .2 0 .4.1.7-2.3-.1-5-1.2-6.5-3.1-.9 1.5-.1 3.3.9 3.9-.4 0-1 0-1.3-.3 0 1 .5 2.4 2.4 2.9-.4.2-1 .1-1.3.1.1.9 1.4 2 2.8 2-.6.5-2.3 1.4-4.4 1.1 1.4.8 3.1 1.3 4.8 1.3 5 0 8.8-3.9 8.6-8.6.5-.4 1.1-.9 1.6-1.6z"/></symbol><symbol viewBox="0 0 15 15" id="svg-undo"><title>undo</title><path d="M15 13.4c0-9.3-7.5-8.4-7.5-8.4v-3.3l-7.5 4.8 7.5 4.9v-3.2c5.8 0 7.5 5.1 7.5 5.2z"/></symbol><symbol viewBox="0 0 1024 973.125" id="svg-chat-search"><title>chat-search</title><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></symbol><symbol viewBox="-2.4 120.9 600 600" id="svg-config"><title>config</title><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></symbol><symbol viewBox="0 0 17 17" id="svg-plus-bolder"><title>plus-bolder</title><path d="M7 2h3v13H7M2 7h13v3H2z"/></symbol></svg><div class="loading-indicator" id="loading-indicator"></div><script src="//fgnass.github.io/spin.js/spin.min.js"></script><script>var loadingSpinner=new Spinner({lines:15,length:0,width:9,radius:30,corners:1,rotate:0,direction:1,color:"#000",speed:0.75,trail:74,shadow:false,hwaccel:false,className:"spinner",zIndex:2000000000,top:"50%",left:"50%"}).spin(document.getElementById("loading-indicator"));</script><div id="library-container" class="chart-page"><div class="tv-side-toolbar"></div><div class="tv-side-panel"></div><div class="tv-main-panel"><div class="header-chart-panel"><div class="right"></div><div class="left"></div></div><div id="chart-area"></div></div></div><script>var A82={};var __initialEnabledFeaturesets=["charting_library"];</script><script>ChartingLibraryBackend=function(){var a={},b,c,d;a.initialize=function(a,g,h){b=a;c=g;d=h};a.getCharts=function(a){return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(d,"1.0",b,c),type:"GET",crossDomain:!0}).done(function(b){b=JSON.parse(b);"ok"!=b.status&&console.warn("Charts list request failed: "+b.message);b=b.data.map(function(a){return{id:a.id,name:a.name,image_url:a.id,modified_iso:a.timestamp,short_symbol:a.symbol,interval:a.resolution}});a(b)})};a.removeChart=function(a,g){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,
"1.0",b,c,a),type:"DELETE",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=a.status&&console.warn("Chart delete request failed: "+a.message);g()})};a.saveChart=function(a,g,h,k,l,m,n){var q="{0}/{1}/charts?client={2}&user={3}".format(d,"1.0",b,c);"undefined"!=typeof l&&(q+="&chart="+l);$.ajax({url:q,data:{name:a,content:JSON.stringify(k),symbol:g,resolution:h},type:"POST",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=a.status?(console.warn("Chart save request failed: "+a.message),
n()):m(a.id)}).fail(function(){n()})};a.loadChart=function(a){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,"1.0",b,c,a.id),type:"GET",crossDomain:!0}).done(function(b){b=JSON.parse(b);"ok"!=b.status?console.warn("Chart load request failed: "+b.message):(b=JSON.parse(b.data.content),b.uid=a.id,D17.emit("chart_load_requested",b))}).fail(function(){console.warn("Error loading chart")})};a.removeStudyTemplate=function(a,b){};a.getStudyTemplateContent=function(a,
b){};a.saveStudyTemplate=function(a,b){};a.getStudyTemplatesList=function(a){a([])};a.clearStudyTemplatesListCache=function(a){};return a}();(function(){var a=function(){};"undefined"===typeof window.console&&(window.console={});for(var b=window.console,c="dir log time info warn count clear debug error group trace assert dirxml profile timeEnd groupEnd profileEnd timeStamp exception table notifyFirebug groupCollapsed getFirebugElement firebug userObjects".split(" "),d=0,e=c.length;d<e;d++){var g=c[d];if("undefined"===typeof b[g])try{b[g]=a}catch(h){}}var k=window.onerror;window.__tv_js_errors=[];window.onerror=function(a,b,c){window.__tv_js_errors.push(a+
" (found at "+b+", line "+c+")");if(k)try{k.apply(window,arguments)}catch(d){}}})();(function(a,b){function c(a){var b=S[a]={},c,d;a=a.split(/\s+/);c=0;for(d=a.length;c<d;c++)b[a[c]]=!0;return b}function d(a,c,d){if(d===b&&1===a.nodeType)if(d="data-"+c.replace(U,"-$1").toLowerCase(),d=a.getAttribute(d),"string"===typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:t.isNumeric(d)?+d:M.test(d)?t.parseJSON(d):d}catch(e){}t.data(a,c,d)}else d=b;return d}function e(a){for(var b in a)if(("data"!==b||!t.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function g(a,b,c){var d=
b+"defer",e=b+"queue",g=b+"mark",h=t._data(a,d);!h||"queue"!==c&&t._data(a,e)||"mark"!==c&&t._data(a,g)||setTimeout(function(){t._data(a,e)||t._data(a,g)||(t.removeData(a,d,!0),h.fire())},0)}function h(){return!1}function k(){return!0}function l(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function m(a,b,c){b=b||0;if(t.isFunction(b))return t.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return t.grep(a,function(a,d){return a===b===c});if("string"===typeof b){var d=t.grep(a,
function(a){return 1===a.nodeType});if(Wa.test(b))return t.filter(b,d,!c);b=t.filter(b,d)}return t.grep(a,function(a,d){return 0<=t.inArray(a,b)===c})}function n(a){var b=za.split("|");a=a.createDocumentFragment();if(a.createElement)for(;b.length;)a.createElement(b.pop());return a}function q(a,b){return t.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function r(a,b){if(1===b.nodeType&&t.hasData(a)){var c,d,e;d=t._data(a);var g=t._data(b,
d),h=d.events;if(h)for(c in delete g.handle,g.events={},h)for(d=0,e=h[c].length;d<e;d++)t.event.add(b,c,h[c][d]);g.data&&(g.data=t.extend({},g.data))}}function u(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==
a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(t.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function w(a){return"undefined"!==typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!==typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function A(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function v(a){var b=(a.nodeName||"").toLowerCase();
"input"===b?A(a):"script"!==b&&"undefined"!==typeof a.getElementsByTagName&&t.grep(a.getElementsByTagName("input"),A)}function B(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?1:0;if(0<d){if("border"!==c)for(;4>e;e+=2)c||(d-=parseFloat(t.css(a,"padding"+ha[e]))||0),d="margin"===c?d+(parseFloat(t.css(a,c+ha[e]))||0):d-(parseFloat(t.css(a,"border"+ha[e]+"Width"))||0);return d+"px"}d=oa(a,b);if(0>d||null==d)d=a.style[b];if(ra.test(d))return d;d=parseFloat(d)||0;if(c)for(;4>e;e+=
2)d+=parseFloat(t.css(a,"padding"+ha[e]))||0,"padding"!==c&&(d+=parseFloat(t.css(a,"border"+ha[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(t.css(a,c+ha[e]))||0);return d+"px"}function D(a){return function(b,c){"string"!==typeof b&&(c=b,b="*");if(t.isFunction(c))for(var d=b.toLowerCase().split(kb),e=0,g=d.length,h,k;e<g;e++)h=d[e],(k=/^\+/.test(h))&&(h=h.substr(1)||"*"),h=a[h]=a[h]||[],h[k?"unshift":"push"](c)}}function C(a,c,d,e,g,h){g=g||c.dataTypes[0];h=h||{};h[g]=!0;g=a[g];for(var k=0,l=g?g.length:
0,m=a===Xa,n;k<l&&(m||!n);k++)n=g[k](c,d,e),"string"===typeof n&&(!m||h[n]?n=b:(c.dataTypes.unshift(n),n=C(a,c,d,e,n,h)));!m&&n||h["*"]||(n=C(a,c,d,e,"*",h));return n}function z(a,c){var d,e,g=t.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&t.extend(!0,a,e)}function F(a,b,c,d){if(t.isArray(b))t.each(b,function(b,e){c||da.test(a)?d(a,e):F(a+"["+("object"===typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==t.type(b))d(a,b);else for(var e in b)F(a+"["+e+"]",b[e],c,
d)}function G(){try{return new a.XMLHttpRequest}catch(b){}}function J(){setTimeout(E,0);return Na=t.now()}function E(){Na=b}function I(a,b){var c={};t.each(Oa.concat.apply([],Oa.slice(0,b)),function(){c[this]=a});return c}function L(a){if(!Ya[a]){var b=H.body,c=t("<"+a+">").appendTo(b),d=c.css("display");c.remove();if("none"===d||""===d)ka||(ka=H.createElement("iframe"),ka.frameBorder=ka.width=ka.height=0),b.appendChild(ka),wa&&ka.createElement||(wa=(ka.contentWindow||ka.contentDocument).document,
wa.write((t.support.boxModel?"<!doctype html>":"")+"<html><body>"),wa.close()),c=wa.createElement(a),wa.body.appendChild(c),d=t.css(c,"display"),b.removeChild(ka);Ya[a]=d}return Ya[a]}function P(a){return t.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var H=a.document,R=a.navigator,O=a.location,t=function(){function c(){if(!d.isReady){try{H.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,h)},e=a.jQuery,g=a.$,
h,k=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,m=/^\s+/,n=/\s+$/,r=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,q=/^[\],:{}\s]*$/,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,t=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,D=/(webkit)[ \/]([\w.]+)/,z=/(opera)(?:.*version)?[ \/]([\w.]+)/,w=/(msie) ([\w.]+)/,C=/(mozilla)(?:.*? rv:([\w.]+))?/,A=/-([a-z]|[0-9])/ig,B=/^-ms-/,F=function(a,b){return(b+"").toUpperCase()},da=R.userAgent,E,G,J=Object.prototype.toString,O=Object.prototype.hasOwnProperty,
S=Array.prototype.push,I=Array.prototype.slice,pa=String.prototype.trim,N=Array.prototype.indexOf,W={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var g;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!c&&H.body)return this.context=H,this[0]=H.body,this.selector=a,this.length=1,this;if("string"===typeof a){g="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:k.exec(a);if(!g||!g[1]&&c)return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a);
if(g[1])return e=(c=c instanceof d?c[0]:c)?c.ownerDocument||c:H,(a=r.exec(a))?d.isPlainObject(c)?(a=[H.createElement(a[1])],d.fn.attr.call(a,c,!0)):a=[e.createElement(a[1])]:(a=d.buildFragment([g[1]],[e]),a=(a.cacheable?d.clone(a.fragment):a.fragment).childNodes),d.merge(this,a);if((c=H.getElementById(g[2]))&&c.parentNode){if(c.id!==g[2])return e.find(a);this.length=1;this[0]=c}this.context=H;this.selector=a;return this}if(d.isFunction(a))return e.ready(a);a.selector!==b&&(this.selector=a.selector,
this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return I.call(this,0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?S.apply(e,a):d.merge(e,a);e.prevObject=this;e.context=this.context;"find"===b?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,
b){return d.each(this,a,b)},ready:function(a){d.bindReady();E.add(a);return this},eq:function(a){a=+a;return-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(I.apply(this,arguments),"slice",I.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:S,sort:[].sort,splice:[].splice};
d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a,c,e,g,h,k=arguments[0]||{},l=1,m=arguments.length,n=!1;"boolean"===typeof k&&(n=k,k=arguments[1]||{},l=2);"object"===typeof k||d.isFunction(k)||(k={});m===l&&(k=this,--l);for(;l<m;l++)if(null!=(a=arguments[l]))for(c in a)e=k[c],g=a[c],k!==g&&(n&&g&&(d.isPlainObject(g)||(h=d.isArray(g)))?(h?(h=!1,e=e&&d.isArray(e)?e:[]):e=e&&d.isPlainObject(e)?e:{},k[c]=d.extend(n,e,g)):g!==b&&(k[c]=g));return k};d.extend({noConflict:function(b){a.$===
d&&(a.$=g);b&&a.jQuery===d&&(a.jQuery=e);return d},isReady:!1,readyWait:1,holdReady:function(a){a?d.readyWait++:d.ready(!0)},ready:function(a){if(!0===a&&!--d.readyWait||!0!==a&&!d.isReady){if(!H.body)return setTimeout(d.ready,1);d.isReady=!0;!0!==a&&0<--d.readyWait||(E.fireWith(H,[d]),d.fn.trigger&&d(H).trigger("ready").off("ready"))}},bindReady:function(){if(!E){E=d.Callbacks("once memory");if("complete"===H.readyState)return setTimeout(d.ready,1);if(H.addEventListener)H.addEventListener("DOMContentLoaded",
G,!1),a.addEventListener("load",d.ready,!1);else if(H.attachEvent){H.attachEvent("onreadystatechange",G);a.attachEvent("onload",d.ready);var b=!1;try{b=null==a.frameElement}catch(e){}H.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return"function"===d.type(a)},isArray:Array.isArray||function(a){return"array"===d.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):W[J.call(a)]||
"object"},isPlainObject:function(a){if(!a||"object"!==d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!O.call(a,"constructor")&&!O.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}for(var e in a);return e===b||O.call(a,e)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw Error(a);},parseJSON:function(b){if("string"!==typeof b||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(q.test(b.replace(u,
"@").replace(t,"]").replace(v,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(c){if("string"!==typeof c||!c)return null;var e,g;try{a.DOMParser?(g=new DOMParser,e=g.parseFromString(c,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(c))}catch(h){e=b}e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||d.error("Invalid XML: "+c);return e},noop:function(){},globalEval:function(b){b&&l.test(b)&&(a.execScript||function(b){a.eval.call(a,
b)})(b)},camelCase:function(a){return a.replace(B,"ms-").replace(A,F)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var g,h=0,k=a.length,l=k===b||d.isFunction(a);if(e)if(l)for(g in a){if(!1===c.apply(a[g],e))break}else for(;h<k&&!1!==c.apply(a[h++],e););else if(l)for(g in a){if(!1===c.call(a[g],g,a[g]))break}else for(;h<k&&!1!==c.call(a[h],h,a[h++]););return a},trim:pa?function(a){return null==a?"":pa.call(a)}:function(a){return null==
a?"":a.toString().replace(m,"").replace(n,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var e=d.type(a);null==a.length||"string"===e||"function"===e||"regexp"===e||d.isWindow(a)?S.call(c,a):d.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(N)return N.call(b,a,c);d=b.length;for(c=c?0>c?Math.max(0,d+c):c:0;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if("number"===typeof c.length)for(var g=c.length;e<g;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=
c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var g=0,h=a.length;g<h;g++)e=!!b(a[g],g),c!==e&&d.push(a[g]);return d},map:function(a,c,e){var g,h,k=[],l=0,m=a.length;if(a instanceof d||m!==b&&"number"===typeof m&&(0<m&&a[0]&&a[m-1]||0===m||d.isArray(a)))for(;l<m;l++)g=c(a[l],l,e),null!=g&&(k[k.length]=g);else for(h in a)g=c(a[h],h,e),null!=g&&(k[k.length]=g);return k.concat.apply([],k)},guid:1,proxy:function(a,c){if("string"===typeof c){var e=a[c];c=a;a=e}if(!d.isFunction(a))return b;
var g=I.call(arguments,2),e=function(){return a.apply(c,g.concat(I.call(arguments)))};e.guid=a.guid=a.guid||e.guid||d.guid++;return e},access:function(a,c,e,g,h,k,l){var m,n=null==e,r=0,q=a.length;if(e&&"object"===typeof e){for(r in e)d.access(a,c,r,e[r],1,k,g);h=1}else if(g!==b){m=l===b&&d.isFunction(g);n&&(m?(m=c,c=function(a,b,c){return m.call(d(a),c)}):(c.call(a,g),c=null));if(c)for(;r<q;r++)c(a[r],e,m?g.call(a[r],r,c(a[r],e)):g,l);h=1}return h?a:n?c.call(a):q?c(a[0],e):k},now:function(){return(new Date).getTime()},
uaMatch:function(a){a=a.toLowerCase();a=D.exec(a)||z.exec(a)||w.exec(a)||0>a.indexOf("compatible")&&C.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this);a.superclass=this;a.fn=a.prototype=this();a.fn.constructor=a;a.sub=this.sub;a.fn.init=function(c,e){e&&e instanceof d&&!(e instanceof a)&&(e=a(e));return d.fn.init.call(this,c,e,b)};a.fn.init.prototype=a.fn;var b=a(H);return a},browser:{}});d.each("Boolean Number String Function Array Date RegExp Object".split(" "),
function(a,b){W["[object "+b+"]"]=b.toLowerCase()});da=d.uaMatch(da);da.browser&&(d.browser[da.browser]=!0,d.browser.version=da.version);d.browser.webkit&&(d.browser.safari=!0);l.test("\u00a0")&&(m=/^[\s\xA0]+/,n=/[\s\xA0]+$/);h=d(H);H.addEventListener?G=function(){H.removeEventListener("DOMContentLoaded",G,!1);d.ready()}:H.attachEvent&&(G=function(){"complete"===H.readyState&&(H.detachEvent("onreadystatechange",G),d.ready())});return d}(),S={};t.Callbacks=function(a){a=a?S[a]||c(a):{};var d=[],e=
[],g,h,k,l,m,n,r=function(b){var c,e,g,h;c=0;for(e=b.length;c<e;c++)g=b[c],h=t.type(g),"array"===h?r(g):"function"===h&&(a.unique&&u.has(g)||d.push(g))},q=function(b,c){c=c||[];g=!a.memory||[b,c];k=h=!0;n=l||0;l=0;for(m=d.length;d&&n<m;n++)if(!1===d[n].apply(b,c)&&a.stopOnFalse){g=!0;break}k=!1;d&&(a.once?!0===g?u.disable():d=[]:e&&e.length&&(g=e.shift(),u.fireWith(g[0],g[1])))},u={add:function(){if(d){var a=d.length;r(arguments);k?m=d.length:g&&!0!==g&&(l=a,q(g[0],g[1]))}return this},remove:function(){if(d)for(var b=
arguments,c=0,e=b.length;c<e;c++)for(var g=0;g<d.length&&(b[c]!==d[g]||(k&&g<=m&&(m--,g<=n&&n--),d.splice(g--,1),!a.unique));g++);return this},has:function(a){if(d)for(var b=0,c=d.length;b<c;b++)if(a===d[b])return!0;return!1},empty:function(){d=[];return this},disable:function(){d=e=g=b;return this},disabled:function(){return!d},lock:function(){e=b;g&&!0!==g||u.disable();return this},locked:function(){return!e},fireWith:function(b,c){e&&(k?a.once||e.push([b,c]):a.once&&g||q(b,c));return this},fire:function(){u.fireWith(this,
arguments);return this},fired:function(){return!!h}};return u};var N=[].slice;t.extend({Deferred:function(a){var b=t.Callbacks("once memory"),c=t.Callbacks("once memory"),d=t.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){k.done(a).fail(b).progress(c);return this},always:function(){k.done.apply(k,arguments).fail.apply(k,arguments);return this},pipe:function(a,
b,c){return t.Deferred(function(d){t.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;if(t.isFunction(c))k[a](function(){if((g=c.apply(this,arguments))&&t.isFunction(g.promise))g.promise().then(d.resolve,d.reject,d.notify);else d[e+"With"](this===k?d:this,[g])});else k[a](d[e])})}).promise()},promise:function(a){if(null==a)a=h;else for(var b in h)a[b]=h[b];return a}},k=h.promise({}),l;for(l in g)k[l]=g[l].fire,k[l+"With"]=g[l].fireWith;k.done(function(){e=
"resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock);a&&a.call(k,k);return k},when:function(a){function b(a){return function(b){d[a]=1<arguments.length?N.call(arguments,0):b;--k||l.resolveWith(l,d)}}function c(a){return function(b){h[a]=1<arguments.length?N.call(arguments,0):b;l.notifyWith(m,h)}}var d=N.call(arguments,0),e=0,g=d.length,h=Array(g),k=g,l=1>=g&&a&&t.isFunction(a.promise)?a:t.Deferred(),m=l.promise();if(1<g){for(;e<g;e++)d[e]&&d[e].promise&&t.isFunction(d[e].promise)?
d[e].promise().then(b(e),l.reject,c(e)):--k;k||l.resolveWith(l,d)}else l!==a&&l.resolveWith(l,g?[a]:[]);return m}});t.support=function(){var b,c,d,e,g,h,k,l,m=H.createElement("div");m.setAttribute("className","t");m.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";c=m.getElementsByTagName("*");d=m.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=H.createElement("select");g=e.appendChild(H.createElement("option"));c=
m.getElementsByTagName("input")[0];b={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===c.value,optSelected:g.selected,getSetAttribute:"t"!==m.className,enctype:!!H.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==H.createElement("nav").cloneNode(!0).outerHTML,
submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0};t.boxModel=b.boxModel="CSS1Compat"===H.compatMode;c.checked=!0;b.noCloneChecked=c.cloneNode(!0).checked;e.disabled=!0;b.optDisabled=!g.disabled;try{delete m.test}catch(n){b.deleteExpando=!1}!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",function(){b.noCloneEvent=!1}),m.cloneNode(!0).fireEvent("onclick"));
c=H.createElement("input");c.value="t";c.setAttribute("type","radio");b.radioValue="t"===c.value;c.setAttribute("checked","checked");c.setAttribute("name","t");m.appendChild(c);d=H.createDocumentFragment();d.appendChild(m.lastChild);b.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked;b.appendChecked=c.checked;d.removeChild(c);d.appendChild(m);if(m.attachEvent)for(k in{submit:1,change:1,focusin:1})c="on"+k,l=c in m,l||(m.setAttribute(c,"return;"),l="function"===typeof m[c]),b[k+"Bubbles"]=
l;d.removeChild(m);d=e=g=m=c=null;t(function(){var c,d,e,g,k=H.getElementsByTagName("body")[0];k&&(c=H.createElement("div"),c.style.cssText="padding:0;margin:0;border:0;visibility:hidden;width:0;height:0;position:static;top:0;margin-top:1px",k.insertBefore(c,k.firstChild),m=H.createElement("div"),c.appendChild(m),m.innerHTML="<table><tr><td style='padding:0;margin:0;border:0;display:none'></td><td>t</td></tr></table>",h=m.getElementsByTagName("td"),l=0===h[0].offsetHeight,h[0].style.display="",h[1].style.display=
"none",b.reliableHiddenOffsets=l&&0===h[0].offsetHeight,a.getComputedStyle&&(m.innerHTML="",d=H.createElement("div"),d.style.width="0",d.style.marginRight="0",m.style.width="2px",m.appendChild(d),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(d,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!==typeof m.style.zoom&&(m.innerHTML="",m.style.width=m.style.padding="1px",m.style.border=0,m.style.overflow="hidden",m.style.display="inline",m.style.zoom=1,b.inlineBlockNeedsLayout=3===m.offsetWidth,
m.style.display="block",m.style.overflow="visible",m.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=3!==m.offsetWidth),m.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:0;visibility:hidden;",m.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;display:block;'><div style='padding:0;margin:0;border:0;display:block;overflow:hidden;'></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",
d=m.firstChild,e=d.firstChild,g=d.nextSibling.firstChild.firstChild,g={doesNotAddBorder:5!==e.offsetTop,doesAddBorderForTableAndCells:5===g.offsetTop},e.style.position="fixed",e.style.top="20px",g.fixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",g.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,g.doesNotIncludeMarginInBodyOffset=1!==k.offsetTop,a.getComputedStyle&&(m.style.marginTop="1%",b.pixelMargin="1%"!==
(a.getComputedStyle(m,null)||{marginTop:0}).marginTop),"undefined"!==typeof c.style.zoom&&(c.style.zoom=1),k.removeChild(c),m=null,t.extend(b,g))});return b}();var M=/^(?:\{.*\}|\[.*\])$/,U=/([A-Z])/g;t.extend({cache:{},uuid:0,expando:"jQuery"+(t.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?t.cache[a[t.expando]]:a[t.expando];return!!a&&!e(a)},data:function(a,c,d,e){if(t.acceptData(a)){var g;
g=t.expando;var h="string"===typeof c,k=a.nodeType,l=k?t.cache:a,m=k?a[g]:a[g]&&g,n="events"===c;if(m&&l[m]&&(n||e||l[m].data)||!h||d!==b){m||(k?a[g]=m=++t.uuid:m=g);l[m]||(l[m]={},k||(l[m].toJSON=t.noop));if("object"===typeof c||"function"===typeof c)e?l[m]=t.extend(l[m],c):l[m].data=t.extend(l[m].data,c);g=a=l[m];e||(a.data||(a.data={}),a=a.data);d!==b&&(a[t.camelCase(c)]=d);if(n&&!a[c])return g.events;h?(d=a[c],null==d&&(d=a[t.camelCase(c)])):d=a;return d}}},removeData:function(a,b,c){if(t.acceptData(a)){var d,
g,h,k=t.expando,l=a.nodeType,m=l?t.cache:a,n=l?a[k]:k;if(m[n]){if(b&&(d=c?m[n]:m[n].data)){t.isArray(b)||(b in d?b=[b]:(b=t.camelCase(b),b=b in d?[b]:b.split(" ")));g=0;for(h=b.length;g<h;g++)delete d[b[g]];if(!(c?e:t.isEmptyObject)(d))return}if(!c&&(delete m[n].data,!e(m[n])))return;t.support.deleteExpando||!m.setInterval?delete m[n]:m[n]=null;l&&(t.support.deleteExpando?delete a[k]:a.removeAttribute?a.removeAttribute(k):a[k]=null)}}},_data:function(a,b,c){return t.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=
t.noData[a.nodeName.toLowerCase()];if(b)return!(!0===b||a.getAttribute("classid")!==b)}return!0}});t.fn.extend({data:function(a,c){var e,g,h,k,l,m=this[0],n=0,r=null;if(a===b){if(this.length&&(r=t.data(m),1===m.nodeType&&!t._data(m,"parsedAttrs"))){h=m.attributes;for(l=h.length;n<l;n++)k=h[n].name,0===k.indexOf("data-")&&(k=t.camelCase(k.substring(5)),d(m,k,r[k]));t._data(m,"parsedAttrs",!0)}return r}if("object"===typeof a)return this.each(function(){t.data(this,a)});e=a.split(".",2);e[1]=e[1]?"."+
e[1]:"";g=e[1]+"!";return t.access(this,function(c){if(c===b)return r=this.triggerHandler("getData"+g,[e[0]]),r===b&&m&&(r=t.data(m,a),r=d(m,a,r)),r===b&&e[1]?this.data(e[0]):r;e[1]=c;this.each(function(){var b=t(this);b.triggerHandler("setData"+g,e);t.data(this,a,c);b.triggerHandler("changeData"+g,e)})},null,c,1<arguments.length,null,!1)},removeData:function(a){return this.each(function(){t.removeData(this,a)})}});t.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",t._data(a,b,(t._data(a,b)||0)+
1))},_unmark:function(a,b,c){!0!==a&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark";(a=a?0:(t._data(b,d)||1)-1)?t._data(b,d,a):(t.removeData(b,d,!0),g(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=t._data(a,b),c&&(!d||t.isArray(c)?d=t._data(a,b,t.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=t.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift());d&&("fx"===b&&c.unshift("inprogress"),t._data(a,b+".run",e),d.call(a,function(){t.dequeue(a,
b)},e));c.length||(t.removeData(a,b+"queue "+b+".run",!0),g(a,b,"queue"))}});t.fn.extend({queue:function(a,c){var d=2;"string"!==typeof a&&(c=a,a="fx",d--);return arguments.length<d?t.queue(this[0],a):c===b?this:this.each(function(){var b=t.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&t.dequeue(this,a)})},dequeue:function(a){return this.each(function(){t.dequeue(this,a)})},delay:function(a,b){a=t.fx?t.fx.speeds[a]||a:a;return this.queue(b||"fx",function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},
clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function d(){--k||e.resolveWith(g,[g])}"string"!==typeof a&&(c=a,a=b);a=a||"fx";for(var e=t.Deferred(),g=this,h=g.length,k=1,l=a+"defer",m=a+"queue",n=a+"mark",r;h--;)if(r=t.data(g[h],l,b,!0)||(t.data(g[h],m,b,!0)||t.data(g[h],n,b,!0))&&t.data(g[h],l,t.Callbacks("once memory"),!0))k++,r.add(d);d();return e.promise(c)}});var Q=/[\n\t\r]/g,V=/\s+/,W=/\r/g,X=/^(?:button|input)$/i,Z=/^(?:button|input|object|select|textarea)$/i,
Y=/^a(?:rea)?$/i,ea=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,aa=t.support.getSetAttribute,K,T,qa;t.fn.extend({attr:function(a,b){return t.access(this,t.attr,a,b,1<arguments.length)},removeAttr:function(a){return this.each(function(){t.removeAttr(this,a)})},prop:function(a,b){return t.access(this,t.prop,a,b,1<arguments.length)},removeProp:function(a){a=t.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},
addClass:function(a){var b,c,d,e,g,h,k;if(t.isFunction(a))return this.each(function(b){t(this).addClass(a.call(this,b,this.className))});if(a&&"string"===typeof a)for(b=a.split(V),c=0,d=this.length;c<d;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){g=" "+e.className+" ";h=0;for(k=b.length;h<k;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=t.trim(g)}else e.className=a;return this},removeClass:function(a){var c,d,e,g,h,k,l;if(t.isFunction(a))return this.each(function(b){t(this).removeClass(a.call(this,
b,this.className))});if(a&&"string"===typeof a||a===b)for(c=(a||"").split(V),d=0,e=this.length;d<e;d++)if(g=this[d],1===g.nodeType&&g.className)if(a){h=(" "+g.className+" ").replace(Q," ");k=0;for(l=c.length;k<l;k++)h=h.replace(" "+c[k]+" "," ");g.className=t.trim(h)}else g.className="";return this},toggleClass:function(a,b){var c=typeof a,d="boolean"===typeof b;return t.isFunction(a)?this.each(function(c){t(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===
c)for(var e,g=0,h=t(this),k=b,l=a.split(V);e=l[g++];)k=d?k:!h.hasClass(e),h[k?"addClass":"removeClass"](e);else if("undefined"===c||"boolean"===c)this.className&&t._data(this,"__className__",this.className),this.className=this.className||!1===a?"":t._data(this,"__className__")||""})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;b<c;b++)if(1===this[b].nodeType&&-1<(" "+this[b].className+" ").replace(Q," ").indexOf(a))return!0;return!1},val:function(a){var c,d,e,g=this[0];if(arguments.length)return e=
t.isFunction(a),this.each(function(d){var g=t(this);1===this.nodeType&&(d=e?a.call(this,d,g.val()):a,null==d?d="":"number"===typeof d?d+="":t.isArray(d)&&(d=t.map(d,function(a){return null==a?"":a+""})),c=t.valHooks[this.type]||t.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,d,"value")!==b||(this.value=d))});if(g){if((c=t.valHooks[g.type]||t.valHooks[g.nodeName.toLowerCase()])&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return"string"===typeof d?d.replace(W,""):null==
d?"":d}}});t.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d=a.selectedIndex,e=[],g=a.options,h="select-one"===a.type;if(0>d)return null;a=h?d:0;for(c=h?d+1:g.length;a<c;a++)if(b=g[a],!(!b.selected||(t.support.optDisabled?b.disabled:null!==b.getAttribute("disabled"))||b.parentNode.disabled&&t.nodeName(b.parentNode,"optgroup"))){b=t(b).val();if(h)return b;e.push(b)}return h&&!e.length&&g.length?t(g[d]).val():
e},set:function(a,b){var c=t.makeArray(b);t(a).find("option").each(function(){this.selected=0<=t.inArray(t(this).val(),c)});c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,k=a.nodeType;if(a&&3!==k&&8!==k&&2!==k){if(e&&c in t.attrFn)return t(a)[c](d);if("undefined"===typeof a.getAttribute)return t.prop(a,c,d);if(e=1!==k||!t.isXMLDoc(a))c=c.toLowerCase(),h=t.attrHooks[c]||(ea.test(c)?T:K);if(d!==b)if(null===
d)t.removeAttr(a,c);else{if(h&&"set"in h&&e&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}else{if(h&&"get"in h&&e&&null!==(g=h.get(a,c)))return g;g=a.getAttribute(c);return null===g?b:g}}},removeAttr:function(a,b){var c,d,e,g,h,k=0;if(b&&1===a.nodeType)for(d=b.toLowerCase().split(V),g=d.length;k<g;k++)if(e=d[k])c=t.propFix[e]||e,(h=ea.test(e))||t.attr(a,e,""),a.removeAttribute(aa?e:c),h&&c in a&&(a[c]=!1)},attrHooks:{type:{set:function(a,b){if(X.test(a.nodeName)&&a.parentNode)t.error("type property can't be changed");
else if(!t.support.radioValue&&"radio"===b&&t.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b);c&&(a.value=c);return b}}},value:{get:function(a,b){return K&&t.nodeName(a,"button")?K.get(a,b):b in a?a.value:null},set:function(a,b,c){if(K&&t.nodeName(a,"button"))return K.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",
frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h;h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h){if(h=1!==h||!t.isXMLDoc(a))c=t.propFix[c]||c,g=t.propHooks[c];return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&null!==(e=g.get(a,c))?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):Z.test(a.nodeName)||Y.test(a.nodeName)&&a.href?0:b}}}});t.attrHooks.tabindex=t.propHooks.tabIndex;
T={get:function(a,c){var d,e=t.prop(a,c);return!0===e||"boolean"!==typeof e&&(d=a.getAttributeNode(c))&&!1!==d.nodeValue?c.toLowerCase():b},set:function(a,b,c){!1===b?t.removeAttr(a,c):(b=t.propFix[c]||c,b in a&&(a[b]=!0),a.setAttribute(c,c.toLowerCase()));return c}};aa||(qa={name:!0,id:!0,coords:!0},K=t.valHooks.button={get:function(a,c){var d;return(d=a.getAttributeNode(c))&&(qa[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);d||(d=H.createAttribute(c),
a.setAttributeNode(d));return d.nodeValue=b+""}},t.attrHooks.tabindex.set=K.set,t.each(["width","height"],function(a,b){t.attrHooks[b]=t.extend(t.attrHooks[b],{set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}})}),t.attrHooks.contenteditable={get:K.get,set:function(a,b,c){""===b&&(b="false");K.set(a,b,c)}});t.support.hrefNormalized||t.each(["href","src","width","height"],function(a,c){t.attrHooks[c]=t.extend(t.attrHooks[c],{get:function(a){a=a.getAttribute(c,2);return null===a?b:a}})});
t.support.style||(t.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}});t.support.optSelected||(t.propHooks.selected=t.extend(t.propHooks.selected,{get:function(a){if(a=a.parentNode)a.selectedIndex,a.parentNode&&a.parentNode.selectedIndex;return null}}));t.support.enctype||(t.propFix.enctype="encoding");t.support.checkOn||t.each(["radio","checkbox"],function(){t.valHooks[this]={get:function(a){return null===a.getAttribute("value")?
"on":a.value}}});t.each(["radio","checkbox"],function(){t.valHooks[this]=t.extend(t.valHooks[this],{set:function(a,b){if(t.isArray(b))return a.checked=0<=t.inArray(t(a).val(),b)}})});var ia=/^(?:textarea|input|select)$/i,fa=/^([^\.]*)?(?:\.(.+))?$/,la=/(?:^|\s)hover(\.\S+)?\b/,ja=/^key/,ca=/^(?:mouse|contextmenu)|click/,ma=/^(?:focusinfocus|focusoutblur)$/,sa=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,ta=function(a){if(a=sa.exec(a))a[1]=(a[1]||"").toLowerCase(),a[3]=a[3]&&new RegExp("(?:^|\\s)"+a[3]+
"(?:\\s|$)");return a},na=function(a){return t.event.special.hover?a:a.replace(la,"mouseenter$1 mouseleave$1")};t.event={add:function(a,c,d,e,g){var h,k,l,m,n,r,q,u,v;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(h=t._data(a))){d.handler&&(q=d,d=q.handler,g=q.selector);d.guid||(d.guid=t.guid++);l=h.events;l||(h.events=l={});k=h.handle;k||(h.handle=k=function(a){return"undefined"===typeof t||a&&t.event.triggered===a.type?b:t.event.dispatch.apply(k.elem,arguments)},k.elem=a);c=t.trim(na(c)).split(" ");
for(h=0;h<c.length;h++)m=fa.exec(c[h])||[],n=m[1],r=(m[2]||"").split(".").sort(),v=t.event.special[n]||{},n=(g?v.delegateType:v.bindType)||n,v=t.event.special[n]||{},m=t.extend({type:n,origType:m[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&ta(g),namespace:r.join(".")},q),u=l[n],u||(u=l[n]=[],u.delegateCount=0,v.setup&&!1!==v.setup.call(a,e,r,k)||(a.addEventListener?a.addEventListener(n,k,!1):a.attachEvent&&a.attachEvent("on"+n,k))),v.add&&(v.add.call(a,m),m.handler.guid||(m.handler.guid=d.guid)),
g?u.splice(u.delegateCount++,0,m):u.push(m),t.event.global[n]=!0;a=null}},global:{},remove:function(a,b,c,d,e){var g=t.hasData(a)&&t._data(a),h,k,l,m,n,r,q,u,v,D;if(g&&(q=g.events)){b=t.trim(na(b||"")).split(" ");for(h=0;h<b.length;h++)if(k=fa.exec(b[h])||[],l=m=k[1],k=k[2],l){u=t.event.special[l]||{};l=(d?u.delegateType:u.bindType)||l;v=q[l]||[];n=v.length;k=k?new RegExp("(^|\\.)"+k.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(r=0;r<v.length;r++)D=v[r],!e&&m!==D.origType||c&&c.guid!==
D.guid||k&&!k.test(D.namespace)||d&&d!==D.selector&&("**"!==d||!D.selector)||(v.splice(r--,1),D.selector&&v.delegateCount--,u.remove&&u.remove.call(a,D));0===v.length&&n!==v.length&&(u.teardown&&!1!==u.teardown.call(a,k)||t.removeEvent(a,l,g.handle),delete q[l])}else for(l in q)t.event.remove(a,l+b[h],c,d,!0);if(t.isEmptyObject(q)){if(b=g.handle)b.elem=null;t.removeData(a,["events","handle"],!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||3!==e.nodeType&&
8!==e.nodeType){var h=c.type||c,k=[],l,m,n,r,q;if(!ma.test(h+t.event.triggered)&&(0<=h.indexOf("!")&&(h=h.slice(0,-1),l=!0),0<=h.indexOf(".")&&(k=h.split("."),h=k.shift(),k.sort()),e&&!t.event.customEvent[h]||t.event.global[h]))if(c="object"===typeof c?c[t.expando]?c:new t.Event(h,c):new t.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=l,c.namespace=k.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+k.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,l=0>h.indexOf(":")?"on"+h:"",e){if(c.result=b,c.target||
(c.target=e),d=null!=d?t.makeArray(d):[],d.unshift(c),n=t.event.special[h]||{},!n.trigger||!1!==n.trigger.apply(e,d)){q=[[e,n.bindType||h]];if(!g&&!n.noBubble&&!t.isWindow(e)){r=n.delegateType||h;k=ma.test(r+h)?e:e.parentNode;for(m=null;k;k=k.parentNode)q.push([k,r]),m=k;m&&m===e.ownerDocument&&q.push([m.defaultView||m.parentWindow||a,r])}for(m=0;m<q.length&&!c.isPropagationStopped();m++)k=q[m][0],c.type=q[m][1],(r=(t._data(k,"events")||{})[c.type]&&t._data(k,"handle"))&&r.apply(k,d),(r=l&&k[l])&&
t.acceptData(k)&&!1===r.apply(k,d)&&c.preventDefault();c.type=h;g||c.isDefaultPrevented()||n._default&&!1!==n._default.apply(e.ownerDocument,d)||"click"===h&&t.nodeName(e,"a")||!t.acceptData(e)||!l||!e[h]||("focus"===h||"blur"===h)&&0===c.target.offsetWidth||t.isWindow(e)||((m=e[l])&&(e[l]=null),t.event.triggered=h,e[h](),t.event.triggered=b,m&&(e[l]=m));return c.result}}else for(m in e=t.cache,e)e[m].events&&e[m].events[h]&&t.event.trigger(c,d,e[m].handle.elem,!0)}},dispatch:function(c){c=t.event.fix(c||
a.event);var d=(t._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,k=t.event.special[c.type]||{},l=[],m,n,r,q,u,v,D;g[0]=c;c.delegateTarget=this;if(!k.preDispatch||!1!==k.preDispatch.call(this,c)){if(e&&(!c.button||"click"!==c.type))for(r=t(this),r.context=this.ownerDocument||this,n=c.target;n!=this;n=n.parentNode||this)if(!0!==n.disabled){u={};v=[];r[0]=n;for(m=0;m<e;m++){q=d[m];D=q.selector;if(u[D]===b){var z=u,w=D,C;if(q.quick){C=
q.quick;var R=n.attributes||{};C=(!C[1]||n.nodeName.toLowerCase()===C[1])&&(!C[2]||(R.id||{}).value===C[2])&&(!C[3]||C[3].test((R["class"]||{}).value))}else C=r.is(D);z[w]=C}u[D]&&v.push(q)}v.length&&l.push({elem:n,matches:v})}d.length>e&&l.push({elem:this,matches:d.slice(e)});for(m=0;m<l.length&&!c.isPropagationStopped();m++)for(e=l[m],c.currentTarget=e.elem,d=0;d<e.matches.length&&!c.isImmediatePropagationStopped();d++)if(q=e.matches[d],h||!c.namespace&&!q.namespace||c.namespace_re&&c.namespace_re.test(q.namespace))c.data=
q.data,c.handleObj=q,q=((t.event.special[q.origType]||{}).handle||q.handler).apply(e.elem,g),q!==b&&(c.result=q,!1===q&&(c.preventDefault(),c.stopPropagation()));k.postDispatch&&k.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(a,b){null==a.which&&
(a.which=null!=b.charCode?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,g=c.button,h=c.fromElement;null==a.pageX&&null!=c.clientX&&(d=a.target.ownerDocument||H,e=d.documentElement,d=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||d&&d.scrollLeft||0)-(e&&e.clientLeft||d&&d.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||d&&d.scrollTop||0)-(e&&e.clientTop||d&&
d.clientTop||0));!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?c.toElement:h);a.which||g===b||(a.which=g&1?1:g&2?3:g&4?2:0);return a}},fix:function(a){if(a[t.expando])return a;var c,d,e=a,g=t.event.fixHooks[a.type]||{},h=g.props?this.props.concat(g.props):this.props;a=t.Event(e);for(c=h.length;c;)d=h[--c],a[d]=e[d];a.target||(a.target=e.srcElement||H);3===a.target.nodeType&&(a.target=a.target.parentNode);a.metaKey===b&&(a.metaKey=a.ctrlKey);return g.filter?g.filter(a,e):a},special:{ready:{setup:t.bindReady},
load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){t.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){a=t.extend(new t.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?t.event.trigger(a,null,b):t.event.dispatch.call(b,a);a.isDefaultPrevented()&&c.preventDefault()}};t.event.handle=t.event.dispatch;t.removeEvent=H.removeEventListener?function(a,
b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};t.Event=function(a,b){if(!(this instanceof t.Event))return new t.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||!1===a.returnValue||a.getPreventDefault&&a.getPreventDefault()?k:h):this.type=a;b&&t.extend(this,b);this.timeStamp=a&&a.timeStamp||t.now();this[t.expando]=!0};t.Event.prototype={preventDefault:function(){this.isDefaultPrevented=
k;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=k;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},isDefaultPrevented:h,isPropagationStopped:h,isImmediatePropagationStopped:h};t.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){t.event.special[a]={delegateType:b,
bindType:b,handle:function(a){var c=a.relatedTarget,d=a.handleObj,e;if(!c||c!==this&&!t.contains(this,c))a.type=d.origType,e=d.handler.apply(this,arguments),a.type=b;return e}}});t.support.submitBubbles||(t.event.special.submit={setup:function(){if(t.nodeName(this,"form"))return!1;t.event.add(this,"click._submit keypress._submit",function(a){a=a.target;(a=t.nodeName(a,"input")||t.nodeName(a,"button")?a.form:b)&&!a._submit_attached&&(t.event.add(a,"submit._submit",function(a){a._submit_bubble=!0}),
a._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&t.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(t.nodeName(this,"form"))return!1;t.event.remove(this,"._submit")}});t.support.changeBubbles||(t.event.special.change={setup:function(){if(ia.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)t.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&
(this._just_changed=!0)}),t.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,t.event.simulate("change",this,a,!0))});return!1}t.event.add(this,"beforeactivate._change",function(a){a=a.target;ia.test(a.nodeName)&&!a._change_attached&&(t.event.add(a,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||t.event.simulate("change",this.parentNode,a,!0)}),a._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||
a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type)return a.handleObj.handler.apply(this,arguments)},teardown:function(){t.event.remove(this,"._change");return ia.test(this.nodeName)}});t.support.focusinBubbles||t.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){t.event.simulate(b,a.target,t.event.fix(a),!0)};t.event.special[b]={setup:function(){0===c++&&H.addEventListener(a,d,!0)},teardown:function(){0===--c&&H.removeEventListener(a,d,!0)}}});t.fn.extend({on:function(a,
c,d,e,g){var k,l;if("object"===typeof a){"string"!==typeof c&&(d=d||c,c=b);for(l in a)this.on(l,c,d,a[l],g);return this}null==d&&null==e?(e=c,d=c=b):null==e&&("string"===typeof c?(e=d,d=b):(e=d,d=c,c=b));if(!1===e)e=h;else if(!e)return this;1===g&&(k=e,e=function(a){t().off(a);return k.apply(this,arguments)},e.guid=k.guid||(k.guid=t.guid++));return this.each(function(){t.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=
a.handleObj;t(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if("object"===typeof a){for(e in a)this.off(e,c,a[e]);return this}if(!1===c||"function"===typeof c)d=c,c=b;!1===d&&(d=h);return this.each(function(){t.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){t(this.context).on(a,this.selector,b,c);return this},die:function(a,b){t(this.context).off(a,
this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1==arguments.length?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){t.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return t.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||t.guid++,d=0,e=function(c){var e=(t._data(this,"lastToggle"+a.guid)||0)%d;t._data(this,"lastToggle"+a.guid,e+1);c.preventDefault();
return b[e].apply(this,arguments)||!1};for(e.guid=c;d<b.length;)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});t.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){t.fn[b]=function(a,c){null==c&&(c=a,a=null);return 0<arguments.length?this.on(b,null,a,c):this.trigger(b)};
t.attrFn&&(t.attrFn[b]=!0);ja.test(b)&&(t.event.fixHooks[b]=t.event.keyHooks);ca.test(b)&&(t.event.fixHooks[b]=t.event.mouseHooks)});(function(){function a(b,c,d,g,h,k){h=0;for(var l=g.length;h<l;h++){var m=g[h];if(m){for(var n=!1,m=m[b];m;){if(m[e]===d){n=g[m.sizset];break}1!==m.nodeType||k||(m[e]=d,m.sizset=h);if(m.nodeName.toLowerCase()===c){n=m;break}m=m[b]}g[h]=n}}}function c(a,b,d,g,h,k){h=0;for(var l=g.length;h<l;h++){var m=g[h];if(m){for(var n=!1,m=m[a];m;){if(m[e]===d){n=g[m.sizset];break}if(1===
m.nodeType)if(k||(m[e]=d,m.sizset=h),"string"!==typeof b){if(m===b){n=!0;break}}else if(0<q.filter(b,[m]).length){n=m;break}m=m[a]}g[h]=n}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),g=0,h=Object.prototype.toString,k=!1,l=!0,m=/\\/g,n=/\r\n/g,r=/\W/;[0,0].sort(function(){l=!1;return 0});var q=function(a,b,c,e){c=c||[];var g=b=b||H;if(1!==b.nodeType&&9!==
b.nodeType)return[];if(!a||"string"!==typeof a)return c;var k,l,m,n,r,u=!0,t=q.isXML(b),z=[],w=a;do if(d.exec(""),k=d.exec(w))if(w=k[3],z.push(k[1]),k[2]){n=k[3];break}while(k);if(1<z.length&&D.exec(a))if(2===z.length&&v.relative[z[0]])l=F(z[0]+z[1],b,e);else for(l=v.relative[z[0]]?[b]:q(z.shift(),b);z.length;)a=z.shift(),v.relative[a]&&(a+=z.shift()),l=F(a,l,e);else if(!e&&1<z.length&&9===b.nodeType&&!t&&v.match.ID.test(z[0])&&!v.match.ID.test(z[z.length-1])&&(k=q.find(z.shift(),b,t),b=k.expr?q.filter(k.expr,
k.set)[0]:k.set[0]),b)for(k=e?{expr:z.pop(),set:C(e)}:q.find(z.pop(),1!==z.length||"~"!==z[0]&&"+"!==z[0]||!b.parentNode?b:b.parentNode,t),l=k.expr?q.filter(k.expr,k.set):k.set,0<z.length?m=C(l):u=!1;z.length;)k=r=z.pop(),v.relative[r]?k=z.pop():r="",null==k&&(k=b),v.relative[r](m,k,t);else m=[];m||(m=l);m||q.error(r||a);if("[object Array]"===h.call(m))if(u)if(b&&1===b.nodeType)for(a=0;null!=m[a];a++)m[a]&&(!0===m[a]||1===m[a].nodeType&&q.contains(b,m[a]))&&c.push(l[a]);else for(a=0;null!=m[a];a++)m[a]&&
1===m[a].nodeType&&c.push(l[a]);else c.push.apply(c,m);else C(m,c);n&&(q(n,g,c,e),q.uniqueSort(c));return c};q.uniqueSort=function(a){if(A&&(k=l,a.sort(A),k))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};q.matches=function(a,b){return q(a,null,null,b)};q.matchesSelector=function(a,b){return 0<q(b,null,null,[a]).length};q.find=function(a,b,c){var d,e,g,h,k,l;if(!a)return[];e=0;for(g=v.order.length;e<g;e++)if(k=v.order[e],h=v.leftMatch[k].exec(a))if(l=h[1],h.splice(1,1),"\\"!==
l.substr(l.length-1)&&(h[1]=(h[1]||"").replace(m,""),d=v.find[k](h,b,c),null!=d)){a=a.replace(v.match[k],"");break}d||(d="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};q.filter=function(a,c,d,e){for(var g,h,k,l,m,n,r,u,t=a,D=[],z=c,w=c&&c[0]&&q.isXML(c[0]);a&&c.length;){for(k in v.filter)if(null!=(g=v.leftMatch[k].exec(a))&&g[2]&&(n=v.filter[k],m=g[1],h=!1,g.splice(1,1),"\\"!==m.substr(m.length-1))){z===D&&(D=[]);if(v.preFilter[k])if(g=v.preFilter[k](g,
z,d,D,e,w),!g)h=l=!0;else if(!0===g)continue;if(g)for(r=0;null!=(m=z[r]);r++)m&&(l=n(m,g,r,z),u=e^l,d&&null!=l?u?h=!0:z[r]=!1:u&&(D.push(m),h=!0));if(l!==b){d||(z=D);a=a.replace(v.match[k],"");if(!h)return[];break}}if(a===t)if(null==h)q.error(a);else break;t=a}return z};q.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var u=q.getText=function(a){var b,c;b=a.nodeType;var d="";if(b)if(1===b||9===b||11===b){if("string"===typeof a.textContent)return a.textContent;if("string"===
typeof a.innerText)return a.innerText.replace(n,"");for(a=a.firstChild;a;a=a.nextSibling)d+=u(a)}else{if(3===b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=u(c));return d},v=q.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"===typeof b,d=c&&!r.test(b),
c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,g;d<e;d++)if(g=a[d]){for(;(g=g.previousSibling)&&1!==g.nodeType;);a[d]=c||g&&g.nodeName.toLowerCase()===b?g||!1:g===b}c&&q.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,e=0,g=a.length;if(d&&!r.test(b))for(b=b.toLowerCase();e<g;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<g;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&q.filter(b,a,!0)}},"":function(b,d,e){var h,k=g++,l=c;"string"!==
typeof d||r.test(d)||(h=d=d.toLowerCase(),l=a);l("parentNode",d,k,b,h,e)},"~":function(b,d,e){var h,k=g++,l=c;"string"!==typeof d||r.test(d)||(h=d=d.toLowerCase(),l=a);l("previousSibling",d,k,b,h,e)}},find:{ID:function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,g=d.length;e<g;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);
return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,g){a=" "+a[1].replace(m,"")+" ";if(g)return a;g=0;for(var h;null!=(h=b[g]);g++)h&&(e^(h.className&&0<=(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(m,"")},TAG:function(a,b){return a[1].replace(m,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||
q.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&q.error(a[0]);a[0]=g++;return a},ATTR:function(a,b,c,d,e,g){b=a[1]=a[1].replace(m,"");!g&&v.attrMap[b]&&(a[1]=v.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(m,"");"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,g){if("not"===a[1])if(1<(d.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=
q(a[3],null,null,b);else return a=q.filter(a[3],b,c,1^g),c||e.push.apply(e,a),!1;else if(v.match.POS.test(a[0])||v.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},
has:function(a,b,c){return!!q(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&
"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===
a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],g=v.filters[e];if(g)return g(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||u([a])||"").indexOf(b[3]);
if("not"===e){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}q.error(e)},CHILD:function(a,b){var c,d,g,h,k,l;c=b[1];l=a;switch(c){case "only":case "first":for(;l=l.previousSibling;)if(1===l.nodeType)return!1;if("first"===c)return!0;l=a;case "last":for(;l=l.nextSibling;)if(1===l.nodeType)return!1;return!0;case "nth":c=b[2];d=b[3];if(1===c&&0===d)return!0;g=b[0];if((h=a.parentNode)&&(h[e]!==g||!a.nodeIndex)){k=0;for(l=h.firstChild;l;l=l.nextSibling)1===l.nodeType&&(l.nodeIndex=++k);
h[e]=g}l=a.nodeIndex-d;return 0===c?0===l:0===l%c&&0<=l/c}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1],c=q.attr?q.attr(a,c):v.attrHandle[c]?v.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],g=b[4];return null==c?"!="===e:!e&&q.attr?null!=c:"="===e?
d===g:"*="===e?0<=d.indexOf(g):"~="===e?0<=(" "+d+" ").indexOf(g):g?"!="===e?d!==g:"^="===e?0===d.indexOf(g):"$="===e?d.substr(d.length-g.length)===g:"|="===e?d===g||d.substr(0,g.length+1)===g+"-":!1:d&&!1!==c},POS:function(a,b,c,d){var e=v.setFilters[b[2]];if(e)return e(a,c,b,d)}}},D=v.match.POS,z=function(a,b){return"\\"+(b-0+1)},w;for(w in v.match)v.match[w]=new RegExp(v.match[w].source+/(?![^\[]*\])(?![^\(]*\))/.source),v.leftMatch[w]=new RegExp(/(^(?:.|\r|\n)*?)/.source+v.match[w].source.replace(/\\(\d+)/g,
z));v.match.globalPOS=D;var C=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(H.documentElement.childNodes,0)[0].nodeType}catch(R){C=function(a,b){var c=0,d=b||[];if("[object Array]"===h.call(a))Array.prototype.push.apply(d,a);else if("number"===typeof a.length)for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var A,B;H.documentElement.compareDocumentPosition?A=function(a,b){return a===b?(k=!0,0):a.compareDocumentPosition&&
b.compareDocumentPosition?a.compareDocumentPosition(b)&4?-1:1:a.compareDocumentPosition?-1:1}:(A=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[];c=a.parentNode;d=b.parentNode;var h=c;if(c===d)return B(a,b);if(!c)return-1;if(!d)return 1;for(;h;)e.unshift(h),h=h.parentNode;for(h=d;h;)g.unshift(h),h=h.parentNode;c=e.length;d=g.length;for(h=0;h<c&&h<d;h++)if(e[h]!==g[h])return B(e[h],g[h]);return h===c?B(a,g[h],-1):B(e[h],b,1)},
B=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});(function(){var a=H.createElement("div"),c="script"+(new Date).getTime(),d=H.documentElement;a.innerHTML="<a name='"+c+"'/>";d.insertBefore(a,d.firstChild);H.getElementById(c)&&(v.find.ID=function(a,c,d){if("undefined"!==typeof c.getElementById&&!d)return(c=c.getElementById(a[1]))?c.id===a[1]||"undefined"!==typeof c.getAttributeNode&&c.getAttributeNode("id").nodeValue===a[1]?[c]:b:[]},v.filter.ID=
function(a,b){var c="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b});d.removeChild(a);d=a=null})();(function(){var a=H.createElement("div");a.appendChild(H.createComment(""));0<a.getElementsByTagName("*").length&&(v.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c});a.innerHTML="<a href='#'></a>";a.firstChild&&"undefined"!==typeof a.firstChild.getAttribute&&
"#"!==a.firstChild.getAttribute("href")&&(v.attrHandle.href=function(a){return a.getAttribute("href",2)});a=null})();H.querySelectorAll&&function(){var a=q,b=H.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){q=function(b,c,d,e){c=c||H;if(!e&&!q.isXML(c)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(1===c.nodeType||9===c.nodeType)){if(g[1])return C(c.getElementsByTagName(b),d);if(g[2]&&v.find.CLASS&&c.getElementsByClassName)return C(c.getElementsByClassName(g[2]),
d)}if(9===c.nodeType){if("body"===b&&c.body)return C([c.body],d);if(g&&g[3]){var h=c.getElementById(g[3]);if(h&&h.parentNode){if(h.id===g[3])return C([h],d)}else return C([],d)}try{return C(c.querySelectorAll(b),d)}catch(k){}}else if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){var g=c,l=(h=c.getAttribute("id"))||"__sizzle__",m=c.parentNode,n=/^\s*[+~]/.test(b);h?l=l.replace(/'/g,"\\$&"):c.setAttribute("id",l);n&&m&&(c=c.parentNode);try{if(!n||m)return C(c.querySelectorAll("[id='"+l+"'] "+
b),d)}catch(r){}finally{h||g.removeAttribute("id")}}}return a(b,c,d,e)};for(var c in a)q[c]=a[c];b=null}}();(function(){var a=H.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(H.createElement("div"),"div"),d=!1;try{b.call(H.documentElement,"[test!='']:sizzle")}catch(e){d=!0}q.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!q.isXML(a))try{if(d||!v.match.PSEUDO.test(e)&&!/!=/.test(e)){var g=b.call(a,
e);if(g||!c||a.document&&11!==a.document.nodeType)return g}}catch(h){}return 0<q(e,null,null,[a]).length}}})();(function(){var a=H.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length&&(v.order.splice(1,0,"CLASS"),v.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},
a=null))})();q.contains=H.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:H.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};q.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var F=function(a,b,c){var d,e=[],g="";for(b=b.nodeType?[b]:b;d=v.match.PSEUDO.exec(a);)g+=d[0],a=a.replace(v.match.PSEUDO,"");a=v.relative[a]?a+"*":a;d=0;for(var h=b.length;d<h;d++)q(a,
b[d],e,c);return q.filter(g,e)};q.attr=t.attr;q.selectors.attrMap={};t.find=q;t.expr=q.selectors;t.expr[":"]=t.expr.filters;t.unique=q.uniqueSort;t.text=q.getText;t.isXMLDoc=q.isXML;t.contains=q.contains})();var Za=/Until$/,Pa=/^(?:parents|prevUntil|prevAll)/,$a=/,/,Wa=/^.[^:#\[\.,]*$/,ab=Array.prototype.slice,Aa=t.expr.match.globalPOS,xa={children:!0,contents:!0,next:!0,prev:!0};t.fn.extend({find:function(a){var b=this,c,d;if("string"!==typeof a)return t(a).filter(function(){c=0;for(d=b.length;c<
d;c++)if(t.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,k;c=0;for(d=this.length;c<d;c++)if(g=e.length,t.find(a,this[c],e),0<c)for(h=g;h<e.length;h++)for(k=0;k<g;k++)if(e[k]===e[h]){e.splice(h--,1);break}return e},has:function(a){var b=t(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(t.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(m(this,a,!1),"not",a)},filter:function(a){return this.pushStack(m(this,a,!0),"filter",a)},is:function(a){return!!a&&
("string"===typeof a?Aa.test(a)?0<=t(a,this.context).index(this[0]):0<t.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){var c=[],d,e,g=this[0];if(t.isArray(a)){for(e=1;g&&g.ownerDocument&&g!==b;){for(d=0;d<a.length;d++)t(g).is(a[d])&&c.push({selector:a[d],elem:g,level:e});g=g.parentNode;e++}return c}var h=Aa.test(a)||"string"!==typeof a?t(a,b||this.context):0;d=0;for(e=this.length;d<e;d++)for(g=this[d];g;)if(h?-1<h.index(g):t.find.matchesSelector(g,a)){c.push(g);break}else if(g=
g.parentNode,!g||!g.ownerDocument||g===b||11===g.nodeType)break;c=1<c.length?t.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return a?"string"===typeof a?t.inArray(this[0],t(a)):t.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"===typeof a?t(a,b):t.makeArray(a&&a.nodeType?[a]:a),d=t.merge(this.get(),c);return this.pushStack(l(c[0])||l(d[0])?d:t.unique(d))},andSelf:function(){return this.add(this.prevObject)}});
t.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return t.dir(a,"parentNode")},parentsUntil:function(a,b,c){return t.dir(a,"parentNode",c)},next:function(a){return t.nth(a,2,"nextSibling")},prev:function(a){return t.nth(a,2,"previousSibling")},nextAll:function(a){return t.dir(a,"nextSibling")},prevAll:function(a){return t.dir(a,"previousSibling")},nextUntil:function(a,b,c){return t.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return t.dir(a,"previousSibling",
c)},siblings:function(a){return t.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return t.sibling(a.firstChild)},contents:function(a){return t.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:t.makeArray(a.childNodes)}},function(a,b){t.fn[a]=function(c,d){var e=t.map(this,b,c);Za.test(a)||(d=c);d&&"string"===typeof d&&(e=t.filter(d,e));e=1<this.length&&!xa[a]?t.unique(e):e;(1<this.length||$a.test(d))&&Pa.test(a)&&(e=e.reverse());return this.pushStack(e,a,ab.call(arguments).join(","))}});
t.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return 1===b.length?t.find.matchesSelector(b[0],a)?[b[0]]:[]:t.find.matches(a,b)},dir:function(a,c,d){var e=[];for(a=a[c];a&&9!==a.nodeType&&(d===b||1!==a.nodeType||!t(a).is(d));)1===a.nodeType&&e.push(a),a=a[c];return e},nth:function(a,b,c,d){b=b||1;for(d=0;a&&(1!==a.nodeType||++d!==b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var za="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
bb=/ jQuery\d+="(?:\d+|null)"/g,Ba=/^\s+/,Qa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ra=/<([\w:]+)/,cb=/<tbody/i,Ca=/<|&#?\w+;/,db=/<(?:script|style)/i,eb=/<(?:script|object|embed|option|style)/i,Sa=new RegExp("<(?:"+za+")[\\s/>]","i"),Da=/checked\s*(?:[^=]|=\s*.checked.)/i,Ea=/\/(java|ecma)script/i,fb=/^\s*<!(?:\[CDATA\[|\-\-)/,ba={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>",
"</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Fa=n(H);ba.optgroup=ba.option;ba.tbody=ba.tfoot=ba.colgroup=ba.caption=ba.thead;ba.th=ba.td;t.support.htmlSerialize||(ba._default=[1,"div<div>","</div>"]);t.fn.extend({text:function(a){return t.access(this,function(a){return a===b?t.text(this):this.empty().append((this[0]&&this[0].ownerDocument||H).createTextNode(a))},
null,a,arguments.length)},wrapAll:function(a){if(t.isFunction(a))return this.each(function(b){t(this).wrapAll(a.call(this,b))});if(this[0]){var b=t(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return t.isFunction(a)?this.each(function(b){t(this).wrapInner(a.call(this,b))}):this.each(function(){var b=t(this),c=b.contents();
c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=t.isFunction(a);return this.each(function(c){t(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){t.nodeName(this,"body")||t(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&
this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=t.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,t.clean(arguments));return a}},remove:function(a,
b){for(var c=0,d;null!=(d=this[c]);c++)if(!a||t.filter(a,[d]).length)b||1!==d.nodeType||(t.cleanData(d.getElementsByTagName("*")),t.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;null!=(b=this[a]);a++)for(1===b.nodeType&&t.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a,b){a=null==a?!1:a;b=null==b?a:b;return this.map(function(){return t.clone(this,a,b)})},html:function(a){return t.access(this,
function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(bb,""):null;if(!("string"!==typeof a||db.test(a)||!t.support.leadingWhitespace&&Ba.test(a)||ba[(Ra.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Qa,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},1===c.nodeType&&(t.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(t.isFunction(a))return this.each(function(b){var c=
t(this),d=c.html();c.replaceWith(a.call(this,b,d))});"string"!==typeof a&&(a=t(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;t(this).remove();b?t(b).before(a):t(c).append(a)})}return this.length?this.pushStack(t(t.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,k=a[0],l=[];if(!t.support.checkClone&&3===arguments.length&&"string"===typeof k&&Da.test(k))return this.each(function(){t(this).domManip(a,
c,d,!0)});if(t.isFunction(k))return this.each(function(e){var g=t(this);a[0]=k.call(this,e,c?g.html():b);g.domManip(a,c,d)});if(this[0]){e=k&&k.parentNode;e=t.support.parentNode&&e&&11===e.nodeType&&e.childNodes.length===this.length?{fragment:e}:t.buildFragment(a,this,l);h=e.fragment;if(g=1===h.childNodes.length?h=h.firstChild:h.firstChild){c=c&&t.nodeName(g,"tr");for(var m=0,n=this.length,r=n-1;m<n;m++)d.call(c?q(this[m],g):this[m],e.cacheable||1<n&&m<r?t.clone(h,!0,!0):h)}l.length&&t.each(l,function(a,
b){b.src?t.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):t.globalEval((b.text||b.textContent||b.innerHTML||"").replace(fb,"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)})}return this}});t.buildFragment=function(a,b,c){var d,e,g,h,k=a[0];b&&b[0]&&(h=b[0].ownerDocument||b[0]);h.createDocumentFragment||(h=H);!(1===a.length&&"string"===typeof k&&512>k.length&&h===H&&"<"===k.charAt(0))||eb.test(k)||!t.support.checkClone&&Da.test(k)||!t.support.html5Clone&&Sa.test(k)||(e=!0,(g=
t.fragments[k])&&1!==g&&(d=g));d||(d=h.createDocumentFragment(),t.clean(a,h,d,c));e&&(t.fragments[k]=g?d:1);return{fragment:d,cacheable:e}};t.fragments={};t.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){t.fn[a]=function(c){var d=[];c=t(c);var e=1===this.length&&this[0].parentNode;if(e&&11===e.nodeType&&1===e.childNodes.length&&1===c.length)return c[b](this[0]),this;for(var e=0,g=c.length;e<g;e++){var h=(0<e?this.clone(!0):
this).get();t(c[e])[b](h);d=d.concat(h)}return this.pushStack(d,a,c.selector)}});t.extend({clone:function(a,b,c){var d,e,g;t.support.html5Clone||t.isXMLDoc(a)||!Sa.test("<"+a.nodeName+">")?d=a.cloneNode(!0):(d=H.createElement("div"),Fa.appendChild(d),d.innerHTML=a.outerHTML,d=d.firstChild);var h=d;if(!(t.support.noCloneEvent&&t.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||t.isXMLDoc(a)))for(u(a,h),d=w(a),e=w(h),g=0;d[g];++g)e[g]&&u(d[g],e[g]);if(b&&(r(a,h),c))for(d=w(a),e=w(h),g=0;d[g];++g)r(d[g],
e[g]);return h},clean:function(a,b,c,d){var e,g=[];b=b||H;"undefined"===typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||H);for(var h=0,k;null!=(k=a[h]);h++)if("number"===typeof k&&(k+=""),k){if("string"===typeof k)if(Ca.test(k)){k=k.replace(Qa,"<$1></$2>");e=(Ra.exec(k)||["",""])[1].toLowerCase();var l=ba[e]||ba._default,m=l[0],q=b.createElement("div"),r=Fa.childNodes;b===H?Fa.appendChild(q):n(b).appendChild(q);for(q.innerHTML=l[1]+k+l[2];m--;)q=q.lastChild;if(!t.support.tbody)for(m=
cb.test(k),l="table"!==e||m?"<table>"!==l[1]||m?[]:q.childNodes:q.firstChild&&q.firstChild.childNodes,e=l.length-1;0<=e;--e)t.nodeName(l[e],"tbody")&&!l[e].childNodes.length&&l[e].parentNode.removeChild(l[e]);!t.support.leadingWhitespace&&Ba.test(k)&&q.insertBefore(b.createTextNode(Ba.exec(k)[0]),q.firstChild);k=q.childNodes;q&&(q.parentNode.removeChild(q),0<r.length&&(q=r[r.length-1])&&q.parentNode&&q.parentNode.removeChild(q))}else k=b.createTextNode(k);var u;if(!t.support.appendChecked)if(k[0]&&
"number"===typeof(u=k.length))for(e=0;e<u;e++)v(k[e]);else v(k);k.nodeType?g.push(k):g=t.merge(g,k)}if(c)for(a=function(a){return!a.type||Ea.test(a.type)},h=0;g[h];h++)b=g[h],d&&t.nodeName(b,"script")&&(!b.type||Ea.test(b.type))?d.push(b.parentNode?b.parentNode.removeChild(b):b):(1===b.nodeType&&(k=t.grep(b.getElementsByTagName("script"),a),g.splice.apply(g,[h+1,0].concat(k))),c.appendChild(b));return g},cleanData:function(a){for(var b,c,d=t.cache,e=t.event.special,g=t.support.deleteExpando,h=0,k;null!=
(k=a[h]);h++)if(!k.nodeName||!t.noData[k.nodeName.toLowerCase()])if(c=k[t.expando]){if((b=d[c])&&b.events){for(var l in b.events)e[l]?t.event.remove(k,l):t.removeEvent(k,l,b.handle);b.handle&&(b.handle.elem=null)}g?delete k[t.expando]:k.removeAttribute&&k.removeAttribute(t.expando);delete d[c]}}});var Ga=/alpha\([^)]*\)/i,Ha=/opacity=([^)]*)/,Ia=/([A-Z]|^ms)/g,gb=/^[\-+]?(?:\d*\.)?\d+$/i,ra=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Ja=/^([\-+])=([\-+.\de]+)/,hb=/^margin/,ib={position:"absolute",visibility:"hidden",
display:"block"},ha=["Top","Right","Bottom","Left"],oa,Ka,ga;t.fn.css=function(a,c){return t.access(this,function(a,c,d){return d!==b?t.style(a,c,d):t.css(a,c)},a,c,1<arguments.length)};t.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=oa(a,"opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":t.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&
3!==a.nodeType&&8!==a.nodeType&&a.style){var g,h=t.camelCase(c),k=a.style,l=t.cssHooks[h];c=t.cssProps[h]||h;if(d!==b){if(e=typeof d,"string"===e&&(g=Ja.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(t.css(a,c)),e="number"),!(null==d||"number"===e&&isNaN(d)||("number"!==e||t.cssNumber[h]||(d+="px"),l&&"set"in l&&(d=l.set(a,d))===b)))try{k[c]=d}catch(m){}}else return l&&"get"in l&&(g=l.get(a,!1,e))!==b?g:k[c]}},css:function(a,c,d){var e,g;c=t.camelCase(c);g=t.cssHooks[c];c=t.cssProps[c]||c;"cssFloat"===c&&
(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(oa)return oa(a,c)},swap:function(a,b,c){var d={},e;for(e in b)d[e]=a.style[e],a.style[e]=b[e];c=c.call(a);for(e in b)a.style[e]=d[e];return c}});t.curCSS=t.css;H.defaultView&&H.defaultView.getComputedStyle&&(Ka=function(a,b){var c,d,e,g=a.style;b=b.replace(Ia,"-$1").toLowerCase();(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""!==c||t.contains(a.ownerDocument.documentElement,a)||(c=t.style(a,
b)));!t.support.pixelMargin&&e&&hb.test(b)&&ra.test(c)&&(d=g.width,g.width=c,c=e.width,g.width=d);return c});H.documentElement.currentStyle&&(ga=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],g=a.style;null==e&&g&&(c=g[b])&&(e=c);if(ra.test(e)){c=g.left;if(d=a.runtimeStyle&&a.runtimeStyle.left)a.runtimeStyle.left=a.currentStyle.left;g.left="fontSize"===b?"1em":e;e=g.pixelLeft+"px";g.left=c;d&&(a.runtimeStyle.left=d)}return""===e?"auto":e});oa=Ka||ga;t.each(["height","width"],function(a,
b){t.cssHooks[b]={get:function(a,c,d){if(c)return 0!==a.offsetWidth?B(a,b,d):t.swap(a,ib,function(){return B(a,b,d)})},set:function(a,b){return gb.test(b)?b+"px":b}}});t.support.opacity||(t.cssHooks.opacity={get:function(a,b){return Ha.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=t.isNumeric(b)?"alpha(opacity="+100*b+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(1<=b&&""===t.trim(g.replace(Ga,
""))&&(c.removeAttribute("filter"),d&&!d.filter))return;c.filter=Ga.test(g)?g.replace(Ga,e):g+" "+e}});t(function(){t.support.reliableMarginRight||(t.cssHooks.marginRight={get:function(a,b){return t.swap(a,{display:"inline-block"},function(){return b?oa(a,"margin-right"):a.style.marginRight})}})});t.expr&&t.expr.filters&&(t.expr.filters.hidden=function(a){var b=a.offsetHeight;return 0===a.offsetWidth&&0===b||!t.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||t.css(a,"display"))},
t.expr.filters.visible=function(a){return!t.expr.filters.hidden(a)});t.each({margin:"",padding:"",border:"Width"},function(a,b){t.cssHooks[a+b]={expand:function(c){var d="string"===typeof c?c.split(" "):[c],e={};for(c=0;4>c;c++)e[a+ha[c]+b]=d[c]||d[c-2]||d[0];return e}}});var Ta=/%20/g,da=/\[\]$/,pa=/\r?\n/g,La=/#.*$/,sb=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,tb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ub=/^(?:GET|HEAD)$/,vb=/^\/\//,
lb=/\?/,wb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,xb=/^(?:select|textarea)/i,kb=/\s+/,yb=/([?&])_=[^&]*/,mb=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,nb=t.fn.load,Xa={},ob={},ua,va,pb=["*/"]+["*"];try{ua=O.href}catch(Eb){ua=H.createElement("a"),ua.href="",ua=ua.href}va=mb.exec(ua.toLowerCase())||[];t.fn.extend({load:function(a,c,d){if("string"!==typeof a&&nb)return nb.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(0<=e){var g=a.slice(e,a.length);a=
a.slice(0,e)}e="GET";c&&(t.isFunction(c)?(d=c,c=b):"object"===typeof c&&(c=t.param(c,t.ajaxSettings.traditional),e="POST"));var h=this;t.ajax({url:a,type:e,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText;a.isResolved()&&(a.done(function(a){c=a}),h.html(g?t("<div>").append(c.replace(wb,"")).find(g):c));d&&h.each(d,[c,b,a])}});return this},serialize:function(){return t.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?t.makeArray(this.elements):
this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xb.test(this.nodeName)||tb.test(this.type))}).map(function(a,b){var c=t(this).val();return null==c?null:t.isArray(c)?t.map(c,function(a,c){return{name:b.name,value:a.replace(pa,"\r\n")}}):{name:b.name,value:c.replace(pa,"\r\n")}}).get()}});t.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){t.fn[b]=function(a){return this.on(b,a)}});t.each(["get","post"],function(a,c){t[c]=function(a,
d,e,g){t.isFunction(d)&&(g=g||e,e=d,d=b);return t.ajax({type:c,url:a,data:d,success:e,dataType:g})}});t.extend({getScript:function(a,c){return t.get(a,b,c,"script")},getJSON:function(a,b,c){return t.get(a,b,c,"json")},ajaxSetup:function(a,b){b?z(a,t.ajaxSettings):(b=a,a=t.ajaxSettings);z(a,b);return a},ajaxSettings:{url:ua,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(va[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,
async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":pb},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":t.parseJSON,"text xml":t.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:D(Xa),ajaxTransport:D(ob),ajax:function(a,c){function d(a,c,q,r){if(2!==R){R=2;z&&clearTimeout(z);D=b;u=r||"";F.readyState=0<a?4:
0;var v,w,C;r=c;if(q){var B=e,da=F,E=B.contents,G=B.dataTypes,J=B.responseFields,O,S,I,pa;for(S in J)S in q&&(da[J[S]]=q[S]);for(;"*"===G[0];)G.shift(),O===b&&(O=B.mimeType||da.getResponseHeader("content-type"));if(O)for(S in E)if(E[S]&&E[S].test(O)){G.unshift(S);break}if(G[0]in q)I=G[0];else{for(S in q){if(!G[0]||B.converters[S+" "+G[0]]){I=S;break}pa||(pa=S)}I=I||pa}I?(I!==G[0]&&G.unshift(I),q=q[I]):q=void 0}else q=b;if(200<=a&&300>a||304===a){if(e.ifModified){if(O=F.getResponseHeader("Last-Modified"))t.lastModified[n]=
O;if(O=F.getResponseHeader("Etag"))t.etag[n]=O}if(304===a)r="notmodified",v=!0;else try{O=e;O.dataFilter&&(q=O.dataFilter(q,O.dataType));var N=O.dataTypes;S={};var W,Ma,M=N.length,H,U=N[0],L,La,Q,P,X;for(W=1;W<M;W++){if(1===W)for(Ma in O.converters)"string"===typeof Ma&&(S[Ma.toLowerCase()]=O.converters[Ma]);L=U;U=N[W];if("*"===U)U=L;else if("*"!==L&&L!==U){La=L+" "+U;Q=S[La]||S["* "+U];if(!Q)for(P in X=b,S)if(H=P.split(" "),H[0]===L||"*"===H[0])if(X=S[H[1]+" "+U]){P=S[P];!0===P?Q=X:!0===X&&(Q=P);
break}Q||X||t.error("No conversion from "+La.replace(" "," to "));!0!==Q&&(q=Q?Q(q):X(P(q)))}}w=q;r="success";v=!0}catch(Y){r="parsererror",C=Y}}else if(C=r,!r||a)r="error",0>a&&(a=0);F.status=a;F.statusText=""+(c||r);v?k.resolveWith(g,[w,r,F]):k.rejectWith(g,[F,r,C]);F.statusCode(m);m=b;A&&h.trigger("ajax"+(v?"Success":"Error"),[F,e,v?w:C]);l.fireWith(g,[F,r]);A&&(h.trigger("ajaxComplete",[F,e]),--t.active||t.event.trigger("ajaxStop"))}}"object"===typeof a&&(c=a,a=b);c=c||{};var e=t.ajaxSetup({},
c),g=e.context||e,h=g!==e&&(g.nodeType||g instanceof t)?t(g):t.event,k=t.Deferred(),l=t.Callbacks("once memory"),m=e.statusCode||{},n,q={},r={},u,v,D,z,w,R=0,A,B,F={readyState:0,setRequestHeader:function(a,b){if(!R){var c=a.toLowerCase();a=r[c]=r[c]||a;q[a]=b}return this},getAllResponseHeaders:function(){return 2===R?u:null},getResponseHeader:function(a){var c;if(2===R){if(!v)for(v={};c=sb.exec(u);)v[c[1].toLowerCase()]=c[2];c=v[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){R||
(e.mimeType=a);return this},abort:function(a){a=a||"abort";D&&D.abort(a);d(0,a);return this}};k.promise(F);F.success=F.done;F.error=F.fail;F.complete=l.add;F.statusCode=function(a){if(a){var b;if(2>R)for(b in a)m[b]=[m[b],a[b]];else b=a[F.status],F.then(b,b)}return this};e.url=((a||e.url)+"").replace(La,"").replace(vb,va[1]+"//");e.dataTypes=t.trim(e.dataType||"*").toLowerCase().split(kb);null==e.crossDomain&&(w=mb.exec(e.url.toLowerCase()),e.crossDomain=!(!w||w[1]==va[1]&&w[2]==va[2]&&(w[3]||("http:"===
w[1]?80:443))==(va[3]||("http:"===va[1]?80:443))));e.data&&e.processData&&"string"!==typeof e.data&&(e.data=t.param(e.data,e.traditional));C(Xa,e,c,F);if(2===R)return!1;A=e.global;e.type=e.type.toUpperCase();e.hasContent=!ub.test(e.type);A&&0===t.active++&&t.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=(lb.test(e.url)?"&":"?")+e.data,delete e.data),n=e.url,!1===e.cache)){w=t.now();var da=e.url.replace(yb,"$1_="+w);e.url=da+(da===e.url?(lb.test(e.url)?"&":"?")+"_="+w:"")}(e.data&&
e.hasContent&&!1!==e.contentType||c.contentType)&&F.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(n=n||e.url,t.lastModified[n]&&F.setRequestHeader("If-Modified-Since",t.lastModified[n]),t.etag[n]&&F.setRequestHeader("If-None-Match",t.etag[n]));F.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+pb+"; q=0.01":""):e.accepts["*"]);for(B in e.headers)F.setRequestHeader(B,e.headers[B]);if(e.beforeSend&&(!1===e.beforeSend.call(g,
F,e)||2===R))return F.abort(),!1;for(B in{success:1,error:1,complete:1})F[B](e[B]);if(D=C(ob,e,c,F)){F.readyState=1;A&&h.trigger("ajaxSend",[F,e]);e.async&&0<e.timeout&&(z=setTimeout(function(){F.abort("timeout")},e.timeout));try{R=1,D.send(q,d)}catch(E){if(2>R)d(-1,E);else throw E;}}else d(-1,"No Transport");return F},param:function(a,c){var d=[],e=function(a,b){b=t.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=t.ajaxSettings.traditional);if(t.isArray(a)||
a.jquery&&!t.isPlainObject(a))t.each(a,function(){e(this.name,this.value)});else for(var g in a)F(g,a[g],c,e);return d.join("&").replace(Ta,"+")}});t.extend({active:0,lastModified:{},etag:{}});var zb=t.now(),Ua=/(\=)\?(&|$)|\?\?/i;t.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return t.expando+"_"+zb++}});t.ajaxPrefilter("json jsonp",function(b,c,d){c="string"===typeof b.data&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if("jsonp"===b.dataTypes[0]||!1!==b.jsonp&&(Ua.test(b.url)||
c&&Ua.test(b.data))){var e,g=b.jsonpCallback=t.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],k=b.url,l=b.data,m="$1"+g+"$2";!1!==b.jsonp&&(k=k.replace(Ua,m),b.url===k&&(c&&(l=l.replace(Ua,m)),b.data===l&&(k+=(/\?/.test(k)?"&":"?")+b.jsonp+"="+g)));b.url=k;b.data=l;a[g]=function(a){e=[a]};d.always(function(){a[g]=h;if(e&&t.isFunction(h))a[g](e[0])});b.converters["script json"]=function(){e||t.error(g+" was not called");return e[0]};b.dataTypes[0]="json";return"script"}});t.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){t.globalEval(a);return a}}});t.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1);a.crossDomain&&(a.type="GET",a.global=!1)});t.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=H.head||H.getElementsByTagName("head")[0]||H.documentElement;return{send:function(e,g){c=H.createElement("script");c.async="async";a.scriptCharset&&(c.charset=a.scriptCharset);c.src=a.url;c.onload=c.onreadystatechange=function(a,
e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")};d.insertBefore(c,d.firstChild)},abort:function(){if(c)c.onload(0,1)}}}});var jb=a.ActiveXObject?function(){for(var a in ya)ya[a](0,1)}:!1,Ab=0,ya;t.ajaxSettings.xhr=a.ActiveXObject?function(){var b;if(!(b=!this.isLocal&&G()))a:{try{b=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}b=void 0}return b}:G;(function(a){t.extend(t.support,
{ajax:!!a,cors:!!a&&"withCredentials"in a})})(t.ajaxSettings.xhr());t.support.ajax&&t.ajaxTransport(function(c){if(!c.crossDomain||t.support.cors){var d;return{send:function(e,g){var h=c.xhr(),k,l;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(l in c.xhrFields)h[l]=c.xhrFields[l];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType);c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(l in e)h.setRequestHeader(l,
e[l])}catch(m){}h.send(c.hasContent&&c.data||null);d=function(a,e){var l,m,n,q,r;try{if(d&&(e||4===h.readyState))if(d=b,k&&(h.onreadystatechange=t.noop,jb&&delete ya[k]),e)4!==h.readyState&&h.abort();else{l=h.status;n=h.getAllResponseHeaders();q={};(r=h.responseXML)&&r.documentElement&&(q.xml=r);try{q.text=h.responseText}catch(u){}try{m=h.statusText}catch(v){m=""}l||!c.isLocal||c.crossDomain?1223===l&&(l=204):l=q.text?200:404}}catch(D){e||g(-1,D)}q&&g(l,m,q,n)};c.async&&4!==h.readyState?(k=++Ab,jb&&
(ya||(ya={},t(a).unload(jb)),ya[k]=d),h.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var Ya={},ka,wa,Bb=/^(?:toggle|show|hide)$/,Cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,Va,Oa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],Na;t.fn.extend({show:function(a,b,c){if(a||0===a)return this.animate(I("show",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=a.style.display,t._data(a,
"olddisplay")||"none"!==b||(b=a.style.display=""),(""===b&&"none"===t.css(a,"display")||!t.contains(a.ownerDocument.documentElement,a))&&t._data(a,"olddisplay",L(a.nodeName)));for(c=0;c<d;c++)if(a=this[c],a.style&&(b=a.style.display,""===b||"none"===b))a.style.display=t._data(a,"olddisplay")||"";return this},hide:function(a,b,c){if(a||0===a)return this.animate(I("hide",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=t.css(a,"display"),"none"===b||t._data(a,"olddisplay")||t._data(a,
"olddisplay",b));for(c=0;c<d;c++)this[c].style&&(this[c].style.display="none");return this},_toggle:t.fn.toggle,toggle:function(a,b,c){var d="boolean"===typeof a;t.isFunction(a)&&t.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:t(this).is(":hidden");t(this)[b?"show":"hide"]()}):this.animate(I("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,
b,c,d){function e(){!1===g.queue&&t._mark(this);var b=t.extend({},g),c=1===this.nodeType,d=c&&t(this).is(":hidden"),h,k,l,m,q;b.animatedProperties={};for(l in a)if(h=t.camelCase(l),l!==h&&(a[h]=a[l],delete a[l]),(k=t.cssHooks[h])&&"expand"in k)for(l in m=k.expand(a[h]),delete a[h],m)l in a||(a[l]=m[l]);for(h in a){k=a[h];t.isArray(k)?(b.animatedProperties[h]=k[1],k=a[h]=k[0]):b.animatedProperties[h]=b.specialEasing&&b.specialEasing[h]||b.easing||"swing";if("hide"===k&&d||"show"===k&&!d)return b.complete.call(this);
!c||"height"!==h&&"width"!==h||(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===t.css(this,"display")&&"none"===t.css(this,"float")&&(t.support.inlineBlockNeedsLayout&&"inline"!==L(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=b.overflow&&(this.style.overflow="hidden");for(l in a)if(c=new t.fx(this,b,l),k=a[l],Bb.test(k))if(h=t._data(this,"toggle"+l)||("toggle"===k?d?"show":"hide":0))t._data(this,"toggle"+l,"show"===h?"hide":"show"),
c[h]();else c[k]();else h=Cb.exec(k),m=c.cur(),h?(k=parseFloat(h[2]),q=h[3]||(t.cssNumber[l]?"":"px"),"px"!==q&&(t.style(this,l,(k||1)+q),m*=(k||1)/c.cur(),t.style(this,l,m+q)),h[1]&&(k=("-="===h[1]?-1:1)*k+m),c.custom(m,k,q)):c.custom(m,k,"");return!0}var g=t.speed(b,c,d);if(t.isEmptyObject(a))return this.each(g.complete,[!1]);a=t.extend({},a);return!1===g.queue?this.each(e):this.queue(g.queue,e)},stop:function(a,c,d){"string"!==typeof a&&(d=c,c=a,a=b);c&&!1!==a&&this.queue(a||"fx",[]);return this.each(function(){var b,
c=!1,e=t.timers,g=t._data(this);d||t._unmark(!0,this);if(null==a)for(b in g){if(g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4){var h=g[b];t.removeData(this,b,!0);h.stop(d)}}else g[b=a+".run"]&&g[b].stop&&(g=g[b],t.removeData(this,b,!0),g.stop(d));for(b=e.length;b--;)if(e[b].elem===this&&(null==a||e[b].queue===a)){if(d)e[b](!0);else e[b].saveState();c=!0;e.splice(b,1)}d&&c||t.dequeue(this,a)})}});t.each({slideDown:I("show",1),slideUp:I("hide",1),slideToggle:I("toggle",1),fadeIn:{opacity:"show"},
fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){t.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}});t.extend({speed:function(a,b,c){var d=a&&"object"===typeof a?t.extend({},a):{complete:c||!c&&b||t.isFunction(a)&&a,duration:a,easing:c&&b||b&&!t.isFunction(b)&&b};d.duration=t.fx.off?0:"number"===typeof d.duration?d.duration:d.duration in t.fx.speeds?t.fx.speeds[d.duration]:t.fx.speeds._default;if(null==d.queue||!0===d.queue)d.queue="fx";d.old=d.complete;d.complete=function(a){t.isFunction(d.old)&&
d.old.call(this);d.queue?t.dequeue(this,d.queue):!1!==a&&t._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});t.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(t.fx.step[this.prop]||t.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];
var a,b=t.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?b&&"auto"!==b?b:0:a},custom:function(a,c,d){function e(a){return g.step(a)}var g=this,h=t.fx;this.startTime=Na||J();this.end=c;this.now=this.start=a;this.pos=this.state=0;this.unit=d||this.unit||(t.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=function(){t._data(g.elem,"fxshow"+g.prop)===b&&(g.options.hide?t._data(g.elem,"fxshow"+g.prop,g.start):g.options.show&&t._data(g.elem,"fxshow"+g.prop,g.end))};
e()&&t.timers.push(e)&&!Va&&(Va=setInterval(h.tick,h.interval))},show:function(){var a=t._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||t.style(this.elem,this.prop);this.options.show=!0;a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur());t(this.elem).show()},hide:function(){this.options.orig[this.prop]=t._data(this.elem,"fxshow"+this.prop)||t.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b,
c=Na||J(),d=!0,e=this.elem,g=this.options;if(a||c>=g.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();g.animatedProperties[this.prop]=!0;for(b in g.animatedProperties)!0!==g.animatedProperties[b]&&(d=!1);if(d){null==g.overflow||t.support.shrinkWrapBlocks||t.each(["","X","Y"],function(a,b){e.style["overflow"+b]=g.overflow[a]});g.hide&&t(e).hide();if(g.hide||g.show)for(b in g.animatedProperties)t.style(e,b,g.orig[b]),t.removeData(e,"fxshow"+b,!0),t.removeData(e,"toggle"+
b,!0);if(a=g.complete)g.complete=!1,a.call(e)}return!1}Infinity==g.duration?this.now=c:(a=c-this.startTime,this.state=a/g.duration,this.pos=t.easing[g.animatedProperties[this.prop]](this.state,a,0,1,g.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};t.extend(t.fx,{tick:function(){for(var a,b=t.timers,c=0;c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||t.fx.stop()},interval:13,stop:function(){clearInterval(Va);Va=null},speeds:{slow:600,fast:200,
_default:400},step:{opacity:function(a){t.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&null!=a.elem.style[a.prop]?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}});t.each(Oa.concat.apply([],Oa),function(a,b){b.indexOf("margin")&&(t.fx.step[b]=function(a){t.style(a.elem,b,Math.max(0,a.now)+a.unit)})});t.expr&&t.expr.filters&&(t.expr.filters.animated=function(a){return t.grep(t.timers,function(b){return a===b.elem}).length});var qb,Db=/^t(?:able|d|h)$/i,rb=/^(?:body|html)$/i;
qb="getBoundingClientRect"in H.documentElement?function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!t.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};a=b.body;b=P(b);return{top:d.top+(b.pageYOffset||t.support.boxModel&&c.scrollTop||a.scrollTop)-(c.clientTop||a.clientTop||0),left:d.left+(b.pageXOffset||t.support.boxModel&&c.scrollLeft||a.scrollLeft)-(c.clientLeft||a.clientLeft||0)}}:function(a,b,c){var d,e=a.offsetParent,g=b.body;d=(b=b.defaultView)?b.getComputedStyle(a,
null):a.currentStyle;for(var h=a.offsetTop,k=a.offsetLeft;(a=a.parentNode)&&a!==g&&a!==c&&(!t.support.fixedPosition||"fixed"!==d.position);)d=b?b.getComputedStyle(a,null):a.currentStyle,h-=a.scrollTop,k-=a.scrollLeft,a===e&&(h+=a.offsetTop,k+=a.offsetLeft,!t.support.doesNotAddBorder||t.support.doesAddBorderForTableAndCells&&Db.test(a.nodeName)||(h+=parseFloat(d.borderTopWidth)||0,k+=parseFloat(d.borderLeftWidth)||0),e=a.offsetParent),t.support.subtractsBorderForOverflowNotVisible&&"visible"!==d.overflow&&
(h+=parseFloat(d.borderTopWidth)||0,k+=parseFloat(d.borderLeftWidth)||0);if("relative"===d.position||"static"===d.position)h+=g.offsetTop,k+=g.offsetLeft;t.support.fixedPosition&&"fixed"===d.position&&(h+=Math.max(c.scrollTop,g.scrollTop),k+=Math.max(c.scrollLeft,g.scrollLeft));return{top:h,left:k}};t.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){t.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;return d?c===d.body?t.offset.bodyOffset(c):qb(c,d,
d.documentElement):null};t.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;t.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(t.css(a,"marginTop"))||0,c+=parseFloat(t.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=t.css(a,"position");"static"===d&&(a.style.position="relative");var e=t(a),g=e.offset(),h=t.css(a,"top"),k=t.css(a,"left"),l={},m={};("absolute"===d||"fixed"===d)&&-1<t.inArray("auto",[h,k])?(m=e.position(),d=m.top,k=m.left):(d=parseFloat(h)||
0,k=parseFloat(k)||0);t.isFunction(b)&&(b=b.call(a,c,g));null!=b.top&&(l.top=b.top-g.top+d);null!=b.left&&(l.left=b.left-g.left+k);"using"in b?b.using.call(a,l):e.css(l)}};t.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=rb.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(t.css(a,"marginTop"))||0;c.left-=parseFloat(t.css(a,"marginLeft"))||0;d.top+=parseFloat(t.css(b[0],"borderTopWidth"))||0;d.left+=parseFloat(t.css(b[0],
"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||H.body;a&&!rb.test(a.nodeName)&&"static"===t.css(a,"position");)a=a.offsetParent;return a})}});t.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);t.fn[a]=function(e){return t.access(this,function(a,e,g){var h=P(a);if(g===b)return h?c in h?h[c]:t.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];
h?h.scrollTo(d?t(h).scrollLeft():g,d?g:t(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}});t.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;t.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(t.css(a,c,"padding")):this[c]():null};t.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(t.css(b,c,a?"margin":"border")):this[c]():null};t.fn[c]=function(a){return t.access(this,function(a,c,h){if(t.isWindow(a))return c=a.document,
a=c.documentElement[d],t.support.boxModel&&a||c.body&&c.body[d]||a;if(9===a.nodeType)return c=a.documentElement,c[d]>=c[e]?c[d]:Math.max(a.body[e],c[e],a.body[g],c[g]);if(h===b)return a=t.css(a,c),c=parseFloat(a),t.isNumeric(c)?c:a;t(a).css(c,h)},c,a,arguments.length,null)}});a.jQuery=a.$=t;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return t})})(window);jQuery.cookie=function(a,b,c){if(1<arguments.length&&"[object Object]"!==String(b)){c=jQuery.extend({},c);if(null===b||void 0===b)c.expires=-1;if("number"===typeof c.expires){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};e=c.raw?function(a){return a}:
decodeURIComponent;return(d=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?e(d[1]):null};(function(a){function b(b){var c=b||window.event,d=[].slice.call(arguments,1),k=0,l=0,m=0;b=a.event.fix(c);b.type="mousewheel";c.wheelDelta&&(k=c.wheelDelta/120);c.detail&&(k=-c.detail/3);m=k;void 0!==c.axis&&c.axis===c.HORIZONTAL_AXIS&&(m=0,l=-1*k);void 0!==c.wheelDeltaY&&(m=c.wheelDeltaY/120);void 0!==c.wheelDeltaX&&(l=-1*c.wheelDeltaX/120);d.unshift(b,k,l,m);return(a.event.dispatch||a.event.handle).apply(this,d)}var c=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var d=c.length;d;)a.event.fixHooks[c[--d]]=
a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],b,!1);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);(function(a,b){function c(){this._state=[];this._defaults={classHolder:"sbHolder",classHolderDisabled:"sbHolderDisabled",classHolderOpen:"sbHolderOpen",classSelector:"sbSelector",classOptions:"sbOptions",classGroup:"sbGroup",classSub:"sbSub",classDisabled:"sbDisabled",classToggleOpen:"sbToggleOpen",classToggle:"sbToggle",speed:200,slidesUp:!1,effect:"slide",onChange:null,onOpen:null,onClose:null}}a.extend(c.prototype,{_isOpenSelectbox:function(a){return a?this._getInst(a).isOpen:!1},_isDisabledSelectbox:function(a){return a?
this._getInst(a).isDisabled:!1},_attachSelectbox:function(c,e){function g(){var b,c=this.attr("id").split("_")[1];for(b in m._state)b!==c&&m._state.hasOwnProperty(b)&&a(":input[sb='"+b+"']")[0]&&m._closeSelectbox(a(":input[sb='"+b+"']")[0])}function h(b){l.children().each(function(e){if(a(this).is(":selected")){if(38==b&&0<e)return e=a(l.children()[e-1]),m._changeSelectbox(c,e.val(),e.text()),!1;if(40==b&&e<l.children().length-1)return e=a(l.children()[e+1]),m._changeSelectbox(c,e.val(),e.text()),
!1}})}function k(e,g){var h=g&&g.sub?!0:!1,k=g&&g.disabled?!0:!1;e.each(function(e){var g=a(this),l=a("<li>"),q;g.is(":selected")&&(r.text(g.text()),A=!0);e===B-1&&l.addClass("last");(function(){var e=g.text(),r=g.data("custom-option-text"),r=r!=b?r:e;g.is(":disabled")||k?q=a("<span>",{text:r}).addClass(n.settings.classDisabled):(q=a("<a>",{href:"#"+g.val(),rel:g.val(),text:r,click:function(b){b.preventDefault();b=u;b.attr("id").split("_");m._closeSelectbox(c);m._changeSelectbox(c,a(this).attr("rel"),
e);b.focus()}}),g.is(":selected")&&q.addClass("active"));h&&q.addClass(n.settings.classSub);q.appendTo(l)})();l.appendTo(w)})}if(this._getInst(c))return!1;var l=a(c),m=this,n=m._newInst(l),q,r,u,w,A=!1;l.find("optgroup");var v=l.find("option"),B=v.length;l.attr("sb",n.uid);a.extend(n.settings,m._defaults,e);m._state[n.uid]=!1;l.hide();q=a("<div>",{id:"sbHolder_"+n.uid,"class":n.settings.classHolder});var D=l.data("selectbox-css");D&&q.css(D);r=a("<a>",{id:"sbSelector_"+n.uid,href:"#","class":n.settings.classSelector,
click:function(b){b.preventDefault();b.stopPropagation();g.apply(a(this),[]);b=a(this).attr("id").split("_")[1];m._state[b]?m._closeSelectbox(c):(m._openSelectbox(c),u.focus())},keyup:function(a){h(a.keyCode)}});u=a("<a>",{id:"sbToggle_"+n.uid,href:"#","class":n.settings.classToggle,click:function(b){b.preventDefault();b.stopPropagation();g.apply(a(this),[]);b=a(this).attr("id").split("_")[1];m._state[b]?m._closeSelectbox(c):(m._openSelectbox(c),u.focus())},keyup:function(a){h(a.keyCode)}});u.appendTo(q);
w=a("<ul>",{id:"sbOptions_"+n.uid,"class":n.settings.classOptions,css:{display:"none"}});l.children().each(function(b){b=a(this);var c,d={};b.is("option")?k(b):b.is("optgroup")&&(c=a("<li>"),a("<span>",{text:b.attr("label")}).addClass(n.settings.classGroup).appendTo(c),c.appendTo(w),b.is(":disabled")&&(d.disabled=!0),d.sub=!0,k(b.find("option"),d))});A||r.text(v.first().text());a.data(c,"selectbox",n);r.appendTo(q);w.appendTo(q);q.insertAfter(l);l.is(":disabled")&&a.selectbox._disableSelectbox(c);
l.change(function(){var b=a(this).val(),e=l.find("option[value='"+b+"']").text();m._changeSelectbox(c,b,e)})},_detachSelectbox:function(b){var c=this._getInst(b);if(!c)return!1;a("#sbHolder_"+c.uid).remove();delete this._state[c.uid];a.data(b,"selectbox",null);a(b).show()},_changeSelectbox:function(b,c,g){var h=this._getInst(b),k=this._get(h,"onChange");alreadySelected=a("#sbSelector_"+h.uid).text()===g&&a("#sbOptions_"+h.uid).find('a[rel="'+c+'"]').hasClass("active");alreadySelected||(a("#sbSelector_"+
h.uid).text(g),a("#sbOptions_"+h.uid).find(".active").removeClass("active"),a("#sbOptions_"+h.uid).find('a[rel="'+c+'"]').addClass("active"),a(b).find("option").attr("selected",!1),a(b).find("option[value='"+c+"']").attr("selected",!0),k?k.apply(h.input?h.input[0]:null,[c,h]):h.input&&h.input.trigger("change"))},_enableSelectbox:function(b){var c=this._getInst(b);if(!c||!c.isDisabled)return!1;a("#sbHolder_"+c.uid).removeClass(c.settings.classHolderDisabled);c.isDisabled=!1;a.data(b,"selectbox",c)},
_disableSelectbox:function(b){var c=this._getInst(b);if(!c||c.isDisabled)return!1;a("#sbHolder_"+c.uid).addClass(c.settings.classHolderDisabled);c.isDisabled=!0;a.data(b,"selectbox",c)},_optionSelectbox:function(b,c,g){var h=this._getInst(b);if(!h)return!1;h[c]=g;a.data(b,"selectbox",h)},_openSelectbox:function(b){var c=this._getInst(b),g=this;if(c&&!c.isOpen&&!c.isDisabled){var h=a("#sbOptions_"+c.uid),k=parseInt(a(window).height(),10),l=parseInt(a(window).width(),10),m=a("#sbHolder_"+c.uid).offset(),
n=a(window).scrollTop(),q=h.prev().height(),k=k-(m.top-n)-q/2,r=this._get(c,"onOpen");50<k&&!c.settings.slidesUp?h.css({bottom:"auto",top:q+2+"px",maxHeight:k-q+"px"}):h.css({top:"auto",bottom:q+2+"px",maxHeight:m.top-n-q/2+"px"});m.left+h.width()>l?h.css("left","-"+(h.width()-h.parent().width()+3)+"px"):h.css("left","-1px");"fade"===c.settings.effect?h.fadeIn(c.settings.speed):h.slideDown(c.settings.speed);a("#sbToggle_"+c.uid).addClass(c.settings.classToggleOpen);a("#sbHolder_"+c.uid).addClass(c.settings.classHolderOpen);
this._state[c.uid]=!0;c.isOpen=!0;r&&r.apply(c.input?c.input[0]:null,[c]);a.data(b,"selectbox",c);a("html").unbind("click.sbClose").one("click.sbClose",function(){g._closeSelectbox(b)})}},_closeSelectbox:function(b){var c=this._getInst(b);if(c&&c.isOpen){var g=this._get(c,"onClose");a("#sbOptions_"+c.uid).hide();a("#sbToggle_"+c.uid).removeClass(c.settings.classToggleOpen);a("#sbHolder_"+c.uid).removeClass(c.settings.classHolderOpen);this._state[c.uid]=!1;c.isOpen=!1;g&&g.apply(c.input?c.input[0]:
null,[c]);a.data(b,"selectbox",c);a("html").unbind("click.sbClose")}},_newInst:function(a){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,uid:Math.floor(99999999*Math.random()),isOpen:!1,isDisabled:!1,settings:{}}},_getInst:function(b){try{return a.data(b,"selectbox")}catch(c){throw"Missing instance data for this selectbox";}},_get:function(a,c){return a.settings[c]!==b?a.settings[c]:this._defaults[c]}});a.fn.selectbox=function(b){var c=Array.prototype.slice.call(arguments,1);return"string"==
typeof b&&"isDisabled"==b||"option"==b&&2==arguments.length&&"string"==typeof arguments[1]?a.selectbox["_"+b+"Selectbox"].apply(a.selectbox,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.selectbox["_"+b+"Selectbox"].apply(a.selectbox,[this].concat(c)):a.selectbox._attachSelectbox(this,b)})};a.selectbox=new c;a.selectbox.version="0.1.3"})(jQuery);(function(a,b){var c="fontFamily fontSize fontWeight fontStyle letterSpacing textTransform wordSpacing".split(" "),d=a('<textarea style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden">')[0];d.setAttribute("oninput","return");a.isFunction(d.oninput)||"onpropertychange"in d?a.fn.autosize=function(b){return this.each(function(){function d(){var a,b;q||(q=!0,l.value=h.value,
l.style.overflowY=h.style.overflowY,l.style.width=k.css("width"),l.style.textIndent=k.css("text-indent"),l.scrollTop=0,l.scrollTop=9E4,a=l.scrollTop,b="hidden",a>n?(a=n,b="scroll"):a<m&&(a=m),h.style.overflowY=b,h.style.height=h.style.minHeight=h.style.maxHeight=a+u+"px",setTimeout(function(){q=!1},1));k.trigger("autosizeComplete")}for(var h=this,k=a(h).css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),l=a('<textarea style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden">').addClass(b||
"autosizejs")[0],m=k.height(),n=parseInt(k.css("maxHeight"),10),q,r=c.length,u="border-box"===k.css("box-sizing")?k.outerHeight()-k.height():0,n=n&&0<n?n:9E4;r--;)l.style[c[r]]=k.css(c[r]);a("body").append(l);"onpropertychange"in h?"oninput"in h?h.oninput=h.onkeyup=d:h.onpropertychange=d:h.oninput=d;a(window).resize(d);k.bind("autosize",d);d()})}:a.fn.autosize=function(){return this}})(jQuery);(function(a,b,c){function d(){h=b.setTimeout(function(){e.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,"resize-special-event");c===e.w&&d===e.h||b.trigger("resize",[e.w=c,e.h=d])});d()},g.delay)}"$:nomunge";var e=a([]),g=a.resize=a.extend(a.resize,{}),h;g.delay=250;g.throttleWindow=!0;a.event.special.resize={setup:function(){if(!g.throttleWindow&&this.setTimeout)return!1;var b=a(this);e=e.add(b);a.data(this,"resize-special-event",{w:b.width(),h:b.height()});1===e.length&&d()},
teardown:function(){if(!g.throttleWindow&&this.setTimeout)return!1;var b=a(this);e=e.not(b);b.removeData("resize-special-event");e.length||clearTimeout(h)},add:function(b){function d(b,g,h){var k=a(this),l=a.data(this,"resize-special-event");l.w=g!==c?g:k.width();l.h=h!==c?h:k.height();e.apply(this,arguments)}if(!g.throttleWindow&&this.setTimeout)return!1;var e;if(a.isFunction(b))return e=b,d;e=b.handler;b.handler=d}}})(jQuery,this);Modernizr=window.Modernizr=function(a,b,c){function d(a,b){return typeof a===b}function e(a,b){for(var d in a){var e=a[d];if(!~(""+e).indexOf("-")&&m[e]!==c)return"pfx"==b?e:!0}return!1}function g(a,b,g){var h=a.charAt(0).toUpperCase()+a.slice(1),k=(a+" "+q.join(h+" ")+h).split(" ");if(d(b,"string")||d(b,"undefined"))b=e(k,b);else a:{k=(a+" "+r.join(h+" ")+h).split(" "),a=k;for(var l in a)if(h=b[a[l]],h!==c){b=!1===g?a[l]:d(h,"function")?h.bind(g||b):h;break a}b=!1}return b}var h={},k=b.documentElement,
l=b.createElement("modernizr"),m=l.style,n=" -webkit- -moz- -o- -ms- ".split(" "),q=["Webkit","Moz","O","ms"],r=["webkit","moz","o","ms"],l={},u=[],w=u.slice,A,v=function(a,c,d,e){var g,h,l,m,q=b.createElement("div"),n=b.body,r=n||b.createElement("body");if(parseInt(d,10))for(;d--;)l=b.createElement("div"),l.id=e?e[d]:"modernizr"+(d+1),q.appendChild(l);return g=['&#173;<style id="smodernizr">',a,"</style>"].join(""),q.id="modernizr",(n?q:r).innerHTML+=g,r.appendChild(q),n||(r.style.background="",
r.style.overflow="hidden",m=k.style.overflow,k.style.overflow="hidden",k.appendChild(r)),h=c(q,a),n?q.parentNode.removeChild(q):(r.parentNode.removeChild(r),k.style.overflow=m),!!h},B=function(){var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(e,g){g=g||b.createElement(a[e]||"div");e="on"+e;var h=e in g;return h||(g.setAttribute||(g=b.createElement("div")),g.setAttribute&&g.removeAttribute&&(g.setAttribute(e,""),h=d(g[e],"function"),
d(g[e],"undefined")||(g[e]=c),g.removeAttribute(e))),h}}(),D={}.hasOwnProperty,C;d(D,"undefined")||d(D.call,"undefined")?C=function(a,b){return b in a&&d(a.constructor.prototype[b],"undefined")}:C=function(a,b){return D.call(a,b)};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=w.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var e=new e,g=b.apply(e,c.concat(w.call(arguments)));
return Object(g)===g?g:e}return b.apply(a,c.concat(w.call(arguments)))};return d});l.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")};l.canvastext=function(){return!!h.canvas&&!!d(b.createElement("canvas").getContext("2d").fillText,"function")};l.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:v(["@media (",n.join("touch-enabled),("),"modernizr){#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=
9===a.offsetTop}),c};l.history=function(){return!!a.history&&!!history.pushState};l.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a};l.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a};l.multiplebgs=function(){m.cssText="background:url(https://),url(https://),red url(https://)";return/(url\s*\(.*?){3}/.test(m.background)};l.csscolumns=function(){return g("columnCount")};l.csstransitions=function(){return g("transition")};l.localstorage=
function(){try{return localStorage.setItem("modernizr","modernizr"),localStorage.removeItem("modernizr"),!0}catch(a){return!1}};for(var z in l)C(l,z)&&(A=z.toLowerCase(),h[A]=l[z](),u.push((h[A]?"":"no-")+A));h.addTest=function(a,b){if("object"==typeof a)for(var d in a)C(a,d)&&h.addTest(d,a[d]);else{a=a.toLowerCase();if(h[a]!==c)return h;b="function"==typeof b?b():b;k.className+=" feature-"+(b?"":"no-")+a;h[a]=b}return h};m.cssText="";return l=null,h._version="2.7.1",h._prefixes=n,h._domPrefixes=
r,h._cssomPrefixes=q,h.hasEvent=B,h.testProp=function(a){return e([a])},h.testAllProps=g,h.testStyles=v,k.className=k.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(" feature-js feature-"+u.join(" feature-")),h}(this,this.document);Modernizr.touch=Modernizr.touch&&"onorientationchange"in window;
Modernizr.addTest("pointerevents",function(){var a=document.createElement("x"),b=document.documentElement,c=window.getComputedStyle,d=!1;if(!("pointerEvents"in a.style))return!1;a.style.pointerEvents="auto";a.style.pointerEvents="x";b.appendChild(a);c&&(d=(c=c(a,""))?"auto"===c.pointerEvents:!1);b.removeChild(a);return!!d});(function(a){function b(a,b,c){a/=255;b/=255;c/=255;var d=Math.max(a,b,c),e=Math.min(a,b,c),g,h=d-e;if(d==e)g=0;else{switch(d){case a:g=(b-c)/h+(b<c?6:0);break;case b:g=(c-a)/h+2;break;case c:g=(a-b)/h+4}g/=6}return[g,0==d?0:h/d,d]}function c(a,b,c){var d,e,g,h=Math.floor(6*a),k=6*a-h;a=c*(1-b);var l=c*(1-k*b);b=c*(1-(1-k)*b);switch(h%6){case 0:d=c;e=b;g=a;break;case 1:d=l;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=l;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c,e=a,g=l}return[255*d,255*
e,255*g]}function d(a){a=a.replace(/^(?:[\da-f]{3}){1,2}$/i,"#$&");a=a.replace(/^#([\da-f])([\da-f])([\da-f])$/i,"#$1$1$2$2$3$3");return a=a.replace(/^\s*RGB\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,function(a,b,c,d){return g(b,c,d)})}function e(a){a.replace(/^#([\da-f])([\da-f])([\da-f])$/i,"#$1$1$2$2$3$3");a=/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(a)||[null,0,0,0];return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}function g(a,b,c){2 in arguments||(c=a[2],b=a[1],a=a[0]);
return("#@0"+(~~a).toString(16)+"@0"+(~~b).toString(16)+"@0"+(~~c).toString(16)).replace(/@0?([\da-f]{2})/gi,"$1")}function h(a){a&&(a.join||(a=a?(""+a).split(","):[]),m=a)}function k(n){function q(b){var c=!1;b=b.toLowerCase();a.each(m,function(a,d){if(d.toLowerCase()==b)return c=!0,!1});if(c)return!1;m=[b].concat(m.slice(0,l-1));return!0}function r(b){u.call(this,b);a(this).removeData("tvcolorpicker").removeData("tvcolorpicker-custom-color");D()}function u(b){var c=a(this);c.val(b);c.change();b?
c.trigger("pick-color",b):c.trigger("pick-transparent");w.call(this,b)}function w(b){a(this).css({backgroundColor:b,color:b})}function A(c,d){var g=this,h=a(g).val().toLowerCase(),k=document.createElement("table"),m=document.createElement("tbody");k.appendChild(m);var q,n=0;a.each(c,function(c,k){n++;0==c%l&&(q=a("<tr></tr>").appendTo(m));var u=a('<td class="tvcolorpicker-cell"></td>').appendTo(q),u=a('<div class="tvcolorpicker-swatch"></div>').appendTo(u);d&&d.addClass&&u.addClass(d.addClass);if(k){k=
k.toLowerCase();h==k&&u.addClass("active");u.css({backgroundColor:k}).data("color",k);u.bind("click",function(){r.call(g,k)});var t=b.apply(this,e(k));.9<(1-t[1])*t[2]&&u.addClass("low-contrast")}});a(k).addClass("tvcolorpicker-table");return n?k:a()}function v(b,c,d){var e=a(b).offset();a(document).scrollLeft();var g=a(document).scrollTop(),h=a(b).outerWidth(),k=a(b).outerHeight();b=a(window).width();var l=a(window).height(),m=a(c).outerWidth(),q=a(c).outerHeight();switch(d.direction){default:case "down":d=
{top:e.top+k+d.offset,left:e.left+d.drift};break;case "right":d={top:e.top+d.drift,left:e.left+h+d.offset}}d.top+q>l+g&&(d.top=l-q+g);e.left+m>b&&(d.left=b-m);d.left+="px";d.top+="px";c.css(d)}function B(d){function h(a){var b=a.originalEvent,d=a.offsetX||a.layerX||b&&(b.offsetX||b.layerX)||0;a=a.offsetY||a.layerY||b&&(b.offsetY||b.layerY)||0;S.css({left:d+"px",top:a+"px"});Y[0]=d/V;Y[1]=1-a/Q;M.css({backgroundColor:g(c(Y[0],Y[1],1))});r()}function k(b){1==b.which&&(W=!1,D.is(".opened")&&a(n).get(0).focus(),
a(document).unbind("mouseup",k))}function l(a){var b=a.originalEvent;a=a.offsetY||a.layerY||b&&(b.offsetY||b.layerY)||0;U.css({top:a+"px"});Y[2]=1-a/Q;r()}function q(b){1==b.which&&(X=!1,a(document).unbind("mouseup",q),D.is(".opened")&&a(n).get(0).focus())}function r(){Z&&(Z=!1,D.find(".tvcolorpicker-swatch.active").removeClass("active"));var a=g(c(Y[0],Y[1],Y[2]));n.val().toUpperCase()!=a.toUpperCase()&&(n.data("tvcolorpicker-custom-color",a),u.call(n,a))}var n=a(this),D=a('<div class="tvcolorpicker-popup opened">'),
w=a('<div class="tvcolorpicker-swatches-area"></div>').appendTo(D);w.append(A.call(this,"#000000 #424242 #656565 #989898 #b6b6b6 #cbcbcb #d8d8d8 #eeeeee #f2f2f2 #ffffff".split(" ")));w.append(A.call(this,"#970000 #ff0000 #ff9800 #ffff00 #00ff00 #00ffff #4985e7 #0000ff #9800ff #ff00ff".split(" ")));w.append(A.call(this,"#e6b8af #f4cccc #fce5cd #fff2cc #d9ead3 #d0e0e3 #c9daf8 #cfe2f3 #d9d2e9 #ead1dc #dd7e6b #ea9999 #f9cb9c #ffe599 #b6d7a8 #a2c4c9 #a4c2f4 #9fc5e8 #b4a7d6 #d5a6bd #cc4125 #e06666 #f6b26b #ffd966 #93c47d #76a5af #6d9eeb #6fa8dc #8e7cc3 #c27ba0 #a61c00 #cc0000 #e69138 #f1c232 #6aa84f #45818e #3c78d8 #3d85c6 #674ea7 #a64d79 #85200c #990000 #b45f06 #bf9000 #38761d #134f5c #1155cc #0b5394 #351c75 #741b47 #5b0f00 #660000 #783f04 #7f6000 #274e13 #0c343d #1c4587 #073763 #20124d #4c1130".split(" ")));
var C=a('<div class="tvcolorpicker-custom-area"></div>').css({display:"none"}).appendTo(D),B=a('<div class="tvcolorpicker-hsv"></div>').appendTo(C),t=a('<div class="tvcolorpicker-hs"></div>').appendTo(B),S=a('<div class="tvcolorpicker-hs-handle"></div>').appendTo(t),N=a('<div class="tvcolorpicker-hs-area"></div>').appendTo(t),M=a('<div class="tvcolorpicker-v"></div>').appendTo(B),U=a('<div class="tvcolorpicker-v-handle"></div>').appendTo(M),B=a('<div class="tvcolorpicker-v-area"></div>').appendTo(M),
Q=t.height(),V=t.width(),W=!1,X=!1,Z=!0,Y=[0,0,.5];N.bind("mousedown",function(b){1==b.which&&(W=!0,a(document).bind("mouseup",k),h(b),b.preventDefault())});N.bind("mousemove",function(a){W&&(h(a),a.preventDefault())});B.bind("mousedown",function(b){1==b.which&&(X=!0,a(document).bind("mouseup",q),l(b),b.preventDefault())});B.bind("mousemove",function(a){X&&(l(a),a.preventDefault())});a('<a class="tvcolorpicker-custom-button tv-button">'+a.t("Custom color...")+"</a>").appendTo(D).bind("click",function(){var d=
a(this).is(".active");d||C.css({minWidth:w.width()+"px",minHeight:w.height()+"px"});a(this)[d?"removeClass":"addClass"]("active");C.css({display:d?"none":"block"});w.css({display:d?"block":"none"});d?n.removeData("tvcolorpicker-custom-color"):(Q=t.height(),V=t.width(),d=e(n.val()),Y=b.apply(this,d),S.css({left:~~(Y[0]*V)+"px",top:~~((1-Y[1])*Q)+"px"}),U.css({top:~~((1-Y[2])*Q)+"px"}),M.css({backgroundColor:g(c(Y[0],Y[1],1))}))});D.append(a(A.call(this,m,{addClass:"tvcolorpicker-user"})).addClass("tvcolorpicker-user-swatches"));
a(document.body).append(D);v(n,D,d);return D}function D(){a(".tvcolorpicker-popup").removeClass("opened").remove();a(C).data("tvcolorpicker",null);a(C).each(function(){var b=a(this).data("tvcolorpicker-custom-color");b&&(q(b)&&a(this).trigger("customcolorchange",[m]),a(this).data("tvcolorpicker-custom-color",null));(b=a(this).data("tvcolorpicker-previous-color"))&&b!=a(this).val()&&a(this).trigger("change");a(this).removeData("tvcolorpicker-previous-color")})}n=a.extend({},k.options,n||{});var C=
this;n&&"customColors"in n&&h(n.customColors);return this.each(function(){function b(){var a=d(c.val());w.call(c,a)}var c=a(this);c.val(d(c.val()));var e=null,g=!1;c.addClass("tvcolorpicker-widget").attr("autocomplete","off").attr("readonly",!0);var h=function(){c.data("tvcolorpicker")||(e=B.call(c,n),c.data("tvcolorpicker-custom-color",null),c.data("tvcolorpicker",e),c.data("tvcolorpicker-previous-color",c.val()),e.bind("mousedown click",function(b){a(b.target).parents().andSelf().is(e)&&(c.focus(),
g=!0,setTimeout(function(){g=!1},0))}))};c.on("touchstart",h);c.focus(h);c.blur(function(a){g?a.stopPropagation():D.call(c)});c.change(function(a){b()});b()})}if(!a)throw Error("This program cannot be run in DOS mode");k.setCustomColors=h;a.fn.tvcolorpicker=k;var l=10,m=[];k.options={direction:"down",offset:0,drift:0}})(window.jQuery);var Mustache="undefined"!==typeof module&&module.exports||{};
(function(a){function b(a){return String(a).replace(/&(?!\w+;)|[<>"']/g,function(a){return C[a]||a})}function c(a,b,c,d){d=d||"<template>";for(var e=b.split("\n"),g=Math.max(c-3,0),h=Math.min(e.length,c+3),e=e.slice(g,h),k=0,l=e.length;k<l;++k)h=k+g+1,e[k]=(h===c?" >> ":" ")+e[k];a.template=b;a.line=c;a.file=d;a.message=[d+":"+c,e.join("\n"),"",a.message].join("\n");return a}function d(a,b,c){if("."===a)return b[b.length-1];a=a.split(".");for(var d=a.length-1,e=a[d],g,h,k=b.length,l,m;k;){m=b.slice(0);
h=b[--k];for(l=0;l<d;){h=h[a[l++]];if(null==h)break;m.push(h)}if(h&&e in h){g=h[e];break}}"function"===typeof g&&(g=g.call(m[m.length-1]));return null==g?c:g}function e(a,b,c,e){var g="";a=d(a,b);if(e){if(null==a||!1===a||u(a)&&0===a.length)g+=c()}else if(u(a))w(a,function(a){b.push(a);g+=c();b.pop()});else if("object"===typeof a)b.push(a),g+=c(),b.pop();else if("function"===typeof a)var h=b[b.length-1],g=g+(a.call(h,c(),function(a){return l(a,h)})||"");else a&&(g+=c());return g}function g(b,d){d=
d||{};for(var e=d.tags||a.tags,g=e[0],h=e[e.length-1],k=['var buffer = "";',"\nvar line = 1;","\ntry {",'\nbuffer += "'],l=[],m=!1,q=!1,r=function(){if(!m||q||d.space)l=[];else for(;l.length;)k.splice(l.pop(),1);q=m=!1},n=[],u,D,w,z=function(a){e=v(a).split(/\s+/);D=e[0];w=e[e.length-1]},C=function(a){k.push('";',u,'\nvar partial = partials["'+v(a)+'"];',"\nif (partial) {","\n buffer += render(partial,stack[stack.length - 1],partials);","\n}",'\nbuffer += "')},B=function(a,e){var g=v(a);if(""===
g)throw c(Error("Section name may not be empty"),b,ea,d.file);n.push({name:g,inverted:e});k.push('";',u,'\nvar name = "'+g+'";',"\nvar callback = (function () {","\n return function () {",'\n var buffer = "";','\nbuffer += "')},W=function(a){B(a,!0)},X=function(a){a=v(a);var e=0!=n.length&&n[n.length-1].name;if(!e||a!=e)throw c(Error('Section named "'+a+'" was never opened'),b,ea,d.file);a=n.pop();k.push('";',"\n return buffer;","\n };","\n})();");a.inverted?k.push("\nbuffer += renderSection(name,stack,callback,true);"):
k.push("\nbuffer += renderSection(name,stack,callback);");k.push('\nbuffer += "')},Z=function(a){k.push('";',u,'\nbuffer += lookup("'+v(a)+'",stack,"");','\nbuffer += "')},Y=function(a){k.push('";',u,'\nbuffer += escapeHTML(lookup("'+v(a)+'",stack,""));','\nbuffer += "')},ea=1,aa,K,T=0,qa=b.length;T<qa;++T)if(b.slice(T,T+g.length)===g){T+=g.length;aa=b.substr(T,1);u="\nline = "+ea+";";D=g;w=h;m=!0;switch(aa){case "!":T++;K=null;break;case "=":T++;h="="+h;K=z;break;case ">":T++;K=C;break;case "#":T++;
K=B;break;case "^":T++;K=W;break;case "/":T++;K=X;break;case "{":h="}"+h;case "&":T++;q=!0;K=Z;break;default:q=!0,K=Y}aa=b.indexOf(h,T);if(-1===aa)throw c(Error('Tag "'+g+'" was not closed properly'),b,ea,d.file);g=b.substring(T,aa);K&&K(g);for(K=0;~(K=g.indexOf("\n",K));)ea++,K++;T=aa+h.length-1;g=D;h=w}else switch(aa=b.substr(T,1),aa){case '"':case "\\":q=!0;k.push("\\"+aa);break;case "\r":break;case "\n":l.push(k.length);k.push("\\n");r();ea++;break;default:A.test(aa)?l.push(k.length):q=!0,k.push(aa)}if(0!=
n.length)throw c(Error('Section "'+n[n.length-1].name+'" was not closed properly'),b,ea,d.file);r();k.push('";',"\nreturn buffer;","\n} catch (e) { throw {error: e, line: line}; }");h=k.join("").replace(/buffer \+= "";\n/g,"");d.debug&&("undefined"!=typeof console&&console.log?console.log(h):"function"===typeof print&&print(h));return h}function h(a,h){var k=g(a,h),m=new Function("view,partials,stack,lookup,escapeHTML,renderSection,render",k);return function(g,k){k=k||{};var q=[g];try{return m(g,
k,q,d,b,e,l)}catch(n){throw c(n.error,a,n.line,h.file);}}}function k(a,b){b=b||{};return!1!==b.cache?(z[a]||(z[a]=h(a,b)),z[a]):h(a,b)}function l(a,b,c){return k(a)(b,c)}a.name="mustache.js";a.version="0.5.0-dev";a.tags=["{{","}}"];a.parse=g;a.compile=k;a.render=l;a.clearCache=function(){z={}};a.to_html=function(a,b,c,d){a=l(a,b,c);if("function"===typeof d)d(a);else return a};var m=Object.prototype.toString,n=Array.isArray,q=Array.prototype.forEach,r=String.prototype.trim,u;u=n?n:function(a){return"[object Array]"===
m.call(a)};var w;w=q?function(a,b,c){return q.call(a,b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;++d)b.call(c,a[d],d,a)};var A=/^\s*$/,v;if(r)v=function(a){return null==a?"":r.call(a)};else{var B,D;A.test("\u00a0")?(B=/^\s+/,D=/\s+$/):(B=/^[\s\xA0]+/,D=/[\s\xA0]+$/);v=function(a){return null==a?"":String(a).replace(B,"").replace(D,"")}}var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},z={}})(Mustache);Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)});Array.prototype.forEach||(Array.prototype.forEach=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!==typeof a)throw new TypeError;for(var d=2<=arguments.length?arguments[1]:void 0,e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)});
Array.prototype.map||(Array.prototype.map=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!==typeof a)throw new TypeError;for(var d=Array(c),e=2<=arguments.length?arguments[1]:void 0,g=0;g<c;g++)g in b&&(d[g]=a.call(e,b[g],g,b));return d});Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),d=c.length;return function(e){if("object"!==typeof e&&"function"!==typeof e||null===e)throw new TypeError("Object.keys called on non-object");var g=[],h;for(h in e)a.call(e,h)&&g.push(h);if(b)for(h=0;h<d;h++)a.call(e,c[h])&&g.push(c[h]);return g}}());(function(a){var b=["","webkit","moz","o","ms"],c=0;(function(c,e){var g;a:{var h;for(g in b){h=b[g];var k;k=c;k=k[0].toUpperCase()+k.slice(1);h+=k;h=h[0].toLowerCase()+h.slice(1);if(a[h]){g=h;break a}}g=!1}a[c]=g?a[g]:e})("requestAnimationFrame",function(a){setTimeout(a,16);return c++})})(this);(function(){var a,b,c,d,e,g;window.parent!==window&&window.CanvasRenderingContext2D&&window.TextMetrics&&(b=window.CanvasRenderingContext2D.prototype)&&b.hasOwnProperty("font")&&b.hasOwnProperty("mozTextStyle")&&"function"===typeof b.__lookupSetter__&&(c=b.__lookupSetter__("font"))&&(b.__defineSetter__("font",function(a){try{return c.call(this,a)}catch(b){if("NS_ERROR_FAILURE"!==b.name)throw b;}}),d=b.measureText,a=function(){this.width=0;this.isFake=!0;this.__proto__=window.TextMetrics.prototype},
b.measureText=function(b){try{return d.apply(this,arguments)}catch(c){if("NS_ERROR_FAILURE"!==c.name)throw c;return new a}},e=b.fillText,b.fillText=function(a,b,c,d){try{e.apply(this,arguments)}catch(g){if("NS_ERROR_FAILURE"!==g.name)throw g;}},g=b.strokeText,b.strokeText=function(a,b,c,d){try{g.apply(this,arguments)}catch(e){if("NS_ERROR_FAILURE"!==e.name)throw e;}})})();eval(function(a,b,c,d,e,g){e=function(a){return(a<b?"":e(parseInt(a/b)))+(35<(a%=b)?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){for(;c--;)g[e(c)]=d[c]||e(c);d=[function(a){return g[a]}];e=function(){return"\\w+"};c=1}for(;c--;)d[c]&&(a=a.replace(new RegExp("\\b"+e(c)+"\\b","g"),d[c]));return a}("h.i['1a']=h.i['z'];h.O(h.i,{y:'D',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});",
62,74," return Math function if var PI jQuery easing pow 75 70158 else sin sqrt 5625 asin undefined easeOutBounce abs def swing easeInBounce 525 cos easeOutQuad easeOutBack easeInBack easeInSine easeOutElastic easeInOutQuint easeOutQuint easeInQuint easeInOutQuart easeOutQuart easeInQuart extend easeInElastic easeInOutCirc easeInOutCubic easeOutCirc easeInOutElastic easeOutCubic easeInCirc easeInOutExpo easeInCubic easeOutExpo easeInExpo 9375 easeInOutSine easeInOutQuad 25 easeOutSine easeInOutBack easeInQuad 625 984375 jswing easeInOutBounce".split(" "),
0,{}));(function(a){var b=a(window),c=a(document),d=function(d){d=jQuery.data(d.target);b.scrollTop()>c.height()-b.innerHeight()-(d.tolerance||190)&&a(this).trigger("scrolltoend")};a.event.special.scrolltoend={setup:function(b,c){a(this).bind("scroll.scrolltoend",d)},teardown:function(b){a(this).unbind("scroll.scrolltoend",d)}};jQuery.event.special.scrollto={bindType:"scroll",handle:function(a){var d=a.handleObj;a.scrollData||(a.scrollData={scrollTop:b.scrollTop()});var h=null;if("number"===typeof a.data.to)h=
a.scrollData.scrollTop>a.data.to-(a.data.tolerance||0)?!0:!1;else if("bottom"===a.data.to)a.scrollData.bottomOffset||(a.scrollData.bottomOffset=c.height()-b.innerHeight()),h=a.scrollData.scrollTop>a.scrollData.bottomOffset-(a.data.tolerance||0)?!0:!1;else throw Error('Special event scrollto: property "to" has unexpected value');var k=Array.prototype.slice.apply(arguments);if(h)return k.push(!0),d.handler.apply(this,k);if(a.data.twoway)return k.push(!1),d.handler.apply(this,k)}}})(jQuery);jQuery.fn.timeUpdate=function(){return this.each(function(){var a=jQuery(this).data("timestamp"),a=a?1E3*a:1E3*jQuery(this).text();TradingView.agoDateFormatter(jQuery(this),new Date(a));jQuery(this).removeClass("time-upd")})};(function(a){function b(a,b,c){for(var d=0;d<n.length;d++)n[d]||(b=b.toLowerCase()),a.addEventListener(n[d]+b,c,!1)}function c(a){a.stop(!0);a.css("background-color","");a.removeData("flicker-enable");a.removeData("flicker-options")}function d(b){var d=b.data("flicker-enable");d&&(!0!==d?(d--,d?(e(b),b.data("flicker-enable",d)):(d=b.data("flicker-options").complete,c(b),d&&a.isFunction(d)&&d())):e(b))}function e(a){var b=a.css("background-color"),c=a.data("flicker-options"),e=c.duration||400,g=c.easing||
"swing";a.animate({"background-color":c.highlightColor||"#fbf8e9"},e,g).animate({"background-color":b},e,g,d.bind(a,a))}var g=!1,h=document.body||document.documentElement,k="animation",l=["Webkit","Moz","O","ms","Khtml"],m="";void 0!==h.style.animationName&&(g=!0);if(!1===g)for(m=0;m<l.length;m++)if(void 0!==h.style[l[m]+"AnimationName"]){m=l[m];k=m+"Animation";m.toLowerCase();g=!0;break}var n=["webkit","moz","MS","o",""];a.fn.highlight=function(d,h){switch(d){default:d=void 0===d?!0:d;this.each(function(){if(g)d=
!0===d?"infinite":d,b(this,"AnimationEnd",function(){this.style[k]=""}),this.style[k]="highlight-animation 0.4s ease-in-out "+d+" alternate";else{var c=a(this);c.data("flicker-enable",d);c.data("flicker-options",a.extend({},h||{}));c.is(":animated")||e(c)}});break;case !1:this.each(function(){g?this.style[k]="":c(a(this))})}}})(jQuery);(function(a){var b,c;"undefined"!==typeof document.hidden?(b="hidden",c="visibilitychange"):"undefined"!==typeof document.mozHidden?(b="mozHidden",c="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(b="msHidden",c="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(b="webkitHidden",c="webkitvisibilitychange");a.tabvisible=!0;c&&(a(document).on(c,function(c){a.tabvisible=!document[b];a(window).trigger("visibilitychange",!document[b])}),a(document).trigger(c));a.whenTabVisible=
function(b){if(!c||a.tabvisible)b();else a(window).one("visibilitychange",b)}})(jQuery);!function(a){function b(e,g,h,k,l){var m=e.contents(),q=!1;e.empty();for(var n=0,r=m.length;r>n&&!q;n++){var G=m[n],J=a(G);"undefined"!=typeof G&&(e.append(J),l&&e[e.is("table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style")?"after":"append"](l),3==G.nodeType?d(h,k)&&(q=c(J,g,h,k,l)):q=b(J,g,h,k,l),q||l&&l.detach())}return q}function c(a,b,g,l,m){var q=!1,n=a[0];if("undefined"==typeof n)return!1;for(var r=k(n),
F=-1!==r.indexOf(" ")?" ":"\u3000",F="letter"==l.wrap?"":F,r=r.split(F),G=-1,J=-1,E=0,I=r.length-1;I>=E;){var L=Math.floor((E+I)/2);if(L==J)break;J=L;h(n,r.slice(0,J+1).join(F)+l.ellipsis);d(g,l)?I=J:(G=J,E=J);I==E&&0==I&&l.fallbackToLetter&&(F="",r=r[0].split(F),G=-1,J=-1,E=0,I=r.length-1)}-1==G||1==r.length&&0==r[0].length?(F=a.parent(),a.remove(),n=m?m.length:0,F.contents().size()>n?(q=F.contents().eq(-1-n),q=c(q,b,g,l,m)):(b=F.prev(),n=b.contents().eq(-1)[0],"undefined"!=typeof n&&(r=e(k(n),l),
h(n,r),m&&b.append(m),F.remove(),q=!0))):(r=e(r.slice(0,G+1).join(F),l),q=!0,h(n,r));return q}function d(a,b){return a.innerHeight()>b.maxHeight}function e(b,c){for(;-1<a.inArray(b.slice(-1),c.lastCharacter.remove);)b=b.slice(0,-1);return 0>a.inArray(b.slice(-1),c.lastCharacter.noEllipsis)&&(b+=c.ellipsis),b}function g(a){return{width:a.innerWidth(),height:a.innerHeight()}}function h(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function k(a){return a.innerText?
a.innerText:a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function l(b,c){return"undefined"==typeof b?!1:b?"string"==typeof b?(b=a(b,c),b.length?b:!1):"object"==typeof b?"undefined"==typeof b.jquery?!1:b:!1:!1}function m(a,b){return a?(b="string"==typeof b?"dotdotdot: "+b:["dotdotdot:",b],"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&window.console.log(b),!1):!1}if(!a.fn.dotdotdot){a.fn.dotdotdot=function(c){if(0==this.length)return c&&!1===c.debug||m(!0,'No element found for "'+
this.selector+'".'),this;if(1<this.length)return this.each(function(){a(this).dotdotdot(c)});var e=this;e.data("dotdotdot")&&e.trigger("destroy.dot");e.data("dotdotdot-style",e.attr("style"));e.css("word-wrap","break-word");e.bind_events=function(){return e.bind("update.dot",function(c,g){c.preventDefault();c.stopPropagation();var l=k,m;if("number"==typeof k.height)m=k.height;else{m=e.innerHeight();for(var n=["paddingTop","paddingBottom"],r=0,u=n.length;u>r;r++){var D=parseInt(e.css(n[r]),10);isNaN(D)&&
(D=0);m-=D}}l.maxHeight=m;k.maxHeight+=k.tolerance;"undefined"!=typeof g&&(("string"==typeof g||g instanceof HTMLElement)&&(g=a("<div />").append(g).contents()),g instanceof a&&(h=g));z=e.wrapInner('<div class="dotdotdot" />').children();z.empty().append(h.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});l=n=!1;q.afterElement&&(n=q.afterElement.clone(!0),q.afterElement.remove());if(d(z,k))if("children"==k.wrap){l=z;m=k;r=l.children();u=!1;l.empty();for(var D=0,C=r.length;C>
D;D++){var O=r.eq(D);if(l.append(O),n&&l.append(n),d(l,m)){O.remove();u=!0;break}n&&n.detach()}l=u}else l=b(z,e,z,k,n);return z.replaceWith(z.contents()),z=null,a.isFunction(k.callback)&&k.callback.call(e[0],l,h),q.isTruncated=l,l}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(e[0],q.isTruncated),q.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(e[0],
h),h}).bind("destroy.dot",function(a){a.preventDefault();a.stopPropagation();e.unwatch().unbind_events().empty().append(h).attr("style",e.data("dotdotdot-style")).data("dotdotdot",!1)}),e};e.unbind_events=function(){return e.unbind(".dot"),e};e.watch=function(){if(e.unwatch(),"window"==k.watch){var b=a(window),c=b.width(),d=b.height();b.bind("resize.dot"+q.dotId,function(){c==b.width()&&d==b.height()&&k.windowResizeFix||(c=b.width(),d=b.height(),C&&clearInterval(C),C=setTimeout(function(){e.trigger("update.dot")},
10))})}else r=g(e),C=setInterval(function(){var a=g(e);(r.width!=a.width||r.height!=a.height)&&(e.trigger("update.dot"),r=g(e))},100);return e};e.unwatch=function(){return a(window).unbind("resize.dot"+q.dotId),C&&clearInterval(C),e};var h=e.contents(),k=a.extend(!0,{},a.fn.dotdotdot.defaults,c),q={},r={},C=null,z=null;return k.lastCharacter.remove instanceof Array||(k.lastCharacter.remove=a.fn.dotdotdot.defaultArrays.lastCharacter.remove),k.lastCharacter.noEllipsis instanceof Array||(k.lastCharacter.noEllipsis=
a.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),q.afterElement=l(k.after,e),q.isTruncated=!1,q.dotId=n++,e.data("dotdotdot",!0).bind_events().trigger("update.dot"),k.watch&&e.watch(),e};a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,debug:!1};a.fn.dotdotdot.defaultArrays={lastCharacter:{remove:" \u3000,;.!?".split(""),noEllipsis:[]}};var n=1,q=a.fn.html;a.fn.html=function(a){return"undefined"!=
typeof a?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):q.call(this,a):q.call(this)};var r=a.fn.text;a.fn.text=function(b){if("undefined"!=typeof b){if(this.data("dotdotdot")){var c=a("<div />");return c.text(b),b=c.html(),c.remove(),this.trigger("update",[b])}return r.call(this,b)}return r.call(this)}}}(jQuery);(function(a){if(!a.support.cors&&a.ajaxTransport&&window.XDomainRequest){var b=/^https?:\/\//i,c=/^get|post$/i,d=new RegExp("^"+location.protocol,"i"),e=/text\/html/i,g=/\/json/i,h=/\/xml/i;a.ajaxTransport("* text html xml json",function(k,l,m){if(k.crossDomain&&k.async&&c.test(k.type)&&b.test(k.url)&&d.test(k.url)){var n=null,q=(l.dataType||"").toLowerCase();return{send:function(b,c){n=new XDomainRequest;/^\d+$/.test(l.timeout)&&(n.timeout=l.timeout);n.ontimeout=function(){c(500,"timeout")};n.onload=
function(){var b="Content-Length: "+n.responseText.length+"\r\nContent-Type: "+n.contentType,d=200,k="success",l={text:n.responseText};try{if("html"===q||e.test(n.contentType))l.html=n.responseText;else if("json"===q||"text"!==q&&g.test(n.contentType))try{l.json=a.parseJSON(n.responseText)}catch(m){d=500,k="parseerror"}else if("xml"===q||"text"!==q&&h.test(n.contentType)){var r=new ActiveXObject("Microsoft.XMLDOM");r.async=!1;try{r.loadXML(n.responseText)}catch(w){r=void 0}if(!r||!r.documentElement||
r.getElementsByTagName("parsererror").length)throw d=500,k="parseerror","Invalid XML: "+n.responseText;l.xml=r}}catch(G){throw G;}finally{c(d,k,l,b)}};n.onprogress=function(){};n.onerror=function(){c(500,"error",{text:n.responseText})};var d="";l.data&&(d="string"===a.type(l.data)?l.data:a.param(l.data));n.open(k.type,k.url);n.send(d)},abort:function(){n&&n.abort()}}}})}})(jQuery);(function(a){a.fn.inputselectable=function(b){var c=a(this);b=a.extend({},b);if(!c.is('input[type="text"]'))throw Error(c+' should be input[type="text"]');if(b.list&&b.list.length&&!c.hasClass("ISinput")){c.addClass("ISinput");var d=a('<div class="ISwraper"></div>'),e=a('<div class="IStoggle"></div>'),g=function(d,g,l){function m(d,g){g||(g=n);g.remove();c.off("click");b.closeHandle instanceof a&&b.closeHandle.off("click");e.removeClass("active");c.focus()}d.stopPropagation();if(e.is(":active")||
e.is(".active"))if(m(null,a(".ISdropdown")),l)return;if(g&&g.length){d='<ul class="ISdropdown">';for(l=0;l<g.length;l++)d+='<li><div><span class="IStext">'+g[l]+"</span></div></li>";var n=a(d+"</ul>");n.find("li").each(function(){a(this).click(function(){c.val(a(this).find(".IStext").text());m()})});c.on("click","",m);if(b.closeHandle instanceof a)b.closeHandle.on("click","",m);n.insertAfter(c);n.css({top:c.outerHeight(),width:c.outerWidth(),"max-height":a(window).height()-n.offset().top-35});e.toggleClass("active")}};
c.wrap(d);"static"==c.css("position")?d.css("position","relative"):d.css({top:c.css("top"),left:c.css("left"),position:c.css("position")});d.css({width:c.outerHeight(),height:c.outerWidth()});e.insertAfter(c);e.click(function(a){g(a,b.list,!0)});c.keyup(function(d){var e=new RegExp(c.val(),"i"),l=a.grep(b.list,function(a){return e.test(a)});g(d,l)});return c.focus()}}})(jQuery);(function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){return function(c){return m(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function g(a){D(a);k(this,a)}function h(a){a=w(a);var b=a.year||0,c=a.month||0,d=a.week||0,e=a.day||0;this._milliseconds=+(a.millisecond||0)+1E3*(a.second||0)+6E4*(a.minute||
0)+36E5*(a.hour||0);this._days=+e+7*d;this._months=+c+12*b;this._data={};this._bubble()}function k(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function l(a){return 0>a?Math.ceil(a):Math.floor(a)}function m(a,b,c){for(var d=""+Math.abs(a);d.length<b;)d="0"+d;return(0<=a?c?"+":"":"-")+d}function n(a,b,c,d){var e,g,h=b._milliseconds,k=b._days;b=b._months;h&&a._d.setTime(+a._d+h*
c);(k||b)&&(e=a.minute(),g=a.hour());k&&a.date(a.date()+k*c);b&&a.month(a.month()+b*c);h&&!d&&K.updateOffset(a);(k||b)&&(a.minute(e),a.hour(g))}function q(a){return"[object Array]"===Object.prototype.toString.call(a)}function r(a,b,c){var d,e=Math.min(a.length,b.length),g=Math.abs(a.length-b.length),h=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&v(a[d])!==v(b[d]))&&h++;return h+g}function u(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=hb[a]||ib[b]||b}return a}function w(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&
(b=u(c),b&&(d[b]=a[c]));return d}function A(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12;d="month"}K[b]=function(e,g){var h,k,l=K.fn._lang[b],m=[];if("number"==typeof e&&(g=e,e=a),k=function(a){a=K().utc().set(d,a);return l.call(K.fn._lang,a,e||"")},null!=g)return k(g);for(h=0;c>h;h++)m.push(k(h));return m}}function v(a){a=+a;var b=0;return 0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a)),b}function B(a){return 0===a%4&&0!==a%100||0===a%400}function D(a){var b;
a._a&&-2===a._pf.overflow&&(b=0>a._a[la]||11<a._a[la]?la:1>a._a[ja]||a._a[ja]>(new Date(Date.UTC(a._a[fa],a._a[la]+1,0))).getUTCDate()?ja:0>a._a[ca]||23<a._a[ca]?ca:0>a._a[ma]||59<a._a[ma]?ma:0>a._a[sa]||59<a._a[sa]?sa:0>a._a[ta]||999<a._a[ta]?ta:-1,a._pf._overflowDayOfYear&&(fa>b||b>ja)&&(b=ja),a._pf.overflow=b)}function C(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,
a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function z(a){return a?a.toLowerCase().replace("_","-"):a}function F(a,b){return b._isUTC?K(a).zone(b._offset||0):K(a).local()}function G(a){var b,c,d,e,g=0,h=function(a){if(!na[a]&&Pa)try{require("./lang/"+a)}catch(b){}return na[a]};if(!a)return K.fn._lang;if(!q(a)){if(c=h(a))return c;a=[a]}for(;g<a.length;){e=z(a[g]).split("-");b=e.length;for(d=(d=z(a[g+1]))?d.split("-"):null;0<b;){if(c=h(e.slice(0,
b).join("-")))return c;if(d&&d.length>=b&&r(e,d,!0)>=b-1)break;b--}g++}return K.fn._lang}function J(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function E(a){var b,c,d=a.match(Aa);b=0;for(c=d.length;c>b;b++)d[b]=ga[d[b]]?ga[d[b]]:J(d[b]);return function(e){var g="";for(b=0;c>b;b++)g+=d[b]instanceof Function?d[b].call(e,a):d[b];return g}}function I(a,b){return a.isValid()?(b=L(b,a.lang()),ha[b]||(ha[b]=E(b)),ha[b](a)):a.lang().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||
a}var d=5;for(xa.lastIndex=0;0<=d&&xa.test(a);)a=a.replace(xa,c),xa.lastIndex=0,--d;return a}function P(a,b){var c=b._strict;switch(a){case "DDDD":return Ea;case "YYYY":case "GGGG":case "gggg":return c?fb:Ba;case "Y":case "G":case "g":return Fa;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?ba:Qa;case "S":if(c)return Sa;case "SS":if(c)return Da;case "SSS":if(c)return Ea;case "DDD":return bb;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return cb;case "a":case "A":return G(b._l)._meridiemParse;
case "X":return eb;case "Z":case "ZZ":return Ca;case "T":return db;case "SSSS":return Ra;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?Da:za;case "M":case "D":case "d":case "H":case "h":case "m":case "s":case "w":case "W":case "e":case "E":return za;default:var c=RegExp,d;d=S(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new c(d)}}function H(a){a=(a||"").match(Ca)||[];a=((a[a.length-1]||[])+"").match(gb)||
["-",0,0];var b=+(60*a[1])+v(a[2]);return"+"===a[0]?-b:b}function R(a){var b,c,d,e,g,h,k,l,m,q=[];if(!a._d){c=O(a);a._w&&null==a._a[ja]&&null==a._a[la]&&(e=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[fa]?K().weekYear():a._a[fa]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=W(e(g.GG),g.W||1,g.E,4,1):(k=G(a._l),l=null!=g.d?U(g.d,k):null!=g.e?parseInt(g.e,10)+k._week.dow:0,m=parseInt(g.w,10)||1,null!=g.d&&l<k._week.dow&&m++,h=W(e(g.gg),m,l,k._week.doy,k._week.dow)),
a._a[fa]=h.year,a._dayOfYear=h.dayOfYear);a._dayOfYear&&(d=null==a._a[fa]?c[fa]:a._a[fa],a._dayOfYear>(B(d)?366:365)&&(a._pf._overflowDayOfYear=!0),b=M(d,0,a._dayOfYear),a._a[la]=b.getUTCMonth(),a._a[ja]=b.getUTCDate());for(b=0;3>b&&null==a._a[b];++b)a._a[b]=q[b]=c[b];for(;7>b;b++)a._a[b]=q[b]=null==a._a[b]?2===b?1:0:a._a[b];q[ca]+=v((a._tzm||0)/60);q[ma]+=v((a._tzm||0)%60);a._d=(a._useUTC?M:N).apply(null,q)}}function O(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:
[b.getFullYear(),b.getMonth(),b.getDate()]}function t(a){a._a=[];a._pf.empty=!0;var b,c,d,e,g;b=G(a._l);var h=""+a._i,k=h.length,l=0;d=L(a._f,b).match(Aa)||[];for(b=0;b<d.length;b++)if(e=d[b],(c=(h.match(P(e,a))||[])[0])&&(g=h.substr(0,h.indexOf(c)),0<g.length&&a._pf.unusedInput.push(g),h=h.slice(h.indexOf(c)+c.length),l+=c.length),ga[e]){c?a._pf.empty=!1:a._pf.unusedTokens.push(e);var m=a,q=void 0,n=m._a;switch(e){case "M":case "MM":null!=c&&(n[la]=v(c)-1);break;case "MMM":case "MMMM":q=G(m._l).monthsParse(c);
null!=q?n[la]=q:m._pf.invalidMonth=c;break;case "D":case "DD":null!=c&&(n[ja]=v(c));break;case "DDD":case "DDDD":null!=c&&(m._dayOfYear=v(c));break;case "YY":n[fa]=v(c)+(68<v(c)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":n[fa]=v(c);break;case "a":case "A":m._isPm=G(m._l).isPM(c);break;case "H":case "HH":case "h":case "hh":n[ca]=v(c);break;case "m":case "mm":n[ma]=v(c);break;case "s":case "ss":n[sa]=v(c);break;case "S":case "SS":case "SSS":case "SSSS":n[ta]=v(1E3*("0."+c));break;case "X":m._d=
new Date(1E3*parseFloat(c));break;case "Z":case "ZZ":m._useUTC=!0;m._tzm=H(c);break;case "w":case "ww":case "W":case "WW":case "d":case "dd":case "ddd":case "dddd":case "e":case "E":e=e.substr(0,1);case "gg":case "gggg":case "GG":case "GGGG":case "GGGGG":e=e.substr(0,2),c&&(m._w=m._w||{},m._w[e]=c)}}else a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=k-l;0<h.length&&a._pf.unusedInput.push(h);a._isPm&&12>a._a[ca]&&(a._a[ca]+=12);!1===a._isPm&&12===a._a[ca]&&(a._a[ca]=0);R(a);D(a)}function S(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
function(a,b,c,d,e){return b||c||d||e})}function N(a,b,c,d,e,g,h){b=new Date(a,b,c,d,e,g,h);return 1970>a&&b.setFullYear(a),b}function M(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function U(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function Q(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function V(a,b,c){var d;b=c-b;c-=a.day();return c>b&&(c-=7),b-7>c&&(c+=7),d=K(a).add("d",
c),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function W(a,b,c,d,e){var g,h,k=M(a,0,1).getUTCDay();return c=null!=c?c:e,g=e-k+(k>d?7:0)-(e>k?7:0),h=7*(b-1)+(c-e)+g+1,{year:0<h?a:a-1,dayOfYear:0<h?h:(B(a-1)?366:365)+h}}function X(c){var d=c._i,e=c._f;if(null===d)c=K.invalid({nullInput:!0});else{"string"==typeof d&&(c._i=d=G().preparse(d));if(K.isMoment(d)){c=d;var h,l={};for(h in c)c.hasOwnProperty(h)&&Za.hasOwnProperty(h)&&(l[h]=c[h]);c=l;c._d=new Date(+d._d)}else if(e)if(q(e)){var m=c,n,r;if(0===
m._f.length)m._pf.invalidFormat=!0,m._d=new Date(0/0);else{for(d=0;d<m._f.length;d++)h=0,l=k({},m),l._pf=b(),l._f=m._f[d],t(l),C(l)&&(h+=l._pf.charsLeftOver,h+=10*l._pf.unusedTokens.length,l._pf.score=h,(null==r||r>h)&&(r=h,n=l));k(m,n||l)}}else t(c);else if(l=c,n=l._i,r=$a.exec(n),n===a)l._d=new Date;else if(r)l._d=new Date(+r[1]);else if("string"==typeof n)if(m=l._i,d=Ga.exec(m)){l._pf.iso=!0;n=0;for(r=Ha.length;r>n;n++)if(Ha[n][1].exec(m)){l._f=Ha[n][0]+(d[6]||" ");break}n=0;for(r=Ia.length;r>
n;n++)if(Ia[n][1].exec(m)){l._f+=Ia[n][0];break}m.match(Ca)&&(l._f+="Z");t(l)}else l._d=new Date(m);else q(n)?(l._a=n.slice(0),R(l)):"[object Date]"===Object.prototype.toString.call(n)||n instanceof Date?l._d=new Date(+n):"object"==typeof n?l._d||(m=w(l._i),l._a=[m.year,m.month,m.day,m.hour,m.minute,m.second,m.millisecond],R(l)):l._d=new Date(n);c=new g(c)}return c}function Z(a,b){K.fn[a]=K.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),K.updateOffset(this),
this):this._d["get"+c+b]()}}function Y(a){K.duration.fn[a]=function(){return this._data[a]}}function ea(a,b){K.duration.fn["as"+a]=function(){return+this/b}}function aa(a){var b=!1,c=K;"undefined"==typeof ender&&(a?(qa.moment=function(){return!b&&console&&console.warn&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.")),c.apply(null,arguments)},k(qa.moment,c)):qa.moment=K)}for(var K,T,qa=this,ia=Math.round,fa=0,la=1,ja=2,ca=3,
ma=4,sa=5,ta=6,na={},Za={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},Pa="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,$a=/^\/?Date\((\-?\d+)/i,Wa=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ab=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Aa=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,
xa=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,za=/\d\d?/,bb=/\d{1,3}/,Ba=/\d{1,4}/,Qa=/[+\-]?\d{1,6}/,Ra=/\d+/,cb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ca=/Z|[\+\-]\d\d:?\d\d/gi,db=/T/i,eb=/[\+\-]?\d+(\.\d{1,3})?/,Sa=/\d/,Da=/\d\d/,Ea=/\d{3}/,fb=/\d{4}/,ba=/[+-]?\d{6}/,Fa=/[+-]?\d+/,Ga=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
Ha=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Ia=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],gb=/([\+\-]|\d\d)/gi,ra=["Date","Hours","Minutes","Seconds","Milliseconds"],Ja={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},hb={ms:"millisecond",s:"second",
m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},ib={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},ha={},oa="DDD w W M D d".split(" "),Ka="MDHhmswW".split(""),ga={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},
DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return m(this.year()%100,2)},YYYY:function(){return m(this.year(),4)},YYYYY:function(){return m(this.year(),5)},YYYYYY:function(){var a=this.year();return(0<=a?"+":"-")+m(Math.abs(a),
6)},gg:function(){return m(this.weekYear()%100,2)},gggg:function(){return m(this.weekYear(),4)},ggggg:function(){return m(this.weekYear(),5)},GG:function(){return m(this.isoWeekYear()%100,2)},GGGG:function(){return m(this.isoWeekYear(),4)},GGGGG:function(){return m(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),
!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return v(this.milliseconds()/100)},SS:function(){return m(v(this.milliseconds()/10),2)},SSS:function(){return m(this.milliseconds(),3)},SSSS:function(){return m(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+m(v(a/60),2)+":"+m(v(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,
b="-"),b+m(v(a/60),2)+m(v(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Ta=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];oa.length;)T=oa.pop(),ga[T+"o"]=d(ga[T],T);for(;Ka.length;)T=Ka.pop(),ga[T+T]=c(ga[T],2);ga.DDDD=c(ga.DDD,3);k(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "),
months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;this._monthsParse||(this._monthsParse=[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(c=K.utc([2E3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;this._weekdaysParse||(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(c=K([2E3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,
""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},
_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return 11<a?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",
y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[0<a?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return V(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",
invalidDate:function(){return this._invalidDate}});K=function(c,d,e,g){var h;return"boolean"==typeof e&&(g=e,e=a),h={},h._isAMomentObject=!0,h._i=c,h._f=d,h._l=e,h._strict=g,h._isUTC=!1,h._pf=b(),X(h)};K.utc=function(c,d,e,g){var h;return"boolean"==typeof e&&(g=e,e=a),h={},h._isAMomentObject=!0,h._useUTC=!0,h._isUTC=!0,h._l=e,h._i=c,h._f=d,h._strict=g,h._pf=b(),X(h).utc()};K.unix=function(a){return K(1E3*a)};K.duration=function(a,b){var c,d,e,g=a,k=null;return K.isDuration(a)?g={ms:a._milliseconds,
d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(k=Wa.exec(a))?(c="-"===k[1]?-1:1,g={y:0,d:v(k[ja])*c,h:v(k[ca])*c,m:v(k[ma])*c,s:v(k[sa])*c,ms:v(k[ta])*c}):(k=ab.exec(a))&&(c="-"===k[1]?-1:1,e=function(a){a=a&&parseFloat(a.replace(",","."));return(isNaN(a)?0:a)*c},g={y:e(k[2]),M:e(k[3]),d:e(k[4]),h:e(k[5]),m:e(k[6]),s:e(k[7]),w:e(k[8])}),d=new h(g),K.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d};K.version="2.5.1";K.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
K.updateOffset=function(){};K.lang=function(a,b){var c,d;a?(b?(d=z(a),b.abbr=d,na[d]||(na[d]=new e),na[d].set(b)):null===b?(delete na[a],a="en"):na[a]||G(a),d=(c=K.duration.fn._lang=K.fn._lang=G(a),c._abbr)):d=K.fn._lang._abbr;return d};K.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),G(a)};K.isMoment=function(a){return a instanceof g||null!=a&&a.hasOwnProperty("_isAMomentObject")};K.isDuration=function(a){return a instanceof h};for(T=Ta.length-1;0<=T;--T)A(Ta[T]);K.normalizeUnits=
function(a){return u(a)};K.invalid=function(a){var b=K.utc(0/0);return null!=a?k(b._pf,a):b._pf.userInvalidated=!0,b};K.parseZone=function(a){return K(a).parseZone()};k(K.fn=g.prototype,{clone:function(){return K(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=
K(this).utc();return 0<a.year()&&9999>=a.year()?I(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):I(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return C(this)},isDSTShifted:function(){return this._a?this.isValid()&&0<r(this._a,(this._isUTC?K.utc(this._a):K(this._a)).toArray()):!1},parsingFlags:function(){return k({},this._pf)},invalidAt:function(){return this._pf.overflow},
utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){a=I(this,a||K.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;return c="string"==typeof a?K.duration(+b,a):K.duration(a,b),n(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?K.duration(+b,a):K.duration(a,b),n(this,c,-1),this},diff:function(a,b,c){var d,e;a=F(a,this);var g=6E4*(this.zone()-a.zone());return b=u(b),"year"===b||"month"===b?(d=
432E5*(this.daysInMonth()+a.daysInMonth()),e=12*(this.year()-a.year())+(this.month()-a.month()),e+=(this-K(this).startOf("month")-(a-K(a).startOf("month")))/d,e-=6E4*(this.zone()-K(this).startOf("month").zone()-(a.zone()-K(a).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-a,e="second"===b?d/1E3:"minute"===b?d/6E4:"hour"===b?d/36E5:"day"===b?(d-g)/864E5:"week"===b?(d-g)/6048E5:d),c?e:l(e)},from:function(a,b){return K.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(K(),
a)},calendar:function(){var a=F(K(),this).startOf("day"),a=this.diff(a,"days",!0),a=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,this))},isLeapYear:function(){return B(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=U(a,this.lang()),this.add({d:a-
b})):b},month:function(a){var b,c=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?this:(b=this.date(),this.date(1),this._d["set"+c+"Month"](a),this.date(Math.min(b,this.daysInMonth())),K.updateOffset(this),this):this._d["get"+c+"Month"]()},startOf:function(a){switch(a=u(a)){case "year":this.month(0);case "month":this.date(1);case "week":case "isoWeek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}return"week"===
a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),this},endOf:function(a){return a=u(a),this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+K(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+K(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+F(a,this).startOf(b)},min:function(a){return a=K.apply(null,
arguments),this>a?this:a},max:function(a){return a=K.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=H(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&n(this,K.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==
typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?K(a).zone():0,0===(this.zone()-a)%60},daysInMonth:function(){var a=this.year(),b=this.month();return(new Date(Date.UTC(a,b+1,0))).getUTCDate()},dayOfYear:function(a){var b=ia((K(this).startOf("day")-K(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=V(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==
a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=V(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=V(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){return a=u(a),this[a]()},set:function(a,
b){return a=u(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=G(b),this)}});for(T=0;T<ra.length;T++)Z(ra[T].toLowerCase().replace(/s$/,""),ra[T]);Z("year","FullYear");K.fn.days=K.fn.day;K.fn.months=K.fn.month;K.fn.weeks=K.fn.week;K.fn.isoWeeks=K.fn.isoWeek;K.fn.toJSON=K.fn.toISOString;k(K.duration.fn=h.prototype,{_bubble:function(){var a,b;a=this._milliseconds;b=this._days;var c=this._months,d=this._data;d.milliseconds=a%1E3;a=l(a/1E3);d.seconds=
a%60;a=l(a/60);d.minutes=a%60;a=l(a/60);d.hours=a%24;b+=l(a/24);d.days=b%30;c+=l(b/30);d.months=c%12;b=l(c/12);d.years=b},weeks:function(){return l(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*v(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),e=ia(Math.abs(b)/1E3),g=ia(e/60),h=ia(g/60),k=ia(h/24),l=ia(k/365),e=45>e&&["s",e]||1===g&&["m"]||45>g&&["mm",g]||1===h&&["h"]||22>h&&["hh",h]||1===k&&["d"]||25>=k&&["dd",
k]||45>=k&&["M"]||345>k&&["MM",ia(k/30)]||1===l&&["y"]||["yy",l];c=(e[2]=c,e[3]=0<b,e[4]=d,Q.apply({},e));return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=K.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=K.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=
u(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=u(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:K.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),g=Math.abs(this.seconds()+this.milliseconds()/1E3);return this.asSeconds()?(0>this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||g?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(g?g+"S":""):"P0D"}});for(T in Ja)Ja.hasOwnProperty(T)&&
(ea(T,Ja[T]),Y(T.toLowerCase()));ea("Weeks",6048E5);K.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};K.lang("en",{ordinal:function(a){var b=a%10,b=1===v(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});Pa?(module.exports=K,aa(!0)):"function"==typeof define&&define.amd?define("moment",function(b,c,d){return d.config&&d.config()&&!0!==d.config().noGlobal&&aa(d.config().noGlobal===a),K}):aa()}).call(this);(function(){function a(a){return(10>a?"0":"")+a}function b(a){var b=++w+"";return a?a+b:b}function c(c,e){function l(a,b){var c=u.offset(),d=/^touch/.test(a.type),m=c.left+100,n=c.top+100,v=(d?a.originalEvent.touches[0]:a).pageX-m,D=(d?a.originalEvent.touches[0]:a).pageY-n,c=Math.sqrt(v*v+D*D),w=!1;if(!b||!(67>c||93<c)){a.preventDefault();var C=setTimeout(function(){h.addClass("clockpicker-moving")},200);k&&u.append(L.canvas);L.setHand(v,D,!b,!0);g.off(q).on(q,function(a){a.preventDefault();var b=
/^touch/.test(a.type),c=(b?a.originalEvent.touches[0]:a).pageX-m;a=(b?a.originalEvent.touches[0]:a).pageY-n;if(w||c!==v||a!==D)w=!0,L.setHand(c,a,!1,!0)});g.off(r).one(r,function(a){a.preventDefault();var c=/^touch/.test(a.type),d=(c?a.originalEvent.changedTouches[0]:a).pageX-m;a=(c?a.originalEvent.changedTouches[0]:a).pageY-n;(b||w)&&d===v&&a===D&&L.setHand(d,a);"hours"===L.currentView?L.toggleView("minutes",A/2):e.autoclose&&(L.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){L.done()},
A/2));u.prepend(O);clearTimeout(C);h.removeClass("clockpicker-moving");g.off(q)})}}var m=d('<div class="popover clockpicker-popover"><div class="arrow"></div><div class="popover-title"><span class="clockpicker-span-hours text-primary"></span> : <span class="clockpicker-span-minutes"></span></div><div class="popover-content"><div class="clockpicker-plate"><div class="clockpicker-canvas"></div><div class="clockpicker-dial clockpicker-hours"></div><div class="clockpicker-dial clockpicker-minutes clockpicker-dial-out"></div></div></div></div>'),
u=m.find(".clockpicker-plate"),w=m.find(".clockpicker-hours"),G=m.find(".clockpicker-minutes"),J="INPUT"===c.prop("tagName"),E=J?c:c.find("input"),I=c.find(".input-group-addon"),L=this;this.id=b("cp");this.element=c;this.options=e;this.isShown=this.isAppended=!1;this.currentView="hours";this.isInput=J;this.input=E;this.addon=I;this.popover=m;this.plate=u;this.hoursView=w;this.minutesView=G;this.spanHours=m.find(".clockpicker-span-hours");this.spanMinutes=m.find(".clockpicker-span-minutes");e.autoclose||
d('<button type="button" class="btn btn-sm btn-default btn-block clockpicker-button">'+e.donetext+"</button>").click(d.proxy(this.done,this)).appendTo(m);"top"!==e.placement&&"bottom"!==e.placement||"top"!==e.align&&"bottom"!==e.align||(e.align="left");"left"!==e.placement&&"right"!==e.placement||"left"!==e.align&&"right"!==e.align||(e.align="top");m.addClass(e.placement);m.addClass("clockpicker-align-"+e.align);this.spanHours.click(d.proxy(this.toggleView,this,"hours"));this.spanMinutes.click(d.proxy(this.toggleView,
this,"minutes"));E.on("focus.clockpicker click.clockpicker",d.proxy(this.show,this));I.on("click.clockpicker",d.proxy(this.toggle,this));for(var J=d('<div class="clockpicker-tick"></div>'),P,E=0;24>E;E+=1){I=J.clone();P=E/6*Math.PI;var H=0<E&&13>E,R=H?54:80;I.css({left:100+Math.sin(P)*R-13,top:100-Math.cos(P)*R-13});H&&I.css("font-size","120%");I.html(0===E?"00":E);w.append(I);I.on(n,l)}for(E=0;60>E;E+=5)I=J.clone(),P=E/30*Math.PI,I.css({left:100+80*Math.sin(P)-13,top:100-80*Math.cos(P)-13}),I.css("font-size",
"120%"),I.html(a(E)),G.append(I),I.on(n,l);u.on(n,function(a){0===d(a.target).closest(".clockpicker-tick").length&&l(a,!0)});if(k){var O=m.find(".clockpicker-canvas"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");m.setAttribute("class","clockpicker-svg");m.setAttribute("width",200);m.setAttribute("height",200);w=document.createElementNS("http://www.w3.org/2000/svg","g");w.setAttribute("transform","translate(100,100)");G=document.createElementNS("http://www.w3.org/2000/svg","circle");
G.setAttribute("class","clockpicker-canvas-bearing");G.setAttribute("cx",0);G.setAttribute("cy",0);G.setAttribute("r",2);J=document.createElementNS("http://www.w3.org/2000/svg","line");J.setAttribute("x1",0);J.setAttribute("y1",0);E=document.createElementNS("http://www.w3.org/2000/svg","circle");E.setAttribute("class","clockpicker-canvas-bg");E.setAttribute("r",13);I=document.createElementNS("http://www.w3.org/2000/svg","circle");I.setAttribute("class","clockpicker-canvas-fg");I.setAttribute("r",
3.5);w.appendChild(J);w.appendChild(E);w.appendChild(I);w.appendChild(G);m.appendChild(w);O.append(m);this.hand=J;this.bg=E;this.fg=I;this.bearing=G;this.g=w;this.canvas=O}}var d=window.jQuery,e=d(window),g=d(document),h,k="SVGAngle"in window&&function(){var a,b=document.createElement("div");b.innerHTML="<svg/>";a="http://www.w3.org/2000/svg"==(b.firstChild&&b.firstChild.namespaceURI);b.innerHTML="";return a}(),l=function(){var a=document.createElement("div").style;return"transition"in a||"WebkitTransition"in
a||"MozTransition"in a||"msTransition"in a||"OTransition"in a}(),m="ontouchstart"in window,n="mousedown"+(m?" touchstart":""),q="mousemove.clockpicker"+(m?" touchmove.clockpicker":""),r="mouseup.clockpicker"+(m?" touchend.clockpicker":""),u=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,w=0,A=l?350:1;c.DEFAULTS={"default":"",fromnow:0,placement:"bottom",align:"left",donetext:"\u5b8c\u6210",autoclose:!1,vibrate:!0};c.prototype.toggle=function(){this[this.isShown?"hide":"show"]()};
c.prototype.locate=function(){var a=this.element,b=this.popover,c=a.offset(),d=a.outerWidth(),a=a.outerHeight(),e=this.options.placement,g=this.options.align,h={};b.show();switch(e){case "bottom":h.top=c.top+a;break;case "right":h.left=c.left+d;break;case "top":h.top=c.top-b.outerHeight();break;case "left":h.left=c.left-b.outerWidth()}switch(g){case "left":h.left=c.left;break;case "right":h.left=c.left+d-b.outerWidth();break;case "top":h.top=c.top;break;case "bottom":h.top=c.top+a-b.outerHeight()}b.css(h)};
c.prototype.show=function(b){if(!this.isShown){var c=this;this.isAppended||(h=d(document.body).append(this.popover),e.on("resize.clockpicker"+this.id,function(){c.isShown&&c.locate()}),this.isAppended=!0);b=((this.input.prop("value")||this.options["default"]||"")+"").split(":");"now"===b[0]&&(b=new Date(+new Date+this.options.fromnow),b=[b.getHours(),b.getMinutes()]);this.hours=+b[0]||0;this.minutes=+b[1]||0;this.spanHours.html(a(this.hours));this.spanMinutes.html(a(this.minutes));"function"===typeof this.options.beforeShow&&
this.options.beforeShow.apply(this);this.toggleView("hours");this.locate();this.isShown=!0;g.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(a){a=d(a.target);0===a.closest(c.popover).length&&0===a.closest(c.addon).length&&0===a.closest(c.input).length&&c.hide()});g.on("keyup.clockpicker."+this.id,function(a){27===a.keyCode&&c.hide()});"function"===typeof this.options.afterShow&&this.options.afterShow.apply(this)}};c.prototype.hide=function(){this.isShown=!1;g.off("click.clockpicker."+
this.id+" focusin.clockpicker."+this.id);g.off("keyup.clockpicker."+this.id);this.popover.hide()};c.prototype.toggleView=function(a,b){var c="hours"===a,d=c?this.hoursView:this.minutesView,e=c?this.minutesView:this.hoursView;this.currentView=a;this.spanHours.toggleClass("text-primary",c);this.spanMinutes.toggleClass("text-primary",!c);e.addClass("clockpicker-dial-out");d.css("visibility","visible").removeClass("clockpicker-dial-out");this.resetClock(b);clearTimeout(this.toggleViewTimer);this.toggleViewTimer=
setTimeout(function(){e.css("visibility","hidden")},A)};c.prototype.resetClock=function(a){var b=this.currentView,c=this[b],d="hours"===b,b=Math.PI/(d?6:30)*c,c=d&&0<c&&13>c?54:80,e=Math.sin(b)*c,g=-Math.cos(b)*c,h=this;k&&a?(h.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){h.canvas.removeClass("clockpicker-canvas-out");h.setHand(e,g)},a)):this.setHand(e,g)};c.prototype.setHand=function(b,c,e,g){var h=Math.atan2(b,-c),l="hours"===this.currentView,m=Math.PI/(l||e?6:30);b=Math.sqrt(b*
b+c*c);b=(c=l&&67>b)?54:80;var n;0>h&&(h=2*Math.PI+h);n=Math.round(h/m);h=n*m;l?(12===n&&(n=0),n=c?0===n?12:n:0===n?0:n+12):(e&&(n*=5),60===n&&(n=0));this[this.currentView]!==n&&u&&this.options.vibrate&&!this.vibrateTimer&&(navigator[u](10),this.vibrateTimer=setTimeout(d.proxy(function(){this.vibrateTimer=null},this),100));this[this.currentView]=n;this[l?"spanHours":"spanMinutes"].html(a(n));k?(g||!l&&n%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class",
"clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg")),e=Math.sin(h)*b,h=-Math.cos(h)*b,this.hand.setAttribute("x2",e),this.hand.setAttribute("y2",h),this.bg.setAttribute("cx",e),this.bg.setAttribute("cy",h),this.fg.setAttribute("cx",e),this.fg.setAttribute("cy",h)):this[l?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var a=d(this);a.toggleClass("active",
n===+a.html())})};c.prototype.done=function(){this.hide();var b=this.input.prop("value"),c=a(this.hours)+":"+a(this.minutes);this.input.prop("value",c);c!==b&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))};c.prototype.remove=function(){this.element.removeData("clockpicker");this.input.off("focus.clockpicker click.clockpicker");this.addon.off("click.clockpicker");this.isShown&&this.hide();this.isAppended&&(e.off("resize.clockpicker"+this.id),this.popover.remove())};
d.fn.clockpicker=function(a){var b=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=d(this),g=e.data("clockpicker");g?"function"===typeof g[a]&&g[a].apply(g,b):(g=d.extend({},c.DEFAULTS,e.data(),"object"==typeof a&&a),e.data("clockpicker",new c(e,g)))})}})();(function(){function a(a,b){if(!b||"function"===typeof b)return a;for(var c in b)a[c]=b[c];return a}function b(a,b,c){var d,e=0,g=a.length,h=void 0===g||"[object Array]"!==Object.prototype.toString.apply(a)||"function"===typeof a;if(c)if(h)for(d in a){if(!1===b.apply(a[d],c))break}else for(;e<g&&!1!==b.apply(a[e++],c););else if(h)for(d in a){if(!1===b.call(a[d],d,a[d]))break}else for(;e<g&&!1!==b.call(a[e],e,a[e++]););return a}function c(a){var b=function(a){if(window.XMLHttpRequest)return a(null,
new XMLHttpRequest);if(window.ActiveXObject)try{return a(null,new ActiveXObject("Msxml2.XMLHTTP"))}catch(b){return a(null,new ActiveXObject("Microsoft.XMLHTTP"))}return a(Error())},c=function(a){if("string"===typeof a)return a;var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")},d=function(){for(var a=arguments[0],b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a},e=function(a,
g,h,k){"function"===typeof h&&(k=h,h={});h.cache=h.cache||!1;h.data=h.data||{};h.headers=h.headers||{};h.jsonp=h.jsonp||!1;h.async=void 0===h.async?!0:h.async;var l=d({accept:"*/*","content-type":"application/x-www-form-urlencoded;charset=UTF-8"},e.headers,h.headers),m;m="application/json"===l["content-type"]?JSON.stringify(h.data):c(h.data);if("GET"===a){var n=[];m&&(n.push(m),m=null);h.cache||n.push("_="+(new Date).getTime());h.jsonp&&(n.push("callback="+h.jsonp),n.push("jsonp="+h.jsonp));n=n.join("&");
1<n.length&&(g=-1<g.indexOf("?")?g+("&"+n):g+("?"+n));if(h.jsonp){var n=document.getElementsByTagName("head")[0],q=document.createElement("script");q.type="text/javascript";q.src=g;n.appendChild(q);return}}b(function(b,c){if(b)return k(b);c.open(a,g,h.async);for(var d in l)l.hasOwnProperty(d)&&c.setRequestHeader(d,l[d]);c.onreadystatechange=function(){if(4===c.readyState){var a=c.responseText||"";k&&k(c.status,{text:function(){return a},json:function(){return JSON.parse(a)}})}};c.send(m)})};({authBasic:function(a,
b){var c=e.headers,d;d=a+":"+b;d=d.replace(/\r\n/g,"\n");for(var g="",h=0;h<d.length;h++){var k=d.charCodeAt(h);128>k?g+=String.fromCharCode(k):(127<k&&2048>k?g+=String.fromCharCode(k>>6|192):(g+=String.fromCharCode(k>>12|224),g+=String.fromCharCode(k>>6&63|128)),g+=String.fromCharCode(k&63|128))}d=g;var g="",l,m,n,q,r=0;do l=d.charCodeAt(r++),h=d.charCodeAt(r++),k=d.charCodeAt(r++),m=l>>2,l=(l&3)<<4|h>>4,n=(h&15)<<2|k>>6,q=k&63,isNaN(h)?n=q=64:isNaN(k)&&(q=64),g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q);while(r<d.length);c.Authorization="Basic "+g},connect:function(a,b,c){return e("CONNECT",a,b,c)},del:function(a,b,c){return e("DELETE",a,b,c)},get:function(a,b,c){return e("GET",a,b,c)},head:function(a,b,c){return e("HEAD",a,b,c)},headers:function(a){e.headers=a||{}},
isAllowed:function(a,b,c){this.options(a,function(a,d){c(-1!==d.text().indexOf(b))})},options:function(a,b,c){return e("OPTIONS",a,b,c)},patch:function(a,b,c){return e("PATCH",a,b,c)},post:function(a,b,c){return e("POST",a,b,c)},put:function(a,b,c){return e("PUT",a,b,c)},trace:function(a,b,c){return e("TRACE",a,b,c)}})[a.type?a.type.toLowerCase():"get"](a.url,a,function(b,c){200===b?a.success(c.json(),b,null):a.error(c.text(),b,null)})}function d(a,b){"function"===typeof a&&(b=a,a={});a=a||{};E.extend(z,
a);delete z.fixLng;"string"==typeof z.ns&&(z.ns={namespaces:[z.ns],defaultNs:z.ns});"string"==typeof z.fallbackNS&&(z.fallbackNS=[z.fallbackNS]);if("string"==typeof z.fallbackLng||"boolean"==typeof z.fallbackLng)z.fallbackLng=[z.fallbackLng];z.interpolationPrefixEscaped=E.regexEscape(z.interpolationPrefix);z.interpolationSuffixEscaped=E.regexEscape(z.interpolationSuffix);z.lng||(z.lng=E.detectLanguage());z.lng?z.useCookie&&E.cookie.create(z.cookieName,z.lng,z.cookieExpirationTime,z.cookieDomain):
(z.lng=z.fallbackLng[0],z.useCookie&&E.cookie.remove(z.cookieName));D=E.toLanguages(z.lng);v=D[0];E.log("currentLng set to: "+v);var c=m;a.fixLng&&(c=function(a,b){b=b||{};b.lng=b.lng||c.lng;return m(a,b)},c.lng=v);L.setCurrentLng(v);u&&z.setJqueryExt&&g();var d;u&&u.Deferred&&(d=u.Deferred());if(z.resStore)A=z.resStore,C=!0,b&&b(c),d&&d.resolve(c);else{var e=E.toLanguages(z.lng);"string"===typeof z.preload&&(z.preload=[z.preload]);for(var h=0,k=z.preload.length;h<k;h++)for(var l=E.toLanguages(z.preload[h]),
n=0,q=l.length;n<q;n++)0>e.indexOf(l[n])&&e.push(l[n]);w.sync.load(e,z,function(a,e){A=e;C=!0;b&&b(c);d&&d.resolve(c)})}if(d)return d.promise()}function e(a,b){var c={dynamicLoad:z.dynamicLoad,resGetPath:z.resGetPath,getAsync:z.getAsync,customLoad:z.customLoad,ns:{namespaces:a,defaultNs:""}},d=E.toLanguages(z.lng);"string"===typeof z.preload&&(z.preload=[z.preload]);for(var e=0,g=z.preload.length;e<g;e++)for(var h=E.toLanguages(z.preload[e]),k=0,l=h.length;k<l;k++)0>d.indexOf(h[k])&&d.push(h[k]);
for(var m=[],e=0,g=d.length;e<g;e++){h=!1;if(k=A[d[e]])for(var l=0,n=a.length;l<n;l++)k[a[l]]||(h=!0);else h=!0;h&&m.push(d[e])}m.length?w.sync._fetch(m,c,function(c,d){var e=a.length*m.length;E.each(a,function(a,c){0>z.ns.namespaces.indexOf(c)&&z.ns.namespaces.push(c);E.each(m,function(a,g){A[g]=A[g]||{};A[g][c]=d[g][c];e--;0===e&&b&&(z.useLocalStorage&&w.sync._storeLocal(A),b())})})}):b&&b()}function g(){function a(b,c,d){if(0!==c.length){var e="text";0===c.indexOf("[")&&(e=c.split("]"),c=e[1],
e=e[0].substr(1,e[0].length-1));c.indexOf(";")===c.length-1&&(c=c.substr(0,c.length-2));if("html"===e)d=z.defaultValueFromContent?u.extend({defaultValue:b.html()},d):d,b.html(u.t(c,d));else if("text"===e)d=z.defaultValueFromContent?u.extend({defaultValue:b.text()},d):d,b.text(u.t(c,d));else if("prepend"===e)d=z.defaultValueFromContent?u.extend({defaultValue:b.html()},d):d,b.prepend(u.t(c,d));else if("append"===e)d=z.defaultValueFromContent?u.extend({defaultValue:b.html()},d):d,b.append(u.t(c,d));
else if(0===e.indexOf("data-")){var g=e.substr(5);d=z.defaultValueFromContent?u.extend({defaultValue:b.data(g)},d):d;c=u.t(c,d);b.data(g,c);b.attr(e,c)}else d=z.defaultValueFromContent?u.extend({defaultValue:b.attr(e)},d):d,b.attr(e,u.t(c,d))}}function b(c,d){var e=c.attr(z.selectorAttr);e||"undefined"===typeof e||!1===e||(e=c.text()||c.val());if(e){var g=c,h=c.data("i18n-target");h&&(g=c.find(h)||c);d||!0!==z.useDataAttrOptions||(d=c.data("i18n-options"));d=d||{};0<=e.indexOf(";")?(e=e.split(";"),
u.each(e,function(b,c){""!==c&&a(g,c,d)})):a(g,e,d);!0===z.useDataAttrOptions&&c.data("i18n-options",d)}}u.t=u.t||m;u.fn.i18n=function(a){return this.each(function(){b(u(this),a);u(this).find("["+z.selectorAttr+"]").each(function(){b(u(this),a)})})}}function h(a,b,c,d){if(!a)return a;d=d||b;if(0>a.indexOf(d.interpolationPrefix||z.interpolationPrefix))return a;var e=d.interpolationPrefix?E.regexEscape(d.interpolationPrefix):z.interpolationPrefixEscaped,g=d.interpolationSuffix?E.regexEscape(d.interpolationSuffix):
z.interpolationSuffixEscaped,k="HTML"+g;E.each(b,function(b,l){var m=c?c+z.keyseparator+b:b;"object"===typeof l&&null!==l?a=h(a,l,m,d):d.escapeInterpolation||z.escapeInterpolation?(a=a.replace(new RegExp([e,m,k].join(""),"g"),l),a=a.replace(new RegExp([e,m,g].join(""),"g"),E.escape(l))):a=a.replace(new RegExp([e,m,g].join(""),"g"),l)});return a}function k(a,b){var c=E.extend({},b);for(delete c.postProcess;-1!=a.indexOf(z.reusePrefix);){B++;if(B>z.maxRecursion)break;var d=a.lastIndexOf(z.reusePrefix),
e=a.indexOf(z.reuseSuffix,d)+z.reuseSuffix.length,d=a.substring(d,e),e=d.replace(z.reusePrefix,"").replace(z.reuseSuffix,"");if(-1!=e.indexOf(",")){var g=e.indexOf(",");if(-1!=e.indexOf("{",g)&&-1!=e.indexOf("}",g)){var h=e.indexOf("{",g),k=e.indexOf("}",h)+1;try{c=E.extend(c,JSON.parse(e.substring(h,k))),e=e.substring(0,g)}catch(l){}}}e=q(e,c);a=a.replace(d,e)}return a}function l(a,b){b=b||{};var c=void 0!==b.defaultValue?b.defaultValue:a,d=r(a,b);return void 0!==d||d===c}function m(a,b){b=b||{};
if(!C)return a||"";B=0;return q.apply(null,arguments)}function n(){for(var a=[],b=1;b<arguments.length;b++)a.push(arguments[b]);return{postProcess:"sprintf",sprintf:a}}function q(a,b){b&&"object"!==typeof b?"sprintf"===z.shortcutFunction?b=n.apply(null,arguments):"defaultValue"===z.shortcutFunction&&(b={defaultValue:b}):b=b||{};if(void 0===a||null===a)return"";"string"==typeof a&&(a=[a]);var c=a[0];if(1<a.length)for(var d=0;d<a.length&&(c=a[d],!l(c,b));d++);var d=void 0!==b.defaultValue?b.defaultValue:
c,e=r(c,b),g=b.lng?E.toLanguages(b.lng):D,m=b.ns||z.ns.defaultNs,q;-1<c.indexOf(z.nsseparator)&&(q=c.split(z.nsseparator),m=q[0],c=q[1]);void 0===e&&z.sendMissing&&(b.lng?I.postMissing(g[0],m,c,d,g):I.postMissing(z.lng,m,c,d,g));g=b.postProcess||z.postProcess;void 0!==e&&g&&P[g]&&(e=P[g](e,c,b));q=d;-1<d.indexOf(z.nsseparator)&&(q=d.split(z.nsseparator),q=q[1]);q===c&&z.parseMissingKey&&(d=z.parseMissingKey(d));void 0===e&&(d=h(d,b),d=k(d,b),g&&P[g]&&(e=P[g](void 0!==b.defaultValue?b.defaultValue:
c,c,b)));return void 0!==e?e:d}function r(a,b){b=b||{};var c,d=void 0!==b.defaultValue?b.defaultValue:a,e=D;if(!A||"cimode"===e[0].toLowerCase())return d;if(b.lng&&(e=E.toLanguages(b.lng),!A[e[0]])){var g=z.getAsync;z.getAsync=!1;w.sync.load(e,z,function(a,b){E.extend(A,b);z.getAsync=g})}var l=b.ns||z.ns.defaultNs;-1<a.indexOf(z.nsseparator)&&(c=a.split(z.nsseparator),l=c[0],a=c[1]);if(b.context&&("string"==typeof b.context||"number"==typeof b.context)&&(c=E.extend({},b),delete c.context,c.defaultValue=
z.contextNotFound,c=m(l+z.nsseparator+a+"_"+b.context,c),c!=z.contextNotFound))return h(c,{context:b.context});if(void 0!==b.count&&"string"!=typeof b.count&&1!==b.count){c=E.extend({},b);delete c.count;c.defaultValue=z.pluralNotFound;var n=l+z.nsseparator+a+z.pluralSuffix,u=L.get(e[0],b.count);0<=u?n=n+"_"+u:1===u&&(n=l+z.nsseparator+a);c=m(n,c);if(c!=z.pluralNotFound)return h(c,{count:b.count,interpolationPrefix:b.interpolationPrefix,interpolationSuffix:b.interpolationSuffix})}var v;c=a.split(z.keyseparator);
n=0;for(u=e.length;n<u&&void 0===v;n++){for(var C=e[n],B=0,F=A[C]&&A[C][l];c[B];)F=F&&F[c[B]],B++;if(void 0!==F){v=Object.prototype.toString.apply(F);if("string"===typeof F)F=h(F,b),F=k(F,b);else if("[object Array]"===v&&!z.returnObjectTrees&&!b.returnObjectTrees)F=F.join("\n"),F=h(F,b),F=k(F,b);else if(null===F&&!0===z.fallbackOnNull)F=void 0;else if(null!==F)if(!z.returnObjectTrees&&!b.returnObjectTrees)z.objectTreeKeyHandler&&"function"==typeof z.objectTreeKeyHandler?F=z.objectTreeKeyHandler(a,
F,C,l,b):(F="key '"+l+":"+a+" ("+C+")' returned an object instead of string.",E.log(F));else if("[object Number]"!==v&&"[object Function]"!==v&&"[object RegExp]"!==v){var J="[object Array]"===v?[]:{};E.each(F,function(c){J[c]=q(l+z.nsseparator+a+z.keyseparator+c,b)});F=J}"string"===typeof F&&""===F.trim()&&!0===z.fallbackOnEmpty&&(F=void 0);v=F}}if(void 0===v&&!b.isFallbackLookup&&(!0===z.fallbackToDefaultNS||z.fallbackNS&&0<z.fallbackNS.length))if(b.isFallbackLookup=!0,z.fallbackNS.length)for(e=
0,c=z.fallbackNS.length;e<c;e++){if(v=r(z.fallbackNS[e]+z.nsseparator+a,b))if(n=-1<v.indexOf(z.nsseparator)?v.split(z.nsseparator)[1]:v,u=-1<d.indexOf(z.nsseparator)?d.split(z.nsseparator)[1]:d,n!==u)break}else v=r(a,b);return v}Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;0<arguments.length&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&Infinity!=d&&-Infinity!=d&&(d=(0<d||-1)*Math.floor(Math.abs(d))));
if(d>=c)return-1;for(d=0<=d?d:Math.max(c-Math.abs(d),0);d<c;d++)if(d in b&&b[d]===a)return d;return-1});Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=c;1<arguments.length&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&d!=1/0&&d!=-(1/0)&&(d=(0<d||-1)*Math.floor(Math.abs(d))));for(c=0<=d?Math.min(d,c-1):c-Math.abs(d);0<=c;c--)if(c in b&&b[c]===a)return c;return-1});"function"!==typeof String.prototype.trim&&
(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var u=this.jQuery||this.Zepto,w={},A={},v,B=0,D=[],C=!1;"undefined"!==typeof module&&module.exports?module.exports=w:(u&&(u.i18n=u.i18n||w),this.i18n=this.i18n||w);var z={lng:void 0,load:"all",preload:[],lowerCaseLng:!1,returnObjectTrees:!1,fallbackLng:["dev"],fallbackNS:[],detectLngQS:"setLng",ns:"translation",fallbackOnNull:!0,fallbackOnEmpty:!1,fallbackToDefaultNS:!1,nsseparator:":",keyseparator:".",selectorAttr:"data-i18n",
debug:!1,resGetPath:"locales/__lng__/__ns__.json",resPostPath:"locales/add/__lng__/__ns__",getAsync:!0,postAsync:!0,resStore:void 0,useLocalStorage:!1,localStorageExpirationTime:6048E5,dynamicLoad:!1,sendMissing:!1,sendMissingTo:"fallback",sendType:"POST",interpolationPrefix:"__",interpolationSuffix:"__",reusePrefix:"$t(",reuseSuffix:")",pluralSuffix:"_plural",pluralNotFound:["plural_not_found",Math.random()].join(""),contextNotFound:["context_not_found",Math.random()].join(""),escapeInterpolation:!1,
setJqueryExt:!0,defaultValueFromContent:!0,useDataAttrOptions:!1,cookieExpirationTime:void 0,useCookie:!0,cookieName:"i18next",cookieDomain:void 0,objectTreeKeyHandler:void 0,postProcess:void 0,parseMissingKey:void 0,shortcutFunction:"sprintf"},F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},G={create:function(a,b,c,d){if(c){var e=new Date;e.setTime(e.getTime()+6E4*c);c="; expires="+e.toGMTString()}else c="";document.cookie=a+"="+b+c+";"+(d?"domain="+d+";":"")+"path=/"},
read:function(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return d.substring(a.length,d.length)}return null},remove:function(a){this.create(a,"",-1)}},J={create:function(a,b,c,d){},read:function(a){return null},remove:function(a){}},E={extend:u?u.extend:a,each:u?u.each:b,ajax:u?u.ajax:"undefined"!==typeof document?c:function(){},cookie:"undefined"!==typeof document?G:J,detectLanguage:function(){var a,
b=[];if("undefined"!==typeof window){for(var c=window.location.search.substring(1).split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("=");if(0<e){var g=c[d].substring(0,e),e=c[d].substring(e+1);b[g]=e}}b[z.detectLngQS]&&(a=b[z.detectLngQS])}!a&&"undefined"!==typeof document&&z.useCookie&&(b=E.cookie.read(z.cookieName))&&(a=b);a||"undefined"===typeof navigator||(a=navigator.language?navigator.language:navigator.userLanguage);return a},escape:function(a){return"string"===typeof a?a.replace(/[&<>"'\/]/g,
function(a){return F[a]}):a},log:function(a){z.debug&&"undefined"!==typeof console&&console.log(a)},toLanguages:function(a){var b=[];if("string"===typeof a&&-1<a.indexOf("-")){var c=a.split("-");a=z.lowerCaseLng?c[0].toLowerCase()+"-"+c[1].toLowerCase():c[0].toLowerCase()+"-"+c[1].toUpperCase();"unspecific"!==z.load&&b.push(a);"current"!==z.load&&b.push(c[0])}else b.push(a);for(a=0;a<z.fallbackLng.length;a++)-1===b.indexOf(z.fallbackLng[a])&&z.fallbackLng[a]&&b.push(z.fallbackLng[a]);return b},regexEscape:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
"\\$&")}};E.applyReplacement=h;var I={load:function(a,b,c){b.useLocalStorage?I._loadLocal(a,b,function(d,e){for(var g=[],h=0,k=a.length;h<k;h++)e[a[h]]||g.push(a[h]);0<g.length?I._fetch(g,b,function(a,b){E.extend(e,b);I._storeLocal(b);c(null,e)}):c(null,e)}):I._fetch(a,b,function(a,b){c(null,b)})},_loadLocal:function(a,b,c){var d={},e=(new Date).getTime();if(window.localStorage){var g=a.length;E.each(a,function(a,h){var k=window.localStorage.getItem("res_"+h);k&&(k=JSON.parse(k),k.i18nStamp&&k.i18nStamp+
b.localStorageExpirationTime>e&&(d[h]=k));g--;0===g&&c(null,d)})}},_storeLocal:function(a){if(window.localStorage)for(var b in a)a[b].i18nStamp=(new Date).getTime(),window.localStorage.setItem("res_"+b,JSON.stringify(a[b]))},_fetch:function(a,b,c){var d=b.ns,e={};if(b.dynamicLoad){var g=function(a,b){c(null,b)};if("function"==typeof b.customLoad)b.customLoad(a,d.namespaces,b,g);else{var k=h(b.resGetPath,{lng:a.join("+"),ns:d.namespaces.join("+")});E.ajax({url:k,success:function(a,b,d){E.log("loaded: "+
k);c(null,a)},error:function(a,b,d){E.log("failed loading: "+k);c(null,void 0)},dataType:"json",async:b.getAsync})}}else{var l=d.namespaces.length*a.length,m;E.each(d.namespaces,function(d,g){E.each(a,function(a,d){var h=function(a,b){a&&(m=m||[],m.push(a));e[d]=e[d]||{};e[d][g]=b;l--;0===l&&c(m,e)};"function"==typeof b.customLoad?b.customLoad(d,g,b,h):I._fetchOne(d,g,b,h)})})}},_fetchOne:function(a,b,c,d){var e=h(c.resGetPath,{lng:a,ns:b});E.ajax({url:e,success:function(a,b,c){E.log("loaded: "+e);
d(null,a)},error:function(a,b,c){b&&200==b||a&&a.status&&200==a.status?E.log("There is a typo in: "+e):b&&404==b||a&&a.status&&404==a.status?E.log("Does not exist: "+e):E.log((b?b:a&&a.status?a.status:null)+" when loading "+e);d(c,{})},dataType:"json",async:c.getAsync})},postMissing:function(a,b,c,d,e){var g={};g[c]=d;var k=[];if("fallback"===z.sendMissingTo&&!1!==z.fallbackLng[0])for(a=0;a<z.fallbackLng.length;a++)k.push({lng:z.fallbackLng[a],url:h(z.resPostPath,{lng:z.fallbackLng[a],ns:b})});else if("current"===
z.sendMissingTo||"fallback"===z.sendMissingTo&&!1===z.fallbackLng[0])k.push({lng:a,url:h(z.resPostPath,{lng:a,ns:b})});else if("all"===z.sendMissingTo){a=0;for(var l=e.length;a<l;a++)k.push({lng:e[a],url:h(z.resPostPath,{lng:e[a],ns:b})})}e=0;for(a=k.length;e<a;e++){var m=k[e];E.ajax({url:m.url,type:z.sendType,data:g,success:function(a,e,g){E.log("posted missing key '"+c+"' to: "+m.url);a=c.split(".");e=0;for(g=A[m.lng][b];a[e];)g=e===a.length-1?g[a[e]]=d:g[a[e]]=g[a[e]]||{},e++},error:function(a,
b,d){E.log("failed posting missing key '"+c+"' to: "+m.url)},dataType:"json",async:z.postAsync})}}},L={rules:{ach:{name:"Acholi",numbers:[1,2],plurals:function(a){return Number(1<a)}},af:{name:"Afrikaans",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ak:{name:"Akan",numbers:[1,2],plurals:function(a){return Number(1<a)}},am:{name:"Amharic",numbers:[1,2],plurals:function(a){return Number(1<a)}},an:{name:"Aragonese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ar:{name:"Arabic",
numbers:[0,1,2,3,11,100],plurals:function(a){return Number(0===a?0:1==a?1:2==a?2:3<=a%100&&10>=a%100?3:11<=a%100?4:5)}},arn:{name:"Mapudungun",numbers:[1,2],plurals:function(a){return Number(1<a)}},ast:{name:"Asturian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ay:{name:"Aymar\u00e1",numbers:[1],plurals:function(a){return 0}},az:{name:"Azerbaijani",numbers:[1,2],plurals:function(a){return Number(1!=a)}},be:{name:"Belarusian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&
11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},bg:{name:"Bulgarian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},bn:{name:"Bengali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},bo:{name:"Tibetan",numbers:[1],plurals:function(a){return 0}},br:{name:"Breton",numbers:[1,2],plurals:function(a){return Number(1<a)}},bs:{name:"Bosnian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},ca:{name:"Catalan",
numbers:[1,2],plurals:function(a){return Number(1!=a)}},cgg:{name:"Chiga",numbers:[1],plurals:function(a){return 0}},cs:{name:"Czech",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a&&4>=a?1:2)}},csb:{name:"Kashubian",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},cy:{name:"Welsh",numbers:[1,2,3,8],plurals:function(a){return Number(1==a?0:2==a?1:8!=a&&11!=a?2:3)}},da:{name:"Danish",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},de:{name:"German",numbers:[1,2],plurals:function(a){return Number(1!=a)}},dz:{name:"Dzongkha",numbers:[1],plurals:function(a){return 0}},el:{name:"Greek",numbers:[1,2],plurals:function(a){return Number(1!=a)}},en:{name:"English",numbers:[1,2],plurals:function(a){return Number(1!=a)}},eo:{name:"Esperanto",numbers:[1,2],plurals:function(a){return Number(1!=a)}},es:{name:"Spanish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},es_ar:{name:"Argentinean Spanish",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},et:{name:"Estonian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},eu:{name:"Basque",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fa:{name:"Persian",numbers:[1],plurals:function(a){return 0}},fi:{name:"Finnish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fil:{name:"Filipino",numbers:[1,2],plurals:function(a){return Number(1<a)}},fo:{name:"Faroese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fr:{name:"French",numbers:[1,2],plurals:function(a){return Number(1<
a)}},fur:{name:"Friulian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fy:{name:"Frisian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ga:{name:"Irish",numbers:[1,2,3,7,11],plurals:function(a){return Number(1==a?0:2==a?1:7>a?2:11>a?3:4)}},gd:{name:"Scottish Gaelic",numbers:[1,2,3,20],plurals:function(a){return Number(1==a||11==a?0:2==a||12==a?1:2<a&&20>a?2:3)}},gl:{name:"Galician",numbers:[1,2],plurals:function(a){return Number(1!=a)}},gu:{name:"Gujarati",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},gun:{name:"Gun",numbers:[1,2],plurals:function(a){return Number(1<a)}},ha:{name:"Hausa",numbers:[1,2],plurals:function(a){return Number(1!=a)}},he:{name:"Hebrew",numbers:[1,2],plurals:function(a){return Number(1!=a)}},hi:{name:"Hindi",numbers:[1,2],plurals:function(a){return Number(1!=a)}},hr:{name:"Croatian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},hu:{name:"Hungarian",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},hy:{name:"Armenian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ia:{name:"Interlingua",numbers:[1,2],plurals:function(a){return Number(1!=a)}},id:{name:"Indonesian",numbers:[1],plurals:function(a){return 0}},is:{name:"Icelandic",numbers:[1,2],plurals:function(a){return Number(1!=a%10||11==a%100)}},it:{name:"Italian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ja:{name:"Japanese",numbers:[1],plurals:function(a){return 0}},jbo:{name:"Lojban",numbers:[1],plurals:function(a){return 0}},
jv:{name:"Javanese",numbers:[0,1],plurals:function(a){return Number(0!==a)}},ka:{name:"Georgian",numbers:[1],plurals:function(a){return 0}},kk:{name:"Kazakh",numbers:[1],plurals:function(a){return 0}},km:{name:"Khmer",numbers:[1],plurals:function(a){return 0}},kn:{name:"Kannada",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ko:{name:"Korean",numbers:[1],plurals:function(a){return 0}},ku:{name:"Kurdish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},kw:{name:"Cornish",numbers:[1,
2,3,4],plurals:function(a){return Number(1==a?0:2==a?1:3==a?2:3)}},ky:{name:"Kyrgyz",numbers:[1],plurals:function(a){return 0}},lb:{name:"Letzeburgesch",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ln:{name:"Lingala",numbers:[1,2],plurals:function(a){return Number(1<a)}},lo:{name:"Lao",numbers:[1],plurals:function(a){return 0}},lt:{name:"Lithuanian",numbers:[1,2,10],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&(10>a%100||20<=a%100)?1:2)}},lv:{name:"Latvian",numbers:[1,
2,0],plurals:function(a){return Number(1==a%10&&11!=a%100?0:0!==a?1:2)}},mai:{name:"Maithili",numbers:[1,2],plurals:function(a){return Number(1!=a)}},mfe:{name:"Mauritian Creole",numbers:[1,2],plurals:function(a){return Number(1<a)}},mg:{name:"Malagasy",numbers:[1,2],plurals:function(a){return Number(1<a)}},mi:{name:"Maori",numbers:[1,2],plurals:function(a){return Number(1<a)}},mk:{name:"Macedonian",numbers:[1,2],plurals:function(a){return Number(1==a||1==a%10?0:1)}},ml:{name:"Malayalam",numbers:[1,
2],plurals:function(a){return Number(1!=a)}},mn:{name:"Mongolian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},mnk:{name:"Mandinka",numbers:[0,1,2],plurals:function(a){return Number(1==a?1:2)}},mr:{name:"Marathi",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ms:{name:"Malay",numbers:[1],plurals:function(a){return 0}},mt:{name:"Maltese",numbers:[1,2,11,20],plurals:function(a){return Number(1==a?0:0===a||1<a%100&&11>a%100?1:10<a%100&&20>a%100?2:3)}},nah:{name:"Nahuatl",numbers:[1,
2],plurals:function(a){return Number(1!=a)}},nap:{name:"Neapolitan",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nb:{name:"Norwegian Bokmal",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ne:{name:"Nepali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nl:{name:"Dutch",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nn:{name:"Norwegian Nynorsk",numbers:[1,2],plurals:function(a){return Number(1!=a)}},no:{name:"Norwegian",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},nso:{name:"Northern Sotho",numbers:[1,2],plurals:function(a){return Number(1!=a)}},oc:{name:"Occitan",numbers:[1,2],plurals:function(a){return Number(1<a)}},or:{name:"Oriya",numbers:[2,1],plurals:function(a){return Number(1!=a)}},pa:{name:"Punjabi",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pap:{name:"Papiamento",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pl:{name:"Polish",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?
1:2)}},pms:{name:"Piemontese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ps:{name:"Pashto",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pt:{name:"Portuguese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pt_br:{name:"Brazilian Portuguese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},rm:{name:"Romansh",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ro:{name:"Romanian",numbers:[1,2,20],plurals:function(a){return Number(1==a?0:0===a||0<a%100&&20>
a%100?1:2)}},ru:{name:"Russian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},sah:{name:"Yakut",numbers:[1],plurals:function(a){return 0}},sco:{name:"Scots",numbers:[1,2],plurals:function(a){return Number(1!=a)}},se:{name:"Northern Sami",numbers:[1,2],plurals:function(a){return Number(1!=a)}},si:{name:"Sinhala",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sk:{name:"Slovak",numbers:[1,2,5],plurals:function(a){return Number(1==
a?0:2<=a&&4>=a?1:2)}},sl:{name:"Slovenian",numbers:[5,1,2,3],plurals:function(a){return Number(1==a%100?1:2==a%100?2:3==a%100||4==a%100?3:0)}},so:{name:"Somali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},son:{name:"Songhay",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sq:{name:"Albanian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sr:{name:"Serbian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:
2)}},su:{name:"Sundanese",numbers:[1],plurals:function(a){return 0}},sv:{name:"Swedish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sw:{name:"Swahili",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ta:{name:"Tamil",numbers:[1,2],plurals:function(a){return Number(1!=a)}},te:{name:"Telugu",numbers:[1,2],plurals:function(a){return Number(1!=a)}},tg:{name:"Tajik",numbers:[1,2],plurals:function(a){return Number(1<a)}},th:{name:"Thai",numbers:[1],plurals:function(a){return 0}},ti:{name:"Tigrinya",
numbers:[1,2],plurals:function(a){return Number(1<a)}},tk:{name:"Turkmen",numbers:[1,2],plurals:function(a){return Number(1!=a)}},tr:{name:"Turkish",numbers:[1,2],plurals:function(a){return Number(1<a)}},tt:{name:"Tatar",numbers:[1],plurals:function(a){return 0}},ug:{name:"Uyghur",numbers:[1],plurals:function(a){return 0}},uk:{name:"Ukrainian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},ur:{name:"Urdu",numbers:[1,2],plurals:function(a){return Number(1!=
a)}},uz:{name:"Uzbek",numbers:[1,2],plurals:function(a){return Number(1<a)}},vi:{name:"Vietnamese",numbers:[1],plurals:function(a){return 0}},wa:{name:"Walloon",numbers:[1,2],plurals:function(a){return Number(1<a)}},wo:{name:"Wolof",numbers:[1],plurals:function(a){return 0}},yo:{name:"Yoruba",numbers:[1,2],plurals:function(a){return Number(1!=a)}},zh:{name:"Chinese",numbers:[1],plurals:function(a){return 0}}},addRule:function(a,b){L.rules[a]=b},setCurrentLng:function(a){if(!L.currentRule||L.currentRule.lng!==
a){var b=a.split("-");L.currentRule={lng:a,rule:L.rules[b[0]]}}},get:function(a,b){var c=a.split("-");if(c=L.currentRule&&L.currentRule.lng===a?L.currentRule.rule:L.rules[c[0]]){var d=c.plurals(b),d=c.numbers[d];2===c.numbers.length&&1===c.numbers[0]&&(2===d?d=-1:1===d&&(d=1));c=d}else c=1===b?"1":"-1";return c}},P={},G=function(a,b){P[a]=b},H=function(){function a(b){return Object.prototype.toString.call(b).slice(8,-1).toLowerCase()}var b=function(){b.cache.hasOwnProperty(arguments[0])||(b.cache[arguments[0]]=
b.parse(arguments[0]));return b.format.call(null,b.cache[arguments[0]],arguments)};b.format=function(b,c){var d=1,e=b.length,g="",h=[],k,l,m,n;for(k=0;k<e;k++)if(g=a(b[k]),"string"===g)h.push(b[k]);else if("array"===g){m=b[k];if(m[2])for(g=c[d],l=0;l<m[2].length;l++){if(!g.hasOwnProperty(m[2][l]))throw H('[sprintf] property "%s" does not exist',m[2][l]);g=g[m[2][l]]}else g=m[1]?c[m[1]]:c[d++];if(/[^s]/.test(m[8])&&"number"!=a(g))throw H("[sprintf] expecting number but found %s",a(g));switch(m[8]){case "b":g=
g.toString(2);break;case "c":g=String.fromCharCode(g);break;case "d":g=parseInt(g,10);break;case "e":g=m[7]?g.toExponential(m[7]):g.toExponential();break;case "f":g=m[7]?parseFloat(g).toFixed(m[7]):parseFloat(g);break;case "o":g=g.toString(8);break;case "s":g=(g=String(g))&&m[7]?g.substring(0,m[7]):g;break;case "u":g=Math.abs(g);break;case "x":g=g.toString(16);break;case "X":g=g.toString(16).toUpperCase()}g=/[def]/.test(m[8])&&m[3]&&0<=g?"+"+g:g;l=m[4]?"0"==m[4]?"0":m[4].charAt(1):" ";n=m[6]-String(g).length;
if(m[6]){for(var q=[];0<n;q[--n]=l);l=q.join("")}else l="";h.push(m[5]?g+l:l+g)}return h.join("")};b.cache={};b.parse=function(a){for(var b=[],c=[],d=0;a;){if(null!==(b=/^[^\x25]+/.exec(a)))c.push(b[0]);else if(null!==(b=/^\x25{2}/.exec(a)))c.push("%");else if(null!==(b=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(a))){if(b[2]){var d=d|1,e=[],g=b[2],h=[];if(null!==(h=/^([a-z_][a-z_\d]*)/i.exec(g)))for(e.push(h[1]);""!==(g=g.substring(h[0].length));)if(null!==
(h=/^\.([a-z_][a-z_\d]*)/i.exec(g)))e.push(h[1]);else if(null!==(h=/^\[(\d+)\]/.exec(g)))e.push(h[1]);else throw"[sprintf] huh?";else throw"[sprintf] huh?";b[2]=e}else d|=2;if(3===d)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";c.push(b)}else throw"[sprintf] huh?";a=a.substring(b[0].length)}return c};return b}();G("sprintf",function(a,b,c){return c.sprintf?"[object Array]"===Object.prototype.toString.apply(c.sprintf)?(b=c.sprintf,b.unshift(a),H.apply(null,b)):"object"===
typeof c.sprintf?H(a,c.sprintf):a:a});w.init=d;w.setLng=function(a,b,c){"function"===typeof b?(c=b,b={}):b||(b={});b.lng=a;return d(b,c)};w.preload=function(a,b){"string"===typeof a&&(a=[a]);for(var c=0,e=a.length;c<e;c++)0>z.preload.indexOf(a[c])&&z.preload.push(a[c]);return d(b)};w.addResourceBundle=function(a,b,c){"string"!==typeof b?(c=b,b=z.ns.defaultNs):0>z.ns.namespaces.indexOf(b)&&z.ns.namespaces.push(b);A[a]=A[a]||{};A[a][b]=A[a][b]||{};E.extend(A[a][b],c)};w.removeResourceBundle=function(a,
b){"string"!==typeof b&&(b=z.ns.defaultNs);A[a]=A[a]||{};A[a][b]={}};w.loadNamespace=function(a,b){e([a],b)};w.loadNamespaces=e;w.setDefaultNamespace=function(a){z.ns.defaultNs=a};w.t=m;w.translate=m;w.exists=l;w.detectLanguage=E.detectLanguage;w.pluralExtensions=L;w.sync=I;w.functions=E;w.lng=function(){return v};w.addPostProcessor=G;w.options=z})();(function(a,b){function c(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function d(a){return q?q(a):"[object Array]"===r.call(a)}function e(a){return a&&"[object Object]"===r.call(a)}function g(a,b){var c;a=a||{};b=b||{};for(c in b)b.hasOwnProperty(c)&&null==a[c]&&(a[c]=b[c]);return a}function h(a,b,c){var d=[],e,g;if(!a)return d;if(n&&a.map===n)return a.map(b,c);e=0;for(g=a.length;e<g;e++)d[e]=b.call(c,a[e],e,a);return d}function k(a,b){a=Math.round(Math.abs(a));return isNaN(a)?b:a}function l(a){var b=
m.settings.currency.format;"function"===typeof a&&(a=a());return c(a)&&a.match("%v")?{pos:a,neg:a.replace("-","").replace("%v","-%v"),zero:a}:a&&a.pos&&a.pos.match("%v")?a:c(b)?m.settings.currency.format={pos:b,neg:b.replace("%v","-%v"),zero:b}:b}var m={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},n=Array.prototype.map,q=Array.isArray,r=Object.prototype.toString,u=m.unformat=
m.parse=function(a,b){if(d(a))return h(a,function(a){return u(a,b)});a=a||0;if("number"===typeof a)return a;b=b||m.settings.number.decimal;var c=new RegExp("[^0-9-"+b+"]",["g"]),c=parseFloat((""+a).replace(/\((.*)\)/,"-$1").replace(c,"").replace(b,"."));return isNaN(c)?0:c},w=m.toFixed=function(a,b){b=k(b,m.settings.number.precision);var c=Math.pow(10,b);return(Math.round(m.unformat(a)*c)/c).toFixed(b)},A=m.formatNumber=m.format=function(a,b,c,l){if(d(a))return h(a,function(a){return A(a,b,c,l)});
a=u(a);var n=g(e(b)?b:{precision:b,thousand:c,decimal:l},m.settings.number),q=k(n.precision),r=0>a?"-":"",v=parseInt(w(Math.abs(a||0),q),10)+"",I=3<v.length?v.length%3:0;return r+(I?v.substr(0,I)+n.thousand:"")+v.substr(I).replace(/(\d{3})(?=\d)/g,"$1"+n.thousand)+(q?n.decimal+w(Math.abs(a),q).split(".")[1]:"")},v=m.formatMoney=function(a,b,c,n,q,r){if(d(a))return h(a,function(a){return v(a,b,c,n,q,r)});a=u(a);var w=g(e(b)?b:{symbol:b,precision:c,thousand:n,decimal:q,format:r},m.settings.currency),
E=l(w.format);return(0<a?E.pos:0>a?E.neg:E.zero).replace("%s",w.symbol).replace("%v",A(Math.abs(a),k(w.precision),w.thousand,w.decimal))};m.formatColumn=function(a,b,n,q,r,v){if(!a)return[];var w=g(e(b)?b:{symbol:b,precision:n,thousand:q,decimal:r,format:v},m.settings.currency),E=l(w.format),I=E.pos.indexOf("%s")<E.pos.indexOf("%v")?!0:!1,L=0;a=h(a,function(a,b){if(d(a))return m.formatColumn(a,w);a=u(a);var c=(0<a?E.pos:0>a?E.neg:E.zero).replace("%s",w.symbol).replace("%v",A(Math.abs(a),k(w.precision),
w.thousand,w.decimal));c.length>L&&(L=c.length);return c});return h(a,function(a,b){return c(a)&&a.length<L?I?a.replace(w.symbol,w.symbol+Array(L-a.length+1).join(" ")):Array(L-a.length+1).join(" ")+a:a})};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=m),exports.accounting=m):"function"===typeof define&&define.amd?define([],function(){return m}):(m.noConflict=function(c){return function(){a.accounting=c;m.noConflict=b;return m}}(a.accounting),a.accounting=
m)})(this);(function(a,b){function c(b){return!a(b).parents().andSelf().filter(function(){return"hidden"===a.curCSS(this,"visibility")||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,
PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return"number"===typeof b?this.each(function(){var g=this;setTimeout(function(){a(g).focus();c&&c.call(g)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,
"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var e;c.length&&c[0]!==document;){e=c.css("position");
if("absolute"===e||"relative"===e||"fixed"===e)if(e=parseInt(c.css("zIndex"),10),!isNaN(e)&&0!==e)return e;c=c.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,e){function g(b,c,d,e){a.each(h,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0;d&&(c-=parseFloat(a.curCSS(b,
"border"+this+"Width",!0))||0);e&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var h="Width"===e?["Left","Right"]:["Top","Bottom"],k=e.toLowerCase(),l={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+e]=function(c){return c===b?l["inner"+e].call(this):this.each(function(){a(this).css(k,g(this,c)+"px")})};a.fn["outer"+e]=function(b,c){return"number"!==typeof b?l["outer"+e].call(this,b):this.each(function(){a(this).css(k,
g(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,g){return!!a.data(b,g[3])},focusable:function(b){var e=b.nodeName.toLowerCase(),g=a.attr(b,"tabindex");if("area"===e){e=b.parentNode;g=e.name;if(!b.href||!g||"map"!==e.nodeName.toLowerCase())return!1;b=a("img[usemap=#"+g+"]")[0];return!!b&&c(b)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||!isNaN(g):!isNaN(g))&&c(b)},tabbable:function(b){var c=a.attr(b,"tabindex");return(isNaN(c)||0<=c)&&a(b).is(":focusable")}}),
a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=100===c.offsetHeight;a.support.selectstart="onselectstart"in c;b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,g){b=a.ui[b].prototype;for(var h in g)b.plugins[h]=b.plugins[h]||[],b.plugins[h].push([c,g[h]])},call:function(a,b,c){if((b=a.plugins[b])&&a.element[0].parentNode)for(var h=0;h<b.length;h++)a.options[b[h][0]]&&
b[h][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if("hidden"===a(b).css("overflow"))return!1;c=c&&"left"===c?"scrollLeft":"scrollTop";var g=!1;if(0<b[c])return!0;b[c]=1;g=0<b[c];b[c]=0;return g},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,g,h,k,l){return a.ui.isOverAxis(b,g,k)&&a.ui.isOverAxis(c,h,l)}}))})(jQuery);
(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,h;null!=(h=b[d]);d++)a(h).triggerHandler("remove");c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||b&&!a.filter(b,[this]).length||a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var k=b.split(".")[0],l;b=b.split(".")[1];l=k+"-"+b;d||(d=c,c=a.Widget);a.expr[":"][l]=function(c){return!!a.data(c,b)};
a[k]=a[k]||{};a[k][b]=function(a,b){arguments.length&&this._createWidget(a,b)};c=new c;c.options=a.extend(!0,{},c.options);a[k][b].prototype=a.extend(!0,c,{namespace:k,widgetName:b,widgetEventPrefix:a[k][b].prototype.widgetEventPrefix||b,widgetBaseClass:l},d);a.widget.bridge(b,a[k][b])};a.widget.bridge=function(c,d){a.fn[c]=function(h){var k="string"===typeof h,l=Array.prototype.slice.call(arguments,1),m=this;h=!k&&l.length?a.extend.apply(null,[!0,h].concat(l)):h;if(k&&"_"===h.charAt(0))return m;
k?this.each(function(){var d=a.data(this,c),g=d&&a.isFunction(d[h])?d[h].apply(d,l):d;if(g!==d&&g!==b)return m=g,!1}):this.each(function(){var b=a.data(this,c);b?b.option(h||{})._init():a.data(this,c,new d(h,this))});return m}};a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this);this.element=a(c);this.options=a.extend(!0,{},this.options,this._getCreateOptions(),
b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},
option:function(c,d){var h=c;if(0===arguments.length)return a.extend({},this.options);if("string"===typeof c){if(d===b)return this.options[c];h={};h[c]=d}this._setOptions(h);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b;"disabled"===a&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",
!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var k=this.options[b];c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();d=d||{};if(c.originalEvent){b=a.event.props.length;for(var l;b;)l=a.event.props[--b],c[l]=c.originalEvent[l]}this.element.trigger(c,d);return!(a.isFunction(k)&&!1===k.call(this.element[0],c,d)||c.isDefaultPrevented())}}})(jQuery);
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){b.originalEvent=
b.originalEvent||{};if(!b.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var c=this,d=1==b.which,e="string"==typeof this.options.cancel?a(b.target).parents().add(b.target).filter(this.options.cancel).length:!1;if(!d||e||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=
!1!==this._mouseStart(b),!this._mouseStarted))return b.preventDefault(),!0;!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return c._mouseMove(a)};this._mouseUpDelegate=function(a){return c._mouseUp(a)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();return b.originalEvent.mouseHandled=!0}},_mouseMove:function(b){if(a.browser.msie&&
!(9<=document.documentMode)&&!b.button)return this._mouseUp(b);if(this._mouseStarted)return this._mouseDrag(b),b.preventDefault();this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&((this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,b))?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);this._mouseStarted&&(this._mouseStarted=
!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
(function(a){a.ui=a.ui||{};var b=/left|center|right/,c=/top|center|bottom/,d=a.fn.position,e=a.fn.offset;a.fn.position=function(e){if(!e||!e.of)return d.apply(this,arguments);e=a.extend({},e);var h=a(e.of),k=h[0],l=(e.collision||"flip").split(" "),m=e.offset?e.offset.split(" "):[0,0],n,q,r;9===k.nodeType?(n=h.width(),q=h.height(),r={top:0,left:0}):k.setTimeout?(n=h.width(),q=h.height(),r={top:h.scrollTop(),left:h.scrollLeft()}):k.preventDefault?(e.at="left top",n=q=0,r={top:e.of.pageY,left:e.of.pageX}):
(n=h.outerWidth(),q=h.outerHeight(),r=h.offset());a.each(["my","at"],function(){var a=(e[this]||"").split(" ");1===a.length&&(a=b.test(a[0])?a.concat(["center"]):c.test(a[0])?["center"].concat(a):["center","center"]);a[0]=b.test(a[0])?a[0]:"center";a[1]=c.test(a[1])?a[1]:"center";e[this]=a});1===l.length&&(l[1]=l[0]);m[0]=parseInt(m[0],10)||0;1===m.length&&(m[1]=m[0]);m[1]=parseInt(m[1],10)||0;"right"===e.at[0]?r.left+=n:"center"===e.at[0]&&(r.left+=n/2);"bottom"===e.at[1]?r.top+=q:"center"===e.at[1]&&
(r.top+=q/2);r.left+=m[0];r.top+=m[1];return this.each(function(){var b=a(this),c=b.outerWidth(),d=b.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,k=parseInt(a.curCSS(this,"marginTop",!0))||0,D=c+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),C=d+k+(parseInt(a.curCSS(this,"marginBottom",!0))||0),z=a.extend({},r),F;"right"===e.my[0]?z.left-=c:"center"===e.my[0]&&(z.left-=c/2);"bottom"===e.my[1]?z.top-=d:"center"===e.my[1]&&(z.top-=d/2);z.left=Math.round(z.left);z.top=Math.round(z.top);
F={left:z.left-h,top:z.top-k};a.each(["left","top"],function(b,h){a.ui.position[l[b]]&&a.ui.position[l[b]][h](z,{targetWidth:n,targetHeight:q,elemWidth:c,elemHeight:d,collisionPosition:F,collisionWidth:D,collisionHeight:C,offset:m,my:e.my,at:e.at})});a.fn.bgiframe&&b.bgiframe();b.offset(a.extend(z,{using:e.using}))})};a.ui.position={fit:{left:function(b,c){var d=a(window),d=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=0<d?b.left-d:Math.max(b.left-c.collisionPosition.left,
b.left)},top:function(b,c){var d=a(window),d=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=0<d?b.top-d:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if("center"!==c.at[0]){var d=a(window),d=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),e="left"===c.my[0]?-c.elemWidth:"right"===c.my[0]?c.elemWidth:0,m="left"===c.at[0]?c.targetWidth:-c.targetWidth,n=-2*c.offset[0];b.left+=0>c.collisionPosition.left?e+m+n:0<d?e+m+n:0}},top:function(b,
c){if("center"!==c.at[1]){var d=a(window),d=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),e="top"===c.my[1]?-c.elemHeight:"bottom"===c.my[1]?c.elemHeight:0,m="top"===c.at[1]?c.targetHeight:-c.targetHeight,n=-2*c.offset[1];b.top+=0>c.collisionPosition.top?e+m+n:0<d?e+m+n:0}}}};a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),m=parseInt(a.curCSS(b,"top",!0),10)||0,n=parseInt(a.curCSS(b,
"left",!0),10)||0,e={top:c.top-e.top+m,left:c.left-e.left+n};"using"in c?c.using.call(b,e):d.css(e)},a.fn.offset=function(b){var c=this[0];return c&&c.ownerDocument?b?this.each(function(){a.offset.setOffset(this,b)}):e.call(this):null})})(jQuery);
(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||
(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable"))return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?
!1:(this.handle=this._getHandle(b))?!0:!1},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();a.ui.ddmanager&&(a.ui.ddmanager.current=this);this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,
top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(!1===this._trigger("start",b))return this._clear(),!1;this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");
this._mouseDrag(b,!0);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(!1===this._trigger("drag",b,c))return this._mouseUp({}),!1;this.position=c.position}this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},
_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b));this.dropped&&(c=this.dropped,this.dropped=!1);if(!(this.element[0]&&this.element[0].parentNode||"original"!=this.options.helper))return!1;if("invalid"==this.options.revert&&!c||"valid"==this.options.revert&&c||!0===this.options.revert||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
10),function(){!1!==d._trigger("stop",b)&&d._clear()})}else!1!==this._trigger("stop",b)&&this._clear();return!1},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=this.options.handle&&a(this.options.handle,this.element).length?!1:!0;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],
[b])):"clone"==c.helper?this.element.clone():this.element;b.parents("body").length||b.appendTo("parent"==c.appendTo?this.element[0].parentNode:c.appendTo);b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" "));a.isArray(b)&&(b={left:+b[0],top:+b[1]||0});"left"in b&&(this.offset.click.left=b.left+this.margins.left);"right"in b&&(this.offset.click.left=this.helperProportions.width-
b.right+this.margins.left);"top"in b&&(this.offset.click.top=b.top+this.margins.top);"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==
document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),
10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;"parent"==b.containment&&
(b.containment=this.helper[0].parentNode);if("document"==b.containment||"window"==b.containment)this.containment=[("document"==b.containment?0:a(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,("document"==b.containment?0:a(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,("document"==b.containment?0:a(window).scrollLeft())+a("document"==b.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==b.containment?0:a(window).scrollTop())+
(a("document"==b.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(/^(document|window|parent)$/.test(b.containment)||b.containment.constructor==Array)b.containment.constructor==Array&&(this.containment=b.containment);else{var c=a(b.containment)[0];if(c){var b=a(b.containment).offset(),d="hidden"!=a(c).css("overflow");this.containment=[b.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),
10)||0),b.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),b.left+(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,b.top+(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-
this.margins.top-this.margins.bottom]}}},_convertPositionTo:function(b,c){c||(c=this.position);b="absolute"==b?1:-1;var d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():
e?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName),g=b.pageX,h=b.pageY;
this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(g=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(h=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(g=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(h=this.containment[3]+this.offset.click.top)),c.grid&&(h=this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*
c.grid[1],h=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h,g=this.originalPageX+Math.round((g-this.originalPageX)/c.grid[0])*c.grid[0],g=this.containment?g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2]?g-this.offset.click.left<this.containment[0]?g+c.grid[0]:g-c.grid[0]:g:g));return{top:h-this.offset.click.top-this.offset.relative.top-
this.offset.parent.top+(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&
this.helper.remove();this.helper=null;this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);"drag"==b&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.11"});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,
c){var d=a(this).data("draggable"),e=d.options,g=a.extend({},c,{item:d.element});d.sortables=[];a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,g))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=
!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,"original"==d.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this;a.each(d.sortables,function(){this.instance.positionAbs=d.positionAbs;this.instance.helperProportions=d.helperProportions;this.instance.offset.click=
d.offset.click;this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=
d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",
b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}});a.ui.plugin.add("draggable","cursor",{start:function(){var b=a("body"),c=a(this).data("draggable").options;b.css("cursor")&&(c._cursor=b.css("cursor"));b.css("cursor",c.cursor)},stop:function(){var b=a(this).data("draggable").options;
b._cursor&&a("body").css("cursor",b._cursor)}});a.ui.plugin.add("draggable","iframeFix",{start:function(){var b=a(this).data("draggable").options;a(!0===b.iframeFix?"iframe":b.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")})},stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});
a.ui.plugin.add("draggable","opacity",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;b.css("opacity")&&(c._opacity=b.css("opacity"));b.css("opacity",c.opacity)},stop:function(b,c){b=a(this).data("draggable").options;b._opacity&&a(c.helper).css("opacity",b._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");b.scrollParent[0]!=document&&"HTML"!=b.scrollParent[0].tagName&&(b.overflowOffset=b.scrollParent.offset())},drag:function(b){var c=
a(this).data("draggable"),d=c.options,e=!1;c.scrollParent[0]!=document&&"HTML"!=c.scrollParent[0].tagName?(d.axis&&"x"==d.axis||(c.overflowOffset.top+c.scrollParent[0].offsetHeight-b.pageY<d.scrollSensitivity?c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop+d.scrollSpeed:b.pageY-c.overflowOffset.top<d.scrollSensitivity&&(c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop-d.scrollSpeed)),d.axis&&"y"==d.axis||(c.overflowOffset.left+c.scrollParent[0].offsetWidth-b.pageX<d.scrollSensitivity?
c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft+d.scrollSpeed:b.pageX-c.overflowOffset.left<d.scrollSensitivity&&(c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft-d.scrollSpeed))):(d.axis&&"x"==d.axis||(b.pageY-a(document).scrollTop()<d.scrollSensitivity?e=a(document).scrollTop(a(document).scrollTop()-d.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<d.scrollSensitivity&&(e=a(document).scrollTop(a(document).scrollTop()+d.scrollSpeed))),d.axis&&"y"==d.axis||
(b.pageX-a(document).scrollLeft()<d.scrollSensitivity?e=a(document).scrollLeft(a(document).scrollLeft()-d.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<d.scrollSensitivity&&(e=a(document).scrollLeft(a(document).scrollLeft()+d.scrollSpeed))));!1!==e&&a.ui.ddmanager&&!d.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,b)}});a.ui.plugin.add("draggable","snap",{start:function(){var b=a(this).data("draggable"),c=b.options;b.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":
c.snap).each(function(){var c=a(this),e=c.offset();this!=b.element[0]&&b.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:e.top,left:e.left})})},drag:function(b,c){for(var d=a(this).data("draggable"),e=d.options,g=e.snapTolerance,h=c.offset.left,k=h+d.helperProportions.width,l=c.offset.top,m=l+d.helperProportions.height,n=d.snapElements.length-1;0<=n;n--){var q=d.snapElements[n].left,r=q+d.snapElements[n].width,u=d.snapElements[n].top,w=u+d.snapElements[n].height;if(q-
g<h&&h<r+g&&u-g<l&&l<w+g||q-g<h&&h<r+g&&u-g<m&&m<w+g||q-g<k&&k<r+g&&u-g<l&&l<w+g||q-g<k&&k<r+g&&u-g<m&&m<w+g){if("inner"!=e.snapMode){var A=Math.abs(u-m)<=g,v=Math.abs(w-l)<=g,B=Math.abs(q-k)<=g,D=Math.abs(r-h)<=g;A&&(c.position.top=d._convertPositionTo("relative",{top:u-d.helperProportions.height,left:0}).top-d.margins.top);v&&(c.position.top=d._convertPositionTo("relative",{top:w,left:0}).top-d.margins.top);B&&(c.position.left=d._convertPositionTo("relative",{top:0,left:q-d.helperProportions.width}).left-
d.margins.left);D&&(c.position.left=d._convertPositionTo("relative",{top:0,left:r}).left-d.margins.left)}var C=A||v||B||D;"outer"!=e.snapMode&&(A=Math.abs(u-l)<=g,v=Math.abs(w-m)<=g,B=Math.abs(q-h)<=g,D=Math.abs(r-k)<=g,A&&(c.position.top=d._convertPositionTo("relative",{top:u,left:0}).top-d.margins.top),v&&(c.position.top=d._convertPositionTo("relative",{top:w-d.helperProportions.height,left:0}).top-d.margins.top),B&&(c.position.left=d._convertPositionTo("relative",{top:0,left:q}).left-d.margins.left),
D&&(c.position.left=d._convertPositionTo("relative",{top:0,left:r-d.helperProportions.width}).left-d.margins.left));!d.snapElements[n].snapping&&(A||v||B||D||C)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[n].item}));d.snapElements[n].snapping=A||v||B||D||C}else d.snapElements[n].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[n].item})),d.snapElements[n].snapping=!1}}});
a.ui.plugin.add("draggable","stack",{start:function(){var b=a(this).data("draggable").options,b=a.makeArray(a(b.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(b.length){var c=parseInt(b[0].style.zIndex)||0;a(b).each(function(a){this.style.zIndex=c+a});this[0].style.zIndex=c+b.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;b.css("zIndex")&&(c._zIndex=b.css("zIndex"));
b.css("zIndex",c.zIndex)},stop:function(b,c){b=a(this).data("draggable").options;b._zIndex&&a(c.helper).css("zIndex",b._zIndex)}})})(jQuery);
(function(a){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],
_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null});this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"}),this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),
this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize",
"none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize());this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){"all"==
this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var g=this.handles.split(",");this.handles={};for(var h=0;h<g.length;h++){var k=a.trim(g[h]),l=a('<div class="ui-resizable-handle ui-resizable-'+k+'"></div>');/sw|se|ne|nw/.test(k)&&l.css({zIndex:++c.zIndex});"se"==k&&l.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[k]=".ui-resizable-"+k;this.element.append(l)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=
a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0,e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth(),d=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(d,e);this._proportionallyResize()}a(this.handles[c])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}});c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){a(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())}));this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var c=!1,g;for(g in this.handles)a(this.handles[g])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(c){var e=this.options,g=this.element.position(),
h=this.element;this.resizing=!0;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};(h.is(".ui-draggable")||/absolute/.test(h.css("position")))&&h.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(h.css("position"))&&h.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();var g=b(this.helper.css("left")),k=b(this.helper.css("top"));e.containment&&(g+=a(e.containment).scrollLeft()||0,k+=a(e.containment).scrollTop()||0);this.offset=
this.helper.offset();this.position={left:g,top:k};this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()};this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()};this.originalPosition={left:g,top:k};this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()};this.originalMousePosition={left:c.pageX,top:c.pageY};this.aspectRatio="number"==typeof e.aspectRatio?e.aspectRatio:
this.originalSize.width/this.originalSize.height||1;e=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor","auto"==e?this.axis+"-resize":e);h.addClass("ui-resizable-resizing");this._propagate("start",c);return!0},_mouseDrag:function(a){var b=this.helper,c=this.originalMousePosition,h=this._change[this.axis];if(!h)return!1;c=h.apply(this,[a,a.pageX-c.left||0,a.pageY-c.top||0]);if(this._aspectRatio||a.shiftKey)c=this._updateRatio(c,a);c=this._respectSize(c,a);this._propagate("resize",
a);b.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",a,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options;if(this._helper){var g=this._proportionallyResizeElements,h=g.length&&/textarea/i.test(g[0].nodeName),g=h&&a.ui.hasScroll(g[0],"left")?0:this.sizeDiff.height,h=h?0:
this.sizeDiff.width,h={width:this.helper.width()-h,height:this.helper.height()-g},g=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,k=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;c.animate||this.element.css(a.extend(h,{top:k,left:g}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");
this._propagate("stop",b);this._helper&&this.helper.remove();return!1},_updateCache:function(a){this.offset=this.helper.offset();c(a.left)&&(this.position.left=a.left);c(a.top)&&(this.position.top=a.top);c(a.height)&&(this.size.height=a.height);c(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=this.position,c=this.size,h=this.axis;a.height?a.width=c.height*this.aspectRatio:a.width&&(a.height=c.width/this.aspectRatio);"sw"==h&&(a.left=b.left+(c.width-a.width),a.top=null);"nw"==
h&&(a.top=b.top+(c.height-a.height),a.left=b.left+(c.width-a.width));return a},_respectSize:function(a){var b=this.options,g=this.axis,h=c(a.width)&&b.maxWidth&&b.maxWidth<a.width,k=c(a.height)&&b.maxHeight&&b.maxHeight<a.height,l=c(a.width)&&b.minWidth&&b.minWidth>a.width,m=c(a.height)&&b.minHeight&&b.minHeight>a.height;l&&(a.width=b.minWidth);m&&(a.height=b.minHeight);h&&(a.width=b.maxWidth);k&&(a.height=b.maxHeight);var n=this.originalPosition.left+this.originalSize.width,q=this.position.top+this.size.height,
r=/sw|nw|w/.test(g),g=/nw|ne|n/.test(g);l&&r&&(a.left=n-b.minWidth);h&&r&&(a.left=n-b.maxWidth);m&&g&&(a.top=q-b.minHeight);k&&g&&(a.top=q-b.maxHeight);(b=!a.width&&!a.height)&&!a.left&&a.top?a.top=null:b&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,c=0;c<this._proportionallyResizeElements.length;c++){var g=this._proportionallyResizeElements[c];if(!this.borderDif){var h=[g.css("borderTopWidth"),
g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],k=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=a.map(h,function(a,b){a=parseInt(a,10)||0;b=parseInt(k[b],10)||0;return a+b})}a.browser.msie&&(a(b).is(":hidden")||a(b).parents(":hidden").length)||g.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
this.element.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var c=a.browser.msie&&7>a.browser.version,g=c?1:0,c=c?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+c,height:this.element.outerHeight()+c,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+
b}},w:function(a,b){return{left:this.originalPosition.left+b,width:this.originalSize.width-b}},n:function(a,b,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,g]))},sw:function(b,c,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,g]))},ne:function(b,c,g){return a.extend(this._change.n.apply(this,
arguments),this._change.e.apply(this,[b,c,g]))},nw:function(b,c,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,g]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]);"resize"!=b&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,
{version:"1.8.11"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var b=a(this).data("resizable").options,c=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};"object"!=typeof b.alsoResize||b.alsoResize.parentNode?c(b.alsoResize):b.alsoResize.length?(b.alsoResize=b.alsoResize[0],c(b.alsoResize)):a.each(b.alsoResize,
function(a){c(a)})},resize:function(b,c){var g=a(this).data("resizable");b=g.options;var h=g.originalSize,k=g.originalPosition,l={height:g.size.height-h.height||0,width:g.size.width-h.width||0,top:g.position.top-k.top||0,left:g.position.left-k.left||0},m=function(b,d){a(b).each(function(){var b=a(this),h=a(this).data("resizable-alsoresize"),k={},m=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(m,function(a,b){(a=(h[b]||0)+(l[b]||0))&&
0<=a&&(k[b]=a||null)});a.browser.opera&&/relative/.test(b.css("position"))&&(g._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"}));b.css(k)})};"object"!=typeof b.alsoResize||b.alsoResize.nodeType?m(b.alsoResize):a.each(b.alsoResize,function(a,b){m(a,b)})},stop:function(){var b=a(this).data("resizable"),c=b.options,g=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};b._revertToRelativePosition&&(b._revertToRelativePosition=
!1,"object"!=typeof c.alsoResize||c.alsoResize.nodeType?g(c.alsoResize):a.each(c.alsoResize,function(a){g(a)}));a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(b){var c=a(this).data("resizable"),g=c.options,h=c._proportionallyResizeElements,k=h.length&&/textarea/i.test(h[0].nodeName),l=k&&a.ui.hasScroll(h[0],"left")?0:c.sizeDiff.height,k={width:c.size.width-(k?0:c.sizeDiff.width),height:c.size.height-l},l=parseInt(c.element.css("left"),10)+(c.position.left-
c.originalPosition.left)||null,m=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;c.element.animate(a.extend(k,m&&l?{top:m,left:l}:{}),{duration:g.animateDuration,easing:g.animateEasing,step:function(){var g={width:parseInt(c.element.css("width"),10),height:parseInt(c.element.css("height"),10),top:parseInt(c.element.css("top"),10),left:parseInt(c.element.css("left"),10)};h&&h.length&&a(h[0]).css({width:g.width,height:g.height});c._updateCache(g);c._propagate("resize",
b)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var c=a(this).data("resizable"),e=c.element,g=c.options.containment;if(e=g instanceof a?g.get(0):/parent/.test(g)?e.parent().get(0):g)if(c.containerElement=a(e),/document/.test(g)||g==document)c.containerOffset={left:0,top:0},c.containerPosition={left:0,top:0},c.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var h=a(e),k=[];a(["Top",
"Right","Left","Bottom"]).each(function(a,c){k[a]=b(h.css("padding"+c))});c.containerOffset=h.offset();c.containerPosition=h.position();c.containerSize={height:h.innerHeight()-k[3],width:h.innerWidth()-k[1]};var g=c.containerOffset,l=c.containerSize.height,m=c.containerSize.width,m=a.ui.hasScroll(e,"left")?e.scrollWidth:m,l=a.ui.hasScroll(e)?e.scrollHeight:l;c.parentData={element:e,left:g.left,top:g.top,width:m,height:l}}},resize:function(b){var c=a(this).data("resizable"),g=c.options,h=c.containerOffset,
k=c.position;b=c._aspectRatio||b.shiftKey;var l={top:0,left:0},m=c.containerElement;m[0]!=document&&/static/.test(m.css("position"))&&(l=h);k.left<(c._helper?h.left:0)&&(c.size.width+=c._helper?c.position.left-h.left:c.position.left-l.left,b&&(c.size.height=c.size.width/g.aspectRatio),c.position.left=g.helper?h.left:0);k.top<(c._helper?h.top:0)&&(c.size.height+=c._helper?c.position.top-h.top:c.position.top,b&&(c.size.width=c.size.height*g.aspectRatio),c.position.top=c._helper?h.top:0);c.offset.left=
c.parentData.left+c.position.left;c.offset.top=c.parentData.top+c.position.top;g=Math.abs(c.offset.left-l.left+c.sizeDiff.width);h=Math.abs((c._helper?c.offset.top-l.top:c.offset.top-h.top)+c.sizeDiff.height);k=c.containerElement.get(0)==c.element.parent().get(0);l=/relative|absolute/.test(c.containerElement.css("position"));k&&l&&(g-=c.parentData.left);g+c.size.width>=c.parentData.width&&(c.size.width=c.parentData.width-g,b&&(c.size.height=c.size.width/c.aspectRatio));h+c.size.height>=c.parentData.height&&
(c.size.height=c.parentData.height-h,b&&(c.size.width=c.size.height*c.aspectRatio))},stop:function(){var b=a(this).data("resizable"),c=b.options,g=b.containerOffset,h=b.containerPosition,k=b.containerElement,l=a(b.helper),m=l.offset(),n=l.outerWidth()-b.sizeDiff.width,l=l.outerHeight()-b.sizeDiff.height;b._helper&&!c.animate&&/relative/.test(k.css("position"))&&a(this).css({left:m.left-h.left-g.left,width:n,height:l});b._helper&&!c.animate&&/static/.test(k.css("position"))&&a(this).css({left:m.left-
h.left-g.left,width:n,height:l})}});a.ui.plugin.add("resizable","ghost",{start:function(){var b=a(this).data("resizable"),c=b.options,g=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:.25,display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof c.ghost?c.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=a(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,
width:b.size.width})},stop:function(){var b=a(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var b=a(this).data("resizable"),c=b.options,g=b.size,h=b.originalSize,k=b.originalPosition,l=b.axis;c.grid="number"==typeof c.grid?[c.grid,c.grid]:c.grid;var m=Math.round((g.width-h.width)/(c.grid[0]||1))*(c.grid[0]||1),c=Math.round((g.height-h.height)/(c.grid[1]||1))*(c.grid[1]||1);/^(se|s|e)$/.test(l)?(b.size.width=
h.width+m,b.size.height=h.height+c):/^(ne)$/.test(l)?(b.size.width=h.width+m,b.size.height=h.height+c,b.position.top=k.top-c):(/^(sw)$/.test(l)?(b.size.width=h.width+m,b.size.height=h.height+c):(b.size.width=h.width+m,b.size.height=h.height+c,b.position.top=k.top-c),b.position.left=k.left-m)}});var b=function(a){return parseInt(a,10)||0},c=function(a){return!isNaN(parseInt(a,10))}})(jQuery);
(function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=
this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;0<=a;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(b,c){"disabled"===b?(this.options[b]=c,this.widget()[c?
"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){if(this.reverting||this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(b);var d=null,e=this;a(b.target).parents().each(function(){if(a.data(this,"sortable-item")==e)return d=a(this),!1});a.data(b.target,"sortable-item")==e&&(d=a(b.target));if(!d)return!1;if(this.options.handle&&!c){var g=!1;a(this.options.handle,d).find("*").andSelf().each(function(){this==
b.target&&(g=!0)});if(!g)return!1}this.currentItem=d;this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){c=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(b);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=
this.helper.css("position");a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();
c.containment&&this._setContainment();c.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",c.cursor));c.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",c.opacity));c.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",c.zIndex));this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());
this._trigger("start",b,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;0<=d;d--)this.containers[d]._trigger("activate",b,this._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this);a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");
this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+
this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+
c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)));!1!==d&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px");
this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(c=this.items.length-1;0<=c;c--){var d=this.items[c],e=d.item[0],g=this._intersectsWithPointer(d);if(g&&e!=this.currentItem[0]&&this.placeholder[1==g?"next":"prev"]()[0]!=e&&!a.ui.contains(this.placeholder[0],e)&&("semi-dynamic"==this.options.type?!a.ui.contains(this.element[0],e):1)){this.direction=1==g?"down":"up";if("pointer"==this.options.tolerance||this._intersectsWithSides(d))this._rearrange(b,d);
else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b);a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this;c=d.placeholder.offset();d.reverting=!0;a(this.helper).animate({left:c.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?
0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;0<=b;b--)this.containers[b]._trigger("deactivate",
null,this._uiHash(this)),this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",null,this._uiHash(this)),this.containers[b].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):
a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))});!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||
"id")||"")});return d},_intersectsWith:function(a){var c=this.positionAbs.left,d=c+this.helperProportions.width,e=this.positionAbs.top,g=e+this.helperProportions.height,h=a.left,k=h+a.width,l=a.top,m=l+a.height,n=this.offset.click.top,q=this.offset.click.left;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?e+n>l&&e+n<m&&c+q>h&&c+q<k:h<c+this.helperProportions.width/
2&&d-this.helperProportions.width/2<k&&l<e+this.helperProportions.height/2&&g-this.helperProportions.height/2<m},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width);c=c&&b;b=this._getDragVerticalDirection();var d=this._getDragHorizontalDirection();return c?this.floating?d&&"right"==d||"down"==b?2:1:b&&("down"==b?2:1):!1},_intersectsWithSides:function(b){var c=
a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width);var d=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?"right"==e&&b||"left"==e&&!b:d&&("down"==d&&c||"up"==d&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!=a&&(0<a?"down":"up")},_getDragHorizontalDirection:function(){var a=
this.positionAbs.left-this.lastPositionAbs.left;return 0!=a&&(0<a?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=[],d=[],e=this._connectWith();if(e&&b)for(b=e.length-1;0<=b;b--)for(var g=a(e[b]),h=g.length-1;0<=h;h--){var k=a.data(g[h],"sortable");k&&k!=this&&!k.options.disabled&&d.push([a.isFunction(k.options.items)?
k.options.items.call(k.element):a(k.options.items,k.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),k])}d.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(b=d.length-1;0<=b;b--)d[b][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),
c=0;c<this.items.length;c++)for(var d=0;d<a.length;d++)a[d]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(b){this.items=[];this.containers=[this];var c=this.items,d=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var g=e.length-1;0<=g;g--)for(var h=a(e[g]),k=h.length-1;0<=k;k--){var l=a.data(h[k],"sortable");l&&l!=this&&!l.options.disabled&&(d.push([a.isFunction(l.options.items)?
l.options.items.call(l.element[0],b,{item:this.currentItem}):a(l.options.items,l.element),l]),this.containers.push(l))}for(g=d.length-1;0<=g;g--)for(b=d[g][1],e=d[g][0],k=0,h=e.length;k<h;k++)l=a(e[k]),l.data("sortable-item",b),c.push({item:l,instance:b,width:0,height:0,left:0,top:0})},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;0<=c;c--){var d=this.items[c],e=this.options.toleranceElement?a(this.options.toleranceElement,
d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());e=e.offset();d.left=e.left;d.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;0<=c;c--)e=this.containers[c].element.offset(),this.containers[c].containerCache.left=e.left,this.containers[c].containerCache.top=e.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=
this.containers[c].element.outerHeight();return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-
parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){for(var c=null,d=null,e=this.containers.length-1;0<=e;e--)a.ui.contains(this.currentItem[0],
this.containers[e].element[0])||(this._intersectsWith(this.containers[e].containerCache)?c&&a.ui.contains(this.containers[e].element[0],c.element[0])||(c=this.containers[e],d=e):this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){for(var c=
1E4,e=null,g=this.positionAbs[this.containers[d].floating?"left":"top"],h=this.items.length-1;0<=h;h--)if(a.ui.contains(this.containers[d].element[0],this.items[h].item[0])){var k=this.items[h][this.containers[d].floating?"left":"top"];Math.abs(k-g)<c&&(c=Math.abs(k-g),e=this.items[h])}if(e||this.options.dropOnEmpty)this.currentContainer=this.containers[d],e?this._rearrange(b,e,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",
b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):"clone"==c.helper?this.currentItem.clone():this.currentItem;b.parents("body").length||a("parent"!=c.appendTo?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0]);b[0]==this.currentItem[0]&&
(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(""==b[0].style.width||c.forceHelperSize)&&b.width(this.currentItem.width());(""==b[0].style.height||c.forceHelperSize)&&b.height(this.currentItem.height());return b},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" "));a.isArray(b)&&(b={left:+b[0],top:+b[1]||0});"left"in b&&
(this.offset.click.left=b.left+this.margins.left);"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left);"top"in b&&(this.offset.click.top=b.top+this.margins.top);"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&
(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),
10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;"parent"==b.containment&&(b.containment=
this.helper[0].parentNode);if("document"==b.containment||"window"==b.containment)this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a("document"==b.containment?document:window).width()-this.helperProportions.width-this.margins.left,(a("document"==b.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=
a(b.containment)[0],b=a(b.containment).offset(),d="hidden"!=a(c).css("overflow");this.containment=[b.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,b.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,b.left+(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-
this.margins.left,b.top+(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);b="absolute"==b?1:-1;var d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);return{top:c.top+
this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],
this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var g=b.pageX,h=b.pageY;this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(g=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(h=this.containment[1]+this.offset.click.top),
b.pageX-this.offset.click.left>this.containment[2]&&(g=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(h=this.containment[3]+this.offset.click.top)),c.grid&&(h=this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1],h=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h,g=this.originalPageX+Math.round((g-this.originalPageX)/
c.grid[0])*c.grid[0],g=this.containment?g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2]?g-this.offset.click.left<this.containment[0]?g+c.grid[0]:g-c.grid[0]:g:g));return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&
"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,c,d,e){d?d[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?c.item[0]:c.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var g=this,h=this.counter;window.setTimeout(function(){h==g.counter&&g.refreshPositions(!e)},0)},_clear:function(b,c){this.reverting=!1;var d=[];!this._noFinalSort&&this.currentItem[0].parentNode&&
this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if("auto"==this._storedCSS[e]||"static"==this._storedCSS[e])this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&
this.domPosition.parent==this.currentItem.parent()[0]||c||d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0]))for(c||d.push(function(a){this._trigger("remove",a,this._uiHash())}),e=this.containers.length-1;0<=e;e--)a.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[e])),d.push(function(a){return function(b){a._trigger("update",
b,this._uiHash(this))}}.call(this,this.containers[e])));for(e=this.containers.length-1;0<=e;e--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",
this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(e=0;e<d.length;e++)d[e].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(e=
0;e<d.length;e++)d[e].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){!1===a.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}});a.extend(a.ui.sortable,{version:"1.8.11"})})(jQuery);
(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,c=this.options;this._mouseSliding=this._keySliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");c.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
this.range=a([]);c.range&&(!0===c.range?(this.range=a("<div></div>"),c.values||(c.values=[this._valueMin(),this._valueMin()]),c.values.length&&2!==c.values.length&&(c.values=[c.values[0],c.values[0]])):this.range=a("<div></div>"),this.range.appendTo(this.element).addClass("ui-slider-range"),"min"!==c.range&&"max"!==c.range||this.range.addClass("ui-slider-range-"+c.range),this.range.addClass("ui-widget-header"));0===a(".ui-slider-handle",this.element).length&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(c.values&&c.values.length)for(;a(".ui-slider-handle",this.element).length<c.values.length;)a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){c.disabled?
a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)});this.handles.keydown(function(c){var e=!0,g=a(this).data("index.ui-slider-handle"),h,k,l;if(!b.options.disabled){switch(c.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(e=
!1,!b._keySliding&&(b._keySliding=!0,a(this).addClass("ui-state-active"),h=b._start(c,g),!1===h))return}l=b.options.step;h=b.options.values&&b.options.values.length?k=b.values(g):k=b.value();switch(c.keyCode){case a.ui.keyCode.HOME:k=b._valueMin();break;case a.ui.keyCode.END:k=b._valueMax();break;case a.ui.keyCode.PAGE_UP:k=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:k=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===
b._valueMax())return;k=b._trimAlignValue(h+l);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;k=b._trimAlignValue(h-l)}b._slide(c,g,k);return e}}).keyup(function(c){var e=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,e),b._change(c,e),a(this).removeClass("ui-state-active"))});this._refreshValue();this._animateOff=!1},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,g,h,k;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();d=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(b){var c=Math.abs(d-h.values(b));e>c&&(e=c,g=a(this),k=b)});!0===c.range&&this.values(1)===c.min&&(k+=1,g=a(this.handles[k]));if(!1===this._start(b,
k))return!1;this._mouseSliding=!0;h._handleIndex=k;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=a(b.target).parents().andSelf().is(".ui-slider-handle")?{left:b.pageX-c.left-g.width()/2,top:b.pageY-c.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)}:{left:0,top:0};this.handles.hasClass("ui-state-hover")||this._slide(b,k,d);return this._animateOff=!0},_mouseStart:function(){return!0},
_mouseDrag:function(a){var c=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=!1;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var c;"horizontal"===
this.orientation?(c=this.elementSize.width,a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(c=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));c=a/c;1<c&&(c=1);0>c&&(c=0);"vertical"===this.orientation&&(c=1-c);a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*a)},_start:function(a,c){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=
this.values(c),d.values=this.values());return this._trigger("start",a,d)},_slide:function(a,c,d){var e;this.options.values&&this.options.values.length?(e=this.values(c?0:1),2===this.options.values.length&&!0===this.options.range&&(0===c&&d>e||1===c&&d<e)&&(d=e),d!==this.values(c)&&(e=this.values(),e[c]=d,a=this._trigger("slide",a,{handle:this.handles[c],value:d,values:e}),this.values(c?0:1),!1!==a&&this.values(c,d,!0))):d!==this.value()&&(a=this._trigger("slide",a,{handle:this.handles[c],value:d}),
!1!==a&&this.value(d))},_stop:function(a,c){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(c),d.values=this.values());this._trigger("stop",a,d)},_change:function(a,c){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(c),d.values=this.values());this._trigger("change",a,d)}},value:function(a){arguments.length&&(this.options.value=
this._trimAlignValue(a),this._refreshValue(),this._change(null,0));return this._value()},values:function(b,c){var d,e,g;1<arguments.length&&(this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b));if(arguments.length)if(a.isArray(arguments[0])){d=this.options.values;e=arguments[0];for(g=0;g<d.length;g+=1)d[g]=this._trimAlignValue(e[g]),this._change(null,g);this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):this.value();
else return this._values()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length);a.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.attr("disabled","disabled"),this.element.addClass("ui-disabled")):(this.handles.removeAttr("disabled"),this.element.removeClass("ui-disabled"));break;case "orientation":this._detectOrientation();
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){return this._trimAlignValue(this.options.value)},_values:function(a){var c,d;if(arguments.length)return c=this.options.values[a],this._trimAlignValue(c);
c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var c=0<this.options.step?this.options.step:1,d=(a-this._valueMin())%c;alignValue=a-d;2*Math.abs(d)>=c&&(alignValue+=0<d?c:-c);return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=
this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,g,h={},k,l,m,n;if(this.options.values&&this.options.values.length)this.handles.each(function(b){g=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100;h["horizontal"===d.orientation?"left":"bottom"]=g+"%";a(this).stop(1,1)[e?"animate":"css"](h,c.animate);if(!0===d.options.range)if("horizontal"===d.orientation){if(0===b)d.range.stop(1,1)[e?"animate":"css"]({left:g+"%"},c.animate);if(1===b)d.range[e?"animate":"css"]({width:g-
k+"%"},{queue:!1,duration:c.animate})}else{if(0===b)d.range.stop(1,1)[e?"animate":"css"]({bottom:g+"%"},c.animate);if(1===b)d.range[e?"animate":"css"]({height:g-k+"%"},{queue:!1,duration:c.animate})}k=g});else{l=this.value();m=this._valueMin();n=this._valueMax();g=n!==m?(l-m)/(n-m)*100:0;h["horizontal"===d.orientation?"left":"bottom"]=g+"%";this.handle.stop(1,1)[e?"animate":"css"](h,c.animate);if("min"===b&&"horizontal"===this.orientation)this.range.stop(1,1)[e?"animate":"css"]({width:g+"%"},c.animate);
if("max"===b&&"horizontal"===this.orientation)this.range[e?"animate":"css"]({width:100-g+"%"},{queue:!1,duration:c.animate});if("min"===b&&"vertical"===this.orientation)this.range.stop(1,1)[e?"animate":"css"]({height:g+"%"},c.animate);if("max"===b&&"vertical"===this.orientation)this.range[e?"animate":"css"]({height:100-g+"%"},{queue:!1,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.11"})})(jQuery);
(function(a,b){function c(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:"January February March April May June July August September October November December".split(" "),monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),
weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,
beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1};a.extend(this._defaults,this.regional[""]);this.dpDiv=a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function d(c,d){a.extend(c,d);for(var e in d)if(null==d[e]||d[e]==b)c[e]=d[e];return c}a.extend(a.ui,{datepicker:{version:"1.8.11"}});
var e=(new Date).getTime();a.extend(c.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){d(this._defaults,a||{});return this},_attachDatepicker:function(b,c){var d=null,e;for(e in this._defaults){var m=b.getAttribute("date:"+e);if(m){d=d||{};try{d[e]=eval(m)}catch(n){d[e]=m}}}e=b.nodeName.toLowerCase();m="div"==e||"span"==e;b.id||(this.uuid+=1,b.id="dp"+this.uuid);var q=this._newInst(a(b),
m);q.settings=a.extend({},c||{},d||{});"input"==e?this._connectDatepicker(b,q):m&&this._inlineDatepicker(b,q)},_newInst:function(b,c){return{id:b[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'):this.dpDiv}},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]);c.trigger=a([]);d.hasClass(this.markerClassName)||
(this._attachments(d,c),d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,b,d){c.settings[b]=d}).bind("getData.datepicker",function(a,b){return this._get(c,b)}),this._autoSize(c),a.data(b,"datepicker",c))},_attachments:function(b,c){var d=this._get(c,"appendText"),e=this._get(c,"isRTL");c.append&&c.append.remove();d&&(c.append=a('<span class="'+this._appendClass+'">'+d+"</span>"),b[e?"before":"after"](c.append));
b.unbind("focus",this._showDatepicker);c.trigger&&c.trigger.remove();d=this._get(c,"showOn");"focus"!=d&&"both"!=d||b.focus(this._showDatepicker);if("button"==d||"both"==d){var d=this._get(c,"buttonText"),m=this._get(c,"buttonImage");c.trigger=a(this._get(c,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:m,alt:d,title:d}):a('<button type="button"></button>').addClass(this._triggerClass).html(""==m?d:a("<img/>").attr({src:m,alt:d,title:d})));b[e?"before":"after"](c.trigger);c.trigger.click(function(){a.datepicker._datepickerShowing&&
a.datepicker._lastInput==b[0]?a.datepicker._hideDatepicker():a.datepicker._showDatepicker(b[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){for(var b=0,c=0,d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",
this._formatDate(a,b).length)}},_inlineDatepicker:function(b,c){var d=a(b);d.hasClass(this.markerClassName)||(d.addClass(this.markerClassName).append(c.dpDiv).bind("setData.datepicker",function(a,b,d){c.settings[b]=d}).bind("getData.datepicker",function(a,b){return this._get(c,b)}),a.data(b,"datepicker",c),this._setDate(c,this._getDefaultDate(c),!0),this._updateDatepicker(c),this._updateAlternate(c),c.dpDiv.show())},_dialogDatepicker:function(b,c,e,l,m){b=this._dialogInst;b||(this.uuid+=1,this._dialogInput=
a('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),a("body").append(this._dialogInput),b=this._dialogInst=this._newInst(this._dialogInput,!1),b.settings={},a.data(this._dialogInput[0],"datepicker",b));d(b.settings,l||{});c=c&&c.constructor==Date?this._formatDate(b,c):c;this._dialogInput.val(c);this._pos=m?m.length?m:[m.pageX,m.pageY]:null;this._pos||(this._pos=[document.documentElement.clientWidth/
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]);this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");b.settings.onSelect=e;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",b);return this},_destroyDatepicker:function(b){var c=
a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=b.nodeName.toLowerCase();a.removeData(b,"datepicker");"input"==e?(d.append.remove(),d.trigger.remove(),c.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=e&&"span"!=e||c.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(b){var c=a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=
b.nodeName.toLowerCase();"input"==e?(b.disabled=!1,d.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!=e&&"span"!=e||c.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(a){return a==b?null:a})}},_disableDatepicker:function(b){var c=a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=b.nodeName.toLowerCase();"input"==e?(b.disabled=
!0,d.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!=e&&"span"!=e||c.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(a){return a==b?null:a});this._disabledInputs[this._disabledInputs.length]=b}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(b){try{return a.data(b,
"datepicker")}catch(c){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(c,e,k){var l=this._getInst(c);if(2==arguments.length&&"string"==typeof e)return"defaults"==e?a.extend({},a.datepicker._defaults):l?"all"==e?a.extend({},l.settings):this._get(l,e):null;var m=e||{};"string"==typeof e&&(m={},m[e]=k);if(l){this._curInst==l&&this._hideDatepicker();var n=this._getDateDatepicker(c,!0),q=this._getMinMaxDate(l,"min"),r=this._getMinMaxDate(l,"max");d(l.settings,m);null!==q&&
m.dateFormat!==b&&m.minDate===b&&(l.settings.minDate=this._formatDate(l,q));null!==r&&m.dateFormat!==b&&m.maxDate===b&&(l.settings.maxDate=this._formatDate(l,r));this._attachments(a(c),l);this._autoSize(l);this._setDateDatepicker(c,n);this._updateDatepicker(l)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a))this._setDate(a,b),this._updateDatepicker(a),
this._updateAlternate(a)},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(b){var c=a.datepicker._getInst(b.target),d=!0,e=c.dpDiv.is(".ui-datepicker-rtl");c._keyEvent=!0;if(a.datepicker._datepickerShowing)switch(b.keyCode){case 9:a.datepicker._hideDatepicker();d=!1;break;case 13:return d=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",c.dpDiv),d[0]?a.datepicker._selectDay(b.target,
c.selectedMonth,c.selectedYear,d[0]):a.datepicker._hideDatepicker(),!1;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(c,"stepBigMonths"):-a.datepicker._get(c,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(c,"stepBigMonths"):+a.datepicker._get(c,"stepMonths"),"M");break;case 35:(b.ctrlKey||b.metaKey)&&a.datepicker._clearDate(b.target);d=b.ctrlKey||b.metaKey;break;case 36:(b.ctrlKey||
b.metaKey)&&a.datepicker._gotoToday(b.target);d=b.ctrlKey||b.metaKey;break;case 37:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,e?1:-1,"D");d=b.ctrlKey||b.metaKey;b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(c,"stepBigMonths"):-a.datepicker._get(c,"stepMonths"),"M");break;case 38:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,-7,"D");d=b.ctrlKey||b.metaKey;break;case 39:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,e?-1:
1,"D");d=b.ctrlKey||b.metaKey;b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(c,"stepBigMonths"):+a.datepicker._get(c,"stepMonths"),"M");break;case 40:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,7,"D");d=b.ctrlKey||b.metaKey;break;default:d=!1}else 36==b.keyCode&&b.ctrlKey?a.datepicker._showDatepicker(this):d=!1;d&&(b.preventDefault(),b.stopPropagation())},_doKeyPress:function(c){var d=a.datepicker._getInst(c.target);if(a.datepicker._get(d,"constrainInput")){var d=
a.datepicker._possibleChars(a.datepicker._get(d,"dateFormat")),e=String.fromCharCode(c.charCode==b?c.keyCode:c.charCode);return c.ctrlKey||c.metaKey||" ">e||!d||-1<d.indexOf(e)}},_doKeyUp:function(b){b=a.datepicker._getInst(b.target);if(b.input.val()!=b.lastVal)try{a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,a.datepicker._getFormatConfig(b))&&(a.datepicker._setDateFromField(b),a.datepicker._updateAlternate(b),a.datepicker._updateDatepicker(b))}catch(c){a.datepicker.log(c)}return!0},
_showDatepicker:function(b){b=b.target||b;"input"!=b.nodeName.toLowerCase()&&(b=a("input",b.parentNode)[0]);if(!a.datepicker._isDisabledDatepicker(b)&&a.datepicker._lastInput!=b){var c=a.datepicker._getInst(b);a.datepicker._curInst&&a.datepicker._curInst!=c&&a.datepicker._curInst.dpDiv.stop(!0,!0);var e=a.datepicker._get(c,"beforeShow");d(c.settings,e?e.apply(b,[b,c]):{});c.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(c);a.datepicker._inDialog&&(b.value="");a.datepicker._pos||
(a.datepicker._pos=a.datepicker._findPos(b),a.datepicker._pos[1]+=b.offsetHeight);var l=!1;a(b).parents().each(function(){l|="fixed"==a(this).css("position");return!l});l&&a.browser.opera&&(a.datepicker._pos[0]-=document.documentElement.scrollLeft,a.datepicker._pos[1]-=document.documentElement.scrollTop);e={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;c.dpDiv.empty();c.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(c);e=
a.datepicker._checkOffset(c,e,l);c.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":l?"fixed":"absolute",display:"none",left:e.left+"px",top:e.top+"px"});if(!c.inline){var e=a.datepicker._get(c,"showAnim"),m=a.datepicker._get(c,"duration"),n=function(){a.datepicker._datepickerShowing=!0;var b=c.dpDiv.find("iframe.ui-datepicker-cover");if(b.length){var d=a.datepicker._getBorders(c.dpDiv);b.css({left:-d[0],top:-d[1],width:c.dpDiv.outerWidth(),height:c.dpDiv.outerHeight()})}};c.dpDiv.zIndex(a(b).zIndex()+
1);a.effects&&a.effects[e]?c.dpDiv.show(e,a.datepicker._get(c,"showOptions"),m,n):c.dpDiv[e||"show"](e?m:null,n);e&&m||n();c.input.is(":visible")&&!c.input.is(":disabled")&&c.input.focus();a.datepicker._curInst=c}}},_updateDatepicker:function(b){var c=this,d=a.datepicker._getBorders(b.dpDiv);b.dpDiv.empty().append(this._generateHTML(b));var e=b.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-d[0],top:-d[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()});b.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",
function(){a(this).removeClass("ui-state-hover");-1!=this.className.indexOf("ui-datepicker-prev")&&a(this).removeClass("ui-datepicker-prev-hover");-1!=this.className.indexOf("ui-datepicker-next")&&a(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){c._isDisabledDatepicker(b.inline?b.dpDiv.parent()[0]:b.input[0])||(a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),a(this).addClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&
a(this).addClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&a(this).addClass("ui-datepicker-next-hover"))}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();d=this._getNumberOfMonths(b);e=d[1];1<e?b.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");b.dpDiv[(1!=d[0]||1!=d[1]?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");b==a.datepicker._curInst&&a.datepicker._datepickerShowing&&b.input&&b.input.is(":visible")&&!b.input.is(":disabled")&&b.input[0]!=document.activeElement&&b.input.focus();if(b.yearshtml){var m=b.yearshtml;setTimeout(function(){m===b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);m=b.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),
parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(b,c,d){var e=b.dpDiv.outerWidth(),m=b.dpDiv.outerHeight(),n=b.input?b.input.outerWidth():0,q=b.input?b.input.outerHeight():0,r=document.documentElement.clientWidth+a(document).scrollLeft(),u=document.documentElement.clientHeight+a(document).scrollTop();c.left-=this._get(b,"isRTL")?e-n:0;c.left-=d&&c.left==b.input.offset().left?a(document).scrollLeft():0;c.top-=d&&c.top==b.input.offset().top+q?a(document).scrollTop():0;c.left-=Math.min(c.left,
c.left+e>r&&r>e?Math.abs(c.left+e-r):0);c.top-=Math.min(c.top,c.top+m>u&&u>m?Math.abs(m+q):0);return c},_findPos:function(b){for(var c=this._get(this._getInst(b),"isRTL");b&&("hidden"==b.type||1!=b.nodeType||a.expr.filters.hidden(b));)b=b[c?"previousSibling":"nextSibling"];b=a(b).offset();return[b.left,b.top]},_hideDatepicker:function(b){var c=this._curInst;if(c&&(!b||c==a.data(b,"datepicker"))&&this._datepickerShowing){b=this._get(c,"showAnim");var d=this._get(c,"duration"),e=function(){a.datepicker._tidyDialog(c);
this._curInst=null};a.effects&&a.effects[b]?c.dpDiv.hide(b,a.datepicker._get(c,"showOptions"),d,e):c.dpDiv["slideDown"==b?"slideUp":"fadeIn"==b?"fadeOut":"hide"](b?d:null,e);b||e();(b=this._get(c,"onClose"))&&b.apply(c.input?c.input[0]:null,[c.input?c.input.val():"",c]);this._datepickerShowing=!1;this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),a.blockUI&&(a.unblockUI(),a("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
_checkExternalClick:function(b){a.datepicker._curInst&&(b=a(b.target),b[0].id==a.datepicker._mainDivId||0!=b.parents("#"+a.datepicker._mainDivId).length||b.hasClass(a.datepicker.markerClassName)||b.hasClass(a.datepicker._triggerClass)||!a.datepicker._datepickerShowing||a.datepicker._inDialog&&a.blockUI||a.datepicker._hideDatepicker())},_adjustDate:function(b,c,d){b=a(b);var e=this._getInst(b[0]);this._isDisabledDatepicker(b[0])||(this._adjustInstDate(e,c+("M"==d?this._get(e,"showCurrentAtPos"):0),
d),this._updateDatepicker(e))},_gotoToday:function(b){b=a(b);var c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate();c.drawMonth=c.selectedMonth=d.getMonth();c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c);this._adjustDate(b)},_selectMonthYear:function(b,c,d){b=a(b);var e=this._getInst(b[0]);e._selectingMonthYear=
!1;e["selected"+("M"==d?"Month":"Year")]=e["draw"+("M"==d?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(b)},_clickMonthYear:function(b){var c=this._getInst(a(b)[0]);c.input&&c._selectingMonthYear&&setTimeout(function(){c.input.focus()},0);c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(b,c,d,e){var m=a(b);a(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(m[0])||(m=this._getInst(m[0]),m.selectedDay=m.currentDay=
a("a",e).html(),m.selectedMonth=m.currentMonth=c,m.selectedYear=m.currentYear=d,this._selectDate(b,this._formatDate(m,m.currentDay,m.currentMonth,m.currentYear)))},_clearDate:function(b){b=a(b);this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(b,c){b=this._getInst(a(b)[0]);c=null!=c?c:this._formatDate(b);b.input&&b.input.val(c);this._updateAlternate(b);var d=this._get(b,"onSelect");d?d.apply(b.input?b.input[0]:null,[c,b]):b.input&&b.input.trigger("change");b.inline?this._updateDatepicker(b):
(this._hideDatepicker(),this._lastInput=b.input[0],"object"!=typeof b.input[0]&&b.input.focus(),this._lastInput=null)},_updateAlternate:function(b){var c=this._get(b,"altField");if(c){var d=this._get(b,"altFormat")||this._get(b,"dateFormat"),e=this._getDate(b),m=this.formatDate(d,e,this._getFormatConfig(b));a(c).each(function(){a(this).val(m)})}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=
a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(null==a||null==b)throw"Invalid arguments";b="object"==typeof b?b.toString():b+"";if(""==b)return null;for(var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof d?d:(new Date).getFullYear()%100+parseInt(d,10),e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,n=(c?c.dayNames:null)||this._defaults.dayNames,q=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
r=(c?c.monthNames:null)||this._defaults.monthNames,u=c=-1,w=-1,A=-1,v=!1,B=function(b){(b=G+1<a.length&&a.charAt(G+1)==b)&&G++;return b},D=function(a){var c=B(a);a=new RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}");a=b.substring(F).match(a);if(!a)throw"Missing number at position "+F;F+=a[0].length;return parseInt(a[0],10)},C=function(a,c,d){a=B(a)?d:c;for(c=0;c<a.length;c++)if(b.substr(F,a[c].length).toLowerCase()==a[c].toLowerCase())return F+=a[c].length,c+1;throw"Unknown name at position "+
F;},z=function(){if(b.charAt(F)!=a.charAt(G))throw"Unexpected literal at position "+F;F++},F=0,G=0;G<a.length;G++)if(v)"'"!=a.charAt(G)||B("'")?z():v=!1;else switch(a.charAt(G)){case "d":w=D("d");break;case "D":C("D",e,n);break;case "o":A=D("o");break;case "m":u=D("m");break;case "M":u=C("M",q,r);break;case "y":c=D("y");break;case "@":var J=new Date(D("@"));c=J.getFullYear();u=J.getMonth()+1;w=J.getDate();break;case "!":J=new Date((D("!")-this._ticksTo1970)/1E4);c=J.getFullYear();u=J.getMonth()+1;
w=J.getDate();break;case "'":B("'")?z():v=!0;break;default:z()}-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=d?0:-100));if(-1<A){u=1;w=A;do{d=this._getDaysInMonth(c,u-1);if(w<=d)break;u++;w-=d}while(1)}J=this._daylightSavingAdjust(new Date(c,u-1,w));if(J.getFullYear()!=c||J.getMonth()+1!=u||J.getDate()!=w)throw"Invalid date";return J},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",
RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864E9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,n=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var q=function(b){(b=v+1<a.length&&a.charAt(v+1)==b)&&v++;return b},
r=function(a,b,c){b=""+b;if(q(a))for(;b.length<c;)b="0"+b;return b},u=function(a,b,c,d){return q(a)?d[b]:c[b]},w="",A=!1;if(b)for(var v=0;v<a.length;v++)if(A)"'"!=a.charAt(v)||q("'")?w+=a.charAt(v):A=!1;else switch(a.charAt(v)){case "d":w+=r("d",b.getDate(),2);break;case "D":w+=u("D",b.getDay(),d,e);break;case "o":w+=r("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":w+=r("m",b.getMonth()+1,2);break;case "M":w+=u("M",b.getMonth(),n,c);break;case "y":w+=q("y")?b.getFullYear():
(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":w+=b.getTime();break;case "!":w+=1E4*b.getTime()+this._ticksTo1970;break;case "'":q("'")?w+="'":A=!0;break;default:w+=a.charAt(v)}return w},_possibleChars:function(a){for(var b="",c=!1,d=function(b){(b=e+1<a.length&&a.charAt(e+1)==b)&&e++;return b},e=0;e<a.length;e++)if(c)"'"!=a.charAt(e)||d("'")?b+=a.charAt(e):c=!1;else switch(a.charAt(e)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":d("'")?
b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,c){return a.settings[c]!==b?a.settings[c]:this._defaults[c]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,n;e=n=this._getDefaultDate(a);var q=this._getFormatConfig(a);try{e=this.parseDate(c,d,q)||n}catch(r){this.log(r),d=b?"":d}a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();a.currentDay=
d?e.getDate():0;a.currentMonth=d?e.getMonth():0;a.currentYear=d?e.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(b,c,d){var e=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},m=function(c){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),c,a.datepicker._getFormatConfig(b))}catch(d){}for(var e=(c.toLowerCase().match(/^c/)?a.datepicker._getDate(b):
null)||new Date,h=e.getFullYear(),k=e.getMonth(),e=e.getDate(),l=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,m=l.exec(c);m;){switch(m[2]||"d"){case "d":case "D":e+=parseInt(m[1],10);break;case "w":case "W":e+=7*parseInt(m[1],10);break;case "m":case "M":k+=parseInt(m[1],10);e=Math.min(e,a.datepicker._getDaysInMonth(h,k));break;case "y":case "Y":h+=parseInt(m[1],10),e=Math.min(e,a.datepicker._getDaysInMonth(h,k))}m=l.exec(c)}return new Date(h,k,e)};if(c=(c=null==c||""===c?d:"string"==typeof c?m(c):"number"==
typeof c?isNaN(c)?d:e(c):new Date(c.getTime()))&&"Invalid Date"==c.toString()?d:c)c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0);return this._daylightSavingAdjust(c)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,n=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=
b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();e==a.selectedMonth&&n==a.selectedYear||c||this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""==a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(b){var c=new Date,c=this._daylightSavingAdjust(new Date(c.getFullYear(),c.getMonth(),c.getDate())),d=this._get(b,"isRTL"),
l=this._get(b,"showButtonPanel"),m=this._get(b,"hideIfNoPrevNext"),n=this._get(b,"navigationAsDateFormat"),q=this._getNumberOfMonths(b),r=this._get(b,"showCurrentAtPos"),u=this._get(b,"stepMonths"),w=1!=q[0]||1!=q[1],A=this._daylightSavingAdjust(b.currentDay?new Date(b.currentYear,b.currentMonth,b.currentDay):new Date(9999,9,9)),v=this._getMinMaxDate(b,"min"),B=this._getMinMaxDate(b,"max"),r=b.drawMonth-r,D=b.drawYear;0>r&&(r+=12,D--);if(B)for(var C=this._daylightSavingAdjust(new Date(B.getFullYear(),
B.getMonth()-q[0]*q[1]+1,B.getDate())),C=v&&C<v?v:C;this._daylightSavingAdjust(new Date(D,r,1))>C;)r--,0>r&&(r=11,D--);b.drawMonth=r;b.drawYear=D;var C=this._get(b,"prevText"),C=n?this.formatDate(C,this._daylightSavingAdjust(new Date(D,r-u,1)),this._getFormatConfig(b)):C,C=this._canAdjustMonth(b,-1,D,r)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', -"+u+", 'M');\" title=\""+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+
'">'+C+"</span></a>":m?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+'">'+C+"</span></a>",z=this._get(b,"nextText"),z=n?this.formatDate(z,this._daylightSavingAdjust(new Date(D,r+u,1)),this._getFormatConfig(b)):z,m=this._canAdjustMonth(b,1,D,r)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', +"+u+", 'M');\" title=\""+z+'"><span class="ui-icon ui-icon-circle-triangle-'+
(d?"w":"e")+'">'+z+"</span></a>":m?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+z+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"w":"e")+'">'+z+"</span></a>",u=this._get(b,"currentText"),z=this._get(b,"gotoCurrent")&&b.currentDay?A:c,u=n?this.formatDate(u,z,this._getFormatConfig(b)):u,n=b.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+e+'.datepicker._hideDatepicker();">'+this._get(b,
"closeText")+"</button>",l=l?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(d?n:"")+(this._isInRange(b,z)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._gotoToday('#"+b.id+"');\">"+u+"</button>":"")+(d?"":n)+"</div>":"",n=parseInt(this._get(b,"firstDay"),10),n=isNaN(n)?0:n,u=this._get(b,"showWeek"),z=this._get(b,"dayNames");this._get(b,"dayNamesShort");var F=this._get(b,"dayNamesMin"),G=this._get(b,
"monthNames"),J=this._get(b,"monthNamesShort"),E=this._get(b,"beforeShowDay"),I=this._get(b,"showOtherMonths"),L=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var P=this._getDefaultDate(b),H="",R=0;R<q[0];R++){for(var O="",t=0;t<q[1];t++){var S=this._daylightSavingAdjust(new Date(D,r,b.selectedDay)),N=" ui-corner-all",M="";if(w){M+='<div class="ui-datepicker-group';if(1<q[1])switch(t){case 0:M+=" ui-datepicker-group-first";N=" ui-corner-"+(d?"right":"left");break;case q[1]-1:M+=
" ui-datepicker-group-last";N=" ui-corner-"+(d?"left":"right");break;default:M+=" ui-datepicker-group-middle",N=""}M+='">'}for(var M=M+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+N+'">'+(/all|left/.test(N)&&0==R?d?m:C:"")+(/all|right/.test(N)&&0==R?d?C:m:"")+this._generateMonthYearHeader(b,r,D,v,B,0<R||0<t,G,J)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),U=u?'<th class="ui-datepicker-week-col">'+this._get(b,"weekHeader")+"</th>":"",N=0;7>N;N++)var Q=(N+n)%
7,U=U+("<th"+(5<=(N+n+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+z[Q]+'">'+F[Q]+"</span></th>");M+=U+"</tr></thead><tbody>";U=this._getDaysInMonth(D,r);D==b.selectedYear&&r==b.selectedMonth&&(b.selectedDay=Math.min(b.selectedDay,U));for(var N=(this._getFirstDayOfMonth(D,r)-n+7)%7,U=w?6:Math.ceil((N+U)/7),Q=this._daylightSavingAdjust(new Date(D,r,1-N)),V=0;V<U;V++){for(var M=M+"<tr>",W=u?'<td class="ui-datepicker-week-col">'+this._get(b,"calculateWeek")(Q)+"</td>":"",N=0;7>N;N++){var X=
E?E.apply(b.input?b.input[0]:null,[Q]):[!0,""],Z=Q.getMonth()!=r,Y=Z&&!L||!X[0]||v&&Q<v||B&&Q>B,W=W+('<td class="'+(5<=(N+n+6)%7?" ui-datepicker-week-end":"")+(Z?" ui-datepicker-other-month":"")+(Q.getTime()==S.getTime()&&r==b.selectedMonth&&b._keyEvent||P.getTime()==Q.getTime()&&P.getTime()==S.getTime()?" "+this._dayOverClass:"")+(Y?" "+this._unselectableClass+" ui-state-disabled":"")+(Z&&!I?"":" "+X[1]+(Q.getTime()==A.getTime()?" "+this._currentClass:"")+(Q.getTime()==c.getTime()?" ui-datepicker-today":
""))+'"'+(Z&&!I||!X[2]?"":' title="'+X[2]+'"')+(Y?"":' onclick="DP_jQuery_'+e+".datepicker._selectDay('#"+b.id+"',"+Q.getMonth()+","+Q.getFullYear()+', this);return false;"')+">"+(Z&&!I?"&#xa0;":Y?'<span class="ui-state-default">'+Q.getDate()+"</span>":'<a class="ui-state-default'+(Q.getTime()==c.getTime()?" ui-state-highlight":"")+(Q.getTime()==A.getTime()?" ui-state-active":"")+(Z?" ui-priority-secondary":"")+'" href="#">'+Q.getDate()+"</a>")+"</td>");Q.setDate(Q.getDate()+1);Q=this._daylightSavingAdjust(Q)}M+=
W+"</tr>"}r++;11<r&&(r=0,D++);M+="</tbody></table>"+(w?"</div>"+(0<q[0]&&t==q[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=M}H+=O}H+=l+(a.browser.msie&&7>parseInt(a.browser.version,10)&&!b.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");b._keyEvent=!1;return H},_generateMonthYearHeader:function(b,c,d,l,m,n,q,r){var u=this._get(b,"changeMonth"),w=this._get(b,"changeYear"),A=this._get(b,"showMonthAfterYear"),v='<div class="ui-datepicker-title">',
B="";if(n||!u)B+='<span class="ui-datepicker-month">'+q[c]+"</span>";else{q=l&&l.getFullYear()==d;for(var D=m&&m.getFullYear()==d,B=B+('<select class="ui-datepicker-month" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+b.id+"', this, 'M');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+b.id+"');\">"),C=0;12>C;C++)(!q||C>=l.getMonth())&&(!D||C<=m.getMonth())&&(B+='<option value="'+C+'"'+(C==c?' selected="selected"':"")+">"+r[C]+"</option>");B+="</select>"}A||(v+=B+(!n&&u&&w?
"":"&#xa0;"));b.yearshtml="";if(n||!w)v+='<span class="ui-datepicker-year">'+d+"</span>";else{r=this._get(b,"yearRange").split(":");var z=(new Date).getFullYear();q=function(a){a=a.match(/c[+-].*/)?d+parseInt(a.substring(1),10):a.match(/[+-].*/)?z+parseInt(a,10):parseInt(a,10);return isNaN(a)?z:a};c=q(r[0]);r=Math.max(c,q(r[1]||""));c=l?Math.max(c,l.getFullYear()):c;r=m?Math.min(r,m.getFullYear()):r;for(b.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+
b.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+b.id+"');\">";c<=r;c++)b.yearshtml+='<option value="'+c+'"'+(c==d?' selected="selected"':"")+">"+c+"</option>";b.yearshtml+="</select>";a.browser.mozilla?v+='<select class="ui-datepicker-year"><option value="'+d+'" selected="selected">'+d+"</option></select>":(v+=b.yearshtml,b.yearshtml=null)}v+=this._get(b,"yearSuffix");A&&(v+=(!n&&u&&w?"":"&#xa0;")+B);return v+"</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+
("Y"==c?b:0),e=a.drawMonth+("M"==c?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+("D"==c?b:0);d=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();"M"!=c&&"Y"!=c||this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,d+(0>b?b:e[0]*e[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff"),b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);b=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});a.fn.datepicker=
function(b){if(!this.length)return this;a.datepicker.initialized||(a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv),a.datepicker.initialized=!0);var c=Array.prototype.slice.call(arguments,1);return"string"==typeof b&&("isDisabled"==b||"getDate"==b||"widget"==b)||"option"==b&&2==arguments.length&&"string"==typeof arguments[1]?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.datepicker["_"+
b+"Datepicker"].apply(a.datepicker,[this].concat(c)):a.datepicker._attachDatepicker(this,b)})};a.datepicker=new c;a.datepicker.initialized=!1;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.11";window["DP_jQuery_"+e]=a})(jQuery);
jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&3==b.length?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[2.55*parseFloat(c[1]),2.55*parseFloat(c[2]),2.55*parseFloat(c[3])]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],
16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(b)?l.transparent:l[a.trim(b).toLowerCase()]}function d(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]])for(var e=a.length;e--;)c=a[e],"string"==typeof a[c]&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c]);else for(c in a)"string"===
typeof a[c]&&(b[c]=a[c]);return b}function e(b){var c,d;for(c in b)d=b[c],(null==d||a.isFunction(d)||c in n||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function g(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function h(b,c,d,e){"object"==typeof b&&(e=c,d=null,c=b,b=c.effect);a.isFunction(c)&&(e=c,d=null,c={});if("number"==typeof c||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null);c=c||{};d=d||c.duration;d=a.fx.off?0:"number"==typeof d?
d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default;e=e||c.complete;return[b,c,d,e]}function k(b){return!b||"number"===typeof b||a.fx.speeds[b]||"string"===typeof b&&!a.effects[b]?!0:!1}a.effects={};a.each("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor borderColor color outlineColor".split(" "),function(b,d){a.fx.step[d]=function(b){if(!b.colorInit){var e;e=b.elem;var g=d,h;do{h=a.curCSS(e,g);if(""!=h&&"transparent"!=h||a.nodeName(e,"body"))break;g="backgroundColor"}while(e=
e.parentNode);e=c(h);b.start=e;b.end=c(b.end);b.colorInit=!0}b.elem.style[d]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],
darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],
maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},m=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,h,k){a.isFunction(h)&&(k=h,h=null);return this.queue("fx",function(){var l=a(this),n=l.attr("style")||
" ",B=e(d.call(this)),D,C=l.attr("className");a.each(m,function(a,c){b[c]&&l[c+"Class"](b[c])});D=e(d.call(this));l.attr("className",C);l.animate(g(B,D),c,h,function(){a.each(m,function(a,c){b[c]&&l[c+"Class"](b[c])});"object"==typeof l.attr("style")?(l.attr("style").cssText="",l.attr("style").cssText=n):l.attr("style",n);k&&k.apply(this,arguments)});B=a.queue(this);D=B.splice(B.length-1,1)[0];B.splice(1,0,D);a.dequeue(this)})};a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?
a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,g,h){return"boolean"==typeof d||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,g,h]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,g])},switchClass:function(b,c,d,e,g){return a.effects.animateClass.apply(this,
[{add:c,remove:b},d,e,g])}});a.extend(a.effects,{version:"1.8.11",save:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){"toggle"==b&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c;switch(a[0]){case "top":c=0;break;case "middle":c=.5;break;case "bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case "left":a=
0;break;case "center":a=.5;break;case "right":a=1;break;default:a=a[1]/b.width}return{x:a,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});b.wrap(d);d=b.parent();"static"==b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):
(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d);isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(a){return a.parent().is(".ui-effects-wrapper")?a.parent().replaceWith(a):a},setTransition:function(b,c,d,e){e=e||{};a.each(c,function(a,c){unit=b.cssUnit(c);0<unit[0]&&(e[c]=unit[0]*d+unit[1])});return e}});a.fn.extend({effect:function(b){var c=
h.apply(this,arguments),d={options:c[1],duration:c[2],callback:c[3]},c=d.options.mode,e=a.effects[b];return a.fx.off||!e?c?this[c](d.duration,d.callback):this.each(function(){d.callback&&d.callback.call(this)}):e.call(this,d)},_show:a.fn.show,show:function(a){if(k(a))return this._show.apply(this,arguments);var b=h.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(k(a))return this._hide.apply(this,arguments);var b=h.apply(this,arguments);b[1].mode=
"hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(k(b)||"boolean"===typeof b||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=h.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){0<c.indexOf(b)&&(d=[parseFloat(c),b])});return d}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,g){return a.easing[a.easing.def](b,
c,d,e,g)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*
((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,
b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:1>(b/=e/2)?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return 1>
(b/=e/2)?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;g||(g=.3*e);h<Math.abs(d)?(h=d,a=g/4):a=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*--b)*Math.sin(2*(b*e-a)*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;g||(g=.3*e);h<Math.abs(d)?(h=d,a=g/4):a=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin(2*(b*e-a)*Math.PI/g)+
d+c},easeInOutElastic:function(a,b,c,d,e){var g=0,h=d;if(0==b)return c;if(2==(b/=e/2))return c+d;g||(g=.3*e*1.5);h<Math.abs(d)?(h=d,a=g/4):a=g/(2*Math.PI)*Math.asin(d/h);return 1>b?-.5*h*Math.pow(2,10*--b)*Math.sin(2*(b*e-a)*Math.PI/g)+c:h*Math.pow(2,-10*--b)*Math.sin(2*(b*e-a)*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,g,h){h==b&&(h=1.70158);return e*(c/=g)*c*((h+1)*c-h)+d},easeOutBack:function(a,c,d,e,g,h){h==b&&(h=1.70158);return e*((c=c/g-1)*c*((h+1)*c+h)+1)+d},easeInOutBack:function(a,c,
d,e,g,h){h==b&&(h=1.70158);return 1>(c/=g/2)?e/2*c*c*(((h*=1.525)+1)*c-h)+d:e/2*((c-=2)*c*(((h*=1.525)+1)*c+h)+2)+d},easeInBounce:function(b,c,d,e,g){return e-a.easing.easeOutBounce(b,g-c,0,e,g)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,g){return c<g/2?.5*a.easing.easeInBounce(b,2*c,0,e,g)+d:.5*a.easing.easeOutBounce(b,
2*c-g,0,e,g)+.5*e+d}})}(jQuery);function cursorCss(a,b,c){c||(c="light");a=TradingView.wrapUrl("url("+TradingView.resourceFullPath(c+"/"+a+".cur")+")");return $.browser.msie?a+", default":a+" "+b+", default"};(function(a){a.fn.contextMenu=function(b){a(this).bind("contextmenu",function(a){b(a);return!1})}})(jQuery);(function(a){function b(b){if("string"===typeof b.data){var d=b.handler,e=b.data.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&"text"!==b.target.type){var c="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],k=String.fromCharCode(b.which).toLowerCase(),l="",m={};b.ctrlKey&&"ctrl"!==c&&(l+="ctrl+");b.altKey&&"alt"!==c&&(l+="alt+");b.metaKey&&!b.ctrlKey&&"meta"!==c&&(l+="meta+");b.shiftKey&&"shift"!==c&&(l+="shift+");c?m[l+c]=!0:(m[l+
k]=!0,m[l+a.hotkeys.shiftNums[k]]=!0,"shift+"===l&&(m[a.hotkeys.shiftNums[k]]=!0));c=0;for(k=e.length;c<k;c++)if(m[e[c]])return d.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:/mac/i.test(navigator.platform)?"del":"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",
104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery);(function(a){a.fn.selectable=function(b){return this.each(function(){var c=a(this);c.css("user-select",b?"text":"none");c.css("-moz-user-select",b?"text":"-moz-none");c.css("-webkit-user-select",b?"auto":"none");(a.browser.msie||a.browser.opera)&&c.attr("unselectable",b?"off":"on")})}})(jQuery);this.JSON||(this.JSON={});
(function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=k[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,k,u,w,A=g,v,B=d[a];B&&"object"===typeof B&&"function"===typeof B.toJSON&&(B=B.toJSON(a));"function"===typeof l&&(B=l.call(d,a,B));switch(typeof B){case "string":return b(B);case "number":return isFinite(B)?String(B):"null";case "boolean":case "null":return String(B);case "object":if(!B)return"null";
g+=h;v=[];if("[object Array]"===Object.prototype.toString.apply(B)){w=B.length;for(e=0;e<w;e+=1)v[e]=c(e,B)||"null";u=0===v.length?"[]":g?"[\n"+g+v.join(",\n"+g)+"\n"+A+"]":"["+v.join(",")+"]";g=A;return u}if(l&&"object"===typeof l)for(w=l.length,e=0;e<w;e+=1)k=l[e],"string"===typeof k&&(u=c(k,B))&&v.push(b(k)+(g?": ":":")+u);else for(k in B)Object.hasOwnProperty.call(B,k)&&(u=c(k,B))&&v.push(b(k)+(g?": ":":")+u);u=0===v.length?"{}":g?"{\n"+g+v.join(",\n"+g)+"\n"+A+"}":"{"+v.join(",")+"}";g=A;return u}}
"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(b){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=
/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,h,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;h=g="";if("number"===typeof d)for(e=0;e<d;e+=1)h+=" ";else"string"===typeof d&&(h=d);if((l=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,g,h=a[d];if(h&&"object"===typeof h)for(e in h)Object.hasOwnProperty.call(h,e)&&(g=c(h,e),void 0!==g?h[e]=g:delete h[e]);return b.call(a,d,h)}var e;a=String(a);d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();(function(a){a.extend(a.fn,{swapClass:function(a,b){var e=this.filter("."+a);this.filter("."+b).removeClass(b).addClass(a);e.removeClass(a).addClass(b);return this},replaceClass:function(a,b){return this.filter("."+a).removeClass(a).addClass(b).end()},hoverClass:function(b){b=b||"hover";return this.hover(function(){a(this).addClass(b)},function(){a(this).removeClass(b)})},heightToggle:function(a,b){a?this.animate({height:"toggle"},a,b):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?
"show":"hide"]();b&&b.apply(this,arguments)})},heightHide:function(a,b){a?this.animate({height:"hide"},a,b):(this.hide(),b&&this.each(b))},prepareBranches:function(a){a.prerendered||(this.filter(":last-child:not(ul)").addClass(b.last),this.filter((a.collapsed?"":"."+b.closed)+":not(."+b.open+")").find(">ul").hide());return this.filter(":has(>ul)")},applyClasses:function(c,d){this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",function(b){this==b.target&&
d.apply(a(this).next())}).add(a("a",this)).hoverClass();if(!c.prerendered){this.filter(":has(>ul:hidden)").addClass(b.expandable).replaceClass(b.last,b.lastExpandable);this.not(":has(>ul:hidden)").addClass(b.collapsable).replaceClass(b.last,b.lastCollapsable);var e=this.find("div."+b.hitarea);e.length||(e=this.prepend('<div class="'+b.hitarea+'"/>').find("div."+b.hitarea));e.removeClass().addClass(b.hitarea).each(function(){var b="";a.each(a(this).parent().attr("class").split(" "),function(){b+=this+
"-hitarea "});a(this).addClass(b)})}this.find("div."+b.hitarea).click(d)},treeview:function(c){function d(c,d){function g(d){return function(){e.apply(a("div."+b.hitarea,c).filter(function(){return d?a(this).parent("."+d).length:!0}));return!1}}a("a:eq(0)",d).click(g(b.collapsable));a("a:eq(1)",d).click(g(b.expandable));a("a:eq(2)",d).click(g())}function e(){a(this).parent().find(">.hitarea").swapClass(b.collapsableHitarea,b.expandableHitarea).swapClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().swapClass(b.collapsable,
b.expandable).swapClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightToggle(c.animated,c.toggle);c.unique&&a(this).parent().siblings().find(">.hitarea").replaceClass(b.collapsableHitarea,b.expandableHitarea).replaceClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().replaceClass(b.collapsable,b.expandable).replaceClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightHide(c.animated,c.toggle)}function g(){var b=[];l.each(function(c,d){b[c]=a(d).is(":has(>ul:visible)")?1:0});
a.cookie(c.cookieId,b.join(""),c.cookieOptions)}function h(){var b=a.cookie(c.cookieId);if(b){var d=b.split("");l.each(function(b,c){a(c).find(">ul")[parseInt(d[b])?"show":"hide"]()})}}c=a.extend({cookieId:"treeview"},c);if(c.toggle){var k=c.toggle;c.toggle=function(){return k.apply(a(this).parent()[0],arguments)}}this.data("toggler",e);this.addClass("treeview");var l=this.find("li").prepareBranches(c);switch(c.persist){case "cookie":var m=c.toggle;c.toggle=function(){g();m&&m.apply(this,arguments)};
h();break;case "location":var n=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});n.length&&(n=n.addClass("selected").parents("ul, li").add(n.next()).show(),c.prerendered&&n.filter("li").swapClass(b.collapsable,b.expandable).swapClass(b.lastCollapsable,b.lastExpandable).find(">.hitarea").swapClass(b.collapsableHitarea,b.expandableHitarea).swapClass(b.lastCollapsableHitarea,b.lastExpandableHitarea))}l.applyClasses(c,e);c.control&&(d(this,c.control),a(c.control).show());
return this}});a.treeview={};var b=a.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"}})(jQuery);(function(a){function b(a){for(var b=0;b<arguments.length;b++)if(!isNaN(parseFloat(arguments[b])))return Number(parseFloat(arguments[b]))}function c(b,c){var g=a(c||this).attr("class"),g=(new RegExp("(\\b"+b+")(\\S*)")).exec(g),h={"true":!0,True:!0,"false":!1,False:!1};g&&3<=g.length&&void 0!==h[g[3]]&&(g[3]=h[g[3]]);return g?3<=g.length?g[2]:null:void 0}a.fn.spinbox=function(d){if(d&&"String"===typeof d&&"destroy"===d)return this.unbind(".spinbox").removeClass(d.spinboxClass).removeClass(d.upClass).removeClass(d.downClass).removeClass(d.upHoverClass).removeClass(d.downHoverClass).removeData("spinboxMin").removeData("spinboxMax").removeData("spinboxReset").removeData("spinboxStep").removeData("spinboxBigStep");
d=a.extend({},a.fn.spinbox.defaults,d);this.each(function(){var e=a(this),g=c("spinboxMin",this),h=c("spinboxMax",this),k=c("spinboxStep",this),l=c("spinboxBigStep",this),m=c("spinboxReset",this),n=c("spinboxScale",this);void 0===g&&(g=b(e.attr("min"),d.min));void 0===h&&(h=b(e.attr("max"),d.max));k||(k=b(e.attr("step"),d.step));l||(l=b(e.attr("bigStep"),d.bigStep));void 0===m&&(m=b(d.reset,e.val(),g,h));void 0===n&&(n=e.data("spinboxScale"));n=n||!isNaN(parseFloat(n))?n:d.scale;!0===n&&(n=(k.toString().split(".")[1]||
"").length);e.data("spinboxMin",g);e.data("spinboxMax",h);e.data("spinboxStep",k);e.data("spinboxBigStep",l);e.data("spinboxReset",m);e.data("spinboxScale",n)});return this.each(function(){function c(e,g,h){e=a(this);if(!d.ignore||!e.is(d.ignore)){g=b(g,e.data("spinboxStep"),1);h=h||(l?-1:1);var k=e.val(),m=b(k,e.data("spinboxReset"),0),n=b(e.data("spinboxMin")),q=b(e.data("spinboxMax")),C=[m,g,n,q,h,k,d];0<h?m=d.increment.apply(this,C):0>h&&(m=d.decrement.apply(this,C));C=e.data("spinboxScale");
!isNaN(parseFloat(C))&&d.round&&(m=d.round(m,e.data("spinboxScale")));isNaN(parseFloat(n))||(m=Math.max(m,n));isNaN(parseFloat(q))||(m=Math.min(m,q));C=[m,g,n,q,h,k,d];m!=k&&!1!==e.triggerHandler("beforeSpin",C)&&(e.val(m),d.change&&e.trigger("change",C),e.triggerHandler("spin",C))}}function g(a,b){h();m=window.setTimeout(function(){c.apply(a,[b]);n=window.setInterval(function(){c.apply(a,[b])},d.repeat)},d.delay)}function h(){window.clearTimeout(m);window.clearInterval(n)}var k,l,m,n,q=a(this);q.bind("mousemove.spinbox",
function(b){var c=a(this),e=c.offset(),g=c.height()/2,h=b.pageX>e.left+c.width()-d.buttonWidth;k=h&&b.pageY<=e.top+g;l=h&&b.pageY>e.top+g;c.toggleClass(d.upHoverClass,k).toggleClass(d.downHoverClass,l)});q.bind("mouseout.spinbox",function(){h();a(this).removeClass([d.upClass,d.downClass,d.upHoverClass,d.downHoverClass].join(" "));k=l=null});q.bind("mousedown.spinbox",function(b){if(k||l)a(this).toggleClass(d.upClass,k).toggleClass(d.downClass,l),c.apply(this,[b]),g(this,b)});q.bind("mouseup.spinbox",
function(b){h();a(this).removeClass(d.upClass).removeClass(d.downClass)});q.bind("keydown.spinbox",function(b){if(!d.keys||a.grep(d.keys,function(a){return a===b.keyCode||a instanceof RegExp&&a.test(String.fromCharCode(b.keyCode))}).length){var g=a(this),h=g.data("spinboxBigStep"),g=b.shiftKey?h:g.data("spinboxStep");switch(b.keyCode){case 38:c.apply(this,[b,g,1]);break;case 40:c.apply(this,[b,g,-1]);break;case 33:c.apply(this,[b,h,1]);break;case 34:c.apply(this,[b,h,-1])}}else return!d.keys});q.bind("change.spinbox",
function(a){c.apply(this,[a,0])});q.addClass(d.spinboxClass);d.mousewheel&&a(this).bind("mousewheel.spinbox DOMMouseScroll.spinbox",function(b){var d=b.shiftKey?a(this).data("spinboxBigStep"):a(this).data("spinboxStep");0>b.detail||120<=b.wheelDelta?c.apply(this,[b,d,1]):(0<b.detail||-120>=b.wheelDelta)&&c.apply(this,[b,d,-1]);return!1});c.apply(this,[a.Event(),0])})};a.fn.spinbox.defaults={min:0,max:null,step:1,bigStep:10,keys:[/[0-9]/,9,13,8,46,33,34,37,38,39,40,109,188,190],ignore:"[readonly],[disabled]",
spinboxClass:"spinbox-active",upClass:"spinbox-up",downClass:"spinbox-down",upHoverClass:"spinbox-up-hover",downHoverClass:"spinbox-down-hover",mousewheel:!0,change:!0,increment:function(a,b,c,h,k){return a+b},decrement:function(a,b,c,h,k){return a-b},reset:null,delay:500,repeat:100,buttonWidth:20,scale:!0,round:function(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)}}})(jQuery);(function(a){a.fn.popup=function(){return a(this).each(function(a,c){HTMLHelper.createPopup(c)})}})(jQuery);(function(a,b,c){function d(d,g){function h(b){a(k).each(function(){var c=a(this);this===b.target||c.has(b.target).length||c.triggerHandler(g,[b.target])})}g=g||d+c;var k=a(),l=d+"."+g+"-special-event";a.event.special[g]={setup:function(){k=k.add(this);delete k.prevObject;1===k.length&&a(b).bind(l,h)},teardown:function(){k=k.not(this);delete k.prevObject;0===k.length&&a(b).unbind(l)},add:function(a){var b=a.handler;a.handler=function(a,c){a.target=c;b.apply(this,arguments)}}}}"$:nomunge";a.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),
function(a){d(a)});d("focusin","focus"+c);d("focusout","blur"+c);Modernizr.touch&&(d("touchstart","mousedown"+c),d("touchmove","mousemove"+c),d("touchend","mouseup"+c));a.addOutsideEvent=d})(jQuery,document,"outside");(function(a){a.fn.mousecapture=function(b){var c=a(document);this.each(function(){var d=a(this),e={};d.mousedown(function(a){var h;b.move&&(h=function(a){b.move.call(d,a,e)},c.mousemove(h));var k,l=function(){b.move&&c.unbind("mousemove",h);c.unbind("mouseup",k)};k=b.up?function(a){l();return b.up.call(d,a,e)}:l;c.mouseup(k);return b.down.call(d,a,e)})});return this}})(jQuery);(function(a){function b(a,b){if(!(1<a.originalEvent.touches.length)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null);a.target.dispatchEvent(d)}}a.support.touch="ontouchend"in document;if(a.support.touch){var c=a.ui.mouse.prototype,d=c._mouseInit,e=c._mouseDestroy,g;c._touchStart=function(a){!g&&this._mouseCapture(a.originalEvent.changedTouches[0])&&(g=!0,this._touchMoved=
!1,b(a,"mouseover"),b(a,"mousemove"),b(a,"mousedown"))};c._touchMove=function(a){g&&(this._touchMoved=!0,b(a,"mousemove"))};c._touchEnd=function(a){g&&(b(a,"mouseup"),b(a,"mouseout"),this._touchMoved||b(a,"click"),g=!1)};c._mouseInit=function(){this.element.bind({touchstart:a.proxy(this,"_touchStart"),touchmove:a.proxy(this,"_touchMove"),touchend:a.proxy(this,"_touchEnd")});d.call(this)};c._mouseDestroy=function(){this.element.unbind({touchstart:a.proxy(this,"_touchStart"),touchmove:a.proxy(this,
"_touchMove"),touchend:a.proxy(this,"_touchEnd")});e.call(this)}}})(jQuery);EventEmitter=function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,g=e.EventEmitter;d.getListeners=function(a){var b=this._getEvents(),c,d;if(a instanceof RegExp)for(d in c={},b)b.hasOwnProperty(d)&&a.test(d)&&(c[d]=b[d]);else c=b[a]||(b[a]=[]);return c};d.flattenListeners=function(a){var b=[],c;for(c=0;c<a.length;c+=1)b.push(a[c].listener);return b};d.getListenersAsObject=
function(a){var b=this.getListeners(a),c;b instanceof Array&&(c={},c[a]=b);return c||b};d.addListener=function(a,c){var d=this.getListenersAsObject(a),e="object"===typeof c,g;for(g in d)d.hasOwnProperty(g)&&-1===b(d[g],c)&&d[g].push(e?c:{listener:c,once:!1});return this};d.on=c("addListener");d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})};d.once=c("addOnceListener");d.defineEvent=function(a){this.getListeners(a);return this};d.defineEvents=function(a){for(var b=0;b<
a.length;b+=1)this.defineEvent(a[b]);return this};d.removeListener=function(a,c){var d=this.getListenersAsObject(a),e,g;for(g in d)d.hasOwnProperty(g)&&(e=b(d[g],c),-1!==e&&d[g].splice(e,1));return this};d.off=c("removeListener");d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)};d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)};d.manipulateListeners=function(a,b,c){var d,e,g=a?this.removeListener:this.addListener;a=a?this.removeListeners:this.addListeners;
if("object"!==typeof b||b instanceof RegExp)for(d=c.length;d--;)g.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"===typeof e?g.call(this,d,e):a.call(this,d,e));return this};d.removeEvent=function(a){var b=typeof a,c=this._getEvents(),d;if("string"===b)delete c[a];else if(a instanceof RegExp)for(d in c)c.hasOwnProperty(d)&&a.test(d)&&delete c[d];else delete this._events;return this};d.removeAllListeners=c("removeEvent");d.emitEvent=function(a,b){var c=this.getListenersAsObject(a),
d,e,g,r;for(g in c)if(c.hasOwnProperty(g))for(e=c[g].length;e--;)d=c[g][e],!0===d.once&&this.removeListener(a,d.listener),r=d.listener.apply(this,b||[]),r===this._getOnceReturnValue()&&this.removeListener(a,d.listener);return this};d.trigger=c("emitEvent");d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)};d.setOnceReturnValue=function(a){this._onceReturnValue=a;return this};d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:
!0};d._getEvents=function(){return this._events||(this._events={})};a.noConflict=function(){e.EventEmitter=g;return a};"function"===typeof define&&define.amd?define(function(){return a}):"object"===typeof module&&module.exports?module.exports=a:this.EventEmitter=a;return a}.call(this);var W77=function(){var a={};if("undefined"!=typeof W77)return W77;var b={custom_items_in_context_menu:{},websocket_connection:{},countdown:{},extended_hours:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},
header_fullscreen_button:{},header_symbol_search:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},header_widget:{subsets:"header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_settings header_indicators header_compare header_undo_redo header_fullscreen_button".split(" ")},disable_userlink_popup:{},
left_toolbar:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu"]},items_favoriting:{},use_localstorage_for_settings:{subsets:["items_favoriting"]},plain_studymarket:{},trading_options:{},disable_resolution_rebuild:{},border_around_the_chart:{},narrow_chart_enabled:{},charting_library_debug_mode:{},log_data_request_time:{},
saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},link_to_tradingview:{},right_bar_stays_on_scroll:{},short_name_may_differ_from_fullname:{},chart_content_overrides_by_deafults:{},14851:{},alerts:{},show_dialog_on_snapshot_ready:{},
allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},remove_library_container_border:{},side_toolbar_in_fullscreen_mode:{},tv_production:{subsets:"show_pro_features countdown extended_hours symbol_search_parser_mixin symbollist_context_menu websocket_connection header_fullscreen_button header_widget left_toolbar control_bar timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings saveload_requires_authentication volume_force_overlay new_chart_creation_available saved_charts_count_restriction create_volume_indicator_by_default charts_auto_save save_old_chart_before_save_as trading_options chart_content_overrides_by_deafults alerts show_dialog_on_snapshot_ready widgetbar_tabs header_saveload_to_the_right collapsible_header".split(" ")},
browser_extension:{subsets:["disable_userlink_popup"]},widget:{subsets:"show_pro_features countdown extended_hours symbol_search_parser_mixin symbollist_context_menu websocket_connection left_toolbar control_bar timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings saveload_requires_authentication volume_force_overlay create_volume_indicator_by_default show_dialog_on_snapshot_ready header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_indicators header_compare star_some_intervals_by_default".split(" ")},
charting_library:{subsets:"daily_timeframe_suffix custom_items_in_context_menu pay_attention_to_ticker_not_symbol graying_disabled_tools_enabled update_study_formatter_on_symbol_resolve constraint_dialogs_movement header_widget header_screenshot left_toolbar control_bar widget_logo timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings plain_studymarket border_around_the_chart saveload_storage_customization volume_force_overlay lean_chart_load stop_study_on_restart header_saveload create_volume_indicator_by_default adapt_onchart_logo_background update_timeframes_set_on_symbol_resolve refresh_saved_charts_list_on_dialog_show predefined_items_only_may_be_starred link_to_tradingview right_bar_stays_on_scroll short_name_may_differ_from_fullname 14851 show_dialog_on_snapshot_ready allow_supported_resolutions_set_only study_market_minimized collapsible_header".split(" ")},
static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library","trading_options","header_saveload_to_the_right"]}},c={},d;for(d in b){for(var e=b[d].subsets||[],g=0;g<e.length;++g)c[e[g]]=1;c[d]=1}var h={};for(d in c)for(var k in c)e=b[k],"undefined"!=typeof e&&e.subsets&&0<=e.subsets.indexOf(d)&&(h.hasOwnProperty(d)||(h[d]=[]),h[d].push(k));var l={};a.enabled=function(a){var b=h.hasOwnProperty(a)?
h[a]:[];if(0==l[a])return!1;a=l[a];for(var c=0;c<b.length;++c)a|=W77.enabled(b[c]);return a};a._uniqueSets=function(){return Object.keys(c)};a.enable=function(a){l[a]=!0};a.setEnabled=function(a,b){l[a]=b};"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.map(function(b){a.setEnabled(b,!1)});"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.map(function(b){a.enable(b)});return a}();
"undefined"!=typeof module&&(module.exports=W77);var TradingView={},PineAddons={};TradingView.className=function(a){for(var b in this)if(TradingView[b]===a)return b;return null};TradingView.isMobileView=/mobile=1/i.test(window.location.search);TradingView.isOnFeaturePage=/on-features-page=1/i.test(window.location.search);TradingView.wrapUrl=function(a){W77.enabled("charting_library")&&(a=a.replace("/static/",""));return a};TradingView.RESOURCES_ROOT=TradingView.wrapUrl("/static/chart-client/css/");TradingView.THEME_RESOURCES_ROOT=TradingView.wrapUrl("/static/chart-client/css/images/");
TradingView.resourceFullPath=function(a){return TradingView.RESOURCES_ROOT+a};TradingView.themeResourceFullPath=function(a){return TradingView.THEME_RESOURCES_ROOT+a};
TradingView.isMobile=function(){var a=/Android/i.test(navigator.userAgent),b=/BlackBerry/i.test(navigator.userAgent),c=/iPhone|iPad|iPod/i.test(navigator.userAgent),d=/Opera Mini/i.test(navigator.userAgent),e=TradingView.winMobileMode,g=TradingView.isMobileView||a||b||c||d||e;return{Android:function(){return a},BlackBerry:function(){return b},iOS:function(){return c},Opera:function(){return d},Windows:function(){return e},any:function(){return g}}}();
TradingView.supportTouch=function(){return Modernizr.touch||TradingView.isMobile.any()};TradingView.onWidget=function(){return/widgetembed|widgetpopup|idea-popup/.test(window.location.pathname)};TradingView.availableTimezones=TradingView.availableTimezones||[{id:"UTC",title:"UTC"},{id:"EST",title:"EST"},{id:"CST",title:"CST"},{id:"PST",title:"PST"},{id:"exchange",title:"Exchange"}];TradingView.monthsShort="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
TradingView.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}];TradingView.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})};TradingView.randomHash=function(){return TradingView.randomHashN(12)};TradingView.randomHashN=function(a){for(var b="",c=0;c<a;c++)var d=Math.round(60*Math.random()),b=b+"0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[d];return b};isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};function isInteger(a){return"number"===typeof a&&0===a%1}function isNumber(a){return"number"===typeof a&&isFinite(a)}function parseBool(a){return!0===a||"true"===a}function isBoolean(a){return!0===a||!1===a}function isString(a){return null===a||void 0===a?!1:a.constructor==String}function isFunction(a){return null===a||void 0===a?!1:a.constructor==Function}
function inherit(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});a.prototype.superclass=b}function declareClassAsPureInterface(a,b){for(var c in a.prototype)"function"===typeof a.prototype[c]&&a.prototype.hasOwnProperty(c)&&(a.prototype[c]=function(){throw b+"::"+c+" is an interface member declaration and must be overloaded in order to be called";})}
function requireFullInterfaceImplementation(a,b,c,d){for(var e in c.prototype)if("function"===typeof c.prototype[e]&&!a.prototype[e])throw"Interface implementation assertion failed: "+b+" does not implement "+d+"::"+e+" function";}function isInherited(a,b){if(a===b)return!0;if(a&&a.prototype)return void 0===a.prototype.superclass||null===a.prototype.superclass?!1:a.prototype.superclass===b?!0:isInherited(a.prototype.superclass,b);debugger;return!1}function TypeValidator(a){this.m_type=a}
TypeValidator.prototype.check=function(a){return a.constructor===this.m_type||isInherited(a.constructor,this.m_type)};function PredicateValidator(a){this.m_predicate=a}PredicateValidator.prototype.check=function(a){return this.m_predicate(a)};TradingView.clone=function(a){if(!a||"object"!==typeof a)return a;var b;b="function"===typeof a.pop?[]:{};var c,d;for(c in a)a.hasOwnProperty(c)&&(d=a[c],b[c]=d&&"object"===typeof d?TradingView.clone(d):d);return b};
TradingView.deepEquals=function(a,b,c){c||(c="");if(a===b)return[!0,c];isFunction(a)&&(a=void 0);isFunction(b)&&(b=void 0);if(void 0===a&&void 0!==b||void 0===b&&void 0!==a||null===a&&null!==b||null===b&&null!==a)return[!1,c];if(isString(a)&&isString(b))return[a===b,c];if(isArray(a)&&isArray(b)){var d=a.length;if(d!==b.length)return[!1,c];for(var e=0;e<d;e++)if(res=TradingView.deepEquals(a[e],b[e],c+"["+e+"]"),!res[0])return res}else{if(isArray(a)||isArray(b))return[!1,c];for(d in a)if(res=TradingView.deepEquals(a[d],
b[d],c+"["+d+"]"),!res[0])return res}return[!0,c]};TradingView.merge=function(a,b){for(var c in b)"object"===typeof b[c]&&a.hasOwnProperty(c)?TradingView.merge(a[c],b[c]):a[c]=b[c];return a};TradingView.mergeWithRules=function(a,b,c,d){for(var e in b){var g=d?d+"."+e:e;c&&g in c?a[e]=c[g](a[e],b[e]):"object"===typeof b[e]&&a.hasOwnProperty(e)?TradingView.merge(a[e],b[e],c,g):a[e]=b[e]}};
TradingView.sortMultipleFunction=function(){var a=[].slice.call(arguments),b=a.length;return function(c,d){var e,g,h,k,l;for(l=0;l<b&&(k=0,h=a[l],g="string"===typeof h?h:h.name,e=c[g],g=d[g],"function"===typeof h.fn&&(e=h.fn(e),g=h.fn(g)),h=h.reverse?-1:1,e<g&&(k=-1*h),e>g&&(k=1*h),0===k);l++);return k}};"undefined"!=typeof module&&module&&module.exports&&(module.exports={inherit:inherit,merge:TradingView.merge,isNumber:isNumber,isBoolean:isBoolean,isString:isString});function OrderedHash(a,b){this.array=[];for(var c in a)a[c].key=c,this.array.push(a[c]);this.rearrange(b)}OrderedHash.prototype.rearrange=function(a){if("function"!==typeof a)throw Error("sort param is not a function");return this.array.sort(a)};OrderedHash.byValue=function(a){return function(a,c){return a-c}};OrderedHash.byField=function(a){return function(b,c){if(b[a]>c[a])return 1;if(b[a]<c[a])return-1;if(b[a]==c[a])return 0}};
OrderedHash.byOrder=function(a){return function(b,c){var d=a.indexOf(b.key),e=a.indexOf(c.key);return d-e}};var HTMLHelper={};
(function(a){HTMLHelper.createLabel=function(b,c,d){return HTMLHelper.Element.create("label",a.extend(d,{html:c,"for":b}))};HTMLHelper.unbindContextMenu=function(a){a.contextMenu(function(a){return!1})};HTMLHelper.offsetX=function(a,c){return a.width()+c.pageX};HTMLHelper.offsetY=function(a,c){return a.height()+c.pageY};HTMLHelper.checkObjIsOutOfWindowX=function(b,c){var d=a(window).width()-HTMLHelper.offsetX(b,c);return 0>d?(d=c.pageX+d,0<d?d:0):c.pageX};HTMLHelper.checkObjIsOutOfWindowY=function(b,
c){var d=a(window).height()-HTMLHelper.offsetY(b,c);return 0>d?(d=c.pageY+d,0<d?d:0):c.pageY};HTMLHelper.checkObjIsOutOfWindow=function(a,c){return{left:HTMLHelper.checkObjIsOutOfWindowX(a,c),top:HTMLHelper.checkObjIsOutOfWindowY(a,c)}};HTMLHelper.setAttr=function(a,c,d){a.attr?a.attr(c,d):a[c]=d;return a};HTMLHelper.removeAttr=function(a,c){a.removeAttr?a.removeAttr(c):a.removeAttribute(c);return a};HTMLHelper.notNull=function(b){return-1==a.inArray(b,[null,void 0,"false","null","undefined",0])};
HTMLHelper.hideControl=function(a){return a.css({position:"absolute",top:-1E3,left:-1E3})};HTMLHelper.createPopup=function(a,c,d){return(new HTMLHelper.Popup(a,c,d)).render()};HTMLHelper.Popup=function(b,c,d){this.jqDiv=void 0!==b.selector?b:b.nodeType?a(b):HTMLHelper.Element.create("div",b);if(d){var e=this;a.each(d,function(a,b){e[a]=b})}TradingView.setMouseEventHandler(this.jqDiv,this);this._callback=c};HTMLHelper.Popup.prototype.render=function(){return this.jqDiv};HTMLHelper.Popup.prototype.show=
function(){this.jqDiv.show()};HTMLHelper.Popup.prototype.hide=function(){this.jqDiv.hide()};HTMLHelper.Popup.prototype.setVisible=function(a){a?this.show():this.hide()};HTMLHelper.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")};HTMLHelper.Popup.prototype.contextMenuEvent=function(a){return!1};HTMLHelper.Popup.prototype.mouseDownOutsideEvent=function(a){!this.isVisible()||this._callback&&!this._callback()||this.hide()}})(jQuery);HTMLHelper.Element={};HTMLHelper.Element.renderAttributes=function(a){var b="";for(attr in a)a[attr]&&(b+=" "+attr+'="'+a[attr]+'"');return b};HTMLHelper.Element.create=function(a,b){var c=$(document.createElement(a));b&&(b.html&&(c.html(b.html),delete b.html),c.attr(b));return c};HTMLHelper.Element.validAttributes="abbr accept-charset accept accesskey action align alink alt archive axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class classid clear code codebase codetype color cols colspan compact content coords data datetime declare defer dir disabled enctype face for frame frameborder headers height href hreflang hspace http-equiv id ismap label lang language link longdesc marginheight marginwidth maxlength media method multiple name nohref noresize noshade nowrap object onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onreset onselect onsubmit onunload profile prompt readonly rel rev rows rowspan rules scheme scope scrolling selected shape size span src standby start style summary tabindex target text title type usemap valign value valuetype version vlink vspace width".split(" ");
HTMLHelper.Element.validAttribute=function(a){return-1!=jQuery.inArray(a,HTMLHelper.Element.validAttributes)};HTMLHelper.Element.cleanAttributes=function(a){jQuery.each(a,function(b,c){HTMLHelper.Element.validAttribute(b)||delete a[b]});return a};HTMLHelper.CUSTOM_SELECT_MINIMAL_WIDTH=100;HTMLHelper.Input=function(a){this.jqObj=null;this.data=a;this.init();this._prepareValue();this._prepareCallback();this._prepareChildren();this._applyAttributes();return this.jqObj};HTMLHelper.Input.selectOptions={type:"option",value:null,html:null};HTMLHelper.Input.optionsData={radiogroup:{type:"radio",name:null,value:null,label:null},select:HTMLHelper.Input.selectOptions,"select-one":HTMLHelper.Input.selectOptions,"select-multiple":HTMLHelper.Input.selectOptions};
HTMLHelper.Input.customTypes=["radiogroup","fontpicker","colorpicker","combobox"];HTMLHelper.Input.prototype._tagIsInput=function(a){return-1!=jQuery.inArray(this.data.type,"text radio checkbox hidden reset image file".split(" "))};HTMLHelper.Input.prototype.init=function(){this._tagIsInput()?this.jqObj=HTMLHelper.Element.create("input",{name:this.data.name,type:this.data.type}):this.jqObj=HTMLHelper.Element.create(this.data.type,{name:this.data.name})};
HTMLHelper.Input.prototype._eventIsKeyUp=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea"])};HTMLHelper.Input.prototype._eventIsClick=function(){return-1!=jQuery.inArray(this.data.type,["checkbox","radio","option"])};HTMLHelper.Input.prototype._eventIsChange=function(){return-1!=jQuery.inArray(this.data.type,["select","select-one","select-multiple","radiogroup"])};
HTMLHelper.Input.prototype._prepareCallback=function(){this.data.callback&&(this._eventIsKeyUp()?this.jqObj.keyup(this.data.callback):this._eventIsClick()?this.jqObj.click(this.data.callback):this._eventIsChange()&&this.jqObj.bind("change",this.data.callback),delete this.data.callback)};HTMLHelper.Input.prototype._childTag=function(){return{select:"option","select-one":"option","select-multiple":"option",radiogroup:"radio"}[this.data.type]};
HTMLHelper.Input.prototype._inheritedProperties=function(){var a={type:this._childTag()};"radiogroup"==this.data.type&&(a.name=this.data.name);return a};HTMLHelper.Input.prototype._extendChildProps=function(a){var b=jQuery.extend(this._inheritedProperties(),a);this.data.value==a.value&&(b.selected=!0);return b};HTMLHelper.Input.prototype._prepareChildren=function(){if(this.data.options){var a=this;jQuery.each(this.data.options,function(b,c){a.jqObj.append(new HTMLHelper.Input(a._extendChildProps(c)))})}};
HTMLHelper.Input.prototype.isCustom=function(){return-1!=jQuery.inArray(this.data.type,this.customTypes)};HTMLHelper.Input.prototype._isStoringValue=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea","option","radio","checkbox"])};HTMLHelper.Input.prototype._htmlAsValue=function(){return"textarea"==this.data.type};HTMLHelper.Input.prototype._valAsValue=function(){return jQuery.inArray(this.data.type,"text checkbox radio option select select-one select-multiple".split(" "))};
HTMLHelper.Input.prototype._getControlValue=function(){return{checkbox:1}[this.data.type]||this.data.value};HTMLHelper.Input.prototype._setControlValue=function(){this._valAsValue()?this.jqObj.val(this._getControlValue()):this._htmlAsValue()&&this.jqObj.html(this.data.value)};HTMLHelper.Input.prototype._getCheckedAttr=function(){return{option:"selected",radio:"checked",checkbox:"checked"}[this.data.type]};
HTMLHelper.Input.prototype._setChecked=function(){this.data.selected&&this.jqObj.attr(this._getCheckedAttr(),!0)};HTMLHelper.Input.prototype._setValue=function(){this._setControlValue();HTMLHelper.Input.isCheckable(this.data.type)&&this._setChecked()};HTMLHelper.Input.prototype._prepareValue=function(){this._isStoringValue()&&this._setValue()};HTMLHelper.Input.prototype._applyAttributes=function(){this.jqObj.attr(HTMLHelper.Element.cleanAttributes(this.data))};
HTMLHelper.Input.value=function(a){return HTMLHelper.Input.controlCheckable(a)?a.checked:a.value};HTMLHelper.Input.isCheckable=function(a){return-1!=jQuery.inArray(a,["checkbox","radio","option"])};HTMLHelper.Input.controlType=function(a){if("string"==typeof a)return a;a=jQuery(a);var b=null;return a.attr("type")&&(b=a.attr("type"),jQuery.inArray(b,"textarea text select select-one select-multiple submit".split(" ")))?b:a.attr("tagName")};HTMLHelper.Input.controlCheckable=function(a){return HTMLHelper.Input.isCheckable(HTMLHelper.Input.controlType(a))};
HTMLHelper.Input.controlToggleChecked=function(a,b){return HTMLHelper.setAttr(a,"checked",b)};HTMLHelper.Input.controlSetValue=function(a,b){return HTMLHelper.Input.controlCheckable(a)?HTMLHelper.Input.controlToggleChecked(a,b):HTMLHelper.setAttr(a,"value",b)};HTMLHelper.Input.currentOption=function(a){return a.options[a.selectedIndex]};HTMLHelper.Input.currentOptionInnerHTML=function(a){return HTMLHelper.Input.currentOption(a).innerHTML};
HTMLHelper.ComboboxItem=function(a,b){this.value=a;this.html=b||"";this.jqItem=this._render()};HTMLHelper.ComboboxItem.prototype.eq=function(a){return this.value===a};HTMLHelper.ComboboxItem.prototype.width=function(a){return this.jqItem.width()};HTMLHelper.ComboboxItem.prototype._render=function(a){a=$("<span/>").append(this.html);return $('<div class="item"></div>').append(a)};HTMLHelper.ComboboxItem.prototype.render=function(a){return this.jqItem};
HTMLHelper.ComboboxItem.prototype.select=function(a){a?this.jqItem.addClass("selected"):this.jqItem.removeClass("selected")};HTMLHelper.ComboboxItem.prototype.selectAndReturnIfValueMatch=function(a){if(this.eq(a))return this.select(!0),this;this.select(!1);return null};HTMLHelper.Combobox=function(a){this._value=null;this.items=[];this.width=0;this.callback=this.jqItems=this.jqIcon=this.jqTitle=this.jqSwitcher=this.jqWrapper=null;this._init();this.addItems(a);this.joinParts()};
HTMLHelper.Combobox.prototype._init=function(){this._initWrapper();this._initSwitcher();this._initOptions()};HTMLHelper.Combobox.prototype._initTitle=function(){this.jqTitle=$('<span class="title" />')};HTMLHelper.Combobox.prototype._initIcon=function(){this.jqIcon=$('<span class="icon" />')};HTMLHelper.Combobox.prototype._initOptions=function(){this.jqItems=HTMLHelper.createPopup({"class":"items"})};
HTMLHelper.Combobox.prototype._initWrapper=function(){this.jqWrapper=$('<div class="custom-select" />');this.jqWrapper.data({disable:this.disable.bind(this),enable:this.enable.bind(this)})};HTMLHelper.Combobox.prototype._initSwitcher=function(){var a=this;this._initTitle();this._initIcon();this.jqSwitcher=$('<div class="switcher" />');this.jqSwitcher.append(this.jqTitle);this.jqSwitcher.append(this.jqIcon);this.jqSwitcher.click(function(b){a.toggleItems()})};
HTMLHelper.Combobox.prototype.toggleItems=function(){this.disabled()||this.jqItems.toggle()};HTMLHelper.Combobox.prototype.setWidth=function(){this.jqWrapper.width(this.width)};HTMLHelper.Combobox.prototype.joinParts=function(){this.jqWrapper.append(this.jqSwitcher);this.jqWrapper.append(this.jqItems);this.jqWrapper.selectable(!1)};HTMLHelper.Combobox.prototype.render=function(){return this.jqWrapper};
HTMLHelper.Combobox.prototype.selectItemByValue=function(a){var b=null;$(this.items).each(function(c,d){var e=d.selectAndReturnIfValueMatch(a);e&&(b=e)});return b};HTMLHelper.Combobox.prototype.setValue=function(a){if(this._value!=a){var b=this.selectItemByValue(a);this._value=a;this.jqTitle.html(b.html);this.change()}};HTMLHelper.Combobox.prototype.change=function(a){a?this.callback=a:this.callback&&this.callback.call(this)};HTMLHelper.Combobox.prototype.value=function(){return this._value};
HTMLHelper.Combobox.prototype.val=function(a){if(void 0!==a)this.setValue(a);else return this.value()};HTMLHelper.Combobox.prototype.addItems=function(a){var b=this;$(a).each(function(a,d){b.addItem(d.value,d.html)})};HTMLHelper.Combobox.prototype.addItem=function(a,b){var c=this,d=new HTMLHelper.ComboboxItem(a,b);this.items.push(d);d=d.render();d.click(function(){c.setValue(a);c.toggleItems()});this.jqItems.append(d);null===this.value()&&this.setValue(a)};
HTMLHelper.Combobox.prototype.disable=function(){this._disabled=!0};HTMLHelper.Combobox.prototype.enable=function(){this._disabled=!1};HTMLHelper.Combobox.prototype.disabled=function(){return this._disabled};function List(a){if(void 0==a)this.m_values=[];else if(isArray(a))this.m_values=a;else throw new TypeError("invalid values");this.m_validator=null}List.prototype.validator=function(){return this.m_validator};List.prototype.setValidator=function(a){this.m_validator=a};List.prototype.item=function(a){return this.m_values[a]};
List.prototype.setItem=function(a,b){if(!isInteger(a))throw new RangeError("incorrect index");if(0>a||a>=this.m_values.length)throw new RangeError("incorrect index");if(null!==this.m_validator&&!this.m_validator.check(b))throw new TypeError("value is of unexpected type");this.m_values[a]=b};List.prototype.first=function(){return this.item(0)};List.prototype.last=function(){return this.item(this.size()-1)};
List.prototype.append=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");this.m_values.push(a);return this};List.prototype.insert=function(a,b){if(!isInteger(b))throw new RangeError("invalid index:"+b);if(0>b||b>this.size())throw new RangeError("invalid index:"+b);this.m_values.splice(b,0,a)};
List.prototype.appendAll=function(a){if(!(new TypeValidator(List)).check(a))throw new TypeError("parameter must be of type List");for(var b=0;b<a.size();++b)this.m_values.push(a.item(b));return this};List.prototype.removeAt=function(a){if(!isInteger(a))throw new RangeError("incorrect index");if(0>a||a>=this.m_values.length)throw new RangeError("incorrect index");this.m_values.splice(a,1)};List.prototype.size=function(){return this.m_values.length};List.prototype.isEmpty=function(){return 0===this.size()};
List.prototype.indexOf=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");return this.m_values.indexOf(a)};List.prototype.contains=function(a){return-1!=this.indexOf(a)};List.prototype.remove=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");a=this.indexOf(a);-1!==a&&this.removeAt(a)};List.prototype.removeAll=function(a){this.m_values=this.m_values.filter(function(b){return!a(b)})};
List.prototype.clear=function(){this.m_values=[]};List.prototype.clone=function(){var a=new List;a.setValidator(this.validator());a.m_values=this.m_values.slice();return a};List.prototype.toArray=function(){return this.m_values};List.prototype.sort=function(a){this.m_values.sort(a)};List.prototype.find=function(a){for(var b=0;b<this.m_values.length;b++)if(a(this.m_values[b],b,this.m_values))return this.m_values[b]};
List.prototype.count=function(a){for(var b=0,c=0;c<this.m_values.length;c++)a(this.m_values[c],c,this.m_values)&&b++;return b};function loadScript(a){function b(){d.reject()}function c(){if(e.length){var a=e.shift();if(null==a)return c();var h=document.createElement("script");h.addEventListener("load",c,!0);h.addEventListener("error",b,!0);h.async=!0;h.defer=!0;h.src=a;document.body.appendChild(h)}else d.resolve()}var d=$.Deferred(),e=[].concat(a);c();return d.promise()}var loadTVScript=function(){var a=null;return function(){a||(a="undefined"!==typeof TVScript?$.Deferred().resolve():loadScript(window.TVSCRIPT_FILES));return a.promise()}}();var MathEx={lessThan:function(a,b){return a<=b},greaterThan:function(a,b){return a>=b},clamp:function(a,b,c){return Math.min(Math.max(a,b),c)},sign:function(a){return 0>a?-1:0<a?1:0},isBaseDecimal:function(a){if(0>a)return TradingView.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(;1<a;a/=10)if(0!==a%10)return!1;return!0},greaterOrEqual:function(a,b,c){return b-a<=c},equal:function(a,b,c){return Math.abs(a-b)<c},log10:function(a){if(0>=a)TradingView.logDebug("MathEx.log10: argument less or equal zero");
else return Math.log(a)/Math.log(10)},defComparator:function(a,b){return a<b?-1:a>b?1:0},min:function(a,b){if(!isArray(a))throw"argument is not array";if(1>a.length)throw"array is empty";b||(b=MathEx.defComparator);for(var c=a[0],d=0;d<a.length;++d)0>b(a[d],c)&&(c=a[d]);return c},max:function(a,b){if(!isArray(a))throw"argument is not array";if(1>a.length)throw"array is empty";b||(b=MathEx.defComparator);for(var c=a[0],d=0;d<a.length;++d)0<b(a[d],c)&&(c=a[d]);return c},Point:function(a,b){this.x=a;
this.y=b}};MathEx.Point.prototype.add=function(a){return new MathEx.Point(this.x+a.x,this.y+a.y)};MathEx.Point.prototype.addScaled=function(a,b){return new MathEx.Point(this.x+b*a.x,this.y+b*a.y)};MathEx.Point.prototype.substract=function(a){return new MathEx.Point(this.x-a.x,this.y-a.y)};MathEx.Point.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};MathEx.Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};
MathEx.Point.prototype.scaled=function(a){return new MathEx.Point(this.x*a,this.y*a)};MathEx.Point.prototype.normalized=function(){return this.scaled(1/this.length())};MathEx.Point.prototype.transponed=function(){return new MathEx.Point(-this.y,this.x)};MathEx.Point.prototype.clone=function(){return new MathEx.Point(this.x,this.y)};MathEx.Matrix=function(){this._rows=[[1,0,0],[0,1,0],[0,0,1]]};
MathEx.Matrix.prototype.mult=function(a){if(a instanceof MathEx.Matrix){for(var b=new MathEx.Matrix,c=0;3>c;c++)for(var d=0;3>d;d++)for(var e=b._rows[c][d]=0;3>e;e++)b._rows[c][d]+=this._rows[c][e]*a._rows[e][d];return b}if(a instanceof MathEx.Point){a=[a.x,a.y,1];b=[0,0,0];for(c=0;3>c;c++)for(d=0;3>d;d++)b[c]+=a[d]*this._rows[c][d];return new MathEx.Point(b[0],b[1])}throw"unsupported type";};
MathEx.Matrix.rotate=function(a){var b=new MathEx.Matrix;b._rows[0][0]=Math.cos(a);b._rows[1][1]=Math.cos(a);b._rows[0][1]=-Math.sin(a);b._rows[1][0]=Math.sin(a);return b};MathEx.Matrix.scale=function(a,b){var c=new MathEx.Matrix;c._rows[0][0]=a;c._rows[1][1]=b;return c};MathEx.Matrix.translate=function(a,b){var c=new MathEx.Matrix;c._rows[0][2]=a;c._rows[1][2]=b;return c};
MathEx.distanceToLine=function(a,b,c){b=b.substract(a);var d=c.substract(a).dotProduct(b)/b.dotProduct(b);return{distance:a.addScaled(b,d).substract(c).length(),coeff:d}};MathEx.distanceToSegment=function(a,b,c){var d=MathEx.distanceToLine(a,b,c);if(0<=d.coeff&&1>=d.coeff)return d;a=a.substract(c).length();b=b.substract(c).length();return a<b?{distance:a,coeff:0}:{distance:b,coeff:1}};
MathEx.intersectLines=function(a,b,c,d){b=b.substract(a);d=d.substract(c);b=b.x*d.y-b.y*d.x;if(1E-6>Math.abs(b))return null;a=a.substract(c);return(a.y*d.x-a.x*d.y)/b};MathEx.intersectSegment=function(a,b,c,d){var e=MathEx.intersectLines(a,b,c,d);if(null===e)return null;a=b.substract(a).scaled(e).add(a);c=MathEx.distanceToSegment(c,d,a);return 1E-6>Math.abs(c.distance)?e:null};MathEx.pointInRect=function(a,b,c){return a.x>=b.x&&a.x<=c.x&&a.y>=b.y&&a.y<=c.y};
MathEx.pointInTriangle=function(a,b,c,d){var e=a.add(b).scaled(.5).add(c).scaled(.5),g=MathEx.intersectSegment(a,b,e,d);if(null!==g)return!1;g=MathEx.intersectSegment(b,c,e,d);if(null!==g)return!1;g=MathEx.intersectSegment(c,a,e,d);return null!==g?!1:!0};
MathEx.intersectRayWithRect=function(a,b,c,d){var e=MathEx.intersectLines(a,b,c,new MathEx.Point(d.x,c.y)),g=MathEx.intersectLines(a,b,new MathEx.Point(d.x,c.y),d),h=MathEx.intersectLines(a,b,d,new MathEx.Point(c.x,d.y)),k=MathEx.intersectLines(a,b,new MathEx.Point(c.x,d.y),c),l=[];e&&0<=e&&l.push(e);g&&0<=g&&l.push(g);h&&0<=h&&l.push(h);k&&0<=k&&l.push(k);if(0===l.length)return null;l.sort(function(a,b){return a-b});c=MathEx.pointInRect(a,c,d)?l[0]:l[l.length-1];return a.addScaled(b.substract(a),
c)};MathEx.isInPolygon=function(a,b){for(var c=0,d=a.size()-1,e=!1,g=b.x,h=b.y,c=0;c<a.size();c++){var k=a.item(c),d=a.item(d);(k.y<h&&d.y>=h||d.y<h&&k.y>=h)&&k.x+(h-k.y)/(d.y-k.y)*(d.x-k.x)<g&&(e=!e);d=c}return e};MathEx.isInCircle=function(a,b,c){a=(c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y);radiusQ=b*b;return a<=radiusQ};
MathEx.optionalCorner=function(a,b,c,d){return 1E-6<Math.abs(a.x-b.x)&&1E-6<Math.abs(a.y-b.y)?0==Math.round(a.x)||0==Math.round(b.x)?0==Math.round(a.y)||0==Math.round(b.y)?new MathEx.Point(0,0):new MathEx.Point(0,d):0==Math.round(a.y)||0==Math.round(b.y)?new MathEx.Point(c,0):new MathEx.Point(c,d):null};var CanvasEx={LINESTYLE_SOLID:0,LINESTYLE_DOTTED:1,LINESTYLE_DASHED:2,LINESTYLE_LARGE_DASHED:3,TEXTPOS_TOPLEFT:0,TEXTPOS_TOPCENTER:1,TEXTPOS_TOPRIGHT:2,TEXTPOS_MIDDLELEFT:3,TEXTPOS_MIDDLECENTER:4,TEXTPOS_MIDDLERIGHT:5,TEXTPOS_BOTTOMLEFT:6,TEXTPOS_BOTTOMCENTER:7,TEXTPOS_BOTTOMRIGHT:8,MARKLOC_ABOVEBAR:"AboveBar",MARKLOC_BELOWBAR:"BelowBar",MARKLOC_TOP:"Top",MARKLOC_BOTTOM:"Bottom",MARKLOC_RIGHT:"Right",MARKLOC_LEFT:"Left",MARKLOC_ABSOLUTE:"Absolute",MARKLOC_ABSOLUTEUP:"AbsoluteUp",MARKLOC_ABSOLUTEDOWN:"AbsoluteDown",
HHISTLOC_RELATIVE:"relative",HHISTLOC_ABSOLUTE:"absolute",HHISTDIR_LEFTTORIGHT:"left_to_right",HHISTDIR_RIGHTTOLEFT:"right_to_left"};CanvasEx.computeDashPattern=function(a){return[[a.lineWidth,2*a.lineWidth],[3*a.lineWidth,2*a.lineWidth],[6*a.lineWidth,6*a.lineWidth]][a.lineStyle-1]};CanvasEx.drawLine=function(a,b,c,d,e){isFinite(b)&&isFinite(d)&&isFinite(c)&&isFinite(e)&&(a.lineStyle===CanvasEx.LINESTYLE_DASHED||a.lineStyle===CanvasEx.LINESTYLE_DOTTED?a.drawDashedLine(a,b,c,d,e):CanvasEx.drawSolidLine(a,b,c,d,e))};CanvasEx.drawSolidLine=function(a,b,c,d,e){a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()};
CanvasEx.setLineStyle=function(a,b){a.lineStyle=b;var c=[];b!=CanvasEx.LINESTYLE_SOLID&&(c=CanvasEx.computeDashPattern(a));"function"==typeof a.setLineDash?a.setLineDash(c):void 0!==a.mozDash?a.mozDash=c:void 0!==a.webkitLineDash&&(a.webkitLineDash=c)};CanvasEx.drawPoly=function(a,b,c){a.beginPath();a.moveTo(b[0].x,b[0].y);for(var d=0;d<b.length;d++){var e=b[d];a.lineTo(e.x,e.y)}a.closePath();a.stroke();c&&a.fill()};CanvasEx.lineStyles=[];
"undefined"!==typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(a){if(this.font!=a)try{this.font=a}catch(b){}},CanvasRenderingContext2D.prototype.lineStyle=CanvasEx.LINESTYLE_SOLID,CanvasEx.originalSave=CanvasRenderingContext2D.prototype.save,CanvasEx.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){CanvasEx.lineStyles.push(this.lineStyle);CanvasEx.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=
function(){0<CanvasEx.lineStyles.length&&(this.lineStyle=CanvasEx.lineStyles.pop(),CanvasEx.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(a,b,c,d,e){a.save();var g=CanvasEx.computeDashPattern(a);a.beginPath();if("function"==typeof a.setLineDash)a.setLineDash(g);else if(void 0!==a.mozDash)a.mozDash=g;else if(void 0!==a.webkitLineDash)a.webkitLineDash=g;else{a.dashedLineTo(b,c,d,e,g);a.stroke();a.restore();return}a.moveTo(b,c);a.lineTo(d,e);a.stroke();a.restore()},
CanvasRenderingContext2D.prototype.dashedLineTo=function(a,b,c,d,e){var g={thereYet:MathEx.greaterThan,cap:Math.min},h={thereYet:MathEx.greaterThan,cap:Math.min};0<b-d&&(h.thereYet=MathEx.lessThan,h.cap=Math.max);0<a-c&&(g.thereYet=MathEx.lessThan,g.cap=Math.max);this.moveTo(a,b);for(var k=a,l=b,m=0,n=!0;!g.thereYet(k,c)||!h.thereYet(l,d);){var q=Math.atan2(d-b,c-a),r=e[m],k=g.cap(c,k+Math.cos(q)*r),l=h.cap(d,l+Math.sin(q)*r);n?this.lineTo(k,l):this.moveTo(k,l);m=(m+1)%e.length;n=!n}},CanvasRenderingContext2D.prototype.roundRect=
function(a,b,c,d,e){this.beginPath();this.moveTo(a+e,b);this.lineTo(a+c-e,b);this.arcTo(a+c,b,a+c,b+e,e);this.lineTo(a+c,b+d-e);this.arcTo(a+c,b+d,a+c-e,b+d,e);this.lineTo(a+e,b+d);this.arcTo(a,b+d,a,b+d-e,e);this.lineTo(a,b+e);this.arcTo(a,b,a+e,b,e)});String.prototype.left=function(a){if(!isInteger(a))throw"invalid length";if(a>this.length)throw"invalid length";return this.substring(0,a)};String.prototype.right=function(a){if(!isInteger(a))throw"invalid length";if(a>this.length)throw"invalid length";return this.substring(this.length-a,this.length)};String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};String.prototype.startsWith=function(a){return a.length>this.length?!1:this.left(a.length)===a};function Delegate(){this._listeners=new List}Delegate.prototype.subscribe=function(a,b,c){this._listeners.append({object:a,member:b,singleshot:!!c})};Delegate.prototype.unsubscribe=function(a,b){for(var c=0;c<this._listeners.size();++c){var d=this._listeners.item(c);if(d.object===a&&d.member.prototype===b.prototype){this._listeners.removeAt(c);break}}};
Delegate.prototype.fire=function(a){for(var b=$.extend(!0,{},this._listeners),c=0;c<b.size();++c){var d=b.item(c);d.object?d.member.call(d.object,a):d.member(a)}this._listeners.removeAll(function(a){return a.singleshot})};/*
Use it if you like it
*/
function RGBColor(a){this.ok=!1;"#"==a.charAt(0)&&(a=a.substr(1,6));a=a.replace(/ /g,"");a=a.toLowerCase();var b={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",
darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",
gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",
oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",
slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in b)a==c&&(a=b[c]);b=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,
example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(c=0;c<b.length;c++){var d=b[c].process,e=b[c].re.exec(a);e&&(channels=d(e),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.cleanupRGB=function(){this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=
0>this.g||isNaN(this.g)?0:255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b};this.cleanupRGB();this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);1==a.length&&(a="0"+a);1==b.length&&(b="0"+b);1==c.length&&(c="0"+c);return"#"+a+b+c};this.grayChannel=function(){var a=[.199,.687,.114];return a[0]*this.r+a[1]*this.g+a[2]*this.b};this.blackWhiteContrast=function(){return 150>
this.grayChannel()?"white":"black"};this.darken=function(a){var b=TradingView.rgbToHsl(this.r,this.g,this.b);a=TradingView.hslToRgb(b[0],b[1],b[2]-a/100);this.r=a[0];this.g=a[1];this.b=a[2];this.cleanupRGB();return this}}TradingView.rgbToHsl=function(a,b,c){a/=255;b/=255;c/=255;var d=Math.max(a,b,c),e=Math.min(a,b,c),g,h=(d+e)/2;if(d==e)g=e=0;else{var k=d-e,e=.5<h?k/(2-d-e):k/(d+e);switch(d){case a:g=(b-c)/k+(b<c?6:0);break;case b:g=(c-a)/k+2;break;case c:g=(a-b)/k+4}g/=6}return[g,e,h]};
TradingView.hslToRgb=function(a,b,c){if(0===b)c=b=a=c;else{var d=function(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a},e=.5>c?c*(1+b):c+b-c*b,g=2*c-e;c=d(g,e,a+1/3);b=d(g,e,a);a=d(g,e,a-1/3)}return[Math.round(255*c),Math.round(255*b),Math.round(255*a)]};
TradingView.colorsAreSimilar=function(a,b){var c=parseInt(a.substring(1,3),16),d=parseInt(a.substring(3,5),16),e=parseInt(a.substring(5,7),16),g=parseInt(b.substring(1,3),16),h=parseInt(b.substring(3,5),16),k=parseInt(b.substring(5,7),16),c=g-c,d=d-h,e=e-k;return 16>Math.sqrt(c*c+d*d+e*e)};
TradingView.invertColor=function(a){var b=parseInt(a.substring(1,3),16),c=parseInt(a.substring(3,5),16);a=parseInt(a.substring(5,7),16);c=255-c;a=255-a;return"#"+("0"+(255-b).toString(16)).right(2)+("0"+c.toString(16)).right(2)+("0"+a.toString(16)).right(2)};function PixelSet(a,b,c){this._rawData=a?a:Array(b*c*4);this._width=b;this._height=c}PixelSet.prototype.rawData=function(){return this._rawData};PixelSet.prototype.width=function(){return this._width};PixelSet.prototype.height=function(){return this._height};PixelSet.prototype.pixel=function(a,b){var c=[],d=b*this._width*4+4*a;c.push(this._rawData[d]);c.push(this._rawData[d+1]);c.push(this._rawData[d+2]);c.push(this._rawData[d+3]);return c};
PixelSet.prototype.setPixel=function(a,b,c){a=b*this._width*4+4*a;this._rawData[a]=c[0];this._rawData[a+1]=c[1];this._rawData[a+2]=c[2];this._rawData[a+3]=c[3]};
PixelSet.prototype.blend=function(a,b,c,d,e,g,h){d||(d=this.width());e||(e=this.height());g||(g=0);h||(h=0);for(var k=a.getImageData(b,c,d,e),l=0;l<d;l++)for(var m=0;m<e;m++){var n=m*d*4+4*l,q=this.pixel(g+l,h+m),r=q[1],u=q[2],w=1-q[3]/255;k.data[n]=k.data[n]*w+q[0]*(1-w);k.data[n+1]=k.data[n+1]*w+r*(1-w);k.data[n+2]=k.data[n+2]*w+u*(1-w);k.data[n+3]=Math.max(q[3],k.data[n+3])}a.putImageData(k,b,c)};TradingView.getImage=function(a,b){var c=document.body,d=c[a];d||(d=document.createElement("img"),d.src=b,c[a]=d);return d};A68=function(){function a(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;return a}function b(){}function c(a){this.value=a}function d(){}function e(){}function g(){}function h(){}function k(){}function l(){}function m(){}function n(a){this.value=a}function q(a){this.value=a}function r(a){this.value=a}function u(){n.apply(this,arguments)}function w(){q.apply(this,arguments)}function A(a,b){var d=[],e;a:for(;e=G.exec(a);){for(var g=C.length;g--;)if(void 0!==e[g+
1]){C[g].ctor&&(g=new C[g].ctor(e[g+1]),g._offset=e.index,d.push(g));continue a}g=new r(e[0]);g._offset=e.index;d.push(g)}if(b&&b.recover)for(var h,g=d.length;g--;)e=d[g],e instanceof q||e instanceof n?(void 0!==h&&(e=new n(""),h=d.splice(g,h-g+1,e),e.value=h.map(function(a){return a.value}).join("")),h=g):e instanceof c||(h=void 0);return d}function v(a){for(var b=[],d=0;d<a.length;d++)a[d]instanceof c||b.push(a[d]);return b}function B(a){a=v(a);for(var b=[],c=[],h=0;h<a.length;h++){var k=a[h];if(k instanceof
g)c.length&&c[c.length-1].minPrecedence>k.precedence&&(c[c.length-1].minPrecedence=k.precedence);else if(k instanceof d)c.push({minPrecedence:Infinity,openBraceIndex:h});else if(k instanceof e){var k=c.pop(),l=a[k.openBraceIndex-1],m=a[h+1];m instanceof g&&!(m.precedence<=k.minPrecedence)||l instanceof g&&!(l.precedence<k.minPrecedence||l.precedence===k.minPrecedence&&l.commutative)||(b.unshift(k.openBraceIndex),b.push(h),c.length&&c[c.length-1].minPrecedence>k.minPrecedence&&(c[c.length-1].minPrecedence=
k.minPrecedence))}}for(h=b.length;h--;)a.splice(b[h],1);return a}function D(a){for(var b=0,h=0,k,l=0;l<a.length;l++){var n=a[l];if(!(n instanceof c))switch(b){case 0:if(n instanceof q&&1===+n.value)b=1;else return!1;break;case 1:if(1===b&&n instanceof m)b=2,k=l+1;else return!1;break;case 2:if(n instanceof d)b=3,h=1;else if(n instanceof g)return!1;break;case 3:n instanceof d?h++:n instanceof e&&(h--,0>=h&&(b=2))}}return a.slice(k)}var C=[{pattern:"(",ctor:d},{pattern:")",ctor:e},{pattern:"+",ctor:h},
{pattern:"-",ctor:k},{pattern:"*",ctor:l},{pattern:"/",ctor:m},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:q},{pattern:/\./,ctor:w},{pattern:W77.enabled("charting_library")?/[a-zA-Z0-9_\u4e00-\u9fa5^][a-zA-Z0-9_\u4e00-\u9fa5_!:\.&]*|'.+?'/:/[a-zA-Z0-9][a-zA-Z0-9_!|:\.&]*|'.+?'/,ctor:n},{pattern:/'[^']*/,ctor:u},{pattern:/[\0-\x20\s]+/,ctor:c}];b.prototype.toString=function(){return this.value};a(c,b);a(d,b);d.prototype.value="(";a(e,b);e.prototype.value=")";a(g,b);a(h,g);h.prototype.value=
"+";h.prototype.precedence=0;h.prototype.commutative=!0;a(k,g);k.prototype.value="-";k.prototype.precedence=0;k.prototype.commutative=!1;a(l,g);l.prototype.value="*";l.prototype.precedence=1;l.prototype.commutative=!0;a(m,g);m.prototype.value="/";m.prototype.precedence=1;m.prototype.commutative=!1;var z=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,F=/[\+\-\/\*]/;a(n,b);n.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var a=F.test(this._ticker)?"'":"";return a+(this._exchange?this._exchange+
":":"")+this._ticker+a}return this.value};n.prototype.parse=function(){var a=z.exec(this.value);a[1]&&(this._exchange=a[1]);this._ticker=a[2]};n.prototype.parseAsFutures=function(){if(TradingView.futuresRoots){this.hasOwnProperty("_ticker")||this.parse();for(var a=function(a){return TradingView.futuresRoots.some(function(b){return b.t===a})},b=2;1<=b;--b){var c=this._ticker.slice(0,b);if(a(c)){this._root=c;this._contract=this._ticker.slice(b);break}}}};n.prototype.exchange=function(a){this.hasOwnProperty("_ticker")||
this.parse();if(0<arguments.length)null===a||void 0===a?delete this._exchange:this._exchange=a+"";else return this._exchange};n.prototype.ticker=function(a){this.hasOwnProperty("_ticker")||this.parse();if(0<arguments.length)null===a||void 0===a?delete this._ticker:this._ticker=a+"",delete this._root,delete this._contract;else return this._ticker};n.prototype.root=function(a){this.hasOwnProperty("_root")||this.parseAsFutures();if(0<arguments.length)if(null===a||void 0===a)delete this._root;else{if(this._root=
a+"")this._ticker=this._root+(this._contract||"")}else return this._root};n.prototype.contract=function(a){this.hasOwnProperty("_contract")||this.parseAsFutures();if(0<arguments.length)null===a||void 0===a?delete this._contract:(this._contract=a+"",this._root&&(this._ticker=this._root+this._contract));else return this._root};a(q,b);q.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value};q.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,
"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")};r.prototype.toString=function(){return this.value};a(u,n);u.prototype.isIncomplete=!0;u.prototype.incompleteSuggest=function(){if("'"!==this.value)return new String("'")};a(w,q);w.prototype.isIncomplete=!0;var G=new RegExp(C.map(function(a){return"("+("string"===typeof a.pattern?a.pattern.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&"):a.pattern.source)+")"}).concat(".").join("|"),"g");return{tokenize:A,validate:function(a){if(W77.enabled("charting_library"))return{currentState:"var"};
for(var b="init",h={warnings:[],errors:[],isEmpty:!0},k=[],l=0;l<a.length;l++){var m=a[l];if(!(m instanceof c)){delete h.isEmpty;if(m.isIncomplete){var v={status:"incomplete",reason:"incomplete_token",offset:m._offset,token:m};m.incompleteSuggest&&(v.recover={append:m.incompleteSuggest()});h.warnings.push(v);if(l!==a.length-1){v.status="error";continue}}m instanceof n||m instanceof q?"var"==b?h.errors.push({status:"error",reason:"unexpected_token",offset:m._offset,token:m}):b="var":m instanceof g?
"var"!=b?h.errors.push({status:"error",reason:"unexpected_token",offset:m._offset,token:m}):b="operator":m instanceof d?"var"==b?h.errors.push({status:"error",reason:"unexpected_token",offset:m._offset,token:m}):(k.push(m),b="init"):m instanceof e?"var"!=b?h.errors.push({status:"error",reason:"unexpected_token",offset:m._offset,token:m}):(k.pop()||h.errors.push({status:"error",reason:"unbalanced_brace",offset:m._offset,token:m,recover:{prepend:new d}}),b="var"):m instanceof r&&h.errors.push({status:"error",
reason:"unparsed_entity",offset:m._offset,token:m})}}h.braceBalance=k.length;for("var"!==b&&h.warnings.push({status:"incomplete"});k.length;)m=k.pop(),v={status:"incomplete",reason:"unbalanced_brace",offset:m._offset,token:m},"var"==b&&(v.recover={append:new e}),h.warnings.push(v);h.currentState=b;0===h.warnings.length&&delete h.warnings;0===h.errors.length&&delete h.errors;return h},factorOutBraces:B,normalizeTokens:function(a){for(var b=0;b<a.length;b++)a[b].parse&&a[b].parse();return a},flip:function(a){var b=
D(a);return b?B(b):B([new q("1"),new m,new d].concat(a).concat(new e))},hasBatsSymbols:function(a){if("string"===typeof a)a=A(a);else if(!Array.isArray(a))throw new TypeError("expression must be a string or token array");return a.some(function(a){return a instanceof n&&"BATS"===(a.exchange()||"").toUpperCase()?!0:!1})},hasEodSymbols:function(a){if("string"===typeof a)a=A(a);else if(!Array.isArray(a))throw new TypeError("expression must be a string or token array");return a.some(function(a){return a instanceof
n&&-1!==(a.exchange()||"").toUpperCase().indexOf("_EOD")?!0:!1})},SymbolToken:n,IncompleteSymbolToken:u,NumberToken:q,BinaryOperatorToken:g,OpenBraceToken:d,CloseBraceToken:e,ticker:function(a){return(new n(a)).ticker()},shortName:function(a){if("string"!==typeof a)throw new TypeError("expression must be a string");a=B(v(A(a)));a.forEach(function(a){a instanceof n&&a.exchange(null)});return a.join("")},normalize:function(a){if("string"!==typeof a)throw new TypeError("expression must be a string");
return B(v(A(a))).join("")}}}();function ReadonlyWatchedValue(){}function WatchedValue(a){if(!(this instanceof WatchedValue))return new WatchedValue(a);0<arguments.length&&(this._value=a);this._listeners=[]}WatchedValue.prototype.value=function(){return this._owner?this._owner._value:this._value};
WatchedValue.prototype.setValue=function(a,b){var c=this._owner?this._owner:this;"function"===typeof c.hook&&(a=c.hook(a));if(c.writeLock)return c._value;if(!b&&c._value===a&&c.hasOwnProperty("_value"))return a;c._value=a;for(var d=c._listeners.slice(),e=0,g=0;g<d.length;g++)d[g].once&&(c._listeners.splice(g-e,1),e++),d[g].cb(a);return a};
WatchedValue.prototype.deleteValue=function(){var a=this._owner?this._owner:this;if(a.hasOwnProperty("_value")){if(a.writeLock)return a._value;delete a._value;for(var b=a._listeners.slice(),c=0;c<b.length;c++)b[c].once&&a._listeners.splice(c-deletedEntries,1);for(c=0;c<b.length;c++)b[c].cb()}};
WatchedValue.prototype.subscribe=function(a,b){if("function"!==typeof a)throw new TypeError("callback must be a function");var c=!!b&&!!b.once,d=this._owner?this._owner:this;if(b&&b.callWithLast&&d.hasOwnProperty("_value")&&(a(d._value),c))return;d._listeners.push({cb:a,owner:this,once:!!b&&!!b.once})};
WatchedValue.prototype.unsubscribe=function(a){var b=this._owner?this._owner:this;void 0===a&&(a=null);for(var c=b._listeners,d=c.length;d--;)c[d].owner!==this&&b!==this||c[d].cb!==a&&null!==a||c.splice(d,1)};WatchedValue.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var a=this._readonlyInstance=new ReadonlyWatchedValue;a.subscribe=this.subscribe.bind(this);a.unsubscribe=this.unsubscribe.bind(this);a.value=this.value.bind(this);a.when=this.when.bind(this);return a};
WatchedValue.prototype.spawn=function(){var a=new WatchedValue;delete a._listeners;a._owner=this._owner||this;a.destroy=function(){this.unsubscribe();delete this._owner};return a};WatchedValue.prototype.when=function(a){var b=this;if(this.value())a();else{var c=function(d){d&&(b.unsubscribe(c),a())};b.subscribe(c)}};WEB_SOCKET_SWF_LOCATION=TradingView.resourceFullPath("web_socket_main.swf");WEB_SOCKET_WAS_CONNECTED=WEB_SOCKET_DEBUG=!1;STUDY_COUNT_LIMIT=100;function HandlerInfo(a,b){this.handler=a;this.customId=b;this.requestHook=null}function W98(){}W98.prototype.defaultWatchlistSymbols=function(){};W98.prototype.availableTimeFrames=function(a,b){};W98.prototype.defaultResolutions=function(){};W98.prototype.supportedSymbolsTypes=function(){};
W98.prototype.supportedExchangesList=function(){};W98.prototype.setAuthToken=function(a,b){};W98.prototype.authTokenRequired=function(a){};W98.prototype.quoteCreateSession=function(a){};W98.prototype.quoteDeleteSession=function(a){};W98.prototype.quoteSetFields=function(a,b){};W98.prototype.quoteAddSymbols=function(a,b){};W98.prototype.quoteRemoveSymbols=function(a,b){};
W98.prototype.quoteFastSymbols=function(a,b){};W98.prototype.depthCreateSession=function(a,b,c){};W98.prototype.depthDeleteSession=function(a){};W98.prototype.depthSetSymbol=function(a,b){};W98.prototype.depthClearSymbol=function(a){};W98.prototype.depthSetScale=function(a,b){};W98.prototype.chartCreateSession=function(a,b){};W98.prototype.chartDeleteSession=function(a){};
W98.prototype.createSession=function(a,b){};W98.prototype.removeSession=function(a){};W98.prototype.connected=function(){};W98.prototype._getHost=function(a){};W98.prototype.connect=function(){};W98.prototype.disconnect=function(){};W98.prototype.switchTimezone=function(a,b){};W98.prototype.resolveSymbol=function(a,b,c,d,e){};
W98.prototype.createSeries=function(a,b,c,d,e,g,h){};W98.prototype.removeSeries=function(a,b,c){};W98.prototype.modifySeries=function(a,b,c,d,e,g){};W98.prototype.requestMoreData=function(a,b,c,d){};W98.prototype.requestMetadata=function(a,b,c){};W98.prototype.isCanCreateStudy=function(){};W98.prototype.createStudy=function(a,b,c,d,e,g,h){};W98.prototype.removeStudy=function(a,b,c){};
W98.prototype.modifyStudy=function(a,b,c,d,e){};W98.prototype.createPointset=function(a,b,c,d,e,g,h){};W98.prototype.modifyPointset=function(a,b,c,d,e){};W98.prototype.removePointset=function(a,b,c){};W98.prototype.requestMoreTickmarks=function(a,b,c,d){};W98.prototype.requestFirstBarTime=function(a,b,c,d){};W98.prototype._invokeHandler=function(a,b){};
W98.prototype._sendRequest=function(a,b){};W98.prototype._onMessage=function(a){};W98.prototype._convertTimescaleResponse=function(a){};W98.prototype._dispathNotification=function(a){};W98.prototype._invokeNotificationHandler=function(a,b,c){};W98.prototype._notifySessions=function(a){};W98.prototype.unpack=function(a){};W98.prototype.reconnectTimeout=function(a){};
W98.prototype.searchSymbolsByName=function(a){};W98.prototype._isSafari5=function(){};W98.prototype._isIE9=function(){};W98.prototype._isIOS5=function(){};W98.prototype._getPort=function(a){};W98.prototype.getMarks=function(a,b,c,d,e){};declareClassAsPureInterface(W98,"W98");function ChartSession(a,b){this._chartApi=a;this._sessionid="cs_"+TradingView.randomHash();this._sessionDisabled=!1;this._disableStatistics=!!b}ChartSession.prototype.serverTimeOffset=function(){return this._chartApi._serverTimeOffset};ChartSession.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled};ChartSession.prototype.disconnected=function(){var a=this;Object.keys(this).forEach(function(b){/^(s|st|symbol_)\d+$/.test(b)&&delete a[b]})};
ChartSession.prototype.initSession=function(){this._chartApi.createSession(this._sessionid,this)};ChartSession.prototype.stopSession=function(){this._chartApi.removeSession(this._sessionid)};ChartSession.prototype.setHandler=function(a){this._globalHandler=a};ChartSession.prototype.sessionId=function(){return this._sessionid};ChartSession.prototype.connect=function(a){this._globalHandler=a;this.initSession();this._chartApi.connect()};ChartSession.prototype.disconnect=function(){this._chartApi.disconnect()};
ChartSession.prototype.switchTimezone=function(a){this._chartApi.switchTimezone(this._sessionid,a)};ChartSession.prototype.resolveSymbol=function(a,b,c){this._chartApi.resolveSymbol(this._sessionid,a,b,c)};ChartSession.prototype.createSeries=function(a,b,c,d,e,g){this._chartApi.createSeries(this._sessionid,a,b,c,d,e,g)};ChartSession.prototype.removeSeries=function(a,b){this._chartApi.removeSeries(this._sessionid,a,b)};
ChartSession.prototype.modifySeries=function(a,b,c,d,e){this._chartApi.modifySeries(this._sessionid,a,b,c,d,e)};ChartSession.prototype.requestMoreData=function(a,b,c){this._chartApi.requestMoreData(this._sessionid,a,b,c)};ChartSession.prototype.requestMetadata=function(a,b){this._chartApi.requestMetadata(this._sessionid,a,b)};ChartSession.prototype.createStudy=function(a,b,c,d,e,g){this._chartApi.createStudy(this._sessionid,a,b,c,d,e,g)};
ChartSession.prototype.removeStudy=function(a,b){this._chartApi.removeStudy(this._sessionid,a,b)};ChartSession.prototype.modifyStudy=function(a,b,c,d){this._chartApi.modifyStudy(this._sessionid,a,b,c,d)};ChartSession.prototype.createPointset=function(a,b,c,d,e,g){this._chartApi.createPointset(this._sessionid,a,b,c,d,e,g)};ChartSession.prototype.modifyPointset=function(a,b,c,d){this._chartApi.modifyPointset(this._sessionid,a,b,c,d)};
ChartSession.prototype.removePointset=function(a,b){this._chartApi.removePointset(this._sessionid,a,b)};ChartSession.prototype.requestMoreTickmarks=function(a,b,c){this._chartApi.requestMoreTickmarks(this._sessionid,a,b,c)};ChartSession.prototype.requestFirstBarTime=function(a,b,c){this._chartApi.requestFirstBarTime(this._sessionid,a,b,c)};ChartSession.prototype.setVisibleTimeRange=function(a,b,c){this._chartApi.setVisibleTimeRange(this._sessionid,a,b,c)};
ChartSession.prototype.onMessage=function(a){switch(a.method){case "connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case "disconnected":this.disconnected()}this._globalHandler&&this._globalHandler(a)};ChartSession.prototype.disable=function(){this._sessionDisabled=!0};function TimeIndexes(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null}TimeIndexes.prototype.clear=function(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null};TimeIndexes.prototype.items=function(){return this._items};TimeIndexes.prototype.size=function(){return this._items.length};TimeIndexes.prototype.firstTimePointIndex=function(){return this.offsetToIndex(0)};
TimeIndexes.prototype.lastTimePointIndex=function(){return null!==this._lastTimePointIndex&&void 0!==this._lastTimePointIndex?this._lastTimePointIndex:this._lastTimePointIndex=this.offsetToIndex(this.size()-1)};
TimeIndexes.prototype.merge=function(a,b,c){if(0===this._items.length)return this._items=c,this._zoffset=b,[{change:"rebuild",index:0}];var d=a+this._zoffset;if(0>d){d=Math.abs(d);this._items=Array(d).concat(this._items);this._zoffset=b;for(var e=0;e<c.length;++e)this._items[a+e+b]=c[e];return[{change:"rebuild",index:0}]}a=[];for(e=d;e<this._items.length&&e-d<c.length;++e)this._items[e]=c[e-d],a.push({change:"update",index:e-this._zoffset,value:c[e-d]});d+=c.length;if(d>this._items.length)for(d-=
this._items.length,e=0;e<d;++e){var g=this._items.length;this._items.push(c[e]);a.push({change:"append",index:g-this._zoffset,value:c[e]})}this._zoffset=b;this._lastTimePointIndex=null;return a};TimeIndexes.prototype.addTail=function(a,b){for(var c=b?1:0;c<a.length;c++)this._items.push(a[c]),this._lastTimePointIndex++};TimeIndexes.prototype.valueAt=function(a){a=this.indexToOffset(a);if(void 0!==a)return this._items[a]};
TimeIndexes.prototype.indexOf=function(a,b){if(b&&a>this._items[this._items.length-1])return this.offsetToIndex(this._items.length-1);for(var c=0;c<this._items.length&&!(a<this._items[c]);++c)if(!(a>this._items[c]))return this.offsetToIndex(c);return b?this.offsetToIndex(c):void 0};TimeIndexes.prototype.offsetToIndex=function(a){if(0<=a&&a<this.size())return a-this._zoffset};TimeIndexes.prototype.indexToOffset=function(a){a+=this._zoffset;if(0<=a&&a<this.size())return a};
TimeIndexes.prototype.state=function(){var a={};a.zoffset=this._zoffset;a.items=this._items;return a};TimeIndexes.prototype.restoreState=function(a){a&&(this._zoffset=a.zoffset,this._items=a.items,this._lastTimePointIndex=null)};
TimeIndexes.prototype.closestIndexLeft=function(a){var b=this._items;if(b.length&&a===a){var c=b.length-1;if(a>=b[c])return c-this._zoffset;var d=0,e=b[d];if(!(a<e)){if(a==e)return d-this._zoffset;for(;c>d+1;){var e=d+c>>1,g=b[e];if(g>a)c=e;else if(g<a)d=e;else{if(g===a)return e-this._zoffset;return}}return d-this._zoffset}}};function PlotList(a){this._items=[];this._columns=a?a:[];this._end=this._start=0;this._shareread=!1}PlotList.prototype.clear=function(){this._items=[];this._columns=[];this._end=this._start=0;this._shareread=!1};PlotList.prototype.columns=function(){return this._columns};PlotList.prototype.last=function(){return this._items[this._end-this._start-1]};PlotList.prototype.first=function(){return this._items[0]};PlotList.prototype.firstIndex=function(){return this._start};
PlotList.prototype.lastIndex=function(){return this._end-this._start-1};PlotList.prototype.size=function(){return this._end-this._start};PlotList.prototype.isEmpty=function(){return 0===this.size()};PlotList.prototype.contains=function(a){return-1!=this._search(a)};PlotList.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
PlotList.prototype.add=function(a,b){if(this._shareread)return TradingView.logDebug("PlotList.add: readonly collection modification attempt"),!1;var c=this._createPair(a,b),d=this._search(a);if(0>d)return d=this._lowerbound(a,-1),this._items.splice(d,0,c),this._start=0,this._end=this._items.length,!0;this._items[d]=c;return!1};var SEARCH_NEAREST_LEFT=-1,SEARCH_EXACT=0,SEARCH_NEAREST_RIGHT=1;PlotList.prototype.search=function(a,b){var c=this._search(a,b);return 0>c?void 0:{index:this._indexAt(c),value:this._valueAt(c)}};
PlotList.prototype.fold=function(a,b){for(var c=b,d=this._start;d<this._end;++d)c=a(this._indexAt(d),this._valueAt(d),c);return c};PlotList.prototype.each=function(a){for(var b=this._start;b<this._end&&!a(this._indexAt(b),this._valueAt(b));++b);};PlotList.prototype.reduce=function(a,b){for(var c=b,d=this._start;d<this._end;++d)c=a(c,this._indexAt(d),this._valueAt(d));return c};
PlotList.prototype.range=function(a,b){var c=new PlotList;c._items=this._items;c._start=this._lowerbound(a);c._end=Math.min(this._lowerbound(b)+1,c._items.length);c._shareread=!0;return c};
PlotList.prototype.minMaxOnRange=function(a,b,c){for(var d=this._lowerbound(a),e=Math.min(this._lowerbound(b)+1,this._items.length),g=null,h=null,k=0;k<c.length;k++){var l=c[k],d=this._lowerbound(a-l.offset),e=Math.min(this._lowerbound(b-l.offset)+1,this._items.length);for(this._items[e-1]>b-l.offset&&(e=d);d<e;d++){var m=this._items[d].value[l.index];if(void 0!==m&&null!==m){if(null===g||m<g)g=m;if(null==h||m>h)h=m}}void 0!==l.baseValue&&(g=Math.min(l.baseValue,g),h=Math.max(l.baseValue,h))}return{min:g,
max:h}};PlotList.prototype.merge=function(a){if(this._shareread)return TradingView.logDebug("PlotList.merge: shared collection modification attempt"),[];for(var b=[],c=0;c<a.length;++c){var d=a[c];this.add(d.index,d.value)?b.push({insert:d}):b.push({update:d})}return b};PlotList.prototype.addTail=function(a,b){var c=0;b&&0<this._end-this._start&&(c=1,this._items[this._end-this._start-1].value=a[0].value);for(;c<a.length;++c){var d=a[c];this.add(parseInt(this.last(),10)+1,d.value)}};
PlotList.prototype._createPair=function(a,b){var c=new Number(a);c.value=b;return c};PlotList.prototype._valueAt=function(a){return this._items[a].value};PlotList.prototype._length=function(a){return this._items.length};PlotList.prototype._indexAt=function(a){return this._items[a].valueOf()};
PlotList.prototype._search=function(a,b){var c=this._bsearch(a);if(-1!=c||!b)return c;if(0>b)return c=this._lowerbound(a),c>this._start&&--c,c!=this._end&&this._indexAt(c)<a?c:-1;c=this._upperbound(a);return c!=this._end&&a<this._indexAt(c)?c:-1};PlotList.prototype._bsearch=function(a){var b=this._lowerbound(a);return b==this._end||a<this._items[b]?-1:b};PlotList.prototype._lowerbound=function(a){for(var b=this._start,c=this._end-b;0<c;){var d=c>>1,e=b+d;this._items[e]<a?(b=e+1,c-=d+1):c=d}return b};
PlotList.prototype._upperbound=function(a){for(var b=this._start,c=this._end-b;0<c;){var d=c>>1,e=b+d;a<this._items[e]?c=d:(b=e+1,c-=d+1)}return b};PlotList.prototype.state=function(){var a={};a.columns=this._columns;a.start=this._start;a.end=this._end;a.shareread=this._shareread;a.data=[];for(var b in this._items)a.data.push({index:new Number(this._items[b]),value:this._items[b].value});return a};
PlotList.prototype.restoreState=function(a){if(a){this._columns=a.columns;this._start=a.start;this._end=a.end;this._shareread=a.shareread;this._items=[];for(var b=0;b<a.data.length;b++){var c=new Number(a.data[b].index);c.value=a.data[b].value;this._items.push(c)}}else this.clear()};PlotList.prototype.firstTimeIndex=function(){return this._indexAt(this._start)};PlotList.prototype.lastTimeIndex=function(){return this._indexAt(this._end-1)};function StudyMetaInfo(a){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}});TradingView.merge(this,a);TradingView.merge(this,StudyMetaInfo.parseIdString(a.id));this.name=this.id}StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION=31;StudyMetaInfo.FilledArea={};StudyMetaInfo.FilledArea.TYPE_PLOTS="plot_plot";StudyMetaInfo.FilledArea.TYPE_HLINES="hline_hline";
StudyMetaInfo.versionOf=function(a){a="_metainfoVersion"in a&&isNumber(a._metainfoVersion)?a._metainfoVersion:0;0>a&&console.error("Metainfo format version cannot be negative: "+a);a>StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION&&console.warn("Client doesn't support this version of metainfo format: "+a);return a};
StudyMetaInfo.parseIdString=function(a){var b={};if(-1==a.indexOf("@"))b.shortId=a,b.packageId="tv-basicstudies",b.id=a+"@"+b.packageId,b.version=1;else{var c=a.split("@");b.shortId=c[0];c=c[1].split("-");if(3===c.length)b.packageId=c.slice(0,2).join("-"),b.id=b.shortId+"@"+b.packageId,b.version=c[2];else if(1===c.length&&"decisionbar"===c[0])b.packageId="les-"+c[0],b.id=b.shortId+"@"+b.packageId,b.version=1;else if(1===c.length)b.packageId="tv-"+c[0],b.id=b.shortId+"@"+b.packageId,b.version=1;else throw Error("unexpected study id:"+
a);}b.fullId=b.id+"-"+b.version;"tv-scripting"===b.packageId?(a=b.shortId,0===a.indexOf("Script$")?(c=a.indexOf("_"),b.productId=0<=c?a.substring(0,c):b.packageId):b.productId=b.packageId):b.productId=b.packageId;return b};StudyMetaInfo.getPackageName=function(a){return(/^[^@]+@([^-]+-[^-]+)/.exec(a||"")||[0,"tv-basicstudies"])[1]};StudyMetaInfo.cutFullId=function(a){return a.replace(/(@[^-]+-[^-]+).*$/,"$1")};
StudyMetaInfo.cutDollarHash=function(a){var b=a.indexOf("$"),c=a.indexOf("@");if(-1==b)return a;b=a.substr(0,b);a=0<=c?a.substr(c):"";return b+a};StudyMetaInfo.prototype.parseValue=function(a,b){return"bool"===a?parseBool(b):b};StudyMetaInfo.prototype.defaultInputs=function(){for(var a=new List,b=0;b<this.inputs.length;b++)a.append(this.inputs[b].defval);return a};
StudyMetaInfo.prototype.state=function(){var a={},b;for(b in this)this.hasOwnProperty(b)&&(a[b]=this[b],"id"===b&&(a[b]+="-"+this.version));return a};StudyMetaInfo.findStudyMetaInfoByDescription=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).description.toLowerCase()===b.toLowerCase())return a.item(c);throw Error("unexpected study id:"+b);}throw Error("There is no studies metainfo");};
StudyMetaInfo.findStudyMetaInfo=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.item(c);throw Error("unexpected study id:"+b);}throw Error("There is no studies metainfo");};StudyMetaInfo.removeStudyMetaInfo=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.removeAt(c),defaults.remove("study_"+b),!0;return!1}throw Error("There is no studies metainfo");};
StudyMetaInfo.addStudyMetaInfo=function(a,b){var c=new StudyMetaInfo(b);assert(!1===StudyMetaInfo.removeStudyMetaInfo(a,c.id),"Study with id="+b.id+" already exists in the model");a.append(c);if(b.defaults){var d=TradingView.clone(b.defaults);d.precision="default";defaults.create("study_"+b.id,d)}return c};
StudyMetaInfo.addOrReplaceStudyMetaInfo=function(a,b){var c=new StudyMetaInfo(b);StudyMetaInfo.removeStudyMetaInfo(a,c.id);a.append(c);if(b.defaults){var d=TradingView.clone(b.defaults);d.precision="default";defaults.createOrReplace("study_"+b.id,d)}return c};StudyMetaInfo.sortStudiesMetainfo=function(a){a.sort(function(a,c){var d=defaults("study_"+a.id).description,e=defaults("study_"+c.id).description;return d<e?-1:d>e?1:0})};
StudyMetaInfo.setStudyHidden=function(a,b){if(!a)throw Error("There is no studies metainfo");for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.is_hidden_study=!0;return!1};StudyMetaInfo.createMetaInfoStub=function(a,b){a.scriptIdPart||TVScript.createScriptIdPart();return{isTVScriptStubToCompile:!0,id:TVScript.createScriptStudyId(a.scriptIdPart,b),scriptIdPart:a.scriptIdPart,description:a.scriptName,TVScriptSourceCode:a.scriptSource,version:b}};
StudyMetaInfo.replaceWithFullStudyMetaInfoAsync=function(a,b){var c=$.Deferred();if(b.isTVScriptStubToCompile){try{var d=StudyMetaInfo.findStudyMetaInfo(a,b.id);d.isTVScriptStubToCompile||c.resolve(d)}catch(e){}A57.translateScriptAsync(b.TVScriptSourceCode,null,b.scriptIdPart,b.version).done(function(b){b=StudyMetaInfo.addOrReplaceStudyMetaInfo(a,b);c.resolve(b)}).fail(function(d){d=A57.createScriptStub(b.TVScriptSourceCode,b.description,b.scriptIdPart);d=StudyMetaInfo.addOrReplaceStudyMetaInfo(a,
d);c.resolve(d)})}else c.resolve(b);return c.promise()};"undefined"!=typeof module&&module&&module.exports&&(module.exports=StudyMetaInfo);StudyMetaInfo.getOrderedInputIds=function(a){var b=[];a=a.inputs;for(var c=0;c<a.length;++c)b.push(a[c].id);return b};TradingView.drawingState=function(){function a(a){return"cursor"===a||"arrow"===a||"dot"===a}var b=null,c=null,d=null,e=new WatchedValue,g=new WatchedValue,h=!1;return{tool:e,cursorTool:g,toolIsCursor:a,resetToCursor:function(a){!a&&b&&b.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())},init:function(){h||(e.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),e.subscribe(function(b){a(b)&&g.setValue(b)},{callWithLast:!0}),g.subscribe(function(a){a&&TVSettings.setValue("chart.cursorPreference",
a)}),b=new $52("drawings"),c=new Property,d=new Property,hideMarksOnBars=new Property,c.setValue(!1),d.setValue(!1),hideMarksOnBars.setValue(!1),h=!0)},properties:function(){return b},hideAllDrawings:function(){return c},hideMarksOnBars:function(){return hideMarksOnBars},lockDrawings:function(){return d}}}();function HitTestResult(a,b,c){this._result=a;this._data=b;this._eraseMarker=c}HitTestResult.REGULAR=1;HitTestResult.MOVEPOINT=2;HitTestResult.CHANGEPOINT=3;HitTestResult.CUSTOM=4;HitTestResult.prototype.result=function(){return this._result};HitTestResult.prototype.data=function(){return this._data};HitTestResult.prototype.eraseMarker=function(){return this._eraseMarker};function DataSource(){this._zorder=0;this.m_priceScale=null;this._id=TradingView.guid();this._ownerSource=null;this._userEditEnabled=!0;this.hasAlert=new WatchedValue(!1)}DataSource.prototype.id=function(){return this._id};DataSource.prototype.uniqueId=function(){return this._id};DataSource.prototype.setId=function(a){this._id=a};DataSource.prototype.zorder=function(){return this._zorder};DataSource.prototype.setZorder=function(a){"number"==typeof a&&this._zorder!=a&&(this._zorder=a)};
DataSource.prototype.title=function(){throw Error("Implement this fun in a subclass");};DataSource.prototype.priceScale=function(){return this.m_priceScale};DataSource.prototype.setPriceScale=function(a){this.m_priceScale=a};DataSource.prototype.ownerSource=function(){return this._ownerSource};DataSource.prototype.setOwnerSource=function(a){(this._ownerSource=a)&&this.setPriceScale(a.priceScale())};DataSource.prototype.isSavedInChart=function(a){return!0};
DataSource.prototype.isSavedInStudyTemplates=function(){return!0};DataSource.prototype.isRemovedByStudyTemplates=function(){return!0};DataSource.prototype.hasContextMenu=function(){return!0};DataSource.prototype.showInObjectTree=function(){return!0};DataSource.prototype.setUserEditEnabled=function(a){this._userEditEnabled=a};DataSource.prototype.userEditEnabled=function(){return this._userEditEnabled};DataSource.prototype.isUserDeletable=function(){return this.userEditEnabled()};
DataSource.prototype.canHasAlert=function(){return!1};DataSource.prototype.properties=function(){throw Error("Implement this fun in a subclass");};DataSource.prototype.statusView=function(){return null};DataSource.prototype.dataWindowView=function(){return null};DataSource.prototype.priceAxisViews=function(a,b){return null};DataSource.prototype.updateAllViews=function(){};DataSource.prototype.paneViews=function(a){return null};
function PriceDataSource(a){DataSource.call(this);this._isOverlay=null;this.D0=a}inherit(PriceDataSource,DataSource);PriceDataSource.prototype.isNoScale=function(){return!!this._isOverlay};PriceDataSource.prototype.base=function(){return 0};PriceDataSource.prototype.formatter=function(){return null};PriceDataSource.prototype.model=function(){return this.D0};PriceDataSource.prototype.priceRange=function(a,b){return null};function Property(a){this._listeners=new Delegate;this._childs=[];if(void 0!==a&&null!==a)if(this.isPrimitiveType(a))this._value=a;else for(var b in a)this.addProperty(b,a[b])}Property.prototype.merge=function(a){if(null!=a)if(this.isPrimitiveType(a))this._value=a;else if(isArray(a))for(var b=0;b<a.length;b++)this[b]?this[b].merge(a[b]):this.addProperty(b,a[b]);else for(b in a)this[b]?this[b].merge(a[b]):this.addProperty(b,a[b])};
Property.prototype.state=function(a){var b=this._value;void 0===b&&(b={});for(var c=0;c<this._childs.length;c++){var d=this._childs[c];if(!a||-1===a.indexOf(d))if(a){for(var e=[],g=0;g<a.length;g++){var h=a[g];h.startsWith(d+".")&&e.push(h.substr(d.length+1))}b[d]=this[d].state(e)}else b[d]=this[d].state()}return b};Property.prototype.isPrimitiveType=function(a){return isNumber(a)||(new TypeValidator(String)).check(a)||isBoolean(a)?!0:!1};Property.prototype.value=function(){return this._value};
Property.prototype.listeners=function(){return this._listeners};Property.prototype.childCount=function(){return this._childs.length};Property.prototype.setValue=function(a,b){if(this._value!==a||b)this._value=a,this._listeners.fire(this)};Property.prototype.addProperty=function(a,b){var c=new Property(b);this[a]=c;this._childs.push(a);c.listeners().subscribe(this,Property.prototype.childChanged)};
Property.prototype.addChild=function(a,b){this[a]=b;-1==$.inArray(a,this._childs)&&this._childs.push(a);b.listeners().subscribe(this,Property.prototype.childChanged)};Property.prototype.childChanged=function(a,b){this.listeners().fire(this)};Property.prototype.subscribe=function(a,b){this.listeners().subscribe(a,b)};Property.prototype.unsubscribe=function(a,b){this.listeners().unsubscribe(a,b)};
function $52(a,b,c){this._defaultName=a;c?c=b:(c=TradingView.clone(defaults(a)),b&&TradingView.merge(c,b));Property.call(this,c);this._defaultName=a;this.listeners().subscribe(this,$52.prototype.onPropertyChanged);this._exclusions=[]}inherit($52,Property);$52._saveDefaults=!1;TradingView.saveDefaultProperties=function(a){$52._saveDefaults=a};$52.prototype.addExclusion=function(a){this._exclusions.push(a)};
$52.prototype.restoreFactoryDefaults=function(){var a={};this._defaultName.startsWith("study_")&&(a=TradingView.clone(factoryDefaults("study")));var b=TradingView.clone(factoryDefaults(this._defaultName));this._defaultName.startsWith("study_")&&b.inputs&&delete b.inputs.symbol;"linetoolicon"===this._defaultName&&(b.icon=defaults(this._defaultName).icon);~"linetooltext linetooltextabsolute linetoolnote linetoolnoteabsolute linetoolcallout linetoolballoon linetoolarrowmark linetoolarrowmarkleft linetoolarrowmarkup linetoolarrowmarkright linetoolarrowmarkdown linetoolhorzline linetoolhorzray".split(" ").indexOf(this._defaultName)&&
delete b.text;TradingView.merge(a,b);this.merge(a);this._defaultName.startsWith("study_")||saveDefaults(this._defaultName,this.state(this._exclusions));this.listeners().fire(this)};$52.prototype.cleanupFactoryDefaults=function(){saveDefaults(this._defaultName,{});this.listeners().fire(this)};$52.prototype.onPropertyChanged=function(){$52._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()};
$52.prototype.saveDefaults=function(){saveDefaults(this._defaultName,this.state(this._exclusions))};function factoryDefaults(a){"undefined"==typeof defaultProperties&&(defaultProperties={chartproperties:{timezone:"UTC",timeScale:{barSpacing:DEFAULT_BAR_SPACING,rightOffset:DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"#FFFECE",border:"#606090",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{color:"#E6E6E6",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#B7B7B7",style:CanvasEx.LINESTYLE_DASHED,
transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,showSymbolLabels:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,showSymbolLabels:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,showSymbolLabels:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,
showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",scaleSeriesOnly:!1,showSeriesLastValue:!0,showStudyLastValue:!1},mainSeriesProperties:{style:TradingView.Series.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"#E2745B",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,
visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,lockScale:!1,minTick:"default",extendedHours:!1,sessVis:!1,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},haStyle:{upColor:"#6ba583",
downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},barStyle:{upColor:"#6ba583",downColor:"#d75442",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"#3C78D8",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:TradingView.Series.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"#606090",color2:"#01F6F5",linecolor:"#0094FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,
priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"#6ba583",downColor:"#d75442",borderUpColor:"#225437",borderDownColor:"#5b1a13",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",borderUpColorProjection:"#225437",borderDownColorProjection:"#5b1a13",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},
atrLength:{name:"ATR Length"}}},pbStyle:{upColor:"#6ba583",downColor:"#d75442",borderUpColor:"#225437",borderDownColor:"#5b1a13",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",borderUpColorProjection:"#225437",borderDownColorProjection:"#5b1a13",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"#6ba583",downColor:"#d75442",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",inputs:{source:"close",reversalAmount:1},inputInfo:{source:{name:"Source"},
reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"#6ba583",downColor:"#d75442",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",inputs:{sources:"HL",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}}},symbolWatermarkProperties:{color:"#555",transparency:85},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,
extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"#d75442",highlightColor:"#ffff33",hoverColor:"#f5e387",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"#777",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"#AAA"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,crossHairColor:"#B7B7B7",
crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{extendLeft:"inherit",lineLength:"inherit",lineColor:"#F00",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"#F00",bodyBorderTransparency:0,bodyBackgroundColor:"#FFF",bodyBackgroundTransparency:25,bodyTextColor:"#F00",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"#F00",quantityBorderTransparency:0,quantityBackgroundColor:"#F00",
quantityBackgroundTransparency:25,quantityTextColor:"#FFF",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"#F00",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"#FFF",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"#F00",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{extendLeft:"inherit",lineLength:"inherit",lineColor:"#0071E0",lineTransparency:0,lineStyle:"inherit",
lineWidth:"inherit",bodyBorderColor:"#0071E0",bodyBorderTransparency:0,bodyBackgroundColor:"#FFF",bodyBackgroundTransparency:25,bodyTextColor:"#0071E0",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"#0071E0",quantityBorderTransparency:0,quantityBackgroundColor:"#0071E0",quantityBackgroundTransparency:25,quantityTextColor:"#FFF",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,
reverseButtonBorderColor:"#0071E0",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"#FFF",reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"#0071E0",reverseButtonIconTransparency:0,closeButtonBorderColor:"#0071E0",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"#FFF",closeButtonBackgroundTransparency:25,closeButtonIconColor:"#0071E0",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"#00F",arrowTransparency:0,
text:"",textColor:"#000",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{clonable:!0,color:"#3D85C6",snapTo45Degrees:!0,size:40,icon:9786,angle:.5*Math.PI,scale:1},linetooltrendline:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,
alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltrendangle:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"#129f5c",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#6AA84F",
transparency:50,extendLeft:!1,extendRight:!1,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_NORMAL,font:"Verdana",textcolor:"#129f5c",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"#4985e7",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#153899",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_NORMAL,
font:"Verdana",textcolor:"#4985e7",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"#FFFFFF",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",labelBackgroundTransparency:0,fillBackground:!0,backgroundColor:"#BADAFF",backgroundTransparency:60,drawBorder:!1,
borderColor:"#667B8B"},linetoolpricerange:{clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"#FFFFFF",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",labelBackgroundTransparency:0,fillBackground:!0,backgroundColor:"#BADAFF",backgroundTransparency:60,drawBorder:!1,borderColor:"#667B8B"},linetoolriskrewardshort:{isShort:!0,clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"white",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",
labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"#FF0000",profitBackground:"#00A000",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667B8B"},linetoolriskrewardlong:{isShort:!1,clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"white",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"#FF0000",profitBackground:"#00A000",stopBackgroundTransparency:80,
profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667B8B"},linetoolarrow:{clonable:!0,linecolor:"#6F88C6",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_ARROW,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolray:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
extendLeft:!1,extendRight:!0,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolextended:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:W47.LINEEND_NORMAL,rightEnd:W47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",
fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolhorzline:{clonable:!0,linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,
text:"",font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,
baselinecolor:"#808080",linecolor:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level3:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:2},level4:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3},level5:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:5},level6:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:8},level7:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:13},level8:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:21},level9:{visible:!0,color:"#0055DB",
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:34},level10:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:55},level11:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:89}},linetooltext:{clonable:!0,color:"#667B8B",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"#9BBED5",backgroundTransparency:70,drawBorder:!1,borderColor:"#667B8B",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},
linetooltextabsolute:{clonable:!0,color:"#667B8B",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"#9BBED5",backgroundTransparency:70,drawBorder:!1,borderColor:"#667B8B",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"#667b8b",backgroundColor:"#fffece",borderColor:"#8c8c8c",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30,text:$.t("Comment")},linetoolbrush:{clonable:!0,linecolor:"#353535",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,
smooth:5,fillBackground:!1,backgroundColor:"#153899",transparency:50},linetoolpolyline:{clonable:!0,linecolor:"#353535",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#153899",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,
color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"#ff0000"},linetoolnote:{clonable:!0,markerColor:"#2E66FF",textColor:"#000000",backgroundColor:"#FFFFFF",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{clonable:!0,markerColor:"#2E66FF",textColor:"#000000",backgroundColor:"#FFFFFF",backgroundTransparency:0,
text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"#008000"},linetoolthumbdown:{clonable:!0,color:"#FF0000"},linetoolpricelabel:{clonable:!0,color:"#667b8b",backgroundColor:"#ffffff",borderColor:"#8c8c8c",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"#153899",fillBackground:!0,backgroundColor:"#153899",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolrotatedrectangle:{clonable:!0,
color:"#9800ff",fillBackground:!0,backgroundColor:"#8e7cc3",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"#999915",fillBackground:!0,backgroundColor:"#999915",transparency:50,linewidth:1},linetoolarc:{clonable:!0,color:"#999915",fillBackground:!0,backgroundColor:"#999915",transparency:50,linewidth:1},linetoolprediction:{linecolor:"#1c73db",linewidth:2,sourceBackColor:"#f1f1f1",sourceTextColor:"#6e6e6e",sourceStrokeColor:"#6e6e6e",targetStrokeColor:"#2fa8ff",targetBackColor:"#0b6fde",
targetTextColor:"#ffffff",successBackground:"#36a02a",successTextColor:"#ffffff",failureBackground:"#e74545",failureTextColor:"#ffffff",intermediateBackColor:"#ead289",intermediateTextColor:"#6d4d22",transparency:10,centersColor:"#202020"},linetooltriangle:{clonable:!0,color:"#991515",fillBackground:!0,backgroundColor:"#991515",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"#FFFFFF",backgroundColor:"#991515",transparency:50,linewidth:2,fontsize:12,font:"Verdana",text:$.t("Text"),
bordercolor:"#991515",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"#773499",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"#b4a7d6",transparency:50,showMidline:!1,midlinecolor:"#773499",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottsubminuette:{clonable:!0,showWave:!0,color:"#3d85c6",wavesize:0,showBackground:!0},linetoolelliottminor:{clonable:!0,showWave:!0,
color:"#ff9800",wavesize:3,showBackground:!0},linetoolelliottcircle:{clonable:!0,showWave:!0,color:"#6aa84f",wavesize:6,showBackground:!0},linetoolelliottminorretr:{clonable:!0,showWave:!0,color:"#a64d79",wavesize:0,showBackground:!0},linetoolelliottmajorretr:{clonable:!0,showWave:!0,color:"#bf9000",wavesize:1,showBackground:!0},linetoolbarspattern:{color:"#5091CC",clonable:!0,mode:TradingView.LineToolBarsPattern.BARS_MODE,mirrored:!1,flipped:!1},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},
graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_ORIGINAL,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:{visible:!0,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:8},level2:{visible:!0,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:4},level3:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:3},level4:{visible:!0,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff1:1,coeff2:2},level5:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:1},level6:{visible:!0,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:2,coeff2:1},level7:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:3,coeff2:1},level8:{visible:!0,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:4,coeff2:1},level9:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff1:8,coeff2:1}},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:50},levels:[{width:1,color:"#808080",visible:!0},{width:1,color:"#A06B00",visible:!0},{width:1,color:"#699E00",visible:!0},{width:1,color:"#009B00",visible:!0},{width:1,color:"#009965",visible:!0},{width:1,color:"#808080",visible:!0}],fanlines:[{width:1,color:"#A500FF",visible:!1,x:8,y:1},{width:1,color:"#A50000",visible:!1,x:5,y:1},{width:1,color:"#808080",visible:!1,x:4,y:1},{width:1,
color:"#A06B00",visible:!1,x:3,y:1},{width:1,color:"#699E00",visible:!0,x:2,y:1},{width:1,color:"#009B00",visible:!0,x:1,y:1},{width:1,color:"#009965",visible:!0,x:1,y:2},{width:1,color:"#009965",visible:!1,x:1,y:3},{width:1,color:"#000099",visible:!1,x:1,y:4},{width:1,color:"#660099",visible:!1,x:1,y:5},{width:1,color:"#A500FF",visible:!1,x:1,y:8}],arcs:[{width:1,color:"#A06B00",visible:!0,x:1,y:0},{width:1,color:"#A06B00",visible:!0,x:1,y:1},{width:1,color:"#A06B00",visible:!0,x:1.5,y:0},{width:1,
color:"#699E00",visible:!0,x:2,y:0},{width:1,color:"#699E00",visible:!0,x:2,y:1},{width:1,color:"#009B00",visible:!0,x:3,y:0},{width:1,color:"#009B00",visible:!0,x:3,y:1},{width:1,color:"#009965",visible:!0,x:4,y:0},{width:1,color:"#009965",visible:!0,x:4,y:1},{width:1,color:"#000099",visible:!0,x:5,y:0},{width:1,color:"#000099",visible:!0,x:5,y:1}]},linetoolgannsquare:{clonable:!0,color:"#153899",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,
showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,hlevel1:{color:"#808080",coeff:0,visible:!0},hlevel2:{color:"#A06B00",coeff:.25,visible:!0},hlevel3:{color:"#699E00",coeff:.382,visible:!0},hlevel4:{color:"#009B00",coeff:.5,visible:!0},hlevel5:{color:"#009965",coeff:.618,visible:!0},hlevel6:{color:"#006599",coeff:.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:.25,
visible:!0},vlevel3:{color:"#699E00",coeff:.382,visible:!0},vlevel4:{color:"#009B00",coeff:.5,visible:!0},vlevel5:{color:"#009965",coeff:.618,visible:!0},vlevel6:{color:"#006599",coeff:.75,visible:!0},vlevel7:{color:"#808080",coeff:1,visible:!0}},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,
showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:{color:"#808080",coeff:0,visible:!0},hlevel2:{color:"#A06B00",coeff:.25,visible:!0},hlevel3:{color:"#699E00",coeff:.382,visible:!0},hlevel4:{color:"#009B00",coeff:.5,visible:!0},hlevel5:{color:"#009965",coeff:.618,visible:!0},hlevel6:{color:"#006599",coeff:.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:.25,visible:!0},vlevel3:{color:"#699E00",coeff:.382,
visible:!0},vlevel4:{color:"#009B00",coeff:.5,visible:!0},vlevel5:{color:"#009965",coeff:.618,visible:!0},vlevel6:{color:"#006599",coeff:.75,visible:!0},vlevel7:{color:"#808080",coeff:1,visible:!0}},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,
color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},linetoolfibchannel:{clonable:!0,
showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,level1:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level4:{visible:!0,color:"#28CC28",linewidth:1,
linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"#008000",color2:"#FF0000",linewidth:1,trendline:{visible:!0,color:"#808080",linestyle:CanvasEx.LINESTYLE_SOLID},level1:{color:"#808080",visible:!0,linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:1}},linetool5pointspattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"#9528FF",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#9528CC",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"#009B00",textcolor:"#FFFFFF",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},
linetoolthreedrivers:{clonable:!0,color:"#9528FF",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#9528CC",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"#45682F",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#45A82F",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"#808080",
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.764},level6:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level7:{visible:!1,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!1,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level9:{visible:!1,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!1,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!1,
color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.618}},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,
color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level6:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level7:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:2.618},level9:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.618}},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,
color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level6:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:1},level7:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level9:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.618}},linetooltrendbasedfibextension:{clonable:!0,
showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.382},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,
color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!1,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:1.382},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.382},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3}},linetoolschiffpitchfork:{clonable:!0,
fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_SCHIFF,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolschiffpitchfork2:{clonable:!0,
fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_SCHIFF2,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolinsidepitchfork:{clonable:!0,
fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_INSIDE,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetool:{frozen:!1,visible:!0}},
applyDefaultsOverrides(defaultProperties.chartproperties));"undefined"==typeof defaultProperties["study_MA@tv-basicstudies"]&&(defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"MA"}}});"undefined"==typeof defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]=
{description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});"undefined"==typeof defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"#00ff00",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});
"undefined"==typeof defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&(defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});"undefined"==typeof defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"#538F1F",
backColor:"#F0FFCC",textColor:"#000000"});"undefined"==typeof defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:!0,"S1/R1":!0,"S2/R2":!0,"S3/R3":!0,"S4/R4":!0,"S5/R5":!0},colors:{P:"#D47928","S1/R1":"#D47928","S2/R2":"#D47928","S3/R3":"#D47928","S4/R4":"#D47928","S5/R5":"#D47928"},widths:{P:1,"S1/R1":1,"S2/R2":1,"S3/R3":1,"S4/R4":1,
"S5/R5":1}}});"undefined"==typeof defaultProperties["study_ZigZag@tv-basicstudies"]&&(defaultProperties["study_ZigZag@tv-basicstudies"]={color:"#56871D",linewidth:2});"undefined"==typeof defaultProperties["study_ElliottWave@tv-basicstudies"]&&(defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:{visible:!1,color:"#ff0000"},level1:{visible:!1,color:"#008000"},level2:{visible:!1,color:"#0000ff"},level3:{visible:!1,color:"#ff00ff"},level4:{visible:!0,color:"#0080ff"},level5:{visible:!0,
color:"#ff0000"},level6:{visible:!0,color:"#008000"},level7:{visible:!0,color:"#0000ff"},level8:{visible:!0,color:"#ff00ff"}});"undefined"==typeof defaultProperties["study_LinearRegression@tv-basicstudies"]&&(defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,
linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"#991515",transparency:70}});"undefined"==typeof defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"#0000FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"#0000FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"#FF0000",linestyle:CanvasEx.LINESTYLE_SOLID,
linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}});"undefined"==typeof defaultProperties["study_Compare@tv-basicstudies"]&&(defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"});"undefined"==typeof defaultProperties["study_Overlay@tv-basicstudies"]&&(defaultProperties["study_Overlay@tv-basicstudies"]={style:TradingView.Series.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",
borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},barStyle:{upColor:"#6ba583",downColor:"#d75442",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"#0303F7",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:TradingView.Series.STYLE_LINE_TYPE_SIMPLE},
areaStyle:{color1:"#606090",color2:"#01F6F5",linecolor:"#0094FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},styles:{open:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"open"},high:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"high"},low:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,
linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"low"},close:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"close"}}});a=a.split(".");for(var b=defaultProperties,c=0;c<a.length;c++)b&&(b=b[a[c]]);return b?TradingView.clone(b):{}}
function applyDefaultsOverrides(a,b,c){function d(a,c,e){var g=c.split(".");c=g[0];b&&b[c]&&(c=b[c]);if(!a.hasOwnProperty(c))throw"illegal path";1<g.length?(g=g.splice(1).join("."),d(a[c],g,e)):a[c]&&a[c].serValue?a[c].setValue(e):a[c]=e}if("undefined"!=typeof __defaultsOverrides&&__defaultsOverrides)for(var e in __defaultsOverrides)try{d(a,e,__defaultsOverrides[e])}catch(g){"undefined"!=typeof c&&c||console.warn("Path `"+e+"` does not exist.")}}
function defaults(a,b){return b?_defaultsUpdated(a,b):_defaultsAsIs(a)}function _defaultsAsIs(a){var b=factoryDefaults(a);window._UNIT_TESTS||(a=TradingView.clone(TVSettings.getJSON(a,null)),TradingView.merge(b,a));return b}function _defaultsUpdated(a,b){var c=factoryDefaults(a);if(!window._UNIT_TESTS){var d=TradingView.clone(TVSettings.getJSON(a,null));a.startsWith("study_")&&d&&A0.isVersionHead(d.version)&&(d=b.updateStudyState(d,d));TradingView.merge(c,d)}return c}
function saveDefaults(a,b){TVSettings.setJSON(a,b)}defaults.create=function(a,b){if(b){var c=StudyMetaInfo.parseIdString(a),d=factoryDefaults(c.id);defaultProperties[c.id]=$.extend(b,d)}};defaults.createOrReplace=function(a,b){if(b){var c=StudyMetaInfo.parseIdString(a);defaultProperties[c.id]=b}};defaults.remove=function(a){defaultProperties[a]=void 0};function PriceFormatter(a,b,c,d){b||(b=1);isInteger(a)||(a=100);if(0>a)throw new TypeError("invalid base");this._priceScale=a;this._minMove=b;this._minMove2=d;0<d&&2!==d&&4!==d?TradingView.logDebug("invalid minmove2"):(this._fractional=c,this.calculateDecimal())}PriceFormatter.prototype.isFractional=function(){return this._fractional};PriceFormatter.prototype.decimalSign=".";PriceFormatter.prototype.decimalSignFractional="'";PriceFormatter.prototype.southandDelimeter="`";
PriceFormatter.prototype.fullPrecision=!1;PriceFormatter.prototype.calculateDecimal=function(){this._fractionalLength=0;if(0<this._priceScale&&0<this._minMove){var a=this._priceScale;for(this._minMove2&&(a/=this._minMove2);1<a;)a/=10,this._fractionalLength++}};
function numberToStringWithLeadingZero(a,b){if(!isNumber(a))return"n/a";if(!isInteger(b))throw new TypeError("invalid length");if(0>b||16<b)throw new TypeError("invalid length");return 0===b?a.toString():("0000000000000000"+a.toString()).right(b)}PriceFormatter.prototype.format=function(a,b){var c="";0>a?(c=!0===b?"\u2212":"-",a=-a):a&&!0===b&&(c="+");return this._fractional?c+this.formatAsFractional(a):c+this.formatAsDecimal(a)};
PriceFormatter.prototype.formatAsDecimal=function(a){var b;b=this._fractional?Math.pow(10,this._fractionalLength||0):this._priceScale/this._minMove;var c=Math.floor(a);a=+(Math.round(a*b)-c*b).toFixed(this._fractionalLength);a>=b&&(a-=b,c+=1);b=1===b?"":this.decimalSign+numberToStringWithLeadingZero(a.toFixed(this._fractionalLength)*this._minMove,this._fractionalLength);return c.toString()+b};
PriceFormatter.prototype.formatAsFractional=function(a){var b=this._priceScale/this._minMove,c=Math.floor(a);a=Math.round(a*b)-c*b;a===b&&(a=0,c+=1);if(this._minMove2){var b=["0","5"],d=["0","2","5","7"],e=a%this._minMove2;a=(a-e)/this._minMove2;a=numberToStringWithLeadingZero(a,this._fractionalLength)+this.decimalSignFractional+(2===this._minMove2?b[e]:d[e])}else a=numberToStringWithLeadingZero(a*this._minMove,this._fractionalLength);return c.toString()+this.decimalSignFractional+a};
function PercentageFormatter(){PriceFormatter.call(this,100)}inherit(PercentageFormatter,PriceFormatter);PercentageFormatter.prototype.format=function(a,b){return PriceFormatter.prototype.format.call(this,a,b)+"%"};function DateFormatter(){}DateFormatter.prototype.format=function(a){return numberToStringWithLeadingZero(a.getUTCFullYear(),4)+"-"+numberToStringWithLeadingZero(a.getUTCMonth()+1,2)+"-"+numberToStringWithLeadingZero(a.getUTCDate(),2)};
function TimeFormatter(a){this._format_str=a||"%h:%m:%s"}TimeFormatter.prototype.format=function(a){return this._format_str.replace("%h",numberToStringWithLeadingZero(a.getUTCHours(),2)).replace("%m",numberToStringWithLeadingZero(a.getUTCMinutes(),2)).replace("%s",numberToStringWithLeadingZero(a.getUTCSeconds(),2))};function DateTimeFormatter(a){this._dwm=a}DateTimeFormatter.prototype.format=function(a){var b=(new DateFormatter).format(a);this._dwm||(b+=" "+(new TimeFormatter).format(a));return b};
function VolumeFormatter(a){this._precision=a;this._fractionalValues=0<a}
VolumeFormatter.prototype.format=function(a){function b(a){return c._fractionalValues?(a.toFixed(c._precision)+"").replace(/\.?0+$/,""):a}if(!isNumber(a))return"---";var c=this,d="";0>a&&(d="-",a=-a);if(1E100<=a)return"N/A";if(!this._fractionalValues||995<=a)a=Math.round(a);if(995>a)return d+b(a);if(999995>a)return d+b(a/1E3)+"K";if(999999995>a)return a=1E3*Math.round(a/1E3),d+b(a/1E6)+"M";a=1E6*Math.round(a/1E6);return d+b(a/1E9)+"B"};function TimeSpanFormatter(){}
TimeSpanFormatter.prototype.format=function(a){var b=0>a;a=Math.abs(a);var c=Math.floor(a/86400);a-=86400*c;var d=Math.floor(a/3600);a-=3600*d;var e=Math.floor(a/60);a-=60*e;var g="";c&&(g+=c+" "+$.t("d",{context:"dates"})+" ");d&&(g+=d+" "+$.t("h",{context:"dates"})+" ");e&&(g+=e+" "+$.t("m",{context:"dates"})+" ");a&&(g+=a+" "+$.t("s",{context:"dates"})+" ");b&&(g="-"+g);return g.trimmed()};function PriceColorer(){this._prev=null}
PriceColorer.formatSign=function(a){return 0==a?"#5A5D66":0<a?"#27AC66":"#DA563E"};PriceColorer.formatDiff=function(a,b){PriceColorer.signFormat(b-a)};PriceColorer.prototype.format=function(a){try{return null===this._prev?PriceColorer.formatSign(a):PriceColorer.formatDiff(this._prev,a)}finally{this._prev=a}};function FormattedLabelsCache(a,b){this._formatter=a;this._maxSize=b||50;this._actualSize=0;this._cache={};this._oldestTick=this._usageTick=1;this._tick2Labels={}}
FormattedLabelsCache.prototype.format=function(a){if(this._cache[a])return this._cache[a].string;if(this._actualSize==this._maxSize){var b=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick];delete this._cache[b];this._oldestTick++;this._actualSize--}b=this._formatter(a);this._cache[a]={string:b,tick:this._usageTick};this._tick2Labels[this._usageTick]=a;this._actualSize++;this._usageTick++;return b};function AbstractBarColorer(){this.backColorers=[]}AbstractBarColorer.prototype.barStyle=function(a,b,c){for(var d={},e=this.backColorers.length-1;0<=e;e--)this.backColorers[e].applyBarStyle(a,b,d,c);this.applyBarStyle(a,b,d,c);return d};AbstractBarColorer.prototype.pushBackBarColorer=function(a){this.backColorers.push(a)};AbstractBarColorer.prototype.applyBarStyle=function(a,b,c){throw Error("This function is supposed to be reimplemented in a subclass");};
function SeriesBarColorer(a){AbstractBarColorer.call(this);this._series=a}inherit(SeriesBarColorer,AbstractBarColorer);
SeriesBarColorer.prototype.applyBarStyle=function(a,b,c,d){c||(c={});c.barColor=null;c.barBorderColor=null;c.isBarHollow=null;c.isBarUp=null;c.upColor=null;c.downColor=null;c.isTwoColorBar=null;var e=this._series.properties();switch(e.style.value()){case TradingView.Series.STYLE_LINE:c.barColor=e.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:c.barColor=e.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:var g=e.barStyle.upColor.value(),h=e.barStyle.downColor.value(),
k=g,l=h,m=this.findBar(a,!1,d);e.barStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,!1,d),c.barColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?k:l):(c.barColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?k:l);break;case TradingView.Series.STYLE_CANDLES:g=e.candleStyle.upColor.value();h=e.candleStyle.downColor.value();k=e.candleStyle.borderUpColor?e.candleStyle.borderUpColor.value():e.candleStyle.borderColor.value();l=e.candleStyle.borderDownColor?
e.candleStyle.borderDownColor.value():e.candleStyle.borderColor.value();m=this.findBar(a,!1,d);e.candleStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,!1,d),c.barColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?k:l):(c.barColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?k:l);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:g=e.hollowCandleStyle.upColor.value();h=e.hollowCandleStyle.downColor.value();k=e.hollowCandleStyle.borderUpColor?
e.hollowCandleStyle.borderUpColor.value():e.hollowCandleStyle.borderColor.value();l=e.hollowCandleStyle.borderDownColor?e.hollowCandleStyle.borderDownColor.value():e.hollowCandleStyle.borderColor.value();m=this.findBar(a,!1,d);b=this.findPrevBar(a,!1,d);b[CLOSE_PLOT]<=m[CLOSE_PLOT]?(c.barColor=g,c.barBorderColor=k):(c.barColor=h,c.barBorderColor=l);c.isBarHollow=m[OPEN_PLOT]<=m[CLOSE_PLOT]?!0:!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:g=e.haStyle.upColor.value();h=e.haStyle.downColor.value();
k=e.haStyle.borderUpColor.value();l=e.haStyle.borderDownColor.value();m=this.findBar(a,b,d);e.haStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,b,d),c.barColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=b[CLOSE_PLOT]<=m[CLOSE_PLOT]?k:l):(c.barColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?g:h,c.barBorderColor=m[OPEN_PLOT]<=m[CLOSE_PLOT]?k:l);break;case TradingView.Series.STYLE_RENKO:m=this.findBar(a,b,d);m=m[OPEN_PLOT]<=m[CLOSE_PLOT];g=b?e.renkoStyle.upColorProjection.value():e.renkoStyle.upColor.value();
h=b?e.renkoStyle.downColorProjection.value():e.renkoStyle.downColor.value();k=b?e.renkoStyle.borderUpColorProjection.value():e.renkoStyle.borderUpColor.value();l=b?e.renkoStyle.borderDownColorProjection.value():e.renkoStyle.borderDownColor.value();c.barColor=m?g:h;c.barBorderColor=m?k:l;c.isBarUp=m;break;case TradingView.Series.STYLE_PB:m=this.findBar(a,b,d);m=m[OPEN_PLOT]<=m[CLOSE_PLOT];g=b?e.pbStyle.upColorProjection.value():e.pbStyle.upColor.value();h=b?e.pbStyle.downColorProjection.value():e.pbStyle.downColor.value();
k=b?e.pbStyle.borderUpColorProjection.value():e.pbStyle.borderUpColor.value();l=b?e.pbStyle.borderDownColorProjection.value():e.pbStyle.borderDownColor.value();c.barColor=m?g:h;c.barBorderColor=m?k:l;c.isBarUp=m;break;case TradingView.Series.STYLE_KAGI:c.upColor=b?e.kagiStyle.upColorProjection.value():e.kagiStyle.upColor.value();c.downColor=b?e.kagiStyle.downColorProjection.value():e.kagiStyle.downColor.value();g=null;m=this.findBar(a,b,d);m[LOW_PLOT]<m[ADT_PLOT]&&m[ADT_PLOT]<m[HIGH_PLOT]?(g=m[OPEN_PLOT]<=
m[CLOSE_PLOT],c.isTwoColorBar=!0):(g=m[OPEN_PLOT]<=m[CLOSE_PLOT]?m[OPEN_PLOT]==m[ADT_PLOT]?!0:!1:m[OPEN_PLOT]==m[ADT_PLOT]?!1:!0,c.isTwoColorBar=!1);c.barColor=g?c.upColor:c.downColor;c.isBarUp=m[OPEN_PLOT]<=m[CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:m=this.findBar(a,b,d),m=0<m[ADT_PLOT],g=b?e.pnfStyle.upColorProjection.value():e.pnfStyle.upColor.value(),h=b?e.pnfStyle.downColorProjection.value():e.pnfStyle.downColor.value(),c.isBarUp=m,c.barColor=m?g:h}return c};
SeriesBarColorer.prototype.getSeriesBars=function(a){return a?this._series.nsBars():this._series.bars()};SeriesBarColorer.prototype._findBarFieldValue=function(a,b,c){a=this.getSeriesBars(c).valueAt(a);if(void 0!==a)return a[b]};SeriesBarColorer.prototype.findBar=function(a,b,c){return c?c.value:this.getSeriesBars(b).valueAt(a)||[]};
SeriesBarColorer.prototype.findPrevBar=function(a,b,c){if(c)return c.previousValue||[];a=this._series.bars()._search(a,SEARCH_EXACT);return 0<a?this._series.bars()._valueAt(a-1):[]};function StudyBarColorer(a,b){AbstractBarColorer.call(this);this.D1=a;this._plotIndex=b}inherit(StudyBarColorer,AbstractBarColorer);
StudyBarColorer.prototype.applyBarStyle=function(a,b,c){c||(c={});if(b)return c;b=this.D1.properties();if(!b.visible.value())return c;var d=this.D1.metaInfo(),e=this.D1.data();if(!e||0==e.size())return c;var g=this.D1.offset(d.plots[this._plotIndex].id);a=e.valueAt(a-g);if(!a)return c;a=a[this._plotIndex+1];if(null==a)return c;a=Math.round(a);e=d.plots[this._plotIndex].palette;b=b.palettes[e].colors[d.palettes[e].valToIndex?d.palettes[e].valToIndex[a]:a].color.value();c.barColor=b;
c.upColor=b.color;c.downColor=b.color;return c};function BarItem(){this.close=this.low=this.high=this.open=this.time=0}BarItem.prototype.setTime=function(a){isNumber(a)?this.time=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect time")};BarItem.prototype.setOpen=function(a){isNumber(a)?this.open=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect open")};BarItem.prototype.setHigh=function(a){isNumber(a)?this.high=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect high")};
BarItem.prototype.setLow=function(a){isNumber(a)?this.low=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect low")};BarItem.prototype.setClose=function(a){isNumber(a)?this.close=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect close")};BarItem.prototype.setAdditionalPrice=function(a){isNumber(a)?this.additionalPrice=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect additionalPrice")};BarItem.prototype.setAdditionalNum=function(a){isNumber(a)?this.additionalNum=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect additionalNum")};function BarsRange(a,b){null===a||isInteger(a)?null===b||isInteger(b)?(this.m_firstBar=a,this.m_lastBar=b):TradingView.logDebug("BarsRange: incorrect lastBar"):TradingView.logDebug("BarsRange: incorrect firstBar")}BarsRange.prototype.isEmpty=function(){return null===this.m_firstBar||null===this.m_lastBar};BarsRange.prototype.clone=function(){return new BarsRange(this.m_firstBar,this.m_lastBar)};BarsRange.prototype.firstBar=function(){return this.m_firstBar};BarsRange.prototype.lastBar=function(){return this.m_lastBar};
BarsRange.prototype.count=function(){return this.m_lastBar-this.m_firstBar+1};BarsRange.prototype.resizeRight=function(a){!isInteger(a)||0>a?TradingView.logDebug("BarsRange: incorrect newWidth"):this.m_firstBar=this.m_lastBar-a+1};BarsRange.prototype.shift=function(a){isNumber(a)?(this.m_firstBar=Math.round(this.m_firstBar+a),this.m_lastBar=Math.round(this.m_lastBar+a)):TradingView.logDebug("BarsRange.shift: incorrect coeff")};
BarsRange.prototype.contains=function(a){return this.m_firstBar<=a&&this.m_lastBar>=a};A47=function(a,b,c){this._magnetProperty=a;this._timeScale=b};
A47.prototype.align=function(a,b,c){var d=c.defaultPriceScale(),e=d.priceToCoordinate(a);if(!this._magnetProperty.value())return a;d=d.D19();c=null;for(var g=0;g<d.size();g++)if(d.item(g)instanceof TradingView.Series){c=d.item(g);break}if(c&&(d=c.bars(),d.contains(b)&&(b=d.valueAt(b),b=[b[OPEN_PLOT],b[HIGH_PLOT],b[LOW_PLOT],b[CLOSE_PLOT]],d=c.priceScale(),!d.isEmpty()))){var h=[];if(d.isPercent())for(c=c.firstValue(),g=0;g<b.length;g++)b[g]=d.priceRange().convertToPercent(b[g],
c);for(g=0;g<b.length;g++)h.push({y:d.priceToCoordinate(b[g]),price:b[g]});h.sort(function(a,b){var c=Math.abs(a.y-e),d=Math.abs(b.y-e);return c-d});c=h[0];50>Math.abs(c.y-e)&&(a=c.price)}return a};A77=function(){function a(){if(c){var a=c;c=null;a.isEmpty()||b(a)}}function b(a){c?c.addCommand(a):(e.clear(),d.push(a))}var c=null,d=new UndoStack,e=new UndoStack;return{beginUndoMacro:function(b){c&&a();c=new UndoMacroCommand(b)},endUndoMacro:a,undo:function(){if(d.isEmpty())return!1;var a=d.pop();a.undo();e.push(a);return!0},redo:function(){if(e.isEmpty())return!1;var a=e.pop();a.redo();d.push(a);return!0},pushUndoCommand:b,createUndoCheckpoint:function(){return{lastActualCommand:d.isEmpty()?
null:d.head()}},undoToCheckpoint:function(a){for(;!d.isEmpty()&&a.lastActualCommand!==d.head();)d.pop().undo();e.clear()},undoStack:function(){return d},redoStack:function(){return e},clearStack:function(){d.clear();e.clear()}}}();A77.setChartLayout=function(a,b){if(a.layout.value()===b)return!1;var c=new SetChartLayoutCommand(a,b);c.redo();this.pushUndoCommand(c)};
function SetChartLayoutCommand(a,b){UndoCommand.call(this,"Change Chart Layout to "+A8.LayoutTemplates[b].title);this.D5=a;this._newLayoutId=b;this._oldLayoutId=a.layout.value()}inherit(SetChartLayoutCommand,UndoCommand);SetChartLayoutCommand.prototype.redo=function(){this.D5.layout.setValue(this._newLayoutId)};SetChartLayoutCommand.prototype.undo=function(){this.D5.layout.setValue(this._oldLayoutId)};
function W78(a,b,c,d,e,g,h,k){this.D4=k;this.m_model=new W79(a,b,c,d,e,g,h,this);this.m_undoStack=new UndoStack;this.m_redoStack=new UndoStack;this.m_zoomStack=new UndoStack;this._onSimpleZoomIn=new Delegate;this._onSimpleZoomOut=new Delegate}inherit(W78,EventEmitter);W78.prototype.version=function(){return this.m_model._version};
W78.prototype.onData=function(a){switch(a.method){case "timescale_update":a=a.params,this.m_model.updateTimeScale(a.index,a.zoffset,a.changes,a.marks,a.clear)}};W78.prototype.paneForSource=function(a){return this.m_model.paneForSource(a)};W78.prototype.createPane=function(a){return this.m_model.createPane(a)};W78.prototype.dumpViews=function(){return this.m_model.dumpViews()};W78.prototype.readOnly=function(){return this.m_model.readOnly()};
W78.prototype.restart=function(){this.m_model.restart()};W78.prototype.disconnect=function(){this.m_model.disconnect()};W78.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()};W78.prototype.studyVersioning=function(){return this.m_model.studyVersioning()};W78.prototype.chartModel=function(){return this.m_model};W78.prototype.undoStack=A77.undoStack;W78.prototype.redoStack=A77.redoStack;
W78.prototype.undo=A77.undo;W78.prototype.redo=A77.redo;W78.prototype.pushUndoCommand=A77.pushUndoCommand;W78.prototype.startScalePrice=function(a,b,c){this.pushUndoCommand(new W89(this.m_model,a,b,b.state()));this.chartModel().startScalePrice(a,b,c)};W78.prototype.scalePriceTo=function(a,b,c){this.chartModel().scalePriceTo(a,b,c)};
W78.prototype.endScalePrice=function(a,b){this.chartModel().endScalePrice(a,b)};W78.prototype.startScrollPrice=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollState=b.state(),this._initialPriceScrollPos=c,this.chartModel().startScrollPrice(a,b,c))};
W78.prototype.scrollPriceTo=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollPos&&20<Math.abs(this._initialPriceScrollPos-c)&&(this.pushUndoCommand(new W89(this.m_model,a,b,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(a,b,c))};
W78.prototype.endScrollPrice=function(a,b){b.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(a,b))};W78.prototype.setPriceAutoScale=function(a,b,c){this.pushUndoCommand(new W89(this.m_model,a,b,b.state()));this.chartModel().setPriceAutoScale(a,b,c)};
W78.prototype.resetPriceScale=function(a,b){this.pushUndoCommand(new W89(this.m_model,a,b,b.state()));this.chartModel().resetPriceScale(a,b)};W78.prototype.startScaleTime=function(a){this.pushUndoCommand(new W94(this.m_model,this.m_model.timeScale().state(),"scale time"));this.chartModel().startScaleTime(a)};W78.prototype.scaleTimeTo=function(a){this.chartModel().scaleTimeTo(a)};W78.prototype.endScaleTime=function(){this.chartModel().endScaleTime()};
W78.prototype.startScrollTime=function(a){this._initialTimeScrollState=this.m_model.timeScale().state();this._initialTimeScrollPos=a;this.chartModel().startScrollTime(a)};W78.prototype.scrollTimeTo=function(a){this._initialTimeScrollPos&&20<Math.abs(a-this._initialTimeScrollPos)&&(this.pushUndoCommand(new W94(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState);this.chartModel().scrollTimeTo(a)};
W78.prototype.endScrollTime=function(){this.chartModel().endScrollTime();delete this._initialTimeScrollPos;delete this._initialTimeScrollState};W78.prototype.resetTimeScale=function(){this.pushUndoCommand(new W94(this.m_model,this.m_model.timeScale().state()));this.chartModel().resetTimeScale()};W78.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()};W78.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()};
W78.prototype.setWidth=function(a){this.m_model.setWidth(a)};W78.prototype.setPaneHeight=function(a,b){this.m_model.setPaneHeight(a,b)};W78.prototype.gridSource=function(){return this.m_model.gridSource()};W78.prototype.watermarkSource=function(){return this.m_model.watermarkSource()};W78.prototype.addAlertsSource=function(a){return this.m_model.addAlertsSource(a)};W78.prototype.alertsSources=function(){return this.m_model.alertsSources()};
W78.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()};W78.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()};W78.prototype.crossHairSource=function(){return this.m_model.crossHairSource()};W78.prototype.model=function(){return this.m_model};W78.prototype.mainSeries=function(){return this.m_model.m_mainSeries};W78.prototype.panes=function(){return this.m_model.m_panes};
W78.prototype.timeScale=function(){return this.m_model.timeScale()};W78.prototype.setSelectedSource=function(a,b){this.m_model.setSelectedSource(a,b)};W78.prototype.setHoveredSource=function(a,b){this.m_model.setHoveredSource(a,b)};W78.prototype.selectedSource=function(){return this.m_model.selectedSource()};W78.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()};W78.prototype.hoveredSource=function(){return this.m_model.hoveredSource()};
W78.prototype.D20=function(a){this.m_model.D20(a)};W78.prototype.setCurrentPosition=function(a,b,c,d){this.m_model.setCurrentPosition(a,b,c,d)};W78.prototype.modifySeries=function(a,b,c){a=new W86(this.m_model,a,b,c);this.pushUndoCommand(a);a.redo()};
W78.prototype.insertStudy=function(a,b,c){if(this.model()._chartApi._chartApi.isCanCreateStudy())if(TradingView.D18("indicators_limit")&&!user.is_pro&&this.m_model.countUserStudies()>=A7.FREE_STUDY_LIMIT)A83.showGoProDialog({feature:"studyLimit"});else return a=new InsertStudyCommand(this.m_model,a,b,c),this.pushUndoCommand(a),a.redo();else A83.showNotice("Error","Exceeded the limit of studies")};
W78.prototype.setProperty=function(a,b,c){a&&a.value()!==b&&(a=new SetPropertyCommand(a,b,c,this.m_model),this.pushUndoCommand(a),a.redo(),this.emitEvent("setProperty"))};W78.prototype.setPercentProperty=function(a,b,c,d){a.value()!==b&&(a=new SetPercentagePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};W78.prototype.setLogProperty=function(a,b,c,d){a.value()!==b&&(a=new SetLogPropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
W78.prototype.setAutoScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new SetAutoScalePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};W78.prototype.setChartStyleProperty=function(a,b,c){a.value()!==b&&(a=new SetChartStyleCommand(a,b,this.mainSeries(),c,this.m_model,this.D4),this.pushUndoCommand(a),a.redo(),this.emitEvent("setChartStyleProperty"))};
W78.prototype.setLockScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new SetLockScaleCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};W78.prototype.setScreenChartProperty=function(a,b,c,d,e){if(e||a.value()!==b)a=new W92(d,a,b,c,e),this.pushUndoCommand(a),a.redo()};W78.prototype.beginUndoMacro=A77.beginUndoMacro;W78.prototype.endUndoMacro=A77.endUndoMacro;
W78.prototype.createUndoCheckpoint=A77.createUndoCheckpoint;W78.prototype.undoToCheckpoint=A77.undoToCheckpoint;W78.prototype.removeSource=function(a){if(a.isUserDeletable()){var b=new RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};
W78.prototype.removeSelectedSource=function(){var a=this.m_model.selectedSource();if(a&&a.isUserDeletable()){this.setSelectedSource(null);var b=new RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};W78.prototype.move=function(a,b,c){var d=this.m_model.paneForSource(a);b=new W88(this.m_model,a,d,b,c);this.pushUndoCommand(b);b.redo();this.emitEvent("moveSource",[a])};
W78.prototype.createLineTool=function(a,b,c,d){if("LineToolRegressionTrend"!=c||this.model()._chartApi._chartApi.isCanCreateStudy())return c=this.m_model.createLineTool(a,b,c,d),this._createLineCommand=new W83(this.m_model,c,a,b),this.m_model.lineBeingCreated()||(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),c;A83.showNotice("Error","Exceeded the limit of studies")};W78.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()};
W78.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()};W78.prototype.coninueCreatingLine=function(a,b){this.m_model.lineBeingCreated();this.m_model.paneBeingCreatedLineOn();var c=this.m_model.coninueCreatingLine(a,b);this._createLineCommand.coninueCreatingLine(a,b);c&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand);return c};W78.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()};
W78.prototype.lineCancelled=function(){return this.m_model.lineCancelled()};W78.prototype.startChangingLinetool=function(a,b,c,d){this._currentLineChangeCommand=new W80(this.m_model,a,c,d);this.m_model.startChangingLinetool(a,b,c,d)};W78.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()};W78.prototype.changeLinePoint=function(a,b){this._currentLineChangeCommand.setPoint(a,b);this.m_model.changeLinePoint(a,b)};
W78.prototype.endChangingLinetool=function(){this.m_model.endChangingLinetool();this._currentLineChangeCommand.endChanging();this.pushUndoCommand(this._currentLineChangeCommand);this._currentLineChangeCommand=null};W78.prototype.startMovingSource=function(a,b,c){this._currentLineMoveCommand=new W87(this.m_model,a,b,c);this.m_model.startMovingSource(a,b,c)};W78.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()};
W78.prototype.moveSource=function(a){this._currentLineMoveCommand.setPoint(a);this.m_model.moveSource(a)};W78.prototype.endMovingSource=function(){this.m_model.endMovingSource();this.pushUndoCommand(this._currentLineMoveCommand);this._currentLineChangeCommand=null};W78.prototype.D19=function(){return this.m_model.D19()};W78.prototype.state=function(a){return this.m_model.state(a)};W78.prototype.asyncState=function(a){return this.m_model.asyncState(a)};
W78.prototype.restoreState=function(a,b){this.m_model.restoreState(a,b)};W78.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()};W78.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()};W78.prototype.changeZOrder=function(a,b){var c=new ChangeZOrderCommand(this.m_model,a,b);this.pushUndoCommand(c);c.redo();this.emitEvent("changeZOrder",[a])};
W78.prototype.sendToBack=function(a){var b=new SendToBackCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};W78.prototype.bringToFront=function(a){var b=new BringToFrontCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};
W78.prototype.removeAllStudies=function(){this.beginUndoMacro("remove all studies");for(var a=this.m_model.D19(),b=0;b<a.size();b++){var c=a.item(b);isInherited(c.constructor,TradingView.Study)&&c.removeByRemoveAllStudies()&&this.removeSource(c)}this.endUndoMacro()};
W78.prototype.removeAllDrawingTools=function(a){this.beginUndoMacro("remove all drawing tools");for(var b=this.m_model.D19(),c=0;c<b.size();c++){var d=b.item(c);isInherited(d.constructor,W47)&&d.isActualSymbol()&&d.isUserDeletable()&&(a&&a!=d._constructor||this.removeSource(d))}this.endUndoMacro()};
W78.prototype.moveDown=function(){try{this.beginUndoMacro("Move Down")}catch(a){return}var b=this,c=this.m_model.mainSeries(),d=this.m_model.paneForSource(c),e=d.priceScaleForSource(c);e.setAutoScale(!1);c=e.height();TradingView.animate(c/5,function(a){b.startScrollPrice(d,e,0);b.scrollPriceTo(d,e,a);b.endScrollPrice(d,e)},function(){b.endUndoMacro()})};
W78.prototype.moveUp=function(){try{this.beginUndoMacro("Move Up")}catch(a){return}var b=this,c=this.m_model.mainSeries();pane=this.m_model.paneForSource(c);scale=pane.priceScaleForSource(c);scale.setAutoScale(!1);c=scale.height();TradingView.animate(c/5,function(a){b.startScrollPrice(pane,scale,a);b.scrollPriceTo(pane,scale,0);b.endScrollPrice(pane,scale)},function(){b.endUndoMacro()})};
W78.prototype.moveLeft=function(){try{this.beginUndoMacro("Move Left")}catch(a){return}var b=this.m_model.timeScale().width(),c=this;TradingView.animate(b/5,function(a){c.startScrollTime(a);c.scrollTimeTo(0);c.endScrollTime()},function(){c.endUndoMacro()})};
W78.prototype.moveRight=function(){try{this.beginUndoMacro("Move Right")}catch(a){return}var b=this.m_model.timeScale().width(),c=this;TradingView.animate(b/5,function(a){c.startScrollTime(0);c.scrollTimeTo(a);c.endScrollTime()},function(){c.endUndoMacro()})};W78.prototype.scrollChart=function(a){this.startScrollTime(0);this.scrollTimeTo(a);this.endScrollTime()};
W78.prototype.scrollChartByBar=function(a){a*=this.m_model.timeScale().barSpacing();this.startScrollTime(0);this.scrollTimeTo(a);this.endScrollTime()};
W78.prototype.zoomIn=function(a,b){var c=this.m_model.timeScale().width(),d=this;b=b||1;if(this.canZoomIn())if(a){var c=b*c/10,e=(a+1)/2*c;this.startScaleTime(c);this.scaleTimeTo(0);this.endScaleTime();this.startScrollTime(0);this.scrollTimeTo(c-e);this.endScrollTime();this._onSimpleZoomIn.fire()}else{try{this.beginUndoMacro("Zoom In")}catch(g){return}TradingView.animate(c/5,function(a){d.startScaleTime(a);d.scaleTimeTo(0);d.endScaleTime()},function(){d.endUndoMacro();d._onSimpleZoomIn.fire()})}};
W78.prototype.zoomOut=function(a,b){var c=this.m_model.timeScale().width(),d=this;b=b||1;if(this.canZoomOut())if(a)this.startScaleTime(0),this.scaleTimeTo(b*c/10),this.endScaleTime(),this.startScrollTime(b*(c/20-c/20*a)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(e){return}TradingView.animate(c/5,function(a){d.startScaleTime(0);d.scaleTimeTo(a);d.endScaleTime()},function(){d.endUndoMacro();d._onSimpleZoomOut.fire()})}};
W78.prototype.resetScales=function(){this.beginUndoMacro("Reset scales");this.resetTimeScale();for(var a=0;a<this.panes().size();a++){var b=this.panes().item(a);this.resetPriceScale(b,b.leftPriceScale());this.resetPriceScale(b,b.rightPriceScale())}this.endUndoMacro();this.m_model.recalculateAllPanes()};W78.prototype.zoomToViewport=function(a,b,c,d,e){a=new ZoomCommand(this.m_model,a,b,c,d,e);a=new W95(a,this.m_zoomStack,!0);a.redo();this.pushUndoCommand(a)};
W78.prototype.zoomFromViewport=function(){var a=new W95(this.m_zoomStack.head(),this.m_zoomStack,!1);a.redo();this.pushUndoCommand(a)};W78.prototype.zoomStack=function(){return this.m_zoomStack};W78.prototype.addPaneStretchFactorUndoCommand=function(a,b,c,d){a=new W91(this.m_model,a,b,c,d);this.pushUndoCommand(a)};
W78.prototype.restoreFactoryDefaults=function(a){a=new W90(this.m_model,a);a.redo();this.pushUndoCommand(a)};W78.prototype.chartLoadTheme=function(a,b){var c=new W81(a,b);c.redo();this.pushUndoCommand(c)};W78.prototype.drawingLoadTemplate=function(a,b){var c=new W84(a,b);c.redo();this.pushUndoCommand(c)};
W78.prototype.studyLoadTemplate=function(a,b,c,d){a=new W93(a,b,c,d);a.redo();this.pushUndoCommand(a)};W78.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn};W78.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut};
W78.prototype.loadRange=function(a){a.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries()._pendingInterval=a.val,this.setProperty(this.m_model.mainSeries().properties().interval,a.res,"Change date range")):this.m_model.mainSeries().loadDataTo(a.val)};W78.prototype.cloneLineTool=function(a){a=new W82(this.m_model,a);a.redo();this.pushUndoCommand(a);this.emitEvent("cloneLineTool")};
W78.prototype._preparePriceAxisProperties=function(a,b){var c=a.lockScale.value(),d=a.style.value()==TradingView.Series.STYLE_PNF;if(d||c)b.log.setValue(!1),b.percentage.setValue(!1);b.logDisabled.setValue(!(!d&&!c));b.percentageDisabled.setValue(!(!d&&!c))};W78.prototype.alertsList=function(){return this.m_model.alertsList()};W78.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()};W78.prototype.insertStudyStub=function(a){return this.m_model.insertStudyStub(a)};
W78.prototype.removeStudyStub=function(a){return this.m_model.removeStudyStub(a)};W78.prototype.isJustClonedChart=function(){return this.D4.isJustClonedChart()};function UndoCommand(a){this._text=a}UndoCommand.prototype.text=function(){return this._text};UndoCommand.prototype.undo=function(){throw"pure virtual call ;)";};UndoCommand.prototype.redo=function(){throw"pure virtual call ;)";};
function UndoStack(){this.m_commands=new List;this.m_commands.setValidator(new TypeValidator(UndoCommand));this._onChange=new Delegate}UndoStack.prototype.onChange=function(){return this._onChange};UndoStack.prototype.isEmpty=function(){return this.m_commands.isEmpty()};UndoStack.prototype.clear=function(){this.m_commands.clear();this._onChange.fire()};UndoStack.prototype.push=function(a){this.m_commands.append(a);this._onChange.fire()};
UndoStack.prototype.pop=function(){if(this.m_commands.isEmpty())TradingView.logDebug("UndoStack.pop: undo stack is empty");else{var a=this.m_commands.item(this.m_commands.size()-1);this.m_commands.removeAt(this.m_commands.size()-1);this._onChange.fire();return a}};UndoStack.prototype.head=function(){if(this.m_commands.isEmpty())TradingView.logDebug("UndoStack.head: undo stack is empty");else return this.m_commands.item(this.m_commands.size()-1)};
function UndoMacroCommand(a){UndoCommand.call(this,a);this._subcommands=new List}inherit(UndoMacroCommand,UndoCommand);UndoMacroCommand.prototype.addCommand=function(a){this._subcommands.append(a)};UndoMacroCommand.prototype.isEmpty=function(){return this._subcommands.isEmpty()};UndoMacroCommand.prototype.redo=function(){for(var a=0;a<this._subcommands.size();a++)this._subcommands.item(a).redo()};UndoMacroCommand.prototype.undo=function(){for(var a=this._subcommands.size()-1;0<=a;a--)this._subcommands.item(a).undo()};
function SetPropertyCommand(a,b,c,d){UndoCommand.call(this,c);this._targetObj=a;this._newValue=b;this.D0=d}inherit(SetPropertyCommand,UndoCommand);SetPropertyCommand.prototype.redo=function(){this._oldValue=this._targetObj.value();TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._newValue);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
SetPropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._oldValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};function SetAutoScalePropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._priceScale=c;this._newValue=b;this.D0=e}
inherit(SetAutoScalePropertyCommand,UndoCommand);
SetAutoScalePropertyCommand.prototype.redo=function(){this._oldValue=this._property.value();this._oldLockScaleValue=this._priceScale.mainSource()instanceof TradingView.Series?this._priceScale.mainSource().properties().lockScale.value():void 0;TradingView.saveDefaultProperties(!0);this._property.setValue(this._newValue);this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(!1);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),
this.D0.D20(new A22(A22.LIGHT_UPDATE)))};SetAutoScalePropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._property.setValue(this._oldValue);this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(this._oldLockScaleValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
function SetPercentagePropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._percentage=a;this._priceScale=c;this._newValue=b;this.D0=e}inherit(SetPercentagePropertyCommand,UndoCommand);
SetPercentagePropertyCommand.prototype.redo=function(){this._oldValue=this._percentage.value();this._oldAutoScaleValue=this._priceScale.properties().autoScale.value();this._oldLogValue=this._priceScale.properties().log.value();this._oldLogDisabled=this._priceScale.properties().logDisabled.value();TradingView.saveDefaultProperties(!0);this._percentage.setValue(this._newValue);this._priceScale.properties().autoScaleDisabled.setValue(this._newValue);this._priceScale.properties().log.setValue(!1);TradingView.saveDefaultProperties(!1);
this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
SetPercentagePropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._percentage.setValue(this._oldValue);this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue);this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue);this._priceScale.properties().log.setValue(this._oldLogValue);if(!(this._oldAutoScaleValue||this._priceScale.mainSource()instanceof TradingView.Series&&this._priceScale.mainSource().isLockScale())){var a=this.D0.timeScale().visibleBars();
this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(a.firstBar())))}TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};function SetLogPropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._log=a;this._priceScale=c;this._newValue=b;this.D0=e}inherit(SetLogPropertyCommand,UndoCommand);
SetLogPropertyCommand.prototype.redo=function(){this._oldValue=this._log.value();this._oldPercValue=this._priceScale.properties().percentage.value();this._oldPercDisabled=this._priceScale.properties().percentageDisabled.value();TradingView.saveDefaultProperties(!0);this._log.setValue(this._newValue);this._priceScale.properties().percentage.setValue(!1);this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value());TradingView.saveDefaultProperties(!1);this.D0&&
(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};SetLogPropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._log.setValue(this._oldValue);this._priceScale.properties().percentage.setValue(this._oldPercValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
function SetChartStyleCommand(a,b,c,d,e,g){UndoCommand.call(this,d);this._style=a;this._mainSeries=c;this._priceAxisProperties=c.properties().priceAxisProperties;this._newValue=b;this.D0=e;this.D4=g}inherit(SetChartStyleCommand,UndoCommand);
SetChartStyleCommand.prototype.redo=function(){var a=$.Deferred().resolve();this._mainSeries.D2.style===this._style&&this.D0.mainSeries().isNeedRestart(this._newValue)&&(a=this.D4.screen.show());a.done(function(){this._oldValue=this._style.value();this._oldAutoScale=this._priceAxisProperties.autoScale.value();this._oldLogValue=this._priceAxisProperties.log.value();this._oldLogDisabled=this._priceAxisProperties.logDisabled.value();this._oldPercentageValue=this._priceAxisProperties.percentage.value();
this._oldPercentageDisabled=this._priceAxisProperties.percentageDisabled.value();TradingView.saveDefaultProperties(!0);this._style.setValue(this._newValue);this.D4.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))}.bind(this))};
SetChartStyleCommand.prototype.undo=function(){var a=$.Deferred().resolve();this._mainSeries.D2.style===this._style&&this.D0.mainSeries().isNeedRestart(this._newValue)&&(a=this.D4.screen.show());a.done(function(){TradingView.saveDefaultProperties(!0);this._style.setValue(this._oldValue);this._priceAxisProperties.log.setValue(this._oldLogValue);this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled);this._priceAxisProperties.percentage.setValue(this._oldPercentageValue);
this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled);this._priceAxisProperties.autoScale.setValue(this._oldAutoScale);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))}.bind(this))};
function SetLockScaleCommand(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._mainSeries=c;this._priceAxisProperties=c.properties().priceAxisProperties;this._newValue=b;this.D0=e}inherit(SetLockScaleCommand,UndoCommand);
SetLockScaleCommand.prototype.redo=function(){this._oldValue=this._property.value();this._oldAutoScale=this._priceAxisProperties.autoScale.value();this._oldPercentage=this._priceAxisProperties.percentage.value();this._oldLog=this._priceAxisProperties.log.value();TradingView.saveDefaultProperties(!0);this._newValue&&(this._priceAxisProperties.percentage.setValue(!1),this._priceAxisProperties.log.setValue(!1),this._priceAxisProperties.autoScale.setValue(!1));var a=this._mainSeries.properties().style.value();
a!==TradingView.Series.STYLE_RENKO&&a!==TradingView.Series.STYLE_KAGI&&a!==TradingView.Series.STYLE_PNF&&a!==TradingView.Series.STYLE_PB&&this._mainSeries.fixBoxSize();this._property.setValue(this._newValue);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
SetLockScaleCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._priceAxisProperties.percentage.setValue(this._oldPercentage);this._priceAxisProperties.log.setValue(this._oldLog);this._priceAxisProperties.autoScale.setValue(this._oldAutoScale);this._property.setValue(this._oldValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
W89=function(a,b,c,d){this.m_model=a;this.m_pane=b;this.m_priceScale=c;this.m_state=d;this.m_newPriceScaleState=null};inherit(W89,UndoCommand);W89.prototype.undo=function(){null!==this.m_newPriceScaleState?TradingView.logDebug("W89.undo: Command is already undone"):(this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state),this.m_priceScale.recalcLockedScale(null))};
W89.prototype.redo=function(){null===this.m_newPriceScaleState?TradingView.logDebug("W89.redo: Command is not undone"):(this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null)};W94=function(a,b,c){UndoCommand.call(this,c);this.m_model=a;this.m_state=b;this.m_newTimeScaleState=null};inherit(W94,UndoCommand);
W94.prototype.undo=function(){null!==this.m_newTimeScaleState?TradingView.logDebug("W94.undo: Command is already undone"):(this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state),this.m_model.timeScale().recalcLockedScale())};
W94.prototype.redo=function(){null===this.m_newTimeScaleState?TradingView.logDebug("W94.redo: Command is not undone"):(this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null)};W86=function(a,b,c,d){this.D0=a;this._series=b;this._oldSymbol=b.symbol();this._oldInterval=b.interval();this._symbol=c;this._interval=d};inherit(W86,UndoCommand);
W86.prototype.redo=function(){this.D0.modifySeries(this._series,this._symbol,this._interval)};W86.prototype.undo=function(){this.D0.modifySeries(this._series,this._oldSymbol,this._oldInterval)};InsertStudyCommand=function(a,b,c,d){UndoCommand.call(this,"Insert "+b.id);this.D0=a;this._studyMetaInfo=b;this._props=c;this._isOverlay=d};inherit(InsertStudyCommand,UndoCommand);
InsertStudyCommand.prototype.redo=function(){return this.D1=this.D0.insertStudy(this._studyMetaInfo,this._props,this._isOverlay)};InsertStudyCommand.prototype.undo=function(){this.D0.removeSource(this.D1)};function RemoveSourceCommand(a,b){this.D0=a;this.W99=b}inherit(RemoveSourceCommand,UndoCommand);
RemoveSourceCommand.prototype.redo=function(){var a=this.D0.paneForSource(this.W99);this._paneIndex=this.D0.panes().indexOf(a);this._priceScaleName=a.priceScaleName(this.W99.priceScale());var b=this.D0.children(this.W99);this._removeChildUndoCommands=new List;for(var c=0;c<b.size();c++){var d=b.item(c),d=new RemoveSourceCommand(this.D0,d);this._removeChildUndoCommands.append(d);d.redo()}this._paneState=a.state();this._restorePane=this.D0.removeSource(this.W99);
this.D0.recalculateAllPanes();this.D0.D20(new A22(A22.FULL_UPDATE,!0))};
RemoveSourceCommand.prototype.undo=function(){var a;a=this._restorePane?this.D0.createPane(this._paneIndex):this.D0.panes().item(this._paneIndex);var b=this.W99.ownerSource()?this.W99.ownerSource().priceScale():a.priceScaleByName(this._priceScaleName);a.addDataSource(this.W99,b);this.W99.start();this.W99.restore&&this.W99.restore();this._restorePane&&a.restoreState(this._paneState);for(a=this._removeChildUndoCommands.size()-1;0<=a;a--)this._removeChildUndoCommands.item(a).undo();
this._removeChildUndoCommands.clear();this.D0.recalculateAllPanes();this.D0.D20(new A22(A22.FULL_UPDATE,!0))};
function W88(a,b,c,d,e){this.D0=a;this.W99=b;this._scale=e;this._sources=new List;this._sources.append(b);this._sources.appendAll(this.D0.children(b));this._oldPane=c;this._oldPaneIndex=a.panes().indexOf(c);this._oldPaneState=this._oldPane.state();this._oldScaleName=c.priceScaleName(b.priceScale());this._pane=d;this._samePane=this._pane===this._oldPane}inherit(W88,UndoCommand);W88.prototype.redo=function(){this.D0.move(this.W99,this._pane,this._scale)};
W88.prototype.undo=function(){var a=!1;if(this._samePane)this._oldPane.restoreState(this._oldPaneState);else{for(var b=0;b<this._sources.size();b++)this.D0.detachSource(this._sources.item(b));if(this.D0.panes().contains(this._oldPane)){for(var c=this._oldPane.priceScaleByName(this._oldScaleName),b=0;b<this._sources.size();b++)this._oldPane.addDataSource(this._sources.item(b),c);this._oldPane.restoreState(this._oldPaneState)}else{this._oldPane=this.D0.createPane(this._oldPaneIndex);
c=this._oldPane.priceScaleByName(this._oldScaleName);for(b=0;b<this._sources.size();b++)this._oldPane.addDataSource(this._sources.item(b),c);a=!0}}this.D0.recalculateAllPanes();a&&this.D0.D20(new A22(A7.FULL_UPDATE))};function W83(a,b,c,d){UndoCommand.call(this,"Create line "+b.toolname);this.D0=a;this._line=b;this._paneIndex=a.panes().indexOf(c);this._points=new List;this._points.append({point:d})}
inherit(W83,UndoCommand);W83.prototype.coninueCreatingLine=function(a,b){this._points.append({point:a,envState:b})};W83.prototype.undo=function(){this.D0.removeSource(this._line)};
W83.prototype.redo=function(){var a=this.D0.panes().item(this._paneIndex);this._line=this.D0.createLineTool(a,this._points.item(0).point,this._line.toolname);for(a=1;a<this._points.size();a++)this.D0.coninueCreatingLine(this._points.item(a).point,this._points.item(a).envState)};function W80(a,b,c,d){this.D0=a;this.W99=b;this._nextState=this._prevState=b.state(!0)}inherit(W80,UndoCommand);
W80.prototype.setPoint=function(a){this._nextState=this.W99.state(!0)};W80.prototype.endChanging=function(){this._nextState=this.W99.state(!0)};W80.prototype.undo=function(){var a=this.W99,b=this._prevState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D0.D20(new A22(A22.FULL_UPDATE))};
W80.prototype.redo=function(){var a=this.W99,b=this._nextState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D0.D20(new A22(A22.FULL_UPDATE))};function W87(a,b,c,d){this.D0=a;this.W99=b;this._origPoint=c instanceof MathEx.Point?c.clone():TradingView.clone(c);this._pointIndex=d}inherit(W87,UndoCommand);
W87.prototype.setPoint=function(a){this._point=a instanceof MathEx.Point?a.clone():TradingView.clone(a)};W87.prototype.undo=function(){this.D0.startMovingSource(this.W99,this._point,this._pointIndex);this.D0.moveSource(this._origPoint);this.D0.endMovingSource()};W87.prototype.redo=function(){this.D0.startMovingSource(this.W99,this._origPoint,this._pointIndex);this.D0.moveSource(this._point);this.D0.endMovingSource()};
function ChangeZOrderCommand(a,b,c){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.W99=b;this._shift=c}inherit(ChangeZOrderCommand,UndoCommand);ChangeZOrderCommand.prototype.undo=function(){this.D0.changeZOrder(this.W99,-this._shift)};ChangeZOrderCommand.prototype.redo=function(){this.D0.changeZOrder(this.W99,this._shift)};function SendToBackCommand(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.W99=b}
inherit(SendToBackCommand,UndoCommand);SendToBackCommand.prototype.undo=function(){this.D0.bringToFront(this.W99)};SendToBackCommand.prototype.redo=function(){this.D0.sendToBack(this.W99)};function BringToFrontCommand(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.W99=b}inherit(BringToFrontCommand,UndoCommand);BringToFrontCommand.prototype.undo=function(){this.D0.sendToBack(this.W99)};BringToFrontCommand.prototype.redo=function(){this.D0.bringToFront(this.W99)};
W78.prototype.removePane=function(a,b){var c=new RemovePaneCommand(this,b,a);this.pushUndoCommand(c);c.redo()};function RemovePaneCommand(a,b,c){UndoCommand.call(this,"Remove pane");this.D0=a;this._index=b;this._pane=this.D0.panes().item(b);this._chart=c}inherit(RemovePaneCommand,UndoCommand);RemovePaneCommand.prototype.redo=function(){this.D0.panes().removeAt(this._index);this._chart._updateGui()};
RemovePaneCommand.prototype.undo=function(){this.D0.panes().insert(this._pane,this._index);this._chart._updateGui()};W78.prototype.rearrangePanes=function(a,b,c){a=new RearrangePanesCommand(this,b,c,a);this.pushUndoCommand(a);a.redo()};function RearrangePanesCommand(a,b,c,d){UndoCommand.call(this,"Rearrange panes");this.D0=a;this._index=b;this._direction=c;this._chart=d}inherit(RearrangePanesCommand,UndoCommand);
RearrangePanesCommand.prototype.redo=function(){var a=this.D0.panes().item(this._index);"up"===this._direction&&0<this._index&&(this.D0.panes().removeAt(this._index),this.D0.panes().insert(a,this._index-1));"down"===this._direction&&this._index<this.D0.panes().size()-1&&(this.D0.panes().removeAt(this._index),this.D0.panes().insert(a,this._index+1));this.D0.D20(new A22(A22.FULL_UPDATE))};
RearrangePanesCommand.prototype.undo=function(){if("up"===this._direction){var a=this.D0.panes().item(this._index-1);this.D0.panes().removeAt(this._index-1);this.D0.panes().insert(a,this._index)}"down"===this._direction&&(a=this.D0.panes().item(this._index+1),this.D0.panes().removeAt(this._index+1),this.D0.panes().insert(a,this._index));this.D0.D20(new A22(A22.FULL_UPDATE))};
function ZoomCommand(a,b,c,d,e,g){this.D0=a;this._startBar=b;this._endBar=c;this._startPrice=d;this._endPrice=e;this._pane=g}inherit(ZoomCommand,UndoCommand);ZoomCommand.prototype.redo=function(){this._timeScaleState=this.D0.timeScale().state();this._priceScaleState=this._pane.defaultPriceScale().state();this.D0.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)};
ZoomCommand.prototype.undo=function(){this.D0.timeScale().restoreState(this._timeScaleState);this._pane.defaultPriceScale().restoreState(this._priceScaleState);this.D0.recalculateAllPanes();this.D0.D20(new A22(A22.LIGHT_UPDATE))};function W95(a,b,c){this._baseCmd=a;this._zoomStack=b;this._inOut=c}inherit(W95,UndoCommand);
W95.prototype.undo=function(){this._inOut?this._baseCmd!==this._zoomStack.head()?TradingView.logDebug("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop()):(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd))};W95.prototype.redo=function(){this._inOut?(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)):this._baseCmd!==this._zoomStack.head()?TradingView.logDebug("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop())};
function W91(a,b,c,d,e){this.D0=a;this._paneA=b;this._paneB=c;this._prevStretchA=d;this._currStretchA=e}inherit(W91,UndoCommand);W91.prototype.redo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA;this._paneB._stretchFactor=a-this._currStretchA;this.D0.D20(new A22(A22.FULL_UPDATE))};
W91.prototype.undo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA;this._paneB._stretchFactor=a-this._prevStretchA;this.D0.D20(new A22(A22.FULL_UPDATE))};function W90(a,b){UndoCommand.call(this,"Restore Defaults");this.D0=a;this._defaultProperty=b;this._state=b.state(b._exclusions)}inherit(W90,UndoCommand);
W90.prototype.redo=function(){this.D0.restoreFactoryDefaults(this._defaultProperty)};W90.prototype.undo=function(){this._defaultProperty.merge(this._state);this._defaultProperty.listeners().fire(this._defaultProperty);this.D0.mainSeries().onChartStyleChanged()};
function W81(a,b){UndoCommand.call(this,"Apply Chart Theme");this.D0=a;this._newChartProps=b.chartProperties;this._newSeriesProps=b.mainSourceProperties;this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor);this._oldChartProps=a.properties().state();delete this._oldChartProps.paneProperties.topMargin;
delete this._oldChartProps.paneProperties.bottomMargin;this._oldSeriesProps=a.properties().state().mainSeriesProperties}inherit(W81,UndoCommand);
W81.prototype._merge=function(a,b){var c=this.D0;TradingView.saveDefaultProperties(!0);a&&(c.properties().paneProperties.merge(a.paneProperties),c.properties().scalesProperties.merge(a.scalesProperties),c.properties().symbolWatermarkProperties.merge(a.symbolWatermarkProperties));c.mainSeries().properties().merge(b);c.mainSeries().properties().saveDefaults();c.mainSeries().$63();c._version=b.version;c.recalculateAllPanes();c.D20(new A22(A22.FULL_UPDATE));
c.properties().saveDefaults();c.properties().listeners().fire(this.D2);TradingView.saveDefaultProperties(!1)};W81.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps);this.D0.mainSeries().onChartStyleChanged();this.D0.updateScales()};W81.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps);this.D0.mainSeries().onChartStyleChanged();this.D0.updateScales()};
function W84(a,b){UndoCommand.call(this,"Apply Drawing Template");this.W99=a;this._oldProps=a.properties().state();this._newProps=b}inherit(W84,UndoCommand);W84.prototype._merge=function(a){var b=this.W99;b.properties().merge(a);b.properties().saveDefaults();b.updateAllViews();b.D0.D20(new A22(A22.LIGHT_UPDATE))};
W84.prototype.undo=function(){this._merge(this._oldProps)};W84.prototype.redo=function(){this._merge(this._newProps)};function W93(a,b,c,d){UndoCommand.call(this,(" "+d||"")+" Study template");this.D0=a;this._oldProps=b;this._newProps=c}inherit(W93,UndoCommand);
W93.prototype._merge=function(a){var b=this.D0.model(),c=b.mainSeries();c.properties().lockScale.setValue(!1);a.interval&&c.properties().interval.setValue(a.interval);for(var d=[],e=b.panes(),g=e.size();g--;)for(var h=e.item(g),k=h.containsMainSeries(),l=h.D19(),h=l.size();h--;){var m=l.item(h);if(!k||m instanceof TradingView.Study||m instanceof TradingView.AlertLabel)m.isRemovedByStudyTemplates()||d.push(m),b.removeSource(m)}k=a.panes;for(g=0;g<k.length;g++){for(var l=
!1,n=k[g],h=0;h<n.sources.length;h++)m=n.sources[h],"MainSeries"===m.type&&(delete m.state,l=!0);h=null;h=l?e.item(g):b.createPane(g);h.restoreState(k[g],!1,a.version);if(l)for(m=0;m<d.length;m++){d[m].restore&&d[m].restore();var q=d[m];q instanceof TradingView.AlertLabel&&!h.D19().find(function(a){return a.alert&&a.alert().id()===q.alert.id()})||h.D19().append(q)}h.updateAlertLabelsSources()}c.priceScale().setAutoScale(!0);b._version=a.version;b.startNotStartedStudies();b.recalculateAllPanes();
b.D20(new A22(A22.FULL_UPDATE))};W93.prototype.undo=function(){this._merge(this._oldProps);this.D0.model().mainSeries().onChartStyleChanged()};
W93.prototype.redo=function(){this._merge(this._newProps);this.D0.model().mainSeries().onChartStyleChanged();var a=this.D0.model().mainSeries().properties(),b=this.D0.model().mainSeries().properties().priceAxisProperties;this.D0._preparePriceAxisProperties(a,b)};
function SetPriceScaleMarginsCommand(a,b,c,d,e){this.D0=a;this._pane=b;this._priceScale=c;this._topMargin=d;this._bottomMargin=e;this._oldTopMargin=c.topMargin();this._oldBottomMargin=c.bottomMargin()}inherit(SetPriceScaleMarginsCommand,UndoCommand);SetPriceScaleMarginsCommand.prototype.redo=function(){this._priceScale.setTopMargin(this._topMargin);this._priceScale.setBottomMargin(this._bottomMargin);this.D0.recalculatePane(this._pane,!1)};
SetPriceScaleMarginsCommand.prototype.undo=function(){this._priceScale.setTopMargin(this._oldTopMargin);this._priceScale.setBottomMargin(this._oldBottomMargin);this.D0.recalculatePane(this._pane,!1)};function W85(a,b){this.D0=a;this._range=b}inherit(W85,UndoCommand);W85.prototype.redo=function(){this.D0.mainSeries().loadDataTo(this._range)};
function W92(a,b,c,d,e){UndoCommand.call(this,a);this._property=b;this._value=c;this._forceSetProperty=e;this._prevValue=b.value();this._cw=d}inherit(W92,UndoCommand);W92.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))};
W92.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))};function W82(a,b){UndoCommand.call(this,"clone "+b.title());this.D0=a;this.W99=b;this._points=new List}inherit(W82,UndoCommand);
W82.prototype.redo=function(){if(this.W99){var a=this.W99,b=a.priceScale(),c=this.D0.paneForSource(a),d=TradingView.className(a.constructor);this._line=new TradingView[d](this.D0,new $52(d.toLowerCase(),a.properties().state()));this._line.setOwnerSource(a.ownerSource());this._line.properties().visible._value=!0;this._line._fixedPoints.appendAll(a._fixedPoints);for(var e=0;e<this._line._fixedPoints.size();e++)this._line._fixedPoints.setItem(e,this._line._fixedPoints.item(e).add(new MathEx.Point(20,
20)));var g=a._timePoint.toArray(),d=[];if(b.isPercent())var h=a.ownerSource().firstValue();for(e=0;e<g.length;e++){var k={offset:g[e].offset,time_t:g[e].time_t},l=g[e].price;b.isPercent()&&(l=b.priceRange().convertToPercent(l,h));l=b.priceToCoordinate(l);l-=40;l=b.coordinateToPrice(l);b.isPercent()&&(l=b.priceRange().convertFromPercent(l,h));k.price=l;d.push(k)}h=a._points.toArray();this._line.restorePoints(d,h);this._line.cloneData&&this._line.cloneData(a);c.addDataSource(this._line,b);this.D0.updateSource(this._line);
this._line.checkAlert&&this._line.checkAlert();this._points=this._line.points();this._paneIndex=this.D0.panes().indexOf(c);this._toolname=a._constructor;delete this.W99}else for(c=this.D0.panes().item(this._paneIndex),this._line=this.D0.createLineTool(c,this._points.item(0),this._toolname),e=1;e<this._points.size();e++)this.D0.coninueCreatingLine(this._points.item(e))};
W82.prototype.undo=function(){this.D0.removeSource(this._line);this.D0.D20(new A22(A22.LIGHT_UPDATE,!0))};A77.setWatchedValue=function(a,b,c){a.value()!==b&&(a=new SetWatchedValueCommand(a,b,c),this.pushUndoCommand(a),a.redo())};function SetWatchedValueCommand(a,b,c){UndoCommand.call(this,c);this._wv=a;this._newValue=b;this._oldValue=a.value()}inherit(SetWatchedValueCommand,UndoCommand);
SetWatchedValueCommand.prototype.redo=function(){this._wv.setValue(this._newValue)};SetWatchedValueCommand.prototype.undo=function(){this._wv.setValue(this._oldValue)};function W79(a,b,c,d,e,g,h,k){this._version=W79.version;this._readOnly=d;this._undoModel=k;this._studiesMetaData=g;this._studyVersioning=new A0(this._studiesMetaData,h);this.m_timeScale=new W49(this,c.timeScale);this.m_panes=new List;this.m_gridSource=new Grid;this.m_crossHairSource=new CrossHair(this,TradingView.drawingState.properties());this.m_width=0;this._tagsChanged=new Delegate;this.D2=c;this._lineCancelled=new Delegate;this._magnet=new A47(TradingView.drawingState.properties().magnet,
this.m_timeScale,c.paneProperties.magnetSensivity);this._alertsList=new List;var l=new $52("chartproperties.mainSeriesProperties");l.addExclusion("lockScale");l.addExclusion("minTick");l.addExclusion("priceAxisProperties.percentage");l.addExclusion("priceAxisProperties.log");this.createPane(void 0,!1,{rightAxisProperties:l.priceAxisProperties.state(["autoScale"])});this.m_panes.item(0)._stretchFactor=2*W75.DEFAULT_STRETCH_FACTOR;this.m_panes.item(0)._isMainPane=!0;this.m_selectedSource=
null;this._selectedSourceChanged=new Delegate;this._chartApi=a;this._invalidateHandler=b;this.m_hoveredSource=null;this.D2.listeners().subscribe(this,W79.prototype.propertyChangeHandler);var m=this;this.D2.timezone.listeners().subscribe(null,function(){m._chartApi&&m._chartApi.connected()&&m._chartApi.switchTimezone(m.timezone())});this.D2.timeScale.rightOffset.listeners().subscribe(null,function(){m.m_timeScale.setOffset(m.D2.timeScale.rightOffset.value());
m.recalculateAllPanes()});l.merge(c.mainSeriesProperties.state());this.m_mainSeries=new TradingView.Series(this,l,e);this.panes().item(0).addDataSource(this.m_mainSeries,this.panes().item(0).rightPriceScale());this.m_mainSeries.onCompleted().subscribe(this,function(){m.clearCurrentPosition()});d||(l.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),l.lockScale.listeners().subscribe(this,function(a){if(a=a.value())l.priceAxisProperties.percentage.setValue(!1),l.priceAxisProperties.logDisabled.setValue(!1);
l.priceAxisProperties.percentageDisabled.setValue(a);l.priceAxisProperties.logDisabled.setValue(a)}),this.D2.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(a){a.value()||this.D2.paneProperties.legendProperties.showStudyArguments.setValue(!1)}));this._barsMarksSources=[];a=W77.enabled("charting_library")?new UserDefinedBarsMarks(this):new PublishedChartsTimeline(this);a.setOwnerSource(this.m_mainSeries);this._barsMarksSources.push(a);this.m_watermarkSource=
new Watermark(this.m_mainSeries);var n=this._undoModel.D4;TradingView.D18("alerts")&&!this.readOnly()&&!n.onWidget()&&TradingView.alertsDispatcher&&(this._alertsList.setValidator(new PredicateValidator(function(a){return a instanceof TradingView.Alert?a.fake()||a===TradingView.alertsDispatcher.stash.getAlert(a.id())?!0:(console.error("[Alerts] item need to be fake or in alertsDispatcher stash"),!1):(console.error("[Alerts] item should be instance of TradingView.Alert"),!1)})),
this._alertsList.onAdd=new Delegate,this._alertsList.onRemove=new Delegate,this._alertsList.onChange=new Delegate,this._alertsList.onAdd.subscribe(this,function(a){function b(d){if(d){var e=d.rightPriceScale()||d.leftPriceScale();e&&d.addDataSource(new TradingView.AlertLabel(c,a),e)}}var c=this;if(a.isOHLC())b(c.paneForSource(c.m_mainSeries));else for(var d=c.m_panes.size()-1;0<=d;d--)b(c.m_panes.item(d));n.update();c._alertsList.onChange.fire()}),this._alertsList.onRemove.subscribe(this,function(a){for(var b=
this.m_panes.size()-1;0<=b;b--){var c=this.m_panes.item(b),d=c.D19().find(function(b){return b.alert&&b.alert()&&b.alert().id()===a.id()});d&&c.removeDataSource&&c.removeDataSource(d)}n.update();this._alertsList.onChange.fire()}),this._prepareAlertsList());this._oldEndVisibleIndex=this._oldStartVisibleIndex=-1;this._currentTool="";TradingView.drawingState.hideAllDrawings().subscribe(this,W79.prototype.visibilityChangeHandler)}W79.prototype.currentTool=function(){return this._currentTool};
W79.prototype.setCurrentTool=function(a){this._currentTool=a};W79.prototype.timezone=function(){return this.D2.timezone.value()};W79.prototype.version=function(){return this._version};W79.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())};
W79.prototype.dumpViews=function(){for(var a={panes:[]},b=0;b<this.m_panes.size();b++)a.panes.push(this.m_panes.item(b).dumpViews());a.dataWindow=[];for(var c=this.D19(),b=0;b<c.size();b++){var d=c.item(b).dataWindowView();d&&a.dataWindow.push(d.dump())}return a};W79.prototype._paneInvalidationMask=function(a,b){var c=new A22,d=this.m_panes.indexOf(a);void 0===b&&(b=A22.LIGHT_UPDATE);c.invalidatePane(d,b);return c};
W79.prototype.updatePane=function(a){a=this._paneInvalidationMask(a);this.D20(a)};W79.prototype.fullUpdate=function(a){this.D20(new A22(A22.FULL_UPDATE))};W79.prototype.updateSource=function(a){a=this.paneForSource(a);a=this._paneInvalidationMask(a);this.D20(a)};W79.prototype.studiesMetaData=function(){return this._studiesMetaData};W79.prototype.studyVersioning=function(){return this._studyVersioning};
W79.prototype.disconnect=function(){for(var a=this.D19(),b=0;b<a.size();b++)a.item(b).disconnect&&a.item(b).disconnect()};W79.prototype.restart=function(){this.initConnection();this.m_timeScale.reset();this.m_mainSeries.restart();for(var a=this.D19(),b=0;b<a.size();b++)a.item(b).restart&&a.item(b)!==this.m_mainSeries&&a.item(b).restart()};
W79.prototype.startNotStartedStudies=function(){if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(var a=this.D19(),b=0;b<a.size();b++)a.item(b)instanceof TradingView.Study&&!a.item(b).isStarted()&&a.item(b).restart&&a.item(b)!==this.m_mainSeries&&a.item(b).restart()};
W79.prototype.updateLineTools=function(){for(var a=this.D19(),b=0;b<a.size();b++)if(isInherited(a.item(b).constructor,W47)){var c=a.item(b);c.tryCreateServerPoints();c.checkAlert&&c.checkAlert()}};W79.prototype.realignLineTools=function(){for(var a=this.D19(),b=0;b<a.size();b++)isInherited(a.item(b).constructor,W47)&&a.item(b).calcIsActualSymbol();for(b=0;b<this.panes().size();b++)this.panes().item(b).invalidateSourcesCache()};
W79.prototype.readOnly=function(){return this._readOnly};W79.prototype.properties=function(){return this.D2};W79.prototype.lineCancelled=function(){return this._lineCancelled};W79.prototype.chartApi=function(){return this._chartApi};W79.prototype.propertyChangeHandler=function(){this.D20(new A22(A22.LIGHT_UPDATE))};W79.prototype.visibilityChangeHandler=function(){this.setSelectedSource();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.updateAllPaneViews=function(){for(var a=0;a<this.panes().size();a++)this.panes().item(a).updateAllViews()};W79.prototype.mainSeries=function(){return this.m_mainSeries};W79.prototype.timeScale=function(){return this.m_timeScale};W79.prototype.panes=function(){return this.m_panes};W79.prototype.gridSource=function(){return this.m_gridSource};W79.prototype.watermarkSource=function(){return this.m_watermarkSource};
W79.prototype.crossHairSource=function(){return this.m_crossHairSource};W79.prototype.publishedChartsTimelineSource=function(){for(var a=0;a<this._barsMarksSources.length;++a)if(this._barsMarksSources[a]instanceof PublishedChartsTimeline)return this._barsMarksSources[a]};W79.prototype.barsMarksSources=function(){return this._barsMarksSources};W79.prototype.width=function(){return this.m_width};
W79.prototype.setPaneHeight=function(a,b){a.setHeight(b);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};W79.prototype.setWidth=function(a){this.m_width=a;this.m_timeScale.setWidth(this.m_width);for(var b=0;b<this.m_panes.size();++b)this.m_panes.item(b).setWidth(a);this.recalculateAllPanes()};
W79.prototype.createPane=function(a,b,c){var d=this.D2.paneProperties;c&&d.merge(c);b=new W75(this.m_timeScale,d,this,b);if(void 0!==a){if(0>a||a>this.m_panes.size()){TradingView.logDebug("W79.createPane: invalid index: "+a);return}this.m_panes.insert(b,a)}else this.m_panes.append(b);b.onTagsChanged().subscribe(this,W79.prototype.onPaneTagsChanged);return b};W79.prototype.removePane=function(a){a.destroy();this.m_panes.remove(a);this.D20(new A22(A22.FULL_UPDATE))};
W79.prototype.startScalePrice=function(a,b,c){a.startScalePrice(b,c)};W79.prototype.scalePriceTo=function(a,b,c){a.scalePriceTo(b,c);this.mainSeries().properties().lockScale.value()?this.D20(new A22(A22.LIGHT_UPDATE)):this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};W79.prototype.endScalePrice=function(a,b){a.endScalePrice(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
W79.prototype.startScrollPrice=function(a,b,c){a.startScrollPrice(b,c)};W79.prototype.scrollPriceTo=function(a,b,c){a.scrollPriceTo(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};W79.prototype.endScrollPrice=function(a,b){a.endScrollPrice(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
W79.prototype.setPriceAutoScale=function(a,b,c){a.setPriceAutoScale(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};W79.prototype.restorePriceScaleState=function(a,b,c){a.restorePriceScaleState(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};W79.prototype.resetPriceScale=function(a,b){a.resetPriceScale(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
W79.prototype.updateScales=function(a,b){this._undoModel.D4._updateScalesActions()};W79.prototype.startScaleTime=function(a){this.m_timeScale.startScale(a)};W79.prototype.scaleTimeTo=function(a){this.m_timeScale.scaleTo(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.endScaleTime=function(){this.m_timeScale.endScale();this.D20(new A22(A22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19())};W79.prototype.startScrollTime=function(a){this.m_timeScale.startScroll(a)};W79.prototype.scrollTimeTo=function(a){this.m_timeScale.scrollTo(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.endScrollTime=function(){this.m_timeScale.endScroll();this.D20(new A22(A22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19())};
W79.prototype.recalcVisibleRangeStudy=function(a,b){if(!this.timeScale().isEmpty()){var c=this.timeScale().visibleBars(),d=this.mainSeries().nearestData(c.firstBar(),SEARCH_NEAREST_RIGHT),c=this.mainSeries().nearestData(c.lastBar(),SEARCH_NEAREST_LEFT),e=d?d.index:void 0,g=c?c.index:void 0;if(e!=this._oldStartVisibleIndex||g!=this._oldEndVisibleIndex||b)for(this._oldStartVisibleIndex=e,this._oldEndVisibleIndex=g,e=0;e<a.size();e++)if(a.item(e)instanceof TradingView.Study)for(var g=a.item(e),
h=g.metaInfo().inputs,k=0;k<h.length;k++){if("first_visible_bar_time"==h[k].id){var l=d&&d.value?d.value[TIME_PLOT]:0;g.properties().inputs.first_visible_bar_time.setValue(1E3*Math.floor(l))}"last_visible_bar_time"==h[k].id&&(l=c&&c.value?c.value[TIME_PLOT]:0,g.properties().inputs.last_visible_bar_time.setValue(1E3*Math.floor(l)))}}};
W79.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault();this.recalculateAllPanes();this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19());this.D20(new A22(A22.LIGHT_UPDATE))};W79.prototype.restoreTimeScaleState=function(a){this.m_timeScale.restoreState(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.restoreFactoryDefaults=function(a){a.restoreFactoryDefaults();this.recalcVisibleRangeStudy(this.D19(),!0);this.mainSeries().onChartStyleChanged()};
W79.prototype.setSelectedSource=function(a,b){if(!(this.m_selectedSource===a&&this._lastHittestData===b||a&&a.customization&&a.customization.disableSelection)){this._lastHittestData=b;var c=new A22;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),this.paneForSource(this.m_selectedSource));this.m_selectedSource=a;this._selectedSourceChanged.fire(a);a&&(a.updateAllViews(),this.paneForSource(a),a.hasAlert.value()&&TradingView.alertsDispatcher&&a.getAlert(function(a){TradingView.alertsDispatcher.alertSelected.setValue(a)},
!0));c.force=!0;this.D20(new A22(A22.LIGHT_UPDATE));this.setHoveredSource(a,b)}};W79.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof W47&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))};W79.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged};
W79.prototype.setHoveredSource=function(a,b){if(this.m_hoveredSource!==a||this._lastHittestData!==b){this._lastHittestData=b;var c=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),c||(c=new A22),c.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),A22.LIGHT_UPDATE)));if(this.m_hoveredSource=a)a.updateAllViews(),c||(c=new A22),c.merge(this._paneInvalidationMask(this.paneForSource(a),
A22.LIGHT_UPDATE));c&&this.D20(c)}};W79.prototype.selectedSource=function(){return this.m_selectedSource};W79.prototype.hoveredSource=function(){return this.m_hoveredSource};W79.prototype.lastHittestData=function(){return this._lastHittestData};W79.prototype.D20=function(a){this._invalidateHandler&&this._invalidateHandler(a)};
W79.prototype.D19=function(){var a=[];a.push(this.m_crossHairSource);for(var b=0;b<this.m_panes.size();++b)a=a.concat(this.m_panes.item(b).D19().toArray());return new List(a)};W79.prototype.dataSourceForId=function(a){for(var b,c=0;c<this.m_panes.size();++c)if(b=this.m_panes.item(c).dataSourceForId(a))return b;return null};W79.prototype.children=function(a){for(var b=this.D19(),c=new List,d=0;d<b.size();d++){var e=b.item(d);e.ownerSource()===a&&c.append(e)}return c};
W79.prototype.setCurrentPosition=function(a,b,c,d){var e=NaN;a=Math.round(this.m_timeScale.coordinateToIndex(a));if(c){var g=c.defaultPriceScale();g.isEmpty()||(e=g.coordinateToPrice(b))}if(this._lineBeingCreated||W47.isLineTool(this.currentTool()))e=this._magnet.align(e,a,c);this.m_crossHairSource.setPosition(a,e,c);this.m_crossHairSource.dataWindowView().update();b=this.m_panes.toArray();for(c=b.length;c--;)for(var g=b[c].D19().toArray(),h=g.length;h--;){var k=g[h].dataWindowView();
k&&k.update()}this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:a,price:e},d),this._lineBeingCreated.updateAllViews(),this.D20(new A22(A22.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.D20(new A22(A22.LIGHT_UPDATE)):this.D20(new A22(A22.UPDATE_CURSOR_ONLY));d=this._undoModel.D4;d.D5&&
(e=this.m_timeScale.points().valueAt(a),isNaN(e)&&0<a&&(e=Infinity),d.D5.syncCrosshair(e,d))};W79.prototype.clearCurrentPosition=function(){this.crossHairSource().clearPosition();this.fullUpdate();var a=this._undoModel.D4;a.D5&&a.D5.syncCrosshair(NaN,a)};
W79.prototype.setExternalPosition=function(a){a=this.m_timeScale.points().closestIndexLeft(a);if(isFinite(a)){this.crossHairSource().setPosition(a,NaN,null);a=this.D19();for(var b=a.size();b--;){var c=a.item(b).dataWindowView();c&&c.update()}}else this.crossHairSource().visible=!1;this.D20(new A22(A22.UPDATE_CURSOR_ONLY))};
W79.prototype.updateTimeScale=function(a,b,c,d,e){if(e){this.m_timeScale.reset();e=this.D19();for(var g=0;g<e.size();g++)e.item(g).clearData&&e.item(g).clearData()}this.m_timeScale.update(a,b,c,d);this.recalculateAllPanes();this.updateBarsMarksSources();this.D20(new A22(A22.LIGHT_UPDATE))};W79.prototype.recalculatePane=function(a,b){a&&a.recalculate(b)};
W79.prototype.paneForSource=function(a){for(var b=this.m_panes.size()-1;0<=b;b--)if(this.m_panes.item(b).D19().contains(a))return this.m_panes.item(b);return a instanceof W96?this.paneForSource(this.m_mainSeries):null};W79.prototype.updateBarsMarksSources=function(){for(;0<this._barsMarksSources.length;)return this._barsMarksSources[0].updateTimeZone()};
W79.prototype.recalculateAllPanes=function(){for(var a=0;a<this.m_panes.size();++a)this.m_panes.item(a).recalculate();this.timeScale().recalcLockedScale();this.updateAllPaneViews()};W79.prototype._invalidateBarColorerCaches=function(){for(var a=this.D19(),b=0;b<a.size();++b){var c=a.item(b);c instanceof TradingView.Series&&c.invalidateBarColorerCache()}};
W79.prototype.insertStudy=function(a,b,c){var d=null;TradingView.trackEvent("studies","Study_"+a.id);c||a.is_price_study?d=this.paneForSource(this.m_mainSeries):(d=this.createPane(void 0,!0),b&&b.paneSize&&d.setPaneSize(b.paneSize));"Compare@tv-basicstudies"==a.id&&(TradingView.trackEvent("compare","symbol:"+b.inputs.symbol),this.m_mainSeries.priceScale().properties().log.setValue(!1),this.m_mainSeries.priceScale().properties().percentage.setValue(!0));b=TradingView.prepareStudyProperties(a,
b,d,this.studyVersioning());b=TradingView.createStudy(this,b,this.mainSeries(),a);b.start();var e=b.metaInfo().priceScale||TradingView.StudyConsts.SCALE_RIGHT;e===TradingView.StudyConsts.SCALE_RIGHT?e=d.rightPriceScale():e===TradingView.StudyConsts.SCALE_LEFT?e=d.leftPriceScale():a.is_price_study?e=null:(console.warn("Cannot add study "+b.metaInfo().id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),e=d.rightPriceScale());c?(d.addDataSource(b,null),"Volume@tv-basicstudies"==
a.id&&(a=b.priceScale(),a.setTopMargin(.75),a.setBottomMargin(0))):d.addDataSource(b,e);b.properties().linkedToSeries&&b.properties().linkedToSeries.value()&&b.setOwnerSource(this.mainSeries());this.recalculatePane(d);this.D20(new A22(A22.FULL_UPDATE));this._invalidateBarColorerCaches();this.recalcVisibleRangeStudy(this.D19(),!0);return b};
W79.prototype.replaceStudyStub=function(a,b){var c=this.paneForSource(a);if(void 0==c)return!1;var d=a.isNoScale()?null:a.priceScale(),e=a.zorder(),g=a.ownerSource();c.addDataSource(b,d);b.setOwnerSource(g);b.setZorder(e);this.removeSource(a);b.start();this.recalculatePane(c);this.D20(new A22(A22.FULL_UPDATE));return!0};
W79.prototype.insertStudyStub=function(a){var b=this.mainSeries(),b=this.paneForSource(b);a=new TradingView.StudyStub(this,null,a);b.addDataSource(a,null);this.recalculatePane(b);this.D20(new A22(A22.FULL_UPDATE));return a};W79.prototype.removeStudyStub=function(a){var b=this.dataSourceForId(a);if(void 0==b)return console.info("StudyStub id="+a+" is not found in chart model"),!1;this.removeSource(b);return!0};
W79.prototype.detachSource=function(a,b){var c=this.paneForSource(a);if(c){c.removeDataSource(a);if(c.isEmpty())return this._lineBeingCreated&&c==this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(c,b),!0;this.D20(new A22(A22.FULL_UPDATE));return!1}};
W79.prototype.removeSource=function(a,b){a===this.m_selectedSource&&this.setSelectedSource(null);a.stop&&a.stop();var c=this.detachSource(a,b);if(a.metaInfo&&a.metaInfo()&&"Compare@tv-basicstudies"===a.metaInfo().id){for(var d=this.paneForSource(this.m_mainSeries),e=0;e<d.D19().size();e++)if(d.D19().item(e).metaInfo&&"Compare@tv-basicstudies"===d.D19().item(e).metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}this.D20(new A22(A22.FULL_UPDATE));
this._invalidateBarColorerCaches();return c};
W79.prototype.move=function(a,b,c){var d=new List,e=this.children(a);d.append(a);d.appendAll(e);var g=this.paneForSource(a);this.panes().indexOf(g);g.state();g.priceScaleName(a.priceScale());this.panes().indexOf(b);b&&b.state();c=b?b.priceScaleName(c):"right";if(g===b)for(b.move(a,b.priceScaleByName(c)),d=a.priceScale(),a=0;a<e.size();a++)b.move(e.item(a),d);else{for(a=0;a<d.size();a++)this.detachSource(d.item(a));b=b?b:this.createPane();for(a=0;a<d.size();a++)b.addDataSource(d.item(a),b.priceScaleByName(c));
this.D20(new A22(A22.FULL_UPDATE))}this.recalculateAllPanes()};W79.prototype.isSingleInstanceLineTool=function(a){return"LineStudyMtpRiskReward"==a||"LineStudyMtpAnalysis"==a?!0:!1};
W79.prototype.createLineTool=function(a,b,c,d){TradingView.trackEvent("GUI","Add Line Tool");var e=TradingView[c];if(!e)return null;this.isSingleInstanceLineTool(c)&&this._undoModel.removeAllDrawingTools(c);TradingView.trackEvent("drawings","Study_Drawing_"+c);d=new e(this,d);d.toolname=c;d.setOwnerSource(a.mainDataSource());var g=a.defaultPriceScale();a.addDataSource(d,g);c=this.m_timeScale.indexToCoordinate(b.index);g=g.priceToCoordinate(b.price);d.isFixed()?b=d.addFixedPoint(new MathEx.Point(c,
g)):(e.skipMagnetting||(b.price=this._magnet.align(b.price,b.index,a)),b=d.addPoint(b));b||(this._lineBeingCreated=d,this._paneBeingCreatedLineOn=a);this.D20(new A22(A22.FULL_UPDATE));return d};W79.prototype.lineBeingCreated=function(){return this._lineBeingCreated};W79.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn};
W79.prototype.coninueCreatingLine=function(a,b){var c=this.paneForSource(this._lineBeingCreated);c.defaultPriceScale();a.price=this._magnet.align(a.price,a.index,c);c=this._lineBeingCreated.addPoint(a,b);this._lineBeingCreated.updateAllViews();var d=new A22(A22.LIGHT_UPDATE);c&&(this._lineBeingCreated=this._paneBeingCreatedLineOn=null,d.force=!0);this.D20(d);return c};
W79.prototype.cancelCreatingLine=function(){this._lineBeingCreated&&(this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire())};
W79.prototype.startChangingLinetool=function(a,b,c,d){this._lineBeingEdited=a;this._linePointBeingEdited=c;this._lineBeingEdited.startChanging(c,b);a=this.paneForSource(a);b.price=this._magnet.align(b.price,b.index,a);this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(c,b);this._lineBeingEdited.setPoint(c,b,d);this._lineBeingEdited.updateAllViews();b=this._paneInvalidationMask(a,A22.LIGHT_UPDATE);b.force=!0;this.D20(b)};
W79.prototype.lineBeingEdited=function(){return this._lineBeingEdited};W79.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited};
W79.prototype.changeLinePoint=function(a,b){var c=this.paneForSource(this._lineBeingEdited);if(void 0!==a.x&&void 0!==a.y){var d=this._lineBeingEdited.priceScale().coordinateToPrice(a.y),e=Math.round(this.timeScale().coordinateToIndex(a.x)),d=this._magnet.align(d,e,c);this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:d,index:e},b)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,a,b);this._lineBeingEdited.updateAllViews();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.endChangingLinetool=function(){this.paneForSource(this._lineBeingEdited);this._lineBeingEdited.endChanging();this._linePointBeingEdited=this._lineBeingEdited=null;var a=new A22(A22.LIGHT_UPDATE);a.force=!0;this.D20(a)};
W79.prototype.startMovingSource=function(a,b,c){this._sourceBeingMoved=a;this._linePointBeingMoved=c;this._sourceBeingMoved.startMoving(b,c);a=this.paneForSource(this._sourceBeingMoved);a=this._paneInvalidationMask(a,A22.LIGHT_UPDATE);a.force=!0;this.D20(a)};W79.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved};
W79.prototype.moveSource=function(a){this._sourceBeingMoved.move(a,this._linePointBeingMoved);this.paneForSource(this._sourceBeingMoved);this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.endMovingSource=function(){var a=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving();this._linePointBeingMoved=this._sourceBeingMoved=null;a=this._paneInvalidationMask(a,A22.LIGHT_UPDATE);a.invalidateAll(A22.LIGHT_UPDATE);a.force=!0;this.D20(a)};W79.prototype.calculateDefaultTags=function(){for(var a=[],b=this.D19(),c=0;c<b.size();c++){var d=b.item(c);d.tags&&(a=a.concat(d.tags()))}return a};
W79.prototype.changeZOrder=function(a,b){this.paneForSource(a).changeZOrder(a,b);this.D20(new A22(A22.FULL_UPDATE))};W79.prototype.sendToBack=function(a){this.paneForSource(a).sendToBack(a);this.D20(new A22(A22.FULL_UPDATE))};W79.prototype.bringToFront=function(a){this.paneForSource(a).bringToFront(a);this.D20(new A22(A22.FULL_UPDATE))};
W79.prototype.onTagsChanged=function(){return this._tagsChanged};W79.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()};W79.prototype.setTimeViewport=function(a,b){this.timeScale().zoomToBarsRange(a,b);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
W79.prototype.zoomToViewport=function(a,b,c,d,e){this.setTimeViewport(a,b);a=Math.min(c,d);c=Math.max(c,d);d=e.defaultPriceScale();d.setAutoScale(!1);d.isLog()&&(a=d.priceToLogical(a),c=d.priceToLogical(c));d.setPriceRange(new PriceRange(a,c));this.recalculateAllPanes();this.D20(this._paneInvalidationMask(e,A22.LIGHT_UPDATE))};W79.prototype.clearAllStudies=function(){for(var a=this.D19(),b=0;b<a.size();b++)a.item(b).clearData&&a.item(b).clearData()};
W79.prototype.allLineTools=function(){for(var a=new List,b=this.m_panes,c=b.size(),d=0;d<c;++d)for(var e=b.item(d).D19(),g=e.size(),h=0;h<g;++h){var k=e.item(h);isInherited(k.constructor,W47)&&a.append(k)}return a};W79.prototype.backgroundColor=function(){return this.D2.paneProperties.background._value};W79.prototype.backgroundCounterColor=function(){return(new RGBColor(this.backgroundColor())).blackWhiteContrast()};
W79.prototype.isDark=function(){return"white"===this.backgroundCounterColor()};W79.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()};W79.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()};
W79.prototype.updateAllVolumeStudies=function(){for(var a=this.m_panes.toArray(),b=a.length;b--;)for(var c=!1,d=a[b],e=d.D19().toArray(),g=e.length;g--;){var h=e[g];h instanceof TradingView.Study&&"Volume"===h.metaInfo().shortId&&(h.updateAllViews(),c||(this.updatePane(d),c=!0))}};
W79.prototype._prepareAlertsList=function(){function a(){var a=g.mainSeries().symbolInfo()?g.mainSeries().symbolInfo().full_name:null,e=g.mainSeries().properties().interval.value();a&&e&&is_authenticated?TradingView.alertsDispatcher.requestList(function(a){for(;g._alertsList.size();)d(g._alertsList.item(0));for(var b=0;b<a.length;b++)c(a[b])},function(){},{symbol:a,resolution:e,activeOnly:!0}):b()}function b(){for(var a=g._alertsList.toArray(),b=0;b<a.length;b++)d(a[b].id())}function c(a){if(a instanceof
TradingView.Alert){var b=g._alertsList.find(function(b){return b.id()===a.id()});b&&d(b);(a.active()||a.fake())&&(g.mainSeries().symbolInfo()?g.mainSeries().symbolInfo().full_name:null)===a.symbol()&&(g._alertsList.append(a),g._alertsList.onAdd.fire(a))}}function d(a){var b=a instanceof TradingView.Alert?a.id():a.id||a;if(a=g._alertsList.find(function(a){return a.id()===b}))g._alertsList.removeAll(function(a){return a.id()===b}),g._alertsList.onRemove.fire(a)}function e(e){TradingView.alertsDispatcher.alertCreatingStarted[e](g,
c);TradingView.alertsDispatcher.alertRunning[e](g,c);TradingView.alertsDispatcher.alertDeletingStarted[e](g,d);TradingView.alertsDispatcher.alertDeletingAllStarted[e](g,b);TradingView.alertsDispatcher.alertDeleted[e](g,d);TradingView.alertsDispatcher.alertStoppingStarted[e](g,d);TradingView.alertsDispatcher.alertStoppingAllStarted[e](g,b);TradingView.alertsDispatcher.alertStopped[e](g,d);g.mainSeries().onSymbolResolved()[e](g,a);g.mainSeries().onSymbolError()[e](g,b);g.mainSeries().properties().interval[e](g,
a)}var g=this;g._alertsList.add=c;g._alertsList.remove=d;loginStateChange.subscribe(g,function(){is_authenticated?(a(),e("subscribe")):(b(),e("unsubscribe"))});is_authenticated&&(a(),e("subscribe"))};W79.prototype.alertsList=function(){return this._alertsList};W79.prototype._modelIntervals=[];W79.prototype.setInterval=function(a,b){var c=setInterval(a,b);this._modelIntervals.push(c);return c};
W79.prototype.clearInterval=function(a){clearInterval(a);a=this._modelIntervals.indexOf(a);-1<a&&this._modelIntervals.splice(a,1)};W79.prototype.clearIntervals=function(){for(var a=0;a<this._modelIntervals.length;a++)clearInterval(this._modelIntervals[a]);this._modelIntervals=[]};W79.prototype.destroy=function(){this.clearIntervals()};
W79.prototype.countUserStudies=function(){for(var a=0,b=0;b<this.panes().size();b++)for(var c=this.panes().item(b).D19(),d=0;d<c.size();d++){var e=c.item(d);e instanceof TradingView.Study&&e.showInObjectTree()&&a++}return a};W79.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()};function DataWindowItem(a,b){this.m_title=a;this.m_value=b;this._visible=!0;this._color=void 0}DataWindowItem.prototype.title=function(){return this.m_title};DataWindowItem.prototype.text=function(){return this.m_value};DataWindowItem.prototype.visible=function(){return this._visible};DataWindowItem.prototype.color=function(){return this._color};DataWindowItem.prototype.setVisible=function(a){this._visible=a};DataWindowItem.prototype.setValue=function(a){this.m_value=a};
DataWindowItem.prototype.setColor=function(a){this._color=a};DataWindowItem.prototype.value=function(){return this.m_value};function DataWindowView(){this._title=this._header="";this._items=new List}DataWindowView.prototype.header=function(){return this._header};DataWindowView.prototype.title=function(){return this._title};DataWindowView.prototype.items=function(){return this._items};DataWindowView.prototype.update=function(){};function StatusView(a){this._props=a;this._text="";this._size="12px";this._bold=!1}StatusView.prototype.text=function(){return this._text};StatusView.prototype.setText=function(a){this._text=a};StatusView.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#444"};StatusView.prototype.bold=function(){return this._bold};StatusView.prototype.size=function(){return this._size};function PriceAxisView(){this._text="";this._background="#585858";this._coordinate=0}PriceAxisView.prototype.text=function(){return this._text};PriceAxisView.prototype.background=function(){return this._background};PriceAxisView.prototype.color=function(){return(new RGBColor(this._background)).blackWhiteContrast()};PriceAxisView.prototype.coordinate=function(){return this._coordinate};function PriceAxisViewRenderer(a,b){this._data=a;this._data.borderColor||(this._data.borderColor=this._data.background);this._textWidthCache=b}PriceAxisViewRenderer.prototype.height=function(a){return this._data.secondLine&&a?2.2*this._data.textHeight+2:1.1*this._data.textHeight};PriceAxisViewRenderer.prototype.measureText=function(a,b){return this._textWidthCache?this._textWidthCache.measureText(a,b):a.measureText(b).width};
PriceAxisViewRenderer.prototype.draw=function(a,b,c,d){function e(a,b,c,d){$.browser.webkit?--d:$.browser.mozilla?d+=1:$.browser.jsdom&&(d+=.5);a.fillText(b,c,d)}if(this._data.visible){if(this._data.font){var g=a.font;a.setFont(this._data.font)}var h=this.measureText(a,this._data.text);a.strokeStyle=this._data.borderColor;a.fillStyle=this._data.background;a.lineWidth=1;d=Math.round(1.1*this._data.textHeight);var k=this._data.coordinate,l=Math.round(k-.5*d)-.5,m=l,n=m+d+1,q=n;if(this._data.text){if(b){var r=
c-1.5,u=r-h-9-2,w=u,A=c=r,v=A-3;a.beginPath();a.moveTo(r,l);a.lineTo(u,m);a.lineTo(w,n);a.lineTo(c,q);a.fill();a.beginPath();a.strokeStyle=this._data.color;a.moveTo(A,k);a.lineTo(v,k);a.stroke();a.textBaseline="middle";a.textAlign="left";a.fillStyle=this._data.color;A=r-h-.4*d}else r=.5,w=u=r+h+9+2,A=c=r,v=A+3,a.beginPath(),a.moveTo(r,l),a.lineTo(u,m),a.lineTo(w,n),a.lineTo(c,q),a.fill(),a.beginPath(),a.strokeStyle=this._data.color,a.moveTo(A,k),a.lineTo(v,k),a.stroke(),a.textBaseline="middle",a.textAlign=
"left",a.fillStyle=this._data.color,A=r+.4*d;e(a,this._data.text,A,k+1);this._data.font&&a.setFont(g)}this._data.secondLine&&(g=this.measureText(a,this._data.secondLine),a.fillStyle=this._data.background,this._data.text&&(l=n+1,m=q+1,n=l+d,q=m+d),b?(c=r=r-h-9-2,u=r+g+4+3):(c=r=.5+h-g+4,u=h+9+2+.5),w=u,A=r+2,a.beginPath(),a.moveTo(r,l),a.lineTo(u,m),a.lineTo(w,n),a.lineTo(c,q),a.fill(),a.textBaseline="middle",a.textAlign="left",a.fillStyle=this._data.color,b=this._data.coordinate,this._data.text&&
(b+=d+2),e(a,this._data.secondLine,A,b))}};function TimeAxisView(){this._text="";this._background="#585858";this._coordinate=0}TimeAxisView.prototype.text=function(){return this._text};TimeAxisView.prototype.background=function(){return this._background};TimeAxisView.prototype.color=function(){return(new RGBColor(this._background)).blackWhiteContrast()};TimeAxisView.prototype.coordinate=function(){return this._coordinate};function TimeAxisViewRenderer(a){this._data=a}
TimeAxisViewRenderer.prototype.draw=function(a,b,c){if(!1!==this._data.visible&&(this._cacheFont!=a.font&&(this._cacheFont=a.font,this._cache=new TextWidthCache),b=this._cache.measureText(a,this._data.text),!(0>=b))){c=b+6;b=Math.round(this._data.coordinate-.5*c-1.5)+1.5;c=b+c+3;var d=Math.round(this._data.coordinate+1),e=this._data.textHeight+6+.5;a.fillStyle=this._data.background;a.lineWidth=1;a.beginPath();a.moveTo(b,.5);a.lineTo(b,e);a.lineTo(c,e);a.lineTo(c,.5);a.fill();a.strokeStyle=this._data.color;
a.beginPath();a.moveTo(d,.5);a.lineTo(d,3.5);a.stroke();a.textBaseline="middle";a.textAlign="left";a.fillStyle=this._data.color;$.browser.webkit?a.fillText(this._data.text,b+3+1,.5*(.5+e)+1):a.fillText(this._data.text,b+3+1,.5*(.5+e)+2)}};function CrossHair(a,b){var c=this;DataSource.call(this);this.D2=b;this.D0=a;this._dataWindowView=new CrossHairDataWindowView(this,a);this._priceAxisView=new CrossHairPriceAxisView(this,a);this._startMeasurePriceAxisView=new CrossHairPriceAxisView(this,a,"measureStartY");this._endMeasurePriceAxisView=new CrossHairPriceAxisView(this,a,"measureEndY");this._timeAxisView=new CrossHairTimeAxisView(this,a);this._startMeasureTimeAxisView=new CrossHairTimeAxisView(this,a,"measureStartX");this._endMeasureTimeAxisView=
new CrossHairTimeAxisView(this,a,"measureEndX");this.visible=!0;a.readOnly()?this.areLinesVisible=!0:TradingView.drawingState.cursorTool.subscribe(function(a){c.areLinesVisible="arrow"!==a},{callWithLast:!0});this._subscribed=!1}inherit(CrossHair,DataSource);CrossHair.prototype.index=0;CrossHair.prototype.price=NaN;CrossHair.prototype.pane=null;CrossHair.prototype.color="white";CrossHair.prototype.style="";CrossHair.prototype.properties=function(){return this.D2};
CrossHair.prototype.setPosition=function(a,b,c){this._subscribed||(this.D0.mainSeries().onRestarted().subscribe(this,CrossHair.prototype.clearMeasure),this._subscribed=!0);this.index=a;this.x=this.D0.timeScale().indexToCoordinate(a);c&&!c.defaultPriceScale().isEmpty()?(this.price=b,this.y=c.defaultPriceScale().priceToCoordinate(b),this.pane=c):(this.y=this.price=NaN,this.pane=null);this.visible=!0;this.updateAllViews()};
CrossHair.prototype.clearPosition=function(){this.visible=!1;this.index=parseInt(this.D0.mainSeries().data().bars().last())};CrossHair.prototype.measureStartY=function(){var a=this._startMeasurePoint.price,b=this._measurePane;if(b.defaultPriceScale().isPercent())var c=b.mainDataSource().firstValue(),a=b.defaultPriceScale().priceRange().convertToPercent(a,c);return b.defaultPriceScale().priceToCoordinate(a)};CrossHair.prototype.measureStartX=function(){return this.D0.timeScale().indexToCoordinate(this._startMeasurePoint.index)};
CrossHair.prototype.measureEndY=function(){var a=this._endMeasurePoint.price,b=this._measurePane;if(b.defaultPriceScale().isPercent())var c=b.mainDataSource().firstValue(),a=b.defaultPriceScale().priceRange().convertToPercent(a,c);return b.defaultPriceScale().priceToCoordinate(a)};CrossHair.prototype.measureEndX=function(){return this.D0.timeScale().indexToCoordinate(this._endMeasurePoint.index)};
CrossHair.prototype.paneViews=function(a){var b=(new List).append(new $65(this,a,a===this.pane));a===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new $64(this,a)),this._measurePaneView.update(),b.append(this._measurePaneView));return b};CrossHair.prototype.dataWindowView=function(){return this._dataWindowView};
CrossHair.prototype.priceAxisViews=function(a,b){if(this.visible&&this.pane===a&&b===a.defaultPriceScale()){var c=new List;c.append(this._priceAxisView);this._startMeasurePoint&&c.append(this._startMeasurePriceAxisView);this._endMeasurePoint&&c.append(this._endMeasurePriceAxisView);return c}return null};
CrossHair.prototype.timeAxisView=function(){if(!this.visible)return null;var a=new List;a.append(this._timeAxisView);this._startMeasurePoint&&a.append(this._startMeasureTimeAxisView);this._endMeasurePoint&&a.append(this._endMeasureTimeAxisView);return a};
CrossHair.prototype.updateAllViews=function(){this._priceAxisView.update();this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update());this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update());this._timeAxisView.update()};CrossHair.prototype.startMeasurePoint=function(){return this._startMeasurePoint};
CrossHair.prototype.startMeasuring=function(a,b){if(b.defaultPriceScale().isPercent()){var c=b.mainDataSource().firstValue();a.price=b.defaultPriceScale().priceRange().convertFromPercent(a.price,c)}this._startMeasurePoint=a;this._measurePane=b};CrossHair.prototype.finishMeasure=function(a){var b=this._measurePane;if(b.defaultPriceScale().isPercent()){var c=b.mainDataSource().firstValue();a.price=b.defaultPriceScale().priceRange().convertFromPercent(a.price,c)}this._endMeasurePoint=a};
CrossHair.prototype.endMeasurePoint=function(){return this._endMeasurePoint};CrossHair.prototype.clearMeasure=function(a){delete this._measurePane;delete this._startMeasurePoint;delete this._endMeasurePoint;delete this._lastValidMeasurePoint;this.D0.D20(new A22(A22.LIGHT_UPDATE))};
CrossHair.prototype.measurePoints=function(){this.updateAllViews();var a=new List;a.append(this._startMeasurePoint);if(this._endMeasurePoint)a.append(this._endMeasurePoint);else{this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index});var b=this._lastValidMeasurePoint.rawPrice,c=this._measurePane,d=c.defaultPriceScale();d.isPercent()&&!d.isEmpty()&&(c=c.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=d.priceRange().convertFromPercent(b,
c));a.append(this._lastValidMeasurePoint)}return a};CrossHair.prototype.currentPoint=function(){return new MathEx.Point(this.x,this.y)};function $64(a,b){this.W99=a;this._pane=b;this._rendererCache={}}
$64.prototype.update=function(){if(this.W99._endMeasurePoint)var a=this.W99._endMeasurePoint.price,b=this.W99._endMeasurePoint.index;else if(this.W99._measurePane===this.W99.pane)a=this.W99.price,b=this.W99.index;else if(this.W99._lastValidMeasurePoint)a=this.W99._lastValidMeasurePoint.rawPrice,b=this.W99._lastValidMeasurePoint.index;else return;var c=a-this.W99._startMeasurePoint.price,d=b-this.W99._startMeasurePoint.index,
e=this.W99._startMeasurePoint.price,g=this.W99._measurePane;if(g.defaultPriceScale().isPercent()){var h=g.mainDataSource().firstValue();this.W99._endMeasurePoint&&(a=g.defaultPriceScale().priceRange().convertToPercent(a,h));e=g.defaultPriceScale().priceRange().convertToPercent(e,h)}this._horzLabel=$.t("{0} bars").format(d);d=this.W99._measurePane.defaultPriceScale().formatter().format(c);this.W99._startMeasurePoint.price&&(g=c/this.W99._startMeasurePoint.price,d+=" ("+(new PercentageFormatter).format(100*
g)+")");this._vertLabel=""+d;e=this.W99.D0._magnet.align(e,this.W99._startMeasurePoint.index,this.W99._measurePane);a=this.W99.D0._magnet.align(a,b,this.W99._measurePane);d=this.W99.D0.timeScale().indexToCoordinate(this.W99._startMeasurePoint.index);g=this.W99.D0.timeScale().indexToCoordinate(b);e=this.W99._measurePane.defaultPriceScale().priceToCoordinate(e);a=this.W99._measurePane.defaultPriceScale().priceToCoordinate(a);this._p1=new MathEx.Point(d,
e);this._p2=new MathEx.Point(g,a);a=this.W99.D0.timeScale().indexToUserTime(this.W99._startMeasurePoint.index);b=this.W99.D0.timeScale().indexToUserTime(b);a&&b&&(b=(b.valueOf()-a.valueOf())/1E3,this._horzLabel+=", "+(new TimeSpanFormatter).format(b));if(b=this.W99._measurePane.mainDataSource().base())c=Math.round(c*b),this._vertLabel+=" , "+c};
$64.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=(new List).append(this._p1).append(this._p2);b.width=this.W99.D0.timeScale().width();b.height=this.W99._measurePane.defaultPriceScale().height();b.color="#D3E7FF";b.linewidth=0;b.fillBackground=!0;b.transparency=60;b.backcolor="#BADAFF";a.append(new RectangleRenderer(b));var c=this._p1.add(this._p2).scaled(.5),d=new MathEx.Point(this._p1.x,c.y),e=new MathEx.Point(this._p2.x,c.y),d={points:(new List).append(d).append(e),
width:b.width,height:b.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_ARROW};a.append(new TrendLineRenderer(d));d=new MathEx.Point(c.x,this._p1.y);e=new MathEx.Point(c.x,this._p2.y);d={points:(new List).append(d).append(e),width:b.width,height:b.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_ARROW};a.append(new TrendLineRenderer(d));b=function(a,b){return{points:(new List).append(b),text:a,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:"Arial",offsetX:5,offsetY:0,bold:!1,italic:!1,fontsize:12,highlightBorder:!1,backgroundColor:"#646668",backgroundTransparency:20,backgroundVertInflate:5,backgroundHorzInflate:5}};c=c.add(new MathEx.Point(0,-10));c=b(this._horzLabel,c);a.append(new TextRenderer(c,this._rendererCache));c=this._p2.y;this._p1.y>this._p2.y&&
(c-=27);c=new MathEx.Point(.5*(this._p1.x+this._p2.x),c);c=b(this._vertLabel,c);a.append(new TextRenderer(c,this._rendererCache));return a};function $65(a,b,c){this.source=a;this.pane=b;this._horzVisible=c}$65.prototype.update=function(){};
$65.prototype.renderer=function(){var a={},b=this.source.visible&&this.source.areLinesVisible;a.horzLinesVisible=b&&this._horzVisible;a.vertLinesVisible=b;var c=(b=this.pane.D0.readOnly())?defaults("chartproperties.paneProperties.crossHairProperties"):null,d=TradingView.isMobile.any()&&W47.isLineTool(this.source.D0.currentTool()),e=d?"#a000a0":b?c.color:this.pane.D0.properties().paneProperties.crossHairProperties.color.value(),g=b?c.transparency:this.pane.D0.properties().paneProperties.crossHairProperties.transparency.value();
!d&&0<g&&(e=generateColor(e,g));a.color=e;a.lineWidth=b?c.width:this.pane.D0.properties().paneProperties.crossHairProperties.width.value();a.lineStyle=b?c.style:this.pane.D0.properties().paneProperties.crossHairProperties.style.value();a.drawCenter=d&&this.pane==this.source.pane;a.w=this.pane.width();a.h=this.pane.height();a.x=this.source.x;a.y=this.source.y;return new W62(a)};function W62(a){this.data=a}
W62.prototype.draw=function(a){var b=this.data.vertLinesVisible,c=this.data.horzLinesVisible;if((b||c)&&this.data){a.lineStyle=this.data.lineStyle;a.lineWidth=this.data.lineWidth;a.strokeStyle=this.data.color;var d=0==this.data.lineWidth%2?.5:0,e=this.data.x+1+d,d=this.data.y+d,g=this.data.w,h=this.data.h;b&&0<=e&&CanvasEx.drawLine(a,e,0,e,h);c&&0<=d&&CanvasEx.drawLine(a,0,d,g,d);this.data.drawCenter&&(a.beginPath(),a.arc(e,d,3,0,2*Math.PI,!0),a.fillStyle=this.data.color,a.fill())}};function CrossHairPriceAxisView(a,b){this._crossHair=a;this.D0=b;this._rendererData={background:"#585858",color:"white",textHeight:14,visible:!0};this._defaultFormatter=new PriceFormatter(100)}inherit(CrossHairPriceAxisView,PriceAxisView);
CrossHairPriceAxisView.prototype.update=function(){var a=this._rendererData,b=this._crossHair.pane;a.coordinate=this._crossHair.y;this.text="";if(b&&this._crossHair.visible&&(b=b.defaultPriceScale(),!b.isEmpty())){var c;c=(c=b.mainSource())?c.formatter():this._defaultFormatter;a.text=c.format(this._crossHair.price);a.textHeight=b.m_markBuilder.fontHeight()}};CrossHairPriceAxisView.prototype.renderer=function(){this._renderer||(this._renderer=new PriceAxisViewRenderer(this._rendererData));return this._renderer};function CrossHairTimeAxisView(a,b){TimeAxisView.call(this);this._crosshair=a;this.D0=b;this._rendererData={visible:!1,background:"#585858",color:"white",textHeight:14,text:""}}inherit(CrossHairTimeAxisView,TimeAxisView);
CrossHairTimeAxisView.prototype.update=function(){var a=this._rendererData;this.D0.timeScale();a.coordinate=this._crosshair.x;var b=this.D0.timeScale().indexToUserTime(this._crosshair.index);b?(a.visible=!0,a.text=(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(b)):(a.visible=!1,a.text="")};CrossHairTimeAxisView.prototype.renderer=function(){var a=this._rendererData;this._renderer||(this._renderer=new TimeAxisViewRenderer(a));return this._renderer};function CrossHairDataWindowView(a,b){DataWindowView.call(this);this._header=null;this._crossHair=a;this.D0=b;this._items.append(new DataWindowItem("Date",""));this._items.append(new DataWindowItem("Time",""));this._items.append(new DataWindowItem("Price",""));this._defaultFormatter=new PriceFormatter(100)}inherit(CrossHairDataWindowView,DataWindowView);
CrossHairDataWindowView.prototype.update=function(){var a=this.D0.mainSeries().isDWM();this._items.item(1).setVisible(!a);this._items.item(0).setValue("n/a");this._items.item(1).setValue("n/a");this._items.item(2).setValue("n/a");if(!this.D0.timeScale().isEmpty()){var b=this._crossHair.index,b=this.D0.timeScale().indexToUserTime(b);null===b?(this._items.item(0).setValue("n/a"),a||this._items.item(1).setValue("n/a")):(this._items.item(0).setValue((new DateFormatter).format(b)),a||this._items.item(1).setValue((new TimeFormatter).format(b)));
if(a=this._crossHair.pane)a=a.defaultPriceScale(),a.isEmpty()||(a=(a=a.mainSource())?a.formatter():this._defaultFormatter,this._items.item(2).setValue(a.format(this._crossHair.price)))}};function MAMetaInfo(){return new StudyMetaInfo({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})}
function VolumeMetaInfo(){return new StudyMetaInfo({id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}})}
function DMMetaInfo(){return new StudyMetaInfo({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})}
function RSIMetaInfo(){return new StudyMetaInfo({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})}function makeDefaultChartModel(a,b,c,d,e,g,h,k){a=new W78(a,b,c,d,e,g,h,k);a.model().D20(new A22(A22.FULL_UPDATE));return a};function Grid(){this.horzLinesVisible=this.visible=!0;this.horzLinesColor="white";this.horzLinesStyle="";this.vertLinesVisible=!0;this.vertLinesColor="white";this.vertLinesStyle=""}Grid.prototype.paneViews=function(a){return(new List).append(new $83(this,a))};function $83(a,b){this.source=a;this.pane=b}$83.prototype.update=function(){};
$83.prototype.renderer=function(){var a={};if(this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty())return null;a.horzLinesVisible=!0;a.vertLinesVisible=!0;a.horzLinesColor=this.pane.D0.properties().paneProperties.gridProperties.color.value();a.vertLinesColor=a.horzLinesColor;a.lineStyle=this.pane.D0.properties().paneProperties.gridProperties.style.value();a.priceMarks=this.pane.defaultPriceScale().marks();a.timeMarks=this.pane.timeScale().marks();a.w=this.pane.width();
a.h=this.pane.height();return new W65(a)};function W65(a){this.data=a}
W65.prototype.draw=function(a){CanvasEx.setLineStyle(a,this.data.lineStyle);var b=a.lineStyle!=CanvasEx.LINESTYLE_SOLID&&!("setLineDash"in a||"mozDash"in a||"webkitLineDash"in a),c=b?CanvasEx.computeDashPattern(a):null,d;a.translate(.5,-.5);a.lineWidth=1;if(this.data.vertLinesVisible){a.fillStyle=this.data.vertLinesColor;a.beginPath();for(d=0;d<this.data.timeMarks.length;d++)b?a.dashedLineTo(this.data.timeMarks[d].coord,0,this.data.timeMarks[d].coord,this.data.h,c):a.rect(this.data.timeMarks[d].coord,
0,1,this.data.h);a.closePath();a.fill()}if(this.data.horzLinesVisible){a.fillStyle=this.data.horzLinesColor;a.beginPath();for(d=0;d<this.data.priceMarks.length;d++)b?a.dashedLineTo(0,this.data.priceMarks[d].coord,this.data.w,this.data.priceMarks[d].coord,c):a.rect(0,this.data.priceMarks[d].coord,this.data.w,1);a.closePath();a.fill()}};function Watermark(a){function b(){var b=c.width(),d=c.height();return{draw:function(c){var m=a.symbolInfo();if(m){c.fillStyle=g.color.value();var n=(100-g.transparency.value())/100;if(0!==n){c.globalAlpha=n;for(var m=[{text:m.name?m.name+", "+translatedIntervalString(a.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:m.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],q=n=0;q<m.length;q++){var r=m[q];if(r.text){c.font=
r.font;var u=c,w=r.text,A=u.font;e.hasOwnProperty(A)||(e[A]={});textWidth=e[A].hasOwnProperty(w)?e[A][w]:e[A][w]=u.measureText(w).width;textWidth>b?(r.zoom=b/textWidth,textWidth=b):r.zoom=1;r.offsetLeft=(b-textWidth)/2;n+=r.lineHeight*r.zoom}}n=Math.max((d-n)/2,0);for(q=0;q<m.length;q++)r=m[q],r.text&&(c.save(),c.font=r.font,c.translate(r.offsetLeft,n),c.scale(r.zoom,r.zoom),c.fillText(r.text,0,r.baselineOffset),c.restore(),n+=r.lineHeight*r.zoom)}}}}}var c=null,d=new Function,e={},g=a.model().properties().symbolWatermarkProperties;
this.paneViews=function(a){if(!a.containsMainSeries())return new List;c=a;return(new List).append({renderer:b,update:d})}};function Legend(){this.m_items=new List}Legend.prototype.items=function(){return this.m_items};function LegendItem(a,b){this.m_title=b;this.m_color="white";this.m_dataSource=a}LegendItem.prototype.title=function(){return this.m_title};LegendItem.prototype.color=function(){return this.m_color};LegendItem.prototype.dataSource=function(){return this.m_dataSource};function W75(a,b,c){var d=this;this.m_timeScale=a;a=b.rightAxisProperties.state();a.autoScale=!0;this.m_rightPriceScale=new W76(new Property(a));this.m_rightPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});this.m_rightPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});
a=b.leftAxisProperties.state();a.autoScale=!0;this.m_leftPriceScale=new W76(new Property(a));this.m_leftPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});this.m_leftPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});
this.m_dataSources=new List;this.m_legend=new Legend;this.m_width=this.m_height=0;this.m_mainDataSource=null;this.D2=b;this.D0=c;this._tagsChanged=new Delegate;b.topMargin.listeners().subscribe(this,W75.prototype._updateMargins);b.bottomMargin.listeners().subscribe(this,W75.prototype._updateMargins);this._updateMargins();this._stretchFactor=W75.DEFAULT_STRETCH_FACTOR}W75.DEFAULT_STRETCH_FACTOR=1E3;W75.PANE_ANIMATION_DURATION=500;
W75.alwaysTopSources=["LineToolOrder","LineToolPosition","LineToolExecution"];W75.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,"Script$TV_DIVIDENDS@tv-scripting":1,"Script$TV_SPLITS@tv-scripting":2,"Script$TV_EARNINGS@tv-scripting":3};W75.prototype.destroy=function(){this.D2.topMargin.listeners().unsubscribe(this,W75.prototype._updateMargins);this.D2.bottomMargin.listeners().unsubscribe(this,W75.prototype._updateMargins)};
W75.prototype.setPaneSize=function(a){var b={large:1,medium:.6,small:.3,tiny:.15};if(!b[a])throw"Unknown size enum value: "+a;this._stretchFactor=b[a]*W75.DEFAULT_STRETCH_FACTOR};
W75.sortSources=function(a){a.sort(function(a,b){if(0<=W75.alwaysTopSources.indexOf(a._constructor))return 1;if(0<=W75.alwaysTopSources.indexOf(b._constructor))return-1;var c=a.zorder(),d=b.zorder();d==c&&(c=d-1,a.setZorder(c));return c-d});var b=[],c=[],d;for(d in W75.sortSourcesPreOrdered)c.push(null);d=0;for(var e=a.length;d<e;d++){var g=a[d];if(isFunction(g.metaInfo)){var h=g.metaInfo().id,h=W75.sortSourcesPreOrdered[h];0<h?c[h]=g:b.push(g)}else b.push(g)}d=0;for(e=c.length;d<e;d++)(g=c[d])&&
b.push(g);return b};
W75.prototype._updateMargins=function(){var a=.01*this.D2.topMargin.value(),b=.01*this.D2.bottomMargin.value();this.m_leftPriceScale.setTopMargin(a);this.m_leftPriceScale.setBottomMargin(b);this.m_rightPriceScale.setTopMargin(a);this.m_rightPriceScale.setBottomMargin(b);for(var c=0;c<this.m_dataSources.size();c++){var d=this.m_dataSources.item(c);d instanceof TradingView.Study&&this.isOverlay(d)&&"Volume"!==d.metaInfo().shortId&&d.priceScale()&&d.priceScale()!==this.m_leftPriceScale&&
d.priceScale()==this.m_rightPriceScale&&(d.priceScale().setTopMargin(a),d.priceScale().setBottomMargin(b),this.recalculatePriceScale(d.priceScale()))}this.recalculatePriceScale(this.m_leftPriceScale);this.recalculatePriceScale(this.m_rightPriceScale);this.updateAllViews()};W75.prototype.model=function(){return this.D0};W75.prototype.width=function(){return this.m_width};W75.prototype.height=function(){return this.m_height};W75.prototype.setWidth=function(a){this.m_width=a;this.updateAllViews()};
W75.prototype.setHeight=function(a){this.m_height=a;this.m_leftPriceScale.setHeight(a);this.m_rightPriceScale.setHeight(a);for(var b=0;b<this.m_dataSources.size();b++){var c=this.m_dataSources.item(b);this.isOverlay(c)&&c.priceScale()&&c.priceScale().setHeight(a)}this.updateAllViews()};W75.prototype.leftPriceScale=function(){return this.m_leftPriceScale};W75.prototype.rightPriceScale=function(){return this.m_rightPriceScale};W75.prototype.timeScale=function(){return this.m_timeScale};
W75.prototype.D19=function(){return this.m_dataSources};W75.prototype.isOverlay=function(a){return a._isOverlay};W75.prototype.legend=function(){return this.m_legend};
W75.prototype._processMainSourceChange=function(){var a;if(null===this.m_mainDataSource)for(var b=0;b<this.m_dataSources.size();b++){var c=this.m_dataSources.item(b);if(!(!isInherited(c.constructor,PriceDataSource)||this.isOverlay(c)||c.properties().linkedToSeries&&c.properties().linkedToSeries.value()||c instanceof TradingView.AlertLabel)){this.m_mainDataSource=c;a=!0;break}}if(this.m_mainDataSource&&a){a=[];for(b=0;b<this.m_dataSources.size();b++)c=this.m_dataSources.item(b),isInherited(c.constructor,
W47)&&a.push(c);a=W75.sortSources(a);for(b=0;b<a.length;b++)this.move(a[b],this.m_mainDataSource.priceScale())}else if(!this.m_mainDataSource)for(b=0;b<this.m_dataSources.size();b++)if(c=this.m_dataSources.item(b),isInherited(c.constructor,PriceDataSource)&&this.isOverlay(c)&&c.showInObjectTree()){this.m_mainDataSource=c;this.m_rightPriceScale.addDataSource(c);c.setPriceScale(this.m_rightPriceScale);for(var b=this.D0.children(c),d=0;d<b.size();d++)a=b.item(d),this.m_rightPriceScale.addDataSource(a),
a.setPriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_rightPriceScale);c._isOverlay=!1;break}};
W75.prototype.addDataSource=function(a,b){this.m_dataSources.append(a);var c=!1;null!==this.m_mainDataSource||a instanceof TradingView.AlertLabel||(this.m_mainDataSource=a,c=!0);a._isOverlay=!1;null===b&&(b=new W76(new Property(this.D2.overlayPropreties.state())),b.setHeight(this.m_height),b.setTopMargin(this.m_rightPriceScale.topMargin()),b.setBottomMargin(this.m_rightPriceScale.bottomMargin()),a._isOverlay=!0);b.addDataSource(a);a.setPriceScale(b);a.onTagsChanged&&a.onTagsChanged().subscribe(this,
W75.prototype.onSourceTagsChanged);a.setZorder(this.getZOrderMinMax().minZOrder-1);c&&this._processMainSourceChange();a instanceof TradingView.AlertLabel||this.updateAlertLabelsSources();this._tagsChanged.fire();isInherited(a.constructor,PriceDataSource)&&this.recalculatePriceScale(b);this.invalidateSourcesCache()};
W75.prototype.removeDataSource=function(a,b){if(this.m_dataSources.contains(a)){a._isOverlay=!1;this.m_dataSources.remove(a);a!==this.m_mainDataSource||b||(this.m_mainDataSource=null);var c=null;this.m_leftPriceScale.D19().contains(a)?(this.m_leftPriceScale.removeDataSource(a),c=this.m_leftPriceScale):this.m_rightPriceScale.D19().contains(a)&&(this.m_rightPriceScale.removeDataSource(a),c=this.m_rightPriceScale);a.onTagsChanged&&a.onTagsChanged().unsubscribe(this,W75.prototype.onSourceTagsChanged);
isInherited(a.constructor,PriceDataSource)&&this._processMainSourceChange();a instanceof TradingView.AlertLabel||this.D0.mainSeries()!==a||this.updateAlertLabelsSources();this._tagsChanged.fire();c&&isInherited(a.constructor,PriceDataSource)&&this.recalculatePriceScale(c);this.invalidateSourcesCache()}else TradingView.logDebug("removeDataSource: invalid data source")};
W75.prototype.updateAlertLabelsSources=function(){for(var a=this.containsMainSeries(),b=this.D0.alertsList(),c=$.map($.grep(this.D19().toArray(),function(a){return a instanceof TradingView.AlertLabel}),function(a){return a.alert().id()}),d=b.size()-1;0<=d;d--){var e=b.item(d),g=-1!==c.indexOf(e.id());if(!g&&(a||!e.isOHLC())){var h=new TradingView.AlertLabel(this.D0,e),k=this.rightPriceScale()||this.leftPriceScale();this.addDataSource(h,k)}g&&!a&&e.isOHLC()&&this.removeDataSource(new TradingView.AlertLabel(g))}};
W75.prototype.startScalePrice=function(a,b){a.startScale(b)};W75.prototype.scalePriceTo=function(a,b){a.scaleTo(b);this.updateAllViews()};W75.prototype.endScalePrice=function(a){a.endScale()};W75.prototype.startScrollPrice=function(a,b){a.startScroll(b)};W75.prototype.scrollPriceTo=function(a,b){a.scrollTo(b);this.updateAllViews()};W75.prototype.endScrollPrice=function(a){a.endScroll()};
W75.prototype.setPriceAutoScale=function(a,b){a.setAutoScale(b);this.timeScale().isEmpty()?a.setPriceRange(null):this.recalculatePriceScale(a)};W75.prototype.restorePriceScaleState=function(a,b){a.restoreState(b);this.updateAllViews()};W75.prototype.updateAllViews=function(){for(var a=0;a<this.D19().size();a++)this.D19().item(a).updateAllViews()};
W75.prototype.defaultPriceScale=function(){if(!this.m_mainDataSource)var a=this.rightPriceScale();this.m_mainDataSource&&(a=this.m_mainDataSource.priceScale());void 0==a&&(props=new Property(this.D2.overlayPropreties.state()),a=new W76(props));return a};W75.prototype._priceScaleIsPrice=function(a){return(a=a.mainSource())?isInherited(a.constructor,TradingView.Series)?!0:isInherited(a.constructor,TradingView.Study)?a.metaInfo().is_price_study:!1:!1};
W75.prototype.findSuitableScale=function(a){var b=!1;isInherited(a.constructor,TradingView.Study)?b=a.metaInfo().is_price_study:isInherited(a.constructor,TradingView.Series)&&(b=!0);if(b){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale};
W75.prototype.mainDataSource=function(){return this.m_mainDataSource};W75.prototype.recalculatePriceScale=function(a){if(a){if(a.isAutoScale()&&!this.timeScale().isEmpty()){var b=this.timeScale().visibleBars();a.recalculatePriceRange(b)}a.updatePaneViews()}};W75.prototype.resetPriceScale=function(a){var b=this.timeScale().visibleBars();a.mainSource()instanceof TradingView.Series&&a.mainSource().isLockScale()||a.setAutoScale(!0);a.recalculatePriceRange(b);this.updateAllViews()};
W75.prototype._recalculateImpl=function(){if(this._needRecalc){this.recalculatePriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_leftPriceScale);for(var a=0;a<this.m_dataSources.size();a++){var b=this.m_dataSources.item(a);this.isOverlay(b)&&this.recalculatePriceScale(b.priceScale())}this.updateAllViews();this.D0.updatePane(this);this._needRecalc=!1}};W75.prototype.recalculate=function(a){this._needRecalc=!0;a&&this._recalculateImpl()};
W75.prototype.isEmpty=function(){return null===this.m_mainDataSource};W75.prototype.move=function(a,b){var c=this.m_dataSources.clone();this.removeDataSource(a,null!==b);this.addDataSource(a,b);this.m_dataSources=c;this.invalidateSourcesCache()};W75.prototype.dataSourceForId=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};
W75.prototype.priceScaleForSource=function(a){return this.rightPriceScale().D19().contains(a)?this.rightPriceScale():this.leftPriceScale().D19().contains(a)?this.leftPriceScale():null};W75.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};W75.prototype.containsMainSeries=function(){return this.m_dataSources.contains(this.D0.mainSeries())};
W75.prototype.priceScaleByName=function(a){return"left"===a?this.m_leftPriceScale:"right"===a?this.m_rightPriceScale:null};W75.prototype.priceScaleName=function(a){return a===this.m_leftPriceScale?"left":a===this.m_rightPriceScale?"right":""};
W75.prototype.hitTestSources=function(){if(this._cachedHitTestSources)return this._cachedHitTestSources;for(var a=this.orderedSources(),b=[],c=[],d=0;d<a.length;d++){var e=a[d];isInherited(e.constructor,W47)?b.push(e):c.push(e)}return this._cachedHitTestSources=c.concat(b)};
W75.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0,c=this.D19().size();b<c;b++){var d=this.D19().item(b);isInherited(d.constructor,W47)&&!d.isActualSymbol()||a.push(d)}return this._cachedOrderedSoruces=a=W75.sortSources(a)};W75.prototype.invalidateSourcesCache=function(){this._cachedHitTestSources=this._cachedOrderedSoruces=null;this.m_leftPriceScale.invalidateSourcesCache();this.m_rightPriceScale.invalidateSourcesCache()};
W75.prototype.getZOrderMinMax=function(){for(var a=this.orderedSources(),b=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<a.length;d++){var e=a[d];e.showInObjectTree()&&(e.zorder()<b&&(b=e.zorder()),e.zorder()>c&&(c=e.zorder()))}return{minZOrder:b,maxZOrder:c}};W75.prototype.sendToBack=function(a){for(var b=this.getZOrderMinMax().minZOrder,b=Math.abs(a.zorder()-b),c=0;c<b;c++)this.changeZOrder(a,-1)};
W75.prototype.bringToFront=function(a){for(var b=this.getZOrderMinMax().maxZOrder,b=Math.abs(a.zorder()-b),c=0;c<b;c++)this.changeZOrder(a,1)};W75.prototype.changeZOrder=function(a,b){for(var c=this.orderedSources().filter(function(a){return a.showInObjectTree()}),d=0,e=0,g=c.length;e<g;e++)if(c[e]===a){d=e;break}0<d&&0>b?(g=c[d-1].zorder(),e=a.zorder(),c[d-1].setZorder(e),a.setZorder(g)):d<c.length-1&&0<b&&(g=c[d+1].zorder(),e=a.zorder(),c[d+1].setZorder(e),a.setZorder(g));this.invalidateSourcesCache()};
W75.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()};W75.prototype.onTagsChanged=function(){return this._tagsChanged};W75.prototype.dumpPriceScale=function(a){for(var b=new List,c=a.D19().clone(),d=0;d<c.size();++d){var e=c.item(d).priceAxisViews(this,a);e&&b.appendAll(e)}a=[];for(d=0;d<b.size();d++)a.push(b.item(d).dump());return a};
W75.prototype.dumpViews=function(){for(var a={paneViews:{}},b=this.orderedSources(),c=0;c<b.length;c++){var d=b[c];a.paneViews[c]=[];if(d=d.paneViews())for(var e=0;e<d.size();e++)a.paneViews[c].push(d.item(c).dump())}a.leftAxis=this.dumpPriceScale(this.m_leftPriceScale);a.rightAxis=this.dumpPriceScale(this.m_rightPriceScale);return a};W75.prototype.clearSeries=function(){for(var a=this.m_dataSources.size()-1;0<=a;a--)isInherited(this.m_dataSources.item(a).constructor,TradingView.Series)&&this.m_dataSources.removeAt(a)};
W75.prototype.actionNoScaleIsEnabled=function(a){return this.isOverlay(a)||!isInherited(a.constructor,PriceDataSource)?!0:1<this.D19().count(function(a){return a.properties().linkedToSeries&&a.properties().linkedToSeries.value()?!1:isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()&&!a.isNoScale()})};
W75.prototype.executionsPositionController=function(){this._executionsPositionController||(this._executionsPositionController=new ExecutionsPositionController(this,this.D0.timeScale()));return this._executionsPositionController};function optimalBarWidth(a){return.3*a}function selectionTolerance(a){return 2+.5*a}function paneRendererCoordinateIsValid(a){return null!==a&&void 0!==a&&!isNaN(a)}function W56(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.barWidth=optimalBarWidth(a.barSpacing);this.barLineWidth=Math.max(1,Math.round(this.barWidth));this.dontDrawOpen=a.dontDrawOpen}
W56.prototype.draw=function(a){a.save();a.translate(.5,.5);for(var b,c=0;c<this.bars.size();++c){var d=this.bars.item(c);b!==d.color&&(b=a.fillStyle=d.color);a.fillRect(Math.round(d.time-this.barLineWidth/2),Math.round(d.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(d.low-d.high+this.barWidth));this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||a.fillRect(Math.round(d.time-1.5*this.barWidth),Math.round(d.open-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)),
a.fillRect(Math.round(d.time),Math.round(d.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)))}a.restore()};W56.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var g=b.item(e);if(a.x<=g.time+c){d=g;break}}b=selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
function W70(a){this.bars=a.bars;this.barWidth=a.barWidth;this.barLineWidth=1}
W70.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(.5,.5);a.lineWidth=this.barLineWidth;for(var b=this.barWidth/2,c=0,d;c<this.bars.size();++c){d=this.bars.item(c);var e=d.exactTime-b,g=d.exactTime+b-e,h=Math.round(d.high),k=0==d.low-d.high?1:Math.round(d.low-d.high);a.fillStyle=d.borderColor;a.fillRect(e,h,g,k);a.fillStyle=d.color;a.fillRect(e+this.barLineWidth,h+this.barLineWidth,g-2*this.barLineWidth,k-2*this.barLineWidth)}a.restore()};
W70.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barWidth;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var g=b.item(e);if(a.x<=g.time+c){d=g;break}}b=selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};function W67(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.barLineWidth=Math.max(1,optimalBarWidth(a.barSpacing))}
W67.prototype.draw=function(a){a.save();a.lineCap="square";a.translate(.5,.5);for(var b=0;b<this.bars.size();++b){var c=this.bars.item(b),d=Math.round(.5*this.barLineWidth);c.isTwoColorBar?(a.fillStyle=c.upColor,a.fillRect(Math.round(c.exactTime-d),Math.round(c.high-d),Math.round(2*d),Math.round(c.additionalPrice-c.high+d)),a.fillStyle=c.downColor,a.fillRect(Math.round(c.exactTime-d),Math.round(c.additionalPrice),Math.round(2*d),Math.round(c.low-c.additionalPrice+d))):(a.fillStyle=c.color,
a.fillRect(Math.round(c.exactTime-d),Math.round(c.high-d),Math.round(2*d),Math.round(c.low-c.high)+2*d));c.combinedWithProjection||(a.fillStyle=c.isTwoColorBar?c.isUp?c.downColor:c.upColor:c.color,a.fillRect(Math.round(c.exactTime-this.barSpacing+d),Math.round(c.open-d),Math.round(this.barSpacing-2*d+1),Math.round(2*d)))}a.restore()};
W67.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barLineWidth;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var g=b.item(e);if(a.x<=g.time+c){d=g;break}}b=selectionTolerance(.5*this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};function W69(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.blockSize=a.blockSize;this.barWidth=a.barSpacing}
W69.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(.5,.5);for(var b=0;b<this.bars.size();++b){bar=this.bars.item(b);var c=(bar.low-bar.high)/bar.additionalNum;a.beginPath();for(var d=0;d<bar.additionalNum;d++)bar.isUp?(a.moveTo(Math.round(bar.time-.5*this.barWidth)+.5,bar.high+d*c),a.lineTo(Math.round(bar.time+.5*this.barWidth)-.5,bar.high+(d+1)*c),a.moveTo(Math.round(bar.time+.5*this.barWidth)-.5,bar.high+d*c),a.lineTo(Math.round(bar.time-.5*this.barWidth)+.5,bar.high+
(d+1)*c)):this.drawEllipse(a,bar.time-.45*this.barWidth+.5,bar.high+d*c,Math.round(.9*this.barWidth),Math.round(c));a.strokeStyle=bar.color;a.lineWidth=1;a.stroke()}a.restore()};W69.prototype.drawEllipse=function(a,b,c,d,e){a.save();a.translate(b+d/2,c+e/2);a.scale(d/2,e/2);a.moveTo(1,0);a.arc(0,0,.95,0,2*Math.PI,!1);a.restore()};
W69.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var g=b.item(e);if(a.x<=g.time+c){d=g;break}}b=selectionTolerance(this.barWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
function W66(a){this.items=a.items;this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth}W66.prototype.draw=function(a){a.translate(.5,.5);a.fillStyle=this.lineColor;for(var b=this.lineWidth,c=0;c<this.items.size();++c){var d=this.items.item(c),e=d.x,g=d.y;d.style&&(a.fillStyle=d.style.color,b=d.style.width);a.fillRect(Math.round(e-.5*b),g,b,this.histogramBase-g)}};
W66.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e=0;e<this.items.size();++e)if(c=this.items.item(e),d=c.x,c=c.y,d=MathEx.distanceToSegment(new MathEx.Point(d,c),new MathEx.Point(d,this.histogramBase),new MathEx.Point(a.x,a.y)),d.distance<=b)return new HitTestResult(HitTestResult.REGULAR);return null};
function W60(a){this.items=a.items;this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth}
W60.prototype.draw=function(a){if(0!==this.items.size())if(TradingView.D18("tv4603_tv4590")){var b=this.barSpacing,c=this.lineColor,d=this.histogramBase;a.translate(.5,.5);for(var e={},g=this.items.toArray(),h=0;h<g.length;++h){var k=g[h],l=0==h?null:g[h-1],m;m=k.style?k.style.color:c;var n=e[m]||[];n.push({item:k,prev:l});e[m]=n}for(m in e){n=e[m];a.fillStyle=m;a.strokeStyle=m;a.lineWidth=1;a.beginPath();for(h=0;h<n.length;h++){var k=n[h].item,g=Math.ceil(k.x-.5*b),q=
Math.ceil(g+b),r=k.y;a.rect(g,r,q-g,d-r)}a.fill();a.beginPath();for(h=0;h<n.length;h++)k=n[h].item,g=Math.ceil(k.x-.5*b),q=Math.ceil(g+b),r=k.y,l=n[h].prev,a.moveTo(q-.5,d),a.lineTo(q-.5,r+.5),a.lineTo(g+.5,r+.5),l&&l.y>r&&a.lineTo(g+.5,l.y);a.stroke()}}else for(a.translate(.5,.5),c=this.lineColor,b=d=this.histogramBase,h=0;h<this.items.size();++h)k=this.items.item(h),g=Math.ceil(k.x-.5*this.barSpacing),q=Math.ceil(g+this.barSpacing),r=k.y,m=k.style?k.style.color:c,e!==m&&(e=m,a.fillStyle=m),a.fillRect(g,
r,q-g,d-r),2>=this.barSpacing?a.fillRect(g,r,q-g,d-r):(a.beginPath(),r<b&&a.rect(g,r,1,b-r),a.rect(q-1,r,1,d-r),a.rect(g,r,q-g,1),a.fill(),b=r)};W60.prototype.hitTest=function(a){for(var b=.5*this.barSpacing+this.lineWidth,c=a.x-b,b=a.x+b,d=this.items.toArray(),e=d.length;e--;){var g=d[e].x;if(g>=c&&g<=b&&(g=d[e].y,a.y>=Math.min(g,this.histogramBase)&&a.y<=Math.max(g,this.histogramBase)))return new HitTestResult(HitTestResult.REGULAR)}return null};
function W68(a){this.items=a.items;this._simpleMode=a.simpleMode;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth;this.lineStyle=a.lineStyle;this.withMarkers=a.withMarkers;this.withSteps=a.withSteps;this.hittest=a.hittest;this.ignorePaletteLineWidth=a.ignorePaletteLineWidth;this.forceLineColor=!!a.forceLineColor}
W68.prototype.draw=function(a){a.lineCap="square";a.lineJoin=this.withMarkers?"round":"miter";a.strokeStyle=this.lineColor;a.fillStyle=this.lineColor;a.lineWidth=this.lineWidth;a.lineStyle=this.lineStyle;this._simpleMode?this._drawSimpleMode(a):this._drawLines(a)};
W68.prototype._drawSimpleMode=function(a){a.beginPath();this.walkLine(a,this.items.toArray());a.stroke();if(this.withMarkers){i=this.items.size();var b=this.lineWidth+2,c=2*Math.PI,d;for(a.beginPath();i--;)if(d=this.items.item(i))a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,0,c);a.fill()}};
W68.prototype.walkLine=function(a,b,c,d){if(b){for(var e=.25*this.barSpacing,g,h,k,l,m=paneRendererCoordinateIsValid,n=0,q=b.length;n<q;n++)if(l=b[n],m(l.y)){h=l;g=n;break}if("undefined"!==typeof g&&h)for(var r=this.withSteps&&this.lineWidth&&0==this.lineWidth%2?.5:0,n=g,q=b.length;n<q;n++){h=b[n];l=b[n+1]||{};if(m(h.y))if(k&&m(k.y))this.withSteps&&a.lineTo(k.x+r,h.y+r),a.lineTo(h.x+r,h.y+r),c&&!m(l.y)&&a.lineTo(h.x+r,d);else if(l&&m(l.y))c?(n!=g&&a.lineTo(h.x+r,d),a.lineTo(h.x+r,h.y+
r)):a.moveTo(h.x+r,h.y+r);else if(c){if(0===n)continue;n!=g&&a.lineTo(h.x-e+r,d);a.lineTo(h.x-e+r,h.y+r);a.lineTo(h.x+e+r,h.y+r);a.lineTo(h.x+e+r,d)}else a.moveTo(h.x-e+r,h.y+r),a.lineTo(h.x+e+r,h.y+r);k=h}}};
W68.prototype._drawLines=function(a){function b(b,c,d){h(c.y)&&(h(b.y)?a.lineTo(c.x,c.y):d&&h(d.y)?a.moveTo(c.x,c.y):(a.moveTo(c.x-g,c.y),a.lineTo(c.x+g,c.y)))}if(this.items.size()){var c,d,e,g=.25*this.barSpacing,h=paneRendererCoordinateIsValid;a.beginPath();(c=this.items.item(0))&&a.moveTo(c.x,c.y);for(var k=a.strokeStyle,l=a.lineWidth,m=a.lineStyle,n=1;n<this.items.size();++n){c=this.items.item(n-1);d=this.items.item(n);e=this.items.item(n+1);var q,r,u;d.style&&!this.forceLineColor?
(q=d.style.color,r=d.style.width,u=d.style.style):(q=this.lineColor,r=this.lineWidth,u=this.lineStyle);this.ignorePaletteLineWidth&&(r=this.lineWidth);q!=k||r!=l||u!=m?(k=q,l=r,m=u,a.stroke(),a.beginPath(),a.strokeStyle=q,a.lineWidth=r,a.lineStyle=u,u===CanvasEx.LINESTYLE_SOLID?(a.moveTo(c.x,c.y),b(c,d,e)):CanvasEx.drawLine(a,c.x,c.y,d.x,d.y)):b(c,d,e)}a.stroke()}};
W68.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e,g,h=0,k=this.items.size()-1;2<k-h;)c=Math.round((k+h)/2),this.items.item(c).x<=a.x?h=c:k=c;h=Math.max(1,h-1);for(k=Math.min(this.items.size()-1,k+1);h<=k;++h)if(c=this.items.item(h-1),d=this.items.item(h),e=c.x,g=d.x,c=MathEx.distanceToSegment(new MathEx.Point(e,c.y),new MathEx.Point(g,d.y),new MathEx.Point(a.x,a.y)),c.distance<=b)return this.hittest?this.hittest:new HitTestResult(HitTestResult.REGULAR);
return null};function W53(a){a.forceLineColor=!0;W68.call(this,a);this.color1=a.color1;this.color2=a.color2;this.bottom=a.bottom;this._simpleMode=a.simpleMode}inherit(W53,W68);
W53.prototype.draw=function(a){if(0!==this.items.size()){a.lineCap="square";a.strokeStyle=this.lineColor;a.lineWidth=this.lineWidth;a.lineStyle=this.lineStyle;a.lineWidth=1;a.beginPath();for(var b,c=0,d=this.items.size();c<d;c++){var e=this.items.item(c);if(paneRendererCoordinateIsValid(e.y)){b=e;break}}if(b){a.moveTo(b.x,this.bottom);W68.prototype.walkLine.call(this,a,this.items.toArray(),!0,this.bottom);for(var g,c=this.items.size()-1;0<=c;c--)if(e=this.items.item(c),paneRendererCoordinateIsValid(e.y)){g=
e;break}a.moveTo(g.x,this.bottom);a.closePath();b=a.createLinearGradient(0,0,0,this.bottom);b.addColorStop(0,this.color1);b.addColorStop(1,this.color2);a.fillStyle=b;a.fill();a.lineWidth=this.lineWidth;W68.prototype.draw.call(this,a)}}};function W57(a){this._data=a;this._barWidth=optimalBarWidth(a.barSpacing);this._barBorderWidth=1}
W57.prototype.draw=function(a){var b=this._data.bars.clone(),c=this._data.barSpacing,d=this._data.drawWick,e=this._data.drawBorder,g=this._data.wickColor,h=this._barBorderWidth,k=this._barWidth,l=b.size(),m,n,q;a.lineCap="square";a.lineStyle=this._data.lineStyle;if(1>c){if(d){a.strokeStyle=g;a.lineWidth=1;a.beginPath();for(l=b.size();0<l--;)c=b.item(l),a.moveTo(c.time,c.low),a.lineTo(c.time,c.high);a.stroke()}a.lineWidth=1;e="";k=!1;a.beginPath();for(l=b.size();0<l--;)c=b.item(l),
d=c.time,e!==c.color&&(k&&(a.stroke(),a.beginPath(),k=!1),e=a.strokeStyle=c.color),a.moveTo(c.time,c.open),a.lineTo(c.time,c.close),k=!0;k&&a.stroke()}else{a.translate(.5,.5);a.lineWidth=h;b.sort(function(a,b){return a.color>b.color?1:-1});if(d)for(a.fillStyle=g;0<l--;)c=b.item(l),d=c.time,h=c.open,m=c.high,n=c.low,q=c.close,g=Math.min(h,q),h=Math.max(h,q),c.hollow?(a.fillRect(d,m,1,g-m),a.fillRect(d,h,1,n-h)):a.fillRect(d,m,1,n-m);if(e)for(l=b.size();0<l--;)c=b.item(l),b.item(l+1)&&c.borderColor==
b.item(l+1).borderColor||(a.fillStyle=c.borderColor),c.hollow||(d=c.time,h=c.open,q=c.close,m=Math.round(d-k),d=Math.round(d+k),g=Math.min(h,q),h=Math.max(h,q),a.fillRect(m,g,d-m+1,h-g+1));for(l=b.size();0<l--;)c=b.item(l),d=c.time,h=c.open,m=c.high,n=c.low,q=c.close,m=Math.round(d-k),d=Math.round(d+k),g=Math.min(h,q),h=Math.max(h,q),b.item(l+1)&&c.color==b.item(l+1).color||(a.fillStyle=c.color,a.strokeStyle=c.color),c.hollow?(a.translate(-.5,-.5),a.strokeRect(m+1,g+1,d-m,h-g),a.translate(.5,.5)):
(e&&(m+=1,g+=1,--d,--h),a.fillRect(m,g,d-m+1,h-g+1))}};W57.prototype.hitTest=function(a){var b=this._data.bars,c=.5*this._data.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var g=b.item(e);if(a.x<=g.time+c){d=g;break}}b=selectionTolerance(this._barBorderWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
function W61(a){this.items=a.items;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth;this.lineStyle=a.lineStyle}W61.prototype.draw=function(a){for(var b=this.lineWidth,c=3*this.lineWidth,d,e=!1,g=0;g<this.items.size();++g){var h=this.items.item(g),k=h.x,l=h.y;isNaN(k)||isNaN(l)||(h=null!=h.style?h.style.color:this.lineColor,h!==d&&(d=h,e&&a.fill(),a.beginPath(),a.fillStyle=h),a.rect(k-c/2,l-b/2,c,b),a.rect(k-b/2,l-c/2,b,c),e=!0)}e&&a.fill()};
W61.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e,g,h=1;h<this.items.size();++h)if(c=this.items.item(h-1),d=this.items.item(h),e=c.x,g=d.x,c=MathEx.distanceToSegment(new MathEx.Point(e,c.y),new MathEx.Point(g,d.y),new MathEx.Point(a.x,a.y)),c.distance<=b)return new HitTestResult(HitTestResult.REGULAR);return null};
function W58(a){this.items=a.items;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor||a.color;this.radius=a.lineWidth||a.height/2;this.vertOffset=a.vertOffset||0}
W58.prototype.draw=function(a){for(var b=2*Math.PI,c=this.radius,d,e=!1,g=0;g<this.items.size();++g){var h=this.items.item(g),k=h.x,l=h.y+this.vertOffset;isNaN(k)||isNaN(l)||(h=null!=h.style?h.style.color:this.lineColor,h!==d&&(d=h,e&&a.fill(),a.beginPath(),a.fillStyle=h),a.moveTo(k+c,l),a.arc(k,l,c,0,b,!1),e=!0)}e&&a.fill()};
W58.prototype.hitTest=function(a){for(var b=this.vertOffset,c=selectionTolerance(2*this.radius),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&(offsettedPoint=new MathEx.Point(e.x,e.y+b),offsettedPoint.substract(a).length()+this.radius<=c))return new HitTestResult(HitTestResult.REGULAR)}return null};function PaneRendererArrowsUpDownItem(a,b,c,d){this.x=a;this.y=b;this.height=c;this.isUp=d}inherit(PaneRendererArrowsUpDownItem,MathEx.Point);
function W54(a){this.items=a.items;this.barSpacing=a.barSpacing;this.colorUp=a.colorup;this.colorDn=a.colordown;this.colorBorder=a.colorBorder;this.width=this._calculateWidth(a.barSpacing);this.minHeight=a.minHeight;this.vertOffset=this._calculateVerticalOffset(a.barSpacing)}W54.prototype._calculateVerticalOffset=function(a){return Math.round((a||0)/4)};W54.prototype._calculateMinHeight=function(a){return this.width||this._calculateWidth(a)};
W54.prototype._calculateWidth=function(a){a=a||this.barSpacing;return Math.round(a/2)};
W54.prototype.draw=function(a){var b=this.width,c=4>b,d=Math.max(parseInt(b/2),1),e=Math.round(this.width/2),g=Math.round(this.width);a.translate(1,1);for(var h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m=l.isUp?-1:1,n=Math.abs(l.height),q=l.y-m*this.vertOffset;a.beginPath();a.translate(l.x,q);c?(a.moveTo(0,0),a.lineTo(-e,-e*m),a.moveTo(0,0),a.lineTo(e,-e*m),a.moveTo(0,0),a.lineTo(0,-n*m),a.moveTo(-e,-n*m),a.lineTo(e,-n*m),a.lineWidth=d,a.strokeStyle=l.isUp?this.colorUp:
this.colorDn,a.stroke()):(a.moveTo(0,0),n<g?(a.lineTo(b,-n*m),a.lineTo(-b,-n*m)):(a.lineTo(b,-g*m),a.lineTo(e,-g*m),a.lineTo(e,-n*m),a.lineTo(-e,-n*m),a.lineTo(-e,-g*m),a.lineTo(-b,-g*m)),a.lineTo(0,0),a.strokeStyle=this.colorBorder,a.stroke(),a.fillStyle=l.isUp?this.colorUp:this.colorDn,a.fill());a.translate(-l.x,-q)}a.translate(-1,-1)};
W54.prototype.hitTest=function(a){for(var b=Math.round(this.width/2),c=Math.round(this.width),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&void 0!==e.x&&null!==e.x&&!isNaN(e.x)&&void 0!==e.y&&null!==e.y&&!isNaN(e.y)){var g=Math.abs(e.height),h=e.isUp?-1:1,k=e.y-h*this.vertOffset,g=k-h*(g+c),h=e.x+b;if(e.x-b<a.x&&a.x<h&&(e.isUp?k<a.y&&a.y<g:g<a.y&&a.y<k))return new HitTestResult(HitTestResult.REGULAR)}}};
function W73(a){this.items=a.items;this.ch=a["char"][0];this.color=a.color;this.vertOffset=a.vertOffset;this.height=Math.round(a.height);this.fontFamily=a.fontFamily||"Arial"}
W73.prototype.draw=function(a){a.font=this.height+"px "+this.fontFamily;var b=a.measureText(this.ch),c=this.height/2,b=b.width/2;a.translate(1,1);for(var d=0,e=this.items.size();d<e;d++){var g=this.items.item(d);newFillStyle=void 0!==g.style?g.style.color:this.color;a.fillStyle=newFillStyle;a.fillText(this.ch,g.x-b,g.y+this.vertOffset+c)}a.translate(-1,-1)};
W73.prototype.hitTest=function(a){for(var b=this.vertOffset,c=selectionTolerance(this.height),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&(offsettedPoint=new MathEx.Point(e.x,e.y+b),offsettedPoint.substract(a).length()<=c))return new HitTestResult(HitTestResult.REGULAR)}return null};
function W52(a){this.items=a.items;this.height=a.height||a.width;this.width=a.width||a.height;this.color=a.color;this.borderColor=a.borderColor;this.vertOffset=a.vertOffset||0}W52.prototype.draw=function(a){throw Error("Not implemented");};
W52.prototype.hitTest=function(a,b){var c=Math.max(this.height,this.width),d=this.vertOffset;b=b||HitTestResult.REGULAR;for(var e,g=0;g<this.items.size();++g)if(e=this.items.item(g))if(e=new MathEx.Point(e.x,e.y+d),e=e.substract(a).length(),e<=c)return new HitTestResult(b);return null};function W74(a){W52.call(this,a)}inherit(W74,W52);
W74.prototype.draw=function(a){a.lineWidth=2;for(var b=this.width,c=this.height,d=this.vertOffset,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m;m=null!=l.style?l.style.color:this.color;m!==e&&(e=m,g&&a.stroke(),a.beginPath(),a.strokeStyle=m);g=l.x-b/2;l=l.y-c/2+d;a.moveTo(g,l);a.lineTo(g+b,l+c);a.moveTo(g,l+c);a.lineTo(g+b,l);g=!0}g&&a.stroke()};function W72(a){W52.call(this,a)}inherit(W72,W52);
W72.prototype.draw=function(a){for(var b=this.width,c=this.height,d=Math.round(c/3),d=this.vertOffset-2*d,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m,n;null!=l.style?(m=l.style.color,n=l.style.borderColor):(m=this.color,n=this.borderColor);m!==e&&(e=m,g&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=m,a.strokeStyle=n);g=l.x;l=l.y+d;a.moveTo(g,l);a.lineTo(g+b/2,l+c);a.lineTo(g-b/2,l+c);a.lineTo(g,l);g=!0}g&&(a.fill(),a.stroke())};
function W71(a){W52.call(this,a)}inherit(W71,W52);
W71.prototype.draw=function(a){for(var b=this.width,c=this.height,d=Math.round(c/3),d=this.vertOffset-d,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m,n;null!=l.style?(m=l.style.color,n=l.style.borderColor):(m=this.color,n=this.borderColor);m!==e&&(e=m,g&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=m,a.strokeStyle=n);g=l.x-b/2;l=l.y+d;a.moveTo(g,l);a.lineTo(g+b,l);a.lineTo(g+b/2,l+c);a.lineTo(g,l);g=!0}g&&(a.fill(),a.stroke())};
function PaneRendererTriangleApexLeft(a){W52.call(this,a)}inherit(PaneRendererTriangleApexLeft,W52);
PaneRendererTriangleApexLeft.prototype.draw=function(a){for(var b=this.width,c=this.height,d=this.vertOffset,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m;m=null!=l.style?l.style.color:this.color;m!==e&&(e=m,g&&a.fill(),a.beginPath(),a.fillStyle=m);g=l.x+b/2;l=l.y-c/2+d;a.moveTo(g,l);a.lineTo(g,l+c);a.lineTo(g-b,l+c/2);a.lineTo(g,l);g=!0}g&&a.fill()};function W64(a){W52.call(this,a)}inherit(W64,W52);
W64.prototype.draw=function(a){for(var b=this.width,c=this.height,d=c/2,e=this.vertOffset,g=(b-3)/3,h,k=!1,l=0,m=this.items.size();l<m;l++){var n=this.items.item(l),q,r;null!=n.style?(q=n.style.color,r=n.style.borderColor):(q=this.color,r=this.borderColor);q!==h&&(h=q,k&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=q,a.strokeStyle=r);k=n.x-b/2;n=n.y-d+e;a.moveTo(k,n);a.lineTo(k+3,n);a.bezierCurveTo(k+g,n-g,k+2*g,n+g,k+b,n);a.lineTo(k+b,n+d);a.bezierCurveTo(k+b-g,n+d+g,k+b-2*g,
n+d-g,k+3,n+d);a.lineTo(k+3,n+c);a.lineTo(k,n+c);a.lineTo(k,n);k=!0}k&&(a.fill(),a.stroke())};function W63(a){W52.call(this,a)}inherit(W63,W52);
W63.prototype.draw=function(a){a.lineWidth=2;for(var b=this.width,c=this.height,d=this.vertOffset,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m;m=null!=l.style?l.style.color:this.color;m!==e&&(e=m,g&&a.stroke(),a.beginPath(),a.strokeStyle=m);g=l.x-b/2;l=l.y-c/2+d;a.moveTo(g+b/2,l);a.lineTo(g+b/2,l+c);a.moveTo(g,l+c/2);a.lineTo(g+b,l+c/2);g=!0}g&&a.stroke()};function W59(a){W52.call(this,a)}
inherit(W59,W52);W59.prototype.draw=function(a){for(var b=Math.max(this.width,this.height)/2,c=this.vertOffset,d=2*Math.PI,e,g=!1,h=0,k=this.items.size();h<k;h++){var l=this.items.item(h),m,n;null!=l.style?(m=l.style.color,n=l.style.borderColor):(m=this.color,n=this.borderColor);m!==e&&(e=m,g&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=m,a.strokeStyle=n);g=l.x;l=l.y+c;a.moveTo(g+b,l);a.arc(g,l,b,0,d,!1);g=!0}g&&(a.fill(),a.stroke())};
function PaneRendererArrowsBase(a){W52.call(this,a);this.width=this._calculateWidth(a.barSpacing);this.isUp=!1}inherit(PaneRendererArrowsBase,W52);PaneRendererArrowsBase.prototype._calculateWidth=function(a){a=a||this.barSpacing;return Math.round(a/4)};
PaneRendererArrowsBase.prototype.draw=function(a){for(var b,c=!1,d=this.width,e=4>d,g=Math.max(parseInt(d/2),1),h=Math.round(this.width/2),k=Math.round(this.width),l=this.isUp?-1:1,m=0,n=this.items.size();m<n;m++){var q=this.items.item(m),r=Math.abs(this.height),u=q.x,w=q.y+this.vertOffset+l*Math.round(r/2),A;null!=q.style?(A=q.style.color,q=q.style.borderColor):(A=this.color,q=this.borderColor);A!==b&&(b=A,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=A,a.strokeStyle=q);a.translate(u,w);e?(a.moveTo(0,
0),a.lineTo(-h,-h*l),a.moveTo(0,0),a.lineTo(h,-h*l),a.moveTo(0,0),a.lineTo(0,-r*l),a.moveTo(-h,-r*l),a.lineTo(h,-r*l),a.lineWidth=g):(a.moveTo(0,0),r<k?(a.lineTo(d,-r*l),a.lineTo(-d,-r*l)):(a.lineTo(d,-k*l),a.lineTo(h,-k*l),a.lineTo(h,-r*l),a.lineTo(-h,-r*l),a.lineTo(-h,-k*l),a.lineTo(-d,-k*l)),a.lineTo(0,0));a.translate(-u,-w);c=!0}c&&(a.fill(),a.stroke())};function PaneRendererArrowUp(a){PaneRendererArrowsBase.call(this,a);this.isUp=!0}inherit(PaneRendererArrowUp,PaneRendererArrowsBase);
function PaneRendererArrowDown(a){PaneRendererArrowsBase.call(this,a);this.isUp=!1}inherit(PaneRendererArrowDown,PaneRendererArrowsBase);function PaneRendererSquare(a){W52.call(this,a)}inherit(PaneRendererSquare,W52);
PaneRendererSquare.prototype.draw=function(a){for(var b,c=!1,d=Math.round(this.height/2),e=0,g=this.items.size();e<g;e++){var h=this.items.item(e),k,l;null!=h.style?(k=h.style.color,l=h.style.borderColor):(k=this.color,l=this.borderColor);k!==b&&(b=k,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=k,a.strokeStyle=l);a.rect(h.x-d,h.y+this.vertOffset-d,this.height,this.height);c=!0}c&&(a.fill(),a.stroke())};function PaneRendererDiamond(a){W52.call(this,a)}
inherit(PaneRendererDiamond,W52);
PaneRendererDiamond.prototype.draw=function(a){for(var b,c=!1,d=Math.round(this.height/2),e=0,g=this.items.size();e<g;e++){var h=this.items.item(e),k,l;null!=h.style?(k=h.style.color,l=h.style.borderColor):(k=this.color,l=this.borderColor);k!==b&&(b=k,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=k,a.strokeStyle=l);c=h.x;h=h.y+this.vertOffset;a.moveTo(c,h-d);a.lineTo(c+d,h);a.lineTo(c,h+d);a.lineTo(c-d,h);a.lineTo(c,h-d);c=!0}c&&(a.fill(),a.stroke())};
function W55(a){this._items=a.items;this._y=a.y;this._h=a.h;this._w=a.w}W55.prototype.draw=function(a){};W55.prototype.drawBackground=function(a){a.save();"undefined"==typeof FlashCanvas&&a.translate(-.5,-.5);for(var b=0;b<this._items.size();++b){var c=this._items.item(b);if(void 0!=c.color){a.fillStyle=c.color;var d=b==this._items.size()-1?this._w:this._items.item(b+1).x-c.x;a.fillRect(c.x,this._y,d,this._h)}}a.restore()};
W55.prototype.hitTest=function(a){return null};function PaneRendererClockIcon(a){a.point2||(a.point2=a.point1);var b=a.point1.x,c=a.point1.y,b=b<=a.point2.x?b-10:b+10,c=c<=a.point2.y?c+10:c-10;a={items:new List([new MathEx.Point(b-1,c-3)]),"char":[String.fromCharCode("0xF017").toUpperCase()],color:a.color,vertOffset:0,height:16,fontFamily:"FontAwesome"};W73.call(this,a)}inherit(PaneRendererClockIcon,W73);function PriceRange(a,b){this.m_minValue=a;this.m_maxValue=b}PriceRange.prototype.equals=function(a){return this.m_minValue==a.m_minValue&&this.m_maxValue==a.m_maxValue};PriceRange.prototype.clone=function(){return new PriceRange(this.m_minValue,this.m_maxValue)};PriceRange.prototype.minValue=function(){return this.m_minValue};PriceRange.prototype.maxValue=function(){return this.m_maxValue};PriceRange.prototype.length=function(){return this.m_maxValue-this.m_minValue};
PriceRange.prototype.isEmpty=function(){return this.m_maxValue===this.m_minValue||this.m_maxValue!=this.m_maxValue||this.m_minValue!=this.m_minValue};PriceRange.prototype.merge=function(a){return new PriceRange(Math.min(this.minValue(),a.minValue()),Math.max(this.maxValue(),a.maxValue()))};PriceRange.prototype.apply=function(a,b){this.m_minValue=Math.min(this.m_minValue,a);this.m_maxValue=Math.max(this.m_maxValue,b)};
PriceRange.prototype.scaleAroundCenter=function(a){if(!isNumber(a))TradingView.logDebug("PriceRange.scaleAroundCenter: invalid coeff");else if(0!==this.m_maxValue-this.m_minValue){var b=.5*(this.m_maxValue+this.m_minValue),c=this.m_maxValue-b,d=this.m_minValue-b;this.m_maxValue=b+c*a;this.m_minValue=b+d*a}};PriceRange.prototype.shift=function(a){isNumber(a)?(this.m_maxValue+=a,this.m_minValue+=a):TradingView.logDebug("PriceRange.shift: invalid coeff")};
PriceRange.prototype.convertToPercent=function(a,b){return 100*(a-b)/b};PriceRange.prototype.convertFromPercent=function(a,b){return a/100*b+b};PriceRange.prototype.convertToPercents=function(a){return new PriceRange(100*(this.m_minValue-a)/a,100*(this.m_maxValue-a)/a)};PriceRange.prototype.convertFromPercents=function(a){return new PriceRange(this.m_minValue/100*a+a,this.m_maxValue/100*a+a)};function TickMark(a,b,c){this.coord=a;this.label=b;this.major=c}
function PriceTickSpanCalculator(a,b){this.m_base=a;this.m_integralDividers=b;this.m_fractionalDividers=[];if(MathEx.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var c=this.m_base;1!==c;){if(0===c%2)this.m_fractionalDividers.push(2),c/=2;else if(0===c%5)this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),c/=5;else throw new RangeError("unexpected base");if(100<this.m_fractionalDividers.length)throw Error("something wrong with base");}}
PriceTickSpanCalculator.prototype.TICK_SPAN_EPSILON=1E-9;
PriceTickSpanCalculator.prototype.tickSpan=function(a,b,c){var d=0===this.m_base?0:1/this.m_base,e=this.TICK_SPAN_EPSILON;a=Math.pow(10,Math.max(0,Math.ceil(MathEx.log10(a-b))));b=0;var g;b=0;for(g=this.m_integralDividers[0];a>d+e&&MathEx.greaterOrEqual(a,d,e)&&MathEx.greaterOrEqual(a,c*g,e)&&MathEx.greaterOrEqual(a,1,e);++b,g=this.m_integralDividers[b%this.m_integralDividers.length])a/=g;a<=d+e&&(a=d);a=Math.max(1,a);if(0<this.m_fractionalDividers.length&&MathEx.equal(a,1,e))for(b=0,g=this.m_fractionalDividers[0];a>
d+e&&MathEx.greaterOrEqual(a,c*g,e);++b,g=this.m_fractionalDividers[b%this.m_fractionalDividers.length])a/=g;return a};function PriceTickMarkBuilder(a,b,c){this.m_marks=[];this.m_base=b;this.m_priceScale=a;this.m_fontHeight=14;if(this._formatter=c)this._cache=new FormattedLabelsCache(function(a){return c.format(a)});this._currentFormatBase=0}PriceTickMarkBuilder.prototype.TICK_DENSITY=2;PriceTickMarkBuilder.prototype.base=function(){return this.m_base};
PriceTickMarkBuilder.prototype.setBase=function(a){if(0>a)throw new RangeError("base < 0");this.m_base=a};PriceTickMarkBuilder.prototype.fontHeight=function(){return this.m_fontHeight};PriceTickMarkBuilder.prototype.setFontHeight=function(a){this.m_fontHeight!==a&&(this.m_fontHeight=a)};
PriceTickMarkBuilder.prototype.tickSpan=function(a,b){if(a<b)throw new RangeError("high < low");var c=this.m_priceScale.height(),d=this.tickMarkHeight(),c=(a-b)*d/c,d=new PriceTickSpanCalculator(this.m_base,[2,2.5,2]),e=new PriceTickSpanCalculator(this.m_base,[2,2,2.5]),g=new PriceTickSpanCalculator(this.m_base,[2.5,2,2]),h=[];h.push(d.tickSpan(a,b,c));h.push(e.tickSpan(a,b,c));h.push(g.tickSpan(a,b,c));return MathEx.min(h)};
PriceTickMarkBuilder.prototype.tickMarkHeight=function(){return this.m_fontHeight*this.TICK_DENSITY};function calculateBaseForTickSpan(a){for(var b=1;a*b!==Math.round(a*b);)b*=10;return b}
PriceTickMarkBuilder.prototype.rebuildTickMarks=function(){if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())this.m_marks=[];else{var a=this.m_priceScale.height(),b=this.m_priceScale.coordinateToPrice(a-1),c=this.m_priceScale.coordinateToPrice(0),a=c>=b?1:-1,d=Math.max(c,b),b=Math.min(c,b),c=d;if(c!=b){var d=this.tickSpan(c,b),e=c%d,e=e+(0>e?d:0);this.m_marks=[];if(!this._formatter){var g=calculateBaseForTickSpan(d);if(!this._cache||this._currentFormatBase!=
g){var h=new PriceFormatter(g);this._cache=new FormattedLabelsCache(function(a){return h.format(a)})}}g=null;for(c-=e;c>b;c-=d)e=this.m_priceScale.priceToCoordinate(c),null!==g&&Math.abs(e-g)<this.tickMarkHeight()||(g=new TickMark(e,this._cache.format(c),0),this.m_marks.push(g),g=e,this.m_priceScale.isLog()&&(d=this.tickSpan(c*a,b)))}}};PriceTickMarkBuilder.prototype.marks=function(){return this.m_marks};
function W76(a){function b(){for(var a=c.m_dataSources,b=0;b<a.size();b++){var g=a.item(b);g.priceScaleChanged&&g.priceScaleChanged.fire(c)}}this.D2=a;this.m_height=0;this.m_priceRange=null;this.m_dataSources=new List;this._studyBottomMargin=this._studyTopMargin=this.m_bottomMargin=this.m_topMargin=0;this.m_priceRangeSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_markBuilder=new PriceTickMarkBuilder(this,100,new PriceFormatter(100));this.D2.percentage.listeners().subscribe(this,
W76.prototype.updateFormatter);this.D2.showSymbolLabels.listeners().subscribe(this,W76.prototype.updateShowSymbolLabels);var c=this;this.D2.log.listeners().subscribe(null,function(a){if(c.m_priceRange){var b=c.m_priceRange;a.value()?c.m_priceRange=new PriceRange(c._toLog(b.minValue()),c._toLog(b.maxValue())):c.m_priceRange=new PriceRange(c._fromLog(b.minValue()),c._fromLog(b.maxValue()))}});this.D2.percentage.listeners().subscribe(null,function(){c.D2.autoScale.setValue(!0)});
this.D2.percentage.listeners().subscribe(null,function(){c.D2.autoScaleDisabled.setValue(c.D2.percentage.value());var a=c.priceRange();if(!(!c.mainSource()||c.mainSource().model().timeScale().isEmpty()||c.mainSource().data().isEmpty()||c.mainSource()instanceof TradingView.Series&&!c.mainSource().properties().lockScale.value())&&a){var b=c.mainSource().model().timeScale().visibleBars(),b=c.mainSource().data().search(b.firstBar(),SEARCH_NEAREST_RIGHT).value[CLOSE_PLOT];null!=
a&&void 0!==b&&(c.D2.percentage.value()?c.setPriceRange(a.convertToPercents(b)):c.setPriceRange(a.convertFromPercents(b)))}});this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this._hasSeries=!1;this.D2.percentage.listeners().subscribe(null,b);this.D2.log.listeners().subscribe(null,b)}W76.prototype.isLog=function(){return this.D2.log.value()};W76.prototype.isPercent=function(){return this.D2.percentage.value()};
W76.prototype.properties=function(){return this.D2};W76.prototype.height=function(){return this.m_height};W76.prototype.setHeight=function(a){var b=this.m_height;this.m_height=a;this._internalHeightCache=void 0;this._marksCache=null;b!=a&&this.mainSource()instanceof TradingView.Series&&this.mainSource().isLockScale()&&this.mainSource().model().timeScale().recalcLockedScale()};W76.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)};
W76.prototype.setTopMargin=function(a){if(!isNumber(a))throw new TypeError("invalid margin");if(0>a||30<a)throw new RangeError("invalid margin");this.m_topMargin=a;this._internalHeightCache=void 0;this._marksCache=null};W76.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)};
W76.prototype.setBottomMargin=function(a){if(!isNumber(a))throw new TypeError("invalid margin");if(0>a||30<a)throw new RangeError("invalid margin");this.m_bottomMargin=a;this._internalHeightCache=void 0;this._marksCache=null};W76.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var a=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=a};W76.prototype.priceRange=function(){return this.m_priceRange};
W76.prototype.setPriceRange=function(a){if(!a instanceof PriceRange)throw new TypeError("incorrect price range");this.m_priceRange&&this.m_priceRange.equals(a)||(this.m_priceRange=a,this._marksCache=null)};W76.prototype.isEmpty=function(){return 0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()};W76.prototype.invertedCoordinate=function(a){return this.height()-1-a};W76._logicalOffset=4;W76._coordOffset=1E-4;
W76.prototype.log10=function(a){return Math.log(a)/Math.log(10)};W76.prototype._toLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=this.log10(b+W76._coordOffset)+W76._logicalOffset;return 0>a?-b:b};W76.prototype.priceToLogical=function(a){return this.isLog()&&a?this._toLog(a):a};W76.prototype._fromLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=Math.pow(10,b-W76._logicalOffset)-W76._coordOffset;return 0>a?-b:b};
W76.prototype.logicalToPrice=function(a){return this.isLog()?this._fromLog(a):a};W76.prototype.priceToCoordinate=function(a,b){if(this.isEmpty())return 0;a=this.priceToLogical(a);var c=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(a-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),c=this.invertedCoordinate(c);return b?c:Math.round(c)};
W76.prototype.pricesToCoordinates=function(a){this.pricesToCoordinatesEx(a.toArray(),function(a){return a.y},function(a,c){a.y=c})};
W76.prototype.pricesToCoordinatesEx=function(a,b,c){var d=this.bottomMargin()*this.height(),e=this.priceRange().minValue(),g=this.priceRange().maxValue(),g=(this.internalHeight()-1)/(g-e);if(this.isLog())for(var h=0;h<a.length;h++){var k=b(a[h]);c(a[h],this.priceToLogical(k))}for(h=0;h<a.length;h++)k=b(a[h]),isNaN(k)||void 0===k||null===k||c(a[h],Math.round(this.m_height-1-(d+g*(k-e))))};
W76.prototype.pointsArrayToCoordinates=function(a){var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e].y=this.priceToLogical(a[e].y);for(e=0;e<a.length;e++){var g=a[e].y;isNaN(g)||void 0===g||null===g||(a[e].y=Math.round(this.m_height-1-(b+d*(g-c))))}};
W76.prototype.pricesArrayToCoordinates=function(a){var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e]=this.priceToLogical(a[e]);for(e=0;e<a.length;e++){var g=a[e];void 0!=g&&(a[e]=Math.round(this.m_height-1-(b+d*(g-c))))}};
W76.prototype.barPricesToCoordinates=function(a){a=a.toArray();var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e]&&(a[e].open=this.priceToLogical(a[e].open),a[e].high=this.priceToLogical(a[e].high),a[e].low=this.priceToLogical(a[e].low),a[e].close=this.priceToLogical(a[e].close),a[e].additionalPrice&&(a[e].additionalPrice=this.priceToLogical(a[e].additionalPrice)));
for(e=0;e<a.length;e++){var g=a[e];if(g){var h=g.open,h=b+d*(h-c),h=this.m_height-1-h;g.open=Math.round(h);h=g.high;h=b+d*(h-c);h=this.m_height-1-h;g.high=Math.round(h);h=g.low;h=b+d*(h-c);h=this.m_height-1-h;g.low=Math.round(h);h=g.close;h=b+d*(h-c);h=this.m_height-1-h;g.close=Math.round(h);g.additionalPrice&&(h=g.additionalPrice,h=b+d*(h-c),h=this.m_height-1-h,g.additionalPrice=Math.round(h))}}};
W76.prototype.coordinateToPrice=function(a){if(this.isEmpty())return 0;a=this.invertedCoordinate(a);a=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((a-this.bottomMargin()*this.height())/(this.internalHeight()-1));return this.logicalToPrice(a)};W76.prototype.isAutoScale=function(){return this.D2.autoScale.value()&&!(this.mainSource()instanceof TradingView.Series&&this.mainSource().isLockScale())};W76.prototype.isPercentage=function(){return this.D2.percentage.value()};
W76.prototype.D19=function(){return this.m_dataSources};W76.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0;b<this.D19().size();b++){var c=this.D19().item(b);null==c.zorder()&&c.setZorder(b+1);a.push(c)}a=W75.sortSources(a);return this._cachedOrderedSoruces=new List(a)};W76.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null};
W76.prototype.addDataSource=function(a){if(!this.m_dataSources.contains(a)){isInherited(a.constructor,TradingView.Series)&&(this._hasSeries=!0);var b=this;a.properties().visible.listeners().subscribe(null,function(){b._sourcesForAutoscale=null});this.m_dataSources.append(a);this._mainSource=void 0;this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this.updateFormatter();this.initScaleProperties();this.invalidateSourcesCache()}};
W76.prototype.initScaleProperties=function(){var a=this.mainSource()instanceof TradingView.Series&&this.mainSource().properties().lockScale.value();a&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1));this.properties().percentageDisabled.setValue(a);this.properties().logDisabled.setValue(a);this.properties().autoScaleDisabled.setValue(this.properties().percentage.value());this.properties().percentage.value()&&this.properties().log.setValue(!1)};
W76.prototype.removeDataSource=function(a){if(!this.m_dataSources.contains(a))throw Error("source is not attached to scale");this.m_dataSources.remove(a);isInherited(a.constructor,TradingView.Series)&&(this._hasSeries=!1);this.mainSource()||this.setAutoScale(!0);this._mainSource=void 0;this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this.updateFormatter();this.invalidateSourcesCache()};W76.prototype.setAutoScale=function(a){this.D2.autoScale.setValue(a)};
W76.prototype.startScale=function(a){this.isPercentage()||null!==this.m_scaleStartPoint||null!==this.m_priceRangeSnapshot||this.isEmpty()||(this.m_scaleStartPoint=this.m_height-a,this.m_priceRangeSnapshot=this.priceRange().clone())};W76.prototype.marks=function(){if(this._marksCache)return this._marksCache;this.m_markBuilder.rebuildTickMarks();return this._marksCache=this.m_markBuilder.marks()};
W76.prototype.scaleTo=function(a){if(!this.isPercentage()&&(this._marksCache=null,null!==this.m_scaleStartPoint)){this.setAutoScale(!1);var b=this.m_priceRange.clone();a=this.m_height-a;0>a&&(a=0);a=(this.m_scaleStartPoint+.2*(this.m_height-1))/(a+.2*(this.m_height-1));a=Math.max(a,.1);this.m_priceRange=this.m_priceRangeSnapshot.clone();this.m_priceRange.scaleAroundCenter(a);this.recalcLockedScale(b)}};
W76.prototype.recalcLockedScale=function(a){if(this.mainSource()instanceof TradingView.Series&&this.mainSource().properties().lockScale.value()){var b=this.mainSource().model().timeScale(),c=this.mainSource().data().boxSize;void 0===c&&this.mainSource().fixBoxSize();if(void 0!==c){if(this.properties().percentage.value())var d=this.mainSource().data().search(this.mainSource().getRealVisibleRange().m_firstBar).value[CLOSE_PLOT],c=PriceRange.prototype.convertToPercent.call(null,d+c,d)-PriceRange.prototype.convertToPercent.call(null,
d,d);c*=this.internalHeight()/this.priceRange().length();.5>c||50<c?this.m_priceRange=a:(b.setBarSpacing(c),b._correctOffset());this.mainSource().model().mainSeries().requestMoreData()}}};W76.prototype.endScale=function(){this.isPercentage()||null===this.m_scaleStartPoint||(this.m_priceRangeSnapshot=this.m_scaleStartPoint=null)};
W76.prototype.startScroll=function(a){this.isAutoScale()||null!==this.m_scrollStartPoint||null!==this.m_priceRangeSnapshot||this.isEmpty()||(this.m_scrollStartPoint=a,this.m_priceRangeSnapshot=this.priceRange().clone())};W76.prototype.scrollTo=function(a){this._marksCache=null;if(!this.isAutoScale()&&null!==this.m_scrollStartPoint){var b=this.priceRange().length()/(this.height()-1);a=(a-this.m_scrollStartPoint)*b;this.m_priceRange=this.m_priceRangeSnapshot.clone();this.m_priceRange.shift(a)}};
W76.prototype.endScroll=function(){this.isAutoScale()||null===this.m_scrollStartPoint||(this.m_priceRangeSnapshot=this.m_scrollStartPoint=null)};
W76.prototype.state=function(){var a={};a.m_priceRange=this.priceRange()?this.priceRange().clone():null;a.m_isAutoScale=this.isAutoScale();a.m_isPercentage=this.D2.percentage.value();a.m_isLog=this.D2.log.value();a.m_height=this.m_height;a.m_topMargin=this.m_topMargin;a.m_bottomMargin=this.m_bottomMargin;a.m_showSymbolLabels=this.D2.showSymbolLabels.value();return a};
W76.prototype.restoreState=function(a){var b=a.m_priceRange;if(void 0===b)throw new TypeError("invalid state");if(void 0===a.m_isAutoScale)throw new TypeError("invalid state");void 0!==a.m_isPercentage&&this.D2.percentage.setValue(a.m_isPercentage);void 0!==a.m_isLog&&this.D2.log.setValue(a.m_isLog);this.m_priceRange=b?new PriceRange(b.m_minValue,b.m_maxValue):null;void 0!==a.m_height&&(this.m_height=a.m_height);this.setAutoScale(a.m_isAutoScale);void 0!==a.m_topMargin&&(this.m_topMargin=
a.m_topMargin);void 0!==a.m_bottomMargin&&(this.m_bottomMargin=a.m_bottomMargin);void 0!==a.m_showSymbolLabels&&this.D2.showSymbolLabels.setValue(a.m_showSymbolLabels);this._mainSource=void 0;this._scaleSeriesOnly=!1};
W76.prototype.mainSource=function(){if(void 0!==this._mainSource)return this._mainSource;for(var a=0;a<this.m_dataSources.size();a++)if(isInherited(this.m_dataSources.item(a).constructor,PriceDataSource))return this._mainSource=a=this.m_dataSources.item(a);this._mainSource=void 0;return null};W76.prototype.formatter=function(){this._formatter||this.updateFormatter();return this._formatter};
W76.prototype.updateFormatter=function(){this._marksCache=null;var a=this.mainSource(),b=100;a&&(b=a.base());this._formatter=null;this.properties().percentage.value()?this._formatter=new PercentageFormatter:a&&(this._formatter=a.formatter());this.m_markBuilder=new PriceTickMarkBuilder(this,b,this._formatter);this.m_markBuilder.rebuildTickMarks()};
W76.prototype._recalculateSourcesForAutoscale=function(){this._sourcesForAutoscale=new List;this._mainSource&&(this._scaleSeriesOnly=this._mainSource.model().properties().scalesProperties.scaleSeriesOnly.value());for(var a=this._scaleSeriesOnly&&this._hasSeries,b=0;b<this.D19().size();b++){var c=this.D19().item(b),d;d=c;d=d.properties().visible.value()||d instanceof TradingView.Series?a?isInherited(d.constructor,TradingView.Series):isInherited(d.constructor,PriceDataSource):
!1;d&&this._sourcesForAutoscale.append(c)}};W76.prototype.sourcesForAutoscale=function(){if(this._mainSource){var a=this._mainSource.model().properties();this._scaleSeriesOnly!=a.scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null)}this._sourcesForAutoscale||this._recalculateSourcesForAutoscale();return this._sourcesForAutoscale};
W76.prototype.recalculatePriceRange=function(a){this._studyBottomMargin=this._studyTopMargin=0;var b=null,c=this.sourcesForAutoscale();this.mainSource();for(var d=0;d<c.size();d++){var e=c.item(d);if(e.properties().visible.value()){var g=a.firstBar(),h=a.lastBar(),g=e.priceRange(g,h);null===b&&g?b=g:g&&(b=b.merge(g));e.margins&&(e=e.margins(),this._studyTopMargin=Math.max(e[0],this._studyTopMargin),this._studyBottomMargin=Math.max(e[1],this._studyBottomMargin))}}b?(b.minValue()==b.maxValue()&&
(b=new PriceRange(b.minValue()-.5,b.maxValue()+.5)),this.setPriceRange(b)):this.m_priceRange||this.setPriceRange(new PriceRange(-.5,.5))};W76.prototype.sourcesToUpdateViews=function(){if(!this._sourcesToUpdateViews){this._sourcesToUpdateViews=new List;for(var a=0;a<this.D19().size();a++){var b=this.D19().item(a);isInherited(b.constructor,W47)&&!b.isActualSymbol()||this._sourcesToUpdateViews.append(b)}}return this._sourcesToUpdateViews};
W76.prototype.updatePaneViews=function(){for(var a=this.sourcesToUpdateViews(),b=0;b<a.size();b++)a.item(b).updateAllViews()};W76.prototype.updateShowSymbolLabels=function(){for(var a=this.sourcesToUpdateViews(),b=0;b<a.size();b++)a.item(b).updateAllViews();this.mainSource()&&this.mainSource().model().D20(new A22(A22.LIGHT_UPDATE))};A58=function(a,b){this.m_bars=new PlotList(["time","open","high","low","close"]);this.m_nsBars=new PlotList(["time","open","high","low","close"]);this.m_series=a;this.m_model=b;this.boxSize=this.lastProjectionPrice=void 0};A58.prototype.bars=function(){return this.m_bars};A58.prototype.nsBars=function(){return this.m_nsBars};A58.prototype.size=function(){return this.m_nsBars._end-this.m_nsBars._start+(this.m_bars._end-this.m_bars._start)};
A58.prototype.each=function(a){for(var b=this.m_bars._start;b<this.m_bars._end&&!a(this.m_bars._indexAt(b),this.m_bars._valueAt(b));++b);for(b=this.m_nsBars._start;b<this.m_nsBars._end&&!a(this.m_nsBars._indexAt(b),this.m_nsBars._valueAt(b));++b);};A58.prototype.clear=function(){this.m_bars=new PlotList(["time","open","high","low","close"]);this.m_nsBars=new PlotList(["time","open","high","low","close"]);this.boxSize=this.lastProjectionPrice=void 0};
A58.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars._items[0]:this.m_bars._items[0]};A58.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()};A58.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars._items[this.m_bars._end-1]:this.m_nsBars._items[this.m_nsBars._end-1]};
A58.prototype.search=function(a,b){return this.nsBars().isEmpty()?this.bars().search(a,b):this.bars().isEmpty()?this.nsBars().search(a,b):this.nsBars().firstTimeIndex()<=a?this.nsBars().search(a,b):this.bars().search(a,b)};A58.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
A58.prototype.firstBar=function(){if(this.m_model.timeScale().isEmpty())return null;var a=this.m_model.timeScale().visibleBars(),b=a.firstBar(),a=a.lastBar(),c=null,d=function(a,b){if(!c)return c=b,!0};this.bars().range(b,a).isEmpty()?this.nsBars().range(b,a).each(d):this.bars().range(b,a).each(d);return c};A58.prototype.firstValue=function(){var a=this.firstBar();return a?a[CLOSE_PLOT]:null};
A58.prototype.timeToBarIndex=function(a,b){if(null===a)return TradingView.logDebug("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"),0;if(b===SEARCH_FROM_RIGHT){for(var c=this.m_bars.lastIndex();c>=this.m_bars.firstIndex();c--){var d=this.m_bars._valueAt(c);if(a>=d[TIME_PLOT])return c}for(c=this.m_nsBars.lastIndex();c>=this.m_nsBars.firstIndex();c--)if(d=this.m_nsBars._valueAt(c),a>=d[TIME_PLOT])return c;return this.m_bars.firstIndex()}if(b===
SEARCH_FROM_LEFT){for(c=this.m_bars.firstIndex();c<=this.m_bars.lastIndex();c++)if(d=this.m_bars._valueAt(c),a<=d[TIME_PLOT])return c;for(c=this.m_nsBars.firstIndex();c<=this.m_nsBars.lastIndex();c++)if(d=this.m_nsBars._valueAt(c),a<=d[TIME_PLOT])return c;return this.m_bars.lastIndex()}TradingView.logDebug("SeriesData.timeToBarIndex: Incorrect options value");return 0};var DEFAULT_BAR_COUNT=300,TIME_PLOT=0,OPEN_PLOT=1,HIGH_PLOT=2,LOW_PLOT=3,CLOSE_PLOT=4,ADT_PLOT=6,SEARCH_FROM_LEFT=-1,SEARCH_FROM_RIGHT=1;function W23(a){this._series=a;this.D0=a.m_model;this._points=(new List).append(new MathEx.Point(0,0));this._invalidated=!0}W23.prototype.update=function(){this._invalidated=!0};
W23.prototype.updateImpl=function(){this._visible=!1;if(this._series.properties().showPriceLine.value()){var a=this._series.lastValueData(CLOSE_PLOT,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
W23.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a={};a.points=this._points;a.color=this._color;a.linewidth=this._series.properties().priceLineWidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};TradingView.defaultRequestOption=function(){return{count:DEFAULT_BAR_COUNT}};
TradingView.Series=function(a,b,c){PriceDataSource.call(this,a);this._boxSizeChanged=new Delegate;this._tagsChanged=new Delegate;this._symbolIntervalChanged=new Delegate;this._symbolResolved=new Delegate;this._symbolError=new Delegate;this._symbolNotPermitted=new Delegate;this._extendedHoursChanged=new Delegate;this._extendedHoursNotPermitted=new Delegate;this.chartTypeNotPermitted=new Delegate;this.intradaySpreadNotPermitted=new Delegate;this.intradayExchangeNotPermitted=new Delegate;this.customIntervalNotPermitted=
new Delegate;this.chartWidgetInitialized=new Delegate;this._startLoading=new Delegate;this._dataLoaded=new Delegate;this._tickmarksRangeChanged=new Delegate;this._barReceived=new Delegate;this._onChangedStyle=new Delegate;this._onCompleted=new Delegate;this._onStatusChanged=new Delegate;this._onRestarted=new Delegate;this._onSessionsStudyCreated=new Delegate;this.requestingIntradayWhenNotSupported=new Delegate;this.requestingResolutionWhenNotSupported=new Delegate;this.priceScaleChanged=new Delegate;
this._requestOptions=c?c:TradingView.defaultRequestOption();this.m_model=a;this._chartApi=a._chartApi;this.m_data=new A58(this,a);this.setProperties(b);this._prevChartStyle=b.style.value();this.$63();this._dataWindowView=new SeriesDataWindowView(this,a);this._statusView=new SeriesStatusView(this,a.properties());this._priceAxisViews=new List;this._priceAxisViews.append(new SeriesPriceAxisView(this,a));this._priceAxisViews.append(new ProjectionSeriesPriceAxisView(this,
a));this._symbolInfo=null;this._status=TradingView.Series.STATUS_OFFLINE;var d=this;this._turnaroundCounter=1;this._turnaround="s"+this._turnaroundCounter;this._handler=function(a){d.onData(a)};this.D2.addExclusion&&this.D2.addExclusion("visible");this._base=100;this._formatter=new PriceFormatter(this._base);this._predictBars=0;this._futureBarsPaneView=null;this.D2.showInDataWindow.listeners().subscribe(a,W79.prototype.fullUpdate);this.marketStatus=new WatchedValue;
this._seriesLoaded=!1;this.properties().minTick.listeners().subscribe(this,TradingView.Series.prototype._recreateFormatter);d=this;this.properties().minTick.listeners().subscribe(null,function(){d.m_model.D20(new A22(A22.FULL_UPDATE))});this._priceLineView=new W23(this);this.bindJapChartsInputs();this.createExtendedHoursProperty();this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()});this._extendedHoursNotPermitted.subscribe(this,
function(){this.D2.extendedHours.setValue(!1)});this._extendedHoursChanged.subscribe(this,function(){this._status!==TradingView.Series.STATUS_SNAPSHOT&&this.restart()});this._symbolIntervalChanged.subscribe(this,this.checkInterval);this.properties().showCountdown.listeners().subscribe(this,TradingView.Series.prototype._onChangeShowCountdown);this._onChangeShowCountdown(this.properties().showCountdown);this._recreateFormatter()};inherit(TradingView.Series,PriceDataSource);
TradingView.Series.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()};TradingView.Series.prototype._onChangeShowCountdown=function(a){var b=this;a.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){b._priceAxisViews.item(0).update();b.m_model.D20(new A22(A22.LIGHT_UPDATE))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)};
TradingView.Series.prototype.lastValueData=function(a,b,c){a={};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return null;var d=this.m_model.timeScale().visibleBars();if(d.isEmpty())return null;var e;if(b){b=this.data().bars().last();if(null==b)return null;e=b.value;b=parseInt(b)}else{b=this.data().bars().search(d.lastBar(),SEARCH_NEAREST_LEFT);if(void 0===b)return null;e=this.data().bars().valueAt(b.index);b=b.index}e=e[CLOSE_PLOT];c&&(a.price=e);this.priceScale().properties().percentage.value()&&
(c=this.nearestIndex(d.firstBar(),SEARCH_NEAREST_RIGHT),this.data().valueAt(c),c=this.firstValue(),e=this.priceScale().priceRange().convertToPercent(e,c));a.text=this.priceScale().formatter().format(e);c=this.barColorer().barStyle(b,!1);a.color=c.barColor;a.floatCoordinate=this.priceScale().priceToCoordinate(e,!0);a.coordinate=Math.round(a.floatCoordinate);return a};
TradingView.Series.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||DEFAULT_BAR_COUNT};
TradingView.Series.prototype._nextSymbolId=1;TradingView.Series.prototype._nextSeriesId=1;TradingView.Series.STYLE_BARS=0;TradingView.Series.STYLE_CANDLES=1;TradingView.Series.STYLE_LINE=2;TradingView.Series.STYLE_LINE_TYPE_MARKERS=0;TradingView.Series.STYLE_LINE_TYPE_STEP=1;TradingView.Series.STYLE_LINE_TYPE_SIMPLE=2;TradingView.Series.STYLE_AREA=3;TradingView.Series.STYLE_RENKO=4;TradingView.Series.STYLE_KAGI=5;TradingView.Series.STYLE_PNF=6;TradingView.Series.STYLE_PB=7;
TradingView.Series.STYLE_HEIKEN_ASHI=8;TradingView.Series.STYLE_HOLLOW_CANDLES=9;TradingView.Series.STATUS_OFFLINE=0;TradingView.Series.STATUS_RESOLVING=1;TradingView.Series.STATUS_LOADING=2;TradingView.Series.STATUS_READY=3;TradingView.Series.STATUS_INVALID_SYMBOL=4;TradingView.Series.STATUS_SNAPSHOT=5;TradingView.Series.STATUS_EOD=6;TradingView.Series.STATUS_PULSE=7;TradingView.Series.STATUS_DELAYED=8;TradingView.Series.STATUS_DELAYED_STREAMING=9;TradingView.Series.PERMISSION_DENIED="permission denied";
TradingView.Series.PD_REASON_SYMBOL="symbol";TradingView.Series.PD_REASON_EXTENDED_HOURS="extended_hours";TradingView.Series.STUDY_NOT_AUTH="study_not_auth";TradingView.Series.prototype.model=function(){return this.m_model};TradingView.Series.prototype.fixLastBar=function(){if(!this._futureBarsPaneView){var a=parseInt(this.data().last(),10)+1;this._futureBarsPaneView=new TradingView.$79(this,a)}};TradingView.Series.prototype.clearData=function(){this.data().clear()};
TradingView.Series.prototype.data=function(){return this.m_data};TradingView.Series.prototype.symbolId=function(){return this._symbolId};TradingView.Series.prototype.isPulse=function(){return this._symbolInfo&&0<this._symbolInfo.resolutions.length};TradingView.Series.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.Series.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged};TradingView.Series.prototype.onSymbolResolved=function(){return this._symbolResolved};
TradingView.Series.prototype.onSymbolError=function(){return this._symbolError};TradingView.Series.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted};TradingView.Series.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted};TradingView.Series.prototype.onStartLoading=function(){return this._startLoading};TradingView.Series.prototype.onDataLoaded=function(){return this._dataLoaded};TradingView.Series.prototype.onStatusChanged=function(){return this._onStatusChanged};
TradingView.Series.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged};TradingView.Series.prototype.onBarReceived=function(){return this._barReceived};TradingView.Series.prototype.onChangedStyle=function(){return this._onChangedStyle};TradingView.Series.prototype.onCompleted=function(){return this._onCompleted};TradingView.Series.prototype.onRestarted=function(){return this._onRestarted};TradingView.Series.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged};
TradingView.Series.prototype.status=function(){return this._status};TradingView.Series.prototype.isDWM=function(){return!(3600>+this.D2.interval.value())};TradingView.Series.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews.item(0)._fixedCoordinate};
TradingView.Series.prototype.$63=function(){this._projectionBarsPaneView=this._paneView=null;this._symbolLabelView=new TradingView.W38(this.m_model,this,CLOSE_PLOT,"firstShortName");var a=this.D2.style.value();switch(a){case TradingView.Series.STYLE_BARS:this._paneView=new W15(this,this.m_model);break;case TradingView.Series.STYLE_CANDLES:this._paneView=new W16(this,this.m_model);break;case TradingView.Series.STYLE_LINE:this._paneView=
new W20(this,this.D2.lineStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_AREA:this._paneView=new W13(this,this.D2.areaStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_RENKO:this._paneView=new W28(this,this.m_model);this._projectionBarsPaneView=new W27(this,this.m_model);break;case TradingView.Series.STYLE_PB:this._paneView=new W22(this,
this.m_model);this._projectionBarsPaneView=new W26(this,this.m_model);break;case TradingView.Series.STYLE_KAGI:this._paneView=new W19(this,this.m_model);this._projectionBarsPaneView=new W24(this,this.m_model);break;case TradingView.Series.STYLE_PNF:this._paneView=new W21(this,this.m_model);this._projectionBarsPaneView=new W25(this,this.m_model);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._paneView=
new W17(this,this.m_model);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._paneView=new W18(this,this.m_model);break;default:throw"Unknown chart style assigned: "+a;}};TradingView.Series.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache};
TradingView.Series.prototype.barColorer=function(){if(this._barColorerCache)return this._barColorerCache;for(var a=null,b=this.m_model.D19().size()-1;0<=b;b--){var c=this.m_model.D19().item(b);c.metaInfo&&isInherited(c.constructor,TradingView.Study)&&c.hasBarColorer()&&c.properties().visible.value()&&(c=c.barColorer(),null===a?a=c:a.pushBackBarColorer(c))}null===a?a=new SeriesBarColorer(this):a.pushBackBarColorer(new SeriesBarColorer(this));return this._barColorerCache=a};
TradingView.Series.prototype.properties=function(){return this.D2};
TradingView.Series.prototype.state=function(a){var b={type:this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};b.state.symbol=this._symbolInfo.ticker||b.state.symbol;a&&(b.bars=this.m_data.m_bars.state(),b.nsBars=this.m_data.m_nsBars.state(),b.symbolInfo=this._symbolInfo,b.rtPrice=this.data().lastProjectionPrice);b.boxSize=this.data().boxSize;return b};
TradingView.Series.prototype.uniqueId=function(){return this.symbol()+"|"+this.interval()};TradingView.Series.prototype.stateForAlert=function(){var a=this.state();a.uniqueId=this.uniqueId();return a};
TradingView.Series.prototype.restoreData=function(a,b,c,d,e){this._status=TradingView.Series.STATUS_SNAPSHOT;this.m_data.m_bars.restoreState(a);this.m_data.m_nsBars.restoreState(b);this.updateSymbolInfo(c);this.m_data.lastProjectionPrice=d;this.m_data.boxSize=e;e||(this.properties().style.value()==TradingView.Series.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()==TradingView.Series.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value()))};
TradingView.Series.prototype.setProperties=function(a){a.timeframe||a.merge({timeframe:""});a.shortName||a.merge({shortName:""});this.D2=a;this.D2.symbol.listeners().subscribe(this,TradingView.Series.prototype.changeSymbol);this.D2.interval.listeners().subscribe(this,TradingView.Series.prototype.changeInterval);this.D2.timeframe.listeners().subscribe(this,TradingView.Series.prototype.changeTimeFrame);this.D2.listeners().subscribe(this,TradingView.Series.prototype.changeProperties);
this.m_model.properties().scalesProperties.subscribe(this,TradingView.Series.prototype.fullUpdateChartWidget)};TradingView.Series.prototype.changeSymbol=function(){TradingView.trackEvent("GUI","Change symbol");this.setSymbolIntervalDelayed();this.m_model.checkLineToolSelection()};TradingView.Series.prototype.changeInterval=function(){TradingView.trackEvent("GUI","Change interval");this.setSymbolIntervalDelayed()};
TradingView.Series.prototype.changeTimeFrame=function(){TradingView.trackEvent("GUI","Change timeframe");timeframe=this.D2.interval.value()};TradingView.Series.prototype.title=function(){return this.properties().symbol.value()+", "+translatedIntervalString(this.properties().interval.value())};TradingView.Series.prototype.fullUpdateChartWidget=function(){var a=this;setTimeout(function(){a.m_model.fullUpdate()},300)};
TradingView.Series.prototype.changeProperties=function(a){a!==this.D2.symbol&&a!==this.D2.interval&&a!==this.D2.timeframe&&(this._tagsChanged.fire(),this.$63(),this.updateAllViews(),this.m_model.updateSource(this),this.fullUpdateChartWidget())};TradingView.Series.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++};TradingView.Series.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++};
TradingView.Series.prototype._clearLoadingTimer=function(){this.loadingTimer&&(TradingView.logDebug("Series loading took "+((new Date).getTime()-this._loadingStartTime)+" ms"),clearTimeout(this.loadingTimer),this.loadingTimer=null)};
TradingView.Series.prototype.onData=function(a){var b=this;switch(a.method){case "symbol_resolved":if(a.params[0]!==this._symbolId){TradingView.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+a.params[0]);break}this.updateSymbolInfo(a.params[1]);this.m_model.updateSource(this);this._symbolResolved.fire(this._symbolInfo);this.m_model.realignLineTools();var c=this.symbolInfo().minmov/this.symbolInfo().pricescale,d=this.properties();d.style.value()==TradingView.Series.STYLE_RENKO&&
d.renkoStyle.inputs.boxSize.value()<c?d.renkoStyle.inputs.merge({boxSize:c}):d.style.value()==TradingView.Series.STYLE_PNF&&d.pnfStyle.inputs.boxSize.value()<c?d.pnfStyle.inputs.merge({boxSize:c}):d.style.value()==TradingView.Series.STYLE_KAGI&&d.kagiStyle.inputs.reversalAmount.value()<c&&d.kagiStyle.inputs.merge({reversalAmount:c});break;case "symbol_error":if(a.params[0]!==this._symbolId){TradingView.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+a.params[0]);break}this._clearLoadingTimer();
this._setStatus(TradingView.Series.STATUS_INVALID_SYMBOL);this.D2.shortName.setValue(this.D2.symbol.value());this.m_model.clearAllStudies();this.updateAllViews();this.m_model.updateSource(this);if(a.params[1]==TradingView.Series.PERMISSION_DENIED)switch(a.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case TradingView.Series.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(a.params[3]);break;default:this._symbolNotPermitted.fire(a.params[2])}else this.m_model.resetTimeScale(),
this._symbolError.fire(),A72.sendReport("symbol_error",{chartSession:b._chartApi._sessionid,symbol:b.getSymbolString()});this.m_model.realignLineTools();break;case "series_timeframe":if(a.params[1]!==this._turnaround)break;c=a.params[3];d=a.params[4];this.m_model.setTimeViewport(a.params[2],"undefined"!=typeof d&&d?c:c+10);break;case "series_error":c=a.params[2];this._clearLoadingTimer();W77.enabled("charting_library_debug_mode")&&console.log("Error reason: "+c);c&&c.startsWith("study_not_auth:")?
(c=c.split(":",2)[1].split("@",2)[0],c in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(c):"BarSetSpread"===c&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"==c?this.intradayExchangeNotPermitted.fire():"custom_resolution"==c&&this.customIntervalNotPermitted.fire();this._setStatus(TradingView.Series.STATUS_INVALID_SYMBOL);break;case "series_loading":if(a.params[1]!==this._turnaround)break;if(a.params[0]!==this._seriesId){TradingView.logNormal("command for old series. Expected:"+
this._seriesId+", actual"+a.params.customId);break}this._setStatus(TradingView.Series.STATUS_LOADING);0==this.m_data.m_bars.size()&&(b._loadingStartTime=(new Date).getTime(),b.loadingTimer=setTimeout(function(){var a={chartSession:b._chartApi._sessionid,symbol:b.getSymbolString(),interval:b.interval()};A72.sendReport("series_loading",a)},15E3));break;case "series_completed":if(a.params[2]!==this._turnaround)break;if(a.params[0]!==this._seriesId){TradingView.logNormal("command for old series. Expected:"+
this._seriesId+", actual"+a.params.customId);break}c=a.params[1];"pulsed"==c&&(c="delayed");switch(c){case "streaming":this._setStatus(TradingView.Series.STATUS_READY);break;case "endofday":this._setStatus(TradingView.Series.STATUS_EOD);break;case "delayed":this._setStatus(TradingView.Series.STATUS_DELAYED);break;case "pulsed":this._setStatus(TradingView.Series.STATUS_PULSE)}c.match(/delayed_streaming/)&&this._setStatus(TradingView.Series.STATUS_DELAYED_STREAMING);this.requestMoreData();c=this.m_model.paneForSource(this);
c.recalculatePriceScale(this.priceScale());this.m_model.D20(new A22(A22.FULL_UPDATE));this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TIME_PLOT],end:this.data().last().value[TIME_PLOT]});this.model().recalcVisibleRangeStudy(this.model().D19(),!0);!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),
c=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(c.firstBar(),c.lastBar())));this._seriesLoaded=!0;this._onCompleted.fire();break;case "data_update":if(a.params.customId!==this._seriesId){TradingView.logNormal("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);break}if(this.status()===TradingView.Series.STATUS_INVALID_SYMBOL)break;this._clearLoadingTimer();0<a.params.plots.length&&(this._endOfData=!1);a.params.plots.length?(c=this.m_data.m_bars.size(),
this.m_data.m_bars.merge(a.params.plots),c!=this.bars().size()&&this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().D19(),!0)):(this.m_data.clear(),this._startLoading.fire());c=this.properties().style.value();!a.params.nonseries||c!==TradingView.Series.STYLE_RENKO&&c!==TradingView.Series.STYLE_KAGI&&c!==TradingView.Series.STYLE_PNF&&c!==TradingView.Series.STYLE_PB?a.params.nonseries||(this.m_data.m_nsBars.clear(),this.m_data.lastProjectionPrice=
void 0):(c=this.parseJapProjBars(a.params.nonseries),this.m_data.m_nsBars=c.nsBars,this.m_data.lastProjectionPrice=c.lastPrice,d=this.m_data.boxSize!==c.boxSize,this.m_data.boxSize=c.boxSize,d&&this._boxSizeChanged.fire(this.m_data.boxSize));c=this.m_model.paneForSource(this);this.m_model.updateAllVolumeStudies();this.m_model.recalculatePane(c);this.m_model.updateSource(this);this.m_model.updateLineTools()}this._dataLoaded.fire(a)};
TradingView.Series.prototype.fixBoxSize=function(){var a=this.model().timeScale(),b=this.priceScale();b.isEmpty()||a.isEmpty()||(this.m_data.boxSize=Math.abs(b.coordinateToPrice(a.barSpacing())-b.coordinateToPrice(0)))};
TradingView.Series.prototype.parseJapProjBars=function(a){var b=new PlotList(["time","open","high","low","close"]),c=this.model().timeScale(),d=this.properties().style.value();if(a.d&&""!==a.d)for(var e=JSON.parse(a.d).data,g=e.price,h=e.boxSize,e=e.bars,k=0;e&&k<e.length;k++){var l=[],m=a.indexes[e[k].time];l.push(c.points().valueAt(m));l.push(e[k].open);l.push(e[k].high);l.push(e[k].low);l.push(e[k].close);l.push(e[k].volume);d===TradingView.Series.STYLE_KAGI?l.push(e[k].additionalPrice):d===TradingView.Series.STYLE_PNF&&
l.push(e[k].factor);b.add(m,l)}return{nsBars:b,lastPrice:g,boxSize:h}};TradingView.Series.prototype.disconnect=function(){this._seriesId=this._symbolId=null;this._status=TradingView.Series.STATUS_OFFLINE};TradingView.Series.prototype.isStarted=function(){return!!this._symbolId};
TradingView.Series.prototype.restart=function(){this._onRestarted.fire();this._setStatus(TradingView.Series.STATUS_RESOLVING);this.m_data=new A58(this,this.model());this._prevSymbolId=this._symbolId;this._symbolId=this._makeNextSymbolId();this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler);this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,this.D2.interval.value(),
this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,this.D2.interval.value(),this._prepareChartApiParams(),this._handler));this.D2.showInDataWindow.listeners().subscribe(this.m_model,W79.prototype.fullUpdate);this.m_symbol=this.D2.symbol.value();this.m_interval=this.D2.interval.value();this._seriesLoaded=!1};
TradingView.Series.prototype._generateTimeframe=function(a,b){var c=b.right(1),d=a;"ytd"===b?d+=",YTD":"d"===c?(c=b.left(b.length-1),d+=","+c,W77.enabled("daily_timeframe_suffix")&&(d+="D")):"m"===c?(c=b.left(b.length-1),d+=","+c+"M"):"all"===b&&(d+=",ALL");return d};
TradingView.Series.prototype.setSymbolIntervalDelayed=function(){this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay);this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay;this.setSymbolInterval(this.D2.symbol.value(),this.D2.interval.value())}.bind(this),10)};
TradingView.Series.prototype.setSymbolInterval=function(a,b){var c=(b+"").split(","),d=0,e=b;2==c.length&&(e=c[0],d=c[1]);var c=!this.symbolSameAsCurrent(a)||W77.enabled("same_data_requery"),g=this.m_interval!==e||W77.enabled("same_data_requery");if(c||g)if(this.m_model.realignLineTools(),this.m_symbol=a,this.m_interval=e,this.m_timeframe=d,this._status!==TradingView.Series.STATUS_SNAPSHOT){this._setStatus(TradingView.Series.STATUS_RESOLVING);this._symbolId&&!c||this.updateSymbolInfo(null);
this._symbolIntervalChanged.fire();this._onRestarted.fire();if(this._chartApi&&this._chartApi.connected()){if(!this._symbolId||c)this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),d=this.getSymbolString(),this._chartApi.resolveSymbol(this._symbolId,d,this._handler);if(this._seriesId){this._modifyTimer&&clearTimeout(this._modifyTimer);var h=this;h._turnaround="s"+ ++h._turnaroundCounter;this._pendingInterval&&(b=this._generateTimeframe(b,this._pendingInterval),delete this._pendingInterval);
this._modifyTimer=setTimeout(function(){h._predictBars=0;h._chartApi.modifySeries(h._seriesId,h._turnaround,h._symbolId,b,h._handler,this._prevSymbolId);h._modifyTimer=null},30)}else this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,b,this._prepareChartApiParams(),this._handler)}this._seriesLoaded=!1;this._haveToScroll=!0}};
TradingView.Series.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().ticker||this.symbolInfo().full_name:this.symbol()};TradingView.Series.prototype.symbol=function(){return this.properties().symbol.value()};TradingView.Series.prototype.interval=function(){return this.properties().interval.value()};TradingView.Series.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&1440>=this.interval()};TradingView.Series.prototype.bars=function(){return this.m_data.m_bars};
TradingView.Series.prototype.nsBars=function(){return this.m_data.m_nsBars};TradingView.Series.prototype.open=function(a){return this.m_data.valueAt(a)[OPEN_PLOT]};TradingView.Series.prototype.high=function(a){return this.m_data.valueAt(a)[HIGH_PLOT]};TradingView.Series.prototype.low=function(a){return this.m_data.valueAt(a)[LOW_PLOT]};TradingView.Series.prototype.close=function(a){return this.m_data.valueAt(a)[CLOSE_PLOT]};
TradingView.Series.prototype.hl2=function(a){return(this.high(a)+this.low(a))/2};TradingView.Series.prototype.hlc3=function(a){return(this.high(a)+this.low(a)+this.close(a))/3};TradingView.Series.prototype.ohlc4=function(a){return(this.open(a)+this.high(a)+this.low(a)+this.close(a))/4};
TradingView.Series.prototype.priceRange=function(a,b){if(!isInteger(a))return TradingView.logDebug("Series.priceRange: incorrect startBar"),null;if(!isInteger(b))return TradingView.logDebug("Series.priceRange: incorrect endBar"),null;if(this.data().isEmpty())return null;if(this.isLockScale()){var c=this.data().boxSize;void 0===c&&this.fixBoxSize();var d=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),c=this.data().search(b,SEARCH_NEAREST_LEFT),c=(c.value[HIGH_PLOT]+
c.value[LOW_PLOT])/2,d=new PriceRange(c-.5*d,c+.5*d),c=this.data().search(a,SEARCH_NEAREST_RIGHT);return this.priceScale().properties().percentage.value()&&d?d.convertToPercents(c.value[CLOSE_PLOT]):d}this.properties().style.value===TradingView.Series.STYLE_PNF&&(c=this.data().boxSize,d.apply(d.minValue()-.5*c,d.maxValue()+.5*c));d=function(a,b,c){a.firstBar||(a.firstBar=c);null===a.range?a.range=new PriceRange(c[LOW_PLOT],c[HIGH_PLOT]):a.range.apply(c[LOW_PLOT],c[HIGH_PLOT]);return a};c={range:null,
firstBar:null};c=this.data().bars().range(a,b).reduce(d,c);c=this.data().nsBars().range(a,b).reduce(d,c);d=c.range;c=c.firstBar;d&&d.minValue()===d.maxValue()&&(d=new PriceRange(d.minValue()-.5,d.maxValue()+.5));return this.priceScale().properties().percentage.value()&&d?d.convertToPercents(c[CLOSE_PLOT]):this.priceScale().isLog()&&d?new PriceRange(this.priceScale().priceToLogical(d.minValue()),this.priceScale().priceToLogical(d.maxValue())):d};
TradingView.Series.prototype.nearestData=function(a,b){if(isInteger(a)){var c=this.data().search(a,b);return c?c:void 0}TradingView.logDebug("Series.nearestData: incorrect logicalPoint")};TradingView.Series.prototype.nearestIndex=function(a,b){var c=this.nearestData(a,b);return c?c.index:void 0};
TradingView.Series.prototype.paneViews=function(a){if(!this.properties().visible.value())return null;a=(new List).append(this._paneView);this._futureBarsPaneView&&a.append(this._futureBarsPaneView);this._projectionBarsPaneView&&a.append(this._projectionBarsPaneView);a.append(this._priceLineView);a.append(this._symbolLabelView);return a};TradingView.Series.prototype.dataWindowView=function(){return this._dataWindowView};TradingView.Series.prototype.statusView=function(){return this._statusView};
TradingView.Series.prototype.priceAxisViews=function(a,b){return this.m_model.paneForSource(this)===a&&b===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null};TradingView.Series.prototype.base=function(){return this._base};TradingView.Series.prototype.formatter=function(){return this._formatter};TradingView.Series.prototype.purgeSymbolInfo=function(){this._symbolInfo=null};
TradingView.Series.prototype.symbolInfo=function(){return this._symbolInfo};
TradingView.Series.prototype._recreateFormatter=function(){if("default"==this.properties().minTick.value())this._formatter=new PriceFormatter(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,this._symbolInfo?this._symbolInfo.fractional:!1,this._symbolInfo?this._symbolInfo.minmove2:void 0);else{var a=this.properties().minTick.value().split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&this.priceScale().updateFormatter()};
TradingView.Series.prototype.updateSymbolInfo=function(a){var b=this,c=a&&(a.ticker||a.pro_name||a.full_name);if(this._symbolInfo=a)this.D2.shortName.setValue(a.name),c&&this.D2.symbol.value().toUpperCase()!==c.toUpperCase()&&this.D2.symbol.setValue(c);this._base=a?a.pricescale/a.minmov:100;this._recreateFormatter();this._statusView.update();this.priceScale().updateFormatter();"undefined"!==typeof quoteSessionMultiplexerInstance&&(this._quoteSessionClientId||(this._quoteSessionClientId=
"series-"+TradingView.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),c&&(this._quoteSessionSymbol=c,quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(a,c){b.quoteData=a&&a.values||null;c&&c.values&&c.values.current_session&&b.marketStatus.setValue(c.values.current_session)})));this.checkInterval();this.dataPoweredBy=
TradingView.getDataVendorString(a)};TradingView.Series.prototype.symbolSameAsCurrent=function(a){if(this.m_symbol===a)return!0;var b=this._symbolInfo;return!b||b.full_name!==a&&b.pro_name!==a?!1:!0};
TradingView.Series.prototype.updateAllViews=function(){this._paneView.update();this._dataWindowView.update();this._statusView.update();this._priceAxisViews.item(0).update();this._priceAxisViews.item(1).update();this._futureBarsPaneView&&this._futureBarsPaneView.update();this._projectionBarsPaneView&&this._projectionBarsPaneView.update();this._priceLineView.update();this._symbolInfo&&this._symbolLabelView.update()};
TradingView.Series.prototype.tags=function(){var a=[this.D2.symbol.value(),this.D2.interval.value()+"minutes"];if(this._symbolInfo&&this._symbolInfo.description){var b=this._symbolInfo.description.replace(",","").split(" ");a.push(b)}return a};TradingView.Series.prototype._setStatus=function(a){this._status=a;this._statusView.update();this.m_model.updateSource(this);this._onStatusChanged.fire()};
TradingView.Series.prototype.requestMoreData=function(){if((this._status===TradingView.Series.STATUS_READY||this._status===TradingView.Series.STATUS_PULSE||this._status===TradingView.Series.STATUS_DELAYED||this._status===TradingView.Series.STATUS_DELAYED_STREAMING||this._status===TradingView.Series.STATUS_EOD)&&!this.m_model.timeScale().isEmpty()){var a=this.m_model.timeScale().visibleBars();if(!a.isEmpty()&&0!==this.bars().size()){var b=a.lastBar()-this.data().last();this._predictBars<b&&(this._predictBars=
b,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,b,this._handler));this._endOfData||(a=this.bars()._indexAt(0)-a.firstBar(),0>=a||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreData(this._seriesId,a,this._handler),this._setStatus(TradingView.Series.STATUS_LOADING)))}}};
TradingView.Series.prototype.bindJapChartsInputs=function(){this.D2.style.listeners().subscribe(this,this.onChartStyleChanged);this.D2.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);this.D2.pbStyle.inputs.lb.listeners().subscribe(this,
this.onInputChanged);this.D2.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.D2.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.sources.listeners().subscribe(this,
this.onInputChanged);this.D2.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var a=this;this.D2.lockScale.listeners().subscribe(this,function(b){b.value()&&a.model().timeScale().recalcLockedScale()})};
TradingView.Series.prototype.createExtendedHoursProperty=function(){function a(){var a=window.user?!!user.extended_session:!1,d=b.model().readOnly(),e=b.D2.extendedHours.value();!e||d||a||(b._extendedHoursNotPermitted.fire(),e=!1);e&&!b.isIntradayInterval()&&(e=!1);b.extendedHours.setValue(e)}var b=this;b.extendedHours=new Property;b.D2.extendedHours.listeners().subscribe(null,a);b.D2.interval.listeners().subscribe(null,a);b.chartWidgetInitialized.subscribe(null,a);a()};
TradingView.Series.prototype.isNeedRestart=function(a){void 0===a&&(a=this.properties().style.value());if(this._prevChartStyle!=a){var b=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA];if(!(-1<b.indexOf(this._prevChartStyle)&&-1<b.indexOf(a)))return!0}return!1};
TradingView.Series.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart());this._prevChartStyle=this.properties().style.value();this._onChangedStyle.fire(this.properties().style.value())};TradingView.Series.prototype.onInputChanged=function(){this.restart()};TradingView.Series.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged};
TradingView.Series.prototype.getSymbolString=function(){var a;a=W77.enabled("pay_attention_to_ticker_not_symbol")?this._symbolInfo?this._symbolInfo.ticker:this.D2.symbol.value():this.D2.symbol.value();this.extendedHours.value()&&(a={symbol:a,session:"extended"});switch(this.D2.style.value()){case TradingView.Series.STYLE_RENKO:var b=this.D2.renkoStyle.inputs;a={symbol:a,type:"BarSetRenko@tv-prostudies-1!",inputs:[b.source.value(),b.style.value(),b.boxSize.value(),
b.atrLength.value()]};break;case TradingView.Series.STYLE_PB:b=this.D2.pbStyle.inputs;a={symbol:a,type:"BarSetPriceBreak@tv-prostudies-1!",inputs:[b.source.value(),b.lb.value()]};break;case TradingView.Series.STYLE_KAGI:b=this.D2.kagiStyle.inputs;a={symbol:a,type:"BarSetKagi@tv-prostudies-1!",inputs:[b.source.value(),b.reversalAmount.value()]};break;case TradingView.Series.STYLE_PNF:b=this.D2.pnfStyle.inputs;a={symbol:a,type:"BarSetPnF@tv-prostudies-1!",inputs:[b.sources.value(),
b.style.value(),b.boxSize.value(),b.atrLength.value(),b.reversalAmount.value()]};break;case TradingView.Series.STYLE_HEIKEN_ASHI:a={symbol:a,type:"BarSetHeikenAshi@tv-basicstudies-1!",inputs:[]}}"string"!==typeof a&&(a="="+JSON.stringify(a));return a};
TradingView.Series.prototype.getStyleShortName=function(){switch(this.D2.style.value()){case TradingView.Series.STYLE_BARS:return"bar";case TradingView.Series.STYLE_CANDLES:return"candle";case TradingView.Series.STYLE_HOLLOW_CANDLES:return"hollowCandle";case TradingView.Series.STYLE_LINE:return"line";case TradingView.Series.STYLE_AREA:return"area";case TradingView.Series.STYLE_RENKO:return"renko";case TradingView.Series.STYLE_PB:return"pb";case TradingView.Series.STYLE_KAGI:return"kagi";
case TradingView.Series.STYLE_PNF:return"pnf";case TradingView.Series.STYLE_HEIKEN_ASHI:return"ha";default:throw Error("Missed short name for style "+this.D2.style.value());}};TradingView.Series.prototype.getInputsProperties=function(){var a=this.D2[this.getStyleShortName()+"Style"];a.inputs||a.addProperty("inputs");return a.inputs};
TradingView.Series.prototype.getRealVisibleRange=function(){var a=this.model().timeScale().visibleBars(),b;b=this.data().search(a.m_firstBar,SEARCH_NEAREST_RIGHT);a=this.data().search(a.m_lastBar,SEARCH_NEAREST_LEFT);return void 0===b||void 0===a?null:new BarsRange(b.index,a.index)};TradingView.Series.prototype.isLockScale=function(){return this.properties().lockScale.value()};TradingView.Series.prototype.firstValue=function(){return this.data().firstValue()};
TradingView.Series.prototype.firstBar=function(){return this.data().firstBar()};TradingView.Series.prototype.sessionsStudy=function(){if(this._sessionsStudy)return this._sessionsStudy;var a=this.model().paneForSource(this).D19();for(i=0;i<a.size();i++){var b=a.item(i);if(b instanceof TradingView.Study&&"Sessions"==b.metaInfo().shortId)return this._sessionsStudy=b}return!1};
TradingView.Series.prototype.createSessStudy=function(){if(!W77.enabled("charting_library")&&!this.sessionsStudy()){var a=StudyMetaInfo.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(a,!1,!0);this._onSessionsStudyCreated.fire()}};TradingView.Series.prototype.checkSessStudy=function(){W77.enabled("charting_library")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())};
TradingView.Series.prototype.isSpread=function(){return 1<this._symbolInfo.legs.length};TradingView.Series.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""};TradingView.Series.prototype.firstShortName=function(){return A68.ticker(this.firstSymbol())};TradingView.Series.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated};
TradingView.Series.prototype.loadDataTo=function(a){a.right(1);this._turnaround="s"+ ++this._turnaroundCounter;var b=this.D2.interval.value(),b=this._generateTimeframe(b,a);this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,b,this._handler)};
TradingView.Series.prototype.checkInterval=function(){if(this._symbolInfo&&(this.isDWM()||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var a=this.D2.interval.value();-1==this._symbolInfo.supported_resolutions.indexOf(a)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}};
TradingView.Series.prototype.setPriceScale=function(a){this.m_priceScale!=a&&(this.m_priceScale=a,this.priceScaleChanged.fire(a))};function SeriesDataWindowView(a,b){DataWindowView.call(this);this._series=a;this.D0=b;this._items.append(new DataWindowItem($.t("Open",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("High",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("Low",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("Close",{context:"in_legend"}),""));this._invalidated=!0;this.update()}inherit(SeriesDataWindowView,DataWindowView);
SeriesDataWindowView.prototype.update=function(){this._invalidated=!0};
SeriesDataWindowView.prototype._updateImpl=function(){this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,translatedIntervalString(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol();this._items.item(0).setValue($.t("n/a"));this._items.item(1).setValue($.t("n/a"));this._items.item(2).setValue($.t("n/a"));this._items.item(3).setValue($.t("n/a"));if(!this.D0.timeScale().isEmpty()&&
0!==this._series.bars().size()){var a=this._series.barColorer(),b=this.D0.crossHairSource().index,b=this._series.nearestIndex(b,SEARCH_NEAREST_LEFT);if(void 0!==b){var c=this._series.data().valueAt(b),d=this._series.formatter();this._items.item(0).setValue(d.format(c[OPEN_PLOT]));this._items.item(1).setValue(d.format(c[HIGH_PLOT]));this._items.item(2).setValue(d.format(c[LOW_PLOT]));this._items.item(3).setValue(d.format(c[CLOSE_PLOT]));a=a.barStyle(b,!1).barColor;b=this._series.model().paneForSource(this._series).D2.background.value();
TradingView.colorsAreSimilar(a,b)&&(a=TradingView.invertColor(a));for(b=0;4>b;b++)this._items.item(b).setColor(a)}}};SeriesDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};SeriesDataWindowView.prototype.dump=function(){return{header:this._header,items:this._items}};SeriesDataWindowView.prototype.additional=function(){if(this._series.dataPoweredBy)return"(Data Provided by "+this._series.dataPoweredBy+")"};function W14(a,b){this.m_series=a;this.m_model=b;this.m_bars=new List;this._invalidated=!0}W14.prototype.update=function(){this._invalidated=!0};
W14.prototype._updateImpl=function(){var a=this;this.m_bars.clear();if(!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()){var b=this.m_model.timeScale().visibleBars();if(!b.isEmpty()&&0!==this.m_series.bars().size()){for(var c=this.m_series.nearestIndex(b.firstBar(),SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(b.lastBar(),SEARCH_NEAREST_LEFT);c<=d&&void 0===this.m_series.bars().valueAt(c);c++);if(!(c>d)){var b=this.m_series.bars().range(c,d),e=void 0;
this.m_series.bars().first();var g=this.m_series.priceScale(),h=g.properties().percentage.value(),k=this.m_series.barColorer(),l={};b.each(function(b,c){if(void 0!=c[OPEN_PLOT]&&void 0!=c[HIGH_PLOT]&&void 0!=c[LOW_PLOT]&&void 0!=c[CLOSE_PLOT]){void 0===e&&(e=c[CLOSE_PLOT]);var d=new BarItem;d.setTime(Math.round(b));h?(d.setOpen(100*(c[OPEN_PLOT]-e)/e),d.setHigh(100*(c[HIGH_PLOT]-e)/e),d.setLow(100*(c[LOW_PLOT]-e)/e),d.setClose(100*(c[CLOSE_PLOT]-e)/e)):(d.setOpen(c[OPEN_PLOT]),d.setHigh(c[HIGH_PLOT]),
d.setLow(c[LOW_PLOT]),d.setClose(c[CLOSE_PLOT]));l.value=c;var g=k.barStyle(b,!1,l);l.previousValue=c;d.color=g.barColor;d.borderColor=g.barBorderColor;d.hollow=g.isBarHollow;a.m_bars.append(d)}},this);g.barPricesToCoordinates(this.m_bars);this.m_model.timeScale().barIndexesToCoordinates(this.m_bars);if(this.m_series===this.m_model.selectedSource())for(b=(new SelectionIndexes).calc(c,d),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,c=0;c<b.size();c++){var d=
b.item(c),m=this.m_series.bars().valueAt(d);m&&(m=.5*(m[OPEN_PLOT]+m[CLOSE_PLOT]),g.properties().percentage.value()&&(m=100*(m-e)/e),d=this.m_model.timeScale().indexToCoordinate(d),m=this.m_series.priceScale().priceToCoordinate(m),this._selectionData.points.append(new MathEx.Point(d,m)))}}}}};W14.prototype.items=function(){return this.m_bars};W14.prototype.dump=function(){var a={};a.bars=this.m_bars;return a};
function W15(a,b){W14.call(this,a,b)}inherit(W15,W14);
W15.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value();var b=new CompositeRenderer;b.append(new W56(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};
function W16(a,b){W14.call(this,a,b)}inherit(W16,W14);
W16.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().candleStyle.drawWick.value();a.drawBorder=this.m_series.properties().candleStyle.drawBorder.value();a.borderColor=this.m_series.properties().candleStyle.borderColor.value();a.wickColor=this.m_series.properties().candleStyle.wickColor.value();var b=new CompositeRenderer;b.append(new W57(a));
this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function W17(a,b){W14.call(this,a,b)}inherit(W17,W14);
W17.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().haStyle.drawWick.value();a.drawBorder=this.m_series.properties().haStyle.drawBorder.value();a.borderColor=this.m_series.properties().haStyle.borderColor.value();a.wickColor=this.m_series.properties().haStyle.wickColor.value();var b=new CompositeRenderer;b.append(new W57(a));
this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function W18(a,b){W14.call(this,a,b)}inherit(W18,W14);
W18.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value();a.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value();a.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value();a.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value();
var b=new CompositeRenderer;b.append(new W57(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};
function W29(a,b,c){this.m_series=a;this.m_priceSource=b;this.m_model=c;this.m_items=new List;this._barGetter={open:function(a){return a[OPEN_PLOT]},high:function(a){return a[HIGH_PLOT]},low:function(a){return a[LOW_PLOT]},close:function(a){return a[CLOSE_PLOT]},hl2:function(a){return(a[HIGH_PLOT]+a[LOW_PLOT])/2},hlc3:function(a){return(a[HIGH_PLOT]+a[LOW_PLOT]+a[CLOSE_PLOT])/3},ohlc4:function(a){return(a[OPEN_PLOT]+a[HIGH_PLOT]+a[LOW_PLOT]+a[CLOSE_PLOT])/4}}[this.m_priceSource]}
W29.prototype.update=function(){this.m_items.clear();if(!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()){var a=this.m_model.timeScale().visibleBars();if(!a.isEmpty()&&0!==this.m_series.bars().size()){var b=this.m_series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),SEARCH_NEAREST_LEFT),a=this.m_series.bars().range(b,c);this.m_series.bars();var d=void 0,e=this.m_series.priceScale();
this.m_series.barColorer();for(var g={color:this.m_series.properties().lineStyle.color.value()},h=e.properties().percentage.value(),k=a._start;k<a._end;++k){var l=a._indexAt(k),m=a._valueAt(k),m=this._barGetter(m);void 0!==m&&null!==m&&(void 0===d&&(d=m),h&&(m=100*(m-d)/d),l=new MathEx.Point(l,m),l.style=g,this.m_items.append(l))}e.pointsArrayToCoordinates(this.m_items.toArray());this.m_model.timeScale().indexesToCoordinates(this.m_items);if(this.m_series===this.m_model.selectedSource())for(a=(new SelectionIndexes).calc(b,
c),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,k=0;k<a.size();k++)l=a.item(k),b=this.m_series.data().valueAt(l),m=this._barGetter(b),e.properties().percentage.value()&&(m=100*(m-d)/d),l=this.m_model.timeScale().indexToCoordinate(l),b=this.m_series.priceScale().priceToCoordinate(m),this._selectionData.points.append(new MathEx.Point(l,b))}}};function W20(a,b,c){W29.call(this,a,b,c);this._invaidated=!0}
inherit(W20,W29);W20.prototype.update=function(){this._invalidated=!0};
W20.prototype.renderer=function(){this._invalidated&&(W29.prototype.update.call(this),this._invalidated=!1);var a=this.m_series.properties().lineStyle,a={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:a.color.value(),lineStyle:a.linestyle.value(),withMarkers:a.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:a.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:a.linewidth.value(),simpleMode:!0},
a=new W68(a),b;this.m_series===this.m_model.selectedSource()?(b=new CompositeRenderer,b.append(a),b.append(new SelectionRenderer(this._selectionData))):b=a;return b};function W13(a,b,c){W29.call(this,a,b,c);this._invaidated=!0}inherit(W13,W29);W13.prototype.update=function(){this._invalidated=!0};
W13.prototype.renderer=function(){this._invalidated&&(W29.prototype.update.call(this),this._invalidated=!1);var a={simpleMode:!1};a.barSpacing=this.m_model.timeScale().barSpacing();a.items=this.m_items;a.lineColor=this.m_series.properties().areaStyle.linecolor.value();a.lineStyle=this.m_series.properties().areaStyle.linestyle.value();a.lineWidth=this.m_series.properties().areaStyle.linewidth.value();var b=this.m_series.properties().areaStyle.transparency.value();
a.color1=generateColor(this.m_series.properties().areaStyle.color1.value(),b);a.color2=generateColor(this.m_series.properties().areaStyle.color2.value(),b);a.bottom=this.m_series.priceScale().height();b=new CompositeRenderer;b.append(new W53(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function SeriesStatusView(a,b){StatusView.call(this,b);this._series=a;this._series.onRestarted().subscribe(this,SeriesStatusView.prototype.D20);this._series.onSymbolResolved().subscribe(this,SeriesStatusView.prototype.D20);this._series.onBoxSizeChanged().subscribe(this,SeriesStatusView.prototype.D20)}inherit(SeriesStatusView,StatusView);SeriesStatusView.prototype.D20=function(){delete this._text;this.update()};
SeriesStatusView.prototype.round=function(a,b){var c=Math.round(a*Math.pow(10,b))/Math.pow(10,b);return c?c:""};
SeriesStatusView.prototype.update=function(){if(!("_text"in this)){this._series.symbolInfo()?this._text=this._series.symbolInfo().description:this._text=this._series.symbol();this._text+=", "+translatedIntervalString(this._series.interval());if(this._series.symbolInfo()&&this._series.symbolInfo().exchange){var a=this._series.symbolInfo().exchange;"forex"==this._series.symbolInfo().type&&(a="FX");this._text+=", "+a}a=this._series.D2;switch(a.style.value()){case TradingView.Series.STYLE_RENKO:var b=
a.renkoStyle.inputs.style.value()+("ATR"===a.renkoStyle.inputs.style.value()?"("+a.renkoStyle.inputs.atrLength.value()+")":"");this._text+=", Renko ["+a.renkoStyle.inputs.source.value()+", "+b+", "+this.round(this._series.data().boxSize,4)+"]";break;case TradingView.Series.STYLE_PB:this._text+=", Line Break ["+a.pbStyle.inputs.source.value()+", "+a.pbStyle.inputs.lb.value()+"]";break;case TradingView.Series.STYLE_KAGI:this._text+=", Kagi ["+a.kagiStyle.inputs.source.value()+", "+a.kagiStyle.inputs.reversalAmount.value()+
"]";break;case TradingView.Series.STYLE_PNF:b=a.pnfStyle.inputs.style.value()+("ATR"===a.pnfStyle.inputs.style.value()?"("+a.pnfStyle.inputs.atrLength.value()+")":"");this._text+=", PnF ["+a.pnfStyle.inputs.sources.value()+", "+b+", "+this.round(this._series.data().boxSize,4)+", "+a.pnfStyle.inputs.reversalAmount.value()+"]";break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._text+=", "+$.t("Heiken Ashi")}this._bold=!1;this._size="17px"}};function SeriesPriceAxisView(a,b){this._series=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invalidated=!0}inherit(SeriesPriceAxisView,PriceAxisView);SeriesPriceAxisView.prototype.update=function(){this._invalidated=!0};
SeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(a=this._series.lastValueData())if(this._visible=!0,this._text=this.D0.properties().scalesProperties.showSeriesLastValue.value()?a.text:"",a.color!=this._background&&(this._background=a.color,this._color=this.color()),this._coordinate=a.coordinate,this._floatCoordinate=a.floatCoordinate,this._textHeight=this._series.priceScale().m_markBuilder.fontHeight(),this._countdown=null,W77.enabled("countdown")&&
this._series.properties().showCountdown.value()&&(a=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_HEIKEN_ASHI],!this._series.isDWM()&&-1!=a.indexOf(this._series.properties().style.value()))){var b=1E3*this._series.data().bars().last().value[0];(new Date).getTimezoneOffset();var c=1E3*this._series.serverTimeOffset();a=this._series.interval();b=Math.round((b.valueOf()+
6E4*a-((new Date).valueOf()+c))/1E3);0<b&&(b=Math.min(b,60*a),a="",3600<=b&&(a=""+Math.floor(b/3600)+":"),b%=3600,c=("0"+Math.floor(b/60)).right(2),b=("0"+Math.floor(b%60)).right(2),this._countdown=a+c+":"+b)}};SeriesPriceAxisView.prototype.font=function(){return"11px Arial"};SeriesPriceAxisView.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
SeriesPriceAxisView.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);this._cacheFont!=this.font()&&(this._cacheFont=this.font(),this._cache=new TextWidthCache);var a={text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible,font:this.font(),secondLine:this._countdown};return new PriceAxisViewRenderer(a,this._cache)};
SeriesPriceAxisView.prototype.dump=function(){return{text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible}};SeriesPriceAxisView.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};function ProjectionSeriesPriceAxisView(a,b){SeriesPriceAxisView.call(this,a,b)}inherit(ProjectionSeriesPriceAxisView,SeriesPriceAxisView);ProjectionSeriesPriceAxisView.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice};
ProjectionSeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(!this.D0.timeScale().isEmpty()&&!this._series.priceScale().isEmpty()&&this.lastPrice()&&(a=this.D0.timeScale().visibleBars(),!a.isEmpty())){var b=this._series.data().search(a.lastBar(),SEARCH_NEAREST_LEFT);if(void 0!==b){a=this._series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT);a=this._series.data().valueAt(a)[CLOSE_PLOT];this._visible=!0;this._series.data().last();var c=this.lastPrice();
this._series.priceScale().properties().percentage.value()&&(c=100*(c-a)/a);this._text=this._series.priceScale().formatter().format(c);this._background=this._series.barColorer().barStyle(b.index,!0).barColor;this._coordinate=this._series.priceScale().priceToCoordinate(c);this._textHeight=this._series.priceScale().m_markBuilder.fontHeight()}}};TradingView.StudyConsts={PLOT_TYPE_LINE:"line",PLOT_TYPE_COLORER:"colorer",PLOT_TYPE_BAR_COLORER:"bar_colorer",PLOT_TYPE_BG_COLORER:"bg_colorer",PLOT_TYPE_SHAPES:"shapes",PLOT_TYPE_CHARS:"chars",PLOT_TYPE_ARROWS:"arrows",PLOT_TYPE_DATAOFFSET:"dataoffset",PLOT_LINE:0,PLOT_HISTOGRAM:1,PLOT_CROSS:3,PLOT_AREA:4,PLOT_COLUMNS:5,PLOT_CIRCLES:6,PLOT_LINE_WITH_BREAKS:7,PLOT_AREA_WITH_BREAKS:8,SCALE_RIGHT:0,SCALE_LEFT:1,SCALE_NONE:2};TradingView.StudyPlotShapes={};TradingView.StudyPlotShapes.Data={};
TradingView.StudyPlotShapes.registerPlotShape=function(a,b,c,d){if(a in TradingView.StudyPlotShapes.Data)throw Error("Plot shape "+a+" already registered!");TradingView.StudyPlotShapes.Data[a]={id:a,pineName:b,guiName:c,paneRendererClass:d}};TradingView.StudyPlotShapes.SHAPE_CROSS="shape_cross";TradingView.StudyPlotShapes.SHAPE_XCROSS="shape_xcross";TradingView.StudyPlotShapes.SHAPE_CIRCLE="shape_circle";TradingView.StudyPlotShapes.SHAPE_TRIANGLE_UP="shape_triangle_up";
TradingView.StudyPlotShapes.SHAPE_TRIANGLE_DOWN="shape_triangle_down";TradingView.StudyPlotShapes.SHAPE_FLAG="shape_flag";TradingView.StudyPlotShapes.SHAPE_ARROW_UP="shape_arrow_up";TradingView.StudyPlotShapes.SHAPE_ARROW_DOWN="shape_arrow_down";TradingView.StudyPlotShapes.SHAPE_SQUARE="shape_square";TradingView.StudyPlotShapes.SHAPE_DIAMOND="shape_diamond";TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CROSS,"shape.cross","Cross","W63");
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_XCROSS,"shape.xcross","X Cross","W74");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CIRCLE,"shape.circle","Circle","W59");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_UP,"shape.triangleup","Triangle Up","W72");
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_DOWN,"shape.triangledown","Triangle Down","W71");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_FLAG,"shape.flag","Flag","W64");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_ARROW_UP,"shape.arrowup","Arrow Up","PaneRendererArrowUp");
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_ARROW_DOWN,"shape.arrowdown","Arrow Down","PaneRendererArrowDown");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_SQUARE,"shape.square","Square","PaneRendererSquare");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_DIAMOND,"shape.diamond","Diamond","PaneRendererDiamond");function W37(a,b,c,d){this.D1=a;this.m_series=b;this.m_model=c;this._plotName=d;this._visible=!1;this._points=(new List).append(new MathEx.Point(0,0))}W37.prototype.update=function(){this._visible=!1;var a=this.D1.lastValueData(this._plotName,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)};
W37.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=this.D1.properties().styles[this._plotName].linewidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};
function defaultPlotOptions(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}TradingView.createStudy=function(a,b,c,d){var e="study_"+(d.classId||d.shortId);return TradingView[e]?new TradingView[e](a,b,c,d):new TradingView.Study(a,b,c,d)};TradingView.prepareStudyProperties=function(a,b,c,d){return TradingView.prepareStudyPropertiesWithRoot(a,b,c,d,"study_"+a.id)};
TradingView.prepareStudyPropertiesWithRoot=function(a,b,c,d,e){b=TradingView.prepareStudyPropsState(a,b,c,d);e=new $52(e,b,!0);e.addExclusion("visible");e.addExclusion("precision");e.addExclusion("minTick");for(b=0;b<a.inputs.length;++b)c=a.inputs[b],c.isHidden&&(e.addExclusion("inputs."+b.toString()),e.addExclusion("inputs."+c.id));return e};
TradingView.prepareStudyPropertiesForLoadChart=function(a,b,c,d,e){return TradingView.prepareStudyPropertiesForLoadChartWithRoot(a,b,c,d,e,"study_"+a.id)};
TradingView.prepareStudyPropertiesForLoadChartWithRoot=function(a,b,c,d,e,g){c=TradingView.prepareStudyPropsStateForLoadChart(a,b,c,d,e);g=new $52(g,c,!0);g.addExclusion("visible");g.addExclusion("precision");g.addExclusion("minTick");a=b||a;for(b=0;b<a.inputs.length;++b)c=a.inputs[b],c.isHidden&&(g.addExclusion("inputs."+b.toString()),g.addExclusion("inputs."+c.id));return g};
TradingView.prepareStudyPropsState=function(a,b,c,d){if(1>StudyMetaInfo.versionOf(a))throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");var e=TradingView.clone(defaults("study"));TradingView.preparePlotStyles(e,a);var g=TradingView.clone(defaults("study_"+a.id,d));a.isTVScript&&a.TVScriptSourceCode!==g.TVScriptSourceCode&&(g=TradingView.clone(factoryDefaults("study_"+a.id,d)));TradingView.merge(e,g);b&&(assert(!(b instanceof Property),"propsState should not be an instance of Property"),
TradingView.merge(e,b));d=TradingView.convertMetainfoInputsArrayToObject(a);g={};A0.mergeInputs(g,d.defaults.inputs);A0.mergeInputsObjPart(g,e.inputs);A0.mergeInputsArrPart(g,d.inputs);e.inputs=g;delete d.inputs;delete d.defaults.inputs;g={};TradingView.merge(g,d.defaults);TradingView.merge(g,factoryDefaults("study_"+d.id));TradingView.merge(g,e);TradingView.merge(g,d);delete g.defaults;e=g;a=TradingView.calcDefaultColorsOffset(c,
a);TradingView.merge(e,TradingView.shiftDefaultColors(e,a));b&&TradingView.merge(e.styles,b.styles);return e};
TradingView.prepareStudyPropsStateForLoadChart=function(a,b,c,d,e){var g=StudyMetaInfo.versionOf(a);a.version&&c.version&&a.version!==c.version&&"undefined"!==typeof console&&console.warn("Serialized metaInfo version "+a.version+" is not equal to the saved state version "+c.version);var h=TradingView.clone(defaults("study"));if(0==g){TradingView.merge(h,TradingView.clone(a));var k=TradingView.convertMetainfoInputsArrayToObject(a);TradingView.merge(h.inputs,k.inputs)}else 1<=g&&TradingView.merge(h,
TradingView.clone(a.defaults));TradingView.merge(h,factoryDefaults("study_"+a.id));TradingView.preparePlotStyles(h,a);TradingView.merge(h,c);1<=g&&(TradingView.merge(h,TradingView.clone(a)),delete h.defaults);h=e.updateStudyState(h,a,b);(a=b||a)&&1<=StudyMetaInfo.versionOf(a)&&(a=TradingView.convertMetainfoInputsArrayToObject(a),b={},A0.mergeInputs(b,a.defaults.inputs),A0.mergeInputs(b,h.inputs),A0.mergeInputsArrPart(b,a.inputs),
h.inputs=b,delete a.inputs,delete a.defaults.inputs,b={},TradingView.merge(b,a.defaults),TradingView.merge(b,factoryDefaults("study_"+a.id)),TradingView.merge(b,h),TradingView.merge(b,a),delete b.defaults,h=b);d=TradingView.calcDefaultColorsOffset(d,a);TradingView.merge(h,TradingView.shiftDefaultColors(h,d));return h};
TradingView.preparePlotStyles=function(a,b){if(b.plots)for(var c=0;c<b.plots.length;c++){var d=b.plots[c].id,e=b.plots[c].type;if(e!==TradingView.StudyConsts.PLOT_TYPE_COLORER){var g=defaultPlotOptions();g.plottype=e;g.title=d;a.styles&&d in a.styles&&TradingView.merge(g,a.styles[d]);a.styles[d]=g}}};
TradingView.convertMetainfoInputsArrayToObject=function(a){var b=TradingView.clone(a);b.inputs={};if(a.inputs)for(var c=0;c<a.inputs.length;c++)b.inputs[a.inputs[c].id]=a.inputs[c].defval,b.inputs[c]=a.inputs[c];return b};TradingView.calcDefaultColorsOffset=function(a,b){var c=0;if(a)for(var d=0;d<a.D19().size();d++){var e=a.D19().item(d);e.metaInfo&&e.metaInfo()&&e.metaInfo().id==b.id&&c++}return c};
TradingView.shiftDefaultColors=function(a,b){if(!b)return a;for(var c in a.styles)if(color=a.styles[c].color)a.styles[c].color=TradingView.shiftColor(color,b);return a};TradingView.shiftColor=function(a,b){a=new RGBColor(a);var c=TradingView.rgbToHsl(a.r,a.g,a.b),d=c[0]+.05*b;c[0]=d-Math.floor(d);c=TradingView.hslToRgb(c[0],c[1],c[2]);a.r=c[0];a.g=c[1];a.b=c[2];return a.toHex()};
TradingView.Study=function(a,b,c,d){this._titleCache={};this._resolvedSymbols={};this._priceAxisViewsBase=new List;this._paneViews=new List;this._hlinesPriceAsisViews=new List;this._horizlinesPriceAsisViews=new List;PriceDataSource.call(this,a);this.m_data=new PlotList;this._graphics=new A62(d);this._plotOffsets={};this._plotOffsetsMetaInfoOverride={};this.D0=a;this._chartApi=a._chartApi;this._series=c;this._metaInfo=d;this.D2=b;this.D2.listeners().subscribe(this,
TradingView.Study.prototype.changeStyles);void 0!=this.D2.inputs&&this.D2.inputs.listeners().subscribe(this,TradingView.Study.prototype.inputsChanged);this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments;this._turnaroundCounter=1;this._turnaround="st"+this._turnaroundCounter;this._status="";this._plotFields=[];if(b=this.metaInfo().plots)for(c=0,d=b.length;c<d;c++)this._plotFields.push(b[c].id);this.clearData();this._studyModified=
!1;this._tagsChanged=new Delegate;this.createViews();var e=this;this._handler=function(a){e.onData(a)};this._createFormatter();e=this;this.D2.precision.listeners().subscribe(null,function(){e._createFormatter();e.D0.D20(new A22(A22.FULL_UPDATE))});this._showStudyArgumentsProperty.listeners().subscribe(null,function(){e._titleCache={}});this.D2.description.listeners().subscribe(null,function(){e._titleCache={}});this.D2.shortDescription&&
this.D2.shortDescription.listeners().subscribe(null,function(){e._titleCache={}});W77.enabled("update_study_formatter_on_symbol_resolve")&&a.mainSeries().onSymbolResolved().subscribe(this,TradingView.Study.prototype._createFormatter);this.D2.showInDataWindow.listeners().subscribe(a,W79.prototype.fullUpdate)};inherit(TradingView.Study,PriceDataSource);
TradingView.Study.prototype.lastValueData=function(a,b,c){var d={};if(this.D0.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return null;var e=this.D0.timeScale().visibleBars();if(e.isEmpty())return null;var g;for(g=0;g<this.metaInfo().plots.length&&this.metaInfo().plots[g].id!==a;g++);if(!this.properties().visible.value()||!this.properties().styles[a].visible.value())return null;var h=this.offset(a),e=this.nearestIndex(e.lastBar()-h,SEARCH_NEAREST_LEFT);
if(void 0===e)return null;this.data();b=b?this.data().last().value:this.data().valueAt(e);if(!b||!isNumber(b[g+1]))return null;for(var k=this.metaInfo().plots,e=h=null,l=0;l<k.length;l++)this.isSelfColorerPlot(l)&&k[l].target===a&&(h=l,e=this.metaInfo().palettes[k[l].palette],paletterProps=this.properties().palettes[k[l].palette]);g=b[g+1];c&&(d.price=g);if(this.priceScale().properties().percentage.value()){c=this.firstValue(!0);if(!c)return null;g=this.priceScale().priceRange().convertToPercent(g,
c)}d.text=this.priceScale().formatter().format(g);a=this.properties().styles[a].color.value();h&&b.length>h+1?(c=b[h+1],d.color=void 0!=c?paletterProps.colors[e.valToIndex?e.valToIndex[c]:c].color.value():a):d.color=a;d.floatCoordinate=this.priceScale().priceToCoordinate(g,!0);d.coordinate=Math.round(d.floatCoordinate);d.item=b;return d};TradingView.Study.prototype.series=function(){return this._series};TradingView.Study.prototype.model=function(){return this.D0};
TradingView.Study.prototype.clearData=function(){this.m_data=new PlotList(this._plotFields);this._graphics=new A62(this._metaInfo);this._plotOffsets={}};TradingView.Study.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.Study.prototype.properties=function(){return this.D2};
TradingView.Study.prototype.state=function(a){var b={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};this.metaInfo()instanceof StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=StudyMetaInfo.parseIdString(b.metaInfo.id+(b.metaInfo.version?"-"+b.metaInfo.version:"")).fullId);a&&(b.data=this.m_data.state(),b.data.symbols=this._resolvedSymbols,b.data.graphics=this._graphics.graphics(),
b.data.plotOffsets=this._plotOffsets);this.ownerSource()&&(b.ownerSource=this.ownerSource().id());for(a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type){var c=this._metaInfo.inputs[a].id,d=b.state.inputs[c];0>d&&(d=this._rightOffsetToUnixTime(-d),b.state.inputs[c]=d&&0<=d?d:0)}return b};TradingView.Study.prototype.uniqueId=function(){return this.id()+"|"+JSON.stringify(this.inputsForAlert())};
TradingView.Study.prototype.stateForAlert=function(){var a=this.state();a.data||(a.data={});a.data.completePlotOffsets={};for(var b=0;b<this._metaInfo.plots.length;++b){var c=this._metaInfo.plots[b].id;a.data.completePlotOffsets[c]=this.offset(c)}a.uniqueId=this.uniqueId();return a};TradingView.Study.prototype.isSavedInStudyTemplates=function(){for(var a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type)return!1;return!0};
TradingView.Study.prototype.restoreData=function(a){this.m_data.restoreState(a);this._resolvedSymbols=a.symbols;this._graphics.setGraphics(a.graphics);this._postProcessGraphics();this._plotOffsets=a.plotOffsets};TradingView.Study.prototype.restart=function(){this._restarting=!0;W77.enabled("stop_study_on_restart")&&this.stop();this._clearLoadingTimer();this.start()};
TradingView.Study.prototype._clearLoadingTimer=function(){this.loadingTimer&&(TradingView.logDebug("Study "+this._metaInfo.description+" loading took "+((new Date).getTime()-this._loadingStartTime)+" ms"),clearTimeout(this.loadingTimer),this.loadingTimer=null)};
TradingView.Study.prototype.stop=function(){this._clearLoadingTimer();this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler);W77.enabled("update_study_formatter_on_symbol_resolve")&&this.D0.mainSeries().onSymbolResolved().unsubscribe(this,TradingView.Study.prototype._createFormatter);this._studyId=null;this.clearData();this._unsubscribeExtendedHours();this.recalculate()};
TradingView.Study.prototype._resolveSymbol=function(a,b){function c(b){d._chartApi.resolveSymbol(d._makeNextSymbolId(),b,function(b){switch(b.method){case "symbol_resolved":d._resolvedSymbols[a]=b.params[1];0!=d._studyId&&d.stop();d.start();break;case "symbol_error":if("permission denied"===b.params[1]&&b.params[2])switch(b.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(b.params[3])return c(b.params[3]);break;default:return c(b.params[2])}d._status=
$.t("Invalid Symbol");d.stop();d.D0.updateSource(d)}})}var d=this;c(a)};TradingView.Study.prototype._allSymbolsAreResolved=function(){for(var a=!0,b=0;b<this._metaInfo.inputs.length;b++)if("symbol"==this._metaInfo.inputs[b].type){var c=this._metaInfo.inputs[b].id,d=this.D2.inputs[c].value();this._resolvedSymbols[d]||(a=!1,this._resolveSymbol(d,this.D2.inputs[c]))}return a};
TradingView.Study.prototype._allInputsAreValid=function(){for(var a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type){var b=this.D2.inputs[this._metaInfo.inputs[a].id].value();if(void 0==b||null==b)return!1}return!0};TradingView.Study.prototype.sourceId=function(){return this._studyId};TradingView.Study.prototype.isStarted=function(){return!!this._studyId};
TradingView.Study.prototype.start=function(){if(this._chartApi&&this._chartApi.connected()&&this._allSymbolsAreResolved()&&(!this.isStarted()||this._restarting)&&(this._studyId=TradingView.Study.makeNextStudyId(),this._restarting=!1,this._allInputsAreValid())){this._inputs=this.inputs();var a=this._metaInfo.id;if("MA"===this._metaInfo.id){switch(this._inputs[2]){case "exp":a="MAExp@tv-basicstudies";break;case "simple":a="MASimple@tv-basicstudies";break;case "weighted":a="MAWeighted@tv-basicstudies";
break;case "volume weighted":a="MAVolumeWeighted@tv-basicstudies"}inputs=[inputs[0],inputs[1]]}a+="-"+(this._metaInfo.version||"1!");a=StudyMetaInfo.cutDollarHash(a);"Script@tv-scripting-1"===a&&(a+="!");this._chartApi.createStudy(this._studyId,this._turnaround,this._series._seriesId,a,this._inputs,this._handler);this._subscribeExtendedHours()}};TradingView.Study._nextSymbolId=0;TradingView.Study.prototype._makeNextSymbolId=function(){TradingView.Study._nextSymbolId++;return"ss_"+TradingView.Study._nextSymbolId};
TradingView.Study._nextStudyId=0;TradingView.Study.makeNextStudyId=function(){TradingView.Study._nextStudyId++;return"st"+TradingView.Study._nextStudyId};TradingView.Study.prototype._rightOffsetToUnixTime=function(a){var b=null;this._series.bars().size()>=a&&(b=this._series.bars()._valueAt(this._series.bars().lastIndex()-a)[TIME_PLOT]);return b};
TradingView.Study.prototype.getSymbolString=function(a){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:a,session:"extended"}):a};TradingView.Study.prototype.inputsForGUI=function(a){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1})};TradingView.Study.prototype.inputsForAlert=function(){var a=this.offset(),b=this.inputs({symbolsForDisplay:!0,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1});a&&b.push(a);return b};
TradingView.Study.prototype.inputs=function(a){var b={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0};TradingView.merge(b,a);return this._buildInputs(b)};
TradingView.Study.prototype._buildInputs=function(a){assert(!!a,"options not set");try{var b=this._prepareInputs(a)}catch(c){console.warn("Failed to prepare study inputs: "+c),b={}}if(!a.symbolsForDisplay&&this._metaInfo.isTVScript)return 0==Object.keys(b).length||this._metaInfo.isTVScriptStub?[this._metaInfo.defaults.inputs.text]:[A57.patchILTemplate(this._metaInfo.defaults.inputs.text,this._metaInfo,b)];if(a.asObject){var d={};Object.keys(b).forEach(function(a){null!=b[a]&&(d[a]=
b[a])});d=$.isEmptyObject(d)?null:d}else d=[],Object.keys(b).forEach(function(a){null!=b[a]&&d.push(b[a])});return d};TradingView.Study.prototype._prepareInputs=function(a){assert(!!a,"options not set");for(var b={},c=0;c<this._metaInfo.inputs.length;c++){var d=this._metaInfo.inputs[c];if(!d.isFake||!a.skipFakeInputs||this._metaInfo.isTVScript)if(!d.isHidden||!a.skipHiddenInputs){var e=this._prepareInput(d,a);b[d.id]=e}}return b};
TradingView.Study.prototype._prepareInput=function(a,b){var c=a.id;if("symbol"==a.type)return c=this.D2.inputs[c].value(),b&&b.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[c]&&(c=this._resolvedSymbols[c].name+", "+this._resolvedSymbols[c].exchange):(this._resolvedSymbols&&this._resolvedSymbols[c]&&(c=this._resolvedSymbols[c],c=c.ticker||c.full_name),b&&b.symbolsForChartApi&&(c=this.getSymbolString(c))),c;if("bar_time"==a.type){c=this.D2.inputs[c].value();if(0>c)var d=
this._rightOffsetToUnixTime(-c),c=d&&0<=d?d:c;return c}return this.D2.inputs[c].value()};TradingView.Study.prototype._changeInputs=function(a){this._studyId&&this._chartApi.connected()?(this._turnaround="st"+ ++this._turnaroundCounter,this._allInputsAreValid())?this._allSymbolsAreResolved()&&(this._studyModified=!0,this._chartApi.modifyStudy(this._studyId,this._turnaround,a,this._handler)):this.stop():(this.stop(),this.start());this._inputs=a;this._tagsChanged.fire();this._titleCache={}};
TradingView.Study.prototype.changeStyles=function(){if(this._inputs)for(var a=this.inputs(),b=0;b<a.length;b++){if(a[b]!==this._inputs[b]){this._changeInputs(a);break}}else this.restart();this.createViews();this.recalculate(!0);this.updateAllViews()};TradingView.Study.prototype.inputsChanged=function(){this._metaInfo.isTVScript&&(void 0!=this._pinePatchPropsTimerId&&clearTimeout(this._pinePatchPropsTimerId),this._pinePatchPropsTimerId=setTimeout(this._pinePatchProps.bind(this),250))};
TradingView.Study.prototype._pinePatchProps=function(){var a=this._prepareInputs({symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0});A57.patchPropertiesAsync(this.D2,this._metaInfo,a).done(function(){this.createViews();this.recalculate(!0);this.updateAllViews()}.bind(this)).fail(function(a){console.error(a)});this._pinePatchPropsTimerId=null};
TradingView.Study.prototype.createViews=function(){this._priceAxisViewsBase=new List;this._paneViews=new List;if(this.metaInfo().plots)for(var a=0;a<this.metaInfo().plots.length;a++)if(!this.isSelfColorerPlot(a)&&!this.isBarColorerPlot(a)){var b=this.metaInfo().plots[a].id;this.isBgColorerPlot(a)?this._paneViews.append(new W30(this,this._series,this.D0,b)):this.isPlotShapesPlot(a)?this._paneViews.append(new W36(this,this._series,this.D0,b)):this.isPlotCharsPlot(a)?
this._paneViews.append(new W35(this,this._series,this.D0,b)):this.isPlotArrowsPlot(a)?this._paneViews.append(new W34(this,this._series,this.D0,b)):(this._priceAxisViewsBase.append(new W51(this,this.D0,b)),this._paneViews.append(new W33(this,this._series,this.D0,b)),this.properties().styles[b].trackPrice.value()&&this._paneViews.append(new W37(this,this._series,this.D0,b)))}if(this.D2.bands)for(a=
0;a<this.D2.bands.childCount();a++)this.D2.bands[a].visible.value()&&this._paneViews.append(new TradingView.$58(this.D2.bands[a],this));this.D2.bandsBackground&&this._paneViews.append(new TradingView.$57(this));a=[];this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(a,b){return TradingView.Study.graphicsZOrderPriority(a)-TradingView.Study.graphicsZOrderPriority(b)}));for(var c in a){var b=a[c],d="_paneView"+
b,e="StudyPaneView_"+b;TradingView.Study[e]&&(this[d]=new TradingView.Study[e](this,this.D0),this._paneViews.append(this[d]));this._dataWindowView||"hhists"!==b||(this._dataWindowView=new StudyHHistsDataWindowView(this,this.D0))}this.D2.areaBackground&&this._paneViews.append(new TradingView.$55(this));if(this.D2.filledAreas&&this._metaInfo.filledAreas)for(a=0;a<this._metaInfo.filledAreas.length;++a)c=this._metaInfo.filledAreas[a],b=this.D2.filledAreasStyle[c.id],
c.type===StudyMetaInfo.FilledArea.TYPE_PLOTS?this._paneViews.append(new TradingView.W2(this,c,b)):c.type===StudyMetaInfo.FilledArea.TYPE_HLINES?this._paneViews.append(new TradingView.$84(this,c,b)):console.warn("Unsupported filledArea type: "+c.type);this._dataWindowView||(this._dataWindowView=new StudyDataWindowView(this,this.D0));this._statusView||(this._statusView=new StudyStatusView(this,this.D0.properties()));this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(this._horizlinesPriceAsisViews)};
TradingView.Study.prototype.recalculate=function(a){var b=this.D0.paneForSource(this);this.D0.recalculatePane(b,a);this.D0.updateSource(this)};TradingView.Study.prototype.data=function(){return this.m_data};TradingView.Study.prototype.metaInfo=function(){return this._metaInfo};TradingView.Study.prototype.status=function(){return this._status};
TradingView.Study.prototype.title=function(a){if(this._titleCache[a])return this._titleCache[a];var b;b=a?this._metaInfo.shortDescription||this.D2.shortDescription&&this.D2.shortDescription.value()||"Study":this._metaInfo.description||this.D2.description&&this.D2.description.value()||"Study";b=$.t(b);var c=this._showStudyArgumentsProperty.value(),d=this.inputsForGUI()||[];c&&0<d.length&&(b+=" ("+d.join(", ")+")");return this._titleCache[a]=b};
TradingView.Study.prototype.graphics=function(){return this._graphics.graphics()};TradingView.Study.prototype._checkTurnaround=function(a){return a===this._turnaround||a===this.D0.mainSeries()._turnaround||a===this.D0.mainSeries()._turnaround+"_"+this._turnaround};
TradingView.Study.prototype.onData=function(a){var b=this;switch(a.method){case "study_loading":this._status=$.t("loading...");this._failed=!1;this._statusView.update();this.D0.updateSource(this);this._clearLoadingTimer();-1==["Plot splits","Plot earnings","Plot dividends"].indexOf(b._metaInfo.description)&&(b._loadingStartTime=(new Date).getTime(),b.loadingTimer=setTimeout(function(){var a={chartSession:b._chartApi._sessionid,studyName:b._metaInfo.description,arguments:b.inputs()};A72.sendReport("study_loading",
a)},15E3));break;case "study_error":this._clearLoadingTimer();this._failed=!0;this.clearData();this._status=a.params[2]?$.t(a.params[2].split(":",2)[0]):"";-1==["Sessions"].indexOf(b._metaInfo.description)&&A72.sendReport("study_error",{chartSession:b._chartApi._sessionid,studyName:b._metaInfo.description,arguments:b.inputs()});this._statusView.update();this.D0.updateSource(this);break;case "study_completed":if(!this._checkTurnaround(a.params[1]))break;this._clearLoadingTimer();
this._status="";this._statusView.update();a=this.D0.paneForSource(this);this.D0.recalculatePane(a,!0);this._updateSources();this.D0.D20(new A22(A22.FULL_UPDATE));break;case "data_update":if(!this._checkTurnaround(a.params.turnaround))break;b._clearLoadingTimer();this._studyModified&&(this.clearData(),this._studyModified=!1);var c=0==this.m_data.size();assert(!!a.params.nonseries,"data.params.nonseries is missing");a.params.nonseries.d=
""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"";this._processPlotOffsets(a.params);this.transformData(a.params.plots);this._mergeData(a.params.plots);this._graphics.process(a.params.nonseries);this._postProcessGraphics();a=this.D0.paneForSource(this);this.D0.recalculatePane(a,c);this._updateSources()}};TradingView.Study.prototype.transformData=function(a){};TradingView.Study.prototype._updateSources=function(){this.D0.updateSource(this);this.hasBarColorer()&&this.D0.updateSource(this.D0.mainSeries())};
TradingView.Study.prototype._processPlotOffsets=function(a){a=a.nonseries.d;a&&a.indexes_replace||(this._plotOffsets=a&&a.offsets?a.offsets:{})};TradingView.Study.prototype._mergeData=function(a){this.m_data.merge(a)};
TradingView.Study.prototype._postProcessGraphics=function(){var a=this,b=function(b){var d=a._graphics.graphics(),e=new List,g;if(d&&d[b])for(var h=d[b],d=0;d<h.length;d+=1)if(h[d].data)for(g=0;g<h[d].data.length;g+=1)e.append(new TradingView.Study.StudyPriceAxisView_hlines(a,a.D0,h[d].data[g],h[d].styleId,b));return e};this._hlinesPriceAsisViews=b("hlines");this._horizlinesPriceAsisViews=b("horizlines");this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(this._horizlinesPriceAsisViews)};
TradingView.Study.prototype.firstValue=function(a){if(this._metaInfo.is_price_study&&"Compare@tv-basicstudies"!==this._metaInfo.id)return this._series.data().firstValue();var b=this.D0.timeScale().visibleBars(),c=b.firstBar(),b=b.lastBar();if(0===this.m_data.size())return null;var d,e=this;this.m_data.range(c,b).each(function(b,c){for(var k=1;k<c.length;++k)if(!e.isSelfColorerPlot(k-1)){var l=e._metaInfo.plots[k-1].id,l=e.properties().styles[l];if(l.visible&&l.visible.value()&&!(a&&1E-10>Math.abs(c[k])||
void 0===c[k]||null===c[k]||d))return d=c[k],!0}});return d};TradingView.Study.prototype.offset=function(a){var b=0;this._plotOffsets&&void 0!=this._plotOffsets[a]&&(b+=this._plotOffsets[a]);void 0!=this._plotOffsetsMetaInfoOverride[a]?b+=this._plotOffsetsMetaInfoOverride[a]:this.properties().offsets&&void 0!=this.properties().offsets[a]&&(b+=this.properties().offsets[a].val.value());this.properties().offset&&(b+=this.properties().offset.val.value());return b};
TradingView.Study.prototype.priceRange=function(a,b){if(isInteger(a)){if(isInteger(b)){if(0===this.m_data.size())return null;var c=null;if(0==this._metaInfo.plots.length)return null;for(var d=[],e=0;e<this._metaInfo.plots.length;++e){var g=this._metaInfo.plots[e].id,h=this.properties().styles[g],k=this.isLinePlot(e);if((k=k||(this.isPlotShapesPlot(e)||this.isPlotCharsPlot(e))&&h.location.value()==CanvasEx.MARKLOC_ABSOLUTE)&&h.visible.value()){h={index:e+1,offset:this.offset(g)};k=this.properties().styles[g].plottype.value();
if(!this.properties().skipHistogramBaseOnAutoScale&&0<=[TradingView.StudyConsts.PLOT_HISTOGRAM,TradingView.StudyConsts.PLOT_COLUMNS,TradingView.StudyConsts.PLOT_AREA].indexOf(k)){g=this.properties().styles[g].histogramBase.value();if(!isNumber(g))continue;h.baseValue=g}d.push(h)}}d=this.m_data.minMaxOnRange(a,b,d);null!==d.min&&(c=new PriceRange(d.min,d.max));if(this._metaInfo.bands)for(e=0;e<this._metaInfo.bands.length;e++)this.properties().bands[e].visible.value()&&(g=this.properties().bands[e].value.value(),
isNumber(g)&&(c?c.apply(g,g):c=PriceRange(g,g)));c&&c.minValue()===c.maxValue()&&(d=.005*c.minValue(),c=new PriceRange(c.minValue()-d,c.maxValue()+d));return this.priceScale().properties().percentage.value()&&c?(d=this.firstValue())?c.convertToPercents(d):null:this.priceScale().isLog()&&c?new PriceRange(this.priceScale().priceToLogical(c.minValue()),this.priceScale().priceToLogical(c.maxValue())):c}TradingView.logDebug("Study.priceRange: incorrect endBar")}else TradingView.logDebug("Study.priceRange: incorrect startBar")};
TradingView.Study.prototype.paneViews=function(a){return this.properties().visible.value()?this._paneViews:null};TradingView.Study.prototype.dataWindowView=function(){return this._dataWindowView};TradingView.Study.prototype.statusView=function(){return this._statusView};
TradingView.Study.prototype.priceAxisViews=function(a,b){return this.D0.paneForSource(this)===a&&b===this.priceScale()&&(this.D0.properties().scalesProperties.showStudyLastValue.value()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null};TradingView.Study.prototype.isLinePlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_LINE};
TradingView.Study.prototype.isSelfColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_COLORER};TradingView.Study.prototype.isBarColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_BAR_COLORER};TradingView.Study.prototype.isBgColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_BG_COLORER};
TradingView.Study.prototype.isPlotShapesPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_SHAPES};TradingView.Study.prototype.isPlotCharsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_CHARS};TradingView.Study.prototype.isPlotArrowsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_ARROWS};TradingView.Study.prototype.isDataOffsetPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_DATAOFFSET};
TradingView.Study.prototype.hasBarColorer=function(){for(var a=0;a<this._metaInfo.plots.length;++a)if(this.isBarColorerPlot(a))return!0;return!1};TradingView.Study.prototype.barColorer=function(){for(var a=null,b=0;b<this._metaInfo.plots.length;++b)if(this.isBarColorerPlot(b)){var c=new StudyBarColorer(this,b);null===a?a=c:a.pushBackBarColorer(c)}if(null===a)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return a};
TradingView.Study.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0};
TradingView.Study.prototype._createFormatter=function(){var a;"default"==this.properties().precision.value()?this.metaInfo().defaults&&(a=parseInt(this.metaInfo().defaults.precision)):a=parseInt(this.properties().precision.value());isFinite(a)||(a=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1E4);var b=this.series().symbolInfo();0==a?(a=0,b&&(a=b.volume_precision?b.volume_precision:b.has_fractional_volume?2:0),this._formatter=
new VolumeFormatter(a)):this._formatter=new PriceFormatter(Math.pow(10,a));this.priceScale()&&this.priceScale().updateFormatter()};TradingView.Study.prototype.formatter=function(){return this._formatter};TradingView.Study.prototype.nearestIndex=function(a,b){if(isInteger(a)){var c=this._series.data().bars().search(a,b);return c?c.index:void 0}TradingView.logDebug("Study.nearestIndex: incorrect logicalPoint")};
TradingView.Study.prototype.updateAllViews=function(){for(var a=0;a<this._paneViews.size();a++)this._paneViews.item(a).update();this._dataWindowView.update();this._statusView.update();for(a=0;a<this._priceAxisViews.size();a++)this._priceAxisViews.item(a).update()};TradingView.Study.prototype.tags=function(){var a=[];a.push(this._metaInfo.id);var b=this.inputsForGUI();if(0<b.length){for(var c=this._metaInfo.id,d=0;d<b.length;d++)c+="_"+b[d];a.push(c)}return a};
TradingView.Study.isPointsBasedStudy=function(a){switch(a){case "VbPFixed@tv-volumebyprice":case "mtp_tsanalysis@mtp-mtpredictor":case "mtp_riskreward@mtp-mtpredictor":case "mtp_decisionpoint@mtp-mtpredictor":case "mtp_ew_main@mtp-mtpredictor":case "mtp_ew_major@mtp-mtpredictor":case "mtp_ew_minor@mtp-mtpredictor":case "mtp_wpt_down1ora@mtp-mtpredictor":case "mtp_wpt_down2orb@mtp-mtpredictor":case "mtp_wpt_down3@mtp-mtpredictor":case "mtp_wpt_down4@mtp-mtpredictor":case "mtp_wpt_down5@mtp-mtpredictor":case "mtp_wpt_downc@mtp-mtpredictor":case "mtp_wpt_up1ora@mtp-mtpredictor":case "mtp_wpt_up2orb@mtp-mtpredictor":case "mtp_wpt_up3@mtp-mtpredictor":case "mtp_wpt_up4@mtp-mtpredictor":case "mtp_wpt_up5@mtp-mtpredictor":case "mtp_wpt_upc@mtp-mtpredictor":return!0;
default:return!1}};
TradingView.Study.lineToolNameForPointsBasedStudy=function(a){switch(a){case "VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case "RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case "mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case "mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case "mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case "mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case "mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";
case "mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case "mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case "mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case "mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case "mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case "mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case "mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case "mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";
case "mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case "mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case "mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case "mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case "mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+a);}};
TradingView.Study.isStudyLineTool=function(a){a=TradingView[a];return"function"===typeof a&&a.prototype instanceof A63};TradingView.Study.prototype.onExtendedHoursChanged=function(){this.restart()};TradingView.Study.prototype.hasSymbolInputs=function(){for(var a=this._metaInfo.inputs.length;a--;)if("symbol"===this._metaInfo.inputs[a].type)return!0;return!1};
TradingView.Study.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)};TradingView.Study.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)};
TradingView.Study.prototype.removeByRemoveAllStudies=function(){return!0};TradingView.StudyStub=function(a,b,c){PriceDataSource.call(this,a);this._origState=b;this._title=c;this.D2=new Property({visible:!0});this._statusView=new StatusView(a.properties());this._status=$.t("compiling...");this._statusView.setText(this._title+" "+this._status);this._formatter=new PriceFormatter(Math.pow(10,2))};inherit(TradingView.StudyStub,PriceDataSource);TradingView.StudyStub.prototype.properties=function(){return this.D2};TradingView.StudyStub.prototype.statusView=function(){return this._statusView};
TradingView.StudyStub.prototype.state=function(a){return this._origState};TradingView.StudyStub.prototype.setStatus=function(a){this._status=a;this._statusView.setText(this._title+" "+this._status)};TradingView.StudyStub.prototype.formatter=function(){return this._formatter};TradingView.StudyStub.prototype.title=function(){return this._title};A62=function(a){this._graphics=A62.emptyGraphics();assert(!!a,"Study metaInfo is absent!");this._metaInfo=a};A62.emptyGraphics=function(){return{indexes:[]}};A62.prototype.isEmpty=function(){var a=1<Object.keys(this._graphics).length;return 0==this._graphics.indexes.length&&!a};A62.prototype.graphics=function(){return this._graphics};
A62.prototype.setGraphics=function(a){this._graphics=a;this._postProcessGraphicsData()};A62.prototype.process=function(a){""!==a.d&&(TradingView.logDebug("nonseries.d is "+JSON.stringify(a.d)),a.d.indexes_replace?this.replaceIndexes(a):a.d.graphicsCmds&&(this.processEraseCmds(a.d.graphicsCmds.erase),this.processCreateCmds(a.d.graphicsCmds.create,a.indexes)))};
A62.prototype.replaceIndexes=function(a){""!==a.d&&(assert(!!a.d.indexes_replace),this._graphics.indexes=a.indexes,TradingView.logDebug("timescale has been replaced with a new one (replaceIndexes)"))};
A62.prototype.processEraseCmds=function(a){if(a){assert(!!this._graphics,"_graphics object doesn't exist in the study!");assert(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(var b=0;b<a.length;++b){var c=a[b];if("all"===c.action)this._graphics=A62.emptyGraphics(),TradingView.logDebug("erased ALL the graphics");else if("one"===c.action)for(var d in this._graphics[c.type]){var e=this._graphics[c.type][d],g=A62._findGraphicsObjIndexById(e.data,
c.id);0<=g?(e.data.splice(g,1),TradingView.logDebug("erased one the graphics obj with id="+c.id)):TradingView.logDebug("cannot erase obj with id="+c.id+" because it doesn't exist")}else Error("Unknown graphics command "+c.action)}}};A62._findGraphicsObjIndexById=function(a,b){for(var c=0;c<a.length;++c)if(a[c].id===b)return c;return-1};
A62.prototype.processCreateCmds=function(a,b){if(a){assert(!!b,"indexes are missing in the study nonseries response!");assert(!!this._graphics,"_graphics object doesn't exist in the study!");assert(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(var c in a){assert(c in this._metaInfo.graphics,"There is a '"+c+"' in study response, but it doesn't present in metaInfo!");for(var d=0;d<a[c].length;++d){var e=a[c][d],g=e.styleId;assert(g in this._metaInfo.graphics[c]);
this._graphics[c]||(this._graphics[c]=[]);for(var h=null,k=0;k<this._graphics[c].length;++k)if(this._graphics[c][k].styleId===g){h=this._graphics[c][k];break}null===h&&(h={styleId:g,data:[]},this._graphics[c].push(h));h.data=h.data.concat(e.data);TradingView.logDebug("created "+e.data.length+" graphics objects")}}"nochange"===b?TradingView.logDebug("timescale hasn't changed"):(assert(isArray(b)),this._graphics.indexes=b,TradingView.logDebug("timescale has been replaced with a new one"));this._postProcessGraphicsData()}};
A62.prototype._postProcessGraphicsData=function(){if(this._graphics)for(var a in this._graphics.hhists){var b=this._graphics.hhists[a];A62._sortHHistItemsByPrice(b.data);b.dataObj=A62._splitHHistItemsBySession(b.data,this._graphics.indexes)}};A62._sortHHistItemsByPrice=function(a){a.sort(function(a,c){return a.priceLow-c.priceLow})};
A62._splitHHistItemsBySession=function(a,b){for(var c={},d=0;d<a.length;++d){var e=a[d],g=b[e.firstBarTime];void 0===g?console.error("Cannot find index "+e.firstBarTime+" in study timescale indexes"):(g in c||(c[g]=[]),c[g].push(e))}return c};A64=function(a){this._studyId=a;this._maxFromVers=this._maxToVers="0";this._migrs=[]};A64.prototype.addMigration=function(a,b,c){A0.isGreater(a,this._maxFromVers)&&(this._maxFromVers=a);A0.isGreater(b,this._maxToVers)&&(this._maxToVers=b);this._migrs.push({fromVers:a,toVers:b,rules:c})};
A64.prototype.updateInputs=function(a,b){if(!b)return b;var c=TradingView.clone(b);TradingView.logDebug("Applying migrations to study: "+this._studyId+" from vers: "+a+" to vers: "+this._maxToVers);for(var d=a;A0.isLess(d,this._maxToVers);){var e=this._findMigration(d),c=this._applyMigration(c,e);if(!A0.isLess(d,e.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");
d=e.toVers;TradingView.logDebug("Applied migration rule to study: "+this._studyId+" from vers: "+e.fromVers+" to vers: "+e.toVers)}return c};
A64.prototype._findMigration=function(a){for(var b=-1,c=this._maxFromVers,d=0;d<this._migrs.length;d++){var e=this._migrs[d];!A0.isLess(e.fromVers,a)&&A0.isLessOrEqual(e.fromVers,c)&&(c=e.fromVers,b=d)}if(0>b)throw Error("Could not find matching migration for study: "+this._studyId+" vers: "+a);return this._migrs[b]};
A64.prototype._applyMigration=function(a,b){for(var c=a,d=0;d<b.rules.length;d++)var e=b.rules[d],c=this._getApplyRuleFun(e.type)(c,e);return c};A64.prototype._getApplyRuleFun=function(a){if("inputRemoved"==a)return A64._applyInputRemovedRule;if("inputChangedType"==a)return A64._applyInputChangedTypeRule;throw Error("Unknown migration rule type: "+mr.type);};
A64._applyInputRemovedRule=function(a,b){if(!(b.inputId in a))return a;var c=A0.findInputKeyById(a,b.inputId);if(!c)return a;delete a[c];delete a[b.inputId];var c={},d=0,e;for(e in a)isNumber(parseInt(e,10))?(c[d]=a[e],d++):c[e]=a[e];return c};
A64._applyInputChangedTypeRule=function(a,b){var c=A0.getInputKeyById(a,b.inputId);if("resetToDefVal"==b.action)a[b.inputId]=b.defVal,a[c].defval=b.defVal,a[c].type=b.inputType;else throw Error("Unknown action "+b.action+" for rule with type "+b.type);return a};A0=function(a,b){if(!a)throw Error("No studies metainfo");this._studiesMetainfo=a;if(!b)throw Error("No studies migrations");this._studiesMigrations=b;this._migrations={};for(var c=0;c<this._studiesMigrations.size();c++)for(var d=this._studiesMigrations.item(c),e=0;e<d.length;e++)for(var g=d[e],h=g.versFrom,k=g.versTo,l=0;l<g.studyMigrations.length;l++){var m=g.studyMigrations[l],n=m.studyId;if(0==m.rules.length)throw Error("Study Migration should have at least one convertion rule");
var q=n in this._migrations?this._migrations[n]:new A64(n);q.addMigration(h,k,m.rules);this._migrations[n]=q}this._clientMigrations=[function(a,b){if(this._studiesMetainfo.isEmpty()||!a.isTVScript||22<=a.version)return b;for(var c={},d=0,e=0;;){var g=b[e];if(void 0==g)break;var h=b[g.id];g.isFake&&(g.id="in_"+d++);c[e]=g;c[g.id]=h;e++}return c}]};
A0.prototype.updateMetaInfo=function(a){if(!a)return a;assert(!a.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync");for(var b=null,c=this._studiesMetainfo,d=0;d<c.size();d++)if(c.item(d).id===a.id){b=c.item(d);break}return TradingView.clone(b)};
A0.prototype.updateMetaInfoAsync=function(a,b){var c=$.Deferred(),d=c.promise();if(!a)return c.reject("No old metaInfo was given"),d;if(b)return c.resolve(null),d;if(a.isTVScript&&a.TVScriptSourceCode)if(StudyMetaInfo.versionOf(a)!=StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION){var e=this._studiesMetainfo.isEmpty()?"1":A57.tvScriptingPkgVersion(this._studiesMetainfo),g=a.scriptIdPart||TVScript.createScriptIdPart();A57.translateScriptAsync(a.TVScriptSourceCode,
null,g,e).done(function(a){a=StudyMetaInfo.addOrReplaceStudyMetaInfo(this._studiesMetainfo,a);c.resolve(a)}.bind(this)).fail(function(b){console.warn("Could not compile Pine script (skipping): "+a.description+" "+b);c.reject(b)})}else c.resolve(a);else{for(var e=null,g=this._studiesMetainfo,h=0;h<g.size();h++)if(g.item(h).id===a.id){e=g.item(h);break}e?c.resolve(TradingView.clone(e)):c.resolve(null)}return d};
A0.prototype.updateStudyState=function(a,b,c){if(a){a=TradingView.clone(a);var d=b.id;if(d in this._migrations){var e=this._migrations[d].updateInputs(b.version,a.inputs);a.inputs=e}for(d=0;d<this._clientMigrations.length;++d)e=this._clientMigrations[d].call(this,b,a.inputs),Object.keys(e).length==Object.keys(a.inputs).length?a.inputs=e:console.warn("StudyVersioning._clientMigrations application returned bad result. Skipping it...")}if(c&&a&&(d={},A0.mergeInputs(d,
c.inputs),A0.mergeInputs(d,c.defaults.inputs),A0.mergeInputs(d,a.inputs),a.inputs=d,d=StudyMetaInfo.versionOf(b),b.isTVScript&&b.TVScriptSourceCode&&12<=d&&26>=d)){e={};for(d=0;d<b.plots.length;++d)e[b.plots[d].id]=c.plots[d].id;c=Object.keys(a.styles);for(d=0;d<c.length;++d){b=c[d];var g=a.styles[b];delete a.styles[b];a.styles[e[b]]=g}c=Object.keys(a.plots);for(d=0;d<c.length;++d)g=c[d],b=a.plots[g].id,a.plots[g].id=e[b]}return a};
A0.prototype.patchPointsBasedStudyState=function(a){A0._fixInputsMaxValue(a.state,a.metaInfo);"LineToolRegressionTrend"===a.type&&(a=TradingView.LineToolRegressionTrend.patchSourceState(a));return a};A0.prototype.patchPointsBasedStudyData=function(a,b){if(!a||!b)return b;var c=TradingView.clone(b);"VbPFixed@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,c);return c};
A0.prototype.patchStudyData=function(a,b,c,d){b=TradingView.clone(b);c=TradingView.clone(c);d=TradingView.clone(d);"VbPVisible@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,b.graphics);"VbPSessions@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,b.graphics);var e=StudyMetaInfo.versionOf(a);if(a.isTVScript&&a.TVScriptSourceCode&&12<=e&&26>=e)for(a=b.columns,b.columns=
[],e=0;e<a.length;++e)b.columns.push("plot_"+e);return{data:b,nsData:c,indexes:d}};A0._patchOldVolumeProfiles=function(a,b){var c=b.hhists[a].data,d=[],e;for(e in c)d=d.concat(c[e]);b.hhists[0].data=d};
A0._fixInputsOrder=function(a,b){for(var c=StudyMetaInfo.getOrderedInputIds(b),d=A0.splitInputs(a.inputs),e=d.arr,d=TradingView.merge({},d.obj),g=0;g<c.length;++g){var h=A0.findInputKeyById(e,c[g]);void 0!=h&&(d[g]=e[h])}a.inputs=d};
A0._fixInputsMaxValue=function(a,b){if(b.inputs)for(var c=0;c<b.inputs.length;c++)b.inputs[c].max&&253370764800<b.inputs[c].max&&(b.inputs[c].max=253370764800);if(a&&a.inputs){var c=A0.splitInputs(a.inputs),d=c.arr;for(key in d){var e=d[key];e.max&&253370764800<e.max&&(e.max=253370764800)}a.inputs=TradingView.merge(c.obj,c.arr)}};
A0.prototype.patchPropsStateAndMetaInfo=function(a,b,c){A0._fixInputsOrder(a,b);A0._fixInputsMaxValue(a,b);b.isTVScript&&"undefined"!==typeof TVScript&&(b.scriptIdPart=b.scriptIdPart||TVScript.createScriptIdPart());b.isTVScript&&("Script$TV_EARNINGS@tv-scripting"!==b.id&&"Script$TV_DIVIDENDS@tv-scripting"!==b.id&&"Script$TV_SPLITS@tv-scripting"!==b.id||delete b.TVScriptSourceCode);"Volume"!==b.id&&"Volume@tv-basicstudies"!==
b.id||0!=b.inputs.length||(b.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1E3}],b.plots.push({id:"vol_ma",type:"line"}));if("PivotPointsStandard@tv-basicstudies"===b.id&&(0===b.inputs.length?(a.inputs={kind:"Traditional",showHistoricalPivots:!0},b.inputs=[{defval:"Traditional",id:"kind",type:"text",options:"Traditional Fibonacci Woodie Classic DeMark Camarilla".split(" ")},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===b.inputs.length&&(a.inputs={kind:"Traditional"},b.inputs=[{defval:"Traditional",
id:"kind",type:"text",options:"Traditional Fibonacci Woodie Classic DeMark Camarilla".split(" ")},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0==a._hardCodedDefaultsVersion)){a._hardCodedDefaultsVersion=1;var d=a.color;delete a.color;a.levelsStyle={colors:{P:d,"S1/R1":d,"S2/R2":d,"S3/R3":d,"S4/R4":d,"S5/R5":d}}}"CMF"===b.shortId&&2===b.inputs.length&&(a.inputs={length:a.inputs["length fast"]},b.inputs=b.inputs.splice(0,1),b.inputs[0].id="length");b.defaults&&!b.defaults.precision&&(-1!=
["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(b.id)?b.defaults.precision=0:b.defaults.precision=4);if("MA"===b.id){var d=new StudyMetaInfo({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:{}}),e=new StudyMetaInfo({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:{}}),g=new StudyMetaInfo({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:{}}),h=new StudyMetaInfo({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(a.inputs.type){case "exp":result.metaInfo=d;break;case "simple":result.metaInfo=e;break;case "weighted":result.metaInfo=h;break;case "volume weighted":result.metaInfo=g}a.styles[b.plots[0].id]=
a.styles.MovAvg;delete a.styles.MovAvg;delete a.inputs.type}c.oldShowStudyLastValueProperty&&(a.oldShowLastValue=a.showLastValue);delete a.showLastValue;delete a.showStudyArguments;return{propsState:a,metaInfo:b}};A0.compareStudyVersions=function(a,b){a=a.toString();b=b.toString();var c=a.split("."),d=c[0],d=parseInt(d,10),c=1<c.length?c[1]:"0",c=parseInt(c,10),e=b.split("."),g=e[0],g=parseInt(g,10),e=1<e.length?e[1]:"0",e=parseInt(e,10);return d<g?-1:d>g?1:c<e?-1:c>e?1:0};
A0.isLess=function(a,b){return 0>A0.compareStudyVersions(a,b)};A0.isLessOrEqual=function(a,b){return 0>=A0.compareStudyVersions(a,b)};A0.isEqual=function(a,b){return 0==A0.compareStudyVersions(a,b)};A0.isGreater=function(a,b){return 0<A0.compareStudyVersions(a,b)};
A0.isGreaterOrEqual=function(a,b){return 0<=A0.compareStudyVersions(a,b)};A0.isVersionTesting=function(a){if(!a)return!1;a=a.toString();return/\d+.\d+/.exec(a)==a};A0.isVersionHead=function(a){if(!a)return!1;a=a.toString();return/\d+/.exec(a)==a};
A0.mergeInputs=function(a,b){A0.mergeInputsArrPart(a,b);A0.mergeInputsObjPart(a,b)};A0.mergeInputsArrPart=function(a,b){var c=A0.splitInputs(b),d;for(d in c.arr){var e=A0.findInputKeyById(a,c.arr[d].id);e?TradingView.merge(a[e],c.arr[d]):A0.appendInputInfoToArr(a,c.arr[d])}};
A0.mergeInputsObjPart=function(a,b){var c=A0.splitInputs(b);TradingView.merge(a,c.obj)};A0.appendInputInfoToArr=function(a,b){var c=-1,d;for(d in a){var e=parseInt(d,10);isNumber(e)&&e>c&&(c=e)}a[c+1]=b};A0.splitInputs=function(a){var b={},c={},d;for(d in a)isNumber(parseInt(d,10))?b[d]=a[d]:c[d]=a[d];return{arr:b,obj:c}};
A0.findInputKeyById=function(a,b){var c=null,d;for(d in a)if(isNumber(parseInt(d,10))&&a[d].id==b){c=d;break}return c};A0.getInputKeyById=function(a,b){var c=A0.findInputKeyById(a,b);if(!c)throw Error("Cannot find input with id: "+b);return c};A48=function(a,b,c,d,e){TradingView.Study.call(this,a,b,c,d);this._paneView=e};inherit(A48,TradingView.Study);
A48.prototype.onData=function(a){switch(a.method){case "data_update":var b=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):{};b.indexes_replace||(this._nonseriesdata=b.data);this._indexes=a.params.nonseries.indexes;a=this.D0.paneForSource(this);this.D0.recalculatePane(a,!0);this.D0.updateSource(this);break;default:return TradingView.Study.prototype.onData.call(this,a)}};
A48.prototype.updateAllViews=function(){this._paneView.update();this._dataWindowView.update();this._statusView.update()};A48.prototype.paneViews=function(a){a=new List;a.append(this._paneView);return a};A48.prototype.state=function(a){var b=TradingView.Study.prototype.state.call(this,a);a&&(b.nonSeriesData=this._nonseriesdata,b.indexes=this._indexes);return b};
A48.prototype.restoreData=function(a,b,c){TradingView.Study.prototype.restoreData.call(this,a);this._nonseriesdata=b;this._indexes=c};A48.prototype.clearData=function(){this._indexes=this._nonseriesdata=null};function LocationToYMixin(){}
LocationToYMixin.prototype._locationToY=function(a,b,c){c||(c=0);var d=[],e=this.D1.priceScale(),g;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:g=HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:g=LOW_PLOT}var h=this.D1.firstValue();1<=c&&--c;for(var k=-c;k<=c;k++){var l=this.D1.series().bars().valueAt(b+k);l&&(l=l[g],e.isPercent()&&(l=e.priceRange().convertToPercent(l,h)),d.push(e.priceToCoordinate(l)))}switch(a){case CanvasEx.MARKLOC_ABOVEBAR:return MathEx.min(d)-15;case CanvasEx.MARKLOC_BELOWBAR:return MathEx.max(d)+
15}};function W33(a,b,c,d){this.m_study=a;this.m_series=b;this.m_model=c;this._plotName=d;this.m_items=new List;this._invalidated=!0;a=this.m_study.metaInfo().plots;this._paletterProps=this._palette=this._colorer=null;for(b=this._plotIndex=0;b<a.length;b++)a[b].id===this._plotName&&(this._plotIndex=b),this.m_study.isSelfColorerPlot(b)&&a[b].target===this._plotName&&(this._colorer=b,this._palette=this.m_study.metaInfo().palettes[a[b].palette],this._paletterProps=this.m_study.properties().palettes[a[b].palette])}
W33.isNaNOrUndefOrNull=function(a){return isNaN(a)||void 0===a||null===a};W33.isIndexValid=function(a,b){return 0<=a&&a<b._length()};W33.prototype.items=function(){return this.m_items};W33.prototype.update=function(){this._invalidated=!0};
W33.prototype._updateImpl=function(){this.m_items.clear();this._histogramBase=null;if(!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()){var a=this.m_model.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.m_series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),SEARCH_NEAREST_LEFT),d=this.m_study.offset(this._plotName);0<d?(b-=d,c+=d):(b+=d,c-=d);var a=this.m_study.properties().styles[this._plotName].plottype.value(),
e=0<=[TradingView.StudyConsts.PLOT_LINE,TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_CIRCLES,TradingView.StudyConsts.PLOT_CROSS].indexOf(a),a=this.m_study.data(),g=this.m_study.firstValue();if(e&&0<a._length()){for(var h=a._bsearch(b);W33.isIndexValid(h,a)&&W33.isNaNOrUndefOrNull(a._valueAt(h)[this._plotIndex+1]);)--h;b=W33.isIndexValid(h,a)?a._indexAt(h):b;for(h=a._bsearch(c);W33.isIndexValid(h,a)&&W33.isNaNOrUndefOrNull(a._valueAt(h)[this._plotIndex+
1]);)h+=1;c=W33.isIndexValid(h,a)?a._indexAt(h):c}for(var k=a.range(b,c),h=this.m_study.priceScale(),l=h.properties().percentage.value(),a=this._getTranspValue(),m={},n=function(a,b){var c=a+"@"+b;m[c]||(m[c]=generateColor(a,b));return m[c]},q=k._start;q<k._end;++q){var r=k._indexAt(q),r=r+d,r=Math.floor(r),u=k._valueAt(q),w=u[this._plotIndex+1],w=null!==w&&void 0!==w?w:NaN;l&&!isNaN(w)&&(w=100*(w-g)/g);if(!e||!isNaN(w)){r=new MathEx.Point(r,w);w=void 0!==u[this._colorer+1]||this._palette&&
this._palette.addDefaultColor;if(this._colorer&&w){w=u[this._colorer+1];r.style={};u=this.m_study.properties().styles[this._plotName];if(void 0!=w){var A=this._palette.valToIndex?this._palette.valToIndex[w]:w,v=this._paletterProps.colors[A],w=v.color.value();r.style.color=n(w,a)}else w=u.color.value(),r.style.color=n(w,100);w=void 0!=A?v.width.value():u.linewidth.value();u=void 0!=A?v.style.value():u.linestyle.value();r.style.width=w;r.style.style=u}this.m_items.append(r)}}h.pricesToCoordinates(this.m_items);
this.m_model.timeScale().indexesToCoordinates(this.m_items);this.m_study.properties().styles[this._plotName].histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(this.m_study.properties().styles[this._plotName].histogramBase.value()));if(this.m_study===this.m_model.selectedSource())for(b=(new SelectionIndexes).calc(b,c),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,q=0;q<b.size();q++)r=b.item(q),u=this.m_study.data().valueAt(r),
r+=d,void 0!==u&&(w=u[this._plotIndex+1],h.properties().percentage.value()&&(w=100*(w-g)/g),A=this.m_model.timeScale().indexToCoordinate(Math.floor(r)),v=this.m_study.priceScale().priceToCoordinate(w),this._selectionData.points.append(new MathEx.Point(A,v)));d=this.m_study.properties().styles[this._plotName];this._lineColor=generateColor(d.color.value(),a);this._lineWidth=d.linewidth.value();d=d.color.value();this._colorer&&(d=this._paletterProps.colors[0].color.value(),this._lineWidth=this._paletterProps.colors[0].width.value(),
this._lineColor=generateColor(this._paletterProps.colors[0].color.value(),a));this._color2=generateColor(d,a);d=new RGBColor(d);g=TradingView.rgbToHsl(d.r,d.g,d.b);b=g[0]+.05;g[0]=b-Math.floor(b);g=TradingView.hslToRgb(g[0],g[1],g[2]);d.r=g[0];d.g=g[1];d.b=g[2];d=d.toHex();this._color1=generateColor(d,a)}}};
W33.prototype._getTranspValue=function(){var a=0;this.m_study.properties().transparency&&(a=this.m_study.properties().transparency.value(),a=isNumber(a)?a:50);var b=this.m_study.properties().styles[this._plotName],c=b.plottype.value();if("Volume@tv-basicstudies"===this.m_study.metaInfo().id&&c===TradingView.StudyConsts.PLOT_COLUMNS)return a;0<=[TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS,TradingView.StudyConsts.PLOT_COLUMNS].indexOf(c)&&b.transparency&&
(a=b.transparency.value(),a=isNumber(a)?a:50);return a};
W33.prototype.renderer=function(){var a=this.m_study.properties().styles[this._plotName];if(a.visible.value()&&this.m_study.priceScale()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var b={};this._getTranspValue();a.color.value();b.barSpacing=this.m_model.timeScale().barSpacing();b.items=this.m_items;b.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height();b.lineIndex=0;b.lineStyle=a.linestyle.value();b.lineColor=this._lineColor;b.lineWidth=
this._lineWidth;b.lineWidth=isNumber(b.lineWidth)?b.lineWidth:1;b.color1=this._color1;b.color2=this._color2;b.bottom=b.histogramBase;this._colorer||(b.simpleMode=!0);var c=new CompositeRenderer,d=a.joinPoints?a.joinPoints.value():!1;switch(a.plottype.value()){case TradingView.StudyConsts.PLOT_LINE:case TradingView.StudyConsts.PLOT_LINE_WITH_BREAKS:c.append(new W68(b));break;case TradingView.StudyConsts.PLOT_AREA:case TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS:c.append(new W53(b));
break;case TradingView.StudyConsts.PLOT_HISTOGRAM:c.append(new W66(b));break;case TradingView.StudyConsts.PLOT_COLUMNS:c.append(new W60(b));break;case TradingView.StudyConsts.PLOT_CROSS:c.append(new W61(b));d&&(a=TradingView.merge({},b),a.lineWidth=1,a.forceLineWidth=!0,c.append(new W68(a)));break;case TradingView.StudyConsts.PLOT_CIRCLES:c.append(new W58(b));d&&(a=TradingView.merge({},b),a.lineWidth=1,a.ignorePaletteLineWidth=
!0,c.append(new W68(a)));break;default:c.append(new W68(b))}this.m_study===this.m_model.selectedSource()&&c.append(new SelectionRenderer(this._selectionData));return c}};
function W30(a,b,c,d){this.D1=a;this._series=b;this.D0=c;this._plotName=d;this._items=new List;this._invalidated=!0;a=this.D1.metaInfo().plots;for(b=0;b<a.length;b++)a[b].id===this._plotName&&(this._plotIndex=b,assert(this.D1.isBgColorerPlot(b),"Plot '"+this._plotName+"' is not a background colorer!"))}W30.prototype.items=function(){return this._items};W30.prototype.update=function(){this._invalidated=!0};
W30.prototype._scalesReady=function(){var a=this.D0.timeScale(),b=this.D1.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
W30.prototype._updateImpl=function(){this._items.clear();assert(this._scalesReady(),"Scales must be ready!");var a=this.D0.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.D1.metaInfo().plots[this._plotIndex].palette,c=this.D1.properties().palettes[b].colors,b=this.D1.metaInfo().palettes[b],d=this.D1.properties().styles[this._plotName].transparency.value(),e=this._series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT),g=this._series.nearestIndex(a.lastBar(),
SEARCH_NEAREST_LEFT),a=this.D1.offset(this._plotName);0<a?(e-=a,g+=a):(e+=a,g-=a);e=this.D1.data().range(e,g);for(g=e._start;g<e._end;++g){var h=e._indexAt(g),h=h+a,k=e._valueAt(g)[this._plotIndex+1],h=new MathEx.Point(Math.floor(h)-.5),l=isNumber(d)?d:50,l=Math.min(l,100),l=Math.max(l,0);void 0!=k?(colorIndexInPalette=b.valToIndex?b.valToIndex[k]:k,h.color=generateColor(c[colorIndexInPalette].color.value(),l)):h.color=null;this._items.append(h)}this.D0.timeScale().indexesToCoordinates(this._items)}};
W30.prototype.renderer=function(){if(this.D1.properties().styles[this._plotName].visible&&this.D1.properties().styles[this._plotName].visible.value()&&this._scalesReady()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={items:this._items,y:0,h:this.D1.priceScale().height(),w:Math.ceil(this.D0.timeScale().barSpacing())},b=new CompositeRenderer;b.append(new W55(a));return b}};
function StudyPlotShapesPaneViewBase(a,b,c,d){this.m_study=a;this.m_series=b;this.m_model=c;this.m_plotName=d;this.m_items=new List;this.m_invalidated=!0;this.m_plotIndex=null;a=this.m_study.metaInfo().plots;for(b=0;b<a.length;b++)if(a[b].id===this.m_plotName){this.m_plotIndex=b;break}a=this.m_study.metaInfo().plots;this._paletterProps=this._palette=this._colorer=null;for(b=this._plotIndex=0;b<a.length;b++)a[b].id===this.m_plotName&&(this._plotIndex=b),this.m_study.isSelfColorerPlot(b)&&a[b].target===
this.m_plotName&&(this._colorer=b,this._palette=this.m_study.metaInfo().palettes[a[b].palette],this._paletterProps=this.m_study.properties().palettes[a[b].palette])}StudyPlotShapesPaneViewBase.prototype.items=function(){return this.m_items};StudyPlotShapesPaneViewBase.prototype.update=function(){this.m_invalidated=!0};StudyPlotShapesPaneViewBase.prototype._scalesReady=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
StudyPlotShapesPaneViewBase.prototype._updateImpl=function(){this.m_items.clear();if(this._scalesReady()){var a=this.m_model.timeScale(),b=this.m_study.priceScale(),a=a.visibleBars().clone();if(!a.isEmpty()){var c=this.m_series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(a.lastBar(),SEARCH_NEAREST_LEFT),a=this.m_study.offset(this.m_plotName);0<a?(c-=a,d+=a):(c+=a,d-=a);var e=this.m_study.data(),g=this.m_study.firstValue(),e=e.range(c,d),h=b.properties().percentage.value();
b.priceRange();b=this._getTranspValue();c=(new SelectionIndexes).calc(c,d).toArray();if(d=this.m_study===this.m_model.selectedSource())this.m_selectionData={points:new List,hittestResult:HitTestResult.REGULAR,vertOffset:0};var k=this.m_series.properties().style.value();if(k=k===TradingView.Series.STYLE_LINE?"lineStyle":k===TradingView.Series.STYLE_AREA?"areaStyle":null)var l=k=this.m_series.properties()[k].priceSource.value();else k="high",l="low";for(var m=e._start;m<e._end;++m){var n=e._indexAt(m),
q=Math.floor(n+a),r=function(a){try{var b=this.m_series[a||"close"](q)}catch(c){b=null}return b}.bind(this),u=e._valueAt(m),w=u[this.m_plotIndex+1];if(null!==w&&void 0!==w){h&&(w=100*(w-g)/g);var A=this.m_study.metaInfo().plots[this.m_plotIndex].type,v=this.m_study.properties().styles[this.m_plotName].location;if(A=(A=A==TradingView.StudyConsts.PLOT_TYPE_ARROWS)||v&&0<=[CanvasEx.MARKLOC_ABOVEBAR,CanvasEx.MARKLOC_BELOWBAR].indexOf(v.value())){if(v=r(k),r=r(l),void 0==v||void 0==r)continue}else r=v=
w;r=this._createItem(q,w,v,r);void 0!=r&&(w=void 0!==u[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&w&&(w=u[this._colorer+1],r.style={},void 0!=w?(w=this._paletterProps.colors[this._palette.valToIndex?this._palette.valToIndex[w]:w].color.value(),r.style.color=generateColor(w,b)):(w=this.m_study.properties().styles[this.m_plotName].color.value(),r.style.color=generateColor(w,100)),r.style.borderColor=generateColor(w,9<b?b-10:0)),this.m_model.timeScale().indexToCoordinate(Math.floor(q)),
this.m_study.priceScale().priceToCoordinate(u),d&&-1!==$.inArray(n,c)&&this.m_selectionData.points.append(r),this.m_items.append(r))}}this._convertItemsToCoordinates()}}};StudyPlotShapesPaneViewBase.prototype._getTranspValue=function(){var a=0;this.m_study.properties().transparency&&(a=this.m_study.properties().transparency.value(),a=isNumber(a)?a:50);var b=this.m_study.properties().styles[this.m_plotName];b.transparency&&(a=b.transparency.value(),a=isNumber(a)?a:50);return a};
StudyPlotShapesPaneViewBase.prototype._createItem=function(a,b,c,d){var e=this.m_study.properties().styles[this.m_plotName].location.value(),g=this.m_study.priceScale(),h=g.coordinateToPrice(g.height()*g.topMargin()),g=g.coordinateToPrice(g.height()*(1-g.bottomMargin()));if(!b&&e!=CanvasEx.MARKLOC_ABSOLUTE)return null;switch(e){case CanvasEx.MARKLOC_ABOVEBAR:b=c;break;case CanvasEx.MARKLOC_BELOWBAR:b=d;break;case CanvasEx.MARKLOC_TOP:b=h;break;case CanvasEx.MARKLOC_BOTTOM:b=g;break;case CanvasEx.MARKLOC_ABSOLUTE:break;
default:throw Error("Bad value: "+e);}return new MathEx.Point(a,b)};StudyPlotShapesPaneViewBase.prototype._convertItemsToCoordinates=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();a.indexesToCoordinates(this.m_items);b.pricesToCoordinatesEx(this.m_items.toArray(),function(a){return a.y},function(a,b){a.y=b})};
StudyPlotShapesPaneViewBase.prototype._calculateVerticalOffset=function(a,b){var c;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:c=-b;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:c=b;break;default:c=0}return c};StudyPlotShapesPaneViewBase.prototype._calculateShapeHeight=function(a){return Math.round(a/2)};
StudyPlotShapesPaneViewBase.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()){var a=this.m_model.timeScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var b={},c=this._getTranspValue(),d=a.barSpacing(),e=this._calculateShapeHeight(d),a=this.m_study.properties().styles[this.m_plotName].location.value(),a=this._calculateVerticalOffset(a,e+e/2);b.barSpacing=
d;b.items=this.m_items;b.color=generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),c);b.height=e;b.vertOffset=a;d=this.m_study.properties().styles[this.m_plotName].plottype.value();c=TradingView.StudyPlotShapes.Data[d];void 0==c&&console.error("Unknown style "+d);d=new CompositeRenderer;d.append(new window[c.paneRendererClass](b));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=a,d.append(new SelectionRenderer(this.m_selectionData)));return d}};
function W36(a,b,c,d){StudyPlotShapesPaneViewBase.call(this,a,b,c,d);this._rendererCache={}}inherit(W36,StudyPlotShapesPaneViewBase);W36.prototype._calculateTextVerticalOffset=function(a,b){var c;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:c=2.5*-b;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:case CanvasEx.MARKLOC_ABSOLUTE:c=2.1*b;break;default:console.error("Unexpected location value: "+a),c=0}return c};
W36.prototype._createTextData=function(a,b,c,d){var e={};e.text=a;e.color=d;e.font="Arial";e.fontsize=12;e.offsetX=0;e.offsetY=c;e.vertAlign=0<c?"top":"bottom";e.horzAlign="center";e.bold=!1;e.italic=!1;e.points=new List;e.points.append(b);e.highlightBorder=!0;return e};
W36.prototype.renderer=function(){var a=this.m_study.properties().styles[this.m_plotName];if(a.visible&&a.visible.value()&&this._scalesReady()){var b=this.m_model.timeScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var c={},d=this._getTranspValue(),e=b.barSpacing(),g=this._calculateShapeHeight(e),h=a.location.value(),b=generateColor(a.color.value(),d),k=19<d?d-10:0,d=this._calculateVerticalOffset(h,Math.round(1.5*g)),h=this._calculateTextVerticalOffset(h,
g);c.barSpacing=e;c.items=this.items();c.color=b;c.borderColor=generateColor(a.color.value(),k);c.height=g;c.vertOffset=d;g=a.plottype.value();e=TradingView.StudyPlotShapes.Data[g];void 0==e&&console.error("Unknown style "+g);g=new CompositeRenderer;a=a.text?a.text.value():void 0;if(void 0!=a&&""!==a.trim())for(a=a.trim().replace(/\\n/gm,"\n"),k=0;k<this.m_items.size();k++){var l=this._createTextData(a,this.m_items.item(k),h,b);g.append(new TextRenderer(l,this._rendererCache,new HitTestResult(HitTestResult.REGULAR)))}g.append(new window[e.paneRendererClass](c));
this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=d,g.append(new SelectionRenderer(this.m_selectionData)));return g}};function W35(a,b,c,d){W36.call(this,a,b,c,d)}inherit(W35,W36);W35.prototype._calculateShapeHeight=function(a){return Math.round(a)};
W35.prototype._calculateTextVerticalOffset=function(a,b){var c;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:c=1.3*-b;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:case CanvasEx.MARKLOC_ABSOLUTE:c=1.5*b;break;default:console.error("Unexpected location value: "+a),c=0}return c};
W35.prototype.renderer=function(){var a=this.m_study.properties().styles[this.m_plotName];if(a.visible&&a.visible.value()&&this._scalesReady()){var b=this.m_model.timeScale();this.m_study.priceScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var c={},d=this._getTranspValue(),b=b.barSpacing(),e=this._calculateShapeHeight(b),g=a.location.value(),d=generateColor(a.color.value(),d),b=this._calculateVerticalOffset(g,e),g=this._calculateTextVerticalOffset(g,e);c.items=
this.items();c["char"]=a["char"].value();c.height=e;c.vertOffset=b;c.color=d;e=new CompositeRenderer;a=a.text?a.text.value():void 0;if(void 0!=a&&""!==a.trim())for(var a=a.trim().replace(/\\n/gm,"\n"),h=0;h<this.m_items.size();h++){var k=this._createTextData(a,this.m_items.item(h),g,d);e.append(new TextRenderer(k,this._rendererCache,new HitTestResult(HitTestResult.REGULAR)))}e.append(new W73(c));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=b,e.append(new SelectionRenderer(this.m_selectionData)));
return e}};function W34(a,b,c,d){StudyPlotShapesPaneViewBase.call(this,a,b,c,d);this._maxAbsValue=0}inherit(W34,StudyPlotShapesPaneViewBase);
W34.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 a={},b=this._getTranspValue(),c=this.m_model.timeScale().barSpacing();a.items=this.m_items;a.barSpacing=c;a.colorup=generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),b);a.colordown=generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),
b);a.colorBorder=generateColor("#000000",b);a.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value();a.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value();b=new CompositeRenderer;b.append(new W54(a));this.m_study===this.m_model.selectedSource()&&(a=this.m_selectionData,a.barSpacing=c,b.append(new SelectionRendererArrowsUpDown(a)));return b}};
W34.prototype._createItem=function(a,b,c,d){if(0!==b){Math.abs(b)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(b));var e=0<b;return new PaneRendererArrowsUpDownItem(a,e?d:c,b,e)}};
W34.prototype._convertItemsToCoordinates=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();a.indexesToCoordinates(this.m_items);b.pricesToCoordinatesEx(this.m_items.toArray(),function(a){return a.y},function(a,b){a.y=b});a=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value());b=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value());if(a>b)var c=a,a=b,b=c;for(var b=(b-a)/this._maxAbsValue,c=this.m_items.toArray(),
d=0;d<c.length;d++){var e=c[d],g=Math.abs(e.height);e.height=g*b+a}};function W51(a,b,c){this.D1=a;this.D0=b;this._plotIndex=c;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invalidated=!0;this._cache=new TextWidthCache}inherit(W51,PriceAxisView);W51.prototype.update=function(){this._invalidated=!0};
W51.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.D1.lastValueData(this._plotIndex);a&&(this._visible=!0,this._text=a.text,this._coordinate=a.coordinate,this._floatCoordinate=a.floatCoordinate,this._background!=a.color&&(this._background=a.color,this._color=this.color()),this._textHeight=this.D1.priceScale().m_markBuilder.fontHeight())};
W51.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};W51.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return new PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible},this._cache)};
W51.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};function StudyDataWindowView(a,b){DataWindowView.call(this);this.D1=a;this.D0=b;var c=a.metaInfo().plots;if(c){for(var d=0;d<c.length;++d)if(!(this.D1.isSelfColorerPlot(d)||this.D1.isBarColorerPlot(d)||this.D1.isBgColorerPlot(d)||this.D1.isDataOffsetPlot(d))){var e=c[d].id,g;if("Compare@tv-basicstudies"===this.D1.metaInfo().id)g=new DataWindowItem(this.D1.inputsForGUI()[1],"");else{g=this.D1.title();try{g=this.D1.properties().styles[e].title.value()}catch(h){}g=
new DataWindowItem(g,"")}g.plotId=e;g.plotIndex=d;this._items.append(g)}this.update();this._invalidated=!0}}inherit(StudyDataWindowView,DataWindowView);StudyDataWindowView.prototype.update=function(){this._invalidated=!0};
StudyDataWindowView.prototype._updateImpl=function(){this._header=this.D1.title(!0);this._title=this.D1.title();for(var a=$.t("n/a"),b=0;b<this._items.size();++b)this._items.item(b).setValue(a);if(!this.D0.timeScale().isEmpty()){var c=this.D1.metaInfo().plots,d=null,a={};if(c)for(b=0;b<c.length;b++)this.D1.isSelfColorerPlot(b)&&(a[c[b].target]={index:b},a[c[b].target].palette=this.D1.metaInfo().palettes[c[b].palette],a[c[b].target].paletterProps=this.D1.properties().palettes[c[b].palette]);
for(var c=this.D0.crossHairSource().index,e=this.D1.formatter(),b=0;b<this._items.size();++b){var g=this._items.item(b).plotId,d=this._items.item(b).plotIndex,h=this.D1.offset(g),h=this.D1.nearestIndex(c-h,SEARCH_NEAREST_LEFT);void 0!==h&&(h=this.D1.data().valueAt(h)||this.D1.data().last())&&(d=h[d+1],isNumber(d)&&(this._items.item(b).setValue(e.format(d)),d=this.D1.properties().styles[g].color.value(),a[g]&&h.length>a[g].index+1?(h=h[a[g].index+1],void 0!=h?(d=a[g].palette,
g=a[g].paletterProps,d=d.valToIndex?d.valToIndex[h]:h,this._items.item(b).setColor(g.colors[d].color.value())):this._items.item(b).setColor(d)):this._items.item(b).setColor(d)))}}};StudyDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};function DataVendorStudyDataWindowView(a,b){StudyDataWindowView.call(this,a,b)}inherit(DataVendorStudyDataWindowView,StudyDataWindowView);
DataVendorStudyDataWindowView.prototype.additional=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._additional};DataVendorStudyDataWindowView.prototype._updateImpl=function(){var a=TradingView.getDataVendorString(this.D1.symbolInfo());this._additional=a?"(Data Provided by "+a+")":void 0;return StudyDataWindowView.prototype._updateImpl.call(this)};function StudyStatusView(a,b){StatusView.call(this,b);this.D1=a}inherit(StudyStatusView,StatusView);StudyStatusView.prototype.color=function(){return this.D1._failed||this.D1.metaInfo().isTVScriptStub?"#ff0000":StatusView.prototype.color.call(this)};StudyStatusView.prototype.update=function(){this._text=this.D1._failed?this.D1.title(!0)+": "+this.D1.status():this.D1.title(!0)+" "+this.D1.status()};function $90(a,b){this.W99=a;this.D0=b;this._points=new List;this._floatPoints=new List}$90.prototype.addAnchors=function(a){if(this.isAnchorsRequired()){var b=this._points.clone();this.D0.lineBeingCreated()==this.W99&&b.removeAt(b.size()-1);a.append(this.createLineAnchor({points:b}))}};
$90.prototype.update=function(){var a=this.W99.priceScale(),b=this.D0.timeScale();if(a&&!a.isEmpty()&&!b.isEmpty())for(this._points=new List,this._floatPoints=new List,a=this.W99.points(),b=0;b<a.size();b++){var c=a.item(b),d=this.W99.pointToScreenPoint(c);if(!d)break;c=d[0];c.data=b;d=d[1];d.data=b;this._floatPoints.append(c);this._points.append(d)}};
$90.prototype.currentPoint=function(){var a=this.D0.crossHairSource();return new MathEx.Point(a.x,a.y)};$90.prototype.anchorColor=function(){return this.W99.isBeingEdited()?"#D61AD3":this.D0.isDark()?"#FFFFFF":"#606060"};$90.prototype.isHoveredSource=function(){return this.W99===this.D0.hoveredSource()};$90.prototype.isSelectedSource=function(){return this.W99===this.D0.selectedSource()};
$90.prototype.isAnchorsRequired=function(){return this.isHoveredSource()||this.isSelectedSource()};
$90.prototype.createLineAnchor=function(a){return new LineAnchor($.extend({color:this.anchorColor(),backgroundColor:this.D0.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this.D0.linePointBeingEdited(),hittestResult:HitTestResult.CHANGEPOINT,radius:(TradingView.isMobile.any()?15:7)+(this.isSelectedSource()?1:0),strokeWidth:(TradingView.isMobile.any()?3:1)+(this.isSelectedSource()?1:0)},a))};TradingView.study_Compare=function(a,b,c,d){this._symbolLabelView=new TradingView.W38(a,this,"compare");TradingView.Study.call(this,a,b,c,d);var e=this;this.D2.minTick.listeners().subscribe(null,function(){e._createFormatter()});this.properties().minTick.listeners().subscribe(null,function(){e.D0.D20(new A22(A22.FULL_UPDATE))});this.D2.merge({skipHistogramBaseOnAutoScale:!0})};
inherit(TradingView.study_Compare,TradingView.Study);TradingView.study_Compare.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new DataVendorStudyDataWindowView(this,this.D0));TradingView.Study.prototype.createViews.call(this);this._paneViews.append(this._symbolLabelView)};
TradingView.study_Compare.prototype._createFormatter=function(){var a=this.properties().inputs.symbol.value(),a=this._resolvedSymbols?this._resolvedSymbols[a]:null;if("default"==this.properties().minTick.value())this._formatter=new PriceFormatter(a?a.pricescale:100,a?a.minmov:1,a?a.fractional:!1);else{var a=this.properties().minTick.value(),a=isNumber(a)?["100","1","false"]:a.split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&this.priceScale().updateFormatter()};
TradingView.study_Compare.prototype.symbol=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name:a).toUpperCase()};TradingView.study_Compare.prototype.title=function(a){a=this.properties().inputs.symbol.value();var b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name+", "+b.exchange:a).toUpperCase()};
TradingView.study_Compare.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var a=this.D2.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};TradingView.study_Compare.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews.item(0)._fixedCoordinate};function AreaBackgroundRenderer(a){this._data=a}AreaBackgroundRenderer.prototype.hitTest=function(a){selectionTolerance(this.lineWidth);for(var b=1;b<this._data.points1.length;++b)if(currY1=this._data.points1[b],currY2=this._data.points2[b],x=this._data.timePoints[b],x==a.x&&(a.y>=currY1&&a.y<=currY2||a.y<=currY1&&a.y>=currY2))return new HitTestResult(HitTestResult.REGULAR);return null};
AreaBackgroundRenderer.prototype.draw=function(a){if(0!==this._data.points1.length&&0!==this._data.points2.length)for(var b=this._data.timePoints,c=this._data.points1,d=this._data.points2,e=this._data.getBarSpacing()/4,g=paneRendererCoordinateIsValid,h=isNumber(this._data.transparency)?this._data.transparency:50,h=Math.min(h,100),h=Math.max(h,0),h=generateColor(this._data.backcolor,h),k,l,m,n,q,r,u=0;u<this._data.timePoints.length;u++)if(l=b[u],m=c[u],n=d[u],q=c[u+1],r=d[u+1],g(m)&&g(n)&&(k||(k={points1:[],
points2:[],timePoints:[]}),k.points1.push(m),k.points2.push(n),k.timePoints.push(l)),k&&(!g(q)||!g(r))){1===k.timePoints.length&&(k.timePoints=[k.timePoints[0]-e,k.timePoints[0]+e],k.points1.push(k.points1[0]),k.points2.push(k.points2[0]));a.beginPath();a.moveTo(k.timePoints[0],k.points1[0]);for(l=1;l<k.timePoints.length;l++)a.lineTo(k.timePoints[l],k.points1[l]);0<k.timePoints.length&&0<k.points2.length&&a.lineTo(k.timePoints[k.timePoints.length-1],k.points2[k.timePoints.length-1]);for(l=k.timePoints.length-
2;0<=l;l--)a.lineTo(k.timePoints[l],k.points2[l]);a.closePath();a.fillStyle=h;a.fill();k=null}};TradingView.$53=function(a){this.W99=a;this._points1=[];this._points2=[];this._timePoints=[];this._getBarSpacing=a.model().timeScale().barSpacing.bind(a.model().timeScale());this._invalidated=!0};TradingView.$53.prototype.update=function(){this._invalidated=!0};
TradingView.$53.prototype._updateImpl=function(){this._points1=[];this._points2=[];this._timePoints=[];if(this._visible()){var a=this.W99.priceScale(),b=this.W99.D0.timeScale();if(a&&!a.isEmpty()&&!this.W99.D0.timeScale().isEmpty()&&!this.W99._series.bars().isEmpty()){var c=this.W99.data()._columns.indexOf(this._plotAId())+1,d=this.W99.data()._columns.indexOf(this._plotBId())+1,e=this.W99.D0.timeScale().visibleBars();if(!e.isEmpty()){var g=
this.W99.offset(this._plotAId()),h=this.W99._series.nearestIndex(e.firstBar(),SEARCH_NEAREST_RIGHT),e=this.W99._series.nearestIndex(e.lastBar(),SEARCH_NEAREST_LEFT);0<g?(h-=g,e+=g):(h+=g,e-=g);h=this.W99.data().range(h,e);if(0<this.W99.data()._items.length){this.W99.data();for(var e=this.W99.firstValue(),k=h._start;k<h._end;++k){var l=h._indexAt(k),m=h._valueAt(k),l=l+g,n=m[c];a.properties().percentage.value()&&(n=100*(n-e)/e);this._points1.push(n);m=m[d];a.properties().percentage.value()&&
(m=100*(m-e)/e);this._points2.push(m);this._timePoints.push(b.indexToCoordinate(l))}}a.pricesArrayToCoordinates(this._points1);a.pricesArrayToCoordinates(this._points2)}}}};TradingView.$53.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.points1=this._points1;a.points2=this._points2;a.timePoints=this._timePoints;a.getBarSpacing=this._getBarSpacing;a.backcolor=this._color();a.transparency=this._transparency();return new AreaBackgroundRenderer(a)};
TradingView.$53.prototype._plotAId=function(){assert(!1,"Pure virtual call!")};TradingView.$53.prototype._plotBId=function(){assert(!1,"Pure virtual call!")};TradingView.$53.prototype._color=function(){assert(!1,"Pure virtual call!")};TradingView.$53.prototype._transparency=function(){assert(!1,"Pure virtual call!")};TradingView.$53.prototype._visible=function(){assert(!1,"Pure virtual call!")};
TradingView.$55=function(a){TradingView.$53.call(this,a)};inherit(TradingView.$55,TradingView.$53);TradingView.$55.prototype._plotAId=function(){return this.W99.properties().area[0].name.value()};TradingView.$55.prototype._plotBId=function(){return this.W99.properties().area[1].name.value()};TradingView.$55.prototype._color=function(){return this.W99.properties().areaBackground.backgroundColor.value()};
TradingView.$55.prototype._transparency=function(){return this.W99.properties().areaBackground.transparency.value()};TradingView.$55.prototype._visible=function(){return this.W99.properties().areaBackground.fillBackground.value()};
TradingView.W2=function(a,b,c){TradingView.$53.call(this,a);assert(b.type===StudyMetaInfo.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+b.type);this._fillMetaInfo=b;this._fillStyleProps=c};inherit(TradingView.W2,TradingView.$53);TradingView.W2.prototype._plotAId=function(){return this._fillMetaInfo.objAId};TradingView.W2.prototype._plotBId=function(){return this._fillMetaInfo.objBId};
TradingView.W2.prototype._color=function(){return this._fillStyleProps.color.value()};TradingView.W2.prototype._transparency=function(){return this._fillStyleProps.transparency.value()};TradingView.W2.prototype._visible=function(){return this._fillStyleProps.visible.value()};TradingView.$58=function(a,b){this.W99=b;this.D2=a;this._points=new List;this._points.append(new MathEx.Point(-1,-1))};TradingView.$58.prototype.update=function(){var a=this.W99.priceScale();if(!a||a.isEmpty())this._points.setItem(0,new MathEx.Point(-1,-1));else{var b=this.D2.value.value();isNumber(b)?this._points.setItem(0,new MathEx.Point(-1,a.priceToCoordinate(b))):this._points.setItem(0,new MathEx.Point(-1,NaN))}};
TradingView.$58.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D2.color.value();a.linewidth=this.D2.linewidth.value();a.linestyle=this.D2.linestyle.value();a.hitTestResult=HitTestResult.REGULAR;return new HorzLineRenderer(a)};function BandBackgroundRenderer(a){this._data=a}
BandBackgroundRenderer.prototype.draw=function(a){if(0!==this._data.points.length){var b=a.canvas.width;a.fillStyle=generateColor(this._data.backcolor,this._data.transparency);var c=Math.min(this._data.points[0],this._data.points[1]),d=Math.max(this._data.points[0],this._data.points[1]);a.fillRect(0,c,b,d-c)}};BandBackgroundRenderer.prototype.hitTest=function(a){return null};TradingView.$57=function(a){this.W99=a;this._points=[]};
TradingView.$57.prototype.update=function(){this._points=[];if(this.W99.properties().bandsBackground.fillBackground.value()){var a=this.W99.properties().bands[0],b=this.W99.properties().bands[1],c=this.W99.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
TradingView.$57.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this.W99.properties().bandsBackground.backgroundColor.value();a.transparency=this.W99.properties().bandsBackground.transparency.value();return new BandBackgroundRenderer(a)};
TradingView.$84=function(a,b,c){this.W99=a;this._points=[];assert(b.type===StudyMetaInfo.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+b.type);this._initBandIndexes(b.objAId,b.objBId);this._fillStyleProps=c};
TradingView.$84.prototype._initBandIndexes=function(a,b){this._bandBKey=this._bandAKey=null;for(var c=0;c<this.W99.metaInfo().bands.length;++c){var d=this.W99.metaInfo().bands[c];void 0==this._bandAKey&&d.id===a?this._bandAKey=c:void 0==this._bandBKey&&d.id===b&&(this._bandBKey=c)}};
TradingView.$84.prototype.update=function(){this._points=[];if(this._fillStyleProps.visible.value()){var a=this.W99.properties().bands[this._bandAKey],b=this.W99.properties().bands[this._bandBKey],c=this.W99.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
TradingView.$84.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this._fillStyleProps.color.value();a.transparency=this._fillStyleProps.transparency.value();return new BandBackgroundRenderer(a)};function W50(){this._marksByIndex={};this._marksBySpan=[]}W50.prototype.minIndex=void 0;W50.prototype.maxIndex=void 0;
W50.prototype.merge=function(a){for(var b=this._marksBySpan,c={},d=0;d<a.length;d++){var e=a[d],g=e.index,h=e.span,k=this._marksByIndex[e.index];if(k){if(k.index===e.index&&k.span===e.span){k.time=e.time;continue}this._removeTickmark(k)}this._marksByIndex[g]=e;this.minIndex<=g||(this.minIndex=g);this.maxIndex>=g||(this.maxIndex=g);b[h]||(b[h]=[]);b[h].push(e);c[h]=!0}for(h=b.length;h--;)b[h]&&(b[h].length||delete b[h],c[h]&&b[h].sort(this._sortByIndexAsc));delete this._cache};
W50.prototype._removeTickmark=function(a){var b=a.index;this._marksByIndex[b]===a&&(delete this._marksByIndex[b],b<=this.minIndex&&this.minIndex++,b>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),b=this._marksBySpan[a.span],a=b.indexOf(a),-1!==a&&b.splice(a,1))};W50.prototype._sortByIndexAsc=function(a,b){return a.index-b.index};
W50.prototype.removeTail=function(a){var b={};this.maxIndex=0;for(var c in this._marksByIndex)this._marksByIndex[c].time<a&&(b[c]=this._marksByIndex[c],this.maxIndex=Math.max(this.maxIndex,c));this._marksByIndex=b};W50.prototype.addTail=function(a){for(var b=0;b<a.length;b++)a[b].index=this.maxIndex+b+1;this.merge(a)};W50.prototype.indexToTime=function(a){return(a=this._marksByIndex[a])?new Date(1E3*a.time):null};
W50.prototype.build=function(a,b){var c=Math.ceil(b/a);if(this._maxbar===c&&this._cache)return this._cache;this._maxbar=c;for(var d=[],e=this._marksBySpan.length;e--;)if(this._marksBySpan[e]){for(var g=d,d=[],h=g.length,k=0,l=this._marksBySpan[e],m=l.length,n=Infinity,q=-Infinity,r=0;r<m;r++){for(var u=l[r],w=u.index;k<h;){var n=g[k],A=n.index;if(A<w)k++,d.push(n),q=A,n=Infinity;else{n=A;break}}n-w>=c&&w-q>=c&&(d.push(u),q=w)}for(;k<h;k++)d.push(g[k])}return this._cache=d};
W50.prototype.state=function(){for(var a=[],b=this._marksBySpan.length;b--;)this._marksBySpan[b]&&(a=a.concat(this._marksBySpan[b]));return{marks:a}};W50.prototype.restoreState=function(a){this._marksByIndex={};this._marksBySpan=[];delete this.maxIndex;delete this.minIndex;a&&a.marks&&a.marks.length&&this.merge(a.marks)};function TimePoint(a){this.m_date=a}TimePoint.prototype.date=function(){return this.m_date};TimePoint.prototype.setDate=function(a){this.m_date=a};var MONTH_NAMES=void 0,MINUTE_SPAN=20,HOUR_SPAN=30,DAY_SPAN=40,WEEK_SPAN=50,MONTH_SPAN=60,YEAR_SPAN=70,DEFAULT_BAR_SPACING=6,MAX_BAR_SPACING=50,MIN_BAR_SPACING=.5,DEFAULT_RIGHT_OFFSET=5;function _createMonthNames(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}
function W49(a,b){this.D0=a;this.D2=b;this.m_width=0;this._defaultRightOffset=this.D2.rightOffset.value();this.m_rightOffset=this.D2.rightOffset.value();this.m_points=new TimeIndexes;this.m_barSpacing=this.D2.barSpacing.value();this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new W50;this._locked=!1;this._formattedBySpan={}}
W49.prototype.reset=function(){this._visibleBarsCache=null;this.m_points=new TimeIndexes;this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new W50};W49.prototype.restoreDefault=function(){this._visibleBarsCache=null;this.m_barSpacing=DEFAULT_BAR_SPACING;this.m_rightOffset=this.D2.rightOffset.value();this.saveDefault("barSpacing");this._correctOffset();this.recalcLockedScale()};W49.prototype.rightOffset=function(){return this.m_rightOffset};
W49.prototype.scrollToRealtime=function(a){var b=this.D2.rightOffset.value();if(a){var c=this;a=this.m_rightOffset;var d=this.m_width/this.m_barSpacing-10;0<d&&b>d&&(b=d);var e=this.D0;$({offset:a}).animate({offset:b},{duration:1E3,easing:"easeInOutQuint",step:function(a){c._visibleBarsCache=null;c.m_rightOffset=a;e.recalculateAllPanes();e.D20(new A22(A22.LIGHT_UPDATE));e.recalcVisibleRangeStudy(e.D19())}})}else this._visibleBarsCache=
null,this.m_rightOffset=b,this._correctOffset()};W49.prototype.points=function(){return this.m_points};W49.prototype.width=function(){return this.m_width};W49.prototype.barSpacing=function(){return this.m_barSpacing};W49.prototype.setWidth=function(a){this._visibleBarsCache=null;!isFinite(a)||0>=a||(this._locked&&this.m_width&&(this.m_barSpacing*=a/this.m_width),this.m_width=a,this._correctOffset())};
W49.prototype.visibleBars=function(){if(this._visibleBarsCache)return this._visibleBarsCache;if(!this.isEmpty()){var a=Math.ceil(this.m_width/this.m_barSpacing)-1,b=Math.round(this.m_rightOffset+this.m_points.lastTimePointIndex());return this._visibleBarsCache=a=new BarsRange(b-a,b)}};W49.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()};
W49.prototype.indexToCoordinate=function(a,b){if(this.isEmpty()||!isInteger(a))return 0;var c=this.m_points.lastTimePointIndex()+this.m_rightOffset-a,c=this.m_width-(c+.5)*this.m_barSpacing;return b?c:Math.round(c)};W49.prototype.barIndexesToCoordinates=function(a){a=a.toArray();for(var b=0;b<a.length;b++){var c=a[b].time,c=this.m_points.lastTimePointIndex()+this.m_rightOffset-c,c=this.m_width-(c+.5)*this.m_barSpacing;a[b].time=Math.round(c);a[b].exactTime=c}};
W49.prototype.indexesToCoordinates=function(a){a=a.toArray();for(var b=this.m_points.lastTimePointIndex()+this.m_rightOffset,b=this.m_width-b*this.m_barSpacing-.5*this.m_barSpacing,c=0;c<a.length;c++)a[c].x=Math.round(b+a[c].x*this.m_barSpacing)};W49.prototype.coordinateToIndex=function(a){a=(this.m_width+1-a)/this.m_barSpacing;a=this.m_points.lastTimePointIndex()+this.m_rightOffset-a;a=Math.round(1E6*a)/1E6;return Math.ceil(a)};
W49.prototype.timeToCoordinate=function(a){function b(a){return 0>=a||a>=this.m_width}var c=this.m_points.closestIndexLeft(a),d=this.m_points.valueAt(c),c=this.indexToCoordinate(c,!0);if(b(c))return null;var e=this.barSpacing(),g=function(){var a=this.m_points.lastTimePointIndex();return this.m_points.valueAt(a)-this.m_points.valueAt(a-1)}.call(this);a=Math.round(c+(a-d)/g*e)+1;return b(a)?null:a};
W49.prototype.alignCoordinate=function(a){if(this.isEmpty())return a;a=this.coordinateToIndex(a);return this.indexToCoordinate(a)};W49.prototype.timePointToIndex=function(a){return this.m_points.indexOf(a,!0)};W49.prototype.indexToTimePoint=function(a){return(a=this.m_points.valueAt(a))?new Date(1E3*a):null};W49.prototype.indexToUserTime=function(a){return this.m_tickmarks.indexToTime(a)};
W49.prototype.marks=function(){if(this.isEmpty())return null;for(var a=this.m_barSpacing,b=Math.round(75/a),c=this.visibleBars(),d=Math.max(c.firstBar(),c.firstBar()-b),b=Math.max(c.lastBar(),c.lastBar()-b),a=this.m_tickmarks.build(a,75),c=[],e=0;e<a.length;++e){var g=a[e];if(d<=g.index&&g.index<=b){var h=this.m_tickmarks.indexToTime(g.index);null!==h&&c.push({coord:this.indexToCoordinate(g.index),label:this.formatLabel(h,g.span),span:g.span,major:g.label>=DAY_SPAN?1:0})}}return c};
W49.prototype.state=function(a){var b={};b.m_barSpacing=this.barSpacing();b.m_rightOffset=this.m_rightOffset;a&&(0<this.m_points.size()&&(b.m_lastVisibleBar=this.m_points.valueAt(this.m_points.lastTimePointIndex())),b.points=this.m_points.state(),b.tickmarks=this.m_tickmarks.state(),b.width=this.m_width);return b};
W49.prototype.restoreState=function(a,b,c){this._visibleBarsCache=null;void 0===a.m_barSpacing?TradingView.logDebug("W49.restoreState: invalid state"):void 0===a.m_rightOffset?TradingView.logDebug("W49.restoreState: invalid state"):(this.m_barSpacing=a.m_barSpacing,this.m_rightOffset=a.m_rightOffset,this.m_restoredLastTimePoint=a.m_lastVisibleBar,c&&this.m_restoredLastTimePoint&&(c=this.m_points.indexOf(this.m_restoredLastTimePoint),lastIndex=this.m_points.lastTimePointIndex(),offset=
lastIndex-c,this.m_rightOffset=-offset+a.m_rightOffset),b&&(this.m_points.restoreState(a.points),this.m_tickmarks.restoreState(a.tickmarks),a.width&&(this._locked=!0,0<this.m_width&&(this.m_barSpacing*=this.m_width/a.width))),this._correctOffset())};W49.prototype.setOffset=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebug("W49.setOffset: invalid state"):(this.m_rightOffset=a,this._correctOffset())};
W49.prototype.setBarSpacing=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebug("W49.setBarSpacing: invalid state"):this.m_barSpacing=a};W49.prototype._correctOffset=function(){if(!this.isEmpty()){var a=this.m_width/this.m_barSpacing-10;0<a&&this.m_rightOffset>a&&(this.m_rightOffset=a,this._visibleBarsCache=null);a=this.m_points.size()-10;this.m_rightOffset<-a&&(this.m_rightOffset=-a,this._visibleBarsCache=null)}};
W49.prototype.maxOffset=function(){return this.m_width/this.m_barSpacing-10};W49.prototype.startScale=function(a){this.m_scrollStartPoint&&this.endScroll();null!==this.m_scaleStartPoint||null!==this.m_stateSnapshot||this.isEmpty()||(this.m_scaleStartPoint=a,this.m_stateSnapshot=this.state())};
W49.prototype.scaleTo=function(a){this._visibleBarsCache=null;delete this.m_restoredLastTimePoint;if(null!==this.m_stateSnapshot){a=MathEx.clamp(this.m_width-a,0,this.m_width);var b=MathEx.clamp(this.m_width-this.m_scaleStartPoint,0,this.m_width);0!==a&&0!==b&&(this.m_barSpacing=this.m_stateSnapshot.m_barSpacing*a/b,this.m_barSpacing<MIN_BAR_SPACING?this.m_barSpacing=MIN_BAR_SPACING:this.m_barSpacing>MAX_BAR_SPACING&&(this.m_barSpacing=MAX_BAR_SPACING),this._correctOffset(),this.recalcLockedScale())}};
W49.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_stateSnapshot=this.m_scaleStartPoint=null,this.saveDefault("barSpacing"))};W49.prototype.saveDefault=function(a){TradingView.saveDefaultProperties(!0);this.D2[a].setValue(this["m_"+a]);TradingView.saveDefaultProperties(!1)};W49.prototype.startScroll=function(a){null!==this.m_scrollStartPoint||null!==this.m_stateSnapshot||this.isEmpty()||(this.m_scrollStartPoint=a,this.m_stateSnapshot=this.state())};
W49.prototype.scrollTo=function(a){this._visibleBarsCache=null;delete this.m_restoredLastTimePoint;null!==this.m_scrollStartPoint&&(a=(this.m_scrollStartPoint-a)/this.barSpacing(),this.m_rightOffset=this.m_stateSnapshot.m_rightOffset+a,this._correctOffset(),this.D0.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale())};
W49.prototype.scrollToOffsetAnimated=function(a,b){if(!isFinite(a))throw new RangeError("offset is required and must be finite number");void 0===b&&(b=400);if(!isFinite(b)||0>=b)throw new RangeError("animationDuration (optional) must be finite positive number");var c=this,d=this.m_rightOffset,e=+new Date,g=this.D0;(function k(){c._visibleBarsCache=null;var l=(new Date-e)/b;1<=l?(c.m_rightOffset=a,c._visibleBarsCache=null,g.recalculateAllPanes(),g.D20(new A22(A22.LIGHT_UPDATE))):
(c.m_rightOffset=d+(a-d)*l,g.recalculateAllPanes(),setTimeout(k,20))})()};W49.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_stateSnapshot=this.m_scrollStartPoint=null)};W49.prototype._currentSavedPosition=function(){if(!this.isEmpty()){var a=this.m_points.indexOf(this.m_restoredLastTimePoint,!0);isInteger(a)&&(a=this.m_points.lastTimePointIndex()-a,this.m_rightOffset-=a);delete this.m_restoredLastTimePoint}};
W49.prototype.update=function(a,b,c,d){this._visibleBarsCache=null;this.m_tickmarks.merge(d);this.m_points.merge(a,b,c);this.m_restoredLastTimePoint&&this._currentSavedPosition()};W49.prototype.addTail=function(a,b,c){this.m_tickmarks.removeTail(b);a=a.params;b=this.m_tickmarks.maxIndex+(c?0:1);for(var d=0;d<a.marks.length;d++)a.marks[d].index=b+d;this.m_tickmarks.addTail(a.marks);this.m_points.addTail(a.changes,c);this.m_rightOffset-=a.changes.length};
W49.prototype.formatLabel=function(a,b){if(this._formattedBySpan[b])return this._formattedBySpan[b].format(a.valueOf());var c=this;this._formattedBySpan[b]=new FormattedLabelsCache(function(a){return c.formatLabelImpl(new Date(a),b)});return this._formattedBySpan[b].format(a)};
W49.prototype.formatLabelImpl=function(a,b){if(!(a&&a instanceof Date))return"incorrect time";var c=this.D0.mainSeries().isDWM();return b<MINUTE_SPAN&&!c?numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+numberToStringWithLeadingZero(a.getUTCMinutes(),2)+":"+numberToStringWithLeadingZero(a.getUTCSeconds(),2):b<DAY_SPAN&&!c?numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+numberToStringWithLeadingZero(a.getUTCMinutes(),2):b<WEEK_SPAN||b<MONTH_SPAN?a.getUTCDate():b<YEAR_SPAN?(MONTH_NAMES||
(MONTH_NAMES=_createMonthNames()),MONTH_NAMES[a.getUTCMonth()]):a.getUTCFullYear()};W49.prototype.normalizeBarIndex=function(a){var b=0,c=0;a<this.m_points.firstTimePointIndex()?(b=this.m_points.valueAt(this.m_points.firstTimePointIndex()),c=a-this.m_points.firstTimePointIndex()):a>this.m_points.lastTimePointIndex()?(b=this.m_points.valueAt(this.m_points.lastTimePointIndex()),c=a-this.m_points.lastTimePointIndex()):(b=this.m_points.valueAt(a),c=0);return{time_t:b,offset:c}};
W49.prototype.denormalizeTimePoint=function(a){var b=this.m_points.closestIndexLeft(a.time_t);return void 0===b?void 0:b+a.offset};W49.prototype.zoomToBarsRange=function(a,b){if(!(b<=a)){var c=this.m_points.lastTimePointIndex();c&&(this.m_rightOffset=b-c);this.m_barSpacing=this.width()/(b-a+1);this._visibleBarsCache=null}};
W49.prototype.recalcLockedScale=function(){if(this.D0.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()){var a=this.D0.m_mainSeries.priceScale(),b=this.D0.m_mainSeries,c=b.data().boxSize;c||(b.fixBoxSize(),c=b.data().boxSize);if(c){if(a.properties().percentage.value())var d=b.data().search(b.getRealVisibleRange().m_firstBar).value[CLOSE_PLOT],c=PriceRange.prototype.convertToPercent.call(null,d+c,d)-PriceRange.prototype.convertToPercent.call(null,d,d);c=a.internalHeight()/
(this.barSpacing()/c);a=b.priceScale().priceRange();a&&c==a.length()||(!a||a.isEmpty()?(a=this.visibleBars(),a=b.priceRange(a.firstBar(),a.lastBar())):(c=(c-a.length())/2,a.m_minValue-=c,a.m_maxValue+=c),b.priceScale().setPriceRange(a))}}};W49.prototype.correctBarSpacing=function(){!this.isEmpty()&&this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),MAX_BAR_SPACING)))};
W49.prototype.canZoomIn=function(){return this.m_barSpacing<MAX_BAR_SPACING};W49.prototype.canZoomOut=function(){return this.m_barSpacing>MIN_BAR_SPACING};function SelectionRenderer(a){this._data=a}SelectionRenderer.RADIUS=3.5;SelectionRenderer.prototype.tolerance=2;SelectionRenderer.prototype.draw=function(a){if(this._data){a.strokeStyle="#6B6B6B";a.fillStyle="#D6D6D6";for(var b=this._data.vertOffset||0,c=0;c<this._data.points.size();c++){var d=this._data.points.item(c),e=d;void 0===e.x||isNaN(e.x)||null===e.x||void 0===e.y||isNaN(e.y)||null===e.y||this._drawMarker(a,d,b)}}};
SelectionRenderer.prototype._drawMarker=function(a,b,c){a.beginPath();a.arc(b.x+.5,b.y+.5+c,SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};SelectionRenderer.prototype.hitTest=function(a){if(!this._data)return null;for(var b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);if(c.substract(a).length()<=SelectionRenderer.RADIUS+this.tolerance)return new HitTestResult(this._data.hittestResult,c.data)}return null};
function LineAnchor(a,b){this._data=a;this.D0=b;this.radius=this._data.radius||LineAnchor.OUTER_RADIUS}LineAnchor.OUTER_RADIUS=TradingView.isMobile.any()?16:8;LineAnchor.prototype.tolerance=2;
LineAnchor.prototype.draw=function(a){for(var b=this._data.currentPoint,c=this._data.outerStrokeWidth||1,d=0;d<this._data.points.size();d++){var e=this._data.points.item(d),g=e.substract(b).length(),h=isInteger(e.data)&&this._data.linePointBeingEdited===e.data,k=this.radius,l=this._data.strokeWidth||2,g=g<=k+this.tolerance?1:0,k=k+g,l=l+g;h||(e.square?(a.fillStyle=this._data.backgroundColor,a.fillRect(e.x-k,e.y-k,2*k,2*k),a.fillStyle=this._data.color,h=k-c,a.fillRect(e.x-h,e.y-h,2*h,2*h),h=k-c-l,
a.fillStyle=this._data.backgroundColor,a.fillRect(e.x-h,e.y-h,2*h,2*h)):(a.beginPath(),a.arc(e.x,e.y,k,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.backgroundColor,a.fill(),a.beginPath(),a.arc(e.x,e.y,k-c,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.color,a.fill(),a.beginPath(),a.arc(e.x,e.y,k-c-l,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.backgroundColor,a.fill()))}};
LineAnchor.prototype.hitTest=function(a){for(var b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);if(c.substract(a).length()<=this.radius+this.tolerance)return new HitTestResult(this._data.hittestResult,c.data)}return null};SelectionRendererArrowsUpDown=function(a){SelectionRenderer.call(this,a)};inherit(SelectionRendererArrowsUpDown,SelectionRenderer);
SelectionRendererArrowsUpDown.prototype._drawMarker=function(a,b,c){var d=b.isUp?1:-1,e=W54.prototype._calculateVerticalOffset(this._data.barSpacing),g=W54.prototype._calculateMinHeight(this._data.barSpacing);c=c+d*e+d*g;a.beginPath();a.arc(b.x+.5,b.y+.5+c,SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};function CompositeRenderer(){this._renderers=new List}CompositeRenderer.prototype.append=function(a){this._renderers.append(a)};CompositeRenderer.prototype.insert=function(a,b){this._renderers.insert(a,b)};CompositeRenderer.prototype.draw=function(a){for(var b=0;b<this._renderers.size();b++)a.save(),this._renderers.item(b).draw(a),a.restore()};CompositeRenderer.prototype.drawBackground=function(a){for(var b=0;b<this._renderers.size();b++)this._renderers.item(b).drawBackground&&this._renderers.item(b).drawBackground(a)};
CompositeRenderer.prototype.hitTest=function(a){for(var b=this._renderers.size()-1;0<=b;b--){var c=this._renderers.item(b).hitTest(a);if(c)return c}return!1};function SelectionIndexes(){}SelectionIndexes.DENSITY=10;SelectionIndexes.prototype.calc=function(a,b){for(var c=new List,d=a;d<=b;d++)0===d%SelectionIndexes.DENSITY&&c.append(d);return c};function W48(a,b){PriceAxisView.call(this,a,b);this._linetool=a;this._pointIndex=b;this._text="";this._coordinate=0;this._background="#5592C9";this._activeBackground="#0F6DBF";this._borderColor="#2E84A6";this._color="white";this._textHeight=14;this._invalidated=!0;this.D0=a.D0}inherit(W48,PriceAxisView);W48.prototype.update=function(){this._invalidated=!0};W48.prototype.setActive=function(a){this._active=a};
W48.prototype._updateImpl=function(){this._visible=!1;this._text="";if(this.D0.timeScale()&&!this.D0.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&!(this.D0.selectedSource()!==this._linetool&&!this._linetool.customization.forcePriceAxisLabel||this.D0.timeScale().visibleBars().isEmpty()||this._linetool.points().size()<=this._pointIndex)){var a=this._linetool.points().item(this._pointIndex);if(isFinite(a.price)){var b=this._linetool.priceScale();
if(b.isPercent()){var c=this._linetool.ownerSource().firstValue();if(!isNumber(c))return;a.price=b.priceRange().convertToPercent(a.price,c)}this._text=b.formatter().format(a.price);this._coordinate=b.priceToCoordinate(a.price);this._textHeight=b.m_markBuilder.fontHeight();this._visible=!0}}};
W48.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return new PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,borderColor:this._borderColor,background:this._active?this._activeBackground:this._background,textHeight:this._textHeight,visible:this._visible})};W48.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};
function LineToolTimeAxisView(a,b){TimeAxisView.call(this);this._linetool=a;this._pointindex=b;this.D0=a.D0;this._text="";this._coordinate=0;this._background="#5592C9";this._activeBackground="#0F6DBF";this._borderColor="#2E84A6";this._color="white";this._visible=!1;this._textHeight=14;this._invalidated=!0}inherit(LineToolTimeAxisView,TimeAxisView);LineToolTimeAxisView.prototype.setActive=function(a){this._active=a};LineToolTimeAxisView.prototype.update=function(){this._invalidated=!0};
LineToolTimeAxisView.prototype.updateImpl=function(){this._visible=!1;if(!(this.D0.timeScale().isEmpty()||this._linetool.points().size()<=this._pointindex||this._linetool!==this.D0.selectedSource())){this._text="";var a=this._linetool.points().item(this._pointindex).index;this._coordinate=this.D0.timeScale().indexToCoordinate(a);if(a=this.D0.timeScale().indexToUserTime(a))this._text=(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(a);this._visible=!0;this._invalidated=
!1}};LineToolTimeAxisView.prototype.renderer=function(){this._invalidated&&this.updateImpl();return new TimeAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,textHeight:this._textHeight,visible:this._visible})};
function W47(a,b,c){DataSource.call(this);this.D0=a;this.D2=c;c.visible&&c.frozen||this.D2.merge(defaults("linetool"));$.isArray(b)?this._paneViews=b:this._paneViews=[b];this._points=new List;this._fixedPoints=new List;this._timePoint=new List;this.D2.symbol||(this.D2.merge({symbol:a.mainSeries().symbol()}),(b=a.mainSeries().symbolInfo())&&this.D2.merge({symbolInfo:{listed_exchange:b.listed_exchange,short_name:b.name}}));this.D2.interval||
this.D2.merge({interval:a.mainSeries().interval()});this.D2.addExclusion&&(this.D2.addExclusion("symbol"),this.D2.addExclusion("symbolInfo"),this.D2.addExclusion("points"),this.D2.addExclusion("interval"),this.D2.addExclusion("visible"));this.calcIsActualSymbol();this.D2.listeners().subscribe(this,W47.prototype.propertiesChanged);this._createPointsProperties();"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&
(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash));this.m_priceAxisViews=new List;this.m_timeAxisViews=new List;if(0<this.pointsCount())for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.append(this.createPriceAxisView(a)),this.m_timeAxisViews.append(new LineToolTimeAxisView(this,a));this.D2.visible.listeners().subscribe(this,function(a){a.value()||this.D0.selectedSource()!=this||this.D0.setSelectedSource(null)});this.customization=this.customization||{forcePriceAxisLabel:!1,
disableSelection:!1,disableErasing:!1};$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this))}inherit(W47,DataSource);W47.LINEEND_NORMAL=0;W47.LINEEND_ARROW=1;W47.LINEEND_CIRCLE=2;W47.PointPriceProperty=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(W47.PointPriceProperty,Property);W47.prototype.getType=function(){return TradingView.className(this.constructor)};
W47.prototype.getConstructor=function(){return this._constructor||null};W47.prototype.isActualSymbol=function(){return this._isActualSymbol};W47.prototype.calcIsActualSymbol=function(){var a=this.D2,b=this.D0.mainSeries(),c=b.symbolInfo();this._isActualSymbol=c&&a.symbolInfo?a.symbolInfo.listed_exchange.value()===c.listed_exchange&&a.symbolInfo.short_name.value()===c.name:a.symbol.value()===b.symbol()||a.symbol.value().split(":").slice(-1)[0]===b.symbol().split(":").slice(-1)[0]};
W47.PointPriceProperty.prototype.value=function(){var a=this._lineSource.points().item(this._pointIndex).price;return parseFloat(this._lineSource.priceScale().formatter().format(a))};W47.PointPriceProperty.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.price=parseFloat(a);this._lineSource.setPoint(this._pointIndex,b);this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging(!0)};
W46=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(W46,Property);W46.prototype.value=function(){return this._lineSource.points().item(this._pointIndex).index};
W46.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.index=a;a=this._lineSource.priceScale();if(a.isPercent()){var c=this._lineSource.ownerSource().firstValue();b.price=a.priceRange().convertToPercent(b.price,c)}this._lineSource.setPoint(this._pointIndex,b);this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging(!0)};
W47.prototype._createPointsProperties=function(){this.D2.addProperty("points");for(var a=this.D2.points,b=0;b<this.pointsCount();b++){a.addProperty(b);var c=a[b];c.addProperty("price");c.price=new W47.PointPriceProperty(this,b);c.addProperty("bar");c.bar=new W46(this,b)}};W47.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null};W47.prototype.symbol=function(){return this.D2.symbol.value()};
W47.prototype.properties=function(){return this.D2};W47.prototype.isSavedInStudyTemplates=function(){return!1};
W47.prototype.state=function(a){var b={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),points:this._timePoint.toArray(),zorder:this.zorder()};delete b.state.points;a&&(b.indexes=this._points.toArray());this.ownerSource()&&(b.ownerSource=this.ownerSource().id());this.isFixed()&&(b.positionPercents=(this._positionPercents||this.calcPositionPercents()).toArray());"version"in this&&1!==this.version&&(b.version=this.version);this.hasAlert.value()&&(b.alertId=
this._alertId);return b};W47.prototype.template=function(){var a=this.properties().state();delete a.points;delete a.symbol;delete a.symbolInfo;return a};W47.prototype.restoreTemplate=function(a){delete a.symbolInfo;this.D0._undoModel.drawingLoadTemplate(this,a)};W47.prototype.clearData=function(){this._points=new List};W47.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId};
W47.prototype.stop=function(){this._currentPointsetId&&(this.D0.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null);this.hasAlert.value()&&TradingView.alertsDispatcher.deleteAlert(this._alertId)};W47.prototype.isStarted=function(){return!!this._currentPointsetId};W47.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=0,this.createServerPoints())};
W47.prototype.tryCreateServerPoints=function(){this.isFixed()||this._currentPointsetId||this.createServerPoints()};W47.prototype.normalizePoint=function(a){var b=this.D0.timeScale().normalizeBarIndex(a.index);b.price=a.price;return b};
W47.prototype.normalizePoints=function(){this._timePoint.clear();for(var a=0;a<this._points.size();a++){var b=this.D0.timeScale().normalizeBarIndex(this._points.item(a).index);if(!b.time_t){this._timePoint.clear();break}b.price=this._points.item(a).price;this._timePoint.append(b)}};
W47.prototype.denormalizeTimePoints=function(){for(var a=[],b=0;b<this._timePoint.size();b++){var c=this.D0.timeScale().denormalizeTimePoint(this._timePoint.item(b));if(void 0===c){a=[];break}else a.push({index:c,price:this._timePoint.item(b).price})}0<a.length&&(this._points=new List(a))};W47.prototype.restorePoints=function(a,b,c){this._timePoint=new List(a);this._points=new List(b);c||this.denormalizeTimePoints()};
W47.prototype.restorePositionPercents=function(a){this._positionPercents=new List(a)};W47.prototype.propertiesChanged=function(){this.updateAllViews();this.D0.updateSource(this)};
W47.prototype.points=function(){for(var a=[],b=0;b<this._points.size();b++){var c=this._points.item(b);a.push({index:c.index,price:c.price,time:c.time})}this._lastPoint&&a.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time});a=new List(a);this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(a);return a};
W47.prototype.fixedPoints=function(){var a=new List;if(this._positionPercents&&!this.priceScale().isEmpty())for(var b=0;b<this._positionPercents.size();b++){var c=this._positionPercents.item(b),d=this.D0.timeScale().width()*c.x,c=this.priceScale().height()*c.y;a.append(new MathEx.Point(d,c))}else for(b=0;b<this._fixedPoints.size();b++)a.append(this._fixedPoints.item(b).clone());this._lastPoint&&a.append(this._lastPoint.clone());this._currentMovingPoint&&this._startMovingPoint&&this.correctFixedPoints(a);
return a};W47.prototype.addPoint=function(a,b){b&&b.shift&&2<=this.points().size()&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));var c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();a.price=c.priceRange().convertFromPercent(a.price,d)}this._points.append(a);(c=this._points.size()==this.pointsCount())?(this._lastPoint=null,this.normalizePoints(),this.createServerPoints()):this._lastPoint=a;return c};
W47.prototype.addFixedPoint=function(a){this._fixedPoints.append(a);(a=this._fixedPoints.size()==this.pointsCount())&&this.calcPositionPercents();return a};
W47.prototype.calcPositionPercents=function(){if(!this.priceScale()||this.priceScale().isEmpty())return new List;this._positionPercents=new List;for(var a=0;a<this._fixedPoints.size();a++){var b=this._fixedPoints.item(0),c=b.x/this.D0.timeScale().width(),b=b.y/this.priceScale().height();this._positionPercents.append({x:c,y:b})}return this._positionPercents};W47.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()};
W47.prototype.onData=function(a){if(a.params.customId===this.currentPointsetId()&&0!==a.params.plots.length){for(var b=0;b<a.params.plots.length;b++){var c=a.params.plots[b],d=this._timePoint.item(c.index),d={index:c.value[0],time:new Date(1E3*c.value[1]),price:d.price};this._points.size()<=c.index?this._points.append(d):this._points.setItem(c.index,d)}this.checkAlert&&this.checkAlert();this.updateAllViews();this.D0.updateSource(this)}};
W47.prototype.correctPricesToPercents=function(){for(var a=this.priceScale(),b=this.ownerSource().firstValue(),c=0;c<this._points.size();c++){var d=this._points.item(c);d.price=a.priceRange().convertFromPercent(d.price,b)}};W47.prototype.startChanging=function(a,b){a<this.m_priceAxisViews.size()&&this.m_priceAxisViews.item(a).setActive(!0);a<this.m_timeAxisViews.size()&&this.m_timeAxisViews.item(a).setActive(!0)};
W47.prototype.setPoint=function(a,b,c){c&&c.shift&&this.D2.snapTo45Degrees&&(c=0===a?1:a-1,this._snapPoint45Degree(b,this.points().item(c)));c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();b.price=c.priceRange().convertFromPercent(b.price,d)}this._points.setItem(a,b);this.normalizePoints()};
W47.prototype.startMoving=function(a){this.isFixed()&&this.restoreFixedPoints();var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}this._startMovingPoint=a};W47.prototype.move=function(a){var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}this._currentMovingPoint=a;this.updateAllViews()};
W47.prototype.correctPoints=function(a){for(var b=this._currentMovingPoint.index-this._startMovingPoint.index,c=this._currentMovingPoint.price-this._startMovingPoint.price,d=0;d<a.size();d++){var e=a.item(d);e.index+=b;e.price+=c;a.setItem(d,e)}};W47.prototype.correctFixedPoints=function(a){for(var b=this._currentMovingPoint.substract(this._startMovingPoint),c=0;c<a.size();c++)a.setItem(c,a.item(c).add(b))};
W47.prototype.endMoving=function(){this.D2.interval.setValue(this.D0.mainSeries().interval());var a=!1,b=!1;this._currentMovingPoint&&this._startMovingPoint&&(a=this._currentMovingPoint.index!=this._startMovingPoint.index,b=this._currentMovingPoint.price!=this._startMovingPoint.price,this.isFixed()?this.correctFixedPoints(this._fixedPoints):this.correctPoints(this._points),this._currentMovingPoint=this._startMovingPoint=null);this.isFixed()?(this.calcPositionPercents(),this.updateAllViews()):
(this.normalizePoints(),this.updateAllViews(),a&&this.createServerPoints(),(b||a)&&this.synchronizeAlert(!0))};W47.prototype.endChanging=function(a){this.D2.interval.setValue(this.D0.mainSeries().interval());this.normalizePoints();this.createServerPoints();for(var b=0;b<this.m_priceAxisViews.size();b++)this.m_priceAxisViews.item(b).setActive(!1);for(b=0;b<this.m_timeAxisViews.size();b++)this.m_timeAxisViews.item(b).setActive(!1);this.synchronizeAlert(!a)};
W47.prototype.paneViews=function(a){if(!this._isActualSymbol||!this.D2.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled())return null;a=new List;for(var b=this._paneViews.length-1;0<=b;--b)a.append(this._paneViews[b]);return a};W47.prototype.dataWindowView=function(){return null};W47.prototype.statusView=function(){return null};
W47.prototype.priceAxisViews=function(a,b){if(this._isActualSymbol&&a.D19().contains(this)&&b===this.priceScale()){var c=new List;if(this.D0.lineBeingEdited()===this){var d=this.D0.linePointBeingEdited();if(d<this.m_priceAxisViews.size()){var c=this.m_priceAxisViews.clone(),e=c.item(d);c.removeAt(d);c.append(e);return c}}return this.m_priceAxisViews}return null};
W47.prototype.timeAxisViews=function(){if(this.D0.lineBeingEdited()===this){var a=this.D0.linePointBeingEdited();if(a<this.m_timeAxisViews.size()){var b=this.m_timeAxisViews.clone(),c=b.item(a);b.removeAt(a);b.append(c);return b}}return this.m_timeAxisViews};
W47.prototype.updateAllViews=function(){if(!this._isActualSymbol||!this.D2.visible.value())return null;var a=this.paneViews();if(null!==a)for(var a=a.toArray(),b=0;b<a.length;b++)a[b].update();a=this.m_priceAxisViews.toArray();for(b=0;b<a.length;b++)a[b].update();a=this.m_timeAxisViews.toArray();for(b=0;b<a.length;b++)a[b].update()};
W47.prototype.setLastPoint=function(a,b){b&&b.shift&&2<=this.points().size()&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));var c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();a.price=c.priceRange().convertFromPercent(a.price,d)}this._lastPoint=a;this.updateAllViews()};W47.prototype.setLastFixedPoint=function(a){this._lastFixedPoint=a;this.updateAllViews()};W47.prototype.title=function(){return"Line Tool"};
W47._pointSetId=1;W47.prototype.start=function(){this.createServerPoints()};
W47.prototype.tryRemoveOffsetFromPoints=function(){var a=this.D0.timeScale();if(a&&!a.isEmpty())for(var b=a.points().lastTimePointIndex(),c=a.points().valueAt(b),d=0;d<this._timePoint.size();d++){var e=this._timePoint.item(d);if(0!==e.offset&&!(e.time_t>=c)){var g=a.points().indexOf(e.time_t,!0);g+e.offset<=b?(e.time_t=a.points().valueAt(g+e.offset),e.offset=0):(e.time_t=c,e.offset-=b-g)}}};
W47.prototype.createServerPoints=function(){if(!this._recursiveGuard&&this._isActualSymbol&&this.D0.chartApi().connected()&&(this._currentPointsetId&&this.D0.chartApi().removePointset(this.currentPointsetId()),!this.D0.timeScale().isEmpty()&&(0===this._timePoint.size()&&this.normalizePoints(),0!==this._timePoint.size()))){this.tryRemoveOffsetFromPoints();this._currentPointsetId=++W47._pointSetId;for(var a=this.D0.mainSeries().symbolId(),b=this.properties().interval.value(),
c=[],d=0;d<this._timePoint.size();d++){var e=this._timePoint.item(d);c.push([e.time_t,e.offset])}var g=this;this.D0.chartApi().createPointset(this.currentPointsetId(),"turnaround",a,b,c,function(a){g.onData(a)})}};W47.prototype.isBeingEdited=function(){return this===this.D0.lineBeingEdited()||this===this.D0.sourceBeingMoved};W47.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()};
W47.prototype.isLocked=W47.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()};W47.prototype._tooltipFieldsHash={};W47.prototype._tooltipFieldsOrder="time price index time0 price0 time1 price1 time2 price2 time3 price3 time4 price4 distance term pointsPerBar".split(" ");W47.prototype._tooltipFieldsOrdered=null;
W47.prototype._formatTooltip=function(){null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new OrderedHash(this._tooltipFieldsHash,OrderedHash.byOrder(this._tooltipFieldsOrder)));return this._tooltipFieldsOrdered.array.filter(function(a){return null!==a.value&&""!==a.value}).map(function(a){return"<span>"+a.title+":</span> "+a.value}).join("<br />")};
W47.prototype.pointToScreenPoint=function(a){var b=this.D0.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||b.isEmpty())return new MathEx.Point(0,0);var d=null;if(c.isPercent()){if(!this.ownerSource())return;d=this.ownerSource().firstValue();if(null===d||!isFinite(d))return}var e=b.indexToCoordinate(a.index,!0),g=a.price;c.isPercent()&&(g=c.priceRange().convertToPercent(g,d));var h=c.priceToCoordinate(g,!0),d=new MathEx.Point(e,h),e=b.indexToCoordinate(a.index,!1),h=c.priceToCoordinate(g,
!1);a=new MathEx.Point(e,h);return[d,a]};W47.prototype.screenPointToPoint=function(a){var b=this.D0.timeScale(),c=this.priceScale(),b=b.coordinateToIndex(a.x);a=c.coordinateToPrice(a.y);var d=null;if(c.isPercent()){if(!this.ownerSource())return;d=this.ownerSource().firstValue();if(null===d||!isFinite(d))return}c.isPercent()&&(a=c.priceRange().convertFromPercent(a,d));return{price:a,index:b}};W47.prototype.tags=function(){return[this._constructor]};
W47.prototype._snapPoint45Degree=function(a,b,c){var d=this.D0.timeScale(),e=d.indexToCoordinate(b.index),g=d.indexToCoordinate(a.index)-e,h=this.m_priceScale,k=b.price,l=a.price;firstValue=this.ownerSource().firstValue();h.isPercent()&&(k=h.priceRange().convertToPercent(k,firstValue));var m=h.priceToCoordinate(k),l=h.priceToCoordinate(l)-m;switch(Math.round(Math.atan2(g,l)/Math.PI*4)){case 2:case -2:if(!c){a.price=k;break}case 0:case 4:case -4:if(!c){a.index=b.index;break}default:k=
Math.sqrt(g*g+l*l),c=0>g?-1:1,b=0>l?-1:1,g=Math.max(Math.abs(l),Math.abs(g)),l=g*Math.sqrt(2)/k,g=Math.round(d.coordinateToIndex(e+g/l*c)),correctedDiff=Math.abs(d.indexToCoordinate(g)-e),d=h.coordinateToPrice(m+correctedDiff*b),a.index=g,a.price=d}};W47.prototype.createPriceAxisView=function(a){return new W48(this,a)};W47.prototype.version=1;W47.isLineTool=function(a){return(a=TradingView[a])?isInherited(a,W47):!1};
W47.prototype.alertId=function(){return this._alertId};
W47.prototype.setAlert=function(a,b,c,d){if(this.canHasAlert()&&(a=a instanceof TradingView.Alert?a.id():parseInt(a),!isNaN(a))){b="function"===typeof b?b:function(){};var e=function(){A83.showGoProDialog({feature:"savedChartsForAlertLimit"});"function"===typeof c&&c()};this._alertId=a;this._alert=null;this.hasAlert.setValue(!0);this._processAlertHanders("unsubscribe");this._processAlertHanders("subscribe");d?b():window.saver?saver.saveChartSilently(b,!1,e,{noDefaultOnFail:!0}):b()}};
W47.prototype._processAlertHanders=function(a){function b(a){this.synchronizeAlert(!1)}a="subscribe"===a?"subscribe":"unsubscribe";TradingView.alertsDispatcher.alertDeleted[a](this,this.removeAlert);TradingView.alertsDispatcher.alertDeletingStarted[a](this,this.removeAlert);TradingView.alertsDispatcher.alertDeletingAllStarted[a](this,this.removeAlert);TradingView.alertsDispatcher.alertHovered[a](function(){var a=this.D0.hoveredSource(),a=a&&a.canHasAlert()&&a.alertId(),b=TradingView.alertsDispatcher.alertHovered.value(),
b=b&&b.id();b===this._alertId&&b!==a?this.D0.setHoveredSource(this):b!==this._alertId&&this._alertId===a&&this.D0.setHoveredSource(null)}.bind(this));TradingView.alertsDispatcher.alertSelected[a](function(){var a=this.D0.selectedSource(),a=a&&a.canHasAlert()&&a.alertId(),b=TradingView.alertsDispatcher.alertSelected.value(),b=b&&b.id();b===this._alertId&&b!==a?this.D0.setSelectedSource(this):b!==this._alertId&&this._alertId===a&&this.D0.setSelectedSource(null)}.bind(this));this.properties().extendLeft&&
this.properties().extendRight&&(this.properties().extendLeft[a](this,b),this.properties().extendRight[a](this,b))};W47.prototype.removeAlert=function(a){a&&a!==this._alertId||(delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),this._processAlertHanders("unsubscribe"))};
W47.prototype.getAlert=function(a,b){var c={};c.success="function"===typeof a?a:function(){};c.cacheOnly="boolean"===typeof b?b:void 0;this.hasAlert.value()?TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(this._alertId,c):console.error("[Alerts] Can't get alert without alert alerts dispatcher"):_callback(null)};
W47.prototype.synchronizeAlert=function(a){var b=this;b.hasAlert.value()&&b.getAlert(function(c){if(c){var d=b.D2.interval.value();d!==c.resolution()&&c.resolution(d);c.extra().drawing(b);b.needSynchronizeAlertWithServer=!0;a&&(c.generateScript(!0),restartAlert(c,null,function(){b.needSynchronizeAlertWithServer=!1}))}})};
W47.prototype.stateForAlert=function(){if(this.canHasAlert()){var a=this.state();a.uniqueId=this.uniqueId();a.title=this.title();var b=this._getAlertPlots();b&&(a.plots=b);return a}};W47.prototype._getAlertPlots=function(){return null};
W47.prototype._linePointsToAlertPlot=function(a,b,c,d){if(2!==a.length)return console.error("[Drawing Alert] Wrong points"),null;var e=this.D0.timeScale();return!e||e.isEmpty()?null:{type:"LinePlot",title:b||this.title(),timestamp:Math.round(e.indexToTimePoint(0).getTime()/1E3),offset1:a[0].index,offset2:a[1].index,price1:a[0].price,price2:a[1].price,extendBackward:c||!1,extendForward:d||!1}};
W47.prototype.getAlertIsActive=function(a){this.getAlert(function(b){a(b?b.active():!1)},!0)};A63=function(a,b,c,d){var e=new $92(this,a);b.push(e);W47.call(this,a,b,c);this.properties().listeners().subscribe(this,A63.prototype.changeStyles);this._constructor=d;this._inputs=this._graphics=this._metaInfo=this._indexes=this._nonseriesdata=this._studyId=null};inherit(A63,W47);
A63.prototype.pointsCount=function(){throw Error("Reimplement this in a child class");};A63.prototype.title=function(){return this._metaInfo.description};A63.prototype.studyId=function(){return this._metaInfo.id};A63.prototype._requestStudy=function(){throw Error("Reimplement this in a child class");};
A63.prototype.changeStyles=function(){if(this._inputs){var a=A0.splitInputs(this.properties().inputs.state()),a=a.obj,b;for(b in a)if(a[b]!==this._inputs[b]){this._inputs=a;this._requestStudy();break}}else{var a=A0.splitInputs(this.properties().inputs.state());this._inputs=TradingView.clone(a.obj);this._requestStudy()}};
A63.prototype._checkTurnaround=function(a){return a===this._turnaround||a==this.D0.mainSeries()._turnaround||a===this.D0.mainSeries()._turnaround+"_"+this._turnaround};A63.prototype.stop=function(){W47.prototype.stop.call(this);this._studyId&&this.D0.chartApi().removeStudy(this._studyId)};A63.prototype.onData=function(a){throw Error("Reimplement this in a child class");};
A63.prototype._correctedPoint=function(a){var b=parseInt(this.D0.mainSeries().bars().first(),10),c=parseInt(this.D0.mainSeries().bars().last(),10);a.index=Math.max(a.index,b);a.index=Math.min(a.index,c);return a};A63.prototype.addPoint=function(a){return W47.prototype.addPoint.call(this,this._correctedPoint(a))};
A63.prototype.setLastPoint=function(a){return W47.prototype.setLastPoint.call(this,this._correctedPoint(a))};A63.prototype.move=function(a){};A63.prototype.clearData=function(){this._indexes=this._nonseriesdata=null;this._graphics=new A62(this._metaInfo);this.updateAllViews()};
A63.prototype.state=function(a){var b=W47.prototype.state.call(this,a);a&&(b.nonseriesdata=this._nonseriesdata,b.nonseriesindexes=this._indexes,b.graphics=this._graphics.graphics());this.metaInfo()instanceof StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=StudyMetaInfo.parseIdString(b.metaInfo.id+(b.metaInfo.version?"-"+b.metaInfo.version:"")).fullId);return b};
A63.prototype.restoreData=function(a){this._nonseriesdata=a.nonseriesdata?a.nonseriesdata:null;this._indexes=a.nonseriesindexes?a.nonseriesindexes:null;this._graphics.setGraphics(a.graphics?a.graphics:A62.emptyGraphics())};A63.prototype.setPoint=function(a,b){this._indexes=this._nonseriesdata=null;W47.prototype.setPoint.call(this,a,this._correctedPoint(b))};
A63.prototype.disconnect=function(){this._studyId=0};A63.prototype.graphics=function(){return this._graphics.graphics()};A63.prototype.firstValue=function(){return this.D0.mainSeries().data().firstValue()};A63.prototype.formatter=function(){return this.D0.mainSeries().data().formatter()};A63.prototype.metaInfo=function(){return this._metaInfo};
function $92(a,b){$90.call(this,a,b)}inherit($92,$90);
$92.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||this.W99._nonseriesdata||this.W99._graphics&&!this.W99._graphics.isEmpty())return a;var b=this._points.item(0),c=this._points.item(1);Math.min(b.x,c.x);Math.max(b.x,c.x);var d={};d.points=(new List).append(b);d.color="#808080";d.linewidth=this.W99._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));d={};d.points=(new List).append(c);
d.color="#808080";d.linewidth=this.W99._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));b={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:"#808080",linewidth:this.W99._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));return a};
function W31(a,b){$90.call(this,a,b)}inherit(W31,$90);W31.prototype.renderer=function(){var a=new CompositeRenderer;this.isAnchorsRequired()&&(a.append(new SelectionRenderer({points:this._points})),a.append(this.createLineAnchor({points:this._points})));return a};A67=function(a){this._data=a};A67.prototype.hitTest=function(a){return null};
A67.prototype.draw=function(a){a.font=this._data.textHeight+" Arial";a.fillStyle=this._data.backColor;var b=a.measureText(this._data.text).width,c=this._data.pos;"left"==this._data.align&&(c=b+4+2-1);a.save();a.translate(.5,.5);a.fillRect(c-4-2-b,this._data.coordinate-this._data.textHeight/2-1,b+4+2,this._data.textHeight+2);a.fillStyle=this._data.color;a.textBaseline="middle";a.fillText(this._data.text,c-2-b,this._data.coordinate);a.restore()};
TradingView.W38=function(a,b,c,d){this.D0=a;this.W99=b;this._plotIndex=c;this._getterName=d?d:"symbol";this._cache={};this._invalidated=!0};TradingView.W38.prototype.update=function(){this._invalidated=!0};
TradingView.W38.prototype.updateImpl=function(){this._visible=!1;var a=this.W99.lastValueData(this._plotIndex,!1);a&&this.W99.priceScale().properties().showSymbolLabels.value()&&(this._visible=!0,this._coordinate=a.coordinate,this._color=a.color,this._text=this.W99[this._getterName](),this._textHeight=this.W99.priceScale().m_markBuilder.fontHeight())};
TradingView.W38.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);if(!this._visible)return new CompositeRenderer;var a=this.D0.paneForSource(this.W99),b="right";a.leftPriceScale()==this.W99.priceScale()&&(b="left");var c=this.D0.properties();(a=!a.leftPriceScale().mainSource()||!a.rightPriceScale().mainSource())&&c.scalesProperties.showLeftScale.value()&&!c.scalesProperties.showRightScale.value()&&(b="left");if(!a&&("left"==b&&
!c.scalesProperties.showLeftScale.value()||"right"==b&&!c.scalesProperties.showRightScale.value()))return new CompositeRenderer;c=this._coordinate;this.W99.lastPriceLabelFixedCoordinate&&(c=this.W99.lastPriceLabelFixedCoordinate()||c);b={coordinate:c,backColor:this._color,color:(new RGBColor(this._color)).blackWhiteContrast(),text:this._text,pos:this.D0.timeScale().width(),textHeight:this._textHeight,align:b};return new A67(b)};function PoligonRenderer(a,b){this._data=a;this._hittest=b?b:new HitTestResult(HitTestResult.MOVEPOINT)}
PoligonRenderer.prototype.draw=function(a){if(!this._data.points.isEmpty()){a.beginPath();a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0);a.moveTo(b.x,b.y);for(b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);a.lineTo(c.x,c.y)}this._data.filled&&this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill());this._data.filled&&!this._data.skipClosePath&&
a.closePath();0<this._data.linewidth&&a.stroke()}};PoligonRenderer.prototype.hitTest=function(a){if(void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(var b=TradingView.isMobile.any()?24:3,c=1;c<this._data.points.size();c++){var d=this._data.points.item(c-1),e=this._data.points.item(c);if(MathEx.distanceToSegment(d,e,a).distance<=b)return this._hittest}return this._data.filled&&this._data.fillBackground&&MathEx.isInPolygon(this._data.points,a)?this._hittest:null};TradingView.$60=function(a,b){$90.call(this,a,b)};inherit(TradingView.$60,$90);
TradingView.$60.prototype.renderer=function(){if(this._pattern&&2==this.W99.points().size()){var a=this.W99.points().item(0).index,b=this.W99.points().item(1).index,b=a<b?this._points.item(0):this._points.item(1);if(!b)return new CompositeRenderer;var c=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this._pattern.length-1));if(this.W99.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE){a=new CompositeRenderer;new List;for(var d=0;d<this._pattern.length;d++){var e=
Math.round(b.x+d*c+.5),g=b.y+Math.round(this._pattern[d].high),h=b.y+Math.round(this._pattern[d].low),k={};k.points=(new List).append(new MathEx.Point(e-1,g)).append(new MathEx.Point(e+1,h));k.color=this.W99.properties().color.value();k.linewidth=1;k.backcolor=this.W99.properties().color.value();k.fillBackground=!0;k.transparency=10;a.append(new RectangleRenderer(k))}}else a=new CompositeRenderer,k={},k.barSpacing=c,k.items=this._pattern,k.histogramBase=0,k.lineIndex=0,k.lineColor=generateColor(this.W99.properties().color.value(),
10),k.lineStyle=CanvasEx.LINESTYLE_SOLID,k.lineWidth=2,k.hittest=new HitTestResult(HitTestResult.MOVEPOINT),a.append(new W68(k));this.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}))}else{a=new CompositeRenderer;if(2>this._points.size())return a;b=this._points.item(0);c=this._points.item(1);Math.min(b.x,c.x);Math.max(b.x,c.x);d={};d.points=(new List).append(b);d.color="#808080";d.linewidth=1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));
d={};d.points=(new List).append(c);d.color="#808080";d.linewidth=1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));b={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b))}return a};
TradingView.$60.prototype.update=function(){$90.prototype.update.call(this);if(!(!this.W99.priceScale()||this.W99.priceScale().isEmpty()||2>this._points.size()))if(this.W99._pattern&&0<this.W99._pattern.length&&2==this.W99.points().size()){var a=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this.W99._pattern.length-1)),b=this.W99.priceScale(),c=this.W99._pattern;if(this.W99.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE){this._pattern=
[];if(b.isPercent()){for(var d=this.W99.ownerSource().firstValue(),e=[],g=b.priceRange(),h=c.length;h--;)e[h]=[],e[h][HIGH_PLOT]=g.convertToPercent(c[h][HIGH_PLOT],d),e[h][LOW_PLOT]=g.convertToPercent(c[h][LOW_PLOT],d);c=e}d=b.priceToCoordinate(c[0][HIGH_PLOT]);for(h=0;h<c.length;h++)a=b.priceToCoordinate(c[h][HIGH_PLOT])-d,e=b.priceToCoordinate(c[h][LOW_PLOT])-d,this._pattern.push({high:a,low:e})}else{this._pattern=new List;if(b.isPercent()){d=this.W99.ownerSource().firstValue();e=[];g=b.priceRange();
for(h=c.length;h--;)e[h]=[],e[h][CLOSE_PLOT]=g.convertToPercent(c[h][CLOSE_PLOT],d);c=e}d=b.priceToCoordinate(c[0][CLOSE_PLOT]);h=this.W99.points().item(0).index;e=this.W99.points().item(1).index;e=this._points.item(h>e?1:0);g=e.x;for(h=0;h<c.length;h++){var k=e.y+b.priceToCoordinate(c[h][CLOSE_PLOT])-d,k=new MathEx.Point(g+h*a,k);this._pattern.append(k)}}}else delete this._pattern};
TradingView.LineToolBarsPattern=function(a,b){this._constructor="LineToolBarsPattern";var c=b?b:new $52("linetoolbarspattern");W47.call(this,a,new TradingView.$60(this,a),c);c.mirrored.listeners().subscribe(this,TradingView.LineToolBarsPattern.prototype.mirror);c.flipped.listeners().subscribe(this,TradingView.LineToolBarsPattern.prototype.flip);c.addExclusion("mirrored");c.addExclusion("flipped")};inherit(TradingView.LineToolBarsPattern,W47);
TradingView.LineToolBarsPattern.BARS_MODE=0;TradingView.LineToolBarsPattern.LINE_MODE=1;
TradingView.LineToolBarsPattern.prototype.additionalActions=function(a){var b=new Action({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),c=new Action({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});b.callbacks().subscribe(null,function(b){b=b.callbackContext().target;a.setProperty(b.properties().mirrored,!b.properties().mirrored.value(),"Bats Pattern Mirroring");b.updateAllViews();
b.D0.updateSource(b)});c.callbacks().subscribe(null,function(b){b=b.callbackContext().target;a.setProperty(b.properties().flipped,!b.properties().flipped.value(),"Bats Pattern Flipping");b.updateAllViews();b.D0.updateSource(b)});return[b,c]};TradingView.LineToolBarsPattern.prototype.pointsCount=function(){return 2};TradingView.LineToolBarsPattern.prototype.state=function(a){a=W47.prototype.state.call(this,a);a.pattern=this._pattern;return a};
TradingView.LineToolBarsPattern.prototype.restoreData=function(a){a.pattern&&(this._pattern=a.pattern)};TradingView.LineToolBarsPattern.prototype.title=function(){return"Bars Pattern"};TradingView.LineToolBarsPattern.prototype.cloneData=function(a){this._pattern=TradingView.clone(a._pattern)};
TradingView.LineToolBarsPattern.prototype.mirror=function(){for(var a=this._pattern,b=a[0][HIGH_PLOT],c=Math.min(a[0][LOW_PLOT],a[0][HIGH_PLOT]),d=Math.max(a[0][LOW_PLOT],a[0][HIGH_PLOT]),e=1;e<a.length;e++)c=Math.min(c,a[e][LOW_PLOT]),d=Math.max(d,a[e][HIGH_PLOT]);if(c<d)for(c=(c+d)/2,e=0;e<a.length;e++)a[e][HIGH_PLOT]=c-(a[e][HIGH_PLOT]-c),a[e][LOW_PLOT]=c-(a[e][LOW_PLOT]-c),a[e][OPEN_PLOT]=c-(a[e][OPEN_PLOT]-c),a[e][CLOSE_PLOT]=c-(a[e][CLOSE_PLOT]-c);b=a[0][HIGH_PLOT]-b;a=a[a.length-1][LOW_PLOT]-
a[0][HIGH_PLOT];this._points.item(0).price+=b;this._points.item(1).price=this._points.item(0).price+a;this.updateAllViews()};
TradingView.LineToolBarsPattern.prototype.flip=function(){this._points.item(0).price=this._points.item(1).price;for(var a=0;a<this._pattern.length/2;a++){var b=this._pattern[a];this._pattern[a]=this._pattern[this._pattern.length-a-1];this._pattern[this._pattern.length-a-1]=b}a=this._pattern[this._pattern.length-1][LOW_PLOT]-this._pattern[0][HIGH_PLOT];this._points.item(1).price=this._points.item(0).price+a;this.updateAllViews()};
TradingView.LineToolBarsPattern.prototype.addPoint=function(a,b){var c=this.D0.mainSeries(),d=c.nearestIndex(a.index,SEARCH_NEAREST_RIGHT);this.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE?a.price=c.bars().valueAt(d)[HIGH_PLOT]:a.price=c.bars().valueAt(d)[CLOSE_PLOT];d=this.priceScale().priceRange().length();a.price+=.05*d;d=c.priceScale();d.isPercent()&&(c=c.firstValue(),a.price=d.priceRange().convertToPercent(a.price,c));if(c=W47.prototype.addPoint.call(this,
a,b)){var d=Math.min(this.points().item(0).index,this.points().item(1).index),e=Math.max(this.points().item(0).index,this.points().item(1).index),d=this.D0.mainSeries().nearestIndex(d,SEARCH_NEAREST_RIGHT),e=this.D0.mainSeries().nearestIndex(e,SEARCH_NEAREST_LEFT);this.points().item(0).index>this.points().item(1).index&&(this._points.item(0).price=this._points.item(1).price);for(this._pattern=[];d<=e;d++){var g=this.D0.mainSeries().data().valueAt(d);this._pattern.push(TradingView.clone(g))}}return c};
TradingView.LineToolBarsPattern.prototype.setPoint=function(a,b,c){var d=this._points.item(0).price-this._points.item(1).price;1==a&&b.index<=this._points.item(0).index&&(b.index=this._points.item(0).index+1);0==a&&b.index>=this._points.item(1).index&&(b.index=this._points.item(1).index-1);W47.prototype.setPoint.call(this,a,b,c);1==a?this._points.item(0).price=this._points.item(1).price+d:this._points.item(1).price=this._points.item(0).price-d};function $66(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($66,$90);
$66.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.W99.points().size())return a;var b=this.W99.properties();if(b.fillBackground&&b.fillBackground.value()){var c={};c.points=this._points;c.color="white";c.linewidth=0;c.backcolor=b.backgroundColor.value();c.fillBackground=!0;c.transparency=b.backgroundTransparency.value();a.append(new RectangleRenderer(c))}var d=this,e=function(b,c){var e={};e.points=(new List).append(b).append(c);e.width=
d.D0.timeScale().width();e.height=d.W99.priceScale().height();e.color=d.W99.properties().linecolor.value();e.linewidth=d.W99.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=W47.LINEEND_NORMAL;e.rightend=W47.LINEEND_NORMAL;a.append(new TrendLineRenderer(e))},g=this._points.item(0),h=this._points.item(1),h=new MathEx.Point(g.x,h.y);e(g,h);g=this._points.item(0);h=this._points.item(1);g=new MathEx.Point(h.x,
g.y);e(g,h);var g=this._points.item(0),h=this._points.item(1),c=(g.y+h.y)/2,e=new MathEx.Point(g.x,c),k=new MathEx.Point(h.x,c),c={};c.points=(new List).append(e).append(k);c.width=d.D0.timeScale().width();c.height=d.W99.priceScale().height();c.color=d.W99.properties().linecolor.value();c.linewidth=d.W99.properties().linewidth.value();c.linestyle=CanvasEx.LINESTYLE_DASHED;c.extendleft=!1;c.extendright=!1;c.leftend=W47.LINEEND_NORMAL;c.rightend=W47.LINEEND_ARROW;
a.append(new TrendLineRenderer(c));var c=this.W99.points().item(0).index,k=this.W99.points().item(1).index,e=k-c,c=this.D0.timeScale().indexToUserTime(c),l=this.D0.timeScale().indexToUserTime(k),k="";c&&l&&(c=(l.valueOf()-c.valueOf())/1E3,k=", "+(new TimeSpanFormatter).format(c));c={};c.points=(new List).append(g.add(h).scaled(.5));c.text=$.t("{0} bars").format(e)+k;c.color=b.textcolor.value();c.font=b.font.value();c.offsetX=0;c.offsetY=0;c.vertAlign="top";c.horzAlign="center";c.backgroundRoundRect=
0;c.backgroundHorzInflate=.4*b.fontsize.value();c.backgroundVertInflate=.2*b.fontsize.value();c.fontsize=b.fontsize.value();b.fillLabelBackground&&b.fillLabelBackground.value()&&(c.backgroundColor=b.labelBackgroundColor.value(),c.backgroundTransparency=1-b.labelBackgroundTransparency.value()/100||0);b.drawBorder&&b.drawBorder.value()&&(c.borderColor=b.borderColor.value());a.append(new TextRenderer(c,this._rendererCache));this.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}));
return a};TradingView.LineToolDateRange=function(a,b){this._constructor="LineToolDateRange";var c=b?b:new $52("linetooldaterange");W47.call(this,a,new $66(this,a),c)};inherit(TradingView.LineToolDateRange,W47);TradingView.LineToolDateRange.prototype.pointsCount=function(){return 2};TradingView.LineToolDateRange.prototype.title=function(){return"Date Range"};function W6(a,b){$90.call(this,a,b);this._rendererCache={}}inherit(W6,$90);
W6.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.W99.points().size())return a;var b=this.W99.properties();if(b.fillBackground&&b.fillBackground.value()){var c={};c.points=this._points;c.color="white";c.linewidth=0;c.backcolor=b.backgroundColor.value();c.fillBackground=!0;c.transparency=b.backgroundTransparency.value();a.append(new RectangleRenderer(c))}var d=this,c=function(b,c){var e={};e.points=(new List).append(b).append(c);e.width=
d.D0.timeScale().width();e.height=d.W99.priceScale().height();e.color=d.W99.properties().linecolor.value();e.linewidth=d.W99.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=W47.LINEEND_NORMAL;e.rightend=W47.LINEEND_NORMAL;a.append(new TrendLineRenderer(e))},e=this._points.item(0),g=this._points.item(1),g=new MathEx.Point(g.x,e.y);c(e,g);e=this._points.item(0);g=this._points.item(1);e=new MathEx.Point(e.x,
g.y);c(e,g);var e=this._points.item(0),g=this._points.item(1),c=(e.x+g.x)/2,h=new MathEx.Point(c,e.y),k=new MathEx.Point(c,g.y),c={};c.points=(new List).append(h).append(k);c.width=d.D0.timeScale().width();c.height=d.W99.priceScale().height();c.color=d.W99.properties().linecolor.value();c.linewidth=d.W99.properties().linewidth.value();c.linestyle=CanvasEx.LINESTYLE_DASHED;c.extendleft=!1;c.extendright=!1;c.leftend=W47.LINEEND_NORMAL;c.rightend=W47.LINEEND_ARROW;
a.append(new TrendLineRenderer(c));var h=this.W99.points().item(0).price,k=this.W99.points().item(1).price,c=k-h,l=100*c/h,l=this.W99.priceScale().formatter().format(c)+" ("+Math.round(100*l)/100+"%)",c={};k>h?(h=g.clone(),h.y-=2*b.fontsize.value(),h.x=.5*(e.x+g.x)):(h=g.clone(),h.x=.5*(e.x+g.x),h.y+=.7*b.fontsize.value());c.points=(new List).append(h);c.text=l;c.color=b.textcolor.value();c.font=b.font.value();c.offsetX=0;c.offsetY=0;c.vertAlign="middle";c.horzAlign="center";c.fontsize=
b.fontsize.value();c.backgroundRoundRect=0;c.backgroundHorzInflate=.4*b.fontsize.value();c.backgroundVertInflate=.2*b.fontsize.value();b.fillLabelBackground&&b.fillLabelBackground.value()&&(c.backgroundColor=b.labelBackgroundColor.value(),c.backgroundTransparency=1-b.labelBackgroundTransparency.value()/100||0);b.drawBorder&&b.drawBorder.value()&&(c.borderColor=b.borderColor.value());a.append(new TextRenderer(c,this._rendererCache));this.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}));
return a};TradingView.LineToolPriceRange=function(a,b){this._constructor="LineToolPriceRange";var c=b?b:new $52("linetoolpricerange");W47.call(this,a,new W6(this,a),c)};inherit(TradingView.LineToolPriceRange,W47);TradingView.LineToolPriceRange.prototype.pointsCount=function(){return 2};TradingView.LineToolPriceRange.prototype.title=function(){return"Price Range"};function ParallelChannelRenderer(a){this._data=a}
ParallelChannelRenderer.prototype.extendPoints=function(a,b,c,d){var e=new MathEx.Point(0,0);c=new MathEx.Point(c,d);this._data.extendleft&&(d=a.substract(b),(d=MathEx.intersectRayWithRect(a,a.add(d),e,c))&&(a=d));this._data.extendright&&(d=b.substract(a),(d=MathEx.intersectRayWithRect(b,b.add(d),e,c))&&(b=d));this._data.extendleft&&!MathEx.pointInRect(a,e,c)&&MathEx.pointInRect(b,e,c)&&(d=MathEx.intersectRayWithRect(b,a,e,c))&&(a=d);this._data.extendright&&!MathEx.pointInRect(b,e,c)&&MathEx.pointInRect(a,
e,c)&&(d=MathEx.intersectRayWithRect(a,b,e,c))&&(b=d);return[a,b]};
ParallelChannelRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),b=this.extendPoints(b,c,this._data.width,this._data.height);this._data.skipLines||CanvasEx.drawLine(a,b[0].x,b[0].y,b[1].x,b[1].y);if(4==this._data.points.size()){var c=this._data.points.item(2),d=this._data.points.item(3);if(c&&d){c=this.extendPoints(c,
d,this._data.width,this._data.height);this._data.skipLines||this._data.skipTopLine||CanvasEx.drawLine(a,c[0].x,c[0].y,c[1].x,c[1].y);if(this._data.fillBackground){var d=Math.max(b[1].x,c[1].x),e=Math.max(b[1].y,c[1].y),g=Math.min(c[0].x,b[0].x),h=Math.min(c[0].y,b[0].y);if(!(isFinite(d)&&isFinite(e)&&isFinite(g)&&isFinite(h)))return;a.fillStyle=generateColor(this._data.backcolor,this._data.transparency);a.beginPath();a.moveTo(b[0].x,b[0].y);a.lineTo(b[1].x,b[1].y);this._data.extendright&&(d=MathEx.optionalCorner(b[1],
c[1],this._data.width,this._data.height))&&a.lineTo(d.x,d.y);a.lineTo(c[1].x,c[1].y);a.lineTo(c[0].x,c[0].y);this._data.extendleft&&(d=MathEx.optionalCorner(c[0],b[0],this._data.width,this._data.height))&&a.lineTo(d.x,d.y);a.lineTo(b[0].x,b[0].y);a.fill()}this._data.showMidline&&!this._data.skipLines&&(a.strokeStyle=this._data.midcolor,a.lineWidth=this._data.midlinewidth,a.lineStyle=this._data.midlinestyle,b=this._data.points.item(0).add(this._data.points.item(2)).scaled(.5),c=this._data.points.item(1).add(this._data.points.item(3)).scaled(.5),
c=this.extendPoints(b,c,this._data.width,this._data.height),(b=TrendLineRenderer.prototype.lineClipping(c[0],c[1],this._data.width,this._data.height))&&CanvasEx.drawLine(a,Math.round(b[0].x),Math.round(b[0].y),Math.round(b[1].x),Math.round(b[1].y)))}}}};
ParallelChannelRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;if(this._data.floatPoints)var b=this._data.floatPoints.item(0),c=this._data.floatPoints.item(1);else b=this._data.points.item(0),c=this._data.points.item(1);var d=this.extendPoints(b,c,this._data.width,this._data.height),d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.floatPoints)var e=this._data.floatPoints.item(2),g=this._data.floatPoints.item(3);
else e=this._data.points.item(2),g=this._data.points.item(3);if(4==this._data.points.size()&&!this._data.skipTopLine){if(!e||!g)return null;d=this.extendPoints(e,g,this._data.width,this._data.height);d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.showMidline&&!this._data.skipLines){var d=this._data.points.item(0).add(this._data.points.item(2)).scaled(.5),h=this._data.points.item(1).add(this._data.points.item(3)).scaled(.5),
d=this.extendPoints(d,h,this._data.width,this._data.height),d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT)}}return this._data.hittestOnBackground&&this._data.fillBackground&&4==this._data.points.size()&&(b=(new List).append(b).append(c).append(g).append(e),MathEx.isInPolygon(b,a))?new HitTestResult(HitTestResult.MOVEPOINT):null};function $98(a,b){$90.call(this,a,b)}inherit($98,$90);
$98.prototype.update=function(){$90.prototype.update.call(this);if(this.W99.priceScale()&&!this.W99.priceScale().isEmpty()&&0!=this.W99.points().size()&&(this.W99._priceOffset||this.W99.calculatePriceDiff(),3===this._points.size()&&this.W99._priceOffset)){var a=this._points.item(0),b=this._points.item(1),c=this.W99._priceOffset+this.W99.points().item(0).price,d=this.W99._priceOffset+this.W99.points().item(1).price;this._p3=
a.clone();this._p4=b.clone();a=this.W99.priceScale();a.isLog()?(a=.5*(c+d)-this.W99._priceOffset,c=.5*(c+d),d=this.W99.priceScale().priceToCoordinate(a),c=this.W99.priceScale().priceToCoordinate(c)-d,this._p3.y+=c,this._p4.y+=c):(a.isPercent()&&(b=this.W99.ownerSource().firstValue(),c=a.priceRange().convertToPercent(c,b),d=a.priceRange().convertToPercent(d,b)),this._p3.y=this.W99.priceScale().priceToCoordinate(c),this._p4.y=this.W99.priceScale().priceToCoordinate(d))}};
$98.prototype.renderer=function(){var a={};a.points=new List;1<this._points.size()&&(a.points.append(this._points.item(0)),a.points.append(this._points.item(1)));2<this._points.size()&&(a.points.append(this._p3),a.points.append(this._p4));a.color=this.W99.properties().linecolor.value();a.width=this.D0.timeScale().width();a.height=this.W99.priceScale().height();var b=this.W99.properties();a.linewidth=b.linewidth.value();a.linestyle=b.linestyle.value();a.extendleft=
b.extendLeft.value();a.extendright=b.extendRight.value();a.fillBackground=b.fillBackground.value();a.backcolor=b.backgroundColor.value();a.transparency=b.transparency.value();a.showMidline=b.showMidline.value();a.midlinewidth=b.midlinewidth.value();a.midlinestyle=b.midlinestyle.value();a.midcolor=b.midlinecolor.value();a.fillBackground=b.fillBackground.value();a.hittestOnBackground=TradingView.isMobile.any();var c=new CompositeRenderer;c.append(new ParallelChannelRenderer(a));if(this.isAnchorsRequired()){a=
new List;a.append(this._points.item(0));this._points.item(1)&&a.append(this._points.item(1));this._p3&&(a.append(this._p3.add(this._p4).scaled(.5)),a.item(2).data=2);var d=3==this._points.size()&&!this._p3;this.D0.lineBeingCreated()!=this.W99||d||a.removeAt(a.size()-1);c.append(this.createLineAnchor({points:a}))}if(!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&2<=this._points.size()){var e=this._points;this.W99.getAlertIsActive(function(a){c.append(new PaneRendererClockIcon({point1:e.item(0),
point2:e.item(1),color:a?b.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return c};TradingView.LineToolParallelChannel=function(a,b){this._constructor="LineToolParallelChannel";var c=b?b:new $52("linetoolparallelchannel");W47.call(this,a,new $98(this,a),c)};inherit(TradingView.LineToolParallelChannel,W47);
TradingView.LineToolParallelChannel.prototype.addPoint=function(a){if(a=W47.prototype.addPoint.call(this,a)){var b=this.points().item(0);this._points.item(2).index=b.index;this._points.item(2).price=b.price+this._priceOffset}return a};
TradingView.LineToolParallelChannel.prototype.calculatePriceDiff=function(){if(3===this.points().size()){var a=this.points().item(0),b=this.points().item(1),c=this.points().item(2);if(a.index!==b.index){var d=this.priceScale();if(null!==d)if(d.isLog()){var e=this.D0.timeScale();if(!e.isEmpty()){var g=e.indexToCoordinate(a.index),h=e.indexToCoordinate(b.index),a=d.priceToCoordinate(a.price),b=d.priceToCoordinate(b.price),e=e.indexToCoordinate(c.index);d.priceToCoordinate(c.price);g=a+(b-a)/(h-
g)*(e-g);c=d.priceToCoordinate(c.price)-g;a=.5*(a+b);g=d.coordinateToPrice(a);this._priceOffset=d.coordinateToPrice(a+c)-g}}else d=(b.price-a.price)/(b.index-a.index),this._priceOffset=c.price-(a.price+d*(c.index-a.index))}}};TradingView.LineToolParallelChannel.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(0));W47.prototype.setLastPoint.call(this,a);this.calculatePriceDiff()};
TradingView.LineToolParallelChannel.prototype.restorePoints=function(a,b,c){W47.prototype.restorePoints.call(this,a,b,c);a&&3<=a.length&&(this._priceOffset=a[2].price-a[0].price)};
TradingView.LineToolParallelChannel.prototype.setPoint=function(a,b,c){c&&c.shift&&2>a&&this._snapPoint45Degree(b,this.points().item(1-a));W47.prototype.setPoint.call(this,a,b,c);2===a&&this.calculatePriceDiff();a=this.points().item(0);this._points.item(2).index=a.index;this._points.item(2).price=a.price+this._priceOffset};TradingView.LineToolParallelChannel.prototype.pointsCount=function(){return 3};TradingView.LineToolParallelChannel.prototype.title=function(){return"Parallel Channel"};
TradingView.LineToolParallelChannel.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(0));return W47.prototype.addPoint.call(this,a,b)};TradingView.LineToolParallelChannel.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset};TradingView.LineToolParallelChannel.prototype.cloneData=function(a){this._priceOffset=a._priceOffset};
TradingView.LineToolParallelChannel.prototype.restoreData=function(a){a.priceOffset&&(this._priceOffset=a.priceOffset)};TradingView.LineToolParallelChannel.prototype.state=function(a){a=W47.prototype.state.call(this,a);a.priceOffset=this._priceOffset;return a};TradingView.LineToolParallelChannel.prototype.canHasAlert=function(){return!0};
TradingView.LineToolParallelChannel.prototype._getAlertPlots=function(){function a(a,b){return a.index<=b.index?[a,b]:[b,a]}var b=this._points.clone().toArray().splice(0,2),b=b.concat([{price:b[0].price+this._priceOffset,time:b[0].time,index:b[0].index},{price:b[1].price+this._priceOffset,time:b[1].time,index:b[1].index}]),c=a(b[0],b[1]),d=a(b[2],b[3]),e;0>this._priceOffset?e=d:(e=c,c=d);var d=this.properties().extendLeft.value(),g=this.properties().extendRight.value();b[0].index<=b[1].index?(b=d,
d=g):b=g;return[this._linePointsToAlertPlot(c,"Upper",b,d),this._linePointsToAlertPlot(e,"Lower",b,d)]};function TrendLineStatsRenderer(a,b,c){this._textSizeCache=b;this._data=a;this._fontSize=a.fontsize?a.fontsize:a.fontSize?a.fontSize:12;this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0;a.lines=this._lines=TextRenderer.prototype.wordWrap.call(this,a.text,a.wordWrapWidth);this._hittest=c?c:new HitTestResult(HitTestResult.MOVEPOINT)}
(function(){var a,b={priceRange:{width:15,height:14,data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,
134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,
0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,
134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,
255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,
130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};TrendLineStatsRenderer.prototype._preRender=function(){if(!this._preRendered){if(!a){var b=document.createElement("canvas");b.width=0;b.height=0;a=b.getContext("2d")}this._data.points.item(0);
var d=textX=this._data.points.item(0).x+(this._data.offsetX||0),e=textY=this._data.points.item(0).y+(this._data.offsetY||0),g=this._fontSize,b=this._lineSpacing,h=(g+b)*this._lines.length-b;a.textBaseline="top";a.font=this.fontStyle();var b=[],k;if(this._data.wordWrapWidth){k=this._data.wordWrapWidth;for(var l=0;l<this._lines.length;l++)b.push(this._data.wordWrapWidth)}else for(l=k=0;l<this._lines.length;l++){var m=a.measureText(this._lines[l]).width;b.push(m);k=Math.max(k,m)}if(this._data.backgroundColor||
this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){var m={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},n=0,q=0;this._data.backgroundHorzInflate&&(n=this._data.backgroundHorzInflate/2,m.left+=n,m.right+=n,n=-n);this._data.backgroundVertInflate&&(q=this._data.backgroundVertInflate/2,m.top+=q,m.bottom+=q,q=-q);g="number"==typeof this._data.padding?this._data.padding:~~(g/6);for(l in m)m[l]||
(m[l]=g);h={x:Math.floor(d+n),y:Math.floor(e+q),w:Math.ceil(k+m.left+m.right),h:Math.ceil(h+m.top+m.bottom)};textX+=m.left+n;textY+=m.top+q;if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)e="middle"==this._data.vertAlign?e-h.h/2:e-h.h-(h.y-e),textY+=e-h.y,h.y=e;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d="center"==this._data.horzAlign?d-h.w/2:d-h.w-(h.x-d),textX+=d-h.x,h.x=d,!0!==this._data.doNotAlignText&&("right"==this._data.horzAlign?(a.textAlign="end",
textX+=k):(a.textAlign="center",textX+=k/2));0!=h.w%2&&h.w++;h.x+=.5;h.y+=.5;this._boundingRect=[new MathEx.Point(h.x,h.y),new MathEx.Point(h.x+h.w,h.y+h.h)];this._rect=h;this._padding=m;this._defaultPadding=g}else{if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)textY-=Math.round(h*("middle"==this._data.vertAlign?.5:1));d=textX;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d-=Math.round(k*("center"==this._data.horzAlign?.5:1));this._boundingRect=[new MathEx.Point(d,
textY),new MathEx.Point(d+k,textY+h)]}this._textPoint={x:textX,y:textY};this._textSizeCache&&(this._textSizeCache.widths=b);this._preRendered=!0}};TrendLineStatsRenderer.prototype._drawIcon=function(a,d,e,g){if(b.hasOwnProperty(g)){g=b[g];if(!g.src){g.src=document.createElement("canvas");g.src.width=g.width;g.src.height=g.height;for(var h=g.src.getContext("2d"),k=h.createImageData(g.width,g.height),l=0;l<g.data.length;l++)k.data[l]=g.data[l];h.putImageData(k,0,0)}a.drawImage(g.src,d,e)}}})();
TrendLineStatsRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font};
TrendLineStatsRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){this._preRender();var b=this._fontSize,c=b+this._lineSpacing;a.textBaseline="top";a.font=this.fontStyle();if((this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect){var d=this._rect;"right"!=this._data.horzAlign&&"center"!=this._data.horzAlign||!0===this._data.doNotAlignText||(a.textAlign="right"==this._data.horzAlign?"end":"center");if(this._data.backgroundRoundRect){if(a.roundRect(d.x,
d.y,d.w,d.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fill(),a.globalAlpha=1),this._data.borderColor){var e="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(b/12,1);a.strokeStyle=this._data.borderColor;a.lineWidth=e;a.stroke()}}else if(this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fillRect(d.x,d.y,
d.w,d.h),a.globalAlpha=1),this._data.borderColor)e="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(b/12,1),a.strokeStyle=this._data.borderColor,a.lineWidth=e,a.strokeRect(d.x-e/2,d.y-e/2,d.w+e,d.h+e);else if(this._data.highlightBorder){a.strokeStyle=this._data.color;a.lineWidth=1;a.beginPath();var g=[3,1];a.dashedLineTo(d.x-.5,e=d.y-.5,b=d.x+d.w+.5,e,g);a.dashedLineTo(b,e,b,e=d.y+d.h+.5,g);a.dashedLineTo(b=d.x-.5,e,d.x+d.w+.5,e,g);a.dashedLineTo(b,d.y-.5,b,e,g);a.globalAlpha=
.5;a.stroke();a.globalAlpha=1}this._data.icons&&this._data.icons.forEach(function(b,e){this._drawIcon(a,d.x+this._defaultPadding,d.y+this._padding.top+c*e,b)},this)}else"right"==this._data.horzAlign?a.textAlign="end":"center"==this._data.horzAlign&&(a.textAlign="center");e=this._textPoint.x;b=this._textPoint.y;a.fillStyle=this._data.color;for(g=0;g<this._lines.length;g++)a.fillText(this._lines[g],e,b),b+=c}};
TrendLineStatsRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;this._preRender();return this._boundingRect?MathEx.pointInRect(a,this._boundingRect[0],this._boundingRect[1])?this._hittest:null:null};function TrendLineRenderer(a,b){this._data=a;this._hittest=b?b:new HitTestResult(HitTestResult.MOVEPOINT)}
TrendLineRenderer.prototype.drawArrow=function(a,b,c,d){if(!(1>b.substract(a).length())){var e=b.substract(a).normalized();a=e.scaled(5*d);a=b.substract(a);e=e.transponed().scaled(3*d);d=a.add(e);a=a.substract(e);CanvasEx.drawLine(c,Math.round(d.x),Math.round(d.y),b.x,b.y);CanvasEx.drawLine(c,Math.round(a.x),Math.round(a.y),b.x,b.y)}};TrendLineRenderer.prototype.lineClipping=function(a,b,c,d){return(a=CohenSutherland(a.x,a.y,b.x,b.y,0,0,c,d))?[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]:!1};
TrendLineRenderer.prototype.expandPoints=function(a,b,c,d){var e=new MathEx.Point(0,0);c=new MathEx.Point(c,d);this._data.extendleft&&(d=a.substract(b),(d=MathEx.intersectRayWithRect(a,a.add(d),e,c))&&(a=d));this._data.extendright&&(d=b.substract(a),(d=MathEx.intersectRayWithRect(b,b.add(d),e,c))&&(b=d));return[a,b]};
TrendLineRenderer.prototype.drawCircle=function(a,b,c,d){d=$.extend({fillStyle:"#000000"},d);b.save();b.fillStyle=d.fillStyle;b.beginPath();b.arc(a.x,a.y,c,0,2*Math.PI,!1);b.fill();d.strokeWidth&&(b.lineWidth=d.strokeWidth,b.stroke());b.restore()};
TrendLineRenderer.prototype.draw=function(a){if(!(this._data.points&&2>this._data.points.size()||this._data.floatPoints&&2>this._data.floatPoints.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;if(this._data.floatPoints)var b=this._data.floatPoints.item(0),c=this._data.floatPoints.item(1);else b=this._data.points.item(0),c=this._data.points.item(1);if(this._data.overlayLineEndings)var d=[$.extend(!0,{},b),$.extend(!0,{},c)];
else this.drawEnds(a,[b,c]);b=this.expandPoints(b,c,this._data.width,this._data.height);(b=this.lineClipping(b[0],b[1],this._data.width,this._data.height))&&0<this._data.linewidth&&CanvasEx.drawLine(a,Math.round(b[0].x),Math.round(b[0].y),Math.round(b[1].x),Math.round(b[1].y));this._data.overlayLineEndings&&this.drawEnds(a,d)}};
TrendLineRenderer.prototype.drawEnds=function(a,b){var c=b[0],d=b[1];switch(this._data.leftend){case W47.LINEEND_ARROW:this.drawArrow(d,c,a,a.lineWidth);break;case W47.LINEEND_CIRCLE:this.drawCircle(c,a,a.lineWidth,this._data.endstyle)}switch(this._data.rightend){case W47.LINEEND_ARROW:this.drawArrow(c,d,a,a.lineWidth);break;case W47.LINEEND_CIRCLE:this.drawCircle(d,a,a.lineWidth,this._data.endstyle)}};
TrendLineRenderer.prototype.hitTest=function(a){if(this._data.points&&2>this._data.points.size()||this._data.floatPoints&&2>this._data.floatPoints.size())return null;var b=TradingView.isMobile.any()?24:3;if(this._data.floatPoints)var c=this._data.floatPoints.item(0),d=this._data.floatPoints.item(1);else c=this._data.points.item(0),d=this._data.points.item(1);c=this.expandPoints(c,d,this._data.width,this._data.height);return MathEx.distanceToSegment(c[0],c[1],a).distance<=b?this._hittest:null};
function W43(a,b){$90.call(this,a,b);this._label=null;this._rendererCache={};this._invalidated=!0}inherit(W43,$90);W43.prototype.update=function(){this._invalidated=!0};
W43.prototype.updateImpl=function(){var a=this.W99.points();if(!(2>a.size())){var b=a.item(0),a=a.item(1),c=this.D0.timeScale().visibleBars();if(void 0!=c&&!c.isEmpty()){c=c.clone();this._label=null;var d=this.W99.properties();if(!(b.index<c.firstBar()&&a.index<c.firstBar())||d.extendLeft.value()||d.extendRight.value())if($90.prototype.update.call(this),!(0>this._points.item(0).x&&0>this._points.item(1).x)||d.extendLeft.value()||d.extendRight.value()){var c=
[],e,g,h,k,l;if(this.W99.properties().showPriceRange.value()&&this.W99.priceScale()){k=a.price-b.price;e=k/b.price;e=this.W99.priceScale().formatter().format(k)+" ("+(new PercentageFormatter).format(100*e)+")";if(d=this.D0.mainSeries().base())d=Math.round(k*d),e+=", "+d;c.push("priceRange")}var d=this.W99.properties().showBarsRange.value(),m=this.W99.properties().showDateTimeRange.value(),n=this.W99.properties().showDistance.value();if(d||m||n){g="";d&&(l=a.index-b.index,
g+=$.t("{0} bars").format(l));if(m){var m=this.D0.timeScale().indexToUserTime(b.index),q=this.D0.timeScale().indexToUserTime(a.index);m&&q&&(m=(q.valueOf()-m.valueOf())/1E3,(m=(new TimeSpanFormatter).format(m))&&(g+=d?" ("+m+")":m))}n&&(g&&(g+=", "),"undefined"==typeof k&&(k=a.price-b.price),"undefined"==typeof l&&(l=a.index-b.index),k=Math.round(1E5*Math.sqrt(k*k+l*l))/1E5,g+=$.t("distance: {0}").format(k));g&&c.push("barsRange")}if(this.W99.properties().showAngle.value()){var b=this.W99.pointToScreenPoint(b),
a=this.W99.pointToScreenPoint(a),r,b=b instanceof Array?b[0]:b instanceof MathEx.Point?b:null,a=a instanceof Array?a[0]:a instanceof MathEx.Point?a:null;b instanceof MathEx.Point&&a instanceof MathEx.Point&&(b=a.substract(b),0<b.length()&&(b=b.normalized(),r=Math.acos(b.x),0<b.y&&(r=-r)));"number"!=typeof r||isNaN(r)||(h=Math.round(180*r/Math.PI)+"\u00ba",c.push("angle"))}this._label=[e,g,h].filter(function(a){return a}).join("\n")||null;this._icons=c;this._invalidated=!1}}}};
W43.prototype.renderer=function(){this._invalidated&&this.updateImpl();var a=new CompositeRenderer;if(this._invalidated||!this.W99.priceScale())return a;var b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D0.timeScale().width();b.height=this.W99.priceScale().height();b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();b.extendleft=this.W99.properties().extendLeft.value();
b.extendright=this.W99.properties().extendRight.value();b.leftend=this.W99.properties().leftEnd.value();b.rightend=this.W99.properties().rightEnd.value();a.append(new TrendLineRenderer(b));var c=this.isAnchorsRequired();if((c||this.W99.properties().alwaysShowStats.value())&&this._label&&2==this._points.size()){var d={points:(new List).append(this._points.item(1)),text:this._label,color:this.W99.properties().textcolor.value(),font:TradingView.LineToolTrendLine.LABEL_FONT,fontsize:TradingView.LineToolTrendLine.LABEL_FONTSIZE,
lineSpacing:TradingView.LineToolTrendLine.LABEL_LINESPACING,backgroundColor:TradingView.LineToolTrendLine.LABEL_BGCOLOR,borderColor:TradingView.LineToolTrendLine.LABEL_BORDERCOLOR,borderWidth:1,padding:TradingView.LineToolTrendLine.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},e=TradingView.LineToolTrendLine.LABEL_OFFSET;this._points.item(1).y<this._points.item(0).y?(d.vertAlign="bottom",d.offsetY=-e):d.offsetY=e;this._points.item(1).x<this._points.item(0).x?(d.horzAlign="right",
d.offsetX=-e):d.offsetX=e;a.append(new TrendLineStatsRenderer(d,this._rendererCache))}c&&(c=b.points.clone(),this.D0.lineBeingCreated()==this.W99&&c.removeAt(c.size()-1),a.append(this.createLineAnchor({points:c})));!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&2<=b.points.size()&&this.W99.getAlertIsActive(function(c){a.append(new PaneRendererClockIcon({point1:b.points.item(0),point2:b.points.item(1),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});
return a};TradingView.LineToolTrendLine=function(a,b){this._constructor="LineToolTrendLine";var c=b?b:new $52("linetooltrendline");W47.call(this,a,new W43(this,a),c)};inherit(TradingView.LineToolTrendLine,W47);TradingView.LineToolTrendLine.LABEL_OFFSET=8;TradingView.LineToolTrendLine.LABEL_FONT="Arial";TradingView.LineToolTrendLine.LABEL_FONTSIZE=12;TradingView.LineToolTrendLine.LABEL_LINESPACING=10;TradingView.LineToolTrendLine.LABEL_BGCOLOR="rgba(255,255,255,.8)";
TradingView.LineToolTrendLine.LABEL_BORDERCOLOR="#e3e3e3";TradingView.LineToolTrendLine.LABEL_PADDING=8;TradingView.LineToolTrendLine.prototype.pointsCount=function(){return 2};TradingView.LineToolTrendLine.prototype.title=function(){return"Trend Line"};TradingView.LineToolTrendLine.prototype.canHasAlert=function(){return!0};TradingView.LineToolTrendLine.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points.toArray(),null,this.properties().extendLeft.value(),this.properties().extendRight.value())]};
(function(){function a(a,c,d,e,g,h){var k=0;a<d?k|=1:a>g&&(k|=2);c<e?k|=4:c>h&&(k|=8);return k}window.CohenSutherland=function(b,c,d,e,g,h,k,l){for(var m=a(b,c,g,h,k,l),n=a(d,e,g,h,k,l),q=!1,r,u,w,A=0;;){if(1E3<A)throw Error("Cohen - Sutherland algorithm: infinity loop");A++;if(m|n)if(m&n)break;else w=m?m:n,w&8?(r=b+(d-b)*(l-c)/(e-c),u=l):w&4?(r=b+(d-b)*(h-c)/(e-c),u=h):w&2?(u=c+(e-c)*(k-b)/(d-b),r=k):(u=c+(e-c)*(g-b)/(d-b),r=g),w==m?(b=r,c=u,m=a(b,c,g,h,k,l)):(d=r,e=u,n=a(d,e,g,h,k,l));else{q=!0;
break}}return q?[b,c,d,e]:!1}})();function RectangleRenderer(a){this._data=a}RectangleRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1).substract(b);a.beginPath();a.rect(b.x,b.y,c.x,c.y);0<this._data.linewidth&&a.stroke();this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
RectangleRenderer.prototype.hitTest=function(a){if(2>this._data.points.size()||this._data.nohittest)return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=new MathEx.Point(c.x,b.y),e=new MathEx.Point(b.x,d.y),g=MathEx.distanceToSegment(b,d,a);if(3>=g.distance)return new HitTestResult(HitTestResult.MOVEPOINT);g=MathEx.distanceToSegment(d,c,a);if(3>=g.distance)return new HitTestResult(HitTestResult.MOVEPOINT);g=MathEx.distanceToSegment(c,e,a);if(3>=g.distance)return new HitTestResult(HitTestResult.MOVEPOINT);
g=MathEx.distanceToSegment(e,b,a);return 3>=g.distance||this._data.fillBackground&&(d=Math.min(b.x,c.x),e=Math.max(b.x,c.x),g=Math.min(b.y,c.y),c=Math.max(b.y,c.y),b=new MathEx.Point(d,g),c=new MathEx.Point(e,c),MathEx.pointInRect(a,b,c))?new HitTestResult(HitTestResult.MOVEPOINT):null};function W8(a,b){$90.call(this,a,b)}inherit(W8,$90);
W8.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().color.value();a.linewidth=this.W99.properties().linewidth.value();a.backcolor=this.W99.properties().backgroundColor.value();a.fillBackground=this.W99.properties().fillBackground.value();a.transparency=this.W99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new RectangleRenderer(a));a=a.points.clone();this.D0.lineBeingCreated()==
this.W99&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new RectangleRenderer(a)};TradingView.LineToolRectangle=function(a,b){this._constructor="LineToolRectangle";var c=b?b:new $52("linetoolrectangle");W47.call(this,a,new W8(this,a),c)};inherit(TradingView.LineToolRectangle,W47);TradingView.LineToolRectangle.prototype.pointsCount=function(){return 2};TradingView.LineToolRectangle.prototype.title=function(){return"Rectangle"};function EllipseRenderer(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=2*Math.PI;this._data.clockwise=!1}
EllipseRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0),c=this._data.points.item(1);if(3>this._data.points.size())a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance;if(1>d)a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();
else{var e=c.substract(b),b=b.add(c).scaled(.5),c=new MathEx.Point(-e.y,e.x),c=c.normalized();b.add(c.scaled(d));b.add(c.scaled(-d));a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;var c=e.length(),g=e.y/c,e=Math.acos(e.x/c);0>g&&(e=-e);var g=this._data.points.item(2),h=MathEx.Matrix.translate(-b.x,-b.y),g=h.mult(g),h=MathEx.Matrix.rotate(-e),g=h.mult(g),h=MathEx.Matrix.scale(1,c/(2*d)),g=h.mult(g);this._data.clockwise=0>g.y?!0:!1;a.save();a.beginPath();a.translate(b.x,b.y);a.rotate(e);
a.scale(1,2*d/c);a.arc(0,0,.5*c,this._data.angleFrom,this._data.angleTo,this._data.clockwise);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};EllipseRenderer.prototype._additionalPointTest=function(a,b){return!0};
EllipseRenderer.prototype.hitTest=function(a){if(3>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance,e=c.substract(b),c=b.add(c).scaled(.5),b=new MathEx.Point(-e.y,e.x),b=b.normalized();c.add(b.scaled(d));c.add(b.scaled(-d));var b=e.length(),g=e.y/b,e=Math.acos(e.x/b);0>g&&(e=-e);g=MathEx.Matrix.translate(-c.x,-c.y);a=g.mult(a);c=g.mult(this._data.points.item(2));g=MathEx.Matrix.rotate(-e);
a=g.mult(a);c=g.mult(c);g=MathEx.Matrix.scale(1,b/(2*d));a=g.mult(a);c=g.mult(c);d=a.length();if(!this._additionalPointTest(a,c))return null;if(this._data.fillBackground&&!this._data.noHitTestOnBackground){if(d<=.5*b)return new HitTestResult(HitTestResult.MOVEPOINT)}else if(3>=Math.abs(d-.5*b))return new HitTestResult(HitTestResult.MOVEPOINT);return null};function $69(a,b){$90.call(this,a,b)}inherit($69,$90);
$69.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.color=this.W99.properties().color.value();b.linewidth=this.W99.properties().linewidth.value();b.backcolor=this.W99.properties().backgroundColor.value();b.fillBackground=this.W99.properties().fillBackground.value();b.transparency=this.W99.properties().transparency.value();a.append(new EllipseRenderer(b));if(this.isAnchorsRequired()){var c=
b.points.item(0),d=b.points.item(1);if(2==this._points.size())return this.addAnchors(a),a;var b=b.points.item(2),e=MathEx.distanceToLine(c,d,b).distance,b=d.substract(c),g=c.add(d).scaled(.5),h=new MathEx.Point(-b.y,b.x),h=h.normalized(),b=g.add(h.scaled(e)),e=g.add(h.scaled(-e)),c=new MathEx.Point(c.x,c.y);c.data=0;d=new MathEx.Point(d.x,d.y);d.data=1;b=new MathEx.Point(b.x,b.y);b.data=2;e=new MathEx.Point(e.x,e.y);e.data=3;g=new List;g.append(c).append(d).append(b).append(e);a.append(this.createLineAnchor({points:g}))}return a};
TradingView.LineToolEllipse=function(a,b){this._constructor="LineToolEllipse";var c=b?b:new $52("linetoolellipse");W47.call(this,a,new $69(this,a),c);this.version=TradingView.LineToolEllipse.version};inherit(TradingView.LineToolEllipse,W47);
TradingView.LineToolEllipse.prototype.startChanging=function(a,b){W47.prototype.startChanging.call(this,a,b);if(0==a||1==a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0];this._dist=MathEx.distanceToLine(c,d,e).distance}};
TradingView.LineToolEllipse.prototype.setPoint=function(a,b){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],g=this.priceScale();if(g.isPercent()){var h=this.ownerSource().firstValue();b.price=g.priceRange().convertFromPercent(b.price,h)}switch(a){case 0:c=this.pointToScreenPoint(b)[0];g=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-g.y,g.x);d=d.normalized();e=c.add(d.scaled(this._dist));
e=this.screenPointToPoint(e);this._points.setItem(0,b);this._points.setItem(2,e);break;case 1:e=MathEx.distanceToLine(c,d,e).distance;d=this.pointToScreenPoint(b)[0];g=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-g.y,g.x);d=d.normalized();e=c.add(d.scaled(this._dist));e=this.screenPointToPoint(e);this._points.setItem(1,b);this._points.setItem(2,e);break;case 2:b=this.pointToScreenPoint(b)[0];e=MathEx.distanceToLine(c,d,b).distance;g=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-g.y,
g.x);d=d.normalized();e=c.add(d.scaled(e));e=this.screenPointToPoint(e);this._points.setItem(2,e);break;case 3:b=this.pointToScreenPoint(b)[0],e=MathEx.distanceToLine(c,d,b).distance,g=d.substract(c),c=c.add(d).scaled(.5),d=new MathEx.Point(-g.y,g.x),d=d.normalized(),e=c.add(d.scaled(e)),e=this.screenPointToPoint(e),this._points.setItem(2,e)}this.normalizePoints()};TradingView.LineToolEllipse.prototype.pointsCount=function(){return 3};TradingView.LineToolEllipse.prototype.title=function(){return"Ellipse"};
TradingView.LineToolEllipse.version=2;
TradingView.LineToolEllipse.prototype.migrateVersion=function(a,b,c){1==a&&2==this._points.size()&&(b=this._points.item(0).price,c=.5*(this._points.item(0).price+this._points.item(1).price),this._points.setItem(0,{price:c,index:this._points.item(0).index}),this._points.setItem(1,{price:c,index:this._points.item(1).index}),this._points.append({price:b,index:this._points.item(0).index}));1==a&&2==this._timePoint.size()&&(b=this._timePoint.item(0).price,c=.5*(this._timePoint.item(0).price+this._timePoint.item(1).price),
this._timePoint.item(0).price=c,this._timePoint.item(1).price=c,a={price:b,offset:this._timePoint.item(0).offset,time_t:this._timePoint.item(0).time_t},this._timePoint.append(a))};function HorzLineRenderer(a){this._data=a}HorzLineRenderer.prototype.draw=function(a){if(0===this._data.points.size())return null;if(!1!==this._data.visible){var b=this._data.points.item(0).y,c=a.canvas.width;a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,0,b,c,b)}};
HorzLineRenderer.prototype.hitTest=function(a){return!1===this._data.visible||0===this._data.points.size()?null:3>=Math.abs(a.y-this._data.points.item(0).y)?new HitTestResult(this._data.hitTestResult):null};function $85(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($85,$90);
$85.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=this._points;b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();b.hitTestResult=HitTestResult.MOVEPOINT;var c=this.W99.properties();a.append(new HorzLineRenderer(b));if(this.W99.properties().showLabel.value()&&1==this._points.size()){var d=c.vertLabelsAlign.value(),e=c.horzLabelsAlign.value(),
g=this._points.item(0),h=0,k=0;"left"==e?g.x=3:"right"==e?(g.x=this.D0.timeScale().width(),k=-5):g.x=this.D0.timeScale().width()/2;"middle"==d?h=-this.W99.properties().fontsize.value()/6:"bottom"==d&&(h=-4);c={points:(new List).append(g),text:c.text.value(),color:c.textcolor.value(),vertAlign:d,horzAlign:e,font:c.font.value(),offsetX:k,offsetY:h,bold:this.W99.properties().bold.value(),italic:this.W99.properties().italic.value(),fontsize:this.W99.properties().fontsize.value()};
a.append(new TextRenderer(c,this._rendererCache))}this.isAnchorsRequired()&&(a.append(new HorzLineRenderer(b)),c=new List,c.append(new MathEx.Point(this.D0.timeScale().width()/2,this._points.item(0).y)),a.append(this.createLineAnchor({points:c,hittestResult:HitTestResult.MOVEPOINT})));if(!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&1==this._points.size()){var l=new MathEx.Point(this.D0.timeScale().width()/2,this._points.item(0).y);this.W99.getAlertIsActive(function(c){a.append(new PaneRendererClockIcon({point1:l,
color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return a};function LineToolHorzLinePriceAxisView(a,b){this.W99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invaildated=!0}inherit(LineToolHorzLinePriceAxisView,PriceAxisView);LineToolHorzLinePriceAxisView.prototype.update=function(){this._invaildated=!0};
LineToolHorzLinePriceAxisView.prototype.updateImpl=function(){if(0!==this.W99.points().size()&&this.W99.priceScale()&&!this.W99.priceScale().isEmpty()){var a=this.W99.properties().linecolor.value();a!=this._background&&(this._background=a,this._color=this.color());a=this.W99.points().item(0).price;if(this.W99.priceScale().isPercent()){var b=this.W99.ownerSource().firstValue();if(null===b)return;a=this.W99.priceScale().priceRange().convertToPercent(a,b)}this._floatCoordinate=
this.W99.priceScale().priceToCoordinate(a,!0);this._coordinate=Math.round(this._floatCoordinate);this._textHeight=this.W99.priceScale().m_markBuilder.fontHeight();this.W99.priceScale().formatter()&&(this._text=this.W99.priceScale().formatter().format(a))}};
LineToolHorzLinePriceAxisView.prototype.renderer=function(){this._invaildated&&this.updateImpl();return new PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:!0})};LineToolHorzLinePriceAxisView.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
TradingView.LineToolHorzLine=function(a,b){this._constructor="LineToolHorzLine";var c=b?b:new $52("linetoolhorzline");W47.call(this,a,new $85(this,a),c);this._priceAxisView=new LineToolHorzLinePriceAxisView(this,a)};inherit(TradingView.LineToolHorzLine,W47);TradingView.LineToolHorzLine.prototype.pointsCount=function(){return 1};TradingView.LineToolHorzLine.prototype.title=function(){return"Horizontal Line"};
TradingView.LineToolHorzLine.prototype.priceAxisViews=function(a,b){return this.isActualSymbol()?this.D0.paneForSource(this)===a&&b===this.priceScale()&&this.properties().showPrice.value()?(new List).append(this._priceAxisView):null:null};TradingView.LineToolHorzLine.prototype.updateAllViews=function(){W47.prototype.updateAllViews.call(this);this._priceAxisView.update()};TradingView.LineToolHorzLine.prototype.canHasAlert=function(){return!0};
TradingView.LineToolHorzLine.prototype._getAlertPlots=function(){return[this.points().item(0).price]};function HorzRayRenderer(a){this._data=a}HorzRayRenderer.prototype.draw=function(a){if(0===this._data.points.size())return null;var b=a.canvas.width,c=this._data.points.item(0).y,d=Math.max(0,this._data.points.item(0).x),b=Math.max(b,this._data.points.item(0).x);a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,d,c,b,c)};
HorzRayRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.x<this._data.points.item(0).x?null:3>=Math.abs(a.y-this._data.points.item(0).y)?new HitTestResult(this._data.hitTestResult):null};function $86(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($86,$90);
$86.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=this._points;b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();b.hitTestResult=HitTestResult.MOVEPOINT;var c=this.W99.properties();a.append(new HorzRayRenderer(b));if(this.W99.properties().showLabel.value()&&1==this._points.size()){var d=c.vertLabelsAlign.value(),e=c.horzLabelsAlign.value(),
g=this._points.item(0).clone(),h=0,k=0;"right"==e?(g.x=this.D0.timeScale().width(),k=-5):"center"==e&&(g.x=(g.x+this.D0.timeScale().width())/2);"middle"==d?h=-this.W99.properties().fontsize.value()/6:"bottom"==d&&(h=-4);c={points:(new List).append(g),text:c.text.value(),color:c.textcolor.value(),vertAlign:d,horzAlign:e,font:c.font.value(),offsetX:k,offsetY:h,bold:this.W99.properties().bold.value(),italic:this.W99.properties().italic.value(),fontsize:this.W99.properties().fontsize.value()};
a.append(new TextRenderer(c,this._rendererCache))}this.isAnchorsRequired()&&(c=new List,c.append(this._points.item(0)),a.append(this.createLineAnchor({points:c})));TradingView.printing||!this.W99.hasAlert.value()||this.D0.readOnly()||1!=this._points.size()||this.W99.getAlertIsActive(function(c){a.append(new PaneRendererClockIcon({point1:b.points.clone().item(0),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
function LineToolHorzRayPriceAxisView(a,b){this.W99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14}inherit(LineToolHorzRayPriceAxisView,PriceAxisView);
LineToolHorzRayPriceAxisView.prototype.update=function(){0!==this.W99.points().size()&&this.W99.priceScale()&&!this.W99.priceScale().isEmpty()&&(this._background=this.W99.properties().linecolor.value(),this._coordinate=this.W99.priceScale().priceToCoordinate(this.W99.points().item(0).price),this._textHeight=this.W99.priceScale().m_markBuilder.fontHeight(),this._text=this.W99.priceScale().formatter().format(this.W99.points().item(0).price))};
LineToolHorzRayPriceAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new PriceAxisViewRenderer(a)};TradingView.LineToolHorzRay=function(a,b){this._constructor="LineToolHorzRay";var c=b?b:new $52("linetoolhorzray");W47.call(this,a,new $86(this,a),c);this._priceAxisView=new LineToolHorzRayPriceAxisView(this,a)};
inherit(TradingView.LineToolHorzRay,W47);TradingView.LineToolHorzRay.prototype.pointsCount=function(){return 1};TradingView.LineToolHorzRay.prototype.title=function(){return"Horizontal Ray"};TradingView.LineToolHorzRay.prototype.priceAxisViews=function(a,b){return this.symbol()!==this.D0.mainSeries().symbol()?null:this.D0.paneForSource(this)===a&&b===this.priceScale()&&this.properties().showPrice.value()?(new List).append(this._priceAxisView):null};
TradingView.LineToolHorzRay.prototype.updateAllViews=function(){W47.prototype.updateAllViews.call(this);this._priceAxisView.update()};TradingView.LineToolHorzRay.prototype.canHasAlert=function(){return!0};TradingView.LineToolHorzRay.prototype._getAlertPlots=function(){var a=this._points.clone().item(0);return[this._linePointsToAlertPlot([a,{index:a.index+1,price:a.price}],null,!1,!0)]};function VertLineRenderer(a,b){this._data=a;this._hittest=b}VertLineRenderer.prototype.draw=function(a){if(0!==this._data.points.size()&&!(0>=this._data.linewidth)){var b=this._data.points.item(0).x;a.translate(1,0);var c=a.canvas.width;a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,b,0,b,c)}};
VertLineRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);return 3>=Math.abs(a.x-this._data.points.item(0).x)?b:null};function W45(a,b){$90.call(this,a,b)}inherit(W45,$90);
W45.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().linecolor.value();a.linewidth=this.W99.properties().linewidth.value();a.linestyle=this.W99.properties().linestyle.value();var b=new CompositeRenderer;b.append(new VertLineRenderer(a));if(this.isAnchorsRequired()){var c=new List;c.append(new MathEx.Point(this._points.item(0).x,this.W99.priceScale().height()/2));b.append(this.createLineAnchor({points:c,hittestResult:HitTestResult.MOVEPOINT}))}if(!TradingView.printing&&
this.W99.hasAlert.value()&&!this.D0.readOnly()&&1==a.points.size()){var d=new MathEx.Point(this._points.item(0).x,this.W99.priceScale().height()/2);this.W99.getAlertIsActive(function(c){b.append(new PaneRendererClockIcon({point1:d,color:c?a.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return b};function LineToolVertLineTimeAxisView(a,b){TimeAxisView.call(this);this.W99=a;this.D0=b;this._invalidated=!0}inherit(LineToolVertLineTimeAxisView,TimeAxisView);
LineToolVertLineTimeAxisView.prototype.update=function(){this._invalidated=!0};
LineToolVertLineTimeAxisView.prototype.updateImpl=function(){if(!this.D0.timeScale().isEmpty()&&0!==this.W99.points().size()){this._text="";this._background=this.W99.properties().linecolor.value();var a=this.W99.points().item(0).index;this._coordinate=this.D0.timeScale().indexToCoordinate(a);if(a=this.D0.timeScale().indexToUserTime(a))this._text=(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(a);this._invalidated=!1}};
LineToolVertLineTimeAxisView.prototype.renderer=function(){this._invalidated&&this.updateImpl();var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:18};return new TimeAxisViewRenderer(a)};TradingView.LineToolVertLine=function(a,b){this._constructor="LineToolVertLine";var c=b?b:new $52("linetoolvertline");W47.call(this,a,new W45(this,a),c);this._timeAxisView=new LineToolVertLineTimeAxisView(this,a)};
inherit(TradingView.LineToolVertLine,W47);TradingView.LineToolVertLine.prototype.pointsCount=function(){return 1};TradingView.LineToolVertLine.prototype.title=function(){return"Vertical Line"};TradingView.LineToolVertLine.prototype.timeAxisViews=function(){return this.symbol()!==this.D0.mainSeries().symbol()?null:this.properties().showTime.value()?(new List).append(this._timeAxisView):null};
TradingView.LineToolVertLine.prototype.updateAllViews=function(){W47.prototype.updateAllViews.call(this);this._timeAxisView.update()};TradingView.LineToolVertLine.prototype.canHasAlert=function(){return!0};TradingView.LineToolVertLine.prototype._getAlertPlots=function(){var a=this._points.clone().item(0);return[this._linePointsToAlertPlot([a,{index:a.index,price:a.price+1}],null,!0,!0)]};function ChannelRenderer(a){this._data=a}ChannelRenderer.prototype.extendPoints=function(a,b,c){var d=new MathEx.Point(0,-5E3);c=new MathEx.Point(c,5E3);var e=b.substract(a);(e=MathEx.intersectRayWithRect(b,b.add(e),d,c))&&(b=e);!MathEx.pointInRect(a,d,c)&&MathEx.pointInRect(b,d,c)&&(e=MathEx.intersectRayWithRect(b,a,d,c))&&(a=e);!MathEx.pointInRect(b,d,c)&&MathEx.pointInRect(a,d,c)&&(e=MathEx.intersectRayWithRect(a,b,d,c))&&(b=e);return[a,b]};
ChannelRenderer.prototype.draw=function(a){var b=a.canvas.width,c=this.extendPoints(this._data.p1,this._data.p2,b),b=this.extendPoints(this._data.p3,this._data.p4,b);a.beginPath();a.moveTo(c[0].x,c[0].y);a.lineTo(c[1].x,c[1].y);c[1].x<b[1].x&&a.lineTo(b[1].x,c[1].y);a.lineTo(b[1].x,b[1].y);a.lineTo(b[0].x,b[0].y);a.lineTo(c[0].x,c[0].y);a.fillStyle=generateColor(this._data.color,this._data.transparency);a.fill()};
ChannelRenderer.prototype.hitTest=function(a){if(!this._data.hittestOnBackground)return null;var b=this._data.width,c=this.extendPoints(this._data.p1,this._data.p2,b),b=this.extendPoints(this._data.p3,this._data.p4,b),d=[new MathEx.Point(c[0].x,c[0].y),new MathEx.Point(c[1].x,c[1].y)];c[1].x<b[1].x&&d.push(new MathEx.Point(b[1].x,c[1].y));d.push(new MathEx.Point(b[1].x,b[1].y));d.push(new MathEx.Point(b[0].x,b[0].y));d.push(new MathEx.Point(c[0].x,c[0].y));return MathEx.isInPolygon(new List(d),a)?
new HitTestResult(HitTestResult.MOVEPOINT):null};function W1(a,b){$90.call(this,a,b)}inherit(W1,$90);
W1.prototype.update=function(){$90.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
W1.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||!this._medianPoint)return a;var b={points:(new List).append(this._points.item(0)).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));for(var b=this._points.item(2).substract(this._points.item(1)).scaled(.5),c=this._medianPoint.substract(this._points.item(0)),d=0,e=this.W99.properties().fillBackground.value(),g=this.W99.properties().transparency.value(),h=0;8>=h;h++){var k="level"+h,k=this.W99.properties()[k];if(k.visible.value()){var l=this._medianPoint.addScaled(b,k.coeff.value()),m=l.add(c),n=this._medianPoint.addScaled(b,-k.coeff.value()),
q=n.add(c);if(e){var r={};r.width=this.D0.timeScale().width();r.p1=l;r.p2=m;r.p3=this._medianPoint.addScaled(b,d);r.p4=r.p3.add(c);r.color=k.color.value();r.transparency=g;r.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(r));r={};r.width=this.D0.timeScale().width();r.p1=n;r.p2=q;r.p3=this._medianPoint.addScaled(b,-d);r.p4=r.p3.add(c);r.color=k.color.value();r.transparency=g;r.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(r))}d=k.coeff.value();
m={points:(new List).append(l).append(m),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};l=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(m,l));k={points:(new List).append(n).append(q),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};l=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(k,l))}}this.addAnchors(a);return a};function W12(a,b){W1.call(this,a,b)}inherit(W12,W1);
W12.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(a),a;var c={points:(new List).append(this._modifiedBase).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!0,
leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(c));if(3>this._points.size())return this.addAnchors(a),a;c={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,
extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(c));for(var c=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this._medianPoint.substract(this._modifiedBase),e=0,g=this.W99.properties().fillBackground.value(),h=this.W99.properties().transparency.value(),k=0;8>=k;k++){var l="level"+k,l=this.W99.properties()[l];if(l.visible.value()){var m=this._medianPoint.addScaled(c,l.coeff.value()),n=m.add(d),
q=this._medianPoint.addScaled(c,-l.coeff.value()),r=q.add(d);g&&(b={},b.p1=m,b.p2=n,b.p3=this._medianPoint.addScaled(c,e),b.p4=b.p3.add(d),b.color=l.color.value(),b.transparency=h,a.append(new ChannelRenderer(b)),b={},b.p1=q,b.p2=r,b.p3=this._medianPoint.addScaled(c,-e),b.p4=b.p3.add(d),b.color=l.color.value(),b.transparency=h,a.append(new ChannelRenderer(b)));e=l.coeff.value();m={points:(new List).append(m).append(n),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:l.color.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};b=new HitTestResult(HitTestResult.MOVEPOINT,null,k);a.append(new TrendLineRenderer(m,b));l={points:(new List).append(q).append(r),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:l.color.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),extendleft:!1,extendright:!0,
leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};b=new HitTestResult(HitTestResult.MOVEPOINT,null,k);a.append(new TrendLineRenderer(l,b))}}this.addAnchors(a);return a};W12.prototype.update=function(){W1.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(.5))};function W11(a,b){W12.call(this,a,b)}
inherit(W11,W12);W11.prototype.update=function(){W1.prototype.update.call(this);if(2<this._points.size()){var a=this._points.item(0).x,b=.5*(this._points.item(0).y+this._points.item(1).y);this._modifiedBase=new MathEx.Point(a,b)}};function $88(a,b){W1.call(this,a,b)}inherit($88,W1);
$88.prototype.update=function(){W1.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(.5))};
$88.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(a),a;if(3==this._points.size()){var b={points:(new List).append(this._modifiedBase).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),
extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b))}var c={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,
leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(c));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,
extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));var b=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this._points.item(2).substract(this._modifiedBase),e=0,g=this.W99.properties().fillBackground.value(),h=this.W99.properties().transparency.value(),k={points:(new List).append(this._medianPoint).append(this._medianPoint.add(d)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(k));for(k=0;8>=k;k++){var l="level"+k,l=this.W99.properties()[l];if(l.visible.value()){var m=this._medianPoint.addScaled(b,l.coeff.value()),n=m.add(d),q=this._medianPoint.addScaled(b,-l.coeff.value()),
r=q.add(d);g&&(c={},c.p1=m,c.p2=n,c.p3=this._medianPoint.addScaled(b,e),c.p4=c.p3.add(d),c.color=l.color.value(),c.transparency=h,a.append(new ChannelRenderer(c)),c={},c.p1=q,c.p2=r,c.p3=this._medianPoint.addScaled(b,-e),c.p4=c.p3.add(d),c.color=l.color.value(),c.transparency=h,a.append(new ChannelRenderer(c)));e=l.coeff.value();m={points:(new List).append(m).append(n),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:l.color.value(),linewidth:l.linewidth.value(),
linestyle:l.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};c=new HitTestResult(HitTestResult.MOVEPOINT,null,k);a.append(new TrendLineRenderer(m,c));l={points:(new List).append(q).append(r),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:l.color.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
c=new HitTestResult(HitTestResult.MOVEPOINT,null,k);a.append(new TrendLineRenderer(l,c))}}this.addAnchors(a);return a};TradingView.LineToolPitchfork=function(a,b){this._constructor="LineToolPitchfork";var c=b?b:new $52("linetoolpitchfork");W47.call(this,a,new W1(this,a),c);this.D2.style.listeners().subscribe(this,TradingView.LineToolPitchfork.prototype._recreatePaneView);this._recreatePaneView()};inherit(TradingView.LineToolPitchfork,W47);
TradingView.LineToolPitchfork.STYLE_ORIGINAL=0;TradingView.LineToolPitchfork.STYLE_SCHIFF=1;TradingView.LineToolPitchfork.STYLE_INSIDE=2;TradingView.LineToolPitchfork.STYLE_SCHIFF2=3;
TradingView.LineToolPitchfork.prototype.additionalActions=function(){for(var a=[],b=["Original","Modified Schiff","Inside","Schiff"],c=0;4>c;c++){var d=new Action({checked:this.properties().style.value()==c,checkable:!0,text:$.t(b[c]),callbackContext:{target:this,value:c}});d.callbacks().subscribe(null,function(a){var b=a.callbackContext();a=b.target;b=b.value;a.properties().style.setValue(b);a.updateAllViews();a.D0.updateSource(a)});a.push(d)}return[a[0],a[3],a[1],a[2]]};
TradingView.LineToolPitchfork.prototype._recreatePaneView=function(){this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_ORIGINAL?this._paneViews=[new W1(this,this.D0)]:this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF?this._paneViews=[new W12(this,this.D0)]:this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF2?this._paneViews=[new W11(this,this.D0)]:this.D2.style.value()==
TradingView.LineToolPitchfork.STYLE_INSIDE&&(this._paneViews=[new $88(this,this.D0)])};TradingView.LineToolPitchfork.prototype.pointsCount=function(){return 3};TradingView.LineToolPitchfork.prototype.title=function(){return $.t("Pitchfork")};TradingView.LineToolPitchfork.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function W0(a,b){$90.call(this,a,b)}inherit(W0,$90);W0.prototype.update=function(){$90.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
W0.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||!this._medianPoint)return a;var b={points:(new List).append(this._points.item(0)).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this.W99.properties().median.color.value(),linewidth:this.W99.properties().median.linewidth.value(),linestyle:this.W99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));for(var b=0,c=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this.W99.properties().fillBackground.value(),e=this.W99.properties().transparency.value(),g=0;8>=g;g++){var h="level"+g,h=this.W99.properties()[h];if(h.visible.value()){var k=this._medianPoint.addScaled(c,h.coeff.value()),l=this._medianPoint.addScaled(c,-h.coeff.value());if(d){var m={};m.width=this.D0.timeScale().width();m.p1=this._points.item(0);
m.p2=k;m.p3=this._points.item(0);m.p4=this._medianPoint.addScaled(c,b);m.color=h.color.value();m.transparency=e;m.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(m));m={};m.width=this.D0.timeScale().width();m.p1=this._points.item(0);m.p2=l;m.p3=this._points.item(0);m.p4=this._medianPoint.addScaled(c,-b);m.color=h.color.value();m.transparency=e;m.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(m))}b=h.coeff.value();m={points:(new List).append(this._points.item(0)).append(k),
width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};k=new HitTestResult(HitTestResult.MOVEPOINT,null,g);a.append(new TrendLineRenderer(m,k));h={points:(new List).append(this._points.item(0)).append(l),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:h.color.value(),
linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};k=new HitTestResult(HitTestResult.MOVEPOINT,null,g);a.append(new TrendLineRenderer(h,k))}}this.addAnchors(a);return a};TradingView.LineToolPitchfan=function(a,b){this._constructor="LineToolPitchfan";var c=b?b:new $52("linetoolpitchfan");W47.call(this,a,new W0(this,a),c)};
inherit(TradingView.LineToolPitchfan,W47);TradingView.LineToolPitchfan.prototype.pointsCount=function(){return 3};TradingView.LineToolPitchfan.prototype.title=function(){return"Pitchfan"};TradingView.LineToolPitchfan.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.LineToolSchiffPitchfork=function(a,b){var c=b?b:new $52("linetoolschiffpitchfork");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolSchiffPitchfork"};inherit(TradingView.LineToolSchiffPitchfork,TradingView.LineToolPitchfork);TradingView.LineToolSchiffPitchfork.prototype.title=function(){return $.t("Modified Schiff Pitchfork")};TradingView.LineToolSchiffPitchfork2=function(a,b){var c=b?b:new $52("linetoolschiffpitchfork2");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolSchiffPitchfork2"};inherit(TradingView.LineToolSchiffPitchfork2,TradingView.LineToolPitchfork);TradingView.LineToolSchiffPitchfork2.prototype.title=function(){return $.t("Schiff Pitchfork")};TradingView.LineToolInsidePitchfork=function(a,b){var c=b?b:new $52("linetoolinsidepitchfork");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolInsidePitchfork"};inherit(TradingView.LineToolInsidePitchfork,TradingView.LineToolPitchfork);TradingView.LineToolInsidePitchfork.prototype.title=function(){return $.t("Inside Pitchfork")};function TextRenderer(a,b,c){this._textSizeCache=b;this._data=a;this._fontSize=a.fontsize?a.fontsize:a.fontSize?a.fontSize:20;a.lines=this._lines=this.wordWrap(a.text,a.wordWrapWidth);this._hittest=c?c:new HitTestResult(HitTestResult.MOVEPOINT)}
(function(){var a;TextRenderer.prototype.wordWrap=function(b,c,d){if(!a){var e=document.createElement("canvas");e.width=0;e.height=0;a=e.getContext("2d")}c=+c;b=(b+"").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);b[b.length-1]||b.pop();if(!isFinite(c)||0>=c)return b;a.font=d||this.fontStyle();d=[];for(e=0;e<b.length;e++){var g=b[e],h=a.measureText(g).width;if(h<=c)d.push(g);else for(g=g.split(/([-\)\]\},.!?:;])|(\s+)/);g.length;){h=~~(c/h*(g.length+2)/3);if(0>=h||a.measureText(g.slice(0,3*h-1).join("")).width<=
c)for(;a.measureText(g.slice(0,3*(h+1)-1).join("")).width<=c;)h++;else for(;0<h&&a.measureText(g.slice(0,3*--h-1).join("")).width>c;);if(0<h)d.push(g.slice(0,3*h-1).join("")),g.splice(0,3*h);else{var h=g[0]+(g[1]||""),k=1===k?1:~~(c/a.measureText(h)*h.length);if(a.measureText(h.substr(0,k)).width<=c)for(;a.measureText(h.substr(0,k+1)).width<=c;)k++;else for(;1<k&&a.measureText(h.substr(0,--k)).width>c;);1>k&&(k=1);d.push(h.substr(0,k));g[0]=h.substr(k);g[1]=""}h=a.measureText(g.join("")).width;if(h<=
c){d.push(g.join(""));break}}}return d}})();TextRenderer.prototype._x=function(){return this._data.points.item(0).x+this._data.offsetX};TextRenderer.prototype._y=function(){var a=this._fontSize*this._lines.length;this._data.scaleY&&(a*=this._data.scaleY);var b=this._data.points.item(0).y+this._data.offsetY+a;switch(this._data.vertAlign){case "bottom":b-=a;break;case "middle":b-=a/2}return b};
TextRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font};
TextRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){var b=this._x(),c=this._y(),d=this._fontSize;this._data.scaleY&&(d*=this._data.scaleY);c-=d*(this._lines.length-1);a.textBaseline="alphabetic";a.font=this.fontStyle();switch(this._data.horzAlign){case "left":a.textAlign="start";break;case "right":a.textAlign="end";break;case "center":a.textAlign="center"}a.translate(b+.5,c+.5);c=b=0;d=this._fontSize;if(this._data.scaleX&&this._data.scaleY){var e=Math.min(this._data.scaleX,this._data.scaleY);
a.scale(e,e)}var e=[],g;if(this._data.wordWrapWidth){g=this._data.wordWrapWidth;for(var h=0;h<this._lines.length;h++)e.push(this._data.wordWrapWidth)}else for(h=g=0;h<this._lines.length;h++){var k=a.measureText(this._lines[h]).width;e.push(k);g=Math.max(g,k)}if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){h=b;switch(this._data.horzAlign){case "right":h-=g;break;case "center":h-=g/2}var l=d*this._lines.length,m=~~(d/6);this._data.backgroundHorzInflate&&
(g+=2*this._data.backgroundHorzInflate,h-=this._data.backgroundHorzInflate);this._data.backgroundVertInflate&&(l+=2*this._data.backgroundVertInflate,c+=this._data.backgroundVertInflate);h=Math.floor(h-m);k=Math.floor(c-d);g=Math.ceil(g+2*m);l=Math.ceil(l+2*m);0!=g%2&&g++;this._data.backgroundVertInflate&&(c+=this._data.backgroundVertInflate);if(this._data.backgroundRoundRect){if(a.roundRect(h,k,g,l,this._data.backgroundRoundRect),this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,
a.globalAlpha=this._data.backgroundTransparency,a.fill(),a.globalAlpha=1),this._data.borderColor){var n=~~Math.max(d/12,1);a.strokeStyle=this._data.borderColor;a.lineWidth=n;a.stroke()}}else if(this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fillRect(h,k,g,l),a.globalAlpha=1),this._data.borderColor)n=~~Math.max(d/12,1),a.strokeStyle=this._data.borderColor,a.lineWidth=n,a.strokeRect(h-n/2,k-n/2,g+n,l+n);else if(this._data.highlightBorder){a.strokeStyle=
this._data.color;a.lineWidth=1;a.beginPath();var q=[3,1];a.dashedLineTo(h-.5,n=k-.5,m=h+g+.5,n,q);a.dashedLineTo(m,n,m,n=k+l+.5,q);a.dashedLineTo(m=h-.5,n,h+g+.5,n,q);a.dashedLineTo(m,k-.5,m,n,q);a.globalAlpha=.5;a.stroke();a.globalAlpha=1}}a.fillStyle=this._data.color;for(h=0;h<this._lines.length;h++)a.fillText(this._lines[h],b,c),c+=d;this._textSizeCache&&(this._textSizeCache.widths=e)}};
TextRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._fontSize;this._data.scaleY&&(b*=this._data.scaleY);var c=this._textSizeCache.widths;if(!c)return null;for(var d=0,e=0;e<c.length;e++)d=Math.max(d,c[e]);this._data.scaleX&&(d*=this._data.scaleX);c=this._data.points.item(0).x+this._data.offsetX;e=this._data.points.item(0).y+this._data.offsetY;"bottom"==this._data.vertAlign&&(e-=this._lines.length*this._fontSize);"middle"==this._data.vertAlign&&(e-=this._lines.length*
this._fontSize/2);"right"==this._data.horzAlign?c-=d:"center"==this._data.horzAlign&&(c-=d/2);var g=this._data.backgroundColor||this._data.borderColor?~~(b/6):0,b=this._data.borderColor?~~Math.max(b/12,1):0;return a.x>=c-g-b&&a.x<=c+d+g+b&&a.y>=e-b&&a.y<=e+this._lines.length*this._fontSize+2*g+b?this._hittest:null};function W39(a,b,c,d,e,g){$90.call(this,a,b);this._offsetX=c;this._offsetY=d;this._vertAlign=e;this._horzAlign=g;this._rendererCache={};this._renderer=null}
inherit(W39,$90);W39.prototype.update=function(){this._renderer=null;$90.prototype.update.call(this)};
W39.prototype.renderer=function(){if(this._renderer)return this._renderer;var a=this.W99.priceScale();if(!a||a.isEmpty())return this._renderer=new CompositeRenderer;var b={},c=this.W99.properties(),d=c.locked&&c.locked.value();b.points=d?this.W99.fixedPoints():this._points;b.text=c.text.value();b.color=c.color.value();b.font=c.font.value();b.offsetX=this._offsetX?this._offsetX:0;b.offsetY=this._offsetY?this._offsetY:0;b.vertAlign=this._vertAlign?this._vertAlign:"top";b.horzAlign=
this._horzAlign?this._horzAlign:"left";b.fontsize=c.fontsize.value();c.fillBackground&&c.fillBackground.value()&&(b.backgroundColor=c.backgroundColor.value(),b.backgroundTransparency=1-c.backgroundTransparency.value()/100||0);c.drawBorder&&c.drawBorder.value()&&(b.borderColor=c.borderColor.value());c.wordWrap&&c.wordWrap.value()&&(b.wordWrapWidth=c.wordWrapWidth.value());b.bold=c.bold&&c.bold.value();b.italic=c.italic&&c.italic.value();b.highlightBorder=this.D0.selectedSource()===this.W99;
d||!c.fixedSize||c.fixedSize.value()||(b.scaleX=this.W99.D0.timeScale().barSpacing()/this.W99._barSpacing,c=a.height()/a.priceRange().length(),this.W99._isPriceDencityLog&&!a.isLog()&&(c=a.priceRange().minValue(),d=a.priceRange().maxValue(),c=a._toLog(c),d=a._toLog(d),c=d-c,c=a.height()/c),!this.W99._isPriceDencityLog&&a.isLog()&&(c=a.priceRange().minValue(),d=a.priceRange().maxValue(),c=a._fromLog(c),d=a._fromLog(d),c=d-c,c=a.height()/c),b.scaleY=c/this.W99._priceDencity,
(!isFinite(b.scaleY)||0>=b.scaleY)&&delete b.scaleY);c=new TextRenderer(b,this._rendererCache);this.isAnchorsRequired()&&1===b.points.size()&&!this._noSelection?(d=b.points.item(0),a=new CompositeRenderer,a.append(c),b.wordWrapWidth&&(b=new MathEx.Point(d.x+b.wordWrapWidth+~~(b.fontsize/6),d.y+(b.lines?b.lines.length*b.fontsize/2+~~(b.fontsize/6):0)),b.data=0,a.append(this.createLineAnchor({points:(new List).append(b)}))),this._renderer=a):this._renderer=c;return this._renderer};
TradingView.LineToolText=function(a,b){this._constructor="LineToolText";var c=b?b:new $52("linetooltext");W47.call(this,a,new W39(this,a),c);this._timeScale=a.timeScale();this._barSpacing=a.timeScale().barSpacing()};inherit(TradingView.LineToolText,W47);TradingView.LineToolText.MIN_WIDTH=100;
TradingView.LineToolText.prototype.setPoint=function(a,b){var c=this.properties();if(0===a&&c.wordWrapWidth&&c.wordWrapWidth.value()){var d=c.locked&&c.locked.value()?this.fixedPoints().item(0).x:this._timeScale.indexToCoordinate(this.points().item(0).index),d=this._timeScale.indexToCoordinate(b.index)-d-~~(c.fontsize.value()/6);isFinite(d)&&c.wordWrapWidth.setValue(Math.max(TradingView.LineToolText.MIN_WIDTH,d))}};TradingView.LineToolText.prototype.pointsCount=function(){return 1};
TradingView.LineToolText.prototype.title=function(){return $.t("Text")};TradingView.LineToolText.prototype.setPriceScale=function(a){DataSource.prototype.setPriceScale.call(this,a);a&&a.priceRange()&&(this._priceDencity=a.height()/a.priceRange().length(),this._isPriceDencityLog=a.isLog())};
TradingView.LineToolText.prototype.restoreSize=function(){this._barSpacing=this.D0.timeScale().barSpacing();this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length();this.updateAllViews();this.D0.updateSource(this)};TradingView.LineToolText.prototype.restoreTemplate=function(a){delete a.locked;delete a.text;W47.prototype.restoreTemplate.call(this,a)};
TradingView.LineToolTextAbsolute=function(a,b){var c=b?b:new $52("linetooltextabsolute");c.locked.value()||c.locked.setValue(!0);TradingView.LineToolText.call(this,a,c)};inherit(TradingView.LineToolTextAbsolute,TradingView.LineToolText);TradingView.LineToolTextAbsolute.prototype.title=function(){return $.t("Anchored Text")};TradingView.LineToolText.prototype.state=function(a){var b=W47.prototype.state.call(this,a);a&&(b.state.fixedSize=!1);return b};TradingView.LineToolThumbUp=function(a,b){this._constructor="LineToolThumbUp";var c=b?b:new Property(defaults("linetoolthumbup"));W47.call(this,a,new $97(this,a,this.image,20,20,-11,0),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbUp,W47);TradingView.LineToolThumbUp.prototype.image=new Image;TradingView.LineToolThumbUp.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAACG0lEQVR4AWMgBajE205TTrD7D8R7VRJtQxgoBSDD9r++8n/68bX/leNt91NkmEKCg4BOhvv/7S/O/d/y9DTIlT8pMlAx3q4kqDv7/9KHB/8vfXAAZOAfsg0DhpeoerLT/zmXtv6ffXfn/6ZD8/4rxdqcJT/s4m168pa0/V/1+Mj/6Xe2/XdvTfovF2SWS57rEmxCjfP9/q95cOT//Pt7/k+6sem/SpLDfwZBQX4yYtXBA+TVicdW/l/+6ND/aXe2gl0YPa0MFIYQnGi3TjHB3hVFI0wSxoZhy5Lg/70Hlv5f//TE/zn3dv2feGvj/5l3d4D5e19dAieh3v1LgGptN+AzEKQQjPcANW16dvr/wgf7/k+5vfl//80N/6fd3gqO6Y3PTv7f8vzM/x0vzoP14jVw24uzQINO/V/75DjYsKlAQybc3AgyEORKsKGzgC6dC3T1ikeHCRu45OEBcPKYcWf7/8m3N8MMQ8cgcZChhA2cfW8nRBNhDFI7yA3sPb/6v3Kc7VOqGZi2rPm/fITFLKoY2Hxq8X+dTPf/km66xkQlbM101/+WFaH/XVoT/6esbPrfcmbJ/+6ra/4X75r0P3p+5X8toLxckEknUBsbvhzHCcRSoGzMKSNsJmKmFClup1EhG2C6QzHG+h2wYP0pH2p+RcbPaImgtpQ1UB0XEDMSzMdQRcxAzA7EvEAsCsSyQCwPtVAAiFnRDQMAkGceWYhDo88AAAAASUVORK5CYII=";
TradingView.LineToolThumbUp.prototype.pointsCount=function(){return 1};TradingView.LineToolThumbUp.prototype.title=function(){return"Thumb Up"};TradingView.LineToolThumbDown=function(a,b){this._constructor="LineToolThumbDown";var c=b?b:new $52("linetoolthumbdown");W47.call(this,a,new $97(this,a,this.image,20,20,-6,-18),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbDown,W47);
TradingView.LineToolThumbDown.prototype.image=new Image;TradingView.LineToolThumbDown.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAB70lEQVR4AWNAB4dsVUT3WCrU7bOQP7zXQuH/Xgv523stFSbsNley2e+gzcNACgBqLNhvq/r/SkbQ/wcNWf9fT6n//7Sj6P+N/Ij/JwIs/4PkIJYgMFgfgo0Au8xlVA/Yq/9/3JL//3lrwf+nNan/H1ck/n9Slfz/WVPO/xddpf9fTaj+/2pSLRi/ntaI38Ad5goTrmUF/39am/7/IdBFD7KC/t9P9///IDPw/8Oc0P+PCqP+PyqJ/f+4NA6MnzVk4Tdwj4XCg0dVKf8f5oX/v5/mRwiDDMVtIFQQ5D2Qi6hn4OOyeJBiqhkIUjSSDNxsKrf3RoovKKlgMwAsfj3W9f8RJy3iEvZ8A5moVcayJ2CS5wIt/z/ICIAbdjPR8/8+K6X/TepiZUDlakAsBcSc+HIeGxCLArGCNh+r6V5Lxf8Pc0PBBt7LDPp/yEHj/1QdiWKgPBcQM5GUp7eYycWf9Lf4/6goGuzKixEO/xcbyC6AuoiRgVSw01z+2L3S+P+PCiL/30kP+L/fRuV/oZKgLumGIWL8z9PaNGA2DPt/OsDi/0I9mS6gMCvpJiHy9a9HZXHgQuKAnfr/UhUxZbDryAXbzOQv384KBpUusOTAwkAJWGokXbjRWO4WyLANJnILwa6jELADsTgQS4JjlgQAAD+B93SzAgQRAAAAAElFTkSuQmCC";
TradingView.LineToolThumbDown.prototype.pointsCount=function(){return 1};TradingView.LineToolThumbDown.prototype.title=function(){return"Thumb Down"};TradingView.LineToolThumbDown.prototype.version=TradingView.LineToolThumbUp.prototype.version=2;TradingView.LineToolThumbUp.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(12,0)))};
TradingView.LineToolThumbDown.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(7,18)))};function BalloonRenderer(a,b){this._measureCache=b;this._data=a}
BalloonRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){a.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var b=a.measureText(this._data.label);b.height=this._data.fontSize;var c={left:15,top:(30-b.height)/2},b=b.width+2*c.left,d=this._data.points.item(0).x-(c.left+20),e=this._data.points.item(0).y-39;this._measureCache&&$.extend(this._measureCache,{innerWidth:b,innerHeight:30,padding:c});a.translate(.5+d,.5+e);a.beginPath();a.moveTo(24,30);
a.lineTo(15,30);a.arcTo(-1E3,0,1E3,0,15);a.lineTo(b-15,0);a.arcTo(1E3,30,-1E3,30,15);a.lineTo(33,30);a.quadraticCurveTo(33,34,35,39);a.quadraticCurveTo(27,36,24,30);a.fillStyle=generateColor(this._data.backgroundColor,this._data.transparency);a.fill();a.strokeStyle=this._data.borderColor;a.lineWidth=2;a.stroke();a.closePath();a.textBaseline="top";a.fillStyle=this._data.color;a.fillText(this._data.label,c.left,c.top-1)}};
BalloonRenderer.prototype.hitTest=function(a){if(0===this._data.points.size()||!this._measureCache.padding)return null;var b=this._data.points.item(0).x-(this._measureCache.padding.left+20),c=this._data.points.item(0).y-(this._measureCache.innerHeight+9);return MathEx.pointInRect(a,new MathEx.Point(b,c),new MathEx.Point(b+this._measureCache.innerWidth,c+this._measureCache.innerHeight))?new HitTestResult(HitTestResult.MOVEPOINT):null};
function $56(a,b){$90.call(this,a,b);this._image=TradingView.getImage("balloon",TradingView.wrapUrl("/static/images/balloon.png"));$(this._image).load(function(){b.updateSource(a)});this._rendererCache={}}inherit($56,$90);
$56.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().color.value();a.borderColor=this.W99.properties().borderColor.value();a.backgroundColor=this.W99.properties().backgroundColor.value();a.transparency=this.W99.properties().transparency.value();a.fontWeight=this.W99.properties().fontWeight.value();a.fontSize=this.W99.properties().fontsize.value();a.fontFamily=this.W99.properties().font.value();a.label=this.W99.properties().text.value();
a.image=this._image;if(this.isAnchorsRequired()&&1==a.points.size()){var b=new CompositeRenderer;b.append(new BalloonRenderer(a,this._rendererCache));b.append(new SelectionRenderer({points:a.points}));return b}return new BalloonRenderer(a,this._rendererCache)};TradingView.LineToolBalloon=function(a,b){this._constructor="LineToolBalloon";var c=b?b:new $52("linetoolballoon");W47.call(this,a,new $56(this,a),c)};inherit(TradingView.LineToolBalloon,W47);
TradingView.LineToolBalloon.prototype.pointsCount=function(){return 1};TradingView.LineToolBalloon.prototype.title=function(){return"Balloon"};function CalloutRenderer(a,b){this._data=a;a.lines=this.wordWrap(a.text,a.wordWrapWidth);this._textSizeCache=b}CalloutRenderer.ROUND_RADIUS=8;CalloutRenderer.TEXT_MARGINS=2;
(function(){var a;CalloutRenderer.prototype.wordWrap=function(b,c){if(!a){var d=document.createElement("canvas");d.width=0;d.height=0;a=d.getContext("2d")}c=+c;d=(b+"").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);d[d.length-1]||d.pop();if(!isFinite(c)||0>=c)return d;a.font=this.fontStyle();for(var e=[],g=0;g<d.length;g++){var h=d[g],k=a.measureText(h).width;if(k<=c)e.push(h);else for(h=h.split(/([-\)\]\},.!?:;])|(\s+)/);h.length;){k=~~(c/k*(h.length+2)/3);if(0>=k||a.measureText(h.slice(0,3*k-1).join("")).width<=
c)for(;a.measureText(h.slice(0,3*(k+1)-1).join("")).width<=c;)k++;else for(;0<k&&a.measureText(h.slice(0,3*--k-1).join("")).width>c;);if(0<k)e.push(h.slice(0,3*k-1).join("")),h.splice(0,3*k);else{var k=h[0]+(h[1]||""),l=1===l?1:~~(c/a.measureText(k)*k.length);if(a.measureText(k.substr(0,l)).width<=c)for(;a.measureText(k.substr(0,l+1)).width<=c;)l++;else for(;1<l&&a.measureText(k.substr(0,--l)).width>c;);1>l&&(l=1);e.push(k.substr(0,l));h[0]=k.substr(l);h[1]=""}k=a.measureText(h.join("")).width;if(k<=
c){e.push(h.join(""));break}}}return e}})();CalloutRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1);if(3>b.substract(a).length())return new HitTestResult(HitTestResult.CHANGEPOINT,0);b=c.x-this._textSizeCache.totalWidth/2;c=c.y-this._textSizeCache.totalHeight/2;return a.x>=b&&a.x<=b+this._textSizeCache.totalWidth&&a.y>=c&&a.y<=c+this._textSizeCache.totalHeight?new HitTestResult(HitTestResult.MOVEPOINT):null};
CalloutRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
CalloutRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0).clone(),c=this._data.points.item(1).clone();a.lineCap="butt";a.strokeStyle=this._data.bordercolor;a.lineWidth=this._data.linewidth;a.textBaseline="bottom";a.font=this.fontStyle();var d=this._data.fontSize*this._data.lines.length,e=this._data.wordWrapWidth||this._data.lines.reduce(function(b,c){return Math.max(b,a.measureText(c).width)},0);this._textSizeCache.textHeight=d;this._textSizeCache.textHeight=
e;var g=CalloutRenderer.ROUND_RADIUS,h=CalloutRenderer.TEXT_MARGINS,k=e+2*h+2*g,l=d+2*h+2*g;this._textSizeCache.totalWidth=k;this._textSizeCache.totalHeight=l;var m=c.x-k/2,n=c.y-l/2,q=0,e=e+2*h>2*g,d=d+2*h>2*g;b.x>m+k?q=20:b.x>m&&(q=10);b.y>n+l?q+=2:b.y>n&&(q+=1);a.save();a.translate(m,n);b.x-=m;b.y-=n;c.x-=m;c.y-=n;a.beginPath();a.moveTo(g,0);10==q&&(e?(a.lineTo(c.x-g,0),a.lineTo(b.x,b.y),a.lineTo(c.x+g,0)):a.lineTo(b.x,b.y));a.lineTo(k-g,0);20==q?(a.lineTo(b.x,b.y),a.lineTo(k,g)):a.arcTo(k,0,k,
g,g);21==q&&(d?(a.lineTo(k,c.y-g),a.lineTo(b.x,b.y),a.lineTo(k,c.y+g)):a.lineTo(b.x,b.y));a.lineTo(k,l-g);22==q?(a.lineTo(b.x,b.y),a.lineTo(k-g,l)):a.arcTo(k,l,k-g,l,g);12==q&&(e?(a.lineTo(c.x+g,l),a.lineTo(b.x,b.y),a.lineTo(c.x-g,l)):a.lineTo(b.x,b.y));a.lineTo(g,l);2==q?(a.lineTo(b.x,b.y),a.lineTo(0,l-g)):a.arcTo(0,l,0,l-g,g);1==q&&(d?(a.lineTo(0,c.y+g),a.lineTo(b.x,b.y),a.lineTo(0,c.y-g)):a.lineTo(b.x,b.y));a.lineTo(0,g);0==q?(a.lineTo(b.x,b.y),a.lineTo(g,0)):a.arcTo(0,0,g,0,g);a.stroke();a.fillStyle=
generateColor(this._data.backcolor,this._data.transparency);a.fill();a.fillStyle=this._data.color;n=g+h+this._data.fontSize;m=g+h;for(b=0;b<this._data.lines.length;b++)a.fillText(this._data.lines[b],m,n),n+=this._data.fontSize;a.restore()}};function $62(a,b){$90.call(this,a,b);this._textSizeCache={}}inherit($62,$90);$62.prototype.update=function(){$90.prototype.update.call(this);this.W99._calculatePoint2()};
$62.prototype.renderer=function(){if(!this._points.item(0))return new CompositeRenderer;if(!(2>this._points.size(0))){var a=this.W99.properties(),b={};b.points=new List;b.points.append(this._points.item(0));var c=this._points.item(1).clone();c.x=this._points.item(0).x+this.W99._barOffset*this.D0.timeScale().barSpacing();b.points.append(c);b.color=a.color.value();b.linewidth=a.linewidth.value();b.backcolor=a.backgroundColor.value();b.transparency=a.transparency.value();b.text=
a.text.value();b.font=a.font.value();b.fontSize=a.fontsize.value();b.bordercolor=a.bordercolor.value();a.wordWrap&&a.wordWrap.value()&&(b.wordWrapWidth=a.wordWrapWidth.value());b.bold=a.bold&&a.bold.value();b.italic=a.italic&&a.italic.value();c=new CalloutRenderer(b,this._textSizeCache);if(this.isAnchorsRequired()){a=new CompositeRenderer;a.append(c);var c=b.points.item(1),d=b.points.clone();d.removeAt(d.size()-1);a.append(this.createLineAnchor({points:d}));b.wordWrapWidth&&(b=new MathEx.Point(c.x+
(b.wordWrapWidth>>1)+CalloutRenderer.ROUND_RADIUS+CalloutRenderer.TEXT_MARGINS,c.y),b.data=1,a.append(this.createLineAnchor({points:(new List).append(b)})));return a}return c}};TradingView.LineToolCallout=function(a,b){this._constructor="LineToolCallout";var c=b?b:new $52("linetoolcallout");W47.call(this,a,new $62(this,a),c);this._barOffset=0;this._timeScale=a.timeScale()};inherit(TradingView.LineToolCallout,W47);
TradingView.LineToolCallout.MIN_WIDTH=100;TradingView.LineToolCallout.prototype.pointsCount=function(){return 2};TradingView.LineToolCallout.prototype.title=function(){return"Callout"};TradingView.LineToolCallout.prototype.correctPoints=function(a){var b=this._currentMovingPoint.index-this._startMovingPoint.index,c=this._currentMovingPoint.price-this._startMovingPoint.price,d=a.item(1);d.index+=b;d.price+=c;a.setItem(1,d)};
TradingView.LineToolCallout.prototype.addPoint=function(a){(a=W47.prototype.addPoint.call(this,a))&&this._calculateBarOffset();return a};TradingView.LineToolCallout.prototype._calculateBarOffset=function(){1<this.points().size()&&(this._barOffset=this.points().item(1).index-this.points().item(0).index)};TradingView.LineToolCallout.prototype.setLastPoint=function(a){W47.prototype.setLastPoint.call(this,a);2==this.points().size()&&this._calculateBarOffset()};
TradingView.LineToolCallout.prototype.setPoint=function(a,b){switch(a){case 0:W47.prototype.setPoint.call(this,a,b);this._calculateBarOffset();break;case 1:var c=this.properties();if(!c.wordWrapWidth)break;var d=this._points,e=this._dragStartLeftEdgeIndex,g=Math.round((b.index-e)/2);if(isFinite(e)&&isFinite(g)){d.setItem(1,{index:e+g,price:d.item(1).price});this._calculateBarOffset();this.normalizePoints();d=this._timeScale.indexToCoordinate(e+2*g)-this._timeScale.indexToCoordinate(e)-
CalloutRenderer.ROUND_RADIUS-CalloutRenderer.TEXT_MARGINS;if(!isFinite(d))break;c.wordWrapWidth.setValue(Math.max(TradingView.LineToolCallout.MIN_WIDTH,d))}else d.setItem(1,b),this._calculateBarOffset(),this.normalizePoints()}};TradingView.LineToolCallout.prototype.startDragPoint=function(a,b){var c=this.properties();1===a&&c.wordWrap&&c.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points().item(1).index-b.index)};
TradingView.LineToolCallout.prototype.move=function(a){W47.prototype.move.call(this,a);this._calculateBarOffset()};TradingView.LineToolCallout.prototype.state=function(a){a=W47.prototype.state.call(this,a);a.barOffset=this._barOffset;return a};TradingView.LineToolCallout.prototype.restoreData=function(a){a.barOffset?this._barOffset=a.barOffset:this._calculateBarOffset();this._calculatePoint2()};
TradingView.LineToolCallout.prototype.setPriceScale=function(a){DataSource.prototype.setPriceScale.call(this,a);a&&a.priceRange()&&this._calculatePoint2()};TradingView.LineToolCallout.prototype._calculatePoint2=function(){if(this.D0.lineBeingEdited()!=this&&this.D0.sourceBeingMoved()!=this&&!(2>this._points.size())){var a=this.points().item(0),b=this.points().item(1);this._points.setItem(1,{price:b.price,index:a.index+this._barOffset})}};function TriangleRenderer(a){this._data=a}
TriangleRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),d;d=2==this._data.points.size()?c:this._data.points.item(2);a.beginPath();a.moveTo(b.x,b.y);a.lineTo(c.x,c.y);a.lineTo(d.x,d.y);a.lineTo(b.x,b.y);this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill());
a.stroke()}};
TriangleRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),e=MathEx.distanceToSegment(b,c,a);if(3>=e.distance)return new HitTestResult(HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(c,d,a);if(3>=e.distance)return new HitTestResult(HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(d,b,a);return 3>=e.distance||this._data.fillBackground&&MathEx.pointInTriangle(b,c,d,a)?new HitTestResult(HitTestResult.MOVEPOINT):
null};function W44(a,b){$90.call(this,a,b)}inherit(W44,$90);
W44.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().color.value();a.linewidth=this.W99.properties().linewidth.value();a.backcolor=this.W99.properties().backgroundColor.value();a.fillBackground=this.W99.properties().fillBackground.value();a.transparency=this.W99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new TriangleRenderer(a));a=a.points.clone();this.D0.lineBeingCreated()==
this.W99&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new TriangleRenderer(a)};TradingView.LineToolTriangle=function(a,b){this._constructor="LineToolTriangle";var c=b?b:new $52("linetooltriangle");W47.call(this,a,new W44(this,a),c)};inherit(TradingView.LineToolTriangle,W47);TradingView.LineToolTriangle.prototype.pointsCount=function(){return 3};TradingView.LineToolTriangle.prototype.title=function(){return"Triangle"};function ArcRenderer(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=Math.PI;this._data.clockwise=!1}inherit(ArcRenderer,EllipseRenderer);ArcRenderer.prototype._additionalPointTest=function(a,b){return 0<=a.y*b.y};
ArcRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0),c=this._data.points.item(1);if(3>this._data.points.size())a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance;if(1>d)a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var e=
c.substract(b),g=b.add(c).scaled(.5),c=new MathEx.Point(-e.y,e.x),c=c.normalized();g.add(c.scaled(d));g.add(c.scaled(-d));a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;var c=e.length(),h=e.y/c,e=Math.acos(e.x/c);0>h&&(e=-e);h=this._data.points.item(2);g=MathEx.Matrix.translate(-g.x,-g.y);h=g.mult(h);g=MathEx.Matrix.rotate(-e);h=g.mult(h);g=MathEx.Matrix.scale(1,c/(2*d));h=g.mult(h);this._data.clockwise=0>h.y?!0:!1;a.save();a.beginPath();a.translate(b.x,b.y);a.rotate(e);b=1-Math.sqrt(3)/
2;a.scale(1,d/(c*b));this._data.clockwise?a.arc(.5*c,c*Math.sqrt(3)/2,c,-2*Math.PI/3,-Math.PI/3,!1):a.arc(.5*c,-c*Math.sqrt(3)/2,c,Math.PI/3,2*Math.PI/3,!1);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};function $54(a,b){$90.call(this,a,b)}inherit($54,$90);
$54.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().color.value();a.linewidth=this.W99.properties().linewidth.value();a.backcolor=this.W99.properties().backgroundColor.value();a.fillBackground=this.W99.properties().fillBackground.value();a.transparency=this.W99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new ArcRenderer(a));var c=new List,d=a.points.item(0),e=new MathEx.Point(d.x,
d.y);e.data=0;c.append(e);if(1==a.points.size())return b;var g=a.points.item(1),e=new MathEx.Point(g.x,g.y);e.data=1;if(2==a.points.size())return this.addAnchors(b),b;c.append(e);var e=a.points.item(2),h=MathEx.distanceToLine(d,g,e).distance,k=g.substract(d),d=d.add(g).scaled(.5),g=new MathEx.Point(-k.y,k.x),g=g.normalized(),e=d.add(g.scaled(h)),g=d.add(g.scaled(-h)),l=k.length(),m=k.y/l,k=Math.acos(k.x/l);0>m&&(k=-k);a=a.points.item(2);d=MathEx.Matrix.translate(-d.x,-d.y);a=d.mult(a);d=MathEx.Matrix.rotate(-k);
a=d.mult(a);d=MathEx.Matrix.scale(1,l/(2*h));a=d.mult(a);a=0<=a.y?new MathEx.Point(e.x,e.y):new MathEx.Point(g.x,g.y);a.data=2;c.append(a);b.append(this.createLineAnchor({points:c}));return b}return new ArcRenderer(a)};TradingView.LineToolArc=function(a,b){this._constructor="LineToolArc";var c=b?b:new $52("linetoolarc");W47.call(this,a,new $54(this,a),c);this.version=TradingView.LineToolArc.version};inherit(TradingView.LineToolArc,W47);
TradingView.LineToolArc.prototype.startChanging=function(a,b){W47.prototype.startChanging.call(this,a,b);if(0==a||1==a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0];this._dist=MathEx.distanceToLine(c,d,e).distance}};TradingView.LineToolArc.prototype.pointsCount=function(){return 3};TradingView.LineToolArc.prototype.title=function(){return"Arc"};
TradingView.LineToolArc.prototype.setPoint=function(a,b){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],g=this.priceScale();if(g.isPercent()){var h=this.ownerSource().firstValue();b.price=g.priceRange().convertFromPercent(b.price,h)}switch(a){case 0:var c=this.pointToScreenPoint(b)[0],h=d.substract(c),k=c.add(d).scaled(.5),c=new MathEx.Point(-h.y,h.x),c=c.normalized(),e=k.add(c.scaled(this._dist)),
e=this.screenPointToPoint(e);this._points.setItem(0,b);this._points.setItem(2,e);break;case 1:g=MathEx.distanceToLine(c,d,e).distance;d=this.pointToScreenPoint(b)[0];h=d.substract(c);k=c.add(d).scaled(.5);c=new MathEx.Point(-h.y,h.x);c=c.normalized();e=k.add(c.scaled(this._dist));e=this.screenPointToPoint(e);this._points.setItem(1,b);this._points.setItem(2,e);break;case 2:b=this.pointToScreenPoint(b)[0];var g=MathEx.distanceToLine(c,d,b).distance,h=d.substract(c),k=c.add(d).scaled(.5),c=new MathEx.Point(-h.y,
h.x),c=c.normalized(),e=k.add(c.scaled(g)),c=k.add(c.scaled(-g)),d=h.length(),l=h.y/d,h=Math.acos(h.x/d);0>l&&(h=-h);k=MathEx.Matrix.translate(-k.x,-k.y);b=k.mult(b);l=k.mult(e);k=MathEx.Matrix.rotate(-h);b=k.mult(b);l=k.mult(l);k=MathEx.Matrix.scale(1,d/(2*g));b=k.mult(b);l=k.mult(l);e=0<=b.y*l.y?new MathEx.Point(e.x,e.y):new MathEx.Point(c.x,c.y);e=this.screenPointToPoint(e);this._points.setItem(2,e)}this.normalizePoints()};TradingView.LineToolArc.version=2;
TradingView.LineToolArc.prototype.migrateVersion=function(a,b,c){1==a&&2==this._points.size()&&(b=(2*this._points.item(0).price+3*this._points.item(1).price)/5,this._points.append({price:b,index:this._points.item(1).index}));1==a&&2==this._timePoint.size()&&(b=(2*this._timePoint.item(0).price+3*this._timePoint.item(1).price)/5,a={price:b,offset:this._timePoint.item(1).offset,time_t:this._timePoint.item(1).time_t},this._timePoint.append(a))};TradingView.LineToolArrow=function(a,b){this._constructor="LineToolArrow";var c=b?b:new $52("linetoolarrow");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolArrow,TradingView.LineToolTrendLine);TradingView.LineToolArrow.prototype.title=function(){return"Arrow"};function $61(a,b){$90.call(this,a,b);this._invalidated=!0;this.D0=b;this.W99=a}inherit($61,$90);$61.prototype.update=function(){this._invalidated=!0};$61.prototype._smoothArray=function(a,b){for(var c=Array(a.length),d=0;d<a.length;d++){for(var e=new MathEx.Point(0,0),g=0;g<b;g++)var h=Math.max(d-g,0),k=Math.min(d+g,a.length-1),e=e.add(a[h]),e=e.add(a[k]);c[d]=e.scaled(.5/b)}c.push(a[a.length-1]);return c};
$61.prototype._updateInternal=function(){$90.prototype.update.call(this);var a=Math.max(1,this.W99.properties().smooth.value()),b=this._points.toArray();if(0!=b.length){for(var c=[b[0]],d=1;d<b.length;d++){for(var e=b[d].substract(b[d-1]),g=e.length(),h=Math.floor(g/a),e=e.normalized().scaled(g/h),g=0;g<h-1;g++)c.push(b[d-1].add(e.scaled(g)));c.push(b[d])}a=this._smoothArray(c,a);this._points=new List(a)}};
$61.prototype.renderer=function(){this._invalidated&&(this._updateInternal(),this._invalidated=!1);var a={},b=this.W99.properties();a.points=this._points;a.color=b.linecolor.value();a.linewidth=b.linewidth.value();a.linestyle=b.linestyle.value();a.skipClosePath=!0;b.fillBackground.value()&&this.D0.lineBeingCreated()!==this.W99&&(a.filled=!0,a.fillBackground=!0,a.backcolor=b.backgroundColor.value(),a.transparency=b.transparency.value());if(this.isAnchorsRequired()&&this.W99.finished()){b=
new CompositeRenderer;b.append(new PoligonRenderer(a));if(0<a.points.size()){var c=new List;c.append(a.points.item(0));c.append(a.points.item(a.points.size()-1));b.append(new SelectionRenderer({points:c}))}return b}return new PoligonRenderer(a)};TradingView.LineToolBrush=function(a,b){this._constructor="LineToolBrush";var c=b?b:new $52("linetoolbrush");W47.call(this,a,new $61(this,a),c);this._finished=!1};inherit(TradingView.LineToolBrush,W47);
TradingView.LineToolBrush.prototype.pointsCount=function(){return-1};TradingView.LineToolBrush.prototype.finished=function(){return this._finished};TradingView.LineToolBrush.prototype.finish=function(){this._finished=!0;this._lastPoint=null;this.normalizePoints();this.createServerPoints()};TradingView.LineToolBrush.prototype.title=function(){return"Brush"};TradingView.LineToolBrush.prototype.percentDistance=function(a,b){return Math.abs((b-a)/a)};
TradingView.LineToolBrush.prototype.addPoint=function(a){if(this._finished)return!0;this._lastPoint=null;if(0<this._points.size()){var b=this._points.item(this._points.size()-1),b=this.pointToScreenPoint(b)[1];if(2>this.pointToScreenPoint(a)[1].substract(b).length())return this._finished}W47.prototype.addPoint.call(this,a);return this._finished};TradingView.LineToolBrush.prototype.restorePoints=function(a,b,c){W47.prototype.restorePoints.call(this,a,b,c);this._finished=!0};TradingView.LineToolRay=function(a,b){this._constructor="LineToolRay";var c=b?b:new $52("linetoolray");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolRay,TradingView.LineToolTrendLine);TradingView.LineToolRay.prototype.title=function(){return"Ray"};TradingView.LineToolExtended=function(a,b){this._constructor="LineToolExtended";var c=b?b:new $52("linetoolextended");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolExtended,TradingView.LineToolTrendLine);TradingView.LineToolExtended.prototype.title=function(){return"Extended Line"};TradingView.LineToolArrowMark=function(a,b){var c=b?b:new $52("linetoolarrowmark");W47.call(this,a,new $97(this,a,this.image,this.width,this.height,this.offsetX,this.offsetY),c)};inherit(TradingView.LineToolArrowMark,W47);TradingView.LineToolArrowMark.prototype.width=21;TradingView.LineToolArrowMark.prototype.height=21;TradingView.LineToolArrowMark.prototype.offsetX=0;TradingView.LineToolArrowMark.prototype.offsetY=0;
TradingView.LineToolArrowMark.prototype.paneViews=function(a){a=W47.prototype.paneViews.call(this,a);null!==a&&this._textPaneView&&a.append(this._textPaneView);return a};TradingView.LineToolArrowMark.prototype.pointsCount=function(){return 1};TradingView.LineToolArrowMark.prototype.title=function(){return"Arrow Mark"};
TradingView.LineToolArrowMarkLeft=function(a,b){this._constructor="LineToolArrowMarkLeft";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new W39(this,a,22,-3,"middle","left");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkLeft,TradingView.LineToolArrowMark);TradingView.LineToolArrowMarkLeft.prototype.image=new Image;TradingView.LineToolArrowMarkLeft.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==";
TradingView.LineToolArrowMarkLeft.prototype.offsetX=1;TradingView.LineToolArrowMarkLeft.prototype.offsetY=-10;TradingView.LineToolArrowMarkLeft.prototype.title=function(){return"Arrow Mark Left"};TradingView.LineToolArrowMarkUp=function(a,b){this._constructor="LineToolArrowMarkUp";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new W39(this,a,0,18,"top","center");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkUp,TradingView.LineToolArrowMark);
TradingView.LineToolArrowMarkUp.prototype.image=new Image;TradingView.LineToolArrowMarkUp.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=";
TradingView.LineToolArrowMarkUp.prototype.offsetX=-9;TradingView.LineToolArrowMarkUp.prototype.offsetY=0;TradingView.LineToolArrowMarkUp.prototype.title=function(){return"Arrow Mark Up"};TradingView.LineToolArrowMarkRight=function(a,b){this._constructor="LineToolArrowMarkRight";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new W39(this,a,-22,-3,"middle","right");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkRight,TradingView.LineToolArrowMark);
TradingView.LineToolArrowMarkRight.prototype.image=new Image;TradingView.LineToolArrowMarkRight.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=";
TradingView.LineToolArrowMarkRight.prototype.offsetX=-19;TradingView.LineToolArrowMarkRight.prototype.offsetY=-10;TradingView.LineToolArrowMarkRight.prototype.title=function(){return"Arrow Mark Right"};TradingView.LineToolArrowMarkDown=function(a,b){this._constructor="LineToolArrowMarkDown";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new W39(this,a,0,-23,"bottom","center");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkDown,TradingView.LineToolArrowMark);
TradingView.LineToolArrowMarkDown.prototype.image=new Image;TradingView.LineToolArrowMarkDown.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=";
TradingView.LineToolArrowMarkDown.prototype.offsetX=-9;TradingView.LineToolArrowMarkDown.prototype.offsetY=-18;TradingView.LineToolArrowMarkDown.prototype.title=function(){return"Arrow Mark Down"};TradingView.LineToolArrowMarkRight.prototype.version=TradingView.LineToolArrowMarkLeft.prototype.version=TradingView.LineToolArrowMarkDown.prototype.version=TradingView.LineToolArrowMarkUp.prototype.version=2;
TradingView.LineToolArrowMarkDown.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,21)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=-4)};
TradingView.LineToolArrowMarkUp.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=18)};
TradingView.LineToolArrowMarkRight.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=10)};
TradingView.LineToolArrowMarkLeft.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=21,this._textPaneView._offsetY=10)};TradingView.LineToolFlagMark=function(a,b){this._constructor="LineToolFlagMark";var c=b?b:new $52("linetoolflagmark");W47.call(this,a,new $97(this,a,this.image,25,25,-8,-21),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolFlagMark,W47);TradingView.LineToolFlagMark.prototype.image=new Image;TradingView.LineToolFlagMark.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=";
TradingView.LineToolFlagMark.prototype.pointsCount=function(){return 1};TradingView.LineToolFlagMark.prototype.title=function(){return"Flag Mark"};TradingView.LineToolFlagMark.prototype.version=2;TradingView.LineToolFlagMark.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(9,21)))};function NoteRendererSource(){}NoteRendererSource.prototype.update=function(a){this._data&&(!this._data||a.markerColor==this._data.markerColor&&a.width==this._data.width&&a.height==this._data.height)||this._createSource(a.width,a.height,a.markerColor);this._data=a};
NoteRendererSource.prototype._createSource=function(a,b,c){this._sourceCanvas=document.createElement("canvas");this._sourceCanvas.width=a;this._sourceCanvas.height=b;this._translate=new MathEx.Point(-a/2,-b+.5);0==this._translate.x%1&&(this._translate.x+=.5);var d=this._sourceCanvas.getContext("2d"),e=.6*a;d.fillStyle=c;d.beginPath();d.moveTo(a/2,b);d.quadraticCurveTo(a,a/1.15,a,a/2);d.arc(a/2,a/2,a/2,0,Math.PI,!0);d.quadraticCurveTo(0,a/1.15,a/2,b);d.fill();d.globalCompositeOperation="destination-out";
d.beginPath();d.moveTo((a-e)/2,a/2);d.arc(a/2,a/2,e/2,0,2*Math.PI);d.fill()};NoteRendererSource.prototype.drawOn=function(a){var b=(new MathEx.Point(Math.round(this._data.point.x),Math.round(this._data.point.y))).add(this._translate);a.drawImage(this._sourceCanvas,b.x,b.y)};NoteRendererSource.prototype.hasPoint=function(a){var b=this._data.point.add(this._translate),c=new MathEx.Point(this._data.point.x-this._translate.x,this._data.point.y);return MathEx.pointInRect(a,b,c)};
function NoteRenderer(a,b){this.W99=a;this._data=b}NoteRenderer.prototype.draw=function(a){this.W99.drawOn(a);this._data.tooltipVisible&&this.drawTooltipOn(a)};
NoteRenderer.prototype.drawTooltipOn=function(a){a.save();var b=String(this._data.text).replace(/^\s+|\s+$/g,"").replace(/[\r\n]+/g,"\n");a.font=(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font;var b=TextRenderer.prototype.wordWrap(b,TradingView.LineToolNote.TOOLTIP_WIDTH-2*TradingView.LineToolNote.TOOLTIP_PADDING,a.font),c=this._data.point,d=TradingView.LineToolNote.TOOLTIP_LINESPACING,e=TradingView.LineToolNote.TOOLTIP_WIDTH,g=b.length*this._data.fontSize+
2*TradingView.LineToolNote.TOOLTIP_PADDING;1<b.length&&(g+=(b.length-1)*d);var h=Math.round(c.x-e/2),k=Math.round(c.y-this._data.height-g-8),l=20>c.x||c.x+20>this._data.vpWidth,m=l?null:"top",n=l?null:Math.round(c.x);10>k?k=c.y+13:m="bottom";10>h?h+=Math.abs(h-10):h+e+10>this._data.vpWidth&&(h-=h+e+10-this._data.vpWidth);a.fillStyle=generateColor(this._data.backgroundColor,this._data.backgroundTransparency);a.strokeStyle=this._data.markerColor;a.lineWidth=1;a.beginPath();a.moveTo(h,k);l||"top"!=m||
(a.lineTo(n-7,k),a.lineTo(n,k-7),a.lineTo(n+7,k));a.lineTo(h+e,k);a.lineTo(h+e,k+g);l||"bottom"!=m||(a.lineTo(n+7,k+g),a.lineTo(n,k+g+7),a.lineTo(n-7,k+g));a.lineTo(h,k+g);a.closePath();a.fill();a.stroke();a.textBaseline="middle";a.fillStyle=this._data.textColor;c=h+TradingView.LineToolNote.TOOLTIP_PADDING;k=k+TradingView.LineToolNote.TOOLTIP_PADDING+this._data.fontSize/2;for(i=0;i<b.length;i++)a.fillText(b[i].replace(/^\s+/,""),c,k),k+=this._data.fontSize+d;a.restore()};
NoteRenderer.prototype.hitTest=function(a){if(this.W99.hasPoint(a))return new HitTestResult(HitTestResult.MOVEPOINT)};function NotePaneView(a,b){$90.call(this,a,b);this._rendererSource=new NoteRendererSource}inherit(NotePaneView,$90);
NotePaneView.prototype.renderer=function(){var a=new CompositeRenderer,b=this.W99.properties(),c=b.locked&&b.locked.value()?this.W99.fixedPoints():this._points;if(1>c.size())return a;var d=this.isAnchorsRequired(),b=$.extend(b.state(),{point:c.item(0),width:24,height:32,tooltipVisible:d,vpWidth:this.D0.m_timeScale.m_width,vpHeight:this.W99.m_priceScale.m_height});this._rendererSource.update(b);a.append(new NoteRenderer(this._rendererSource,b));d&&a.append(new SelectionRenderer({points:c}));
return a};TradingView.LineToolNote=function(a,b){this._constructor="LineToolNote";var c=b?b:new $52("linetoolnote");W47.call(this,a,new NotePaneView(this,a),c);this.version=TradingView.LineToolNote.version};inherit(TradingView.LineToolNote,W47);TradingView.LineToolNote.TOOLTIP_WIDTH=300;TradingView.LineToolNote.TOOLTIP_PADDING=10;TradingView.LineToolNote.TOOLTIP_LINESPACING=5;TradingView.LineToolNote.version=1;TradingView.LineToolNote.prototype.pointsCount=function(){return 1};
TradingView.LineToolNote.prototype.title=function(){return $.t("Note")};TradingView.LineToolNote.prototype.restoreTemplate=function(a){delete a.locked;delete a.text;W47.prototype.restoreTemplate.call(this,a)};TradingView.LineToolNoteAbsolute=function(a,b){var c=b?b:new $52("linetoolnoteabsolute");c.locked.value()||c.locked.setValue(!0);TradingView.LineToolNote.call(this,a,c)};inherit(TradingView.LineToolNoteAbsolute,TradingView.LineToolNote);
TradingView.LineToolNoteAbsolute.prototype.title=function(){return $.t("Anchored Note")};TradingView.LineToolNote.prototype.state=function(a){var b=W47.prototype.state.call(this,a);a&&(b.state.fixedSize=!1);return b};function PriceLabelRenderer(a,b,c){this._data=a;this._measureCache=b;this._chartModel=c}
PriceLabelRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){a.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var b=a.measureText(this._data.label);b.height=this._data.fontSize;var c=b.width+20,b=b.height+10,d=this._data.points.item(0).x- -9,e=this._data.points.item(0).y-(b+15);this._measureCache&&$.extend(this._measureCache,{innerWidth:c,innerHeight:b,tailLeft:-9,tailHeight:15});a.translate(.5+d,.5+e);a.beginPath();a.moveTo(12,b);a.lineTo(-9,
b+15);a.lineTo(-10,b+15-1);a.lineTo(5,b);a.lineTo(3,b);a.arcTo(0,b,0,0,3);a.lineTo(0,3);a.arcTo(0,0,c,0,3);a.lineTo(c-3,0);a.arcTo(c,0,c,b,3);a.lineTo(c,b-3);a.arcTo(c,b,0,b,3);a.lineTo(12,b);a.fillStyle=generateColor(this._data.backgroundColor,this._data.transparency);a.fill();a.strokeStyle=this._data.borderColor;a.lineWidth=2;a.stroke();a.closePath();a.textBaseline="top";a.fillStyle=this._data.color;a.fillText(this._data.label,10,4);a.translate(-.5,-.5);a.beginPath();a.arc(-9,b+15,2.5,0,2*Math.PI,
!1);a.fillStyle=generateColor(this._data.borderColor,this._data.transparency);a.fill();a.strokeStyle=this._chartModel.backgroundColor();a.lineWidth=1;a.stroke();a.closePath()}};
PriceLabelRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._data.points.item(0).x-this._measureCache.tailLeft,c=this._data.points.item(0).y-(this._measureCache.innerHeight+this._measureCache.tailHeight);return MathEx.pointInRect(a,new MathEx.Point(b,c),new MathEx.Point(b+this._measureCache.innerWidth,c+this._measureCache.innerHeight))?new HitTestResult(HitTestResult.MOVEPOINT):null};
function W5(a,b,c){$90.call(this,a,b);this._image=TradingView.getImage("price_label",TradingView.wrapUrl("/static/images/price_label.png"));this._rendererCache={}}inherit(W5,$90);
W5.prototype.update=function(){$90.prototype.update.call(this);if(0<this.W99.points().size()){var a=this.W99.points().item(0).price,b=this.W99.priceScale();if(b&&!b.isEmpty()){if(b.isPercent())var c=this.W99.ownerSource().firstValue(),a=b.priceRange().convertToPercent(a,c);this._priceLabel=b.formatter().format(a)}}};
W5.prototype.renderer=function(){var a={};a.points=this._points;a.borderColor=this.W99.properties().borderColor.value();a.backgroundColor=this.W99.properties().backgroundColor.value();a.color=this.W99.properties().color.value();a.fontWeight=this.W99.properties().fontWeight.value();a.fontSize=this.W99.properties().fontsize.value();a.fontFamily=this.W99.properties().font.value();a.transparency=this.W99.properties().transparency.value();a.label=this._priceLabel;
a.image=this._image;if(this.isAnchorsRequired()&&1==a.points.size()){var b=new CompositeRenderer;b.append(new PriceLabelRenderer(a,this._rendererCache,this.D0));b.append(new SelectionRenderer({points:a.points}));return b}return new PriceLabelRenderer(a,this._rendererCache,this.D0)};TradingView.LineToolPriceLabel=function(a,b){this._constructor="LineToolPriceLabel";var c=b||new $52("linetoolpricelabel");W47.call(this,a,new W5(this,a),c)};
inherit(TradingView.LineToolPriceLabel,W47);TradingView.LineToolPriceLabel.prototype.pointsCount=function(){return 1};TradingView.LineToolPriceLabel.prototype.title=function(){return"Price Label"};function PredictionRenderer(a){this._data=a;this._targetFontSize2=this._targetFontSize1=11;this._targetFontSize3=14;this._font="Arial";this._sourceFontSize1=12;this._sourceFontSize2=10}
PredictionRenderer.prototype.drawBalloon=function(a,b,c,d,e,g){g=g||20;a.beginPath();if("down"===e)return b=new MathEx.Point(b.x-g,b.y-6-5-d),a.moveTo(b.x+3,b.y),a.lineTo(b.x+c-3,b.y),a.arcTo(b.x+c,b.y,b.x+c,b.y+3,3),a.lineTo(b.x+c,b.y+d-3),a.arcTo(b.x+c,b.y+d,b.x+c-3,b.y+d,3),a.lineTo(b.x+g+5,b.y+d),a.lineTo(b.x+g,b.y+d+5),a.lineTo(b.x+g-5,b.y+d),a.lineTo(b.x+3,b.y+d),a.arcTo(b.x,b.y+d,b.x,b.y+d-3,3),a.lineTo(b.x,b.y+3),a.arcTo(b.x,b.y,b.x+3,b.y,3),b;b=new MathEx.Point(b.x-g,b.y+6+5+d);a.moveTo(b.x+
3,b.y);a.lineTo(b.x+c-3,b.y);a.arcTo(b.x+c,b.y,b.x+c,b.y-3,3);a.lineTo(b.x+c,b.y-d+3);a.arcTo(b.x+c,b.y-d,b.x+c-3,b.y-d,3);a.lineTo(b.x+g+5,b.y-d);a.lineTo(b.x+g,b.y-d-5);a.lineTo(b.x+g-5,b.y-d);a.lineTo(b.x+3,b.y-d);a.arcTo(b.x,b.y-d,b.x,b.y-d+3,3);a.lineTo(b.x,b.y-3);a.arcTo(b.x,b.y,b.x+3,b.y,3);return new MathEx.Point(b.x,b.y-d)};
PredictionRenderer.prototype.drawTargetLabel=function(a){var b=this._data.points.item(1);a.save();a.translate(.5,.5);a.font="normal "+this._targetFontSize3+"px "+this._font;var c=1.5*this._targetFontSize1+1.5*this._targetFontSize2+3,d=a.measureText(this._data.targetLine1).width,e=a.measureText(this._data.targetLine2).width;a.font="normal "+this._targetFontSize2+"px "+this._font;var g=a.measureText(this._data.targetLine3).width,h=a.measureText(this._data.targetLine4).width,e=Math.max(d+e,g+h+10)+20,
h="up"===this._data.direction?"down":"up",k=b.x+e-a.canvas.width+5,k=Math.max(20,Math.min(e-15,k)),h=this.drawBalloon(a,b,e,c,h,k);a.save();a.fillStyle=generateColor(this._data.targetBackColor,this._data.transparency);a.fill();a.restore();a.save();a.lineWidth=2;a.strokeStyle=generateColor(this._data.targetStrokeColor,this._data.transparency);a.stroke();a.restore();a.beginPath();a.arc(b.x,b.y,3,0,2*Math.PI,!1);a.fillStyle=this._data.centersColor;a.fill();a.textAlign="left";a.fillStyle=this._data.targetTextColor;
a.font="normal "+this._targetFontSize3+"px "+this._font;a.fillText(this._data.targetLine1,h.x+6,h.y+this._targetFontSize1+4);a.fillText(this._data.targetLine2,h.x+6+d+5,h.y+this._targetFontSize1+4);a.font="normal "+this._targetFontSize2+"px "+this._font;b=h.y+this._targetFontSize1+8+this._targetFontSize2;a.fillText(this._data.targetLine3,h.x+6,b);a.drawImage(this._data.clockWhite,h.x+6+g+6,b-this._targetFontSize2+3);a.fillText(this._data.targetLine4,h.x+6+g+13+5,b);if(this._data.status){g=this._targetFontSize1+
4;a.font="bold "+this._targetFontSize1+"px "+this._font;var l,m,n,q;switch(this._data.status){case TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS:l=$.t("SUCCESS");m=generateColor(this._data.successBackground,this._data.transparency);n=this._data.successTextColor;q=this._data.successIcon;break;case TradingView.LineToolPrediction.ALERT_STATUS_FAILURE:l=$.t("FAILURE"),m=generateColor(this._data.failureBackground,this._data.transparency),n=this._data.failureTextColor,q=this._data.failureIcon}b=a.measureText(l).width;
b=Math.round((e-b)/2);a.fillStyle=m;"up"===this._data.direction?(a.roundRect(h.x-1,h.y-g-2,e+2,g,5),a.fill(),a.fillStyle=n,a.fillText(l,h.x+b,h.y-5),a.drawImage(q,h.x+b-13,h.y-14)):(a.roundRect(h.x-1,h.y+c+3,e+2,g,5),a.fill(),a.fillStyle=n,a.fillText(l,h.x+b,h.y+c+g-1),a.drawImage(q,h.x+b-13,h.y+c+5))}a.restore()};
PredictionRenderer.prototype.drawStartLabel=function(a){a.save();a.translate(.5,.5);a.font="normal "+this._sourceFontSize1+"px "+this._font;var b=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,c=a.measureText(this._data.sourceLine1).width;a.font="normal "+this._fontsize2+"px "+this._font;var d=a.measureText(this._data.sourceLine2).width,d=Math.max(c,d)-5,c=this._data.points.item(0),b=this.drawBalloon(a,c,d,b,this._data.direction);a.fillStyle=generateColor(this._data.sourceBackColor,this._data.transparency);
a.fill();a.lineWidth=2;a.strokeStyle=generateColor(this._data.sourceStrokeColor,this._data.transparency);a.stroke();a.beginPath();a.arc(c.x,c.y,3,0,2*Math.PI,!1);a.fillStyle=this._data.centersColor;a.fill();a.textAlign="left";a.fillStyle=this._data.sourceTextColor;a.font="normal "+this._sourceFontSize1+"px "+this._font;a.fillText(this._data.sourceLine1,b.x+3,b.y+this._sourceFontSize1+2);a.font="normal "+this._sourceFontSize2+"px "+this._font;a.fillText(this._data.sourceLine2,b.x+3,b.y+this._sourceFontSize1+
4+this._sourceFontSize2);a.restore()};
PredictionRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1);new MathEx.Point(b.y,c.x);var d=c.substract(b);1>Math.abs(d.x)||1>Math.abs(d.y)?(a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y)):(a.save(),a.beginPath(),a.translate(b.x,b.y),a.scale(1,d.y/d.x),a.moveTo(0,0),a.arcTo(d.x,0,d.x,d.x,Math.abs(d.x)),
a.lineTo(d.x,d.x),a.restore());a.stroke();this.drawTargetLabel(a);this.drawStartLabel(a);b=Math.max(8,4*this._data.linewidth);a.fillStyle=this._data.color;var e=0>d.y?1:-1;if(1>Math.abs(d.x)||1>Math.abs(d.y))var g=Math.atan(d.x/d.y);else{var h=Math.abs(d.x),k=Math.abs(d.y);Math.sqrt((3*h+k)*(3*k+h));var l=0,m=Math.PI/2,n=(l+m)/2;if(d.length()>b)for(;;){var g=h*Math.sin(n),q=k*(1-Math.cos(n)),r=Math.sqrt((g-h)*(g-h)+(q-k)*(q-k));if(1>Math.abs(r-b))break;r>b?l=n:m=n;n=(l+m)/2}g=Math.atan((h-g)/(k-q));
0>d.x*d.y&&(g=-g)}a.save();a.beginPath();a.translate(c.x,c.y);a.rotate(-g);a.moveTo(0,0);a.lineTo(-b/2,e*b);a.lineTo(b/2,e*b);a.lineTo(0,0);a.restore();a.fill()}};
PredictionRenderer.prototype.targetLabelHitTest=function(a){var b=this._data.points.item(1),c=1.5*this._targetFontSize1+1.5*this._targetFontSize2,d=this._targetFontSize1*this._data.targetLine1.length,e=this._targetFontSize1*this._data.targetLine2.length,g=this._targetFontSize2*this._data.targetLine3.length,h=this._targetFontSize2*this._data.targetLine4.length;this._data.status&&(c+=1.5*this._targetFontSize1);d=Math.max(d+e,g+h)-20;h="up"===this._data.direction?-1:1;e=b.x-20;g=b.y+5*h;c=b.y+(5+c)*
h;b=Math.min(g,c);c=Math.max(g,c);return a.x>=e&&a.x<=e+d&&a.y>=b&&a.y<=c?new HitTestResult(HitTestResult.MOVEPOINT):null};
PredictionRenderer.prototype.sourceLabelHitTest=function(a){var b=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,c=Math.max(this._sourceFontSize1*this._data.sourceLine1.length,this._sourceFontSize2*this._data.sourceLine2.length),d=this._data.points.item(0),e="up"===this._data.direction?1:-1,g=d.x-20,h=d.y+5*e,d=d.y+(5+b)*e,b=Math.min(h,d),h=Math.max(h,d);return a.x>=g&&a.x<=g+c&&a.y>=b&&a.y<=h?new HitTestResult(HitTestResult.MOVEPOINT):null};
PredictionRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=c.substract(b);new MathEx.Point(b.y,c.x);var d=c.substract(b),b=a.substract(b),c=Math.abs(d.x),e=Math.abs(d.y),d=MathEx.sign(d.y)*(e-e*Math.sqrt(1-b.x*b.x/(c*c)));return 3>Math.abs(d-b.y)?new HitTestResult(HitTestResult.MOVEPOINT):(d=this.targetLabelHitTest(a))?d:this.sourceLabelHitTest(a)};
function W4(a,b){$90.call(this,a,b);this._clockWhite=TradingView.getImage("prediction-clock-white",TradingView.wrapUrl("/static/images/prediction-clock-white.png"));this._clockBlack=TradingView.getImage("prediction-clock-black",TradingView.wrapUrl("/static/images/prediction-clock-black.png"));this._successIcon=TradingView.getImage("prediction-success-white",TradingView.wrapUrl("/static/images/prediction-success-white.png"));this._failureIcon=TradingView.getImage("prediction-failure-white",
TradingView.wrapUrl("/static/images/prediction-failure-white.png"))}inherit(W4,$90);
W4.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().linecolor.value();a.linewidth=this.W99.properties().linewidth.value();a.targetLine1=this._targetLine1;a.targetLine2=this._targetLine2;a.targetLine3=this._targetLine3;a.targetLine4=this._targetLine4;a.status=this.W99.properties().status.value();a.transparency=this.W99.properties().transparency.value();a.targetBackColor=this.W99.properties().targetBackColor.value();a.targetStrokeColor=
this.W99.properties().targetStrokeColor.value();a.targetTextColor=this.W99.properties().targetTextColor.value();a.sourceBackColor=this.W99.properties().sourceBackColor.value();a.sourceStrokeColor=this.W99.properties().sourceStrokeColor.value();a.sourceTextColor=this.W99.properties().sourceTextColor.value();a.successBackground=this.W99.properties().successBackground.value();a.successTextColor=this.W99.properties().successTextColor.value();a.failureBackground=this.W99.properties().failureBackground.value();
a.failureTextColor=this.W99.properties().failureTextColor.value();a.intermediateBackColor=this.W99.properties().intermediateBackColor.value();a.intermediateTextColor=this.W99.properties().intermediateTextColor.value();a.sourceLine1=this._sourceLine1;a.sourceLine2=this._sourceLine2;a.direction=this._direction;a.clockWhite=this._clockWhite;a.clockBlack=this._clockBlack;a.successIcon=this._successIcon;a.failureIcon=this._failureIcon;a.finished=this._finished;a.centersColor=(new RGBColor(this.D0.D2.paneProperties.background._value)).blackWhiteContrast();
if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new PredictionRenderer(a));a=a.points.clone();this.D0.lineBeingCreated()==this.W99&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new PredictionRenderer(a)};
W4.prototype.update=function(){$90.prototype.update.call(this);this._targetLine4=this._targetLine3=this._targetLine2=this._targetLine1="";if(!(2>this.W99.points().size())&&this.W99.priceScale()){var a=this.W99.points().item(1),b=this.W99.points().item(0);this._targetLine3=this.W99.priceScale().formatter().format(a.price);var c=a.price-b.price,d=0>c?"-":"+";this._targetLine1=this.W99.priceScale().formatter().format(Math.abs(c));c=Math.abs((Math.round(c/
b.price*1E4)/100).toPrecision(3));this._targetLine1=d+this._targetLine1+" ("+d+c+"%)";d=this.D0.timeScale().indexToUserTime(b.index);c=this.D0.timeScale().indexToUserTime(a.index);b.time&&a.time&&(d=isString(b.time)?new Date(Date.parse(b.time)):b.time,c=isString(a.time)?new Date(Date.parse(a.time)):a.time);c&&d&&(this._targetLine4=(new DateFormatter).format(c),this.D0.mainSeries().isDWM()||(this._targetLine4=this._targetLine4+" "+(new TimeFormatter("%h:%m")).format(c)),a=(c.valueOf()-
d.valueOf())/1E3,this._targetLine2=$.t("in",{context:"dates"})+" "+(new TimeSpanFormatter).format(a));this._sourceLine1=this.W99.priceScale().formatter().format(b.price);this._sourceLine2="";if(b=this.D0.timeScale().indexToUserTime(b.index))this._sourceLine2=(new DateFormatter).format(b),this.D0.mainSeries().isDWM()||(this._sourceLine2=this._sourceLine2+" "+(new TimeFormatter("%h:%m")).format(b));this._direction=this.W99.direction()===TradingView.LineToolPrediction.DIRECTION_UP?"up":
"down";this._finished=this.D0.lineBeingCreated()!==this.W99&&this.D0.lineBeingEdited()!==this.W99&&this.D0.sourceBeingMoved()!==this.W99}};TradingView.LineToolPrediction=function(a,b){this._constructor="LineToolPrediction";var c=b?b:new $52("linetoolprediction");c.merge({status:TradingView.LineToolPrediction.ALERT_STATUS_WAITING});W47.call(this,a,new W4(this,a),c)};TradingView.LineToolPrediction.ALERT_STATUS_WAITING=0;
TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS=1;TradingView.LineToolPrediction.ALERT_STATUS_FAILURE=2;TradingView.LineToolPrediction.DIRECTION_UP=1;TradingView.LineToolPrediction.DIRECTION_DOWN=2;inherit(TradingView.LineToolPrediction,W47);TradingView.LineToolPrediction.prototype.status=function(){return this.D2.status.value()};TradingView.LineToolPrediction.prototype.setStatus=function(a){return this.D2.status.setValue(a)};
TradingView.LineToolPrediction.prototype.pointsCount=function(){return 2};TradingView.LineToolPrediction.prototype.title=function(){return"Forecast"};TradingView.LineToolPrediction.prototype.restorePoints=function(a,b,c){W47.prototype.restorePoints.call(this,a,b,c);this.checkAlert()};
TradingView.LineToolPrediction.prototype.checkAlert=function(){if(!(2>this._points.size()||this.D0.mainSeries().bars().isEmpty())){var a=this._points.item(1);if(this.status())a.index>this.D0.timeScale().points().lastTimePointIndex()&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);else if(this.D0.mainSeries().bars().last(),this.D0.timeScale().indexToTimePoint(a.index)){var b=this.D0.mainSeries().bars().valueAt(a.index),c=this.direction();c===TradingView.LineToolPrediction.DIRECTION_UP&&
b[HIGH_PLOT]>=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):c===TradingView.LineToolPrediction.DIRECTION_DOWN&&b[LOW_PLOT]<=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):(a=this.D0.mainSeries().bars().last().value,b[TIME_PLOT]!==a[TIME_PLOT]&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_FAILURE))}}};
TradingView.LineToolPrediction.prototype.addPoint=function(a){(a=W47.prototype.addPoint.call(this,a))&&this.checkAlert();return a};TradingView.LineToolPrediction.prototype.endChanging=function(){W47.prototype.endChanging.call(this);this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);this.checkAlert()};TradingView.LineToolPrediction.prototype.onData=function(a){W47.prototype.onData.call(this,a);this.checkAlert()};
TradingView.LineToolPrediction.prototype.endMoving=function(){W47.prototype.endMoving.call(this);this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);this.checkAlert()};TradingView.LineToolPrediction.prototype.direction=function(){if(2>this.points().size())return TradingView.LineToolPrediction.DIRECTION_UP;var a=this.points().item(0);return this.points().item(1).price>a.price?TradingView.LineToolPrediction.DIRECTION_UP:TradingView.LineToolPrediction.DIRECTION_DOWN};function W3(a,b){$90.call(this,a,b)}inherit(W3,$90);
W3.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().linecolor.value();a.linewidth=this.W99.properties().linewidth.value();a.linestyle=this.W99.properties().linestyle.value();a.filled=this.W99.properties().filled.value();a.backcolor=this.W99.properties().backgroundColor.value();a.fillBackground=this.W99.properties().fillBackground.value();a.transparency=this.W99.properties().transparency.value();if(this.isAnchorsRequired()){var b=
new CompositeRenderer;b.append(new PoligonRenderer(a));a=a.points.clone();this.D0.lineBeingCreated()==this.W99&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new PoligonRenderer(a)};TradingView.LineToolPolyline=function(a,b){this._constructor="LineToolPolyline";var c;b?c=b:(c=new $52("linetoolpolyline"),c.filled.setValue(!1));W47.call(this,a,new W3(this,a),c)};inherit(TradingView.LineToolPolyline,W47);
TradingView.LineToolPolyline.prototype.pointsCount=function(){return-1};TradingView.LineToolPolyline.prototype.title=function(){return"Polyline"};
TradingView.LineToolPolyline.prototype.addPoint=function(a){var b=this.D0.timeScale().indexToCoordinate(a.index),c=a.price,d=null;this.priceScale().isPercent()&&(d=this.ownerSource().firstValue());c=this.priceScale().priceToCoordinate(c);if(0<this._points.size()){var e=this._points.item(this._points.size()-1),g=this.D0.timeScale().indexToCoordinate(e.index),e=e.price;this.priceScale().isPercent()&&(e=this.priceScale().priceRange().convertToPercent(e,d));e=this.priceScale().priceToCoordinate(e);
if(5>(new MathEx.Point(b,c)).substract(new MathEx.Point(g,e)).length())return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;e=this._points.item(0);g=this.D0.timeScale().indexToCoordinate(e.index);e=e.price;this.priceScale().isPercent()&&(e=this.priceScale().priceRange().convertToPercent(e,d));d=this.priceScale().priceToCoordinate(e);if(5>(new MathEx.Point(b,c)).substract(new MathEx.Point(g,d)).length())return this.D2.filled.setValue(!0),this._lastPoint=null,
this.normalizePoints(),this.createServerPoints(),!0}return W47.prototype.addPoint.call(this,a)};
TradingView.LineToolPolyline.prototype.setPoint=function(a,b){W47.prototype.setPoint.call(this,a,b);if(!(this.D0.timeScale().isEmpty()||this.priceScale().isEmpty()||a!==this._points.size()-1&&0!==a)){var c=this.D0.timeScale().indexToCoordinate(b.index),d=this.priceScale().priceToCoordinate(b.price),e=this._points.item(0),g=this.D0.timeScale().indexToCoordinate(e.index),e=this.priceScale().priceToCoordinate(e.price);5>(new MathEx.Point(c,d)).substract(new MathEx.Point(g,e)).length()&&
this.D2.filled.setValue(!0)}};function $82(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($82,$90);
$82.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return console.log("$82:1 point"),this.addAnchors(a),a;for(var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x),e=Math.min(b.y,c.y),g=Math.max(b.x,c.x),h=Math.max(b.y,c.y),k=this.W99.properties(),l=this.W99.properties().fillHorzBackground.value(),m=this.W99.properties().horzTransparency.value(),n=this.W99.properties().fillVertBackground.value(),q=this.W99.properties().vertTransparency.value(),
r=0;r<this._hlevels.length;r++){if(0<r&&l){var u=this._hlevels[r-1],b=new MathEx.Point(d,this._hlevels[r].y),c=new MathEx.Point(g,u.y),u={nohittest:!0};u.points=(new List).append(b).append(c);u.color=this._hlevels[r].color;u.linewidth=0;u.backcolor=this._hlevels[r].color;u.fillBackground=!0;u.transparency=m;a.append(new RectangleRenderer(u))}b=new MathEx.Point(d,this._hlevels[r].y);c=new MathEx.Point(g,this._hlevels[r].y);u={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),
height:this.W99.priceScale().height(),color:this._hlevels[r].color,linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(u));k.showLeftLabels.value()&&(b={points:(new List).append(b),text:""+this._hlevels[r].coeff,color:this._hlevels[r].color,vertAlign:"middle",horzAlign:"right",font:k.font.value(),offsetX:-5,offsetY:0,fontsize:12},a.append(new TextRenderer(b,
this._rendererCache)));k.showRightLabels.value()&&(c={points:(new List).append(c),text:""+this._hlevels[r].coeff,color:this._hlevels[r].color,vertAlign:"middle",horzAlign:"left",font:k.font.value(),offsetX:5,offsetY:0,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)))}for(r=0;r<this._vlevels.length;r++)b=new MathEx.Point(this._vlevels[r].x,e),c=new MathEx.Point(this._vlevels[r].x,h),0<r&&n&&(u=this._vlevels[r-1],d=new MathEx.Point(u.x,e),u={nohittest:!0},u.points=(new List).append(d).append(c),
u.color=this._vlevels[r].color,u.linewidth=0,u.backcolor=this._vlevels[r].color,u.fillBackground=!0,u.transparency=q,a.append(new RectangleRenderer(u))),u={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this._vlevels[r].color,linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(u)),
k.showTopLabels.value()&&(d={points:(new List).append(b),text:""+this._vlevels[r].coeff,color:this._vlevels[r].color,vertAlign:"bottom",horzAlign:"center",font:k.font.value(),offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(d,this._rendererCache))),k.showBottomLabels.value()&&(c={points:(new List).append(c),text:""+this._vlevels[r].coeff,color:this._vlevels[r].color,vertAlign:"top",horzAlign:"center",font:k.font.value(),offsetX:0,offsetY:5,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)));
this.addAnchors(a);return a};
$82.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0),b=this.W99.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.W99.priceScale().isPercent()&&(d=this.W99.ownerSource().firstValue());for(var e=1;7>=e;e++){var g="hlevel"+e,h=this.W99.properties()[g];if(h.visible.value()){var g=
h.coeff.value(),h=h.color.value(),k=a.price+g*c;this.W99.priceScale().isPercent()&&(k=this.W99.priceScale().priceRange().convertToPercent(k,d));k=this.W99.priceScale().priceToCoordinate(k);this._hlevels.push({coeff:g,color:h,y:k})}}this._vlevels=[];b=b.index-a.index;for(e=1;7>=e;e++)g="vlevel"+e,h=this.W99.properties()[g],h.visible.value()&&(g=h.coeff.value(),h=h.color.value(),c=Math.round(a.index+g*b),c=this.D0.timeScale().indexToCoordinate(c),this._vlevels.push({coeff:g,color:h,
x:c}))}};TradingView.LineToolGannSquare=function(a,b){this._constructor="LineToolGannSquare";var c=b?b:new $52("linetoolgannsquare");W47.call(this,a,new $82(this,a),c)};inherit(TradingView.LineToolGannSquare,W47);TradingView.LineToolGannSquare.prototype.pointsCount=function(){return 2};TradingView.LineToolGannSquare.prototype.title=function(){return"Gann Box"};function $81(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($81,$90);
$81.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1);this._fans=[];for(var c=b.x-a.x,d=b.y-a.y,e=1;9>=e;e++){var g="level"+e,g=this.W99.properties()[g];if(g.visible.value()){var h=g.coeff1.value(),k=g.coeff2.value(),l=h/k,m=g.color.value(),n=""+h+"/"+k;h>k?(h=b.x,l=a.y+d/
l):(h=a.x+c*l,l=b.y);this._fans.push({label:n,color:m,x:h,y:l,index:e,linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),index:e})}}}};
$81.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.W99.properties(),d=this.W99.properties().fillBackground.value(),e=this.W99.properties().transparency.value(),g=0;g<this._fans.length;g++){var h=new MathEx.Point(this._fans[g].x,this._fans[g].y);if(d)if(4>this._fans[g].index){var k=new MathEx.Point(this._fans[g+1].x,this._fans[g+1].y),l={};l.width=this.D0.timeScale().width();
l.p1=b;l.p2=h;l.p3=b;l.p4=k;l.color=this._fans[g].color;l.transparency=e;l.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(l))}else 4<this._fans[g].index&&0<g&&(k=new MathEx.Point(this._fans[g-1].x,this._fans[g-1].y),l={},l.width=this.D0.timeScale().width(),l.p1=b,l.p2=h,l.p3=b,l.p4=k,l.color=this._fans[g].color,l.transparency=e,l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l)));k={points:(new List).append(b).append(h),width:this.D0.timeScale().width(),
height:this.W99.priceScale().height(),color:this._fans[g].color,linewidth:this._fans[g].linewidth,linestyle:this._fans[g].linestyle,extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};l=new HitTestResult(HitTestResult.MOVEPOINT,null,this._fans[g].index);a.append(new TrendLineRenderer(k,l));c.showLabels.value()&&(h={points:(new List).append(h),text:this._fans[g].label,color:this._fans[g].color,vertAlign:"middle",horzAlign:"left",font:c.font.value(),
offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(h,this._rendererCache)))}this.isAnchorsRequired()&&(b=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolGannFan=function(a,b){this._constructor="LineToolGannFan";var c=b?b:new $52("linetoolgannfan");W47.call(this,a,new $81(this,a),c)};inherit(TradingView.LineToolGannFan,W47);
TradingView.LineToolGannFan.prototype.pointsCount=function(){return 2};TradingView.LineToolGannFan.prototype.title=function(){return"Gann Fan"};TradingView.LineToolGannFan.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function $72(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($72,$90);
$72.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0),b=this.W99.points().item(1),c=!1,d=this.W99.properties();d.reverse&&d.reverse.value()&&(c=d.reverse.value());this._levels=[];var e=c?b.price-a.price:a.price-b.price,a=c?a.price:b.price,g;if(this.W99.priceScale().isPercent()&&
(g=this.W99.ownerSource().firstValue(),null===g))return;for(b=1;11>=b;b++)if(c=d["level"+b],c.visible.value()){var h=c.coeff.value(),k=c.color.value(),l=a+h*e;this.W99.priceScale().isPercent()&&(l=this.W99.priceScale().priceRange().convertToPercent(l,g));var m=this.W99.priceScale().priceToCoordinate(l),n,q=function(a){return d.coeffsAsPercents.value()?""+Math.round(1E4*a)/100+"%":""+a};d.showCoeffs.value()&&d.showPrices.value()?n=""+q(h)+"("+this.W99.priceScale().formatter().format(l)+
")":d.showCoeffs.value()?n=""+q(h):d.showPrices.value()&&(n=""+this.W99.priceScale().formatter().format(l));this._levels.push({coeff:h,color:k,y:m,label:n,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:b})}}};
$72.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x);Math.min(b.y,c.y);var e=Math.max(b.x,c.x);Math.max(b.y,c.y);for(var g=this.W99.properties(),h=g.fillBackground.value(),k=g.transparency.value(),l=g.extendLines.value()?this.D0.timeScale().width():e,m=0;m<this._levels.length;m++){if(0<m&&h){var c=this._levels[m-1],b=new MathEx.Point(d,this._levels[m].y),c=new MathEx.Point(l,
c.y),n={};n.nohittest=!TradingView.isMobile.any();n.points=(new List).append(b).append(c);n.color=this._levels[m].color;n.linewidth=0;n.backcolor=this._levels[m].color;n.fillBackground=!0;n.transparency=k;a.append(new RectangleRenderer(n))}var b=new MathEx.Point(d,this._levels[m].y),c=new MathEx.Point(e,this._levels[m].y),n={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this._levels[m].color,linewidth:this._levels[m].linewidth,
linestyle:this._levels[m].linestyle,extendleft:!1,extendright:g.extendLines.value(),leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},q=new HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[m].index);a.append(new TrendLineRenderer(n,q));if(g.showCoeffs.value()||g.showPrices.value()){var r,u,n=g.vertLabelsAlign.value();switch(g.horzLabelsAlign.value()){case "left":r=b;u="right";break;case "center":r=b.add(c).scaled(.5);u="center";break;case "right":g.extendLines.value()?
(r=new MathEx.Point(l-4,this._levels[m].y),u="right"):(r=new MathEx.Point(l+4,this._levels[m].y),u="left")}b={points:(new List).append(r),text:this._levels[m].label,color:this._levels[m].color,vertAlign:n,horzAlign:u,font:g.font.value(),offsetX:-5,offsetY:"top"==n?0:-5,fontsize:12};a.append(new TextRenderer(b,this._rendererCache))}}g.trendline.visible.value()&&(n={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:g.trendline.color.value(),linewidth:g.trendline.linewidth.value(),linestyle:g.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(n)));this.isAnchorsRequired()&&(d=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&d.removeAt(d.size()-1),a.append(this.createLineAnchor({points:d})));return a};
TradingView.LineToolFibRetracement=function(a,b){this._constructor="LineToolFibRetracement";var c=b?b:new $52("linetoolfibretracement");W47.call(this,a,new $72(this,a),c);this.version=TradingView.LineToolFibRetracement.version};inherit(TradingView.LineToolFibRetracement,W47);TradingView.LineToolFibRetracement.version=2;TradingView.LineToolFibRetracement.prototype.pointsCount=function(){return 2};
TradingView.LineToolFibRetracement.prototype.title=function(){return"Fib Retracement"};TradingView.LineToolFibRetracement.prototype.migrateVersion=function(a,b,c){1==a&&this.properties().extendLines.setValue(!0)};TradingView.LineToolFibRetracement.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function W41(a,b){$90.call(this,a,b);this._rendererCache={}}inherit(W41,$90);
W41.prototype.update=function(){$90.prototype.update.call(this);if(!(3>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0),b=this.W99.points().item(1),c=this.W99.points().item(2),d=!1,e=this.W99.properties();e.reverse&&e.reverse.value()&&(d=e.reverse.value());this._levels=[];var a=d?a.price-b.price:b.price-a.price,g;this.W99.priceScale().isPercent()&&
(g=this.W99.ownerSource().firstValue());for(b=1;11>=b;b++)if(d=e["level"+b],d.visible.value()){var h=d.coeff.value(),k=d.color.value(),l=c.price+h*a;this.W99.priceScale().isPercent()&&(l=this.W99.priceScale().priceRange().convertToPercent(l,g));var m=function(a){return e.coeffsAsPercents.value()?""+Math.round(1E4*a)/100+"%":""+a},n=this.W99.priceScale().priceToCoordinate(l),q;e.showCoeffs.value()&&e.showPrices.value()?q=""+m(h)+"("+this.W99.priceScale().formatter().format(l)+")":
e.showCoeffs.value()?q=""+m(h):e.showPrices.value()&&(q=""+this.W99.priceScale().formatter().format(l));this._levels.push({coeff:h,color:k,y:n,label:q,linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),index:b})}}};
W41.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.W99.properties(),e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(e));if(3>this._points.size())return this.addAnchors(a),a;var g=this._points.item(2),e={points:(new List).append(c).append(g),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(e));
var h=Math.min(g.x,c.x);Math.min(b.y,c.y);g=Math.max(g.x,c.x);Math.max(b.y,c.y);for(var k=d.fillBackground.value(),l=d.transparency.value(),m=d.extendLines.value()?this.D0.timeScale().width():g,n=0;n<this._levels.length;n++){0<n&&k&&(c=this._levels[n-1],b=new MathEx.Point(h,this._levels[n].y),c=new MathEx.Point(m,c.y),e={},e.nohittest=!TradingView.isMobile.any(),e.points=(new List).append(b).append(c),e.color=this._levels[n].color,e.linewidth=0,e.backcolor=this._levels[n].color,e.fillBackground=
!0,e.transparency=l,a.append(new RectangleRenderer(e)));var b=new MathEx.Point(h,this._levels[n].y),c=new MathEx.Point(g,this._levels[n].y),e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this._levels[n].color,linewidth:this._levels[n].linewidth,linestyle:this._levels[n].linestyle,extendleft:!1,extendright:d.extendLines.value(),leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},q=new HitTestResult(HitTestResult.MOVEPOINT,
null,this._levels[n].index);a.append(new TrendLineRenderer(e,q));if(d.showCoeffs.value()||d.showPrices.value()){var r,u,e=d.vertLabelsAlign.value();switch(d.horzLabelsAlign.value()){case "left":r=b;u="right";break;case "center":r=b.add(c).scaled(.5);u="center";break;case "right":d.extendLines.value()?(r=new MathEx.Point(m-4,this._levels[n].y),u="right"):(r=new MathEx.Point(m+4,this._levels[n].y),u="left")}b={points:(new List).append(r),text:this._levels[n].label,color:this._levels[n].color,vertAlign:e,
horzAlign:u,font:d.font.value(),offsetX:-5,offsetY:"top"==e?0:-5,fontsize:12};a.append(new TextRenderer(b,this._rendererCache))}}this.addAnchors(a);return a};TradingView.LineToolTrendBasedFibExtension=function(a,b){this._constructor="LineToolTrendBasedFibExtension";var c=b?b:new $52("linetooltrendbasedfibextension");W47.call(this,a,new W41(this,a),c);this.version=TradingView.LineToolTrendBasedFibExtension.version};
inherit(TradingView.LineToolTrendBasedFibExtension,W47);TradingView.LineToolTrendBasedFibExtension.version=2;TradingView.LineToolTrendBasedFibExtension.prototype.pointsCount=function(){return 3};TradingView.LineToolTrendBasedFibExtension.prototype.title=function(){return"Trend-Based Fib Extension"};TradingView.LineToolTrendBasedFibExtension.prototype.migrateVersion=function(a,b,c){1==a&&this.properties().extendLines.setValue(!0)};
TradingView.LineToolTrendBasedFibExtension.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function $74(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($74,$90);
$74.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0),b=this.W99.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.W99.priceScale().isPercent()&&(d=this.W99.ownerSource().firstValue());for(var e=1;7>=e;e++){var g="hlevel"+e,h=this.W99.properties()[g];
if(h.visible.value()){var g=h.coeff.value(),h=h.color.value(),k=a.price+g*c;this.W99.priceScale().isPercent()&&(k=this.W99.priceScale().priceRange().convertToPercent(k,d));k=this.W99.priceScale().priceToCoordinate(k);this._hlevels.push({coeff:g,color:h,y:k,index:e})}}this._vlevels=[];b=b.index-a.index;for(e=1;7>=e;e++)g="vlevel"+e,h=this.W99.properties()[g],h.visible.value()&&(g=h.coeff.value(),h=h.color.value(),c=Math.round(a.index+g*b),c=this.D0.timeScale().indexToCoordinate(c),
this._vlevels.push({coeff:g,color:h,x:c,index:e}))}};
$74.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;for(var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x),e=Math.min(b.y,c.y),g=Math.max(b.x,c.x),h=Math.max(b.y,c.y),k=this.W99.properties(),l=k.grid.color.value(),m=k.grid.linewidth.value(),n=k.grid.linestyle.value(),q=0;q<this._hlevels.length;q++){b=new MathEx.Point(d,this._hlevels[q].y);c=new MathEx.Point(g,this._hlevels[q].y);if(k.grid.visible.value()){var r=
{points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:l,linewidth:m,linestyle:n,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(r))}k.showLeftLabels.value()&&(b={points:(new List).append(b),text:""+this._hlevels[q].coeff,color:this._hlevels[q].color,vertAlign:"middle",horzAlign:"right",font:k.font.value(),offsetX:-5,offsetY:0,fontsize:12},
a.append(new TextRenderer(b,this._rendererCache)));k.showRightLabels.value()&&(c={points:(new List).append(c),text:""+this._hlevels[q].coeff,color:this._hlevels[q].color,vertAlign:"middle",horzAlign:"left",font:k.font.value(),offsetX:5,offsetY:0,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)))}for(q=0;q<this._vlevels.length;q++)b=new MathEx.Point(this._vlevels[q].x,e),c=new MathEx.Point(this._vlevels[q].x,h),k.grid.visible.value()&&(r={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),
height:this.W99.priceScale().height(),color:l,linewidth:m,linestyle:n,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(r))),k.showTopLabels.value()&&(b={points:(new List).append(b),text:""+this._vlevels[q].coeff,color:this._vlevels[q].color,vertAlign:"bottom",horzAlign:"center",font:k.font.value(),offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(b,this._rendererCache))),k.showBottomLabels.value()&&
(c={points:(new List).append(c),text:""+this._vlevels[q].coeff,color:this._vlevels[q].color,vertAlign:"top",horzAlign:"center",font:k.font.value(),offsetX:0,offsetY:5,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)));e=k.fillBackground.value();h=k.transparency.value();b=this._points.item(0);c=this._points.item(1);for(q=0;q<this._hlevels.length;q++)n=new MathEx.Point(c.x,this._hlevels[q].y),0<q&&e&&(l=new MathEx.Point(c.x,this._hlevels[q-1].y),m={},m.width=this.D0.timeScale().width(),
m.p1=b,m.p2=n,m.p3=b,m.p4=l,m.color=this._hlevels[q].color,m.transparency=h,m.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(m))),r={points:(new List).append(b).append(n),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:this._hlevels[q].color,linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},l=new HitTestResult(HitTestResult.MOVEPOINT,
null,{type:"h",index:this._hlevels[q].index}),a.append(new TrendLineRenderer(r,l));for(q=0;q<this._vlevels.length;q++)n=new MathEx.Point(this._vlevels[q].x,c.y),0<q&&e&&(l=new MathEx.Point(this._vlevels[q-1].x,c.y),m={},m.width=this.D0.timeScale().width(),m.p1=b,m.p2=n,m.p3=b,m.p4=l,m.color=this._vlevels[q].color,m.transparency=h,m.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(m))),r={points:(new List).append(b).append(n),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:this._vlevels[q].color,linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},l=new HitTestResult(HitTestResult.MOVEPOINT,null,{type:"v",index:this._vlevels[q].index}),a.append(new TrendLineRenderer(r,l));this.isAnchorsRequired()&&(k=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&k.removeAt(k.size()-1),a.append(this.createLineAnchor({points:k})));return a};
TradingView.LineToolFibSpeedResistanceFan=function(a,b){this._constructor="LineToolFibSpeedResistanceFan";var c=b?b:new $52("linetoolfibspeedresistancefan");W47.call(this,a,new $74(this,a),c)};inherit(TradingView.LineToolFibSpeedResistanceFan,W47);TradingView.LineToolFibSpeedResistanceFan.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpeedResistanceFan.prototype.title=function(){return"Fib Speed Resistance Fan"};
TradingView.LineToolFibSpeedResistanceFan.prototype.processErase=function(a,b){var c="h"==b.type?"hlevel"+b.index:"vlevel"+b.index,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function FibArcRenderer(a,b){this._data=a;this._hittest=b}
FibArcRenderer.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.translate(this._data.center.x,this._data.center.y);a.beginPath();0<this._data.dir?a.arc(0,0,this._data.radius,0,Math.PI,!1):a.arc(0,0,this._data.radius,Math.PI,0,!1);a.stroke();this._data.fillBackground&&(this._data.radius2&&(0<this._data.dir?a.arc(0,0,this._data.radius2,Math.PI,0,!0):a.arc(0,0,this._data.radius2,0,Math.PI,!0)),a.fillStyle=generateColor(this._data.color,this._data.transparency),
a.fill())};FibArcRenderer.prototype.hitTest=function(a){if(MathEx.sign(a.y-this._data.center.y)!==this._data.dir)return null;a=a.substract(this._data.center).length();var b=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.hittestOnBackground){if(Math.abs(a)<=this._data.radius+3)return b}else if(3>Math.abs(a-this._data.radius))return b;return null};function $73(a,b){$90.call(this,a,b);this._rendererCache={}}
inherit($73,$90);
$73.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this._points.size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1),c=a.substract(b).length();this._levels=[];for(var d=this.W99.properties(),e=1;11>=e;e++){var g=d["level"+e];if(g.visible.value()){var h=g.coeff.value(),k=g.color.value(),l=b.substract(a).length()*h,m;d.showCoeffs.value()&&
(m=""+h);var n=MathEx.sign(b.y-a.y),q=new MathEx.Point(a.x,a.y+n*c*h);this._levels.push({coeff:h,color:k,label:m,radius:l,dir:n,labelPoint:q,linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),index:e})}}}};
$73.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.W99.properties(),d=c.fillBackground.value(),e=c.transparency.value(),g=0;g<this._levels.length;g++){var h=this._levels[g],k={};k.center=b;k.color=h.color;k.linewidth=h.linewidth;k.radius=h.radius;k.dir=h.dir;k.transparency=e;k.fillBackground=d;k.hittestOnBackground=TradingView.isMobile.any();0<g&&(k.radius2=this._levels[g-
1].radius);var l=new HitTestResult(HitTestResult.MOVEPOINT,null,h.index);a.append(new FibArcRenderer(k,l));c.showCoeffs.value()&&(h={points:(new List).append(h.labelPoint),text:this._levels[g].label,color:this._levels[g].color,vertAlign:"middle",horzAlign:"right",font:c.font.value(),offsetX:0,offsetY:0,fontsize:12},a.append(new TextRenderer(h,this._rendererCache)))}c.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),
height:this.W99.priceScale().height(),color:c.trendline.color.value(),linewidth:c.trendline.linewidth.value(),linestyle:c.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(b=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};
TradingView.LineToolFibSpeedResistanceArcs=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new $52("linetoolfibspeedresistancearcs");W47.call(this,a,new $73(this,a),c)};inherit(TradingView.LineToolFibSpeedResistanceArcs,W47);TradingView.LineToolFibSpeedResistanceArcs.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpeedResistanceArcs.prototype.title=function(){return"Fib Speed Resistance Arcs"};
TradingView.LineToolFibSpeedResistanceArcs.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function $76(a,b){$90.call(this,a,b);this._levels=[];this._rendererCache={}}inherit($76,$90);
$76.prototype.update=function(){$90.prototype.update.call(this);if(!(1>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0);if(2===this.W99.points().size())var b=this.W99.points().item(1);var c=this.W99.properties(),d=this.W99.points().item(0).index;if(!this.D0.timeScale().visibleBars().isEmpty())for(this._levels=[],a=b?b.index-a.index:
1,b=1;11>=b;b++){var e=c["level"+b];if(e.visible.value()){var g=Math.round(d+e.coeff.value()*a),g=this.D0.timeScale().indexToCoordinate(g),g={index:b,x:g,color:e.color.value(),width:e.linewidth.value(),style:e.linestyle.value()};c.showLabels.value()&&(g.text=e.coeff.value(),g.y=this.W99.priceScale().height());this._levels.push(g)}}}};
$76.prototype.renderer=function(){for(var a=new CompositeRenderer,b=this.W99.properties(),c=0;c<this._levels.length;c++){var d={};d.points=(new List).append(new MathEx.Point(this._levels[c].x,0));d.color=this._levels[c].color;d.linewidth=this._levels[c].width;d.linestyle=this._levels[c].style;var e=new HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[c].index);a.append(new VertLineRenderer(d,e));if(0<c&&b.fillBackground.value()){var g=this._levels[c-1],e=new MathEx.Point(this._levels[c].x,
0),g=new MathEx.Point(g.x,this.W99.priceScale().height()),h={nohittest:!0};h.points=(new List).append(e).append(g);h.color=this._levels[c].color;h.linewidth=0;h.backcolor=this._levels[c].color;h.fillBackground=!0;h.transparency=b.transparency.value();a.append(new RectangleRenderer(h))}if(void 0!==this._levels[c].text){var k,l,m,e=b.horzLabelsAlign.value(),e="left"==e?"right":"right"==e?"left":"center";switch(e){case "left":l=3;break;case "center":l=0;break;case "right":l=-3}switch(b.vertLabelsAlign.value()){case "top":k=
new MathEx.Point(this._levels[c].x,0);m=5;break;case "middle":k=new MathEx.Point(this._levels[c].x,.5*this._levels[c].y);m=0;break;case "bottom":k=new MathEx.Point(this._levels[c].x,this._levels[c].y),m=-10}d={points:(new List).append(k),text:""+this._levels[c].text,color:d.color,vertAlign:"middle",horzAlign:e,font:b.font.value(),offsetX:l,offsetY:m,fontsize:12};a.append(new TextRenderer(d,this._rendererCache))}}2===this._points.size()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),
width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(2===this.W99.points().size()?(b=this._points.clone(),a.append(this.createLineAnchor({points:b}))):0<this._points.size()&&(b=new List,b.append(new MathEx.Point(this._points.item(0).x,
this.W99.priceScale().height()/2)),a.append(this.createLineAnchor({points:b,hittestResult:HitTestResult.MOVEPOINT}))));return a};TradingView.LineToolFibTimeZone=function(a,b){this._constructor="LineToolFibTimeZone";var c=b?b:new $52("linetoolfibtimezone");W47.call(this,a,new $76(this,a),c);this.version=TradingView.LineToolFibTimeZone.version};inherit(TradingView.LineToolFibTimeZone,W47);TradingView.LineToolFibTimeZone.version=2;
TradingView.LineToolFibTimeZone.prototype.migrateVersion=function(a,b,c){if(1===a){c.properties.level1.color.setValue(c.properties.baselinecolor.value());for(a=2;11>=a;a++)c.properties["level"+a].color.setValue(c.properties.linecolor.value());for(a=1;11>=a;a++)c.properties["level"+a].linewidth.setValue(c.properties.linewidth.value()),c.properties["level"+a].linestyle.setValue(c.properties.linestyle.value())}};TradingView.LineToolFibTimeZone.prototype.pointsCount=function(){return 2};
TradingView.LineToolFibTimeZone.prototype.title=function(){return"Fib Time Zone"};TradingView.LineToolFibTimeZone.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function EllipseRendererSimple(a,b){this._data=a;this._hittest=b}
EllipseRendererSimple.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),d=Math.abs(b.x-c.x),e=Math.abs(b.y-c.y),b=b.add(c).scaled(.5);if(!(1>d||1>e)){if(this._data.wholePoints){var c=this._data.wholePoints.item(0),g=this._data.wholePoints.item(1),h=Math.abs(c.x-g.x);Math.abs(c.y-g.y)}a.save();a.translate(b.x,b.y);a.scale(1,e/d);a.beginPath();a.arc(0,
0,d/2,0,2*Math.PI,!1);a.restore();a.stroke();this._data.fillBackground&&(this._data.wholePoints&&(a.translate(b.x,b.y),a.scale(1,e/d),a.arc(0,0,h/2,0,2*Math.PI,!0)),a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
EllipseRendererSimple.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=.5*Math.abs(b.x-c.x);Math.abs(b.y-c.y);var e=Math.abs(b.x-c.x),g=Math.abs(b.y-c.y),h=b.add(c).scaled(.5);a=a.substract(h);if(1>e||1>g)return null;a.y/=(c.y-b.y)/(c.x-b.x);b=a.x*a.x+a.y*a.y-d*d;b=MathEx.sign(b)*Math.sqrt(Math.abs(b/d));d=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.fillBackground&&!this._data.noHitTestOnBackground){if(3>
b)return d}else if(3>Math.abs(b))return d;return null};function $71(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($71,$90);
$71.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1);this._center=a.add(b).scaled(.5);var c=Math.abs(b.x-a.x),a=Math.abs(b.y-a.y);this._levels=[];for(var b=this.W99.properties(),d=1;11>=d;d++){var e=b["level"+d];if(e.visible.value()){var g=e.coeff.value(),h=e.color.value(),
k=new List;k.append(new MathEx.Point(this._center.x-.5*c*g,this._center.y-.5*a*g));k.append(new MathEx.Point(this._center.x+.5*c*g,this._center.y+.5*a*g));var l;b.showCoeffs.value()&&(l=g,l=b.coeffsAsPercents.value()?""+Math.round(1E4*l)/100+"%":""+l);var m=new MathEx.Point(this._center.x,this._center.y+.5*a*g);this._levels.push({coeff:g,color:h,label:l,points:k,labelPoint:m,linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:d})}}}};
$71.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;this._points.item(0);this._points.item(1);for(var b=this.W99.properties(),c=b.fillBackground.value(),d=b.transparency.value(),e=0;e<this._levels.length;e++){var g=this._levels[e],h={};h.points=g.points;h.color=g.color;h.linewidth=g.linewidth;h.backcolor=g.color;0<e&&(h.wholePoints=this._levels[e-1].points);h.fillBackground=c;h.transparency=d;h.noHitTestOnBackground=!TradingView.isMobile.any();
var k=new HitTestResult(HitTestResult.MOVEPOINT,null,g.index);a.append(new EllipseRendererSimple(h,k));b.showCoeffs.value()&&(g={points:(new List).append(g.labelPoint),text:this._levels[e].label,color:this._levels[e].color,vertAlign:"middle",horzAlign:"right",font:b.font.value(),offsetX:0,offsetY:0,fontsize:12},a.append(new TextRenderer(g,this._rendererCache)))}b.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),
height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(b=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};
TradingView.LineToolFibCircles=function(a,b){this._constructor="LineToolFibCircles";var c=b?b:new $52("linetoolfibcircles");W47.call(this,a,new $71(this,a),c)};inherit(TradingView.LineToolFibCircles,W47);TradingView.LineToolFibCircles.prototype.pointsCount=function(){return 2};TradingView.LineToolFibCircles.prototype.title=function(){return"Fib Circles"};
TradingView.LineToolFibCircles.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function ArcWedgeRenderer(a,b){this._data=a;this._hittest=b;this._rendererCache={}}
ArcWedgeRenderer.prototype.draw=function(a){a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.beginPath();a.arc(this._data.center.x,this._data.center.y,this._data.radius,this._data.edge1,this._data.edge2,!0);a.stroke();if(this._data.fillBackground){a.arc(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.edge2,this._data.edge1,!1);if(this._data.gradient){var b=a.createRadialGradient(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.center.x,
this._data.center.y,this._data.radius);b.addColorStop(0,generateColor(this._data.color1,this._data.transparency));b.addColorStop(1,generateColor(this._data.color2,this._data.transparency));a.fillStyle=b}else a.fillStyle=generateColor(this._data.color,this._data.transparency);a.fill()}};
ArcWedgeRenderer.prototype.hitTest=function(a){var b=a.substract(this._data.center).length(),c=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.fillBackground){if(b<=this._data.radius){var d=this._data.p1.substract(this._data.center).normalized(),e=this._data.p2.substract(this._data.center).normalized(),b=a.substract(this._data.center).normalized();a=d.dotProduct(e);d=b.dotProduct(d);b=b.dotProduct(e);if(d>=a&&b>=a)return c}}else if(4>=Math.abs(b-this._data.radius)&&(b=a.substract(this._data.p1).length(),
e=a.substract(this._data.p2).length(),b=Math.max(b,e),e=this._data.p1.substract(this._data.p2).length(),b<=e))return c;return null};function $77(a,b){$90.call(this,a,b);this._rendererCache={};this._levels=[]}inherit($77,$90);$77.prototype._levelsCount=function(){return 11};
$77.prototype.update=function(){$90.prototype.update.call(this);this._levels=[];if(!(3>this._points.size())){var a=this._points,b=a.item(0),c=a.item(1),d=a.item(2),a=c.substract(b).normalized(),d=d.substract(b).normalized(),e=new MathEx.Point(1,0),g=new MathEx.Point(0,1),h=Math.acos(a.dotProduct(e));0>a.dotProduct(g)&&(h=2*Math.PI-h);this._edge1=h;e=Math.acos(d.dotProduct(e));0>d.dotProduct(g)&&(e=2*Math.PI-e);this._edge2=e;h<e&&(this._edge1=Math.max(h,e),this._edge2=Math.min(h,
e)+2*Math.PI);Math.abs(h-e)>Math.PI&&(this._edge1=Math.min(h,e),this._edge2=Math.max(h,e)-2*Math.PI);g=this.W99.properties();for(h=1;h<=this._levelsCount();h++)if(e=g["level"+h],e.visible.value()){var k=e.coeff.value(),l=e.color.value(),m=c.substract(b).length()*k,n;g.showCoeffs.value()&&(n=""+k);var q=a.add(d).scaled(.5).normalized().scaled(m),q=b.add(q);this._levels.push({coeff:k,color:l,label:n,radius:m,labelPoint:q,p1:b.add(a.scaled(m)),p2:b.add(d.scaled(m)),linewidth:e.linewidth.value(),
linestyle:e.linestyle.value(),index:h})}}};
$77.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this.W99.properties(),c=this._points,d=c.item(0),e=c.item(1),g={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
a.append(new TrendLineRenderer(g));if(3>this._points.size())return this.addAnchors(a),a;var h=c.item(2),c=h.data,g=e.substract(d).length();e.substract(d).normalized();h=h.substract(d).normalized();h=d.add(h.scaled(g));h.data=c;g={points:(new List).append(d).append(h),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(g));for(c=this._levels.length-1;0<=c;c--){var g=this._levels[c],k={};k.center=this._points.item(0);k.radius=g.radius;k.prevRadius=0<c?this._levels[c-1].radius:0;k.edge=this._edge;k.color=g.color;k.linewidth=1;k.edge1=this._edge1;k.edge2=this._edge2;k.p1=g.p1;k.p2=g.p2;k.fillBackground=b.fillBackground.value();k.transparency=b.transparency.value();var l=new HitTestResult(HitTestResult.MOVEPOINT,null,g.index);a.append(new ArcWedgeRenderer(k,
l));b.showCoeffs.value()&&(g={points:(new List).append(g.labelPoint),text:this._levels[c].label,color:this._levels[c].color,vertAlign:"middle",horzAlign:"center",font:b.font.value(),offsetX:0,offsetY:0,fontsize:12,bold:!0},a.append(new TextRenderer(g,this._rendererCache)))}this.isAnchorsRequired()&&(c=(new List).append(d).append(e),this.D0.lineBeingCreated()!=this.W99&&c.append(h),a.append(this.createLineAnchor({points:c})));return a};
TradingView.LineToolFibWedge=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new $52("linetoolfibwedge");W47.call(this,a,new $77(this,a),c)};inherit(TradingView.LineToolFibWedge,W47);TradingView.LineToolFibWedge.prototype.pointsCount=function(){return 3};TradingView.LineToolFibWedge.prototype.title=function(){return"Fib Wedge"};
TradingView.LineToolFibWedge.prototype.setPoint=function(a,b){W47.prototype.setPoint.call(this,a,b);if(!this._recursiveGuard){this._recursiveGuard=!0;if(2==a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],e=e.substract(c).length(),d=d.substract(c).normalized(),d=c.add(d.scaled(e)),c=this.priceScale().coordinateToPrice(d.y);a=Math.round(this.D0.timeScale().coordinateToIndex(d.x));
this.D2.points[1].price.setValue(c);this.D2.points[1].bar.setValue(a)}else{var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],g=d.substract(c).length(),d=e.substract(c).normalized(),e=c.add(d.scaled(g)),c=this.priceScale().coordinateToPrice(e.y);a=Math.round(this.D0.timeScale().coordinateToIndex(e.x));this.D2.points[2].price.setValue(c);this.D2.points[2].bar.setValue(a)}this._recursiveGuard=
!1}};
TradingView.LineToolFibWedge.prototype.addPoint=function(a){if(2==this._points.size()){var b=this.pointToScreenPoint(this._points.item(0))[0],c=this.pointToScreenPoint(this._points.item(1))[0];if(this.priceScale().isPercent()){var d=this.ownerSource().firstValue();a.price=this.priceScale().priceRange().convertFromPercent(a.price,d)}a=this.pointToScreenPoint(a)[0];c=c.substract(b).length();a=a.substract(b).normalized();a=b.add(a.scaled(c));b=this.priceScale().coordinateToPrice(a.y);a={index:Math.round(this.D0.timeScale().coordinateToIndex(a.x)),price:b}}return W47.prototype.addPoint.call(this,
a)};TradingView.LineToolFibWedge.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function W7(a,b){$77.call(this,a,b)}inherit(W7,$77);W7.prototype.update=function(){$77.prototype.update.call(this)};W7.prototype._levelsCount=function(){return 1};
W7.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this.W99.properties(),c=this._points,d=c.item(0),e=c.item(1),g={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
a.append(new TrendLineRenderer(g));if(3>this._points.size())return this.addAnchors(a),a;var h=c.item(2),c=h.data,g=e.substract(d).length();e.substract(d).normalized();e=h.substract(d).normalized();h=d.add(e.scaled(g));h.data=c;g={points:(new List).append(d).append(h),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,
rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(g));d=this._levels[0];e={};e.center=this._points.item(0);e.radius=d.radius;e.prevRadius=0;e.edge=this._edge;e.color=b.trendline.color.value();e.color1=b.color1.value();e.color2=b.color2.value();e.linewidth=b.linewidth.value();e.edge1=this._edge1;e.edge2=this._edge2;e.p1=d.p1;e.p2=d.p2;e.fillBackground=b.fillBackground.value();e.transparency=b.transparency.value();e.gradient=!0;a.append(new ArcWedgeRenderer(e));this.addAnchors(a);
return a};TradingView.LineToolProjection=function(a,b){this._constructor="LineToolProjection";var c=b?b:new $52("linetoolprojection");W47.call(this,a,new W7(this,a),c)};inherit(TradingView.LineToolProjection,TradingView.LineToolFibWedge);TradingView.LineToolProjection.prototype.title=function(){return"Projection"};function $68(a,b){$90.call(this,a,b);this._rendererCache=[{},{},{},{},{},{}]}inherit($68,$90);
$68.prototype.renderer=function(){if(!this._wave)return null;for(var a=new CompositeRenderer,b=this.W99.properties(),c=b.wavesize.value(),d=this.W99.labels(),e=0;e<this._wave.length;e++)a.append(new TrendLineRenderer(this._wave[e]));var g=1;if(2<this._points.size())var h=this._points.item(2),e=this._points.item(1),g=MathEx.sign(h.y-e.y);var h=[],k=0;this.D0.lineBeingCreated()==this.W99&&(k=1);for(var l=(new RGBColor(this.D0.backgroundColor())).blackWhiteContrast(),
m=b.color.value(),e=0;e<this._points.size()-k;e++,g=-g){var n=d[c][e],q={points:(new List).append(this._points.item(e)),text:n,color:(new RGBColor(m)).darken("black"==l?15:-15).toHex(),vertAlign:1==g?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1==g?5:-10,fontsize:12};h.push(q);b.showBackground.value()&&(q.borderColor=m,q.backgroundColor=generateColor(m,60));""!=n&&a.append(new TextRenderer(q,this._rendererCache[e],new HitTestResult(HitTestResult.CHANGEPOINT,e)))}if(this.isAnchorsRequired()){b=
new List;for(c=0;c<h.length;c++)d=this._points.item(c).clone(),d.y=h[c].points.item(0).y,d.data=c,b.append(d);this.D0.lineBeingCreated()==this.W99&&0<b.size()&&b.removeAt(b.size()-1);a.append(this.createLineAnchor({points:b}))}return a};
$68.prototype.update=function(){$90.prototype.update.call(this);this._wave=[];var a=this.W99.properties(),b=this.W99.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&!c.isEmpty()){var d;this.W99.priceScale().isPercent()&&(d=this.W99.ownerSource().firstValue());var e=a.color.value();if(a.showWave.value())for(var a=this.W99.points(),g=1;g<a.size();g++){var h=a.item(g-1),k=a.item(g);this.D0.mainSeries().bars().valueAt(h.index);this.D0.mainSeries().bars().valueAt(k.index);
var l=c.indexToCoordinate(h.index),m=c.indexToCoordinate(k.index),h=h.price,k=k.price;this.W99.priceScale().isPercent()&&(h=this.W99.priceScale().priceRange().convertToPercent(h,d),k=this.W99.priceScale().priceRange().convertToPercent(k,d));h=b.priceToCoordinate(h);k=b.priceToCoordinate(k);l={points:(new List).append(new MathEx.Point(l,h)).append(new MathEx.Point(m,k)),width:c.width(),height:b.height(),color:generateColor(e,0),linewidth:3,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,
extendright:!1,leftend:W47.LINEEND_CIRCLE,rightend:W47.LINEEND_CIRCLE,endstyle:{strokeWidth:1,fillStyle:this.D0.backgroundColor()},overlayLineEndings:!0};this._wave.push(l)}}};TradingView.LineToolElliott=function(a,b){var c=b?b:new $52("linetoolelliott");W47.call(this,a,new $68(this,a),c)};inherit(TradingView.LineToolElliott,W47);TradingView.LineToolElliott.prototype.title=function(){return"Elliott Labels"};
TradingView.LineToolElliott5Points=function(a,b){var c=b?b:new $52("linetoolelliott");W47.call(this,a,new $68(this,a),c);this.version=TradingView.LineToolElliott5Points.version};inherit(TradingView.LineToolElliott5Points,TradingView.LineToolElliott);TradingView.LineToolElliott5Points.version=2;TradingView.LineToolElliott5Points.prototype.pointsCount=function(){return 6};
TradingView.LineToolElliott5Points.prototype.labels=function(){return[" i ii iii iv v".split(" ")," (i) (ii) (iii) (iv) (v)".split(" ")," ((i)) ((ii)) ((iii)) ((iv)) ((v))".split(" ")," 1 2 3 4 5".split(" ")," (1) (2) (3) (4) (5)".split(" ")," ((1)) ((2)) ((3)) ((4)) ((5))".split(" ")," I II III IV V".split(" ")," (I) (II) (III) (IV) (V)".split(" ")," ((I)) ((II)) ((III)) ((IV)) ((V))".split(" ")]};
TradingView.LineToolElliott5Points.prototype.migrateVersion=function(a,b,c){1==a&&(a=$.extend({},this._timePoint.item(0)),this._timePoint.insert(a,0),0<this._points.size()&&(a=$.extend({},this._points.item(0)),this._points.insert(a,0)))};TradingView.LineToolElliottSubminuette=function(a,b){this._constructor="LineToolElliottSubminuette";var c=b?b:new $52("linetoolelliottsubminuette");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottSubminuette,TradingView.LineToolElliott5Points);
TradingView.LineToolElliottMinor=function(a,b){this._constructor="LineToolElliottMinor";var c=b?b:new $52("linetoolelliottminor");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottMinor,TradingView.LineToolElliott5Points);TradingView.LineToolElliottCircle=function(a,b){this._constructor="LineToolElliottCircle";var c=b?b:new $52("linetoolelliottcircle");TradingView.LineToolElliott5Points.call(this,a,c)};
inherit(TradingView.LineToolElliottCircle,TradingView.LineToolElliott5Points);TradingView.LineToolElliott3Points=function(a,b){var c=b?b:new $52("linetoolelliott");W47.call(this,a,new $68(this,a),c);this.version=TradingView.LineToolElliott3Points.version};inherit(TradingView.LineToolElliott3Points,TradingView.LineToolElliott);TradingView.LineToolElliott3Points.version=2;TradingView.LineToolElliott3Points.prototype.pointsCount=function(){return 4};
TradingView.LineToolElliott3Points.prototype.labels=function(){return[["","a","b","c"],["","A","B","C"]]};TradingView.LineToolElliott3Points.prototype.migrateVersion=function(a,b,c){1==a&&(a=$.extend({},this._timePoint.item(0)),this._timePoint.insert(a,0),0<this._points.size()&&(a=$.extend({},this._points.item(0)),this._points.insert(a,0)))};
TradingView.LineToolElliottMinorRetr=function(a,b){this._constructor="LineToolElliottMinorRetr";var c=b?b:new $52("linetoolelliottminorretr");TradingView.LineToolElliott3Points.call(this,a,c)};inherit(TradingView.LineToolElliottMinorRetr,TradingView.LineToolElliott3Points);TradingView.LineToolElliottMajorRetr=function(a,b){this._constructor="LineToolElliottMajorRetr";var c=b?b:new $52("linetoolelliottmajorretr");TradingView.LineToolElliott3Points.call(this,a,c)};
inherit(TradingView.LineToolElliottMajorRetr,TradingView.LineToolElliott3Points);function $93(a,b){$90.call(this,a,b);this._lines=[]}inherit($93,$90);
$93.prototype.update=function(){$90.prototype.update.call(this);if(!(2>this.W99.points().size())){var a=this.D0.timeScale();if(this.W99.priceScale()&&!this.W99.priceScale().isEmpty()&&!a.isEmpty()){var b=this.W99.points().item(0),c=this.W99.points().item(1),c=c?c.index-b.index:1;this._lines=[];if(0!==c){var d=a.visibleBars();if(0<c)for(b=b.index;b<=d.lastBar();b+=c)this._lines.push({x:a.indexToCoordinate(b)});else for(b=b.index;b>=d.firstBar();b+=
c)this._lines.push({x:a.indexToCoordinate(b)})}}}};
$93.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.W99.properties(),d={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
a.append(new TrendLineRenderer(d));d=this.W99.properties();for(b=0;b<this._lines.length;b++)c={points:(new List).append(new MathEx.Point(this._lines[b].x,0)),color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:d.linestyle.value()},a.append(new VertLineRenderer(c));this.isAnchorsRequired()&&(2===this.W99.points().size()?(d=this._points.clone(),a.append(this.createLineAnchor({points:d}))):(d=new List,d.append(new MathEx.Point(this._points.item(0).x,this.W99.priceScale().height()/
2)),a.append(this.createLineAnchor({points:d,hittestResult:HitTestResult.MOVEPOINT}))));return a};TradingView.LineToolCircleLines=function(a,b){this._constructor="LineToolCircleLines";var c=b?b:new $52("linetoolcirclelines");W47.call(this,a,new $93(this,a),c)};inherit(TradingView.LineToolCircleLines,W47);TradingView.LineToolCircleLines.prototype.pointsCount=function(){return 2};TradingView.LineToolCircleLines.prototype.title=function(){return"Cyclic Lines"};TradingView.LineToolVbPFixed=function(a,b,c){var d=TradingView.Study.lineToolNameForPointsBasedStudy("VbPFixed@tv-volumebyprice");c=c?c:StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),"VbPFixed@tv-volumebyprice");var e=a.studyVersioning();b=b?b:TradingView.prepareStudyProperties(c,null,null,e);var e=new W31(this,a),g=new TradingView.Study.StudyPaneView_hhists(this,a),h=new TradingView.Study.StudyPaneView_horizlines(this,a),k=new TradingView.Study.StudyPaneView_polygons(this,
a);A63.call(this,a,[e,g,h,k],b,d);this._turnaroundCounter=1;this._turnaround="vbpfixed_"+this._turnaroundCounter;this._metaInfo=c;this._graphics=new A62(c);this._formatter=new VolumeFormatter};inherit(TradingView.LineToolVbPFixed,A63);TradingView.LineToolVbPFixed.prototype.pointsCount=function(){return 2};
TradingView.LineToolVbPFixed.prototype._requestStudy=function(){var a=this.points().item(0),b=this.points().item(1),c=Math.min(a.index,b.index),a=Math.max(a.index,b.index);if(c===a)this.clearData();else if(c=this.D0.mainSeries().bars().valueAt(c),a=this.D0.mainSeries().bars().valueAt(a),c&&a){c=1E3*c[TIME_PLOT];a=1E3*a[TIME_PLOT];b=[];b.push(this.properties().inputs.rows.value());b.push(this.properties().inputs.volume.value());b.push(c);b.push(a);b.push(this.properties().inputs.vaVolume.value());
var d=this;this._studyId?(this._turnaround="vbpfixed_"+ ++this._turnaroundCounter,this.D0.chartApi().modifyStudy(this._studyId,this._turnaround,b,function(a){d.onData(a)})):(this._studyId=TradingView.Study.makeNextStudyId(),this.D0.chartApi().createStudy(this._studyId,this._turnaround,this.D0.mainSeries()._seriesId,this._metaInfo.id+"-1!",b,function(a){d.onData(a)}))}};
TradingView.LineToolVbPFixed.prototype.onData=function(a){"data_update"===a.method&&a.params.customId==="pointset_"+this._currentPointsetId?(W47.prototype.onData.call(this,a),2==this._points.size()&&this._requestStudy()):"data_update"===a.method&&a.params.customId===this._studyId&&this._checkTurnaround(a.params.turnaround)&&(a.params.nonseries.d=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"",""!==a.params.nonseries.d&&(this._graphics.process(a.params.nonseries),this._correctPoints(this._graphics.graphics())),
0<a.params.nonseries.indexes.length&&(this._indexes=a.params.nonseries.indexes),this.updateAllViews(),this.D0.updateSource(this))};TradingView.LineToolVbPFixed.prototype._correctPoints=function(a){if(a&&(void 0==a.indexes||0!=a.indexes.length)){a=a.hhists["0"].data;for(var b=null,c=null,d=0;d<a.length;++d){var e=a[d].priceLow,g=a[d].priceHigh;if(!b||e<b)b=e;if(!c||g>c)c=g}this._points.item(0).price=c;this._points.item(1).price=b}};
TradingView.LineToolVbPFixed.prototype.calcIsActualSymbol=function(){this._isActualSymbol=!0};TradingView.LineToolVbPFixed.prototype.formatter=function(){return this._formatter};W9=function(a,b){$90.call(this,a,b);this._rendererCache={}};inherit(W9,$90);W9.prototype._formatInTicks=function(a){var b=this.D0.mainSeries().base();return Math.round(a*b)};W9.INDEX_ENTRY=0;W9.INDEX_CLOSE=1;W9.INDEX_ACTUALENTRY=2;W9.INDEX_ACTUALCLOSE=3;
W9.prototype.update=function(){$90.prototype.update.call(this);this._profitLevel=this._stopLevel=null;var a=this.D0.timeScale(),b=this.W99.priceScale();if(b&&!b.isEmpty()&&!a.isEmpty()&&0!=this.W99.points().size()&&0!=this._points.size()&&this.D0.mainSeries().bars().last()&&!(2>this.W99.points().size())&&0!=this.D0.mainSeries().bars().size()){if(this._isClosed=4==this.W99.points().size()){a=this.W99.points().item(W9.INDEX_ACTUALCLOSE).price;
if(this.W99.points().item(W9.INDEX_ACTUALCLOSE).index<parseInt(this.W99.D0.mainSeries().bars().first()))return;var c=Math.min(parseInt(this.W99.D0.mainSeries().bars().last()),this.W99.points().item(W9.INDEX_ACTUALCLOSE).index)}else{if(this.W99.points().item(W9.INDEX_CLOSE).index<parseInt(this.W99.D0.mainSeries().bars().first()))return;c=Math.min(parseInt(this.W99.D0.mainSeries().bars().last()),this.W99.points().item(W9.INDEX_CLOSE).index);
a=this.D0.mainSeries().bars().valueAt(c)[CLOSE_PLOT]}this._closeBar=this.W99.D0.timeScale().indexToCoordinate(c);var d=this.W99.priceScale(),e=this.W99.stopPrice(),g=this.W99.profitPrice();this._pl=1<this.W99.points().size()?this.W99.calculatePL(a):0;if(d.isPercent())var h=this.W99.ownerSource().firstValue(),e=d.priceRange().convertToPercent(e,h),g=d.priceRange().convertToPercent(g,h),a=d.priceRange().convertToPercent(a,h);this._entryLevel=this._points.item(W9.INDEX_ENTRY).y;
this._stopLevel=b.priceToCoordinate(e);this._profitLevel=b.priceToCoordinate(g);this._closeLevel=b.priceToCoordinate(a);this._closeBar=this.W99.D0.timeScale().indexToCoordinate(c)}};
W9.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.W99.points().size())return a;var b=this,c=this.W99.properties();this.D0.timeScale();var d=this._points.item(W9.INDEX_ENTRY).x,e=this._points.item(W9.INDEX_ACTUALENTRY)?this._points.item(W9.INDEX_ACTUALENTRY).x:this._points.item(W9.INDEX_CLOSE).x,g=this._points.item(W9.INDEX_ACTUALCLOSE)?this._points.item(W9.INDEX_ACTUALCLOSE).x:
this._points.item(W9.INDEX_CLOSE).x,h=this._points.item(W9.INDEX_CLOSE).x,k=new MathEx.Point(d,this._entryLevel),l=new MathEx.Point(h,this._stopLevel),m={};m.points=(new List).append(k).append(l);m.color="white";m.linewidth=0;m.backcolor=c.stopBackground.value();m.fillBackground=!0;m.transparency=c.stopBackgroundTransparency.value();a.append(new RectangleRenderer(m));if(0>this._pl){k=new MathEx.Point(e,this._entryLevel);l=new MathEx.Point(g,this._closeLevel);m={};m.points=
(new List).append(k).append(l);m.color="white";m.linewidth=0;m.backcolor=c.stopBackground.value();m.fillBackground=!0;var n=.01*c.stopBackgroundTransparency.value();m.transparency=100-100*(1-n*n*n);a.append(new RectangleRenderer(m))}k=new MathEx.Point(d,this._entryLevel);l=new MathEx.Point(h,this._profitLevel);m={};m.points=(new List).append(k).append(l);m.color="white";m.linewidth=0;m.backcolor=c.profitBackground.value();m.fillBackground=!0;m.transparency=c.profitBackgroundTransparency.value();a.append(new RectangleRenderer(m));
0<this._pl&&(k=new MathEx.Point(e,this._entryLevel),l=new MathEx.Point(g,this._closeLevel),m={},m.points=(new List).append(k).append(l),m.color="white",m.linewidth=0,m.backcolor=c.profitBackground.value(),m.fillBackground=!0,n=.01*c.profitBackgroundTransparency.value(),m.transparency=100-100*(1-n*n*n),a.append(new RectangleRenderer(m)));e=function(c,d,e){var g={};g.points=(new List).append(c).append(d);g.width=b.D0.timeScale().width();g.height=b.W99.priceScale().height();g.color=e?e:b.W99.properties().linecolor.value();
g.linewidth=b.W99.properties().linewidth.value();g.linestyle=CanvasEx.LINESTYLE_SOLID;g.extendleft=!1;g.extendright=!1;g.leftend=W47.LINEEND_NORMAL;g.rightend=W47.LINEEND_NORMAL;a.append(new TrendLineRenderer(g))};this._points.item(W9.INDEX_ACTUALENTRY)&&(k=this._points.item(W9.INDEX_ACTUALENTRY),l=this._isClosed?this._points.item(W9.INDEX_ACTUALCLOSE):new MathEx.Point(this._closeBar,this._closeLevel),m={},m.points=(new List).append(k).append(l),
m.width=b.D0.timeScale().width(),m.height=b.W99.priceScale().height(),m.color=b.W99.properties().linecolor.value(),m.linewidth=1,m.linestyle=CanvasEx.LINESTYLE_DASHED,m.extendleft=!1,m.extendright=!1,m.leftend=W47.LINEEND_NORMAL,m.rightend=W47.LINEEND_ARROW,a.append(new TrendLineRenderer(m)));var b=this,m=function(d,e,g,h,k,l){if(b.isAnchorsRequired()||TradingView.printing){var m={};m.points=(new List).append(d);m.text=e;m.color=c.textcolor.value();m.font=c.font.value();
m.offsetX=3;m.offsetY=k;m.vertAlign=h;m.horzAlign="center";m.backgroundRoundRect=4;m.backgroundColor=g;m.fontsize=c.fontsize.value();m.backgroundHorzInflate=4;m.backgroundVertInflate=2;l&&(m.borderColor=l);a.append(new TextRenderer(m,b._rendererCache))}},g=this.W99.entryPrice(),n=this.W99.stopPrice(),k=this.W99.profitPrice(),q=Math.abs(n-g),r=Math.round(1E4*q/g)/100,u=Math.abs(k-g),w=Math.round(1E4*u/g)/100,A=Math.abs(g-k)/Math.abs(g-n),k=new MathEx.Point(d,this._points.item(W9.INDEX_ENTRY).y),
l=new MathEx.Point(h,this._points.item(W9.INDEX_ENTRY).y);e(k,l);k=new MathEx.Point((d+h)/2,Math.round(this._points.item(0).y)+.5);l="";this._points.item(1)&&void 0!==this._pl&&(l=this._isClosed?" "+$.t("Closed",{context:"line_tool_position"}):$.t("Open",{context:"line_tool_position"}),l=$.t("{0} P&L: {1}").format(l,this.W99.priceScale().formatter().format(this._pl))+"\n");l+=$.t("Risk/Reward Ratio: {0}").format(Math.round(100*A)/100)+" ";A=c.linecolor.value();0>this._pl?A=c.stopBackground.value():
0<this._pl&&(A=c.profitBackground.value());m(k,l,A,"middle",0,"white");k=new MathEx.Point(d,this._stopLevel);l=new MathEx.Point(h,this._stopLevel);e(k,l,c.stopBackground.value());k=new MathEx.Point((d+h)/2,this._stopLevel);l=$.t("Stop: {0} ({1}%)").format(this.W99.priceScale().formatter().format(q),r);m(k,l,c.stopBackground.value(),g<n?"bottom":"top",g<n?-12:-1);k=new MathEx.Point(d,this._profitLevel);l=new MathEx.Point(h,this._profitLevel);e(k,l,c.profitBackground.value());k=new MathEx.Point((d+
h)/2,this._profitLevel);l=$.t("Target: {0} ({1}%)").format(this.W99.priceScale().formatter().format(u),w);m(k,l,c.profitBackground.value(),g<n?"top":"bottom",g<n?-1:-12);this.isAnchorsRequired()&&(e=new List,m=this._points.item(0).clone(),m.data=0,e.append(m),g=new MathEx.Point(d,this._stopLevel),g.data=1,e.append(g),d=new MathEx.Point(d,this._profitLevel),d.data=2,e.append(d),h=new MathEx.Point(h,m.y),h.data=3,e.append(h),a.append(this.createLineAnchor({points:e})));return a};
function LineToolRiskRewardPriceAxisView(a,b,c,d){this.W99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14;this._pricePropName=c;this._colorPropName=d}inherit(LineToolRiskRewardPriceAxisView,PriceAxisView);
LineToolRiskRewardPriceAxisView.prototype.update=function(){if(0!==this.W99.points().size()&&this.W99.priceScale()&&!this.W99.priceScale().isEmpty()){var a=this.W99.properties()[this._pricePropName].value();this._background=this.W99.properties()[this._colorPropName].value();this._coordinate=this.W99.priceScale().priceToCoordinate(a);this._textHeight=this.W99.priceScale().m_markBuilder.fontHeight();this._text=this.W99.priceScale().formatter().format(a)}};
LineToolRiskRewardPriceAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new PriceAxisViewRenderer(a)};
TradingView.LineToolRiskReward=function(a,b){var c=b?b:new $52("linetoolriskreward");W47.call(this,a,new W9(this,a),c);this.D2.addExclusion&&(this.D2.addExclusion("stopLevel"),this.D2.addExclusion("profitLevel"));if(!b.stopLevel&&!b.profitLevel){var d=a.timeScale().visibleBars(),e=d.firstBar(),d=d.lastBar(),g=a.mainSeries().priceRange(e,d),e=a.mainSeries().priceScale();e.isLog()&&(d=e.logicalToPrice(g.minValue()),g=e.logicalToPrice(g.maxValue()),
g=new PriceRange(d,g));if(e.isPercent())var h=a.mainSeries().firstValue(),d=e.priceRange().convertFromPercent(g.minValue(),h),g=e.priceRange().convertFromPercent(g.maxValue(),h),g=new PriceRange(d,g);g&&!g.isEmpty()&&(e=Math.round(.2*g.length()*a.mainSeries().base()),c.merge({stopLevel:e,profitLevel:e}))}var k=this;c.stopLevel.listeners().subscribe(this,TradingView.LineToolRiskReward.prototype.recalculate);c.stopLevel.listeners().subscribe(null,function(){k.properties().stopPrice._listeners.fire(k.properties().stopPrice)});
c.profitLevel.listeners().subscribe(this,TradingView.LineToolRiskReward.prototype.recalculate);c.profitLevel.listeners().subscribe(null,function(){k.properties().targetPrice._listeners.fire(k.properties().targetPrice)});c.addProperty("entryPrice");c.entryPrice=new TradingView.LineToolRiskReward.PriceProperty(this,0);c.addProperty("stopPrice");c.stopPrice=new TradingView.LineToolRiskReward.StopPriceProperty(this);c.addProperty("targetPrice");c.targetPrice=new TradingView.LineToolRiskReward.TargetPriceProperty(this);
this._entryPriceAxisView=new LineToolRiskRewardPriceAxisView(this,a,"entryPrice","linecolor");this._stopPriceAxisView=new LineToolRiskRewardPriceAxisView(this,a,"stopPrice","stopBackground");this._profitPriceAxisView=new LineToolRiskRewardPriceAxisView(this,a,"targetPrice","profitBackground");this.version=TradingView.LineToolRiskReward.version};inherit(TradingView.LineToolRiskReward,W47);TradingView.LineToolRiskReward.version=2;
TradingView.LineToolRiskReward.prototype.migrateVersion=function(a,b,c){1==a&&1<=this._points.size()&&(a=new List,a.append(this._points.item(0)),b=this._points.item(0),b={price:b.price,index:b.index+50},a.append(b),this._points.item(1)&&a.append(this._points.item(1)),this._points.item(2)&&a.append(this._points.item(2)),this._points=a,1<=this._timePoint.size()&&(c=new List,b=this._timePoint.item(0),c.append(b),c.append({price:b.price,time_t:b.time_t,offset:b.offset+50}),this._timePoint.item(1)&&a.append(this._points.item(1)),
this._timePoint.item(2)&&a.append(this._points.item(2)),this._timePoint=c))};TradingView.LineToolRiskReward.prototype.checkAlert=function(){this.recalculate()};TradingView.LineToolRiskReward.prototype.priceAxisViews=function(a,b){return this._isActualSymbol?this.D0.paneForSource(this)===a&&b===this.priceScale()?(new List).append(this._entryPriceAxisView).append(this._stopPriceAxisView).append(this._profitPriceAxisView):null:null};
TradingView.LineToolRiskReward.prototype.updateAllViews=function(){!this._isActualSymbol||!this.D2.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled()||(W47.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update())};
TradingView.LineToolRiskReward.prototype.setPoint=function(a,b){var c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();b.price=c.priceRange().convertFromPercent(b.price,d)}switch(a){case 0:b.price=this._roundPrice(b.price);c.isPercent()&&(b.price=c.priceRange().convertToPercent(b.price,d));W47.prototype.setPoint.call(this,a,b);this.recalculate();break;case 1:this.properties().stopPrice.setValue(this.preparseStopPrice(b.price));break;case 2:this.properties().targetPrice.setValue(this.preparseProfitPrice(b.price));
break;case 3:b.price=this._roundPrice(b.price),c.isPercent()&&(b.price=c.priceRange().convertToPercent(b.price,d)),W47.prototype.setPoint.call(this,1,b),this.recalculate()}};TradingView.LineToolRiskReward.PriceProperty=function(a,b){W47.PointPriceProperty.call(this,a,b)};inherit(TradingView.LineToolRiskReward.PriceProperty,W47.PointPriceProperty);
TradingView.LineToolRiskReward.PriceProperty.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.price=parseFloat(a);this._lineSource.setPoint(this._pointIndex,b);this._lineSource.recalculate();this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging()};TradingView.LineToolRiskReward.StopPriceProperty=function(a){TradingView.LineToolRiskReward.PriceProperty.call(this,a,1)};
inherit(TradingView.LineToolRiskReward.StopPriceProperty,TradingView.LineToolRiskReward.PriceProperty);TradingView.LineToolRiskReward.StopPriceProperty.prototype.value=function(){var a=this._lineSource.stopPrice();return parseFloat(this._lineSource.priceScale().formatter().format(a))};
TradingView.LineToolRiskReward.StopPriceProperty.prototype.setValue=function(a){a=Math.round(Math.abs(a-this._lineSource.entryPrice())*this._lineSource.D0.mainSeries().base());this._lineSource.properties().stopLevel.setValue(a);this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)};TradingView.LineToolRiskReward.TargetPriceProperty=function(a){TradingView.LineToolRiskReward.PriceProperty.call(this,a,2)};
inherit(TradingView.LineToolRiskReward.TargetPriceProperty,TradingView.LineToolRiskReward.PriceProperty);TradingView.LineToolRiskReward.TargetPriceProperty.prototype.value=function(){var a=this._lineSource.profitPrice();return parseFloat(this._lineSource.priceScale().formatter().format(a))};
TradingView.LineToolRiskReward.TargetPriceProperty.prototype.setValue=function(a){a=Math.round(Math.abs(a-this._lineSource.entryPrice())*this._lineSource.D0.mainSeries().base());this._lineSource.properties().profitLevel.setValue(a);this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)};TradingView.LineToolRiskReward.prototype.pointsCount=function(){return 1};TradingView.LineToolRiskReward.prototype.title=function(){return"Risk/Reward"};
TradingView.LineToolRiskReward.prototype.addPoint=function(a){var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}a.price=this._roundPrice(a.price);this._points.append(a);b={price:a.price,index:a.index+50};this._points.append(b);if(a=this.calculateActualEntry(a,b))this._points.append(a),(b=this.findClosePoint(a,b))&&this._points.append(b);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};
TradingView.LineToolRiskReward.prototype._roundPrice=function(a){var b=this.D0.mainSeries().base();return Math.round(a*b)/b};
TradingView.LineToolRiskReward.prototype.recalculate=function(){if(this.properties().interval.value()==this.D0.mainSeries().interval()&&0!=this.points().size()){var a=this.properties().targetPrice.value(),b=this.properties().stopPrice.value(),c=new List;c.append(this._points.item(0));c.append(this._points.item(1));var d=this.calculateActualEntry(this.points().item(0),this.points().item(1));d&&(c.append(d),(d=this.findClosePoint(d,this.points().item(1)))&&c.append(d));this._points=c;a!==this.properties().targetPrice.value()&&
this.properties().targetPrice._listeners.fire(this.properties().targetPrice);b!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice)}};TradingView.LineToolRiskReward.prototype.startMoving=function(a){a.price=this._roundPrice(a.price);W47.prototype.startMoving.call(this,a)};TradingView.LineToolRiskReward.prototype.move=function(a){a.price=this._roundPrice(a.price);W47.prototype.move.call(this,a);this.recalculate();this._entryPriceAxisView.update()};
TradingView.LineToolRiskReward.prototype.correctPoints=function(a){W47.prototype.correctPoints.call(this,(new List).append(a.item(0)).append(a.item(1)))};TradingView.LineToolRiskReward.prototype.entryPrice=function(){return this.points().item(0).price};
TradingView.LineToolRiskReward.prototype.findClosePoint=function(a,b){for(var c=this.D0.mainSeries().bars(),d=parseInt(c.first(),10),e=Math.max(a.index,d),d=parseInt(c.last(),10);e<=Math.min(d,b.index);e++){var g=c.valueAt(e),g=this.checkStopPrice(g);if(null!=g)return{index:e,price:g}}return null};
TradingView.LineToolRiskReward.prototype.calculateActualEntry=function(a,b){for(var c=this.D0.mainSeries().bars(),d=parseInt(c.first(),10),e=Math.max(a.index,d),d=a.price,g=parseInt(c.last(),10);e<=Math.min(g,b.index);e++){var h=c.valueAt(e);if(h[HIGH_PLOT]>=d&&h[LOW_PLOT]<=d)return{index:e,price:d}}return null};
TradingView.LineToolRiskRewardShort=function(a,b){this._constructor="LineToolRiskRewardShort";var c=b?b:new $52("linetoolriskrewardshort");TradingView.LineToolRiskReward.call(this,a,c)};inherit(TradingView.LineToolRiskRewardShort,TradingView.LineToolRiskReward);TradingView.LineToolRiskRewardShort.prototype.title=function(){return"Risk/Reward short"};TradingView.LineToolRiskRewardShort.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this.D0.mainSeries().base()};
TradingView.LineToolRiskRewardShort.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardShort.prototype.calculatePL=function(a){return this.entryPrice()-a};TradingView.LineToolRiskRewardShort.prototype.preparseStopPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()+1/this.D0.mainSeries().base();return Math.max(a,b)};
TradingView.LineToolRiskRewardShort.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()-1/this.D0.mainSeries().base();return Math.min(a,b)};TradingView.LineToolRiskRewardShort.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[HIGH_PLOT]>=b?this.stopPrice():a[LOW_PLOT]<=c?this.profitPrice():null};
TradingView.LineToolRiskRewardLong=function(a,b){this._constructor="LineToolRiskRewardLong";var c=b?b:new $52("linetoolriskrewardlong");TradingView.LineToolRiskReward.call(this,a,c)};inherit(TradingView.LineToolRiskRewardLong,TradingView.LineToolRiskReward);TradingView.LineToolRiskRewardLong.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this.D0.mainSeries().base()};
TradingView.LineToolRiskRewardLong.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardLong.prototype.calculatePL=function(a){return a-this.entryPrice()};TradingView.LineToolRiskRewardLong.prototype.preparseStopPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()-1/this.D0.mainSeries().base();return Math.min(a,b)};
TradingView.LineToolRiskRewardLong.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()+1/this.D0.mainSeries().base();return Math.max(a,b)};TradingView.LineToolRiskRewardLong.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[LOW_PLOT]<=b?this.stopPrice():a[HIGH_PLOT]>=c?this.profitPrice():null};TradingView.LineToolRiskRewardLong.prototype.title=function(){return"Risk/Reward long"};function $99(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($99,$90);
$99.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.W99.properties(),b=new CompositeRenderer,c=new List;c.append(this._points.item(0));c.append(this._points.item(1));c.append(3>this._points.size()?this._points.item(1):this._points.item(2));var d=this,e=function(b,c){return{points:(new List).append(b),text:c,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&
a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:d.W99.properties().color.value(),backgroundRoundRect:4}},g=function(a,b){return{points:(new List).append(a).append(b),width:d.D0.timeScale().width(),height:d.W99.priceScale().height(),color:d.W99.properties().color.value(),linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL}},h={};h.points=c;h.color=a.color.value();h.linewidth=
a.linewidth.value();h.backcolor=a.backgroundColor.value();h.fillBackground=a.fillBackground.value();h.transparency=a.transparency.value();b.append(new TriangleRenderer(h));3<this._points.size()&&(c=new List,c.append(this._points.item(2)),c.append(this._points.item(3)),c.append(5==this._points.size()?this._points.item(4):this._points.item(3)),h={},h.points=c,h.color=a.color.value(),h.linewidth=a.linewidth.value(),h.backcolor=a.backgroundColor.value(),h.fillBackground=a.fillBackground.value(),h.transparency=
a.transparency.value(),b.append(new TriangleRenderer(h)));3<=this._points.size()&&(c=this._points.item(0).add(this._points.item(2)).scaled(.5),c=e(c,this._ABRetracement),b.append(new TextRenderer(c,this._rendererCache)));4<=this._points.size()&&(c=this._points.item(1).add(this._points.item(3)).scaled(.5),h=g(this._points.item(1),this._points.item(3)),b.append(new TrendLineRenderer(h)),c=e(c,this._BCRetracement),b.append(new TextRenderer(c,this._rendererCache)));5<=this._points.size()&&(c=this._points.item(2).add(this._points.item(4)).scaled(.5),
c=e(c,this._CDRetracement),b.append(new TextRenderer(c,this._rendererCache)),h=g(this._points.item(0),this._points.item(4)),b.append(new TrendLineRenderer(h)),c=this._points.item(0).add(this._points.item(4)).scaled(.5),c=e(c,this._XDRetracement),b.append(new TextRenderer(c,this._rendererCache)));c=e(this._points.item(0),"X");this._points.item(1).y>this._points.item(0).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5);b.append(new TextRenderer(c,this._rendererCache));c=e(this._points.item(1),
"A");this._points.item(1).y<this._points.item(0).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5);b.append(new TextRenderer(c,this._rendererCache));2<this._points.size()&&(c=e(this._points.item(2),"B"),this._points.item(2).y<this._points.item(1).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));3<this._points.size()&&(c=e(this._points.item(3),"C"),this._points.item(3).y<this._points.item(2).y?(c.vertAlign=
"bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));4<this._points.size()&&(c=e(this._points.item(4),"D"),this._points.item(4).y<this._points.item(3).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));this.isAnchorsRequired()&&(c=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&c.removeAt(c.size()-1),b.append(this.createLineAnchor({points:c})));return b};
$99.prototype.update=function(){$90.prototype.update.call(this);if(3<=this.W99.points().size()){var a=this.W99.points().item(0),b=this.W99.points().item(1),c=this.W99.points().item(2);this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3}if(4<=this.W99.points().size()){var d=this.W99.points().item(3);this._BCRetracement=Math.round(1E3*Math.abs((d.price-c.price)/(c.price-b.price)))/1E3}if(5<=this.W99.points().size()){var e=
this.W99.points().item(4);this._CDRetracement=Math.round(1E3*Math.abs((e.price-d.price)/(d.price-c.price)))/1E3;this._XDRetracement=Math.round(1E3*Math.abs((e.price-b.price)/(b.price-a.price)))/1E3}};TradingView.LineTool5PointsPattern=function(a,b){this._constructor="LineTool5PointsPattern";var c=b?b:new $52("linetool5pointspattern");W47.call(this,a,new $99(this,a),c)};inherit(TradingView.LineTool5PointsPattern,W47);
TradingView.LineTool5PointsPattern.prototype.pointsCount=function(){return 5};TradingView.LineTool5PointsPattern.prototype.title=function(){return"XABCD Pattern"};
TradingView.LineTool5PointsPattern.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}};
TradingView.LineTool5PointsPattern.prototype._updateTooltip=function(){var a=this._tooltipFieldsHash,b=this.points().m_values;if(b[0]){var c=this.D0.timeScale().indexToUserTime(b[0].index);a.time0.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0;a.price0.value=this.D0.mainSeries()._formatter.format(b[0].price)}if(b[1]){var d=this.D0.timeScale().indexToUserTime(b[1].index);a.time1.value=d?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(d):0;
a.price1.value=this.D0.mainSeries()._formatter.format(b[1].price)}b[2]&&(c=this.D0.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price2.value=this.D0.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D0.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price3.value=this.D0.mainSeries()._formatter.format(b[3].price));
b[4]&&(c=this.D0.timeScale().indexToUserTime(b[4].index),a.time4.value=d?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price4.value=this.D0.mainSeries()._formatter.format(b[4].price))};TradingView.LineTool5PointsPattern.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};function $91(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($91,$90);
$91.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.W99.properties(),b=new CompositeRenderer,c=this._points,d=this,e=function(b,c){return{points:(new List).append(b),text:c,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:d.W99.properties().color.value(),backgroundRoundRect:4}},g=function(b,
c,e,g){return{points:(new List).append(b).append(c),width:d.D0.timeScale().width(),height:d.W99.priceScale().height(),color:generateColor(d.W99.properties().color.value(),e),linewidth:g?g:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL}},h=g(c.item(0),c.item(1),0);b.append(new TrendLineRenderer(h));3<=c.size()&&(h=g(c.item(1),c.item(2),0),b.append(new TrendLineRenderer(h)));
4==c.size()&&(h=g(c.item(2),c.item(3),0),b.append(new TrendLineRenderer(h)));h=e(this._points.item(0),"A");this._points.item(1).y>this._points.item(0).y?(h.vertAlign="bottom",h.offsetY=-10):(h.vertAlign="top",h.offsetY=5);b.append(new TextRenderer(h,this._rendererCache));h=e(this._points.item(1),"B");this._points.item(1).y<this._points.item(0).y?(h.vertAlign="bottom",h.offsetY=-10):(h.vertAlign="top",h.offsetY=5);b.append(new TextRenderer(h,this._rendererCache));2<this._points.size()&&(h=e(this._points.item(2),
"C"),this._points.item(2).y<this._points.item(1).y?(h.vertAlign="bottom",h.offsetY=-10):(h.vertAlign="top",h.offsetY=5),b.append(new TextRenderer(h,this._rendererCache)));3<this._points.size()&&(h=e(this._points.item(3),"D"),this._points.item(3).y<this._points.item(2).y?(h.vertAlign="bottom",h.offsetY=-10):(h.vertAlign="top",h.offsetY=5),b.append(new TextRenderer(h,this._rendererCache)));3<=this._points.size()&&(c=this._points.item(0).add(this._points.item(2)).scaled(.5),h=g(this._points.item(0),
this._points.item(2),70,1),b.append(new TrendLineRenderer(h)),h=e(c,this._ABRetracement),b.append(new TextRenderer(h,this._rendererCache)));4<=this._points.size()&&(c=this._points.item(1).add(this._points.item(3)).scaled(.5),h=g(this._points.item(1),this._points.item(3),70,1),b.append(new TrendLineRenderer(h)),h=e(c,this._CDRetracement),b.append(new TextRenderer(h,this._rendererCache)));this.isAnchorsRequired()&&(c=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&c.removeAt(c.size()-
1),b.append(this.createLineAnchor({points:c})));return b};
$91.prototype.update=function(){$90.prototype.update.call(this);if(3<=this.W99.points().size()){var a=this.W99.points().item(0),b=this.W99.points().item(1),c=this.W99.points().item(2);this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3}4==this.W99.points().size()&&(a=this.W99.points().item(3),this._CDRetracement=Math.round(1E3*Math.abs((a.price-c.price)/(c.price-b.price)))/1E3)};
TradingView.LineToolABCD=function(a,b){this._constructor="LineToolABCD";var c=b?b:new $52("linetoolabcd");W47.call(this,a,new $91(this,a),c)};inherit(TradingView.LineToolABCD,W47);TradingView.LineToolABCD.prototype.pointsCount=function(){return 4};TradingView.LineToolABCD.prototype.title=function(){return"ABCD Pattern"};
TradingView.LineToolABCD.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}};
TradingView.LineToolABCD.prototype._updateTooltip=function(){var a=this._tooltipFieldsHash,b=this.points().m_values;if(b[0]){var c=this.D0.timeScale().indexToUserTime(b[0].index);a.time0.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0;a.price0.value=this.D0.mainSeries()._formatter.format(b[0].price)}b[1]&&(c=this.D0.timeScale().indexToUserTime(b[1].index),a.time1.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price1.value=
this.D0.mainSeries()._formatter.format(b[1].price));b[2]&&(c=this.D0.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price2.value=this.D0.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D0.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price3.value=this.D0.mainSeries()._formatter.format(b[3].price))};
TradingView.LineToolABCD.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};function $96(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($96,$90);
$96.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.W99.properties(),b=new CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:d,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.W99.properties().color.value(),backgroundRoundRect:4}},e=function(b,
d){return{points:(new List).append(b).append(d),width:c.D0.timeScale().width(),height:c.W99.priceScale().height(),color:c.W99.properties().color.value(),linewidth:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL}},g=e(this._points.item(0),this._points.item(1));b.append(new TrendLineRenderer(g));3<=this._points.size()&&(g=e(this._points.item(1),this._points.item(2)),b.append(new TrendLineRenderer(g)));
4==this._points.size()&&(g=e(this._points.item(2),this._points.item(3)),b.append(new TrendLineRenderer(g)),this._intersectPoint?(e=new List,e.append(this._startPoint1),e.append(this._startPoint2),e.append(this._intersectPoint),g={},g.points=e,g.color=a.color.value(),g.linewidth=a.linewidth.value(),g.backcolor=a.backgroundColor.value(),g.fillBackground=a.fillBackground.value(),g.transparency=a.transparency.value(),b.append(new TriangleRenderer(g))):this._intersectPoint1&&this._intersectPoint2&&(e=
new List,e.append(this._startPoint1),e.append(this._startPoint2),e.append(this._intersectPoint2),e.append(this._intersectPoint1),g={filled:!0,fillBackground:!0},g.points=e,g.color=a.color.value(),g.linewidth=a.linewidth.value(),g.backcolor=a.backgroundColor.value(),g.transparency=a.transparency.value(),b.append(new PoligonRenderer(g))));e=d(this._points.item(0),"A");this._points.item(1).y>this._points.item(0).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5);b.append(new TextRenderer(e,
this._rendererCache));e=d(this._points.item(1),"B");this._points.item(1).y<this._points.item(0).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5);b.append(new TextRenderer(e,this._rendererCache));2<this._points.size()&&(e=d(this._points.item(2),"C"),this._points.item(2).y<this._points.item(1).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5),b.append(new TextRenderer(e,this._rendererCache)));3<this._points.size()&&(e=d(this._points.item(3),"D"),this._points.item(3).y<
this._points.item(2).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5),b.append(new TextRenderer(e,this._rendererCache)));this.isAnchorsRequired()&&(e=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&e.removeAt(e.size()-1),b.append(this.createLineAnchor({points:e})));return b};
$96.prototype.update=function(){$90.prototype.update.call(this);this._valid=!1;if(4==this._points.size()){var a=this._points.item(0),b=this._points.item(1),c=this._points.item(2),d=this._points.item(3);if(!(1>Math.abs(c.x-a.x)||1>Math.abs(d.x-b.x))){var e=Math.min(a.x,b.x),e=Math.min(e,c.x),e=Math.min(e,d.x),g=(c.y-a.y)/(c.x-a.x),h=a.y+(e-a.x)*g,k=(d.y-b.y)/(d.x-b.x),l=b.y+(e-b.x)*k;if(!(1E-6>Math.abs(g-k))){this._startPoint1=new MathEx.Point(e,h);this._startPoint2=
new MathEx.Point(e,l);var m=(b.y-a.y+(a.x*g-b.x*k))/(g-k);this._valid=!0;delete this._intersectPoint;delete this._intersectPoint1;delete this._intersectPoint2;m<e&&(e=Math.max(a.x,b.x),e=Math.max(e,c.x),e=Math.max(e,d.x),h=a.y+(e-a.x)*g,l=b.y+(e-b.x)*k,this._startPoint1=new MathEx.Point(e,h),this._startPoint2=new MathEx.Point(e,l));this._intersectPoint=new MathEx.Point(m,a.y+(m-a.x)*g)}}}};
TradingView.LineToolTrianglePattern=function(a,b){this._constructor="LineToolTrianglePattern";var c=b?b:new $52("linetooltrianglepattern");W47.call(this,a,new $96(this,a),c)};inherit(TradingView.LineToolTrianglePattern,W47);TradingView.LineToolTrianglePattern.prototype.pointsCount=function(){return 4};TradingView.LineToolTrianglePattern.prototype.title=function(){return"Triangle Pattern"};function $95(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($95,$90);
$95.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.W99.properties(),b=new CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:d,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.W99.properties().color.value(),backgroundRoundRect:4}},e=function(b,
d,e,g){return{points:(new List).append(b).append(d),width:c.D0.timeScale().width(),height:c.W99.priceScale().height(),color:generateColor(c.W99.properties().color.value(),e),linewidth:g?g:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL}},g=1;g<this._points.size();g++){var h=e(this._points.item(g-1),this._points.item(g),0);b.append(new TrendLineRenderer(h))}this._retrace1&&(h=
e(this._points.item(1),this._points.item(3),70,1),b.append(new TrendLineRenderer(h)),g=this._points.item(1).add(this._points.item(3)).scaled(.5),g=d(g,this._retrace1),b.append(new TextRenderer(g,this._rendererCache)));this._retrace2&&(h=e(this._points.item(3),this._points.item(5),70,1),b.append(new TrendLineRenderer(h)),g=this._points.item(5).add(this._points.item(3)).scaled(.5),g=d(g,this._retrace2),b.append(new TextRenderer(g,this._rendererCache)));this.isAnchorsRequired()&&(d=this._points.clone(),
this.D0.lineBeingCreated()==this.W99&&d.removeAt(d.size()-1),b.append(this.createLineAnchor({points:d})));return b};
$95.prototype.update=function(){$90.prototype.update.call(this);delete this._retrace1;delete this._retrace2;if(4<=this.W99.points().size()){var a=this.W99.points().item(1),b=this.W99.points().item(2),c=this.W99.points().item(3);this._retrace1=Math.round(100*Math.abs((c.price-b.price)/(b.price-a.price)))/100}6<=this.W99.points().size()&&(c=this.W99.points().item(3),a=this.W99.points().item(4),b=this.W99.points().item(5),this._retrace2=
Math.round(100*Math.abs((b.price-a.price)/(a.price-c.price)))/100)};TradingView.LineToolThreeDrivers=function(a,b){this._constructor="LineToolThreeDrivers";var c=b?b:new $52("linetoolthreedrivers");W47.call(this,a,new $95(this,a),c)};inherit(TradingView.LineToolThreeDrivers,W47);TradingView.LineToolThreeDrivers.prototype.pointsCount=function(){return 7};TradingView.LineToolThreeDrivers.prototype.title=function(){return"Three Drivers Pattern"};function $94(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($94,$90);
$94.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.W99.properties(),b=new CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:$.t(d),color:a.textcolor.value(),horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.W99.properties().color.value(),backgroundRoundRect:4}},e=function(b,d,e,g){return{points:(new List).append(b).append(d),
width:c.D0.timeScale().width(),height:c.W99.priceScale().height(),color:generateColor(c.W99.properties().color.value(),e),linewidth:g?g:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL}},g=function(b,c,d){var e=new List;e.append(b);e.append(c);e.append(d);b={};b.points=e;b.color=a.color.value();b.linewidth=0;b.backcolor=a.backgroundColor.value();b.fillBackground=a.fillBackground.value();
b.transparency=a.transparency.value();return b},h=1;h<this._points.size();h++){var k=e(this._points.item(h-1),this._points.item(h),0);b.append(new TrendLineRenderer(k))}if(5<=this._points.size()){var l,m=h=!1;this._intersect1?k=this._intersect1:(k=this._points.item(2),h=!0);this._intersect2?l=this._intersect2:(l=this._points.item(4),m=!0);k=e(k,l,0);k.extendleft=h;k.extendright=m;b.append(new TrendLineRenderer(k));e=g(this._points.item(2),this._points.item(3),this._points.item(4));b.append(new TriangleRenderer(e))}this._intersect1&&
(e=g(this._intersect1,this._points.item(1),this._points.item(2)),b.append(new TriangleRenderer(e)));this._intersect2&&(e=g(this._points.item(4),this._points.item(5),this._intersect2),b.append(new TriangleRenderer(e)));2<=this._points.size()&&(g=this._points.item(1),g=d(g,"Left Shoulder"),this._points.item(1).y<this._points.item(0).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5),b.append(new TextRenderer(g,this._rendererCache)));4<=this._points.size()&&(g=this._points.item(3),
g=d(g,"Head"),this._points.item(3).y<this._points.item(2).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5),b.append(new TextRenderer(g,this._rendererCache)));6<=this._points.size()&&(g=this._points.item(5),g=d(g,"Right Shoulder"),this._points.item(5).y<this._points.item(4).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5),b.append(new TextRenderer(g,this._rendererCache)));this.isAnchorsRequired()&&(d=this._points.clone(),this.D0.lineBeingCreated()==this.W99&&
d.removeAt(d.size()-1),b.append(this.createLineAnchor({points:d})));return b};
$94.prototype.update=function(){$90.prototype.update.call(this);delete this._intersect1;delete this._intersect2;if(5<=this._points.size()){var a=this._points.item(0),b=this._points.item(1),c=this._points.item(2);this._points.item(3);var d=this._points.item(4),a=MathEx.intersectSegment(c,d,a,b);null!==a&&(b=d.substract(c),this._intersect1=c.add(b.scaled(a)))}7==this._points.size()&&(a=this._points.item(5),b=this._points.item(6),a=MathEx.intersectSegment(c,
d,a,b),null!==a&&(b=d.substract(c),this._intersect2=c.add(b.scaled(a))))};TradingView.LineToolHeadAndShoulders=function(a,b){this._constructor="LineToolHeadAndShoulders";var c=b?b:new $52("linetoolheadandshoulders");W47.call(this,a,new $94(this,a),c)};inherit(TradingView.LineToolHeadAndShoulders,W47);TradingView.LineToolHeadAndShoulders.prototype.pointsCount=function(){return 7};TradingView.LineToolHeadAndShoulders.prototype.title=function(){return"Head & Shoulders"};function W42(a,b){$90.call(this,a,b);this._rendererCache={}}inherit(W42,$90);
W42.prototype.update=function(){$90.prototype.update.call(this);if(!(3>this.W99.points().size()||!this.W99.priceScale()||this.W99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.W99.points().item(0),b=this.W99.points().item(1),c=this.W99.points().item(2);this._levels=[];if(b.index!=a.index&&(a=b.index-a.index,b=this.W99.properties(),c=c.index,!this.D0.timeScale().visibleBars().isEmpty()))for(var d=1;11>=d;d++){var e=
b["level"+d];if(e.visible.value()){var g=e.coeff.value(),h=e.color.value(),k=Math.round(c+g*a),e={x:this.D0.timeScale().indexToCoordinate(k),coeff:g,color:h,linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:d};b.showCoeffs.value()&&(e.text=g,e.y=this.W99.priceScale().height());this._levels.push(e)}}}};
W42.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.W99.properties(),e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
a.append(new TrendLineRenderer(e));if(3>this._points.size())return this.addAnchors(a),a;e=this._points.item(2);e={points:(new List).append(c).append(e),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};a.append(new TrendLineRenderer(e));for(var e=d.fillBackground.value(),
g=d.transparency.value(),h=0;h<this._levels.length;h++){if(0<h&&e){var b=new MathEx.Point(this._levels[h-1].x,0),c=new MathEx.Point(this._levels[h].x,this.W99.priceScale().height()),k={nohittest:!0};k.points=(new List).append(b).append(c);k.color=this._levels[h].color;k.linewidth=0;k.backcolor=this._levels[h].color;k.fillBackground=!0;k.transparency=g;a.append(new RectangleRenderer(k))}if(void 0!==this._levels[h].text){var l,m,n,c=d.horzLabelsAlign.value(),c="left"==c?"right":"right"==c?"left":
"center";switch(c){case "left":m=3;break;case "center":m=0;break;case "right":m=-3}switch(d.vertLabelsAlign.value()){case "top":l=new MathEx.Point(this._levels[h].x,0);n=5;break;case "middle":l=new MathEx.Point(this._levels[h].x,.5*this._levels[h].y);n=0;break;case "bottom":l=new MathEx.Point(this._levels[h].x,this._levels[h].y),n=-10}c={points:(new List).append(l),text:""+this._levels[h].text,color:this._levels[h].color,vertAlign:"middle",horzAlign:c,font:d.font.value(),offsetX:m,offsetY:n,fontsize:12};
a.append(new TextRenderer(c,this._rendererCache))}c={};c.points=(new List).append(new MathEx.Point(this._levels[h].x,0));c.color=this._levels[h].color;c.linewidth=this._levels[h].linewidth;c.linestyle=this._levels[h].linestyle;b=new HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[h].index);a.append(new VertLineRenderer(c,b))}this.addAnchors(a);return a};
TradingView.LineToolTrendBasedFibTime=function(a,b){this._constructor="LineToolTrendBasedFibTime";var c=b?b:new $52("linetooltrendbasedfibtime");W47.call(this,a,new W42(this,a),c);this.version=TradingView.LineToolTrendBasedFibTime.version};inherit(TradingView.LineToolTrendBasedFibTime,W47);TradingView.LineToolTrendBasedFibTime.version=1;TradingView.LineToolTrendBasedFibTime.prototype.pointsCount=function(){return 3};
TradingView.LineToolTrendBasedFibTime.prototype.title=function(){return"Trend-Based Fib Time"};TradingView.LineToolTrendBasedFibTime.prototype.migrateVersion=function(a,b,c){};TradingView.LineToolTrendBasedFibTime.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function GannArcRenderer(a){this._data=a}
GannArcRenderer.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.translate(this._data.center.x,this._data.center.y);var b=this._data.edge.substract(this._data.center),b=b.y/b.x,c=this._data.point.substract(this._data.center);c.y/=b;var c=c.length(),d=this._data.prevPoint.substract(this._data.center);d.y/=b;d=d.length();a.scale(1,b);this._data.fillBack&&(this._data.point.x<this._data.center.x&&(c=-c,d=-d),a.beginPath(),a.moveTo(d,0),a.lineTo(c,
0),a.arcTo(c,c,0,c,Math.abs(c)),a.lineTo(0,d),a.arcTo(d,d,d,0,Math.abs(d)),a.fillStyle=generateColor(this._data.color,this._data.transparency),a.fill());a.beginPath();this._data.point.x>this._data.center.x?a.arc(0,0,Math.abs(c),0,Math.PI/2,!1):a.arc(0,0,Math.abs(c),-Math.PI/2,-Math.PI,!0);a.scale(1,1/b);a.stroke()};
GannArcRenderer.prototype.hitTest=function(a){a=a.substract(this._data.center);var b=this._data.edge.substract(this._data.center),c=b.y/b.x;a.y/=c;var d=this._data.point.substract(this._data.center);d.y/=c;var d=d.length(),e=a.length(),g=this._data.prevPoint.substract(this._data.center);g.y/=c;c=g.length();if(this._data.fillBack){if(e>=c&&e<=d&&0<=b.x*a.x&&0<=b.y*a.y)return new HitTestResult(HitTestResult.MOVEPOINT)}else if(5>Math.abs(e-d)&&0<=b.x*a.x&&0<=b.y*a.y)return new HitTestResult(HitTestResult.MOVEPOINT);
return null};function $80(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($80,$90);$80.prototype.update=function(){$90.prototype.update.call(this);this.W99._cornerPoint&&this._points.append(this.W99.pointToScreenPoint(this.W99._cornerPoint)[0])};
$80.prototype.renderer=function(){var a=this.W99.properties(),b=new CompositeRenderer;if(2>this._points.size())return this.addAnchors(b),b;for(var c=this._points.item(0),d=3==this._points.size()?this._points.item(2):this._points.item(1),e=this._points.item(1),g=0;6>g;g++){var h=a.levels[g];if(h.visible.value()){var k=g/5,l=c.x+k*(d.x-c.x),m=c.y,n=d.y,l={points:(new List).append(new MathEx.Point(l,m)).append(new MathEx.Point(l,n)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),
color:h.color.value(),linewidth:h.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};b.append(new TrendLineRenderer(l));m=c.y+k*(d.y-c.y);l=c.x;k=d.x;l={points:(new List).append(new MathEx.Point(l,m)).append(new MathEx.Point(k,m)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:h.color.value(),linewidth:h.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,
extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};b.append(new TrendLineRenderer(l))}}for(g in a.fanlines._childs)n=a.fanlines[g],n.visible.value()&&(h=n.x.value(),k=n.y.value(),h>k?(l=d.x,k/=h,m=c.y+k*(d.y-c.y)):(m=d.y,k=h/k,l=c.x+k*(d.x-c.x)),l={points:(new List).append(c).append(new MathEx.Point(l,m)),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:n.color.value(),linewidth:n.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,
extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},b.append(new TrendLineRenderer(l)));n=c;for(g in a.arcs._childs){var q=a.arcs[g];q.visible.value()&&(h=q.x.value()/5,k=q.y.value()/5,l=c.x+h*(d.x-c.x),m=c.y+k*(d.y-c.y),(new MathEx.Point(l,m)).substract(c).length(),l={center:c,point:new MathEx.Point(l,m),edge:d,color:q.color.value(),linewidth:q.width.value(),fillBack:a.arcsBackground.fillBackground.value(),transparency:a.arcsBackground.transparency.value(),
prevPoint:n},b.append(new GannArcRenderer(l)),n=l.point)}this.isAnchorsRequired()&&(a=(new List).append(c).append(e),this.D0.lineBeingCreated()==this.W99&&a.removeAt(a.size()-1),b.append(this.createLineAnchor({points:a})));return b};TradingView.LineToolGannComplex=function(a,b){this._constructor="LineToolGannComplex";var c=b?b:new $52("linetoolganncomplex");W47.call(this,a,new $80(this,a),c)};inherit(TradingView.LineToolGannComplex,W47);
TradingView.LineToolGannComplex.prototype._recalcSecondPoint=function(){var a=this.D0.mainSeries().properties().style.value(),b=this.D0.mainSeries().interval();if(a!==this._currentStyle||b!==this._currentInterval)a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(2))[0].substract(a),a=a.add(b.scaled(.2/Math.sqrt(2))),a=this.screenPointToPoint(a),this._points.setItem(1,a)};TradingView.LineToolGannComplex.prototype.pointsCount=function(){return 2};
TradingView.LineToolGannComplex.prototype.title=function(){return"Gann Square"};TradingView.LineToolGannComplex.prototype._fixThirdPoint=function(a){if(!(2>this.points().size())){var b=this.pointToScreenPoint(this.points().item(0))[0],c=this.pointToScreenPoint(this.points().item(1))[0],d=c.substract(b);a?b=b.add(d.scaled(5*Math.sqrt(2))):(a=0>d.x?-1:1,d=0>d.y?-1:1,c=c.substract(b).length(),b=b.add(new MathEx.Point(5*c*a,5*c*d)));this._cornerPoint=this.screenPointToPoint(b)}};
TradingView.LineToolGannComplex.prototype.setPoint=function(a,b,c){a=W47.prototype.setPoint.call(this,a,b,c);this._fixThirdPoint(c&&c.shift);this._points.setItem(2,this._cornerPoint);delete this._cornerPoint;c=this.D0.mainSeries().properties().style.value();b=this.D0.mainSeries().interval();this._currentStyle=c;this._currentInterval=b;return a};
TradingView.LineToolGannComplex.prototype.setLastPoint=function(a,b){var c=W47.prototype.setLastPoint.call(this,a,b);this._fixThirdPoint(b&&b.shift);return c};
TradingView.LineToolGannComplex.prototype.addPoint=function(a,b){var c=this.D0.mainSeries().properties().style.value(),d=this.D0.mainSeries().interval();this._currentStyle=c;this._currentInterval=d;c=this.priceScale();c.isPercent()&&(d=this.ownerSource().firstValue(),a.price=c.priceRange().convertFromPercent(a.price,d));c=b&&b.shift;this._points.append(a);this._lastPoint=null;(d=this._points.size()==this.pointsCount())?(this._fixThirdPoint(c),this._points.append(this._cornerPoint),delete this._cornerPoint,
this.normalizePoints(),this.createServerPoints()):this._lastPoint=a;return d};TradingView.LineToolGannComplex.prototype.onData=function(a){W47.prototype.onData.call(this,a);this._recalcSecondPoint()};function $70(a,b){$90.call(this,a,b);this._rendererCache={}}inherit($70,$90);
$70.prototype.update=function(){$90.prototype.update.call(this);if(!(3>this._points.size()||3>this.W99.points().size())){var a=this._points.item(0),b=this._points.item(1);this._points.item(2);this.norm=this._points.item(2).substract(this._points.item(0));this._labels=[];for(var c=this.W99.properties(),a=this.W99.points().item(0),b=this.W99.points().item(1),a=a.price-b.price,b=b.price,d=function(a){return c.coeffsAsPercents.value()?""+Math.round(1E4*a)/
100+"%":""+a},e=1;11>=e;e++){var g=c["level"+e].coeff.value(),h=b+g*a;if(this.W99.priceScale().isPercent())var k=this.W99.ownerSource().firstValue(),h=this.W99.priceScale().priceRange().convertToPercent(h,k);var l;c.showCoeffs.value()&&c.showPrices.value()?l=""+d(g)+"("+this.W99.priceScale().formatter().format(h)+")":c.showCoeffs.value()?l=""+d(g):c.showPrices.value()&&(l=""+this.W99.priceScale().formatter().format(h));this._labels.push(l)}}};
$70.prototype.renderer=function(){function a(a,d,e){var h,l,m=c.vertLabelsAlign.value();switch(c.horzLabelsAlign.value()){case "left":h=a;l="right";break;case "center":h=a.add(d).scaled(.5);l="center";break;case "right":h=d,l="left"}a={points:(new List).append(h),text:e,color:k.color,vertAlign:m,horzAlign:l,font:c.font.value(),offsetX:-5,offsetY:"top"==m?0:-5,fontsize:12};b.append(new TextRenderer(a,g._rendererCache))}var b=new CompositeRenderer;if(2>this._points.size())return this.addAnchors(b),
b;var c=this.W99.properties(),d=this._points.item(0),e=this._points.item(1);if(3>this._points.size())return d={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:c.level1.color.value(),linewidth:c.level1.linewidth.value(),linestyle:c.level1.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},b.append(new TrendLineRenderer(d)),
this.addAnchors(b),b;for(var g=this,h=1;11>h;h++){var k=c["level"+h];if(k.visible.value()){for(var l=h+1;11>=l;l++){var m=c["level"+l];if(m.visible.value())break}if(!m)break;var n=this.norm.scaled(k.coeff.value()),l=d.add(n),n=e.add(n),q=this.norm.scaled(m.coeff.value()),r=d.add(q),q=e.add(q),u={};u.points=new List;u.points.append(l);u.points.append(n);u.points.append(r);u.points.append(q);u.color=k.color.value();u.width=this.D0.timeScale().width();u.height=this.W99.priceScale().height();
u.linewidth=k.linewidth.value();u.linestyle=k.linestyle.value();u.extendleft=c.extendLeft.value();u.extendright=c.extendRight.value();u.backcolor=k.color.value();u.transparency=c.transparency.value();u.skipTopLine=!0;u.fillBackground=c.fillBackground.value();u.hittestOnBackground=TradingView.isMobile.any();b.append(new ParallelChannelRenderer(u));(c.showCoeffs.value()||c.showPrices.value())&&a(l,n,this._labels[h-1])}}k=c.level11;k.visible.value()&&(n=this.norm.scaled(k.coeff.value()),l=d.add(n),n=
e.add(n),d={points:(new List).append(l).append(n),width:this.D0.timeScale().width(),height:this.W99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL},b.append(new TrendLineRenderer(d)),(c.showCoeffs.value()||c.showPrices.value())&&a(l,n,this._labels[10]));this.addAnchors(b);return b};
TradingView.LineToolFibChannel=function(a,b){this._constructor="LineToolFibChannel";var c=b?b:new $52("linetoolfibchannel");W47.call(this,a,new $70(this,a),c);this.version=TradingView.LineToolFibChannel.version};inherit(TradingView.LineToolFibChannel,W47);TradingView.LineToolFibChannel.version=1;TradingView.LineToolFibChannel.prototype.pointsCount=function(){return 3};TradingView.LineToolFibChannel.prototype.title=function(){return"Fib Channel"};
TradingView.LineToolFibChannel.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function FibSpiralRenderer(a){this._data=a}FibSpiralRenderer.prototype._fibNumbers=function(){return[0,1,2,3,5,8,13,21,34,55,89]};FibSpiralRenderer.prototype._continiusFib=function(a){var b=this._fibNumbers(),c=Math.floor(a),d=Math.ceil(a);if(d>=b.length)return null;a=Math.pow(a-c,1.15);return b[c]+(b[d]-b[c])*a};
FibSpiralRenderer.prototype.hitTest=function(a){var b=this._data.points.item(0),c=this._data.points.item(1).substract(b),b=a.substract(b);a=c.normalized();var d=a.transponed(),e=b.normalized();a=Math.acos(a.dotProduct(e));0>Math.asin(d.dotProduct(e))&&(a=2*Math.PI-a);b=b.length();for(d=0;4>d;d++)if(e=this._continiusFib(a/(.5*Math.PI)+4*d),e=e*c.length()/5,null!==e&&5>Math.abs(e-b))return new HitTestResult(HitTestResult.MOVEPOINT);return null};
FibSpiralRenderer.prototype.draw=function(a){a.lineCap="round";a.strokeStyle=this._data.color;var b=this._data.points.item(0),c=this._data.points.item(1);a.translate(b.x,b.y);var d=c.substract(b),b=d.length(),d=d.normalized(),c=Math.acos(d.x);0>Math.asin(d.y)&&(c=2*Math.PI-c);a.rotate(c);a.scale(b/5,b/5);a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);d=Math.PI/100;a.moveTo(0,0);for(var e=0;e<50*(this._fibNumbers().length-1);e++){var g=e*d,h=this._continiusFib(e/50),
k=Math.cos(g)*h,g=Math.sin(g)*h;a.lineTo(k,g)}a.scale(5/b,5/b);a.rotate(-c);a.stroke()};function $75(a,b){$90.call(this,a,b)}inherit($75,$90);
$75.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.width=this.D0.timeScale().width();b.height=this.W99.priceScale().height();b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();b.extendleft=!1;b.extendright=!0;b.leftend=W47.LINEEND_NORMAL;b.rightend=W47.LINEEND_NORMAL;
a.append(new TrendLineRenderer(b));b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D0.timeScale().width();b.height=this.W99.priceScale().height();b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();a.append(new FibSpiralRenderer(b));this.isAnchorsRequired()&&(a.append(new TrendLineRenderer(b)),b=b.points.clone(),this.D0.lineBeingCreated()==this.W99&&
b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolFibSpiral=function(a,b){this._constructor="LineToolFibSpiral";var c=b?b:new $52("linetoolfibspiral");W47.call(this,a,new $75(this,a),c)};inherit(TradingView.LineToolFibSpiral,W47);TradingView.LineToolFibSpiral.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpiral.prototype.title=function(){return"Fib Spiral"};function $67(a,b){$90.call(this,a,b);this._label=null;this._rendererCache={}}inherit($67,$90);
$67.prototype.update=function(){$90.prototype.update.call(this);this._label=null;if(!(2>this.W99.points().size())&&this.W99.priceScale()){var a=this.W99.points().item(0),b=this.W99.points().item(1);this._price1=this.W99.priceScale().formatter().format(a.price);this._price2=this.W99.priceScale().formatter().format(b.price);if(3==this.W99.points().size()){var c=this.W99.points().item(2);this._price3=this.W99.priceScale().formatter().format(c.price);
a=b.price-a.price;this._price4=this.W99.priceScale().formatter().format(c.price+a)}}};
$67.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.W99.properties(),e=this.D0,g=this.W99,d=g.properties();if(3<=this._points.size()){var h=this._points.item(2);h.x=c.x;var k=c.y-b.y,l=b.clone();l.y=h.y+k;l.data=3;if(d.fillBackground.value()){var m={},k=e.timeScale().width();g.priceScale().height();var n=d.extendLeft.value(),q=d.extendRight.value();n||q?!n&&q?(m={},m.width=
k,m.p1=b,m.p2=c,m.p3=l,m.p4=h,m.color=d.backgroundColor.value(),m.transparency=d.transparency.value(),m.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(m))):n&&!q?(m={},m.width=k,m.p1=c,m.p2=b,m.p3=h,m.p4=l,m.color=d.backgroundColor.value(),m.transparency=d.transparency.value(),m.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(m))):(m=b.add(c).scaled(.5),n=l.add(h).scaled(.5),q={},q.width=k,q.p1=m,q.p2=c,q.p3=n,q.p4=h,q.color=d.backgroundColor.value(),
q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q)),q={},q.width=k,q.p1=m,q.p2=b,q.p3=n,q.p4=l,q.color=d.backgroundColor.value(),q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q))):(m.points=new List([b,c,h,l]),m.color="rgba(0,0,0,0)",m.linewidth=0,m.linestyle=CanvasEx.LINESTYLE_SOLID,m.filled=!0,m.backcolor=d.backgroundColor.value(),m.fillBackground=!0,m.transparency=
d.transparency.value(),a.append(new PoligonRenderer(m)))}}k=function(a,b){return{points:(new List).append(a).append(b),width:e.timeScale().width(),height:g.priceScale().height(),color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),extendleft:d.extendLeft.value(),extendright:d.extendRight.value(),leftend:d.leftEnd.value(),rightend:d.rightEnd.value()}};a.append(new TrendLineRenderer(k(b,c)));var r=this,m=function(b,c,d,e){r.W99.properties().showPrices.value()&&(d=
{points:(new List).append(b),text:d,color:r.W99.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:r.W99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:r.W99.properties().bold.value(),italic:r.W99.properties().italic.value(),fontsize:r.W99.properties().fontsize.value()},a.append(new TextRenderer(d,r._rendererCache)),d={points:(new List).append(c),text:e,color:r.W99.properties().textcolor.value(),horzAlign:b.x<c.x?"left":
"right",vertAlign:"middle",font:r.W99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:r.W99.properties().bold.value(),italic:r.W99.properties().italic.value(),fontsize:r.W99.properties().fontsize.value()},a.append(new TextRenderer(d,r._rendererCache)))};a.append(new TrendLineRenderer(k(b,c)));m(b,c,this._price1,this._price2);if(2==this._points.size())return this.addAnchors(a),a;a.append(new TrendLineRenderer(k(l,h)));m(h,l,this._price3,this._price4);this.isAnchorsRequired()&&
(h=(new List).append(b).append(c).append(h).append(l),this.D0.lineBeingCreated()==this.W99&&h.removeAt(h.size()-1),a.append(this.createLineAnchor({points:h})));!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&b&&c&&this.W99.getAlertIsActive(function(e){a.append(new PaneRendererClockIcon({point1:b,point2:c,color:e?d.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
TradingView.LineToolDisjointAngle=function(a,b){this._constructor="LineToolDisjointAngle";var c=b?b:new $52("linetooldisjointangle");W47.call(this,a,new $67(this,a),c);this.version=TradingView.LineToolDisjointAngle.version};inherit(TradingView.LineToolDisjointAngle,W47);TradingView.LineToolDisjointAngle.version=1;TradingView.LineToolDisjointAngle.prototype.pointsCount=function(){return 3};TradingView.LineToolDisjointAngle.prototype.title=function(){return"Disjoint Angle"};
TradingView.LineToolDisjointAngle.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return W47.prototype.addPoint.call(this,a)};TradingView.LineToolDisjointAngle.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return W47.prototype.setLastPoint.call(this,a)};
TradingView.LineToolDisjointAngle.prototype.setPoint=function(a,b,c){var d=.5*(this._points.item(1).price+this._points.item(2).price);c&&c.shift&&1==a&&this._snapPoint45Degree(b,this.points().item(0));3>a&&W47.prototype.setPoint.call(this,a,b);0!=a&&2!=a&&(1==a?(a=this._points.item(1).price-d,this._points.item(2).price=this._points.item(1).price-2*a):3==a&&(a=this.priceScale(),c=b.price,a.isPercent()&&(d=this.ownerSource().firstValue(),c=a.priceRange().convertFromPercent(c,d)),a=c-this._points.item(2).price,
this._points.item(0).price=this._points.item(1).price-a,this._points.item(0).index=b.index))};TradingView.LineToolDisjointAngle.prototype.canHasAlert=function(){return!0};
TradingView.LineToolDisjointAngle.prototype._getAlertPlots=function(){var a=this._points.item(0),b=this._points.item(1),c=[];a.index<=b.index?(c.push(a),c.push(b)):(c.push(b),c.push(a));var d=this._points.item(2);d.time=b.time;d.index=b.index;var e={price:d.price+(b.price-a.price),time:a.time,index:a.index},g=[];d.index<=e.index?(g.push(d),g.push(e)):(g.push(e),g.push(d));c[0].price>g[0].price?(d=c,c=g):g[0].price>c[0].price?d=g:g[1].price>c[1].price?d=g:(d=c,c=g);g=this.properties().extendLeft.value();
e=this.properties().extendRight.value();a.index<=b.index?(a=g,b=e):(a=e,b=g);return[this._linePointsToAlertPlot(d,"Upper",a,b),this._linePointsToAlertPlot(c,"Lower",a,b)]};function $78(a,b){$90.call(this,a,b);this._label2=this._label1=null;this._rendererCache={}}inherit($78,$90);
$78.prototype.update=function(){$90.prototype.update.call(this);this._label2=this._label1=null;if(!(2>this.W99.points().size())&&this.W99.priceScale()){var a=this.W99.points().item(0),b=this.W99.points().item(1);this._price1=this.W99.priceScale().formatter().format(a.price);this._price2=this.W99.priceScale().formatter().format(b.price);3==this.W99.points().size()&&(a=this.W99.points().item(2),this._price3=this.W99.priceScale().formatter().format(a.price))}};
$78.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.W99.properties(),e=this.D0,g=this.W99;if(3==this._points.size()){var h=this._points.item(2);h.x=c.x;var k=b.clone();k.y=h.y;k.data=3;if(d.fillBackground.value()){var l={},m=e.timeScale().width();g.priceScale().height();var n=d.extendLeft.value(),q=d.extendRight.value();n||q?!n&&q?(l={},l.width=m,l.p1=b,l.p2=c,l.p3=k,l.p4=
h,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))):n&&!q?(l={},l.width=m,l.p1=c,l.p2=b,l.p3=h,l.p4=k,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))):(l=b.add(c).scaled(.5),n=k.add(h).scaled(.5),q={},q.width=m,q.p1=l,q.p2=c,q.p3=n,q.p4=h,q.color=d.backgroundColor.value(),q.transparency=d.transparency.value(),
q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q)),q={},q.width=m,q.p1=l,q.p2=b,q.p3=n,q.p4=k,q.color=d.backgroundColor.value(),q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q))):(l.points=new List([b,c,h,k]),l.color="rgba(0,0,0,0)",l.linewidth=0,l.linestyle=CanvasEx.LINESTYLE_SOLID,l.filled=!0,l.backcolor=d.backgroundColor.value(),l.fillBackground=!0,l.transparency=d.transparency.value(),a.append(new PoligonRenderer(l)))}}m=
function(a,b){return{points:(new List).append(a).append(b),width:e.timeScale().width(),height:g.priceScale().height(),color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),extendleft:d.extendLeft.value(),extendright:d.extendRight.value(),leftend:d.leftEnd.value(),rightend:d.rightEnd.value()}};a.append(new TrendLineRenderer(m(b,c)));if(2==this._points.size())return this.addAnchors(a),a;var r=this,l=function(b,c,d,e){r.W99.properties().showPrices.value()&&(d={points:(new List).append(b),
text:d,color:r.W99.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:r.W99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:r.W99.properties().bold.value(),italic:r.W99.properties().italic.value(),fontsize:r.W99.properties().fontsize.value()},a.append(new TextRenderer(d,r._rendererCache)),d={points:(new List).append(c),text:e,color:r.W99.properties().textcolor.value(),horzAlign:b.x<c.x?"left":"right",vertAlign:"middle",font:r.W99.properties().font.value(),
offsetX:b.x>c.x?-5:5,offsetY:-5,bold:r.W99.properties().bold.value(),italic:r.W99.properties().italic.value(),fontsize:r.W99.properties().fontsize.value()},a.append(new TextRenderer(d,r._rendererCache)))};a.append(new TrendLineRenderer(m(b,c)));l(b,c,this._price1,this._price2);if(2==this._points.size())return a;a.append(new TrendLineRenderer(m(k,h)));l(h,k,this._price3,this._price3);this.isAnchorsRequired()&&(h=(new List).append(b).append(c).append(h).append(k),this.D0.lineBeingCreated()==
this.W99&&h.removeAt(h.size()-1),a.append(this.createLineAnchor({points:h})));!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&b&&c&&this.W99.getAlertIsActive(function(e){a.append(new PaneRendererClockIcon({point1:b,point2:c,color:e?d.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
TradingView.LineToolFlatBottom=function(a,b){this._constructor="LineToolFlatBottom";var c=b?b:new $52("linetoolflatbottom");W47.call(this,a,new $78(this,a),c);this.version=TradingView.LineToolFlatBottom.version};inherit(TradingView.LineToolFlatBottom,W47);TradingView.LineToolFlatBottom.version=1;TradingView.LineToolFlatBottom.prototype.pointsCount=function(){return 3};TradingView.LineToolFlatBottom.prototype.title=function(){return"Flat Bottom"};
TradingView.LineToolFlatBottom.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return W47.prototype.addPoint.call(this,a)};TradingView.LineToolFlatBottom.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return W47.prototype.setLastPoint.call(this,a)};
TradingView.LineToolFlatBottom.prototype.setPoint=function(a,b,c){this._points.item(1);this._points.item(2);c&&c.shift&&1==a&&this._snapPoint45Degree(b,this.points().item(0));3>a?W47.prototype.setPoint.call(this,a,b):this._points.item(0).index=b.index};TradingView.LineToolFlatBottom.prototype.canHasAlert=function(){return!0};
TradingView.LineToolFlatBottom.prototype._getAlertPlots=function(){var a=this._points.item(0),b=this._points.item(1),c=[];a.index<=b.index?(c.push(a),c.push(b)):(c.push(b),c.push(a));var d=this._points.item(2);d.time=b.time;d.index=b.index;var e={price:d.price,time:a.time,index:a.index},g=[];d.index<=e.index?(g.push(d),g.push(e)):(g.push(e),g.push(d));c[0].price>g[0].price?(d=c,c=g):g[0].price>c[0].price?d=g:g[1].price>c[1].price?d=g:(d=c,c=g);g=this.properties().extendLeft.value();e=this.properties().extendRight.value();
a.index<=b.index?(a=g,b=e):(a=e,b=g);return[this._linePointsToAlertPlot(d,"Upper",a,b),this._linePointsToAlertPlot(c,"Lower",g,b)]};function IconRenderer(a,b){this._data=a;this._cache=b}
IconRenderer.prototype.draw=function(a){var b=String.fromCharCode(this._data.icon);a.font=this._data.size+"px FontAwesome";var c=a.measureText(b).width;a.textBaseline="middle";var d=this._data.point;a.translate(d.x,d.y);a.rotate(this._data.angle-Math.PI/2);a.scale(this._data.scale,1);d=65536*this._data.icon+this._data.size;this._cache[d]=c;this._data.selected&&(a.fillStyle="rgba(80, 80, 80, 0.2)",a.fillRect(-this._cache[d]/2,-this._data.size/2,this._cache[d],this._data.size));a.fillStyle=this._data.color;
a.fillText(b,-this._cache[d]/2,0)};IconRenderer.prototype.hitTest=function(a){var b=this._cache[65536*this._data.icon+this._data.size]*this._data.scale,c=MathEx.Matrix.rotate(-this._data.angle);a=a.substract(this._data.point);a=c.mult(a);return Math.abs(a.y)<=b/2&&Math.abs(a.x)<=this._data.size/2?new HitTestResult(HitTestResult.MOVEPOINT):null};function $87(a,b){$90.call(this,a,b);this._cache={}}inherit($87,$90);$87.anchorLimit=80;
$87.prototype.renderer=function(){var a=new CompositeRenderer;if(1>this._points.size())return a;var b=this.W99.properties(),c={point:this._points.item(0),color:b.color.value(),size:b.size.value(),icon:b.icon.value(),angle:b.angle.value(),scale:b.scale.value(),selected:this.isAnchorsRequired()},d=this.D0,e=this.W99;a.append(new IconRenderer(c,this._cache));if(this.isAnchorsRequired()){var g=this._cache[65536*c.icon+c.size],h=c.size,c=this._points.item(0),k=b.scale.value(),h=new MathEx.Point(Math.max($87.anchorLimit,
h)/2,0),g=new MathEx.Point(0,Math.max($87.anchorLimit,k*g)/2),b=MathEx.Matrix.rotate(b.angle.value()),h=b.mult(h),g=b.mult(g),b=c.add(h);b.data=0;h=c.substract(h);h.data=1;k=c.add(g);k.data=2;k.square=!0;g=c.substract(g);g.data=3;g.square=!0;c={points:(new List).append(b).append(h),width:d.timeScale().width(),height:e.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:W47.LINEEND_NORMAL,rightend:W47.LINEEND_NORMAL};
d=new TrendLineRenderer(c);d._hittest=null;a.append(d);a.append(this.createLineAnchor({points:(new List).append(b).append(h).append(k).append(g)}))}return a};TradingView.LineToolIcon=function(a,b){this._constructor="LineToolIcon";var c=b?b:new $52("linetoolicon");c.addExclusion("angle");c.addExclusion("scale");W47.call(this,a,new $87(this,a),c);this.version=TradingView.LineToolIcon.version};
TradingView.LineToolIcon._getAvailIcons=function(){for(var a=[],a=a.concat([61536,61537,61538,61539]),a=a.concat([61725,61726]),a=a.concat([61575,61576,61796,61797]),a=a.concat([61779,61780,61781,61782,61783,61784,61785,61786]),b=a.slice(0),c=61440;61846>=c;c++)-1!=$.inArray(c,a)||15==c%16&&61487!==c||61620<=c&&61630>=c||61718!=c&&61719!=c&&61472!=c&&61619!=c&&b.push(c);return b};TradingView.LineToolIcon.availIcons=TradingView.LineToolIcon._getAvailIcons();inherit(TradingView.LineToolIcon,W47);
TradingView.LineToolIcon.version=1;TradingView.LineToolIcon.prototype.pointsCount=function(){return 1};TradingView.LineToolIcon.prototype.title=function(){return"Icon"};
TradingView.LineToolIcon.prototype.startChanging=function(a,b){W47.prototype.startChanging.call(this,a,b);var c=this.properties(),d=65536*c.icon.value()+c.size.value();this._startChangeWidth=this._paneViews[0]._cache[d];c.size.value()<$87.anchorLimit?this._sizeScale=c.size.value()/$87.anchorLimit:this._sizeScale=1;this._origScale=c.scale.value();this._resizeRatio=this._startChangeWidth*this._origScale<$87.anchorLimit?this._startChangeWidth/$87.anchorLimit:
1};TradingView.LineToolIcon.prototype.endChanging=function(){W47.prototype.endChanging.call(this);delete this._startChangeWidth;delete this._sizeScale;delete this._resizeRatio};
TradingView.LineToolIcon.prototype.setPoint=function(a,b,c){var d=this.priceScale();if(d.isPercent()){var e=this.ownerSource().firstValue();b.price=d.priceRange().convertFromPercent(b.price,e)}c&&c.shift&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(b,this.points().item(0));c=this.pointToScreenPoint(this.points().item(0))[1];d=this.pointToScreenPoint(b)[1];0==a||1==a?(b=d.substract(c).normalized(),c=2*d.substract(c).length(),c*=this._sizeScale,this.D2.size.setValue(c),c=Math.acos(-b.x),
0<Math.asin(b.y)&&(c=2*Math.PI-c),0==a&&(c+=Math.PI),this.D2.angle.setValue(c)):(a=this._startChangeWidth,b=d.substract(c).length(),this._origScale*a<$87.anchorLimit?(a=$87.anchorLimit/2,this.D2.scale.setValue(this._origScale*b/a)):this.D2.scale.setValue(b/(a/2)))};function W10(a,b){$90.call(this,a,b)}inherit(W10,$90);W10.prototype.update=function(){$90.prototype.update.call(this);this._distance=0;3==this._points.size()&&(this._distance=MathEx.distanceToLine(this._points.item(0),this._points.item(1),this._points.item(2)).distance)};
W10.prototype.renderer=function(){var a=new CompositeRenderer,b=this.W99.properties(),c=this._points.item(0);if(2<=this._points.size())var d=this._points.item(1);if(2==this._points.size()){var e={};e.points=this._points;e.floatPoints=this._floatPoints;e.width=this.D0.timeScale().width();e.height=this.W99.priceScale().height();e.color=b.color.value();e.linewidth=1;e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=W47.LINEEND_NORMAL;
e.rightend=W47.LINEEND_NORMAL;a.append(new TrendLineRenderer(e))}else if(3==this._points.size()){this._points.item(2);var g=d.substract(c),h=(new MathEx.Point(g.y,-g.x)).normalized().scaled(this._distance),k=h.scaled(-1),g=c.add(h),h=d.add(h),l=c.add(k),k=d.add(k),e={};e.points=(new List).append(g).append(h).append(k).append(l);e.color=b.color.value();e.linewidth=this.W99.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.filled=!0;e.backcolor=b.backgroundColor.value();
e.fillBackground=b.fillBackground.value();e.transparency=b.transparency.value();a.append(new PoligonRenderer(e))}this.isAnchorsRequired()&&(b=new List,b.append(c),2<=this._points.size()&&b.append(d),3==this._points.size()&&(g.data=2,l.data=2,h.data=2,k.data=2,b.append(g),b.append(l),b.append(h),b.append(k)),a.append(this.createLineAnchor({points:b})));return a};
TradingView.LineToolRotatedRectangle=function(a,b){this._constructor="LineToolRotatedRectangle";var c=b?b:new $52("linetoolrotatedrectangle");W47.call(this,a,new W10(this,a),c)};inherit(TradingView.LineToolRotatedRectangle,W47);
TradingView.LineToolRotatedRectangle.prototype.startChanging=function(a,b){W47.prototype.startChanging.call(this,a,b);if(0==a||1==a){var c=this._paneViews[0],d=c._points.item(0),e=c._points.item(1),c=c._points.item(2);this._distance=MathEx.distanceToLine(d,e,c).distance}};
TradingView.LineToolRotatedRectangle.prototype.setPoint=function(a,b,c){W47.prototype.setPoint.call(this,a,b,c);if(0==a||1==a)b=this._paneViews[0],b.update(),a=b._points.item(0),b=b._points.item(1).substract(a),b=(new MathEx.Point(b.y,-b.x)).normalized().scaled(this._distance),a=a.add(b),a=this.screenPointToPoint(a),this._points.setItem(2,a)};TradingView.LineToolRotatedRectangle.prototype.endChanging=function(){delete this._distance};
TradingView.LineToolRotatedRectangle.prototype.pointsCount=function(){return 3};TradingView.LineToolRotatedRectangle.prototype.title=function(){return"Rotated Rectangle"};function AngleRenderer(a){this._data=a}AngleRenderer.prototype.hitTest=function(){return null};AngleRenderer.prototype.draw=function(a){a.save();a.translate(this._data.point.x,this._data.point.y);a.strokeStyle=this._data.color;var b=[1,2];"function"==typeof a.setLineDash?a.setLineDash(b):void 0!==a.mozDash?a.mozDash=b:void 0!==a.webkitLineDash&&(a.webkitLineDash=b);b=this._data.size;a.beginPath();a.moveTo(0,0);a.lineTo(b,0);a.arc(0,0,b,0,-this._data.angle,0<this._data.angle);a.stroke();a.restore()};
function W40(a,b){$90.call(this,a,b);this._label=null;this._rendererCache={}}inherit(W40,$90);
W40.prototype.update=function(){$90.prototype.update.call(this);if(0<this._points.size()&&void 0!==this.W99._angle){var a=this._points.item(0),b=Math.cos(this.W99._angle),c=-Math.sin(this.W99._angle),b=new MathEx.Point(b,c);this._secondPoint=a.addScaled(b,this.W99._distance);this._secondPoint.data=1}this._label=null;if(!(2>this.W99.points().size())){var a=this.W99.points().item(0),c=this.W99.points().item(1),b=[],d,e;if(this.W99.properties().showPriceRange.value()&&
this.W99.priceScale()){var g=c.price-a.price;d=g/a.price;d=this.W99.priceScale().formatter().format(g)+" ("+(new PercentageFormatter).format(100*d)+")";var h=this.D0.mainSeries().base();h&&(g=Math.round(g*h),d+=", "+g);b.push("priceRange")}this.W99.properties().showBarsRange.value()&&(a=c.index-a.index,e=""+$.t("{0} bars").format(a),b.push("barsRange"));this._label=[d,e].filter(function(a){return a}).join("\n")||null;this._icons=b}};
W40.prototype.renderer=function(){var a=new CompositeRenderer;if(this._secondPoint&&0<this._points.size()){var b={};b.points=(new List).append(this._points.item(0)).append(this._secondPoint);b.width=this.D0.timeScale().width();b.height=this.W99.priceScale().height();b.color=this.W99.properties().linecolor.value();b.linewidth=this.W99.properties().linewidth.value();b.linestyle=this.W99.properties().linestyle.value();b.extendleft=this.W99.properties().extendLeft.value();
b.extendright=this.W99.properties().extendRight.value();b.leftend=W47.LINEEND_NORMAL;b.rightend=W47.LINEEND_NORMAL;a.append(new TrendLineRenderer(b));if((this.isAnchorsRequired()||this.W99.properties().alwaysShowStats.value())&&this._label&&2==this._points.size()){var c={points:(new List).append(this._secondPoint),text:this._label,color:this.W99.properties().textcolor.value(),font:TradingView.LineToolTrendLine.LABEL_FONT,fontsize:TradingView.LineToolTrendLine.LABEL_FONTSIZE,
lineSpacing:TradingView.LineToolTrendLine.LABEL_LINESPACING,backgroundColor:TradingView.LineToolTrendLine.LABEL_BGCOLOR,borderColor:TradingView.LineToolTrendLine.LABEL_BORDERCOLOR,borderWidth:1,padding:TradingView.LineToolTrendLine.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},d=TradingView.LineToolTrendLine.LABEL_OFFSET;this._points.item(1).y<this._points.item(0).y?(c.vertAlign="bottom",c.offsetY=-d):c.offsetY=d;this._points.item(1).x<this._points.item(0).x?(c.horzAlign="right",
c.offsetX=-d):c.offsetX=d;a.append(new TrendLineStatsRenderer(c,this._rendererCache))}c={};c.point=this._points.item(0);c.angle=this.W99._angle;c.color=this.W99.properties().linecolor.value();c.size=50;a.append(new AngleRenderer(c));c=Math.round(180*c.angle/Math.PI)+"\u00ba";d=this._points.item(0).clone();d.x+=50;c={points:(new List).append(d),text:c,color:this.W99.properties().textcolor.value(),horzAlign:"left",font:this.W99.properties().font.value(),offsetX:5,offsetY:0,bold:this.W99.properties().bold.value(),
italic:this.W99.properties().italic.value(),fontsize:this.W99.properties().fontsize.value(),vertAlign:"middle"};a.append(new TextRenderer(c,this._rendererCache))}!TradingView.printing&&this.W99.hasAlert.value()&&!this.D0.readOnly()&&b&&2<=b.points.size()&&this.W99.getAlertIsActive(function(c){a.append(new PaneRendererClockIcon({point1:b.points.clone().item(0),point2:b.points.clone().item(1),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});this.isAnchorsRequired()&&
this._secondPoint&&(c=b.points.clone(),this.D0.lineBeingCreated()==this.W99&&c.removeAt(c.size()-1),a.append(this.createLineAnchor({points:c})));return a};TradingView.LineToolTrendAngle=function(a,b){this._constructor="LineToolTrendAngleLine";var c=b?b:new $52("linetooltrendangle");W47.call(this,a,new W40(this,a),c);this.D2.addProperty("angle");this.D2.angle=new TradingView.LineToolTrendAngle.AngleProperty(this)};
inherit(TradingView.LineToolTrendAngle,W47);TradingView.LineToolTrendAngle.AngleProperty=function(a){Property.call(this);this._lineSource=a};inherit(TradingView.LineToolTrendAngle.AngleProperty,Property);TradingView.LineToolTrendAngle.AngleProperty.prototype.value=function(){return Math.round(180*this._lineSource._angle/Math.PI)};
TradingView.LineToolTrendAngle.AngleProperty.prototype.setValue=function(a){this._lineSource._angle=a*Math.PI/180;a=this._lineSource.pointToScreenPoint(this._lineSource.points().item(0))[0];var b=Math.cos(this._lineSource._angle),c=-Math.sin(this._lineSource._angle),b=new MathEx.Point(b,c);a=a.addScaled(b,this._lineSource._distance);a=this._lineSource.screenPointToPoint(a);this._lineSource._points.setItem(1,a);this._lineSource.D0.updateSource(this._lineSource);this._lineSource.updateAllViews();
this._lineSource.D0.updateSource(this._lineSource)};TradingView.LineToolTrendAngle.prototype.pointsCount=function(){return 2};TradingView.LineToolTrendAngle.prototype.title=function(){return"Trend Angle"};
TradingView.LineToolTrendAngle.prototype._calculateAngle=function(){var a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(1))[0],c=b.substract(a);0<c.length()?(c=c.normalized(),this._angle=Math.acos(c.x),0<c.y&&(this._angle=-this._angle),this._distance=b.substract(a).length()):delete this._angle;this.properties().hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)};
TradingView.LineToolTrendAngle.prototype.addPoint=function(a,b){var c=W47.prototype.addPoint.call(this,a,b);c&&this._calculateAngle();return c};TradingView.LineToolTrendAngle.prototype.setLastPoint=function(a,b){W47.prototype.setLastPoint.call(this,a,b);1<this.points().size()&&this._calculateAngle()};TradingView.LineToolTrendAngle.prototype.setPoint=function(a,b,c){W47.prototype.setPoint.call(this,a,b,c);1<this.points().size()&&this._calculateAngle()};
TradingView.LineToolTrendAngle.prototype.restoreData=function(a){this._angle=a.angle;this._distance=a.distance};TradingView.LineToolTrendAngle.prototype.state=function(a){a=W47.prototype.state.call(this,a);a.angle=this._angle;a.distance=this._distance;return a};TradingView.LineToolTrendAngle.prototype.cloneData=function(a){this._angle=a._angle;this._distance=a._distance};TradingView.LineToolTrendAngle.prototype.canHasAlert=function(){return!0};
TradingView.LineToolTrendAngle.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points.toArray(),null,this.properties().extendLeft.value(),this.properties().extendRight.value())]};var ChartTradingUtils={_fontHeightCache:{},_parseColor:function(a){var b=document.createElement("div");b.style.color=a;a=b.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||b.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i);$(b).remove();return{r:a[1],g:a[2],b:a[3],a:a[4]||"1"}},getColorFromProperties:function(a,b){var c=1-b.value()/100,d=this._parseColor(a.value());return"rgba("+d.r+","+d.g+","+d.b+","+c+")"},setColorToProperties:function(a,
b,c){a=this._parseColor(a);b.setValue("rgb("+a.r+","+a.g+","+a.b+")");c.setValue(Math.max(0,Math.min(100*(1-a.a),100)))},_parseFont:function(a){var b=document.createElement("div");b.style.font=a;a=b.style.fontSize.match(/(\d+)pt/);a={family:b.style.fontFamily,size:a&&a[0]==b.style.fontSize?a[1]:"",bold:"bold"==b.style.fontWeight,italic:"italic"==b.style.fontStyle};$(b).remove();return a},getFontFromProperties:function(a,b,c,d){c=c.value()?"bold":"";d=d.value()?"italic":"";b=b.value()+"pt";a=a.value();
return[c,d,b,a].join(" ")},setFontToProperties:function(a,b,c,d,e){a=this._parseFont(a);0<a.family.length&&b.setValue(a.family);0<a.size.length&&c.setValue(a.size);d.setValue(a.bold);e.setValue(a.italic)},fontHeight:function(a){if(!this._fontHeightCache[a]){var b=document.createElement("span");b.appendChild(document.createTextNode("height"));document.body.appendChild(b);b.style.cssText="font: "+a+"; white-space: nowrap; display: inline;";var c=b.offsetHeight;document.body.removeChild(b);this._fontHeightCache[a]=
Math.ceil(c)}return this._fontHeightCache[a]},drawPolyHoverOrPress:function(a,b,c,d){d?(a.save(),a.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(a,b,!0),a.restore()):c&&(a.save(),a.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(a,b,!0),a.restore())},repaint:function(a){var b=new A22(A22.LIGHT_UPDATE);b.force=!0;a.D20(b)},roundToMinTick:function(a,b){var c=1/a.mainSource().base();return c*Math.round(b/c)}};TradingView.LineToolTrading=function(a,b,c){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0};W47.call(this,a,b,c)};inherit(TradingView.LineToolTrading,W47);TradingView.LineToolTrading.POINTS_COUNT=1;TradingView.LineToolTrading.prototype.pointsCount=function(){return TradingView.LineToolTrading.POINTS_COUNT};TradingView.LineToolTrading.prototype.hasContextMenu=function(){return!1};TradingView.LineToolTrading.prototype.state=function(){return null};
TradingView.LineToolTrading.prototype.startMoving=function(){W47.prototype.startMoving.apply(this,arguments);this._cursorMoved=!1};TradingView.LineToolTrading.prototype.endMoving=function(){W47.prototype.endMoving.apply(this,arguments);this._cursorMoved=!1};
TradingView.LineToolTrading.prototype.correctPoints=function(a){this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1;for(var b=1/this.priceScale().mainSource().base(),c=0;c<a.size();c++){var d=a.item(c);this._cursorMoved&&(d.price=this._currentMovingPoint.price);d.price=b*Math.round(d.price/b);a.setItem(c,d)}};TradingView.LineToolTrading.prototype.userEditEnabled=function(){return!0};
TradingView.LineToolTrading.prototype.isUserDeletable=function(){return!1};TradingView.LineToolTrading.prototype.showInObjectTree=function(){return!1};function OrderLineAdapter(a){this._line=a;this._data={bodyText:"order",quantityText:"0"}}OrderLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};OrderLineAdapter.prototype.setPrice=function(a){var b=this._line.points().item(0);b.price=a;this._line._points.setItem(0,b);this._line.normalizePoints();return this};OrderLineAdapter.prototype.getText=function(){return this._data.bodyText};OrderLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";return this};
OrderLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};OrderLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};OrderLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};OrderLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";return this};
OrderLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D0.properties().tradingProperties.extendLeft.value():a};OrderLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};OrderLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineLength.value():a};
OrderLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};OrderLineAdapter.prototype.getLineColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};OrderLineAdapter.prototype.setLineColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};
OrderLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineStyle.value():a};OrderLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};OrderLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineWidth.value():a};
OrderLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};OrderLineAdapter.prototype.getBodyBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};OrderLineAdapter.prototype.setBodyBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};
OrderLineAdapter.prototype.getBodyBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};OrderLineAdapter.prototype.setBodyBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};
OrderLineAdapter.prototype.getBodyTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};OrderLineAdapter.prototype.setBodyTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};
OrderLineAdapter.prototype.getBodyFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};OrderLineAdapter.prototype.setBodyFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};
OrderLineAdapter.prototype.getQuantityBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};OrderLineAdapter.prototype.setQuantityBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};
OrderLineAdapter.prototype.getQuantityBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};OrderLineAdapter.prototype.setQuantityBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};
OrderLineAdapter.prototype.getQuantityTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};OrderLineAdapter.prototype.setQuantityTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};
OrderLineAdapter.prototype.getQuantityFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
OrderLineAdapter.prototype.setQuantityFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};OrderLineAdapter.prototype.getCancelButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)};
OrderLineAdapter.prototype.setCancelButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency);return this};OrderLineAdapter.prototype.getCancelButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)};
OrderLineAdapter.prototype.setCancelButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency);return this};OrderLineAdapter.prototype.getCancelButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)};
OrderLineAdapter.prototype.setCancelButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency);return this};OrderLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};OrderLineAdapter.prototype.onCancel=function(a,b){b?this.isFunction(b)&&(this._onCancelData=a,this._onCancelCallback=b):this.isFunction(a)&&(this._onCancelCallback=a);return this};
OrderLineAdapter.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)};OrderLineAdapter.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)};OrderLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};
OrderLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};OrderLineAdapter.prototype.onMove=function(a,b){b?this.isFunction(b)&&(this._onMoveData=a,this._onMoveCallback=b):this.isFunction(a)&&(this._onMoveCallback=a);return this};OrderLineAdapter.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)};
OrderLineAdapter.prototype.onContextMenu=function(a,b){b?this.isFunction(b)&&(this._onContextMenuData=a,this._onContextMenuCallback=b):this.isFunction(a)&&(this._onContextMenuCallback=a);return this};OrderLineAdapter.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)};OrderLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};
function OrderRenderer(a,b,c){this._data=a;this._cache=b;this._adapter=c}OrderRenderer.prototype._height=function(){return Math.max(20,1+Math.max(ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};OrderRenderer.prototype._bodyWidth=function(a){if(0==this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getBodyFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return Math.round(20+b)};
OrderRenderer.prototype._quantityWidth=function(a){if(0==this._adapter.getQuantity().length)return 0;a.save();a.font=this._adapter.getQuantityFont();var b=a.measureText(this._adapter.getQuantity()).width;a.restore();return Math.round(Math.max(this._height(),10+b))};OrderRenderer.prototype._cancelButtonWidth=function(){return this._adapter.isOnCancelCallbackPresent()?this._height():0};
OrderRenderer.prototype._drawLines=function(a,b,c,d,e){a.save();a.strokeStyle=this._adapter.getLineColor();a.lineStyle=this._adapter.getLineStyle();a.lineWidth=this._adapter.getLineWidth();CanvasEx.drawLine(a,c,d,e,d);this._adapter.getExtendLeft()&&CanvasEx.drawLine(a,0,d,b,d);a.restore()};
OrderRenderer.prototype._drawMovePoints=function(a,b,c){a.save();a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBorderColor();b+=4;for(var d=b+2,e=Math.floor((this._height()-10)/2)+1,g=0;g<e;++g){var h=c+5+2*g;CanvasEx.drawLine(a,b,h,d,h)}a.restore()};
OrderRenderer.prototype._drawBody=function(a,b,c){a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=this._bodyWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
OrderRenderer.prototype._drawBodyText=function(a,b,c){a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getBodyFont();a.fillStyle=this._adapter.getBodyTextColor();b+=this._bodyWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getText(),5+b-2,c)};
OrderRenderer.prototype._drawQuantity=function(a,b,c,d){a.save();a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var e=this._quantityWidth(a),g=this._height();a.fillRect(b+.5,c+.5,e-1,g-1);d&&a.clip&&(a.beginPath(),a.rect(b+.5,c-.5,e+1,g+1),a.clip());a.strokeRect(b,c,e,g);a.restore()};
OrderRenderer.prototype._drawQuantityText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getQuantityFont();a.fillStyle=this._adapter.getQuantityTextColor();b+=this._quantityWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getQuantity(),b,c);a.restore()};
OrderRenderer.prototype._drawCancelButton=function(a,b,c,d){a.strokeStyle=this._adapter.getCancelButtonBorderColor();a.fillStyle=this._adapter.getCancelButtonBackgroundColor();var e=this._cancelButtonWidth(),g=this._height();a.fillRect(b+.5,c+.5,e-1,g-1);a.save();d&&a.clip&&(a.beginPath(),a.rect(b+.5,c-.5,e+1,g+1),a.clip());a.strokeRect(b,c,e,g);a.restore();d=b+e;g=c+g;a.strokeStyle=this._adapter.getCancelButtonIconColor();var e=(this._cancelButtonWidth()-8)/2,h=(this._height()-8)/2;CanvasEx.drawPoly(a,
[{x:b+e,y:c+h},{x:d-e,y:g-h}],!0);CanvasEx.drawPoly(a,[{x:d-e,y:c+h},{x:b+e,y:g-h}],!0)};
OrderRenderer.prototype.draw=function(a){if(this._data.points&&!(1>this._data.points.size())){var b=a.canvas.width,c=this._bodyWidth(a),d=this._quantityWidth(a),e=c+d+this._cancelButtonWidth(),g=b-e,h=Math.max(this._adapter.getLineLength()/100*b,1),g=Math.round(b-Math.min(g,h)),e=g-e,k=Math.round(this._data.points.item(0).y),h=Math.round(k-(this._height()+1)/2);this._cache.bodyRight=e+c;this._cache.quantityRight=e+c+d;this._cache.top=h;this._cache.bottom=h+this._height();this._cache.left=e;this._cache.right=
g;this._drawLines(a,e,g,k,b);b=!1;0!=c&&(this._drawBody(a,e,h),this._drawMovePoints(a,e,h),this._drawBodyText(a,e,h),b=!0);0!=d&&(this._drawQuantity(a,e+c,h,b),this._drawQuantityText(a,e+c,h),b=!0);0!=this._cancelButtonWidth()&&this._drawCancelButton(a,e+c+d,h,b)}};
OrderRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.y<this._cache.top||a.y>this._cache.bottom?null:a.x>=this._cache.left&&a.x<this._cache.bodyRight?0==this._adapter.getTooltip().length?new HitTestResult(HitTestResult.MOVEPOINT):new HitTestResult(HitTestResult.MOVEPOINT,{tooltip:{text:this._adapter.getTooltip(),rect:new TradingView.Rect(this._cache.left,this._cache.top,this._cache.bodyRight-this._cache.left,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.bodyRight&&
a.x<this._cache.quantityRight?new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:"Edit Order",rect:new TradingView.Rect(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.quantityRight&&a.x<this._cache.right?new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:"Cancel Order",rect:new TradingView.Rect(this._cache.quantityRight,
this._cache.top,this._cache.right-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):null};function OrderPriceAxisView(a,b){W48.call(this,a,b)}inherit(OrderPriceAxisView,W48);OrderPriceAxisView.prototype._updateImpl=function(){W48.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};function OrderPaneView(a,b){$90.call(this,a,b);this._rendererCache={}}
inherit(OrderPaneView,$90);OrderPaneView.prototype.renderer=function(){return new OrderRenderer({points:this._points},this._rendererCache,this.W99._adapter)};TradingView.LineToolOrder=function(a,b){this._adapter=new OrderLineAdapter(this);this._constructor="LineToolOrder";var c=b||new $52("linetoolorder");TradingView.LineToolTrading.call(this,a,new OrderPaneView(this,a),c)};inherit(TradingView.LineToolOrder,TradingView.LineToolTrading);
TradingView.LineToolOrder.skipMagnetting=!0;TradingView.LineToolOrder.prototype.setPoint=function(a,b,c){this._points.setItem(a,b);this.normalizePoints()};TradingView.LineToolOrder.prototype.addPoint=function(a,b){this._points.append(a);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};TradingView.LineToolOrder.prototype.title=function(){return"Order"};
TradingView.LineToolOrder.prototype.endMoving=function(a){var b=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!=this._currentMovingPoint.price;TradingView.LineToolTrading.prototype.endMoving.call(this);!a&&b&&this._adapter.callOnMove()};TradingView.LineToolOrder.prototype.createPriceAxisView=function(a){return this._priceAxisView=new OrderPriceAxisView(this,a)};
TradingView.LineToolOrder.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showOrders.value()?null:W47.prototype.paneViews.call(this,a)};TradingView.LineToolOrder.prototype.priceAxisViews=function(a,b){return TradingView.printing||!this.D0.properties().tradingProperties.showOrders.value()?null:W47.prototype.priceAxisViews.call(this,a,b)};TradingView.LineToolOrder.prototype.hasContextMenu=function(){return!0};
TradingView.LineToolOrder.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()};function PositionLineAdapter(a){this._line=a;this._data={bodyText:"position",quantityText:"0"}}PositionLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};PositionLineAdapter.prototype.setPrice=function(a){var b=this._line.points().item(0);b.price=a;this._line._points.setItem(0,b);this._line.normalizePoints();return this};PositionLineAdapter.prototype.getText=function(){return this._data.bodyText};
PositionLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";return this};PositionLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};PositionLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};PositionLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};PositionLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";return this};
PositionLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D0.properties().tradingProperties.extendLeft.value():a};PositionLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};
PositionLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineLength.value():a};PositionLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};PositionLineAdapter.prototype.getLineColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};
PositionLineAdapter.prototype.setLineColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};PositionLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineStyle.value():a};PositionLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};
PositionLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineWidth.value():a};PositionLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};PositionLineAdapter.prototype.getBodyBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};
PositionLineAdapter.prototype.setBodyBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};PositionLineAdapter.prototype.getBodyBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};
PositionLineAdapter.prototype.setBodyBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};PositionLineAdapter.prototype.getBodyTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};
PositionLineAdapter.prototype.setBodyTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};PositionLineAdapter.prototype.getBodyFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};
PositionLineAdapter.prototype.setBodyFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};PositionLineAdapter.prototype.getQuantityBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};
PositionLineAdapter.prototype.setQuantityBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};PositionLineAdapter.prototype.getQuantityBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};
PositionLineAdapter.prototype.setQuantityBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};PositionLineAdapter.prototype.getQuantityTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};
PositionLineAdapter.prototype.setQuantityTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};PositionLineAdapter.prototype.getQuantityFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
PositionLineAdapter.prototype.setQuantityFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};PositionLineAdapter.prototype.getReverseButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)};
PositionLineAdapter.prototype.setReverseButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency);return this};PositionLineAdapter.prototype.getReverseButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)};
PositionLineAdapter.prototype.setReverseButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency);return this};PositionLineAdapter.prototype.getReverseButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)};
PositionLineAdapter.prototype.setReverseButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency);return this};PositionLineAdapter.prototype.getCloseButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)};
PositionLineAdapter.prototype.setCloseButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency);return this};PositionLineAdapter.prototype.getCloseButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)};
PositionLineAdapter.prototype.setCloseButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency);return this};PositionLineAdapter.prototype.getCloseButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)};
PositionLineAdapter.prototype.setCloseButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency);return this};PositionLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};PositionLineAdapter.prototype.onReverse=function(a,b){b?this.isFunction(b)&&(this._onReverseData=a,this._onReverseCallback=b):this.isFunction(a)&&(this._onReverseCallback=a);return this};
PositionLineAdapter.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)};PositionLineAdapter.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)};PositionLineAdapter.prototype.onClose=function(a,b){b?this.isFunction(b)&&(this._onCloseData=a,this._onCloseCallback=b):this.isFunction(a)&&(this._onCloseCallback=a);return this};
PositionLineAdapter.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._onCloseCallback.call(this,this._onCloseData)};PositionLineAdapter.prototype.isOnCloseCallbackPresent=function(){return this.isFunction(this._onCloseCallback)};PositionLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};
PositionLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};PositionLineAdapter.prototype.onContextMenu=function(a,b){b?this.isFunction(b)&&(this._onContextMenuData=a,this._onContextMenuCallback=b):this.isFunction(a)&&(this._onContextMenuCallback=a);return this};
PositionLineAdapter.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)};PositionLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};function PositionRenderer(a,b,c){this._data=a;this._cache=b;this._adapter=c}PositionRenderer.prototype._height=function(){return Math.max(20,1+Math.max(ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};
PositionRenderer.prototype._bodyWidth=function(a){if(0==this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getBodyFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return Math.round(10+b)};PositionRenderer.prototype._quantityWidth=function(a){if(0==this._adapter.getQuantity().length)return 0;a.save();a.font=this._adapter.getQuantityFont();var b=a.measureText(this._adapter.getQuantity()).width;a.restore();return Math.round(Math.max(this._height(),10+b))};
PositionRenderer.prototype._reverseButtonWidth=function(){return this._adapter.isOnReverseCallbackPresent()?this._height():0};PositionRenderer.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0};
PositionRenderer.prototype._drawLines=function(a,b,c,d,e){a.save();a.strokeStyle=this._adapter.getLineColor();a.lineStyle=this._adapter.getLineStyle();a.lineWidth=this._adapter.getLineWidth();CanvasEx.drawLine(a,c,d,e,d);this._adapter.getExtendLeft()&&CanvasEx.drawLine(a,0,d,b,d);a.restore()};
PositionRenderer.prototype._drawBody=function(a,b,c){a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=this._bodyWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
PositionRenderer.prototype._drawBodyText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getBodyFont();a.fillStyle=this._adapter.getBodyTextColor();b+=this._bodyWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getText(),b,c);a.restore()};
PositionRenderer.prototype._drawQuantity=function(a,b,c){a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var d=this._quantityWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
PositionRenderer.prototype._drawQuantityText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getQuantityFont();a.fillStyle=this._adapter.getQuantityTextColor();b+=this._quantityWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getQuantity(),b,c);a.restore()};
PositionRenderer.prototype._drawReverseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getReverseButtonBorderColor();a.fillStyle=this._adapter.getReverseButtonBackgroundColor();var d=this._reverseButtonWidth(),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e);a.strokeStyle=this._adapter.getReverseButtonIconColor();d=function(a,b){CanvasEx.drawLine(a,0,0,0,b);CanvasEx.drawLine(a,-1,1,1,1);CanvasEx.drawLine(a,-2,2,2,2)};b+=Math.round((this._reverseButtonWidth()-6)/2);
c+=5;a.save();a.transform(1,0,0,1,b,c);d(a,10);a.transform(1,0,0,1,6,10);a.rotate(Math.PI);d(a,10);a.restore();a.restore()};
PositionRenderer.prototype._drawCloseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getCloseButtonBorderColor();a.fillStyle=this._adapter.getCloseButtonBackgroundColor();var d=this._closeButtonWidth(),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e);d=b+d;e=c+e;a.strokeStyle=this._adapter.getCloseButtonIconColor();var g=(this._closeButtonWidth()-8)/2,h=(this._height()-8)/2;CanvasEx.drawPoly(a,[{x:b+g,y:c+h},{x:d-g,y:e-h}],!0);CanvasEx.drawPoly(a,[{x:d-g,y:c+h},{x:b+
g,y:e-h}],!0);a.restore()};
PositionRenderer.prototype.draw=function(a){if(this._data.points&&!(1>this._data.points.size())){var b=a.canvas.width,c=this._bodyWidth(a),d=this._quantityWidth(a),e=this._reverseButtonWidth(a),g=c+d+e+this._closeButtonWidth(),h=b-g,k=Math.max(this._adapter.getLineLength()/100*b,1),h=Math.round(b-Math.min(h,k)),g=h-g,k=Math.round(this._data.points.item(0).y),l=Math.round(k-(this._height()+1)/2);this._cache.bodyRight=g+c;this._cache.quantityRight=this._cache.bodyRight+d;this._cache.reverseButtonRight=
this._cache.quantityRight+e;this._cache.top=l;this._cache.bottom=l+this._height();this._cache.left=g;this._cache.right=h;this._drawLines(a,g,h,k,b);0!=c&&(this._drawBody(a,g,l),this._drawBodyText(a,g,l));0!=d&&(this._drawQuantity(a,this._cache.bodyRight,l),this._drawQuantityText(a,this._cache.bodyRight,l));0!=e&&this._drawReverseButton(a,this._cache.quantityRight,l);0!=this._closeButtonWidth()&&this._drawCloseButton(a,this._cache.reverseButtonRight,l)}};
PositionRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.y<this._cache.top||a.y>this._cache.bottom?null:a.x>=this._cache.left&&a.x<this._cache.bodyRight&&0!=this._adapter.getTooltip().length?new HitTestResult(HitTestResult.CUSTOM,{tooltip:{text:this._adapter.getTooltip(),rect:new TradingView.Rect(this._cache.left,this._cache.top,this._cache.bodyRight-this._cache.left,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.bodyRight&&a.x<this._cache.quantityRight?new HitTestResult(HitTestResult.CUSTOM,
{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:"Edit Position",rect:new TradingView.Rect(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.quantityRight&&a.x<this._cache.reverseButtonRight?new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:"Reverse Position",rect:new TradingView.Rect(this._cache.quantityRight,
this._cache.top,this._cache.reverseButtonRight-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.reverseButtonRight&&a.x<this._cache.right?new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:"Close Position",rect:new TradingView.Rect(this._cache.reverseButtonRight,this._cache.top,this._cache.right-this._cache.reverseButtonRight,this._cache.bottom-this._cache.top)}}):null};
function PositionPriceAxisView(a,b){W48.call(this,a,b)}inherit(PositionPriceAxisView,W48);PositionPriceAxisView.prototype._updateImpl=function(){W48.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};function PositionPaneView(a,b){$90.call(this,a,b);this._rendererCache={}}inherit(PositionPaneView,$90);
PositionPaneView.prototype.renderer=function(){return new PositionRenderer({points:this._points},this._rendererCache,this.W99._adapter)};TradingView.LineToolPosition=function(a,b){this._adapter=new PositionLineAdapter(this);this._constructor="LineToolPosition";var c=b||new $52("linetoolposition");TradingView.LineToolTrading.call(this,a,new PositionPaneView(this,a),c)};inherit(TradingView.LineToolPosition,TradingView.LineToolTrading);
TradingView.LineToolPosition.prototype.setPoint=function(a,b,c){this._points.setItem(a,b);this.normalizePoints()};TradingView.LineToolPosition.prototype.addPoint=function(a,b){this._points.append(a);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};TradingView.LineToolPosition.skipMagnetting=!0;TradingView.LineToolPosition.prototype.title=function(){return"Position"};
TradingView.LineToolPosition.prototype.createPriceAxisView=function(a){return this._priceAxisView=new PositionPriceAxisView(this,a)};TradingView.LineToolPosition.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showPositions.value()?null:W47.prototype.paneViews.call(this,a)};
TradingView.LineToolPosition.prototype.priceAxisViews=function(a,b){return TradingView.printing||!this.D0.properties().tradingProperties.showPositions.value()?null:W47.prototype.priceAxisViews.call(this,a,b)};TradingView.LineToolPosition.prototype.hasContextMenu=function(){return!0};TradingView.LineToolPosition.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()};function ExecutionsPositionController(a,b){this._pane=a;this._timeScale=b}
ExecutionsPositionController.prototype.getYCoordinate=function(a){var b=0,c=a.getDirection(),d=a._index,e=this._pane.mainDataSource();if(e.bars){var g="buy"==c?10:-10,h=e.bars().search(d,SEARCH_NEAREST_LEFT);h&&(d=h.index,b="buy"==c?h.value[LOW_PLOT]:h.value[HIGH_PLOT],h=e.priceScale(),h.isPercent()&&(e=e.firstValue(),b=h.priceRange().convertToPercent(b,e)),b=h.priceToCoordinate(b)+g)}g=this._pane.orderedSources();for(e=g.length-1;0<=e;--e)if(h=g[e],h instanceof TradingView.LineToolExecution&&h._adapter.getDirection()==
c&&h._adapter._index==d){if(h==a._line)break;b="buy"==c?b+h._adapter._height():b-h._adapter._height()}return b};function ExecutionLineAdapter(a){this._line=a}ExecutionLineAdapter.prototype._height=function(){var a=this.getArrowHeight(),b=this.getArrowSpacing();this.getText()&&ChartTradingUtils.fontHeight(this.getFont());return a+b+0+10};
ExecutionLineAdapter.prototype.getIndex=function(){var a=this._line.D0.timeScale().m_points.lastTimePointIndex(),b=this._line.points().item(0).index;return a-b};ExecutionLineAdapter.prototype.setIndex=function(a){a=this._line.D0.timeScale().m_points.lastTimePointIndex()-Math.abs(a);this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.index=a;this._line.move(b);this._line.endMoving();return this};
ExecutionLineAdapter.prototype.getTime=function(){return this._unixtime};ExecutionLineAdapter.prototype.setTime=function(a){this._unixtime=a;this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:a}],[]);this._line.createServerPoints();return this};ExecutionLineAdapter.prototype.getPrice=function(){if(0<this._line.points().size())return this._line.points().item(0).price;if(0<this._line._timePoint.size())return this._line._timePoint.item(0).price};
ExecutionLineAdapter.prototype.setPrice=function(a){0<this._line.points().size()&&(this._line.points().item(0).price=a);0<this._line._timePoint.size()&&(this._line._timePoint.item(0).price=a);return this};ExecutionLineAdapter.prototype.getText=function(){return this._line.properties().text.value()};ExecutionLineAdapter.prototype.setText=function(a){this._line.properties().text.setValue(a||"");return this};ExecutionLineAdapter.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()};
ExecutionLineAdapter.prototype.setArrowHeight=function(a){this._line.properties().arrowHeight.setValue(a||5);return this};ExecutionLineAdapter.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()};ExecutionLineAdapter.prototype.setArrowSpacing=function(a){this._line.properties().arrowSpacing.setValue(a||1);return this};ExecutionLineAdapter.prototype.getDirection=function(){return this._line.properties().direction.value()};
ExecutionLineAdapter.prototype.setDirection=function(a){this._line.properties().direction.setValue(a||"buy");return this};ExecutionLineAdapter.prototype.getArrowColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)};ExecutionLineAdapter.prototype.setArrowColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().arrowColor,this._line.properties().arrowTransparency);return this};
ExecutionLineAdapter.prototype.getTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)};ExecutionLineAdapter.prototype.setTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().textColor,this._line.properties().textTransparency);return this};
ExecutionLineAdapter.prototype.getFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)};ExecutionLineAdapter.prototype.setFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic);return this};
ExecutionLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};ExecutionLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};ExecutionLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};function ExecutionRenderer(a,b){this._data=a;this._adapter=b}
ExecutionRenderer.prototype._textWidth=function(a){if(0==this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return 5+b};
ExecutionRenderer.prototype._drawArrow=function(a,b,c){a.save();a.strokeStyle=this._adapter.getArrowColor();a.fillStyle=this._adapter.getArrowColor();var d=this._adapter.getArrowHeight(),e=this._adapter.getDirection();a.transform(1,0,0,1,b,c);"buy"!=e&&a.rotate(Math.PI);CanvasEx.drawLine(a,0,0,0,d);CanvasEx.drawLine(a,-1,1,1,1);CanvasEx.drawLine(a,-2,2,2,2);a.restore()};
ExecutionRenderer.prototype._drawText=function(a,b,c){var d=this._adapter.getText();d&&(a.save(),a.textAlign="center",a.textBaseline="middle",a.font=this._adapter.getFont(),a.fillStyle=this._adapter.getTextColor(),b+=this._textWidth(a)/2,c+=ChartTradingUtils.fontHeight(this._adapter.getFont())/2,a.fillText(d,b,c-1),a.restore())};
ExecutionRenderer.prototype.draw=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolExecution.POINTS_COUNT)){var b=Math.round(this._data.points.item(0).x+.5),c=Math.round(this._data.points.item(0).y);this._drawArrow(a,b,c);var d=this._textWidth(a);if(0!=d){var e=this._adapter.getArrowHeight(),g=this._adapter.getArrowSpacing(),h=ChartTradingUtils.fontHeight(this._adapter.getFont()),c="buy"==this._adapter.getDirection()?c+e+g:c-e-g-h;this._drawText(a,Math.round(b-d/2),
c)}}};
ExecutionRenderer.prototype.hitTest=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolExecution.POINTS_COUNT)){var b=Math.round(this._data.points.item(0).x),c=Math.round(this._data.points.item(0).y),d=this._adapter.getArrowHeight(),e;"buy"==this._adapter.getDirection()?(e=c,c+=d):e=c-d;if(a.x>=b-2&&a.x<=b+2&&a.y>=e&&a.y<=c)return a=this._adapter.getTooltip(),new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget.journalDialog()},tooltip:""!=
a?{text:a,rect:new TradingView.Rect(b,e,2,c-e)}:null})}};function ExecutionPaneView(a,b){$90.call(this,a,b)}inherit(ExecutionPaneView,$90);ExecutionPaneView.prototype._renderer=null;ExecutionPaneView.prototype._rendererCached=!1;ExecutionPaneView.prototype.update=function(){$90.prototype.update.call(this);this._renderer=null;this._rendererCached=!1};
ExecutionPaneView.prototype.renderer=function(){if(this._rendererCached)return this._renderer;this._rendererCached=!0;var a=this.W99,b=a._adapter,c=a.D0.timeScale();if(0==a.points().size())return null;var d=a.points().item(0).index;if(a=a.D0.mainSeries().bars().search(d,SEARCH_NEAREST_LEFT))d=a.index;b._index=d;if(!isFinite(d))return this._renderer=null;a=c.visibleBars();if(!a||d>a.lastBar()||d<a.firstBar())return this._renderer=null;a=this.W99.D0.paneForSource(this.W99).executionsPositionController();
c=c.indexToCoordinate(d);d=a.getYCoordinate(b);if(!isFinite(d))return this._renderer=null;a=new List;a.append({x:c,y:d});return this._renderer=new ExecutionRenderer({points:a},b)};TradingView.LineToolExecution=function(a,b){this._adapter=new ExecutionLineAdapter(this);this._constructor="LineToolExecution";var c=b||new $52("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0};W47.call(this,a,new ExecutionPaneView(this,a),c)};
inherit(TradingView.LineToolExecution,W47);TradingView.LineToolExecution.POINTS_COUNT=1;TradingView.LineToolExecution.skipMagnetting=!0;TradingView.LineToolExecution.prototype.pointsCount=function(){return TradingView.LineToolExecution.POINTS_COUNT};TradingView.LineToolExecution.prototype.title=function(){return"Execution"};TradingView.LineToolExecution.prototype.hasContextMenu=function(){return!1};TradingView.LineToolExecution.prototype.state=function(){return null};
TradingView.LineToolExecution.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showExecutions.value()?null:W47.prototype.paneViews.call(this,a)};TradingView.LineToolExecution.prototype.userEditEnabled=function(){return!1};TradingView.LineToolExecution.prototype.showInObjectTree=function(){return!1};A24=function(a,b,c){var d=this._mtpStudyId()+"@mtp-mtpredictor";c=c||StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),d);b=b||TradingView.prepareStudyProperties(c,null,null,a.studyVersioning());d=TradingView.Study.lineToolNameForPointsBasedStudy(d);A63.call(this,a,this.createPaneViews(a),b,d);this._doNotNeedLine=!0;this._turnaroundCounter=0;this._nextTurnaround();this._metaInfo=c;this._graphics=new A62(c);this._formatter=new VolumeFormatter};
inherit(A24,A63);A24.prototype.series=function(){return isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()};A24.prototype.calcIsActualSymbol=function(){return W47.prototype.calcIsActualSymbol.call(this)};A24.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter};
A24.prototype.createPaneViews=function(a){return[new W31(this,a),new TradingView.Study.StudyPaneView_textmarks(this,a),new TradingView.Study.StudyPaneView_polygons(this,a),new TradingView.Study.StudyPaneView_lines(this,a)]};
A24.prototype.onData=function(a){"data_update"===a.method&&a.params.customId==="pointset_"+this._currentPointsetId?(W47.prototype.onData.call(this,a),this._points.size()==this.pointsCount()&&this._requestStudy()):"data_update"===a.method&&a.params.customId===this._studyId&&this._checkTurnaround(a.params.turnaround)&&(a.params.nonseries.d=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"",""!==a.params.nonseries.d&&this._graphics.process(a.params.nonseries),
0<a.params.nonseries.indexes.length&&(this._indexes=a.params.nonseries.indexes),this.updateAllViews(),this.D0.updateSource(this))};
A24.prototype._requestStudy=function(){var a=this,b=function(b){a.onData(b)},c=this._studyInputs();c&&(this._studyId?(this._nextTurnaround(),this.D0.chartApi().modifyStudy(this._studyId,this._turnaround,c,b)):(this._studyId=TradingView.Study.makeNextStudyId(),this.D0.chartApi().createStudy(this._studyId,this._turnaround,this.D0.mainSeries()._seriesId,this._metaInfo.id+"-1!",c,b)))};A37=function(a,b,c){A24.call(this,a,b,c)};inherit(A37,A24);A37.prototype._mtpStudyId=function(){return"mtp_riskreward"};A37.prototype.pointsCount=function(){return 3};
A37.getTooltipText=function(a){return a&&0!=a._points.size()?1==a._points.size()?"Select Stop Bar":2==a._points.size()?"Select Target Point":null:"Select Entry Setup Bar"};
A37.prototype._studyInputs=function(){var a=this.points().item(0).index,b=this.points().item(1).index,c=this.points().item(2).index,a=this.D0.mainSeries().bars().valueAt(a),b=this.D0.mainSeries().bars().valueAt(b),c=this.D0.mainSeries().bars().valueAt(c);return a&&b&&c?[1E3*a[TIME_PLOT],1E3*b[TIME_PLOT],1E3*c[TIME_PLOT],this.points().item(2).price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),
this.properties().inputs.tickStopOffset.value()]:null};A26=function(a,b,c){A24.call(this,a,b,c);this._symbolIntervalChanged=!1;this.D0.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)};inherit(A26,A24);A26.prototype._mtpStudyId=function(){return"mtp_decisionpoint"};
A26.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0};A26.prototype.pointsCount=function(){return 1};A26.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1E3*a[TIME_PLOT]]:null};
A26.prototype.onData=function(a){A24.prototype.onData.call(this,a);this._symbolIntervalChanged=!1};A33=function(a,b,c){A24.call(this,a,b,c)};inherit(A33,A24);A33.prototype.pointsCount=function(){return 1};A33.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[TIME_PLOT]]:null};
A34=function(a,b,c){A33.call(this,a,b,c)};inherit(A34,A33);A34.prototype._mtpStudyId=function(){return"mtp_ew_main"};A35=function(a,b,c){A33.call(this,a,b,c)};inherit(A35,A33);
A35.prototype._mtpStudyId=function(){return"mtp_ew_major"};A36=function(a,b,c){A33.call(this,a,b,c)};inherit(A36,A33);A36.prototype._mtpStudyId=function(){return"mtp_ew_minor"};A25=function(a,b,c){A24.call(this,a,b,c)};inherit(A25,A24);A25.prototype._mtpStudyId=function(){return"mtp_tsanalysis"};A25.prototype.pointsCount=function(){return 1};
A25.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),
this.properties().inputs.shouldFilterSTFTrends.value()]:null};A44=function(a,b,c,d,e){this._wptStudyId=d;this._pointsCount=e;A24.call(this,a,b,c)};inherit(A44,A24);
A44.prototype._studyInputs=function(){for(var a=[this.properties().inputs.displayZoneLabels.value()],b=0;b<this.pointsCount();++b){var c=this.points().item(b).index,c=this.D0.mainSeries().bars().valueAt(c);if(!c)return null;a.push(1E3*c[TIME_PLOT])}return a};A44.prototype._mtpStudyId=function(){return this._wptStudyId};A44.prototype.pointsCount=function(){return this._pointsCount};
A27=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down1ora",2)};inherit(A27,A44);A27.getTooltipText=function(a){return"Down Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};A28=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down2orb",2)};
inherit(A28,A44);A28.getTooltipText=function(a){return"Down Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};A29=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down3",3)};inherit(A29,A44);
A29.getTooltipText=function(a){return"Down Wave 3: Select Point "+((a?a._points.size():0)+1)};A30=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down4",2)};inherit(A30,A44);A30.getTooltipText=function(a){return"Down Wave 4: Select Point "+((a?a._points.size():0)+1)};
A31=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down5",5)};inherit(A31,A44);A31.getTooltipText=function(a){return"Down Wave 5: Select Point "+((a?a._points.size():0)+1)};A32=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_downc",3)};
inherit(A32,A44);A32.getTooltipText=function(a){return"Down Wave C: Select Point "+((a?a._points.size():0)+1)};A38=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up1ora",2)};inherit(A38,A44);
A38.getTooltipText=function(a){return"Up Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};A39=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up2orb",2)};inherit(A39,A44);A39.getTooltipText=function(a){return"Up Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};
A40=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up3",3)};inherit(A40,A44);A40.getTooltipText=function(a){return"Up Wave 3: Select Point "+((a?a._points.size():0)+1)};A41=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up4",2)};
inherit(A41,A44);A41.getTooltipText=function(a){return"Up Wave 4: Select Point "+((a?a._points.size():0)+1)};A42=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up5",5)};inherit(A42,A44);
A42.getTooltipText=function(a){return"Up Wave 5: Select Point "+((a?a._points.size():0)+1)};A43=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_upc",3)};inherit(A43,A44);A43.getTooltipText=function(a){return"Up Wave C: Select Point "+((a?a._points.size():0)+1)};function MarkRenderer(a){this._data=a}MarkRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){var b=this._data.points.item(0).x+this._data.offsetX,c=this._data.points.item(0).y+this._data.offsetY;a.translate(-.5,-.5);a.drawImage(this._data.image,b,c,this._data.width,this._data.height)}};
MarkRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._data.points.item(0).clone();this._data.offsetX&&(b.x+=this._data.offsetX);this._data.offsetY&&(b.y+=this._data.offsetY);return MathEx.pointInRect(a,b,b.add(new MathEx.Point(this._data.width,this._data.height)))?new HitTestResult(HitTestResult.MOVEPOINT):null};
function $97(a,b,c,d,e,g,h){$90.call(this,a,b);this._image=c;this._offsetX=g||0;this._offsetY=h||0;this._width=d;this._height=e}inherit($97,$90);$97.prototype.setAnchors=function(a){this._anchorsOffset=a};
$97.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.W99.properties().color.value();a.image=this._image;a.offsetX=this._offsetX;a.offsetY=this._offsetY;a.width=this._width;a.height=this._height;if(this.isAnchorsRequired()&&1==a.points.size()){var b=new CompositeRenderer;b.append(new MarkRenderer(a));if(this._anchorsOffset){for(var c=new List,d=0;d<a.points.size();d++)c.append(a.points.item(d).clone().add(this._anchorsOffset));b.append(new SelectionRenderer({points:c}))}else b.append(new SelectionRenderer({points:a.points}));
return b}return new MarkRenderer(a)};$97.prototype.update=function(){$90.prototype.update.call(this)};W79.version=2;W79.prototype.state=function(a){for(var b={panes:[]},c=0;c<this.panes().size();c++)b.panes.push(this.panes().item(c).state(!0,a));b.timeScale=this.m_timeScale.state(a);c=this.publishedChartsTimelineSource();b.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),publishedChartsTimelineProperties:c?c.state(a):void 0};b.version=W79.version;b.timezone=this.timezone();return b};
W79.prototype.asyncState=function(a){return this.publishedChartsTimelineSource().asyncState(a).pipe(function(a){var c={};c.chartProperties={publishedChartsTimelineProperties:a};return c})};
W79.prototype.restoreState=function(a,b){var c={};if(a.panes)if(isArray(a.panes))if(1>a.panes.length)TradingView.logDebug("W79.restoreState: invalid state");else{a.chartProperties&&!a.chartProperties.timezone&&(a.chartProperties.timezone=a.timezone);if(a.chartProperties){var d=a.chartProperties.scalesProperties;!("showLastValue"in d)||"showSeriesLastValue"in d||"showStudyLastValue"in d||(d.showSeriesLastValueProperty=d.showLastValue,d.showStudyLastValueProperty=d.showLastValue);"showSeriesLastValue"in
d&&(c.showSeriesLastValueProperty=!0);"showStudyLastValue"in d&&(c.showStudyLastValueProperty=!0);this.D2.paneProperties.merge(a.chartProperties.paneProperties);this.D2.scalesProperties.merge(a.chartProperties.scalesProperties);a.chartProperties.timezone&&this.D2.timezone.setValue(a.chartProperties.timezone);a.chartProperties.publishedChartsTimelineProperties&&this.publishedChartsTimelineSource().restoreData(a.chartProperties.publishedChartsTimelineProperties,b);this.m_timeScale.restoreState(a.timeScale,
b)}a.timeScale&&this.m_timeScale.restoreState(a.timeScale,b);d=a.panes;this.panes().item(0).restoreState(d[0],b,a.version,c);for(d=1;d<a.panes.length;d++)(this.panes().item(d)||this.createPane()).restoreState(a.panes[d],b,a.version,c);this._invalidateBarColorerCaches();c=this.D19();for(d=0;d<c.size();d++){var e=c.item(d);isInherited(e.constructor,W47)&&e.calcIsActualSymbol()}this._version=a.version;this.timeScale().recalcLockedScale();this.recalculateAllPanes();this.D20(new A22(A22.FULL_UPDATE));
window.saver&&is_authenticated&&this.isJustClonedChart()&&this.mainSeries().onSymbolResolved().subscribe(this,function(){saver.saveChartSilently()},!0)}else TradingView.logDebug("W79.restoreState: invalid state");else TradingView.logDebug("W79.restoreState: invalid state")};
W79.prototype.restoreAxisState=function(a){if(a.panes)if(isArray(a.panes))if(1>a.panes.length)TradingView.logDebug("W79.restoreAxisState: invalid state");else{this.m_timeScale.restoreState(a.timeScale,!1,!0);for(var b=0;b<a.panes.length;b++){var c=this.panes().item(b);c.m_leftPriceScale.restoreState(a.panes[b].leftAxisState);c.m_rightPriceScale.restoreState(a.panes[b].rightAxisState)}this.recalculateAllPanes();this.D20(new A22(A22.FULL_UPDATE))}else TradingView.logDebug("W79.restoreAxisState: invalid state");
else TradingView.logDebug("W79.restoreAxisState: invalid state")};
W75.prototype.state=function(a,b,c){function d(a){return c&&!a.isSavedInStudyTemplates()||a instanceof TradingView.AlertLabel||!a.state||!a.state()||!a.isSavedInChart(b)}var e={};if(a)for(e.sources=[],a=0;a<this.m_dataSources.size();a++)d(this.m_dataSources.item(a))||e.sources.push(this.m_dataSources.item(a).state(b));e.leftAxisState=this.m_leftPriceScale.state();e.leftAxisSources=[];for(a=0;a<this.m_leftPriceScale.D19().size();a++)d(this.m_leftPriceScale.D19().item(a))||e.leftAxisSources.push(this.m_leftPriceScale.D19().item(a).id());
e.rightAxisState=this.m_rightPriceScale.state();e.rightAxisSources=[];for(a=0;a<this.m_rightPriceScale.D19().size();a++)d(this.m_rightPriceScale.D19().item(a))||e.rightAxisSources.push(this.m_rightPriceScale.D19().item(a).id());e.overlayPriceScales={};for(a=0;a<this.m_dataSources.size();a++){var g=this.m_dataSources.item(a);this.isOverlay(g)&&g.isSavedInChart(b)&&(e.overlayPriceScales[g.id()]=g.priceScale().state())}e.stretchFactor=this._stretchFactor;this.m_mainDataSource&&
(e.mainSourceId=this.m_mainDataSource.id());return e};W75.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};W75.prototype.isESDStudy=function(a){return"Script$TV_EARNINGS@tv-scripting"==a.id||"Script$TV_DIVIDENDS@tv-scripting"==a.id||"Script$TV_SPLITS@tv-scripting"==a.id};
W75.prototype.restoreState=function(a,b,c,d){d=d||{};if(!a.leftAxisState||!a.rightAxisState)throw Error("invalid state");if(!a.leftAxisSources||!a.rightAxisSources)throw Error("invalid state");a.stretchFactor&&(this._stretchFactor=a.stretchFactor);var e={};if(a.sources){var g=this.m_dataSources.contains(this.D0.mainSeries());this.clearSeries();g&&this.m_dataSources.append(this.D0.mainSeries());for(var h=0;h<a.sources.length;h++){var k=a.sources[h],l=k.id;e[l]=k.ownerSource;var m=k.type;"MainSeries"===
m?this._restoreMainSeries(k,b,g,d):m.toLowerCase().startsWith("study")?this._restoreStudy(k,b,d):this._restoreLineTool(k,b)}}this.m_leftPriceScale.D19().clear();this.m_leftPriceScale._hasSeries=!1;g=defaults("chartproperties").paneProperties.leftAxisProperties;TradingView.merge(g,a.leftAxisState);this.m_leftPriceScale.restoreState(g);for(h=0;h<a.leftAxisSources.length;h++)if(d=this.dataSourceForId(a.leftAxisSources[h]))this.m_leftPriceScale.addDataSource(d),d.setPriceScale(this.m_leftPriceScale);
this.m_rightPriceScale.D19().clear();this.m_rightPriceScale._hasSeries=!1;g=defaults("chartproperties").paneProperties.rightAxisProperties;TradingView.merge(g,a.rightAxisState);this.m_rightPriceScale.restoreState(g);for(h=0;h<a.rightAxisSources.length;h++)if(d=this.dataSourceForId(a.rightAxisSources[h]))this.m_rightPriceScale.addDataSource(d),d.setPriceScale(this.m_rightPriceScale);b&&this.D2.legendProperties.merge(defaults("chartproperties.paneProperties.legendProperties"));for(h=
0;h<this.m_dataSources.size();h++)d=this.m_dataSources.item(h),this.m_rightPriceScale.D19().contains(d)||this.m_leftPriceScale.D19().contains(d)?d._isOverlay=!1:(d._isOverlay=!0,b=new W76(this.D2.overlayPropreties),b.setHeight(this.m_height),b.setTopMargin(this.m_rightPriceScale.topMargin()),b.setBottomMargin(this.m_rightPriceScale.bottomMargin()),b.addDataSource(d),a.overlayPriceScales&&a.overlayPriceScales[d.id()]&&(g=a.overlayPriceScales[d.id()],g.m_isAutoScale=
!0,g.m_isLog=!1,g.m_isPercentage=!1,b.restoreState(g)),d.setPriceScale(b));for(l in e)(h=e[l])&&(d=this.sourceById(l))&&this.sourceById(l).setOwnerSource(this.sourceById(h));a.mainSourceId&&(this.m_mainDataSource=this.dataSourceForId(a.mainSourceId));if(!this.m_mainDataSource)for(h=0;h<this.m_dataSources.size();h++)if(d=this.m_dataSources.item(h),isInherited(d.constructor,PriceDataSource)){this.m_mainDataSource=d;break}for(h=0;h<this.m_dataSources.size();h++)d=this.m_dataSources.item(h),isInherited(d.constructor,
W47)?(d.ownerSource()||d.setOwnerSource(this.mainDataSource()),d.isFixed()&&d.restoreFixedPoints(),1==c&&d.priceScale().isPercent()&&!d.isFixed()&&d.correctPricesToPercents(),d.fixAfterRestorePriceAxis&&d.fixAfterRestorePriceAxis()):isInherited(d.constructor,TradingView.Study)&&(a=d.properties(),a.linkedToSeries&&a.linkedToSeries.value()&&(d.ownerSource()||d.setOwnerSource(this.model().mainSeries())));this._updateMargins();this._cachedHitTestSources=this._cachedOrderedSoruces=null};
W75.prototype._restoreMainSeries=function(a,b,c,d){var e=a.id,g=a.state,h=a.zorder;c||(this.D0.paneForSource(this.D0.mainSeries()).removeDataSource(this.D0.mainSeries()),this.m_dataSources.append(this.D0.mainSeries()));c=g&&g.style?g.style:void 0;var k=c==TradingView.Series.STYLE_PNF&&g.pnfStyle.lockScale;g&&!g.lockScale&&(g.lockScale=k);c==TradingView.Series.STYLE_PNF&&"ATR"==this.D0.mainSeries().properties().pnfStyle.inputs.style.value()?this.D0.mainSeries().properties().pnfStyle.inputs.style._value=
"Traditional":c==TradingView.Series.STYLE_RENKO&&"ATR"==this.D0.mainSeries().properties().renkoStyle.inputs.style.value()&&(this.D0.mainSeries().properties().renkoStyle.inputs.style._value="Traditional");g&&!g.hasOwnProperty("showSessions")&&(g.showSessions=!1);g&&!g.extendedHours&&(g.extendedHours=!1);g&&b&&(g.showCountdown=!1);g&&(b&&!("showSeriesLastValueProperty"in d)&&"showLastValue"in g&&this.D0.properties().scalesProperties.showSeriesLastValue.setValue(g.showLastValue),delete g.showLastValue);
this.D0.mainSeries().properties().merge(g);this.D0.mainSeries()._prevChartStyle=this.D0.mainSeries().properties().style.value();this.D0.mainSeries().$63();this.D0.mainSeries().setId(e);b&&this.D0.mainSeries().restoreData(a.bars,a.nsBars,a.symbolInfo,a.rtPrice,a.boxSize);void 0!==h&&this.D0.mainSeries().setZorder(h);this.D0.mainSeries().properties().extendedHours.listeners().fire(this.D0.mainSeries().properties().extendedHours);this.D0.mainSeries().symbolInfo()&&
this.D0.mainSeries().onSymbolResolved().fire(this.D0.mainSeries().symbolInfo())};
W75.prototype._restoreStudy=function(a,b,c){var d=a.id,e=a.state,g=a.zorder,h=TradingView.clone(a.metaInfo);$.extend(h,StudyMetaInfo.parseIdString(h.id));if(!this.isESDStudy(h)||b){var k=e,l=this.D0.studyVersioning();c=l.patchPropsStateAndMetaInfo(k,h,{oldShowStudyLastValueProperty:b&&!c.showStudyLastValueProperty});var k=c.propsState,h=c.metaInfo,m=new TradingView.StudyStub(this.D0,a,h.shortDescription);m.setId(d);l.updateMetaInfoAsync(h,b).done(function(c){m.setStatus("");var e=c||h;if(e.isTVScript&&
!b){var g=StudyMetaInfo.parseIdString(e.fullId||e.id).productId;pro.hasPackage(g)||(e=A57.createScriptStubNoSrc("Error: '"+e.shortDescription+"' is not authorized",e.scriptIdPart),$.extend(e,StudyMetaInfo.parseIdString(e.id)),c=h=e,k={})}c=TradingView.prepareStudyPropertiesForLoadChart(h,c,k,null,l);e=TradingView.createStudy(this.D0,c,this.D0.mainSeries(),e);e.setId(d);b&&(c=l.patchStudyData(h,a.data,a.nonSeriesData,a.indexes),e.restoreData(c.data,c.nsData,c.indexes));this.D0.replaceStudyStub(m,
e)||(m=e)}.bind(this)).fail(function(a){console.error(a);m.setStatus("error: "+a)});this.m_dataSources.append(m);void 0!==g&&m.setZorder(g)}};
W75.prototype._restoreLineTool=function(a,b){var c=a.type,d=a.id,e=a.state,g=a.zorder,h=TradingView[c];assert(isInherited(h,W47),"invalid data source type:"+c+" (expected to be a Line Tool)");for(var k=a.points,l=!1,m=0;m<k.length;m++)if(1E4<Math.abs(k[m].offset)){l=!0;break}l||(k=null,l=factoryDefaults("linetool"),isInherited(h,A63)?(k=this.D0.studyVersioning(),a=k.patchPointsBasedStudyState(a),e=a.state,TradingView.merge(l,e),e=a.metaInfo,$.extend(e,StudyMetaInfo.parseIdString(e.fullId)),
metaInfo=k.updateMetaInfo(e)||e,l=TradingView.prepareStudyPropsStateForLoadChart(metaInfo,e,l,null,k),b?TradingView.merge(l,{fixedSize:!1}):TradingView.merge(l,{fixedSize:!0}),e=new $52("study_"+metaInfo.id,l,!0),c=new TradingView[c](this.D0,e,metaInfo)):(h=c.toLowerCase(),TradingView.merge(l,factoryDefaults(h)),TradingView.merge(l,e),b?TradingView.merge(l,{fixedSize:!1}):TradingView.merge(l,{fixedSize:!0}),e=new $52(c.toLowerCase(),l),c=new TradingView[c](this.D0,
e)),c.setId(d),d=this.D0.isJustClonedChart(),h=a.alertId,l=TradingView.D18("alerts")&&TradingView.D18("drawing_alerts"),!d&&l&&h&&c.setAlert&&c.setAlert(h,null,null,!0),d=a.indexes?a.indexes:[],d=d.slice(0,a.points.length),c.isFixed()?c.restorePositionPercents(a.positionPercents):c.restorePoints(a.points,d,b),c instanceof TradingView.LineToolBarsPattern||c instanceof TradingView.LineToolCallout||c instanceof TradingView.LineToolTrendAngle||c instanceof TradingView.LineToolParallelChannel?
c.restoreData(a):b&&c.restoreData&&(d=a,k&&(d.graphics=k.patchPointsBasedStudyData(d.metaInfo,d.graphics)),c.restoreData(d)),k=null==a.version?1:a.version,d=null==c.version?1:c.version,k!=d&&"function"===typeof c.migrateVersion&&c.migrateVersion(k,d,{pane:this,model:this.D0,properties:e}),this.m_dataSources.append(c),void 0!==g&&c.setZorder(g))};
W79.prototype.studyTemplate=function(a){for(var b={panes:[]},c=0;c<this.panes().size();c++)b.panes.push(this.panes().item(c).state(!0,!1,!0));a&&(b.interval=this.mainSeries().interval());b.version=W79.version;return b};W79.prototype.restoreStudyTemplate=function(a,b){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),a,b)};
W79.prototype.theme=function(){var a={};a.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()};a.mainSourceProperties=this.mainSeries().state().state;delete a.mainSourceProperties.symbol;delete a.mainSourceProperties.interval;delete a.chartProperties.paneProperties.topMargin;delete a.chartProperties.paneProperties.bottomMargin;a.version=
W79.version;return a};W79.prototype.restoreTheme=function(a){var b={hollowCandle:{related:"candle"}},c;for(c in b)if(!a.mainSourceProperties[c+"Style"]){var d=a.mainSourceProperties[c+"Style"]=factoryDefaults("chartproperties.mainSeriesProperties."+c+"Style"),e=a.mainSourceProperties[b[c].related+"Style"],g;for(g in e)g in d&&(d[g]=e[g])}this._undoModel.chartLoadTheme(this,a)};function fixLineToolsPositions(a,b,c){var d=a.allLineTools(),e=d.size();a=a.timeScale();a.points();for(var g=0;g<e;++g){for(var h=d.item(g),k=0,l=h.points(),m=l.size(),n=0;n<m;++n){var q=l.item(n);q.time>b&&q.time<=c&&(q.index=a.m_points.indexOf(q.time),++k)}0<k&&h.updateAllViews()}}
TradingView.requestChartSnapshotBars=function(a,b){function c(c){a._currentRequest.requestFirstBarTime(c,g,function(e){e.p[1]>h?(a._currentRequest.disconnect(),delete a._currentRequest,a._haveNoMoreData=!0,b()):d(c)})}function d(c){var d=1;a._haveNoMoreData=!0;var l=!1;a._currentRequest.createSeries("series_id","turnaround",c,g,["bar_count",h-1,-m],function(c){switch(c.method){case "data_update":if(!c.params.plots.length)break;var g=c.params.plots[0].value[TIME_PLOT],q=c.params.plots;a._haveNoMoreData=
q.length<m;l=0==q.length;n=g==h;e.mainSeries().fixLastBar();e.mainSeries().bars().addTail(q,n);c=e.mainSeries().parseJapProjBars(c.params.nonseries);e.mainSeries().m_data.m_nsBars=c.nsBars;e.mainSeries().m_data.lastProjectionPrice=c.lastPrice;e.model().recalculateAllPanes();e.model().updateSource(e.mainSeries());e.model().updateLineTools();e.timeScale().scrollToOffsetAnimated(k);break;case "series_completed":d--,0===d&&(a._currentRequest.disconnect(),delete a._currentRequest,b())}});c=e.D19();
for(var q={},v=0;v<c.size();v++){var B=c.item(v);if(isInherited(B.constructor,TradingView.Study)&&-1!==["Volume","Compare","Overlay","Sessions"].indexOf(B.metaInfo().shortId)){var D="study_"+v,C=B.metaInfo().id+"-1!";q[D]=B;d++;a._currentRequest.createStudy(D,"turnaround","series_id",C,B.inputs(),function(c){var g=c.method;"study_completed"===g||"study_error"===g?(d--,0===d&&(a._currentRequest.disconnect(),delete a._currentRequest,b())):"data_update"!==g||l||(q[c.params.customId].m_data.addTail(c.params.plots,
n),e.model().recalculateAllPanes(),e.model().updateSource(e.mainSeries()))})}}}var e=a.model(),g=e.mainSeries().interval(),h=e.mainSeries().bars().last().value[TIME_PLOT];"function"!==typeof b&&(b=new Function);if(null!=a._currentRequest)TradingView.logDebug("requestSnapshotBars: unexpected requestSnapshotBars");else{var k=e.timeScale().rightOffset();if(!(0>k||a._haveNoMoreData)){var l=e.mainSeries().getSymbolString(),m=Math.max(Math.ceil(k),100),n=!1,q=new TVChartApi;!window.user||"pro_realtime"!==
user.pro_plan&&"pro_realtime_trial"!==user.pro_plan||q.authTokenRequired(!0);a._currentRequest=new ChartSession(q);a._currentRequest.connect(function(b){if("connected"===b.method){b=e.model().timezone();b||(b=defaults("chartproperties").mainSeriesProperties.timezone);a._currentRequest.switchTimezone(b);var d="symbol_id",g=function(b){switch(b.method){case "symbol_error":if(b.params[1]==TradingView.Series.PERMISSION_DENIED){switch(b.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:e.mainSeries().properties().extendedHours.setValue(!1);
b=e.mainSeries().getSymbolString();break;case TradingView.Series.PD_REASON_SYMBOL:b=b.params[3];break;default:b=b.params[2]}b&&(d+="_re",a._currentRequest.resolveSymbol(d,b,g))}break;default:c(d)}};a._currentRequest.resolveSymbol(d,l,g)}else if("timescale_update"===b.method){var h=e.mainSeries().bars().last(),k=e.timeScale().indexToUserTime(h).valueOf()/1E3,h=e.timeScale().points(),m=h.lastTimePointIndex(),m=h.valueAt(m);if(0<b.params.changes.length){var n=b.params.changes[0]==m;n||(k+=1);e.timeScale().addTail(b,
k,n);b=h.lastTimePointIndex();b=h.valueAt(b);fixLineToolsPositions(e.model(),m,b)}}})}}};function FutureBarsRenderer(a){this._data=a}FutureBarsRenderer.prototype.hitTest=function(){return null};FutureBarsRenderer.prototype.draw=function(a){a.fillStyle="rgba(195,255,160, 0.3)";a.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height);a.strokeStyle="#308020";a.beginPath();a.lineWidth=1;var b=Math.round(this._data.x);a.moveTo(b,0);a.lineTo(b,this._data.height);a.stroke()};
TradingView.$79=function(a,b){this._series=a;this._lastBar=b};TradingView.$79.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)-.5*this._series.m_model.timeScale().barSpacing()+1};TradingView.$79.prototype.renderer=function(){var a={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()};return new FutureBarsRenderer(a)};function TextWidthCache(a){this._maxSize=a||50;this._actualSize=0;this._cache={};this._oldestTick=this._usageTick=1;this._tick2Labels={}}
TextWidthCache.prototype.measureText=function(a,b){if(this._cache[b])return this._cache[b].width;if(this._actualSize==this._maxSize){var c=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick];delete this._cache[c];this._oldestTick++;this._actualSize--}c=a.measureText(b).width;this._cache[b]={width:c,tick:this._usageTick};this._tick2Labels[this._usageTick]=b;this._actualSize++;this._usageTick++;return c};function W96(a,b){var c=a._undoModel.D4,d=c.onWidget(),e=!1,e=d?c._options&&!c._options.hideIdeas:TVSettings.getBool("W96.visibile",!1);b?b.merge({visible:e,frozen:!1}):b=new Property({visible:e,frozen:!1});var g=this;b.visible.listeners().subscribe(null,function(a){d||c._containsData||TVSettings.setValue("W96.visibile",!!a.value());g._tooltip&&g._tooltip.removeAll()});W47.call(this,a,null,b);this.onNeedRepaint=new Delegate;this._requests=
[];this._marks={};this.exchangeTimezone=this._collectedRange=this._getDataTimeout=this._loadedRange=null;this.updateTimeZone();this.D0.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks);this.D0.mainSeries().onSymbolResolved().subscribe(this,this.clearMarks);this.D0.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData);this._initialize();this.pinnedTooltips={};this._tooltip=new TooltipRenderer(this._createTooltip.bind(this),this)}
inherit(W96,W47);W96.prototype._constructor="Child class must override this member";W96.prototype._initialize=function(a){throw"Child class must override this member";};W96.prototype.onClicked=function(){throw"Child class must override this member";};W96.prototype._getData=function(a){throw"Child class must override this member";};
W96.prototype._createTooltip=function(){throw"Child class must override this member";};W96.prototype.updateDotData=function(a,b){return b};W96.prototype.updatePlateData=function(a,b){};W96.prototype._plateViewData=function(a){return{}};W96.prototype.pinTooltip=function(a,b){this.pinnedTooltips[a]=b};W96.prototype.timeScale=function(){return this.D0.timeScale()};
W96.prototype.getIntervalInTicks=function(){function a(a){a=parseInt(a);if(a!=a)throw new TypeError("Unexpected interval");return 60*a}var b=a(1440),c=7*b,d=31*b,e=this.D0.mainSeries().properties().interval.value();switch(e){case "M":return d;case "W":return c;case "D":return b;default:return a(e)}};W96.prototype._maxDate=new Date(2037,0,1);
W96.prototype.getVisibleTickmarksRange=function(){if(this.timeScale().isEmpty())return{start:0,end:0};var a=this.timeScale().visibleBars();if(!(a.lastBar()>this.timeScale().points().firstTimePointIndex()&&a.firstBar()<this.timeScale().points().lastTimePointIndex()))return{start:0,end:0};end=a.lastBar()<this.timeScale().points().lastTimePointIndex()?this.timeScale().indexToTimePoint(a.lastBar()):this._maxDate;a={start:this.timeScale().indexToTimePoint(Math.max(a.firstBar(),this.timeScale().points().firstTimePointIndex())),
end:end};return{start:a.start?a.start.getTime()/1E3:void 0,end:a.end?a.end.getTime()/1E3:void 0}};W96.prototype.getVisibleRangePlates=function(){var a=[],b=this.getVisibleTickmarksRange(),c=this.getIntervalInTicks(),d=this;$.each(this._marks,function(e,g){var h=d.timeToExchangeTime(g.tickmark);h>=b.start&&h<=b.end+c&&a.push(g)});return a};
W96.prototype.getPublishedPlates=function(){var a={},b=this;if(!is_authenticated)return a;$.each(this.getVisibleRangePlates(),function(c,d){d.is_public&&(b.pinnedTooltips[d.id]||d.user__id==user.id)&&(a[d.id]=d)});return a};W96.prototype._maxPlatesPerBar=10;
W96.prototype.filterDisplayedPlates=function(a){a=a.reduce(function(a,c){var d=this._getIndex(c.tickmark);a[d]||(a[d]=[]);a[d].push(c);return a}.bind(this),{});return a=Object.keys(a).reduce(function(b,c){var d=a[c],d=d.sort(function(a,b){return b.views_count-a.views_count}),d=d.slice(0,this._maxPlatesPerBar);return b.concat(d)},[])};W96.prototype._layout=function(a){switch(a){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}};
W96.prototype._theme=function(a){switch(a){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}};W96.prototype._offset=function(a,b){var c;switch(a){default:case "up":c=b[HIGH_PLOT];break;case "down":c=b[LOW_PLOT]}this.priceScale().isPercent()&&(c=this.priceScale().priceRange().convertToPercent(c,this.ownerSource().firstValue()));return this.priceScale().priceToCoordinate(c)};
W96.prototype.timeToExchangeTime=function(a){return W77.enabled("charting_library")?parseInt(PineJsCalendar.utc_to_cal(this.exchangeTimezone,1E3*a).valueOf()/1E3):a};W96.prototype._getIndex=function(a){return this.timeScale().points().closestIndexLeft(this.timeToExchangeTime(a))};W96.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}};
W96.prototype.updateTimeZone=function(){if(W77.enabled("charting_library")){var a=this.D0.timezone();"exchange"==a&&(a=this.D0.mainSeries().symbolInfo().timezone);this.exchangeTimezone=PineJsCalendar.get_timezone(a)}};W96.prototype.barWidth=function(){return this.timeScale().barSpacing()};
W96.prototype.getPlatesViewData=function(){if(this.D0.mainSeries().data().isEmpty())return[];var a=this.filterDisplayedPlates(this.getVisibleRangePlates()),b=this,c={},d=this.D0.lastHittestData(),a=a.map(function(a){var e=this._getIndex(a.tickmark),g=this._getBar(e);if(!g)return!1;var m=this._layout(a.direction),n=this._theme(a.direction),q=d&&d.id==a.id,r=this.timeScale().indexToCoordinate(e),g=this._offset(m,g),u=0;e in c||(c[e]={up:0,down:0});u=c[e][m]++;return TradingView.merge({id:a.id,
x:r,y:g,order:u,direction:m,theme:n,hovered:q,pinned:!0===b.pinnedTooltips[a.id],user__id:a.user__id,label:a.label,labelFontColor:a.labelFontColor||"#444",minSize:a.minSize||0},this._plateViewData(a))}.bind(this)),a=a.filter(function(a){return!!a}),e=a.filter(function(a){return 1==a.hovered}),g=0;for(;g<a.length;g++)null!=e[0]&&a[g].user__id==e[0].user__id&&(a[g].highlightByAuthor=!0);a.sort(function(a,b){return a.hovered&&!b.hovered?1:0});return a};W96.prototype._getBar=function(a){return this.D0.mainSeries().data().valueAt(a)};
W96.prototype.paneViews=function(a){var b=this;return this.D2.visible.value()?(new List).append(new $59(this,a,function(a){return new BarsMarksContainerRenderer(a.getViewData(),b)})):new List};W96.prototype.dataWindowView=function(){return null};W96.prototype.priceAxisViews=function(){return null};W96.prototype.statusView=function(){return null};W96.prototype.updateAllViews=function(){};
W96.prototype.pointsCount=function(){return 0};W96.prototype.properties=function(){return this.D2};W96.prototype._rangeDifference=function(a){a=$.extend({},a);this._loadedRange&&(a.start<this._loadedRange.start?a.end=this._loadedRange.start:a.end>this._loadedRange.end&&(a.start=this._loadedRange.end));return a};
W96.prototype._rangeUnion=function(a,b){a=$.extend({},a);b&&(a.start=Math.min(b.start,a.start),a.end=Math.max(b.end,a.end));return a};
W96.prototype._pushGetDataStack=function(a){if(!a.end||!a.start)throw new TypeError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout);this._collectedRange=this._rangeUnion(a,this._collectedRange);this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange);this._getDataTimeout=this._collectedRange=null}.bind(this),300)};W96.prototype.roundRange=function(a){return{start:Math.round(a.start),end:Math.round(a.end)}};
W96.prototype.refreshData=function(){this.getData(this._lastRange)};W96.prototype.getData=function(a){if(!a.start||!a.end)throw new TypeError("Wrong range");this._lastRange=a;a=$.extend({},a);a.end=this._maxDate/1E3;this._pushGetDataStack(a)};W96.prototype._abortAllRequests=function(){this._requests.forEach(function(a){a.abort()});this._requests=[];this._getDataTimeout&&clearTimeout(this._getDataTimeout);this._getDataTimeout=this._collectedRange=null};
W96.prototype.clearMarks=function(){this._abortAllRequests();this._marks={};this._loadedRange=null};function $59(a,b,c){this.source=a;this.pane=b;this._rendererFactory=c}$59.prototype.update=function(){};$59.prototype.renderer=function(){return this._rendererFactory(this.source)};function BarsMarksContainerRenderer(a,b){this._barWidth=a.barWidth;this._plates=a.plates;this._tooltip=a.tooltip;this.D0=b}
BarsMarksContainerRenderer.prototype.draw=function(a){a.save();for(var b=0;b<this._plates.length;b++)if(this._plates[b].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,a));this._tooltip.draw(this._plates.map(function(a){return this._plateTransform(a)}.bind(this)),a);this._tooltip.endDraw();a.restore()};
BarsMarksContainerRenderer.prototype._drawItem=function(a,b){a.save();this._highlightByAuthor&&!b.highlightByAuthor&&(a.globalAlpha=.4);var c=this._dotTransform(b);c.mine?this._drawTriangle(a,c):this._drawDot(a,c);a.restore()};
BarsMarksContainerRenderer.prototype._commonTransform=function(a){var b=Math.max(1.4*a.minSize,this._barWidth+4),b=a.y+{up:-1,down:1}[a.direction]*(b*(a.order+.6)+.25*b);return{id:a.id,theme:this.themes[a.theme+(a.hovered||a.highlightByAuthor?"_hovered":"")],themeName:a.theme,x:Math.round(a.x+1),y:Math.round(b),pinned:a.pinned,hovered:a.hovered}};
BarsMarksContainerRenderer.prototype._dotTransform=function(a){var b=this._commonTransform(a);b.radius=Math.max(a.minSize/2,.4*this._barWidth);b.label=a.label;b.labelFontColor=a.labelFontColor;b.labelFontSize=Math.ceil(Math.max(10,Math.min(b.radius,20)));return this.D0.updateDotData(a,b)};BarsMarksContainerRenderer.prototype._plateTransform=function(a){var b=this._commonTransform(a);return this.D0.updatePlateData(a,b)};BarsMarksContainerRenderer.THEMES=["green","red","neutral","yellow","blue"];
BarsMarksContainerRenderer.prototype.themes={green:{border:"#78C143",background:"#8DDD54",dotBorderWidth:2},red:{border:"#CC4545",background:"#ED5A5A ",dotBorderWidth:2},neutral:{border:"#EAC300",background:"#FFD400",dotBorderWidth:2},yellow:{border:"#EAC300",background:"#FFD400",dotBorderWidth:2},blue:{border:"#047ACE",background:"#0496FF",dotBorderWidth:2}};BarsMarksContainerRenderer.THEMES.forEach(function(a){var b=BarsMarksContainerRenderer.prototype.themes;b[a+"_hovered"]=$.extend({},b[a],{dotBorderWidth:4})});
BarsMarksContainerRenderer.prototype._drawTriangle=function(a,b){a.strokeStyle=b.theme.border;a.fillStyle=b.theme.background;a.lineWidth=b.theme.dotBorderWidth;var c=b.radius,d=Math.cos(Math.PI/6)*c,e=Math.sin(Math.PI/6)*c;a.translate(b.x,b.y);"up"==b.direction&&a.rotate(Math.PI);b["public"]||(a.lineWidth/=2);a.beginPath();a.moveTo(0,-c);a.lineTo(d,e);a.lineTo(-d,e);a.lineTo(0,-c);a.closePath();a.stroke();b["public"]&&a.fill()};
BarsMarksContainerRenderer.prototype._drawDot=function(a,b){a.strokeStyle=b.theme.border;a.fillStyle=b.theme.background;a.lineWidth=b.theme.dotBorderWidth;a.beginPath();a.arc(b.x,b.y,b.radius,0,2*Math.PI,!0);a.closePath();a.stroke();a.fill();b.label&&6<b.radius&&(a.textAlign="center",a.textBaseline="middle",a.font="bold "+b.labelFontSize+"px Arial",a.fillStyle=b.labelFontColor,a.fillText(b.label,b.x,b.y))};
BarsMarksContainerRenderer.prototype.hitTest=function(a){for(var b,c=this._plates.length-1;0<=c;--c)if(b=this._hitTestDot(this._plates[c],a))return b;return null};BarsMarksContainerRenderer.prototype._hitTestDot=function(a,b){var c=this._dotTransform(a),d=new MathEx.Point(c.x,c.y);return MathEx.isInCircle(d,Math.max(c.radius,8),b)?new HitTestResult(HitTestResult.REGULAR,a):null};function W97(){this._layout=[];this._currentId=void 0;this.tooltipHovered=!1}
W97.prototype._createLayout=function(){throw"Child class must override this member";};W97.prototype._updatePlate=function(a){throw"Child class must override this member";};W97.prototype._getContainer=function(a){this._container&&this._context===a||(this._context=a,this._container=$(a.canvas).parent());return this._container};W97.prototype._plateArrowSize=14;
W97.prototype.showPlate=function(a,b){if(this._currentId!=a.id||!this._layout||0==this._layout.length||null==this._layout[0].parentNode){this._currentId=a.id;this._createLayout();this._getContainer(b).append(this._layout);var c=this;this._layout.hover(function(){c.tooltipHovered=!0;$(this).stop(!0).fadeTo(0,1)},function(){c.tooltipHovered=!1})}var d=Math.round(a.barWidth/2);15<d&&(d=15);10>d&&(d=10);this._updatePlate(a);var e=a.x-this._layout.outerWidth()<this._plateArrowSize,g=b.canvas.width-
a.x+Math.round(a.barWidth/2+d);e&&(g-=this._layout.outerWidth()+2*this._plateArrowSize);var h=b.canvas.height;this._layout.toggleClass("right",e);this._layout.css({top:Math.min(Math.max(a.y,20),h-this._layout.outerHeight()-10),right:g,fontSize:d+"px",display:"block"})};W97.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())};W97.prototype._toggleLayout=function(a){this._layout.toggle(a)};
W97.prototype.hide=function(a){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove();a()})};W97.prototype.setSource=function(a){this.source=a};TooltipRenderer=function(a,b){this.tooltips={};this.tooltipFactory=a;this.source=b};TooltipRenderer.prototype.findOrCreateTooltip=function(a){var b=this.tooltips[a.id];null==b&&(a.hovered||a.pinned)&&(b=this._createTooltip(),this.tooltips[a.id]=b);return b};
TooltipRenderer.prototype.showPlate=function(a,b){var c=this.findOrCreateTooltip(a);null!=c&&(c._drawPlate(a,b),c.plateData=a)};TooltipRenderer.prototype.draw=function(a,b){this.hoveredId=null;for(var c=0;c<a.length;c++)a[c].hovered&&(this.hoveredId=a[c].id);a.forEach(function(a){this.showPlate(a,b)}.bind(this))};
TooltipRenderer.prototype.endDraw=function(){for(var a in this.tooltips)if(this.tooltips.hasOwnProperty(a)){var b=this.tooltips[a];b.toggleVisibility();this.hoveredId&&b.plateData.id!=this.hoveredId&&!b.plateData.pinned&&(b.remove(),delete this.tooltips[a])}};TooltipRenderer.prototype.removeAll=function(){for(var a in this.tooltips)this.tooltips.hasOwnProperty(a)&&this.tooltips[a].remove();this.tooltips={}};TooltipRenderer.prototype.removeTooltip=function(a){delete this.tooltips[a]};
TooltipRenderer.prototype._createTooltip=function(){return new TooltipWrap(this,this.tooltipFactory())};TooltipWrap=function(a,b){this.renderer=a;this._tooltip=b;this.visible=!1};TooltipWrap.prototype._drawPlate=function(a,b){var c=this;this.visible=!0;this._tooltip.setSource(this.renderer.source);this._tooltip.showPlate(a,b);a.hovered||a.pinned||this._tooltip.hide(function(){c.renderer.removeTooltip(a.id)})};TooltipWrap.prototype.remove=function(){this._tooltip._removeLayout()};
TooltipWrap.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible);this.visible=!1};function UserDefinedBarsMarks(a){W96.call(this,a);var b=this;TradingView.drawingState.hideMarksOnBars().subscribe(this,function(){b.D2.visible.setValue(!TradingView.drawingState.hideMarksOnBars().value())})}inherit(UserDefinedBarsMarks,W96);UserDefinedBarsMarks.prototype._initialize=function(a){this.D2.visible.setValue(!0)};UserDefinedBarsMarks.prototype._constructor="UserDefinedBarsMarks";UserDefinedBarsMarks.prototype._plateViewData=function(a){return{text:a.text}};
UserDefinedBarsMarks.prototype.onClicked=function(){var a=this.D0.lastHittestData().id;this._marks[a].onClicked()};UserDefinedBarsMarks.prototype.clearMarks=function(){W96.prototype.clearMarks.call(this);this.onNeedRepaint.fire()};
UserDefinedBarsMarks.prototype._getData=function(a){var b=this.D0.mainSeries().symbolInfo();if(b){var c=this.roundRange(this._rangeDifference(a)),d=this,e=this.D0.mainSeries().properties().interval.value();D16.getMarks(b,c.start,c.end,function(b){b.forEach(function(a){d._marks[a.id]=a},d);d._loadedRange=d._rangeUnion(a,d._loadedRange);d.onNeedRepaint.fire()},e)}};UserDefinedBarsMarks.prototype._createTooltip=function(){return new UserDefinedBarsMarksTooltip};
UserDefinedBarsMarks.prototype.updatePlateData=function(a,b){b.barWidth=this.barWidth();b.text=a.text;b.tooltipMargin=-1*Math.max(a.minSize/2,.4*this.barWidth());return b};UserDefinedBarsMarks.prototype.hasContextMenu=function(){return!1};function UserDefinedBarsMarksTooltip(a){W97.call(this)}inherit(UserDefinedBarsMarksTooltip,W97);UserDefinedBarsMarksTooltip.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>');this._layout_text=$('<div class="text"></div>').appendTo(this._layout)};
UserDefinedBarsMarksTooltip.prototype._updatePlate=function(a){this._currentId=a.id;this._layout.css("border-color",a.theme.border);this._layout.css("margin-top",a.tooltipMargin+"px");this._layout_text.html(a.text);this._layout.append(this._layout_text)};function W32(a,b){this.W99=a;this.D0=b;this._points=(new List).append(new MathEx.Point(0,0))}W32.prototype.update=function(){this._visible=!1;if(this.W99.properties().showPriceLine.value()){var a=this.W99.lastValueData("close",!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
W32.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=1;a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};A50=function(a,b){this.W99=a;this.D0=b;this._invalidated=!0;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14};inherit(A50,PriceAxisView);
A50.prototype.update=function(){this._invalidated=!0};A50.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
A50.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.W99.lastValueData("close",!1);a&&(this._text=a.text,this._floatCoordinate=a.floatCoordinate,this._coordinate=a.coordinate,this._textHeight=this.W99.priceScale().m_markBuilder.fontHeight(),this._background=a.color,this._visible=!0)};
A50.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:this._visible};return new PriceAxisViewRenderer(a)};
A49=function(a,b){DataWindowView.call(this);this.D1=a;this.D0=b;this._items.append(new DataWindowItem("Open",""));this._items.append(new DataWindowItem("High",""));this._items.append(new DataWindowItem("Low",""));this._items.append(new DataWindowItem("Close",""));this._invalidated=!0;this.update()};inherit(A49,DataWindowView);
A49.prototype._updateImpl=function(){this._header=this.D1.title();if(!this.D0.timeScale().isEmpty()&&0!==this.D1.data().size()){var a,b,c=!1;this.D1.properties().style.value()===TradingView.Series.STYLE_BARS?(a=this.D1.properties().barStyle.upColor.value(),b=this.D1.properties().barStyle.downColor.value(),c=this.D1.properties().barStyle.barColorsOnPrevClose.value()):this.D1.properties().style.value()===TradingView.Series.STYLE_CANDLES?
(a=this.D1.properties().candleStyle.upColor.value(),b=this.D1.properties().candleStyle.downColor.value(),c=this.D1.properties().candleStyle.barColorsOnPrevClose.value()):this.D1.properties().style.value()===TradingView.Series.STYLE_HOLLOW_CANDLES?(a=this.D1.properties().hollowCandleStyle.upColor.value(),b=this.D1.properties().hollowCandleStyle.downColor.value(),c=!0):this.D1.properties().style.value()===TradingView.Series.STYLE_LINE?a=b=this.D1.properties().lineStyle.color.value():
this.D1.properties().style.value()===TradingView.Series.STYLE_AREA&&(a=b=this.D1.properties().areaStyle.linecolor.value());var d=this.D1.series(),e=this.D0.crossHairSource().index,d=d.nearestIndex(e,SEARCH_NEAREST_LEFT);if(void 0!==d){e=this.D1.data().valueAt(d);if(!(e&&e[OPEN_PLOT]&&e[HIGH_PLOT]&&e[LOW_PLOT]&&e[CLOSE_PLOT]))return;var g=this.D1.formatter();this._items.item(0).setValue(g.format(e[OPEN_PLOT]));this._items.item(1).setValue(g.format(e[HIGH_PLOT]));this._items.item(2).setValue(g.format(e[LOW_PLOT]));
this._items.item(3).setValue(g.format(e[CLOSE_PLOT]));a=c&&1<=d?this.D1.data().valueAt(d-1)[CLOSE_PLOT]<=e[CLOSE_PLOT]?a:b:e[OPEN_PLOT]<=e[CLOSE_PLOT]?a:b;for(b=0;4>b;b++)this._items.item(b).setColor(a)}this._additional=(a=TradingView.getDataVendorString(this.D1.symbolInfo()))?"(Data Provided by "+a+")":void 0}};A49.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};
A49.prototype.update=function(){this._invalidated=!0};A49.prototype.additional=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._additional};
TradingView.study_Overlay=function(a,b,c,d){this._symbolLabelView=new TradingView.W38(a,this,"close");TradingView.Study.call(this,a,b,c,d);this._paneView=this._formatter=null;var e=this;this.properties().minTick.listeners().subscribe(null,function(){e._createFormatter();e.updateAllViews();e.D0.D20(new A22(A22.FULL_UPDATE))})};inherit(TradingView.study_Overlay,TradingView.Study);
TradingView.study_Overlay.prototype.symbol=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name:a).toUpperCase()};
TradingView.study_Overlay.prototype.lastValueData=function(a,b){var c=TradingView.Study.prototype.lastValueData.call(this,"close",b);if(!c)return c;var d=this.properties(),e=c.item;switch(d.style.value()){case TradingView.Series.STYLE_BARS:c.color=e[OPEN_PLOT]<=e[CLOSE_PLOT]?d.barStyle.upColor.value():d.barStyle.downColor.value();break;case TradingView.Series.STYLE_CANDLES:c.color=e[OPEN_PLOT]<=e[CLOSE_PLOT]?d.candleStyle.upColor.value():d.candleStyle.downColor.value();break;case TradingView.Series.STYLE_HOLLOW_CANDLES:c.color=
e[OPEN_PLOT]<=e[CLOSE_PLOT]?d.candleStyle.upColor.value():d.candleStyle.downColor.value();break;case TradingView.Series.STYLE_LINE:c.color=d.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:c.color=d.areaStyle.color1.value()}return c};
TradingView.study_Overlay.prototype.createViews=function(){this._priceAxisViews=new List;this._priceAxisViewsBase=new List;this._priceAxisViewsBase.append(new A50(this,this.D0));this._paneViews=new List;paneView=null;switch(this.D2.style.value()){case TradingView.Series.STYLE_BARS:paneView=new W15(this,this.D0);break;case TradingView.Series.STYLE_CANDLES:paneView=new W16(this,this.D0);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:paneView=
new W18(this,this.D0);break;case TradingView.Series.STYLE_LINE:paneView=new W20(this,this.D2.lineStyle.priceSource.value(),this.D0);break;case TradingView.Series.STYLE_AREA:paneView=new W13(this,this.D2.areaStyle.priceSource.value(),this.D0)}this._paneViews.append(paneView);this._paneViews.append(new W32(this,this.D0));this._paneViews.append(this._symbolLabelView);this._dataWindowView||
(this._dataWindowView=new A49(this,this.D0));this._statusView||(this._statusView=new StudyStatusView(this));this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(this._horizlinesPriceAsisViews)};TradingView.study_Overlay.prototype.barColorer=function(){return new SeriesBarColorer(this)};
TradingView.study_Overlay.prototype.start=function(){this._formatter=null;TradingView.Study.prototype.start.call(this);this.priceScale()&&this.priceScale().updateFormatter()};
TradingView.study_Overlay.prototype._createFormatter=function(){if("default"==this.properties().minTick.value()){var a=this.properties().inputs.symbol.value(),a=this._resolvedSymbols[a];this._formatter=new PriceFormatter(a?a.pricescale:100,a?a.minmov:1,a?a.fractional:!1)}else{var a=this.properties().minTick.value(),a=isNumber(a)?["100","1","false"]:a.split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&this.priceScale().updateFormatter()};
TradingView.study_Overlay.prototype.formatter=function(){this._formatter||this._createFormatter();return this._formatter};TradingView.study_Overlay.prototype._changeInputs=function(){TradingView.Study.prototype._changeInputs.call(this,this.inputs());this.m_formatter=null;this.priceScale().updateFormatter()};TradingView.study_Overlay.prototype.title=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols[a];return(b?b.name+", "+b.exchange:a).toUpperCase()};
TradingView.study_Overlay.prototype.bars=function(){return this.m_data};TradingView.study_Overlay.prototype.open=function(a){return this.bars().valueAt(a)[OPEN_PLOT]};TradingView.study_Overlay.prototype.high=function(a){return this.bars().valueAt(a)[HIGH_PLOT]};TradingView.study_Overlay.prototype.low=function(a){return this.bars().valueAt(a)[LOW_PLOT]};TradingView.study_Overlay.prototype.close=function(a){return this.bars().valueAt(a)[CLOSE_PLOT]};
TradingView.study_Overlay.prototype.hl2=function(a){return(this.high(a)+this.low(a))/2};TradingView.study_Overlay.prototype.hlc3=function(a){return(this.high(a)+this.low(a)+this.close(a))/3};TradingView.study_Overlay.prototype.ohlc4=function(a){return(this.open(a)+this.high(a)+this.low(a)+this.close(a))/4};TradingView.study_Overlay.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var a=this.D2.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};
TradingView.study_Overlay.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews.item(0)._fixedCoordinate};TradingView.Study.graphicsZOrderPriority=function(a){switch(a){case "polygons":return-100;case "trendchannels":return-90;default:return 0}};TradingView.Study.StudyPaneView_horizlines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_horizlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_horizlines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().horizlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.firstValue(),e=this.D1.graphics().indexes,g=this.D0.timeScale().visibleBars(),h=g.firstBar(),g=g.lastBar(),k=0;k<a.length;k++){var l=a[k];if(l.data){var m=this.D1.properties().graphics.horizlines[l.styleId];if(m.visible.value())for(var n=
0;n<l.data.length;n++){var q=l.data[n],r=e[q.startIndex],u=e[q.endIndex];if(!(!q.extendRight&&Math.max(r,u)<h||!q.extendLeft&&Math.min(r,u)>g)){var w={},r=c.indexToCoordinate(r),u=c.indexToCoordinate(u),A=q.level;b.isPercent()&&(A=b.priceRange().convertToPercent(A,d));A=b.priceToCoordinate(A);r=new MathEx.Point(r,A);u=new MathEx.Point(u,A);w.points=(new List).append(r).append(u);w.extendleft=q.extendLeft;w.extendright=q.extendRight;w.width=c.width();w.height=b.height();w.color=m.color.value();w.linewidth=
m.width.value();w.linestyle=m.style.value();this._data.push(w)}}}}}};TradingView.Study.StudyPaneView_vertlines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_vertlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_vertlines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().vertlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.firstValue(),e=this.D1.graphics().indexes,g=this.D0.timeScale().visibleBars(),h=g.firstBar(),g=g.lastBar(),k=0;k<a.length;k++){var l=a[k];if(l.data){var m=this.D1.properties().graphics.vertlines[l.styleId];if(m.visible.value())for(var n=
0;n<l.data.length;n++){var q=l.data[n],r={};if(!(e[q.index]<h||e[q.index]>g)){var u=c.indexToCoordinate(e[q.index])+1,w=q.startPrice,A=q.endPrice,v=b.priceRange();q.extendBottom&&(w=v.minValue());q.extendTop&&(A=v.maxValue());b.isPercent()&&(w=b.priceRange().convertToPercent(w,d),A=b.priceRange().convertToPercent(A,d));w=b.priceToCoordinate(w);A=b.priceToCoordinate(A);w=new MathEx.Point(u,w);u=new MathEx.Point(u,A);r.points=(new List).append(w).append(u);r.extendleft=q.extendBottom;r.extendright=
q.extendTop;r.width=c.width();r.height=b.height();r.color=m.color.value();r.linewidth=m.width.value();r.linestyle=m.style.value();this._data.push(r)}}}}}};TradingView.Study.StudyPaneView_lines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_lines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_lines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().lines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.firstValue(),e=this.D1.graphics().indexes,g=this.D0.timeScale().visibleBars(),h=g.firstBar(),g=g.lastBar(),k=0;k<a.length;k++){var l=a[k];if(l.data){var m=this.D1.properties().graphics.lines[l.styleId];if(m.visible.value())for(var n=
0;n<l.data.length;n++){var q=l.data[n],r=e[q.startIndex]+(q.startOffset||0),u=e[q.endIndex]+(q.endOffset||0);if(!(!q.extendRight&&Math.max(r,u)<h||!q.extendLeft&&Math.min(r,u)>g)){var w={},r=c.indexToCoordinate(r),u=c.indexToCoordinate(u),A=q.startPrice,q=q.endPrice;b.isPercent()&&(A=b.priceRange().convertToPercent(A,d),q=b.priceRange().convertToPercent(q,d));A=b.priceToCoordinate(A);q=b.priceToCoordinate(q);r=new MathEx.Point(r,A);u=new MathEx.Point(u,q);w.points=(new List).append(r).append(u);w.color=
m.color.value();w.linewidth=m.width.value();w.linestyle=m.style.value();this._data.push(w)}}}}}};TradingView.Study.StudyPaneView_hlines=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textData=[];this._textRendererCache={}};TradingView.Study.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_hlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new HorzLineRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData();this._calcTextData()};
TradingView.Study.StudyPaneView_hlines.prototype._calcTextData=function(){this._textData=[];var a=this.D1.graphics().hlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.firstValue(),e=0;e<a.length;e++){var g=a[e];if(g.data){var h=this.D1.properties().graphics.hlines[g.styleId];if(h.enableText.value()&&h.showText.value())for(var k=0;k<g.data.length;k++){var l=g.data[k],m={};m.text=void 0===l.text?"":l.text;m.color=
h.color.value();m.font="arial";m.fontsize=h.fontSize.value();l=l.level;b.isPercent()&&(l=b.priceRange().convertToPercent(l,d));l=b.priceToCoordinate(l);tp=h.textPos.value();var n;if(tp==CanvasEx.TEXTPOS_TOPLEFT||tp==CanvasEx.TEXTPOS_MIDDLELEFT||tp==CanvasEx.TEXTPOS_BOTTOMLEFT)n=4,m.horzAlign="left";else if(tp==CanvasEx.TEXTPOS_TOPCENTER||tp==CanvasEx.TEXTPOS_MIDDLECENTER||tp==CanvasEx.TEXTPOS_BOTTOMCENTER)n=c.width()/2,m.horzAlign="center";else if(tp==CanvasEx.TEXTPOS_TOPRIGHT||tp==CanvasEx.TEXTPOS_MIDDLERIGHT||
tp==CanvasEx.TEXTPOS_BOTTOMRIGHT)n=c.width(),m.horzAlign="right";if(tp==CanvasEx.TEXTPOS_TOPLEFT||tp==CanvasEx.TEXTPOS_TOPCENTER||tp==CanvasEx.TEXTPOS_TOPRIGHT)m.vertAlign="bottom",l-=4;else if(tp==CanvasEx.TEXTPOS_MIDDLELEFT||tp==CanvasEx.TEXTPOS_MIDDLECENTER||tp==CanvasEx.TEXTPOS_MIDDLERIGHT)m.vertAlign="middle",l-=2;else if(tp==CanvasEx.TEXTPOS_BOTTOMLEFT||tp==CanvasEx.TEXTPOS_BOTTOMCENTER||tp==CanvasEx.TEXTPOS_BOTTOMRIGHT)m.vertAlign="top";p1=new MathEx.Point(n,l);m.points=(new List).append(p1);
m.offsetX=0;m.offsetY=0;this._textData.push(m)}}}}};
TradingView.Study.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){this._data=[];var a=this.D1.graphics().hlines;if(a){var b=this.D1.priceScale();if(b&&!b.isEmpty())for(var c=this.D1.firstValue(),d=0;d<a.length;d++){var e=a[d];if(e.data){var g=this.D1.properties().graphics.hlines[e.styleId];if(g.visible.value())for(var h=0;h<e.data.length;h++){var k={},l=e.data[h].level;b.isPercent()&&(l=b.priceRange().convertToPercent(l,c));l=b.priceToCoordinate(l);k.points=(new List).append(new MathEx.Point(0,
l));k.color=g.color.value();k.linewidth=g.width.value();k.linestyle=g.style.value();k.hitTestResult=HitTestResult.REGULAR;this._data.push(k)}}}}};TradingView.Study.StudyPriceAxisView_hlines=function(a,b,c,d,e){this.D1=a;this.D0=b;this._line=c;this._styleId=d;this._data={};this._lineType=e;this._invalidated=!0};inherit(TradingView.Study.StudyPriceAxisView_hlines,PriceAxisView);TradingView.Study.StudyPriceAxisView_hlines.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPriceAxisView_hlines.prototype.updateImpl=function(){this._data={};this._data.visible=!1;var a=this.D1.priceScale();if(a&&!a.isEmpty()&&this.D1.properties().visible.value()){var b=this.D1.properties().graphics[this._lineType][this._styleId];if(b.visible&&b.visible.value()&&b.showPrice&&b.showPrice.value()){var c=this.D1.firstValue();this._data.visible=!0;this._data.color="white";this._data.background=b.color.value();b=this._line.level;if(a.isPercent()){if(!isNumber(c))return;
b=a.priceRange().convertToPercent(b,c)}this._data.coordinate=a.priceToCoordinate(b);this._data.textHeight=a.m_markBuilder.fontHeight();this._data.text=a.formatter().format(b)}}};TradingView.Study.StudyPriceAxisView_hlines.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);return new PriceAxisViewRenderer(this._data)};function TriangleTextMarkRenderer(a,b){this._data=a;this._textCache=b}
TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
TriangleTextMarkRenderer.prototype.draw=function(a){if(this._data){var b="up"==this._data.direction?1:-1,c=this._data.point.x;"left"==this._data.halign?c-=this._data.size:"right"==this._data.halign&&(c+=this._data.size);var d=this._data.point.y;a.font=this.fontStyle();var e=a.measureText(this._data.text).width;this._textCache.textWidth=e;var g=this._data.fontSize,h=.65*g,k=1*g;a.save();a.translate(c+.5,d+.5);a.beginPath();a.moveTo(0,0);switch(this._data.direction){case "up":case "down":a.lineTo(h,
k*b);a.lineTo(.5*e+h,k*b);a.lineTo(.5*e+h,(k+1.75*g)*b);a.lineTo(.5*-e-h,(k+1.75*g)*b);a.lineTo(.5*-e-h,k*b);a.lineTo(-h,k*b);a.lineTo(0,0);a.strokeStyle=this._data.borderColor;a.stroke();a.fillStyle=this._data.color;a.fill();a.fillStyle=this._data.fontColor;a.fillText(this._data.text,.5*-e,0>b?b*k-.5*g:k+1.25*g);break;default:throw this._data.direction+" doesn't supported by TriangleTextMarkRenderer";}a.restore()}};
TriangleTextMarkRenderer.prototype.hitTest=function(a){var b=this._textCache.textWidth,c=this._data.fontSize;switch(this._data.direction){case "up":case "down":var d="up"==this._data.direction?1:-1,e=.65*c,g=1*c,h=this._data.point.x;"left"==this._data.halign?h-=this._data.size:"right"==this._data.halign&&(h+=this._data.size);var k=this._data.point.y,l=h+.5*b+e,m=k+g*d,g=k+(g+1.75*c)*d;g<m&&(k=m,m=g,g=k);if(MathEx.pointInRect(a,new MathEx.Point(h-.5*b-e,m),new MathEx.Point(l,g)))return new HitTestResult(HitTestResult.REGULAR);
b=[{}];b[0].x=this._data.point.x;b[0].y=this._data.point.y;b[1]={};b[1].x=this._data.point.x+.65*c;b[1].y=this._data.point.y+c*d;b[2]={};b[2].x=this._data.point.x-.65*c;b[2].y=this._data.point.y+c*d;c=(a.x-b[0].x)*(b[1].y-b[0].y)-(a.y-b[0].y)*(b[1].x-b[0].x);if(0<((a.x-b[1].x)*(b[2].y-b[1].y)-(a.y-b[1].y)*(b[2].x-b[1].x))*c&&0<((a.x-b[2].x)*(b[0].y-b[2].y)-(a.y-b[2].y)*(b[0].x-b[2].x))*c)return new HitTestResult(HitTestResult.REGULAR);break;default:throw this._data.direction+" doesn't supported by TriangleTextMarkRenderer";
}return null};function RectangleTextMarkRenderer(a,b){this._data=a;this._textCache=b}RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
RectangleTextMarkRenderer.prototype.draw=function(a){if(this._data){var b=this._data.point.x,c=this._data.point.y;a.font=this.fontStyle();var d=a.measureText(this._data.text).width;this._textCache.textWidth=d;a.save();a.translate(b+.5,c+.5);a.beginPath();a.moveTo(0,0);b=this._data.valign;a.textAlign=this._data.halign;switch(b){case "middle":a.textBaseline="middle";break;case "top":a.textBaseline="bottom";break;case "bottom":a.textBaseline="hanging"}a.fillStyle=this._data.fontColor;a.fillText(this._data.text,
0,0);a.restore()}};RectangleTextMarkRenderer.prototype.hitTest=function(a){var b=this._data.point.x+.5,c=this._data.point.y+.5,d=this._textCache.textWidth,e=this._data.fontSize,g=this._data.halign;switch(this._data.valign){case "middle":c-=e/2;break;case "bottom":c-=e}switch(g){case "right":b-=d;break;case "center":b-=d/2}g=new MathEx.Point(b,c);b=new MathEx.Point(b+d,c+e);return MathEx.pointInRect(a,g,b)?new HitTestResult(HitTestResult.REGULAR):null};
function CircleShapeMarkRenderer(a,b){this._data=a;this._textCache=b}CircleShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=this._data.point.x,d=this._data.point.y;a.save();a.fillStyle=this._data.color;a.beginPath();a.arc(c+1,d+2*this._data.size*b+.5,this._data.size,0,2*Math.PI);a.closePath();a.fill();a.stroke()}};
CircleShapeMarkRenderer.prototype.hitTest=function(a){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-a.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*b-a.y,2)<=Math.pow(this._data.size,2)?new HitTestResult(HitTestResult.REGULAR):null};function SquareShapeMarkRenderer(a,b){this._data=a;this._textCache=b}
SquareShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=parseInt(this._data.size),d=new MathEx.Point(this._data.point.x-c/2,this._data.point.y-c/2+b*c),b=(new MathEx.Point(this._data.point.x+c/2,this._data.point.y+c/2+b*c)).substract(d);a.beginPath();a.fillStyle=this._data.color;a.rect(d.x,d.y,b.x,b.y);a.stroke();a.fill()}};
SquareShapeMarkRenderer.prototype.hitTest=function(a){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=parseInt(this._data.size),d=new MathEx.Point(this._data.point.x-c/2,this._data.point.y-c/2+b*c),c=new MathEx.Point(this._data.point.x+c/2,this._data.point.y+c/2+b*c),b=new MathEx.Point(Math.min(d.x,c.x),Math.min(d.y,c.y)),d=new MathEx.Point(Math.max(d.x,c.x),Math.max(d.y,c.y));return MathEx.pointInRect(a,b,d)?new HitTestResult(HitTestResult.REGULAR):null};
function ArrowShapeMarkRenderer(a,b,c){this._data=a;this._textCache=b;this._arrowDirection=c}
ArrowShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b=this._arrowDirection,c=1*this._data.size,d=this._data.color,e=this._data.point.x+1,g=this._data.point.y,h=1.1*c;switch(b){case "up":g-=h;break;case "down":g+=h}var h=c/6,k=c/4,l=c/3,m=c/2,n=.6666666*c;a.save();a.fillStyle=d;a.beginPath();switch(b){case "up":a.moveTo(e,g);a.lineTo(e-m,g+n);a.lineTo(e-k,g+n);a.lineTo(e,g+l);a.lineTo(e+k,g+n);a.lineTo(e+m,g+n);a.lineTo(e,g);break;case "down":a.moveTo(e,g+c);a.lineTo(e-m,g+l);a.lineTo(e-
k,g+l);a.lineTo(e,g+n);a.lineTo(e+k,g+l);a.lineTo(e+m,g+l);a.lineTo(e,g+c);break;case "right":a.moveTo(e+h,g);a.lineTo(e-h,g-k);a.lineTo(e-h,g+k);a.lineTo(e+h,g);break;case "left":a.moveTo(e-h,g),a.lineTo(e+h,g-k),a.lineTo(e+h,g+k),a.lineTo(e-h,g)}a.closePath();a.fill();a.stroke()}};
ArrowShapeMarkRenderer.prototype.hitTest=function(a){var b=this._data.point.x,c=this._data.point.y,d=this._arrowDirection,e=1*this._data.size,g=e/2,g=1.1*e;switch(d){case "up":c-=g;break;case "down":c+=g}var h=e/6,k=e/4,l=e/3,g=e/2,m=.6666666*e;switch(d){case "up":var n=new MathEx.Point(b,c),q=new MathEx.Point(b+g,c+m),r=new MathEx.Point(b-g,c+m);break;case "down":n=new MathEx.Point(b,c+e);q=new MathEx.Point(b+g,c+l);r=new MathEx.Point(b-g,c+l);break;case "right":n=new MathEx.Point(b+h,c);q=new MathEx.Point(b-
h,c-k);r=new MathEx.Point(b-h,c+k);break;case "left":n=new MathEx.Point(b-h,c),q=new MathEx.Point(b+h,c-k),r=new MathEx.Point(b+h,c+k)}return MathEx.pointInTriangle(n,q,r,a)?new HitTestResult(HitTestResult.REGULAR):null};TradingView.Study.StudyPaneView_textmarks=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_textmarks,LocationToYMixin);TradingView.Study.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_textmarks.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "triangle":a.append(new TriangleTextMarkRenderer(this._data[b],this._textCache[b]));break;case "rectangle":a.append(new RectangleTextMarkRenderer(this._data[b],this._textCache[b]))}return a};
TradingView.Study.StudyPaneView_textmarks.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().textmarks;if(a){var b=this.D1.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D1.firstValue(),g=this.D0.timeScale().visibleBars(),h=g.firstBar(),g=g.lastBar(),k=0;k<a.length;k++){var l=a[k];if(l.data){var m=this.D1.properties().graphics.textmarks[l.styleId];if(m.visible.value())for(var l=
l.data,n=0;n<l.length;n++){var q=l[n],r={},u=m.location.value(),w=m.shape.value(),A=d[q.time];if(!(A<h||A>g)&&this.D1.series().bars().valueAt(A)){A=d[q.time]+(q.offset||0);r.font=m.fontFamily.value();r.color=generateColor(m.color.value(),m.transparency.value());r.bold=m.fontBold.value();r.fontColor=generateColor(m.fontColor.value(),m.transparency.value());r.italic=m.fontItalic.value();r.fontSize=m.fontSize.value();r.text=q.text?q.text:"";r.halign=m.halign.value();r.valign=void 0!=m.valign?m.valign.value():
"middle";r.shape=m.shape.value();r.size=.5*c.barSpacing();r.borderColor="rgb(0, 0, 0)";var v,B;switch(w){case "triangle":B=this._calcCoordsForTriangleShape(u,A,50,q.price,e,b);r.direction=B.direction;v=Math.round(c.indexToCoordinate(A));B=B.y;break;case "rectangle":B=this._calcCoordsForRectangleShape(u,A,q.price,e,b,c),v=B.x,B=B.y}r.point=new MathEx.Point(v,B);this._data.push(r);this._textCache.push({})}}}}}};
TradingView.Study.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(a,b,c,d,e,g){switch(a){case CanvasEx.MARKLOC_TOP:a=g.height()-c;b="down";break;case CanvasEx.MARKLOC_BOTTOM:a=c;b="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:g.isPercent()&&(d=g.priceRange().convertToPercent(d,e));a=g.priceToCoordinate(d);b="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:g.isPercent()&&(d=g.priceRange().convertToPercent(d,e));a=g.priceToCoordinate(d);b="up";break;case CanvasEx.MARKLOC_ABOVEBAR:a=
this._locationToY(a,b);b="down";break;case CanvasEx.MARKLOC_BELOWBAR:a=this._locationToY(a,b);b="up";break;default:a=this._locationToY(a,b),b="up"}return{y:a,direction:b}};
TradingView.Study.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(a,b,c,d,e,g){var h=Math.round(g.indexToCoordinate(b));switch(a){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:e.isPercent()&&(c=e.priceRange().convertToPercent(c,d));a=e.priceToCoordinate(c);break;case CanvasEx.MARKLOC_ABOVEBAR:a=this._locationToY(a,b);break;case CanvasEx.MARKLOC_BELOWBAR:a=this._locationToY(a,b);break;case CanvasEx.MARKLOC_RIGHT:h=g.width();
e.isPercent()&&(c=e.priceRange().convertToPercent(c,d));a=e.priceToCoordinate(c);break;case CanvasEx.MARKLOC_LEFT:h=g.width();e.isPercent()&&(c=e.priceRange().convertToPercent(c,d));a=e.priceToCoordinate(c);break;default:a=this._locationToY(a,b)}return{x:h,y:a}};TradingView.Study.StudyPaneView_shapemarks=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_shapemarks,LocationToYMixin);
TradingView.Study.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_shapemarks.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "circle":a.append(new CircleShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "square":a.append(new SquareShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "arrowUp":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"up"));
break;case "arrowDown":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"down"));break;case "arrowRight":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"right"));break;case "arrowLeft":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"left"))}return a};
TradingView.Study.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().shapemarks;if(a){var b=this.D1.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),g=e.firstBar(),e=e.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.D1.properties().graphics.shapemarks[k.styleId];if(l.visible.value())for(var k=k.data,m=0;m<k.length;m++){var n=
k[m],q=d[n.time];if(!(q<g||q>e)){var r={};if(null!=n.time&&this.D1.series().bars().valueAt(q)){r.color=generateColor(l.color.value(),l.transparency.value());var u=0;"left"==l.halign.value()?u-=c.barSpacing()/2+1:"right"==l.halign.value()&&(u+=c.barSpacing()/2+1);r.size=l.size.value();r.shape=l.shape.value();var u=Math.round(c.indexToCoordinate(q))+u,w=this.D1.firstValue(),n=n.price;b.isPercent()&&(n=b.priceRange().convertToPercent(n,w));n=b.priceToCoordinate(n);w=l.location.value();switch(w){case CanvasEx.MARKLOC_ABSOLUTE:r.direction=
"";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:r.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:r.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:n=this._locationToY(w,q,Math.floor(2*r.size/c.barSpacing())+1);r.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:n=this._locationToY(w,q,Math.floor(2*r.size/c.barSpacing())+1);r.direction="down";break;default:console.warn("Bad location value: "+w),n=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,q),r.direction="up"}r.point=new MathEx.Point(u,
n);this._data.push(r);this._textCache.push({})}}}}}}};function BackgroundRenderer(a){this._data=a}BackgroundRenderer.prototype.draw=function(a){};BackgroundRenderer.prototype.drawBackground=function(a){var b=this._data;clearRect(a,b.x1,b.y1,b.x2-b.x1,b.y2-b.y1,generateColor(this._data.color,this._data.transparency))};BackgroundRenderer.prototype.hitTest=function(a){return null};TradingView.Study.StudyPaneView_backgrounds=function(a,b){this.D1=a;this.D0=b;this._data=[]};
TradingView.Study.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0};TradingView.Study.StudyPaneView_backgrounds.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new BackgroundRenderer(this._data[b]));return a};
TradingView.Study.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(a){return"inSession"===a||"outOfSession"===a?!this.D1._series.properties().extendedHours.value():!1};
TradingView.Study.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().backgrounds;if(a){var b=this.D0.timeScale(),c=this.D1.priceScale();if(c&&!c.isEmpty()&&b&&!b.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),g=e.firstBar(),e=e.lastBar(),h=0;h<a.length;h++){var k=a[h],l=k.styleId,k=k.data,m=this.D1.properties().graphics.backgrounds[l];if(!this._hideExtendedHours(l)&&m.visible.value())for(var n,
q,l=0;l<k.length;l++){var r=k[l],u={},w=d[r.start],A=d[r.stop];if(!(A<g||w>e)&&null!=r.start&&null!=r.stop){var r=Math.ceil(b.indexToCoordinate(w,!0)-.5*b.barSpacing()),v=Math.ceil(b.indexToCoordinate(A,!0)+.5*b.barSpacing());q==w-1&&(r=n);n=v;q=A;0>r&&0>v||r>b.width()&&v>b.width()||(u.x1=r,u.x2=v,u.y1=0,u.y2=c.height(),u.color=m.color.value(),u.transparency=m.transparency.value(),this._data.push(u))}}}}};
TradingView.Study.StudyPaneView_polygons=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0};TradingView.Study.StudyPaneView_polygons.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new PoligonRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_polygons.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().polygons;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.firstValue(),e=this.D1.graphics().indexes,g=this.D0.timeScale().visibleBars(),h=g.firstBar(),g=g.lastBar(),k=0;k<a.length;k++){var l=a[k];if(l.data){var m=this.D1.properties().graphics.polygons[l.styleId];if(100!=m.transparency.value())for(var n=
0;n<l.data.length;n++){for(var q=l.data[n],r=Infinity,u=-Infinity,w=0;q.points&&w<q.points.length;w++)var A=e[q.points[w].index]+(q.points[w].offset||0),r=Math.min(r,A),u=Math.max(u,A);if(!(u<h||r>g)){r={};r.points=new List;for(w=0;q.points&&w<q.points.length;w++)objPoint=q.points[w],x=c.indexToCoordinate(e[objPoint.index]+(objPoint.offset||0)),u=objPoint.level,b.isPercent()&&(u=b.priceRange().convertToPercent(u,d)),y=b.priceToCoordinate(u),u=new MathEx.Point(x,y),u.data=w,r.points.append(u);r.color=
m.color.value();r.backcolor=m.color.value();r.linewidth=void 0!=m.showBorder&&m.showBorder.value()?1:0;r.linestyle=CanvasEx.LINESTYLE_SOLID;r.filled=!0;r.fillBackground=!0;r.transparency=m.transparency.value();r.mouseTouchable=m.mouseTouchable.value();this._data.push(r)}}}}}};TradingView.Study.StudyPaneView_trendchannels=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0};
TradingView.Study.StudyPaneView_trendchannels.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new CompositeRenderer,b=0;b<this._data.length;b++)a.append(new PoligonRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().trendchannels;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=function(a){b.isPercent()&&(a=b.priceRange().convertToPercent(a,g));return b.priceToCoordinate(a)},e=function(a,b,c,d,e,g){var h=new MathEx.Point(0,0);d=new MathEx.Point(c,d);e&&(e=a.substract(b),(e=MathEx.intersectRayWithRect(a,a.add(e),h,d))?
a=e:b.x=c);g&&(e=b.substract(a),(e=MathEx.intersectRayWithRect(b,b.add(e),h,d))?b=e:b.x=c);return[a,b]},g=this.D1.firstValue(),h=this.D1.graphics().indexes,k=this.D0.timeScale().visibleBars(),l=k.firstBar(),k=k.lastBar(),m=0;m<a.length;m++){var n=a[m];if(n.data)for(var q=this.D1.properties().graphics.trendchannels[n.styleId],r=0;r<n.data.length;r++){var u=n.data[r],w=h[u.startIndex],A=h[u.endIndex];if(!(Math.max(w,A)<l&&!u.extendRight||Math.min(w,A)>k&&!u.extendLeft)){var v=d(u.startHighPrice,
b,g),B=d(u.startLowPrice,b,g),D=d(u.endHighPrice,b,g),C=D-(v-B),w=c.indexToCoordinate(w),A=c.indexToCoordinate(A),v=new MathEx.Point(w,v),B=new MathEx.Point(w,B),D=new MathEx.Point(A,D),C=new MathEx.Point(A,C),D=e(v,D,c.width(),b.height(),u.extendLeft,u.extendRight),C=e(B,C,c.width(),b.height(),u.extendLeft,u.extendRight),v=D[0],D=D[1],B=C[0],C=C[1],A={};A.points=new List;A.points.append(v);A.points.append(B);A.points.append(C);A.points.append(D);A.color=q.color.value();A.backcolor=q.color.value();
A.linewidth=void 0!=q.borderWidth?q.borderWidth.value():0;A.linestyle=CanvasEx.LINESTYLE_SOLID;A.filled=!0;A.fillBackground=!0;u.transparency?(u=u.transparency+q.transparency.value(),A.transparency=Math.min(u,100)):A.transparency=q.transparency.value();A.mouseTouchable=!0;this._data.push(A)}}}}};TradingView.Study.StudyPaneView_hhists=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textData=[];this._textRendererCache={}};
TradingView.Study.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0};TradingView.Study.StudyPaneView_hhists.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);var a=new CompositeRenderer,b;for(b in this._data)a.append(new HorizHistogramRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new HitTestResult(HitTestResult.REGULAR)));return a};
TradingView.Study.StudyPaneView_hhists.prototype._updateViewInternal=function(){this._data=[];this._textData=[];var a=this.D1.priceScale(),b=this.D0.timeScale();if(a&&!a.isEmpty()&&b&&!b.isEmpty()){var c=this.D1.graphics().hhists;if(c)for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),g=e.firstBar(),e=e.lastBar(),h=0;h<c.length;h++){var k=c[h],l=this.D1.properties().graphics.hhists[k.styleId];if(l.visible.value()){var k=k.dataObj,m;for(m in k){for(var n=
k[m],q=Infinity,r=-Infinity,u=n.length;u--;)q=Math.min(q,d[n[u].firstBarTime]),r=Math.max(r,d[n[u].lastBarTime]);r<g||q>e||this._updateDataForRenderers(n,l,a,b,d)}}}}};
TradingView.Study.StudyPaneView_hhists.prototype._updateDataForRenderers=function(a,b,c,d,e){for(var g=[],h=this._findMaxRate(a),k=this.D1.firstValue(),l=null,m=null,n=null,q={},r=0;r<a.length;r++){var u=a[r];null===m&&(m=this._findActualRateLength(u.rate));null===l&&(l=Math.abs(d.indexToCoordinate(e[u.firstBarTime])-d.indexToCoordinate(e[u.lastBarTime])),l=b.percentWidth.value()*l/100,l-=m,l=Math.max(l,0));for(var w=!1,A,v=0;v<m;v++)if(0!=u.rate[v]){q[v]=void 0==q[v]?u.rate[v]:q[v]+u.rate[v];
if(c.isPercent())var B=c.priceRange().convertToPercent(u.priceHigh,k),D=c.priceRange().convertToPercent(u.priceLow,k);else B=u.priceHigh,D=u.priceLow;var C={};C.y1=c.priceToCoordinate(B)+1;C.y2=c.priceToCoordinate(D)-1;0===r&&(A=C.y2,lastHistHeight=C.y2-C.y1);D=b.location.value();B=b.direction.value();if(D==CanvasEx.HHISTLOC_ABSOLUTE&&B==CanvasEx.HHISTDIR_LEFTTORIGHT)var z=d.indexToCoordinate(e[u.firstBarTime]),F=1,G="left";else if(D==CanvasEx.HHISTLOC_ABSOLUTE&&B==CanvasEx.HHISTDIR_RIGHTTOLEFT)z=
d.indexToCoordinate(e[u.lastBarTime]),F=-1,G="right";else if(D==CanvasEx.HHISTLOC_RELATIVE&&B==CanvasEx.HHISTDIR_LEFTTORIGHT)z=0,F=1,G="left";else if(D==CanvasEx.HHISTLOC_RELATIVE&&B==CanvasEx.HHISTDIR_RIGHTTOLEFT)z=d.width(),F=-1,G="right";else throw Error("Unknown location/direction values: "+D+"/"+B);C.x1=0==v?z:z+F*(l*u.rate[v-1]/h+m);C.x2=C.x1+l*u.rate[v]/h*F;C.colorBg=b.colors[v].value();C.transparency=b.transparencies[v].value();C.blendedColor=generateColor(C.colorBg,C.transparency);C.x0=z;
g.push(C);n||(n=.6*(C.y2-C.y1));if(!w&&b.showValues.value()&&7.5<=n){var w=!0,J={},D=this.D1.formatter(),E=function(a,b,c){if(c==CanvasEx.HHISTDIR_LEFTTORIGHT)return a+b;if(c==CanvasEx.HHISTDIR_RIGHTTOLEFT)return b+a;throw Error("Unknown direction value: "+c);};J.text="";for(var I=0;I<m;I++)J.text=E(J.text,D.format(u.rate[I]),B),I!=m-1&&(J.text=E(J.text,"x",B));J.color=b.valuesColor.value();J.font="arial";J.fontsize=n;J.horzAlign=G;J.vertAlign="middle";p1=new MathEx.Point(z+3*F,C.y2-.61*(C.y2-
C.y1));J.points=(new List).append(p1);J.offsetX=0;J.offsetY=0;this._textData.push(J);if(r===a.length-1){C=z+3*F;I=A+.39*lastHistHeight;C={text:"",color:TradingView.shiftColor(b.valuesColor.value(),1.5),font:"arial",fontsize:n,horzAlign:G,vertAlign:"middle",points:(new List).append(new MathEx.Point(C,I)),offsetX:0,offsetY:0};for(I=0;I<m;I++)C.text=E(C.text,D.format(q[I]),B),I!=m-1&&(C.text=E(C.text,"x",B));this._textData.push(C)}}}}0<g.length&&this._data.push(g)};
TradingView.Study.StudyPaneView_hhists.prototype._findMaxRate=function(a){for(var b=0,c=0,d=0;d<a.length;d++){for(var e=c=0;e<a[d].rate.length;e++)c+=a[d].rate[e];b=Math.max(b,c)}return b};TradingView.Study.StudyPaneView_hhists.prototype._findActualRateLength=function(a){for(var b=0,c=0;c<a.length;++c){var d=a[c];if(null!==d&&void 0!==d)b++;else break}return b};function HorizHistogramRenderer(a){this._data=a}
function searchCoord(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>>1,g=a[e].y1,h=a[e].y2;if(g>b)c=e+1;else if(h<b)d=e-1;else return a[e+1]&&g==a[e+1].y1?e+1:e}return-1}HorizHistogramRenderer.prototype.hitTest=function(a){var b=searchCoord(this._data,a.y);if(0>b)return null;var c=Math.min(this._data[b].x0,this._data[b].x2),b=Math.max(this._data[b].x0,this._data[b].x2);return c<=a.x&&a.x<=b?new HitTestResult(HitTestResult.REGULAR):null};
HorizHistogramRenderer.prototype.draw=function(a){a.save();for(var b={},c=[],d=0;d<this._data.length;d++){var e=this._data[d];b[e.blendedColor]?b[e.blendedColor].push(e):(c.push(e.blendedColor),b[e.blendedColor]=[e])}for(var g=0;g<c.length;g++){d=c[g];a.fillStyle=d;a.strokeStyle=d;a.beginPath();rects=b[d];for(d=0;d<rects.length;d++)e=rects[d],a.rect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1);a.stroke();a.fill()}a.restore()};TradingView.study_ScriptWithDataOffset=function(a,b,c,d){TradingView.Study.call(this,a,b,c,d)};inherit(TradingView.study_ScriptWithDataOffset,TradingView.Study);TradingView.study_ScriptWithDataOffset.prototype.clearData=function(){TradingView.Study.prototype.clearData.call(this);this._underlyingData=new PlotList(this._plotFields)};
TradingView.study_ScriptWithDataOffset.prototype._mergeData=function(a){var b=0===this._underlyingData._length()?null:this._underlyingData._indexAt(0);this._underlyingData.merge(a);b!==this._underlyingData._indexAt(0)&&(this.m_data=new PlotList(this._underlyingData.columns()));this.m_data._start=this._underlyingData._start;this.m_data._end=this._underlyingData._end;var c=this.m_data._length();for(a=c;a<this._underlyingData._length();++a)b=TradingView.merge({},this._underlyingData._valueAt(a)),this.m_data.add(this._underlyingData._indexAt(a),
b);this._plotsForStrategyProcessing().forEach(function(a){this._createStrategy(a.strategy,a.strategyIndex,a.targetIndex,c).rebuildData(this.m_data)},this)};
TradingView.study_ScriptWithDataOffset.prototype._plotsForStrategyProcessing=function(){var a=["dataoffset"],b=[];this._metaInfo.plots.forEach(function(c,d){if(-1<a.indexOf(c.type)){var e=null;this._metaInfo.plots.forEach(function(a,b){a.id==c.target&&(e=b)});assert(0<=e,"target plot not found for strategy plot "+c.id);b.push({strategy:c.type,strategyIndex:d,targetIndex:e})}},this);return b};
TradingView.study_ScriptWithDataOffset.prototype._createStrategy=function(a,b,c,d){return new TradingView.study_ScriptWithDataOffset["Strategy_"+a](b,c,d)};TradingView.study_ScriptWithDataOffset.Strategy_dataoffset=function(a,b,c){this._strategyPlotIndex=a;this._targetPlotIndex=b;this._startIndex=c};
TradingView.study_ScriptWithDataOffset.Strategy_dataoffset.prototype.rebuildData=function(a){for(var b=this._targetPlotIndex+1,c=this._strategyPlotIndex+1,d=null,e=null,g=this._startIndex;g<a._length();++g){var h=a._valueAt(g),k=h[b],l=h[c]?Math.round(h[c]):null;h[b]=null;h[c]=null;!l||0<l||((l=g+l,h={pointIndex:l,value:k},e)?e.pointIndex!=h.pointIndex&&(0<=l&&(a._items[l].value[b]=k),l=!1,d&&(l=d.value<=e.value&&e.value<=k||d.value>=e.value&&e.value>=k),l?0<=e.pointIndex&&(a._items[e.pointIndex].value[b]=
null):d=e,e=h):e=h)}};TradingView.getDataVendorString=function(a){if(a&&"QUANDL"==a.exchange)return"Quandl.com"};A20=function(a,b,c){this._options=c||{};this._w=a;this._opener=b;this._addMetric=1;this._addOpened=!1};A20.prototype._interval=function(a){a=$(a.target);a.hasClass("disabled")||(this._w.setInterval(a.data("interval")),this.close())};A20.prototype._quickTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
A20.prototype._onQuick=function(a){var b=$(a.target.parentNode),b=this._w.toggleQuick(b.data("interval"));$(a.target.parentNode).toggleClass("quicked",b);$(a.target).attr("title",this._quickTitle(b));return!1};A20.prototype._onDelete=function(a){a=$(a.target.parentNode);this._w.removeInterval(a.data("interval"));this._reopen();return!1};A20.prototype._showControlButtons=function(){return!0};
A20.prototype._append=function(a,b){var c=$("<span>").addClass("item").toggleClass("active",b==this._w.getInterval()).toggleClass("quicked",this._w.inQuick(b)).toggleClass("disabled",!IntervalHelper.isAvailable(b)).text(this._w.fullLabel(b)).data("interval",b);this._showControlButtons()&&(this._w.isDefaultInterval(b)||c.prepend($("<span>").addClass("delete").attr("title","Remove custom interval").click(this._onDelete.bind(this))),this._w._options.notShowQuicks||c.prepend($("<span>").addClass("to-quick").attr("title",
this._quickTitle(this._w.inQuick(b))).click(this._onQuick.bind(this))));c.click(this._interval.bind(this));a.append(c)};
A20.prototype._appendAdd=function(a){function b(){var a=parseInt(e.val());1>a&&e.val(1);var b={1:1440,60:24,D:364,W:52,M:12}[this._addMetric];a>b&&e.val(b)}var c=$("<span>").addClass("item-add"),d=$('<span class="item-add-wrap">').appendTo(c),e=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(d).TVTicker(),g=$("<span>").addClass("tv-button mins").append($("<span>")).append($("<i>")).appendTo(d),d=$("<span>").addClass("tv-button add").text("add").appendTo(d),
h={1:"minutes",60:"hours",D:"days",W:"weeks",M:"months"};g.find("span").text(h[this._addMetric||1]);e.change(b.bind(this));var k=this;TradingView.bindPopupMenu(g,null,{direction:"up",event:"button-popup",addClass:"thin small-font metrics",popupSpacing:~~this._w._options.popupSpacing,onRemove:function(){k._addOpened=!1}});g.click(function(){k._addOpened=!0;g.trigger("button-popup",[$.map(h,function(a,c){return{title:a.toUpperCase(),active:c==k._addMetric,action:function(){k._addMetric=c;g.find("span").text(a);
b.call(k);return!1}}})])});d.click(function(){runOrGoPro(function(){var a=parseInt(e.val());if(a==a){var b=parseInt(k._addMetric);b==b?k._addInterval(""+a*k._addMetric):k._addInterval(""+a+k._addMetric)}},{feature:"customIntervals"})});a.append($("<div>").addClass("separator"));a.append(c)};A20.prototype._addInterval=function(a){};
A20.prototype._open=function(a,b){a.find(".item, .item-add, .separator").remove();var c=[],d=[],e=[],g=$("<span>").addClass("separator");$.each(b,function(a,b){/^\d*[DWM]$/.test(b)?e.push(b):IntervalHelper.isHour(b)?d.push(b):c.push(b)}.bind(this));c.length&&c.forEach(function(b){this._append(a,b)}.bind(this));d.length&&(a.append(g.clone()),d.forEach(function(b){this._append(a,b)}.bind(this)));e.length&&(a.append(g.clone()),e.forEach(function(b){this._append(a,b)}.bind(this)));
this._options.onWidget||W77.enabled("charting_library")||this._appendAdd(a)};A20.prototype._reopen=function(){this._open(this._menu,this._w._sorted(this._w._intervals))};
A20.prototype.open=function(a){var b=$("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch",Modernizr.touch),c=this._w.mainButton().offset(),d=this._w.mainButton().outerHeight(),e=c.top+d+parseInt(this._options.popupSpacing||0);b.appendTo(document.body);b.css({top:e,left:c.left}).show();this._menu=b;this._opener.addClass("active");this._open(b,a);a=Math.min($("body").height(),$(window).height())-d-e-10;this._setMaxHeight(b,a);setTimeout(function(){b.on("mousedownoutside",
function(a){this.close(a)&&b.unbind("mousedownoutside")}.bind(this))}.bind(this),0)};A20.prototype._setMaxHeight=function(a,b){a.height()>=b&&(a.css("max-height",b+"px"),a.width(a.width()+18))};
A20.prototype.close=function(a){if(a&&$(a.target).parents("span.item-add, .charts-popup-list.metrics").length||a&&$(a.target).hasClass("submenu")&&$(a.target).parents(".intervals-container").length)return!1;this._menu.remove();$(document.body).off(".interval-menu");delete this._menu;this._opener.removeClass("active");return!0};A21=function(a){this._options=$.extend({interval:1},a||{});this._e=$("<div>").addClass("intervals-container favored-list-container");this._quick=$("<div>").addClass("quick").appendTo(this._e);this._quicked={};this._main=$("<span>").text(this.shortLabel(this._options.interval)).appendTo(this._quick);this._main.data("interval",this._options.interval);W77.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton();this._mainSub=$("<span>").addClass("submenu").attr("title",
$.t("Time Interval")).append($("<i>")).appendTo(this._e);a&&"string"==typeof a.submenuBtnAddClass&&this._mainSub.addClass(a.submenuBtnAddClass);this._quick.on("click",this._selectInterval.bind(this));this._mainSub.on("click",this._selectMenu.bind(this));this._menu=new A20(this,this._mainSub,this._options);this.onResize=new Delegate;A45.intraday.subscribe(this._fullUpdate.bind(this));A45.supportedResolutions.subscribe(this._fullUpdate.bind(this));
a.interval&&A45.interval.setValue(a.interval);A45.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0});TVXWindowEvents.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this));this._fullUpdate()};A21.prototype.forceUpdate=function(){this._fullUpdate(!0)};A21.prototype._fullUpdate=function(a){this._setupIntervals(a);this._setupQuicks(a);this.reactivateInterval();this._resize()};
A21.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)};A21.prototype.isDefaultInterval=function(a){return a in D16.defaultResolutions()};A21.prototype._setupIntervals=function(){this._intervals=$.extend({},D16.defaultResolutions())};
A21.prototype._sorted=function(a){if(!Array.isArray(a)){var b=[];$.each(a,function(a){b.push(a)});a=b}return a.sort(function(a,b){function e(a){var b=IntervalHelper.isDWM(a);return b?{D:1440,W:10080,M:43200}[b.unit]*b.qty:parseInt(a)}return e(a)-e(b)})};A21.prototype.setUpStarredItemsList=function(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=!0;this._setupQuicks(!1,b)};
A21.prototype._setupQuicks=function(a,b){if(!this._options.notShowQuicks||b)b=b||{},W77.enabled("star_some_intervals_by_default")&&(b={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",b,a),this._quicked=this._removeCustomIntervalQuicks(this._quicked);this._addQuicked(this._quicked)};A21.prototype._removeCustomIntervalQuicks=function(a){var b={};$.each(a,function(a,d){this.isDefaultInterval(a)&&(b[a]=d)}.bind(this));return b};
A21.prototype.element=function(){return this._e};A21.prototype.mainButton=function(){return this._main};A21.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)};
A21.prototype.postfix=function(a,b){if(b){var c=" ";switch(a){case "D":c+=$.t("day",{count:b});break;case "W":c+=$.t("week",{count:b});break;case "M":c+=$.t("month",{count:b});break;case "m":c+=$.t("minute",{count:b});break;case "h":c+=$.t("hour",{count:b})}return c}switch(a){case "m":return"";case "h":return $.t("h",{context:"dates"});default:return $.t(a.toUpperCase(),{count:0})}};
A21.prototype.readable=function(a,b,c){var d="m",e=IntervalHelper.isDWM(a);e&&(a=e.qty,d=e.unit);a=parseInt(a);if(!a)throw new TypeError("Wrong interval value: "+a);"m"===d&&IntervalHelper.isHour(a)&&(a=~~(a/60),d="h");b=b?a:null;return""+(c&&1===a&&"m"!=d?"":a)+this.postfix(d,b)};A21.prototype.shortLabel=function(a){return translatedIntervalString(this.readable(a,!1))};
A21.prototype.fullLabel=function(a){return this.readable(a,!0)};A21.prototype._addQuicked=function(a){this._quicks().remove();a=this._sorted(a);$.each(a,function(a,c){var d=$("<span>").data("interval",c).text(this.shortLabel(c)).toggleClass("selected",c==this.getInterval()).toggleClass("disabled",!IntervalHelper.isAvailable(c));this._main.before(d)}.bind(this));this._resize()};A21.prototype._resize=function(){this.onResize.fire()};
A21.prototype.addQuick=function(a){this._quicked[a]=!0;this._addQuicked(this._quicked);this.saveSettings();this.reactivateInterval()};A21.prototype._quickWithInterval=function(a){var b=null;this._quicks().each(function(c,d){d=$(d);if(a==d.data("interval"))return b=d,!1});return b};A21.prototype.inQuick=function(a){return null!=this._quickWithInterval(a)};
A21.prototype.removeQuick=function(a){this._quickWithInterval(a)&&(this._quickWithInterval(a).remove(),this._resize(),delete this._quicked[a],this.saveSettings(),this.reactivateInterval())};A21.prototype.toggleQuick=function(a){var b=this.inQuick(a);b?this.removeQuick(a):this.addQuick(a);return!b};A21.prototype.hasQuicks=function(){return!!this._quicks().length};A21.prototype.deactivate=function(a){this._quick.find("span").removeClass("selected")};
A21.prototype.activateInterval=function(a){this.deactivate();this.inQuick(a)?this._quickWithInterval(a).addClass("selected"):(this.hasQuicks()&&this._main.addClass("selected"),this._main.text(this.shortLabel(a)),this._main.data("interval",a))};A21.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())};A21.prototype.getInterval=function(){return A45.interval.value()};
A21.prototype.setInterval=function(a){A45.interval.setValue(""+a)};A21.prototype._selectInterval=function(a){a=$(a.target);var b=a.data("interval");this.hasQuicks()||this.getInterval()!=b?a.hasClass("disabled")||this.setInterval(b):this._selectMenu()};A21.prototype._selectMenu=function(a){this._mainSub.hasClass("active")?this._menu.close():this._menu.open(this._sorted(this._intervals))};
A21.prototype._setIntervalDialogButton=function(){this._intervalDialogButton=$("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title",$.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function(){var a=(new ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show(),b=$(this);b.addClass("active");a.on("destroy",function(){b.removeClass("active")})})};
A21.prototype.addInterval=function(a){};A21.prototype.removeInterval=function(a){};A21.prototype.saveIntervals=function(){};A21.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)};A21.prototype.saveSettings=function(){this.saveQuicked();this.saveIntervals();TVXWindowEvents.emit("intervalwidget-change")};A22=function(a){this._fullInvalidation=a?a:A22.UPDATE_CURSOR_ONLY;this._invalidatedPanes={}};A22.UPDATE_CURSOR_ONLY=1;A22.LIGHT_UPDATE=2;A22.FULL_UPDATE=3;A22.prototype.invalidatePane=function(a,b){this._invalidatedPanes[a]=this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],b):b};
A22.prototype.invalidateAll=function(a){this._fullInvalidation=Math.max(this._fullInvalidation,a)};A22.prototype.fullInvalidation=function(){return this._fullInvalidation};A22.prototype.invalidateForPane=function(a){return this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],this._fullInvalidation):this._fullInvalidation};
A22.prototype.merge=function(a){this.force=this.force||a.force;this._fullInvalidation=Math.max(this._fullInvalidation,a._fullInvalidation);for(var b in a._invalidatedPanes)this._invalidatedPanes[b]=this._invalidatedPanes[b]?Math.max(this._invalidatedPanes[b],a._invalidatedPanes[b]):a._invalidatedPanes[b]};
A22.prototype.exclude=function(a){this._fullInvalidation<=a&&(this._fullInvalidation=0);for(var b in this._invalidatedPanes)this._invalidatedPanes[b]<=a&&(this._invalidatedPanes[b]=0)};var PropertyPagesFactory=function(){function a(a){return a instanceof W47?a instanceof TradingView.LineToolRiskReward?$25:a instanceof TradingView.LineToolRegressionTrend?$24:a instanceof TradingView.LineToolEllipse||a instanceof TradingView.LineToolRotatedRectangle||a instanceof TradingView.LineToolArc?null:a instanceof TradingView.LineToolTrendAngle?$28:a instanceof TradingView.LineToolParallelChannel||
a instanceof TradingView.LineToolPolyline||a instanceof TradingView.LineToolText||a instanceof TradingView.LineToolFibWedge||a instanceof TradingView.LineToolBrush?null:a instanceof TradingView.LineToolHorzLine?$11:a instanceof TradingView.LineToolBarsPattern||a instanceof TradingView.LineToolDisjointAngle||a instanceof TradingView.LineToolFlatBottom?null:a instanceof TradingView.LineToolVertLine?$35:a instanceof A63?
$43:a instanceof TradingView.LineToolIcon||a instanceof TradingView.LineToolTrading||a instanceof TradingView.LineToolExecution?null:$14:a instanceof TradingView.Study?a instanceof TradingView.study_ElliottWave?$40:a instanceof TradingView.study_Compare?$38:$41:null}function b(a,b){if(a instanceof TradingView.Series||a instanceof A7||a instanceof TradingView.ESDStudyBase)return A85;
if(a instanceof TradingView.Study)return a instanceof TradingView.study_PivotPointsHighLow?$45:a instanceof TradingView.study_PivotPointsStandard?$46:a instanceof TradingView.study_ZigZag?$48:a instanceof TradingView.study_Overlay?$44:a instanceof TradingView.study_LinearRegression?$42:"Volume@tv-basicstudies"==a.metaInfo().id?$50:
a instanceof TradingView.study_VbPVisible||a instanceof TradingView.study_VbPSessions?StudyVolumeProfilePropertyPage:$47;if(a instanceof W47){if(a instanceof TradingView.LineToolVbPFixed)return $51;if(a instanceof TradingView.LineToolRegressionTrend)return $42;if(a instanceof TradingView.LineToolTrendLine)return $32;if(a instanceof TradingView.LineToolTrendAngle)return $29;
if(a instanceof TradingView.LineToolDateRange||a instanceof TradingView.LineToolPriceRange)return A95;if(a instanceof TradingView.LineToolHorzLine||a instanceof TradingView.LineToolHorzRay)return $12;if(a instanceof TradingView.LineToolVertLine)return $36;if(a instanceof TradingView.LineToolPitchfork)return $18;if(a instanceof TradingView.LineToolPitchfan)return $17;
if(a instanceof TradingView.LineToolText)return $27;if(a instanceof TradingView.LineToolNote)return LineToolNotePropertyPage;if(a instanceof TradingView.LineToolCallout)return A93;if(a instanceof TradingView.LineToolRectangle||a instanceof TradingView.LineToolRotatedRectangle)return $23;if(a instanceof TradingView.LineToolEllipse)return A98;if(a instanceof TradingView.LineToolArc)return A87;
if(a instanceof TradingView.LineToolTriangle)return $34;if(a instanceof TradingView.LineToolParallelChannel)return $16;if(a instanceof TradingView.LineToolDisjointAngle)return A96;if(a instanceof TradingView.LineToolFlatBottom)return $7;if(a instanceof TradingView.LineToolArrowMark)return A88;if(a instanceof TradingView.LineToolPriceLabel)return $21;
if(a instanceof TradingView.LineToolIcon)return $13;if(a instanceof TradingView.LineToolBalloon)return A89;if(a instanceof TradingView.LineToolBrush)return A92;if(a instanceof TradingView.LineToolPrediction)return $20;if(a instanceof TradingView.LineToolPolyline)return $19;if(a instanceof TradingView.LineToolGannSquare)return $10;
if(a instanceof TradingView.LineToolGannComplex)return $8;if(a instanceof TradingView.LineToolGannFan)return $9;if(a instanceof TradingView.LineToolFibRetracement)return $1;if(a instanceof TradingView.LineToolFibChannel)return A99;if(a instanceof TradingView.LineToolFibCircles)return A84;if(a instanceof TradingView.LineToolFibSpiral)return $4;
if(a instanceof TradingView.LineToolFibSpeedResistanceArcs)return $2;if(a instanceof TradingView.LineToolTrendBasedFibExtension)return $30;if(a instanceof TradingView.LineToolTrendBasedFibTime)return $31;if(a instanceof TradingView.LineToolFibSpeedResistanceFan)return $3;if(a instanceof TradingView.LineToolFibTimeZone)return $5;
if(a instanceof TradingView.LineToolProjection)return $22;if(a instanceof TradingView.LineToolFibWedge)return $6;if(a instanceof TradingView.LineToolCircleLines)return A94;if(a instanceof TradingView.LineToolElliott)return A97;if(a instanceof TradingView.LineToolBarsPattern)return A91;if(a instanceof TradingView.LineToolRiskReward)return $26;
if(a instanceof TradingView.LineTool5PointsPattern)return $15;if(a instanceof TradingView.LineToolABCD)return A86;if(a instanceof TradingView.LineToolTrianglePattern)return $33;if(a instanceof TradingView.LineToolThreeDrivers)return A86;if(a instanceof TradingView.LineToolHeadAndShoulders)return $15;if(a instanceof
A63)return $47}return null}function c(a){return a instanceof TradingView.ESDStudyBase?null:a instanceof TradingView.Study?$39:null}return{createInputsPropertyPage:function(b,c){var g=a(b);return g?new g(b.properties(),c,b):null},createStylesPropertyPage:function(a,c){var g=b(a);return g?new g(a.properties(),c,a):null},createDisplayPropertyPage:function(a,b){var g=c(a);return g?new g(a.properties(),b,a):null},hasInputsPropertyPage:function(b){return!!a(b)},
hasStylesPropertyPage:function(a){return!!b(a)},hasDisplayPropertyPage:function(a){return!!c(a)}}}();function PropertyGroup(a,b,c,d){this._property=a;this._name=b;this._children=c;this._propertyPage=d}PropertyGroup.prototype.property=function(){return this._property};PropertyGroup.prototype.name=function(){return this._name};PropertyGroup.prototype.children=function(){return this._children};PropertyGroup.prototype.propertyPage=function(){return this._propertyPage};function D7(a,b){this.D0=b;this._bindings=new List;this._property=a}D7.prototype.model=function(){return this.D0};D7.prototype.bindControl=function(a){this._bindings.append(a)};D7.prototype.loadData=function(){for(var a=0;a<this._bindings.size();a++){var b=this._bindings.item(a);b.property&&b.setValue(b.property().value())}};
D7.prototype.saveData=function(){this.D0.beginUndoMacro();for(var a=0;a<this._bindings.size();a++){var b=this._bindings.item(a);this.D0.setProperty(b.property(),b.value())}this.D0.endUndoMacro()};D7.prototype.createColorPicker=function(){return $(document.createElement("input")).addClass("colorpicker-widget").bind("customcolorchange",function(a,b){TVSettings.setJSON("pickerCustomColors",b)}).tvcolorpicker({customColors:TVSettings.getJSON("pickerCustomColors",[])})};
D7.prototype.createTextEditor=function(a,b){var c={};a&&(c.width=a);b&&(c.height=b);return $(document.createElement("textarea")).css(c)};D7.prototype.createCombo=function(a){var b=$(document.createElement("select"));a=a.reduce(function(a,b){return a.add($(document.createElement("option")).prop({value:b,text:b}))},$());return b.append(a)};
D7.prototype.createKeyCombo=function(a){var b=$(document.createElement("select"));$.each(a||[],function(a,d){$(document.createElement("option")).prop({value:a,text:d}).appendTo(b)});return b};D7.prototype.createFontEditor=function(a){a=a||factoryDefaults("chartproperties.editorFontsList");return this.createCombo(a)};D7.prototype.createFontSizeEditor=function(a){return this.createCombo(a||[10,11,12,14,16,20,24,28,32,40]).addClass("tv-select-container-fontsize")};
D7.prototype.createSeriesMinTickEditor=function(){var a="<select><option value='default'>"+$.t("Default")+"</option>",b=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1E3,minMove:1,frac:!1},{priceScale:1E4,minMove:1,frac:!1},{priceScale:1E5,minMove:1,frac:!1},{priceScale:1E6,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},
{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}],c;for(c in b)var d=b[c],a=a+("<option value='"+(d.priceScale+","+d.minMove+","+d.frac)+"'>"+(d.minMove+"/"+d.priceScale)+"</option>");return $(a+"</select>")};D7.prototype.createPrecisionEditor=function(){for(var a="<select><option value='default'>"+$.t("Default")+"</option>",b=0;6>=b;b++)a+="<option value='"+b+"'>"+b+"</option>";return $(a+"</select>")};
D7.prototype.createLabeledCell=function(a,b,c){var d=null;"number"===typeof a.valueOf()&&(d=a,a=b,b=c);a+="";c=this._labelToId(a);var e=$("<td>");$("<label>").html(0<a.length?$.t(a):"").attr("for",c).appendTo(e);d&&e.attr("colspan",d);b&&b.attr("id",c);return e};D7.prototype.createTableInTable=function(a){a=$("<tr>").appendTo(a);a=$("<td>").appendTo(a);return $('<table cellpadding="0" cellspacing="0">').appendTo(a)};
D7.prototype._labelToId=function(a){return"control"+a.replace(/(^| )\w/g,function(a){return"-"+a.trim().toLowerCase()})+Math.floor(1E3*Math.random())};D7.prototype.addRow=function(a){return $(document.createElement("tr")).appendTo(a)};
D7.prototype.addLabeledRow=function(a,b,c,d){var e=b&&0<b.length?$.t(b):"",g=$(document.createElement("tr")),h=$(document.createElement("td")).html(e);d&&h.attr("colspan",2);c&&(b=this._labelToId(b),c.attr("id",b),h.html('<label for="'+b+'">'+e+"</label>"));return g.append(h).appendTo(a)};D7.prototype.addEditorRow=function(a,b,c,d){var e=$(document.createElement("td"));c.row=this.addLabeledRow(a,b,c,d);c.appendTo(e.appendTo(c.row));return c};
D7.prototype.addColorPickerRow=function(a,b){return this.addEditorRow(a,b,this.createColorPicker())};D7.prototype.addOffsetEditorRow=function(a,b){var c=$("<input/>");c.attr("type","text");c.css("width","100px");c.addClass("ticker");return this.addEditorRow(a,b,c)};D7.prototype.addFontEditorRow=function(a,b){return this.addEditorRow(a,b,this.createFontEditor())};
D7.prototype.refreshStateControls=function(a,b,c){for(var d=0;d<b.length;d++){var e=b[d],g=a[e.id];g.toggle(this.parseRule(e.visible,b,c));g.attr("disabled",!this.parseRule(e.visible,b,c))}};D7.prototype.parseRule=function(a,b,c){if(!a)return!0;a=a.split("==");return 2>a.length?!1:c[a[0]].value()==a[1]};D7.prototype.destroy=function(){for(var a=this._bindings.size();a--;)this._bindings.item(a).destroy();this._bindings.clear()};
function Binding(a,b,c,d,e){a?(this._control=a,this._property=b,this._applyOnFly=c,this._undoModel=d,this._undoText=e,b&&(this.setValue(b.value()),b.listeners().subscribe(this,Binding.prototype.propertyChanged))):TradingView.logDebug("Binding: missing control")}
Binding.prototype._attachToControl=function(a,b){var c=this;if(b)a.on("keyup change input",function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)});else a.keypress(function(a){13==a.which&&(a=c.value(),c.setValueToProperty(a),c.setValue(a))}),a.focusout(function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)}),a.change(function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)})};Binding.prototype.control=function(){return this._control};
Binding.prototype.setValueToProperty=function(a){this._undoModel.setProperty(this._property,a,this._undoText)};Binding.prototype.property=function(){return this._property};Binding.prototype.propertyChanged=function(a){this.setValue(a.value())};Binding.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,Binding.prototype.propertyChanged)};function UppercaseTransformer(a){return a.toUpperCase()}function GreateTransformer(a){return function(b){return b<a?a:b}}
function LessTransformer(a){return function(b){return b>a?a:b}}function ToIntTransformer(a){return function(b){b=parseInt(b,10);return isNaN(b)?a:b}}function ToFloatTransformer(a){return function(b){b=parseFloat(b);return isNaN(b)?a:b}}function ToAsciiTransformer(){return function(a){var b=a;for(a=a.replace(/[^\u0000-\u007F]/,"");a.length!==b.length;)b=a,a=b.replace(/[^\u0000-\u007F]/,"");return a}}function ReplaceEmptyTransformer(a){return function(b){return 0===b.length?a:b}}
function SimpleStringBinder(a,b,c,d,e,g){Binding.call(this,a,b,d,e,g);this._transformFunction=c;this._attachToControl(a,d)}inherit(SimpleStringBinder,Binding);SimpleStringBinder.prototype.value=function(){var a=this._control.val();if(this._transformFunction)if(isArray(this._transformFunction))for(var b=0;b<this._transformFunction.length;b++)a=this._transformFunction[b](a);else a=this._transformFunction(a);return a};SimpleStringBinder.prototype.setValue=function(a){this._control.val()!==a&&this._control.val(a)};
function D8(a,b,c,d,e,g){this._subControlIds=b;Binding.call(this,a,c,d,e,g);this._forEachSubControl(function(a){this._attachToControl(a,d)})}inherit(D8,Binding);D8.prototype._forEachSubControl=function(a){this._subControlIds.forEach(function(b){b="#"+b;b=this.control().find(b);a.call(this,b)},this)};
D8.prototype._parseSessions=function(a){var b=a.split("-",2);2!=b.length&&(b=["0","0"]);a=parseInt(b[0]);b=parseInt(b[1]);return[Math.floor(a/100),a%100,Math.floor(b/100),b%100]};
D8.prototype.value=function(){var a=[];this._forEachSubControl(function(b){a.push(b.val())});var b=function(a,b){b.forEach(function(b){a=b(a)});return("0"+a).slice(-2)},c=[ToIntTransformer(0),GreateTransformer(0),LessTransformer(23)],d=[ToIntTransformer(0),GreateTransformer(0),LessTransformer(59)];return b(a[0],c)+b(a[1],d)+"-"+b(a[2],c)+b(a[3],d)};
D8.prototype.setValue=function(a){var b=this._parseSessions(a);this._forEachSubControl(function(a){var d=a.val(),e=("0"+b[0]).slice(-2);b.shift();d!==e&&a.val(e)})};
function D9(a,b,c,d,e,g,h){this.D0=d;this._mainSeries=g;this._toIntTransformer=ToIntTransformer(h);this._disabled=!1;Binding.call(this,a,b,c,d,e);var k=this;c&&a.change(function(){k.setValueToProperty(k.value())});this._mainSeries.onBarReceived().subscribe(this,function(a){k.setValue(this.property().value())})}inherit(D9,Binding);
D9.prototype.value=function(){if(this._disabled)return this._control.attr("disabled",!0),null;var a=this._control.val(),a=this._toIntTransformer(a);0>a&&(a=0);var b=this._mainSeries.bars().size();b<=a&&(a=b-1);return 1E3*this._mainSeries.bars()._valueAt(this._mainSeries.bars().lastIndex()-a)[TIME_PLOT]};
D9.prototype.setValue=function(a){this._disabled||null==a?this._control.attr("disabled",!0):0>a?(this._control.val(-a),this._property.setValue(this.value())):(a=this._mainSeries.data().timeToBarIndex(a/1E3,SEARCH_FROM_RIGHT),null===a?this._disabled=!0:(a=this._mainSeries.bars().lastIndex()-a,this._control.val()!==a.toString()&&this._control.val(a)))};
function D10(a,b,c,d,e){Binding.call(this,a,b,c,d,e);if(c)a.on("accept-symbol",function(a,b){this.setValueToProperty(b)}.bind(this))}inherit(D10,Binding);D10.prototype.value=function(){return this._control.val()};D10.prototype.setValue=function(a){var b=this.value();a&&b!==a&&this._control.val(a)};
function D11(a,b,c,d,e,g,h){Binding.call(this,a,b,d,e,g);this._transformFunction=c;this._setter=h;var k=this;d&&a.change(function(){k._setter?k._setter.call(k,k.value()):k.setValueToProperty(k.value())})}inherit(D11,Binding);D11.prototype.value=function(){var a=this._control.val();this._transformFunction&&(a=this._transformFunction(a));return a};
D11.prototype.setValue=function(a){this._control.val(a);if(this._control.selectbox)try{var b=this._control.find("[value='"+a+"']");if(0<b.length){var c=b[0];this._control.selectbox("change",c.value,c.text)}}catch(d){}};function StaticContentBinder(a,b){Binding.call(this,a,b)}inherit(StaticContentBinder,Binding);StaticContentBinder.prototype.value=function(){return this._property.value()};StaticContentBinder.prototype.setValue=function(a){return this._control.html(a)};
function D12(a,b,c,d,e,g){if(!a.is(":checkbox, :radio"))return new D12.PushButtonBinder(a,b,c,d,e);Binding.call(this,a,b,c,d,e);this._setter=g;var h=this;c&&a.change(function(){h._setter?h._setter.call(h,h.value()):h.setValueToProperty(h.value())})}inherit(D12,Binding);D12.prototype.value=function(){return this.control().is(":checked")};
D12.prototype.setValue=function(a){if(this.control().is(".visibility-switch")){var b={opacity:a?1:.5},c=a?"enable":"disable",d=this.control().data("hides");if(d)d.closest("td").css(b);else{var e=this.control();e.parent().parent().data("visible",a).find("td").filter(function(){var a=$(this);return!a.find("label").length&&a.find(":checkbox").attr("id")!==e.attr("id")}).each(function(){var d=$(this);d.children().each(function(){var e=$(this);e.is(".ui-slider")?e.slider(c):(e.is("select")?e.selectbox(c):
e.is(".custom-select")?e.data(c)():e.prop("disabled",!a),d.css(b))})})}}return this.control().attr("checked",!!a)};function DisabledBinder(a,b,c,d,e){Binding.call(this,a,b,c,d,e)}inherit(DisabledBinder,Binding);DisabledBinder.prototype.value=function(){return this.control().is(":disabled")};DisabledBinder.prototype.setValue=function(a){return this.control().attr("disabled",!!a)};
D12.PushButtonBinder=function(a,b,c,d,e){Binding.call(this,a,b,c,d,e);var g=this;c&&a.click(function(){var a=$(this).toggleClass("active").hasClass("active");g.setValueToProperty(a)})};inherit(D12.PushButtonBinder,Binding);D12.PushButtonBinder.prototype.value=function(){return this.control().hasClass("active")};D12.PushButtonBinder.prototype.setValue=function(a){return this.control().toggleClass("active",!!a)};
function D14(a,b,c,d,e){c?(Binding.call(this,a,b,!0,c,d),e?a.callbacks().subscribe(this,e):a.callbacks().subscribe(this,D14.prototype.onActionCallback)):TradingView.logDebug("D14: Missed undo model")}inherit(D14,Binding);D14.prototype.onActionCallback=function(a){this._undoModel.setProperty(this._property,this.value(),this._undoText)};D14.prototype.value=function(){return this.control().checked};
D14.prototype.setValue=function(a){return this.control().checked=!!a};function ColorBinding(a,b,c,d){Binding.call(this,a,b,c,d);var e=this;c&&a.change(function(){e.setValueToProperty(e.value())})}inherit(ColorBinding,Binding);ColorBinding.prototype.value=function(){return this._control.val()};ColorBinding.prototype.setValue=function(a){this._control.val(a);this._control.change();this._control.color&&this._control.color.fromString(a)};
TradingView.ToggleButtonBinding=function(a,b){b.toggle(a.checked);b.content().click(function(){a.setChecked(b.toggled());a.callbacks().fire(a)})};
function SliderBinder(a,b,c,d,e){isNumber(b.value())||(console.warn("Property cannot be binded to control, bad value (expect number): "+b.value()),b=new Property);Binding.call(this,a,b,c,d,e);var g=this;c&&(a.bind("slidechange",function(a,b){g.setValueToProperty(b.value)}),a.bind("slide",function(a,b){g.setValueToProperty(b.value)}));a.bind("slidestart",function(a,b){d.beginUndoMacro(e)});a.bind("slidestop",function(a,b){d.endUndoMacro()})}inherit(SliderBinder,Binding);
SliderBinder.prototype.value=function(){return this._control.slider("option","value")};SliderBinder.prototype.setValue=function(a){this._control.slider("option","value",a)};function D15(a,b,c,d,e,g){D12.call(this,a,b,d,e,g);this._intervalProperty=c;this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged);this.onIntervalChanged()}inherit(D15,D12);
D15.prototype.onIntervalChanged=function(){1440>+this._intervalProperty.value()?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})};D15.prototype.value=function(){return this._control.is(":disabled")?this._property.value():D12.prototype.value.call(this)};D15.prototype.setValue=function(a){if(!this._control.is(":disabled"))return D12.prototype.setValue.call(this,a)};
D15.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged);delete this._intervalProperty;D12.prototype.destroy.call(this,arguments)};function WVBinding(a,b,c,d){this._control=a;this._wv=b.spawn();this._transformFunction=c;this._undoText=d;this._attachToControl(this._control)}
WVBinding.prototype._attachToControl=function(a){var b=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0});$(this._control).on("change",function(){b.setValueToProperty(b.value())})};WVBinding.prototype.control=function(){return this._control};WVBinding.prototype.value=function(){var a=$(this._control).val();this._transformFunction&&(a=this._transformFunction(a));return a};WVBinding.prototype.setValue=function(a){$(this._control).val(a)};
WVBinding.prototype.setValueToProperty=function(a){A77.setWatchedValue(this._wv,a,this._undoText)};WVBinding.prototype.watchedValue=function(){return this._wv};WVBinding.prototype.destroy=function(){this._wv.destroy()};function CheckboxWVBinding(a,b,c,d,e){this._not=!!e;WVBinding.apply(this,arguments)}inherit(CheckboxWVBinding,WVBinding);
CheckboxWVBinding.prototype._attachToControl=function(a){var b=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0});$(this._control).on("click",function(){b.setValueToProperty(b.value())})};CheckboxWVBinding.prototype.value=function(){var a=$(this._control).attr("checked");this._not&&(a=!a);this._transformFunction&&(a=this._transformFunction(a));return a};CheckboxWVBinding.prototype.setValue=function(a){this._not&&(a=!a);$(this._control).attr("checked",!!a)};function SeriesStylePropertyPageMixin(){}inherit(SeriesStylePropertyPageMixin,D7);SeriesStylePropertyPageMixin.prototype.getInputTitle=function(a,b){return b.inputInfo?b.inputInfo[a].name.value():a.toLowerCase().replace(/\b\w/g,function(a){return a.toUpperCase()})};
SeriesStylePropertyPageMixin.prototype.prepareLayoutImpl=function(a,b,c,d){d=d||{};for(var e={},g=this,h=0;h<a.inputs.length;h++){var k=a.inputs[h],l=k.id,m=this.getInputTitle(l,c),n=$("<tr/>");n.appendTo(b);var q=$("<td/>");q.appendTo(n);q.addClass("propertypage-name-label");q.text(m);var r=$("<td"+(d.valueColspan?' colspan = "'+d.valueColspan+'"':"")+"/>");r.appendTo(n);q=null;if(k.options)for(var q=$("<select/>"),u=0;u<k.options.length;u++){var w=k.options[u];$("<option value='"+w+"'>"+w+"</option>").appendTo(q)}else q=
$("<input/>"),"bool"===k.type?q.attr("type","checkbox"):q.attr("type","text");q.appendTo(r);q.css("width","100px");m="Change "+m;if(k.options)this.bindControl(new D11(q,c.inputs[l],null,!0,this.model(),m));else if("integer"===k.type)transformers=[ToIntTransformer(k.defval)],k.min&&transformers.push(GreateTransformer(k.min)),k.max&&transformers.push(LessTransformer(k.max)),this.bindControl(new SimpleStringBinder(q,c.inputs[l],transformers,!1,this.model(),m)),q.addClass("ticker");else if("float"===
k.type){transformers=[ToFloatTransformer(k.defval)];if(k.min){r=void 0;if(("BarSetRenko@tv-prostudies"==a.id||"BarSetPnF@tv-prostudies"==a.id)&&"boxSize"==k.id||"BarSetKagi@tv-prostudies"==a.id&&"reversalAmount"==k.id)r=this.D0.model().mainSeries().symbolInfo(),r=r.minmov/r.pricescale;transformers.push(GreateTransformer(r?r:k.min))}k.max&&transformers.push(LessTransformer(k.max));this.bindControl(new SimpleStringBinder(q,c.inputs[l],transformers,!1,this.model(),m));q.addClass("ticker")}else"text"===
k.type&&this.bindControl(new SimpleStringBinder(q,this._property.inputs[l],null,!1,this.model(),m));q.change(function(b){g.refreshStateControls(e,a.inputs,c.inputs)});e[k.id]=n}this.refreshStateControls(e,a.inputs,c.inputs)};SeriesStylePropertyPageMixin.prototype.getMetaInfo=function(a){for(var b=this.D0.m_model._studiesMetaData,c=0;c<b.size();c++)if(b.item(c).id===a)return b.item(c);return null};
SeriesStylePropertyPageMixin.prototype._prepareSeriesStyleLayout=function(a,b,c,d){var e=$("<tbody>").appendTo(a),g=this._candlesColorerTbody=$("<tbody>").appendTo(b),h=this._barsColorerTbody=$("<tbody>").appendTo(b),k=this._haColorerTbody=$("<tbody>").appendTo(b),l=this._candlesTbody=$("<tbody>").appendTo(c),m=this._hollowCandlesTbody=$("<tbody>").appendTo(c),n=this._haTbody=$("<tbody>").appendTo(c),q=this._barsTbody=$("<tbody>").appendTo(c),r=this._lineTbody=$("<tbody>").appendTo(c);b=this._areaTbody=
$("<tbody>").appendTo(c);var u=this._renkoTbody=$("<tbody>").appendTo(c),w=this._pbTbody=$("<tbody>").appendTo(c);a=this._kagiTbody=$("<tbody>").appendTo(c);c=this._pnfTbody=$("<tbody>").appendTo(c);var e=this.addLabeledRow(e,"Style"),A=$(document.createElement("td")).appendTo(e);A.addClass("property-wide-select");e=$(document.createElement("select"));$("<option value="+TradingView.Series.STYLE_BARS+">"+$.t("Bars")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_CANDLES+">"+$.t("Candles")+
"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_HOLLOW_CANDLES+">"+$.t("Hollow Candles")+"</option>").appendTo(e);this instanceof $44||$("<option value="+TradingView.Series.STYLE_HEIKEN_ASHI+">"+$.t("Heiken Ashi")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_LINE+">"+$.t("Line")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_AREA+">"+$.t("Area")+"</option>").appendTo(e);e.css("width","100px").appendTo(A);
this.switchStyle();this.bindControl(new D11(e,d.style,parseInt,!0,this.model(),"Change Series Style",function(a){this._undoModel.setChartStyleProperty(this._property,a,this._undoText)}));d.style.listeners().subscribe(this,this.switchStyle);var A=this.createColorPicker(),v=this.createColorPicker(),B=this.createColorPicker(),D=this.createColorPicker(),C=this.createColorPicker(),z=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(D).add(C)),F=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
$(B)),G=$("<input type='checkbox'/>"),g=this.addLabeledRow(g,"Color bars based on previous close",G);$("<td>").append(G).prependTo(g);g=this.addLabeledRow(l,"Candles");$("<td>").prependTo(g);$("<td>").append(A).appendTo(g);$("<td>").append(v).appendTo(g);g=this.addLabeledRow(l,"Borders",z);$("<td>").append(z).prependTo(g);$("<td>").append(D).appendTo(g);$("<td>").append(C).appendTo(g);g=this.addLabeledRow(l,"Wick",F);$("<td>").append(F).prependTo(g);$("<td>").append(B).appendTo(g);this.bindControl(new ColorBinding(A,
d.candleStyle.upColor,!0,this.model(),"Change Candle Up Color"));this.bindControl(new ColorBinding(v,d.candleStyle.downColor,!0,this.model(),"Change Candle Down Color"));this.bindControl(new D12(F,d.candleStyle.drawWick,!0,this.model(),"Change Candle Wick Visibility"));this.bindControl(new ColorBinding(B,d.candleStyle.wickColor,!0,this.model(),"Change Candle Wick Color"));this.bindControl(new D12(z,d.candleStyle.drawBorder,!0,this.model(),"Change Candle Border Visibility"));this.bindControl(new ColorBinding(D,
d.candleStyle.borderUpColor,!0,this.model(),"Change Candle Up Border Color"));this.bindControl(new ColorBinding(C,d.candleStyle.borderDownColor,!0,this.model(),"Change Candle Down Border Color"));this.bindControl(new D12(G,d.candleStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"));l=this.createColorPicker();A=this.createColorPicker();v=this.createColorPicker();B=this.createColorPicker();D=this.createColorPicker();C=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
$(B).add(D));z=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(v));g=this.addLabeledRow(m,"Candles");$("<td>").prependTo(g);$("<td>").append(l).appendTo(g);$("<td>").append(A).appendTo(g);g=this.addLabeledRow(m,"Borders",C);$("<td>").append(C).prependTo(g);$("<td>").append(B).appendTo(g);$("<td>").append(D).appendTo(g);g=this.addLabeledRow(m,"Wick",z);$("<td>").append(z).prependTo(g);$("<td>").append(v).appendTo(g);this.bindControl(new ColorBinding(l,d.hollowCandleStyle.upColor,
!0,this.model(),"Change Hollow Candle Up Color"));this.bindControl(new ColorBinding(A,d.hollowCandleStyle.downColor,!0,this.model(),"Change Hollow Candle Down Color"));this.bindControl(new D12(z,d.hollowCandleStyle.drawWick,!0,this.model(),"Change Hollow Candle Wick Visibility"));this.bindControl(new ColorBinding(v,d.hollowCandleStyle.wickColor,!0,this.model(),"Change Hollow Candle Wick Color"));this.bindControl(new D12(C,d.hollowCandleStyle.drawBorder,!0,this.model(),"Change Hollow Candle Border Visibility"));
this.bindControl(new ColorBinding(B,d.hollowCandleStyle.borderUpColor,!0,this.model(),"Change Hollow Candle Up Border Color"));this.bindControl(new ColorBinding(D,d.hollowCandleStyle.borderDownColor,!0,this.model(),"Change Hollow Candle Down Border Color"));m=$("<input type='checkbox'/>");g=this.addLabeledRow(h,"Color bars based on previous close",m);$("<td>").append(m).prependTo(g);l=$("<input type='checkbox'/>");g=this.addLabeledRow(h,"HLC Bars",l);$("<td>").append(l).prependTo(g);g=this.addColorPickerRow(q,
"Up Color");h=this.addColorPickerRow(q,"Down Color");this.bindControl(new ColorBinding(g,d.barStyle.upColor,!0,this.model(),"Change Bar Up Color"));this.bindControl(new ColorBinding(h,d.barStyle.downColor,!0,this.model(),"Change Bar Down Color"));this.bindControl(new D12(m,d.barStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"));this.bindControl(new D12(l,d.barStyle.dontDrawOpen,!0,this.model(),"Change HLC Bars"));h=TradingView.createPriceSourceEditor();
g=this.addLabeledRow(r,"Price Source");$('<td colspan="3">').append(h).appendTo(g);g=this.addLabeledRow(r,"Type");g=$('<td colspan="3">').appendTo(g);g.addClass("property-wide-select");q=$(document.createElement("select"));$("<option value="+TradingView.Series.STYLE_LINE_TYPE_SIMPLE+">"+$.t("Simple")+"</option>").appendTo(q);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_MARKERS+">"+$.t("With Markers")+"</option>").appendTo(q);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_STEP+">"+
$.t("Step")+"</option>").appendTo(q);q.appendTo(g);g=this.addLabeledRow(r,"Line");r=this.createColorPicker();m=TradingView.createLineWidthEditor();$("<td>").append(r).appendTo(g);$("<td>").append(m).appendTo(g);this.bindControl(new D11(h,d.lineStyle.priceSource,null,!0,this.model(),"Change Price Source"));this.bindControl(new D11(q,d.lineStyle.styleType,parseInt,!0,this.model(),"Change Line Type"));this.bindControl(new ColorBinding(r,d.lineStyle.color,!0,this.model(),"Change Line Color"));
this.bindControl(new SliderBinder(m,d.lineStyle.linewidth,!0,this.model(),"Change Line Width"));d.haStyle&&(r=this.createColorPicker(),h=this.createColorPicker(),q=this.createColorPicker(),m=this.createColorPicker(),l=this.createColorPicker(),A=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(m).add(l)),v=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(q)),B=$("<input type='checkbox'/>"),g=this.addLabeledRow(k,"Color bars based on previous close",B),$("<td>").append(B).prependTo(g),
g=this.addLabeledRow(n,"Candles"),$("<td>").prependTo(g),$("<td>").append(r).appendTo(g),$("<td>").append(h).appendTo(g),g=this.addLabeledRow(n,"Borders",A),$("<td>").append(A).prependTo(g),$("<td>").append(m).appendTo(g),$("<td>").append(l).appendTo(g),g=this.addLabeledRow(n,"Wick",v),$("<td>").append(v).prependTo(g),$("<td>").append(q).appendTo(g),this.bindControl(new ColorBinding(r,d.haStyle.upColor,!0,this.model(),"Change Heiken Ashi Up Color")),this.bindControl(new ColorBinding(h,d.haStyle.downColor,
!0,this.model(),"Change Heiken Ashi Down Color")),this.bindControl(new D12(v,d.haStyle.drawWick,!0,this.model(),"Change Heiken Ashi Wick Visibility")),this.bindControl(new ColorBinding(q,d.haStyle.wickColor,!0,this.model(),"Change Heiken Ashi Wick Color")),this.bindControl(new D12(A,d.haStyle.drawBorder,!0,this.model(),"Change Heiken Ashi Border Visibility")),this.bindControl(new ColorBinding(m,d.haStyle.borderUpColor,!0,this.model(),"Change Heiken Ashi Up Border Color")),this.bindControl(new ColorBinding(l,
d.haStyle.borderDownColor,!0,this.model(),"Change Heiken Ashi Down Border Color")),this.bindControl(new D12(B,d.haStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close")));this instanceof $44||W77.enabled("charting_library")||($("<option value="+TradingView.Series.STYLE_RENKO+">Renko</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_PB+">Line break</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_KAGI+
">Kagi</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_PNF+">Point & Figure</option>").appendTo(e),k=this.createColorPicker(),n=this.createColorPicker(),g=this.addLabeledRow(u,"Up bars"),$('<td class="some-colorpicker">').append(k).append(n).appendTo(g),e=this.createColorPicker(),r=this.createColorPicker(),g=this.addLabeledRow(u,"Down bars"),$('<td class="some-colorpicker">').append(e).append(r).appendTo(g),h=this.createColorPicker(),q=this.createColorPicker(),g=this.addLabeledRow(u,
"Projection up bars"),$('<td class="some-colorpicker">').append(h).append(q).appendTo(g),m=this.createColorPicker(),l=this.createColorPicker(),g=this.addLabeledRow(u,"Projection down bars"),$('<td class="some-colorpicker">').append(m).append(l).appendTo(g),this.prepareLayoutImpl(this.getMetaInfo("BarSetRenko@tv-prostudies"),u,d.renkoStyle),this.bindControl(new ColorBinding(k,d.renkoStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(e,d.renkoStyle.downColor,!0,
this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(h,d.renkoStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(m,d.renkoStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new ColorBinding(n,d.renkoStyle.borderUpColor,!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new ColorBinding(r,d.renkoStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),
this.bindControl(new ColorBinding(q,d.renkoStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new ColorBinding(l,d.renkoStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),u=this.createColorPicker(),k=this.createColorPicker(),g=this.addLabeledRow(w,"Up bars"),$('<td class="some-colorpicker">').append(u).append(k).appendTo(g),n=this.createColorPicker(),e=this.createColorPicker(),g=this.addLabeledRow(w,"Down bars"),
$('<td class="some-colorpicker">').append(n).append(e).appendTo(g),r=this.createColorPicker(),h=this.createColorPicker(),g=this.addLabeledRow(w,"Projection up bars"),$('<td class="some-colorpicker">').append(r).append(h).appendTo(g),q=this.createColorPicker(),m=this.createColorPicker(),g=this.addLabeledRow(w,"Projection down bars"),$('<td class="some-colorpicker">').append(q).append(m).appendTo(g),this.prepareLayoutImpl(this.getMetaInfo("BarSetPriceBreak@tv-prostudies"),w,d.pbStyle,{valueColspan:2}),
this.bindControl(new ColorBinding(u,d.pbStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(n,d.pbStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(r,d.pbStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(q,d.pbStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new ColorBinding(k,d.pbStyle.borderUpColor,!0,this.model(),
"Change Border Bar Up Color")),this.bindControl(new ColorBinding(e,d.pbStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new ColorBinding(h,d.pbStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new ColorBinding(m,d.pbStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),w=this.addColorPickerRow(a,"Up bars"),g=this.addColorPickerRow(a,"Down bars"),u=this.addColorPickerRow(a,
"Projection up bars"),k=this.addColorPickerRow(a,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetKagi@tv-prostudies"),a,d.kagiStyle),this.bindControl(new ColorBinding(w,d.kagiStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(g,d.kagiStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(u,d.kagiStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(k,
d.kagiStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),a=this.addColorPickerRow(c,"Up bars"),w=this.addColorPickerRow(c,"Down bars"),g=this.addColorPickerRow(c,"Projection up bars"),u=this.addColorPickerRow(c,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetPnF@tv-prostudies"),c,d.pnfStyle),this.bindControl(new ColorBinding(a,d.pnfStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(w,d.pnfStyle.downColor,!0,this.model(),
"Change Bar Down Color")),this.bindControl(new ColorBinding(g,d.pnfStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(u,d.pnfStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")));c=TradingView.createPriceSourceEditor();g=this.addLabeledRow(b,"Price Source");$('<td colspan="3">').appendTo(g).append(c);a=this.createColorPicker();w=TradingView.createLineWidthEditor();g=this.addLabeledRow(b,"Line");$("<td>").appendTo(g).append(a);
$('<td colspan="2">').appendTo(g).append(w);u=this.createColorPicker();k=this.createColorPicker();n=TradingView.createTransparencyEditor(k);g=this.addLabeledRow(b,"Fill");$("<td>").appendTo(g).append(u);$("<td>").appendTo(g).append(k);$("<td>").appendTo(g).append(n);this.bindControl(new D11(c,d.areaStyle.priceSource,null,!0,this.model(),"Change Price Source"));this.bindControl(new ColorBinding(a,d.areaStyle.linecolor,!0,this.model(),"Change Line Color"));this.bindControl(new SliderBinder(w,
d.areaStyle.linewidth,!0,this.model(),"Change Line Width"));this.bindControl(new ColorBinding(u,d.areaStyle.color1,!0,this.model(),"Change Line Color"));this.bindControl(new ColorBinding(k,d.areaStyle.color2,!0,this.model(),"Change Line Color"));this.bindControl(new SliderBinder(n,d.areaStyle.transparency,!0,this.model(),"Change Area Transparency"))};TradingView.LinetoolTemplatesList=function(a,b,c){this._toolName=a;this._applyTemplate=b;this._options=$.extend({saveAsText:"Save As...",applyDefaultText:"Apply Defaults"},c||{});this._list=[];W77.enabled("charting_library")||(this.templatesDeferred=this.loadData())};TradingView.LinetoolTemplatesList._cache={};TradingView.LinetoolTemplatesList.prototype.getData=function(){return this._list};
TradingView.LinetoolTemplatesList.prototype.loadData=function(){var a=this;return this._toolName in TradingView.LinetoolTemplatesList._cache?(this._list=TradingView.LinetoolTemplatesList._cache[this._toolName],$.Deferred().resolve()):$.get("/drawing-templates/"+this._toolName+"/",function(b){a._list=b;TradingView.LinetoolTemplatesList._cache[a._toolName]=b}).error(function(a){console.warn("Failed to load drawing template: "+a.responseText)})};
TradingView.LinetoolTemplatesList.prototype.templatesLoaded=function(){return this.templatesDeferred};TradingView.LinetoolTemplatesList.prototype.invalidateToolCache=function(){delete TradingView.LinetoolTemplatesList._cache[this._toolName]};
TradingView.LinetoolTemplatesList.prototype.createButton=function(a){var b=this;a=$.extend({},a,b._options);var c=$("<a></span></a>").addClass(a.buttonClass?a.buttonClass:"tv-button").html(a.buttonInner?a.buttonInner:'Template<span class="icon-dropdown">');TradingView.bindPopupMenu(c,null,{event:"button-popup"});c.bind("click",function(c){c.stopPropagation();if(!$(this).is("active")){c=[];"function"===typeof a.getDataForSaveAs&&c.push({title:a.saveAsText,action:function(){runOrSignIn(function(){var c=
function(c){var d=JSON.stringify(a.getDataForSaveAs());b.saveTemplate(c,d)}.bind(b);TradingView.showChartNameDialog(c,"Save template as...","Template name",64)})},addClass:"special"});"function"===typeof a.defaultsCallback&&c.push({title:a.applyDefaultText,action:a.defaultsCallback,addClass:"special"});var e=[];$.each(b._list,function(a,c){e.push({title:c,action:function(){b.loadTemplate.call(b,c)},deleteAction:function(){runOrSignIn(function(){A83.showConfirm("Template","Do you realy want to delete "+
(c?'"'+c+'"':"")+" template?",function(){b.removeTemplate.call(b,c)})})}})});e.length&&(e.sort(function(a,b){a=a.title.toUpperCase();b=b.title.toUpperCase();return a==b?0:a>b?1:-1}),c.push({separator:!0}),c=c.concat(e));$(this).trigger("button-popup",[c])}});return c};TradingView.LinetoolTemplatesList.prototype.loadTemplate=function(a){var b=this;return $.get("/drawing-template/"+this._toolName+"/?templateName="+encodeURIComponent(a),function(a){b._applyTemplate(JSON.parse(a.content))}).error(function(a){console.warn(a.responseText)})};
TradingView.LinetoolTemplatesList.prototype.removeTemplate=function(a){a&&($.post("/remove-drawing-template/",{name:a,tool:this._toolName}).error(function(a){console.warn(a.responseText)}),this.invalidateToolCache(),this._list=$.grep(this._list,function(b){return b!=a}))};
TradingView.LinetoolTemplatesList.prototype.saveTemplate=function(a,b){var c=this;if(a&&b){a=clean(a);var d=-1!=$.inArray(a,c._list),e=function(){$.post("/save-drawing-template/",{name:a,tool:c._toolName,content:b},function(){d||c._list.push(a)}).error(function(a){console.warn(a.responseText)});c.invalidateToolCache()};d?A83.showConfirm("Confirm replacing",'Do you realy want to replace "'+a+'"?',e):e()}};
TradingView.LinetoolTemplatesList.prototype.deleteAction=function(a){var b=this;runOrSignIn(function(){A83.showConfirm("Template","Do you realy want to delete "+(a?'"'+a+'"':"")+" template?",function(){b.removeTemplate.call(b,a)})})};TradingView.LinetoolTemplatesList.prototype.showSaveDialog=function(a){var b=this;runOrSignIn(function(){TradingView.showChartNameDialog(function(c){var d=JSON.stringify(a.template());b.saveTemplate(c,d)},"Save template as...","Template name",64)})};function $49(a,b,c){D7.call(this,a,b);this._linetool=c;this._templateList=new TradingView.LinetoolTemplatesList(this._linetool._constructor,this.applyTemplate.bind(this))}inherit($49,D7);$49.prototype.applyTemplate=function(a){this._linetool.restoreTemplate(a);this.D0.model().updateSource(this._linetool);this.loadData()};
$49.prototype.createTemplateButton=function(a){var b=this;a=$.extend({},a,{getDataForSaveAs:function(){return b._linetool.template()}.bind(b)});return this._templateList.createButton(a)};
$49.prototype.appendTemplateRow=function(a){if(is_authenticated){var b=$(document.createElement("tr"));b.appendTo(a);var c=$(document.createElement("td"));c.attr("colspan",2);c.appendTo(b);b=$('<div class="dialog-theme-buttons"></div>').appendTo(c);this.templateButton=$(this.createTemplateButton());this.templateButton.appendTo(b);$('<tr><td class="property-page-separator-cell" colspan="6"><div class="property-page-separator"></div></td></tr>').appendTo(a)}};"undefined"!=typeof FlashCanvas&&FlashCanvas.setOptions({disableContextMenu:!0});TradingView.setCanvasSize=function(a,b){a.width=b.w;a.height=b.h;"undefined"==typeof FlashCanvas&&a.getContext("2d").translate(.5,.5)};function clearRect(a,b,c,d,e,g){a.save();"undefined"==typeof FlashCanvas&&a.translate(-.5,-.5);a.fillStyle=g;a.fillRect(b,c,d,e);a.restore()}
TradingView.addCanvasTo=function(a,b){var c=document.createElement("canvas");a.append(c);"undefined"!=typeof FlashCanvas&&FlashCanvas.initElement(c);TradingView.setCanvasSize(c,b);return c};TradingView.Rect=function(a,b,c,d){this.x=a;this.y=b;this.w=c;this.h=d};A61=function(a,b){this.w=a;this.h=b};A61.prototype.equals=function(a){return this.w===a.w&&this.h===a.h};TradingView.Point=function(a,b){this.x=a;this.y=b};
TradingView.setAbsoluteRect=function(a,b){a.css("position","absolute");a.css("left",b.x+"px");a.css("top",b.y+"px");a.width(b.w);a.height(b.h)};TradingView.setAbsolutePos=function(a,b){a.css("position","absolute");a.css("left",b.x+"px");a.css("top",b.y+"px")};TradingView.addLocalCoordsToMouseEvent=function(a,b){var c=a.offset();b.localX=b.pageX-c.left;b.localY=b.pageY-c.top};TradingView.processEvent=function(a,b,c,d,e){d&&(e||TradingView.addLocalCoordsToMouseEvent(b,a),d.call(c,a,b))};
TradingView.MOUSE_RIGHT_BUTTON=2;
TradingView.setMouseEventHandler=function(a,b,c){var d=function(d){a.off("mousemove.chartgui");var e=function(d){if(!TradingView.mousePressed||Modernizr.touch)TradingView.processEvent(d,a,b,b.mouseMoveEvent),c&&d.preventDefault()};a.on("mousemove.chartgui",e);Modernizr.touch&&e(d);TradingView.processEvent(d,a,b,b.mouseEnterEvent);c&&d.preventDefault()};a.mouseenter(d);var e=0,g=null,h=function(){window.clearTimeout(g);e=0;g=null},k=0,l=0,m=null,n=function(n){void 0===n.button&&(n.button=0);if(Modernizr.touch||
n.originalEvent.touches)n.pageX=n.originalEvent.touches[0].pageX,n.pageY=n.originalEvent.touches[0].pageY,n.localX=n.originalEvent.touches[0].pageX,n.localY=n.originalEvent.touches[0].pageY,d(n);var q=function(d){void 0===d.button&&(d.button=0);if(Modernizr.touch||d.originalEvent.touches)d.pageX=d.originalEvent.touches[0].pageX,d.pageY=d.originalEvent.touches[0].pageY,d.localX=d.originalEvent.touches[0].pageX,d.localY=d.originalEvent.touches[0].pageY,d.clientX=d.originalEvent.touches[0].pageX,d.clientY=
d.originalEvent.touches[0].pageY,k=d.pageX,l=d.pageY,clearTimeout(m);d.button!==TradingView.MOUSE_RIGHT_BUTTON&&TradingView.processEvent(d,a,b,b.pressedMouseMoveEvent);c&&d.preventDefault()},r=function(d){void 0===d.button&&(d.button=0);if(Modernizr.touch||d.originalEvent.touches)d.pageX=k,d.pageY=l,d.localX=k,d.localY=l,clearTimeout(m);TradingView.mousePressed=!1;$(document.body).off("mousemove.chartgui");$(document.body).off("mouseup.chartgui");Modernizr.touch||d.originalEvent.touches?($(document.body).off("touchmove.chartgui"),
$(document.body).off("touchend.chartgui"),w(d)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"));d.button!==TradingView.MOUSE_RIGHT_BUTTON&&(TradingView.processEvent(d,a,b,b.mouseUpEvent),++e,g&&1<e?(TradingView.processEvent(d,a,b,b.mouseDoubleClickEvent),h()):TradingView.processEvent(d,a,b,b.mouseClickEvent));c&&d.preventDefault();Modernizr.touch&&w(d)};Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),
$(document.body).on("touchmove.chartgui",q),$(document.body).on("touchend.chartgui",r),m=setTimeout(function(){A(n)},500)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",q),$(document.body).on("mouseup.chartgui touchend.chartgui",r));TradingView.mousePressed=!0;n.button!==TradingView.MOUSE_RIGHT_BUTTON&&(TradingView.processEvent(n,a,b,b.mouseDownEvent),g||(e=0,g=window.setTimeout(h,
500)));if(c){n.preventDefault();try{window.focus()}catch(u){}}};a.on("touchcancel",function(){clearTimeout(m)});if(Modernizr.touch)a.on("touchstart.chartgui",n),a.on("touchstartoutside mousedownoutside",function(c){TradingView.processEvent(c,a,b,b.mouseDownOutsideEvent,!0)}),a.on("gesturestart",function(c){TradingView.processEvent(c,a,b,b.gestureStartEvent);clearTimeout(m)}),a.on("gesturechange",function(c){c.scale=c.originalEvent.scale;TradingView.processEvent(c,a,b,b.gestureChangeEvent)}),a.on("gestureend",
function(c){TradingView.processEvent(c,a,b,b.gestureEndEvent)});else if(a.on("mousedown.chartgui touchstart.chartgui",n),a.on("touchstartoutside mousedownoutside",function(c){TradingView.processEvent(c,a,b,b.mouseDownOutsideEvent,!0)}),navigator.msPointerEnabled&&window.MSGesture){var n=new MSGesture,q=!1,r=1,u=a.get(0);n.target=u;u.gesture=n;u.gesture.pointerType=null;u.pointers=[];n.pointerType=null;a.on("pointerdown",function(a){if(a.target===this)if(null===this.gesture.pointerType)this.gesture.target=
u,this.gesture.addPointer(a.originalEvent.pointerId),this.gesture.pointerType=a.originalEvent.pointerType;else if(a.originalEvent.pointerType===this.gesture.pointerType)this.gesture.addPointer(a.originalEvent.pointerId);else{var b=new MSGesture;b.target=a.originalEvent.target;a.originalEvent.target.gesture=b;a.originalEvent.target.gesture.pointerType=a.originalEvent.pointerType;a.originalEvent.target.gesture.addPointer(a.originalEvent.pointerId)}});a.on("MSGestureChange",function(c){c.scale=r*=1*
(c.originalEvent.scale-1)+1;q||1===c.originalEvent.scale||(q=!0,TradingView.processEvent(c,a,b,b.gestureStartEvent));q&&TradingView.processEvent(c,a,b,b.gestureChangeEvent)});a.on("MSGestureEnd",function(c){q=!1;r=1;TradingView.processEvent(c,a,b,b.gestureEndEvent)})}var w=function(d){a.off("mousemove.chartgui touchmove.chartgui");TradingView.processEvent(d,a,b,b.mouseLeaveEvent);c&&d.preventDefault()};a.mouseleave(w);var A=function(d){TradingView.processEvent(d,a,b,b.contextMenuEvent);c&&d.preventDefault()};
a.contextMenu&&a.contextMenu(A)};TradingView.clientRect=function(a){var b=a.offset(),c=a.width();a=a.height();return new TradingView.Rect(b.left,b.top,c,a)};TradingView.offsetPosition=function(a){var b=0,c=0;do b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;while(a);return{left:b,top:c}};
TradingView.addColorPicker=function(a){var b=$("<input>");b.appendTo(a);b.tvcolorpicker();TVSettings&&(b.tvcolorpicker.setCustomColors=TVSettings.setJSON("pickerCustomColors",[]),b.bind("customcolorchange",function(a,b){TVSettings.setJSON("pickerCustomColors",b)}));return b};
TradingView.createLineStyleEditor=function(){return new HTMLHelper.Combobox([{value:CanvasEx.LINESTYLE_SOLID,html:'<div class="linestyle solidline"/>'},{value:CanvasEx.LINESTYLE_DOTTED,html:'<div class="linestyle dottedline"/>'},{value:CanvasEx.LINESTYLE_DASHED,html:'<div class="linestyle dashedline"/>'}])};
TradingView.createShapeLocationEditor=function(){return $('<select><option value="'+CanvasEx.MARKLOC_ABOVEBAR+'">Above Bar</option><option value="'+CanvasEx.MARKLOC_BELOWBAR+'">Below Bar</option><option value="'+CanvasEx.MARKLOC_TOP+'">Top</option><option value="'+CanvasEx.MARKLOC_BOTTOM+'">Bottom</option><option value="'+CanvasEx.MARKLOC_ABSOLUTE+'">Absolute</option></select>')};
TradingView.createShapeStyleEditor=function(){for(var a="<select>",b=Object.keys(TradingView.StudyPlotShapes.Data),c=0;c<b.length;++c)var d=TradingView.StudyPlotShapes.Data[b[c]],a=a+('<option value="'+d.id+'">'+d.guiName+"</option>");return $(a+"</select>")};TradingView.createLineWidthEditor=function(){return $('<div class="linewidth-slider">').slider({min:1,max:4,step:1})};TradingView.createVisibilityEditor=function(){return $("<input type='checkbox' class='visibility-switch'/>")};
TradingView.createTextEditor=function(){var a=$("<input/>");a.attr("type","text");return a};
TradingView.createTextPosEditor=function(){return new HTMLHelper.Combobox([{value:CanvasEx.TEXTPOS_TOPLEFT,html:"Top Left"},{value:CanvasEx.TEXTPOS_TOPCENTER,html:"Top Center"},{value:CanvasEx.TEXTPOS_TOPRIGHT,html:"Top Right"},{value:CanvasEx.TEXTPOS_MIDDLELEFT,html:"Middle Left"},{value:CanvasEx.TEXTPOS_MIDDLECENTER,html:"Middle Center"},{value:CanvasEx.TEXTPOS_MIDDLERIGHT,html:"Middle Right"},{value:CanvasEx.TEXTPOS_BOTTOMLEFT,html:"Bottom Left"},{value:CanvasEx.TEXTPOS_BOTTOMCENTER,html:"Bottom Center"},
{value:CanvasEx.TEXTPOS_BOTTOMRIGHT,html:"Bottom Right"}])};TradingView.createHHistDirectionEditor=function(){var a=$("<select />");$("<option value='"+CanvasEx.HHISTDIR_LEFTTORIGHT+"'>Left</option>").appendTo(a);$("<option value='"+CanvasEx.HHISTDIR_RIGHTTOLEFT+"'>Right</option>").appendTo(a);return a};
TradingView.createTransparencyEditor=function(a){var b=$('<div class="transparency-slider"><div class="gradient"></div></div>').slider({min:0,max:100,step:1}),c=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];b.setColor=
function(a){var e=b.find(".gradient");$.browser.msie?e.css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', EndColor=0, GradientType=1)"):c.forEach(function(b){e.css("background-image",b.replace(/%COLOR/,a))})};a?(b.setColor(a.val()||"black"),a.on("change",function(a){b.setColor(a.target.value)})):b.setColor("black");return b};
TradingView.createPlotEditor=function(){var a=$("<select />");$("<option value='"+TradingView.StudyConsts.PLOT_LINE+"'>"+$.t("Line")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_LINE_WITH_BREAKS+"'>"+$.t("Line With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_HISTOGRAM+"'>"+$.t("Histogram")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_CROSS+"'>"+$.t("Cross",{context:"chart_type"})+"</option>").appendTo(a);
$("<option value='"+TradingView.StudyConsts.PLOT_AREA+"'>"+$.t("Area")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS+"'>"+$.t("Area With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_COLUMNS+"'>"+$.t("Columns")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_CIRCLES+"'>"+$.t("Circles")+"</option>").appendTo(a);return a};
TradingView.createPriceSourceEditor=function(){var a=$("<select>");$("<option value='open'>"+$.t("Open")+"</option>").appendTo(a);$("<option value='high'>"+$.t("High")+"</option>").appendTo(a);$("<option value='low'>"+$.t("Low")+"</option>").appendTo(a);$("<option value='close'>"+$.t("Close")+"</option>").appendTo(a);$("<option value='hl2'>"+$.t("(H + L)/2")+"</option>").appendTo(a);$("<option value='hlc3'>"+$.t("(H + L + C)/3")+"</option>").appendTo(a);$("<option value='ohlc4'>"+$.t("(O + H + L + C)/4")+
"</option>").appendTo(a);return a};TradingView.cacheUrl=function(a){$("<img>").attr("src",a)};TradingView.themeImageHTML=function(a){return"<img src='"+TradingView.themeResourceFullPath(a)+"' style='display:block'/>"};TradingView.animate=function(a,b,c,d,e){var g=d||250,h=$.easing[e]||$.easing.easeOutCubic,k=0,l=Date.now(),m=function(d){d=(d?1E12>d?Date.now():d:Date.now())-l;var e=Math.min(a,h(null,d,0,a,g)),r=e-k;k=e;b(r);d>=g?"function"==typeof c&&c():requestAnimationFrame(m)};requestAnimationFrame(m)};
A14=function(a,b,c){this._options=c=c||{};this._name=a;this._container=$('<div class="favored-list-container" />');c.addClass&&this._container.addClass(c.addClass);this._quick_container=$('<div class="quick" />').appendTo(this._container);this._submenu=$('<span class="submenu">'+(this._options.submenuHtml||"")+"<i></i></span>").appendTo(this._container);c.tooltip&&(this._submenu.attr("title",c.tooltip),c.addTooltipClass&&this._submenu.addClass(c.addTooltipClass));this._activeButton=
null;this._onChange=new Delegate;this._onSelect=new Delegate;this._onResize=new Delegate;this._onOpen=new Delegate;this._load(b);TradingView.bindPopupMenu(this._container,null,{direction:"down",reverse:!0,addClass:"narrow favored-list"+(c.popupAddClass?" "+c.popupAddClass:""),event:"popup-menu",popupSpacing:c.popupSpacing});this._submenu.on("click",this._openMenu.bind(this));if(!$.browser.msie)TVXWindowEvents.on(a+"-change",$.proxy(this,"_onChangeInAnotherTab"));return this};
A14.prototype._openMenu=function(){this._onOpen.fire();this._submenu.trigger("popup-menu",[this._data])};A14.prototype._onChangeInAnotherTab=function(){this.reload(this._data)};A14.prototype.reload=function(a){this._quick_container.empty();this._load(a)};
A14.prototype._convertQuicksToData=function(a){this._quicks.forEach(function(b){var c=!1;a.forEach(function(a){if(a.id==b)return c=!0,!1});c||a.push({id:b,title:b,favoriteButton:{icon:{},title:b,addClass:"apply-common-tooltip"}})});return a};
A14.prototype._load=function(a){var b=this;this._quicks=this._options.showJustDefaultQuicks?this._options.defaultFavorites||[]:this._options.notShowQuicks?[]:TVSettings.getJSON(this._name+".quicks",this._options.defaultFavorites||[],!0);this._list=[];a=this._convertQuicksToData(a);$.grep(a,function(a,b){return!a.separator}).forEach(function(a,d){var e={index:d,data:a,toQuickButton:$('<span class="to-quick" title=""></span>'),toggleFavorite:function(a,c){var d=void 0!==a?a:!this.isFavorite();
d?this.markFavorite():this.unmarkFavorite();b._toggleFavorite(e,d,c)},markFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Remove from favorites")).addClass("quicked")},unmarkFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Add to favorites")).removeClass("quicked")},isFavorite:function(){return-1<b._quicks.indexOf(a.id)},active:function(){return this.data.active()},drop:function(){return this.data.drop()}};b._options.notShowQuicks&&$.extend(e,
{toQuickButton:null});e.data.toQuickButtonStyle&&e.toQuickButton&&e.toQuickButton.css(e.data.toQuickButtonStyle);b._list.push(e);var g={action:function(){b._change(e)},buttons:[],active:b._options.notShowActive?function(){return!1}:function(){return b._active&&e===b._active}};b._options.notShowQuicks||g.buttons.push({el:e.toQuickButton,handler:function(a){e.toggleFavorite();a.preventDefault();a.stopPropagation()}});"function"===typeof e.data.drop&&g.buttons.push({el:$('<span class="delete" title="Delete"></span>'),
handler:function(a){e.drop();a.stopPropagation()}});$.extend(a,g);e.toggleFavorite(e.isFavorite(),!0)});this._data=a;this._options.notShowActive||this._addActive(this._list[0]);this._onResize.fire()};
A14.prototype._toggleFavorite=function(a,b,c){if(!this._options.notShowQuicks||this._options.showJustDefaultQuicks){if(b){a.favorite_button=this._createButton(a,this._quick_container);var d=this._lastFavoriteButton(a);d?a.favorite_button.insertAfter(d.favorite_button):a.favorite_button.prependTo(this._quick_container)}else c||this._removeButton(a);c||(b?-1==this._quicks.indexOf(a.data.id)&&this._quicks.push(a.data.id):-1<this._quicks.indexOf(a.data.id)&&this._quicks.splice(this._quicks.indexOf(a.data.id),
1),this._saveFavorite(),this._markActive(),this._onResize.fire())}};A14.prototype._lastFavoriteButton=function(a){for(a=a.index-1;0<=a;a--)if(this._list[a]&&this._list[a].favorite_button)return this._list[a]};A14.prototype._saveFavorite=function(){this._options.notShowQuicks||(TVSettings.setJSON(this._name+".quicks",this._quicks),TVXWindowEvents.emit(this._name+"-change"))};
A14.prototype._createButton=function(a){var b=this,c=a.data.favoriteButton,d=$("<span></span>").data("item",a);c.addClass&&d.addClass(c.addClass);c.text&&d.text(a.text);c.title&&d.prop("title",c.title);if(c.icon){var e=$("<i></i>").appendTo(d);c.icon.image&&e.css("background-image",c.icon.image||"");c.icon.offset&&e.css("background-position","string"===typeof c.icon.quickOffset?c.icon.quickOffset:c.icon.quickOffset.x+"px "+c.icon.quickOffset.y+"px")}d.on("click",function(c){b._change(a);
0===b._quicks.length&&b._openMenu();c.preventDefault()});return d};A14.prototype._removeButton=function(a){a.favorite_button&&(a.favorite_button.remove(),a.favorite_button=null)};
A14.prototype._markActive=function(a){if(!this._options.notShowActive){var b=this,c;if(this._active)if(a=this._active,a.isFavorite()){var d=b._quick_container.find(".just_active");this._btnToggleActiveView(d,!1)}else c=this._addActive(a),0!==this._quicks.length&&this._btnToggleActiveView(c,!0);$.map(this._list,function(c){a!==c||0===b._quicks.length?b._btnToggleActiveView(c.favorite_button,!1):c.favorite_button&&b._btnToggleActiveView(a.favorite_button,!0)});c&&c.hasClass("selected")?
this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active")}};A14.prototype._btnToggleActiveView=function(a,b){if(a){var c,d=a.data("item");d&&d.data&&d.data.icon&&(c=d.data.icon);b?(a.addClass("selected"),c=c.offsetActive?c.offsetActive:null):(a.removeClass("selected"),c=c.offset?c.offset:null);c&&a.children("i").css("background-position","string"===typeof c?c:c.x+"px "+c.y+"px")}};
A14.prototype._addActive=function(a){this._quick_container.find(".just_active").remove();return this._createButton(a).appendTo(this._quick_container).addClass("just_active")};A14.prototype._clearActive=function(){this._quick_container.find(".just_active").remove()};A14.prototype._clearActive=function(){};A14.prototype._setActive=function(a){if(this._active===a)return!1;this._active=a;this._markActive();return!0};
A14.prototype._change=function(a){this._onSelect.fire(a.data.id);if(this._setActive(a))this._onChange.fire(a.data.id);else return!1};A14.prototype.element=function(){return this._container};A14.prototype._getItemByValue=function(a){for(var b in this._list)if(this._list[b].data.id==a)return this._list[b];throw Error("undefined value "+a+" in FavoredList");};A14.prototype.onChange=function(){return this._onChange};
A14.prototype.onSelect=function(){return this._onSelect};A14.prototype.onResize=function(){return this._onResize};A14.prototype.onOpen=function(){return this._onOpen};A14.prototype.setValue=function(a){a=this._getItemByValue(a);this._setActive(a)};A14.prototype.value=function(a){return this._active?this._active.data.value:void 0};
A14.prototype.removeById=function(a,b){var c=$.grep(this._data,function(b){return b.id!=a});this._list.forEach(function(b){b.data.id==a&&this._toggleFavorite(b,!1)},this);this.reload(c);"function"===typeof b&&b()};
TradingView.bindPopupMenu=function(a,b,c){var d,e;a=$(a);c=c||{};d=(c.event||"click")+".popup-menu";c.hideEvent&&(e=c.hideEvent+".popup-menu");var g=new Function,h=g,k={},l=function(d,e,l){function r(b){b=$(b.target).parents().andSelf();b.is(A)||b.is(a)||b.is(".charts-popup-tab-headers, .charts-popup-itemheader")||h()}function u(a){a=$(a.target).parents().andSelf();a.is(".charts-popup-tab-headers, .charts-popup-itemheader")||c.notCloseOnButtons&&a.is(".icon-save, .icon-delete")||h()}function w(b,
d,e){if(b instanceof TradingView.bindPopupMenu.TabGroup){if(b.tabs&&b.tabs.length)if(1!==b.tabs.length||b.tabs[0].title){var g=$('<div class="charts-popup-tab-group"></div>').appendTo(e),h=$('<div class="charts-popup-tab-headers"></div>').appendTo(g),k=null;$.each(b.tabs||[],function(a,c){if(c.items&&c.items.length){var d=$('<div class="charts-popup-tab"></div>').hide().appendTo(g);$.each(c.items,function(){w(this,void 0,d)});var e=$('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(c.name)).appendTo(h);
e.on("click",function(a){e.is(".active")||(h.find(".charts-popup-tab-header.active").removeClass("active"),e.addClass("active"),g.find(".charts-popup-tab").hide(),d.show(),a&&a.preventDefault(),"function"===typeof b.onChange&&b.onChange.call(b,c.name))});if(!k||c.active)k=e,h.find(".charts-popup-tab-header.active").removeClass("active"),e.addClass("active"),g.find(".charts-popup-tab").hide(),d.show()}})}else $.each(b.tabs[0].items,function(){w(this,void 0,e)})}else if(b instanceof TradingView.bindPopupMenu.Group){var l=
$('<div class="charts-popup-group"></div>').appendTo(e);b.title&&(d=$('<div class="charts-popup-itemheader"></div>').text(b.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),b.collapsible&&(l.addClass("charts-popup-group-collapsible"),l.toggleClass("collapsed",b.collapsed),d.on("click",function(){l.toggleClass("collapsed");if("function"==typeof b.onChange)b.onChange(l.hasClass("collapsed"))})),l.append(d));$.each(b.items,function(a){w(this,1,l)})}else if(b instanceof TradingView.bindPopupMenu.Header)e.append($('<div class="charts-popup-itemheader"></div>').text(b.title));
else if(b.separator){var m=$('<span class="separator"></span>');e.append(m)}else{m=$('<a class="item" href="#">');"function"==typeof b.deleteAction&&"function"==typeof b.saveAction&&m.addClass("item-twobuttons");b.url&&m.attr("href",b.url);b.target&&m.attr("target",b.target);d||m.addClass("first");"function"===typeof b.active?b.active(b)&&m.addClass("active"):b.active&&m.addClass("active");b.addClass&&m.addClass(b.addClass);b.addData&&m.data(b.addData);b.disabled&&m.addClass("disabled");if("function"==
typeof b.action){var n=b.action;d=function(a){var c=$(a.target).parents().andSelf();c.is(r)||c.is(D)||(n.apply(m,arguments),!b.url&&a&&"function"==typeof a.preventDefault&&a.preventDefault())};c.upAction?m.bind("mouseup",d):m.bind("click",d)}b.date?(d=$('<span class="title"></span>').appendTo(m),$('<span class="date"></span>').text(b.date||"").appendTo(m)):b.icon?(d=$('<span class="icon"></span>').appendTo(m),d.css("background-image",b.icon.image||""),b.icon.offset&&d.css("background-position","string"===
typeof b.icon.offset?b.icon.offset:b.icon.offset.x+"px "+b.icon.offset.y+"px"),d=$('<span class="title"></span>').appendTo(m)):d=$('<span class="title-expanded"></span>').appendTo(m);b.html?d.html(b.html):d.text(b.title||"");if("function"==typeof b.deleteAction){var q=b.deleteAction;d=b.deleteAction.title||"Delete";var r=$('<span class="icon-delete">');r.attr("title",d);r.on("click",function(a){q.apply(m,arguments);a.preventDefault()});m.append(r)}if("function"==typeof b.saveAction){var v=b.saveAction;
d=b.saveAction.title||"Save";var D=$('<span class="icon-save">');D.attr("title",d);D.on("click",function(a){v.apply(m,arguments);a.preventDefault()});m.append(D)}b.buttons instanceof Array&&b.buttons.length&&b.buttons.forEach(function(a){a.el instanceof $||(a.el=$(a.el));a.el.appendTo(m);if(a.handler)a.el.on("click",function(b){a.handler.apply(m,arguments)})});"undefined"!==typeof b.counter&&(d=b.counterBlue?"blue":"",$('<span class="counter"></span>').text(b.counter+"").addClass(d).appendTo(m));
e.append(m);a.data("popup-menu",e)}}e=e||b;"function"===typeof e&&(e=e());if($(this).hasClass("open"))if(l)h(),l=k.scrollTop;else return;h=function(){k.scrollTop=A.scrollTop();A.remove();a.removeClass("active open");a.data("popup-menu",null);$(document).off("click",u);$(document).off("mousedown",r);Modernizr.touch&&$(document).off("touchstart.chartgui",r);$(document).off("selectstart.popup-menu");h=g;c.onRemove&&c.onRemove()};a.addClass("active open");var A=$('<div class="charts-popup-list">');c.addClass&&
A.addClass(c.addClass);$.each(e,function(a){w(this,a,A)});setTimeout(function(){$(document).on("click",u);$(document).on("mousedown",r);Modernizr.touch&&$(document).on("touchstart.chartgui",r)},0);if(c.upAction)$(document).on("selectstart.popup-menu",function(){return!1});A.appendTo(document.body);var v=$(window).width();e=Math.min($(window).height(),$("body").height());var B=a.outerWidth(),D=a.outerHeight(),C=a.offset();l=$(window).scrollTop()||0;C.top-=l;var z=A.outerWidth(),F=A.outerHeight(),G=
void 0!=c.viewportSpacing?c.viewportSpacing:10,J=c.popupSpacing?~~c.popupSpacing:1,E=c.popupDrift?~~c.popupDrift:0,I=F-A.height(),L=c.direction?c.direction:"down",P=!!c.reverse;if("down"==L){var H=e-C.top-D-J-G-I,R=C.top-J-G-I;H<Math.max(F||0,100)&&R>H&&(L="up")}switch(L){case "down":case "up":"down"==L?A.css("top",C.top+D+J+"px"):A.css("bottom",e-C.top+J+"px").css("top","auto");P?(Math.max(C.left+E+B-z,G),A.css("left",Math.max(C.left+E+B-z,G)+"px").css("right","auto")):A.css("left",C.left+E+"px").css("right",
"auto");break;case "right":case "left":J=Math.max(J,4),"right"==L?A.css("left",Math.floor(C.left+B+J)+"px").css("right","auto"):A.css("left",Math.floor(Math.max(C.left-z-J,G))+"px").css("right","auto"),P?A.css("top",Math.floor(Math.max(C.top+E+D-F,G))+"px"):A.css("top",Math.floor(C.top+E)+"px")}A.show();"up"==L||{left:1,right:1}[L]&&P?"up"==L?A.css("max-height",C.top-J-G-I+"px"):A.css("max-height",C.top+D-J-G-I+"px"):A.css("max-height",e-C.top-D-J-G-I+"px");c.careRightBorder&&(v+=$(window).scrollLeft(),
parseInt(A.css("left"))+A.width()+G>v&&A.css("left",v-A.width()-G+"px").css("right","auto"));c.careBottomBorder&&parseInt(A.css("top"))+A.height()+G>e+l&&A.css("top",e-A.height()-G+l+"px");var O;l=a.parents().andSelf();for(e=l.size();e--;)if("fixed"===l.eq(e).css("position")){O=l.eq(e);break}O&&(O=A.offset(),A.css({position:"fixed",left:O.left-$(document).scrollLeft(),right:"auto"}));A[0].scrollHeight>A.height()&&A.addClass("popup-with-scroll");d&&d.preventDefault()};d&&a.bind(d,l);e&&a.bind(e,function(){h()});
c.runOpened&&l()};TradingView.bindPopupMenu.TabGroup=function TabGroup(b){if(!(this instanceof TabGroup))return new TabGroup(b);b=b||{};this.tabs=[];"function"===typeof b.onChange&&(this.onChange=b.onChange)};TradingView.bindPopupMenu.TabGroup.prototype.appendTab=function(a,b,c){a=null==a?"":a+"";b||(b=[]);c||(c={});if(!Array.isArray(b))throw new TypeError("items must be an array");this.tabs.push({name:a,items:b,active:!!c.active});return b};
TradingView.bindPopupMenu.Header=function Header(b){if(!(this instanceof Header))return new Header(b);this.title=b};TradingView.bindPopupMenu.Group=function Group(b){if(!(this instanceof Group))return new Group(b);b=b||{};this.items=[];this.title=null==b.title?"":b.title+"";this.collapsible=!!b.collapsible;this.collapsed=!!b.collapsed;"function"===typeof b.onChange&&(this.onChange=b.onChange)};TradingView.bindPopupMenu.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)};
TradingView.unbindPopupMenu=function(a){a=$(a);a.unbind(".popup-menu");a.removeData("popup-menu")};
TradingView.showChartNameDialog=function(a,b,c,d,e,g){var h=b?b:$.t("Save New Chart Layout"),k=A83.createDialog(h);b=function(){var b=k.find('input[name="name"]'),c=b.val(),d=[];if(e)for(var g=0;g<e.length;g++)if("bool"===e[g].type){var l=k.find('input[name="'+e[g].name+'"]');d.push(l[0].checked)}c?(a(c,d),A83.destroy(h)):(A83.showError($.t("Please enter chart name"),A83.get(h)),b.focus());return!1};d=d||"";k.css("width","400px");k.find(".tv-dialog-content").html('<div class="main"><form><p>'+
$.t(c?c:"Chart name")+':</p><p class="tv-dialogs-name"><input type="text" name="name" maxlength="'+d+'"/></p><p class="tv-dialog-right"></p></form></div>');if(e)for(c=k.find(".tv-dialog-right"),d=0;d<e.length;d++)if("bool"===e[d].type){var l=$('<p class="tv-dialogs-name"></p>'),m=e[d].hint?$('<div class="tv-dialogs-label-hint"></div>').blueTooltip($.t(e[d].hint),"bottom"):null,n=$('<label><input type="checkbox" style="vertical-align:top;margin-top:2px" name="'+e[d].name+'"/> '+$.t(e[d].title)+"</label>");
l.append(n,m).insertBefore(c)}k.find("form").submit(b);$('<a class="tv-button wide ok">'+$.t("OK")+"</a>").click(b).css({"margin-right":"5px"}).appendTo(k.find(".tv-dialog-right"));$('<a class="tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){A83.destroy(h)}).appendTo(k.find(".tv-dialog-right"));"function"===typeof g&&g(k);A83.positionDialog(k,{left:$(window).width()/2-k.width()/2,top:$(window).height()/2-k.height()/2});A83.applyHandlers(k);k.find('input[name="name"]').focus()};A1=function(a,b,c){var d=this;this.HIGHLIGHT_STUDY_NUM_FLICKS=2;this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies";this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER";this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB";this._SCRIPTING_PACKAGE_NAME="tv-scripting";this._BASIC_STUDIES_PAGE_NAME=W77.enabled("plain_studymarket")?"Technical Analysis":"Built-ins";this.D5=a;this._chart=a.activeChartWidget.value();this._options=$.extend({},this.DEFAULT_OPTIONS,c||
{});this.concretizeOptions();this._studies=this._market=null;this._packagesWithTabNames={};this._user=b;this._favs=[];this._pages={};this._tabs={};this._headers={};this.favsChanged=new Delegate;this.layoutChanged=new Delegate;this.visibilityChanged=new Delegate;this.studiesReady=new $.Deferred;this.marketPagesReady=new $.Deferred;this._pubSearchPage=-1;this._pubSearchEntries=[];this._pubSearchDfd=null;TVXWindowEvents.on("StudyFavoritesChanged",function(a){d._onExternalFavoritesChanged(JSON.parse(a))})};
A1.prototype.init=function(){this._initialized||(this.setupMarketInfo(),this.getStudyInfo(),this.setUser(this._user),this.prepareLayout(),this.attachHandlers(),this._initialized=!0)};
A1.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:/EPS/,earnings:/EPS/,"trailing twelve months":/TTM/},popularFundamentals:[{name:"Income Statement",studies:"Script$EDGR_TOTAL_REVENUE@tv-scripting Script$EDGR_DILUTED_EPS_NET_INCOME@tv-scripting Script$EDGR_NET_INCOME@tv-scripting Script$EDGR_EBITDA@tv-scripting Script$EDGR_EBIT@tv-scripting Script$EDGR_EQUITY_EARNINGS@tv-scripting".split(" ")},{name:"Profitability",
studies:["Script$EDGR_GROSS_MARGIN@tv-scripting","Script$EDGR_AFTER_TAX_MARGIN@tv-scripting","Script$EDGR_GROSS_PROFIT@tv-scripting"]},{name:"Dividend",studies:["Script$EDGR_DIVIDEND_YIELD@tv-scripting","Script$EDGR_DIVIDENDS_PAID@tv-scripting"]},{name:"Current Valuation",studies:["Script$EDGR_MARKET_CAP@tv-scripting","Script$EDGR_PRICE_EARNINGS_TTM@tv-scripting","Script$EDGR_PRICE_EARNINGS_TO_GROWTH_TTM@tv-scripting","Script$EDGR_PRICE_BOOK_VALUE_PER_SHARE@tv-scripting"]},{name:"Other",studies:["Script$EDGR_DEBT_TO_EQUITY@tv-scripting",
"Script$EDGR_FREE_CASH_FLOW@tv-scripting","Script$EDGR_RETURN_ON_EQUITY@tv-scripting","Script$EDGR_ACCOUNTING_CHANGE@tv-scripting","Script$EDGR_ACCOUNTS_PAYABLE@tv-scripting"]}]};A1.prototype._FAV_KEY="studyMarket.favorites";A1.prototype._PAGE_KEY="studyMarket.page";A1.prototype._MARKET_TAB_IS_OPEN_KEY="studyMarket.marketTabIsOpen";A1.prototype._TECHNICAL_TAB_IS_OPEN_KEY="studyMarket.technicalTabIsOpen";
A1.prototype._ECONOMY_TAB="Economy & Symbols";A1.prototype._FILTER_KEY="studyMarket.filter";A1.prototype.onCustomScriptModified=function(){this._initialized&&(this.getStudyInfo(),this.resetCustomScriptPage(),this.loadFavorites(),this.updateSearchPage())};A1.prototype.onPublishedScriptModified=function(){this._initialized&&(this.getStudyInfo(),this.resetPublishedScriptPage(),this.loadFavorites(),this.updateSearchPage())};
A1.prototype.concretizeOptions=function(){if(this._options.onWidget||W77.enabled("study_market_minimized"))this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0};A1.prototype.setupMarketInfo=function(){this._market={products:pro.getStudies(),order:pro.getStudiesOrder()};this._market.order=$.grep(this._market.order,function(a){return"Script$EOTPRO"!=a});this.setupSubproductsInfo()};
A1.prototype.setupSubproductsInfo=function(){this._subProductIds={};for(var a=Object.keys(this._market.products),b=0;b<a.length;++b){var c=this._market.products[a[b]];if(void 0!=c.subproduct_ids)for(var d=0;d<c.subproduct_ids.length;++d)this._subProductIds[c.subproduct_ids[d]]=c.id}};A1.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){this.setupStudyInfo()})};
A1.prototype.setupStudyInfo=function(){var a=this._chart.model().studiesMetaData().toArray();this._studies={};a=a.filter(function(a){return!this.isHidedStudy(a)},this);a.forEach(function(a){var c=this.getStudyPackageName(a);if("Script$EOTPRO"!=c&&(!this._options.minimized||c==this._BASIC_STUDIES_PACKAGE_NAME)){var d=this.resolvePackageName(c);assert(void 0!=d,"Cannot resolve packageName "+c);this._studies[d]||(this._studies[d]=[]);this._studies[d].push(a)}}.bind(this),this);this.studiesReady.resolve()};
A1.prototype.resolvePackageName=function(a){return a in this._subProductIds?this._subProductIds[a]:a};A1.prototype.setUser=function(a){is_authenticated?this.setupUserData(a):this.setAnonymous()};A1.prototype.setupUserData=function(a){this._user=a;this.loadFavorites();this.updateMarketPages()};A1.prototype.setAnonymous=function(){this.setupUserData(null,[]);this.favsChanged.fire()};
A1.prototype.isHidedStudy=function(a){return!!a.is_hidden_study};A1.prototype.loadFavorites=function(){for(var a=TVSettings.getJSON(this._FAV_KEY,[]),b=[],c=0;c<a.length;c++){var d=StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.favsChanged.fire()};A1.prototype.saveFavorites=function(){TVSettings.setJSON(this._FAV_KEY,this._favs)};
A1.prototype.prepareLayout=function(){var a=this;this._widget=$('<div class="insert-study-dialog"><div class="insert-study-row insert-study-title tv-dialog-title"><a class="tv-dialog-title-close"></a>'+$.t("Indicators")+'</div><div class="insert-study-row insert-study-body"><div class="insert-study-tabs"><div class="insert-study-tabs-list-container"><ul class="insert-study-tabs-list"></ul></div></div><div class="insert-study-main"><div class="insert-study-headers"></div><div class="insert-study-pages insert-study-row"></div></div></div></div>');
this._w_title=this._widget.find(".insert-study-title");this._w_tabs_container=this._widget.find(".insert-study-tabs-list-container");this._w_tabs=this._widget.find(".insert-study-tabs-list");this._w_pages=this._widget.find(".insert-study-pages");this._w_pages.onScrollToEnd=new Delegate;this._w_headers=this._widget.find(".insert-study-headers");this._widget.draggable(A83._constrainDraggableOptionsIfNeeded({handle:".insert-study-title"})).css({position:"absolute",zIndex:17});this.preparePages();
this._options.minimized&&this._widget.addClass("minimized");this._w_pages.scroll(function(){var b=$.map(a._w_pages.children(":visible"),function(a){return $(a).outerHeight(!0)}).reduce(function(a,b){return a+b},0),c=a._w_headers.outerHeight(!0),d=a._widget.find(".insert-study-main").height();b>d-c&&b-a._w_pages.scrollTop()===d-c&&a._w_pages.onScrollToEnd.fire()});this._widget.appendTo("body");this.hide()};A1.prototype.currentPage=function(){return this._pages[this._currentPageTitle]};
A1.prototype.preparePages=function(){this.addSearchPage();W77.enabled("items_favoriting")&&this.addFavoritesPage();this.prepareBasicPage();this._options.minimized||W77.enabled("charting_library")||(this.preparePublishedScriptPage(),this.prepareCustomScriptPage());this.prepareMarketPages();this._options.minimized||W77.enabled("charting_library")||(this.prepareFundamentalsPage(),this.studiesReady.done(function(){}.bind(this)));this.addEconomyPage();this._scroll=
new A59(this._w_tabs_container,this._w_tabs,{showBottomShadow:!1})};A1.prototype.addEconomyPage=function(){var a=this.addPage(this._ECONOMY_TAB,{showTitle:!0}),a=$('<div class="economy-page">').appendTo(a);this.addSymbolWidget=new AddSymbolWidget(this.D5);this.addSymbolWidget.show();a.append(this.addSymbolWidget._widget)};A1.prototype.addFavoritesPage=function(){this.addPage("Favorites",{showTitle:!0}).addClass("page-padded")};
A1.prototype.prepareBasicPage=function(){var a=this,b=a.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!W77.enabled("plain_studymarket"),showTitle:!0});this._basicPage=b;b.addClass("page-padded");a.studiesReady.done(function(){a.resetBasicPage()});a._options.selectBasicPage&&a.selectPage(this._BASIC_STUDIES_PAGE_NAME)};
A1.prototype.prepareCustomScriptPage=function(){var a=this;a.addPage("My Scripts",{packageName:this._CUSTOM_STUDIES_PACKAGE_NAME,technical:!0,showTitle:!0}).addClass("page-padded");a.studiesReady.done(function(){a.resetCustomScriptPage()})};
A1.prototype.preparePublishedScriptPage=function(){var a=this,b=a.addPage("Public Library",{packageName:this._CUSTOM_STUDIES_PACKAGE_NAME,technical:!0,showTitle:!0,titleHref:"/p/",wikiHref:"https://www.tradingview.com/stock-charts-support/index.php/Public_Library"});b.addClass("page-padded");a.studiesReady.done(function(){a.resetPublishedScriptPage()});b.on("show-page",function(){a._onPublishedScriptPageShown(b)})};
A1.prototype._onPublishedScriptPageShown=function(){0>this._pubSearchPage&&this._pubslishedScriptsLoadMore()};A1.prototype._pubslishedScriptsLoadMore=function(){var a=this;if(!this._pubslishedScriptsLoading){var b=this.getPage("Public Library");$('<div class="loading-indicator-small"></div>').appendTo(b);this._pubslishedScriptsLoading=!0;this._loadNextPubSearchPage().done(function(){a.resetPublishedScriptPage();a._pubslishedScriptsLoading=!1})}};
A1.prototype.resetBasicPage=function(){var a=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&studyMarket.preparePageStudies(a,this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[])};
A1.prototype.resetCustomScriptPage=function(){if(!this._options.minimized&&window.scriptLib&&this._studies){var a=this.getPage("My Scripts"),b=this._studies.Script$USER||[],c=$.Deferred();window.scriptLib&&b.length?scriptLib.requestUserScripts(function(a){for(var e=b.length;e--;){var g=b[e].scriptIdPart;if(g){delete b[e].scriptName;for(var h=null,k=a.length;k--;)if(a[k].scriptIdPart===g){h=a[k];break}h?b[e].scriptName=a[k].scriptName:b.splice(e,1)}else b.splice(e,1)}c.resolve(b)}):
c.resolve(b);c.done(function(b){b.length?studyMarket.preparePageStudies(a,b):studyMarket.appendTVScriptBtn(a)})}};A1.prototype._createPublishedScriptMetaInfo=function(a){var b=this.D5.activeChartWidget.value(),b=StudyMetaInfo.createMetaInfoStub(a,b.studyScriptingPkgVers),b=new StudyMetaInfo(b);b.author=a.author;b.scriptName=a.scriptName;b.scriptDescription=a.description;b.agreeCount=a.agreeCount;b.imageUrl=a.imageUrl;return b};
A1.prototype.resetPublishedScriptPage=function(){if(!this._options.minimized){var a=this,b=this.getPage("Public Library"),c=this._pubSearchEntries.map(function(b){return a._createPublishedScriptMetaInfo(b)});a.preparePageStudies(b,c,null,!0);b=a._pubslishedScriptsLoadMore.bind(a);a._w_pages.onScrollToEnd.unsubscribe(a,b);(void 0===a._pubSearchPageMax||null===a._pubSearchPageMax||0<=a._pubSearchPage&&a._pubSearchPage!==a._pubSearchPageMax)&&a._w_pages.onScrollToEnd.subscribe(a,
b)}};
A1.prototype.prepareFundamentalsPage=function(a,b){var c=this;a=this.addPage("Fundamentals",{packageName:"Script$EDGR",showTitle:!0});this.studiesReady.done(function(){function b(){for(var a=[],d=$.map(e,function(a){return a.id}),g=0;g<c._options.popularFundamentals.length;g++){var h=c._options.popularFundamentals[g];h.studies=h.studies.filter(function(a){return-1!=d.indexOf(a)}).map(function(a){return e.filter(function(b){return a===b.id})[0]});h.studies.length&&a.push(h)}return a}var e=
this._studies.Script$EDGR;if("undefined"!==e){var g=a,h=b();a.addClass("page-with-popular");if(h.length){var g=$("<div></div>"),k=$("<div></div>"),l=$('<div><div class="column column-left"></div><div class="column column-right"></div></div>'),m=l.find(".column-left").css("width","50%"),n=l.find(".column-right").css("width","50%"),q=function(){for(var a=0,b=0;b<h.length;b++)a+=h[b].studies.length;return a}(),r=function(a){var b=$('<div class="insert-study-items"></div>');c.fillStudies(b,a.studies,
null);b.prepend('<div class="subgroup-header">'+a.name+"</div>");return b};a.append(k);k.append('<div class="header-container with-divider"><div class="group-header">All Metrics</div></div>');k.append(g);a.prepend(l);a.append(k);for(l=k=0;k<h.length;k++){var u=h[k],w=r(u);l<q/2?m.append(w):n.append(w);l+=u.studies.length}}this.preparePageStudies(g,e)}}.bind(this))};
A1.prototype.appendTVScriptBtn=function(a){var b=this;if(a){var c=$('<br><a class="add-custom-script-btn"> Create your first script now!</a>').on("click",function(a){b.hide();scriptEditor.show();a.stopPropagation()});a.empty();a.append("<p>Welcome to the TradingView custom scripting engine. It allows you to create your own custom studies or modify existing. You do not have any scripts created.</p>");a.find("p").append(c)}};
A1.prototype.appendPubScriptBtn=function(a){a&&a.html("<p>No public library scripts were found.</p>")};
A1.prototype.prepareMarketPages=function(){this._options.hideMarketPages||this.studiesReady.done(function(){var a=this,b=this._market.order.map(function(b){return a._market.products[b]});b.sort(function(a,b){return a.name<b.name?-1:a.name>b.name?1:0});b.forEach(function(a){a.$page=this.addPage(a.name,{market:"tv-volumebyprice"!=a.id,packageName:a.id,subProductIds:a.subproduct_ids||[]});a.$page.addClass("offer-page")},this);this.selectPage(TVSettings.getValue(this._PAGE_KEY,this._basicPage));
this.marketPagesReady.resolve()}.bind(this))};
A1.prototype.addSearchPage=function(){var a=this;a._tabs.search=$('<div class="search"><div class="left-border"></div><div class="right-border"></div><input type="text" name="q" value="" autocomplete="off" placeholder="'+$.t("Search")+'"><div></div><a class="input-reset"></a></div>').data("title","search");a._pages.search=$('<div class="page-search"></div>').data("title","search");var b=a._tabs.search.find("input"),c=a._tabs.search.find(".input-reset");a._search_value=null;a._search_input=
b;this._widget.find(".insert-study-tabs").prepend(a._tabs.search);a._w_pages.prepend(a._pages.search);c.on("click",function(){b.val("").trigger("input").focus()});b.focus(function(){a.search(b.val())});var d;b.on("input",function(){c.toggle(""!==this.value);var b=$(this);d&&clearTimeout(d);d=setTimeout(function(){d=void 0;a.search(b.val())},200)})};
A1.prototype.search=function(a,b,c){var d=this;if(this._search_value!==a||b){var e=this._pages.search,g=[];""!==a&&(g.push({re:new RegExp("("+a.split("").map(function(a){return RegExpEscape(a)}).join(")(.*?)(")+")","i"),fuzzyHighlight:!0}),a.toLowerCase()in this.DEFAULT_OPTIONS.searchKeywords&&g.push({re:this.DEFAULT_OPTIONS.searchKeywords[a.toLowerCase()],fuzzyHighlight:!1}));this._search_value=a;e.html("");var h=$.Deferred();d._currentAsyncSearchDfd=h;W77.enabled("plain_studymarket")?
h.resolve([]):A56.suggest(a).done(function(a){var b=[];a=a&&a.results||[];for(var c=0;c<a.length;c++)b.push(d._createPublishedScriptMetaInfo(a[c]));h.resolve(b)}).fail(function(){h.resolve([])});h.done(function(a){if(d._currentAsyncSearchDfd===h){for(var b=Object.keys(d._studies).concat(d._PUBLISHED_STUDIES_PACKAGE_NAME).sort(),c=[d._BASIC_STUDIES_PACKAGE_NAME,d._PUBLISHED_STUDIES_PACKAGE_NAME,d._CUSTOM_STUDIES_PACKAGE_NAME],n=c.length;n--;){var q=c[n],r=b.indexOf(q);-1!==
r&&(b.splice(r,1),b.unshift(q))}for(c=0;c<b.length;c++){q=b[c];r=[];if(q===d._PUBLISHED_STUDIES_PACKAGE_NAME)r=a;else for(var u=d._studies[q],n=0;n<u.length;n++){var w=u[n];if(g.length)for(var A=0;A<g.length;A++){var v=g[A].re;v.lastIndex=0;v.test(w.description_localized)&&r.push(w)}else r.push(w)}if(r.length){n=$('<div class="insert-study-items"><div>');u=q;switch(q){case d._BASIC_STUDIES_PACKAGE_NAME:u=d._BASIC_STUDIES_PAGE_NAME;break;case "Script$USER":u="My Scripts";break;case "Script$PUB":u=
"Public Library";break;default:q in d._packagesWithTabNames&&(u=d._packagesWithTabNames[u])}e.append('<div class="search-header">'+$.t(u)+"</div>");e.append(n);d.fillStudies(n,r,g)}}e.is(":has(li)")||e.is(":has(.not-found)")||e.append('<p class="not-found">'+$.t("No indicators matched your criteria.")+"</p>");d.layoutChanged.fire()}})}c||this.selectPage("search")};A1.prototype.updateSearchPage=function(){var a=this._tabs.search.find("input").val();this.search(a,!0,!0)};
A1.prototype.updateMarketPages=function(){$.when(this.marketPagesReady).done(function(){var a;this._market.order.forEach(function(b){a=this._market.products[b];pro.hasPackage(a.id)?(b=this._studies[a.id])?this.preparePageStudies(a.$page,b,a):console.warn("Subscripted study package "+a.id+" absent in metaInfo."):this.preparePageOffer(a.$page,a)},this)}.bind(this))};
A1.prototype.preparePageStudies=function(a,b,c,d){var e=$('<div class="insert-study-items"/>');a.empty();a.append(e);c&&a.find(".insert-study-items").css({width:199,"float":"left"}).end().append('<div class="insert-study-offer-container">'+pro.prepareProductPage(c)+"</div>");d||(b=this.sortStudies(b));this.fillStudies(e,b,null)};A1.prototype.preparePageOffer=function(a,b){a.data("html",pro.prepareProductOfferPage(b));a.data("offer",b)};
A1.prototype.addPage=function(a,b){b=$.extend({},b);var c=$.t(a),d=a.toLowerCase(),e=$("<div></div>").data("title",d),g=$('<li title="'+c+'"></li>').text(c).data("title",d),c=$(Mustache.render('<div class="insert-study-header">{{#showTitle}}<div class="header-text">{{#technical}}'+$.t("Technical Analysis")+': {{/technical}}{{#titleHref}}<a href="{{titleHref}}" target="_blank"><u>{{title}}</u></a>{{/titleHref}}{{^titleHref}}{{title}}{{/titleHref}}{{#wikiHref}}<a href="{{wikiHref}}" target="_blank" class="tv-dialogs-label-hint apply-common-tooltip" title="Wiki"></a>{{/wikiHref}}</div>{{/showTitle}}</div>',
{showTitle:b.showTitle,title:c,technical:b.technical,titleHref:b.titleHref,wikiHref:b.wikiHref})).data("title",d).appendTo(this._w_headers).hide();b.beta&&g.append('<span class="beta-sign">Beta</span>');b.packageName&&(this._packagesWithTabNames[b.packageName]=a);this._pages[d]=e;this._tabs[d]=g;this._headers[d]=c;b.technical?(c=this._getOrCreateTechincalTab().find("ul"),c.append(g)):b.market?(c=this._getOrCreateMarketTab().find("ul"),c.append(g)):this._w_market_tabs?g.insertBefore(this._w_market_tabs):
this._w_tabs.append(g);this._w_pages.append(e);e.toggle(d===this._currentPageTitle);return e};A1.prototype._getOrCreateMarketTab=function(){if(this._w_market_tabs)return this._w_market_tabs;var a=TVSettings.getBool(this._MARKET_TAB_IS_OPEN_KEY,!0);this._w_market_tabs=$('<li class="tabs market-tabs"><div class="text open">Marketplace Add-ons</div><ul></ul></li>');this._w_tabs.append(this._w_market_tabs);this.toggleMarketTabs(a);return this._w_market_tabs};
A1.prototype._getOrCreateTechincalTab=function(){if(this._w_technical_tabs)return this._w_technical_tabs;var a=TVSettings.getBool(this._TECHNICAL_TAB_IS_OPEN_KEY,!0);this._w_technical_tabs=$('<li class="tabs technical-tabs"><div class="text open">'+$.t("Technical Analysis")+"</div><ul></ul></li>");this._w_tabs.append(this._w_technical_tabs);this.toggleTechnicalTabs(a);return this._w_technical_tabs};
A1.prototype.hide=function(){this._widget.hide();this.visibilityChanged.fire(!1);TradingView.keyboardBinder.removeListener("StudyMarket");var a=A83.dialogs.indexOf(this._widget);-1!==a&&A83.dialogs.splice(a,1)};
A1.prototype.show=function(){this.init();this._widget.show();this._widget.css("z-index",A83.dialogs.length+110);this._widget.on("mousedownoutside",function(a){$(a.target).parents().andSelf().is(".colorpicker, .charts-popup-list, .tvcolorpicker-popup, .symbol-edit-popup, .tv-dialog-shadowbox, .fancybox-overlay")||(this._widget.unbind("mousedownoutside"),this.hide())}.bind(this));this._widget.on("keyup.hideDialogStudy",function(a){"27"==a.which&&(this._widget.unbind("keyup.hideDialogStudy"),
this.hide())}.bind(this));this._clearInput();this.loadFavorites();this._scroll.scrollTo(0);this.updateLayout(!0);this.visibilityChanged.fire(!0);this.focusAddSymbolInput(this._currentPageTitle);TradingView.keyboardBinder.registerListener("StudyMarket",function(a){if(a.ctrlKey||"47"==a.which)return!1;if(a.which&&13===a.which)return a.target===this._search_input.get(0)&&this._insertStudyByShortDescription(),!0;if(!a.charCode||!a.which||32>=a.which||/^(input|textarea)$/i.test(a.target.tagName))return!1;
a.preventDefault();this._search_input.focus();this._search_input[0].value=String.fromCharCode(a.charCode);return!0}.bind(this));A83.dialogs.push(this._widget)};A1.prototype.isVisible=function(){return!!this._initialized&&this._widget.is(":visible")};
A1.prototype.updateLayout=function(a){var b=this._widget.find(".insert-study-body");b.css("height","");this._widget.css("width","");var c=A83.calcHeight(this._widget.height(),b.height());b.height(c);A83.resizeContentWidth(this._widget.width(),this._widget);b=this._w_headers.outerHeight(!0);c=this._widget.find(".insert-study-main").height();this._w_pages.height(c-b);var b=Math.min($(window).height(),$("body").height()),c=$(window).width(),d=this._widget.outerWidth(),
e=$("body").hasClass("on-cme-widget")?10:20,g=this._widget.height();a&&this._widget.css({left:Math.max(0,c-d)/2,top:Math.max(e,b-g)/2})};A1.prototype.getPage=function(a){a=a.toLowerCase();return this._pages[a]};A1.prototype.focusAddSymbolInput=function(a){a==this._ECONOMY_TAB.toLowerCase()&&this.addSymbolWidget.focus()};
A1.prototype.selectPage=function(a){this.focusAddSymbolInput(a);var b="";"string"===typeof a?b=a.toLowerCase():a instanceof $&&(b=a.data("title"));if(this._currentPageTitle!==b)if(b in this._pages&&b in this._tabs&&("favorites"!=b||this.hasVisibleFavorites())){for(_title in this._pages){a=b===_title;var c=this._pages[_title];this._headers[_title]&&this._headers[_title].toggle(a);c.toggle(a);this._tabs[_title].toggleClass("active",a);a&&(c.data("html")&&(c.html(c.data("html")),
c.data("html",null)),c.trigger("show-page"),a=this._tabs[_title].parents(".tabs"),a.is(".technical-tabs")?this.toggleTechnicalTabs(!0):a.is(".market-tabs")&&this.toggleMarketTabs(!0))}this._currentPageTitle=b;this._w_pages.scrollTop(0);this.layoutChanged.fire();TVSettings.setValue(this._PAGE_KEY,b)}else this.selectPage(this._basicPage)};
A1.prototype.attachHandlers=function(){var a=Modernizr.touch?"touchend":"click";this._w_tabs.on(a,"li",this.selectThisPage.bind(this));this._w_tabs.on(a,"li.market-tabs",this.marketTabsClickHandler.bind(this));this._w_tabs.on(a,"li.technical-tabs",this.technicalTabsClickHandler.bind(this));W77.enabled("items_favoriting")&&(this._w_pages.on(a,".insert-study-items .fav",this.toggleItem.bind(this)),this.favsChanged.subscribe(this,this.updateFavorites));this._w_pages.on(a,
".insert-study-items .source",this.viewSourceCode.bind(this));this._w_pages.on(a,".insert-study-items .open-chart-popup",this.openChartPopup.bind(this));this._w_pages.on(a,".insert-study-items .delete",this.deleteScript.bind(this));this._w_pages.on(a,".insert-study-items li a",function(a){a.stopPropagation()});this._w_pages.on(a,".insert-study-items li",this.insertThisStudy.bind(this));this._widget.on(a,function(a){a.stopPropagation()});this._widget.on(a,".insert-study-subscribe-button",this.subscribePackage.bind(this));
this.layoutChanged.subscribe(this,this.updateLayout);loginStateChange.subscribe(this,this.onLoginStateChange);this._w_title.on(a,"a",this.hide.bind(this));this._widget.on("click",".insert-study-offer-info-screenshots",function(a){a.currentTarget.getAttribute("data-fancybox-inited")||(a.currentTarget.setAttribute("data-fancybox-inited",!0),$(this).find("a").fancybox({type:"image",live:!1,afterShow:function(){$(".fancybox-overlay").on("click",function(a){a.stopPropagation()})}}),setTimeout(function(){$(a.target).click()},
0));a.preventDefault()})};A1.prototype.selectThisPage=function(a){var b=$(a.currentTarget).data("title");b&&"search"!=b&&this.selectPage(b);a.stopPropagation()};A1.prototype.marketTabsClickHandler=function(a){a.stopPropagation();this.toggleMarketTabs()};
A1.prototype.toggleMarketTabs=function(a){var b=this,c=this._w_market_tabs.find("ul"),d=this._w_market_tabs.find(".text"),e=function(){TVSettings.setValue(b._MARKET_TAB_IS_OPEN_KEY,d.hasClass("open"));b.layoutChanged.fire()};"boolean"===typeof a?a?(c.is(":visible")?c.slideDown(50,e):(c.css("display","block"),e()),d.addClass("open")):(c.is(":visible")?c.slideUp(50,e):(c.css("display","none"),e()),d.removeClass("open")):(d.toggleClass("open"),c.slideToggle(50,e))};
A1.prototype.technicalTabsClickHandler=function(a){a.stopPropagation();this.toggleTechnicalTabs()};
A1.prototype.toggleTechnicalTabs=function(a){var b=this,c=this._w_technical_tabs.find("ul"),d=this._w_technical_tabs.find(".text"),e=function(){TVSettings.setValue(b._TECHNICAL_TAB_IS_OPEN_KEY,d.hasClass("open"));b.layoutChanged.fire()};"boolean"===typeof a?a?(c.is(":visible")?c.slideDown(50,e):(c.css("display","block"),e()),d.addClass("open")):(c.is(":visible")?c.slideUp(50,e):(c.css("display","none"),e()),d.removeClass("open")):(d.toggleClass("open"),c.slideToggle(50,e))};
A1.prototype.toggleItem=function(a){a=$(a.target).parent().data("study");this.toggleFavorite(a.id);this.toggleEverywhere(a.id);return!1};A1.prototype.toggleEverywhere=function(a){var b=this.isFavorite(a);this._widget.find(".insert-study-items li").filter(function(b,d){var e=$(d).data("study");return e?StudyMetaInfo.cutFullId(e.id)==a:!1}).find(".fav").toggleClass("in-fav",b).attr("title",this.favTitle(b))};
A1.prototype.toggleFavorite=function(a){this.isFavorite(a)?this.removeFavorite(a):this.addFavorite(a)};A1.prototype.isFavorite=function(a){a=StudyMetaInfo.cutFullId(a);return-1!=this._favs.indexOf(a)};
A1.prototype.addFavorite=function(a){a=StudyMetaInfo.cutFullId(a);if(this.isFavorite(a))return!1;this._favs.push(a);this.saveFavorites();TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify(this._favs));this.favsChanged.fire();window.is_authenticated&&(a=(/^Script\$(PUB;\d+)@tv-scripting/.exec(a)||0)[1])&&A56.info([a]).done(function(a){a&&a[0]&&a[0].imageUrl&&$.ajax({url:"/vote-for-chart/",type:"POST",dataType:"json",data:{image_url:a[0].imageUrl,
vote:1}})});return!0};A1.prototype.removeFavorite=function(a){a=StudyMetaInfo.cutFullId(a);return this.isFavorite(a)?(this._favs.splice(this._favs.indexOf(a),1),this.saveFavorites(),TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify(this._favs)),this.favsChanged.fire(),!0):!1};
A1.prototype.updateFavorites=function(){var a=this.getVisibleFavorites();if(0===a.length)"favorites"===this._currentPageTitle&&this.selectPage(this._basicPage),this._widget.find(".insert-study-items li .fav").removeClass("in-fav"),this._tabs.favorites.hide();else{for(var b=this,c=$.Deferred(),d=[],e=[],g=0;g<a.length;g++){var h=a[g],k=b.getStudyPackageName({id:h});if(k===b._PUBLISHED_STUDIES_PACKAGE_NAME)(h=(/^Script\$([^@]+)/.exec(h)||0)[1])&&e.push(h);else for(var k=b._studies[k]||
[],l=0;l<k.length;l++)if(StudyMetaInfo.cutFullId(k[l].id)==h){d.push(k[l]);break}}!e.length||this._options.minimized?c.resolve(d):A56.info(e).done(function(a){for(var c=0;c<a.length;c++)d.push(b._createPublishedScriptMetaInfo(a[c]))}).always(function(){c.resolve(d)});c.done(function(c){b.preparePageStudies(b._pages.favorites,c);b._widget.find(".insert-study-items li").find(".fav").removeClass("in-fav");a.forEach(b.toggleEverywhere,b)});this._tabs.favorites.show()}};
A1.prototype.hasFavorites=function(){return!!this._favs.length};A1.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length};A1.prototype.getVisibleFavorites=function(){return this.checkExcludePackageStudies(this._favs)};
A1.prototype.viewSourceCode=function(a){a.stopPropagation();this.hide();var b=$(a.target).parent().data("study");this.studyIsPublishedScript(b)?window.scriptEditor.show({scriptIdPart:b.scriptIdPart,scriptSource:b.TVScriptSourceCode}):scriptLib.requestBuiltinAndUserScripts(function(a){for(var d=a.length;d--;)if(a[d].scriptIdPart===b.scriptIdPart){window.scriptEditor.show(a[d]);break}})};
A1.prototype.openChartPopup=function(a){a.stopPropagation();a.preventDefault();a=$(a.target).parent().data("study");TradingView.historyManager.push(new TradingView.HistoryManager.ChartPage(a.imageUrl,a.scriptName||a.description))};
A1.prototype.deleteScript=function(a){a.stopPropagation();a.preventDefault();var b=$(a.target).closest("li"),c=b.data("study");A83.showConfirm("Confirmation","Do you really want to delete script '"+(c.scriptName||c.description)+"'?",function(){scriptLib.requestDeleteScript(c.scriptIdPart,function(){console.log("deleted");b.remove()})})};
A1.prototype.checkExcludePackageStudies=function(a){var b=this;return a.filter(function(a){var d=this.getStudyPackageName({id:a});return d===this._PUBLISHED_STUDIES_PACKAGE_NAME?!0:b._studies[d]&&0<$.grep(b._studies[d],function(b){return a===b.id}).length?d===this._BASIC_STUDIES_PACKAGE_NAME||d===this._CUSTOM_STUDIES_PACKAGE_NAME||d===this._SCRIPTING_PACKAGE_NAME||"Script$EDGR"===d||pro.hasPackage(d)&&d in this._studies:!1},this)};
A1.prototype.sortStudies=function(a){return a.sort(function(a,c){a=a.scriptName||a.description_localized||a.description;c=c.scriptName||c.description_localized||c.description;return a>c?1:a<c?-1:0})};A1.prototype.fillStudies=function(a,b,c){a.empty();b.forEach(function(b){b?li=this.createStudyListItem(b,c):(li=document.createElement("li"),li.className="placeholder");a.append(li)},this)};
A1.prototype.createStudyListItem=function(a,b){var c=document.createElement("li");$.data(c,"study",a);var d=a.description_localized||$.t(a.scriptName||a.description||" ",{context:"study"}),e=this.isFavorite(a.id),g=[];if(b&&d){var h=[];b instanceof RegExp?h.push({re:b,fuzzyHighlight:!1}):$.isArray(b)&&(h=b);for(var k=0;k<h.length;k++){var l=h[k].re;l.lastIndex=0;if(l=l.exec(d))if(h[k].fuzzyHighlight)for(var m=l.index,n=1;n<l.length;n++){var q=l[n].length;n%2&&(g[m]=!0);m+=q}else for(m=
0;m<l[0].length;m++)g[l.index+m]=!0}}d=d.replace(/./g,function(a,b){"<"===a?a="&lt;":"&"===a?a="&amp;":'"'===a&&(a="&quot;");g[b]&&(a='<span class="match">'+a+"</span>");return a});d='<span class="text" title="'+strip_tags(d)+'"">'+d+"</span>";W77.enabled("items_favoriting")&&(d='<span class="fav'+(e?" in-fav":"")+' apply-common-tooltip" title="'+this.favTitle(e)+'"></span>'+d);a.author&&a.author.username&&(d+='<span class="author"><a href="/u/'+a.author.username+'" target="_blank">'+a.author.username+
"</a></span>");a.agreeCount&&(d+='<span class="agrees apply-common-tooltip" title="Total agrees">'+a.agreeCount+" like"+(1<a.agreeCount?"s":"")+"</span>");e=a.TVScriptSourceCode&&(0===a.id.indexOf(this._PUBLISHED_STUDIES_PACKAGE_NAME)||0===a.id.indexOf(this._CUSTOM_STUDIES_PACKAGE_NAME));!TradingView.isMobileView&&e&&(c.className="custom-script",d+='<span class="source apply-common-tooltip" title="Source code">{}</span>');W77.enabled("graying_disabled_tools_enabled")&&D16.studiesAccessController.isToolGrayed(a.description)&&
(c.className+=" grayed");a.imageUrl?d+='<div class="open-chart-popup apply-common-tooltip" title="Read more...">...</div>':e&&window.scriptLib&&(d+='<div class="delete apply-common-tooltip" title="Delete script"><i></i></div>');c.innerHTML=d;return c};A1.prototype.favTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
A1.prototype.insertThisStudy=function(a){a=$(a.target).closest("li");if(!a.hasClass("placeholder")){var b=a.data("study");if(W77.enabled("graying_disabled_tools_enabled")&&D16.studiesAccessController.isToolGrayed(b.description))D17.emit("onGrayedObjectClicked",{type:"study",name:b.description});else return a.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(b),!1}};
A1.prototype.insertStudy=function(a){var b=this.D5.activeChartWidget.value();if(b){var c=b.insertStudyStub(a.description);a=StudyMetaInfo.replaceWithFullStudyMetaInfoAsync(b.model().studiesMetaData(),a);a.done(function(a){b.removeStudyStub(c.id())&&(b.insertStudyOrShowDialog(a),this._is_on_chart=!0)}.bind(this));a.fail(function(a){console.error("Error: "+a);c.setStatus(a)})}};
A1.prototype.subscribePackage=function(a){(a=$(a.target).closest(".insert-study-pages > div").data("offer"))&&TradingView.visitPaymentPage(a.id)};A1.prototype.onLoginStateChange=function(a){a||this.setUser(window.user)};
A1.prototype.getStudyList=function(a){if(!this.studiesReady.isResolved())return[];var b=[],c;for(c in this._studies)if(c==this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(c))this._studies[c].forEach(function(a){b.push(a)}),a&&b.push({separator:!0});a&&b.splice(b.length-1,1);return b};
A1.prototype.getStudyPackageName=function(a){if(a&&a.id){var b=StudyMetaInfo.getPackageName(a.id);if(b!==this._SCRIPTING_PACKAGE_NAME)return b;a=a.id.split("@")[0];if(0!==a.indexOf("Script$"))return b;b=a.indexOf("_");return-1!==b?a.substring(0,b):/^Script\$USER;/.test(a)?"Script$USER":/^Script\$PUB;/.test(a)?"Script$PUB":/^Script\$STD;/.test(a)?this._BASIC_STUDIES_PACKAGE_NAME:a}};
A1.prototype.studyIsUserTVScript=function(a){if(a&&a.id)return"Script$USER"===this.getStudyPackageName(a)};A1.prototype.studyIsPublishedScript=function(a){if(a&&a.id)return"Script$PUB"===this.getStudyPackageName(a)};A1.prototype.selectSearchPage=function(){this.selectPage("search");this._clearInput()};
A1.prototype._insertStudyByShortDescription=function(){for(var a=this._search_value,a=a.trim(),b=this._studies[this._BASIC_STUDIES_PACKAGE_NAME],c=0;c<b.length;c++){var d=b[c];if(d.shortDescription&&d.shortDescription.toUpperCase()===a.toUpperCase()){this.insertStudy(d);break}}};A1.prototype._clearInput=function(){this._search_input.val("");"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()};
A1.prototype._loadNextPubSearchPage=function(){var a=this;if(a._pubSearchDfd)return a._pubSearchDfd;var b=a._pubSearchPage+1;a._pubSearchDfd=A56.suggest(void 0,b);a._pubSearchDfd.done(function(c){a._pubSearchPageMax=c.max_offset;a._pubSearchPage=b;a._pubSearchEntries=a._pubSearchEntries.concat(c.results||[])});a._pubSearchDfd.always(function(){delete a._pubSearchDfd});return a._pubSearchDfd};
A1.prototype._onExternalFavoritesChanged=function(a){for(var b=[],c=0;c<a.length;c++){var d=StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.saveFavorites();this.favsChanged.fire()};TradingView.deleteStudyTemplate=function(a,b){TradingView.getStudyTemplatesList.D20();W77.enabled("charting_library")?ChartingLibraryBackend.removeStudyTemplate(a,b):$.post("/remove-study-template/",{name:a},b)};
A65=function(a){this._options=a||{};this.D5=this._options.D6;this._SAVE_AS_TITLE="Save Study Template As...";this._list=[];this._favoredList=this._$wrapper=null;this._loaded=!1;this._onFirstLoad=new Delegate;this.onFavoriteListResize=new Delegate};A65.prototype.appendMenuButtonTo=function(a){a&&(this._$wrapper=a,this._generateFavoriteList())};
A65.prototype.refreshStudyTemplateList=function(a){var b=this;TradingView.getStudyTemplatesList(function(c){b._list=c||[];"function"===typeof a&&a()})};
A65.prototype._generateFavoriteList=function(){var a=this;this._favoredList=new A14("StudyTemplates",a._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,popupSpacing:this._options.popupSpacing,notShowQuicks:this._options.notShowQuicks,tooltip:"Study Templates",addTooltipClass:"apply-common-tooltip"});this._favoredList.element().appendTo(this._$wrapper);this._favoredList.onSelect().subscribe(a,
function(a){a!=this._SAVE_AS_TITLE&&this.applyStudyTemplate(a)});this._favoredList.onSelect().subscribe(a,function(a){a===this._SAVE_AS_TITLE&&this.showSaveAsDiaolg()});this._favoredList.onResize().subscribe(a.D5,a.D5.updateLayout);this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire);this._favoredList.onOpen().subscribe(a,function(){a.refreshFavoriteDropdownMenu()})};
A65.prototype._listPreparedForFavorite=function(a){var b=this;a=this.plainList("default");var c=this.plainList("custom"),d=[{id:b._SAVE_AS_TITLE,title:b._SAVE_AS_TITLE,addClass:"special",toQuickButtonStyle:{display:"none"}},{separator:!0}],e=function(a,c){return $.map(a,function(a){var d={id:a,title:a,favoriteButton:{icon:{},title:a,addClass:"apply-common-tooltip"}};c&&(d.drop=function(){this.deleteStudyTemplate(a)}.bind(b));return d})};c.length&&(d=d.concat(e(c,!0)).concat([{separator:!0}]));
return d=d.concat(e(a))};A65.prototype.applyStudyTemplate=function(a){function b(b){TradingView.trackEvent("GUI","Load Study Template");c.model().model().restoreStudyTemplate(JSON.parse(b.content),a)}var c=this.D5.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",a);W77.enabled("charting_library")?ChartingLibraryBackend.getStudyTemplateContent(a,b):$.get("/study-template/?templateName="+encodeURIComponent(a),b)};
A65.prototype.showSaveAsDiaolg=function(){var a=this,b=this.D5.activeChartWidget.value(),c=function(c,d){c=clean(c);var h=d[0],h=JSON.stringify(b.model().model().studyTemplate(h)),k={name:c,content:h},h=function(){var b=function(b){b.error||(TVSettings.setValue("defaultStudyTemplate",c),TradingView.getStudyTemplatesList.D20(),a.refreshFavoriteDropdownMenu())};W77.enabled("charting_library")?ChartingLibraryBackend.saveStudyTemplate(k,b):$.post("/save-study-template/",
k,b).error(function(a){console.error(a.responseText)})};-1!=$.inArray(c,a.plainList())?A83.showConfirm("Confirm replace",'Do you realy want to replace "'+c+"\"?<br><small>Note: default study templates won't be removed permanently</small>",h):h()},d=function(b){a.refreshStudyTemplateList(function(){b.find('[name="name"]').inputselectable({list:a.plainList().sort(),closeHandle:b})})};runOrSignIn(function(){TradingView.showChartNameDialog(c,"Save new study template","Template name",255,[{title:"Save Interval",
name:"save_interval",type:"bool",hint:'When selecting this checkbox the study template will set "'+b.model().model().mainSeries().interval()+'" interval on a chart'}],d)},!0)};A65.prototype.refreshFavoriteDropdownMenu=function(){var a=this,b=this._favoredList;b&&a.refreshStudyTemplateList(function(){b.reload(a._listPreparedForFavorite());b._container.hasClass("active")&&(b._container.trigger("click"),b._openMenu.call(b))})};
A65.prototype.deleteStudyTemplate=function(a){var b=this,c="Do you realy want to delete "+(a?'"'+a+'"':"")+" study template?";runOrSignIn(function(){A83.showConfirm("Study Template",c,function(){b._favoredList.removeById(a);TradingView.deleteStudyTemplate(a,function(){setTimeout(function(){b.refreshFavoriteDropdownMenu()},0)})})})};A65.prototype.container=function(){return this._favoredList?this._favoredList._container:null};
A65.prototype.list=function(){return this._list};A65.prototype.plainList=function(a){return"default"===a?$.map(jQuery.grep(this._list,function(a){return!!a.is_default}),function(a){return a.name}):"custom"===a?$.map(jQuery.grep(this._list,function(a){return!a.is_default}),function(a){return a.name}):$.map(this._list,function(a){return a.name})};var Action=function(a){a||(a={});this.checkable=a.checkable||!1;this.checked=a.checked||null;this.enabled=void 0==a.enabled?!0:a.enabled;this.visible=a.visible||!0;this.font=a.font||"Arial";this.icon=a.icon||null;this.iconText=a.iconText||null;this.iconVisibleInMenu=a.iconVisibleMenu||!0;this.deleteButton=a.deleteButton||null;this.shortcut=null;this.setShortCut(a.shortcut);this.statusTip=a.statusTip||null;this.text=a.text||null;this.toolTip=a.toolTip||null;this.htmlclass=a.htmlclass||null;this._callbackContext=
a.callbackContext||this;this._callbacks=new Delegate;this.subActions=a.subActions||[]};Action.prototype.callbacks=function(){return this._callbacks};Action.prototype.callbackContext=function(){return this._callbackContext};Action.prototype.setCallbackContext=function(a){this._callbackContext=a};Action.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length};Action.prototype.setChecked=function(a){this.checked=a};Action.prototype._toggleChecked=function(){this.checked=!this.checked};
Action.prototype.setVisible=function(a){this.visible=a};Action.prototype.setEnabled=function(a){this.enabled=a};Action.prototype.disable=function(){this.setEnabled(!1)};Action.prototype.enable=function(){this.setEnabled(!0)};Action.prototype.setShortCut=function(a){a&&(this.shortcut=a,this._bindShortCut())};
Action.prototype._bindShortCut=function(){var a=this,b="."+this.shortcut;$(document).unbind(b);$(document).bind("keydown"+b,this.shortcut,function(b){b.preventDefault();if(a.enabled)return a.executeCallback(),!1})};Action.prototype.setIconVisible=function(a){this.iconVisibleInMenu=a};Action.prototype.executeCallback=function(a){this._lastEvent=a;this._toggleChecked();this._callbacks.fire(this)};ActionSeparator=function(){Action.call(this);this.subActions=this.font=null;this.htmlclass="action-separator"};
inherit(ActionSeparator,Action);ActionPlaceholder=function(a){Action.call(this);this.deferred=a};inherit(ActionPlaceholder,Action);var ContextMenu={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{"class":"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td",instances:[],createMenu:function(a,b,c){a=new ContextMenu.Menu(a,b,c);this.instances.push(a);return a},createMenuFromActions:function(a,b){var c=new ContextMenu.Items(a,b);this.instances.push(c);return c},hideAll:function(){for(instance in this.instances)this.instances[instance].hide()}};(function(a){function b(a){if(null==a._parentMenu)return null;a=a._parentMenu;a=null==a._parentMenuItem?a:b(a._parentMenuItem);return a}ContextMenu.Item=function(a,b){this.action=a;this._parentMenu=b};ContextMenu.Item.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=HTMLHelper.Element.create(ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};ContextMenu.Item.prototype._createDeleteButton=function(){if(!this.action.deleteButton)return null;
var a=this,b=this.action.deleteButton.action,e=HTMLHelper.Element.create("span",{"class":"context-menu-delete-button"});b&&e.click(function(){b.call(a);return!1});this.jqSubmenu.addClass("delete-spacer");this.jqSubmenu.append(e)};ContextMenu.Item.prototype._createTextTag=function(){var a=this._textTagAttributes();this.jqText=HTMLHelper.Element.create(ContextMenu.TEXT_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqText};ContextMenu.Item.prototype._createRightTag=function(){var a=this._rightTagAttributes();
this.jqRight=HTMLHelper.Element.create(ContextMenu.RIGHT_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqRight};ContextMenu.Item.prototype._createSubmenuTag=function(){var a=this._submenuTagAttributes();this.jqSubmenu=HTMLHelper.Element.create(ContextMenu.SUBMENU_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqSubmenu};ContextMenu.Item.prototype._iconTagAttributes=function(){var a={},b=[];this.action&&(this.action.icon?(b.push("icon"),b.push(this.action.icon.replace(/\./,
"_"))):this.action.checkable?(b.push("icon"),this.action.checked?b.push("checked-icon"):b.push("unchecked-icon")):b.push("spacer"));a["class"]=b.join(" ");return a};ContextMenu.Item.prototype._textTagAttributes=function(){return{"class":"text",html:this.action?this.action.text:""}};ContextMenu.Item.prototype.highlight=function(a){a?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover"));
this.action&&this.action.hasSubActions()&&(a?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))};ContextMenu.Item.prototype._rightTagAttributes=function(){var a={},b=["right"];this.action&&this.action.shortcut&&(b.push("shortcut"),a["class"]=b.join(" "),a.html=this.action.shortcut);return a};ContextMenu.Item.prototype._submenuTagAttributes=function(){var a={};this.action&&this.action.hasSubActions()?a["class"]="submenu-arrow":a["class"]="context-menu spacer";return a};ContextMenu.Item.prototype.render=
function(){this._createRow();this.jqRow.append(this._createIconTag());this.jqRow.append(this._createTextTag());this.jqRow.append(this._createRightTag());this.jqRow.append(this._createSubmenuTag());this._createDeleteButton();this.appendCallback();var a=this;this.jqRow.mouseenter(function(b){a.showSubmenu(b);a.highlight(!0);a._parentMenu&&a._parentMenu._parentMenuItem&&a._parentMenu._parentMenuItem.highlight(!0)});this.jqRow.mouseleave(function(){a.highlight(!1)});return this.jqRow};ContextMenu.Item.prototype._createRow=
function(){var a=this._rowTagAttributes();this.jqRow=HTMLHelper.Element.create(ContextMenu.ITEM_ROW_TAG,a);this.jqRow.addClass("context-menu");var b=this;if(this.action&&!this.action.hasSubActions()){var e=function(a){a.destroy();a._parentMenuItem&&e(a._parentMenuItem._parentMenu)};this.jqRow.click(function(a){e(b._parentMenu)})}};ContextMenu.Item.prototype.showSubmenu=function(a){this._parentMenu.closeOtherSubmenus(this);if(!this.action||this.action.hasSubActions())this._menu||(this._menu=ContextMenu.createMenu(this.action.subActions,
null,this)),this.jqRow.position(),this.jqRow.height(),this.jqRow.width(),this.jqRow.offset(),a.pageX=this._parentMenu.jqMenu.width()-2,a.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(a,this._parentMenu.jqMenu)};ContextMenu.Item.prototype._rowTagAttributes=function(){var a=[];this.action&&(!1===this.action.enabled&&a.push("disabled"),!1===this.action.visible&&a.push("hidden"),this.action.font&&a.push("font_"+this.action.font),this.action.hasSubActions()&&
a.push("has_submenu"),this.action.htmlclass&&a.push(this.action.htmlclass));return{"class":a.join(" ")}};ContextMenu.Item.prototype.appendCallback=function(){var a=this;this.jqRow.click(function(b){a.action.enabled&&a.action.executeCallback(b)})};ContextMenu.Item.prototype.getTopLevelMenu=function(){return b(this)};ContextMenu.ItemPlaceholder=function(a,b){this.action=a;this._parentMenu=b};ContextMenu.ItemPlaceholder.prototype.render=function(a){this._createRow();var b=this;this.action.deferred.then(function(e){for(var g in e){var h=
b._parentMenu.addItem(e[g]);ContextMenu.Menu.renderItem(a,h)}}).always(function(){b.jqRow.hide()});return this.jqRow};ContextMenu.ItemPlaceholder.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=HTMLHelper.Element.create(ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};ContextMenu.ItemPlaceholder.prototype._createRow=function(){var a=this._rowTagAttributes();this.jqRow=HTMLHelper.Element.create(ContextMenu.ITEM_ROW_TAG,a);this.jqRow.append(this._createIconTag());
this.jqRow.addClass("context-menu")};ContextMenu.ItemPlaceholder.prototype._rowTagAttributes=function(){var a=[];this.action&&a.push("spinner");return{"class":a.join(" ")}};ContextMenu.ItemPlaceholder.prototype.highlight=function(a){};ContextMenu.ItemPlaceholder.prototype._iconTagAttributes=function(){var a={},b=[];b.push("spacer");a["class"]=b.join(" ");a.colspan="10";return a}})(jQuery);(function(a){function b(a){var d=[];a=a.m_items;for(var e=0;e<a.length;e++)a[e]._menu&&(d.push(a[e]._menu),d=d.concat(b(a[e]._menu)));return d}ContextMenu.Menu=function(b,d,e){this.options={};this._parentMenuItem=e;a.extend(this.options,d);this.options["class"]&&(this.options.attributes["class"]=this.options["class"]);this.m_wrapper=this.jqMenu=null;this.m_items=[];for(var g in b)this.addItem(b[g])};ContextMenu.Menu.prototype.addItem=function(a){a=a instanceof ActionPlaceholder?new ContextMenu.ItemPlaceholder(a,
this):new ContextMenu.Item(a,this);this.m_items.push(a);return a};ContextMenu.Menu.renderItem=function(a,b){a.append(b.render(a))};ContextMenu.Menu.prototype.closeOtherSubmenus=function(a){for(a=0;a<this.m_items.length;++a)this.m_items[a].highlight(!1),this.m_items[a]._menu&&(this.m_items[a]._menu.destroy(),this.m_items[a]._menu=null)};ContextMenu.Menu.prototype.isShown=function(){return null!==this.jqMenu};ContextMenu.Menu.prototype.render=function(){var b=this.getAttributes();if(this._parentMenuItem){this.jqMenu=
b=a("<table>");b.attr("cellspacing","0");b.attr("cellpadding","0");b.addClass("context-menu");b.addClass("submenu");for(var d in this.m_items){var e=this.m_items[d];ContextMenu.Menu.renderItem(b,e)}}else for(d in this.jqMenu=b=HTMLHelper.Element.create(ContextMenu.MENU_TAG,b),this.m_items)e=this.m_items[d],ContextMenu.Menu.renderItem(b,e);return this.jqMenu};ContextMenu.Menu.prototype.getAttributes=function(){var a={},b=["context-menu"];this.options.attributes&&this.options.attributes["class"]&&b.push(this.options.attributes["class"]);
a.cellspacing=0;a.cellpadding=0;a["class"]=b.join();return a};ContextMenu.Menu.prototype.deploy=function(b,d){this.jqMenu=this.wrapper().append(this.render());d?(a(d).data("submenu",this.jqMenu),a(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",d),this.jqMenu.data("parent-item",b.currentTarget)):a(document.body).append(this.jqMenu);HTMLHelper.unbindContextMenu(this.jqMenu);this._setCoords(b);return this.jqMenu};ContextMenu.Menu.prototype.show=function(a,b){this.deploy(a,b).show()};
ContextMenu.Menu.prototype.hide=function(){this.isShown()&&this.destroy()};ContextMenu.Menu.prototype.destroy=function(){a.each(this.m_items,function(a,b){b._menu&&b._menu.destroy()});this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null);this.m_wrapper.empty()};ContextMenu.Menu.prototype._setCoords=function(b){var d=this.jqMenu;a(this.jqMenu.data("parent-menu"));var e=a(this.jqMenu.data("parent-item")),g=a(window).width(),h=Math.min(a(window).height(),a("body").height()),k=a(document).scrollTop(),
l=a(document).scrollLeft();this.jqMenu.css({maxWidth:g-10,maxHeight:h-10});var m=d.outerWidth(),d=d.outerHeight(),n;e.size()?(n=e.offset(),n={top:n.top-1,left:n.left+e.outerWidth()}):n={top:b.pageY,left:b.pageX};this.jqMenu.offset(n);e={};e.top=Math.min(n.top,h+k-d-5);e.left=Math.min(n.left,g+l-m-5);for(b=b.target;b&&b!==document;b=b.parentNode)if("fixed"===a(b).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(e)};ContextMenu.Menu.prototype._wrapper=function(){var c=this,
d=ContextMenu.WRAPPER_ATTRIBUTES;this._parentMenuItem?this.m_wrapper=HTMLHelper.Element.create(ContextMenu.WRAPPER_TAG,d):(this.m_wrapper=HTMLHelper.createPopup(d,void 0,{mouseDownOutsideEvent:function(d){var g=a();a.each(b(c),function(){g=g.add(this.m_wrapper)});a(d.target).parents().andSelf().is(g)||c.hide()}}),this.m_wrapper.addClass("topmenu"));return this.m_wrapper};ContextMenu.Menu.prototype.wrapper=function(a){return this.m_wrapper||this._wrapper()}})(jQuery);TradingView._defaultChartSymbol="FX:SPX500";
A7=function(a){var b=this;this._startSpinner(a.jqParent);TradingView.drawingState.init();var c=this;TradingView.drawingState.tool.subscribe(function(a){if(c.D0){c.D0.model().setCurrentTool(a);if(TradingView.isMobile.any()){var b=c._paneWidgets[0];if(W47.isLineTool(a)&&"LineToolBrush"!==a){a=.5*c.D0.model().timeScale().width();var d=.5*b._state.defaultPriceScale().height();c.D0.model().setCurrentPosition(a,d,b._state);b._updateTooltip(a,d)}else b._hideTooltip()}c.D0&&
TradingView.isMobile.any()&&c.D0.model().crossHairSource().updateAllViews()}});this._options=a=a||{};var d=a.jqParent,e=a.sizeFunc,g=a.content,h=a.readOnly,k=a.containsData,l=a.onWidget,m=a.onCmeWidget,n=a.timezone,q=a.withDateRanges,r=a.hideSymbolSearch,u=a.defSymbol,w=a.defInterval,A=-1!==$.inArray(a.defStyle,$.map($.grep(Object.keys(TradingView.Series),function(a){return/^STYLE_\w+/.test(a)}),function(a){return TradingView.Series[a]}))?a.defStyle:void 0;this.D5=a.D6||
null;this._withDateRanges=("undefined"===typeof q?!h:!!q)&&W77.enabled("timeframes_toolbar");this._jqParent=void 0!==d?d:$(document.body);this._setContent(g);this._readOnly=h;this._containsData=k;this._defSymbol=u;this._defInterval=w;this._defStyle=A;this._onCmeWidget=(this._onWidget=!!l)?!!m:!1;this._sizeFunc=e||function(){var a=b._jqParent.width(),c=b._jqParent.height(),d=b._jqParent[0];window.self!==window.top&&d.offsetWidth<d.clientWidth&&100>d.getBoundingClientRect().width&&(a=Math.round(100*
d.getBoundingClientRect().width),c=Math.round(100*d.getBoundingClientRect().height));return new TradingView.Rect(0,0,a,c-(b._withDateRanges?22:0))};this._hideSymbolSearch=r;this._jqMainDiv=null;this._rect=this._sizeFunc();this._jqMainTable=null;this._paneWidgets=[];this._paneSeparators=[];this._timeAxisWidget=null;this._frameTime=30;this.D0=null;this._metaInfo={};if(a=this._contentSeriesProperties())u=a.symbol,w=a.interval;!IntervalHelper||IntervalHelper.isMinute(w)||IntervalHelper.isDWM(w)||
(w=void 0);this.D2=new $52("chartproperties");this.D2.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties"));this.D2.mainSeriesProperties.merge({visible:!0,symbol:u?u:TradingView._defaultChartSymbol,shortName:"",timeframe:"",onWidget:this._onWidget,interval:w||"D",style:A,lineStyle:{styleType:factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}});this._containsData&&this.D2.mainSeriesProperties.merge({showCountdown:!1});
n&&TradingView.timezoneIsAvailable(n)&&this.D2.timezone.setValue(n);this.onCmeWidget()&&this.D2.timezone.setValue("exchange");this._tagsChanged=new Delegate;this._modelCreated=new Delegate;this._disconnected=new Delegate;this._reconnectBailout=new Delegate;this._connected=new Delegate;this._redrawPanes=new Delegate;this.chartWidgetInitialized=new Delegate;this._studiesMetaData=new List;this._studiesMigrations=new List;this._chartSession=new ChartSession(D16);this.lhsPriceAxisWidthChanged=
new Delegate;this.rhsPriceAxisWidthChanged=new Delegate;this.createLogo=null};A7.prototype.refreshMarks=function(){this.model().barsMarksSources().map(function(a){a.refreshData()})};A7.prototype.clearMarks=function(){this.model().barsMarksSources().map(function(a){a.clearMarks()})};A7._nextMetadataId=1;A7.FREE_STUDY_LIMIT=10;
A7.prototype._onStudiesMetadata=function(a){var b=this;if("studies_metadata"===a.method){this._studiesMigrations=new List;for(var c=a.params[1].migrations,d=0;c&&d<c.length;d++)this._studiesMigrations.append(c[d]);for(var e=a.params[1].metainfo,d=0;d<e.length;d++)A0._fixInputsMaxValue(null,e[d]);for(d=0;d<e.length;d++)_applyLocalizationToMetadata(e[d]);e=e.concat(this.privateMetaInfo(TradingView.FundamentalsGenerator));e=e.concat(this.privateMetaInfo(TradingView.EotProGenerator));
TradingView.D18("alerts")&&!b.onWidget()&&this._setAlertsStudiesList(e);void 0!=PineAddons?(a=A7._filterAuthorizedMetaInfo(PineAddons.TimWestStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SpyderCrusherStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.AlphaLabStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SRLevelsStudiesMetaInfo),
e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.MTFPanesStudiesMetaInfo),e=e.concat(a),a=PineAddons.ESDMetaInfo,e=e.concat(a)):console.error("PineAddons is undefined. All Pine Script products will be unavailable");(a=this._tvScriptsRequestDfd)||(a=$.Deferred().resolve([]));a.done(function(a){b._onScriptSources(a,e)})}};
A7.prototype._setAlertsStudiesList=function(a){this._alertsStudiesList=$.map($.grep(a,function(a){a=a.plots||[];for(var c=0;c<a.length;c++)if("line"===a[c].type)return!0;return!1}),function(a){return a.id})};
A7.prototype.canCreateAlertForDataSource=function(a){function b(a){a instanceof A58&&(a=a.bars());a instanceof PlotList&&(a=a.state().data);if(!$.isArray(a))return!0;for(var b=a.length-1;0<=b;b--){var c=a[b];if(!$.isArray(c.value))return!0;for(var d=c.value.length-1;0<d;d--){var e=c.value[d];if(null!==e&&void 0!==e&&!isNaN(e))return!0}}return!1}if(this.onWidget()||!W77.enabled("alerts")||!TradingView.D18("alerts"))return!1;var c=a.uniqueId&&
a.uniqueId(),d=a===this.D0.mainSeries(),e=a instanceof TradingView.Study,g=!(a instanceof TradingView.study_Script$TV_DIVIDENDS)&&!(a instanceof TradingView.study_Script$TV_SPLITS)&&!(a instanceof TradingView.study_Script$TV_EARNINGS),h=a.metaInfo?a.metaInfo():null,k=h?h.isTVScript:!1,h=h?-1!=$.inArray(h.fullId,this._alertsStudiesList):!1;return c&&(d||e&&g&&a.data()&&!a.data().isEmpty()&&b(a.data())&&(k||h))};
A7._filterAuthorizedMetaInfo=function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c],e=StudyMetaInfo.parseIdString(d.id).productId;pro.hasPackage(e)&&b.push(d)}return b};A7.prototype.privateMetaInfo=function(a){return a?(new a(StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION)).generateMetaInfo():[]};
A7.prototype._onScriptSources=function(a,b){if(!this.onWidget()){for(var c=null,d=0;d<b.length;++d){var e=b[d];if(e.id.startsWith("Script@tv-scripting-")){c=StudyMetaInfo.parseIdString(e.id).version;break}}if(null!=c)for(this.studyScriptingPkgVers=c,d=0;d<a.length;++d)try{var g=a[d].scriptName;TradingView.logDebug("Loading script: '"+g+"'.");var h=StudyMetaInfo.createMetaInfoStub(a[d],c);b.push(h)}catch(k){console.error("Could not process script (skipped): "+g+" ("+k.message+
")")}else console.error("Could not find tv-scripting package in metadata response")}for(d=0;d<b.length;d++)StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,b[d]);StudyMetaInfo.sortStudiesMetainfo(this._studiesMetaData);this._init();this.chartWidgetInitialized.fire()};
A7.prototype._init=function(){var a=this;!this._containsData&&this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this.D2.timeScale.rightOffset.value());this.initColors();this._makeDefaultGui();this._makeDefaultModel();this._chartSession&&this._chartSession.connected()&&this.D0.restart();this._content&&(this.initColors(),this._updateGui(),this.update());a.D0.mainSeries().marketStatus.subscribe(function(b){a.indicatorImage&&
a._updateDataAndMarketStatus(b,a.D0.mainSeries().status())},{callWithLast:!0});this._resizeHandler=function(){this._rect=this._sizeFunc();TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._adjustSize();this.D0&&this.D0.mainSeries().requestMoreData();this.paint()}.bind(this);this._resizeHandler();this._jqMainDiv.appendTo(this._jqParent);this._spinner&&(this._spinner.stop(),delete this._spinner);$(window).keydown(function(a){27==a.which&&a.preventDefault()});this._containsData||
this._jqMainDiv.mousewheel(function(a,c,d,e){if(!(!TradingView.onWidget()&&parent&&parent!==window&&parent.IS_DEMO_PAGE||!this.model()||this.noScroll||this.model().timeScale().isEmpty())){a=a.pageX-5;c=this._paneWidgets[0].lhsPriceAxisWidget.size.w;var g=this._timeAxisWidget.size.w;c&&(a=Math.max(0,a-c));a=Math.min(a,g);a=W77.enabled("right_bar_stays_on_scroll")?1:2*(a/g-.5);c=Math.min(1,Math.abs(e));0<e?this.model().zoomIn(a,c):0>e&&this.model().zoomOut(a,c);d&&this.model().scrollChart(-80*
d);return!1}}.bind(this));this._initBarsMarksSources();TradingView.D18("esdindicatorfeature")&&this.initESDTimelineWidget();this.setAutoScaleOnSymbolChange();this.readOnly()||this._hideSymbolSearch||A69.registerDialogKeypressHandler(this);this.adaptOnChartLogo(this.D2.paneProperties.background.value())};
A7.prototype._initBarsMarksSources=function(){var a=this;this.withModel(this,function(){this.model().barsMarksSources().map(function(b){b.onNeedRepaint.subscribe(a,a.paint)})})};A7.prototype.initESDTimelineWidget=function(){new TradingView.ESDTimelineWidget(this)};
A7.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().onStartLoading().subscribe(this,function(){(!this.model().mainSeries()instanceof TradingView.Series||!this.model().mainSeries().properties().lockScale.value())&&0==this.model().mainSeries().data().size()&&this.model().mainSeries().priceScale().setAutoScale(!0)})})};
A7.prototype.initColors=function(){this.D2.paneProperties.background.listeners().subscribe(this,A7.prototype.setBackgroundColor);this.D2.paneProperties.gridProperties.color.listeners().subscribe(this,A7.prototype.redrawPanes);this.D2.scalesProperties.lineColor.listeners().subscribe(this,A7.prototype.setScaleLineColor);this.D2.scalesProperties.textColor.listeners().subscribe(this,
A7.prototype.setScaleTextColor)};A7.prototype.paneWidgets=function(){return new List(this._paneWidgets)};A7.prototype.paneByCanvas=function(a){for(var b=0;b<this._paneWidgets.length;b++)if(this._paneWidgets[b].canvas===a||this._paneWidgets[b].top_canvas===a)return this._paneWidgets[b];return null};
A7.prototype.paneByState=function(a){for(var b=0;b<this._paneWidgets.length;b++)if(this._paneWidgets[b]._state===a)return this._paneWidgets[b];return null};A7.prototype.priceAxisByCanvas=function(a){for(var b=0;b<this._paneWidgets.length;b++){var c=this._paneWidgets[b].priceAxisByCanvas(a);if(c)return c}return null};
A7.prototype.timeAxisByCanvas=function(a){return a===this._timeAxisWidget.canvas||a===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null};A7.prototype.properties=function(){return this.D2};A7.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)};A7.prototype.readOnly=function(){return this._readOnly};A7.prototype.onDisconnected=function(){return this._disconnected};
A7.prototype.onReconnectBailout=function(){return this._reconnectBailout};A7.prototype.onConnected=function(){return this._connected};A7.prototype.onRedrawPanes=function(){return this._redrawPanes};A7.prototype.modelCreated=function(){return this._modelCreated};
A7.prototype.setResolution=function(a){if(this.D0){var b=this.D0.mainSeries().properties().interval;this.D0.setScreenChartProperty(b,a,this,$.t("Change Resolution"))}else this.D2.mainSeriesProperties.merge({interval:a})};A7.prototype.getResolution=function(){return this.D0?this.D0.mainSeries().properties().interval.value():this.D2.mainSeriesProperties.interval.value()};
A7.prototype.addSymbol=function(a,b){var c=this.model(),d=c.studiesMetaData(),e=c.mainSeries().properties().style.value()==TradingView.Series.STYLE_CANDLES?TradingView.Series.STYLE_BARS:TradingView.Series.STYLE_CANDLES;props={inputs:{symbol:a},style:e};study=d.find(function(a){return"Overlay@tv-basicstudies"==a.id});c.insertStudy(study,props,b)};A7.prototype.addSymbolDialog=function(){A83.showAddSymbolDialog(this,{overlayOption:!0,callback:this.addSymbol.bind(this)})};
A7.prototype.updateActions=function(){function a(a){function b(){TradingView.showChartNameDialog(function(a){if(a){var b={name:a,content:JSON.stringify(c.D0.model().theme())};$.post("/save-theme/",b).error(function(a){console.error(a.responseText)});TradingView.getThemesList.D20();c.D0._lastLoadedTheme=a}},"Save theme as...","Theme name",128)}d.applyColorTheme.subActions||(d.applyColorTheme.subActions=[]);var e=d.applyColorTheme.subActions;e.splice(0,e.length);
if(is_authenticated){var g=new Action({text:$.t("Save As...")});g.callbacks().subscribe(null,b);e.push(g);e.push(new ActionSeparator)}a&&a.length?$.each(a,function(a,b){function d(a){return function(){A83.showConfirm("Theme","Do you realy want to delete "+(a?'"'+a+'"':"")+" theme?",function(){$.post("/remove-theme/",{name:a}).error(function(a){console.error(a.responseText)});TradingView.getThemesList.D20()});this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}var g=new Action({text:b});
g.callbacks().subscribe(null,function(){$.getJSON("/theme/?themeName="+encodeURIComponent(b),function(a){c.model().model().restoreTheme(JSON.parse(a.content))})});is_authenticated&&(g.deleteButton={action:d(g.text)});e.push(g)}):e.push(new Action({text:"No color themes saved",enabled:!1}))}function b(){var a=studyTemplates.plainList("custom"),b=studyTemplates.plainList("default");d.applyStudyTemplate.subActions||(d.applyStudyTemplate.subActions=[]);var c=d.applyStudyTemplate.subActions;c.splice(0,
c.length);var e=new Action({text:studyTemplates._SAVE_AS_TITLE});e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDiaolg);c.push(e);c.push(new ActionSeparator);a.length||b.length?(a.length&&($.each(a,function(a,b){var d=new Action({text:b});d.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});d.deleteButton={action:function(a){return function(){studyTemplates.deleteStudyTemplate(a);this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}(d.text)};
c.push(d)}),c.push(new ActionSeparator)),$.each(b,function(a,b){var d=new Action({text:b});d.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});c.push(d)})):c.push(new Action({text:"No study templates saved",enabled:!1}))}for(var c=this,d=this.actions(),e=this.D0.D19(),g=!1,h=!1,k=0,l=e.size();k<l;k++){var m=e.item(k);isInherited(m.constructor,W47)&&m.isUserDeletable()&&(g=!0);isInherited(m.constructor,TradingView.Study)&&m.removeByRemoveAllStudies()&&
(h=!0)}this._readOnly||(d.paneRemoveAllStudies&&d.paneRemoveAllStudies.setEnabled(h),d.paneRemoveAllDrawingTools&&d.paneRemoveAllDrawingTools.setEnabled(g));a(TradingView.getThemesList(a));window.studyTemplates&&(b(),studyTemplates.refreshStudyTemplateList(b));var n=[];TradingView.availableTimezones.forEach(function(a){var b=this,c=function(){return a.id===b.model().model().properties().timezone.value()};if(a.separator)indicatorSubActions.push(new ActionSeparator);else{var d=new Action({text:a.title,
checkable:!0,checked:c()});d.callbacks().subscribe(this,function(){var c;c||(c=setTimeout(function(){b.model().setProperty(b.model().model().properties().timezone,a.id,"Changed Time Zone");c=!1},300))});b.model().model().properties().timezone.subscribe(null,function(){d.setChecked(c())});n.push(d)}},this);d.applyTimeZone.subActions=n;d.addToWatchlist.text=$.t("Add {0} To Watchlist").format(this.getSymbol(!0));this.updateActionForIntradayOnly(d.sessionBreaks)};
A7.prototype.actions=function(){this._actions||this._setActions();return this._actions};
A7.prototype._setActions=function(){var a=this;if(!this._readOnly)for(var b=[new Action({text:$.t("Eraser"),callbackContext:"eraser"}),new ActionSeparator,new Action({text:$.t("Trend Line"),callbackContext:"LineToolTrendLine"}),new Action({text:$.t("Horizontal Line"),callbackContext:"LineToolHorzLine"}),new Action({text:$.t("Vertical Line"),callbackContext:"LineToolVertLine"}),new Action({text:$.t("Arrow"),callbackContext:"LineToolArrow"}),new Action({text:$.t("Ray"),callbackContext:"LineToolRay"}),
new Action({text:$.t("Extended"),callbackContext:"LineToolExtended"}),new Action({text:$.t("Parallel Channel"),callbackContext:"LineToolParallelChannel"}),new ActionSeparator,new Action({text:$.t("Pitchfork"),callbackContext:"LineToolPitchfork"}),new Action({text:$.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork"}),new Action({text:$.t("Pitchfan"),callbackContext:"LineToolPitchfan"}),new Action({text:$.t("Gann Square"),callbackContext:"LineToolGannSquare"}),new Action({text:$.t("Gann Fan"),
callbackContext:"LineToolGannFan"}),new Action({text:$.t("Fib Retracement"),callbackContext:"LineToolFibRetracement"}),new Action({text:$.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension"}),new Action({text:$.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan"}),new Action({text:$.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone"}),new Action({text:$.t("Circle Lines"),callbackContext:"LineToolCircleLines"}),new Action({text:$.t("Fib Circles"),
callbackContext:"LineToolFibCircles"}),new Action({text:$.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs"}),new ActionSeparator,new Action({text:$.t("Rectangle"),callbackContext:"LineToolRectangle"}),new Action({text:$.t("Ellipse"),callbackContext:"LineToolEllipse"}),new Action({text:$.t("Triangle"),callbackContext:"LineToolTriangle"}),new Action({text:$.t("Polyline"),callbackContext:"LineToolPolyline"}),new Action({text:$.t("Arc"),callbackContext:"LineToolArc"}),new ActionSeparator,
new Action({text:$.t("Text"),callbackContext:"LineToolText"}),new Action({text:$.t("Anchored Text"),callbackContext:"LineToolTextAbsolute"}),new Action({text:$.t("Balloon"),callbackContext:"LineToolBalloon"}),new Action({text:$.t("Price Label"),callbackContext:"LineToolPriceLabel"}),new ActionSeparator,new Action({text:$.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette"}),new Action({text:$.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor"}),new Action({text:$.t("Elliott Wave Circle"),
callbackContext:"LineToolElliottCircle"}),new Action({text:$.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr"}),new Action({text:$.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr"}),new ActionSeparator,new Action({text:$.t("Brush"),callbackContext:"LineToolBrush"}),new ActionSeparator,new Action({text:$.t("Forecast"),callbackContext:"LineToolPrediction"})],a=this,c=0;c<b.length;c++)b[c].callbacks().subscribe(null,function(a){TradingView.drawingState.tool.setValue(a.callbackContext())});
c=new Action({text:$.t("Reset Chart")});c.callbacks().subscribe(this,this.GUIResetScales);var d=new Action({text:$.t("Undo"),shortcut:"ctrl+z"});d.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Undo");A77.undo()});d.disable();var e=new Action({text:$.t("Redo"),shortcut:"ctrl+y"});e.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Redo");A77.redo()});e.disable();A77.undoStack().onChange().subscribe(this,
this.updateUndoRedo);A77.redoStack().onChange().subscribe(this,this.updateUndoRedo);var g=new Action({text:$.t("Color Theme")}),h=new Action({text:$.t("TimeZone")}),k=new Action({text:$.t("Change Symbol...")});TVSettings.setValue("symboledit.dialog_last_entry","");k.callbacks().subscribe(this,function(){A69.showDialog({callback:this.setSymbol.bind(this)})});var l=new Action({text:$.t("Change Interval...")});l.callbacks().subscribe(this,function(){(new ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show()});
var m=new Action({text:$.t("Add To Watchlist")});m.callbacks().subscribe(this,function(){for(var a=widgetbar.setPage("Watchlist, details and news"),b,c=0;c<a.widgets.length;c++)if("watchlist"==a.widgets[c].type){b=a.widgets[c].widgetObject;break}b&&b.addHighlight(this.getSymbol())});var n=new Action({text:$.t("Study Template")}),q=new Action({shortcut:"ctrl+alt+q",text:$.t("Reset Scale")});q.callbacks().subscribe(null,function(b){a.model().resetTimeScale()});var b=new Action({text:$.t("Insert Drawing Tool"),
subActions:b}),r=new Action({text:$.t("Remove All Indicators")}),u=new Action({text:$.t("Remove All Drawing Tools")}),w=new Action({text:$.t("Insert Indicator...")}),A=new Action({text:$.t("Script Editor...")}),v=new Action({text:$.t("Compare or Add Symbol...")}),B=new Action({text:$.t("Compare...")}),D=new Action({text:$.t("Objects Tree...")}),C=new Action({text:$.t("Properties..."),callback:function(b,c){a.showChartProperties()}}),z=new Action({text:$.t("Scales Properties...")}),F=new Action({text:$.t("Timezone/Sessions Properties...")}),
G=new Action({text:$.t("Lock/Unlock")});G.callbacks().subscribe(this,A7.prototype.toggleLockSelectedObject);var J=new Action({text:$.t("Hide")});J.callbacks().subscribe(this,A7.prototype.hideSelectedObject);var E=new Action({text:$.t("Format...")});E.callbacks().subscribe(this,A7.prototype.editSelectedObject);var I=new Action({text:$.t("Source Code...")});I.callbacks().subscribe(this,this.openSelectedObjectSource);var L=new Action({text:$.t("Show Left Axis"),
checkable:!0});L.binder=new D14(L,this.D2.scalesProperties.showLeftScale,this.model(),"Show Left Scale");var P=new Action({text:$.t("Show Right Axis"),checkable:!0});P.binder=new D14(P,this.D2.scalesProperties.showRightScale,this.model(),"Show Right Scale");this.D2.scalesProperties.showLeftScale.listeners().subscribe(this,A7.prototype._updateScalesActions);this.D2.scalesProperties.showRightScale.listeners().subscribe(this,
A7.prototype._updateScalesActions);var H=new Action({text:$.t("Scale Price Chart Only"),checkable:!0});H.binder=new D14(H,this.D2.scalesProperties.scaleSeriesOnly,this.model(),$.t("Scale Price Chart Only"));var R=this.model().model();this.D2.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){R.recalculateAllPanes();R.D20(new A22(A22.FULL_UPDATE))});var O=new Action({text:$.t("Drawings Toolbar"),
checkable:!0});window.sideToolbar&&(O.binder=new D14(O,window.sideToolbar.visible,this.model(),"Drawings Toolbar"));var t=new Action({text:$.t("Favorite Drawings Toolbar"),checkable:!0});window.sideToolbar&&window.sideToolbar.favoriteDrawingToolbar&&(t.binder=new D14(t,window.sideToolbar.favoriteDrawingToolbar.visibleProperty,this.model(),"Drawings Toolbar"));var S=new Action({text:$.t("Magnet Mode"),checkable:!0});S.binder=new D14(S,TradingView.drawingState.properties().magnet,
this.model(),"Magnet");var N=new Action({text:$.t("Stay In Drawing Mode"),checkable:!0});N.binder=new D14(N,TradingView.drawingState.properties().stayInDrawingMode,this.model(),"Stay In Drawing Mode");var M=new Action({text:$.t("Lock All Drawing Tools"),checkable:!0});M.binder=new D14(M,TradingView.drawingState.lockDrawings(),this.model(),"Lock drawings",function(a){a||this.binder.setValue(!this.binder.value());TradingView.drawingState.lockDrawings().setValue(this.binder.value())}.bind(M));
var U=new Action({text:$.t("Hide All Drawing Tools"),checkable:!0});U.binder=new D14(U,TradingView.drawingState.hideAllDrawings(),this.model(),"Hide All Drawing Tools",function(a){a||this.binder.setValue(!this.binder.value());TradingView.drawingState.hideAllDrawings().setValue(this.binder.value())}.bind(U));var Q=new Action({text:$.t("Hide Marks On Bars"),checkable:!0});Q.binder=new D14(Q,TradingView.drawingState.hideMarksOnBars(),this.model(),"Hide Marks On Bars",function(a){a||
this.binder.setValue(!this.binder.value());TradingView.drawingState.hideMarksOnBars().setValue(this.binder.value())}.bind(Q));var V=new Action({text:$.t("Extended Hours"),checkable:!0});V.binder=new D14(V,this.model().mainSeries().properties().extendedHours,this.model(),"Change Extended Hours");var W=new Action({text:$.t("Show Symbol Last Value"),checkable:!0,checked:!1});W.binder=new D14(W,this.properties().scalesProperties.showSeriesLastValue,this.model(),"Show Symbol Last Value");
var X=new Action({text:$.t("Show Indicator Last Value"),checkable:!0,checked:!1});X.binder=new D14(X,this.properties().scalesProperties.showStudyLastValue,this.model(),"Show Indicator Last Value");X.callbacks().subscribe(this,function(){this._update()});var Z=new Action({text:$.t("Show Countdown"),checkable:!0,checked:!1});Z.binder=new D14(Z,this.model().mainSeries().properties().showCountdown,this.model(),"Show Countdown");this._actions={chartProperties:C,timeScaleReset:q,chartReset:c,
compareOrAdd:v,compare:B,scalesProperties:z,tmzProperties:F,paneObjectTree:D,insertIndicator:w,insertDrawingTool:b,applyColorTheme:g,applyStudyTemplate:n,symbolSearch:k,changeInterval:l,addToWatchlist:m,seriesHide:J,studyHide:J,lineToggleLock:G,lineHide:J,showLeftAxis:L,showRightAxis:P,scaleSeriesOnly:H,drawingToolbarAction:O,favoriteDrawingToolbar:t,magnetAction:S,stayInDrawingModeAction:N,lockDrawingsAction:M,hideAllDrawingsAction:U,hideAllMarks:Q,applyTimeZone:h,extendedHours:V,showCountdown:Z,
showSeriesLastValue:W,showStudyLastValue:X,undo:d,redo:e,viewSourceCode:I};W77.enabled("charting_library")||(this._actions.scriptEditor=A);this.createSessionBreaksActions();this.readOnly()?(this._actions.paneResetAction=new Action({text:$.t("Reset")}),this._actions.paneLoadNewBarsAction=new Action({text:$.t("Load New Bars")}),this._actions.paneMakeItMineAction=new Action({text:this._containsData?$.t("Make It Mine"):$.t("Copy")}),this._actions.paneFullScreenAction=new Action({text:$.t("Full Screen")}),
this._actions.paneResetAction.callbacks().subscribe(this,function(){resetScales()}),this._actions.paneLoadNewBarsAction.callbacks().subscribe(this,function(){requestData()}),this._actions.paneMakeItMineAction.callbacks().subscribe(this,function(a){return a._containsData?function(){submitChartGoToRealTimeForm()}:function(){open("/e/?clone="+a.metaInfo().uid,"_blank")}}(this)),this._actions.paneFullScreenAction.callbacks().subscribe(this,function(a){if(a._containsData)return function(){toggleFullscreen()};
var b=new TradingView.FullscreenWidget;return function(){b.startFullscreen()}}(this))):(c=new Action({text:$.t("Remove"),shortcut:"del"}),c.callbacks().subscribe(this,function(){var a;this.D5&&(a=this.D5.activeChartWidget.value());a||(a=this);a.removeSelectedSource()}),this._actions.insertDrawingTool=b,this._actions.paneRemoveAllStudies=r,this._actions.paneRemoveAllDrawingTools=u,this._actions.seriesRemove=c,this._actions.studyRemove=c,this._actions.lineRemove=
c,this._actions.format=E,this._actions.lockDrawingsAction=M,this._actions.hideAllDrawingsAction=U,this._actions.hideAllMarks=Q,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,A7.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,A7.prototype.removeAllDrawingTools));this._actions.paneObjectTree.callbacks().subscribe(this,A7.prototype.showSourceProperties);this._actions.chartProperties.callbacks().subscribe(this,
A7.prototype.showChartProperties);this._actions.insertIndicator.callbacks().subscribe(this,A7.prototype.showIndicators);this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,A7.prototype.showScriptEditor);this._actions.compareOrAdd.callbacks().subscribe(this,A7.prototype.showCompareOrAdd);this._actions.compare.callbacks().subscribe(this,A7.prototype.showCompareOrAdd);
this._actions.scalesProperties.callbacks().subscribe(this,A7.prototype.showScalesProperties);this._actions.tmzProperties.callbacks().subscribe(this,A7.prototype.showTimezoneProperties);this._updateScalesActions()};A7.prototype.executeActionByName=function(a){var b;a:{for(b in this._actions){var c=this._actions[b];if(c.text.toLowerCase()===a.toLowerCase()){b=c;break a}}b=null}b?b.callbacks().fire():console.warn("Unknown action: "+a)};
A7.prototype._updateScalesActions=function(){if(this._actions){for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility();this._update(new A22(A22.FULL_UPDATE))}};A7.prototype.removeAllStudies=function(){this.D0.removeAllStudies()};A7.prototype.removeAllDrawingTools=function(){this.D0.removeAllDrawingTools()};
A7.prototype.model=function(){return this.D0};A7.prototype.connect=function(){this._handler=function(a){this._onData(a)}.bind(this);this._chartSession.connect(this._handler)};A7.prototype.finishInitWithoutConnect=function(){this._chartSession.disable();this._init();this.chartWidgetInitialized.fire()};
A7.prototype.update=function(){if(this.D0){for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].update();this._timeAxisWidget.update()}};A7.prototype.paint=function(a){a||(a=new A22(A22.FULL_UPDATE));for(var b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].paint(a.invalidateForPane(b),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(a.fullInvalidation());this._redrawPanes.fire()};
A7.prototype._makeDefaultGui=function(){this._makeChartWidget();this._makeLoadingScreen();this._makeMasterTable();this._makeTimeAxisWidget();this._adjustSize();this._updateScalesActions();$("*",this._jqMainTable).selectable(!1);this.update();this.paint()};A7.prototype.widget=function(){return this._jqMainDiv};A7.prototype.restoreState=function(a,b){this._adjustSize();this.D0.restoreState(this._content,b);this._setActions()};
A7.prototype.redrawPanes=function(a){$.each(this._paneWidgets,function(a){this.paint()});this._redrawPanes.fire()};A7.prototype.adaptOnChartLogo=function(a){W77.enabled("adapt_onchart_logo_background")&&($(".onchart-custom-logo .wrapper .inner").css("background-color",generateColor(a,50)),$(".onchart-tv-logo .wrapper .inner").css("background-color",generateColor(a,20)))};
A7.prototype.setBackgroundColor=function(a){this.adaptOnChartLogo(a.value());this.scaleBackgroundColor=a.value();$.each(this._paneWidgets,function(a){this.paint();this.setCursorForTool()});this.update();this.paint()};A7.prototype.setScaleLineColor=function(a){this.scaleLineColor=a.value();$.each(this._paneSeparators,function(){this.update()});this.update();this.paint()};
A7.prototype.setScaleTextColor=function(a){this.scaleTextColor=a.value();this.update();this.paint()};
A7.prototype._update=function(a){if(!a||a.fullInvalidation()===A22.FULL_UPDATE){this.D0&&this._updateGui();this._adjustSize();this._timeAxisWidget.update();for(var b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b]._state=this.D0.panes().item(b),this._paneWidgets[b].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.updateAll()}else if(a.fullInvalidation()===A22.LIGHT_UPDATE){this._timeAxisWidget.update();
this.paint(new A22(A22.UPDATE_CURSOR_ONLY));for(b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(a.fullInvalidation()===A22.UPDATE_CURSOR_ONLY){for(b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}this.paint(a)};
A7.prototype._createVolumeIfNeeded=function(){W77.enabled("create_volume_indicator_by_default")&&this._options.addVolume&&!this._content&&(W77.enabled("charting_library")?this.D0.mainSeries().onCompleted():this.D0.mainSeries().onSymbolResolved()).subscribe(this,function(){var a=this.D0.model().mainSeries().symbolInfo();a&&(a=!a.has_no_volume,!this.containsVolume()&&a?(a=factoryDefaults("chartproperties.volumePaneSize"),this.insertStudy("Volume@tv-basicstudies",
!1,W77.enabled("volume_force_overlay"),void 0,{paneSize:a})):!a&&this.containsVolume()&&(a=this.model().D19().find(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId}),this.D0.model().removeSource(a)))},!W77.enabled("charting_library"))};
A7.prototype._makeDefaultModel=function(){function a(){return makeDefaultChartModel(c._chartSession,function(a){if(!(a instanceof A22))throw Error("Invalid mask");c._invalidateMask?c._invalidateMask.merge(a):c._invalidateMask=a;c._draw_planned||(c._draw_planned=!0,requestAnimationFrame(b))},c.D2,c.readOnly(),d,c._studiesMetaData,c._studiesMigrations,c)}function b(){c._draw_planned=!1;!c._inLoadingState&&c._invalidateMask&&(c._invalidateMask=c._update(c._invalidateMask))}
var c=this;if(this._content&&this._content.timeScale.points)var d={startDate:this._content.timeScale.points.items[0]};if(!this._studiesMetaData)throw Error("Cannot create chart model: studies metainfo is absent");W77.enabled("lean_chart_load")?this.D0=this.D0||a():this.D0=a();this._createVolumeIfNeeded();this._content?(this.restoreState(this._content,this._containsData),W77.enabled("chart_content_overrides_by_deafults")&&(this._defSymbol&&this.setSymbol(this._defSymbol),
this._defInterval&&this.setResolution(this._defInterval),this._defStyle&&this.setSeriesStyle(this.D0.mainSeries(),this._defStyle))):this._setActions();this.D0.onTagsChanged().subscribe(this,A7.prototype.onModelTagsChanged);this._updateGui();this._modelCreated.fire(this.D0);this._tagsChanged.fire();var c=this,e=this.D0.mainSeries();this.D0.lineCancelled().subscribe(this,this.onLineCancelled);e.onSymbolNotPermitted().subscribe(null,function(a){e.properties().symbol.setValue(a)});
this._options.handleSessionErrors&&(e.chartTypeNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showGoProDialog({feature:"kagiRenko"})}),e.intradaySpreadNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showGoProDialog({feature:"intradaySpread"})}),e.customIntervalNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||
A83.showGoProDialog({feature:"customIntervals"})}),e.intradayExchangeNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");if(!c._options.muteSessionErrors){var a=e.symbolInfo().listed_exchange;TVChartApi.prototype.supportedExchangesList().forEach(function(b){b.value==a&&(a=b.name)});A83.showGoProDialog({feature:"intradayExchange",exchangesButton:window.user.is_pro&&"pro_realtime_trial"!=window.user.pro_plan,exchange:a})}}),e.requestingIntradayWhenNotSupported.subscribe(null,
function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showIntervalMismatchDialog()}),e.requestingResolutionWhenNotSupported.subscribe(null,function(a){e.properties().interval.setValue(a)}),c._options.muteSessionErrors||e.onExtendedHoursNotPermitted().subscribe(null,function(){A83.showGoProDialog({feature:"extendedHours"})}));this._readOnly||!TradingView.D18("paper_trading")||this._onWidget||TradingView.Trading.model().registerChartWidget(this)};
A7.prototype._updateGui=function(){this.D0&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())};A7.prototype.setVisibleTimeRange=function(a,b,c){this._chartSession.setVisibleTimeRange(a,b,c)};A7.prototype._dateRangeResolutions=function(){return D16.availableTimeFrames(this.D0.mainSeries().symbolInfo(),this.D0.mainSeries().status())||[]};
A7.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div"));this._jqMainDiv.addClass("chart-widget");TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._withDateRanges&&(W77.enabled("lean_chart_load")?!this._chartControlsBar:1)&&(this._chartControlsBar=$(document.createElement("div")).attr("class","chart-controls-bar").appendTo(this._jqParent),this._seriesControlWidget=new TradingView.SeriesControlWidget({parent:this._chartControlsBar,
D3:this}));if(this._options.controlBar||W77.enabled("control_bar"))this._controlBarNavigation=new A9(this,this._jqMainDiv,!0);this._containsData||this.createIndicatorImage()};A7.prototype._makeLoadingScreen=function(){W77.enabled("lean_chart_load")?this.screen||(this.screen=new A7.LoadingScreen(this,this._jqParent)):this.screen=new A7.LoadingScreen(this,this._jqMainDiv)};
A7.prototype.setSymbol=function(a,b){if(this.D0){var c=this.D0.mainSeries();if(b||!c.symbolSameAsCurrent(a)||W77.enabled("same_data_requery"))this.D0.setSelectedSource(null),this.D0.setScreenChartProperty(c.properties().symbol,a,this,"Change Symbol",W77.enabled("same_data_requery"))}else this.D2.mainSeriesProperties.merge({symbol:a})};
A7.prototype.getSymbol=function(a){var b;return(b=this.D0?this.D0.mainSeries().properties():this.D2.mainSeriesProperties)?a&&b.shortName&&b.shortName.value()?b.shortName.value():b.symbol.value():""};
A7.LoadingScreen=function(a,b){this._cw=a;this.$element=$('<div class="chart-loading-screen">');this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element);this.$element.appendTo(b);this._showed=!1;this._cw.withModel(this,this._connectToModel)};
A7.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().onDataLoaded().subscribe(this,function(a){switch(a.method){case "symbol_error":"permission denied"!==a.params[1]&&this.hide();break;case "series_completed":this.hide()}})};A7.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0;this._showed||this._cw.isDetached||(this._showed=!0,this._show());return $.Deferred().resolve()};
A7.LoadingScreen.prototype._show=function(){var a=this._cw.properties().paneProperties.background.value();this.$shield.css("background",a);this.$element.addClass("fade")};A7.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState;this._showed&&this._hide()};A7.LoadingScreen.prototype._hide=function(){this._showed=!1;this.$element.removeClass("fade")};A7.LoadingScreen.prototype.$canvas=null;
A7.LoadingScreen.prototype.context=null;A7.prototype._makeMasterTable=function(){this._jqMainTable=$(document.createElement("table"));this._jqMainTable.appendTo(this._jqMainDiv);this._jqMainTable.addClass("chart-markup-table");this._jqMainTable.attr("cellpading","0");this._jqMainTable.attr("cellspacing","0")};
A7.prototype._makePaneWidgetsAndSeparators=function(){for(var a=this.D0.panes().toArray(),b=a.length,c=this._paneWidgets.length,d=b;d<c;d++){var e=this._paneWidgets.pop();e.jqRow.remove();e.jqRow.find("*").remove();e.destroy();var g=this._paneSeparators.pop();g&&g.jqRow.remove()}for(d=c;d<b;d++)e=new A53(this,a[d],this._onWidget),this._paneWidgets.push(e),0<d&&(g=new A52(this,d-1,d),this._paneSeparators.push(g),this._timeAxisWidget?
g.jqRow.insertBefore(this._timeAxisWidget.jqRow):g.jqRow.appendTo(this._jqMainTable)),this._timeAxisWidget?e.jqRow.insertBefore(this._timeAxisWidget.jqRow):e.jqRow.appendTo(this._jqMainTable);for(d=0;d<b;d++)c=a[d],e=this._paneWidgets[d],e.state()!==c&&e.setState(c);for(d=b;d--;)this._paneWidgets[d].updateControls()};A7.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new A73(this,this._onWidget),this._timeAxisWidget.jqRow.appendTo(this._jqMainTable))};
A7.prototype.insertStudyOrShowDialog=function(a){if(this.isSymbolicStudy(a)){var b=defaults("study_"+a.id).description;A83.showAddSymbolDialog(this,{title:b,okButtonTitle:$.t("Apply"),callback:function(b,d){var e={inputs:{symbol:b}};TradingView.trackEvent("GUI","Add Study");this.model().insertStudy(a,e,d)}.bind(this)})}else this.hasConfirmInputs(a)?(b=defaults("study_"+a.id).description,A83.showConfirmInputsDialog(this,a,{title:b,okButtonTitle:$.t("Apply"),callback:function(b){TradingView.trackEvent("GUI",
"Add Study");this.model().insertStudy(a,b,!1)}.bind(this)})):TradingView.Study.isPointsBasedStudy(a.id)?(b=TradingView.Study.lineToolNameForPointsBasedStudy(a.id),TradingView.drawingState.tool.setValue(b)):(TradingView.trackEvent("GUI","Add Study"),this.insertStudy(a.id,!0))};A7.prototype.hasConfirmInputs=function(a){a=a.inputs;if(void 0==a)return!1;for(var b=0;b<a.length;++b){var c=a[b];if(void 0!=c.confirm&&c.confirm)return!0}return!1};
A7.prototype.isSymbolicStudy=function(a){switch(a.id){case "Overlay@tv-basicstudies":case "CorrelationCoefficient@tv-basicstudies":return!0;default:return!1}};A7.prototype.isPointsBasedStudy=function(a){return TradingView.Study.isPointsBasedStudy(a.id)};
A7.prototype.insertStudy=function(a,b,c,d,e){a=StudyMetaInfo.findStudyMetaInfo(this._studiesMetaData,a);assert(!a.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!");d=d?{inputs:d}:{};e&&(d=$.extend(d,e));b?this.D0.insertStudy(a,d,c):this.D0.model().insertStudy(a,d,c)};A7.prototype.insertStudyStub=function(a){return this.model().insertStudyStub(a)};A7.prototype.removeStudyStub=function(a){return this.model().removeStudyStub(a)};
A7.prototype._adjustSize=function(){var a=0,b=0,c=0;$.each(this._paneWidgets,function(){a=Math.max(this.lhsPriceAxisWidget.optimalWidth(),a);b=Math.max(this.rhsPriceAxisWidget.optimalWidth(),b);c+=this.stretchFactor()});var d=this._rect,e=d.w-a-b,g=this._paneSeparators.length,h=A52.HEIGHT,k=this._timeAxisWidget.optimalHeight(),l=(d.h-h*g-k)/c;this._jqMainTable.width(d.w);this._jqMainTable.height(d.h);var m=this;$.each(this._paneWidgets,function(c){m.D0&&
(this._state=m.D0.panes().item(c));c=Math.max(Math.round(this.stretchFactor()*l),2);this.setPriceAxisSize(A54.LHS,new A61(a,c));this.setPriceAxisSize(A54.RHS,new A61(b,c));this.setSize(new A61(e,c));m.D0&&this.state()&&m.D0.setPaneHeight(this.state(),c)});this._timeAxisWidget.setSize(new A61(e,k),new A61(a,k),new A61(b,k));this.D0&&this.D0.setWidth(e);this.maxLhsPriceAxisWidth!==
a&&(this.maxLhsPriceAxisWidth=a,this.lhsPriceAxisWidthChanged.fire(a));this.maxRhsPriceAxisWidth!==b&&(this.maxRhsPriceAxisWidth=b,this.rhsPriceAxisWidthChanged.fire(b))};
A7.prototype._onData=function(a){switch(a.method){case "connected":this._onConnection();break;case "disconnected":this._onDisconnect();break;case "reconnect_bailout":this._reconnectBailout.fire();break;case "connection_error":this._onConnectionError(a.params[0]);break;case "critical_error":this._disconnected.fire(!0);break;default:this.D0.onData(a)}};A7.prototype._nextMetadataId=1;
function _applyLocalizationToMetadata(a){a.description_localized=$.t(a.description,{context:"study"});return a}
A7.prototype._onConnection=function(){this._online=!0;this.D0?(this.D0.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):(W77.enabled("charting_library")?this._chartSession.requestMetadata("metadata_"+A7._nextMetadataId,function(a){a=a.params[1];for(var b=0;b<a.length;++b)StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,_applyLocalizationToMetadata(a[b]));this._init();this.chartWidgetInitialized.fire()}.bind(this)):
(this._chartSession.requestMetadata("metadata_"+A7._nextMetadataId,function(a){this._onStudiesMetadata(a)}.bind(this)),"undefined"!==typeof scriptLib&&(this._tvScriptsRequestDfd=scriptLib.requestBuiltinAndUserScripts())),A7._nextMetadataId++)};A7.prototype._onDisconnect=function(){this.D0&&this.D0.disconnect();this._online=!1;this.update();this.paint();this._disconnected.fire()};
A7.prototype.studiesMetaData=function(){return this.D0.studiesMetaData()};A7.prototype._onConnectionError=function(a){this._disconnected.fire()};A7.prototype.getTimeScale=function(){return this._timeAxisWidget};A7.prototype.setSeriesStyle=function(a,b){this.D0.setProperty(a.properties().style,b)};A7.prototype.showSourceProperties=function(a){(new ObjectTreeDialog({D3:this},this.D0)).show()};
A7.prototype.showChartProperties=function(a){return(new EditObjectDialog(this.D0.mainSeries(),this.D0)).show()};A7.prototype.showScriptEditor=function(){window.scriptEditor.show()};A7.prototype.showCompareOrAdd=function(){(new CompareDialog(this.D5)).show()};A7.prototype.showIndicators=function(){studyMarket.isVisible()?studyMarket.hide():studyMarket.show()};
A7.prototype.showScalesProperties=function(a){return(new EditObjectDialog(this.D0.mainSeries(),this.D0)).show({selectScales:!0})};A7.prototype.showTimezoneProperties=function(){return(new EditObjectDialog(this.D0.mainSeries(),this.D0)).show({selectTmz:!0})};
A7.prototype.removeSelectedSource=function(){var a=this.D0.selectedSource();!a||a===this.D0.mainSeries()||a===this.D0.lineBeingCreated()||a instanceof W96||a instanceof TradingView.ESDStudyBase||this.D0.removeSelectedSource()};A7.prototype.hideSelectedObject=function(){var a=this.D0.selectedSource();a&&this.D0.setProperty(a.properties().visible,!1,"Hide "+a.title())};
A7.prototype.toggleLockSelectedObject=function(){var a=this.D0.selectedSource();if(a){var b=a.properties().frozen.value();this.D0.setProperty(a.properties().frozen,!b,(b?"Unlock":"Lock")+" "+a.title())}};A7.prototype.editSelectedObject=function(a){if(a=this.D0.selectedSource())return(new EditObjectDialog(a,this.D0)).show()};
A7.prototype.openSelectedObjectSource=function(a){(a=this.D0.selectedSource())&&a.metaInfo&&(a=a.metaInfo())&&a.TVScriptSourceCode&&a.scriptIdPart&&"undefined"!==typeof scriptEditor&&scriptEditor.show({scriptSource:a.TVScriptSourceCode,scriptIdPart:a.scriptIdPart})};A7.prototype.resetPriceAxisOptimalWidth=function(a){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(a)});this._redrawPanes.fire()};
A7.prototype.adjustPriceAxisWidth=function(a){this.resetPriceAxisOptimalWidth(a);this._adjustSize()};A7.prototype.setPriceAxisVisible=function(a,b){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(a,b)});this._timeAxisWidget.setStubVisible(a,b);this._adjustSize();this._redrawPanes.fire()};A7.prototype.setTimeAxisVisible=function(a){this._timeAxisWidget.setVisible(a);this._adjustSize()};
A7.prototype.isTextTool=function(a){switch(a){case "LineToolBalloon":case "LineToolText":case "LineToolTextAbsolute":case "LineToolCallout":case "LineToolNote":case "LineToolNoteAbsolute":return!0}return!1};A7.prototype.tags=function(){return this.D0?this.D0.calculateDefaultTags():[]};A7.prototype.state=function(a){return this.D0.state(a)};A7.prototype.asyncState=function(a){return this.D0.asyncState(a)};
A7.prototype.metaInfo=function(){var a=this._metaInfo;this.D0&&(a.systemTags=this.D0.calculateDefaultTags());return a};
A7.prototype.image=function(){for(var a=document.createElement("canvas"),b=a.getContext("2d"),c=0,d=this._timeAxisWidget.size.h,e,g=this.properties().scalesProperties.lineColor.value(),h=0;h<this._paneWidgets.length;h++)(e=this._paneWidgets[h])&&e.state()&&(e.state().recalculate(!0),0===h&&(c=e.lhsPriceAxisWidget.size.w+e.size.w+e.rhsPriceAxisWidget.size.w),d+=e.size.h);d+=this._paneWidgets.length-1;this._update();a.width=c+10;a.height=d+25+10;b.fillStyle="#F2F5F8";b.fillRect(0,
0,a.width,a.height);var k=30,h=this.mainSeriesQuotesAndMetainfo();h.ohlc&&(h="{0} O:{1} H:{2} L:{3} C:{4}".format(h.meta.symbol,h.ohlc[0],h.ohlc[1],h.ohlc[2],h.ohlc[3]),b.fillStyle="#000",b.font="12px Verdana, Arial",b.fillText(h,5,20));for(h=0;h<this._paneWidgets.length;h++)e=this._paneWidgets[h],b.drawImage(e.lhsPriceAxisWidget.canvas,5,k),b.drawImage(e.canvas,5+e.lhsPriceAxisWidget.size.w,k),e.statusWidget().renderTo(b,10,k+5),b.drawImage(e.rhsPriceAxisWidget.canvas,5+e.lhsPriceAxisWidget.size.w+
e.size.w,k),k+=e.size.h,h<this._paneWidgets.length-1&&(b.fillStyle=g,b.fillRect(5,k,c,1),k++);b.drawImage(this._timeAxisWidget.lhsCanvas,5,k);b.drawImage(this._timeAxisWidget.canvas,5+e.lhsPriceAxisWidget.size.w,k);b.drawImage(this._timeAxisWidget.rhsCanvas,5+e.lhsPriceAxisWidget.size.w+e.size.w,k);b.lineWidth=1;b.strokeStyle="#000";b.strokeRect(5.5,30.5,c-1,d-1);return a};
A7.prototype.images=function(){TradingView.printing=!0;var a=this.D0.selectedSource();this.D0.setSelectedSource(null);for(var b=[],c=0;c<this._paneWidgets.length;c++){var d=this._paneWidgets[c];d.paint(A22.LIGHT_UPDATE,this._onWidget);var e=d.image(this._onWidget);e.containsMainSeries=this._paneWidgets[c].containsMainSeries();e.studies=[];for(var d=d.state().D19(),g=0;g<d.size();g++){var h=d.item(g);h instanceof TradingView.Study?h.properties().visible.value()&&
h.statusView()&&this.properties().paneProperties.legendProperties.showStudyTitles.value()&&e.studies.push(h.statusView().text()):h instanceof TradingView.Series&&this.properties().paneProperties.legendProperties.showSeriesTitle.value()&&(e.mainSeriesText=h.statusView().text())}b.push(e);c<this._paneWidgets.length-1&&b.push(this._paneSeparators[c].image())}this._timeAxisWidget.paint(A22.LIGHT_UPDATE);c=this._timeAxisWidget.image();TradingView.printing=!1;this.D0.setSelectedSource(a);
this.D0.D20(new A22(A22.LIGHT_UPDATE));a=this.mainSeriesQuotesAndMetainfo();return{panes:b,timeAxis:c,colors:{text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}};
A7.prototype.mainSeriesQuotesAndMetainfo=function(){var a,b,c,d=this.D0.mainSeries();if(d){var e=function(a){return null==a?"":d.formatter().format(a)+""},g=function(a){return null==a?"":a+""};a={resoluton:d.interval(),symbol:d.symbol()};var h=d.symbolInfo();h&&(a.symbol=h.full_name,a.description=h.description,a.exchange=h.exchange);(h=d.bars().last())&&(b=h.value.slice(1,5).map(e));d.quoteData&&(c={change:e(d.quoteData.change),changePercent:g(d.quoteData.change_percent),
last:e(d.quoteData.last_price)})}return{meta:a,ohlc:b,quotes:c}};A7.prototype.onTagsChanged=function(){return this._tagsChanged};A7.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()};A7.prototype.destroy=function(){$(window).unbind("resize",this._resizeHandler);this.D0.model().destroy()};A7.prototype.title=function(){return $.t("Chart Properties")};
A7.prototype.symbolProperty=function(){return this.D0.mainSeries().properties().shortName?this.D0.mainSeries().properties().shortName:this.D0.mainSeries().properties().symbol};
A7.prototype.loadContent=function(a,b){this.screen.show();for(var c=this.D0.model().D19(),d=0;d<c.size();d++){var e=c.item(d);e!=this.D0.mainSeries()&&this.D0.model().removeSource(e,!0)}this._jqMainDiv&&(this._jqMainDiv.remove(),this._jqMainDiv=null);this._timeAxisWidget=null;this._paneWidgets=[];D16.purgeCache();this.D0.mainSeries().purgeSymbolInfo();this._setContent(a);b&&(D6.metaInfo.id.setValue(b.uid),D6.metaInfo.uid.setValue(b.uid),
D6.metaInfo.name.setValue(b.name));for(var g,d=0;d<a.panes.length;++d)for(c=0;c<a.panes[d].sources.length;++c)if(a.panes[d].sources[c].state.symbol){g=a.panes[d].sources[c].state;break}if(!g)throw"An error occured while determining main series ion the chart";this.D2.mainSeriesProperties.merge({visible:!0,symbol:g.symbol,timeframe:"",onWidget:this._onWidget,interval:g.interval||"D",style:g.style});this._init();A45.interval.setValue(g.interval);A77.clearStack();
this._seriesControlWidget&&this._seriesControlWidget.updateUI();this.createLogo&&!W77.enabled("move_logo_to_main_pane")&&this.createLogo(void 0,this._jqMainDiv)};
A7.prototype._setContent=function(a){a&&a.panes.forEach(function(a){a.sources=a.sources.filter(function(a){return a?"MainSeries"==a.type?!0:a.points&&a.points.some(function(a){return null===a.time_t||!isFinite(a.time_t)})?(TradingView.logNormal("Dropped invalid "+a.type+". Reason: non-numeric point time"),!1):!0:!1});var c=function(c){return a.sources&&a.sources.some(function(a){return a.id==c})};a.leftAxisSources&&(a.leftAxisSources=a.leftAxisSources.filter(c));a.rightAxisSources&&
(a.rightAxisSources=a.rightAxisSources.filter(c))});this._content=a};A7.prototype._contentSeriesProperties=function(){if(this._content)for(var a=this._content.panes.length;0<a--;)for(var b=this._content.panes[a].sources,c=b.length;0<c--;)if("MainSeries"===b[c].type)return b[c].state};
A7.prototype.updateUndoRedo=function(){A77.undoStack().isEmpty()?this.actions().undo.setEnabled(!1):this.actions().undo.setEnabled(!0);A77.redoStack().isEmpty()?this.actions().redo.setEnabled(!1):this.actions().redo.setEnabled(!0)};
A7.prototype.createSessionBreaksActions=function(a){var b,c=this,d=function(){b=new Action({text:$.t("Session Breaks"),checkable:!0});b.binder=new D14(b,c.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,c.model(),"Session Breaks");c._actions.sessionBreaks=b};c.model().mainSeries().sessionsStudy()?d():c.model().mainSeries().onSessionsStudyCreated().subscribe(c,function(){d()})};
A7.prototype.updateActionForIntradayOnly=function(a){!a||!a instanceof Action||a.setEnabled(!!this.model().mainSeries().isIntradayInterval())};A7.prototype.withModel=function(a,b){this.model()?b.call(a):this.modelCreated().subscribe(a,b,!0)};A7.prototype.containsVolume=function(){return!!this.model().D19().find(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId})};
A7.prototype.containsStudy=function(a){return this.D0?!!this.D0.D19().find(function(b){if(!(b instanceof TradingView.Study))return!1;b=b.metaInfo();return b.id===a||b.fullId===a}):!1};A7.prototype.containsSessions=function(){return!!this.model().D19().find(function(a){return a instanceof TradingView.Study&&"Sessions"==a.metaInfo().shortId})};A7.prototype.isSmall=function(a){return this.constructor.isSmall(this._jqParent)};
A7.isSmall=function(a){return 550>a.width()||300>a.height()};A7.prototype.onWidget=function(){return this._onWidget};A7.prototype.onCmeWidget=function(){return this._onCmeWidget};A7.prototype.resize=function(){this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()};A7.prototype.chartSession=function(){return this._chartSession};A7.prototype.maxLhsPriceAxisWidth=0;
A7.prototype.maxRhsPriceAxisWidth=0;A7.prototype.GUIResetScales=function(){TradingView.trackEvent("GUI","Reset Scales");this.model()&&(this._containsData?this.model().chartModel().restoreAxisState(this._content):this._controlBarNavigation&&this._controlBarNavigation.resetButtons(),this.model().resetScales())};A7.prototype.onLineCancelled=function(){TradingView.drawingState.resetToCursor()};
A7.prototype.createIndicatorImage=function(){var a=this;this.indicatorImage=$('<span class="chart-status-picture"></span>').appendTo(this._jqMainDiv);a.onWidget()||$('<span class="bats-warning"></span>').appendTo(this.indicatorImage).on("click",function(){TradingView.isProRealtime()||(location.href="/gopro/")}).blueTooltip("<p><b>Warning:</b> This symbol is provided by BATS electronic exchange.</p><p>BATS real-time data is different from the &ldquo;official&rdquo; data and offers approximate volumes with fewer price updates.</p><p>If those differences are important to your analysis then you'll want to use our PRO service which allows you to subscribe to real-time data from the exchanges.</p>",
"bottom","double-width");this.indicatorText=$('<span class="series-status-text"><span class="dot"></span>&nbsp;<span class="text"></span>&nbsp;<span class="market-status"></span></span>').appendTo(this.indicatorImage);a.withModel(null,function(){var b=a.D0.mainSeries();b.onStatusChanged().subscribe(null,a.updateIndicatorImage.bind(a));b.marketStatus.subscribe(a.updateIndicatorImage.bind(a));a.updateIndicatorImage()});a.rhsPriceAxisWidthChanged.subscribe(a,a.updateIndicatorImagePosition);a.updateIndicatorImagePosition()};
A7.prototype.updateIndicatorImage=function(){function a(a,b){return g.hasOwnProperty(a)?g[a]:b}var b=this.indicatorImage;if(this.indicatorImage){var c=this.D0;if(c){var c=c.mainSeries(),d=c.status(),e=this._statusDetails(),g=null,g=e.hasOwnProperty(d)?e[d]:e.defaults,d=a("showBatsWarn",!0),e=(e=c.symbolInfo())&&e.full_name,d=!!(d&&e&&A68.hasBatsSymbols(e));b.find(".bats-warning").toggleClass("warn-bats",d);b.attr("title",a("title",""));this._updateDataAndMarketStatus(c.marketStatus.value(),
c.status())}}};
A7.prototype._statusDetails=function(){this.__statusDetails||(this.__statusDetails={},this.__statusDetails[TradingView.Series.STATUS_SNAPSHOT]={className:"snapshot",text:$.t(""),showBatsWarn:!1,priority:1},this.__statusDetails[TradingView.Series.STATUS_LOADING]=this.__statusDetails[TradingView.Series.STATUS_RESOLVING]={className:"loading",text:$.t("loading data"),priority:1},this.__statusDetails[TradingView.Series.STATUS_INVALID_SYMBOL]={className:"invalid",text:$.t("invalid symbol"),showBatsWarn:!1,
priority:1},this.__statusDetails[TradingView.Series.STATUS_OFFLINE]={className:"connecting",text:$.t("retrying"),priority:1},this.__statusDetails[TradingView.Series.STATUS_EOD]=this.__statusDetails[TradingView.Series.STATUS_PULSE]={className:"eod",text:$.t("eod data"),priority:1},this.__statusDetails[TradingView.Series.STATUS_DELAYED]={className:"delayed",title:$.t("Quotes are delayed by 10 min and updated every 30 seconds"),text:$.t("eod delayed"),priority:1},this.__statusDetails[TradingView.Series.STATUS_DELAYED_STREAMING]=
{className:"delayed-streaming",text:$.t("delayed"),priority:1},this.__statusDetails[TradingView.Series.STATUS_READY]=this.__statusDetails.defaults={className:"realtime",text:$.t("realtime"),priority:-1},this.__statusDetails.pre_market={text:$.t("pre-market"),className:"pre-market",priority:0},this.__statusDetails.post_market={text:$.t("post-market"),className:"post-market",priority:0},this.__statusDetails.out_of_session={text:$.t("closed"),className:"out-of-session",priority:0},this.__statusDetails.market=
this.__statusDetails.defaults);return this.__statusDetails};A7.prototype._updateDataAndMarketStatus=function(a,b){var c=this._resultingStatusRecord(a,b);this.indicatorText.removeClass().addClass("series-status-text "+c.className);this.indicatorText.find(".text").html(c.text)};
A7.prototype._resultingStatusRecord=function(a,b){if(a){var c=this._statusDetails()[a],d=this._statusDetails()[b];d||(d=this._statusDetails().defaults);return d.priority>c.priority?d:c}return this._statusDetails()[b]};A7.prototype.updateIndicatorImagePosition=function(){var a=this.indicatorImage;this.indicatorImage&&a.css("marginRight",this.maxRhsPriceAxisWidth)};
A7.prototype._startSpinner=function(a){"function"===typeof Spinner&&!this._spinner&&(a=$(a).get(0))&&(this._spinner=(new Spinner({lines:15,length:0,width:6,radius:20,corners:1,rotate:0,direction:1,color:"#333",speed:.75,trail:74,shadow:!1,hwaccel:!1,className:"spinner",top:"50%",left:"50%"})).spin(a))};A7.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned};A8=function(a){function b(){M&&M(N);var a=C||{};C={width:N.width(),height:N.height()};var b=N[0];if(window.self!==window.top&&b.offsetWidth<b.clientWidth&&100>b.getBoundingClientRect().width){var d=Math.round(100*b.getBoundingClientRect().width),b=Math.round(100*b.getBoundingClientRect().height);C={width:d,height:b}}d=!1;a.height===C.height&&a.width===C.width&&z||(d=!0);if(d)if(H)c(D);else for(a=0;a<z.count;a++)c(a)}function c(a){var b=B[a];if(b){var c=H?A8.LayoutTemplates.s.sizer(0,
C,u,w):z.sizer(a,C,u,w);B[a].wrap.css({width:c.width||0,height:c.height||0,top:c.top||0,left:c.left||0});b.metrics&&b.metrics.width===c.width&&b.metrics.height===c.height||(b.metrics=c,b.D3&&b.D3.resize())}}function d(a){a=$.extend({D6:r},a||{});var b,d=$(document.createElement("div")).addClass("chart-container").appendTo(N).css("position","absolute");d.on("mousedown touchstart",function(){A.setValue(b)});var e=B.length,k={wrap:d};B.push(k);c(e);a.jqParent=d;k.D3=
b=new A7(a);r.firstWidgetInitialized||b.chartWidgetInitialized.subscribe(null,function(){try{JsBridge.sendEvent("chart_widget_initialized")}catch(a){}r.firstWidgetInitialized=!0},!0);a.containsData?b.finishInitWithoutConnect():b.connect();g();h();return b}function e(a,b){F=a;H=b;R.setValue(H);z=A8.LayoutTemplates[a];var e=z.count;C={width:N.width(),height:N.height()};for(var h=0;h<e||h<B.length;h++)(b?D===h:h<e)?(B[h]?(N.append(B[h].wrap),B[h].D3.isDetached=
!1):d($.extend({},O,G.shift()||(A.value()?{content:A.value().state()}:null)||{})),B[h].wrap.toggleClass("multiple",1<e),c(h)):B[h]&&(B[h].D3.isDetached=!0,B[h].wrap.detach());g()}function g(){var a=Math.min(z.count,B.length)-1;if(0>a)A.deleteValue();else{var b=D;0>b&&(b=0);b>a&&(b=a);A.setValue(B[b].D3)}}function h(){for(var a=B.length;a--;){var b=a===D;B[a].wrap.toggleClass("active",b).toggleClass("inactive",!b)}}function k(a){var b=a.mainSeries().properties();b.style.subscribe(null,
l);l(b.style);a.model().onSelectedSourceChanged().subscribe(null,m);m(a.selectedSource())}function l(a){U.setValue(a.value())}function m(a){Q.setValue(a)}function n(a){for(var b=!1,c=0;c<B.length;c++){var d=B[c].D3;if(d.model().mainSeries().properties().symbol.value()!==a||W77.enabled("same_data_requery"))b||(A77.beginUndoMacro("Change Symbol"),b=!0),d.setSymbol(a)}b&&A77.endUndoMacro()}function q(a){if("s"===a||window.user&&user.is_pro||O.containsData||
v)return a;A83.showGoProDialog({feature:"multipleCharts"});return"s"}var r=this,u=2,w=0,A=new WatchedValue,v=!1,B=[],D=0,C=null,z=null,F="s",G=[],J=new WatchedValue(!1),E=new WatchedValue(!1),I=new WatchedValue(TVSettings.getBool("chart.syncCrosshair",!0)),L=I.value();I.subscribe(function(a){L=a=!!a;TVSettings.setValue("chart.syncCrosshair",a)});var P=new WatchedValue(F),H=!1,R=new WatchedValue(H);a=a||{};"padding"in a&&(u=a.padding);"edge"in a&&(w=a.edge);var O=a.widgetOptions||{};O.readOnly&&
(v=!0);var t=a.metaInfo||{},S={id:new WatchedValue(t.id),name:new WatchedValue(t.name),description:new WatchedValue(t.description),username:new WatchedValue(t.username),uid:new WatchedValue(t.uid)},N=$(a.jqParent).eq(0),M=a.onResize;this.updateLayout=b;var U=new WatchedValue,Q=new WatchedValue;U.subscribe(function(a){var b=A.value();if(b&&(b=b.model())){var c=b.mainSeries().properties().style;c.value()!==a&&b.setChartStyleProperty(c,a,"Change Series Style")}});var V=null;A.subscribe(function(a){if(a){for(var b,
c=B.length;c--;)if(B[c].D3===a){b=c;break}if(!isFinite(b))throw Error("Cannot make detached ChartWidget active");D!==b&&(D=b,h());V!==a&&(V&&(V.modelCreated().unsubscribe(null,k),b=V.model())&&(b.mainSeries().properties().style.unsubscribe(null,l),b.model().onSelectedSourceChanged().unsubscribe(null,m),V=null),a&&((b=a.model())?k(b):a.modelCreated().subscribe(null,k),V=a))}},{callWithLast:!0});$.extend(this,{createChartWidget:d,getAll:function(){return B.map(function(a){return a.D3})},
destroy:function(){return B.forEach(function(a){a.D3.destroy()})},layout:P,maximizeCurrentChart:R,activeChartWidget:A,activeChartStyle:U,selectedSource:Q.readonly(),metaInfo:S,state:function(a){for(var b=[],c=A8.LayoutTemplates[F].count,d=0;d<c;d++)b.push(B[d].D3.state(a));a={layout:F,charts:b};J.value()&&(a.symbolLock=1);E.value()&&(a.intervalLock=1);return a},asyncState:function(a){for(var b=$.Deferred(),c=[],d=A8.LayoutTemplates[F].count,
e=0;e<d;e++)c.push(B[e].D3.asyncState(a));$.when.apply($,c).then(function(){for(var a={charts:[]},c=0;c<arguments.length;c++)a.charts.push(arguments[c]);b.resolve(a)});return b},readOnly:function(){return v},lock:{symbol:J,setSymbolLockWithUndo:function(a){if(a!==J.value()){A77.beginUndoMacro("Symbol Lock");if(a)for(var b=A.value(),c=b.getSymbol(),d=0;d<B.length;d++){var e=B[d].D3;e!==b&&e.getSymbol()!==c&&e.setSymbol(c)}A77.setWatchedValue(J,
a,"Symbol Lock");A77.endUndoMacro()}},interval:E,setIntervalLockWithUndo:function(a){if(a!==E.value()){A77.beginUndoMacro("Interval Lock");if(a)for(var b=A.value(),c=b.getResolution(),d=0;d<B.length;d++){var e=B[d].D3;e!==b&&e.getResolution()!==c&&e.setResolution(c)}A77.setWatchedValue(E,a,"Resolution Lock");A77.endUndoMacro()}},crosshair:I},setSymbol:function(a){J.value()?n(a):A.value().setSymbol(a)},setResolution:function(a){if(E.value()){for(var b=
!1,c=0;c<B.length;c++){var d=B[c].D3;d.model().mainSeries().properties().interval.value()!==a&&(b||(A77.beginUndoMacro("Change Resolution"),b=!0),d.setResolution(a))}b&&A77.endUndoMacro()}else A.value().setResolution(a)},updateLayout:b,images:function(a){if(a&&a.onlyActiveChart||H)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[A.value().images()]};a=[];for(var b=z.count,c=0;c<B.length&&c<b;c++)a.push(B[c].D3.images());return{layout:F,
hidpiRatio:window.hidpiCanvasRatio||1,charts:a}},syncCrosshair:function(a,b){if(L&&!H)for(var c=z.count,d=0;d<B.length&&d<c;d++){var e=B[d].D3;e!==b&&(e=e.model())&&e.model().setExternalPosition(a)}},setSymbolAll:n,clearChartMetaInfo:function(){S.id.setValue(void 0);S.uid.setValue(void 0);S.name.setValue(void 0)}});if(a=a.content){a.charts||(a={layout:"s",charts:[a]});F=q(a.layout||"s");for(I=0;I<a.charts.length;I++)G.push({content:a.charts[I]});a.symbolLock&&J.setValue(!0);a.intervalLock&&
E.setValue(!0);a=null}P.setValue(F);e(F,H);G.splice(0,G.length);P.subscribe(function(a){e(a,!1)});P.hook=function(a){return a===this.value()?a:q(a)};v&&(P.writeLock=!0);R.subscribe(function(a){a!==H&&e(F,a)});$(window).on("resize",b)};
A8.LayoutTemplates={s:{title:"1 chart",count:1,sizer:function(a,b,c,d){return{width:b.width-d-d,height:b.height-d-d,top:d,left:d}}},"2h":{title:"2-up Horizontal",count:2,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=e-c>>1;switch(a){case 0:return{width:g,height:b,top:d,left:d};case 1:return a=c+g,{width:e-a,height:b,top:d,left:d+a}}}},"2v":{title:"2-up Vertical",count:2,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=b-c>>1;switch(a){case 0:return{width:e,
height:g,top:d,left:d};case 1:return a=c+g,{width:e,height:b-a,top:a+d,left:d}}}},"3h":{title:"3-up Horizontal",count:3,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=(e-c-c)/3|0;switch(a){case 0:return{width:g,height:b,top:d,left:d};case 1:return{width:g,height:b,top:d,left:c+g+d};case 2:return a=2*(c+g),{width:e-a,height:b,top:d,left:a+d}}}},"3v":{title:"3-up Vertical",count:3,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=(b-c-c)/3|0;switch(a){case 0:return{width:e,
height:g,top:d,left:d};case 1:return{width:e,height:g,top:c+g+d,left:d};case 2:return a=2*(c+g),{width:e,height:b-a,top:a+d,left:d}}}},"3s":{title:"3-up Stacked",count:3,sizer:function(a,b,c,d){var e=b.height-d-d,g=e-c>>1;b=b.width-d-d-c>>1;switch(a){case 0:return{width:b,height:e,left:d,top:d};case 1:return{width:b,height:g,left:b+c+d,top:d};case 2:return a=c+g,{width:b,height:e-a,left:b+c+d,top:a+d}}}},4:{title:"4-up",count:4,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=b-c>>1,
h=e-c>>1;switch(a){case 0:return{width:h,height:g,left:d,top:d};case 1:return a=g+c,{width:h,height:b-a,left:d,top:a+d};case 2:return c=h+c,{width:e-c,height:g,left:c+d,top:d};case 3:return a=g+c,c=h+c,{width:e-c,height:b-a,left:c+d,top:a+d}}}},6:{title:"6-up",count:6,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=b-c>>1,h=(e-c-c)/3|0;switch(a){case 0:return{width:h,height:g,left:d,top:d};case 1:return a=g+c,{width:h,height:b-a,left:d,top:a+d};case 2:return{width:h,height:g,left:h+
c+d,top:d};case 3:return a=g+c,{width:h,height:b-a,left:h+c+d,top:a+d};case 4:return h=h+c+h+c,{width:e-h,height:g,left:h+d,top:d};case 5:return h=h+c+h+c,a=g+c,{width:e-h,height:b-a,left:h+d,top:a+d}}}},8:{title:"8-up",count:8,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var g=b-c>>1,h=e-3*c>>2;switch(a){case 0:return{width:h,height:g,left:d,top:d};case 1:return a=g+c,{width:h,height:b-a,left:d,top:a+d};case 2:return{width:h,height:g,left:h+c+d,top:d};case 3:return a=g+c,{width:h,height:b-
a,left:h+c+d,top:a+d};case 4:return{width:h,height:g,left:h+c+h+c+d,top:d};case 5:return a=g+c,{width:h,height:b-a,left:h+c+h+c+d,top:a+d};case 6:return h=3*(h+c),{width:e-h,height:g,left:h+d,top:d};case 7:return h=3*(h+c),a=g+c,{width:e-h,height:b-a,left:h+d,top:a+d}}}}};function CompareWidget(a){this.D5=a;this.predefines={"":{"S&P 500 Trust":"AMEX:SPY","Nasdaq Composite":"INDEX:NASX","Diamonds Trust":"AMEX:DIA","Gold Trust":"AMEX:GLD","Euro Currency Trust":"AMEX:FXE","Nasdaq 100":"INDEX:IUXX","Nasdaq Financial 100":"INDEX:IXF"}};this.symbolAlias={"BATS:SPY":"AMEX:SPY","BATS:DIA":"AMEX:DIA","BATS:GLD":"AMEX:GLD","BATS:FXE":"AMEX:FXE"}}
CompareWidget.prototype.addCompareSymbol=function(a,b,c){if(b=this.D5.activeChartWidget.value())if(b=b.model()){for(var d=b.mainSeries().interval(),e=b.studiesMetaData(),g,h=0;h<e.size();h++)"Compare@tv-basicstudies"===e.item(h).id&&(g=e.item(h));a={exchange:c,inputs:{symbol:a,resolution:d}};TradingView.trackEvent("GUI","Add Compare");return b.insertStudy(g,a)}};
CompareWidget.prototype.removeCompareSymbol=function(a){var b=this.D5.activeChartWidget.value();if(b&&(b=b.model()))for(var c=b.D19(),d=0;d<c.size();d++){var e=c.item(d);if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var g=e.properties().inputs.symbol.value();(g===a||this.symbolAlias[g]&&this.symbolAlias[g]===a)&&b.removeSource(e)}}};
CompareWidget.prototype._createPredefinesList_normal=function(){var a=this,b,c;for(c in this.predefines){predefine=$('<div class="predefine-section">').appendTo(this._widget);for(var d in this.predefines[c])line=$('<div class="predefine-line"></div>').appendTo(predefine),checkbox=$('<input type="checkbox" id="predefine-checkbox-'+this.symbolToId(this.predefines[c][d])+'"/>').appendTo(line),checkbox.change({symbol:this.predefines[c][d]},function(c){$(this).is(":checked")?(b=a.addCompareSymbol(c.data.symbol))||
$(this).attr("checked",!1):a.removeCompareSymbol(c.data.symbol)}),$('<label for="predefine-checkbox-'+this.symbolToId(this.predefines[c][d])+'">'+d+"</label>").appendTo(line)}$('<div class="clear"></div>').appendTo(this._widget)};
CompareWidget.prototype.init=function(){var a=this;this._widget=$('<div class="compare-widget"></div>');var b=$('<div class="symbol-edit-widget">');this.input=$('<input type="text" class="symbol-edit with-plus single" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">').appendTo(b);var c=$('<a class="symbol-edit-plus" title="'+$.t("Company Comparison")+'"><span></span></a>').appendTo(b),d=A69.bindToInput(this.input,{callback:function(b){a.addCompareSymbol(b)},keepFocus:!0,
clearAfterAccept:!0});c.click(function(){d.acceptTypeIn()});b.appendTo(this._widget);W77.enabled("charting_library")||this._createPredefinesList_normal()};
CompareWidget.prototype.show=function(){var a=this.D5.activeChartWidget.value();if(a&&(a=a.model()))for(p in a=a.D19(),this.init(),this._widget.find('input[id^="predefine-checkbox"]').attr("checked",!1),this.predefines)for(i in this.predefines[p])for(var b=this._widget.find("#predefine-checkbox-"+this.symbolToId(this.predefines[p][i])),c=0;c<a.size();c++){var d=a.item(c);if(d._metaInfo&&"Compare@tv-basicstudies"===d._metaInfo.id){var e=this.predefines[p][i],d=d.properties().inputs.symbol.value();
(d===e||this.symbolAlias[d]&&this.symbolAlias[d]===e)&&b.attr("checked",!0)}}};CompareWidget.prototype.symbolToId=function(a){return a.replace(/[^a-z0-9]/gi,"_")};CompareWidget.prototype.focus=function(){Modernizr.touch||this.input.focus()};function CompareDialog(a){this.D6=a}CompareDialog.prototype.tabChanged=function(a){0===a?this.compareTab.focus():this.addSymbolTab.focus()};
CompareDialog.prototype.show=function(){TradingView.trackEvent("GUI","Compare Add");var a=A83.createDialog("Compare Add",{hideTitle:!0,dragHandle:".properties-tabs"}),b=a.find(".tv-dialog-content");a.css("min-width",0);b.css("min-width",0);var c=$('<div class="properties-tabs"></div>').appendTo(b);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Compare")).appendTo(c);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Add Symbol")).appendTo(c);var b=$("<div>").appendTo(b),
d=$('<div class="main-tree-page compare active">').appendTo(b),e=$('<div class="main-tree-page compare">').appendTo(b);this.compareTab=new CompareWidget(this.D6);this.addSymbolTab=new AddSymbolWidget(this.D6);this.compareTab.show();d.append(this.compareTab._widget);this.addSymbolTab.show();e.append(this.addSymbolTab._widget);this.tabs=new A71(c,b,{saveTab:"CompareAddDialog.tab"});this.tabs.tabChanged.subscribe(this,this.tabChanged);A83.applyHandlers(a);
A83.positionDialog(a,this.position);return a};function AddSymbolWidget(a){this.D5=a;this.init()}
AddSymbolWidget.prototype.init=function(){var a=this;this._widget=$('<div class="addsymbol-widget"></div>');var b=$('<div class="symbol-edit-widget">'),c=$('<input type="text" class="symbol-edit with-plus single" placeholder="'+$.t("Symbol")+'" autocomplete="off">').appendTo(b);this._input=c;var d=$('<a class="symbol-edit-plus"><span></span></a>').appendTo(b),e=A69.bindToInput(c,{callback:function(b){var c=a.D5.activeChartWidget.value();c&&c.addSymbol(b,a._checkbox.is(":checked"))},
keepFocus:!0,clearAfterAccept:!0});d.on("click",function(){e.acceptTypeIn()});b.appendTo(this._widget);b=$('<div class="opts-line">').appendTo(this._widget);c="addsymbol-widget-overlay-"+TradingView.guid();this._checkbox=$('<input type="checkbox" id="'+c+'">').appendTo(b);this._checkbox.on("click",function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",$(this).is(":checked"))});$('<label for="'+c+'">'+$.t("Overlay the main chart")+"</label>").appendTo(b)};
AddSymbolWidget.prototype.show=function(){this.focus();this._checkbox.attr("checked",TVSettings.getBool("showAddSymbolDialog.checkboxState",!0))};AddSymbolWidget.prototype.focus=function(){Modernizr.touch||this._input.focus()};TradingView.SYMBOL_SEARCH_MAX_LENGTH=100;A4=function(){};A4.prototype._createBackButton=function(a){var b=a.createGroup().appendTo(a._$left);a._backButton=$('<div class="mobile-back-button"><i></i></div>').click(function(){1<window.history.length&&window.history.back();window.location.pathname="/"}).appendTo(b)};
A4.prototype._createBarsGroup=function(a){var b=this.createGroup({single:!0});a._style_list.element().appendTo(b);return b};
A4.prototype._createPropertiesGroup=function(a,b){var c=this.createGroup({single:!0});if(!this._onWidget){var d=$("<span>").addClass("button iconed properties apply-common-tooltip").append($("<i>")).appendTo(c);d.on(a,function(a){a.pageX=d.offset().left;a.pageY=d.offset().top+d.height()+15;a=b.activeChartWidget.value().showChartProperties({_lastEvent:a});d.addClass("active");a.on("destroy",function(){d.removeClass("active")})});d.attr("title",$.t("Chart Properties"))}return c};
A4.prototype._createCompareGroup=function(a,b,c){a=this.createGroup({single:!0});var d=$('<a class="button iconed toggle-caption compare apply-common-tooltip">').append($("<i>")).append($('<span class="caption">Compare</span>')).appendTo(a);this._compareButton=d;this._compareButton.on(c,function(a){a.preventDefault();a=(new CompareDialog(b)).show();d.addClass("active");a.on("destroy",function(){d.removeClass("active")})});this._compareButton.attr("title",$.t("Compare or Add Symbol"));
return a};
A4.prototype._createIndicatorsGroup=function(a,b){var c=this.createGroup({single:!0});this._indicatorsButton=$('<a class="button iconed toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append($("<i>")).append($('<span class="caption">Indicators</span>')).appendTo(c);this._indicatorsButton.attr("title",$.t("Indicators, Fundamentals, Economy and Add-ons"));this._indicatorsButton.on(a,function(a){a.stopPropagation();a.preventDefault();studyMarket.isVisible()?
studyMarket.hide():studyMarket.show()});TradingView.keyboardBinder.registerListener("IndicatorsHotkey",function(a){if("47"==a.which&&$(a.target).is("body")&&!studyMarket.isVisible())return studyMarket.show(),studyMarket.selectSearchPage(),a.preventDefault(),a.stopPropagation(),!0});studyMarket.visibilityChanged.subscribe(this,function(a){this._indicatorsButton.toggleClass("active",a)});TradingView.onWidget()||W77.enabled("charting_library")||studyTemplates.appendMenuButtonTo(c);return c};
A4.prototype.createGroup=function(a){a||(a={});var b=$("<div>").addClass("group");a.right&&b.addClass("right");a.single?b.addClass("space-single"):null;return b};A4.prototype.bindToModel=function(){var a=this.D4.model();a.mainSeries().properties();this.D0=a};A4.prototype.backButton=function(){return this._backButton};
A4.prototype.saveLoadWidget=function(){return this._saveLoad||console.warn("No save-load widget created in footer")};A4.prototype.styleIconPosition=function(a){return"-%1px 0".replace("%1",19*~~a)};A4.styleIconPosition=A4.prototype.styleIconPosition;A5=function(a){a=a||{};var b=this.D5=a.D6,c=this.D4=b.activeChartWidget.value(),d=this._onWidget=c.onWidget(),e=this,g=Modernizr.touch?"touchstart":"click",h=$(".header-chart-panel").eq(0);this._$right=h.find(".right");this._$left=h.find(".left");this._itemsVisibility=a.itemsVisibility;TradingView.isMobileView&&!TradingView.winMobileMode&&this._createBackButton(this);if(!b.readOnly()){if(W77.enabled("header_symbol_search")){var h=
this.createGroup().appendTo(this._$left),h=$('<div class="symbol-edit-widget no-last"></div>').appendTo(h),k=$('<div class="symbol-edit-wrap">').appendTo(h),h=null;W77.enabled("charting_library")||(h=$('<div class="symbol-edit-buttonswrap">').appendTo(k),h=$('<div class="spread-actions">').appendTo(h).on("mousedown",function(a){a.preventDefault()}));var l=$('<div class="symbol-edit-inputspacer">').appendTo(k),m=$('<input type="text" class="symbol-edit" maxlenght="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+
'">').appendTo(l);A69.bindToInput(m,{syncWithChartWidget:!0,spreadActions:h});(function(){var a=!1;m.on("focus",function(){a=!0;k.addClass("expanded")});m.on("blur",function(){a=!1;setTimeout(function(){a||k.removeClass("expanded")},40)})})()}if(W77.enabled("header_resolutions")){h=this.createGroup({single:!0}).appendTo(this._$left);l={onWidget:d,submenuBtnAddClass:"apply-common-tooltip"};a.interval_options&&$.extend(l,a.interval_options);!TradingView.isMobileView&&W77.enabled("items_favoriting")||
$.extend(l,{notShowQuicks:!0,popupSpacing:1});TradingView.isOnFeaturePage&&$.extend(l,{notShowQuicks:!0});this._interval=new A21(l);if(W77.enabled("charting_library"))D16.on("configuration_received",function(){e._interval.forceUpdate()});this._interval.element().addClass("no-first").appendTo(h);this._interval.onResize.subscribe(b,b.updateLayout);a.favoriteIntervals&&this._interval.setUpStarredItemsList(a.favoriteIntervals)}W77.enabled("header_chart_type")&&
(h=W77.enabled("charting_library")?[{id:TradingView.Series.STYLE_BARS,title:$.t("Bars")},{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles")},{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:TradingView.Series.STYLE_LINE,title:$.t("Line")},{id:TradingView.Series.STYLE_AREA,title:$.t("Area")},{id:TradingView.Series.STYLE_HEIKEN_ASHI,title:$.t("Heiken Ashi")}]:[{id:TradingView.Series.STYLE_BARS,title:$.t("Bars")},{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles")},
{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:TradingView.Series.STYLE_HEIKEN_ASHI,title:$.t("Heiken Ashi")},{id:TradingView.Series.STYLE_LINE,title:$.t("Line")},{id:TradingView.Series.STYLE_AREA,title:$.t("Area")},{id:TradingView.Series.STYLE_RENKO,title:$.t("Renko")},{id:TradingView.Series.STYLE_PB,title:$.t("Line Break")},{id:TradingView.Series.STYLE_KAGI,title:$.t("Kagi")},{id:TradingView.Series.STYLE_PNF,title:$.t("Point & Figure")}],l=function(){if(!a.favoriteChartTypes)return[];
var b={Bars:TradingView.Series.STYLE_BARS,Candles:TradingView.Series.STYLE_CANDLES,Line:TradingView.Series.STYLE_LINE,Area:TradingView.Series.STYLE_AREA,"Heiken Ashi":TradingView.Series.STYLE_HEIKEN_ASHI,"Hollow Candles":TradingView.Series.STYLE_HOLLOW_CANDLES};return a.favoriteChartTypes.map(function(a){return b[a]})}()||[1,4,5,6],!TradingView.isMobileView&&!TradingView.isOnFeaturePage||W77.enabled("charting_library")||(l=[]),d?l=[1,3]:W77.enabled("collapsible_header")&&this._createMinimizeButton(a.headerChartPanel),
this._style_list=new A14("StyleWidget",$.map(h,function(a){var b=a.id,c={image:TradingView.wrapUrl("url('/static/chart-client/css/images/bartype-icons.png')"),offset:e.styleIconPosition(b),quickOffset:TradingView.isMobileView?"-%1px -38px".replace("%1",19*~~b):e.styleIconPosition(b),offsetActive:"-%1px -19px".replace("%1",19*~~b)};return{id:b,title:a.title,icon:c,favoriteButton:{icon:c,title:a.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:l,addClass:"chart-style-widget",
popupAddClass:"chart-style-popup",notShowQuicks:!!TradingView.isMobileView||!W77.enabled("items_favoriting"),showJustDefaultQuicks:W77.enabled("predefined_items_only_may_be_starred"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"}),b.activeChartStyle.subscribe(function(a){e._style_list.setValue(a)},{callWithLast:!0}),e._style_list.onChange().subscribe(this,function(a){b.activeChartStyle.setValue(a)}),e._style_list.onResize().subscribe(b,b.updateLayout));studyMarket=
new A1(b,window.user,{onWidget:d});this._createLayout(a,e,g)}W77.enabled("header_saveload")&&(d=W77.enabled("header_saveload_to_the_right")?this._$right:this._$left,h=this.createGroup({single:!0}).appendTo(d),d=$("<div>").addClass("save-load-buttons in-header").appendTo(h),this._saveLoad=new TradingView.SaveLoadWidget(d,b,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(b,b.updateLayout));this.D4.readOnly()||TradingView.isMobileView||
!W77.enabled("header_undo_redo")||(this._undoRedo=new A78(this._$left,this.D4),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"));if(W77.enabled("header_screenshot")){var n=$('<div class="group space-single"><span class="button screenshot iconed"><i></i></span></div>');n.click(function(c){var d={snapshotUrl:a.snapshotUrl};W77.enabled("show_dialog_on_snapshot_ready")?getImage(b,
d,e._onScreenshotReady):n.hasClass("process")||(n.addClass("process"),getImageSilently(b,d,function(a){n.removeClass("process");e._onScreenshotReady(a)}));c.preventDefault()}).appendTo(this._$right)}!TradingView.isMobileView&&W77.enabled("header_fullscreen_button")&&(this._fullscreen=new TradingView.FullscreenWidget,this._fullscreen.element().addClass("apply-common-tooltip").appendTo(this._$left));W77.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none");
c.withModel(this,A4.prototype.bindToModel)};inherit(A5,A4);A5.prototype.onScreenshotReady=function(a){this._onScreenshotReady=a};
A5.prototype._createLayout=function(a,b,c){var d=[];W77.enabled("header_chart_type")&&d.push(this._createBarsGroup(b));W77.enabled("header_settings")&&d.push(this._createPropertiesGroup(c,a.D6));W77.enabled("header_indicators")&&d.push(this._createIndicatorsGroup(c));W77.enabled("header_compare")&&d.push(this._createCompareGroup(b,a.D6,c));d.forEach(function(a){a.appendTo(this._$left)},this)};
A5.prototype._createMinimizeButton=function(a){if(a&&a.size())$(document.createElement("span")).addClass("tv-close-panel top").appendTo(a).on("click",function(b){b.isDefaultPrevented()||(b.preventDefault(),a.toggleClass("hidden"),$(window).trigger("resize"))})};TradingView.LineToolPropertiesWidget=function(a){this.D5=a;this._bindings=new List;this.init();this.attachHandlers()};TradingView.LineToolPropertiesWidget.prototype._POSITION_KEY="properties_toolbar.position";TradingView.LineToolPropertiesWidget.prototype.activeChartWidget=function(){return this.D5.activeChartWidget.value()};TradingView.LineToolPropertiesWidget.prototype.selectedSource=function(){return this.D5.selectedSource.value()};
TradingView.LineToolPropertiesWidget.prototype.init=function(){var a=this,b=$('<div class="properties-toolbar"><div class="drag-handler"><i></i></div></div>').css("position","absolute").hide().draggable({handle:".drag-handler",stop:function(){TVSettings.setJSON(a._POSITION_KEY,b.offset())}});$(window).resize(function(){a._visible&&a._updatePositoin()});this._$widget=b;this._$templates=$('<div class="tools-group">').css("display","inline-block").appendTo(b).hide();this._$properties=$('<div class="tools-group properties-tools-group">').css("display",
"inline-block").appendTo(b).hide();this._$sourceActions=$('<div class="tools-group">').css("display","inline-block").appendTo(b).hide();this.createSourceActions();this._$widget.appendTo(document.body)};TradingView.LineToolPropertiesWidget.prototype.attachHandlers=function(){TradingView.drawingState.tool.subscribe(function(a){this.onToolChanged(a)}.bind(this),{callWithLast:!0});this.D5.selectedSource.subscribe(function(a){this.onSourceChanged(a)}.bind(this))};
TradingView.LineToolPropertiesWidget.prototype.onToolChanged=function(a,b){if(a&&-1!=a.toLowerCase().indexOf("linetool"))b=b instanceof $52?b:new $52(a.toLowerCase()),this.hideSourceActions(),this.showPropertiesOf(a,b),this.showTemplatesOf({tool:a,properties:b}),this._updateVisibility();else if(this.selectedSource())this.onSourceChanged(this.selectedSource());else this.hide()};
TradingView.LineToolPropertiesWidget.prototype.findSourceOnWidget=function(a){for(var b=0;b<this.activeChartWidget().model().panes().size();b++)for(var c=this.activeChartWidget().model().panes().item(b).orderedSources(),d=0;d<c.length;d++)if(c[d]===a)return c[d]};
TradingView.LineToolPropertiesWidget.prototype.onSourceChanged=function(a){a?(a instanceof W47&&!(a instanceof W96)&&this.findSourceOnWidget(a)?(!a.userEditEnabled()||"LineToolBrush"!==a.toolname&&this.activeChartWidget().model().lineBeingCreated()?this.hideSourceActions():this.showSourceActions(a),this.showPropertiesOf(a.getConstructor(),a.properties()),this.showTemplatesOf({source:a}),this._updateVisibility()):this.hide(),this._setupToggleLockButton(a)):this.hide()};
TradingView.LineToolPropertiesWidget.prototype.showTemplatesOf=function(a){var b=a.source,c,d;b?(c=b.getConstructor(),d=b.properties()):(c=a.tool,d=a.properties);this._$templates.hide().empty();var e=this;a=new TradingView.LinetoolTemplatesList(c,function(a){b?(b.restoreTemplate(a),e.activeChartWidget().model().model().updateSource(this._linetool),e.onSourceChanged(b)):(d.merge(a),d.listeners().fire(this),d.saveDefaults(),e.onToolChanged(c,d))},{buttonInner:" ",buttonClass:"button icon-list with-arrow apply-common-tooltip",
defaultsCallback:function(){d.restoreFactoryDefaults();e.showPropertiesOf(c,d)},saveAsText:"Save Drawing Template As...",applyDefaultText:"Apply Default Drawing Template",getDataForSaveAs:b?function(){return b.template()}:null});var g=a.createButton().attr("title","Templates");this.templatesList=a;this._$templates.append(g);W77.enabled("charting_library")||this._$templates.show();this._templatesVisible=!0};
TradingView.LineToolPropertiesWidget.prototype.createSourceActions=function(){function a(a,b,c,d){a=$("<div>").addClass("button apply-common-tooltip").addClass("icon-"+a.toLowerCase()).attr("title",b).on("click",function(a){a.stopPropagation();c(a)});d&&a.append('<svg><use xlink:href="#'+d+'" /></svg>');return a}var b=this,c=a("Settings",$.t("Settings"),function(){(new EditObjectDialog(b.selectedSource(),b.activeChartWidget().model())).show()});this.$zOrder=a("ZOrder",$.t("Visual Order"),function(){b.zOrderButtonHandler()});
this.$zOrder.addClass("with-arrow");TradingView.bindPopupMenu(this.$zOrder,null,{direction:"down",event:"button-popup",reverse:!1,notCloseOnButtons:!0});this.$clone=a("Clone",$.t("Clone"),function(){b.activeChartWidget().paneWidgets().item(0).cloneLineTool(b.selectedSource())});this.$lock=a("Lock",$.t("Lock"),function(){b.activeChartWidget().toggleLockSelectedObject()});this._lockChangeListener=function(a){b.$lock.toggleClass("active",a.value())};var d=a("Hide",$.t("Hide"),function(){b.activeChartWidget().hideSelectedObject()}),
e=a("Remove",$.t("Remove"),function(){b.activeChartWidget().model().removeSelectedSource()});TradingView.D18("alerts")&&TradingView.D18("drawing_alerts")?(this.$editAlert=a("alert",$.t("Edit Alert"),function(){runOrSignIn(function(){b.selectedSource().getAlert(function(a){editAlert(a,b.activeChartWidget())})})},"svg-alarm-clock"),this.$addAlert=a("add-alert",$.t("Add Alert"),function(){runOrSignIn(function(){new TradingView.MakeAlertDialog(b.activeChartWidget(),{drawing:b.selectedSource()})})},
"svg-alarm-clock-plus"),this._$sourceActions.append(c,this.$editAlert,this.$addAlert,this.$zOrder,this.$clone,this.$lock,d,e)):this._$sourceActions.append(c,this.$zOrder,this.$clone,this.$lock,d,e)};TradingView.LineToolPropertiesWidget.prototype.zOrderButtonHandler=function(){this.$zOrder.hasClass("active")||this.$zOrder.trigger("button-popup",[this._getZOrderActions()])};
TradingView.LineToolPropertiesWidget.prototype._getZOrderActions=function(){var a=[],b=this.selectedSource(),c=this.activeChartWidget().model(),d={title:$.t("Bring to Front"),action:function(){c.bringToFront(b)}},e={title:$.t("Send to Back"),action:function(){c.sendToBack(b)}},g={title:$.t("Bring Forward"),action:function(){c.changeZOrder(b,1)}},h={title:$.t("Send Backward"),action:function(){c.changeZOrder(b,-1)}},k=c.paneForSource(this.selectedSource()).getZOrderMinMax();b.zorder()===k.minZOrder&&
(e.disabled=!0,h.disabled=!0);b.zorder()===k.maxZOrder&&(g.disabled=!0,d.disabled=!0);a.push(d,e,g,h);return a};TradingView.LineToolPropertiesWidget.prototype._getPossibleProperty=function(a){for(var b=[],c=this._defaultToolProperties(),d=!0,e=!1,g=0;g<c.length;g++){var h=c[g];h.name in a?(d=!1,b.push(h)):h.divider&&(b.push(h),e=!0)}2===b.length&&e&&(b=$.grep(b,function(a){return!a.divider}));return d?[]:b};
TradingView.LineToolPropertiesWidget.prototype.showPropertiesOf=function(a,b){this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases());var c=this._toolExceptionCases[a]||this._getPossibleProperty(b);this._$properties.empty();this._propertiesVisible=!1;if(c.length){for(var d=0;d<c.length;d++){var e=c[d];if(e.divider)this._$properties.append('<div class="divider"></div>');else{var g=b[e.name];if("function"!=typeof e.showIf||e.showIf(g,b))e=new this.propertyControl(this,
g,e,b),this._$properties.append(e.el),this._propertiesVisible=!0}}this._$properties.toggle(this._propertiesVisible)}else this._$properties.hide()};
TradingView.LineToolPropertiesWidget.prototype.showSourceActions=function(a){function b(c){d.$editAlert.hide();d.$addAlert.hide();a.canHasAlert()&&(c?d.$editAlert.show():d.$addAlert.show());a.hasAlert.subscribe(b,!0)}var c=TradingView.className((a||this.selectedSource()).constructor),d=this;this.activeChartWidget().model().model().isSingleInstanceLineTool(c)?this.$clone.hide():this.$clone.show();d.$editAlert&&d.$addAlert&&b(a.hasAlert.value());this._$sourceActions.show();this._sourceActionsVisible=
!0};TradingView.LineToolPropertiesWidget.prototype.hideSourceActions=function(){this._$sourceActions.hide();this._sourceActionsVisible=!1};TradingView.LineToolPropertiesWidget.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()};TradingView.LineToolPropertiesWidget.prototype.hide=function(){this._$widget.hide();this._setupToggleLockButton();this._visible=!1};
TradingView.LineToolPropertiesWidget.prototype._show=function(){this._$widget.show();this._updatePositoin();this._visible=!0};TradingView.LineToolPropertiesWidget.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())};
TradingView.LineToolPropertiesWidget.prototype._setupToggleLockButton=function(a){a!=this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),a&&a.properties().frozen&&(a.properties().frozen.subscribe(this,this._lockChangeListener),this.$lock.toggleClass("active",a.properties().frozen.value())),this._selectedSourceBk=a)};
TradingView.LineToolPropertiesWidget.prototype._updatePositoin=function(){var a=this._$widget,b=$(window),c=b.height()-a.outerHeight(),b=b.width()-a.outerWidth(),d=TVSettings.getJSON(this._POSITION_KEY,{left:b/2,top:headerChartPanel.outerHeight()+15}),d={top:Math.min(c,Math.max(d.top,0)),left:Math.min(b,Math.max(d.left,0))};a.css(d);a.draggable("option","containment",[0,0,b,c])};TradingView.LineToolPropertiesWidget.prototype.bindControl=function(a){this._bindings.append(a)};
TradingView.LineToolPropertiesWidget.prototype.clearBindings=function(a){for(a=this._bindings.size();a--;)this._bindings.item(a).destroy();this._bindings.clear()};
TradingView.LineToolPropertiesWidget.prototype.propertyControl=function(a,b,c,d){if(b&&c&&a&&c.inputType){"combobox"!==c.inputType||c.comboboxOptions||console.warn('inputType combobox, needs "comboboxOptions" option');this._toolbarWidget=a;var e=c.inputType,g;if("colorPicker"===e)g=D7.prototype.createColorPicker(),c.icon&&g.addClass("icon-"+c.icon),a.bindControl(new ColorBinding(g,b,!0,a.activeChartWidget().model()));else if("combobox"===e){e=!0;!0===c.simple?(g=$.map(c.comboboxOptions,
function(a){return{value:a,html:'<div class="combobox-simple">'+a+"</div>"}}),e=!1):g=$.map(c.comboboxOptions,function(a){return{value:a.value,html:'<div class="combobox-icon icon-'+a.icon+'"></div>'}});var h=new HTMLHelper.Combobox(g,{horizontal:e});g=h.render();e&&g.find(".items").width(32*c.comboboxOptions.length+14);c.propertyProxy&&(b=c.propertyProxy(d,a.activeChartWidget().model()));a.bindControl(new D11(h,b,null,!0,a.activeChartWidget().model()))}c.title&&g.attr("title",c.title);
"string"==typeof c.addClass&&g.addClass(c.addClass);g.addClass("apply-common-tooltip");this.el=g}};
TradingView.LineToolPropertiesWidget.prototype.createLineEndPropertyProxy=function(a,b){return function(c,d){var e;e=c[b].value()?TradingView.LineToolPropertiesWidget.LINE_EXTEND:c[a].value();e=new Property(e);e.subscribe(this,function(e){e=e.value();2>e?(d.beginUndoMacro(""),c[a].setValue(e),c[b].setValue(!1)):(d.beginUndoMacro(""),c[a].setValue(W47.LINEEND_NORMAL),c[b].setValue(!0));d.endUndoMacro()});return e}};TradingView.LineToolPropertiesWidget.LINE_EXTEND=42;
TradingView.LineToolPropertiesWidget.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",icon:"bucket",title:$.t("Background Color")},{divider:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}],
title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,icon:"line"},{value:1,icon:"line-dotted"},{value:2,icon:"line-dashed"}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:W47.LINEEND_NORMAL,icon:"line-left-normal"},{value:W47.LINEEND_ARROW,icon:"line-left-arrow"},{value:TradingView.LineToolPropertiesWidget.LINE_EXTEND,icon:"line-left-extend"}],propertyProxy:this.createLineEndPropertyProxy("leftEnd",
"extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:W47.LINEEND_NORMAL,icon:"line-right-normal"},{value:W47.LINEEND_ARROW,icon:"line-right-arrow"},{value:TradingView.LineToolPropertiesWidget.LINE_EXTEND,icon:"line-right-extend"}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]};
TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",icon:"bucket"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",icon:"bucket"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",icon:"pencil"}]};
TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",inputType:"colorPicker",icon:"pencil"}]};
TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",icon:"bucket",showIf:function(a,b){return b&&b.fillBackground?!!b.fillBackground.value():!0}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",icon:"pencil"},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",icon:"pencil"},
{divider:!0},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]};
TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",icon:"pencil"},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{divider:!0},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]};
TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",icon:"bucket",showIf:function(a,b){return b.fillBackground.value()},title:$.t("Background Color")},{divider:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}],
title:$.t("Line Width")}]};
TradingView.LineToolPropertiesWidget.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:[],LineToolFibTimeZone:[],LineToolBrush:TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases(),LineToolPolyline:TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases(),LineToolText:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolBalloon:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),
LineToolCallout:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolThumbUp:[],LineToolThumbDown:[],LineToolElliottCircle:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),
LineToolElliottMinor:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",icon:"bucket"}],LineToolNote:TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases(),
LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",icon:"pencil"}],LineToolRiskRewardLong:TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",icon:"bucket"}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",icon:"bucket"},
{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",icon:"bucket"},{divider:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}]}]}};TradingView.FavoriteDrawingToolBar=function(a){this.drawingToolbar=a;this.tools=this.drawingToolbar.favorites;this._active=TradingView.drawingState.tool.value();this.visibleProperty=new Property(TVSettings.getBool("ChartFavoriteDrawingToolbarWidget.visible",!0));this.visibleProperty.subscribe(this,function(a){this.toggle(a.value());TVSettings.setValue("ChartFavoriteDrawingToolbarWidget.visible",a.value())});this.init();this._attach();this.visibleProperty.value()&&0<this.tools.length&&(this.render(),
this.showWidget())};TradingView.FavoriteDrawingToolBar.prototype._POSITION_KEY="chart.favoriteDrawingsPosition";TradingView.FavoriteDrawingToolBar.prototype._attach=function(){this.drawingToolbar._favoritesEvent.subscribe(this,this._onEvent);TradingView.drawingState.tool.subscribe(function(){this._active=TradingView.drawingState.tool.value();this.render()}.bind(this))};
TradingView.FavoriteDrawingToolBar.prototype._onEvent=function(a,b){this.tools=this.drawingToolbar.favorites;this._visible||this.visibleProperty.value()?0<this.tools.length?(this.render(),this._visible||this.showWidget(),this._updatePosition()):this.hideWidget():"add"==a&&0<this.tools.length&&this.setVisible(!0)};
TradingView.FavoriteDrawingToolBar.prototype.render=function(){this._$toolsContainer.empty();this.tools.forEach(function(a){if(a.drawing){var b=a.drawing.tool==this._active,c=$("<i/>").css({backgroundPosition:A6.prototype.Button.prototype._getIconBackgroundPosition(a.drawing.tool,b)}),b=$('<span class="button apply-common-tooltip" />').attr("title",a.drawing.localizedName).append(c).toggleClass("active",b).on("click",function(){TradingView.drawingState.tool.value()==
a.drawing.tool?TradingView.drawingState.resetToCursor():a.drawing.action.call(this.drawingToolbar,a.drawing)});this._$toolsContainer.append(b)}}.bind(this))};
TradingView.FavoriteDrawingToolBar.prototype.init=function(){var a=this,b=$('<div class="drawing-favorites-toolbar"><div class="drag-handler"><i></i></div></div>').css("position","absolute").hide().draggable({handle:".drag-handler",stop:function(){TVSettings.setJSON(a._POSITION_KEY,b.offset())}});$(window).resize(function(){a._visible&&a._updatePosition()});b.on("contextmenu",function(b){b.preventDefault();var d=new Action({text:$.t("Hide Favorite Drawings Toolbar")});d.callbacks().subscribe(null,
function(){var b=a.drawingToolbar.activeChartWidget().model();if(b){var c=!a.visibleProperty.value();b.setProperty(a.visibleProperty,c,$.t("Hide Favorite Drawings Toolbar"))}});ContextMenu.createMenu([d]).show(b)});this._$widget=b;this._$toolsContainer=$('<div class="tools-group"/>').appendTo(b);this._$widget.appendTo(document.body);this._$toolsContainer.sortable({tolerance:"pointer",start:function(a,b){TradingView.Tooltip.hide();startIndex=b.item.index()},stop:function(a,b){var e=b.item.index();
startIndex!=e&&(this.tools.splice(e,0,this.tools.splice(startIndex,1)[0]),this.drawingToolbar._favoritesEvent.fire("reorder"))}.bind(this)})};
TradingView.FavoriteDrawingToolBar.prototype._updatePosition=function(){var a=this._$widget,b=$(window),c=b.height()-a.outerHeight(),b=b.width()-a.outerWidth(),d=TVSettings.getJSON(this._POSITION_KEY,{left:b/2,top:headerChartPanel.outerHeight()+61}),d={top:Math.min(c,Math.max(d.top,0)),left:Math.min(b,Math.max(d.left,0))};a.css(d);a.draggable("option","containment",[0,0,b,c])};TradingView.FavoriteDrawingToolBar.prototype.showWidget=function(){this._visible=!0;this.render();this._$widget.show();this._updatePosition()};
TradingView.FavoriteDrawingToolBar.prototype.hideWidget=function(){this._$widget.hide();this._visible=!1};TradingView.FavoriteDrawingToolBar.prototype.setVisible=function(a){this.visibleProperty.setValue(a)};TradingView.FavoriteDrawingToolBar.prototype.toggle=function(a){a?this.show():this.hide()};TradingView.FavoriteDrawingToolBar.prototype.show=function(){!this._visible&&0<this.tools.length&&this.showWidget()};TradingView.FavoriteDrawingToolBar.prototype.hide=function(){this._visible&&this.hideWidget()};A6=function(a){var b=this;this.options=a=a||{};TradingView.drawingState.init();var c=this._container=a.container;this.D5=a.D6;this._container.on("contextmenu",function(a){a.preventDefault()});if(!a.onWidget&&!TradingView.isMobileView){var d=$("<span>").addClass("main-menu apply-common-tooltip common-tooltip-vertical");c.append($("<div>").addClass("tools-group").append(d));this._mainMenuWidget=new TradingView.MainMenuWidget(d)}this._allToolGroups=
[];this._toolsFilter=a.drawingsAccess?new A6.ModernToolsFilter(a.drawingsAccess):new A6.ObsoleteToolsFilter(a.enabledDrawings,a.disabledDrawings);this.favorites=TVSettings.getJSON("chart.favoriteDrawings",[]);if(!a.readOnly){this._main=d=$("<div>").addClass("tools-group no-delimiter").appendTo(c);this.appendToolsGroup([{tool:"cursor",name:"Cross"},{tool:"dot",name:"Dot"},{tool:"arrow",name:"Arrow"},{tool:"eraser",name:"Eraser"}]);this.appendToolsGroup([{tool:"LineToolTrendLine",
name:"Trend Line"},{tool:"LineToolTrendAngle",name:"Trend Angle"},{tool:"LineToolHorzLine",name:"Horizontal Line"},{tool:"LineToolHorzRay",name:"Horizontal Ray"},{tool:"LineToolVertLine",name:"Vertical Line"},{tool:"LineToolArrow",name:"Arrow"},{tool:"LineToolRay",name:"Ray"},{tool:"LineToolExtended",name:"Extended"},{tool:"LineToolParallelChannel",name:"Parallel Channel"},{tool:"LineToolDisjointAngle",name:"Disjoint Angle"},{tool:"LineToolFlatBottom",name:"Flat Top/Bottom"},{tool:"LineToolRegressionTrend",
name:"Regression Trend"}]);this.appendToolsGroup([{tool:"LineToolPitchfork",name:"Pitchfork"},{tool:"LineToolSchiffPitchfork2",name:"Schiff Pitchfork"},{tool:"LineToolSchiffPitchfork",name:"Modified Schiff Pitchfork"},{tool:"LineToolInsidePitchfork",name:"Inside Pitchfork"},{tool:"LineToolPitchfan",name:"Pitchfan"},{tool:"LineToolGannSquare",name:"Gann Box"},{tool:"LineToolGannComplex",name:"Gann Square"},{tool:"LineToolGannFan",name:"Gann Fan"},{tool:"LineToolFibRetracement",name:"Fib Retracement"},
{tool:"LineToolTrendBasedFibExtension",name:"Trend-Based Fib Extension"},{tool:"LineToolFibSpeedResistanceFan",name:"Fib Speed Resistance Fan"},{tool:"LineToolFibTimeZone",name:"Fib Time Zone"},{tool:"LineToolTrendBasedFibTime",name:"Trend-Based Fib Time"},{tool:"LineToolCircleLines",name:"Cyclic Lines"},{tool:"LineToolFibCircles",name:"Fib Circles"},{tool:"LineToolFibSpiral",name:"Fib Spiral"},{tool:"LineToolFibSpeedResistanceArcs",name:"Fib Speed Resistance Arcs"},{tool:"LineToolFibWedge",name:"Fib Wedge"},
{tool:"LineToolFibChannel",name:"Fib Channel"}]);this.appendToolsGroup([{tool:"LineToolBrush",name:"Brush"},{tool:"LineToolRectangle",name:"Rectangle"},{tool:"LineToolRotatedRectangle",name:"Rotated Rectangle"},{tool:"LineToolEllipse",name:"Ellipse"},{tool:"LineToolTriangle",name:"Triangle"},{tool:"LineToolPolyline",name:"Polyline"},{tool:"LineToolArc",name:"Arc"}]);this.appendToolsGroup([{tool:"LineToolText",name:"Text"},{tool:"LineToolTextAbsolute",name:"Anchored Text"},{tool:"LineToolNote",name:"Note"},
{tool:"LineToolNoteAbsolute",name:"Anchored Note"},{tool:"LineToolCallout",name:"Callout"},{tool:"LineToolBalloon",name:"Balloon"},{tool:"LineToolPriceLabel",name:"Price Label"},{tool:"LineToolArrowMarkLeft",name:"Arrow Mark Left"},{tool:"LineToolArrowMarkRight",name:"Arrow Mark Right"},{tool:"LineToolArrowMarkUp",name:"Arrow Mark Up"},{tool:"LineToolArrowMarkDown",name:"Arrow Mark Down"},{tool:"LineToolFlagMark",name:"Flag Mark"}]);this.appendToolsGroup([{tool:"LineTool5PointsPattern",name:"XABCD Pattern"},
{tool:"LineToolABCD",name:"ABCD Pattern"},{tool:"LineToolTrianglePattern",name:"Triangle Pattern"},{tool:"LineToolThreeDrivers",name:"Three Drivers Pattern"},{tool:"LineToolHeadAndShoulders",name:"Head & Shoulders"},{tool:"LineToolElliottSubminuette",name:"Elliott Wave Subminuette"},{tool:"LineToolElliottMinor",name:"Elliott Wave Minor"},{tool:"LineToolElliottCircle",name:"Elliott Wave Cycle"},{tool:"LineToolElliottMinorRetr",name:"Elliott Minor Retracement"},{tool:"LineToolElliottMajorRetr",name:"Elliott Major Retracement"}]);
this.appendToolsGroup([{tool:"LineToolRiskRewardLong",name:"Long Position"},{tool:"LineToolRiskRewardShort",name:"Short Position"},{tool:"LineToolPrediction",name:"Forecast"},{tool:"LineToolDateRange",name:"Date Range"},{tool:"LineToolPriceRange",name:"Price Range"},{tool:"LineToolBarsPattern",name:"Bars Pattern"},{tool:"LineToolProjection",name:"Projection"}]);if(this._toolsFilter.isToolEnabled("Font Icons")){var e=new this.Button(this.createIconActions(),{addClass:"font-awesome line-tool-icons-popup",
buttonClass:"font-awesome"},!0);this._icons=e;d.append(e.element());this._allToolGroups.push(e)}if(!TradingView.isMobileView){d=$("<div>").addClass("tools-group").appendTo(c);e=new this.Button({tool:"zoom",name:"Zoom In",action:function(){TradingView.drawingState.tool.setValue("zoom")}});d.append(e.element());this._allToolGroups.push(e);if(b.D5){var g=new this.Button({tool:"zoom-out",name:"Zoom Out",action:function(){var a=b.D5;a&&(a=a.activeChartWidget.value().model())&&
a.zoomFromViewport()}});d.append(g.element());g.element().addClass("hidden");(function(){function a(){var d=b.D5.activeChartWidget.value(),e=d.model(),h=!1;e?(c!==e&&(c&&c.zoomStack().onChange().unsubscribe(null,a),e.zoomStack().onChange().subscribe(null,a),c=e),h=!e.zoomStack().isEmpty()):d.withModel(null,a);g.element().toggleClass("hidden",!h)}var c=null;b.D5.activeChartWidget.subscribe(a,{callWithLast:!0})})()}e=new this.Button({tool:"measure",name:"Measure (Shift + Click on the chart)",
action:function(){TradingView.drawingState.tool.setValue("measure")}});d.append(e.element());this._allToolGroups.push(e)}var d=$("<div>").addClass("tools-group").appendTo(c),e=!!TradingView.drawingState.properties().magnet.value(),h=new this.Button({tool:"magnet",name:"Magnet Mode",action:function(){h.activate(!h.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().magnet.setValue(h.activated);TradingView.saveDefaultProperties(!1)}.bind(this)});d.append(h.element());
h.activate(e);TradingView.drawingState.properties().magnet.subscribe(this,function(a){h.activate(a.value())});if(!a.onWidget&&!TradingView.isMobileView||W77.enabled("charting_library")){e=!!TradingView.drawingState.properties().stayInDrawingMode.value();drawingmode=new this.Button({tool:"drawginmode",name:"Stay in Drawing Mode",action:function(){drawingmode.activate(!drawingmode.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().stayInDrawingMode.setValue(drawingmode.activated);
TradingView.saveDefaultProperties(!1)}.bind(this)});d.append(drawingmode.element());drawingmode.activate(e);TradingView.drawingState.properties().stayInDrawingMode.subscribe(this,function(a){drawingmode.activate(a.value())});var e=!!TradingView.drawingState.lockDrawings().value(),k=new this.Button({tool:"lockAllDrawings",name:"Lock All Drawing Tools",action:function(){k.activate(!k.activated);TradingView.drawingState.lockDrawings().setValue(k.activated)}.bind(this)});d.append(k.element());k.activate(e);
TradingView.drawingState.lockDrawings().subscribe(this,function(a){k.activate(a.value())});var e=!!TradingView.drawingState.hideAllDrawings().value(),l=new this.Button({tool:"hideAllDrawings",name:"Hide All Drawing Tools",action:function(){l.activate(!l.activated);TradingView.drawingState.hideAllDrawings().setValue(l.activated)}.bind(this)});d.append(l.element());l.activate(e);TradingView.drawingState.hideAllDrawings().subscribe(this,function(a){l.activate(a.value())});d=$("<div>").addClass("tools-group").appendTo(c);
e=$("<span>").addClass("button objects-tree apply-common-tooltip common-tooltip-vertical").attr("title",$.t("Show Objects Tree")).append($("<i>"));e.on("click",function(a){this.activeChartWidget().showSourceProperties();a.preventDefault()}.bind(this));d.append(e);e=new this.Button({tool:"removeAllDrawingTools",name:"Remove All Drawing Tools",action:function(){this.D5.activeChartWidget.value().model().removeAllDrawingTools()}.bind(this)});d.append(e.element())}TVSettings.getValue("chart.cursorPreference",
"cursor");this._favoritesEvent=new Delegate;this._favoritesEvent.subscribe(this,function(a){~["add","remove","reorder"].indexOf(a)&&TVSettings.setJSON("chart.favoriteDrawings",this.favorites.map(function(a){return{tool:a.drawing.tool}}))});a.onWidget||(this.favoriteDrawingToolbar=new TradingView.FavoriteDrawingToolBar(this))}a.onWidget||TradingView.isMobileView||$(window).load(function(){this.createHelpButton(a);loginStateChange.subscribe(this,function(b){!b&&window.is_authenticated&&this.createHelpButton(a)})}.bind(this));
a.readOnly||TradingView.drawingState.tool.subscribe(function(a){this._syncView(a)}.bind(this),{callWithLast:!0});$(document).bind("keydown","esc",function(){TradingView.drawingState.resetToCursor(!0)});this._twoColumnLayout=!1;if(!a.onWidget&&!TradingView.isMobileView||W77.enabled("charting_library")){var m=c.find(".tools-group"),n;$(function(){var a=m.last();n=a.offset().top+a.outerHeight();$(window).resize()});$(window).resize(function(){var a=$(window).height()<n+10;a!=b._twoColumnLayout&&
(c.toggleClass("two-column",a),b._twoColumnLayout=a,$(window).resize())})}this.visible=new Property;this.visible.subscribe(this,function(a){this._fold(!a.value());TVSettings.setValue("ChartSideToolbarWidget.visible",a.value())});this.visible.setValue("boolean"==typeof a.forceVisible?a.forceVisible:TVSettings.getBool("ChartSideToolbarWidget.visible",!0));$('<a href="#" class="tv-close-panel left" title="Hide Drawings Toolbar"></a>').on("click",function(a){var b=this.activeChartWidget().model();b&&
(b.setProperty(this.visible,!this.visible.value(),$.t("Hide Drawings Toolbar")),a.preventDefault())}.bind(this)).appendTo(c);a.onResize&&(this.onResize=a.onResize);$(window).on("resize",this.updateLayout.bind(this))};A6.prototype.updateLayout=function(){if(this.onResize)this.onResize(this._container)};
A6.prototype.appendToolsGroup=function(a){a=this.filterEnabledTools(this.extendTools(a));0<a.length&&(a=new this.Button(a),this._main.append(a.element()),this._allToolGroups.push(a))};A6.prototype.filterEnabledTools=function(a){return a.filter(function(a){return this._toolsFilter.isToolEnabled(a.name)},this)};A6.prototype.element=function(){return this._container};
A6.prototype._syncView=function(a){if(this._allToolGroups)for(var b=this._allToolGroups.length;b--;){var c=this._allToolGroups[b];if(c.textAsIcon)c.activate("LineToolIcon"==a);else{for(var d=!1,e=c.tools.length;e--;)c.tools[e].tool===a&&(c.setCurrent(e),d=!0);c.activate(d)}}};A6.prototype.activeChartWidget=function(){return this.D5.activeChartWidget.value()};
A6.prototype.extendTools=function(a){var b=this,c=this._addToFavorite.bind(this),d=b._removeFromFavorite.bind(this),e=this.favorites.reduce(function(a,b){a.push(b.tool);return a},[]);return $.map(a,function(a){var h={tool:a.tool,name:a.name,localizedName:$.t(a.name),addClass:b._toolsFilter.isToolGrayed(a.name)&&" grayed",action:function(){TradingView.drawingState.tool.value()!==a.tool&&(TradingView.supportTouch()&&b.D5.selectedSource.value()&&b.activeChartWidget().model().lineBeingCreated()&&
b.activeChartWidget().model().cancelCreatingLine(),TradingView.drawingState.tool.setValue(a.tool))},favOptions:{allowMakeFavorite:!b.options.onWidget,addToFavorite:c,removeFromFavorite:d}},k=!!~e.indexOf(a.tool);if(k)for(var l=0;l<b.favorites.length;l++)b.favorites[l].tool==a.tool&&(b.favorites[l].drawing=h);h.favOptions.isFavorite=k;return h})};
A6.prototype._addToFavorite=function(a){a.favOptions.isFavorite=!0;a={drawing:a,tool:a.tool};this.favorites.push(a);this._favoritesEvent.fire("add",a)};A6.prototype._removeFromFavorite=function(a){a.favOptions.isFavorite=!1;for(var b=0;b<this.favorites.length;b++)this.favorites[b].drawing.tool===a.tool&&(this.favorites.splice(b,1),this._favoritesEvent.fire("remove",a))};
A6.prototype.createIconActions=function(a){var b=this;a=TradingView.LineToolIcon.availIcons;var c=TVSettings.getJSON("linetoolicon.recenticons");c&&(a=c.concat(["separator"]).concat(a));return $.map(a,function(a){return"separator"===a?{separator:!0}:{tool:"LineToolIcon",name:String.fromCharCode(a),addClass:b._toolsFilter.isToolGrayed("Font Icons")&&" grayed",action:function(){var c=defaults("linetoolicon");c.icon=a;saveDefaults("linetoolicon",c);TradingView.drawingState.tool.setValue("LineToolIcon");
b._icons.setTools(b.createIconActions());c=TVSettings.getJSON("linetoolicon.recenticons")||[];c=$.grep(c,function(b){return b!=a});c.unshift(a);10<c.length&&(c=c.slice(0,10));TVSettings.setJSON("linetoolicon.recenticons",c)}}})};A6.prototype.changeTool=function(a){a?this.D4.setCurrentTool(a):this.D4.setCurrentTool(this.D4.currentCursorTool())};
A6.prototype._fold=function(a){this._container.toggleClass("hidden",!!a);$(window).resize()};A6.prototype.createHelpButton=function(a){if(window.widgetbar){var b=widgetbar.layout.setHelpButton(),c;a.withWizard&&a.D6&&(c=a.D6.activeChartWidget.value());new TradingView.ChartHelpMenu(b,!!a.withWizard,c)}};
A6.prototype.Button=function(a,b,c){a=isArray(a)?a:[a];this.isGroup=1<a.length;this.textAsIcon=c;this.setTools(a);this._e=$("<span>").addClass("button").addClass("apply-common-tooltip common-tooltip-vertical");this.isGroup?(this._main=$("<span>").addClass("main"),c?this._main.text(this._firstNonGrayedTool().localizedName).addClass("text-as-icon"):this._main.append("<i>"),this._side=$("<span>").addClass("side"),this._e.append(this._main).append(this._side),this._e.addClass("subgroup")):
this._e.append($("<i>")).attr("title",this.tools[0].localizedName);c||this._e.hover($.proxy(this,"_hover"),$.proxy(this,"_unhover"));b=$.extend({direction:TradingView.isMobileView?"up":"right",event:"button-popup",addClass:"drawings-popup-list favored-list",reverse:!1,popupSpacing:TradingView.isMobileView?15:4},b||{});c||(b.addClass+=" iconed");this.isGroup&&TradingView.bindPopupMenu(this._e,null,b);this.activated=a.activated||!1;this.setCurrent(this.tools.indexOf(this._firstNonGrayedTool()));this.isGroup?
(Modernizr.touch?(this._main.bind("touchstart",$.proxy(this,"_startclick")),this._main.bind("touchend",$.proxy(this,"_stopclick"))):(this._main.mousedown($.proxy(this,"_startclick")),this._main.mouseup($.proxy(this,"_stopclick"))),this._side.click($.proxy(this,"_submenu")),this._e.click(function(){return!1})):this._e.click($.proxy(this,"action"))};A6.prototype.Button.prototype._isToolGrayed=function(a){return a.addClass&&-1<a.addClass.indexOf("grayed")};
A6.prototype.Button.prototype._firstNonGrayedTool=function(){for(var a=0;a<this.tools.length;++a){var b=this.tools[a];if(!this._isToolGrayed(b)&&!b.separator)return b}return this.tools[0]};A6.prototype.Button.prototype.element=function(){return this._e};
A6.prototype.Button.prototype.setTools=function(a){if(isArray(a)){var b=this;this.tools=$.map(a,$.proxy(function(a,d){return a.separator?{separator:!0}:{icon:b.textAsIcon?a.name:a.tool,name:a.name,localizedName:a.localizedName||$.t(a.name),tool:a.tool,addClass:a.addClass,action:"function"===typeof a.action?a.action:b._defaultAction,favOptions:a.favOptions}},this))}};
A6.prototype.Button.iconIndices={LineToolTextAbsolute:0,LineToolArc:1,LineToolArrowMarkDown:2,LineToolArrowMarkUp:3,LineToolCircleLines:4,LineToolArrowMarkLeft:5,LineToolArrowMarkRight:6,LineToolFibSpeedResistanceArcs:7,arrow:8,LineToolBalloon:9,LineToolBrush:10,LineToolFibSpeedResistanceFan:11,LineToolArrow:12,cursor:13,LineToolHorzLine:14,LineToolFibRetracement:15,LineToolPitchfork:16,LineToolText:17,LineToolTrendLine:18,LineToolTrendAngle:82,LineToolFibTimeZone:19,
LineToolVertLine:20,dot:21,LineToolEllipse:22,LineToolFlagMark:23,eraser:24,LineToolExtended:25,LineToolFibCircles:26,LineToolFibSpiral:74,LineToolGannFan:27,LineToolGannSquare:28,LineToolGannComplex:67,LineToolParallelChannel:29,LineToolDisjointAngle:75,LineToolFlatBottom:76,LineToolPolyline:30,LineToolRectangle:31,LineToolRotatedRectangle:81,LineToolCallout:32,LineToolPriceLabel:77,LineToolRay:33,LineToolSchiffPitchfork:72,LineToolSchiffPitchfork2:34,LineToolTrendBasedFibExtension:37,LineToolTrendBasedFibTime:66,
LineToolTriangle:38,modes:39,LineToolElliottSubminuette:40,LineToolElliottMinor:41,LineToolElliottCircle:42,LineToolElliottMajorRetr:43,LineToolElliottMinorRetr:44,LineToolRegressionTrend:45,LineToolFibWedge:46,zoom:47,LineToolPitchfan:48,LineToolHorzRay:49,LineToolPrediction:50,"zoom-out":51,LineToolPriceRange:52,LineToolDateRange:53,LineToolRiskRewardLong:54,LineToolRiskRewardShort:55,"":56,removeAllDrawingTools:57,"":58,LineToolBarsPattern:59,LineToolProjection:60,LineTool5PointsPattern:61,LineToolABCD:62,
LineToolTrianglePattern:63,LineToolThreeDrivers:64,LineToolHeadAndShoulders:65,LineToolInsidePitchfork:68,measure:69,magnet:70,drawginmode:71,LineToolFibChannel:73,lockAllDrawings:78,hideAllDrawings:79,LineToolNote:83,LineToolNoteAbsolute:84};A6.prototype.Button.prototype._getBackgroundByTile=function(a,b){return[b?33:1,32*a+2]};A6.prototype.Button.prototype._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};
A6.prototype.Button.prototype._getIconBackgroundPosition=function(a,b){return this._getBackgroundPosition(this._getIconOffset(a,b))};A6.prototype.Button.prototype._getIconOffset=function(a,b){return this._getBackgroundByTile(A6.prototype.Button.iconIndices[a],b)};
A6.prototype.Button.prototype._setIcon=function(a,b,c){c||this._e.find("i").css("background-position",this._getIconBackgroundPosition(a,b))};A6.prototype.Button.prototype._setTextAsIcon=function(a){this._e.find(".main").text(a)};A6.prototype.Button.prototype.setIcon=function(a){this.icon=a;this.textAsIcon?this._setTextAsIcon(a):this._setIcon(a,this.activated)};
A6.prototype.Button.prototype._hover=function(){this._setIcon(this.icon,!0,!0)};A6.prototype.Button.prototype._unhover=function(){this._setIcon(this.icon,this.activated||!1)};
A6.prototype.Button.prototype._getPopupIcon=function(a){a=A6.prototype.Button.iconIndices[a];return offset={image:TradingView.wrapUrl("url('/static/images/sidetoolbar/instruments.png')"),offset:{x:-64,y:32*-a}}};
A6.prototype.Button.prototype._getPopupMenuItems=function(){function a(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")}var b=this;return $.map(this.tools,function(c,d){if(c.separator)return c;if(!b.textAsIcon&&c.favOptions.allowMakeFavorite)var e=$('<span class="to-quick" title="'+a(c.favOptions.isFavorite)+'"></span>').toggleClass("quicked",!!c.favOptions.isFavorite);return{title:""+c.localizedName,action:function(){b._isToolGrayed(c)?D17.emit("onGrayedObjectClicked",
{type:"drawing",name:c.name}):(b.setCurrent(d),c.action.call(b,c),$(document).trigger("click"),$(document).trigger("touch"))},active:d==b.current,icon:b.textAsIcon?null:b._getPopupIcon(c.icon),addClass:c.addClass,buttons:b.textAsIcon||!c.favOptions.allowMakeFavorite?void 0:[{el:e,handler:function(b){c.favOptions.isFavorite?(c.favOptions.removeFromFavorite(c),e.removeClass("quicked").attr("title",a(!1))):(c.favOptions.addToFavorite(c),e.addClass("quicked").attr("title",a(!0)));b.stopPropagation();
b.preventDefault()}}]}})};A6.prototype.Button.prototype._defaultAction=function(){this.activate()};A6.prototype.Button.prototype._startclick=function(){this._e.hasClass("active")?($(document).trigger("click"),this.action()):this._delay=setTimeout($.proxy(function(){this._delay=null;this.openSubmenu()},this),200)};
A6.prototype.Button.prototype._stopclick=function(){this._delay&&(clearTimeout(this._delay),this._delay=null,this.action())};A6.prototype.Button.prototype._submenu=function(){this._e.hasClass("active")?$(document).trigger("click"):this.openSubmenu()};
A6.prototype.Button.prototype.activate=function(a){(this.activated=a=void 0!==a?!!a:!0)?this._e.addClass("selected"):this._e.removeClass("selected");this._setIcon(this.icon,a)};A6.prototype.Button.prototype.action=function(){var a=this.getCurrent();this._isToolGrayed(a)?D17.emit("onGrayedObjectClicked",{type:"drawing",name:a.name}):a.action.call(this,a)};
A6.prototype.Button.prototype.openSubmenu=function(){this._e.trigger("button-popup",[this._getPopupMenuItems()])};A6.prototype.Button.prototype.setCurrent=function(a){if(0<=a&&a<this.tools.length){var b=this.tools[a];this.setIcon(b.icon);this._isToolGrayed(b)?this._e.find(".main").addClass(" grayed"):this._e.find(".main").removeClass(" grayed");this.isGroup&&!this.textAsIcon&&this._e.attr("title",b.localizedName);this.current=a}};
A6.prototype.Button.prototype.getCurrent=function(){return this.tools[this.current]};A6.prototype.Button.prototype.setCurrentTool=function(a,b){var c=this;if("LineToolIcon"===a){var d=String.fromCharCode(defaults("linetoolicon").icon);$.each(this.tools,function(a,b){if(b.icon==d)return c.setCurrent(a),c.activate(),!1})}else $.each(this.tools,function(b,d){if(d.tool==a)return c.setCurrent(b),c.activate(),!1})};
A6.ObsoleteToolsFilter=function(a,b){this._enabledTools=a;this._disabledTools=b};A6.ObsoleteToolsFilter.prototype.isToolEnabled=function(a){var b=!!this._enabledTools&&0<this._enabledTools.length,c=!!this._disabledTools&&0<this._disabledTools.length;if(b&&c)throw"Unable to use enabled drawings list and disabled drawings one together. Please use just one of them.";return!c&&!b||b&&0<=this._enabledTools.indexOf(a)||c&&0>this._disabledTools.indexOf(a)};
A6.ObsoleteToolsFilter.prototype.isToolGrayed=function(){return!1};A6.ModernToolsFilter=function(a){this._toolsAccess=a};A6.ModernToolsFilter.prototype._findTool=function(a){for(var b=null,c=0;c<this._toolsAccess.tools.length;++c){var d=this._toolsAccess.tools[c];if(d.name==a){b=d;break}}return b};
A6.ModernToolsFilter.prototype.isToolEnabled=function(a){return(a=this._findTool(a))&&a.grayed?!0:"black"==this._toolsAccess.type?!a:!!a};A6.ModernToolsFilter.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};A78=function(a,b){var c=$(document.createElement("div")).addClass("group space-single");this.D4=b;this._undo=$('<span class="button undo disabled"><svg><use xlink:href="#svg-undo" /></svg></span>').attr("title","").appendTo(c);this._redo=$('<span class="button redo disabled"><svg><use xlink:href="#svg-redo" /></svg></span>').attr("title","").appendTo(c);var d=this;this._undo.click(function(){d.undo()});this._redo.click(function(){d.redo()});A77.undoStack().onChange().subscribe(this,
this.update);A77.redoStack().onChange().subscribe(this,this.update);c.appendTo(a)};
A78.prototype.update=function(){var a=A77.undoStack(),b=A77.redoStack();a.isEmpty()?(this._undo.addClass("disabled"),this._undo.attr("title",null)):(this._undo.removeClass("disabled"),this._undo.attr("title",$.t("Undo {0}").format(a.head().text()||"")));b.isEmpty()?(this._redo.addClass("disabled"),this._redo.attr("title",null)):(this._redo.removeClass("disabled"),this._redo.attr("title",$.t("Redo {0}").format(b.head().text()||"")))};
A78.prototype.undo=function(){this._undo.hasClass("disabled")||(TradingView.trackEvent("GUI","Undo"),A77.undo())};A78.prototype.redo=function(){this._redo.hasClass("disabled")||(TradingView.trackEvent("GUI","Redo"),A77.redo())};A78.prototype.undoElement=function(){return this._undo};A78.prototype.redoElement=function(){return this._redo};TradingView.FullscreenWidget=function(){var a=this;this.isFullscreen=!1;this._e=$(document.createElement("div")).addClass("group space-single");var b=$("<span>").addClass("button fullscreen iconed").attr("title",$.t("Fullscreen mode")).append("<i>");b.click(function(){a.startFullscreen()});b.appendTo(this._e);$(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",function(){var b;["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement",
"msFullscreenElement"].some(function(a){if(!(a in document))return!1;b=!!document[a]});null!=b&&(b?a._onStartFullscreen():a._onExitFullscreen())})};TradingView.FullscreenWidget.prototype.element=function(){return this._e};TradingView.FullscreenWidget.prototype.startFullscreen=function(){["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"].some(function(a){if("function"===typeof document.documentElement[a])return document.documentElement[a](),!0});this._onStartFullscreen()};
TradingView.FullscreenWidget.prototype._onStartFullscreen=function(){var a=this;W77.enabled("side_toolbar_in_fullscreen_mode")?$(".header-chart-panel").hide():$("#chart-area").addClass("fullscreen");this._$exitButton||(this._$exitButton=$('<div class="exit-fullscreen">Exit Full Screen (ESC)</div>').on("click",this.exitFullscreen.bind(this)).appendTo(document.body));$(window).resize();$(document).off("keyup.toggleFullscreen").on("keyup.toggleFullscreen",function(b){27==b.keyCode&&a.exitFullscreen()})};
TradingView.FullscreenWidget.prototype.exitFullscreen=function(){["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"].some(function(a){if("function"===typeof document[a])return document[a](),!0});this._onExitFullscreen()};
TradingView.FullscreenWidget.prototype._onExitFullscreen=function(){this._$exitButton&&($(".exit-fullscreen").remove(),delete this._$exitButton);W77.enabled("side_toolbar_in_fullscreen_mode")?$(".header-chart-panel").show():$("#chart-area").removeClass("fullscreen");$(window).resize();$(document).off("keyup.toggleFullscreen")};A53=function(a,b,c){this._chart=a;this.dialog=a.dialog;this._state=b;this._disableContextMenu=!!c;this.lhsPriceAxisWidget=new A54(this,A54.LHS);this.rhsPriceAxisWidget=new A54(this,A54.RHS);this.jqPane=$(document.createElement("td"));this.jqPane.addClass("chart-markup-table");this.jqPane.addClass("pane");this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height","100%");this._dv.css("position",
"relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqPane);this.canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order","1");$(this.top_canvas).css("left",
0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this._zoomSelector=$("<div>");this._zoomSelector.addClass("zoom-selector");this._zoomSelector.css("display","none");this._zoomSelector.appendTo(this._dv);this._tooltipSelector=$("<div>");this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden");this._tooltipSelector.appendTo(this._dv);this.legendWidget=new A23(this,this._chart.model(),this._chart._jqMainDiv);this.jqRow=$(document.createElement("tr"));
this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow);this.jqPane.appendTo(this.jqRow);this.legendWidget.jqTable.appendTo(this._dv);this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow);this.setCursorForTool();TradingView.setMouseEventHandler($(this.top_canvas),this,!0);b&&b!==this._chart.model().panes().item(0)&&!this._chart.readOnly()&&(this.paneControls=new A51(this,this._chart.model(),this._dv));this.updateScalesVisibility();this.actions=[];this.readonlyActions=[];this._onKeyUpListener=
this._onKeyUpListener.bind(this);this._lineCancelledCallback=this._lineCancelledCallback.bind(this);$(window).on("keyup.panewidget",this._onKeyUpListener);this._chart.withModel(this,this._lineCancelledCallback);this._overlays={};this._contextMenuY=this._contextMenuX=0;this._lockDrawingsProperty=TradingView.drawingState.lockDrawings();b&&W77.enabled("move_logo_to_main_pane")&&b._isMainPane&&a.createLogo&&a.createLogo(null,this._dv,!0)};
A53.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener);this.legendWidget&&(this.legendWidget.jqTable.remove(),delete this.legendWidget);this.paneControls&&(this.paneControls.jqDiv.remove(),delete this.paneControls);this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var a in this)delete this[a]};
A53.prototype._onKeyUpListener=function(a){27==a.keyCode&&(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip())};A53.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(a){}};A53.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()};
A53.prototype.priceAxisByCanvas=function(a){return a===this.lhsPriceAxisWidget.canvas||a===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:a===this.rhsPriceAxisWidget.canvas||a===this.rhsPriceAxisWidget.canvas?this.rhsPriceAxisWidget:null};A53.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value());this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())};
A53.prototype.chart=function(){return this._chart};A53.prototype.state=function(){return this._state};A53.prototype.setState=function(a){this._state=a};A53.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:W75.DEFAULT_STRETCH_FACTOR};A53.prototype.setStretchFactor=function(a){this._state&&(this._state._stretchFactor=a)};
A53.prototype.mouseEnterEvent=function(a){if(a=this._chart.model())a.crossHairSource().visible=!0};A53.prototype.isLineTool=function(a){a=TradingView[a];return"function"===typeof a&&a.prototype instanceof W47};A53.prototype.hideInplaceEditor=function(){return this._inplaceEditor?(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0):!1};
A53.prototype._processMouseMoveWhileZoom=function(a){this._state.defaultPriceScale().coordinateToPrice(a.localY);var b=Math.floor(this._chart.model().timeScale().coordinateToIndex(a.localX)),b=this._chart.model().timeScale().indexToCoordinate(b)-.5*this._chart.model().timeScale().barSpacing(),c=a.localY,d=Math.abs(b-this._firstZoomPoint.x),c=Math.abs(c-this._firstZoomPoint.y);b<this._firstZoomPoint.x?this._zoomSelector.css("left",b):this._zoomSelector.css("left",this._firstZoomPoint.x);
a.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",a.localY):this._zoomSelector.css("top",this._firstZoomPoint.y);this._zoomSelector.width(d);this._zoomSelector.height(c)};
A53.prototype._finishZoom=function(a){var b=this._state.defaultPriceScale().coordinateToPrice(a.localY);a=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX));a!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,a,this._firstZoomPoint.price,b,this.state());this._zoomSelector.css("display","none");this._firstZoomPoint=null;TradingView.drawingState.resetToCursor()};
A53.EvironmentState=function(a){a.shiftKey&&(this.shift=!0);a.ctrlKey&&(this.control=!0)};
A53.prototype.mouseDownEvent=function(a){$("input").blur();$(window).focus();this._updateCommonTooltip(null);var b=this._chart.model(),c=new A53.EvironmentState(a);this.hideInplaceEditor();TradingView.supportTouch()&&(this._skipFirstMove=!0);var d=this._state.defaultPriceScale();if(!d.isEmpty()&&!b.timeScale().isEmpty()){var e=b.crossHairSource();TradingView.supportTouch()&&"LineToolBrush"!=TradingView.drawingState.tool.value()||b.setCurrentPosition(a.localX,
a.localY,this._state);var d=e.price,g=e.index;e.startMeasurePoint()&&e.endMeasurePoint()&&e.clearMeasure();c.shift&&TradingView.drawingState.toolIsCursor(TradingView.drawingState.tool.value())&&TradingView.drawingState.tool.setValue("measure");if("measure"!==TradingView.drawingState.tool.value()||e.startMeasurePoint())if(e.startMeasurePoint()&&!e.endMeasurePoint())e.finishMeasure({price:d,index:g,x:a.localX,y:a.localY}),TradingView.drawingState.resetToCursor();else if(this._firstZoomPoint)this._finishZoom(a);
else if("zoom"===TradingView.drawingState.tool.value())b=b.timeScale().indexToCoordinate(g)-.5*b.timeScale().barSpacing(),this._firstZoomPoint={price:d,index:g,x:b,y:a.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",b),this._zoomSelector.css("top",a.localY),this._zoomSelector.width(0),this._zoomSelector.height(0);else if(b.createUndoCheckpoint(),this.isLineTool(TradingView.drawingState.tool.value())||b.lineBeingCreated())this._mouseDownEventForLineTool(a,c,g,d);else{d=
(e=this.dataSourceAtPoint(a.localX,a.localY))&&e.source&&e.source.customization?e.source.customization:{};if(e.hittest&&e.hittest.result()==HitTestResult.CUSTOM){var h=e.hittest.data().mouseDownHandler;h&&h()}if(!this._chart.readOnly()){e&&!d.disableSelection&&b.setSelectedSource(e.source,e.hittest&&e.hittest.data());if(e.source&&"eraser"===TradingView.drawingState.tool.value()&&!d.disableErasing&&(isInherited(e.source.constructor,W47)||isInherited(e.source.constructor,TradingView.Study))){g=
e.hittest.eraseMarker();a.ctrlKey&&void 0!==g&&e.source.processErase?e.source.processErase(b,g):b.removeSource(e.source);return}d=e.source&&isInherited(e.source.constructor,W47)&&e.source.isLocked();if(!this._lockDrawingsProperty.value()&&!d){if(e.source&&e.source.userEditEnabled&&!e.source.userEditEnabled())return;if(e.hittest&&e.hittest.result()===HitTestResult.CHANGEPOINT){d=e.source.priceScale();d=d.coordinateToPrice(a.localY);b.startChangingLinetool(e.source,{index:g,price:d},e.hittest.data(),
c);this._updateTooltip(a.localX,a.localY);return}if(e.hittest&&e.hittest.result()==HitTestResult.MOVEPOINT){e.source.isFixed&&e.source.isFixed()?b.startMovingSource(e.source,new MathEx.Point(a.localX,a.localY),e.hittest.data()):(d=e.source.priceScale(),d=d.coordinateToPrice(a.localY),b.startMovingSource(e.source,{index:g,price:d},e.hittest.data()));return}}if(e.source&&isInherited(e.source.constructor,PriceDataSource)){this._chart.draggingSource=e.source;return}}e.hittest&&e.hittest.result()==HitTestResult.REGULAR||
(this._processing=!0)}else e.startMeasuring({price:d,index:g,x:a.localX,y:a.localY},this._state)}};A53.prototype._finishTool=function(a){var b=this._chart.model(),c=TradingView.drawingState.tool.value();TradingView.drawingState.resetToCursor();this._hideTooltip();b.setSelectedSource(a);this._chart.isTextTool(c)&&(c=b.createUndoCheckpoint(),a=new EditObjectDialog(a,b,c),a.show(),a.focusOnText())};
A53.prototype._mouseDownEventForLineTool=function(a,b,c,d){var e=this._chart.model(),g=!1,h=null,k=a.localX,l=a.localY,m=this._chart.model().model().crossHairSource(),n=TradingView.drawingState.tool.value();TradingView.drawingState.hideAllDrawings().setValue(!1);TradingView.drawingState.lockDrawings().setValue(!1);TradingView.supportTouch()&&this.isLineTool(n)&&"LineToolBrush"!==n&&!e.lineBeingCreated()&&(this._startTouchPoint=new MathEx.Point(k,l),this._initCrossHairPosition=m.currentPoint(),
this._skipFirstMove=!0);if(!e.lineBeingCreated()||e.lineBeingCreated()instanceof TradingView.LineToolBrush)TradingView.supportTouch()&&"LineToolBrush"!=n||(h=e.createLineTool(this._state,{index:c,price:d},n),e.lineBeingCreated()||(g=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint){this._startTouchPoint=new MathEx.Point(k,l);d=e.lineBeingCreated().points();d=d.item(d.size()-1);a=e.timeScale().indexToCoordinate(d.index);d=d.price;b=e.lineBeingCreated().priceScale();
b.isPercent()&&(e=e.lineBeingCreated().ownerSource().firstValue(),d=b.priceRange().convertToPercent(d,e));e=b.priceToCoordinate(d);this._lastDrawingPoint=new MathEx.Point(a,e);return}}else h=e.lineBeingCreated(),g=e.paneForSource(h),g!==this._state&&(d=this._dv.offset(),k=a.localX+d.left,l=a.localY+d.top,d=this._chart.paneByState(g)._dv.offset(),k-=d.left,l-=d.top,d=h.priceScale().coordinateToPrice(l),c=Math.round(e.timeScale().coordinateToIndex(k))),g=e.coninueCreatingLine({index:c,price:d},b);e.setSelectedSource(h);
g?this._finishTool(h):TradingView.supportTouch()&&"LineToolBrush"!=n||this._updateTooltip(a.localX,a.localY)};A53.prototype._equalsCursorCache=function(a,b){return TradingView.drawingState.toolIsCursor(a.tool)?a.tool===b.tool&&a.theme===b.theme&&a.crosshair===b.crosshair:a.tool===b.tool&&a.theme===b.theme};
A53.prototype._setCursor=function(a){this._cursorCache&&this._equalsCursorCache(this._cursorCache,a)||(this._cursorCache=a,TradingView.drawingState.toolIsCursor(a.tool)?this.jqPane.css("cursor",a.crosshair):this.jqPane.css("cursor",cursorCss(a.state.name,a.state.hotspot,a.theme)))};
A53.prototype.setCursorForTool=function(a,b){var c={_default:{name:"cursor_cross",hotspot:"11 11"},zoom:{name:"zoom",hotspot:"5 5"},pointer:{name:"cursor_pointinghand",hotspot:"13 7"},dragger:{name:"cursor_closed_hand",hotspot:"8 8"}},d=TradingView.drawingState.tool.value();TradingView.drawingState.toolIsCursor(d)&&(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved()?d="dragger":a&&(d="pointer"));this._chart.model()&&this._chart.model().lineBeingEdited()?
d=this._chart.model().lineBeingEdited()._constructor:b==HitTestResult.CHANGEPOINT&&(d=a._constructor);var e=c._default;d in c&&(e=c[d]);this._setCursor({tool:d,theme:"light",state:e,crosshair:this.defaultPaneCursor("light")})};A53.prototype.setDragToAnotherPaneCursor=function(){this._setCursor({tool:"dragger",theme:"light",state:{name:"cursor_closed_hand_move",hotspot:"8 8"},crosshair:this.defaultPaneCursor("light")})};
A53.prototype.defaultPaneCursor=function(a){var b={cursor:{name:"cursor_cross",hotspot:"11 11"},dot:{name:"cursor_dot",hotspot:"11 11"},crosshair:{name:"cursor_cross",hotspot:"11 11"},eraser:{name:"cursor_eraser",hotspot:"5 5"}},c=b[TradingView.drawingState.tool.value()];c||(c=b[TradingView.drawingState.cursorTool.value()]);return c?cursorCss(c.name,c.hotspot,a):"default"};A53.prototype.gestureStartEvent=function(a){this._prev_pinch_scale=1;this._pinching=!0};
A53.prototype.gestureChangeEvent=function(a){var b=(a.originalEvent.pageX||a.originalEvent.offsetX)-5,c=this._chart._paneWidgets[0].lhsPriceAxisWidget.size.w,d=this._chart.model().timeScale().width();c&&(b=Math.max(0,b-c));b=Math.min(b,d);b=2*(b/d-.5);c=5*(a.scale-this._prev_pinch_scale);0<c?this._chart.model().zoomIn(b,c):this._chart.model().zoomOut(b,-c);this._prev_pinch_scale=a.scale};A53.prototype.gestureEndEvent=function(a){this._pinching=!1};
A53.prototype._updateCommonTooltip=function(a){var b=this._lastCommonTooltipData,c=null;a&&a.hittest&&(a=a.hittest.data())&&(c=a.tooltip||null);if(null!=b||null!=c)null==c?(this._lastCommonTooltipData=null,TradingView.Tooltip.hide()):b&&c.text===b.text&&c.rect.x===b.rect.x&&c.rect.y===b.rect.y&&c.rect.w===b.rect.w&&c.rect.h===b.rect.h||(this._lastCommonTooltipData=c,b=TradingView.clone(c),c=this.jqPane.offset(),b.rect.x+=c.left,b.rect.y+=c.top,TradingView.Tooltip.show(b))};
A53.prototype.mouseMoveEvent=function(a){var b=this._chart.model();if(b){var c=a.localX,d=a.localY,e=new A53.EvironmentState(a);if(this._firstZoomPoint)this._processMouseMoveWhileZoom(a);else{if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())){this.setCursorForTool();var g=TradingView.drawingState.tool.value(),h=null;this._processing||!TradingView.drawingState.toolIsCursor(g)&&"eraser"!==g||(h=this.dataSourceAtPoint(a.localX,a.localY),
this.setCursorForTool(h.source,h.hittest?h.hittest.result():null),h?!h.source||"eraser"===g&&h.source.constructor===TradingView.Series?b.setHoveredSource(null):b.setHoveredSource(h.source,h.hittest.data()):b.setHoveredSource(null));this._updateCommonTooltip(h)}this._chart.readOnly()&&(h=this.dataSourceAtPoint(a.localX,a.localY),b.hoveredSource(),null!==h.source?b.setHoveredSource(h.source,h.hittest.data()):b.setHoveredSource(null,null));if(this._chart.model().lineBeingCreated()&&(a=this._chart.model().lineBeingCreated(),
a=this._chart.model().paneForSource(a),a!==this._state)){e=this._dv.offset();c+=e.left;d+=e.top;e=this._chart.paneByState(a)._dv.offset();c-=e.left;d-=e.top;b.setCurrentPosition(c,d,a);return}g=TradingView.drawingState.tool.value();TradingView.supportTouch()&&this.isLineTool(g)||(b.setCurrentPosition(c,d,this._state,e),this._updateTooltip(c,d))}}};
A53.prototype.pressedMouseMoveEvent=function(a){if(!this._pinching){this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0;var b=new A53.EvironmentState(a),c=this._chart.model(),d=a.localX,e=a.localY;if(this._firstZoomPoint)this._processMouseMoveWhileZoom(a),this._firstZoomPoint.draggingMode=!0;else{var g=TradingView.drawingState.tool.value();if(TradingView.supportTouch()&&this._startTouchPoint&&this.isLineTool(g)&&"LineToolBrush"!==
g&&!c.lineBeingCreated())this._chart.model().model().crossHairSource(),c=this._initCrossHairPosition,a=(new MathEx.Point(d,e)).substract(this._startTouchPoint),c=c.add(a),this._chart.model().setCurrentPosition(c.x,c.y,this._state),this._updateTooltip(c.x,c.y);else if(!TradingView.supportTouch()||!c.lineBeingCreated()||c.lineBeingCreated()instanceof TradingView.LineToolBrush){if(c.setCurrentPosition(d,e,this._state,b),this._updateTooltip(d,e),currentTool=TradingView.drawingState.tool.value(),!this.isLineTool(currentTool)||
"LineToolBrush"===g)if(0===a.button||Modernizr.touch)if("LineToolBrush"===currentTool){var h=this._state.defaultPriceScale();h.isEmpty()||(h=h.coordinateToPrice(a.localY),g=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX)),this._chart.model().coninueCreatingLine({index:g,price:h}))}else this._chart.draggingSource&&(g=a.target,(h=this._chart.paneByCanvas(g))&&(h!==this?h.setDragToAnotherPaneCursor():h.setCursorForTool()),(h=this._chart.priceAxisByCanvas(g))&&h.jqCell.css("cursor",
cursorCss("cursor_closed_hand","8 8")),(g=this._chart.timeAxisByCanvas(g))&&g.jqCell.css("cursor",cursorCss("cursor_closed_hand_move","8 8"))),c.timeScale().isEmpty()||(c.lineBeingEdited()?(c.changeLinePoint({x:d,y:e},b),this._updateTooltip(d,e),this.setCursorForTool()):c.sourceBeingMoved()?(h=c.sourceBeingMoved().priceScale(),h.isEmpty()||(g=this._chart.model().timeScale().coordinateToIndex(a.localX),h=h.coordinateToPrice(a.localY),a=c.sourceBeingMoved(),this.setCursorForTool(),isInherited(a.constructor,
W47)&&a.isFixed()?c.moveSource(new MathEx.Point(d,e)):c.moveSource({index:g,price:h},b))):(h=this._state.defaultPriceScale(),this._startScrollingPos||(this._startScrollingPos={x:a.clientX,y:a.clientY}),!this._startScrollingPos||this._startScrollingPos.x===a.clientX&&this._startScrollingPos.y===a.clientY||this._isScrolling||(c.beginUndoMacro("scroll"),h.isEmpty()||c.startScrollPrice(this._state,h,a.localY),c.startScrollTime(a.localX),this._isScrolling=!0,this.setCursorForTool(),TradingView.trackEvent("GUI",
"Scrolling by pane content dragging")),this._isScrolling&&(h.isEmpty()||c.scrollPriceTo(this._state,h,a.localY),c.scrollTimeTo(a.localX))))}else this._startTouchPoint&&(e=c.lineBeingCreated(),d=this._lastDrawingPoint.x+(a.localX-this._startTouchPoint.x),a=this._lastDrawingPoint.y+(a.localY-this._startTouchPoint.y),e=this._chart.model().paneForSource(e),c.setCurrentPosition(d,a,e),this._updateTooltip(d,a))}}};
A53.prototype._processMouseUpForCustomHandler=function(a){a=this.dataSourceAtPoint(a.localX,a.localY);a.hittest&&a.hittest.result()==HitTestResult.CUSTOM&&(a=a.hittest.data().mouseUpHandler)&&a()};
A53.prototype.mouseUpEvent=function(a){this._processMouseUpForCustomHandler(a);var b=this._chart.model(),c=this._touchMove;delete this._touchMove;var d=TradingView.drawingState.tool.value();if(TradingView.supportTouch()&&!c&&"LineToolBrush"!==d&&this.isLineTool(d)&&!b.lineBeingCreated()){var e=b.crossHairSource().currentPoint(),c=this._state.defaultPriceScale(),c=c.coordinateToPrice(e.y),g=Math.round(b.timeScale().coordinateToIndex(e.x)),g=b.createLineTool(this._state,{index:g,
price:c},d);b.setSelectedSource(g);b.lineBeingCreated()||this._finishTool(g);this._updateTooltip(e.x,e.y);delete this._startTouchPoint}else if(!b.lineBeingCreated()||b.lineBeingCreated()instanceof TradingView.LineToolBrush||!this._startTouchPoint)if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)this._finishZoom(a);else{if(0===a.button||TradingView.supportTouch()){this._processing=!1;b=this._chart.model();if(b.lineBeingEdited()){b.endChangingLinetool();this._hideTooltip();return}if("LineToolBrush"===
d){b.lineBeingCreated().finish();c=this._state.defaultPriceScale();if(c.isEmpty())return;c=c.coordinateToPrice(a.localY);g=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX));this._chart.model().coninueCreatingLine({index:g,price:c});return}if(g=b.sourceBeingMoved()){b.endMovingSource();this._hideTooltip();this.setCursorForTool(g);b.D20(new A22(A22.UPDATE_CURSOR_ONLY));return}g=this._isScrolling&&A77.undoStack().head()instanceof
UndoMacroCommand;if(this._isScrolling){c=this._state.defaultPriceScale();b.endScrollPrice(this._state,c);var h=this,k=function(){b.endScrollTime();b.endUndoMacro();h._startScrollingPos=void 0;h._isScrolling=!1;h.setCursorForTool()};if(TradingView.supportTouch()){var c=b.timeScale().m_scrollStartPoint,l=.05*(a.localX-c),m=null,n=function(c){null===m&&(m=c);c=.01*Math.min(100,3*(c-m));c=Math.sqrt(c);b.scrollTimeTo(a.localX+l*c);1<=c?k():requestAnimationFrame(n)};requestAnimationFrame(n)}else k()}if(this._chart.draggingSource){d=
a.target;(e=this._chart.paneByCanvas(d))&&e!=this&&(c=e._state.findSuitableScale(this._chart.draggingSource),g&&(g=!1,A77.undo()),this._chart.model().move(this._chart.draggingSource,e._state,c));if(c=this._chart.priceAxisByCanvas(d))e=c.pane,c=c._isLeft?e._state.leftPriceScale():e._state.rightPriceScale(),g&&(g=!1,A77.undo()),this._chart.model().move(this._chart.draggingSource,e._state,c);if(c=this._chart.timeAxisByCanvas(d))g&&(g=!1,A77.undo()),
this._chart.model().move(this._chart.draggingSource,null,null),c.jqCell.css("cursor","");this._chart.draggingSource=null;g=this.dataSourceAtPoint(a.localX,a.localY);this.setCursorForTool(g.source,g.hittest||null)}}delete this._touchMove}else{d=!1;delete this._startTouchPoint;if(!c){g=b.lineBeingCreated();d=g.points().last();c=d.price;e=g.priceScale();if(e.isPercent())var q=b.lineBeingCreated().ownerSource().firstValue(),c=e.priceRange().convertToPercent(c,q);d=b.coninueCreatingLine({index:d.index,
price:c},{});delete this._lastDrawingPoint}d&&this._finishTool(g)}};A53.prototype.mouseLeaveEvent=function(a){if(a=this._chart.model())TradingView.isMobile.any()||a.model().clearCurrentPosition(),a.setHoveredSource(null),this._updateCommonTooltip(null)};A53.prototype.mouseClickEvent=function(a){if(this._chart.model().hoveredSource()instanceof W96)this._chart.model().hoveredSource().onClicked()};
A53.prototype.showEditDialogForSource=function(a){this.chart().onWidget()||a.userEditEnabled&&!a.userEditEnabled()||(this._editDialog=new EditObjectDialog(a,this._chart.model()),this._editDialog.show())};
A53.prototype.mouseDoubleClickEvent=function(a){a=this.dataSourceAtPoint(a.localX,a.localY);if(!(this._chart.readOnly()||!a||!a.source||a.source instanceof W96||this.isLineTool(TradingView.drawingState.tool.value()))){var b=a.source;b&&b.customization&&b.customization.disableSelection||(b._metaInfo&&"Sessions@tv-basicstudies"==b._metaInfo.id&&(b=this._chart.model().mainSeries()),a.source instanceof TradingView.AlertLabel?editAlert(a.source.alert(),this._chart):this.showEditDialogForSource(b))}};
A53.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this._chart.model().setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):isInherited(a.constructor,TradingView.ESDStudyBase)?this._studyEsdContextMenu(a).show(b):isInherited(a.constructor,TradingView.Study)?this._studyContextMenu(a).show(b):isInherited(a.constructor,PublishedChartsTimeline)?this._publishedChartsContextMenu(a).show(b):isInherited(a.constructor,TradingView.LineToolOrder)||
isInherited(a.constructor,TradingView.LineToolPosition)?this._tradingDrawingsContextMenu(a).show(b):isInherited(a.constructor,W47)?this._lineContextMenu(a).show(b):isInherited(a.constructor,TradingView.AlertLabel)&&!a.fake&&this._alertLabelContextMenu(a).show(b))};
A53.prototype.contextMenuEvent=function(a,b){if(W77.enabled("pane_context_menu"))if(this._chart.model().crossHairSource().startMeasurePoint())this._chart.model().crossHairSource().clearMeasure();else if(!(this._pinching||this._disableContextMenu||this.chart().readOnly()||(this._firstZoomPoint&&(this._zoomSelector.css("display","none"),delete this._firstZoomPoint),this._chart.model().mainSeries().createSessStudy(),this._chart.updateActions(),this.hideInplaceEditor())))if(TradingView.drawingState.toolIsCursor(TradingView.drawingState.tool.value())){this._contextMenuX=
a.localX;this._contextMenuY=a.localY;var c=this.dataSourceAtPoint(a.localX,a.localY),c=c?c.source:null;null===c?(this._contextMenu(a).show(a),this._chart.model().setSelectedSource(null)):this.showContextMenuForSource(c,a);this.paint()}else TradingView.isMobile.any()||(TradingView.drawingState.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())};
A53.prototype._contextMenu=function(a){var b=this._initActions(a);a=this._customActions();a.remove.forEach(function(a){for(var c=0;c<b.length;c++)if(b[c].text===a){b.splice(c,1);break}});a=a.top.concat(b).concat(a.bottom);for(var c=a.length-1;0<c;c--)null===a[c].text&&null===a[c-1].text&&a.splice(c,1);a.length&&null===a[0].text&&a.splice(0,1);a.length&&null===a[a.length-1].text&&a.splice(a.length-1,1);return ContextMenu.createMenu(a)};
A53.prototype.createIndicatorsMenu=function(){var a=this._chart.actions(),b=new Action({text:$.t("Indicators")});b.subActions||(b.subActions=[]);var c=b.subActions;c.push(a.insertIndicator);TradingView.isMobile.any()||W77.enabled("charting_library")||c.push(a.scriptEditor);c.push(new ActionSeparator);c.push(a.paneRemoveAllStudies);return b};
A53.prototype.createDrawingMenu=function(){var a=this._chart.actions(),b=new Action({text:$.t("Drawing Tools")});b.subActions||(b.subActions=[]);var c=b.subActions;c.push(a.drawingToolbarAction);W77.enabled("charting_library")||c.push(a.favoriteDrawingToolbar);c.push(new ActionSeparator);c.push(a.magnetAction);c.push(a.stayInDrawingModeAction);c.push(new ActionSeparator);c.push(a.lockDrawingsAction);c.push(a.hideAllDrawingsAction);c.push(a.paneRemoveAllDrawingTools);return b};
A53.prototype._initActions=function(a){var b=this._chart.actions(),c=[];TradingView.D18("alerts")&&!this.chart().onWidget()&&c.unshift(this._createActionAddAlert({e:a}));this.chart().onWidget()||(a=this.createActionTrade(a))&&c.push(a);c.length&&c.push(new ActionSeparator);c.push(b.chartReset);c.push(b.symbolSearch);W77.enabled("charting_library")||c.push(b.addToWatchlist);c.push(new ActionSeparator);c.push(b.paneObjectTree);c.push(this.createIndicatorsMenu());
W77.enabled("charting_library")||c.push(b.applyStudyTemplate);c.push(this.createDrawingMenu());W77.enabled("charting_library")&&c.push(b.hideAllMarks);c.push(b.compareOrAdd);(a=this._priceAxisMenu())&&c.push(a);(a=this._timeAxisMenu())&&c.push(a);c.push(new ActionSeparator);W77.enabled("charting_library")||c.push(b.applyColorTheme);c.push(b.chartProperties);pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&(c.push(new ActionSeparator),c.push(this._createMTPredictorActions()));
return c};
A53.prototype._customActions=function(){var a={top:[],bottom:[],remove:[]},b=this._chart.model().timeScale(),c=this._state.defaultPriceScale();if(!W77.enabled("custom_items_in_context_menu"))return a;b=b.isEmpty()?void 0:b.indexToUserTime(b.coordinateToIndex(this._contextMenuX));D17.emit("onContextMenu",{unixtime:b?b/1E3:void 0,price:c.isEmpty()?void 0:c.coordinateToPrice(this._contextMenuY),callback:function(b){[].concat(b).forEach(function(b){if(b.text)if(1<b.text.length&&
"-"===b.text[0])a.remove.push(b.text.slice(1));else{var c;"-"===b.text?c=new ActionSeparator:(c=new Action({text:b.text}),c.callbacks().subscribe(null,b.click));b.position&&"top"==b.position?a.top.push(c):a.bottom.push(c)}})}});return a};A53.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var a=this._chart.getTimeScale();return new Action({text:"Time Scale",subActions:a.getContextMenuActions()})};
A53.prototype._priceAxisMenu=function(){var a=this._state.defaultPriceScale();if(a.isEmpty())return null;a=a===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget();return new Action({text:"Price Scale",subActions:a.getContextMenuActions()})};
A53.prototype._seriesContextMenu=function(a){var b=this._chart.actions(),c=a.properties().visible.value(),d=null;if(this._chart.readOnly())a=[c?b.seriesHide:this.createActionShow(a),new ActionSeparator,this.createActionShowCountdown(a),new ActionSeparator,this.createActionScaleLeft(a),this.createActionScaleRight(a),this.createActionNoScale(a)],W77.enabled("countdown")||a.splice(3,1),d=ContextMenu.createMenu(a);else{d=this._mergeContentMenuItems(a);c=[b.compare,c?b.seriesHide:
this.createActionShow(a),this.createVisualOrderAction(a),new ActionSeparator,this.createActionShowCountdown(a),new ActionSeparator];W77.enabled("countdown")||c.splice(5,1);this.chart().onWidget()||c.unshift(b.format);this.chart().canCreateAlertForDataSource(a)&&c.unshift(this._createActionAddAlert({series:a}));if(b=this.createActionLockScale(a))c.push(b),c.push(new ActionSeparator);if(0<d.length){for(b=0;b<d.length;b++)c.push(d[b]);c.push(new ActionSeparator)}c.push(this.createActionScaleLeft(a));
c.push(this.createActionScaleRight(a));c.push(this.createActionNoScale(a));pro.hasPackage("mtp-mtpredictor")&&(c.push(new ActionSeparator),c.push(this._createMTPredictorActions()));d=ContextMenu.createMenu(c)}return d};
A53.prototype._createMTPredictorActions=function(){var a=this,b=function(b,d,e){b=new Action({text:b});b.callbacks().subscribe(a,function(){var a=this._chart.model(),b=a.timeScale(),c=this._state.defaultPriceScale();b.isEmpty()||c.isEmpty()||(e?(c=c.coordinateToPrice(this._contextMenuY),b=Math.round(b.coordinateToIndex(this._contextMenuX)),a.createLineTool(this._state,{index:b,price:c},d)):TradingView.drawingState.tool.setValue(d))});return b};return new Action({text:"MTPredictor",
subActions:[b("Apply Manual Risk/Reward","LineStudyMtpRiskReward",!1),b("Apply Manual Decision Point","LineStudyMtpDecisionPoint",!0),b("Analyze Trade Setup","LineStudyMtpAnalysis",!0),new Action({text:"Apply Elliot Wave",subActions:[b("Apply Elliot Wave Intermediate","LineStudyMtpElliotWaveMain",!0),b("Apply Elliot Wave Major","LineStudyMtpElliotWaveMajor",!0),b("Apply Elliot Wave Minor","LineStudyMtpElliotWaveMinor",!0)]}),new Action({text:"Apply WPT Up Wave",subActions:[b("Up Wave 1 or A","LineStudyMtpUpWave1OrA",
!1),b("Up Wave 2 or B","LineStudyMtpUpWave2OrB",!1),b("Up Wave C","LineStudyMtpUpWaveC",!1),b("Up Wave 3","LineStudyMtpUpWave3",!1),b("Up Wave 4","LineStudyMtpUpWave4",!1),b("Up Wave 5","LineStudyMtpUpWave5",!1)]}),new Action({text:"Apply WPT Down Wave",subActions:[b("Down Wave 1 or A","LineStudyMtpDownWave1OrA",!1),b("Down Wave 2 or B","LineStudyMtpDownWave2OrB",!1),b("Down Wave C","LineStudyMtpDownWaveC",!1),b("Down Wave 3","LineStudyMtpDownWave3",!1),b("Down Wave 4","LineStudyMtpDownWave4",!1),
b("Down Wave 5","LineStudyMtpDownWave5",!1)]})]})};A53.prototype.createEarningsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowEarnings;a=new Action({checkable:!0,text:"Show Earnings",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Earnings")});return a};
A53.prototype.createDividendsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowDividends;a=new Action({checkable:!0,text:"Show Dividends",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Dividends")});return a};
A53.prototype.createSplitsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowSplits;a=new Action({checkable:!0,text:"Show Splits",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Splits")});return a};
A53.prototype._studyEsdContextMenu=function(a){var b=[];this._chart.readOnly()||(b.push(this.createDividendsShow(a)),b.push(this.createSplitsShow(a)),b.push(this.createEarningsShow(a)));return ContextMenu.createMenu(b)};
A53.prototype._studyContextMenu=function(a){var b=this._chart.actions(),c=a.properties().visible.value(),d=[],e=null;if(!a.userEditEnabled())return e=ContextMenu.createMenu(d);a.properties().linkedToSeries&&a.properties().linkedToSeries.value()?this._chart.readOnly()?d.push(c?b.studyHide:this.createActionShow(a)):(this._chart.canCreateAlertForDataSource(a)&&d.push(this._createActionAddAlert({series:a})),d.push(b.format),d.push(c?b.studyHide:this.createActionShow(a)),d.push(this.createVisualOrderAction(a)),
d.push(new ActionSeparator),d.push(b.studyRemove)):this._chart.readOnly()?d=[c?b.studyHide:this.createActionShow(a),new ActionSeparator,this.createActionScaleLeft(a),this.createActionScaleRight(a),this.createActionNoScale(a)]:(e=[],d=a.metaInfo(),d.TVScriptSourceCode&&d.scriptIdPart&&(e=[b.viewSourceCode]),d=[],d=d.concat([b.format]),d=d.concat(e),d=d.concat([c?b.studyHide:this.createActionShow(a),this.createVisualOrderAction(a),new ActionSeparator]),c=this._mergeContentMenuItems(a),c.length&&c.push(new ActionSeparator),
d=d.concat(c),d.push(this.createActionScaleLeft(a)),d.push(this.createActionScaleRight(a)),d.push(this.createActionNoScale(a)),d.push(new ActionSeparator),d.push(b.studyRemove),this._chart.canCreateAlertForDataSource(a)&&d.unshift(this._createActionAddAlert({series:a})));return e=ContextMenu.createMenu(d)};
A53.prototype.createLineToolTemplateAction=function(a){var b=a.properties(),c=window.lineToolPropertiesToolbar.templatesList,d=new Action({text:$.t("Templates")});d.subActions||(d.subActions=[]);var e=d.subActions,g=new Action({text:$.t("Save As...")});g.callbacks().subscribe(this,function(){c.showSaveDialog(a)});e.push(g);g=new Action({text:$.t("Apply Default")});g.callbacks().subscribe(this,function(){b.restoreFactoryDefaults();window.lineToolPropertiesToolbar.onSourceChanged(a)});
e.push(g);var h=$.Deferred();c.templatesLoaded().then(function(){var a=c.getData(),b=[];0!=a.length&&b.push(new ActionSeparator);$.each(a,function(a,d){var e=new Action({text:d});e.callbacks().subscribe(this,function(){c.loadTemplate(d)});e.deleteButton={action:function(a){return function(){var b=this.getTopLevelMenu();b&&b.hide();c.deleteAction(a);return!0}}(e.text)};b.push(e)});h.resolve(b)});g=new ActionPlaceholder(h);e.push(g);return d};
A53.prototype._publishedChartsContextMenu=function(a){var b=this._chart.actions(),c=[];c.push(b.lineHide);if(is_authenticated){var b=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_NONE,checkable:!0,text:$.t("Suggested ideas & my ideas"),callbackContext:{target:a,value:PublishedChartsTimeline.FILTER_NONE}}),d=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_FOLLOWING,checkable:!0,text:$.t("Ideas of the people I follow & my ideas"),
callbackContext:{target:a,value:PublishedChartsTimeline.FILTER_FOLLOWING}});a=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_PRIVATE,checkable:!0,text:$.t("My ideas only"),callbackContext:{target:a,value:PublishedChartsTimeline.FILTER_PRIVATE}});var e=function(a){var b=a.callbackContext();a=b.target;b=b.value;console.log(b);a.properties().filter.setValue(b);a.updateAllViews();a.D0.updateSource(a)};b.callbacks().subscribe(null,e);d.callbacks().subscribe(null,
e);a.callbacks().subscribe(null,e);c.push(new ActionSeparator);c.push(b);c.push(d);c.push(a)}return ContextMenu.createMenu(c)};
A53.prototype._lineContextMenu=function(a){var b=this._chart.actions(),c=[];if(this._chart.readOnly())c.push(b.lineHide);else if(a.userEditEnabled()){TradingView.D18("alerts")&&TradingView.D18("drawing_alerts")&&!this.chart().onWidget()&&(a.hasAlert.value()?c.push(this._createEditAlertDrawingAction(a)):a.canHasAlert()&&c.push(this._createActionAddAlert({drawing:a})));PropertyPagesFactory.hasStylesPropertyPage(a,this._chart.model())&&c.push(b.format);c.push(b.paneObjectTree);
W77.enabled("charting_library")||c.push(this.createLineToolTemplateAction(a));c.push(this.createVisualOrderAction(a));c.push(new ActionSeparator);c.push(b.lineHide);c.push(b.lineToggleLock);if(a.properties().clonable){var d=new Action({text:$.t("Clone"),callbackContext:{target:a}});d.callbacks().subscribe(this,A53.prototype.cloneLineTool.bind(this,a));c.push(d)}c.push(b.lineRemove);if(a.additionalActions)for(c.push(new ActionSeparator),b=a.additionalActions(this._chart.model()),
d=0;d<b.length;d++)c.push(b[d])}this._state.D19();b=new List;if(1<b.size()){for(var e=[],d=0;d<b.size();d++){var g=b.item(d),g=new Action({checked:g===a.ownerSource(),checkable:!0,text:g.title(),callbackContext:{target:a,owner:g}});g.callbacks().subscribe(null,this._lineContextMenu._actionCallback);e.push(g)}a=new Action({subActions:e,text:$.t("Link To")});c.push(new ActionSeparator);c.push(a)}return ContextMenu.createMenu(c)};
A53.prototype._alertLabelContextMenu=function(a){a=[this._createEditAlertLabelAction(a),this._createStopAlertLabelAction(a),this._createDeleteAlertLabelAction(a),new ActionSeparator,this._createAlertToggleHorzLineLabelAction(a),new ActionSeparator,this._createShowGlobalAlertPropertiesLabelAction(a)];return ContextMenu.createMenu(a)};A53.prototype._tradingDrawingsContextMenu=function(a){return ContextMenu.createMenu(a.contextMenuItems())};
A53.prototype._createAlertToggleHorzLineLabelAction=function(a){var b=a.properties().line.visible,c=new Action({checkable:!0,text:"Extend Alert Line",enabled:!0,checked:b.value()});c.callbacks().subscribe(this,function(a){a=a.checked;var c=(a?"Show":"Hide")+" alert label line";this._chart.model().setProperty(b,a,c)});c.setEnabled(a.globalProperties().line.visible.value());return c};
A53.prototype._createShowGlobalAlertPropertiesLabelAction=function(a){var b=this.chart();a=new Action({text:"Visual settings..."});a.callbacks().subscribe(this,function(a){a=b.showChartProperties().find(".properties-tabs-label").filter(function(){return"Events"===$(this).text()});a.length&&a.trigger("click")});return a};
A53.prototype._createEditAlertDrawingAction=function(a){if(a.hasAlert.value()){var b=this.chart(),c=new Action({text:"Edit "+a.title()+" Alert..."});c.callbacks().subscribe(null,function(){runOrSignIn(function(){a.getAlert(function(c){c?editAlert(c,b):console.warn("[Alerts] No alert for "+a.title())})})});return c}};
A53.prototype._createEditAlertLabelAction=function(a){var b=this.chart(),c=new Action({text:"Edit Alert..."});c.callbacks().subscribe(this,function(){editAlert(a.alert(),b)});return c};A53.prototype._createDeleteAlertLabelAction=function(a){var b=new Action({text:"Delete Alert"});b.callbacks().subscribe(this,function(){deleteAlert(a.alert())});return b};
A53.prototype._createStopAlertLabelAction=function(a){var b=new Action({text:"Stop Alert"});b.callbacks().subscribe(this,function(){stopAlert(a.alert())});return b};
A53.prototype._lineContextMenu._actionCallback=function(a){a=a.callbackContext();var b=[],c=a.target.priceScale();if(c.isPercent())var d=a.target.ownerSource().firstValue();for(var e=a.target.points().toArray(),g=this._chart,h=0;h<e.length;h++){var k=e[h].price;c.isPercent()&&(k=c.priceRange().convertToPercent(k,d));k=c.priceToCoordinate(k);b.push(k)}a.target.setOwnerSource(a.owner);c=a.owner.priceScale();g.model().move(a.target,that._state,c);for(h=0;h<b.length;h++)k=c.coordinateToPrice(b[h]),
d=e[h],d.price=k,a.target.setPoint(h,d);g.model().model().recalculateAllPanes()};A53.prototype.cloneLineTool=function(a){this._chart.model().cloneLineTool(a)};A53.prototype.setPriceAxisSize=function(a,b){this._priceAxisWidget(a).setSize(b)};A53.prototype.setPriceAxisVisible=function(a,b){this._priceAxisWidget(a).setVisible(b);this._cachedStatus=null};
A53.prototype.resetPriceAxisOptimalWidth=function(a){this._priceAxisWidget(a).resetOptimalWidth();this._cachedStatus=null};A53.prototype.setSize=function(a){this.size&&this.size.equals(a)||(this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,a),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(a.w),this.jqPane.height(a.h),this._cachedStatus=null)};
A53.prototype.dataSourceAtPoint=function(a,b){var c=null,d=null;if(!this._state)return null;for(var e=new List(this._state.hitTestSources()),g=e.size();0<g--;){var h=e.item(g),k=h.paneViews(this._state);if(k){for(var l=k.size();0<l--;){var m=k.item(l).renderer();if(m&&m.hitTest&&(m=m.hitTest(new MathEx.Point(a,b)))){d=m;c=h;break}}if(c)break}}if(this.containsMainSeries())for(e=this._chart.model().barsMarksSources(),g=0;g<e.length;++g)for(h=e[g],k=h.paneViews(),g=0;g<k.size();g++)if(m=
k.item(g).renderer(),l=m.hitTest(new MathEx.Point(a,b))){d=l;c=h;break}null===c&&(c=this.legendWidget.dataSourceAtPoint(a,b));return{source:c,hittest:d}};A53.prototype.update=function(){this.lhsPriceAxisWidget.update();this.rhsPriceAxisWidget.update();this.legendWidget.update();this.paneControls&&this.paneControls.update()};A53.prototype.updateControls=function(){this.paneControls&&this.paneControls.update()};
A53.prototype.drawBackground=function(a,b){clearRect(a,0,0,this.size.w,this.size.h,b)};A53.prototype.drawGrid=function(a){for(var b=this._chart.model().gridSource().paneViews(this._state),c=0;c<b.size();c++){a.save();var d=b.item(c).renderer();d&&d.draw(a);a.restore()}};
A53.prototype.drawWatermark=function(a){for(var b=this._chart.model().watermarkSource().paneViews(this._state),c=0;c<b.size();c++){a.save();var d=b.item(c).renderer();d&&d.draw(a);a.restore()}};A53.prototype.drawCrossHair=function(a){var b=this._chart.model().crossHairSource();this._drawSource(b,a)};
A53.prototype._drawSource=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.size();d++){var e=c.item(d).renderer();e&&(b.save(),e.draw(b),b.restore())}};A53.prototype._drawSourceBackground=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.size();d++){var e=c.item(d).renderer();e&&e.drawBackground&&(b.save(),e.drawBackground(b),b.restore())}};
A53.prototype.drawActiveLineTool=function(a){for(var b=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()],c=0;c<b.length;c++){var d=b[c];d&&this._chart.model().paneForSource(d)===this._state&&this._drawSource(d,a)}};A53.prototype.disableDrawOnTop=function(a){return a&&a.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===a._metaInfo.id};
A53.prototype.drawSources=function(a){var b=this._state.orderedSources(),c=this._state.model(),d=this._chart.model().hoveredSource(),c=c.crossHairSource(),e=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];this.disableDrawOnTop(d)&&(d=void 0);for(var g=0;g<b.length;g++)this._drawSourceBackground(b[g],a);for(g=0;g<b.length;g++){var h=b[g];h!==c&&h!==d&&-1===e.indexOf(h)&&this._drawSource(h,a)}d&&-1===e.indexOf(d)&&
-1!==b.indexOf(d)&&this._drawSource(d,a)};A53.prototype.recalculatePriceScale=function(){var a=this._state;a.recalculatePriceScale(a.m_rightPriceScale);a.recalculatePriceScale(a.m_leftPriceScale);for(var b=0;b<a.D19().size();++b){var c=a.D19().item(b);a.isOverlay(c)&&(a.recalculatePriceScale(c.priceScale()),c.updateAllViews())}};A53.prototype.containsMainSeries=function(){return this._state.containsMainSeries()};
A53.prototype.drawBarsMarks=function(a,b){if(this.containsMainSeries()&&!b){var c=this;this._chart.model().barsMarksSources().map(function(b){c._drawSource(b,a)})}};
A53.prototype._syncOverlays=function(){var a=this._state.orderedSources(),b={},c=this;$.each(a,function(){var a=this.paneViews(c._state);if(a)for(var d=0;d<a.size();d++){var h=a.item(d);h.uid&&(b[h.uid()]=h)}});for(var d in this._overlays)b[d]||(this._dv.remove(this._overlays[d]),this._overlays[d]=void 0);for(d in b)this._overlays[d]||(a=b[d].overlay(),this._dv.append(a),this._overlays[d]=a)};
A53.prototype.paint=function(a,b){if(a&&this._chart.model())if(this.lhsPriceAxisWidget.paint(a),this.rhsPriceAxisWidget.paint(a),a===A22.FULL_UPDATE&&(this._cachedStatus=null),a===A22.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(0,0,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var c=this.ctx;this.top_ctx.clearRect(0,0,this.size.w,this.size.h);this.drawBackground(c,this.backgroundColor());
this._state&&(this.recalculatePriceScale(),this.drawGrid(c),this.drawWatermark(c),this.drawSources(c),this.drawBarsMarks(c,b),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx))}};A53.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget};A53.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget};
A53.prototype._priceAxisWidget=function(a){return A54.isLeft(a)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget};A53.prototype.statusWidget=function(){return this.legendWidget};A53.prototype.onScaleLeft=function(a){a=a.callbackContext();this._state.leftPriceScale().D19().contains(a)||this.chart().model().move(a,this._state,this._state.leftPriceScale())};
A53.prototype.onScaleRight=function(a){a=a.callbackContext();this._state.rightPriceScale().D19().contains(a)||this.chart().model().move(a,this._state,this._state.rightPriceScale())};A53.prototype.onNoScale=function(a){a=a.callbackContext();this._state.isOverlay(a)||this.chart().model().move(a,this._state,null)};A53.prototype.onRiskReward=function(a){a.callbackContext()};
A53.prototype.createActionTrade=function(a){if(!TradingView.Trading||!TradingView.D18("paper_trading"))return null;var b=this._state.D19().find(function(a){return a instanceof TradingView.Series}),c=NaN,d=NaN,e=1,g="",h="",k="",l=!1;b&&(h=b.actualSymbol(),k=(b.symbolInfo()||{}).name||h,l=b.priceScale(),a&&(c=l.coordinateToPrice(a.localY),l.isPercentage()&&(a=this._state.mainDataSource().firstValue(),c="undefined"!=typeof a?l.priceRange().convertFromPercent(c,
a):null),g=b.formatter().format(c)),(l=b.bars().last())&&(d=l.value[CLOSE_PLOT]),l=!!(b.symbolInfo()||{}).is_tradable,l=!0,a=b.symbolInfo(),e=TradingView.Trading.suggestedQty.value(h,{symbolType:a&&a.type}));a=[];c<d?(d=new Action({text:"Buy "+k+" Limit "+abbreviatedNumber(e)+" @ "+g,enabled:l}),l&&d.callbacks().subscribe(null,function(){runOrSignIn(function(){TradingView.OrderDialog.get().open({symbol:h,price:+g||c,side:"buy",type:"limit",qty:e,noConfirm:!0})})}),a.push(d),d=new Action({text:"Sell "+
k+" Stop "+abbreviatedNumber(e)+" @ "+g,enabled:l}),l&&d.callbacks().subscribe(null,function(){runOrSignIn(function(){TradingView.OrderDialog.get().open({symbol:h,price:+g||c,side:"sell",type:"stop",qty:e,noConfirm:!0})})}),a.push(d)):c>d&&(d=new Action({text:"Sell "+k+" Limit "+abbreviatedNumber(e)+" @ "+g,enabled:l}),l&&d.callbacks().subscribe(null,function(){runOrSignIn(function(){TradingView.OrderDialog.get().open({symbol:h,price:+g||c,side:"sell",type:"limit",qty:e,noConfirm:!0})})}),a.push(d),
d=new Action({text:"Buy "+k+" Stop "+abbreviatedNumber(e)+" @ "+g,enabled:l}),l&&d.callbacks().subscribe(null,function(){runOrSignIn(function(){TradingView.OrderDialog.get().open({symbol:h,price:+g||c,side:"buy",type:"stop",qty:e,noConfirm:!0})})}),a.push(d));d=new Action({text:"Create New Order...",enabled:l});l&&d.callbacks().subscribe(null,function(){runOrSignIn(function(){TradingView.OrderDialog.get().open({qty:e,symbol:b.actualSymbol(),price:+g||c})})});a.push(d);a.push(new ActionSeparator);
d=new Action({text:"Trading Properties..."});d.callbacks().subscribe(null,function(){TradingView.bottomWidgetBar.showTradingProperties()});a.push(d);return new Action({text:"Trading",subActions:a})};A53.prototype.createActionRiskReward=function(a){var b=new Action({checkable:!1,text:"Risk/Reward",enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onRiskReward);return b};
A53.prototype.createActionScaleLeft=function(a){var b=new Action({checkable:!0,text:$.t("Scale Left"),enabled:!0});b.setCallbackContext(a);b.setChecked(this._state.leftPriceScale().D19().contains(a));b.callbacks().subscribe(this,A53.prototype.onScaleLeft);return b};
A53.prototype.createActionScaleRight=function(a){var b=new Action({checkable:!0,text:$.t("Scale Right"),enabled:!0});b.setCallbackContext(a);b.setChecked(this._state.rightPriceScale().D19().contains(a));b.callbacks().subscribe(this,A53.prototype.onScaleRight);return b};
A53.prototype.createActionNoScale=function(a){var b=this._chart.model().paneForSource(a).actionNoScaleIsEnabled(a),b=new Action({checkable:!0,text:$.t("Screen (No Scale)"),enabled:b});b.setCallbackContext(a);b.setChecked(this._state.isOverlay(a));b.callbacks().subscribe(this,A53.prototype.onNoScale);return b};
A53.prototype.createActionShowCountdown=function(a){a=new Action({checkable:!0,text:"Show Countdown",enabled:!0});var b=this._chart.model().mainSeries().properties();a._binding=new D14(a,b.showCountdown,this._chart.model(),a.text);a._binding.setValue(b.showCountdown.value());return a};
A53.prototype.createActionLockScale=function(a){if(!(a instanceof TradingView.Series))return null;var b=new Action({checkable:a.properties().lockScale.value(),text:$.t("Lock Scale"),enabled:!0});b._binding=new D14(b,a.properties().lockScale,this._chart.model(),b.text,function(b){this._undoModel.setLockScaleProperty(this._property,b.checked,a,this._undoText)});return b};
A53.prototype.createActionMergeUp=function(a){if(this._chart.model().paneForSource(a)===this._chart.model().panes().item(0))return null;var b=new Action({checkable:!1,text:$.t("Merge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onMergeUp);return b};
A53.prototype.onMergeUp=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().panes().item(b-1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
A53.prototype.createActionUnmergeUp=function(a){if(!(1<this._chart.model().paneForSource(a).D19().count(function(a){return isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()})))return null;var b=new Action({checkable:!1,text:$.t("Unmerge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onUnmergeUp);return b};
A53.prototype.onUnmergeUp=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().createPane(b),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
A53.prototype.createActionMergeDown=function(a){var b=this._chart.model().paneForSource(a),c=this._chart.model().panes();if(b===c.item(c.size()-1))return null;b=new Action({checkable:!1,text:$.t("Merge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onMergeDown);return b};
A53.prototype.onMergeDown=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().panes().item(b+1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
A53.prototype.createActionUnmergeDown=function(a){if(!(1<this._chart.model().paneForSource(a).D19().count(function(a){return isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()})))return null;var b=new Action({checkable:!1,text:$.t("Unmerge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onUnmergeDown);return b};
A53.prototype.onUnmergeDown=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().createPane(b+1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
A53.prototype._mergeContentMenuItems=function(a){var b=[],c=this.createActionMergeUp(a);c&&b.push(c);(c=this.createActionUnmergeUp(a))&&b.push(c);(c=this.createActionMergeDown(a))&&b.push(c);(c=this.createActionUnmergeDown(a))&&b.push(c);return b};
A53.prototype.createActionShow=function(a){var b=new Action({checkable:!0,text:$.t("Show"),enabled:!0});b._binding=new D14(b,a.properties().visible,this._chart.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};A53.prototype.bringObjectForward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,1)};
A53.prototype.sendObjectToBack=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().sendToBack(a)};A53.prototype.bringObjectToFront=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().bringToFront(a)};A53.prototype.sendObjectBackward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,-1)};
A53.prototype.createVisualOrderAction=function(a){var b=new Action({text:$.t("Visual Order")});b.subActions||(b.subActions=[]);var c=new Action({text:$.t("Bring to Front")});c.callbacks().subscribe(this,A53.prototype.bringObjectToFront);b.subActions.push(c);var d=new Action({text:$.t("Send to Back")});d.callbacks().subscribe(this,A53.prototype.sendObjectToBack);b.subActions.push(d);var e=new Action({text:$.t("Bring Forward")});e.callbacks().subscribe(this,
A53.prototype.bringObjectForward);b.subActions.push(e);var g=new Action({text:$.t("Send Backward")});g.callbacks().subscribe(this,A53.prototype.sendObjectBackward);b.subActions.push(g);var h=this._chart.model().paneForSource(a).getZOrderMinMax();d.setEnabled(!0);e.setEnabled(!0);g.setEnabled(!0);c.setEnabled(!0);a.zorder()===h.minZOrder&&(d.setEnabled(!1),g.setEnabled(!1));a.zorder()===h.maxZOrder&&(e.setEnabled(!1),c.setEnabled(!1));return b};
A53.prototype._createActionAddAlert=function(a){function b(a){void 0===a||null===a||isNaN(a)||(e+=" ("+a+") ",d.value=a)}var c=this._chart,d={},e="Add Alert",g=this._state;if(a.series){var h,k;a.series instanceof TradingView.Series?k=a.series.lastValueData(null,!0,!0):a.series instanceof TradingView.Study&&(g=a.series.metaInfo().plots[0].id,k=a.series.lastValueData(g,!0,!0));k&&(h=k.price);h&&(g=(a.series.priceScale()||this._state.mainDataSource().priceScale()||c.model().mainSeries().priceScale()).formatter(),
g.formatAsDecimal&&(h=g.formatAsDecimal(h)),b(h));d.series=a.series}else a.e?(h=g.defaultPriceScale(),a=h.coordinateToPrice(a.e.localY),h.isPercentage()&&(k=this._state.mainDataSource().firstValue(),a="undefined"!=typeof k?h.priceRange().convertFromPercent(a,k):null),b(this._state.mainDataSource().formatter().formatAsDecimal(a)),a=g.mainDataSource(),d.series=a):a.drawing&&(e+=" on "+a.drawing.title(),d={drawing:a.drawing});e+="...";a=new Action({text:e});a.callbacks().subscribe(null,function(){runOrSignIn(function(){new TradingView.MakeAlertDialog(c,
d)})});return a};A53.prototype.image=function(){var a={};a.leftAxis=this.leftPriceAxisWidget().image();a.rightAxis=this.rightPriceAxisWidget().image();a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;return a};A53.prototype._updateTooltip=function(a,b){if(!this._rafSet){var c=this;requestAnimationFrame(function(){c._updateTooltipImpl(a,b);c._rafSet=!1});this._rafSet=!0}};
A53.prototype._updateTooltipImpl=function(a,b){function c(c){TradingView[g].getTooltipText&&(c=TradingView[g].getTooltipText(h)||c);d._tooltipSelector.html(c).removeClass("tooltip-selector-hidden").css(TradingView.isMobile.any()?{left:a-d._tooltipSelector.outerWidth()-16,top:b-d._tooltipSelector.outerHeight()-16}:{left:a+16,top:b+16})}if(this._chart){for(var d=this,e=this._chart._paneWidgets,g=TradingView.drawingState.tool.value(),h=this._state.model().lineBeingCreated(),k=e.length-
1;0<=k;k--)e[k]._hideTooltip();TradingView.Study.isStudyLineTool(g)&&!TradingView.isMobile.any()?c($.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!=g&&d.isLineTool(g)&&!d._chart.model().lineBeingCreated()?c($.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!=g&&d.isLineTool(g)&&c($.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor"))}};
A53.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")};function EditObjectDialog(a,b,c){this.W99=a;this.D0=b;this._undoCheckpoint=c}$.extend(EditObjectDialog,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_GRAPHICS:"Graphics",TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300});
EditObjectDialog.prototype.hide=function(a){A83.destroy(this._dialogTitle,{undoChanges:!!a})};
EditObjectDialog.prototype._onDestroy=function(a,b){var c=(b||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog");c?(c=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this.D0.undoToCheckpoint(c):this.W99.hasAlert.value()&&this.W99.needSynchronizeAlertWithServer&&this.W99.synchronizeAlert(!0);this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow;window.lineToolPropertiesToolbar&&lineToolPropertiesToolbar.refresh()};
EditObjectDialog.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")};EditObjectDialog.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()};
EditObjectDialog.prototype.switchTab=function(a,b){if(this._tabs){var c=null;a?a=a.valueOf():null===a&&(a=void 0);"string"==typeof a&&$.each(this._tabs,function(b,d){if(d.name==a)return c=d,!1});"object"==typeof a&&$.each(this._tabs,function(b,d){if(a==d||$(d.labelObject).is(a)||$(d.wrapperObject).is(a))return c=d,!1});c||(c=this._tabs[~~a]);if(!c)return!1;$.each(this._tabs,function(a,b){var d=b==c;$(b.wrapperObject)[d?"show":"hide"]();$(b.labelObject)[d?"addClass":"removeClass"]("active")});if(b){var d=
this.activeTabSettingsName();d&&TVSettings.setValue(d,c.name)}return!0}};
EditObjectDialog.prototype.appendToTab=function(a,b,c,d,e,g){if(!$(a).is("table")||$(a).find("tr").size()){var h;this._tabs||(this._tabs=[]);$.each(this._tabs,function(a,c){if(c.name==b)return h=a,!1});void 0===h&&(this._tabs.push({name:b,localizedName:$.t(b),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!e,callback:e?g||function(){}:null}),h=this._tabs.length-1);e=this._tabs[h];e.objects=e.objects.add(a);e.displayPriority=Math.max(e.displayPriority||0,c||0);e.defaultOpen=Math.max(e.defaultOpen||
0,d||0)}};
EditObjectDialog.prototype.insertTabs=function(){function a(a){e&&e===a.name&&(a.defaultOpen=Math.max(~~a.defaultOpen,EditObjectDialog.TAB_OPEN_USERSAVE));if(!c||~~c.defaultOpen<~~a.defaultOpen)c=a;a.labelObject=$('<a href="#" class="properties-tabs-label"></a>').text(a.localizedName).appendTo(b._tabContainer);a.labelObject.bind("click",function(a){a.preventDefault();b.switchTab(this,!0)});var d=$('<div class="main-properties"></div>');a.wrapperObject=$().add(d);a.objects.each(function(b,c){var e=
$(c);e.is("table")?(e.data("layout-separated")&&(a.wrapperObject=a.wrapperObject.add('<div class="properties-separator"></div>').add(d=$('<div class="main-properties"></div>')),e.removeData("layout-separated")),d.append(e),e.children("tbody").each(function(b,e){if(0!==b&&$(e).data("layout-separated")){a.wrapperObject=a.wrapperObject.add('<div class="properties-separator"></div>').add(d=$('<div class="main-properties"></div>'));var k=$(c).clone(!0,!1).appendTo(d);k.children().remove();k.append(e);
$(e).removeData("layout-separated")}})):d.append(e)});a.wrapperObject.appendTo(b._container)}if(this._tabs){this._tabs.sort(function(a,b){return(b.displayPriority||0)-(a.displayPriority||0)});var b=this,c=null,d=this.activeTabSettingsName();if(d)var e=TVSettings.getValue(d);$.each(this._tabs,function(c,d){d.isButton?(d.labelObject=$('<a href="#" class="properties-tabs-label"></a>').text(d.localizedName).appendTo(b._tabContainer),d.labelObject.bind("click",d.callback)):a(d)});this.switchTab(c)}};
EditObjectDialog.prototype.activeTabSettingsName=function(){var a=this.W99;if(a){if(a instanceof TradingView.Series||a instanceof A7)return"properties_dialog.active_tab.chart";if(a instanceof W47)return"properties_dialog.active_tab.drawing";if(a instanceof TradingView.Study)return"properties_dialog.active_tab.study"}};
EditObjectDialog.prototype.show=function(a){function b(){g.hide(!0)}a=a||{};isInherited(this.W99.constructor,A7)&&TradingView.trackEvent("GUI","Chart Properties");isInherited(this.W99.constructor,TradingView.Study)&&TradingView.trackEvent("GUI","Study Properties");isInherited(this.W99.constructor,DataSource)&&this.D0.setSelectedSource(this.W99);var c=PropertyPagesFactory.createInputsPropertyPage(this.W99,this.D0),d=PropertyPagesFactory.createStylesPropertyPage(this.W99,
this.D0),e=PropertyPagesFactory.createDisplayPropertyPage(this.W99,this.D0);if(c||d){var g=this,h=null!==c,k=this.W99.title(),l=A83.createDialog(k,{hideTitle:!0,dragHandle:".properties-tabs"}),m=l.find(".tv-dialog-content"),n=$('<div class="properties-tabs"></div>').appendTo(m);this._tabs=[];this._dialog=l;this._dialogTitle=k;this._dialog=l;this._container=m;this._tabContainer=n;this._undoCheckpointOnShow=this.D0.createUndoCheckpoint();l.on("destroy",function(a,b){g._onDestroy(a,
b);c&&c.destroy();d&&d.destroy();e&&e.destroy()});a.selectScales&&d.setScalesOpenTab&&d.setScalesOpenTab();a.selectTmz&&d.setTmzOpenTab&&d.setTmzOpenTab();this.D0.readOnly()||!h||c.widget().is(":empty")||c.widget().each(function(a,b){var d=c instanceof $14,e=+$(b).data("layout-tab-priority");isNaN(e)&&(e=d?EditObjectDialog.TAB_PRIORITY_COORDINATES:EditObjectDialog.TAB_PRIORITY_INPUTS);var h=~~$(b).data("layout-tab-open"),k=$(b).data("layout-tab");void 0===k&&(k=d?EditObjectDialog.TAB_NAME_COORDINATES:
EditObjectDialog.TAB_NAME_INPUTS);g.appendToTab(b,k,e,h)});d&&d.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");isNaN(c)&&(c=EditObjectDialog.TAB_PRIORITY_STYLE);var e=~~$(b).data("layout-tab-open");!e&&d instanceof $49&&(e=EditObjectDialog.TAB_OPEN_DEFAULT);var h=$(b).data("layout-tab");void 0===h&&(h=EditObjectDialog.TAB_NAME_STYLE);g.appendToTab(b,h,c,e)});e&&e.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");isNaN(c)&&(c=EditObjectDialog.TAB_PRIORITY_DISPLAY);
var d=~~$(b).data("layout-tab-open"),e=$(b).data("layout-tab");void 0===e&&(e=EditObjectDialog.TAB_NAME_DISPLAY);g.appendToTab(b,e,c,d)});this.W99 instanceof TradingView.Study&&this.W99.metaInfo().isTVScript&&this.W99.metaInfo().TVScriptSourceCode&&!TradingView.isMobileView&&g.appendToTab(null,"Source Code",null,null,!0,function(){this.hide();var a=this.W99.metaInfo();window.scriptEditor.show({scriptSource:a.TVScriptSourceCode,scriptIdPart:a.scriptIdPart})}.bind(this));if(TradingView.D18("alerts")&&
TradingView.D18("drawing_alerts")&&this.W99.canHasAlert()&&!TradingView.isMobileView){var q=function(a){return a&&a.D0&&a.D0._undoModel&&a.D0._undoModel.D4||null};g.appendToTab(null,"Alert",null,null,!0,function(){runOrSignIn(function(){g.hide();g.W99.hasAlert.value()?g.W99.getAlert(function(a){editAlert(a,q(g.W99))}):new TradingView.MakeAlertDialog(q(g.W99),{drawing:g.W99})})})}this.insertTabs();this._helpItemRequired()&&this._createHelp();
a=$('<div class="main-properties main-properties-aftertabs"></div>').appendTo(m);a=$('<div class="dialog-buttons">').appendTo(a);h=function(){var a=[];d&&"function"==typeof d.defaultProperties&&(a=a.concat(d.defaultProperties()));c&&"function"==typeof c.defaultProperties&&(a=a.concat(c.defaultProperties()));0===a.length&&g.W99.properties?a=[g.W99.properties()]:g.W99._sessionsStudy&&(a=a.concat(g.W99._sessionsStudy.properties()));if(a.length){var b=function(a){a._childs&&a._childs.length&&
$.each(a._childs,function(c,d){"percentage"==d?a.percentage.listeners().fire(a.percentage):b(a[d])})};$.each(a,function(a,c){g.D0.restoreFactoryDefaults(c);b(c)});g.W99.properties().minTick&&g.W99.properties().minTick.listeners().fire(g.W99.properties().minTick);g.W99.properties().precision&&g.W99.properties().precision.listeners().fire(g.W99.properties().precision);c&&c.loadData();if(d.onResoreDefaults)d.onResoreDefaults();d&&d.loadData()}};if(d&&"function"==typeof d.createTemplateButton&&
!W77.enabled("charting_library"))d.createTemplateButton({defaultsCallback:h}).addClass("tv-left").appendTo(a);else if(isInherited(this.W99.constructor,TradingView.Study)){var r=[{title:$.t("Reset Settings"),action:h},{title:$.t("Save As Default"),action:function(){g.W99.properties().saveDefaults()}}],h=$('<a href="#" class="tv-button tv-left">'+$.t("Defaults")+'<span class="icon-dropdown"></span></a>');h.on("click",function(a){a.preventDefault();a=$(this);a.is(".active")||a.trigger("button-popup",
[r,!0])}).appendTo(a);TradingView.bindPopupMenu(h,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0})}else $('<a class="tv-button tv-left">'+$.t("Defaults")+"</a>").appendTo(a).click(h);$('<a class="tv-button ok">'+$.t("OK")+"</a>").appendTo(a).click(function(){g.hide()});$('<a class="tv-button cancel">'+$.t("Cancel")+"</a>").appendTo(a).on("click",b);l.find(".tv-dialog-title a").on("click",b);$(window).bind("keyup.hidePropertyDialog",function(a){"13"==a.keyCode&&"textarea"!==a.target.tagName.toLowerCase()&&
g.hide()});$("select",m).each(function(){var a=$(this),b="tv-select-container dialog";a.hasClass("tv-select-container-fontsize")&&(b+=" tv-select-container-fontsize");a.selectbox({speed:100,classHolder:b})});$('input[type="text"]',m).addClass("tv-text-input inset dialog");$("input.ticker",m).TVTicker();l.css("min-width","400px");A83.applyHandlers(l);m={top:($(window).height()-l.height())/2,left:($(window).width()-l.width())/2};d&&"function"==typeof d.dialogPosition&&(m=d.dialogPosition(m,l)||
m);A83.positionDialog(l,m);window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide();return l}};EditObjectDialog.prototype._helpItemRequired=function(){return this.W99._metaInfo&&!!this.W99._metaInfo.helpURL};EditObjectDialog.prototype._createHelp=function(){var a=$('<a class="help" href="#" target="_blank" title="'+$.t("Help")+'"></a>');a.attr("href",this.W99._metaInfo.helpURL);this._tabContainer.prepend(a)};function ObjectTreeDialog(a,b){this._defaultOptions={maxHeight:550,padding:20,minHeight:258};this.options=$.extend({},this._defaultOptions,a||{});this.D0=b}
ObjectTreeDialog.prototype.getSourceProperties=function(){for(var a={groups:[],model:this.D0,drawings:[]},b=0;b<this.D0.panes().size();b++){for(var c=this.D0.panes().item(b),d=[],e=c.orderedSources(),g=0;g<e.length;g++){var h=e[g];h.showInObjectTree()&&d.push({datasource:h,name:h.title()})}c=c.D19();for(g=0;g<c.size();g++)h=c.item(g),h instanceof W47&&h.showInObjectTree()&&a.drawings.push({datasource:h,name:h.title(),symbol:A68.shortName(h.symbol())});
d.length&&a.groups.push({children:d})}return a};ObjectTreeDialog.prototype.calcHeight=function(a,b){for(var c=0,d=0;d<a.length;d++)if(a[d]>b){c=0===d?a[0]:a[d-1];break}else c=a[d];c<this.options.minHeight&&(c=this.options.minHeight);return c};ObjectTreeDialog.prototype.tabChanged=function(a){0===a?this.objectsTreeTab.tabChanged():this.manageDrawingsTab.tabChanged()};ObjectTreeDialog.prototype.onDestroy=function(){this.objectsTreeTab.unsubscribeListeners();this.manageDrawingsTab&&this.manageDrawingsTab.unsubscribeListeners()};
ObjectTreeDialog.prototype.show=function(){this.title=$.t("Objects Tree");TradingView.trackEvent("GUI","Objects Tree");var a=window.user&&!0===user.is_staff&&!0!==user.is_moderator,b={};a&&$.extend(b,{hideTitle:!0,dragHandle:".properties-tabs"});var c=A83.createDialog(this.title,b),d=c.find(".tv-dialog-content"),b=c.find(".tv-dialog-title");if(a){var e=$('<div class="properties-tabs"></div>').appendTo(d),g=$('<a href="#" class="properties-tabs-label with-filter"></a>').text($.t("Objects Tree")).appendTo(e);
$('<a href="#" class="properties-tabs-label"></a>').text($.t("Manage Drawings")).appendTo(e)}d=$("<div>").appendTo(d);a&&d.addClass("with-drawings");var h=$(window).height(),h=h>this.options.maxHeight?this.options.maxHeight:h;a&&(h-=e.height());var h=h-this.options.padding,k=$('<div class="main-tree-page active">').appendTo(d);if(a){k.addClass("no-top-border");var l=$('<div class="main-tree-page active">').appendTo(d)}this.objectsTreeTab=new ObjectsTreeTab(this,this.options,this.D0);a&&(this.manageDrawingsTab=
new ManageDrawingsTab(this,this.options,this.D0));this.objectsTreeTab.createView(k,a?g:b,h);a&&this.manageDrawingsTab.createView(l,h);a&&(this.tabs=new A71(e,d,{saveTab:"ObjectsTreeDialog.tab"}));a&&this.tabs.tabChanged.subscribe(this,this.tabChanged);A83.applyHandlers(c);A83.positionDialog(c);var m=this;c.on("destroy",this.onDestroy.bind(this));setTimeout(function(){c.unbind("mousedownoutside");c.on("mousedownoutside",function(a){$(a.target).parents().andSelf().is(".tv-dialog, .properties-toolbar, .colorpicker, .charts-popup-list, .tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .context-menu")||
(A83.destroy(m.title),c.unbind("mousedownoutside"))})})};ObjectTreeDialog._getBackgroundByTile=function(a){a=A6.prototype.Button.iconIndices[a];return void 0!==a?[1,32*a+1]:null};ObjectTreeDialog._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};ObjectTreeDialog.List=function(a,b,c,d){this.model=a;this.datasources={};this.contentHeights=[];this.content=b;this.dialog=c;this.options=d};
ObjectTreeDialog.List.prototype.setDefaultItemClass=function(a){this.defaultItemClass=a};ObjectTreeDialog.List.prototype.setActiveListener=function(a){this.activeListener=a};ObjectTreeDialog.List.prototype.setActive=function(a){this.content.find(".tv-dialog-tree-item").removeClass("active");a.addClass("active");this.activeListener&&this.activeListener(a);a=this.datasources[a.attr("id")];this.model.setSelectedSource(a.datasource);this.model.D20(new A22(A22.LIGHT_UPDATE))};
ObjectTreeDialog.List.prototype.createItem=function(a,b,c){var d=this,e=$('<a class="tv-dialog-tree-item"></a>').appendTo(b);b=$('<span class="tree-icon-container">').appendTo(e);a.skipped&&e.addClass("skipped");e.attr("id",a.datasource.id());this.defaultItemClass&&e.addClass(this.defaultItemClass);this.datasources[a.datasource.id()]=a;this.contentHeights.push(this.content.height());var g=$('<div class="name-column"></div>').appendTo(e);$('<span class="name">'+$.t(a.name)+"</span>").appendTo(g);this.setIcon(e,
a);this.setVisible(e,a);e.mousedown(function(a){d.setActive(e)});if(a.datasource.userEditEnabled()){if(isInherited(a.datasource.constructor,W47)){var h=$('<a class="button icon-lock" title="'+$.t("Lock/Unlock")+'">');h.click(function(b){b=a.datasource.properties().frozen.value();d.model.setProperty(a.datasource.properties().frozen,!b,"Lock/Unlock "+a.datasource.title())});h.appendTo(b);$('<span class="icon">').appendTo(h);a.datasource.properties().frozen.value()&&(e.addClass("locked"),
h.addClass("active"));a.datasource.properties().frozen.subscribe(this,function(a){a=a.value();e.toggleClass("locked",a);h.toggleClass("active",a)})}else c&&$('<div class="button hidden">&nbsp;</div>').appendTo(b);var k=$('<a class="button icon-hide" title="'+$.t("Show/Hide")+'">');k.click(function(b){b=a.datasource.properties().visible.value();e.toggleClass("hidden",b);k.toggleClass("active",b);d.model.setProperty(a.datasource.properties().visible,!b,"Show/Hide "+a.datasource.title())});k.appendTo(b);
$('<span class="icon">').appendTo(k);a.datasource.properties().visible.value()||(e.addClass("hidden"),k.addClass("active"));a.datasource.properties().visible.subscribe(this,function(a){a=a.value();e.toggleClass("hidden",!a);k.toggleClass("active",!a)});this.createPropertyIcon(a,b,e)}return e};ObjectTreeDialog.List.prototype.contextMenuEvent=function(a,b){this.options.D3.paneByState(this.model.paneForSource(b)).showContextMenuForSource(b,a)};
ObjectTreeDialog.List.prototype.createPropertyIcon=function(a,b,c){var d=this;if(a.datasource instanceof W47&&!a.datasource.isActualSymbol())$('<div class="button hidden">&nbsp;</div>').appendTo(b);else if(a.datasource===this.model.mainSeries()&&this.options.D3&&this.options.D3.onWidget())$('<div class="button hidden">&nbsp;</div>').appendTo(b);else if(PropertyPagesFactory.hasStylesPropertyPage(a.datasource)||PropertyPagesFactory.hasInputsPropertyPage(a.datasource))b=
$('<a class="button format" title="'+$.t("Format")+'">').click(function(b){(new EditObjectDialog(a.datasource,d.model)).show()}).appendTo(b),$('<span class="icon">').appendTo(b),c.dblclick(function(b){(new EditObjectDialog(a.datasource,d.model)).show()}),c.on("contextmenu",function(b){d.contextMenuEvent(b,a.datasource);b.preventDefault();b.stopPropagation()})};
ObjectTreeDialog.List.prototype.updateItem=function(a){var b=this.content.find("#"+a.datasource.id());b.find(".name").text($.t(a.name));this.setIcon(b,a);this.setVisible(b,a)};ObjectTreeDialog.List.prototype.findItem=function(a){return this.content.find("#"+a.id())};ObjectTreeDialog.List.prototype.removeItem=function(a){this.findItem(a).remove()};
ObjectTreeDialog.List.prototype.setIcon=function(a,b){var c=a.find(".name-column");c.find(".instrument").remove();if(b.datasource.getType){var d=ObjectTreeDialog._getBackgroundByTile(b.datasource.getType());if(d){var e=$('<span class="instrument linetool">').appendTo(c);e.css("background-position",ObjectTreeDialog._getBackgroundPosition(d))}}b.datasource instanceof TradingView.LineToolIcon&&(e=b.datasource.properties().icon.value(),e=String.fromCharCode(e),$('<span class="instrument lineicon">'+e+
"</span>").appendTo(c));b.datasource===this.model.mainSeries()&&(e=$('<span class="instrument series">').appendTo(c),c=this.model.mainSeries().properties().style.value(),d=A4.styleIconPosition(c),e.css("background-position",d))};ObjectTreeDialog.List.prototype.setVisible=function(a,b){b.datasource.properties().visible.value()?a.removeClass("hidden"):a.addClass("hidden")};function ManageDrawingsTab(a,b,c){this.dialog=a;this.options=b||{};this.model=c}ManageDrawingsTab.prototype.toolCompare=function(a,b){var c=$(a).find(".name").text(),d=$(b).find(".name").text();return c.localeCompare(d)};ManageDrawingsTab.prototype.symbolCompare=function(a,b){var c=$(a).find(".symbol").text(),d=$(b).find(".symbol").text();return c.localeCompare(d)};ManageDrawingsTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};
ManageDrawingsTab.prototype.addItemControls=function(a,b){var c=this,d=b.find(".tree-icon-container");$('<span class="symbol">'+a.symbol+"</span>").appendTo(b);a.datasource.userEditEnabled()&&(d=$('<a class="button delete" title="'+$.t("Delete")+'">').click(function(d){d.stopPropagation();d=c.itemList.find(".tv-dialog-tree-item");var g=d.index(b),h=d.length;0<h&&(g!==h-1?c.selectedId=$(d[g+1]).attr("id"):0!==g&&(c.selectedId=$(d[g-1]).attr("id")));c.items.model.removeSource(a.datasource)}).appendTo(d),
$('<span class="icon">').appendTo(d))};ManageDrawingsTab.prototype.setActiveHeader=function(a){this.itemHeader.find(".item .label").removeClass("active");$.each(this.itemHeader.find(".item .label"),function(){$(this).data("sort")===a&&$(this).addClass("active")})};
ManageDrawingsTab.prototype.sortList=function(){var a=TVSettings.getValue("manageDrawingsDialog.sort.field")||"symbol",b=TVSettings.getBool("manageDrawingsDialog.sort.asc")||!1,c;c="tool"===a?this.toolSort:this.symbolSort;c.setIsAscending(b);this.itemList.find(".tv-dialog-tree-item").sort(c.getPredicate()).appendTo(this.itemList);this.setActiveHeader(a)};
ManageDrawingsTab.prototype.sortClick=function(a){a=$(a.target).data("sort");var b;b="tool"===a?this.toolSort:this.symbolSort;b.inverse();TVSettings.setValue("manageDrawingsDialog.sort.field",a);TVSettings.setValue("manageDrawingsDialog.sort.asc",b.isAscending);this.sortList()};
ManageDrawingsTab.prototype.createView=function(a,b){this.items=this.dialog.getSourceProperties();this.maxHeight=b;var c=$("<div>").appendTo(a);this.itemHeader=$('<div class="tv-dialog-tree-item-list-header">').appendTo(c);this.contentContainer=$('<div class="main-tree-container">').appendTo(c);this.noDrawings=$('<div class="no-drawings">'+$.t("No drawings yet")+"</div>").appendTo(c);this.contentWrap=$('<div class="main-tree-wrap"></div>').appendTo(this.contentContainer);this.content=$('<div class="main-tree"></div>').appendTo(this.contentWrap);
var c=$('<div class="item tool">').appendTo(this.itemHeader),d=$('<div class="item symbol">').appendTo(this.itemHeader);this.itemList=$('<div class="tv-dialog-tree-item-list">').appendTo(this.content);this.symbolSort=new LoadChartDialog.SortObject(this.symbolCompare);this.toolSort=new LoadChartDialog.SortObject(this.toolCompare);this.list=new ObjectTreeDialog.List(this.items.model,this.content,this.dialog,this.options);this.list.setActiveListener(this.activeListener.bind(this));this.items.model.selectedSource()&&
(this.selectedId=this.items.model.selectedSource().id());$('<span class="label">'+$.t("TOOL")+"</span>").data("sort","tool").appendTo(c).click($.proxy(this,"sortClick"));$('<span class="label">'+$.t("SYMBOL")+"</span>").data("sort","symbol").appendTo(d).click($.proxy(this,"sortClick"));this.fillList();c=this.dialog.calcHeight(this.list.contentHeights,this.maxHeight-this.itemHeader.height());this.contentContainer.height(c);this.noDrawings.height(c);this.addScroll();var e=this;this.updateListListener=
function(){e.updateList()};this.fillListListener=function(){e.fillList()};this.removeSourceListener=function(a){e.list.removeItem(a);e.updateList()};this.model.on("setProperty",this.updateListListener);this.model.on("removeSource",this.removeSourceListener);this.model.on("cloneLineTool",this.fillListListener);return this.contentContainer};
ManageDrawingsTab.prototype.unsubscribeListeners=function(){this.model.removeListener("setProperty",this.updateListListener);this.model.removeListener("removeSource",this.removeSourceListener);this.model.removeListener("cloneLineTool",this.fillListListener)};ManageDrawingsTab.prototype.updateList=function(){for(var a=this.dialog.getSourceProperties(),b=0;b<a.drawings.length;b++)this.list.updateItem(a.drawings[b])};
ManageDrawingsTab.prototype.updateList=function(){0===this.itemList.children().length?(this.noDrawings.show(),this.contentContainer.hide(),this.itemHeader.hide()):(this.noDrawings.hide(),this.contentContainer.show(),this.itemHeader.show())};
ManageDrawingsTab.prototype.fillList=function(){this.itemList.empty();for(var a=this.dialog.getSourceProperties(),b=0;b<a.drawings.length;b++){var c=a.drawings[b],d=this.list.createItem(c,this.itemList);d.unbind("contextmenu");d.unbind("dblclick");c.datasource.id()===this.selectedId&&this.list.setActive(d);this.addItemControls(c,d)}this.sortList();this.updateList()};
ManageDrawingsTab.prototype.addScroll=function(){this._scroll=new A59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};ManageDrawingsTab.prototype.tabChanged=function(){};function ObjectsTreeTab(a,b,c){this.dialog=a;this.options=b||{};this.model=c}ObjectsTreeTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};ObjectsTreeTab.prototype.changeZOrder=function(a){this.model.removeListener("changeZOrder",this.changeZorderListener);a();this.model.on("changeZOrder",this.changeZorderListener)};
ObjectsTreeTab.prototype.addSortable=function(a){var b=0,c=this;a.sortable({scroll:!0,scrollSensitivity:100,scrollSpeed:100,axis:"y",helper:"clone",start:function(a,c){b=c.item.index()},stop:function(a,e){var g=e.item.index();if(0!==b-g){var h=c.list.datasources[e.item.attr("id")],k=0<b-g?1:-1;c.changeZOrder(function(){c.items.model.beginUndoMacro("Change "+h.datasource.title()+" Z order");for(var a=0;a<Math.abs(b-g);a++)c.items.model.changeZOrder(h.datasource,k);c.items.model.endUndoMacro()})}c.setFirstLastItems(e.item.parent())}})};
ObjectsTreeTab.prototype.addItemControls=function(a,b,c,d,e){var g=this;c=b.find(".tree-icon-container");d=$('<div class="button up" title="'+$.t("Move Up")+'">').click(function(c){c.stopPropagation();c.preventDefault();c=b.prev(":visible");if(c.length){var d=b.prev(":hidden").length;b.insertBefore(c.last());g.changeZOrder(function(){for(var b=0;b<1+d;b++)g.items.model.changeZOrder(a.datasource,1)});g.setFirstLastItems(b.parent());g._scroll.scrollTo(b)}}).prependTo(c);$('<span class="icon">').appendTo(d);
d=$('<a class="button down" title="'+$.t("Move Down")+'">').click(function(c){c.stopPropagation();c.preventDefault();c=b.next(":visible");if(c.length){var d=b.next(":hidden").length;b.insertAfter(c.first());g.changeZOrder(function(){for(var b=0;b<1+d;b++)g.items.model.changeZOrder(a.datasource,-1)});g.setFirstLastItems(b.parent());g._scroll.scrollTo(b)}}).prependTo(c);$('<span class="icon">').appendTo(d);a.datasource!==g.items.model.mainSeries()&&a.datasource.isUserDeletable()?(c=$('<a class="button delete" title="'+
$.t("Delete")+'">').click(function(c){c.stopPropagation();c=g.content.find(".tv-dialog-tree-item");var d=c.index(b),e=c.length;0<e&&(d!==e-1?g.selectedId=$(c[d+1]).attr("id"):0!==d&&(g.selectedId=$(c[d-1]).attr("id")));g.items.model.removeSource(a.datasource)}).appendTo(c),$('<span class="icon">').appendTo(c)):$('<div class="button hidden">&nbsp;</div>').appendTo(c)};
ObjectsTreeTab.prototype.createView=function(a,b,c){this.items=this.dialog.getSourceProperties();this.maxHeight=c;this.contentContainer=$('<div class="main-tree-container">').appendTo(a);this.contentWrap=$('<div class="main-tree-wrap"></div>').appendTo(this.contentContainer);this.content=$('<div class="main-tree"></div>').appendTo(this.contentWrap);this.list=new ObjectTreeDialog.List(this.items.model,this.content,this.dialog,this.options);this.list.setDefaultItemClass("objects");this.list.setActiveListener(this.activeListener.bind(this));
this.items.model.selectedSource()&&(this.selectedId=this.items.model.selectedSource().id());this.updateListListener=this.updateList.bind(this);this.fillListListener=this.fillList.bind(this);this.changeZorderListener=function(a){this.fillList();this._scroll.scrollTo(this.list.findItem(a))}.bind(this);this.model.on("setProperty",this.updateListListener);this.model.on("removeSource",this.fillListListener);this.model.on("cloneLineTool",this.fillListListener);this.model.on("setChartStyleProperty",this.updateListListener);
this.model.on("changeZOrder",this.changeZorderListener);this.model.on("moveSource",this.fillListListener);this.filter=new ObjectsTreeTabFilter(b);this.filter.onChange.subscribe(this,this.fillListListener);this.filter.setValue("all");a=this.dialog.calcHeight(this.list.contentHeights,this.maxHeight);this.contentContainer.height(a);this.addScroll();return this.contentContainer};
ObjectsTreeTab.prototype.unsubscribeListeners=function(){this.model.removeListener("setProperty",this.updateListListener);this.model.removeListener("removeSource",this.fillListListener);this.model.removeListener("cloneLineTool",this.fillListListener);this.model.removeListener("setChartStyleProperty",this.updateListListener);this.model.removeListener("changeZOrder",this.changeZorderListener);this.model.removeListener("moveSource",this.fillListListener)};
ObjectsTreeTab.prototype.updateList=function(){this.items=this.dialog.getSourceProperties();for(var a=0;a<this.items.groups.length;a++){var b=this.items.groups[a];if(b.children.length)for(var c=b.children.length-1;0<=c;c--)this.list.updateItem(b.children[c])}};ObjectsTreeTab.prototype.setFirstLastItems=function(a){a=a.find(".tv-dialog-tree-item:visible");a.length&&(a.removeClass("first last"),a.first().addClass("first"),a.last().addClass("last"))};
ObjectsTreeTab.prototype.fillList=function(){this.content.empty();this.items=this.dialog.getSourceProperties();for(var a="studies"!=this.filter.value()&&this.items.drawings.length,b=0;b<this.items.groups.length;b++){var c=this.filter.applyToGroup(this.items.groups[b]);if(c.children.length){var d=$('<div class="tv-dialog-tree-group">').appendTo(this.content);0<b&&d.append('<div class="tv-dialog-tree-head">');var e=$('<div class="tv-dialog-tree-item-list">').appendTo(d);Modernizr.touch||this.addSortable(e);
for(var g=!0,h=c.children.length-1;0<=h;h--){var k=c.children[h],l=this.list.createItem(k,e,a);g&&!k.skipped&&(g=!1);k.datasource.id()===this.selectedId&&this.list.setActive(l);this.addItemControls(k,l,d,h,c)}g&&d.addClass("empty");this.setFirstLastItems(e)}}};ObjectsTreeTab.prototype.addScroll=function(){this._scroll=new A59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};ObjectsTreeTab.prototype.tabChanged=function(){};
function ObjectsTreeTabFilter(a){this.$container=a;this.$button=$('<div class="button-filter">').click(function(a){this.$button.trigger("button-popup",[this._getActions()]);a.stopPropagation()}.bind(this)).appendTo(a);TradingView.bindPopupMenu(this.$button,null,{event:"button-popup",addClass:"tree-tab-filter"});this.onChange=new Delegate}
ObjectsTreeTabFilter.prototype._getActions=function(){return[{name:"all",title:$.t("Show All")},{name:"drawings",title:$.t("Show Only Drawings")},{name:"studies",title:$.t("Show Only Studies")}].map(function(a){a.name==this._value?a.active=!0:a.action=this.setValue.bind(this,a.name);return a}.bind(this))};ObjectsTreeTabFilter.prototype.value=function(){return this._value};ObjectsTreeTabFilter.prototype.setValue=function(a){a!=this._value&&(this._value=a,this.onChange.fire(a))};
ObjectsTreeTabFilter.prototype.applyToGroup=function(a){if("all"==this._value)return a;for(var b=0,c;b<a.children.length;b++)c=a.children[b],c.skipped=!isInherited(c.datasource.constructor,TradingView.Series)&&!isInherited(c.datasource.constructor,"drawings"==this._value?W47:TradingView.Study);return a};A23=function(a,b,c){this.D0=b;this._paneWidget=a;this._chart=a._chart;this._mainDiv=c;this.jqTable=$(document.createElement("table"));this.jqTable.addClass("pane-legend");this._itemsBinding=new List;this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout);this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout);this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,
this.updateLayout);this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);this.updateLayout()};A23.prototype.contextMenuEvent=function(a,b){!this.D0.chartModel().readOnly()&&W77.enabled("legend_context_menu")&&this._paneWidget.showContextMenuForSource(b.source,a)};
A23.prototype.updateLayout=function(){this._itemsBinding.clear();this.jqTable.find(".apply-common-tooltip").trigger("mouseleave");this.jqTable.empty();var a=this._paneWidget.state();if(a&&this.D0){var b={showStudyTitles:this.D0.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),
showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value()},c=new List,d=a.orderedSources().slice(),a=d.indexOf(this.D0.mainSeries());-1<a&&(d.splice(a,1),d.push(this.D0.mainSeries()));for(a=d.length-1;0<=a;a--){var e=d[a],g=e.statusView();g&&c.append({view:g,source:e})}for(a=0;a<c.size();++a)if(e=c.item(a).source,d=e==this.D0.mainSeries(),!d||b.showSeriesTitle||b.showSeriesOHLC)if(d||b.showStudyTitles||b.showStudyValues){var g=c.item(a).view,h=$("<tr>"),
k=$("<td>");h.appendTo(this.jqTable);k.addClass("pane-legend-line");d?k.addClass("main"):k.addClass("study");e.properties().visible.value()||k.addClass("disabled");k.appendTo(h);k.source=e;this._generateItemsForRow(k,g,b);TradingView.setMouseEventHandler(k,this,!0)}this.update()}};
A23.prototype._updateFollowSymbol=function(a,b){if(!this._chart.onWidget()&&!W77.enabled("charting_library")){var c=$(document.createElement("span")).data("alive",!0).appendTo(a);A16.makeButton(b.properties().symbol.value(),"iconed").done(function(a){if(c.data("alive")){a.removeAttr("title");var b=A68.ticker(a.data("symbol")||"");a.blueTooltip("<strong>Follow "+b+".</strong> If you follow a symbol you will receive notifications when new ideas about that symbol are published.",
"bottom");c.replaceWith(a)}})}};
A23.prototype._generateItemsForRow=function(a,b,c){var d=a.source,e=this,g=d==this.D0.mainSeries();if(g&&c.showSeriesTitle||!g&&c.showStudyTitles){var h=$("<span>");h.addClass("pane-legend-line");W77.enabled("legend_context_menu")||h.addClass("no-context-menu");g&&h.addClass("main");d.properties().visible.value()||h.addClass("disabled");h.css({"font-weight":b.bold()?"bold":"normal","font-size":b.size()});h.click(function(b){e.contextMenuEvent(b,a)});h.appendTo(a);
this._itemsBinding.append({value:b,cell:h,source:a.source});if(!this._chart.readOnly()&&d.userEditEnabled()&&W77.enabled("edit_buttons_in_legend")){b=$('<span class="pane-legend-icon-container">').appendTo(a);$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').appendTo(b).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,d));$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').appendTo(b).on("click touchend",
this._generateItemsForRow._onFormatClick.bind(this,d));if(d instanceof TradingView.Study&&d.metaInfo().isTVScript&&d.metaInfo().TVScriptSourceCode&&!TradingView.isMobileView&&(h=$('<a class="pane-legend-icon apply-common-tooltip source" title="Show Source Code">').appendTo(b).on("click touchend",this._generateItemsForRow._onViewSorceClick.bind(this,d)),window.scriptEditor)){var k=window.scriptEditor.loadedScriptIdPart();k&&d.metaInfo().scriptIdPart===k&&h.addClass("active")}if(!g)$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+
$.t("Delete")+'">').appendTo(b).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,d))}else $("<span>&nbsp;</span>").appendTo(a)}b=d.dataWindowView();b=d.dataWindowView();if(this.isDataWindowValuesVisible(b)&&(g&&c.showSeriesOHLC||!g&&c.showStudyValues)){c=[];h=[];k=$("<div>");k.addClass("pane-legend-item-value-container");for(var l=0;l<b.items().size();l++){b.items().item(l);var m=g?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(k):null,n=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(k);
g&&n.addClass("main");d.properties().visible.value()||(n.addClass("disabled"),m&&m.addClass("disabled"));c.push(n);m&&h.push(m)}l=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(k);k.appendTo(a);this._itemsBinding.append({value:b,cell:c,titleCells:h.length?h:null,source:d,additional:l})}TradingView.D18("alerts")&&!this._chart.onWidget()&&TradingView.alertsDispatcher&&g&&(d=$('<span class="pane-legend-icon-container">').appendTo(a),this.alertWidget&&this.alertWidget.destroy(),
this.D0.chartModel().readOnly()||(this.alertWidget=new TradingView.AlertsLegendWidget(d,this.D0)))};A23.prototype.isDataWindowValuesVisible=function(a){return this._chart.onWidget()?!!a&&!this._chart.isSmall():!!a};A23.prototype._generateItemsForRow._onShowhideClick=function(a){this.D0.setProperty(a.properties().visible,!a.properties().visible.value(),"Show/Hide "+a.title())};
A23.prototype._generateItemsForRow._onFormatClick=function(a,b){a.userEditEnabled()&&(new EditObjectDialog(a,this.D0)).show()};A23.prototype._generateItemsForRow._onDeleteClick=function(a){a.isUserDeletable()&&this.D0.removeSource(a)};A23.prototype._generateItemsForRow._onViewSorceClick=function(a){var b=a.metaInfo();a={scriptSource:a.metaInfo().TVScriptSourceCode,scriptIdPart:b.scriptIdPart};window.scriptEditor&&window.scriptEditor.show(a)};
A23.prototype.setItemEnabled=function(a,b){var c=!a.hasClass("disabled"),d=a.closest("td.pane-legend-line");b&&!c?(a.removeClass("disabled"),d.removeClass("disabled")):!b&&c&&(a.addClass("disabled"),d.addClass("disabled"))};
A23.prototype.updateTitle=function(){var a=this._chart.properties().scalesProperties.textColor.value();this.jqTable.css("color",a);for(var a=this._itemsBinding.size(),b,c;a--;){c=this._itemsBinding.item(a);var d=c.source;isArray(c.cell)||(b=d.properties().visible.value(),this.setItemEnabled(c.cell,b),b=c.value.color(),d=d!=this.D0.mainSeries()&&d===this.D0.selectedSource()?"bold":"normal",c.cell.text(clean(c.value.text(),!0)).css({color:b,"border-color":b,"font-weight":d}))}};
A23.prototype.update=function(){this.updateTitle();for(var a,b,c,d,e,g,h,k=this._itemsBinding.size();k--;)if(d=this._itemsBinding.item(k),a=d.cell,b=d.titleCells,c=d.source.properties().visible.value(),isArray(a)){e=d.value.items();for(g=0;g<a.length;g++)h=e.item(g),this.setItemEnabled(a[g],c),a[g][0].textContent=h.text(),h.color()&&a[g].css("color",h.color()),b&&(this.setItemEnabled(b[g],c),b[g][0].textContent=h.title());d.additional&&d.value.additional&&d.additional.text(d.value.additional()||
"")}};A23.prototype.dataSourceAtPoint=function(a,b){return null};A23.prototype.renderTo=function(a,b,c){a.save();a.fillStyle=this._chart.properties().scalesProperties.textColor.value();a.textBaseline="middle";for(var d=0,e=0;e<this._itemsBinding.size();++e){var g=this._itemsBinding.item(e),h=g.value,k=g.source==this.D0.mainSeries(),l=k?12:8,k=k?25:17;isArray(g.cell)||(a.font=h.size()+" Verdana, Arial",a.fillText(h.text(),b,c+d+l),d+=k)}a.restore()};A52=function(a,b,c){this.chart=a;this.paneA=a._paneWidgets[b];this.paneB=a._paneWidgets[c];this.jqRow=$(document.createElement("tr"));this.jqRow.height(A52.HEIGHT);this.jqCell=$(document.createElement("td"));this.jqCell.appendTo(this.jqRow);this.jqCell.addClass("pane-separator");this.jqCell.attr("colspan","3");this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value());this.jqCell.click(function(){});this.handle=$('<div class="handle">').appendTo(this.jqCell);
$(this.handle).css("cursor",cursorCss("cursor_size_vertical","16 15"));TradingView.setMouseEventHandler(this.handle,this)};A52.HEIGHT=1;
A52.prototype.mouseDownEvent=function(a){if(0===a.button||Modernizr.touch)this.startY=a.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight};
A52.prototype.pressedMouseMoveEvent=function(a){if(0===a.button||Modernizr.touch){a.preventDefault();this.deltaY=a.pageY-this.startY;var b=this.paneA.size.h,c=MathEx.clamp(b+this.deltaY,this.minPaneHeight,this.maxPaneHeight)*this.pixelStretchFactor,d=this.totalStretch-c;this.paneA.setStretchFactor(c);this.paneB.setStretchFactor(d);this.chart._adjustSize();this.paneA.size.h!==b&&(this.startY=a.pageY);this.chart.paint()}};
A52.prototype.mouseUpEvent=function(a){if(0===a.button||Modernizr.touch)this.chart.D0.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.pixelStretchFactor=this.maxPaneHeight=this.minPaneHeight=this.totalStretch=this.totalHeight=this.deltaY=this.startY=0};A52.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())};
A52.prototype.paint=function(){};
A52.prototype.image=function(){var a={},b=A52.HEIGHT,c=this.paneA.lhsPriceAxisWidget.size.w,d=this.paneA.size.w,e=this.paneA.rhsPriceAxisWidget.size.w,g,h;g=$('<canvas width="'+c+'" height="'+b+'">')[0];h=g.getContext("2d");h.fillStyle=this.chart.properties().scalesProperties.lineColor.value();h.fillRect(0,0,c,b);a.leftAxis={content:g.toDataURL(),contentWidth:c,contentHeight:b};g=$('<canvas width="'+d+'" height="'+b+'">')[0];h=g.getContext("2d");h.fillStyle=
this.chart.properties().scalesProperties.lineColor.value();h.fillRect(0,0,d,b);a.content=g.toDataURL();a.contentWidth=d;a.contentHeight=b;g=$('<canvas width="'+e+'" height="'+b+'">')[0];h=g.getContext("2d");h.fillStyle=this.chart.properties().scalesProperties.lineColor.value();h.fillRect(0,0,e,b);a.rightAxis={content:g.toDataURL(),contentWidth:e,contentHeight:b};return a};A51=function(a,b,c){this.D0=b;this._paneWidget=a;this._chart=a._chart;this._mainDiv=c;this.jqDiv=$('<div class="pane-controls">').appendTo(c);this.update()};
A51.prototype.update=function(){var a=this,b=a.D0,c=a._paneWidget.state(),b=b.panes().indexOf(c),d=!1;if(!c.containsMainSeries()){for(var e=0,c=c.D19(),g=c.size();g--;)if(c.item(g)instanceof TradingView.Study&&(e++,1<e)){d=!0;break}c=null}0<b?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").attr("title",$.t("Move Up")).on("click",function(){a.D0.rearrangePanes(a._chart,a.D0.panes().indexOf(a._paneWidget.state()),
"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach();b<this.D0.panes().size()-1?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").attr("title",$.t("Move Down")).on("click",function(){a.D0.rearrangePanes(a._chart,a.D0.panes().indexOf(a._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach();d?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").attr("title",
$.t("Delete")).on("click",function(){a.D0.removePane(a._chart,a.D0.panes().indexOf(a._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach()};A54=function(a,b,c){this.pane=a;this._isLeft=A54.isLeft(b);this._disableContextMenu=!!c;this.jqCell=$(document.createElement("td"));this.jqCell.addClass("chart-markup-table");this.jqCell.addClass("price-axis");this.jqCell.width(25);this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height","100%");this._dv.css("position","relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqCell);this.canvas=TradingView.addCanvasTo(this._dv,
new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order","1");$(this.top_canvas).css("left",0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this._optimalWidth=40;this.setFont(11,
"Arial","");this.ctx.setFont(this.baseFont);this.top_ctx.setFont(this.baseFont);this._tickmarksCache=new TradingView.LabelsImageCache(this.baseFont,this.textColor(),11,100);var d=this;this.pane.chart().model().model().properties().scalesProperties.textColor.listeners().subscribe(null,function(a){d._tickmarksCache.reset(a.value())});this.restoreDefaultCursor();this.update();TradingView.setMouseEventHandler(this.jqCell,this,!0);this.dialog=this.pane.chart().dialog;this.contextMenu=null;this.actions=
{};this._isVisible=!0};A54.prototype._BORDER_SIZE=1;A54.prototype._MAJOR_TICK_LENGTH=4;A54.prototype._MINOR_TICK_LENGTH=2;A54.LHS=1;A54.RHS=2;A54.isLeft=function(a){if(a===A54.LHS)return!0;a!==A54.RHS&&TradingView.logDebug("PriceAxisWidget.isLeft: wrong side");return!1};
A54.prototype.backgroundColor=function(){return this.pane.chart().model().model().properties().paneProperties.background.value()};A54.prototype.lineColor=function(){return this.pane.chart().model().model().properties().scalesProperties.lineColor.value()};A54.prototype.textColor=function(){return this.pane.chart().model().model().properties().scalesProperties.textColor.value()};
A54.prototype.mouseDownEvent=function(a){if(!this.priceScale().isEmpty()){var b=this.pane.chart().model(),c=this.pane.state();this._mousedown=!0;this.jqCell.css("cursor",cursorCss("cursor_size_vertical","15 15"));b.startScalePrice(c,this.priceScale(),a.localY);TradingView.trackEvent("GUI","Scaling price scale")}};
A54.prototype.pressedMouseMoveEvent=function(a){var b=this.pane.chart().model(),c=this.pane.state(),d=this.priceScale();b.scalePriceTo(c,d,a.localY)};A54.prototype.mouseDownOutsideEvent=function(a){a=this.pane.chart().model();var b=this.pane.state(),c=this.priceScale();this._mousedown&&(this._mousedown=!1,a.endScalePrice(b,c),this.restoreDefaultCursor())};
A54.prototype.mouseUpEvent=function(a){a=this.pane.chart().model();var b=this.pane.state(),c=this.priceScale();this._mousedown=!1;a.endScalePrice(b,c);this.restoreDefaultCursor()};
A54.prototype._initActions=function(a){if(this.pane.state()){var b=this;this.actions.reset=new Action({text:$.t("Reset Scale")});this.actions.reset.callbacks().subscribe(this,A54.prototype.reset);a=function(a){this._undoModel.setLockScaleProperty(this._property,a.checked,b.priceScale().mainSource(),this._undoText)};delete this.actions.setLockScale;this.priceScale().mainSource()instanceof TradingView.Series&&(this.actions.setLockScale=new Action({text:$.t("Lock Scale"),
checkable:!0,checked:this.priceScale().mainSource().properties().lockScale.value()}),this._lockScaleBinding=new D14(this.actions.setLockScale,this.priceScale().mainSource().properties().lockScale,this.pane.chart().model(),"Undo LockScale",a),this._lockScaleBinding.setValue(this.priceScale().mainSource().properties().lockScale.value()));this.actions.setAutoScale=new Action({text:$.t("Auto Scale"),checkable:!0,checked:!0});this._autoScaleBinding=new D14(this.actions.setAutoScale,this.priceScale().properties().autoScale,
this.pane.chart().model(),"Undo AutoScale",function(){this._undoModel.setAutoScaleProperty(this._property,this.value(),b.priceScale(),this._undoText)});this._autoScaleBinding.setValue(this._autoScaleBinding.property().value());this.actions.setPercentage=new Action({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setPercentage.binding=new D14(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",
function(){this._undoModel.setPercentProperty(this._property,this.value(),b.priceScale(),this._undoText);this._undoModel.m_model.fullUpdate();var a=this;setTimeout(function(){a._undoModel.m_model.fullUpdate()},500)});this.actions.setLog=new Action({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setLog.binding=new D14(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale");this.actions.showSymbolNames=new Action({text:$.t("Show Symbol Labels",
{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.showSymbolNames.binding=new D14(this.actions.showSymbolNames,this.priceScale().properties().showSymbolLabels,this.pane.chart().model(),"Undo Show Symbol Labels");this.actions.alignLabels=new Action({text:$.t("Precise Labels",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.alignLabels.binding=new D14(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"Precise Labels");
this._updateScalesActions()}};
A54.prototype._updateScalesActions=function(){var a=this.priceScale(),b=a.mainSource()instanceof TradingView.Series,c=a.mainSource().properties();this.actions.setPercentage.setEnabled(!a.isLog()&&!(b&&c.lockScale.value())&&!(b&&c.style.value()===TradingView.Series.STYLE_PNF));this.actions.setLog.setEnabled(!a.isPercent()&&!(b&&c.lockScale.value())&&!(b&&c.style.value()===TradingView.Series.STYLE_PNF));this.actions.setAutoScale.setChecked(a.D2.autoScale.value());this.actions.setAutoScale.setEnabled(!a.properties().autoScaleDisabled.value())};
A54.prototype.mouseClickEvent=function(a){};A54.prototype.mouseDoubleClickEvent=function(a){this.reset();TradingView.trackEvent("GUI","Double click price scale")};A54.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&W77.enabled("scales_context_menu")&&this._createContextMenu().show(a)};A54.prototype._createContextMenu=function(){return ContextMenu.createMenu(this.getContextMenuActions())};
A54.prototype.getContextMenuActions=function(){this._initActions();var a=this.pane.chart().actions(),b=[this.actions.reset,new ActionSeparator,a.showLeftAxis,a.showRightAxis,new ActionSeparator,this.actions.setAutoScale,a.scaleSeriesOnly,new ActionSeparator,this.actions.setPercentage,this.actions.setLog,new ActionSeparator,this.actions.showSymbolNames];b.push(a.showSeriesLastValue);b.push(a.showStudyLastValue);W77.enabled("countdown")&&b.push(a.showCountdown);b.push(this.actions.alignLabels);
TradingView.onWidget()||(b.push(new ActionSeparator),b.push(a.scalesProperties));this.actions.setLockScale&&b.splice(6,0,this.actions.setLockScale);return b};
A54.prototype.backLabels=function(a){var b=new List,c=this.priceScale().orderedSources().clone().toArray(),d=this.pane,e=d.chart().model(),d=d.state(),g=[],h=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated();h&&g.push(h);e.selectedSource()&&g.push(e.selectedSource());e.hoveredSource()&&g.push(e.hoveredSource());if(this.priceScale()===d.defaultPriceScale())for(h=this.pane.state().D19(),e=0;e<h.size();e++)d.isOverlay(h.item(e))&&c.push(h.item(e));for(e=
0;e<c.length;++e)h=c[e],(a||-1===g.indexOf(h))&&(h=h.priceAxisViews(d,h.priceScale()))&&b.appendAll(h);return b};
A54.prototype.optimalWidth=function(){if(!this.isVisible())return 0;var a=0;if(this.pane.state()){var b=this.ctx,c=this.priceScale().marks();b.textBaseline="middle";b.textAlign=this._isLeft?"right":"left";b.setFont(this.baseFont);$.each(c,function(){var c=Math.round(b.measureText(this.label).width+10);c>a&&(a=c)});b.setFont(this.labelFont);for(var c=this.backLabels(!0),d=0;d<c.size();d++){if(c.item(d).font){var e=b.font;b.setFont(c.item(d).font())}var g=Math.round(b.measureText(c.item(d).text()).width+
10);g>a&&(a=g);c.item(d).font&&b.setFont(e)}}return this._optimalWidth=this._BORDER_SIZE+this._MAJOR_TICK_LENGTH+a+-1};A54.prototype.resetOptimalWidth=function(){this._optimalWidth=0};A54.prototype.setFont=function(a,b,c){this.labelFont=this.baseFont=makeFont(a,b,c);this.fontSize=a};
A54.prototype.setSize=function(a){this.size&&this.size.equals(a)||(this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,a),this.ctx=this.canvas.getContext("2d"),this.top_ctx=this.top_canvas.getContext("2d"),this.ctx.setFont(this.baseFont),this.top_ctx.setFont(this.baseFont),this.jqCell.css({width:a.w,"min-width":a.w,height:a.h}))};A54.prototype.update=function(){};
A54.prototype._hightlightBackground=function(a,b,c){for(var d=b.item(0).price,e=b.item(0).price,g=1;g<b.size();g++)d=Math.min(d,b.item(g).price),e=Math.max(e,b.item(g).price);b=this.priceScale();b.isPercent()&&c&&(c=c.firstValue(),d=b.priceRange().convertToPercent(d,c),e=b.priceRange().convertToPercent(e,c));d=this.priceScale().priceToCoordinate(d);e=this.priceScale().priceToCoordinate(e);clearRect(a,1,d,this.size.w-1,e-d,"rgba(109, 158, 235, 0.3)")};
A54.prototype.drawBackground=function(a){clearRect(a,0,0,this.size.w,this.size.h,this.backgroundColor());var b=this.pane.chart().model(),c=b.model().selectedSource();if(c&&c.priceScale()==this.priceScale()&&c instanceof W47){var d=c.points();if(0==d.size())return;this._hightlightBackground(a,d,c.ownerSource())}b=b.model().crossHairSource();b.startMeasurePoint()&&this._hightlightBackground(a,b.measurePoints(),this.pane.state().mainDataSource())};
A54.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();var b=this.size.h;if(this._isLeft){a.translate(-.5,-.5);var c=this.size.w-this._BORDER_SIZE-1,d=this.size.w-1}else a.translate(.5,-.5),c=0,d=c+this._BORDER_SIZE;a.fillRect(c,0,d-c,b);a.restore()};
A54.prototype.drawTickMarks=function(a){a.save();a.strokeStyle=this.lineColor();var b=this.priceScale().marks();a.textBaseline="middle";a.textAlign=this._isLeft?"right":"left";a.fillStyle=this.textColor();a.setFont(this.baseFont);var c=this.size.w-1;a.translate(-.5,-.5);var d=b.length,e;if(TradingView.D18("tv4603_tv4590"))if(this._isLeft){e=c-this._BORDER_SIZE;a.fillStyle=this.lineColor();for(a.beginPath();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,
a.rect(e-c,b[d].coord,c,1);a.fill();a.fillStyle=this.textColor();for(d=b.length;d--;)this._tickmarksCache.paintTo(a,b[d].label,e-this._MAJOR_TICK_LENGTH,b[d].coord,"rght")}else{e=this._BORDER_SIZE+1;a.fillStyle=this.lineColor();for(a.beginPath();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.rect(e,b[d].coord,c+1,1);a.fill();a.fillStyle=this.textColor();for(d=b.length;d--;)this._tickmarksCache.paintTo(a,b[d].label,e+this._MAJOR_TICK_LENGTH+1,b[d].coord,"left")}else if(this._isLeft){e=
c-this._BORDER_SIZE;for(a.fillStyle=this.lineColor();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(e-c,b[d].coord,c,1);a.fillStyle=this.textColor();for(d=b.length;d--;)a.fillText(b[d].label,e-this._MAJOR_TICK_LENGTH,b[d].coord)}else{e=this._BORDER_SIZE+1;for(a.fillStyle=this.lineColor();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(e,b[d].coord,c+1,1);a.fillStyle=this.textColor();for(d=b.length;d--;)a.fillText(b[d].label,e+this._MAJOR_TICK_LENGTH+
1,b[d].coord)}a.restore()};
A54.prototype._alignLabels=function(){var a=this.size.h/2,b=new List,c=this.priceScale().orderedSources().clone().toArray(),d=this.pane;d.chart().model();var e=d.state();if(this.priceScale()===e.defaultPriceScale())for(var g=this.pane.state().D19(),d=0;d<g.size();d++)e.isOverlay(g.item(d))&&c.push(g.item(d));for(var h=this.priceScale().mainSource(),d=0;d<c.length;++d){var k=c[d];if(g=k.priceAxisViews(e,k.priceScale()))b.appendAll(g),h==k&&0<g.size()&&(a=g.item(0)._floatCoordinate)}g=
b.toArray();c=g.filter(function(b){return b._floatCoordinate<=a});b=g.filter(function(b){return b._floatCoordinate>a});c.sort(function(a,b){return(b._floatCoordinate||b.coordinate())-(a._floatCoordinate||a.coordinate())});c.length&&b.length&&b.push(c[0]);b.sort(function(a,b){return(a._floatCoordinate||a.coordinate())-(b._floatCoordinate||b.coordinate())});g.forEach(function(a){a._fixedCoordinate=a.coordinate()});d=this.priceScale().properties();if(d.alignLabels&&d.alignLabels.value()){for(d=1;d<c.length;d++)g=
c[d],e=c[d-1],h=e.renderer().height(!1),g.coordinate()>e._fixedCoordinate-h&&(e=e._fixedCoordinate-h,g._fixedCoordinate=e);for(d=1;d<b.length;d++)g=b[d],e=b[d-1],h=e.renderer().height(!0),g.coordinate()<e._fixedCoordinate+h&&(e=e._fixedCoordinate+h,g._fixedCoordinate=e)}};
A54.prototype.drawBackLabels=function(a){a.save();a.setFont(this.labelFont);for(var b=this.backLabels(),c=0;c<b.size();c++){var d=b.item(c),e=d.renderer();d._fixedCoordinate&&(e._data.coordinate=d._fixedCoordinate);e.draw(a,this._isLeft,this.size.w,this.size.h)}a.restore()};
A54.prototype.drawCrossHairLabel=function(a){var b=this.pane.chart().model().model(),c=[],d=b.sourceBeingMoved()||b.lineBeingEdited()||b.lineBeingCreated();d&&c.push({source:d,scale:d.priceScale()});b.selectedSource()&&c.push({source:b.selectedSource(),scale:b.selectedSource().priceScale()});b.hoveredSource()&&c.push({source:b.hoveredSource(),scale:b.hoveredSource().priceScale()});var e=this.pane.state(),c=c.reduce(function(a,b){var c=b.source.priceAxisViews(e,b.scale);return c?
a.concat(c.toArray()):a},[]);(b=b.crossHairSource().priceAxisViews(e,this.priceScale()))&&(c=c.concat(b.toArray()));var g=this;c.filter(function(a){return null!=a}).forEach(function(b){a.save();a.setFont(g.labelFont);var c=b.renderer();b._fixedCoordinate&&(c._data.coordinate=b._fixedCoordinate);c.draw(a,g._isLeft,g.size.w,g.size.h);a.restore()})};
A54.prototype.priceScale=function(){var a=this.pane.state(),b=[],b=this._isLeft?[a.leftPriceScale(),a.rightPriceScale()]:[a.rightPriceScale(),a.leftPriceScale()];return null===b[0].mainSource()?null===b[1].mainSource()?b[0]:b[1]:b[0]};A54.prototype.isVisible=function(){return this._isVisible};A54.prototype.setVisible=function(a){(this._visible=a)?this.jqCell.show():this.jqCell.hide();this._isVisible=!!a};
A54.prototype.setAutoScale=function(a){var b=this.pane.state,c=this.priceScale();this.pane.chart().model().setPriceAutoScale(b,c,a)};A54.prototype.reset=function(){var a=this.pane.state(),b=this.priceScale();this.pane.chart().model().resetPriceScale(a,b)};
A54.prototype.paint=function(a){this._isVisible&&a&&(this._alignLabels(),a===A22.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(0,0,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(0,0,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))};
A54.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};A54.prototype.image=function(){var a={};a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;return a};A73=function(a,b){this.chart=a;this.contextMenu=null;this._disableContextMenu=!!b;this.jqRow=$(document.createElement("tr"));this.jqLhsTimeAxisStub=$(document.createElement("td"));this.jqLhsTimeAxisStub.addClass("chart-markup-table");this.jqLhsTimeAxisStub.appendTo(this.jqRow);this.jqLhsStub=$("<div>");this.jqLhsStub.css("width","100%");this.jqLhsStub.css("height","100%");this.jqLhsStub.css("position","relative");this.jqLhsStub.css("overflow","hidden");this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub);
this.lhsCanvas=TradingView.addCanvasTo(this.jqLhsStub,new A61(16,16));$(this.lhsCanvas).css("position","absolute");$(this.lhsCanvas).css("z-order","2");$(this.lhsCanvas).css("left",0);$(this.lhsCanvas).css("top",0);this.lhsCtx=this.lhsCanvas.getContext("2d");this.jqCell=$(document.createElement("td"));this.jqCell.appendTo(this.jqRow);this.jqCell.addClass("chart-markup-table");this.jqCell.addClass("time-axis");this.jqCell.height(25);this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height",
"100%");this._dv.css("position","relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqCell);this.canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order",
"1");$(this.top_canvas).css("left",0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this.jqRhsTimeAxisStub=$(document.createElement("td"));this.jqRhsTimeAxisStub.addClass("chart-markup-table");this.jqRhsTimeAxisStub.appendTo(this.jqRow);this.jqRhsStub=$("<div>");this.jqRhsStub.css("width","100%");this.jqRhsStub.css("height","100%");this.jqRhsStub.css("position","relative");this.jqRhsStub.css("overflow","hidden");this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub);this.rhsCanvas=
TradingView.addCanvasTo(this.jqRhsStub,new A61(16,16));$(this.rhsCanvas).css("position","absolute");$(this.rhsCanvas).css("z-order","2");$(this.rhsCanvas).css("left",0);$(this.rhsCanvas).css("top",0);this.rhsCtx=this.rhsCanvas.getContext("2d");this.setFont(11,"Arial","");this.ctx.setFont(this.baseFont);this.top_ctx.setFont(this.baseFont);this.restoreDefaultCursor();this.update();this._minVisibleSpan=MINUTE_SPAN;TradingView.setMouseEventHandler(this.jqCell,this,!0);this.updatePriceScalesVisibility()};
A73.prototype.BORDER_SIZE=1;A73.prototype.MAJOR_TICK_LENGTH=4;A73.prototype.MINOR_TICK_LENGTH=2;A73.prototype.backgroundColor=function(){var a=this.chart.model();return a?a.model().properties().paneProperties.background.value():"#ffffff"};A73.prototype.lineColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.lineColor.value():"#ffffff"};
A73.prototype.textColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.textColor.value():"#ffffff"};A73.prototype.updatePriceScalesVisibility=function(){this.chart.properties().scalesProperties.showLeftScale.value()?this.jqLhsTimeAxisStub.show():this.jqLhsTimeAxisStub.hide();this.chart.properties().scalesProperties.showRightScale.value()?this.jqRhsTimeAxisStub.show():this.jqRhsTimeAxisStub.hide()};
A73.prototype.mouseDownEvent=function(a){if(this._mousedown)return!0;this._mousedown=!0;var b=this.chart.model();b.timeScale().isEmpty()||($(this.jqCell).css("cursor",cursorCss("cursor_size_horizontal","15 15")),b.startScaleTime(a.localX))};A73.prototype.mouseDownOutsideEvent=function(a){a=this.chart.model();!a.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,a.endScaleTime(),this.restoreDefaultCursor())};
A73.prototype.pressedMouseMoveEvent=function(a){var b=this.chart.model();if(!b.timeScale().isEmpty()){var c=!1,d=(new Date).valueOf();this._lastScrollScaleTime&&100>d-this._lastScrollScaleTime&&(c=!0);c||(TradingView.trackEvent("GUI","Scaling time scale"),b.scaleTimeTo(a.localX),this._lastScrollScaleTime=d)}};A73.prototype.mouseUpEvent=function(a){this._mousedown=!1;a=this.chart.model();a.timeScale().isEmpty()||(a.endScaleTime(),this.restoreDefaultCursor())};
A73.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&W77.enabled("scales_context_menu")&&this._createContextMenu().show(a)};A73.prototype._createContextMenu=function(){return ContextMenu.createMenu(this.getContextMenuActions())};
A73.prototype.getContextMenuActions=function(){var a=this.chart;a.model().mainSeries().createSessStudy();a.updateActions();var a=a.actions(),b=W77.enabled("charting_library")?[a.timeScaleReset,new ActionSeparator,a.applyTimeZone]:[a.timeScaleReset,new ActionSeparator,a.applyTimeZone,a.sessionBreaks,a.extendedHours];b.push(new ActionSeparator,a.tmzProperties);return b};A73.prototype.mouseClickEvent=function(a){};
A73.prototype.mouseDoubleClickEvent=function(a){TradingView.trackEvent("GUI","Double click time scale");this.chart.model().resetTimeScale()};A73.prototype.optimalHeight=function(){return this.BORDER_SIZE+this.MAJOR_TICK_LENGTH+this.maxFontSize+6};A73.prototype.setFont=function(a,b,c){this.baseFont=makeFont(a,b,c);this.baseBoldFont=makeFont(a,b,c+" bold");this.labelFont=this.baseFont;this.maxFontSize=a};
A73.prototype.setSize=function(a,b,c){this.size&&this.size.equals(a)||(this.lhsStubSize=b,TradingView.setCanvasSize(this.lhsCanvas,b),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqLhsTimeAxisStub.width(b.w),this.jqLhsTimeAxisStub.height(b.h),this.rhsStubSize=c,TradingView.setCanvasSize(this.rhsCanvas,c),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.jqRhsTimeAxisStub.width(c.w),this.jqRhsTimeAxisStub.height(c.h),this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,
a),this.ctx=this.canvas.getContext("2d"),this.top_ctx=this.top_canvas.getContext("2d"),this.ctx.setFont(this.baseFont),this.top_ctx.setFont(this.baseFont),this.jqCell.width(a.w),this.jqCell.height(a.h))};A73.prototype._spanIndex=function(a){for(var b=[MINUTE_SPAN,HOUR_SPAN,DAY_SPAN,MONTH_SPAN,YEAR_SPAN],c=b.length-1;0<c&&!(b[c]<=a);)c--;return c};
A73.prototype._spanOffset=function(a,b){if(b<a)throw new Exception("actual span cuold not be less then base");return this._spanIndex(b)-this._spanIndex(a)};A73.prototype.update=function(){if(this.chart.model()){var a=this.chart.model().timeScale().marks();if(a){var b=this;this._minVisibleSpan=YEAR_SPAN;$.each(a,function(){b._minVisibleSpan=Math.min(this.span,b._minVisibleSpan)})}}};
A73.prototype._hightlightBackground=function(a,b){for(var c=this.chart.model().timeScale(),d=b.item(0).index,e=b.item(0).index,g=1;g<b.size();g++)d=Math.min(d,b.item(g).index),e=Math.max(e,b.item(g).index);d=c.indexToCoordinate(d);c=c.indexToCoordinate(e);clearRect(a,d,1,c-d,this.size.h-1,"rgba(109, 158, 235, 0.3)")};
A73.prototype.drawBackground=function(a){clearRect(a,0,0,this.size.w,this.size.h,this.backgroundColor());var b=this.chart.model();if(b){var c=b.timeScale(),d=b.model().selectedSource();if(d&&d instanceof W47&&!c.isEmpty()){c=d.points();if(0==c.size())return;this._hightlightBackground(a,c)}b=b.model().crossHairSource();b.startMeasurePoint()&&this._hightlightBackground(a,b.measurePoints())}};
A73.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();a.fillRect(-.5,.5,this.size.w+.5,this.BORDER_SIZE);a.restore()};
A73.prototype.drawStubs=function(){var a=this.BORDER_SIZE,b=2*this.BORDER_SIZE,c=this.lhsCtx;clearRect(c,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(this.lhsStubSize.w-b-.5,.5,b,a);c.fillRect(this.lhsStubSize.w-b-.5,-.5,a,a);c=this.rhsCtx;clearRect(c,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(-.5,.5,b,a);c.fillRect(.5,-.5,a,a)};
A73.prototype.drawTickMarks=function(a){var b=this.chart.model().timeScale().marks();if(b&&0!=b.length){var c=b.reduce(function(a,b){return a.span>b.span?a:b}).span;30<c&&40>c&&(c=30);a.save();a.strokeStyle=this.lineColor();a.textBaseline="top";a.textAlign="center";a.translate(.5,.5);a.fillStyle=this.lineColor();for(var d=b.length;d--;)a.fillRect(b[d].coord,this.BORDER_SIZE,1,b[d].major?this.MAJOR_TICK_LENGTH:this.MINOR_TICK_LENGTH);a.fillStyle=this.textColor();for(var e={},
d=0;d<b.length;d++){var g=b[d].span>=c?this.baseBoldFont:this.baseFont,h=e[g]||[];h.push(b[d]);e[g]=h}for(f in e)for(a.setFont(f),b=e[f],d=0;d<b.length;d++)a.fillText(b[d].label,b[d].coord,this.BORDER_SIZE+this.MAJOR_TICK_LENGTH-1);a.restore()}};
A73.prototype.drawBackLabels=function(a){a.save();a.setFont(this.labelFont);for(var b=this.chart.model().D19(),c=this.chart.model(),c=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated(),d=0;d<b.size();d++){var e=b.item(d);if(e!==this.chart.model().crossHairSource()&&e!==c&&e.timeAxisViews&&(e=e.timeAxisViews()))for(var g=0;g<e.size();g++)e.item(g).renderer().draw(a,this.size.w,this.size.h)}a.restore()};
A73.prototype.drawCrossHairLabel=function(a){var b=this.chart.model();if(b=b.sourceBeingMoved()||b.lineBeingEdited()||b.lineBeingCreated()){if(a.save(),b.timeAxisViews&&(b=b.timeAxisViews()))for(var c=0;c<b.size();c++)b.item(c).renderer().draw(a,this.size.w,this.size.h)}else if(a.save(),a.setFont(this.labelFont),b=this.chart.model().crossHairSource().timeAxisView())for(c=0;c<b.size();c++)b.item(c).renderer().draw(a,this.size.w,this.size.h);a.restore()};
A73.prototype.paint=function(a){this.top_ctx.setFont(this.labelFont);0!==a&&(a===A22.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(a=this.ctx,this.drawBackground(a),this.drawBorder(a),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(a),this.drawBackLabels(a),this.drawCrossHairLabel(this.top_ctx))))};
A73.prototype.setStubVisible=function(a,b){var c=A54.isLeft(a)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;b?c.show():c.hide()};A73.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};
A73.prototype.image=function(){var a={};a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;a.lhsStub={};a.lhsStub.content=this.lhsCanvas.toDataURL();a.lhsStub.contentWidth=this.lhsStubSize.w;a.lhsStub.contentHeight=this.lhsStubSize.h;a.rhsStub={};a.rhsStub.content=this.rhsCanvas.toDataURL();a.rhsStub.contentWidth=this.rhsStubSize.w;a.rhsStub.contentHeight=this.rhsStubSize.h;return a};function $41(a,b,c,d){D7.call(this,a,b);this.D1=c;this._showOnlyConfirmInputs=d;this.prepareLayout()}inherit($41,D7);
$41.prototype._addSessionEditor=function(a,b,c,d){if("session"!==c.type)TradingView.logError("Session editor adding FAILED: wrong input type.");else{c=function(a,b){var c=$("<td/>");c.appendTo(a);c.css("padding-left","0px");c.css("padding-right","0px");var d=$("<input>");d.attr("type","text");d.addClass("ticker");d.css("width","40px");d.attr("id",b);d.appendTo(c)};var e=function(a,b,c){var d=$("<td/>");d.css("padding-left",c);d.css("padding-right",c);d.appendTo(a);a=$("<div/>");
a.appendTo(d);a.append(b);a.css("font-size","150%")},g=$("<table/>");g.appendTo(a);a=$("<tr/>");a.appendTo(g);editorIds=["start_hours","start_minutes","end_hours","end_minutes"];c.call(this,a,editorIds[0]);e.call(this,a,":",0);c.call(this,a,editorIds[1]);e.call(this,a,"-",4);c.call(this,a,editorIds[2]);e.call(this,a,":",0);c.call(this,a,editorIds[3]);this.bindControl(new D8(a,editorIds,b,!1,this.model(),d))}};
$41.prototype.prepareLayoutImpl=function(a,b){for(var c=0;c<a.inputs.length;c++){var d=a.inputs[c],e=d.id;if("first_visible_bar_time"!=e&&"last_visible_bar_time"!=e&&"time"!=d.type&&!d.isHidden&&(!this._showOnlyConfirmInputs||d.confirm)){var g=d.name||e.toLowerCase().replace(/\b\w/g,function(a){return a.toUpperCase()}),h="Change "+g,k=$("<tr/>");k.appendTo(b);var l=$("<td/>");l.appendTo(k);l.addClass($.t("propertypage-name-label",{context:"css_class"}));l.text($.t(g,{context:"input"}));
g=$("<td/>");g.appendTo(k);k=null;if("resolution"===d.type)k=$('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1h</option><option value="120">2h</option><option value="180">3h</option><option value="D">1d</option><option value="W">1w</option></select>');else if("symbol"===d.type)k=$('<input class="symbol-edit single">'),A69.bindToInput(k);
else if("session"===d.type)this._addSessionEditor(g,this._property.inputs[e],d,h);else if(d.options)for(k=$("<select/>"),l=0;l<d.options.length;l++){var m=d.options[l];$("<option value='"+m+"'>"+m+"</option>").appendTo(k)}else k=$("<input/>"),"bool"===d.type?k.attr("type","checkbox"):k.attr("type","text");k&&(k.appendTo(g),k.is(":checkbox")||k.css("width","100px"));d.options?this.bindControl(new D11(k,this._property.inputs[e],null,!0,this.model(),h)):"bar_time"===d.type?(this.bindControl(new D9(k,
this._property.inputs[e],!0,this.model(),h,this.model().mainSeries(),10)),k.addClass("ticker")):"integer"===d.type?(l=[ToIntTransformer(d.defval)],(0===d.min||d.min)&&l.push(GreateTransformer(d.min)),(0===d.max||d.max)&&l.push(LessTransformer(d.max)),this.bindControl(new SimpleStringBinder(k,this._property.inputs[e],l,!1,this.model(),h)),k.addClass("ticker")):"float"===d.type?(l=[ToFloatTransformer(d.defval)],(0===d.min||d.min)&&l.push(GreateTransformer(d.min)),(0===d.max||d.max)&&l.push(LessTransformer(d.max)),
this.bindControl(new SimpleStringBinder(k,this._property.inputs[e],l,!1,this.model(),h)),k.addClass("ticker")):"text"===d.type?this.bindControl(new SimpleStringBinder(k,this._property.inputs[e],null,!1,this.model(),h)):"bool"===d.type?this.bindControl(new D12(k,this._property.inputs[e],!0,this.model(),h)):"resolution"===d.type?this.bindControl(new D11(k,this._property.inputs[e],UppercaseTransformer,!0,this.model(),"Change Interval")):"symbol"===d.type&&this.bindControl(new D10(k,
this._property.inputs[e],!0,this.model(),"Change Symbol"))}}this._property.offset&&(g=this._property.offset.title?this._property.offset.title.value():"Offset",k=this.addOffsetEditorRow(b,g),l=[ToIntTransformer(this._property.offset.val)],l.push(GreateTransformer(this._property.offset.min)),l.push(LessTransformer(this._property.offset.max)),this.bindControl(new SimpleStringBinder(k,this._property.offset.val,l,!1,this.model(),"Undo "+g)));this._property.offsets&&$.each(a.plots,function(a,c){if(this._property.offsets[c.id]){var d=
this._property.offsets[c.id];if(void 0==d.isHidden||!d.isHidden.value()){var e=d.title.value(),g=this.addOffsetEditorRow(b,e),h=[ToIntTransformer(d.val)];h.push(GreateTransformer(d.min));h.push(LessTransformer(d.max));this.bindControl(new SimpleStringBinder(g,d.val,h,!1,this.model(),"Undo "+e))}}}.bind(this))};
$41.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.D1.metaInfo();this.prepareLayoutImpl(a,this._table);this.loadData()};$41.prototype.widget=function(){return this._table};function $47(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()}inherit($47,D7);
$47.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=0;a<this.D1.metaInfo().plots.length;++a)if(!this.D1.isSelfColorerPlot(a)&&!this.D1.isDataOffsetPlot(a)){var b=this.D1.metaInfo().plots[a];this.D1.isLinePlot(a)||this.D1.isBarColorerPlot(a)||this.D1.isBgColorerPlot(a)?this._prepareLayoutForPlot(a,b):this.D1.isPlotArrowsPlot(a)?
this._prepareLayoutForArrowsPlot(a,b):this.D1.isPlotCharsPlot(a)?this._prepareLayoutForCharsPlot(a,b):this.D1.isPlotShapesPlot(a)?this._prepareLayoutForShapesPlot(a,b):console.error("Unknown plot type: "+b.type)}if(a=this.D1.properties().transparency){var c=$('<tr class="line"/>');c.appendTo(this._table);$("<td/>").appendTo(c);b=$("<td/>");b.appendTo(c);b.addClass("propertypage-name-label");b.html($.t("Transparency"));b=$("<td/>");b.attr("colspan","3");b.appendTo(c);c=TradingView.createTransparencyEditor().width(270);
c.appendTo(b);this.bindControl(new SliderBinder(c,a,!0,this.model(),"Change Study Transparency"))}var d=this.D1.properties().bands;if(d&&0<d.childCount())for(a=0;a<d.childCount();a++){b=d[a];c=$('<tr class="line"/>');c.appendTo(this._table);var e=$("<td/>");e.appendTo(c);var g=$("<input type='checkbox' class='visibility-switch'/>");g.appendTo(e);e=b.name.value();this.createLabeledCell(e,g).appendTo(c).addClass($.t("propertypage-name-label",{context:"css_class"}));e=$("<td/>");e.appendTo(c);e.addClass("colorpicker-cell");
var e=TradingView.addColorPicker(e),h=$("<td/>");h.appendTo(c);var k=TradingView.createLineWidthEditor();k.appendTo(h);var l=$('<td colspan="4">').css({whiteSpace:"nowrap"});l.appendTo(c);h=TradingView.createLineStyleEditor();h.render().appendTo(l);var m=$("<input class='property-page-bandwidth' type='text'/>");m.appendTo(l);l=[ToFloatTransformer(b.value.value())];c="Change band";this.bindControl(new SimpleStringBinder(m,b.value,l,!1,this.model(),c));this.bindControl(new D12(g,b.visible,
!0,this.model(),c));this.bindControl(new ColorBinding(e,b.color,!0,this.model(),c));this.bindControl(new D11(h,b.linestyle,parseInt,!0,this.model(),c));this.bindControl(new SliderBinder(k,b.linewidth,!0,this.model(),c))}this.D1.properties().bandsBackground&&(b=this.D1.properties().bandsBackground,g=$.t("Background"),c=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,g,"Change band background"),c.appendTo(this._table));this.D1.properties().areaBackground&&
(b=this.D1.properties().areaBackground,g=$.t("Background"),c=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,g,"Change area background"),c.appendTo(this._table));d=this.D1.metaInfo().filledAreas;if(void 0!=d)for(a=0;a<d.length;++a)c=d[a],b=this.D1.properties().filledAreasStyle[c.id],g=c.title||$.t("Background"),c="Change "+g,c=this._prepareFilledAreaBackground(b.visible,b.color,b.transparency,g,c),c.appendTo(this._table);for(var n in this.D1.metaInfo().graphics){var a=
this.D1.metaInfo().graphics[n],q;for(q in a)b=this._property.graphics[n][q],$47["_createRow_"+n].call(this,this._table,b)}1==this._table.find("tr").length&&(e=this._table.find(".visibility-cell"),e.css("display","none"),b=this._table.find(".propertypage-name-label"),b.css("padding-left",0));n=this._prepareStudyPropertiesLayout();this._table=this._table.add(n);this.loadData()};
$47.prototype._prepareLayoutForPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),g=e.palette,h=e.paletteProps,e="Change "+c;if(g)this._prepareLayoutForPalette(a,b,g,h,e);else{g=$('<tr class="line"/>');g.appendTo(this._table);var k=$("<td/>");k.appendTo(g);k.addClass("visibility-cell");h=$("<input type='checkbox' class='visibility-switch'/>");h.appendTo(k);c=this.D1.properties().styles[c].title.value();this.createLabeledCell(c,h).appendTo(g).addClass($.t("propertypage-name-label",
{context:"css_class"}));c=$("<td/>");c.appendTo(g);c.addClass("colorpicker-cell");var c=TradingView.addColorPicker(c),l=$("<td/>");l.appendTo(g);k=TradingView.createLineWidthEditor();k.appendTo(l);var m=$("<td>");m.appendTo(g);l=TradingView.createPlotEditor();l.appendTo(m);var n=$("<td>");n.appendTo(g);var q=TradingView.createTransparencyEditor(c);q.appendTo(n);m=d.plottype.value();n.css("display",this._isStyleNeedsTransparency(m)?"block":"none");m=$("<td>");m.appendTo(g);var r=$("<input type='checkbox'>");
r.appendTo(m);this.createLabeledCell("Price Line",r).appendTo(g);this.bindControl(new D12(h,d.visible,!0,this.model(),e));this.bindControl(new ColorBinding(c,d.color,!0,this.model(),e));this.bindControl(new SliderBinder(k,d.linewidth,!0,this.model(),e));this.bindControl(new D11(l,d.plottype,parseInt,!0,this.model(),e));this.bindControl(new SliderBinder(q,d.transparency,!0,this.model(),e));this.bindControl(new D12(r,d.trackPrice,!0,this.model(),"Change Price Line"));
e=function(){var a=d.plottype.value();n.css("display",this._isStyleNeedsTransparency(a)?"table-cell":"none");q.css("display",this._isStyleNeedsTransparency(a)?"inline-block":"none")}.bind(this);e();d.plottype.listeners().subscribe(null,e)}};
$47.prototype._prepareLayoutForShapesPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),g=e.palette,h=e.paletteProps,e="Change "+c,k=$('<tr class="line"/>');k.appendTo(this._table);var l=$("<td/>");l.appendTo(k);l.addClass("visibility-cell");var m=$("<input type='checkbox' class='visibility-switch'/>");m.appendTo(l);this.bindControl(new D12(m,d.visible,!0,this.model(),e));c=this.D1.properties().styles[c].title.value();
this.createLabeledCell(c,m).appendTo(k).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(k);m=TradingView.createShapeStyleEditor();m.appendTo(c);this.bindControl(new D11(m,d.plottype,null,!0,this.model(),e));c=$("<td/>");c.appendTo(k);k=TradingView.createShapeLocationEditor();k.appendTo(c);this.bindControl(new D11(k,d.location,null,!0,this.model(),e));g?this._prepareLayoutForPalette(a,b,g,h,e):(k=$('<tr class="line"/>'),k.appendTo(this._table),
$("<td/>").appendTo(k),$("<td/>").appendTo(k),g=$("<td/>"),g.appendTo(k),g.addClass("colorpicker-cell"),h=TradingView.addColorPicker(g),this.bindControl(new ColorBinding(h,d.color,!0,this.model(),e)),g=$("<td>"),g.appendTo(k),k=TradingView.createTransparencyEditor(h),k.appendTo(g),this.bindControl(new SliderBinder(k,d.transparency,!0,this.model(),e)))};
$47.prototype._prepareLayoutForCharsPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),g=e.palette,h=e.paletteProps,e="Change "+c,k=$('<tr class="line"/>');k.appendTo(this._table);var l=$("<td/>");l.appendTo(k);l.addClass("visibility-cell");var m=$("<input type='checkbox' class='visibility-switch'/>");m.appendTo(l);this.bindControl(new D12(m,d.visible,!0,this.model(),e));c=this.D1.properties().styles[c].title.value();this.createLabeledCell(c,
m).appendTo(k).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(k);m=TradingView.createTextEditor();m.appendTo(c);m.keyup(function(){var a=$(this),b=a.val();b&&(a.val(b.split("")[b.length-1]),a.change())});this.bindControl(new SimpleStringBinder(m,d["char"],null,!1,this.model(),e));c=$("<td/>");c.appendTo(k);k=TradingView.createShapeLocationEditor();k.appendTo(c);this.bindControl(new D11(k,d.location,null,!0,this.model(),e));g?this._prepareLayoutForPalette(a,
b,g,h,e):(k=$('<tr class="line"/>'),k.appendTo(this._table),$("<td/>").appendTo(k),$("<td/>").appendTo(k),g=$("<td/>"),g.appendTo(k),g.addClass("colorpicker-cell"),h=TradingView.addColorPicker(g),this.bindControl(new ColorBinding(h,d.color,!0,this.model(),e)),g=$("<td>"),g.appendTo(k),k=TradingView.createTransparencyEditor(h),k.appendTo(g),this.bindControl(new SliderBinder(k,d.transparency,!0,this.model(),e)))};
$47.prototype._isStyleNeedsTransparency=function(a){return 0<=[TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS,TradingView.StudyConsts.PLOT_COLUMNS].indexOf(a)};$47.prototype._isStyleNeedsConnectPoints=function(a){return 0<=[TradingView.StudyConsts.PLOT_CROSS,TradingView.StudyConsts.PLOT_CIRCLES].indexOf(a)};
$47.prototype._prepareLayoutForPalette=function(a,b,c,d,e){b=b.id;var g=this.D1.properties().styles[b];b=0;for(var h in c.colors){var k=d.colors[h];c=$('<tr class="line"/>');c.appendTo(this._table);$("<td/>").appendTo(c);var l=$("<td/>");l.appendTo(c);l.addClass($.t("propertypage-name-label",{context:"css_class"}));l.html($.t(k.name.value()));l=$("<td/>");l.appendTo(c);l.addClass("colorpicker-cell");l=TradingView.addColorPicker(l);this.bindControl(new ColorBinding(l,k.color,
!0,this.model(),e));if(0===b&&(this.D1.isBgColorerPlot(a)||this.D1.isPlotCharsPlot(a)||this.D1.isPlotShapesPlot(a))){var m=$("<td>");m.appendTo(c);var n=TradingView.createTransparencyEditor(l);n.appendTo(m);this.bindControl(new SliderBinder(n,g.transparency,!0,this.model(),e))}if(this.D1.isLinePlot(a)){m=$("<td/>");m.appendTo(c);var q=TradingView.createLineWidthEditor();q.appendTo(m);this.bindControl(new SliderBinder(q,k.width,!0,this.model(),e));k=$("<td>");k.appendTo(c);0===b&&(m=
TradingView.createPlotEditor(),m.appendTo(k),this.bindControl(new D11(m,g.plottype,parseInt,!0,this.model(),e)),m=$("<td>"),m.appendTo(c),n=TradingView.createTransparencyEditor(l),n.appendTo(m),this.bindControl(new SliderBinder(n,g.transparency,!0,this.model(),e)),k=function(){var a=g.plottype.value();n.css("display",this._isStyleNeedsTransparency(a)?"block":"none")}.bind(this),k(),g.plottype.listeners().subscribe(null,k),k=$("<input type='checkbox'>"),l=$('<td colspan="4">').css({whiteSpace:"nowrap"}),
m=$("<span>").html($.t("Price Line")),q=$("<span>"),q.append(k),l.append(q).append(m).appendTo(c),this.bindControl(new D12(k,g.trackPrice,!0,this.model(),"Change Price Line")))}b++}};
$47.prototype._prepareLayoutForArrowsPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e="Change "+c,g=$('<tr class="line"/>');g.appendTo(this._table);var h=$("<td/>");h.appendTo(g);h.addClass("visibility-cell");var k=$("<input type='checkbox' class='visibility-switch'/>");k.appendTo(h);c=this.D1.properties().styles[c].title.value();this.createLabeledCell(c,k).appendTo(g).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(g);
c.addClass("colorpicker-cell");c=TradingView.addColorPicker(c);h=$("<td/>");h.appendTo(g);h.addClass("colorpicker-cell");var h=TradingView.addColorPicker(h),l=$("<td>");l.appendTo(g);g=TradingView.createTransparencyEditor();g.appendTo(l);this.bindControl(new D12(k,d.visible,!0,this.model(),e));this.bindControl(new ColorBinding(c,d.colorup,!0,this.model(),e));this.bindControl(new ColorBinding(h,d.colordown,!0,this.model(),e));this.bindControl(new SliderBinder(g,d.transparency,!0,this.model(),
e))};$47.prototype._findPlotPalette=function(a,b){var c=b.id,d=null,e=null,g=this.D1.metaInfo().plots;if(this.D1.isBarColorerPlot(a)||this.D1.isBgColorerPlot(a))d=this.D1.metaInfo().palettes[b.palette],e=this.D1.properties().palettes[b.palette];else for(var h=0;h<g.length;h++)if(this.D1.isSelfColorerPlot(h)&&g[h].target===c){d=this.D1.metaInfo().palettes[g[h].palette];e=this.D1.properties().palettes[g[h].palette];break}return{palette:d,paletteProps:e}};
$47.prototype._prepareStudyPropertiesLayout=function(){var a=$('<table class="property-page study-properties" cellspacing="0" cellpadding="2">');if(!this.D1.metaInfo().is_price_study){var b=this.createPrecisionEditor(),c=$("<tr>");c.appendTo(a);$("<td>"+$.t("Precision")+"</td>").appendTo(c);$("<td>").append(b).appendTo(c);this.bindControl(new D11(b,this.D1.properties().precision,null,!0,this.model(),"Change Precision"))}"Compare@tv-basicstudies"==this.D1.metaInfo().id&&
(b=this.createSeriesMinTickEditor(),c=$("<tr>"),c.appendTo(a),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(c),$("<td>").append(b).appendTo(c),this.bindControl(new D11(b,this.D1.properties().minTick,null,!0,this.model(),"Change MinTick")));this._putStudyDefaultStyles(a);return a};
$47.prototype._putStudyDefaultStyles=function(a,b){var c=null,d=this.D1;if(d.properties().linkedToSeries&&d.properties().linkedToSeries.value())return!1;$.each(this.D0.m_model.panes().toArray(),function(a,b){$.each(b.D19().toArray(),function(a,e){if(e==d)return c=b,!1})});this._pane=c;var e;this._pane&&(this._pane.leftPriceScale().D19().contains(this.D1)?e="left":this._pane.rightPriceScale().D19().contains(this.D1)?e="right":this._pane.isOverlay(this.D1)&&
(e="none"));if(e){var g=this;e=this.createKeyCombo({left:$.t("Scale Left"),right:$.t("Scale Right"),none:$.t("Screen (No Scale)")}).val(e).change(function(){switch(this.value){case "left":g.D0.move(g.D1,g._pane,g._pane.leftPriceScale());break;case "right":g.D0.move(g.D1,g._pane,g._pane.rightPriceScale());break;case "none":g.D0.move(g.D1,g._pane,null)}});var h=this.addRow(a);$("<td>"+$.t("Scale")+"</td>").appendTo(h);e=$("<td>").appendTo(h).append(e);b&&2<b&&e.attr("colspan",
b-1)}return a};$47.prototype.widget=function(){return this._table};
$47.prototype._prepareFilledAreaBackground=function(a,b,c,d,e){var g=$('<tr class="line"/>'),h=$("<td/>");h.appendTo(g);var k=$("<input type='checkbox' class='visibility-switch'/>");k.appendTo(h);this.createLabeledCell(d,k).appendTo(g).addClass($.t("propertypage-name-label",{context:"css_class"}));d=$("<td/>");d.appendTo(g);d.addClass("colorpicker-cell");d=TradingView.addColorPicker(d);h=$("<td/>");h.attr("colspan","3");h.appendTo(g);var l=TradingView.createTransparencyEditor(d).width(230);
l.appendTo(h);this.bindControl(new D12(k,a,!0,this.model(),e+" visibility"));this.bindControl(new ColorBinding(d,b,!0,this.model(),e+" color"));this.bindControl(new SliderBinder(l,c,!0,this.model(),e+" transparency"));return g};function $39(a,b,c){D7.call(this,a,b);this.D1=c;this._property=a;this.prepareLayout()}inherit($39,D7);
$39.prototype.prepareLayout=function(){this.D1.properties().linkedToSeries&&this.D1.properties().linkedToSeries.value();this._table=$()};$39.prototype.widget=function(){return this._table};
$47._createRow_horizlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),g=this.createColorPicker(),h=TradingView.createLineWidthEditor(),k=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k.render()).appendTo(c);this.bindControl(new D12(e,b.visible,!0,this.model(),"Change "+
d+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(k,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(h,b.width,!0,this.model(),"Change "+d+" width"))};
$47._createRow_vertlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),g=this.createColorPicker(),h=TradingView.createLineWidthEditor(),k=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k.render()).appendTo(c);this.bindControl(new D12(e,b.visible,!0,this.model(),"Change "+
d+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(k,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(h,b.width,!0,this.model(),"Change "+d+" width"))};
$47._createRow_lines=function(a,b){var c=this.addRow(a),d=b.title.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),g=this.createColorPicker(),h=TradingView.createLineWidthEditor(),k=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k.render()).appendTo(c);this.bindControl(new D12(e,b.visible,!0,this.model(),"Change "+
d+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(k,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(h,b.width,!0,this.model(),"Change "+d+" width"))};
$47._createRow_hlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),g=this.createColorPicker(),h=TradingView.createLineWidthEditor(),k=TradingView.createLineStyleEditor(),l=$("<input type='checkbox'>");$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k.render()).appendTo(c);$("<td>").appendTo(c);$("<td>").append(l).appendTo(c);
this.createLabeledCell("Show Price",l).appendTo(c);this.bindControl(new D12(e,b.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(k,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(h,b.width,!0,this.model(),"Change "+d+" width"));this.bindControl(new D12(l,b.showPrice,!0,this.model(),"Change "+d+" show price"));b.enableText.value()&&
(c=this.addRow(a),$('<td colspan="2">').appendTo(c),e=$("<input type='checkbox'>"),$('<td class="text-center">').append(e).appendTo(c),this.createLabeledCell("Show Text",e).appendTo(c),this.bindControl(new D12(e,b.showText,!0,this.model(),"Change "+d+" show text")),e=TradingView.createTextPosEditor(),$("<td>").append(e.render()).appendTo(c),this.bindControl(new D11(e,b.textPos,parseInt,!0,this.model(),"Change "+d+" text position")),e=this.createFontSizeEditor(),$('<td colspan="2">').append(e).appendTo(c),
this.bindControl(new D11(e,b.fontSize,parseInt,!0,this.model(),"Change "+d+" font size")))};
$47._createRow_hhists=function(a,b){var c=b.title.value(),d=[],e=[],g=[],h=this.addRow(a),k=TradingView.createVisibilityEditor();$("<td>").append(k).appendTo(h);this.createLabeledCell(c,k).appendTo(h);this.bindControl(new D12(k,b.visible,!0,this.model(),"Change "+c+" Visibility"));h=this.addRow(a);k=$("<input/>");k.attr("type","text");k.addClass("ticker");this.createLabeledCell("Width (% of the Box)",k).appendTo(h);$("<td>").append(k).appendTo(h);h=[ToIntTransformer(40)];
h.push(GreateTransformer(0));h.push(LessTransformer(100));this.bindControl(new SimpleStringBinder(k,b.percentWidth,h,!1,this.model(),"Change Percent Width"));h=this.addLabeledRow(a,"Placement");k=TradingView.createHHistDirectionEditor();$("<td>").append(k).appendTo(h);this.bindControl(new D11(k,b.direction,null,!0,this.model(),"Change "+c+" Placement"));h=this.addRow(a);k=$("<input type='checkbox'>");$("<td>").append(k).appendTo(h);this.createLabeledCell("Show Values",k).appendTo(h);
this.bindControl(new D12(k,b.showValues,!0,this.model(),"Change "+c+" Show Values"));h=this.addRow(a);k=this.createColorPicker();this.createLabeledCell("Text Color",k).appendTo(h);$("<td>").append(k).appendTo(h);this.bindControl(new ColorBinding(k,b.valuesColor,!0,this.model(),"Change "+c+" Text Color"));for(var l in b.colors)isNumber(parseInt(l,10))&&(h=this.addRow(a),d[l]=b.titles[l].value(),e[l]=this.createColorPicker(),g[l]=TradingView.createTransparencyEditor(e[l]),$("<td>").append(d[l]).appendTo(h),
$("<td>").append(e[l]).appendTo(h),$("<td>").append(g[l]).appendTo(h),this.bindControl(new ColorBinding(e[l],b.colors[l],!0,this.model(),"Change "+d[l]+" color")),this.bindControl(new SliderBinder(g[l],b.transparencies[l],!0,this.model(),"Change "+d[l]+" transparency")))};
$47._createRow_backgrounds=function(a,b){var c=this.addRow(a),d=$("<input type='checkbox' class='visibility-switch'/>"),e=b.name.value(),g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g);$("<td>").append(d).appendTo(c);this.createLabeledCell(e,d).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);this.bindControl(new D12(d,b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),
"Change "+e+" color"));this.bindControl(new SliderBinder(h,b.transparency,!0,this.model(),"Change "+e+" transparency"))};
$47._createRow_polygons=function(a,b){var c=this.addRow(a),d=b.name.value(),e=this.createColorPicker(),g=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);$("<td>").append(e).appendTo(c);$("<td>").append(g).appendTo(c);this.bindControl(new ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new SliderBinder(g,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
$47._createRow_trendchannels=function(a,b){var c=this.addRow(a),d=b.name.value(),e=this.createColorPicker(),g=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);$("<td>").append(e).appendTo(c);$("<td>").append(g).appendTo(c);this.bindControl(new ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new SliderBinder(g,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
$47._createRow_textmarks=function(a,b){var c=this.addLabeledRow(a),d=b.name.value(),e=this.createColorPicker(),g=this.createColorPicker(),h=this.createFontEditor(),k=this.createFontSizeEditor(),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),n=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);"rectangle"!==
b.shape.value()&&$("<td>").append(e).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k).appendTo(c);$("<td>").append(l).appendTo(c);$("<td>").append(m).appendTo(c);$("<td>").append(n).appendTo(c);this.bindControl(new ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new ColorBinding(g,b.fontColor,!0,this.model(),"Change "+d+" text color"));this.bindControl(new D11(k,b.fontSize,parseInt,!0,this.model(),"Change "+
d+" font size"));this.bindControl(new D11(h,b.fontFamily,null,!0,this.model(),"Change "+d+" font"));this.bindControl(new D12(l,b.fontBold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(m,b.fontItalic,!0,this.model(),"Change Text Font Italic"));this.bindControl(new SliderBinder(n,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
$47._createRow_shapemarks=function(a,b){var c=this.addRow(a),d=$("<input type='checkbox' class='visibility-switch'/>"),e=b.name.value(),g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),k=$("<input/>");k.attr("type","text");k.addClass("ticker");$("<td>").append(d).appendTo(c);this.createLabeledCell(e,d).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);this.createLabeledCell("Size",k).appendTo(c);$("<td>").append(k).appendTo(c);this.bindControl(new D12(d,
b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new ColorBinding(g,b.color,!0,this.model(),"Change "+e+" back color"));this.bindControl(new SliderBinder(h,b.transparency,!0,this.model(),"Change "+e+" transparency"));this.bindControl(new SimpleStringBinder(k,b.size,null,!1,this.model(),"Change size"))};function A85(a,b,c){a=b.m_model.properties();D7.call(this,a,b);var d=this._series=b.mainSeries();this._chart=b.m_model;this.D0=b;this.W99=c;this._property=a;this._seriesProperty=d.properties();this._scaleProperty=d.m_priceScale.properties();this._mainAxisProperty=d.properties().priceAxisProperties;var e=null;$.each(b.m_model.panes().toArray(),function(a,b){$.each(b.D19().toArray(),function(a,c){if(c==d)return e=b,!1})});this._pane=e;this.prepareLayout();
this._themes=[]}inherit(A85,D7);inherit(A85,SeriesStylePropertyPageMixin);A85.prototype.setScalesOpenTab=function(){this.scalesColumnLeft.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE)};A85.prototype.setTmzOpenTab=function(){this.tmzSessTable.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE)};
A85.prototype.prepareLayout=function(){var a=this,b=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),c=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),d=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),e=$('<table class="property-page" cellspacing="0" cellpadding="2">'),g=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-separated",
!0),h=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales"));this.scalesColumnLeft=h;var k=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales")),l=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Timezone/Sessions"));this.tmzSessTable=l;var m=a._alertSettingsIsVisible()?"Events & Alerts":$.t("Events"),m=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",m);this.W99 instanceof TradingView.ESDStudyBase&&
m.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE);var n=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),q=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),r=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),u=$('<div class="property-page-column-2" style="min-width: 250px">').data("layout-tab",$.t("Background")),w=$('<div class="property-page-column-2" style="width: 170px">').data("layout-tab",
$.t("Background")),A=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Drawings")),v=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),B=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),D=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales"));this._prepareSeriesStyleLayout(b,c,d,this._seriesProperty);var C=$('<input type="checkbox">'),
z=this.addLabeledRow(v,"Price Line",C);$("<td>").append(C).prependTo(z);var F=TradingView.createLineWidthEditor();$("<td>").append(F).appendTo(z);var G=this.createSeriesMinTickEditor(),J=$("<tr>");J.appendTo(B);$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(J);$("<td>").append(G).appendTo(J);this.bindControl(new D11(G,this._seriesProperty.minTick,null,!0,this.model(),"Change MinTick"));!this._alertSettingsIsVisible()&&!TradingView.D18("esdindicatorfeature")||W77.enabled("charting_library")||
this.createEventsTable(m);this.bindControl(new D12(C,this._seriesProperty.showPriceLine,!0,this.model(),"Change Price Price Line"));this.bindControl(new SliderBinder(F,this._seriesProperty.priceLineWidth,!0,this.model(),"Change Price Line Width"));var C=$('<table class="property-page" cellspacing="0" cellpadding="2">'),E=this.createColorPicker(),F=this.createColorPicker(),G=TradingView.createLineStyleEditor(),J=TradingView.createTransparencyEditor(F),I=TradingView.createLineWidthEditor(),
L=this.createColorPicker(),P=TradingView.createLineStyleEditor(),H=this.createColorPicker(),R=this.createColorPicker(),O=this.createColorPicker(),t=TradingView.createTransparencyEditor(O),z=this.addLabeledRow(C,"Background");$('<td colspan="4">').append(E).appendTo(z);this.bindControl(new ColorBinding(E,this._property.paneProperties.background,!0,this.model(),"Change Chart Background Color"));E=this.addLabeledRow(C,"Grid Lines");$("<td>").append(L).appendTo(E);$('<td colspan="3">').append(P.render()).appendTo(E);
this.bindControl(new ColorBinding(L,this._property.paneProperties.gridProperties.color,!0,this.model(),"Change Grid Lines Color"));this.bindControl(new D11(P,this._property.paneProperties.gridProperties.style,parseInt,!0,this.model(),"Change Grid Lines Style"));L=this.addLabeledRow(C,"Scales Text");$('<td colspan="4">').append(H).appendTo(L);this.bindControl(new ColorBinding(H,this._property.scalesProperties.textColor,!0,this.model(),"Change Scales Text Color"));H=this.addLabeledRow(C,
"Scales Lines");$('<td colspan="4">').append(R).appendTo(H);this.bindControl(new ColorBinding(R,this._property.scalesProperties.lineColor,!0,this.model(),"Change Scales Lines Color"));R=this.addLabeledRow(C,"Watermark");$("<td>").append(O).appendTo(R);$('<td colspan="3">').append(t).appendTo(R);this.bindControl(new ColorBinding(O,this._property.symbolWatermarkProperties.color,!0,this.model(),"Change Symbol Watermark Color"));this.bindControl(new SliderBinder(t,this._property.symbolWatermarkProperties.transparency,
!0,this.model(),"Change Symbol Watermark Transparency"));O=this.addLabeledRow(C,"Crosshair");$("<td>").append(F).appendTo(O);$("<td>").append(G.render()).appendTo(O);$("<td>").append(I).appendTo(this.addRow(C).prepend("<td/><td/>"));$("<td>").append(J).appendTo(this.addRow(C).prepend("<td/><td/>"));this.bindControl(new ColorBinding(F,this._property.paneProperties.crossHairProperties.color,!0,this.model(),"Change Crosshair Color"));this.bindControl(new D11(G,this._property.paneProperties.crossHairProperties.style,
parseInt,!0,this.model(),"Change Crosshair Style"));this.bindControl(new SliderBinder(I,this._property.paneProperties.crossHairProperties.width,!0,this.model(),"Change Crosshair Width"));this.bindControl(new SliderBinder(J,this._property.paneProperties.crossHairProperties.transparency,!0,this.model(),"Change Crosshair Transparency"));F=$('<table class="property-page" cellspacing="0" cellpadding="2">');G=$('<input type="checkbox">');z=this.addLabeledRow(F,"Symbol Description",G);$("<td>").append(G).prependTo(z);
this.bindControl(new D12(G,this._property.paneProperties.legendProperties.showSeriesTitle,!0,this.model(),"Change Symbol Description Visibility"));G=$('<input type="checkbox">');z=this.addLabeledRow(F,"OHLC Values",G);$("<td>").append(G).prependTo(z);this.bindControl(new D12(G,this._property.paneProperties.legendProperties.showSeriesOHLC,!0,this.model(),"Change OHLC Values Visibility"));G=$('<input type="checkbox">');z=this.addLabeledRow(F,"Indicator Titles",G);$("<td>").append(G).prependTo(z);
this.bindControl(new D12(G,this._property.paneProperties.legendProperties.showStudyTitles,!0,this.model(),"Change Indicator Titles Visibility"));var S=$('<input type="checkbox">'),z=this.addLabeledRow(F,"Indicator Arguments",S);$("<td>").append(S).prependTo(z);this.bindControl(new D12(S,this._property.paneProperties.legendProperties.showStudyArguments,!0,this.model(),"Change Indicator Arguments Visibility"));G=$('<input type="checkbox">');z=this.addLabeledRow(F,"Indicator Values",
G);$("<td>").append(G).prependTo(z);this.bindControl(new D12(G,this._property.paneProperties.legendProperties.showStudyValues,!0,this.model(),"Change Indicator Values Visibility"));G=function(a){S.prop("disabled",!a.value())};this._property.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,G);G(this._property.paneProperties.legendProperties.showStudyTitles);G=$('<input type="checkbox">');J=$('<input type="checkbox">');I=$('<input type="checkbox">');I.change(function(){this.checked&&
setTimeout(function(){a.D0.m_model.D20(new A22(A22.LIGHT_UPDATE))},0)});O=$('<input type="checkbox">');O.change(function(){this.checked&&setTimeout(function(){a.D0.m_model.D20(new A22(A22.LIGHT_UPDATE))},0)});var N=$("<input type='checkbox'>"),t=$("<input type='checkbox' />"),R=$("<input type='checkbox' />"),H=$('<input type="checkbox">'),L=$('<input type="checkbox">'),P=$("<input type='checkbox' />"),
E=$("<input type='checkbox' />"),M;this._pane&&(this._pane.leftPriceScale().D19().contains(this._series)?M="left":this._pane.rightPriceScale().D19().contains(this._series)?M="right":this._pane.isOverlay(this._series)&&(M="none"));M&&(z={left:$.t("Scale Left"),right:$.t("Scale Right")},a._pane.actionNoScaleIsEnabled(a._series)&&(z.none=$.t("Screen (No Scale)")),M=this.createKeyCombo(z).val(M).change(function(){switch(this.value){case "left":a.D0.move(a._series,a._pane,a._pane.leftPriceScale());
break;case "right":a.D0.move(a._series,a._pane,a._pane.rightPriceScale());break;case "none":a.D0.move(a._series,a._pane,null)}}),z=this.addRow(r),$("<td>").appendTo(z).append(M));this.bindControl(new D12(N,this._seriesProperty.showCountdown,!0,this.model(),"Change Show Countdown"));z=this.addLabeledRow(q,"Auto Scale",I);$("<td>").append(I).prependTo(z);z=this.addLabeledRow(q,"Percentage",G);$("<td>").append(G).prependTo(z);z=this.addLabeledRow(q,"Log Scale",J);$("<td>").append(J).prependTo(z);
z=this.addLabeledRow(q,"Scale Series Only",O);$("<td>").append(O).prependTo(z);z=this.addLabeledRow(n,"Show Left Axis",t);$("<td>").append(t).prependTo(z);z=this.addLabeledRow(n,"Show Right Axis",R);$("<td>").append(R).prependTo(z);W77.enabled("countdown")&&(z=this.addLabeledRow(n,"Show Countdown",N),$("<td>").append(N).prependTo(z));z=this.addLabeledRow(n,"Symbol Last Value",H);$("<td>").append(H).prependTo(z);z=this.addLabeledRow(n,"Indicator Last Value",L);$("<td>").append(L).prependTo(z);
z=this.addLabeledRow(n,"Show Symbol Labels",P);$("<td>").append(P).prependTo(z);z=this.addLabeledRow(n,"Precise Labels",E);$("<td>").append(E).prependTo(z);z=$("<tr>").appendTo(l);M=$("<td>").appendTo(z);M=$('<table cellspacing="0" cellpadding="0">').appendTo(M);z=$(document.createElement("tr"));z.appendTo(M);M=$(document.createElement("td"));M.appendTo(z);M.text($.t("Time Zone"));M=$(document.createElement("td")).attr("colspan",2);M.appendTo(z);for(var U,z="",N=0;N<TradingView.availableTimezones.length;N++)z+=
'<option value="'+TradingView.availableTimezones[N].id+'">'+TradingView.availableTimezones[N].title+"</option>";z=$("<select>"+z+"</select>").change(function(){var b=$(this).val();U||(U=setTimeout(function(){a._chart._chartApi.switchTimezone(b);U=!1},300))});z.appendTo(M);this.bindControl(new D11(z,this._property.timezone,null,!0,this.model(),"Change Timezone"));W77.enabled("charting_library")||(this._series.createSessStudy(),this.createSessTable(l));M=null;W77.enabled("trading_options")&&
TradingView.D18("paper_trading")&&(M=this.createTradingTable());var N=$("<input type='checkbox'/>"),Q=this.addLabeledRow(q,"Lock scale",N);$("<td>").append(N).prependTo(Q);this._seriesProperty.style.listeners().subscribe(this,function(a){Q.toggle(a.value()==TradingView.Series.STYLE_PNF)});var V=$('<input type="text" class="ticker">'),z=this.addLabeledRow(D,"Top Margin",V);$("<td>").appendTo(z).append(V);$("<td>%</td>").appendTo(z);z=[ToIntTransformer(this._property.paneProperties.topMargin.value())];
z.push(LessTransformer(25));z.push(GreateTransformer(0));this.bindControl(new SimpleStringBinder(V,this._property.paneProperties.topMargin,z,!0,this.model(),"Top Margin"));V=$('<input type="text" class="ticker">');z=this.addLabeledRow(D,"Bottom Margin",V);$("<td>").appendTo(z).append(V);$("<td>%</td>").appendTo(z);z=[ToIntTransformer(this._property.paneProperties.bottomMargin.value())];z.push(LessTransformer(25));z.push(GreateTransformer(0));this.bindControl(new SimpleStringBinder(V,this._property.paneProperties.bottomMargin,
z,!0,this.model(),"Bottom Margin"));V=$('<input type="text" class="ticker">');z=this.addLabeledRow(D,"Right Margin",V);$("<td>").appendTo(z).append(V);$("<td>"+$.t("bars",{context:"margin"})+"</td>").appendTo(z);z=[ToIntTransformer(this._property.timeScale.rightOffset.value())];z.push(LessTransformer(~~this._chart.m_timeScale.maxOffset()));z.push(GreateTransformer(-200));this.bindControl(new SimpleStringBinder(V,this._property.timeScale.rightOffset,z,!0,this.model(),"Right Margin"));this.bindControl(new D12(t,
this._property.scalesProperties.showLeftScale,!0,this.model(),"Show Left Axis"));this.bindControl(new D12(R,this._property.scalesProperties.showRightScale,!0,this.model(),"Show Right Axis"));this.bindControl(new D12(P,this._scaleProperty.showSymbolLabels,!0,this.model(),"Show Symbol Labels"));this.bindControl(new D12(E,this._scaleProperty.alignLabels,!0,this.model(),"Precise Labels"));this.bindControl(new D12(I,this._scaleProperty.autoScale,!0,this.model(),
"Auto Scale",function(b){this._undoModel.setAutoScaleProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(I,this._scaleProperty.autoScaleDisabled,!0,this.model(),"Auto Scale"));this.bindControl(new D12(O,this._property.scalesProperties.scaleSeriesOnly,!0,this.model(),"Scale Series Only"));this.bindControl(new D12(G,this._mainAxisProperty.percentage,!0,this.model(),"Scale Percentage",function(b){this._undoModel.setPercentProperty(this._property,
b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(G,this._mainAxisProperty.percentageDisabled,!0,this.model(),"Scale Percentage"));this.bindControl(new D12(J,this._mainAxisProperty.log,!0,this.model(),"Log Scale",function(b){this._undoModel.setLogProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(J,this._mainAxisProperty.logDisabled,!0,this.model(),"Log Scale"));this.bindControl(new D12(H,this._property.scalesProperties.showSeriesLastValue,
!0,this.model(),"Change Symbol Last Value Visibility"));this.bindControl(new D12(L,this._property.scalesProperties.showStudyLastValue,!0,this.model(),"Change Indicator Last Value Visibility"));this.bindControl(new D12(N,this._seriesProperty.lockScale,!0,this.model(),"Change lock scale",function(b){this._undoModel.setLockScaleProperty(this._property,b,a._series,this._undoText)}));this._table=this._table=b.add(c).add(d).add(e).add(g).add(v).add(B).add(h).add(k).add(u).add(w).add(A).add(l).add(M).add(m);
k.append(r);k.append(n);h.append(q);h.append(D);u.append(C);w.append(F);this.loadData()};A85.prototype.widget=function(){return this._table};A85.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};A85.prototype.loadTheme=function(a){var b=this;$.get("/theme/?themeName="+encodeURIComponent(a),function(c){b.D0._lastLoadedTheme=a;b.applyTheme(JSON.parse(c.content))})};
A85.prototype.applyTheme=function(a){var b=this._seriesProperty.extendedHours.value();this.D0.model().restoreTheme(a);this._seriesProperty.extendedHours.value()!==b&&this._seriesProperty.extendedHours.listeners().fire(this._seriesProperty.extendedHours);this.loadData()};
A85.prototype.createTemplateButton=function(a){if(W77.enabled("charting_library"))return $("<span />");var b=this;a||(a={});var c=function(){var c=[];c.push({title:"Save As...",action:function(){runOrSignIn(function(){TradingView.showChartNameDialog(function(a){if(a){var c={name:a,content:JSON.stringify(b.D0.model().theme())};$.post("/save-theme/",c).error(function(a){document.write(a.responseText)});b._themes.push(a);b.D0._lastLoadedTheme=a}},"Save theme as...",
"Theme name")},!0)},addClass:"special"});"function"===typeof a.defaultsCallback&&c.push({title:"Apply Defaults",action:a.defaultsCallback,addClass:"special"});var d=[];$.each(b._themes,function(a,c){d.push({title:c,action:function(){b.loadTheme(c)},deleteAction:is_authenticated?function(){var a=this;A83.showConfirm("Theme","Do you realy want to delete "+(c?'"'+c+'"':"")+" theme?",function(){a instanceof $&&a.remove();$.post("/remove-theme/",{name:c}).error(function(a){console.error(a.responseText)});
TradingView.getThemesList.D20();for(var d=b._themes.length;d--;)b._themes[d]==c&&b._themes.splice(d,1)})}:void 0})});d.length&&(d.sort(function(a,b){a=a.title.toUpperCase();b=b.title.toUpperCase();return a==b?0:a>b?1:-1}),c.push({separator:!0}),c=c.concat(d));return c},d=$('<a href="#" class="tv-button">'+$.t("Themes")+'<span class="icon-dropdown"></span></a>');TradingView.bindPopupMenu(d,null,{direction:"up",event:"button-popup",notCloseOnButtons:!0});d.bind("click",function(){var a=$(this);
a.is(".active")||TradingView.getThemesList(function(d){b._themes=d;a.trigger("button-popup",[c(),!0])})});return d};
A85.prototype.switchStyle=function(){toggledTbodies=$(this._barsTbody).add(this._barsColorerTbody).add(this._renkoTbody).add(this._pbTbody).add(this._kagiTbody).add(this._pnfTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).add(this._haTbody).add(this._haColorerTbody).css("display","none");switch(this._seriesProperty.style.value()){case TradingView.Series.STYLE_BARS:this._barsTbody.css("display",
"table-row-group");this._barsColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_CANDLES:this._candlesTbody.css("display","table-row-group");this._candlesColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_AREA:this._areaTbody.css("display","table-row-group");
break;case TradingView.Series.STYLE_RENKO:this._renkoTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_PB:this._pbTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_KAGI:this._kagiTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_PNF:this._pnfTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._haTbody.css("display","table-row-group"),this._haColorerTbody.css("display","table-row-group")}};
A85.prototype.onResoreDefaults=function(){var a=this.D0.model().properties().paneProperties.topMargin,b=this.D0.model().properties().paneProperties.bottomMargin;a.listeners().fire(a);b.listeners().fire(b);TradingView.bottomWidgetBar&&(A77.setWatchedValue(TradingView.bottomWidgetBar.hideFloatingPanel,!1,"Restore Defaults"),A77.setWatchedValue(TradingView.bottomWidgetBar.hideCompletedOrders,!1,"Restore Defaults"),A77.setWatchedValue(TradingView.bottomWidgetBar.noConfirmEnabled,
!1,"Restore Defaults"))};
A85.prototype.defaultProperties=function(){var a=this,b=[a._seriesProperty.extendedHours,a._property.scalesProperties.showLeftScale,a._property.scalesProperties.showRightScale,a._property.timeScale.rightOffset].map(function(a){return{property:a,previousValue:a.value()}});setTimeout(function(){b.forEach(function(a){a.property.value()!==a.previousValue&&a.property.listeners().fire(a.property)});var c=new $52("chartproperties.paneProperties.rightAxisProperties");$.each(["autoScale",
"percentage","log"],function(b,e){var g=a._scaleProperty[e],h=c[e].value();h!==g.value()&&g.setValue(h)})},0);return[this._property,this._seriesProperty]};A85.prototype._alertSettingsIsVisible=function(){return TradingView.D18("alerts")&&!TradingView.onWidget()&&!W77.enabled("charting_library")};
A85.prototype.createEventsTable=function(a){if(TradingView.D18("esdindicatorfeature")){var b=$("<tr>").appendTo(a),c=$('<input type="checkbox" />'),d=this.addLabeledRow(b,"Show Dividends on Chart",c);$("<td>").append(c).prependTo(d);d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowDividends,!0,this.model(),"Change Show or Hide Dividends"));c=$('<input type="checkbox" />');d=this.addLabeledRow(b,"Show Splits on Chart",c);$("<td>").append(c).prependTo(d);
d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowSplits,!0,this.model(),"Change Show or Hide Splits"));c=$('<input type="checkbox" />');d=this.addLabeledRow(b,"Show Earnings on Chart",c);$("<td>").append(c).prependTo(d);d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowEarnings,!0,this.model(),"Change Show or Hide Earnings"));var d=this.createTableInTable(a),e=$('<input type="checkbox" />'),b=TradingView.createLineStyleEditor(),c=TradingView.addColorPicker(),
g=TradingView.createLineWidthEditor(),d=this.addLabeledRow(d,"Earnings breaks",e);$("<td>").append(e).prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(b.render()).appendTo(d);$("<td>").append(g).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new D12(e,this._seriesProperty.esdShowBreaks,!0,this.model(),"Change Show or Hide Earnings"));this.bindControl(new ColorBinding(c,this._seriesProperty.esdBreaksStyle.color,!0,this.model(),"Change earnings color"));
this.bindControl(new D11(b,this._seriesProperty.esdBreaksStyle.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new SliderBinder(g,this._seriesProperty.esdBreaksStyle.width,!0,this.model(),"Change width"));this._seriesProperty.esdShowEarnings.listeners().subscribe(this,function(a){e.prop("disabled",!a.value())})}if(this._alertSettingsIsVisible()){d=$("<tr>").appendTo(a);b=$('<input type="checkbox" />');d=this.addLabeledRow(d,"Show Alert Labels",b);$("<td>").append(b).prependTo(d);
d.append("<td>");var h=this._property.alertsProperties.labels.visible;this.bindControl(new D12(b,h,!0,this.model(),"Change Show or Hide Alert Labels",function(a){this.D0.beginUndoMacro("Show Alert Labels");this.D0.setProperty(h,a,"Show Alert Labels");this.D0.endUndoMacro()}.bind(this)));var d=this.createTableInTable(a),k=$('<input type="checkbox">');a=TradingView.addColorPicker();var l=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),m=b.render(),d=
this.addLabeledRow(d,"Extended Alert Line",k);$("<td>").append(k).prependTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(m).appendTo(d);$("<td>").append(l).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new D12(k,this._property.alertsProperties.labels.line.visible,!0,this.model(),"Change Show or Hide Alert Labels Lines"));this.bindControl(new ColorBinding(a,this._property.alertsProperties.labels.color,!0,this.model(),"Change Alerts Labels color"));this.bindControl(new D11(b,
this._property.alertsProperties.labels.line.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new SliderBinder(l,this._property.alertsProperties.labels.line.width,!0,this.model(),"Change width"));h.listeners().subscribe(this,function(a){k.prop("disabled",!a.value());m.prop("disabled",!a.value());l.prop("disabled",!a.value())})}};
A85.prototype.createSessTable=function(a){var b=this._series.sessionsStudy().properties(),c=this.createTableInTable(a),d=b.name.value(),e=$("<input type='checkbox' />"),c=this.addLabeledRow(c,"Session Breaks",e),g=TradingView.createLineStyleEditor(),h=TradingView.addColorPicker(),k=TradingView.createLineWidthEditor();$("<td>").append(e).prependTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(g.render()).appendTo(c);$("<td>").append(k).appendTo(c);this.bindControl(new D12(e,
b.graphics.vertlines.sessBreaks.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new ColorBinding(h,b.graphics.vertlines.sessBreaks.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(g,b.graphics.vertlines.sessBreaks.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(k,b.graphics.vertlines.sessBreaks.width,!0,this.model(),"Change "+d+" width"));c=this.createTableInTable(a);d=this._extendedHoursEditor=$('<input type="checkbox" />');
c=this.addLabeledRow(c,"Extended Hours (Intraday Only)",d);$("<td>").append(d).prependTo(c);this.bindControl(new D12(d,this._seriesProperty.extendedHours,!0,this.model(),"Change Extended Hours"));this._seriesProperty.sessVis=b.graphics.vertlines.sessBreaks.visible;var c=this.createTableInTable(a),l=this._createStudySessRow(c,"Extended Hours",b.graphics.backgrounds.outOfSession),m=this._createStudySessRow(c,"In Session",b.graphics.backgrounds.inSession);a=function(a){l.prop("disabled",!a.value());
m.prop("disabled",!a.value())};this._seriesProperty.extendedHours.listeners().subscribe(this,a);a(this._seriesProperty.extendedHours);a=this._series.isIntradayInterval();e.prop("disabled",!a);return c};
A85.prototype._createStudySessRow=function(a,b,c){var d=$("<input type='checkbox' />");a=this.addLabeledRow(a,b,d);var e=TradingView.addColorPicker($("<td>").appendTo(a)),g=TradingView.createTransparencyEditor(e);this.bindControl(new D12(d,c.visible,!0,this.model(),"Change "+b+" visibility"));this.bindControl(new ColorBinding(e,c.color,!0,this.model(),b+" color"));this.bindControl(new SliderBinder(g,c.transparency,!0,this.model(),b+" transparency"));$("<td>").append(d).prependTo(a);
a.addClass("offset-row");$("<td>").append(g).appendTo(a);return d};
A85.prototype.createTradingTable=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Trading")),b=$("<tr>").appendTo(a),c=$("<td>").appendTo(b),c=$('<table cellspacing="0" cellpadding="0">').appendTo(c),d=$('<input type="checkbox">'),b=this.addLabeledRow(c,$.t("Show Positions"),d);$("<td>").append(d).prependTo(b);this.bindControl(new D12(d,this._property.tradingProperties.showPositions,!0,this.model(),"Change Positions Visibility"));
d=$('<input type="checkbox">');b=this.addLabeledRow(c,$.t("Show Orders"),d);$("<td>").append(d).prependTo(b);this.bindControl(new D12(d,this._property.tradingProperties.showOrders,!0,this.model(),"Change Orders Visibility"));b=$('<input type="checkbox">');d=this.addLabeledRow(c,$.t("Extend Lines Left"),b);$("<td>").append(b).prependTo(d);this.bindControl(new D12(b,this._property.tradingProperties.extendLeft,!0,this.model(),"Extend Lines Left"));b=TradingView.createLineWidthEditor();
this.bindControl(new SliderBinder(b,this._property.tradingProperties.lineWidth,!0,this.model(),"Change Connecting Line Width"));d=TradingView.createLineStyleEditor();this.bindControl(new D11(d,this._property.tradingProperties.lineStyle,parseInt,!0,this.model(),"Change Connecting Line Style"));var e=$('<input type="text" class="ticker">'),g=[ToIntTransformer(this._property.tradingProperties.lineLength.value()),LessTransformer(100),GreateTransformer(0)];this.bindControl(new SimpleStringBinder(e,
this._property.tradingProperties.lineLength,g,!0,this.model(),"Change Connecting Line Length"));g=$("<tbody>");g=this.addLabeledRow(c,$.t("Connecting Line"),g);$("<td>").prependTo(g);$("<td>").append(b).appendTo(g);$('<td colspan="3">').append(d.render()).appendTo(g);$('<td colspan="3">').append(e).appendTo(g);$("<td>%</td>").appendTo(g);b=$('<input type="checkbox">');d=this.addLabeledRow(c,$.t("Show Executions"),b);$("<td>").append(b).prependTo(d);this.bindControl(new D12(b,this._property.tradingProperties.showExecutions,
!0,this.model(),"Change Executions Visibility"));TradingView.bottomWidgetBar&&(b=$('<input type="checkbox">'),d=this.addLabeledRow(c,$.t("Show Buy/Sell Panel"),b),$("<td>").append(b).prependTo(d),this.bindControl(new CheckboxWVBinding(b,TradingView.bottomWidgetBar.hideFloatingPanel,null,"Change buy/sell panel visibility",!0)),b=$('<input type="checkbox">'),d=this.addLabeledRow(c,$.t("Show Active Orders Only"),b),$("<td>").append(b).prependTo(d),this.bindControl(new CheckboxWVBinding(b,TradingView.bottomWidgetBar.hideCompletedOrders,
null,"Change completed orders visibility")),b=$('<input type="checkbox">'),c=this.addLabeledRow(c,$.t("Require Order Confirmation"),b),$("<td>").append(b).prependTo(c),this.bindControl(new CheckboxWVBinding(b,TradingView.bottomWidgetBar.noConfirmEnabled,null,"Change order confirmation state",!0)));return a};function $38(a,b){D7.call(this,a,b);this.prepareLayout()}inherit($38,D7);
$38.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createKeyCombo({open:$.t("Open"),high:$.t("High"),low:$.t("Low"),close:$.t("Close")}),b=this.addLabeledRow(this._table,$.t("Source",{context:"compare"}));$("<td>").appendTo(b).append(a);this.bindControl(new D11(a,this._property.inputs.source,null,!0,this.model(),
"Change Price Source"));this.loadData()};$38.prototype.widget=function(){return this._table};TradingView.SoundSelector=function(a){a.container||console.error("[SoundSelector] options.container is required");a=$.extend(this.defaultOptions(),a);this.fileName=new WatchedValue(a.fileName);this.duration=new WatchedValue(a.duration);this._$container=a.container;this._$durationContainer=a.durationContainer;this._onChange=a.onChange||function(){console.warn("[SoundSelector] 'onChange' callback is not defined")};this._options=a;this._nowPlaying=null;this._attachHandlers();this._render()};
TradingView.SoundSelector.prototype.soundList=function(){this._soundListArray||(this._soundListArray=$.map(TradingView.Sound.alertSounds(),function(a){return{fileName:a.path,title:a.title}}));return this._soundListArray};TradingView.SoundSelector.prototype.defaultOptions=function(){return{fileName:this.soundList()[0].fileName,duration:""}};
TradingView.SoundSelector.prototype._attachHandlers=function(){var a=this;a.fileName.subscribe(function(b){a._onChange(b,a.duration.value());a._$button.find(".title").text(a._fileName2title(b))});a.duration.subscribe(function(b){a._onChange(a.fileName.value(),b)})};
TradingView.SoundSelector.prototype._render=function(){var a=this;a._$container.empty();a._$button=$('<a class="tv-button with-arrow"><span class="title">'+a._fileName2title(a.fileName.value())+'</span><span class="icon-dropdown"></span></a>');a._$button.appendTo(a._$container);TradingView.bindPopupMenu(a._$button,function(){return $.map(a.soundList(),function(b){var d=$('<span class="manage-sound-button"></span>'),e=function(){var e=!!TradingView.Sound.isPlaying(b.fileName);d.toggleClass("stop",
e);d.toggleClass("play",!e);a._nowPlaying=e?b.fileName:null};e();if(TradingView.Sound.isPlaying(b.fileName))TradingView.Sound.onStopped(b.fileName,e);return{title:b.title,action:function(){a.fileName.setValue(b.fileName)},active:b.fileName===a.fileName.value(),buttons:[{el:d,handler:function(g){g.stopPropagation();d.hasClass("play")?(TradingView.Sound.stop(),TradingView.Sound.play(b.fileName,!1,a.duration.value()),TradingView.Sound.onStopped(b.fileName,e)):d.hasClass("stop")&&TradingView.Sound.stop(b.fileName);
e()}}]}})},{direction:"down",addClass:"sound-selector"});if(a._$durationContainer){a._$durationContainer.empty();var b=$('<select><option value="0">Once</option><option value="5">5 seconds</option><option value="10">10 seconds</option><option value="30">30 seconds</option><option value="60">1 minute</option></select>');b.change(function(){var c=parseInt(b.val());a.duration.setValue(c)});b.appendTo(a._$durationContainer);b.val(a.duration.value()||0)}};
TradingView.SoundSelector.prototype._fileName2title=function(a){for(var b=this.soundList(),c=0;c<b.length;c++)if(b[c].fileName===a)return b[c].title};TradingView.SoundSelector.prototype.destroy=function(){var a=this;a.fileName.unsubscribe(function(b){a._onChange({fileName:b})});a.duration.unsubscribe(function(b){a._onChange({duration:b})});TradingView.unbindPopupMenu(a._$button);a._nowPlaying&&TradingView.Sound.stop(a._nowPlaying)};TradingView.LabelsImageCache=function(a,b,c,d){this._cacheSize=50;this._labelsWidth=d;this._fontSize=c;this._canvas=$("<canvas>").attr("width",d).attr("height",(c+2)*this._cacheSize);this._ctx=this._canvas.get(0).getContext("2d");this._ctx.font=a;this._ctx.textBaseline="bottom";this._ctx.fillStyle=b;this._labelsMap={};this._actualSize=this._usageCounter=0;this._indexTolabelCache={}};
TradingView.LabelsImageCache.prototype.reset=function(a){this._ctx.clearRect(0,0,this._labelsWidth,(this._fontSize+2)*this._cacheSize);this._ctx.fillStyle=a;this._indexTolabelCache={};this._labelsMap={}};
TradingView.LabelsImageCache.prototype.paintTo=function(a,b,c,d,e){b=this.getLabelImage(b);"left"==e?a.drawImage(this._canvas.get(0),0,b.y,this._labelsWidth,this._fontSize+2,c,Math.ceil(d-(this._fontSize+2)/2),this._labelsWidth,this._fontSize+2):a.drawImage(this._canvas.get(0),0,b.y,this._labelsWidth,this._fontSize+2,c-b.width,Math.ceil(d-(this._fontSize+2)/2),this._labelsWidth,this._fontSize+2)};
TradingView.LabelsImageCache.prototype.getLabelImage=function(a){if(this._labelsMap[a])this._labelsMap[a].accessTimestamp=this._usageCounter;else{if(this._actualSize<this._cacheSize){for(var b=0;b<this._cacheSize;b++)if(!this._indexTolabelCache[b]){this._indexTolabelCache[b]=a;this._actualSize++;var c=b*(this._fontSize+2);this._ctx.clearRect(0,c,this._labelsWidth,this._fontSize+2);this._ctx.fillText(a,0,c+(this._fontSize+2));var d=this._ctx.measureText(a).width;this._labelsMap[a]={y:c,accessTimestamp:this._usageCounter,
index:b,width:d};this._usageCounter++;return this._labelsMap[a]}throw"internal LabelsImageCache failure";}b=1E6;d="";for(c in this._labelsMap){var e=this._labelsMap[c].accessTimestamp;b>e&&(b=e,d=c)}b=this._labelsMap[d];delete this._labelsMap[d];this._indexTolabelCache[b.index]=a;this._ctx.clearRect(0,b.y,this._labelsWidth,this._fontSize+2);this._ctx.fillText(a,0,b.y+(this._fontSize+2));d=this._ctx.measureText(a).width;this._labelsMap[a]={y:b.y,accessTimestamp:this._usageCounter,index:b.index,width:d}}this._usageCounter++;
return this._labelsMap[a]};function $14(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit($14,D7);
$14.prototype._createPointRow=function(a,b,c){a=$("<tr>");var d=$("<td>");d.html($.t("Price")+c);d.appendTo(a);d=$("<td>");d.appendTo(a);c=$("<input type='text'>");c.appendTo(d);d=$("<td>");d.html($.t("Bar #"));d.appendTo(a);barEditCell=$("<td>");barEditCell.appendTo(a);d=$("<input type='text'>");d.appendTo(barEditCell);d.addClass("ticker");var e=[ToFloatTransformer(b.price.value())];this.bindControl(new SimpleStringBinder(c,b.price,e,!1,this.model(),"Change "+this._linetool+
" point price"));e=[ToIntTransformer(b.bar.value()),GreateTransformer(-5E4),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(d,b.bar,e,!1,this.model(),"Change "+this._linetool+" point bar index"));return a};
$14.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=this._linetool.points(),b=a.size(),c=0;c<a.size();c++){var d=a.item(c),e=this._linetool.properties().points[c];e&&this._createPointRow(d,e,(c||1<b?" "+(c+1):"")+"").appendTo(this._table)}this.loadData()};$14.prototype.widget=function(){return this._table};function A91(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A91,$49);
A91.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=$("<tbody>").appendTo(this._table),b=this.createColorPicker(),c=this.addLabeledRow(a,"Color");$("<td>").append(b).appendTo(c);var d=$('<select><option value="0">'+$.t("Bars")+'</option><option value="1">'+$.t("Line")+"</option></select>"),c=this.addLabeledRow(a,"Mode");
$("<td>").append(d).appendTo(c);c=$("<tr>").appendTo(a);$("<td>"+$.t("Mirrored")+"</td>").appendTo(c);var e=$("<input type='checkbox'>");$("<td>").append(e).appendTo(c);c=$("<tr>").appendTo(a);$("<td>"+$.t("Flipped")+"</td>").appendTo(c);a=$("<input type='checkbox'>");$("<td>").append(a).appendTo(c);this.bindControl(new D12(e,this._linetool.properties().mirrored,!0,this.model(),"Change Bars Pattern Mirroring"));this.bindControl(new D12(a,this._linetool.properties().flipped,!0,
this.model(),"Change Bars Pattern Flipping"));this.bindControl(new ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Bars Pattern Color"));this.bindControl(new D11(d,this._linetool.properties().mode,null,!0,this.model(),"Change Bars Pattern Mode"));this.loadData()};A91.prototype.widget=function(){return this._table};function A90(a,b,c){$14.call(this,a,b,c)}
inherit(A90,$14);
A90.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._linetool.points().item(0);var a=$("<tr>");a.appendTo(this._table);var b=$("<td>");b.html($.t("Price"));b.appendTo(a);var c=$("<td>");c.appendTo(a);b=$("<input type='text'>");b.appendTo(c);c=$("<td>");c.html($.t("Bar #"));c.appendTo(a);barEditCell=$("<td>");barEditCell.appendTo(a);
a=$("<input type='text'>");a.appendTo(barEditCell);a.addClass("ticker");var c=this._linetool.properties().points[0],d=[ToFloatTransformer(c.price.value())];this.bindControl(new SimpleStringBinder(b,c.price,d,!1,this.model(),"Change "+this._linetool+" point price"));d=[ToIntTransformer(c.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(a,c.bar,d,!1,this.model(),"Change "+this._linetool+" point bar index"));this.loadData()};function A93(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A93,$49);
A93.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createFontSizeEditor(),c=this.createFontEditor(),d=this.createTextEditor(350,200),e=this.createColorPicker(),g=TradingView.createTransparencyEditor(e),h=TradingView.createLineWidthEditor(),k=this.createColorPicker(),l=$('<input type="checkbox">'),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),n=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Text Color"));this.bindControl(new D11(b,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(c,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),"Change Text"));this.bindControl(new ColorBinding(e,
this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new ColorBinding(k,this._linetool.properties().bordercolor,!0,this.model(),"Change Text Color"));this.bindControl(new SliderBinder(h,this._linetool.properties().linewidth,!0,this.model(),"Change Border Width"));this.bindControl(new D12(l,this._linetool.properties().wordWrap,
!0,this.model(),"Change Text Wrap"));this.bindControl(new D12(m,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(n,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));var q=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE),r=$('<table class="property-page" cellspacing="0" cellpadding="2">'),u=$('<table class="property-page" cellspacing="0" cellpadding="2">');
this._table=q.add(u).add(r);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(b)).append($(document.createElement("td")).attr({width:1}).append(m)).append($(document.createElement("td")).append(n)).appendTo(q);$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(q);a=this.addLabeledRow(r,
"Text Wrap",l);$("<td>").append(l).prependTo(a);a=this.addLabeledRow(u,"Background");$("<td>").append(e).appendTo(a);$("<td>").append(g).appendTo(a);a=this.addLabeledRow(u,"Border");$("<td>").append(k).appendTo(a);$("<td>").append(h).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};A93.prototype.widget=function(){return this._table};function $32(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($32,$49);
$32.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);var e=$("<tbody>").appendTo(this._table),g=$("<label>"+
$.t("Extend")+" </label>").css({"margin-left":"8px"}),h=$('<input type="checkbox">').appendTo(g),k=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),l=$('<input type="checkbox">').appendTo(k),m=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),n=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),a=this.addLabeledRow(e,$.t("Left End"));$('<td colspan="3">').appendTo(a).append(m).append(g);
a=this.addLabeledRow(e,$.t("Right End"));$('<td colspan="3">').appendTo(a).append(n).append(k);a=this.addLabeledRow(e,$.t("Stats Text Color"));g=this.createColorPicker();$("<td>").append(g).appendTo(a);this.bindControl(new ColorBinding(g,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));g=$('<input type="checkbox">');$('<input type="checkbox">');var k=$('<input type="checkbox">'),q=$('<input type="checkbox">'),r=$('<input type="checkbox">'),u=$('<input type="checkbox">'),
w=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Show Price Range"));$('<td colspan="3">').appendTo(a).append(g);a=this.addLabeledRow(e,$.t("Show Bars Range"));$('<td colspan="3">').appendTo(a).append(k);a=this.addLabeledRow(e,$.t("Show Date/Time Range"));$('<td colspan="3">').appendTo(a).append(q);a=this.addLabeledRow(e,$.t("Show Distance"));$('<td colspan="3">').appendTo(a).append(r);a=this.addLabeledRow(e,$.t("Show Angle"));$('<td colspan="3">').appendTo(a).append(u);a=this.addLabeledRow(e,
$.t("Always Show Stats"));$('<td colspan="3">').appendTo(a).append(w);this.bindControl(new D12(h,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Line Extending Left")));this.bindControl(new D12(l,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Trend Line Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));this.bindControl(new D11(c,
this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new D11(m,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Trend Line Left End")));this.bindControl(new D11(n,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Trend Line Right End")));this.bindControl(new D12(g,
this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new D12(k,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new D12(q,this._linetool.properties().showDateTimeRange,!0,this.model(),$.t("Change Trend Line Show Date/Time Range")));this.bindControl(new D12(r,this._linetool.properties().showDistance,!0,this.model(),"Change Trend Line Show Distance"));
this.bindControl(new D12(u,this._linetool.properties().showAngle,!0,this.model(),$.t("Change Trend Line Show Angle")));this.bindControl(new D12(w,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};$32.prototype.widget=function(){return this._table};function $12(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($12,$49);
$12.prototype.prepareLayout=function(){this._res=$("<div>");this._table=$('<table class="property-page" cellspacing="0" cellpadding="2" style="width:100%"></table>').appendTo(this._res);var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Line");$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$('<td colspan="3">').append(b.render().css("display","block")).appendTo(d);
var e=$("<input type='checkbox' class='visibility-switch'>"),d=$("<tr>").appendTo(this._table);$('<td colspan="3">').append($("<label>").append(e).append($.t("Show Price"))).prependTo(d);var g=$("<input type='checkbox'>"),d=$("<tr>").appendTo(this._table);$('<td colspan="3">').append($("<label>").append(g).append($.t("Show Text"))).prependTo(d);var d=this.addLabeledRow(this._table,"Text:"),h=this.createColorPicker(),k=this.createFontSizeEditor(),l=this.createFontEditor(),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
n=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(h).appendTo(d);$("<td>").append(l).appendTo(d);$("<td>").append(k).appendTo(d);$("<td>").append(m).appendTo(d);$("<td>").append(n).appendTo(d);d=$("<tr>").appendTo(this._table);$("<td colspan='2'>").append($.t("Text Alignment:")).appendTo(d);var q=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+
"</option></select>"),r=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>").data("selectbox-css",{display:"block"});$("<td>").append(q).appendTo(d);$("<td colspan='3'>").append(r).appendTo(d);var u=$("<textarea rows='7' cols='60'>").css("width","100%"),d=$("<tr>").appendTo(this._table);$("<td colspan='7'>").append(u).appendTo(d);this.bindControl(new D12(g,this._linetool.properties().showLabel,
!0,this.model(),"Change Horz Line Text Visibility"));this.bindControl(new D11(q,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new D11(r,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new SimpleStringBinder(u,this._linetool.properties().text,null,!0,this.model(),"Change Text"));this.bindControl(new D12(e,this._linetool.properties().showPrice,
!0,this.model(),"Change Horz Line Price Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Horz Line Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Horz Line Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Horz Line Width"));this.bindControl(new D11(k,this._linetool.properties().fontsize,parseInt,
!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(l,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(h,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new D12(m,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(n,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));this.loadData()};
$12.prototype.widget=function(){return this._res};function $11(a,b,c){$14.call(this,a,b,c)}inherit($11,$14);
$11.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');if(this._linetool.points().item(0)){var a=$('<input type="text">'),b=$("<tr>").appendTo(this._table);$("<td>"+$.t("Price")+"</td>").appendTo(b);$("<td>").append(a).appendTo(b);var b=this._linetool.properties().points[0],c=[ToFloatTransformer(b.price.value())];this.bindControl(new SimpleStringBinder(a,b.price,c,!1,this.model(),"Change "+this._linetool+
" point price"));this.loadData()}};function $36(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($36,$49);
$36.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Line");$("<td>").prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(b.render()).appendTo(d);
var e=$("<input type='checkbox' class='visibility-switch'>"),d=$("<tr>").appendTo(this._table);$("<td>").append(e).prependTo(d);this.createLabeledCell(2,"Show Time",e).appendTo(d);this.bindControl(new D12(e,this._linetool.properties().showTime,!0,this.model(),"Change Vert Line Time Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Vert Line Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,
parseInt,!0,this.model(),"Change Vert Line Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Vert Line Width"));this.loadData()};$36.prototype.widget=function(){return this._table};function $35(a,b,c){$14.call(this,a,b,c)}inherit($35,$14);
$35.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');if(this._linetool.points().item(0)){var a=$('<input type="text" class="ticker">'),b=$("<tr>").appendTo(this._table);$("<td>"+$.t("Bar #")+"</td>").appendTo(b);$("<td>").append(a).appendTo(b);var b=this._linetool.properties().points[0],c=[ToIntTransformer(b.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(a,
b.bar,c,!1,this.model(),"Change "+this._linetool+" point bar index"));this.loadData()}};function $18(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($18,$49);$18.prototype.onResoreDefaults=function(){this._linetool.properties().style.listeners().fire(this._linetool.properties().style)};
$18.prototype.addLevelEditor=function(a,b,c){c=$("<tr>");c.appendTo(this._table);if(a){var d=$("<td>");d.appendTo(c);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(c);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,
this.model(),"Change Pitchfork Line Coeff"))}else $("<td></td>").appendTo(c),$("<td>"+$.t("Median")+"</td>").appendTo(c);a=$("<td class='colorpicker-cell'>");a.appendTo(c);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(c);d=TradingView.createLineWidthEditor();d.appendTo(e);e=$("<td>");e.appendTo(c);c=TradingView.createLineStyleEditor();c.render().appendTo(e);this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(c,
b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfork Line Width"))};
$18.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().median,!1);for(var a=0;8>=a;a++){var b="level"+a;this.addLevelEditor($.t("Level {0}").format(a+1),this._linetool.properties()[b],!1)}a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");
$("<td>").append(b).appendTo(a);this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);var d=$("<select><option value='0'>"+$.t("Original")+"</option><option value='3'>"+$.t("Schiff")+"</option><option value='1'>"+$.t("Modified Schiff")+"</option><option value='2'>"+$.t("Inside")+"</option></select>"),a=$("<tr>");a.appendTo(this._table);$("<td>"+$.t("Style")+"</td>").appendTo(a);$("<td>").append(d).appendTo(a);this.bindControl(new D11(d,
this._linetool.properties().style,parseInt,!0,this.model(),"Change Pitchfork Style"));this.bindControl(new D12(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.loadData()};$18.prototype.widget=function(){return this._table};function $17(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($17,$49);
$17.prototype.addLevelEditor=function(a,b,c){c=$("<tr>");c.appendTo(this._table);if(a){var d=$("<td>");d.appendTo(c);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(c);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,
this.model(),"Change Pitchfork Line Coeff"))}else $("<td colspan='2'>"+$.t("Median")+"</td>").appendTo(c);a=$("<td class='colorpicker-cell'>");a.appendTo(c);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(c);d=TradingView.createLineWidthEditor();d.appendTo(e);e=$("<td>");e.appendTo(c);c=TradingView.createLineStyleEditor();c.render().appendTo(e);this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(c,b.linestyle,parseInt,
!0,this.model(),"Change Pitchfan Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfan Line Width"))};
$17.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().median,!1);for(var a=0;8>=a;a++){var b="level"+a;this.addLevelEditor("Level "+(a+1),this._linetool.properties()[b],!1)}a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(b).appendTo(a);
this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};$17.prototype.widget=function(){return this._table};function LineToolTextInplaceEditor(a,b){this.D4=a;this._undoModel=b}
LineToolTextInplaceEditor.prototype.attachSource=function(a,b){this.W99=a;this._edit=$("<textarea>");this._edit.css("width","300");this._edit.css("height","150");this._edit.appendTo(this.D4._jqMainDiv);TradingView.setAbsolutePos(this._edit,b);this._edit.val(a.properties().text.value());this._edit.focus();var c=this._edit;c.select();this._binding=new SimpleStringBinder(c,a.properties().text,null,!0,this._undoModel,"change line tool text");this._edit.focusout(function(){a.properties().text.setValue(c.val())});
this._edit.mousedown(function(a){return!0});return c};function $27(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($27,$49);
$27.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createColorPicker(),c=this.createFontSizeEditor(),d=this.createFontEditor(),e=this.createTextEditor(350,200),g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),k=$('<input type="checkbox" class="visibility-switch">'),l=$('<input type="checkbox" class="visibility-switch">'),m=$('<input type="checkbox">'),n=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
q=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D11(c,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(d,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new SimpleStringBinder(e,
this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Text Background")));this.bindControl(new SliderBinder(h,this._linetool.properties().backgroundTransparency,!0,this.model(),$.t("Change Text Background Transparency")));this.bindControl(new D12(k,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Text Background Fill")));this.bindControl(new D12(l,
this._linetool.properties().drawBorder,!0,this.model(),$.t("Change Text Border")));this.bindControl(new ColorBinding(b,this._linetool.properties().borderColor,!0,this.model(),$.t("Change Text Border Color")));this.bindControl(new D12(m,this._linetool.properties().wordWrap,!0,this.model(),$.t("Change Text Wrap")));this.bindControl(new D12(n,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(q,this._linetool.properties().italic,
!0,this.model(),$.t("Change Text Font Italic")));var r=$('<table class="property-page" cellspacing="0" cellpadding="2">'),u=$('<table class="property-page" cellspacing="0" cellpadding="2">'),w=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=r.add(w).add(u);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(n)).append($(document.createElement("td")).append(q)).appendTo(r);
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(e)).appendTo(r);a=this.addLabeledRow(u,$.t("Text Wrap"),m);$("<td>").append(m).prependTo(a);a=this.addLabeledRow(w,$.t("Background"),k);$("<td>").append(k).prependTo(a);$("<td>").append(g).appendTo(a);$("<td>").append(h).appendTo(a);a=this.addLabeledRow(w,$.t("Border"),l);$("<td>").append(l).prependTo(a);$("<td>").append(b).appendTo(a);this.loadData();setTimeout(function(){e.select();e.focus()},20)};
$27.prototype.widget=function(){return this._table};
$27.prototype.dialogPosition=function(a,b){var c=0,d=this._linetool,e=d.D0.paneForSource(d);$.each(this.D0.D4._paneWidgets,function(a,b){if(b._state==e)return c=$(b.canvas).offset().top,!1});a||(a={});var g=a.left,h=a.top,k=this._linetool.paneViews().item(0);if(k)var l=k._floatPoints.item(0);l&&(g=l.x,h=l.y+c);k=$(b).outerHeight();l=$(window).height();d=d.properties().fontsize.value();return{top:h+k+d+5<=l?h+d+5:h-k-5,left:g}};function $23(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($23,$49);
$23.prototype.prepareLayout=function(){function a(){h.slider("option","disabled",!k.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(g).appendTo(d);$("<td>").append(h).appendTo(d);var k=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Rectangle Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
!0,this.model(),"Change Rectangle Line Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),"Change Rectangle Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Rectangle Border Width"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Rectangle Background Transparency"));this.loadData()};
$23.prototype.widget=function(){return this._table};function A98(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A98,$49);
A98.prototype.prepareLayout=function(){function a(){h.slider("option","disabled",!k.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(g).appendTo(d);$("<td>").append(h).appendTo(d);var k=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Ellipse Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
!0,this.model(),"Change Ellipse Line Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),"Change Ellipse Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Ellipse Border Width"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Ellipse Background Transparency"));this.loadData()};
A98.prototype.widget=function(){return this._table};function A87(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A87,$49);
A87.prototype.prepareLayout=function(){function a(){h.slider("option","disabled",!k.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(g).appendTo(d);$("<td>").append(h).appendTo(d);var k=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Arc Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
!0,this.model(),"Change Arc Line Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),"Change Arc Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Arc Border Width"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Arc Background Transparency"));this.loadData()};A87.prototype.widget=function(){return this._table};function $34(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($34,$49);
$34.prototype.prepareLayout=function(){function a(){h.slider("option","disabled",!k.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(g).appendTo(d);$("<td>").append(h).appendTo(d);var k=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Triangle Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
!0,this.model(),"Change Triangle Line Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),"Change Triangle Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Triangle Border Width"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Triangle Background Transparency"));this.loadData()};
$34.prototype.widget=function(){return this._table};function $16(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($16,$49);
$16.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=$("<tr>").appendTo(a);$("<td></td><td>"+$.t("Channel")+"</td>").appendTo(e);$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);
$("<td>").append(c.render()).appendTo(e);var e=$("<tr>").appendTo(a),g=$("<td>").appendTo(e),h=$("<input type='checkbox' class='visibility-switch'>");h.appendTo(g);this.createLabeledCell("Middle",h).appendTo(e);var g=TradingView.createLineWidthEditor(),k=TradingView.createLineStyleEditor(),l=this.createColorPicker();$("<td>").append(l).appendTo(e);$("<td>").append(g).appendTo(e);$("<td>").append(k.render()).appendTo(e);var e=$("<tr>").appendTo(a),m=$("<td>").appendTo(e),a=$("<input type='checkbox' class='visibility-switch'>");
a.appendTo(m);this.createLabeledCell("Background",a).appendTo(e);m=this.createColorPicker();$("<td>").append(m).appendTo(e);var n=TradingView.createTransparencyEditor(m);$('<td colspan="2">').append(n).appendTo(e);var q=$("<tbody>").appendTo(this._table),e=this.addEditorRow(q,"Extend Left",$("<input type='checkbox'>"),2),q=this.addEditorRow(q,"Extend Right",$("<input type='checkbox'>"),2),r=this._linetool.properties();this.bindControl(new D12(a,r.fillBackground,!0,this.model(),"Change Parallel Channel Fill Background"));
this.bindControl(new D12(h,r.showMidline,!0,this.model(),"Change Parallel Channel Show Center Line"));this.bindControl(new D12(e,r.extendLeft,!0,this.model(),"Change Parallel Channel Extending Left"));this.bindControl(new D12(q,r.extendRight,!0,this.model(),"Change Parallel Channel Extending Right"));this.bindControl(new ColorBinding(d,r.linecolor,!0,this.model(),"Change Parallel Channel Color"));this.bindControl(new D11(c,r.linestyle,parseInt,!0,this.model(),
"Change Parallel Channel Style"));this.bindControl(new SliderBinder(b,r.linewidth,!0,this.model(),"Change Parallel Channel Width"));this.bindControl(new ColorBinding(l,r.midlinecolor,!0,this.model(),"Change Parallel Channel Middle Color"));this.bindControl(new D11(k,r.midlinestyle,parseInt,!0,this.model(),"Change Parallel Channel Middle Style"));this.bindControl(new SliderBinder(g,r.midlinewidth,!0,this.model(),"Change Parallel Channel Middle Width"));this.bindControl(new ColorBinding(m,
r.backgroundColor,!0,this.model(),"Change Parallel Channel Back Color"));this.bindControl(new SliderBinder(n,r.transparency,!0,this.model(),"Change Parallel Channel Background Transparency"));this.loadData()};$16.prototype.widget=function(){return this._table};function A88(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A88,$49);
A88.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">').css({width:"100%"});var a=$("<input type='text'>").css({width:"100%"}),b=$('<div class="property-page-fullwidth-wrapper">').append(a),c=this.createColorPicker(),d=this.createFontEditor(),e=$("<tr>").appendTo(this._table);$("<td>").css({width:"0"}).html($.t("Text")).appendTo(e);$('<td colspan="2">').append(b).appendTo(e);e=this.addLabeledRow(this._table,
"Text Font");e.children().css({whiteSpace:"nowrap"});$("<td>").append(c).appendTo(e).css({width:"0"});$("<td>").append(d).appendTo(e);this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Arrow Mark Text Color"));this.bindControl(new SimpleStringBinder(a,this._linetool.properties().text,null,!0,this.model(),"Change Arrow Mark Text"));this.bindControl(new D11(d,this._linetool.properties().font,null,!0,this.model(),"Change Arrow Mark Font"));this.loadData();
setTimeout(function(){a.select();a.focus()},20)};A88.prototype.widget=function(){return this._table};function $21(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($21,$49);
$21.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.createColorPicker(),c=this.createColorPicker(),d=TradingView.createTransparencyEditor(c),e=this.addLabeledRow(this._table,"Text Color");$("<td>").append(a).appendTo(e);e=this.addLabeledRow(this._table,"Border Color");$("<td>").append(b).appendTo(e);
e=this.addLabeledRow(this._table,"Background");$("<td>").append(c).appendTo(e);$("<td>").append(d).appendTo(e);this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Price Text Color"));this.bindControl(new ColorBinding(b,this._linetool.properties().borderColor,!0,this.model(),"Change Border Color"));this.bindControl(new ColorBinding(c,this._linetool.properties().backgroundColor,!0,this.model(),"Change Background Color"));this.bindControl(new SliderBinder(d,
this._linetool.properties().transparency,!0,this.model(),"Change Background Transparency"));this.loadData()};$21.prototype.widget=function(){return this._table};function A89(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A89,$49);
A89.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE),b=$('<table class="property-page" cellspacing="0" cellpadding="0">');this._table=a.add(b);var c=this.createColorPicker(),d=this.createColorPicker(),e=this.createColorPicker(),g=TradingView.createTransparencyEditor(e),h=$("<input type='text'>").css({width:"100%"}),a=$("<tr>").appendTo(a),
k=$('<div class="property-page-fullwidth-wrapper">').append(h);$("<td>").css({width:"0"}).append(c).appendTo(a);$("<td>").append(k).appendTo(a);a=this.addLabeledRow(b,"Background");$("<td>").appendTo(a).append(e);$("<td>").appendTo(a).append(g);a=this.addLabeledRow(b,"Border Color");$("<td>").appendTo(a).append(d);$("<td>");this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Balooon Text Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().borderColor,
!0,this.model(),"Change Balloon Border Color"));this.bindControl(new ColorBinding(e,this._linetool.properties().backgroundColor,!0,this.model(),"Change Balloon Background Color"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Balloon Background Transparency"));this.bindControl(new SimpleStringBinder(h,this._linetool.properties().text,null,!0,this.model(),"Change Balloon Text"));this.loadData();setTimeout(function(){h.select();h.focus()},0)};
A89.prototype.widget=function(){return this._table};function A92(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A92,$49);
A92.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=TradingView.createLineWidthEditor(),b=this.createColorPicker(),c=$('<input type="checkbox" class="visibility-switch">'),d=this.createColorPicker(),e=TradingView.createTransparencyEditor(d),g=this.addLabeledRow(this._table,"Line");$("<td>").prependTo(g);$("<td>").append(b).appendTo(g);$("<td>").append(a).appendTo(g);g=this.addLabeledRow(this._table,
"Background",c);$("<td>").append(c).prependTo(g);$("<td>").append(d).appendTo(g);$("<td>").append(e).appendTo(g);this.bindControl(new ColorBinding(b,this._linetool.properties().linecolor,!0,this.model(),"Change Brush Color"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Brush Line Width"));this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Brush Filling"));this.bindControl(new ColorBinding(d,
this._linetool.properties().backgroundColor,!0,this.model(),"Change Brush Background Color"));this.bindControl(new SliderBinder(e,this._linetool.properties().transparency,!0,this.model(),"Change Brush Background Transparency"));this.loadData()};A92.prototype.widget=function(){return this._table};function $20(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($20,$49);
$20.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),c=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=a.add(b).add(c);var d=this.createColorPicker(),e=TradingView.createLineWidthEditor(),a=this.addLabeledRow(a,"Line");$("<td>").append(d).appendTo(a);$("<td>").append(e).appendTo(a);
var a=$("<tr>").appendTo(b),b=$("<td>").appendTo(a).css({"vertical-align":"top",width:"50%"}),a=$("<td>").appendTo(a).css({"vertical-align":"top",width:"50%"}),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(b),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(a),b=this.addColorPickerRow(g,"Source back color"),a=this.addColorPickerRow(g,"Source text color"),k=this.addColorPickerRow(g,"Source border color"),l=this.addColorPickerRow(g,"Success back color"),
g=this.addColorPickerRow(g,"Success text color"),m=this.addColorPickerRow(h,"Target back color"),n=this.addColorPickerRow(h,"Target text color"),q=this.addColorPickerRow(h,"Target border color"),r=this.addColorPickerRow(h,"Failure back color"),h=this.addColorPickerRow(h,"Failure text color"),u=TradingView.createTransparencyEditor(m);this.addEditorRow(c,"Transparency",u);this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color"));this.bindControl(new SliderBinder(e,
this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width"));this.bindControl(new ColorBinding(b,this._linetool.properties().sourceBackColor,!0,this.model(),"Forecast Source Background Color"));this.bindControl(new ColorBinding(k,this._linetool.properties().sourceStrokeColor,!0,this.model(),"Forecast Source Border Color"));this.bindControl(new ColorBinding(a,this._linetool.properties().sourceTextColor,!0,this.model(),"Forecast Source Text Color"));this.bindControl(new ColorBinding(m,
this._linetool.properties().targetBackColor,!0,this.model(),"Forecast Target Background Color"));this.bindControl(new ColorBinding(q,this._linetool.properties().targetStrokeColor,!0,this.model(),"Forecast Target Border Color"));this.bindControl(new ColorBinding(n,this._linetool.properties().targetTextColor,!0,this.model(),"Forecast Target Text Color"));this.bindControl(new ColorBinding(l,this._linetool.properties().successBackground,!0,this.model(),"Forecast Success Back Color"));this.bindControl(new ColorBinding(g,
this._linetool.properties().successTextColor,!0,this.model(),"Forecast Success Text Color"));this.bindControl(new ColorBinding(r,this._linetool.properties().failureBackground,!0,this.model(),"Forecast Failure Back Color"));this.bindControl(new ColorBinding(h,this._linetool.properties().failureTextColor,!0,this.model(),"Forecast Failure Text Color"));this.bindControl(new SliderBinder(u,this._linetool.properties().transparency,!0,this.model(),"Change Forecast Background Transparency"));this.loadData()};
$20.prototype.widget=function(){return this._table};function $19(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($19,$49);
$19.prototype.prepareLayout=function(){function a(){h.slider("option","disabled",!k.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(g).appendTo(d);$("<td>").append(h).appendTo(d);var k=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Polyline Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,
!0,this.model(),"Change Polyline Line Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),"Change Polyline Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Polyline Border Width"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Polyline Background Transparency"));this.loadData()};
$19.prototype.widget=function(){return this._table};function $10(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($10,$49);
$10.prototype.addLevelEditor=function(a,b,c){b=$("<tr>");b.appendTo(a);var d=$("<td>");d.appendTo(b);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(b);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new SimpleStringBinder(e,c.coeff,ToFloatTransformer(c.coeff.value()),!1,this.model(),
"Change Pitchfork Line Coeff"));a=$("<td class='colorpicker-cell'>");a.appendTo(b);b=TradingView.addColorPicker(a);this.bindControl(new ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
$10.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tbody>").appendTo(this._table),b=$("<tr>");b.appendTo(a);var c=$('<td width="50%">');c.appendTo(b);a=$('<td width="50%">');a.appendTo(b);b=$('<table cellspacing="0" cellpadding="2">');b.appendTo(c);b.addClass("property-page");
c=$('<table cellspacing="0" cellpadding="2">');c.appendTo(a);c.addClass("property-page");$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(b);$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(c);for(a=1;7>=a;a++){var d="hlevel"+a;this.addLevelEditor(b,"Level "+a,this._linetool.properties()[d])}for(a=1;7>=a;a++)d="vlevel"+a,this.addLevelEditor(c,"Level "+a,this._linetool.properties()[d]);var c=$("<input type='checkbox' class='visibility-switch'>"),
d=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),g=$("<input type='checkbox' class='visibility-switch'>"),h=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),b=$("<tr>").appendTo(h),k=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),
a=this.addLabeledRow(k,"Left Labels",c);$("<td>").append(c).prependTo(a);a=this.addLabeledRow(b,"Right Labels",d);$("<td>").append(d).prependTo(a);a=this.addLabeledRow(k,"Top Labels",e);$("<td>").append(e).prependTo(a);a=this.addLabeledRow(b,"Bottom Labels",g);$("<td>").append(g).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new D12(d,this._linetool.properties().showRightLabels,
!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new D12(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new D12(g,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility"));this._table=this._table.add(h);a=$("<tr>");a.appendTo(k);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(a);d=TradingView.createTransparencyEditor();
$("<td>").append(d).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillHorzBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().horzTransparency,!0,this.model(),"Change Gann Square Background Transparency"));a=$("<tr>");a.appendTo(b);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(a);d=TradingView.createTransparencyEditor();$("<td>").append(d).appendTo(a);
this.bindControl(new D12(c,this._linetool.properties().fillVertBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().vertTransparency,!0,this.model(),"Change Gann Square Background Transparency"));this.loadData()};$10.prototype.widget=function(){return this._table};function $8(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($8,$49);
$8.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tr>");a.appendTo(this._table);var b=this._linetool.properties(),c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);var d=$("<tr>");$("<td colspan='3'>"+$.t("Levels")+"</td>").appendTo(d);d.appendTo(c);
for(var e in b.levels._childs){var g=b.levels[e],h=$("<tr>");h.appendTo(c);$("<td>"+e+"</td>").appendTo(h);d=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(d).appendTo(h);var k=$("<td class='colorpicker-cell'>");k.appendTo(h);var k=TradingView.addColorPicker(k),l=$("<td>");l.appendTo(h);h=TradingView.createLineWidthEditor();h.appendTo(l);this.bindControl(new D12(d,g.visible,!0,this.model(),"Change Gann Line Visibility"));this.bindControl(new ColorBinding(k,g.color,
!0,this.model(),"Change Gann Line Color"));this.bindControl(new SliderBinder(h,g.width,!0,this.model(),"Change Gann Line Width"))}c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);d=$("<tr>");$("<td colspan='4'>"+$.t("Fans")+"</td>").appendTo(d);d.appendTo(c);for(e in b.fanlines._childs)g=b.fanlines[e],h=$("<tr>"),h.appendTo(c),d=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(d).appendTo(h),k=g.x.value()+"x"+g.y.value(),$("<td>"+k+"</td>").appendTo(h),k=$("<td class='colorpicker-cell'>"),
k.appendTo(h),k=TradingView.addColorPicker(k),l=$("<td>"),l.appendTo(h),h=TradingView.createLineWidthEditor(),h.appendTo(l),this.bindControl(new D12(d,g.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new ColorBinding(k,g.color,!0,this.model(),"Change Gann Fan Color")),this.bindControl(new SliderBinder(h,g.width,!0,this.model(),"Change Gann Line Width"));c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);a=$("<tr>");$("<td colspan='4'>"+$.t("Arcs")+"</td>").appendTo(a);
a.appendTo(c);for(e in b.arcs._childs)a=b.arcs[e],h=$("<tr>"),h.appendTo(c),d=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(d).appendTo(h),k=a.x.value()+"x"+a.y.value(),$("<td>"+k+"</td>").appendTo(h),k=$("<td class='colorpicker-cell'>"),k.appendTo(h),k=TradingView.addColorPicker(k),l=$("<td>"),l.appendTo(h),h=TradingView.createLineWidthEditor(),h.appendTo(l),this.bindControl(new D12(d,a.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new ColorBinding(k,
a.color,!0,this.model(),"Change Gann Arc Color")),this.bindControl(new SliderBinder(h,a.width,!0,this.model(),"Change Gann Line Width"));a=$("<tbody>").appendTo(this._table);b=$('<input type="checkbox" class="visibility-switch">');e=TradingView.createTransparencyEditor();a=$("<tr>").appendTo(a);d=$("<table>");$('<td colspan="3">').append(d).appendTo(a);a=$("<tr>").appendTo(d);$("<td>"+$.t("Background")+"</td>").appendTo(a);$("<td>").append(b).appendTo(a);$("<td>").append(e).appendTo(a);this.bindControl(new D12(b,
this._linetool.properties().arcsBackground.fillBackground,!0,this.model(),"Change Gann Square Filling"));this.bindControl(new SliderBinder(e,this._linetool.properties().arcsBackground.transparency,!0,this.model(),"Change Gann Square Background Transparency"))};$8.prototype.widget=function(){return this._table};function $9(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($9,$49);
$9.prototype.addLevelEditor=function(a,b,c,d){var e=$("<tr>");e.appendTo(this._tbody);d="control-level-"+c+"-"+d;var g=$("<td>");g.appendTo(e);c=$("<input type='checkbox' class='visibility-switch' id='"+d+"'>");c.appendTo(g);this.createLabeledCell(a).appendTo(e).find("label").attr("for",d);a=$("<td class='colorpicker-cell'>");a.appendTo(e);a=TradingView.addColorPicker(a);g=$("<td>");g.appendTo(e);d=TradingView.createLineWidthEditor();d.appendTo(g);g=$("<td>");g.appendTo(e);
e=TradingView.createLineStyleEditor();e.render().appendTo(g);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Gann Fan Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Gann Fan Line Color"));this.bindControl(new D11(e,b.linestyle,parseInt,!0,this.model(),"Change Gann Fan Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Gann Fan Line Width"))};
$9.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._tbody=$("<tbody>").appendTo(a);for(var c=1;9>=c;c++){var d="level"+c,d=this._linetool.properties()[d],e=d.coeff1.value(),g=d.coeff2.value();this.addLevelEditor("<sup>"+e+"</sup>&frasl;<sub>"+g+"</sub>",d,e,g)}d=$("<input type='checkbox' class='visibility-switch'>");c=this.addLabeledRow(b,
"Labels",d);$("<td>").append(d).prependTo(c);this.bindControl(new D12(d,this._linetool.properties().showLabels,!0,this.model(),"Change Gann Fan Labels Visibility"));this._table=a.add(b);c=$("<tr>");c.appendTo(this._table);a=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(a).appendTo(c);this.createLabeledCell("Background",a).appendTo(c);b=TradingView.createTransparencyEditor();$('<td colspan="3">').append(b).appendTo(c);this.bindControl(new D12(a,this._linetool.properties().fillBackground,
!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};$9.prototype.widget=function(){return this._table};function A84(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A84,$49);
A84.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);if(a){e=$("<td>");e.appendTo(d);var g=$("<input type='text'>");g.appendTo(e);g.css("width","70px");this.bindControl(new SimpleStringBinder(g,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))}else this.createLabeledCell("Trend Line",c).appendTo(d);
e=$("<td class='colorpicker-cell'>");e.appendTo(d);var e=TradingView.addColorPicker(e),h=$("<td>");h.appendTo(d);g=TradingView.createLineWidthEditor();g.appendTo(h);a||(a=$("<td>"),a.appendTo(d),d=TradingView.createLineStyleEditor(),d.render().appendTo(a),this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Circle Style")));this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Fib Circle Visibility"));this.bindControl(new ColorBinding(e,b.color,
!0,this.model(),"Change Fib Circle Line Color"));this.bindControl(new SliderBinder(g,b.linewidth,!0,this.model(),"Change Fib Circle Width"))};
A84.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var c=$("<input type='checkbox' class='visibility-switch'>"),a=this.addLabeledRow(this._table,"Levels",
c);$("<td>").append(c).prependTo(a);b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,"Coeffs As Percents",b);$("<td>").append(b).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Circle Levels Visibility"));a=$("<tr>");a.appendTo(this._table);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(a);this.createLabeledCell("Background",c).appendTo(a);var d=TradingView.createTransparencyEditor();
$('<td colspan="3">').append(d).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.bindControl(new D12(b,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};
A84.prototype.widget=function(){return this._table};function $1(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($1,$49);
$1.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",c).appendTo(d);
a=$("<td class='colorpicker-cell'>");a.appendTo(d);a=TradingView.addColorPicker(a);var g=$("<td>");g.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(g);g=$("<td>");g.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(g);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,b.linestyle,parseInt,
!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
$1.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var c=$("<input type='checkbox' class='visibility-switch'>"),d=$("<input type='checkbox' class='visibility-switch'>"),
a=$("<input type='checkbox' class='visibility-switch'>"),b=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),g=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),h=$("<tr>").appendTo(g),k=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(h)),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(h)),
k=this.addLabeledRow(k,"Levels",c);$("<td>").append(c).prependTo(k);k=this.addLabeledRow(h,"Prices",d);$("<td>").append(d).prependTo(k);k=this.addLabeledRow(this._table,"Extend Lines",a);$("<td>").append(a).prependTo(k);k=this.addLabeledRow(this._table,"Reverse",b);$("<td>").append(b).prependTo(k);k=this.addLabeledRow(this._table,"Coeffs As Percents",e);$("<td>").append(e).prependTo(k);this.bindControl(new D12(d,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility"));
this.bindControl(new D12(c,this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility"));c=$("<table cellspacing='0' cellpadding='0'>");d=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>");h=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>");
k=$("<tr>");k.append("<td>"+$.t("Labels")+"</td>").append(d).append("<td>&nbsp</td>").append(h);k.appendTo(c);k=$("<tr>");$("<td colspan='5'>").append(c).appendTo(k);k.appendTo(this._table);this.bindControl(new D11(d,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this.bindControl(new D11(h,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this._table=
this._table.add(g);k=$("<tr>");k.appendTo(this._table);g=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(g).appendTo(k);this.createLabeledCell("Background",g).appendTo(k);c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(k);this.bindControl(new D12(g,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,
!0,this.model(),"Change Fib Retracement Background Transparency"));this.bindControl(new D12(a,this._linetool.properties().extendLines,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new D12(b,this._linetool.properties().reverse,!0,this.model(),"Change Fib Retracement Reverse"));this.bindControl(new D12(e,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};
$1.prototype.widget=function(){return this._table};function A99(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A99,$49);
A99.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",c).appendTo(d);a=$("<td class='colorpicker-cell'>");
a.appendTo(d);a=TradingView.addColorPicker(a);var g=$("<td>");g.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(g);g=$("<td>");g.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(g);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));
this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
A99.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var c=$("<input type='checkbox' class='visibility-switch'>"),d=$("<input type='checkbox' class='visibility-switch'>"),a=$("<input type='checkbox' class='visibility-switch'>"),
b=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),g=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),h=$("<tr>").appendTo(g),k=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(h)),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(h)),k=this.addLabeledRow(k,
"Levels",c);$("<td>").append(c).prependTo(k);k=this.addLabeledRow(h,"Prices",d);$("<td>").append(d).prependTo(k);k=this.addLabeledRow(this._table,"Extend Left",a);$("<td>").append(a).prependTo(k);k=this.addLabeledRow(this._table,"Extend Right",b);$("<td>").append(b).prependTo(k);k=this.addLabeledRow(this._table,"Coeffs As Percents",e);$("<td>").append(e).prependTo(k);this.bindControl(new D12(d,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility"));this.bindControl(new D12(c,
this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility"));c=$("<table cellspacing='0' cellpadding='0'>");d=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>");h=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>");k=$("<tr>");k.append("<td>"+$.t("Labels")+
"</td>").append(d).append("<td>&nbsp</td>").append(h);k.appendTo(c);k=$("<tr>");$("<td colspan='5'>").append(c).appendTo(k);k.appendTo(this._table);this.bindControl(new D11(d,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this.bindControl(new D11(h,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this._table=this._table.add(g);k=$("<tr>");k.appendTo(this._table);
g=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(g).appendTo(k);this.createLabeledCell("Background",g).appendTo(k);c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(k);this.bindControl(new D12(g,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));
this.bindControl(new D12(a,this._linetool.properties().extendLeft,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new D12(b,this._linetool.properties().extendRight,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new D12(e,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};A99.prototype.widget=function(){return this._table};function $30(a,b,c){$1.call(this,a,b,c)}inherit($30,$1);function $31(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($31,$49);
$31.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",c).appendTo(d);
a=$("<td class='colorpicker-cell'>");a.appendTo(d);a=TradingView.addColorPicker(a);var g=$("<td>");g.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(g);g=$("<td>");g.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(g);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,b.linestyle,parseInt,
!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
$31.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}a=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"});
a=$("<tr>").appendTo(a);$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a));$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a));a=$("<input type='checkbox' class='visibility-switch'>");b=this.addLabeledRow(this._table,"Show Labels",a);$("<td>").append(a).prependTo(b);var c=$("<table cellspacing='0' cellpadding='0'>"),d=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+
$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),e=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),b=$("<tr>");b.append("<td>"+$.t("Labels")+"</td>").append(d).append("<td>&nbsp</td>").append(e);b.appendTo(c);b=$("<tr>");$("<td colspan='5'>").append(c).appendTo(b);b.appendTo(this._table);this.bindControl(new D11(d,this._linetool.properties().horzLabelsAlign,
null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment"));this.bindControl(new D11(e,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment"));b=$("<tr>");b.appendTo(this._table);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(b);this.createLabeledCell("Background",c).appendTo(b);d=TradingView.createTransparencyEditor();$('<td colspan="3">').append(d).appendTo(b);this.bindControl(new D12(c,
this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this.bindControl(new D12(a,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Retracement Extend Lines"));this.loadData()};$31.prototype.widget=function(){return this._table};function $3(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($3,$49);
$3.prototype.addLevelEditor=function(a,b,c){b=$("<tr>");b.appendTo(a);var d=$("<td>");d.appendTo(b);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(b);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new SimpleStringBinder(e,c.coeff,ToFloatTransformer(c.coeff.value()),!1,this.model(),
"Change Pitchfork Line Coeff"));a=$("<td class='colorpicker-cell'>");a.appendTo(b);b=TradingView.addColorPicker(a);this.bindControl(new ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
$3.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tbody>").appendTo(this._table),b=$("<tr>");b.appendTo(a);var c=$('<td width="50%">');c.appendTo(b);a=$('<td width="50%">');a.appendTo(b);b=$('<table cellspacing="0" cellpadding="2">');b.appendTo(c);
b.addClass("property-page");c=$('<table cellspacing="0" cellpadding="2">');c.appendTo(a);c.addClass("property-page");$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(b);$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(c);for(a=1;7>=a;a++){var d="hlevel"+a;this.addLevelEditor(b,"Level "+a,this._linetool.properties()[d])}for(a=1;7>=a;a++)d="vlevel"+a,this.addLevelEditor(c,"Level "+a,this._linetool.properties()[d]);var c=$("<input type='checkbox' class='visibility-switch'>"),
d=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),g=$("<input type='checkbox' class='visibility-switch'>"),b=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),a=$("<tr>").appendTo(b),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a)),k=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a)),
a=this.addLabeledRow(h,"Left Labels",c);$("<td>").append(c).prependTo(a);a=this.addLabeledRow(k,"Right Labels",d);$("<td>").append(d).prependTo(a);a=this.addLabeledRow(h,"Top Labels",e);$("<td>").append(e).prependTo(a);a=this.addLabeledRow(k,"Bottom Labels",g);$("<td>").append(g).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new D12(d,this._linetool.properties().showRightLabels,
!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new D12(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new D12(g,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility"));d=$('<table class="property-page" cellspacing="0" cellpadding="2">');e=TradingView.createLineWidthEditor();g=TradingView.createLineStyleEditor();h=this.createColorPicker();
c=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(d,"Grid",c);$("<td>").append(c).prependTo(a);$("<td>").append(h).appendTo(a);$("<td>").append(e).appendTo(a);$("<td>").append(g.render()).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().grid.visible,!0,this.model(),"Change Fib Speed Resistance Fan Grid Visibility"));this.bindControl(new ColorBinding(h,this._linetool.properties().grid.color,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Color"));
this.bindControl(new D11(g,this._linetool.properties().grid.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Style"));this.bindControl(new SliderBinder(e,this._linetool.properties().grid.linewidth,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Width"));this._table=this._table.add(b).add(d);a=$("<tr>");a.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(a);this.createLabeledCell("Background",c).appendTo(a);
b=TradingView.createTransparencyEditor();$('<td colspan="3">').append(b).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Speed/Resistance Fan Background Visibility"));this.bindControl(new SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Fib Speed/Resistance Fan Background Transparency"));this.loadData()};$3.prototype.widget=function(){return this._table};function $2(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($2,$49);
$2.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);if(a){e=$("<td>");e.appendTo(d);var g=$("<input type='text'>");g.appendTo(e);g.css("width","70px");this.bindControl(new SimpleStringBinder(g,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))}else $("<td>"+$.t("Trend Line")+"</td>").appendTo(d);
e=$("<td class='colorpicker-cell'>");e.appendTo(d);var e=TradingView.addColorPicker(e),h=$("<td>");h.appendTo(d);g=TradingView.createLineWidthEditor();g.appendTo(h);a||(a=$("<td>"),a.appendTo(d),d=TradingView.createLineStyleEditor(),d.render().appendTo(a),this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Arcs Style")));this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Fib Speed Resistance Arcs Visibility"));this.bindControl(new ColorBinding(e,
b.color,!0,this.model(),"Change Fib Speed Resistance Arcs Line Color"));this.bindControl(new SliderBinder(g,b.linewidth,!0,this.model(),"Change Fib Speed Resistance Arcs Width"))};
$2.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,
"Levels");$("<td>").append(b).prependTo(a);this.bindControl(new D12(b,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Speed Resistance Arcs Levels Visibility"));a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(b).appendTo(a);$("<td>"+$.t("Background")+"</td>").appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().fillBackground,
!0,this.model(),"Change Fib Arcs Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Fib Arcs Background Transparency"));this.loadData()};$2.prototype.widget=function(){return this._table};function $4(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($4,$49);
$4.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,"Line");$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,
!0,this.model(),"Change Fib Spiral Line Color"));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Fib Spiral Line Style"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Spiral Line Width"));this.loadData()};$4.prototype.widget=function(){return this._table};function $5(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($5,$49);
$5.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",c).appendTo(d);a=$("<td class='colorpicker-cell'>");
a.appendTo(d);a=TradingView.addColorPicker(a);var g=$("<td>");g.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(g);g=$("<td>");g.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(g);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));
this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
$5.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=$("<input type='checkbox' class='visibility-switch'>"),e=
this.addLabeledRow(this._table,"Show Labels",d);$("<td>").append(d).prependTo(e);var g=$("<table cellspacing='0' cellpadding='0'>"),h=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),k=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),e=$("<tr>");e.append("<td>"+$.t("Labels")+
"</td>").append(h).append("<td>&nbsp</td>").append(k);e.appendTo(g);e=$("<tr>");$("<td colspan='5'>").append(g).appendTo(e);e.appendTo(this._table);this.bindControl(new D11(h,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment"));this.bindControl(new D11(k,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment"));e=$("<tr>");e.appendTo(this._table);g=$("<input type='checkbox' class='visibility-switch'>");
$("<td>").append(g).appendTo(e);this.createLabeledCell("Background",g).appendTo(e);h=TradingView.createTransparencyEditor();$('<td colspan="3">').append(h).appendTo(e);this.bindControl(new D12(d,this._linetool.properties().showLabels,!0,this.model(),"Change Fib Time Zone Labels Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Fib Time Zone Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,
parseInt,!0,this.model(),"Change Fib Time Zone Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Time Zone Width"));this.bindControl(new D12(g,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(h,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this.loadData()};
$5.prototype.widget=function(){return this._table};function $6(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($6,$49);
$6.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new SimpleStringBinder(e,b.coeff,ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",c).appendTo(d);a=$("<td class='colorpicker-cell'>");
a.appendTo(d);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(d);d=TradingView.createLineWidthEditor();d.appendTo(e);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Fib Wedge Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Fib Wedge Line Color"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Fib Wedge Width"))};
$6.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,"Levels",b);
$("<td>").append(b).prependTo(a);this.bindControl(new D12(b,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Wedge Levels Visibility"));a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(b).appendTo(a);this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().fillBackground,
!0,this.model(),"Change Wedge Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Wedge Background Transparency"));this.loadData()};$6.prototype.widget=function(){return this._table};function A94(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A94,$49);
A94.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Lines");$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(b.render()).appendTo(d);this.bindControl(new ColorBinding(c,
this._linetool.properties().linecolor,!0,this.model(),"Change Circle Lines Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Circle Lines Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Circle Lines Width"));this.loadData()};A94.prototype.widget=function(){return this._table};function $24(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit($24,$14);
$24.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">'),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":EditObjectDialog.TAB_PRIORITY_INPUTS});this._table=a.add(b);for(var c=this._linetool.points(),d=0;d<c.size();d++){c.item(d);var e=$("<tr>");e.appendTo(a);var g=$("<td>");g.html("Point "+(d+1)+" Bar #");g.appendTo(e);
barEditCell=$("<td>");barEditCell.appendTo(e);e=$("<input type='text'>");e.appendTo(barEditCell);e.addClass("ticker");var g=this._linetool.properties().points[d],h=[ToIntTransformer(g.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(e,g.bar,h,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=StudyMetaInfo.findStudyMetaInfo(this.D0.studiesMetaData(),"RegressionTrend@tv-basicstudies");$41.prototype.prepareLayoutImpl.call(this,
a,b)};$24.prototype.widget=function(){return this._table};function A95(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A95,$49);
A95.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(a,"Line");$("<td>").prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var d=this.createColorPicker(),e=this.createColorPicker(),g=this.createFontSizeEditor(),h=this.createFontEditor();this.createTextEditor(350,
200);var k=this.createColorPicker(),l=TradingView.createTransparencyEditor(k),m=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),q=TradingView.createTransparencyEditor(n),r=$('<input type="checkbox" class="visibility-switch">');this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));
this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(k,this._linetool.properties().labelBackgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(l,this._linetool.properties().labelBackgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new D12(m,this._linetool.properties().fillLabelBackground,!0,this.model(),"Change Text Background Fill"));
this.bindControl(new ColorBinding(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(q,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new D12(r,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill"));this.bindControl(new ColorBinding(e,this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color"));
e=this.addLabeledRow(a,"Background",r);$("<td>").append(r).prependTo(e);$("<td>").append(n).appendTo(e);$('<td colspan="2">').append(q).appendTo(e);n=this.addLabeledRow(a,"Label");$("<td>").prependTo(n);$("<td>").append(d).appendTo(n);$("<td>").append(h).appendTo(n);$("<td>").append(g).appendTo(n);e=this.addLabeledRow(a,"Label Background",m);$("<td>").append(m).prependTo(e);$("<td>").append(k).appendTo(e);$('<td colspan="2">').append(l).appendTo(e);this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,
!0,this.model(),"Change Date Range Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Date Range Line Width"));this.loadData()};A95.prototype.widget=function(){return this._table};function $22(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($22,$49);
$22.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.createColorPicker(),c=TradingView.createTransparencyEditor(a),d=this.addLabeledRow(this._table,"Background");$("<td>").append(a).appendTo(d);$("<td>").append(b).appendTo(d);$("<td>").append(c).appendTo(d);var e=TradingView.createLineWidthEditor(),
g=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");$("<td>").append(g).appendTo(d);$("<td>").appendTo(d);$("<td>").append(e).appendTo(d);this.bindControl(new ColorBinding(g,this._linetool.properties().trendline.color,!0,this.model(),"Change Projection Line Color"));this.bindControl(new ColorBinding(a,this._linetool.properties().color1,!0,this.model(),"Change Projection Background Color"));this.bindControl(new ColorBinding(b,this._linetool.properties().color2,!0,this.model(),"Change Projection Background Color"));
this.bindControl(new SliderBinder(e,this._linetool.properties().linewidth,!0,this.model(),"Change Projection Border Width"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Projection Background Transparency"));this.loadData()};$22.prototype.widget=function(){return this._table};function $15(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($15,$49);
$15.prototype.prepareLayout=function(){function a(){q.slider("option","disabled",!r.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.createColorPicker(),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),g=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),
h=this.createFontSizeEditor(),k=this.createFontEditor(),l=this.addLabeledRow(this._table,"Border");l.prepend("<td>");$("<td>").append(c).appendTo(l);$("<td>").append(b).appendTo(l);var m=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),q=TradingView.createTransparencyEditor(n),k=this.createFontEditor(),l=this.addLabeledRow(this._table,"Background",m);$("<td>").append(m).prependTo(l);$("<td>").append(n).appendTo(l);$("<td>").append(q).appendTo(l);var r=this._linetool.properties().fillBackground;
a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(m,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new ColorBinding(n,this._linetool.properties().backgroundColor,
!0,this.model(),"Change Pattern Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new D11(h,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(k,this._linetool.properties().font,
null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(g,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));b=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(k)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).css("vertical-align",
"top").attr({width:1}).append(e)).append($(document.createElement("td")).css("vertical-align","top").append(g)).append($("</tr></table>"));l=this.addLabeledRow(this._table,"");$('<td colspan="5">').append(b).appendTo(l);this.loadData()};$15.prototype.widget=function(){return this._table};function A86(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A86,$49);
A86.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=this.createColorPicker(),c=this.createColorPicker(),d=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),
g=this.createFontSizeEditor(),h=this.createFontEditor(),h=this.addLabeledRow(this._table,"Border");h.prepend("<td>");$("<td>").append(b).appendTo(h);$("<td>").append(a).appendTo(h);h=this.createFontEditor();this.bindControl(new ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(c,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,
!0,this.model(),"Change Pattern Border Width"));this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(d,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(e,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));
a=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).attr({width:1}).append(g)).append($(document.createElement("td")).css("vertical-align","top").attr({width:1}).append(d)).append($(document.createElement("td")).css("vertical-align","top").append(e)).append($("</tr></table>"));h=this.addLabeledRow(this._table,
"");$('<td colspan="5">').append(a).appendTo(h);this.loadData()};A86.prototype.widget=function(){return this._table};function LineToolNotePropertyPage(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(LineToolNotePropertyPage,$49);
LineToolNotePropertyPage.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createFontSizeEditor(),c=this.createFontEditor(),d=this.createTextEditor(350,200),e=this.createColorPicker(),g=this.createColorPicker(),h=TradingView.createTransparencyEditor(g),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new ColorBinding(a,
this._linetool.properties().textColor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D11(b,this._linetool.properties().fontSize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(c,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new ColorBinding(e,this._linetool.properties().markerColor,
!0,this.model(),$.t("Change Marker and Border Color")));this.bindControl(new ColorBinding(g,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Background Color")));this.bindControl(new SliderBinder(h,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Background Transparency"));this.bindControl(new D12(k,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(l,this._linetool.properties().italic,
!0,this.model(),$.t("Change Text Font Italic")));var m=$('<table class="property-page" cellspacing="0" cellpadding="2">'),n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),q=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=m.add(q).add(n);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(b)).append($(document.createElement("td")).attr({width:1}).append(k)).append($(document.createElement("td")).append(l)).appendTo(m);
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(m);a=this.addLabeledRow(q,$.t("Label"));$("<td>").attr("colspan",2).append(e).appendTo(a);a=this.addLabeledRow(q,$.t("Background"));$("<td>").append(g).appendTo(a);$("<td>").append(h).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};LineToolNotePropertyPage.prototype.widget=function(){return this._table};
LineToolNotePropertyPage.prototype.dialogPosition=function(a,b){if(a&&b){for(var c=0,d=this._linetool.D0.paneForSource(this._linetool),e=A45.getChartWidget(),g;c<e._paneWidgets.length;c++)if(e._paneWidgets[c]._state==d){g=$(e._paneWidgets[c].canvas).offset().left;break}c=this._linetool.paneViews().item(0);d=new MathEx.Point(0,0);c&&(d=c._floatPoints.item(0)||this._linetool._fixedPoints.item(0));c=TradingView.LineToolNote.TOOLTIP_WIDTH;g=(g||0)+d.x-c/2;d=b.outerWidth();if(a.left<
g&&a.left+d+10>g)return a.left-=a.left+d+10-g,a;if(a.left>g&&a.left<g+c+10)return a.left+=g+c+10-a.left,a}};function $43(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit($43,$14);
$43.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">'),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":EditObjectDialog.TAB_PRIORITY_INPUTS});this._table=a.add(b);for(var c=this._linetool.points(),d=0;d<c.size();d++){c.item(d);var e=$("<tr>");e.appendTo(a);var g=$("<td>");g.html("Point "+(d+1)+" Bar #");g.appendTo(e);barEditCell=
$("<td>");barEditCell.appendTo(e);e=$("<input type='text'>");e.appendTo(barEditCell);e.addClass("ticker");var g=this._linetool.properties().points[d],h=[ToIntTransformer(g.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(e,g.bar,h,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=StudyMetaInfo.findStudyMetaInfo(this.D0.studiesMetaData(),this._linetool.studyId());$41.prototype.prepareLayoutImpl.call(this,a,b)};
$43.prototype.widget=function(){return this._table};function $44(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()}inherit($44,D7);inherit($44,SeriesStylePropertyPageMixin);
$44.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">'),c=$('<table class="property-page" cellspacing="0" cellpadding="2">'),d=$('<table class="property-page" cellspacing="0" cellpadding="2">'),e=$('<table class="property-page" cellspacing="0" cellpadding="2">'),g=this.D1.properties();this._prepareSeriesStyleLayout(a,b,c,g);this._table=a.add(b).add(c).add(d).add(e);
a=$('<input type="checkbox">');d=this.addLabeledRow(d,"Price Line",a);$("<td>").append(a).prependTo(d);this.bindControl(new D12(a,g.showPriceLine,!0,this.model(),"Change Price Price Line"));d=this.createSeriesMinTickEditor();a=$("<tr>");a.appendTo(e);$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(a);$("<td>").append(d).appendTo(a);this.bindControl(new D11(d,g.minTick,null,!0,this.model(),"Change MinTick"));$47.prototype._putStudyDefaultStyles.call(this,
e)};$44.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};
$44.prototype.switchStyle=function(){$(this._barsTbody).add(this._barsColorerTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).css("display","none");switch(this.D1.properties().style.value()){case TradingView.Series.STYLE_BARS:this._barsTbody.css("display","table-row-group");this._barsColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_CANDLES:this._candlesTbody.css("display",
"table-row-group");this._candlesColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_AREA:this._areaTbody.css("display","table-row-group")}};$44.prototype.widget=function(){return this._table};function A97(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A97,$49);
A97.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=[],a=6===this._linetool.pointsCount()?"Subminuette Minuette Minute Minor Intermediate Primary Cycle SuperCycle GrandSuperCycle".split(" ").map(function(a){return $.t(a)}):["Minor","Major"].map(function(a){return $.t(a)});waveTypeEditor=this.createKeyCombo(a);waveTypeEditor.width(300);this.createFontEditor();a=this.createFontSizeEditor();$('<span class="property-page-small-select">').append(a);
var a=this.createColorPicker(),b=$('<input type="checkbox" class="visibility-switch">'),c=$('<input type="checkbox" class="visibility-switch">'),d=this.addLabeledRow(this._table,"Wave Size");$("<td>").prependTo(d);$("<td>").append(waveTypeEditor).appendTo(d);d=this.addLabeledRow(this._table,"Color");$("<td>").prependTo(d);$("<td>").append(a).appendTo(d);d=this.addLabeledRow(this._table,"Show Wave",c);$("<td>").append(c).prependTo(d);d=this.addLabeledRow(this._table,"Show Background",b);$("<td>").append(b).prependTo(d);
this.bindControl(new D12(b,this._linetool.properties().showBackground,!0,this.model(),"Change Elliott Labels Background"));this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Elliott Label Color"));this.bindControl(new D11(waveTypeEditor,this._linetool.properties().wavesize,parseInt,!0,this.model(),"Change Elliott Wave Size"));this.bindControl(new D12(c,this._linetool.properties().showWave,!0,this.model(),"Change Elliott Labels Background"));
this.loadData()};A97.prototype.widget=function(){return this._table};function $25(a,b,c){$14.call(this,a,b,c);this.prepareLayout()}inherit($25,$14);
$25.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=this.addLabeledRow(a,"Stop Level. Ticks:"),c=$("<input type='text'>");$("<td>").append(c).appendTo(b);c.addClass("ticker");var d=$("<input type='text'>");$("<td>"+$.t("Price:")+"</td>").appendTo(b);$("<td>").append(d).appendTo(b);var e=this.addLabeledRow(a,"Entry price:"),g=$("<input type='text'>");$('<td colspan="2">').append(g).appendTo(e);
var h=this.addLabeledRow(a,"Profit Level. Ticks:"),e=$("<input type='text'>");$("<td>").append(e).appendTo(h);e.addClass("ticker");var k=$("<input type='text'>");$("<td>"+$.t("Price:")+"</td>").appendTo(h);$("<td>").append(k).appendTo(h);"LineToolRiskRewardLong"==this._linetool.getConstructor()&&(b.detach().appendTo(a),h.detach().prependTo(a));a=[ToIntTransformer(this._linetool.properties().stopLevel.value()),GreateTransformer(0),LessTransformer(1E9)];this.bindControl(new SimpleStringBinder(c,this._linetool.properties().stopLevel,
a,!1,this.model(),"Change "+this._linetool+" stop level"));a=[ToIntTransformer(this._linetool.properties().profitLevel.value()),GreateTransformer(0),LessTransformer(1E9)];this.bindControl(new SimpleStringBinder(e,this._linetool.properties().profitLevel,a,!1,this.model(),"Change "+this._linetool+" profit level"));a=[ToFloatTransformer(this._linetool.properties().entryPrice.value())];this.bindControl(new SimpleStringBinder(g,this._linetool.properties().entryPrice,a,!1,this.model(),"Change "+this._linetool+
" entry price"));var l=this,a=[ToFloatTransformer(this._linetool.properties().stopPrice.value()),function(a){return l._linetool.preparseStopPrice(a)}];this.bindControl(new SimpleStringBinder(d,this._linetool.properties().stopPrice,a,!1,this.model(),"Change "+this._linetool+" stop price"));a=[ToFloatTransformer(this._linetool.properties().targetPrice.value()),function(a){return l._linetool.preparseProfitPrice(a)}];this.bindControl(new SimpleStringBinder(k,this._linetool.properties().targetPrice,a,
!1,this.model(),"Change "+this._linetool+" stop price"))};$25.prototype.widget=function(){return this._table};function $26(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($26,$49);
$26.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(a,"Lines");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var d=this.addLabeledRow(a,"Stop Color:"),e=this.createColorPicker();$("<td>").append(e).appendTo(d);var g=TradingView.createTransparencyEditor(e);$('<td colspan="2">').append(g).appendTo(d);
var d=this.addLabeledRow(a,"Target Color:"),h=this.createColorPicker();$("<td>").append(h).appendTo(d);var k=TradingView.createTransparencyEditor(h);$('<td colspan="2">').append(k).appendTo(d);var d=this.addLabeledRow(a,"Text:"),a=this.createColorPicker(),l=this.createFontSizeEditor(),m=this.createFontEditor();$("<td>").append(a).appendTo(d);$("<td>").append(m).appendTo(d);$("<td>").append(l).appendTo(d);this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Risk/Reward line Color"));
this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Risk/Reward line width"));this.bindControl(new ColorBinding(e,this._linetool.properties().stopBackground,!0,this.model(),"Change stop color"));this.bindControl(new SliderBinder(g,this._linetool.properties().stopBackgroundTransparency,!0,this.model(),"Change Stop Background Transparency"));this.bindControl(new ColorBinding(h,this._linetool.properties().profitBackground,!0,this.model(),"Change target color"));
this.bindControl(new SliderBinder(k,this._linetool.properties().profitBackgroundTransparency,!0,this.model(),"Change Profit Background Transparency"));this.bindControl(new D11(l,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(m,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));
this.loadData()};$26.prototype.widget=function(){return this._table};function $33(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($33,$49);
$33.prototype.prepareLayout=function(){function a(){q.slider("option","disabled",!r.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.createColorPicker(),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),g=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),
h=this.createFontSizeEditor(),k=this.createFontEditor(),l=this.addLabeledRow(this._table,"Border");l.prepend("<td>");$("<td>").append(c).appendTo(l);$("<td>").append(b).appendTo(l);var m=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),q=TradingView.createTransparencyEditor(n),k=this.createFontEditor(),l=this.addLabeledRow(this._table,"Background",m);$("<td>").append(m).prependTo(l);$("<td>").append(n).appendTo(l);$("<td>").append(q).appendTo(l);var r=this._linetool.properties().fillBackground;
a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(m,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new ColorBinding(n,this._linetool.properties().backgroundColor,
!0,this.model(),"Change Pattern Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new D11(h,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(k,this._linetool.properties().font,
null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(g,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));b=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(k)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).css("vertical-align",
"top").attr({width:1}).append(e)).append($(document.createElement("td")).css("vertical-align","top").append(g)).append($("</tr></table>"));l=this.addLabeledRow(this._table,"");$('<td colspan="5">').append(b).appendTo(l);this.loadData()};$33.prototype.widget=function(){return this._table};function A96(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit(A96,$49);
A96.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);$('<td colspan="3">').append(c.render()).appendTo(e);var e=this.addLabeledRow(a,$.t("Text")),a=this.createColorPicker(),
g=this.createFontSizeEditor(),h=this.createFontEditor(),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(a).appendTo(e);$("<td>").append(h).appendTo(e);$("<td>").append(g).appendTo(e);$("<td>").append(k).appendTo(e);$("<td>").append(l).appendTo(e);var e=$("<tbody>").appendTo(this._table),m=$('<input type="checkbox" class="visibility-switch">'),
n=this.createColorPicker(),q=TradingView.createTransparencyEditor(n),e=this.addLabeledRow(e,$.t("Background"),m),r=$("<table>");$('<td colspan="5">').append(r).appendTo(e);e=$("<tr>").appendTo(r);$("<td>").append(m).appendTo(e);$("<td>").append(n).appendTo(e);$("<td>").append(q).appendTo(e);var u=$("<tbody>").appendTo(this._table),w=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),r=$('<input type="checkbox">').appendTo(w),A=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
v=$('<input type="checkbox">').appendTo(A),B=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),D=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(u,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(B).append(w);e=this.addLabeledRow(u,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(D).append(A);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
u=$("<input type='checkbox'>");w=$("<label style='display:block'>").append(u).append($.t("Show Prices"));$("<td colspan='2'>").append(w).appendTo(e);this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));
this.bindControl(new D12(k,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(l,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new D12(u,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new D12(r,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));
this.bindControl(new D12(v,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Disjoint Angle Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));
this.bindControl(new D11(B,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new D11(D,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new D12(m,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new ColorBinding(n,this._linetool.properties().backgroundColor,
!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};A96.prototype.widget=function(){return this._table};function $7(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($7,$49);
$7.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);$('<td colspan="3">').append(c.render()).appendTo(e);var e=this.addLabeledRow(a,$.t("Text")),a=this.createColorPicker(),
g=this.createFontSizeEditor(),h=this.createFontEditor(),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(a).appendTo(e);$("<td>").append(h).appendTo(e);$("<td>").append(g).appendTo(e);$("<td>").append(k).appendTo(e);$("<td>").append(l).appendTo(e);var e=$("<tbody>").appendTo(this._table),m=$('<input type="checkbox" class="visibility-switch">'),
n=this.createColorPicker(),q=TradingView.createTransparencyEditor(n),e=this.addLabeledRow(e,$.t("Background"),m),r=$("<table>");$('<td colspan="5">').append(r).appendTo(e);e=$("<tr>").appendTo(r);$("<td>").append(m).appendTo(e);$("<td>").append(n).appendTo(e);$("<td>").append(q).appendTo(e);var u=$("<tbody>").appendTo(this._table),w=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),r=$('<input type="checkbox">').appendTo(w),A=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
v=$('<input type="checkbox">').appendTo(A),B=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),D=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(u,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(B).append(w);e=this.addLabeledRow(u,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(D).append(A);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
u=$("<input type='checkbox'>");w=$("<label style='display:block'>").append(u).append($.t("Show Prices"));$("<td colspan='2'>").append(w).appendTo(e);this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));
this.bindControl(new D12(k,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(l,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new D12(u,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new D12(r,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));
this.bindControl(new D12(v,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Disjoint Angle Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));
this.bindControl(new D11(B,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new D11(D,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new D12(m,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new ColorBinding(n,this._linetool.properties().backgroundColor,
!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};$7.prototype.widget=function(){return this._table};function $13(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($13,$49);
$13.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.addLabeledRow(this._table,"Color:");$("<td>").append(a).appendTo(b);b=this._linetool.properties();this._div=$("<div>").append(this._table);this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Icon Color"));this.loadData()};
$13.prototype.widget=function(){return this._div};function $29(a,b,c){$49.call(this,a,b,c);this.prepareLayout()}inherit($29,$49);
$29.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);var e=$("<tbody>").appendTo(this._table),a=this.addLabeledRow(e,
$.t("Text")),g=this.createColorPicker(),h=this.createFontSizeEditor(),k=this.createFontEditor(),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(g).appendTo(a);$("<td>").append(k).appendTo(a);$("<td>").append(h).appendTo(a);$("<td>").append(l).appendTo(a);$("<td>").append(m).appendTo(a);var n=$('<input type="checkbox">'),q=$('<input type="checkbox">'),
a=this.addLabeledRow(e,$.t("Extend Right End"));$('<td colspan="3">').appendTo(a).append(n);a=this.addLabeledRow(e,$.t("Extend Left End"));$('<td colspan="3">').appendTo(a).append(q);var r=$('<input type="checkbox">'),u=$('<input type="checkbox">'),w=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Show Price Range"));$('<td colspan="3">').appendTo(a).append(r);a=this.addLabeledRow(e,$.t("Show Bars Range"));$('<td colspan="3">').appendTo(a).append(u);a=this.addLabeledRow(e,$.t("Always Show Stats"));
$('<td colspan="3">').appendTo(a).append(w);this.bindControl(new D12(r,this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new D12(u,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new D11(h,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(k,this._linetool.properties().font,
null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(g,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D12(l,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(m,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));
this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new D12(n,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Trend Angle Extending Right")));this.bindControl(new D12(q,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Angle Extending Left")));
this.bindControl(new D12(w,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};$29.prototype.widget=function(){return this._table};function $28(a,b,c){$14.call(this,a,b,c)}inherit($28,$14);
$28.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=this._linetool.points().item(0),b=this._linetool.properties().points[0];if(a&&b){var c=this._createPointRow(a,b,"");this._table.append(c);c=$("<tr>").appendTo(this._table);$("<td>").append($.t("Angle")).appendTo(c);a=$("<input type='text'>");$("<td>").append(a).appendTo(c);b=[ToFloatTransformer(b.price.value()),GreateTransformer(-360),LessTransformer(360)];
this.bindControl(new SimpleStringBinder(a,this._linetool.properties().angle,b,!1,this.model(),$.t("Change angle")));this.loadData()}};$28.prototype.widget=function(){return this._table};function $42(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()}inherit($42,D7);
$42.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=a.add(b);for(var c=this.D1.properties(),d=[["Base",c.styles.baseLine],["Up",c.styles.upLine],["Down",c.styles.downLine]],e,g=0;g<d.length;g++){var h=d[g],k=$("<input type='checkbox' class='visibility-switch'/>"),l=this.createColorPicker(),m=TradingView.createLineWidthEditor(),
n=TradingView.createLineStyleEditor(),q=this.addLabeledRow(a,h[0],k);g||(e=l);$("<td>").append(k).prependTo(q);$("<td>").append(l).appendTo(q);$("<td>").append(m).appendTo(q);$("<td>").append(n.render()).appendTo(q);q="Change "+h[0];this.bindControl(new D12(k,h[1].visible,!0,this.model(),q));this.bindControl(new ColorBinding(l,h[1].color,!0,this.model(),q));this.bindControl(new SliderBinder(m,h[1].linewidth,!0,this.model(),q));this.bindControl(new D11(n,h[1].linestyle,parseInt,
!0,this.model(),q))}a=$("<input type='checkbox' class='visibility-switch'/>");d=$("<input type='checkbox'/>");q=$("<tr>").appendTo(b);$("<td>").append(a).appendTo(q);this.createLabeledCell("Pearson's R",a).appendTo(q);q=$("<tr>").appendTo(b);$("<td>").append(d).appendTo(q);this.createLabeledCell("Extend Lines",d).appendTo(q);q=$("<tr>").appendTo(b);$("<td>").appendTo(q);$("<td>Background</td>").appendTo(q);b=TradingView.createTransparencyEditor(e);$("<td>").append(b).appendTo(q);this.bindControl(new D12(a,
c.styles.showPearsons,!0,this.model(),"Change show Pearson's R"));this.bindControl(new D12(d,c.styles.extendLines,!0,this.model(),"Change Extend Lines"));this.bindControl(new SliderBinder(b,c.styles.transparency,!0,this.model(),"Change Background Transparency"))};$42.prototype.widget=function(){return this._table};function $50(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()}inherit($50,D7);
$50.prototype.prepareLayout=function(){var a=this.D1.properties();this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var b=this.addLabeledRow(this._table,"Volume"),c=TradingView.createPlotEditor();$("<td>").append(c).appendTo(b);this.bindControl(new D11(c,a.styles.vol.plottype,parseInt,!0,this.model(),"Change Volume Plot Style"));c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new ColorBinding(c,a.palettes.volumePalette.colors[0].color,
!0,this.model(),"Change Up Volume color"));c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new ColorBinding(c,a.palettes.volumePalette.colors[1].color,!0,this.model(),"Change Down Volume color"));c=TradingView.createTransparencyEditor();$("<td>").append(c).appendTo(b);this.bindControl(new SliderBinder(c,a.transparency,!0,this.model(),"Change Volume Transparency"));c=$("<input type='checkbox'>");$("<td>").appendTo(b);$("<td>").append(c).appendTo(b);$("<td>"+$.t("Price Line")+
"</td>").appendTo(b);this.bindControl(new D12(c,a.styles.vol.trackPrice,!0,this.model(),"Change Price Line"));a=a.styles.vol_ma;b=this.addLabeledRow(this._table,"Volume MA");c=TradingView.createPlotEditor();$("<td>").append(c).appendTo(b);this.bindControl(new D11(c,a.plottype,parseInt,!0,this.model(),"Change Volume MA Plot Style"));$("<td>").html("&nbsp;").appendTo(b);c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new ColorBinding(c,a.color,!0,
this.model(),"Change Volume MA color"));c=TradingView.createTransparencyEditor(c);$("<td>").append(c).appendTo(b);this.bindControl(new SliderBinder(c,a.transparency,!0,this.model(),"Change Volume MA Transparency"));c=TradingView.createLineWidthEditor();$("<td>").append(c).appendTo(b);this.bindControl(new SliderBinder(c,a.linewidth,!0,this.model(),"Change Volume MA Line Width"));c=$("<input type='checkbox'>");$("<td>").append(c).appendTo(b);$("<td>"+$.t("Price Line")+"</td>").appendTo(b);this.bindControl(new D12(c,
a.trackPrice,!0,this.model(),"Change Price Line"));$47.prototype._putStudyDefaultStyles.call(this,this._table,8)};$50.prototype.widget=function(){return this._table};A3=function(a){this._$container=$(a);this._$header=this._$container.parent().find(".header").eq(0)};A3.prototype.setSelectableHeader=function(a){var b=this._$container.parent().find(".header");b.addClass("selectable").append($("<span>").addClass("dropdown"));this._title=b.find(".title");b=b.find(".title, .dropdown");b.on("click",a);TradingView.bindPopupMenu(b,null,{event:"show-popup",addClass:"narrow",careBottomBorder:!0})};
A3.prototype.updateTitleFull=function(a,b){this._notification_count||(this._notification_count=0);b&&(this._notification_count+=b);0<=this._notification_count||(this._notification_count=0);var c=this._$container.parent().find(".header .title");c.text(a);this._notification_count&&c.prepend($("<span>").addClass("ch-new-counter").text(this._notification_count))};A3.prototype.clearNotifications=function(){this._notification_count=0;this.updateTitle()};
A3.prototype.HIGHLIGHT_NUM_FLICKS=5;A3.prototype.resize=$.noop;TradingView.MarketSummaryWidget=function(a){this._bridge=a;this.D2=a.properties||{};this.D2.symbols||(this.D2.symbols=this.defaults().symbols);this._initLayout();this._bridge.visible.subscribe(this._visibilityChanged.bind(this));this._bridge.height.subscribe(this._onHeightChange.bind(this))};
TradingView.MarketSummaryWidget.prototype.defaults=function(){return{symbols:[{symbol:"S&P 500",symbol_full:"FX:SPX500",short_name:"SPX500",color:"#e0725e"},{symbol:"Nikkei 225",symbol_full:"FX:JPN225",short_name:"JPN225",color:"#64a81e"},{symbol:"Nasdaq",symbol_full:"FX:NAS100",short_name:"NAS100",color:"#fdaf48"}],minHeight:150}};
TradingView.MarketSummaryWidget.prototype._initLayout=function(){var a=this._bridge.$body;a.addClass("market-summary");var b=$.map(this.D2.symbols,function(a){return{symbol:a.symbol_full,options:{line:{color:a.color}}}});this.$chart=$('<div class="mini-chart" style="position: relative;"></div>');this.$timeframes=$('<div class="timeframe"></div>');this._chart=new TradingView.MiniChart(b,this.$chart,{showMessage:!1,timeframe:{container:this.$timeframes,value:"1m",visible:!0},showTimeframes:!0,
chartOptions:{minHeight:this.defaults().minHeight,minWidth:W77.enabled("browser_extension")?330:null,grid:{xIsVisible:!1,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#ebedf0"}},yScale:{visible:!0,position:"right",isPercentage:!0,paddingLeft:10,paddingRight:4,marginInPercents:0,font:{size:10,family:"Helvetica",color:"#c8cacd"},drawOverPlotArea:!1,drawTickMarkLine:!1,maxTickMarkAmount:5},xScale:{visible:!0,font:{size:10,family:"Helvetica",color:"#c8cacd"}},plot:{line:{width:2},
belowLineFillStyle:"transparent",aboveLineFillStyle:"transparent"},loading:{showWhileNoPlots:!0}}});this.$quotes=$(Mustache.render('<table class="quote-tickers"><tr>{{#symbols}}<td><div class="market-summary-quote-ticker chart-legend" data-symbol="{{symbol_full}}"><a href="/e/?symbol={{symbol_full}}" target="_blank" class="chart-link" data-symbol="{{symbol_full}}" style="border-color: {{color}}"><div class="symbol-name symbol-short-name">{{symbol}}</div><div class="symbol-tiker symbol-change-direction symbol-last">&nbsp;</div></a></div></td>{{/symbols}}</tr></table>',
{symbols:this.D2.symbols}));this._quotes=[];var c=this;this.$quotes.find(".market-summary-quote-ticker").each(function(){var a=$(this);c._quotes.push(new TradingView.QuoteTicker(a.data("symbol"),a))});a.append(this.$timeframes,this.$chart,this.$quotes);this._onHeightChange()};TradingView.MarketSummaryWidget.prototype._onHeightChange=function(a){a=this._bridge.$body.height()-this.$quotes.outerHeight(!0)-this.$timeframes.outerHeight(!0);a=Math.max(a,this.defaults().minHeight);this.$chart.height(a)};
TradingView.MarketSummaryWidget.prototype._visibilityChanged=function(a){a||this.$chart.css("visibility","hidden");this._quotes.forEach(function(b){b.enabled=!!a});a?this._chart.connect(function(){this.$chart.css("visibility","visible");this._onHeightChange()}.bind(this)):this._chart.disconnect()};var counter=0;
A12=function(a){this._charWidgetCollection=a.getChartWidgetCollection();this.D4=null;this._views=[];this._itemsBinding=[];this._headerBinding=[];this._boxBinding=[];this.$container=$('<div class="chart-data-window"></div>').appendTo(a.$body);this._scroll=new A59(a.$body,this.$container);this.visible=a.visible.value();this._updateSource();this._upadateLayout();this._charWidgetCollection.activeChartWidget.subscribe(this.updateAll.bind(this));a.visible.subscribe(this._onVisibilityChange.bind(this));
this._charWidgetCollection.selectedSource.subscribe(function(a){this.updateHighlight({source:a,updateScroll:!0})}.bind(this));a.setTitle("Data Window")};
A12.prototype._updateSource=function(){if(this.visible){this._views=[];this.D4&&(this.D4._dataWindowWidget=null);this.D4=this._charWidgetCollection.activeChartWidget.value();this.D4._dataWindowWidget=this;var a=this.D4.model();if(a)for(var a=a.model().D19(),b=0;b<a.size();b++){var c=a.item(b).dataWindowView();c&&this._views.push(c)}}};
A12.prototype._upadateLayout=function(){if(this.visible){var a=this;this.$container.empty();this._itemsBinding=[];this._headerBinding=[];for(var b=this._boxBinding.length-1;0<=b;b--){var c=this._boxBinding[b];c.src.properties().visible.unsubscribe(a,c.visibilityHandler)}this._boxBinding=[];for(b=0;b<this._views.length;++b)c=this._views[b],c.items().size()&&function(b){var c=null;if(b instanceof SeriesDataWindowView)c=b._series;else if(b instanceof StudyDataWindowView||b instanceof
A49)c=b.D1;var g=$('<div class="box"></div>').appendTo(a.$container),h=b.header()?$('<div class="chart-data-window-header"><span class="text">'+b.header()+'</span><div class="hover-source-icon"></div></div>').appendTo(g):null;h&&a._headerBinding.push({value:b,$el:h.find(".text")});if(c&&h){var k=function(a){g.toggleClass("hidden",!a.value()).find(".toggle-source-icon").attr("title",l(a))},l=function(a){return(a?"Hide":"Show")+" data"};g.addClass("with-actions").toggleClass("hidden",
!c.properties().visible.value()).on("click",function(b){b.preventDefault();a.setSelectedSource(c)}).on("contextmenu",function(b){b.preventDefault();a.D4.readOnly()||a.showContextMenuForSource(c,b)});h.on("dblclick",function(){(new EditObjectDialog(c,a.D4.model())).show()}).append($('<div class="toggle-source-icon" title="'+l(c.properties().visible.value())+'"></div>').on("click",function(b){b.stopPropagation();b=c.properties().visible.value();a.D4.model().setProperty(c.properties().visible,
!b,(b?"Hide ":"Show ")+c.title())}));c.properties().visible.subscribe(a,k);a._boxBinding.push({src:c,$el:g,visibilityHandler:k})}for(h=0;h<b.items().size();++h){var k=b.items().item(h),m=$('<div class="chart-data-window-item"></div>').appendTo(g);$('<div class="chart-data-window-item-title">'+k.title()+"</div>").appendTo(m);m=$('<div class="chart-data-window-item-value">'+k.value()+"</div>").appendTo(m);a._setValueHtml(m,k);a._itemsBinding.push({value:k,$el:m})}}(c);this.updateHighlight();this._scroll.resize()}};
A12.prototype.update=function(){this.visible&&(this.updateHighlight(),this.updateValues())};
A12.prototype.updateHighlight=function(a){var b=(a||{}).source;a=!!(a||{}).updateScroll;if(this.visible&&this.D4&&this.D4.model()){for(var c=this.D4.model().hoveredSource(),b=b||this._charWidgetCollection.selectedSource.value(),d,e=0;e<this._boxBinding.length;++e){var g=this._boxBinding[e].src,h=this._boxBinding[e].$el;if(g){var k=!(!b||g!==b);this._boxBinding[e].$el.toggleClass("hover",!(!c||g!==c)).toggleClass("active",k);k&&(d=h)}}d&&a&&this._scroll.scrollTo(d)}};
A12.prototype.updateValues=function(){if(this.visible){for(var a=0;a<this._itemsBinding.length;++a)this._setValueHtml(this._itemsBinding[a].$el,this._itemsBinding[a].value);for(a=0;a<this._headerBinding.length;a++)this._headerBinding[a].$el.html(this._headerBinding[a].value.header()).attr("title",this._headerBinding[a].value.title())}};A12.prototype.updateAll=function(){this._updateSource();this._upadateLayout()};
A12.prototype._onVisibilityChange=function(a){this.visible=!!a;a&&this.updateAll()};A12.prototype._setValueHtml=function(a,b){var c=b.color(),d=this.prepareColor(c),c=c&&c!=d?'<div class="real-color" title="\u0421olor line" style="background-color:'+c+'"></div>'+b.value():b.value();a.html(c).css({color:d||""})};
A12.prototype.prepareColor=function(a,b){if(a){var c=new RGBColor(b||"#FFFFFF");20>Math.abs(c.grayChannel()-(new RGBColor(a)).grayChannel())&&(a=c.blackWhiteContrast());return a}};A12.prototype.setSelectedSource=function(a){this.D4.model().setSelectedSource(a)};
A12.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this.setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):isInherited(a.constructor,TradingView.Study)&&this._studyContextMenu(a).show(b))};
A12.prototype._seriesContextMenu=function(a,b){var c=this.D4.actions(),d=a.properties().visible.value(),d=[c.format,d?c.seriesHide:this.createActionShow(a)];a!=this.D4.model().mainSeries()&&d.push(c.seriesRemove);return ContextMenu.createMenu(d)};
A12.prototype._studyContextMenu=function(a,b){var c=this.D4.actions(),d=a.properties().visible.value();return ContextMenu.createMenu([c.format,d?c.studyHide:this.createActionShow(a),c.studyRemove])};A12.prototype.createActionShow=function(a){var b=new Action({checkable:!0,text:"Show",enabled:!0});b._binding=new D14(b,a.properties().visible,this.D4.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};$(function(){var a=new function(){function a(){m&&(clearTimeout(m),m=null)}function b(a){if(!k)return 0;var c=!!k&&jQuery.contains(document.body,k[0]);c||k.css("position","fixed").appendTo(document.body);a=k[a]();c||k.css("position","").detach();return a}var e,g,h,k,l,m,n;this.sendMessage=function(){var a=k.find('[name="message-text"]');(message=String(a.val()).replace(/^\s+|\s+$/g,""))?(widgetbar.setPage("Recent Chats"),TradingView.messagesWidget.sendMessageToUser(message,g.id),this.close()):a.css("border-color",
"#E0735E").focus()};this.isActiveTarget=function(a){return k&&h&&h.is(a)};this.isSameUser=function(a){return(a=a.data())&&g&&a.id==g.id};this.update=function(b,d){if(this.isActiveTarget(b)||this.isSameUser(b))return a(),this;l&&this.close();g=d||b.data();g.large_badge=!0;g.is_self=g.username==window.user.username;g.current_user_is_staff=window.user.is_staff;g.show_add_status_btn=!window.user.status&&is_authenticated;g.is_realtime=g.is_pro&&"pro_realtime"==g.pro_plan;g.is_premium=g.is_pro&&"pro_premium"==
g.pro_plan;g.is_trial=g.is_pro&&"pro_realtime_trial"==g.pro_plan;h=b;var m=Mustache.render(TradingView.templates.userlinkPopup,g,TradingView.templates);k=$(m).on("mouseenter",function(){a()}).on("mouseleave",function(a){e||$(a.target).is(".content")||this.close(n||500)}.bind(this));k.find(".userlink").removeClass("userlink");if(!g.is_self&&(h.hasClass("ch-userlink")||h.hasClass("ch-item-userpic"))&&(m=h.closest(".ch-item"),m.length&&!m.data("ch-is-standalone"))){var w=h,m=$('<div class="ignore-ban-wrapper"></div>').appendTo(k.find(".content .username")),
A=!!user.ignore_list[g.id],v=g.is_staff?null:$('<a href="#" class="ch-ignore-lnk'+(A?" active":"")+'">').text(A?"Unignore":"Ignore").click(g,function(a){a.preventDefault();A?$.post("/conversation-ignore/",{user_id:a.data.id,action:"remove"},function(b){b.error?A83.showNotice("Error",b.error):(delete user.ignore_list[a.data.id],k&&(k.find(".ch-ignore-lnk").removeClass("active").text("Ignore"),A=!1),w.trigger("userignorechange",!1))}):A83.showConfirm("Confirm","Are you sure you want to ignore messages from "+
a.data.username+"?",function(){$.post("/conversation-ignore/",{user_id:a.data.id,username:a.data.username},function(b){b.error?A83.showNotice("Error",b.error):(user.ignore_list[a.data.id]=a.data.username,w.trigger("userignorechange",!0))})})}),B=!!g.is_banned,D=user.is_staff&&!g.is_staff?$('<a href="#" class="ch-ban-lnk'+(B?" active":"")+'">').text(B?"Unban":"Ban").click(g,function(a){a.preventDefault();B?$.post("/conversation-ban/",{user_id:a.data.id,action:"unban"},function(a){a.error?A83.showNotice("Error",
a.error):(k&&(k.find(".ch-ban-lnk").removeClass("active").text("Ban"),B=!1),w.trigger("userbanchange",!1))}):TradingView.messagesWidget.banUser(a.data.username,a.data.id,null,function(){w.trigger("userbanchange",!0)})}):null;v&&v.appendTo(m);v&&D&&$("<span>&thinsp;|&thinsp;</span>").appendTo(m);D&&D.appendTo(m)}return this};this.setForm=function(){k.on("keyup",function(a){27==a.which&&this.close()}.bind(this)).addClass("form-layout");k.find('[name="message-text"]').focus();k.find("textarea").on("keyup",
function(a){13==a.which&&a.ctrlKey&&this.sendMessage()}.bind(this));k.find(".message-user.send").on("click",this.sendMessage.bind(this));k.find(".message-user.cancel").on("click",this.close.bind(this));e=!0;return this};this.open=function(){a();if(l||!k)return e&&k.css({top:.45*$(window).height()+$(document).scrollTop(),left:""}),this;k&&jQuery.contains(document.body,k[0])||k.css("position","fixed").appendTo(document.body);var m=left=0,n=b("width"),m=b("height");e?(m=.45*$(window).height()+$(document).scrollTop(),
left=""):(m=h.offset().top-m,0>m-$(document).scrollTop()&&(m=h.offset().top+h.height()),left=h.offset().left-20,left+n>$(window).width()&&(left=$(window).width()-n));k.css({position:"",top:m,left:left}).hide().fadeIn("fast",function(){e&&k.find('[name="message-text"]').focus();g.btc_address&&new TradingView.CoinWidget(g.btc_address,k.find(".btc-tip"),"br")});l=!0;return this};this.close=function(b){if(b&&"number"==typeof b)return m=setTimeout(this.close,b),n=b,this;a();if(!l)return this;k.remove();
k=h=g=null;l=e=!1;return this};this.isForm=function(){return e}},b;$(document).on("mouseenter",".userlink, .ch-userlink, .ch-item-userpic",function(){if(!W77.enabled("disable_userlink_popup")){var c=$(this);if(a.isActiveTarget(c))a.open();else{var d="/u/"+(c.data("username")||c.text())+"/info/",e={type:"POST",success:function(b){b&&!b.error&&a.update(c,b).open()}};if($.browser.msie||/\btrident\b/i.test(navigator.userAgent))e.cache=!1;b=$.ajax(d,e)}}}).on("mouseleave",".userlink, .ch-userlink, .ch-item-userpic",
function(){a.isForm()||(b&&b.abort(),a.close(500))}).on("click","button.message-user.message, button.profile-action.profile-message, a.ch-item-message, .ch-private-message-popup-item",function(){var b=$(this);runOrSignIn(function(){a.update(b).setForm().open()})})});A60=function(a,b,c,d){var e=this;this._options=d||{};this._readonly=!!this._options.readonly;this._container=a;this._chart=b;this._panes=c;this._pane_header_height=34;this._hidden_panes_count=0;this.prepareLayout();setInterval(function(){e.paint()},66)};
A60.prototype.prepareLayout=function(){var a=this;this._widget=$('<div class="chart-sidebar">').appendTo(this._container);this._widget.toggleClass("hidden",void 0!=this._options.hidden?this._options.hidden:TVSettings.getBool("sidebar.hidden",!1));this._separator=$('<div class="separator"><div class="separator-bar"><div class="separator-icon"></div></div></div>').appendTo(this._widget);this._separator.click(function(){a._widget.toggleClass("hidden");a._readonly||TVSettings.setValue("sidebar.hidden",
a._widget.is(".hidden"));$(window).resize()});this._panes.forEach(function(b,c){void 0===b.ratio&&(b.ratio=TVSettings.getFloat("sidebar.pane."+b.id+".ratio",1));void 0===b.state&&(b.state=TVSettings.getBool("sidebar.pane."+b.id+".state",!0),this._hidden_panes_count+=b.state?0:1);b.$pane=$('<div class="chart-sidebar-pane">').addClass("tv-"+b.id).appendTo(this._widget);b.$header=$('<div class="header"><span class="icon"></span><span class="title">'+b.title+"</span></div>").click(function(){b.state=
!b.state;a._readonly||TVSettings.setValue("sidebar.pane."+b.id+".state",b.state);a._hidden_panes_count+=b.state?-1:1;a.resize()}).appendTo(b.$pane);b.index=c;b.$container=$('<div class="container">').appendTo(b.$pane);b.widgetObject=new b.widget(b.$container,this._chart,b.options);c<this._panes.length-1&&$('<div class="chart-sidebar-vseparator"><div class="handle"></div></div>').on("mousedown touchstart",function(b){var c=$(this),g=c.prevAll(".chart-sidebar-pane:not(.minimized)").first(),h=c.nextAll(".chart-sidebar-pane:not(.minimized)").first();
if(!g.length||!h.length)return!1;a._drag_start=b.pageY||b.originalEvent.pageY||b.originalEvent.touches&&b.originalEvent.touches[0].pageY||0;a._drag_prev_h=g.height();a._drag_next_h=h.height();$(window).on("mousemove.sidebarDrag touchmove.sidebarDrag",function(b){b=(b.pageY||b.originalEvent.pageY||b.originalEvent.touches&&b.originalEvent.touches[0].pageY||0)-a._drag_start;g.height(a._drag_prev_h+b).data("paneObj").widgetObject.resize();h.height(a._drag_next_h-b).data("paneObj").widgetObject.resize()});
$(window).one("mouseup touchend",function(b){$(window).unbind("mousemove.sidebarDrag touchmove.sidebarDrag");var d=c.prevAll(".chart-sidebar-pane:not(.minimized)").first();b=c.nextAll(".chart-sidebar-pane:not(.minimized)").first();var g=(a._widget.height()-a._hidden_panes_count*a._pane_header_height-(a._panes.length-1))/(a._panes.length-a._hidden_panes_count),h=(d.height()+a._pane_header_height)/g,d=d.data("paneObj");d.ratio=h;g=(b.height()+a._pane_header_height)/g;d=b.data("paneObj");d.ratio=g;a.resize()});
b.preventDefault()}).appendTo(this._widget);b.$pane.data("paneObj",b)},this);$(window).resize(function(){a.resize()});this.resize()};A60.prototype.normalizeRatios=function(){var a=this,b=this._panes.length-this._hidden_panes_count,c=0,d=0;this._panes.forEach(function(a){a.state&&(c+=a.ratio)});d=(c-b)/b;this._panes.forEach(function(b){b.state&&(b.ratio-=d,a._readonly||TVSettings.setValue("sidebar.pane."+b.id+".ratio",b.ratio.toFixed(2)))})};
A60.prototype.resize=function(){this.normalizeRatios();var a=(this._widget.height()-this._hidden_panes_count*this._pane_header_height-(this._panes.length-1))/(this._panes.length-this._hidden_panes_count);this._panes.forEach(function(b,c){b.state?b.$pane.height(a*b.ratio-this._pane_header_height):b.$pane.height(0);b.widgetObject.resize(!0);b.$pane.toggleClass("minimized",!b.state);b.$container.trigger("paneStateChange",[b.state])},this)};
A60.prototype.getPaneIndexById=function(a){for(var b=0;b<this._panes.length;b++)if(this._panes[b].id===a)return b;return null};A60.prototype.getPaneById=function(a){a=this.getPaneIndexById(a);return null===a?null:this._panes[a]};A60.prototype.highlightPane=function(a,b,c){this._panes[a].$header.highlight(b,c)};A60.prototype.highlightWidget=function(a,b,c){this.highlightPane(this.getPaneIndexById(a),b,c)};
A60.prototype.paint=function(){this._panes.forEach(function(a,b){a.widgetObject.paint&&a.widgetObject.paint()},this)};A60.prototype.setPaneState=function(a,b,c){a&&(a.state=!!b,b=c&&c.doNotSave,this._readonly||b||TVSettings.setValue("sidebar.pane."+a.id+".state",a.state),this._hidden_panes_count=this._panes.filter(function(a){return!a.state}).length,this.resize())};
A59=function(a,b,c){var d=this;this._options=$.extend({},this._defaultOptions,c||{});this._$wrapper=a;this._$content=b;this._scroll_speed=40;this._shadow_offset=10;this._header_height=this._options.headerHeight;this.scrolled=new Delegate;this.scrolltoend=new Delegate;this.scrolltostart=new Delegate;(this._touch=Modernizr.touch||navigator.msMaxTouchPoints)?(this._$content.css("position","relative"),this._$wrapper.css({"overflow-y":"scroll","-webkit-overflow-scrolling":"touch",
"-ms-overflow-style":"-ms-autohiding-scrollbar"}).scroll(this._onScroll.bind(this))):(this._$wrapper.css("overflow","hidden"),this._$wrapper.mouseenter(function(){d._bottomFixed||d._dragging||(d._options.alwaysVisible||d._$scrollBar.addClass("active"),d._onScroll())}).mouseleave(function(){d._bottomFixed||d._dragging||(d._options.alwaysVisible||d._$scrollBar.removeClass("active"),d._onScroll())}).mousewheel(function(a,b){if(!a.isDefaultPrevented())return d.scroll(b)}),this._$shadowTop=$('<div class="sb-inner-shadow top">').appendTo(this._$wrapper),
this._$shadowTop.hide(),this._$shadowBottom=$('<div class="sb-inner-shadow">').appendTo(this._$wrapper),this._header_height&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),a=this._options.additionalClass?" "+this._options.additionalClass:"",b=this._options.alwaysVisible?" active-always":"",this._$scrollBarWrapper=$('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper),this._$scrollBar=$('<div class="sb-scrollbar sb-scrollbar-body'+a+b+'"></div>').appendTo(this._$scrollBarWrapper),
this._onScroll())};A59.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0};A59.prototype.initDraggable=function(){if(this._dragInitialized)return this;var a=this;this._$wrapper.offset();this._$scrollBar.draggable({axis:"y",containment:this._$scrollBarWrapper,start:function(){a._dragging=!0},stop:function(){a._dragging=!1},drag:function(b,c){a.updateScroll()}});this._dragInitialized=!0;return this};
A59.prototype.updateScroll=function(){if(this._touch)return this;var a=Math.ceil(this._$scrollBar.position().top-1-this._header_height),b=this._$wrapper.height()-this._header_height,c=this._$content.height();if(0>=b)return this;this._scroll_target_top=0>=c-b-1?this._header_height:-a*c/b+this._header_height;a+this._$scrollBar.height()+2>=b?this.scrollToEnd():(this._$content.css("top",this._scroll_target_top+"px"),this._onScroll());return this};
A59.prototype.updateScrollBar=function(){if(this._touch)return this;var a=this._$content.position().top,b=this._$content.height(),c=this._$wrapper.height(),d=c-this._header_height,e=1+this._header_height,g=d-2,a=(Math.abs(a)-this._header_height)*g/b,c=c*c/b;b<d?(this._$scrollBar.hide(),this._$wrapper.removeClass("sb-scroll-active")):(this._$scrollBar.show().height(c).css("top",e+a),this._$wrapper.addClass("sb-scroll-active"),this.initDraggable());return this};
A59.prototype.scroll=function(a,b){if(this._touch)return this;var c=this._$content.position().top,d=this._$content.height(),e=this._$wrapper.height()-this._header_height,d=d-e-1;if(0>=d)return!0;this._scroll_target_top=Math.max(-d+this._header_height,Math.min(this._header_height,c+a*(b||this._scroll_speed)));this.setContentTop(this._scroll_target_top);this._onScroll();return!1};
A59.prototype.animateTo=function(a){if(this._touch)return this;this._$content.position();var b=this._$content.height(),c=this._$wrapper.height()-this._header_height,b=b-c-1;if(0>=b)return!0;this._scroll_target_top=Math.max(-b+this._header_height,Math.min(this._header_height,-a));this._$content.animate({top:this._scroll_target_top},500,function(){this._onScroll()}.bind(this))};
A59.prototype.resize=function(){if(!this._bottomFixed){this._$content.position();var a=this._$content.height(),b=this._$wrapper.height();!this._options.vAlignBottom&&a<b?this.atStart()||this.scrollToStart():this.atEnd()?this.scrollToEnd():"number"==typeof this._stickyBottom&&this.setContentTop(Math.min(0,this._stickyBottom+this._$wrapper.height()-this._$content.height()))}};
A59.prototype.resizeHeader=function(a){var b=a-this._header_height;this._header_height=a;this._scroll_target_top+=b;this._$shadowTop&&this._$shadowTop.css("top",this._header_height-this._shadow_offset);this.resize()};
A59.prototype.scrollTo=function(a,b){b=$.extend({position:"visible",areaHeight:a instanceof $?a.height():0},b);a instanceof $&&(a=a.position().top);var c=this._$content.position().top,d=this._$content.height(),e=this._$wrapper.height()-this._header_height;if(0>=d-e-1)return!0;c=-1*(c-this._header_height);e=c+e;d=0;if("visible"==b.position){if(a>c&&a+b.areaHeight<e)return!1;d=a+b.areaHeight>e?e-a-b.areaHeight:c-a}else"top"==b.position&&(d=c-a);this.scroll(d,1);this._onScroll();
return!1};A59.prototype.scrollToEnd=function(){var a=this._$content.position().top,b=this._$content.height(),c=this._$wrapper.height();this.setContentTop(a+(c-(b+a))+1);this._onScroll();return this};A59.prototype.scrollToStart=function(){this.setContentTop(this._header_height);this._onScroll();return this};A59.prototype.atStart=function(){return Math.round(this._$content.position().top)>=this._header_height};
A59.prototype.atEnd=function(a){"number"==typeof a&&isFinite(a)||(a=0);var b=this._$content.position().top,c=this._$content.height(),d=this._$wrapper.height();return c-Math.abs(b)-1<=d+a};
A59.prototype._onScroll=function(a){this._touch||this._$content.css("bottom","auto");this.scrolled.fire();this._dragging&&!0!==a||this.updateScrollBar();a=this.atStart();var b=this.atEnd();this._$shadowTop&&this._$shadowTop.toggle(!a);this._$shadowBottom&&this._$shadowBottom.toggle(!b);!this._atStart&&a?(this._atStart=!0,this.scrolltostart.fire()):this._atStart&&!a&&delete this._atStart;!this._atEnd&&b?(this._atEnd=!0,this.scrolltoend.fire()):this._atEnd&&!b&&delete this._atEnd;
this._options.vAlignBottom&&(this._stickyBottom=this._$content.height()-Math.abs(this._$content.position().top)-this._$wrapper.height())};A59.prototype.save=function(){this._saved={top:this._$content.position().top,height:this._$content.height()};return this};
A59.prototype.restore=function(){if(this._saved){if(this._saved.top==this._$content.position().top&&this._saved.height==this._$content.height())return delete this._saved,this;this._options.vAlignBottom&&(this._saved.top-=this._$content.height()-this._saved.height,this._saved.top>this._header_height&&(this._saved.top=this._header_height));this.setContentTop(this._saved.top);delete this._saved;this._onScroll(!0)}return this};
A59.prototype.fixBottom=function(){if(this._bottomFixed)return this;if(this._touch){var a=this._$content.height(),b=this._$wrapper.scrollTop();this._tempIntervalID=setInterval(function(){this._$wrapper.scrollTop(b+(this._$content.height()-a))}.bind(this),0)}else this._$content.css({top:"auto",bottom:this._$wrapper.height()-this._$content.position().top-this._$content.height()});this._bottomFixed=!0;return this};
A59.prototype.releaseBottom=function(){if(!this._bottomFixed)return this;this._touch?clearInterval(this._tempIntervalID):this._$content.css({top:this._$content.position().top,bottom:"auto"});delete this._bottomFixed;this._onScroll();return this};
A59.prototype.setContentTop=function(a){this._touch?this._options.vAlignBottom&&this._$content.height()<this._$wrapper.height()?(this._$wrapper.css("overflow-y","visible"),this._$content.css({position:"absolute",bottom:0})):(this._$content.css({position:"relative",bottom:"auto"}),this._$wrapper.css("overflow-y","scroll"),this._$wrapper.scrollTop(-a)):this._$content.css("top",a);return this};TradingView.SaveLoadWidget=function(a,b,c){function d(){b.metaInfo.name.value()||e._readOnly?e.setTitle(b.metaInfo.name.value()):e.hideTitle()}this._options=c=$.extend({popupDirection:"up",popupReverse:!1},c||{});this.onTitleSizeChanged=new Delegate;this._container=a=$(a);this.D5=b;this._readOnly=b.readOnly();this._savedCharts=[];this._editEnabled=!0;this.loadChartDialog=new LoadChartDialog;this.renameChartDialog=new RenameChartDialog;TradingView.D18("open_last_chart")&&
(this._new=$('<span class="first button load">'+$.t("New")+"</span>").click(this.loadChartDialog.openNewChart).appendTo(a));this._load=$('<span class="button load">'+$.t("Load")+"</span>").click($.proxy(this,"signInOrLoadChart")).appendTo(a);TradingView.D18("open_last_chart")||this._load.addClass("first");this._title=$('<span class="title apply-common-tooltip"></span>');c.hideChartTitle&&this._title.hide();this._sep=$("<i>").addClass("separator");this._optionsMenu=$('<span class="button with-arrow options last">').append($("<span>").addClass("arrow-icon")).click($.proxy(this,
"otherActionsMenu"));TradingView.bindPopupMenu(this._optionsMenu,null,{direction:c.popupDirection,event:"button-popup",reverse:c.popupReverse,notCloseOnButtons:!0,popupSpacing:c.popupSpacing});this._readOnly?(this._save=$(),this._copy=$('<span class="copy">'+$.t("Copy")+"</span>").appendTo(a).click($.proxy(this,"cloneChart")),this._title.addClass("read-only"),this._titleReadOnly=$("<span>").addClass("read-only").appendTo(this._title),this._sep.appendTo(this._copy),this._optionsMenu.hide()):(c=$.t("Save Chart Layout saves not just some particular chart,\nit saves all charts for all symbols and intervals\nwhich you are modifying while working with this Layout"),
this._save=$('<span class="save button apply-common-tooltip" title="'+c+'">'+$.t("Save")+"</span>").appendTo(a).click($.proxy(this,"signInOrSaveChart")),this._copy=$(),this._titleInput=$('<span type="text" maxlength="80">').appendTo(this._title),this._title.bind("click",$.proxy(this,"_renameChart")),this._title.attr("title",$.t("Rename Chart Layout")),this._titleSize=$('<span class="sizer">').appendTo(this._title),this._sep.appendTo(this._save));this._title.appendTo(a);this._optionsMenu.appendTo(a);
this._savecopy=$().add(this._save).add(this._copy).mousedown(function(a){if(a.button)return!1;this._save.addClass("active")}.bind(this)).mouseup(function(){this._save.removeClass("active")}.bind(this));var e=this;b.metaInfo.name.subscribe(function(){d()});d();loginStateChange.subscribe(this,this._refreshSavedChartsList);TVXWindowEvents.on("saved-charts-change",$.proxy(this._otherTabUpdated,this));TVXWindowEvents.on("saved-charts-change-favorites",$.proxy(this._favoritesUpdated,this));A77.undoStack().onChange().subscribe(this,
function(){if(!A77.undoStack().isEmpty()){var a=A77.undoStack().head().text();if("scroll"==a||"scale time"==a)return}this._setChanges(!0);this.autosave()});TradingView.keyboardBinder.registerListener("LoadChartDialogHotkey",function(a){return a.ctrlKey?!1:"46"==a.which&&$(a.target).is("body")?(this._load.click(),a.preventDefault(),a.stopPropagation(),!0):!1}.bind(this));this.favorites=TVSettings.getJSON(TradingView.SaveLoadWidget.FAVORITES_KEY,{})};
TradingView.SaveLoadWidget.FAVORITES_KEY="loadChartDialog.favorites";TradingView.SaveLoadWidget.prototype._favoritesUpdated=function(a){this.favorites=JSON.parse(a);this.loadChartDialog.updateFavoritesData(this.favorites)};TradingView.SaveLoadWidget.prototype._otherTabUpdated=function(a){this._savedCharts=JSON.parse(a);this.loadChartDialog.updateChartsData(this._getLoadMenuCharts())};
TradingView.SaveLoadWidget.prototype._renameChart=function(){var a=this;a._editEnabled&&this.renameChartDialog.show(this.getTitle()).then(function(b){a.setTitle(b);a.saveChart()})};
TradingView.SaveLoadWidget.prototype._setTitle=function(a){this._titleInput.text(a);this._titleValue=a;this._savecopy.removeClass("last").addClass("titled");a?this._options.hideChartTitle||(this._optionsMenu.show(),this._title.show()):(this._optionsMenu.hide(),this._title.hide(),this._savecopy.addClass("last").removeClass("titled"));this._setInputSuze();this._setChanges(!0)};
TradingView.SaveLoadWidget.prototype._setReadOnlyTitle=function(a){this._titleReadOnly.html(a).attr("title",a.replace(/<[^>]+>/g,""));this._savecopy.removeClass("last").addClass("titled");this._title.addClass("last");this._options.hideChartTitle||this._title.show()};TradingView.SaveLoadWidget.prototype.setTitle=function(a){if(this._readOnly){var b=clean(this.D5.metaInfo.username.value());a=(a?a+": ":"")+"view-only chart by "+'<a href="/u/%1">%1</a>'.replace(/%1/g,b);this._setReadOnlyTitle(a)}else this._setTitle(a)};
TradingView.SaveLoadWidget.prototype.hideTitle=function(){this._title.hide();this._optionsMenu.hide();this._titleInput.text("");this._savecopy.removeClass("titled").addClass("last")};TradingView.SaveLoadWidget.prototype.getTitle=function(){return this._titleValue};TradingView.SaveLoadWidget.prototype._setInputSuze=function(){this._titleSize.text(this._titleInput.text());this._titleInput.width(this._titleSize.width());this.onTitleSizeChanged.fire()};
TradingView.SaveLoadWidget.prototype.cloneChart=function(){var a=this;W77.enabled("save_old_chart_before_save_as")&&this.D5.metaInfo.id.value()&&this._saveChart();(new RenameChartDialog($.t("Copy Chart Layout"))).show($.t("{0} copy").format(a.D5.metaInfo.name.value())).then(function(b){W77.enabled("saved_charts_count_restriction")&&!user.is_pro&&5<=a._savedCharts.length?A83.showGoProDialog({feature:"savedChartsLimit"}):W77.enabled("saveload_storage_customization")?
(a.D5.metaInfo.uid.setValue(void 0),a.D5.metaInfo.id.setValue(void 0),a.setTitle(b),a.saveChart()):window.open("/e/?clone="+a.D5.metaInfo.uid.value()+"&name="+encodeURIComponent(b),"_blank")}.bind(this))};TradingView.SaveLoadWidget.prototype._setChanges=function(a){this._haveChanges=a=!!a;!a&&this.getTitle()?this._save.addClass("no-change"):this._save.removeClass("no-change")};
TradingView.SaveLoadWidget.prototype._process=function(a){a?this._save.addClass("process"):this._save.removeClass("process")};
TradingView.SaveLoadWidget.prototype._saveChart=function(a,b){if(!this._readOnly&&!this._saving&&this._haveChanges){var c=function(){this._saving=!1;this._process(!1);this._editEnabled=!0;clearTimeout(this._saveTimeout)}.bind(this);this._saving=!0;this._process(!0);this._editEnabled=!1;this._saveTimeout=setTimeout(c,7E3);try{saver.saveChartSilently(function(){c();this._setChanges(!1);"function"==typeof a&&a.call(this)}.bind(this),null,function(){c();"function"==typeof b&&b.call(this)})}catch(d){c(),
"undefined"!=typeof console&&console.log&&console.log("Error while saving",d)}}};TradingView.SaveLoadWidget.prototype._autosaveInterval=6E4;TradingView.SaveLoadWidget.prototype.autosave=function(){W77.enabled("charts_auto_save")&&(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){this.D5.metaInfo.id.value()&&this._saveChart()}.bind(this),this._autosaveInterval))};
TradingView.SaveLoadWidget.prototype._goChartPage=function(a){"/e/"==location.pathname&&(location="/e/"+a+(TradingView.isMobileView?"?mobile=1":""))};
TradingView.SaveLoadWidget.prototype.saveChart=function(){var a=this.getTitle();a?(this.D5.metaInfo.name.setValue(a),this._saveChart(function(){TradingView.trackEvent("GUI","Save Chart Layout");this._goChartPage(this.D5.metaInfo.uid.value());"undefined"!=typeof TradingView.UaTitleManager&&TradingView.UaTitleManager.instance&&TradingView.UaTitleManager.instance.updateView();this._refreshSavedChartsList()}.bind(this),function(){this.D5.metaInfo.name.setValue("");
this.setTitle("")}.bind(this))):TradingView.showChartNameDialog(function(a){this.setTitle(a);this.saveChart()}.bind(this),void 0,$.t("Chart layout name"),64)};TradingView.SaveLoadWidget.prototype.signInOrSaveChart=function(){W77.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"saveChart")):this.saveChart()};TradingView.SaveLoadWidget.prototype.signInOrLoadChart=function(){W77.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"loadMenu")):this.loadMenu()};
TradingView.SaveLoadWidget.prototype.saveChartByEnter=function(a){"13"==a.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())};TradingView.SaveLoadWidget.prototype._refreshSavedChartsList=function(a){W77.enabled("saveload_requires_authentication")&&!is_authenticated?this._savedCharts=[]:getSavedChartsList(function(a){this._savedCharts=a;TVXWindowEvents.emit("saved-charts-change",JSON.stringify(a))}.bind(this)).then(function(){TVSettings.getJSON(this._FAV_KEY,[]);a&&a()})};
TradingView.SaveLoadWidget.prototype._getSavedChartsList=function(){return this._savedCharts};TradingView.SaveLoadWidget.prototype._fastDelete=function(a,b){this._savedCharts.splice(b,1);a==this.D5.metaInfo.id.value()&&(W77.enabled("saveload_storage_customization")?(this.D5.clearChartMetaInfo(),this.setTitle(void 0)):location.href="/e/")};
TradingView.SaveLoadWidget.prototype._getSavedCharts=function(){var a=[];!this._readOnly&&this.isSaved()&&(a.push({title:$.t("Rename..."),action:this._renameChart.bind(this)}),a.push({title:$.t("Save As..."),action:this.cloneChart.bind(this)}));return a};TradingView.SaveLoadWidget.prototype.isSaved=function(){return!!this.getTitle()};
TradingView.SaveLoadWidget.prototype._getLoadMenuCharts=function(){var a=[],b=this,c=this._getSavedChartsList();c.length&&$.each(c,function(c,e){a.push({id:e.id,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:function(){return e.id==b.D5.metaInfo.id.value()},openAction:function(){openSavedChart(e)},deleteAction:function(a){deleteChart(e.image_url,function(){b._fastDelete(e.id,c);TVXWindowEvents.emit("saved-charts-change",JSON.stringify(b._savedCharts));
a.resolve()})},favoriteAction:function(a){b.favorites=a;TVSettings.setJSON(TradingView.SaveLoadWidget.FAVORITES_KEY,a);TVXWindowEvents.emit("saved-charts-change-favorites",JSON.stringify(a))}})});return a};TradingView.SaveLoadWidget.prototype.otherActionsMenu=function(){this._optionsMenu.hasClass("active")||this._optionsMenu.trigger("button-popup",[this._getSavedCharts()])};
TradingView.SaveLoadWidget.prototype.loadMenu=function(){var a=this;this._load.addClass("process");this._refreshSavedChartsList(function(){a._load.removeClass("process");a.loadChartDialog.show(a._getLoadMenuCharts(),a.favorites)})};A9=function(a,b,c){this._chart=a;this._parent=b;this.zoom_active=!1;this._real=c;this._state="stop";this.init();c&&this.initToRealChart();this.initHandlers()};
A9.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent);$('<div class="control-bar"><svg class="move-left-button-control-bar"><use xlink:href="#svg-left" /></svg><svg class="zoom-out-right-button-control-bar"><use xlink:href="#svg-minus" /></svg><svg class="turn-button-control-bar"><use xlink:href="#svg-restore" /></svg><svg class="zoom-in-button-control-bar"><use xlink:href="#svg-plus" /></svg><svg class="move-right-button-control-bar"><use xlink:href="#svg-right" /></svg></div>').appendTo(this._widget);this._buttons=
{zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")}};
A9.prototype.initToRealChart=function(){var a=this;this._back=$('<svg class="back-to-present hidden"><use xlink:href="#svg-right-stop" /></svg>').appendTo(this._parent);this._back.on("click",function(){a._chart.model().timeScale().scrollToRealtime(!0);a._chart.model().model()._invalidateHandler(new A22(A22.FULL_UPDATE));a._back.addClass("hidden")});var b=function(){var b=a._chart.maxRhsPriceAxisWidth+4;b&&a._back.css("marginRight",
b)};this._chart.rhsPriceAxisWidthChanged.subscribe(this,b);b();this._chart.withModel(this,function(){this._chart.model().model().setInterval(function(){a.check()},1E3)})};A9.prototype.check=function(){this._chart.model()&&0>this._chart.model().timeScale().rightOffset()?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present hidden")};
A9.prototype._move=function(a){"stop"==this._state&&this._chart.model().beginUndoMacro(1==a?"Move Left":"Move Right");this._state="moving";this._moveType="animated";this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0);this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0);this._startTime=+new Date;if(!this._movingTimeout){var b=this._startTime;this._movingTimeout=setTimeout(function d(){this._moveStep.call(this,
b,0,50*a,1E3);this._movingTimeout=setTimeout(d.bind(this),10)}.bind(this),10)}};A9.prototype._moveStep=function(a,b,c,d){if(!this._chart.model().timeScale().isEmpty())return a=1-(Math.max(0,a+d-+new Date)/d||0),1>a&&(d=jQuery.easing.easeOutCubic(null,d*a,0,1,d),this.currentDistance=(c-b)*d+b),this._chart.model().scrollChart(this.currentDistance),a};
A9.prototype._finishMove=function(a){clearTimeout(this._movingTimeout);this._deferredFinishTimeout=this._movingTimeout=0;var b=this.currentDistance,c=+new Date;this._finishingTimeout=setTimeout(function e(){1>this._moveStep.call(this,c,b,0,700)?this._finishingTimeout=setTimeout(e.bind(this),10):(this._state="stop",this._moveType="",this.currentDistance=this._movingTimeout=0,this._chart.model().endUndoMacro())}.bind(this),10)};
A9.prototype._stopMove=function(a){"moving"==this._state&&(this._state="wait_finishing",200>(new Date).getTime()-this._startTime?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())};
A9.prototype._moveByBar=function(a){"stop"==this._state&&this._chart.model().beginUndoMacro(1==a?"Move Left":"Move Right");var b=this._chart.model().timeScale(),c=b.indexToCoordinate(b.visibleBars().lastBar())+b.barSpacing()/2;Math.abs(b.width()-c)>b.barSpacing()/6&&this._chart.model().scrollChart(b.width()-c);this._state="moving";this._moveType="by_bar";this._startTime=+new Date;if(!this._movingTimeout){var d=150,e=0;this._movingTimeout=setTimeout(function h(){this._moveByBarStep(a);
e++;100<d&&(d-=e/5*20);this._movingTimeout=setTimeout(h.bind(this),d)}.bind(this),400);this._moveByBarStep(a)}};A9.prototype._moveByBarStep=function(a){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(a)};A9.prototype._stopMoveByBar=function(a){"moving"==this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this.currentDistance=this._movingTimeout=0,this._chart.model().endUndoMacro())};
A9.prototype.initHandlers=function(){var a=this._chart;$(".control-bar span");var b=Modernizr.touch?"touchstart":"mousedown",c=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(b,this._moveByBar.bind(this,1));this._buttons.moveLeft.on(c,this._stopMoveByBar.bind(this,1));this._buttons.moveRight.on(b,this._moveByBar.bind(this,-1));this._buttons.moveRight.on(c,this._stopMoveByBar.bind(this,-1));this._buttons.turn.on("click",function(){a.GUIResetScales()});
this._buttons.zoomOut.on("click",function(){a.model()&&a.model().zoomOut()});this._buttons.zoomIn.on("click",function(){a.model()&&a.model().zoomIn()});a.withModel(this,function(){var b=function(){var b=!a.model().canZoomIn(),c=!a.model().canZoomOut();this.makeBtnDisabled(this._buttons.zoomIn,b);this.makeBtnDisabled(this._buttons.zoomOut,c)};a.model().onSimpleZoomIn().subscribe(this,function(){b.call(this)});a.model().onSimpleZoomOut().subscribe(this,function(){b.call(this)})});var d={};$("body").on("keydown",
function(a){if(!($(a.target).closest("input, textarea").length||a.which in d))switch(d[a.which]=!0,a.which){case 37:a.ctrlKey||a.altKey?this._move(1):this._moveByBar(1);a.preventDefault();break;case 39:a.ctrlKey||a.altKey?this._move(-1):this._moveByBar(-1),a.preventDefault()}}.bind(this)).on("keyup",function(a){if(!$(a.target).closest("input, textarea").length)switch(delete d[a.which],a.which){case 37:case 39:"by_bar"==this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))};
A9.prototype.makeBtnDisabled=function(a,b){a instanceof $?a.toggleClass("disabled",!!b):"string"===typeof a&&(this._buttons[a]?this._buttons[a].toggleClass("disabled",!!b):console.warn("No btn "+a+" in ControlBarNavigation"))};A9.prototype.resetButtons=function(){if(this._buttons)for(var a in this._buttons)this._buttons[a].removeClass("disabled")};TradingView.SeriesControlWidget=function(){function a(a){var c=this,d=this.D4=a.D3;this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(a.parent);d.onWidget()||W77.enabled("charting_library")?this._$extendedHoursButton=null:this._$extendedHoursButton=$(document.createElement("a")).text($.t("ext")).attr("title","The Extended Trading Hours feature is available only for intraday charts").addClass("apply-common-tooltip").appendTo(this._$seriesControls);
this._$percButton=$(document.createElement("a")).text("%").attr("title",$.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$logButton=$(document.createElement("a")).text($.t("log")).attr("title",$.t("Toggle Log Scale")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$autoScaleButton=$(document.createElement("a")).text($.t("auto",{context:"scale"})).attr("title",$.t("Toggle Auto Scale")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);
var e=$(document.createElement("a")).attr("title",$.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$fullscreenChartButton=$(document.createElement("a")).attr("title",$.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);var g=$(document.createElementNS("http://www.w3.org/2000/svg","svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"});$(document.createElementNS("http://www.w3.org/2000/svg",
"desc")).text("SP").appendTo(g);$(document.createElementNS("http://www.w3.org/2000/svg","path")).attr({d:"M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"}).appendTo(g);
e.append(g);g=$(document.createElementNS("http://www.w3.org/2000/svg","svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"});g.get(0).setAttribute("viewBox","0 0 24 24");$(document.createElementNS("http://www.w3.org/2000/svg","desc")).text("FS").appendTo(g);$(document.createElementNS("http://www.w3.org/2000/svg","path")).attr({d:"M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z"}).appendTo(g);
this._$fullscreenChartButton.append(g);this._$percButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries(),c=b.priceScale(),e=c.properties();b.properties().lockScale.value()||(a.beginUndoMacro($.t("Toggle Percentage")),e.log.value()&&a.setLogProperty(e.log,!1,c,$.t("Toggle Log Scale")),a.setPercentProperty(e.percentage,!e.percentage.value(),c,$.t("Toggle Percentage")),a.endUndoMacro())});this._$logButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries(),
c=b.priceScale(),e=c.properties();b.properties().lockScale.value()||(a.beginUndoMacro($.t("Toggle Log Scale")),e.percentage.value()&&a.setPercentProperty(e.percentage,!1,c,$.t("Toggle Percentage")),a.setLogProperty(e.log,!e.log.value(),c,$.t("Toggle Log Scale")),a.endUndoMacro())});this._$autoScaleButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries().priceScale(),c=b.properties();a.beginUndoMacro($.t("Toggle Auto Scale"));c.autoScale.value()&&c.percentage.value()&&a.setPercentProperty(c.percentage,
!1,b,$.t("Toggle Percentage"));a.setAutoScaleProperty(c.autoScale,!c.autoScale.value(),b,$.t("Toggle Auto Scale"));a.endUndoMacro()});e.on("click",function(a){a.preventDefault();e.addClass("active");d.showScalesProperties().on("remove",function(){e.removeClass("active")})});if(this._$extendedHoursButton)this._$extendedHoursButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries().properties().extendedHours;a.setProperty(b,!b.value(),"Extended Hours")});this._$dateRanges=$(document.createElement("div")).attr("class",
"chart-controls-bar-buttons date-range-wrapper").appendTo(a.parent);d.withModel(null,function(){var a=d.model().mainSeries(),b=a.priceScale();c.updateScaleButtons();a.priceScaleChanged.subscribe(c,c.updateScaleButtons);b.properties().autoScale.subscribe(c,c.updateScaleButtons);c.updateDateRangeButtons();a.onStatusChanged().subscribe(c,c.updateDateRangeButtons);W77.enabled("update_timeframes_set_on_symbol_resolve")&&a.onSymbolResolved().subscribe(c,c.updateDateRangeButtons);a.properties().lockScale.subscribe(c,
c.updateDateRangeButtons);c.updateExtendedHoursButton();a.properties().extendedHours.subscribe(c,c.updateExtendedHoursButton);a.properties().interval.subscribe(c,c.updateExtendedHoursButton)});c.updateFullscreenChartButton();var h=this.D4.D5;h&&(h.layout.subscribe(this.updateFullscreenChartButton.bind(this)),h.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)),this._$fullscreenChartButton.on("click",function(){h.activeChartWidget.setValue(d);
h.maximizeCurrentChart.setValue(!h.maximizeCurrentChart.value())}))}a.prototype.updateScaleButtons=function(){var a=this.D4.model().mainSeries().priceScale().properties(),c=a.log.value(),d=a.percentage.value(),a=a.autoScale.value();this._$logButton.toggleClass("active",c);this._$percButton.toggleClass("active",d);this._$autoScaleButton.toggleClass("active",a)};a.prototype.updateDateRangeButtons=function(){var a=this.D4;if(a.model().mainSeries().status()!=TradingView.Series.STATUS_LOADING){var c=
a._dateRangeResolutions();if(c.length){this._$dateRanges.empty();for(var d=0;d<c.length;d++){var e=c[d],g=$(document.createElement("a")).text(e.text);g.appendTo(this._$dateRanges);g.click({val:e.value,res:e.targetResolution},function(c){a.model().loadRange(c.data)})}}}};a.prototype.updateExtendedHoursButton=function(){this._$extendedHoursButton&&(this.D4.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"))};
a.prototype.updateFullscreenChartButton=function(){var a=this.D4.D5;a&&"s"!==a.layout.value()?(this._$fullscreenChartButton.show(),this._$fullscreenChartButton.toggleClass("active",a.maximizeCurrentChart.value())):this._$fullscreenChartButton.hide()};a.prototype.updateUI=function(){this.updateScaleButtons()};return a}();A69=function(){function a(b){if(!(this instanceof a))throw new TypeError("SymbolSearch is a constructor");this._inputParserMixin=W77.enabled("symbol_search_parser_mixin")?new A70(this):void 0;b=b||{};this._inputElement=$(b.input).get(0);if(!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");this.$list=$(b.list).eq(0);0===this.$list.size()&&delete this.$list;if(void 0!==b.callback){if("function"!==
typeof b.callback)throw new TypeError("options.callback must be function");this._callback=b.callback}if(void 0!==b.onValueChanged){if("function"!==typeof b.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=b.onValueChanged}if(void 0!==b.onEmptyApply){if("function"!==typeof b.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=b.onEmptyApply}b.ignoreInterval&&(this._ignoreInterval=!0);a.resetStoredInterval();
b.hidePro&&(this._hidePro=!0);b.allowMultipleSymbols&&(this._allowMultipleSymbols=!0);if(void 0!==b.onParse){if("function"!==typeof b.onParse)throw new TypeError("options.onParse must be function");this._onParse=b.onParse}this._state={};$(this._inputElement).data("symbol-search-instance",this);for(var c=this._boundListener=this._eventListener.bind(this),d=this.boundTimeoutListener=function(a){setTimeout(function(){c(a)},0)},g=0;g<e.length;g++)if(e[g].immediate)$(this._inputElement).on(e[g].name,c);
else $(this._inputElement).on(e[g].name,d);this._boundOnKeyDown=this._onKeyDown.bind(this);this._boundOnKeyPress=this._onKeyPress.bind(this);$(this._inputElement).on("keydown",this._boundOnKeyDown).on("keypress",this._boundOnKeyPress);this._eventListener();b.autoFocus&&a.registerAutoFocus(this)}function b(a,b){var c=D16.supportedSymbolsTypes(),d=TVSettings.getValue("symboledit.filter");!c.some(function(a){return a.value===d})&&0<c.length&&(d=c[0].value);if(0==c.length)return!1;c.forEach(function(c){var e=
c.value;c=$('<a class="type-filter">').attr("href","#"+e).text($.t(c.name));e===d&&c.addClass("active");c.on("click",function(c){c.preventDefault();b.find(".type-filter").removeClass("active");$(this).addClass("active");a.typeFilter(e);TVSettings.setValue("symboledit.filter",e)});c.appendTo(b)});a.typeFilter(d);return!0}function c(a,b){var c=D16.supportedExchangesList(),d=TVSettings.getValue("symboledit.exchangefilter");!c.some(function(a){return a.value===d})&&0<c.length&&(d=c[0].value);
if(0==c.length)return!1;var e=$('<div class="exchange-filter">').appendTo(b),g=$("<select>").appendTo(e);c.forEach(function(a){var b=a.value,c=a.name||b,e=a.desc||c,b=$("<option>").attr("value",b).text($.t(c)).data("custom-option-text",$.t(e)).appendTo(g);a.value===d&&b.attr("selected",!0)});g.change(function(){var b=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",b);a.exchangeFilter(b)});g.selectbox({speed:0,classHolder:"tv-unstyled-select-container tv-symbol-select"});a.exchangeFilter(d);
return!0}function d(a){return a.ctrlKey||a.metaKey||!a.charCode||!a.which||32>=a.which||/^(input|textarea)$/i.test(a.target.tagName)||A83.modalDialog?!1:!0}var e=[{name:"input",immediate:!0},{name:"sync",immediate:!0},{name:"keypress"},{name:"keydown"},{name:"keyup"},{name:"mousedown"},{name:"mouseup"},{name:"cut"},{name:"paste"}],g=[/^e\-m/i];a.registerAutoFocus=function(b){b instanceof jQuery&&(b=b.data("symbol-search-instance"));if(!(b instanceof a))throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");
TradingView.keyboardBinder.registerListener("symbolEdit",function(a){d(a)&&(a.preventDefault(),this.resetState(),this._skipAutoFocus=!0,this._inputElement.focus(),a=String.fromCharCode(a.charCode),"function"==typeof this._setInputValue?this._setInputValue(a):this._inputElement.value=a,this._eventListener())}.bind(b))};a.prototype.resetState=function(){this._state={}};a.prototype.typeFilter=function(a){if(0<arguments.length)a!==this._state.typeFilter&&(null==a?delete this._state.typeFilter:this._state.typeFilter=
a+"",delete this._state.keepListFor,this._onSelectionChanged());else return this._state.typeFilter};a.prototype.exchangeFilter=function(a){if(0<arguments.length)a!==this._state.exchangeFilter&&(null==a?delete this._state.exchangeFilter:this._state.exchangeFilter=a+"",delete this._state.keepListFor,this._onSelectionChanged());else return this._state.exchangeFilter};a.prototype._moveSelection=function(a,b){if(this._state.suggestOptions&&0!==this._state.suggestOptions.length){var c=this.$list.find("tbody tr:not(.group-close):not(.hidden)"),
d=this.$list.find("tr.symbol-edit-popup-active"),e=-1,g;d.size()?(e=c.index(d),g=Math.max(0,Math.min(e+a,c.size()-1))):g=0;e!=g&&(c=c.eq(g),e=c.data("item"),d.length&&d.removeClass("symbol-edit-popup-active"),e.groupTitle?(c.addClass("symbol-edit-popup-active"),this._selectedGroupItem=e,delete this._state.highlightIndex,this._scrollHighlightIntoView()):(this._selectedGroupItem&&(this._selectedGroupItem=null),d=this._state.suggestOptions.indexOf(e),this._highlightOption(~d&&d||0,!0,b)))}};a.prototype._groupSetCollapsed=
function(a,b){a.groupTitle&&this._groupListHandler&&this._groupListHandler.setCollapsed(a.root,b)};a.prototype._onKeyDown=function(a){if(40===a.keyCode||38===a.keyCode)this._moveSelection(40===a.keyCode?1:-1,!0),a.preventDefault();!this._selectedGroupItem||37!==a.keyCode&&39!==a.keyCode||(this._groupSetCollapsed(this._selectedGroupItem,37===a.keyCode),a.preventDefault())};a.prototype._onKeyPress=function(a){if(40===a.keyCode||38===a.keyCode){if(a.charCode)return;if(this._boundOnKeyDown){$(this._inputElement).off("keydown",
this._boundOnKeyDown);delete this._boundOnKeyDown;a.preventDefault();return}this._moveSelection(40===a.keyCode?1:-1);a.preventDefault()}13===a.keyCode&&(this._selectedGroupItem?(this._groupSetCollapsed(this._selectedGroupItem,!1),a.preventDefault()):this.acceptTypeIn())};a.prototype._eventListener=function(a,b){var c=this._inputElement,d=this._getInputValue().toUpperCase(),e=!1;this._state.value!==d&&(this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(d),this._state.value=
d,e=!0,this._inputParserMixin&&this._inputParserMixin.parse());this._fixIntervalCase();d=this._limitInputSelectionValue("selectionStart");this._state.selectionStart!==d&&(this._state.selectionStart=d,e=!0);d=this._limitInputSelectionValue("selectionEnd");this._state.selectionEnd!==d&&(this._state.selectionEnd=d,e=!0);this._state.selectionDirection!==c.selectionDirection&&(this._state.selectionDirection=c.selectionDirection,e=!0);e&&(this._onSelectionChanged(void 0,b),e=!1,this._getInputValue()!==
this._state.value&&(this._setInputValue(this._state.value),e=!0),(e||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&c.setSelectionRange(this._state.selectionStart,this._state.selectionEnd,this._state.selectionDirection))};a.prototype._fixIntervalCase=function(){if(this._selectionInsideInterval()){var b=a.detachInterval(this._inputElement.value);/[a-z]/.test(b.detached)&&(this._inputElement.value=
b.rest+b.detached.toUpperCase())}};a.prototype._selectionInsideInterval=function(b){if(this._ignoreInterval)return!1;var c=a.detachInterval(this._inputElement.value);return c?"string"==typeof b?this._inputElement[b]>c.rest.length:this._inputElement.selectionStart>c.rest.length&&this._inputElement.selectionEnd>c.rest.length:!1};a.prototype._limitInputSelectionValue=function(b){return this._selectionInsideInterval(b)?a.detachInterval(this._inputElement.value).rest.length:this._inputElement[b]};a.prototype._getInputValue=
function(){if(this._ignoreInterval)return this._inputElement.value;var b=a.detachStoreInterval(this._inputElement.value);$(this._inputElement).toggleClass("interval-error",a.intervalError());return b};a.prototype._setInputValue=function(b){this._inputElement.value=this._ignoreInterval?b:a.recallAttachInterval(b)};a.prototype._onSelectionChanged=function(a,b){function c(a,b,e,g){d._state.contextTicker=a;d._state.contextExchange=b;d._state.contextType=e;d._state.keepListFor&&d._state.keepListFor===
g||(d._getSuggestList(),delete d._state.keepListFor)}var d=this;if(!g.some(function(a){return a.test(d._state.value)})&&this._inputParserMixin&&!0!==b)this._inputParserMixin.onSelectionChanged(c);else{var e=this._state.value;c(e,this._state.exchangeFilter,this._state.typeFilter,this._state._selectedTicker||e)}};a.prototype._clearSelectionState=function(){delete this._state.contextTicker;delete this._state.contextExchange;delete this._state.contextType;delete this._state.contextToken;delete this._state.keepListFor};
a.prototype._getSuggestList=function(){var a=this,b=this._state.contextTicker||"",c=this._state.contextExchange||this._state.exchangeFilter||"",d=this._state.typeFilter||"";this._showLoading();D16.searchSymbolsByName(b,c,d,"undefined"!=typeof D3?D3:void 0,function(e){b===(a._state.contextTicker||"")&&c===(a._state.contextExchange||a._state.exchangeFilter||"")&&d===(a._state.typeFilter||"")&&a._renderSuggestList(e)})};a.prototype._showLoading=function(){this.$list&&(this._clearSuggestList(),
$('<div class="symbol-search-loading">').appendTo(this.$list))};a.prototype._renderSuggestList=function(b){if(this.$list){var c=this,d=this._state;this._clearSuggestList();var e=d.suggestOptions=[],g=RegExpEscape(d.contextTicker).trim(),q=new RegExp(g.replace(" ","|"),"i"+(1<g.length?"g":""));delete d.highlightIndex;this._hidePro&&(b=b.filter(function(a){return!a.params||-1===a.params.indexOf("pro")}));if(0===b.length)this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+
$.t("No symbols matched your criteria")+"</div>");else{var r=$('<table class="symbol-edit-popup">').appendTo(this.$list),u=new a.GroupListHandler(r,q);b.forEach(function(a){a.ticker||(a.ticker=a.full_name);var b=$('<tr class="symbol-edit-popup">'),c=$('<td class="symbol-edit-popup-td name apply-overflow-title">');c.html(a.symbol.replace(q,"<strong>$&</strong>"));c.appendTo(b);$('<td class="symbol-edit-popup-td desc apply-overflow-title">').html(q.test(a.symbol)?a.description:a.description.replace(q,
"<strong>$&</strong>")).appendTo(b);c=$('<td class="symbol-edit-popup-td type apply-overflow-title">').appendTo(b);"undefined"!=typeof a.params&&~a.params.indexOf("eod")&&($("<i>").text("eod").addClass("eod").prependTo(c),c.append("&nbsp;"));switch(a.type){case "index":c.append($.t(a.type));break;default:c.append($.t(a.type)+" - "+a.exchange)}c.appendTo(b);"futures"==a.type?u.append(a,b):b.appendTo(r);a._$tr=b;b.data("item",a)});u.collapse();this._groupListHandler=u;b=0;for(var g=this.$list.find("tbody tr:not(.group-close)"),
w,A;b<g.size();b++)w=g.eq(b),w=w.data("item"),e.push(w),w.ticker===d.contextTicker&&w.exchange===d.contextExchange&&void 0===A&&(A=b);"number"==typeof A&&this._highlightOption(A);r.on("click","tr",function(a){a.isDefaultPrevented()||(a.preventDefault(),c._state.suggestOptions&&(a=$(this).data("item"))&&a.full_name&&c.accept(a.full_name,a.ticker))})}}};a.prototype._highlightOption=function(a,b,c){var d=this._state;d.highlightIndex!==a&&(void 0!==d.highlightIndex&&d.suggestOptions[this._state.highlightIndex]._$tr&&
d.suggestOptions[this._state.highlightIndex]._$tr.removeClass("symbol-edit-popup-active"),d.highlightIndex=a,(a=d.suggestOptions[a]._$tr)&&a.addClass("symbol-edit-popup-active"),this._scrollHighlightIntoView(),b&&this._replaceCurrentSymbol(c))};a.prototype._scrollHighlightIntoView=function(){$tr=this.$list.find("tr.symbol-edit-popup-active");$tr.length&&($tr.offset().top<this.$list.offset().top?this.$list.scrollTop(this.$list.scrollTop()-(this.$list.offset().top-$tr.offset().top)):$tr.offset().top+
$tr.outerHeight()>this.$list.offset().top+this.$list.outerHeight()&&this.$list.scrollTop(this.$list.scrollTop()+($tr.offset().top+$tr.outerHeight()-(this.$list.offset().top+this.$list.outerHeight()))))};a.prototype._clearSuggestList=function(){delete this._state.suggestOptions;this.$list&&this.$list.empty()};a.prototype._showErrorNotice=function(){this.$list&&(this._clearSuggestList(),this.$list.text("Invalid expression"))};a.prototype._replaceCurrentSymbol=function(a){var b=this._state;if(b.suggestOptions&&
void 0!==b.highlightIndex){var c=b.suggestOptions[b.highlightIndex],d="",e=0;if(this._inputParserMixin&&!0!==a){c=this._inputParserMixin.replaceCurrentSymbol(c);if(!c.ok)return;d=c.newValue;e=c.newCaretPos;b.keepListFor=c.keepListFor}else d=!0===a&&c.full_name&&this._inputParserMixin?c.full_name:c.symbol,e=d.length,this._state._selectedTicker=b.keepListFor=c.ticker||c.symbol;this._setInputValue(d);this._inputElement.setSelectionRange(e,e);this._eventListener(void 0,a)}};a.prototype.splitAndAcceptUserInput=
function(){for(var a=this._getInputValue().split(","),b=0;b<a.length;b++)this.acceptSymbolIn(a[b])};a.prototype.acceptSymbolIn=function(a){var b,c;this._inputParserMixin?b=this._inputParserMixin.parseSymbol(a):(b=a,c=this._state._selectedTicker||a);this.accept(b,c)};a.prototype.acceptTypeIn=function(){this._allowMultipleSymbols?this.splitAndAcceptUserInput():this.acceptSymbolIn(this._getInputValue())};a.prototype.accept=function(b,c){if(c=c||b){delete this._state.keepListFor;var d=this._ignoreInterval?
void 0:a.getInterval(!0);this._inputElement.value=b;this._eventListener();this._callback&&this._callback(c,d);$(this._inputElement).trigger("accept-symbol",[c])}};a.prototype.bindListWrapper=function(a){a=$(a).eq(0);if(0===a.size())throw new TypeError("element must be a DOM element, jQuery object or selector");this.$list=a;this._clearSelectionState();this._eventListener()};a.prototype.removeListWrapper=function(){delete this.$list;this._clearSuggestList();this._clearSelectionState();this._eventListener()};
a.showDialog=function(d){d=d||{};if(!A83.get("Symbol Search")){var e=A83.createDialog("Symbol Search",{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"650px",content:TradingView.templates.dialogs.symbolSearch});A83.positionDialog(e);var g=e.find(".tv-dialog-content").addClass("symbol-search-dialog"),m=g.find(".results");m.mousewheel(function(a,b){var c=$(this);0<b?c.scrollTop(c.scrollTop()-15):c.scrollTop(c.scrollTop()+15)});var n=g.find("input").get(0);d.initialValue&&
(n.value=d.initialValue);n.selectionStart=n.selectionEnd=n.value.length;n.focus();var q;if("undefined"!=typeof A70){var r,u;d.ignoreInterval||(r=a.getInputValueGetter(n),u=a.getInputValueSetter(n));q=A70.addSpreadActions(g.find(".spread-actions"),n,r,u)}q=new a({input:n,list:g.find(".results").get(0),callback:function(a,b){d.callback&&d.callback(a,b);A83.destroy("Symbol Search")},onParse:q,ignoreInterval:d.ignoreInterval});
g=g.find(".filter");r=b(q,g);q=c(q,g);r||q||g.attr("style","display: none");A83.resizeContent(e.height(),m);A83.applyHandlers(e);A83.positionDialog(e);e.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",n.value)});return e}};a.bindToInput=function(d,e){function g(){u&&(D.removeListWrapper(),u.off(),u.remove(),u=null)}function m(a){a.preventDefault()}e=e||{};d=$(d).eq(0);var n=e.callback,q=null,r=null,u=null,w=void 0,A=e.spreadActions&&$(e.spreadActions).eq(0);
if(A&&A.size()&&"undefined"!=typeof A70){var v,B;e.ignoreInterval||(v=a.getInputValueGetter(d.get(0)),B=a.getInputValueSetter(d.get(0)));w=A70.addSpreadActions(A,d.get(0),v,B)}var D=new a({input:d,onValueChanged:function(){if(!u){var a=D,d=$('<div class="symbol-edit-popup">').appendTo(document.body),e=$('<div class="filter">').appendTo(d);b(a,e);c(a,e);var g=$('<div class="table-wrapper">').appendTo(d),h=$(a._inputElement),
a=h.offset();leftOffset=Math.max(0,Math.min(a.left+0,$(window).width()-d.outerWidth()));d.css("left",leftOffset+"px");d.css("top",a.top+h.outerHeight()+1);var k=parseInt($(window).height(),10),e=e.outerHeight(),l=$(window).scrollTop(),h=h.height();g.css("maxHeight",k-(a.top-l)-h/2-h-e+"px");u=d;D.bindListWrapper(g);u.on("focus","*",m);u.on("click","*",m);u.on("mousedown","*",m)}W77.enabled("charting_library")&&(d=this._state,d.keepListFor&&(d.suggestOptions&&void 0!==d.highlightIndex?(d=d.suggestOptions[d.highlightIndex],
g=this._getInputValue().toUpperCase(),d.symbol!=g&&delete this._state.keepListFor):delete this._state.keepListFor))},callback:function(a,b){g();"function"===typeof r&&r(a,b)||("function"===typeof n&&n(a,b),"function"===typeof q&&q(a,b));e.clearAfterAccept&&d.val("");e.keepFocus?d.get(0).focus():d.get(0).blur();D.resetState()},hidePro:e.hidePro,autoFocus:e.autoFocus,onEmptyApply:e.onEmptyApply,onParse:w,allowMultipleSymbols:e.allowMultipleSymbols,ignoreInterval:e.ignoreInterval}),C=!1;d.on("focus",
function(a,b){C=!0;D._skipAutoFocus?delete D._skipAutoFocus:setTimeout(function(){C&&d.get(0).select()},0)});d.on("blur",function(a){C=!1;setTimeout(function(){C||g()},0)});if(e.syncWithChartWidget){var z=function(a){a=a&&A45.seriesShortSymbol.value()||A45.symbol.value()||"";d.val(a);D.resetState()};z(!0);A45.seriesShortSymbol.subscribe(function(){z(!0)});q=function(a,b){a&&A45.symbol.setValue(a);b&&A45.interval.setValue(b)};
r=function(a,b){if(b)return!1;if(a===A45.symbol.value()||a===A45.seriesShortSymbol.value())return!0};d.on("keypress",function(a){27===a.keyCode&&(d.get(0).blur(),z(!1))});d.on("keydown",function(a){27===a.keyCode&&(d.get(0).blur(),z(!1))})}return D};a.GroupListHandler=function(a,b){this._$container=a;this._tickerRegExp=b;this._roots={}};a.GroupListHandler.prototype.addRoot=function(a,b,c){var d=this,e=c.clone().addClass("group-title").click(function(b){b.preventDefault();
d[e.hasClass("collapsed")?"expand":"collapse"](a)});e.find("td.name").html("<div>"+a.replace(this._tickerRegExp,"<strong>$&</strong>")+"</div>");e.find("td.type").html(b.type);e.appendTo(this._$container);e.data("item",{groupTitle:!0,root:a});b=$('<tr class="group-close"><td colspan="3"></td></tr>').appendTo(this._$container);this._roots[a]={titleRow:e,closeRow:b}};a.GroupListHandler.prototype.append=function(a,b){var c=/^(.+)([12]!|\w\d{4})$/.exec(String(a.symbol));c?(c=c[1],this._roots[c]||this.addRoot(c,
a,b),b.addClass("root-"+c).insertBefore(this._roots[c].closeRow)):b.appendTo(this._$container)};a.GroupListHandler.prototype.setCollapsed=function(a,b){if(!a)for(a in this._roots)this.setCollapsed(a,b);else if(this._roots[a]){var c=!0===b?"addClass":"removeClass";this._roots[a].titleRow[c]("collapsed");this._$container.find("tr.root-"+a)[c]("hidden")}};a.GroupListHandler.prototype.collapse=function(a){this.setCollapsed(a,!0)};a.GroupListHandler.prototype.expand=function(a){this.setCollapsed(a,!1)};
a.isIntervalInit=function(a){return/[\d,]/.test(a)&&W77.enabled("show_interval_dialog_on_key_press")};a.isIntervalChar=function(a){return/[\dhdwm]/i.test(a)};a.parseIntervalValue=function(a){var b=/^[,\s]*(\d*)\s*([hdwm]?)\s*$/i.exec(a)||[];a=~~b[1];var b=b[2]&&b[2].toUpperCase(),c={qty:!a&&b?1:a,unit:b||null};c.error=!a&&!b;c.intraday=!c.error&&(!c.unit||"H"==c.unit);return c};a.sanitizeIntervalValue=function(b){b=a.parseIntervalValue(b);var c=b.qty,d=b.unit;if(b.error)return null;"H"==d&&
(c*=60,d=null);return c&&!d?String(c):!d||c&&1!=c?c+d:d};a.detachInterval=function(a){var b=/,[^,]*$/i.exec(a)||[];if(b[0])return{rest:a.substr(0,a.length-b[0].length),detached:b[0]}};a.intervalIsSupported=function(b){if(W77.enabled("allow_supported_resolutions_set_only"))return b=this.sanitizeIntervalValue(b),null===b?!1:IntervalHelper.isAvailable(b);b=a.parseIntervalValue(b);if(b.error)return!1;if(b.intraday)return A45.intraday.value();var c=A45.supportedResolutions.value();
return c?!!~c.indexOf(b.unit):!0};(function(){var b="",c=null;a.resetStoredInterval=function(){b="";c=null};a.detachStoreInterval=function(d){var e=a.detachInterval(d);if(e)return b=e.detached,c=a.sanitizeIntervalValue(b),e.rest;a.resetStoredInterval();return d};a.recallAttachInterval=function(a){return a+b};a.getInterval=function(b){var d=c;!0===b&&a.resetStoredInterval();return d};a.getInputValueGetter=function(b){return function(){return a.detachStoreInterval(b.value)}};a.getInputValueSetter=function(b){return function(c){b.value=
a.recallAttachInterval(c)}};a.intervalError=function(){return!b||/^,\s*$/.test(b)?!1:!c}})();a.registerDialogKeypressHandler=function(b){if(!b)throw new TypeError("D3 is required");TradingView.keyboardBinder.pushBackListener("symbolEdit",function(b){d(b)&&(b.preventDefault(),b=String.fromCharCode(b.charCode),a.isIntervalInit(b)?(new ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show(b):a.showDialog({initialValue:b,callback:function(a,b){A45.symbol.setValue(a);
b&&A45.interval.setValue(b)}}))})};return a}();TradingView.MiniChartWidget=function(a,b,c){this.$container=b;this._options=_options=$.extend(!0,this.defaults(),c||{});this._ctx=this._canvas=null;this._plots=$.map(a||[],function(a){return new TradingView.MiniChartWidgetPlot(a.data,$.extend(!0,{},_options.plot,a.options))});this._initCanvas();a=function(){return this._plots}.bind(this);this._xScale=new TradingView.MiniChartWidgetXScale(a,this._ctx,this._options.xScale);this._yScale=new TradingView.MiniChartWidgetYScale(a,this._ctx,this._options.yScale);
this._plotArea=new TradingView.MiniChartWidgetPlotArea(a,this._ctx,this._xScale,this._yScale,{grid:this._options.grid,plot:this._options.plot,loading:this._options.loading});this.height=new WatchedValue(0);this.width=new WatchedValue(0);this._initSizeHandling();this.resetSize();this._onPlotsChanged();this.bindOnResize()};
TradingView.MiniChartWidget.prototype.defaults=function(){return{minWidth:100,minHeight:75,bgColor:null,grid:{xIsVisible:!0,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#e9e9ea"}},xScale:{visible:!0,position:"bottom",isTimeScale:!0,paddingTop:4,paddingBottom:4,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},yScale:{visible:!0,position:"right",isPercentage:!1,paddingLeft:4,
paddingRight:4,marginInPercents:10,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},plot:{line:{width:2,color:"#ff7965"},belowLineFillStyle:"rgba(180, 180, 180, 0.2)",aboveLineFillStyle:null},loading:{lines:9,length:0,width:5,radius:8,corners:1,color:null,speed:.75}}};
TradingView.MiniChartWidget.prototype._initCanvas=function(){this._canvas=TradingView.addCanvasTo(this.$container,{w:this._options.minWidth,h:this._options.minHeight});$(this._canvas).css("display","block");this._ctx=this._canvas.getContext("2d");this._ctx._fillText=function(a,b,c){b=Math.round(b);c=Math.round(c);this._ctx.fillText(a,b,c)}.bind(this)};
TradingView.MiniChartWidget.prototype._initSizeHandling=function(){function a(){var a=e._options.drawOverPlotArea||!e._options.visible?d.height.value():d.height.value()-e.height.value();h.height.setValue(a)}function b(){var a=g._options.drawOverPlotArea||!g._options.visible?d.width.value():d.width.value()-g.width.value();h.width.setValue(a)}function c(){var a=0;"right"===g._options.position&&(a=g._options.drawOverPlotArea||!g._options.visible?h.width.value()-g.width.value():h.width.value());g.originX.setValue(a)}
var d=this,e=this._xScale,g=this._yScale,h=this._plotArea;d.height.subscribe(a);e.height.subscribe(a);h.height.subscribe(function(a){g.height.setValue(a);a=0;"bottom"===e._options.position&&(a=e._options.drawOverPlotArea||!e._options.visible?h.height.value()-e.height.value():h.height.value());e.originY.setValue(a)});d.width.subscribe(b);g.width.subscribe(b);g.width.subscribe(function(){var a=0;"left"===g._options.position&&(a=g.width.value());h.originX.setValue(a)});g.width.subscribe(c);g.width.subscribe(function(){var a=
0;"left"===g._options.position&&(a=g.width.value());e.originX.setValue(a)});h.width.subscribe(function(a){e.width.setValue(a);c()})};
TradingView.MiniChartWidget.prototype.resetSize=function(){var a=this.$container.height()||this._options.minHeight,b=this.$container.width()||this._options.minWidth;this._xScale.originX.setValue("left"===this._yScale._options.position?this._yScale.width.value():0);this._yScale.originY.setValue("top"===this._xScale._options.position?this._xScale.height.value():0);TradingView.setCanvasSize(this._canvas,{h:a,w:b});this.height.setValue(a);this.width.setValue(b)};
TradingView.MiniChartWidget.prototype.onResize=function(){this.resetSize();this.draw()};TradingView.MiniChartWidget.prototype.bindOnResize=function(){this._onResize||(this._onResize=this.onResize.bind(this));this.$container.resize(this._onResize)};TradingView.MiniChartWidget.prototype.unbindOnResize=function(){this._onResize&&(this.$container.off("resize",this._onResize),delete this._onResize)};
TradingView.MiniChartWidget.prototype.addPlot=function(a){var b=a;if(!(b instanceof TradingView.MiniChartWidgetPlot)){if(!b.data){console.error("[MiniChartWidget] wrong plot format");return}b=new TradingView.MiniChartWidgetPlot(b.data,$.extend(!0,{},this._options.plot,b.options))}if(!$.grep(this._plots,function(a){return a.id===b.id}).length)return this._plots.push(b),b.dataChanged.subscribe(this,this._onPlotsChanged),this._onPlotsChanged(),b};
TradingView.MiniChartWidget.prototype._onPlotsChanged=function(){this._yScale.onPlotsChanged();this._xScale.onPlotsChanged();this.draw()};TradingView.MiniChartWidget.prototype.removePlot=function(a){this._plots=$.grep(this._plots,function(b){return b.id!==a.id});this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};
TradingView.MiniChartWidget.prototype.removeAllPlots=function(){this._plots=[];this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};TradingView.MiniChartWidget.prototype.draw=function(){this._plotArea.draw();this._yScale.draw();this._xScale.draw()};TradingView.MiniChartWidget.prototype.showMessage=function(a){this._options.showMessage&&this._writeMessage(a)};
TradingView.MiniChartWidget.prototype.writeText=function(a){this._options.bgColor&&"transparent"!==this._options.bgColor?(this._ctx.fillStyle=this._options.bgColor,this._ctx.fillRect(0,0,this.width.value(),this.height.value())):this._ctx.clearRect(0,0,this.width.value(),this.height.value());var b=this._ctx.measureText(a).width;this._ctx.fillStyle=this._options.xScale.font.color;this._ctx.font=this._options.xScale.font.size+"px "+this._options.xScale.font.family;this._ctx._fillText(a,(this.width.value()-
b)/2,(this.height.value()-this._options.xScale.font.size)/2)};TradingView.MiniChartWidgetPlot=function(a,b){this.id=TradingView.guid();this._options=$.extend(!0,{},b);this._y=this._x=null;a&&this.setData(a,!0);this.dataChanged=new Delegate};TradingView.MiniChartWidgetPlot.prototype.setData=function(a,b){a.x&&a.y||console.error("[MiniChartWidgetPlot] wrong data format");this._x=a.x;this._y=a.y;b||this.dataChanged.fire()};TradingView.MiniChartWidgetPlot.prototype.x=function(){return this._x};
TradingView.MiniChartWidgetPlot.prototype.y=function(a){var b=this._y;if(!a)return b;var c=function(){for(var a=0,c=b.length;a<c;a++)if(isNumber(b[a]))return b[a]}()/100;return $.map(b,function(a){return isNumber(a)?a/c-100:void 0})};TradingView.MiniChartWidgetRectangle=function(a,b,c,d){this.originX=new WatchedValue(a||0);this.originY=new WatchedValue(b||0);this.width=new WatchedValue(c||0);this.height=new WatchedValue(d||0)};TradingView.MiniChartWidgetRectangle.prototype.left=function(){return this.originX.value()};
TradingView.MiniChartWidgetRectangle.prototype.right=function(){return this.originX.value()+this.width.value()};TradingView.MiniChartWidgetRectangle.prototype.top=function(){return this.originY.value()};TradingView.MiniChartWidgetRectangle.prototype.bottom=function(){return this.originY.value()+this.height.value()};
TradingView.MiniChartWidgetRectangle.prototype.clearBack=function(){var a=this._ctx,b=this.left()-.5,c=this.top()-.5,d=this.right()+.5,e=this.bottom()+.5;this._options.bgColor&&"transparent"!==this._options.bgColor?(a.fillStyle=this._options.bgColor,a.fillRect(b,c,d,e)):a.clearRect(b,c,d,e)};
TradingView.MiniChartWidgetPlotArea=function(a,b,c,d,e){TradingView.MiniChartWidgetRectangle.call(this);this.getWidgetPlots=a;this._ctx=b;this._xScale=c;this._yScale=d;this._options=e;this.originY.setValue("bottom"===this._xScale._options.position?0:this._xScale.height.value());this.originY.setValue=function(){console.warn("[MiniChartWidgetPlotArea] updating originY forbidden")}};inherit(TradingView.MiniChartWidgetPlotArea,TradingView.MiniChartWidgetRectangle);
TradingView.MiniChartWidgetPlotArea.prototype.draw=function(){this.clearBack();this._drawGrid();this.getWidgetPlots().length?(this._drawPlots(),this._hideLoading()):this._options.loading.showWhileNoPlots&&this._showLoading()};
TradingView.MiniChartWidgetPlotArea.prototype._drawGrid=function(a){a=this._ctx;var b=this.left(),c=this.right(),d=this.top(),e=this.bottom(),g,h,k,l;a.lineWidth=this._options.grid.line.width;a.strokeStyle=this._options.grid.line.color;a.lineStyle=this._options.grid.line.style;var m=this._xScale.tickMarks();if(m.length&&this._options.grid.xIsVisible)for(var n=0;n<m.length;n++)g=m[n].coordinate,h=d,k=m[n].coordinate,l=e,CanvasEx.drawLine(a,g,h,k,l);d=this._yScale.tickMarks();if(d.length&&this._options.grid.yIsVisible)for(n=
0;n<d.length;n++)g=b,h=d[n].coordinate,k=c,l=d[n].coordinate,CanvasEx.drawLine(a,g,h,k,l)};
TradingView.MiniChartWidgetPlotArea.prototype._drawPlots=function(){var a=this.getWidgetPlots(),b=this._ctx,c=this._xScale.valueToCoord.bind(this._xScale),d=this._yScale.valueToCoord.bind(this._yScale);this.left();this.right();for(var e=this.top(),g=this.bottom(),h,k,l,m=0;m<a.length;m++)h=a[m],k=$.map(h.x(),function(a){return c(a)}),l=$.map(h.y(this._yScale._options.isPercentage),function(a){return d(a)}),1===k.length?this._drawCircle(k[0],l[0],h._options.line.width,h._options.line.color):(h._options.belowLineFillStyle&&
"transparent"!==h._options.belowLineFillStyle&&this._drawNearAroundArea(b,k,l,g,h._options.belowLineFillStyle),h._options.aboveLineFillStyle&&"transparent"!==h._options.aboveLineFillStyle&&this._drawNearAroundArea(b,k,l,e,h._options.aboveLineFillStyle),this._drawLine(b,k,l,h._options.line.width,h._options.line.color))};
TradingView.MiniChartWidgetPlotArea.prototype._drawNearAroundArea=function(a,b,c,d,e){var g=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),h=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==g||null!==h){a.fillStyle=e;a.beginPath();a.moveTo(b[g],d);for(e=g;e<=h;e++)isNumber(b[e])&&isNumber(c[e])&&a.lineTo(b[e],c[e]);a.lineTo(b[h],d);a.closePath();a.fill()}};
TradingView.MiniChartWidgetPlotArea.prototype._drawLine=function(a,b,c,d,e){var g=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),h=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==g||null!==h){a.lineWidth=d;a.strokeStyle=e;a.moveTo(b[g],c[g]);a.beginPath();for(d=g;d<=h;d++)isNumber(b[d])&&isNumber(c[d])&&a.lineTo(b[d],c[d]);a.stroke()}};
TradingView.MiniChartWidgetPlotArea.prototype._drawCircle=function(a,b,c,d,e){isNumber(b)&&isNumber(c)&&(a.beginPath(),a.arc(x,y,d,0,2*Math.PI,!1),a.fillStyle=e,a.fill())};
TradingView.MiniChartWidgetPlotArea.prototype._showLoading=function(){this._$loadingIndicator||(this._$loadingIndicator=$("<div></div>"),(new Spinner({lines:this._options.loading.lines,length:this._options.loading.length,width:this._options.loading.width,radius:this._options.loading.radius,corners:this._options.loading.corners,rotate:0,direction:1,color:this._options.loading.color||this._options.grid.line.color,speed:this._options.loading.speed,trail:100,shadow:!1,hwaccel:!1,className:"spinner",zIndex:1,
top:"50%",left:"50%"})).spin(this._$loadingIndicator.get(0)),this._$loadingIndicator.insertAfter(this._ctx.canvas));this._$loadingIndicator.show()};TradingView.MiniChartWidgetPlotArea.prototype._hideLoading=function(){this._$loadingIndicator&&this._$loadingIndicator.hide()};TradingView.MiniChartWidgetAbstractScale=function(a,b,c){TradingView.MiniChartWidgetRectangle.call(this);this._ctx=b;this._options=c;this._max=this._min=null;this._tickMarks=[];this.getWidgetPlots=a};
inherit(TradingView.MiniChartWidgetAbstractScale,TradingView.MiniChartWidgetRectangle);
TradingView.MiniChartWidgetAbstractScale.prototype._calculateTickMarks=function(a,b,c){function d(a){return Math.round(1E6*a)/1E6+(k._options.isPercentage?"%":"")}function e(a){var e=d(a);a=k.valueToCoord(a);if("vertical"===c&&!r)return a;if("vertical"===c&&r)return a+.5*b(e);if("horizontal"===c&&!r)return a;if("horizontal"===c&&r)return a-.5*b(e)}function g(a){var e=d(a);a=k.valueToCoord(a);if("vertical"===c&&!r)return a-k._GREED_MARGIN-b(e);if("vertical"===c&&r)return a-.5*b(e);if("horizontal"===
c&&!r)return a+k._GREED_MARGIN+b(e);if("horizontal"===c&&r)return a+.5*b(e)}function h(a,b){return"vertical"===c?g(a)-q>e(b):g(a)+q<e(b)}var k=this,l=k._min,m=k._max;if(!a||null===l||null===m||"function"!==typeof b)return[];c=c||"vertical";var n=k._options.maxTickMarkAmount||10,q=a/(n||20),r=!k._options.drawOverPlotArea;a=[];if(l===m)a=[l];else for(;0<n;){a=(m-l)/n;var u=Math.pow(10,Math.ceil(Math.log(a)/Math.LN10));u/5>=a&&(u/=5);u/2>=a&&(u/=2);var w=Math.floor(l/u)*u;w<l&&(w=Math.ceil(l/u)*u);for(a=
[w];a[a.length-1]+u<=m;)a.push(a[a.length-1]+u);for(var u=!1,A,v=1;v<a.length;v++)if(A=a[v],h(w,A))w=A;else{u=!0;break}if(u)n--;else break}return $.map(a,function(a){return{text:d(a),coordinate:Math.round(k.valueToCoord(a))}})};TradingView.MiniChartWidgetAbstractScale.prototype.tickMarks=function(){return this._tickMarks};
TradingView.MiniChartWidgetAbstractScale.prototype.draw=function(){if(this._options.visible){var a=this._tickMarks,b=this._ctx;this._options.drawOverPlotArea||this.clearBack();if(!this._options.drawOverPlotArea&&this._options.borderColor&&"transparent"!==this._options.borderColor){b.strokeStyle=this._options.borderColor;b.lineWidth=1;b.beginPath();switch(this._options.position){case "left":b.moveTo(this.right()-.5,this.top());b.lineTo(this.right()-.5,this.bottom());break;case "right":b.moveTo(this.left()+
.5,this.top());b.lineTo(this.left()+.5,this.bottom());break;case "top":b.moveTo(this.left(),this.bottom());b.lineTo(this.right(),this.bottom());break;case "bottom":b.moveTo(this.left(),this.top()),b.lineTo(this.right(),this.top())}b.stroke()}b.fillStyle=this._options.font.color;b.font=this._options.font.size+"px "+this._options.font.family;for(var c=0;c<a.length;c++)b=a[c],this._drawLabel(b.coordinate,b.text)}};
TradingView.MiniChartWidgetXScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._series=[];this.height.setValue(this._options.paddingBottom+this._options.font.size+this._options.paddingTop);this.height.setValue=function(){console.warn("[MiniChartWidgetXScale] updating height forbidden")};this.width.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=2};inherit(TradingView.MiniChartWidgetXScale,TradingView.MiniChartWidgetAbstractScale);
TradingView.MiniChartWidgetXScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.right()-this.left())/2:this.left()+this._pixelsPerValue*(a-this._min)};TradingView.MiniChartWidgetXScale.prototype.onPlotsChanged=function(){this._updateSeries();this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetXScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks()};
TradingView.MiniChartWidgetXScale.prototype._updateSeries=function(){this._series=this.getWidgetPlots().length?this.getWidgetPlots()[0].x():[]};TradingView.MiniChartWidgetXScale.prototype._updateMinMax=function(){this._min=this._series.length?this._series[0]:null;this._max=this._series.length?this._series[this._series.length-1]:null};TradingView.MiniChartWidgetXScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=this.width.value()/(this._max-this._min)};
TradingView.MiniChartWidgetXScale.prototype._updateTickMarks=function(){var a=this.width.value(),b=function(a){return this._ctx.measureText(a).width}.bind(this);this._tickMarks=this._options.isTimeScale?this._calculateTimeTickMarks(a,b):this._calculateTickMarks(a,b,"horizontal")};
TradingView.MiniChartWidgetXScale.prototype._calculateTimeTickMarks=function(a,b){if(!a||null===this._min||null===this._max||"function"!==typeof b)return[];var c=this._max-this._min,d=c/86400,e=[],g=[],e=this._ctx;e.font=this._options.fontSize+"px "+this._options.fontFamily;e.fillStyle=this._options.fontColor;e.textBaseline="bottom";2>d?e=this._timeSplit(a,b,this._trimToHour,this._formatHour):3>d?e=this._timeSplit(a,b,this._trimToHour,this._formatDayHour):6>d?e=this._timeSplit(a,b,this._trimToDay,
this._formatDay):6>c/604800?e=this._timeSplit(a,b,this._trimToWeek,this._formatDay):15>c/2592E3?(e=(new Date(1E3*this._max)).getFullYear()===(new Date).getFullYear()?this._formatMonthOnly:this._formatMonthYear,e=this._timeSplit(a,b,this._trimToMonth,e)):(e=c/31104E3,e=6>e?this._timeSplit(a,b,this._trimToYear,this._formatYear):30>e?this._timeSplit(a,b,this._trimTo5Years,this._formatYear):50>e?this._timeSplit(a,b,this._trimTo10Years,this._formatYear):this._timeSplit(a,b,this._trimTo25Years,this._formatYear));
c=0;for(d=e.length;c<d;c++){var h=this.valueToCoord(this._series[e[c].index]);g.push({text:""+e[c].text,coordinate:h})}return g};
TradingView.MiniChartWidgetXScale.prototype._timeSplit=function(a,b,c,d){for(var e=[],g=null,h=a/20,k=0,l=this._series.length;k<l;k++){var m=c.call(this,new Date(1E3*this._series[k])),n=d.call(this,m);if(null===g)g=m;else{var q=this.valueToCoord(this._series[k]),r=0<q&&q<a;if(e.length&&r)var r=this.valueToCoord(this._series[e[e.length-1].index]),u=b(e[e.length-1].text),r=r+u+h<=q;r&&g.valueOf()!==m.valueOf()&&(e.push({index:k,text:n}),g=m)}}return e};
TradingView.MiniChartWidgetXScale.prototype._trimToHour=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())};TradingView.MiniChartWidgetXScale.prototype._trimToDay=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())};TradingView.MiniChartWidgetXScale.prototype._trimToMonth=function(a){return new Date(a.getFullYear(),a.getMonth(),1)};TradingView.MiniChartWidgetXScale.prototype._trimToYear=function(a){return new Date(a.getFullYear(),1,1)};
TradingView.MiniChartWidgetXScale.prototype._trimToWeek=function(a){a=this._trimToDay(a);return new Date(a.valueOf()-864E5*a.getDay())};TradingView.MiniChartWidgetXScale.prototype._trimTo5Years=function(a){a=a.getFullYear();return new Date(a-a%5,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo10Years=function(a){a=a.getFullYear();return new Date(a-a%10,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo25Years=function(a){a=a.getFullYear();return new Date(a-a%25,1,1)};
TradingView.MiniChartWidgetXScale.prototype._monthNames="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");TradingView.MiniChartWidgetXScale.prototype._formatHour=function(a){a=a.getHours().toString();1===a.length&&(a="0"+a);return a+":00"};TradingView.MiniChartWidgetXScale.prototype._formatDayHour=function(a){return this._formatDay(a)+" "+this._formatHour(a)};TradingView.MiniChartWidgetXScale.prototype._formatDay=function(a){return this._monthNames[a.getMonth()]+","+a.getDate()};
TradingView.MiniChartWidgetXScale.prototype._formatMonthOnly=function(a){return this._monthNames[a.getMonth()]};TradingView.MiniChartWidgetXScale.prototype._formatMonthYear=function(a){return this._monthNames[a.getMonth()]+", "+a.getFullYear()};TradingView.MiniChartWidgetXScale.prototype._formatYear=function(a){return a.getFullYear()};
TradingView.MiniChartWidgetXScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=c.measureText(b).width,d=this._options.drawOverPlotArea?a+this._GREED_MARGIN:a-d/2,d=Math.min(this.right(),d),d=Math.max(this.left(),d),e="bottom"===this._options.position?this.bottom()-this._options.paddingBottom:this.top()+this._options.paddingTop+this._options.font.size;c.textBaseline="bottom";c._fillText(b,d,e);this._options.drawTickMarkLine&&this._options.borderColor&&"transparent"!==this._options.borderColor&&
(c.strokeStyle=this._options.borderColor,c.beginPath(),"bottom"===this._options.position?(c.moveTo(a,this.top()),c.lineTo(a,this.top()+2)):(c.moveTo(a,this.bottom()),c.lineTo(a,this.bottom()-2)),c.stroke())};TradingView.MiniChartWidgetYScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._max=this._min=null;this.height.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=1};inherit(TradingView.MiniChartWidgetYScale,TradingView.MiniChartWidgetAbstractScale);
TradingView.MiniChartWidgetYScale.prototype.onPlotsChanged=function(){this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetYScale.prototype._updateMinMax=function(){for(var a=this.getWidgetPlots(),b=null,c=null,d,e,g=0;g<a.length;g++){d=MathEx.min(a[g].y(this._options.isPercentage));e=MathEx.max(a[g].y(this._options.isPercentage));if(null===b||d<b)b=d;if(null===c||c<e)c=e}this._min=b;this._max=c};
TradingView.MiniChartWidgetYScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=(this.height.value()-2*this._margin())/(this._max-this._min)};TradingView.MiniChartWidgetYScale.prototype._updateTickMarks=function(){var a=this.height.value(),b=function(){return this._options.font.size}.bind(this);this._tickMarks=this._calculateTickMarks(a,b,"vertical")};
TradingView.MiniChartWidgetYScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks();this.width.setValue(this._options.paddingLeft+this._maxLabelWidth()+this._options.paddingRight)};TradingView.MiniChartWidgetYScale.prototype._maxLabelWidth=function(){for(var a=0,b=0;b<this._tickMarks.length;b++)a=Math.max(a,this._ctx.measureText(this._tickMarks[b].text).width);return a};
TradingView.MiniChartWidgetYScale.prototype._margin=function(){return this.height.value()*this._options.marginInPercents/100};TradingView.MiniChartWidgetYScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.bottom()-this.top())/2:this.height.value()-this._margin()-this._pixelsPerValue*(a-this._min)};
TradingView.MiniChartWidgetYScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=this._options.drawOverPlotArea?a-this._GREED_MARGIN:a+this._options.font.size/2,e="left"===this._options.position?this.left()+this._options.paddingLeft:this.right()-this._options.paddingRight-this._maxLabelWidth();c.textBaseline="bottom";c._fillText(b,e,d);this._options.drawTickMarkLine&&(this._options.borderColor&&"transparent"!==this._options.borderColor&&(c.strokeStyle=this._options.borderColor),c.beginPath(),
"left"===this._options.position?(c.moveTo(this.right(),a),c.lineTo(this.right()-2,a)):(c.moveTo(this.left(),a),c.lineTo(this.left()+2,a)),c.stroke())};function RenameChartDialog(a,b,c){this.title=a||$.t("Rename Chart Layout");this.label=b||$.t("Enter a new chart layout name");this.maxlength=c||""}
RenameChartDialog.prototype.show=function(a){var b=$.Deferred(),c=A83.createDialog(this.title),d=function(){var a=c.find('input[name="name"]'),d=a.val();d?(b.resolve(d),A83.destroy(this.title)):(A83.showError($.t("Please enter chart layout name"),A83.get(this.title)),a.focus());return!1}.bind(this);c.css("width","400px");c.find(".tv-dialog-content").html('<div class="main"><form><p>'+this.label+':</p><p class="tv-dialogs-name"><input type="text" name="name" maxlength="'+this.maxlength+
'"/></p><p class="tv-dialog-right"></p></form></div>');c.find("form").submit(d);$('<a class="tv-button wide ok">'+$.t("OK")+"</a>").click(d).css({"margin-right":"5px"}).appendTo(c.find(".tv-dialog-right"));$('<a class="tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){A83.destroy(this.title)}.bind(this)).appendTo(c.find(".tv-dialog-right"));A83.positionDialog(c,{left:$(window).width()/2-c.width()/2,top:$(window).height()/2-c.height()/2});A83.applyHandlers(c);c.find('input[name="name"]').val(a).focus().select();
return b};function LoadChartDialog(){this.title=$.t("Load Chart Layout");this.options={};this.inputDelegate=new Delegate;this.matchedItems=[];this.itemsData=[];this.qs=new LoadChartDialog.QuickSearch(this.inputDelegate,this.fieldsExtractor,this.searchResult.bind(this));this.sortObj=new LoadChartDialog.SortObject(this.modifiedCompare);this.nameSort=new LoadChartDialog.SortObject(this.nameCompare);this.symbolSort=new LoadChartDialog.SortObject(this.symbolCompare);this.toolsSort=new LoadChartDialog.SortObject(this.toolsCompare);
D17.on("chart_loaded",LoadChartDialog.onChartLoaded,this)}LoadChartDialog.onChartLoaded=function(){this.itemsData&&0<this.itemsData.length&&this._refreshChartsList()};LoadChartDialog.QuickSearch=function(a,b,c){this.fieldsExtractor=b;this.callback=c;this.regExps=[];a.subscribe(this,this.onInput)};LoadChartDialog.QuickSearch.prototype.onInput=function(a){this.query=a;this.createRegexps(a);this.search()};
LoadChartDialog.QuickSearch.prototype.createRegexps=function(a){this.regExps=[];this.regExps.push(new RegExp("("+a.split("").map(function(a){return RegExpEscape(a)}).join(")(.*?)(")+")","i"))};LoadChartDialog.QuickSearch.prototype.match=function(a){for(var b=0;b<this.regExps.length;b++){var c=this.regExps[b];c.lastIndex=0;for(var d=this.fieldsExtractor(a),e=0;e<d.length;e++)if(c.test(d[e]))return!0}return!1};
LoadChartDialog.QuickSearch.prototype.search=function(){for(var a=[],b=0;b<this.items.length;b++){var c=this.items[b];this.match(c)&&a.push(c)}this.callback(a,this.regExps)};LoadChartDialog.QuickSearch.prototype.setItems=function(a){this.items=a};
LoadChartDialog.SortObject=function(a,b){this.isAscending=!1;this.sortingFunc=a;this.getPredicate=function(){return function(a,b){var e=this.sortingFunc(a,b);this.isAscending&&(e*=-1);return e}.bind(this)};this.inverse=function(){this.isAscending=!this.isAscending};this.setIsAscending=function(a){"boolean"==typeof a&&(this.isAscending=a);return this.isAscending};this.reset=function(){this.isAscending=!1}};
LoadChartDialog.prototype.fieldsExtractor=function(a){var b=LoadChartDialog.symbolWrap(a);return[a.title,b]};LoadChartDialog.prototype.saveFavorite=function(a,b){b?this.favorites[a]=b:delete this.favorites[a]};LoadChartDialog.prototype.filterFavorites=function(){var a={};this.itemsData.map(function(b){this.favorites.hasOwnProperty(b.id)&&(a[b.id]=!0)}.bind(this));this.favorites=a};LoadChartDialog.prototype.getFavorite=function(a){return this.favorites.hasOwnProperty(a)};
LoadChartDialog.prototype._appendListItem=function(a){var b=$('<div class="item">').appendTo(this.itemsList);a.active()&&b.addClass("active");var c=moment.unix(a.modified),d=$('<div class="value name first">').appendTo(b);if(W77.enabled("items_favoriting")){var e=$('<div class="icon-favorite">').appendTo(d).click(function(b){this.saveFavorite(a.id,!this.getFavorite(a.id));this.filterFavorites();this.fillList();a.favoriteAction(this.favorites);b.stopPropagation()}.bind(this));this.getFavorite(a.id)&&
e.addClass("active")}$('<span class="text">').text(a.title).appendTo(d);d=$('<div class="actions">').appendTo(b);$('<div class="icon-delete">').appendTo(d).click(function(b){var c=this,d=$.Deferred();a.deleteAction(d);d.then(function(){c.removeItem(a)});b.stopPropagation()}.bind(this));$('<div class="value modified">').text(c.format("L LT")).appendTo(b);c=""===a.symbol?"multiple charts":a.symbol+", "+a.interval;$('<div class="value symbol last">').text(c).appendTo(b);b.click(function(b){!0!==this.itemsList.executing&&
(this.itemsList.executing=!0,a.openAction(),setTimeout(function(){this.itemsList.executing=!1}.bind(this),1E3))}.bind(this))};LoadChartDialog.prototype.removeItem=function(a){a=this.itemsData.indexOf(a);-1<a&&this.itemsData.splice(a,1);this.setChartsData(this.itemsData)};LoadChartDialog.prototype.modifiedCompare=function(a,b){var c=a.modified;return moment(b.modified).diff(moment(c))};LoadChartDialog.prototype.nameCompare=function(a,b){return a.title.localeCompare(b.title)};
LoadChartDialog.symbolWrap=function(a){return""===a.symbol?"multiple charts":a.symbol+" "+a.interval};LoadChartDialog.prototype.symbolCompare=function(a,b){return LoadChartDialog.symbolWrap(a).localeCompare(LoadChartDialog.symbolWrap(b))};LoadChartDialog.prototype.toolsCompare=function(a,b){var c=a.toolsCount,d=b.toolsCount;return c<d?-1:c==d?0:1};LoadChartDialog.prototype.sortClick=function(a){this.setSort($(a.target).data("sort"),!0);this.fillList()};
LoadChartDialog.prototype.setSort=function(a,b){var c=TVSettings.getValue("loadChartDialog.sort.field")||"modified",d=TVSettings.getValue("loadChartDialog.sort.asc")||"0",e=a||c,g=b?"0"==d?"1":"0":d,h;if(!this.currentSortObj||(h=e!=c))this.currentSortObj="name"==e?this.nameSort:"symbol"==e?this.symbolSort:"tools"==e?this.toolsSort:this.sortObj,h&&TVSettings.setValue("loadChartDialog.sort.field",e);this.currentSortObj.setIsAscending("1"==g);g!=d&&TVSettings.setValue("loadChartDialog.sort.asc",g);$.each(this.header.children(".item"),
function(){$(this).data("sort");$(this)[$(this).data("sort")==e?"addClass":"removeClass"]("active")})};LoadChartDialog.prototype.sortList=function(){var a=[],b=[];this.matchedItems.map(function(c){this.favorites.hasOwnProperty(c.id)?a.push(c):b.push(c)}.bind(this));if(void 0!==this.currentSortObj){var c=this.currentSortObj.getPredicate();b.sort(c);a.sort(c)}this.matchedItems=a.concat(b)};
LoadChartDialog.prototype.fillList=function(){var a=this;this.sortList();this.itemsList.children(".item").remove();$.each(this.matchedItems,function(){a._appendListItem(this)});this.highlightOccurrences(this.qs.regExps)};LoadChartDialog.prototype.searchResult=function(a,b){this.matchedItems=a;this.fillList()};LoadChartDialog.prototype.updateChartsData=function(a){this.setChartsData(a)};LoadChartDialog.prototype.updateFavoritesData=function(a){this.favorites=a;this.itemsList&&this.inputDelegate.fire(this.input.val())};
LoadChartDialog.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData);this.inputDelegate.fire(this.input.val())};LoadChartDialog.prototype.setChartsData=function(a){this.itemsList&&(this.itemsData=a,this.qs.setItems(a),this.inputDelegate.fire(this.input.val()))};
LoadChartDialog.prototype.layoutHeader=function(){var a=$('<div class="list-header">').appendTo(this.content);$('<div class="item name first">').text($.t("Chart Layout Name")).data("sort","name").appendTo(a);$('<div class="item modified">').text($.t("Last Modified")).data("sort","modified").appendTo(a);$('<div class="item symbol last">').text($.t("Active Symbol")).data("sort","symbol").appendTo(a);return a};
LoadChartDialog.prototype.resetSort=function(){this.sortObj.reset();this.nameSort.reset();this.symbolSort.reset();this.toolsSort.reset();this.currentSortObj=this.sortObj};LoadChartDialog.prototype.resetSearchClick=function(){this.input.val("").trigger("input").focus()};
LoadChartDialog.prototype.show=function(a,b){this.options.width="654px";this.options.content='<div class="load-chart">'+(W77.enabled("new_chart_creation_available")?'<a class="button new-chart">'+$.t("NEW CHART LAYOUT")+"</a>":"")+'<div class="chart-search"><input type="text" name="q" value="" autocomplete="off" placeholder="'+$.t("Search")+'"><a class="input-reset"></a><div class="search-icon"></div></div></div>';var c=A83.createDialog(this.title,this.options);A83.positionDialog(c);
this.input=c.find(".chart-search input");this.inputReset=c.find(".chart-search .input-reset");this.content=$('<div class="list-content"></div>').appendTo(c.find(".load-chart"));this.header=this.layoutHeader();this.setSort();this.itemsListContainer=$('<div class="charts-list-container">').appendTo(this.content);this.itemsList=$('<div class="charts-list">').appendTo(this.itemsListContainer);this._scroll=new A59(this.itemsListContainer,this.itemsList,{showBottomShadow:!1});
c.find(".new-chart").click(this.openNewChart);this.header.children(".item").click($.proxy(this,"sortClick"));this.inputReset.click($.proxy(this,"resetSearchClick"));this.input.on("input propertychange",function(){this._scroll.scrollTo(0);this.inputDelegate.fire(this.input.val());""!==this.input.val()?this.inputReset.show():this.inputReset.hide()}.bind(this));var d;W77.enabled("saveload_requires_authentication")&&!is_authenticated&&(this.content.hide(),d=$('<div class="please-log-in"></div>').appendTo(c.find(".load-chart")),
$('<a href="#" class="link">You are not logged in. Please sign in.</a>').appendTo(d).click(function(a){a.preventDefault();A83.destroy(this.title);A83.showSignInDialog(null,{mode:"signin"})}.bind(this)));this.favorites=b;this.setChartsData(a);var e=this;A83.applyHandlers(c,{doNotCloseOnBgClickIfShadowbox:!0,beforeDestroy:function(){D17.on("chart_loaded",LoadChartDialog.onChartLoaded,e)}});var g=this.itemsListContainer;d&&(g=d);A83.resizeContent(c.height(),g);
A83.positionDialog(c)};LoadChartDialog.prototype.openNewChart=function(){window.open("/e/"+(is_authenticated?"new/":""),"_blank")};LoadChartDialog.prototype.highlightOccurrences=function(a){this.itemsList.children(".item").each(function(){var b=$(this).find(".value.name").find("span"),c=b.text(),c=LoadChartDialog.highlightText(c,a);b.html(c);b=$(this).find(".value.symbol");c=b.text();c=LoadChartDialog.highlightText(c,a);b.html(c)})};
LoadChartDialog.highlightText=function(a,b){a=$("<div>").text(a).html();if(0===b.length)return a;for(var c=0;c<b.length;c++){var d=b[c];d.lastIndex=0;var e="",g="";if((g=d.exec(a))&&g.length)for(var h=1;h<g.length;h++)e=h%2?e+('<span class="match">$'+h+"</span>"):e+("$"+h);if((g=a.replace(d,e))&&g!==a)return g}};function ChangeIntervalDialog(a){this._options=a||{};this._setInput();this._caption=$('<i class="interval-caption">').html("&nbsp;");this._helpTooltipTrigger=$('<i class="help-tooltip-trigger">').text("?").blueTooltip($.t("interval_dialog_description"),"bottom");this._dialogTitle=$.t("Change Interval")}
ChangeIntervalDialog.prototype._setInput=function(){this._input=$('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">');this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate();this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))};
ChangeIntervalDialog.prototype._validate=function(){var a=this._input.val();this._parsed=A69.parseIntervalValue(a);this._valid=!this._parsed.error;(this._supported=!this._parsed.error&&A69.intervalIsSupported(a))&&(!this._parsed.unit||"H"==this._parsed.unit)&&1440<this._parsed.qty*("H"==this._parsed.unit?60:1)&&(this._supported=!1)};
ChangeIntervalDialog.prototype._updateCaption=function(){var a;this._valid&&this._supported?(a=this._parsed.qty||1,a=a+" "+$.t(this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month"}[this._parsed.unit]:"minute",{count:a}),this._input.add(this._caption).removeClass("error")):(a=this._parsed.error?"&nbsp;":$.t("Not applicable"),this._input.add(this._caption).addClass("error"));this._caption.html(a)};
ChangeIntervalDialog.prototype._handleInput=function(a){13===a.which?this._submit():a.ctrlKey||a.metaKey||!a.charCode||!a.which||32>=a.which||A69.isIntervalChar(String.fromCharCode(a.charCode))||a.preventDefault()};
ChangeIntervalDialog.prototype._submit=function(){if(A83.isOpen(this._dialogTitle)){if(this._valid&&this._supported){var a=A69.sanitizeIntervalValue(this._input.val()),b=A45.interval.value();a&&b!=a&&"function"==typeof this._options.callback&&this._options.callback(a)}this._helpTooltipTrigger.trigger("mouseleave");A83.destroy(this._dialogTitle)}};
ChangeIntervalDialog.prototype._setInitialValue=function(a){a=a||this._options.initialValue;var b="",c=!1;a&&","!=a?b=A69.sanitizeIntervalValue(a)||"":(b=a=A45.interval.value(),c=!0);this._input.val(b);c&&this._input.select()};ChangeIntervalDialog.prototype.isValid=function(){return Boolean(this._valid)};
ChangeIntervalDialog.prototype.show=function(a){var b=A83.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),c=b.find(".tv-dialog-content");b.css("min-width",0);c.css("min-width",0).mousedown(function(a){this._input.is(a.target)||a.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger));A83.applyHandlers(b);A83.positionDialog(b);this._setInitialValue(a);this._validate();this._updateCaption();return b};TVXWindowEvents=function(){var a={};$(window).on("storage",function(b){if(null!==b.originalEvent.newValue){var c=b.originalEvent.key;c.startsWith("tvxwevents.")&&(c=c.substr(11),$.browser.msie&&TVXWindowEvents._emitting?TVXWindowEvents._emitting=!1:a[c]&&a[c].forEach(function(a){a.call(b.originalEvent.newValue,b.originalEvent.newValue)}))}});return{on:function(b,c){a[b]||(a[b]=[]);a[b].push(c)},off:function(b,c){if(a[b]){var d=a[b].indexOf(c);-1!==d&&(1===a[b].length?delete a[b]:a[b].splice(d,1))}},
current:function(a){return localStorage.getItem("tvxwevents."+a)},emit:function(a,c){void 0===c&&(c=+new Date);c!=localStorage.getItem("tvxwevents."+a)&&($.browser.msie&&(TVXWindowEvents._emitting=!0),localStorage.setItem("tvxwevents."+a,c))}}}();(function(a){var b=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"]];a.clean=function(a,d,e){var g=a;if(!a||!a.replace)return g;for(a=0;a<b.length;a++){var h=b[a][0],k=b[a][1];e&&e.indexOf&&-1!==e.indexOf(d?k:h)||(g=d?g.replace(new RegExp(k,"g"),h):g.replace(new RegExp(h,"g"),k))}return g};a.cleanButAmpersand=function(b,d){return a.clean(b,d,d?["&amp;"]:["&"])}})(this);function strip_tags(a){return a&&a.replace?a.replace(/(<([^>]+)>)/ig,""):a}
function encodeSpread(a){return encodeURIComponent(a)}function truncate(a,b){if(!a)return a;b=void 0===b?140:b;return a.length>b?a.substr(0,a.indexOf(" ",b))+"\u2026":a}"undefined"!=typeof module&&module&&module.exports&&(module.exports={clean:clean,cleanButAmpersand:cleanButAmpersand});$(document).ajaxSend(function(a,b,c){"POST"==c.type&&(b.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),b.setRequestHeader("sessionid",$.cookie("sessionid")))});String.prototype.format||(String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})});
"string"===typeof $.cookie("csrftoken")&&""!=$.cookie("csrftoken")?$("#update-status-li").append('<a href="#" onclick="TradingView.showChangeUserStatusDialog(); return false;">Update Status</a>'):$("#update-status-li").empty();
$(document).ready(function(){$(".tv-select").selectbox({speed:100,classHolder:"tv-select-container"});Modernizr.canvas&&Modernizr.canvastext||"undefined"!=typeof FlashCanvas||A83.showNotice("Oops, your browser can't display our charts!",{html:'It appears that your browser does not support <strong>Canvas</strong> technology, which is needed for TradingView to work.<br/>Please use one of the following browsers:<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="http://www.mozilla.com" target="_blank">Firefox</a></li><li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li><li><a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home" target="_blank">Internet Explorer 9+</a></li></ul>',classSuffix:"slim",
doNotCloseOnBgClick:!0});!W77.enabled("websocket_connection")||"WebSocket"in window||swfobject.hasFlashPlayerVersion("9.0.0")||A83.showNotice("TradingView Notice",{html:'It appears that your browser does not support <strong>WebSocket</strong> technology and does not have <strong>Adobe Flash</strong> plugin installed, one of which is essential for our portal.<br/>Please, <a href="http://get.adobe.com/flashplayer/" target="_blank">install Flash plugin</a> or consider updating to one of these modern browsers with WebSocket support:<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li></ul>',
classSuffix:"slim",doNotCloseOnBgClick:!0})});var loginStateChange=new Delegate;loginStateChange.subscribe(this,onLoginStateChange);TVXWindowEvents.on("loginStateChange",function(){var a=JSON.parse(this);user=a.user;is_authenticated=!!a.is_authenticated;loginStateChange.fire()});TradingView.trackEvent=function(a,b,c){window._UNIT_TESTS||"undefined"===typeof _gaq||(a=["_trackEvent",a,b],"undefined"!==typeof c&&a.push(c),_gaq.push(a))};
var assert=function(a,b){if(!a)throw Error("Assertion failed"+(b?": "+b:""));};function changeLoginState(a){is_authenticated=a?!0:!1;TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user}));loginStateChange.fire()}
function loginUser(a){user=$.extend({},a);changeLoginState(!0);"function"==typeof A83.onSigninSuccess&&(A83.onSigninSuccess(),A83.onSigninSuccess=void 0);A83.modalDialog&&"Log in"==A83.modalDialog.data("title")&&A83.destroy()}function signOut(){$.get("/accounts/logout/",function(){changeLoginState(!1)})}function runOrSignIn(a){is_authenticated?a():A83.showSignInDialog(a)}function runOrGoPro(a,b){user&&user.is_pro?a():A83.showGoProDialog(b)}
function following(){runOrSignIn(function(){document.location="/following/"})}function followers(){runOrSignIn(function(){document.location="/followers/"})}function handleIfNotError(a,b){a.error?console.log(a.error):b(a)}function handleIfNotErrorFunc(a){return function(b){handleIfNotError(b,a)}}
function relationChange(a,b,c){var d=$(a);runOrSignIn(function(){var a;a=void 0===d.data("type")?b:d.data("type");$.post("/social/follow-the-user/",{targetId:c,follow:a},function(b){a?(d.addClass("unfollow").removeClass("follow"),user.following++):(d.removeClass("unfollow").addClass("follow"),user.following--);d.mouseleave();d.hasClass("follow-big")||followButtonTooltip(d);$(".following_count").text(user.following);d.data("type",1-a)},"json")})}
function followButtonsHandler(a){a.on("click",".follow-big",function(){var a=$(this);a.hasClass("unfollow")?relationChange(a,0,a.data("userid")):(relationChange(a,1,a.data("userid")),a.hover())}).on("mouseenter",".follow-big",function(){$(this).hasClass("unfollow")&&$(this).text("Unfollow")}).on("mouseleave",".follow-big",function(){$(this).hasClass("unfollow")&&$(this).text("Following")})}
function bindIdeasStreamFilter(a,b){b=b||{};var c=a.find(".filter").map(function(){function a(d,g){var h=$(this),k=h.data("name");if(!0===v||v[k])d&&d.preventDefault();else{n&&A.find(".temp").remove();if(!is_authenticated&&h.hasClass("authorization-required"))return A83.showSignInDialog(null,0),!1;var q=k?l.filter("[name="+k+"]"):l,w=h.data("value");if(q&&q.val()!=w||b.forceChange)u.filter(".active").filter(k?"[data-name="+k+"]":"*").removeClass("active").find(".active-underline").remove(),
h.addClass("active"),q.val(w).change(),g||"function"!=typeof b.onChange||setTimeout(function(){b.onChange(d,q.attr("name"),w)},0);var B=h.data("hook");if(B)for(key in B)c.forEach(function(a){-1<a.inputs.indexOf(key)&&a.obj.setValue(B[key],key)});n&&0==A.find("a[data-value="+w+"]").length&&h.clone(!0).addClass("temp item").append('<span class="active-underline"></span>').appendTo(A);!b.notPreventDefault&&b.onChange&&d&&d.preventDefault();if(!n){var I=u.filter(".active[data-filter-title]:first").data("filter-title")||
r;I?u.filter(".active").each(function(){I=I.replace("%"+$(this).data("name")+"%",$(this).contents(":first").text())}):I=h.contents(":first").text();m.text(I)}e(!0)}}function e(a){"boolean"!=typeof a&&(a=k);a?(h.stop(!0,!1).fadeOut(q),g.unbind("clickoutside").removeClass("active"),k=!1):(h.stop(!0,!1).fadeIn(q),g.one("clickoutside",e).addClass("active"),k=!0)}var g=$(this),h=g.find(".dropdown"),k=!1,l=g.find("input"),m=g.find(".selected"),n=!1,q="undefined"==typeof b.speed?50:b.speed,r=g.data("filter-title");
g.find(".selected").on("click",e);h.on("click","a",a);var u=h.find("a"),w=g.parent(".filter-tabbed"),A;w.length&&(n=!0,A=w.find(".tabs"),u=u.add(A.find("a:not(.temp)")),A.on("click","a",a));var v={};g.find(".sub-group.inactive").find("a:first").each(function(a,b){v[$(b).data("name")]=!0}.bind(this));var B={setValue:function(b,c){var e=u.filter("a[data-value="+b+"]"+(1<l.length&&c?"[data-name="+c+"]":""));a.apply(e,[void 0,!0])},getActiveTitle:function(){return m.text()},disabled:function(a,b){b?$("[data-name="+
b+"]",g).closest(".sub-group").addClass("inactive"):n?w.addClass("inactive "):g.addClass("inactive ");a||(b?("object"!=typeof v&&(v={}),v[b]=!0):v=!0)},enabled:function(a){a?($("[data-name="+a+"]",g).closest(".sub-group").removeClass("inactive"),"object"==typeof v&&(v[a]=!1)):(n?w.removeClass("inactive "):g.removeClass("inactive "),v=!1)}};g.data("interface",B);return{inputs:l.map(function(a,b){return $(b).attr("name")}).get(),obj:B}}).get()}bindProfileTabsFilter=bindIdeasStreamFilter;
A18=function(a,b){function c(a,b){var c={};if(a||d.options&&d.options.defaultSymbol)c.symbol=String(a||d.options.defaultSymbol).toUpperCase();b&&(c.interval=b);var k="/e/";Object.keys(c).length&&(k+="?"+$.param(c));location.href=k}this.$element=a;this.$field=this.$element.find("input");this.$button=this.$element.find("span");this.options=b;this.$button.on("click",function(){if(!this.$field.val()){var a=(d.options||{}).defaultSymbol||(TradingView.D18("open_last_chart")?
"":this.$field.data("default-symbol"));a&&this.$field.val(String(a).toUpperCase())}this.symbolSearch.acceptTypeIn()}.bind(this));this.$element.on("keyup",function(){this.$element.toggleClass("not-empty",!!this.$field.val().length)}.bind(this));this.symbolSearch=A69.bindToInput(this.$field,$.extend((this.options||{}).symbolSearch,{callback:c,onEmptyApply:c}));var d=this};A18.prototype.updateOptions=function(a){$.extend(this.options,a)};
TradingView.SearchChartField=function(a){this.$element=a;this.$field=this.$element.find("input");this.$button=this.$element.find(".button");this.symbolSearch=A69.bindToInput(this.$field,{callback:function(a){a&&(a=a.toUpperCase(),location.href="/s/?q="+encodeSpread(a))}});this.$field.placeholder();this.$field.on("focus",function(){this.$element.addClass("active")}.bind(this)).on("blur",function(){this.$element.removeClass("active")}.bind(this)).on("keyup",function(){this.$element.toggleClass("not-empty",
!!this.$field.val().length)}.bind(this));this.$button.on("click",function(){this.symbolSearch.acceptTypeIn()}.bind(this))};TradingView.applyReadMoreToChart=function(a){var b=a.find(".desc");b.html(b.html().replace(/<br>/g," ")).ellipsis(111,!1,function(b){b=a.find(".chart-read-more-container");b.css("display","block");b.is(b.parent().children(":visible").last())&&a.css("padding-bottom","0px")})};
function chartWithCover(a){a.find(".date").each(function(){var a=$(this),c=new Date(a.text());TradingView.agoDateFormatter(a,c)});a.find(".desc").each(function(){var a=$(this);a.height(a.parent().outerHeight()-a.position().top-5)}).ellipsis()}
function deleteChart(a,b){var c=[a];A83.showConfirm($.t("Confirmation"),$.t("Are you sure you want to delete this chart?"),function(){if(W77.enabled("saveload_storage_customization"))return ChartingLibraryBackend.removeChart(a,b);$.post("/deletechart/",{uid:c},function(a){a.error||("string"===typeof b?document.location=b:"function"===typeof b?b():window.location.reload())})},null,{addClass:"delete-chart-dialog"})}
function saveChart(a,b,c,d,e){e=e||{};if(W77.enabled("saveload_storage_customization"))return ChartingLibraryBackend.saveChart(a.name,a.short_name,a.resolution,a,b.id.value(),function(a){b.id.value()||(b.id.setValue(a),b.uid.setValue(a));c()},d);$.post("/savechart/",a,function(a){"ok:"===a.substr(0,3)?(json=a.substr(3),res=JSON.parse(json),b.id.value()||(b.id.setValue(res.id),b.uid.setValue(res.uid)),"function"==typeof c&&c({uid:b.uid.value()},res.count||0)):"saved_chart_limit_reached"==a||
""==a?("function"==typeof d&&d(),e.noDefaultOnFail||A83.showGoProDialog({feature:"savedChartsLimit"})):("function"==typeof d&&d(),$("#error").html(a))})}function openSavedChart(a){W77.enabled("saveload_storage_customization")?ChartingLibraryBackend.loadChart(a):open("/e/"+a.url+"/"+(TradingView.isMobileView?"?mobile=1":""),"_blank")}
function toggleTitleOfModerationButton(a,b,c){c?(a.attr("title",b),a.addClass("apply-common-tooltip")):(a.removeAttr("title"),a.removeClass("apply-common-tooltip"))}function recommendChart(a,b){var c=b?$(b):$("#chart-recommend-button");c.toggleClass("active");$.post("/recommend/",{id:a,type:"recommend"},function(a){c.toggleClass("active",!!a.state)})}
function bullseyeChart(a,b){var c=b?$(b):$("#chart-bullseye-button");c.hasClass("disabled")||(c.toggleClass("active"),$.post("/recommend/",{id:a,type:"bullseye"},function(a){c.toggleClass("active",!!a.state)}))}
function updateSuggestedView(a,b){var c=$("#chart-"+a+"-suggested-button"),d=$("#chart-"+a+"-not-suggested-button");c.toggleClass("active",!!b);d.toggleClass("active",!b);toggleTitleOfModerationButton(c,"By "+user.username,!!b);toggleTitleOfModerationButton(d,"By "+user.username,!b);$("#chart-"+a).removeClass("not-moderated")}function suggestChart(a,b){updateSuggestedView(a,b);$.post("/recommend/",{id:a,type:"hot",state:(!!b).toString()},function(b){updateSuggestedView(a,b.state)})}
function chartTogglePublic(a,b){var c=b?$(b):$("#chart-public-button");c.toggleClass("active");$.post("/togglepublic/",{id:a},function(a){toggleTitleOfModerationButton(c,"By "+user.username,a.state);c.toggleClass("active",!!a.state)})}function chartRepostSTTW(a,b){var c=$(b);c.addClass("active");$.post("/repoststtw/",{id:a},function(a){c.toggleClass("active",!!a.state)})}
function chartToggleIOTD(a,b){function c(){d.toggleClass("active",e)}var d=b?$(b):$("#chart-iotd-button");if(!d.is(".disabled")){var e=d.hasClass("active");d.toggleClass("active",!e);$.post("/toggle-iotd/",{id:a},function(b){b.state&&updateSuggestedView(a,!0)}).done(function(a){if(a.error)return c();d.toggleClass("active",!!a.state).toggleClass("disabled",!!a.disabled)}).fail(c)}}
function trendingPeople(a){a.on("click",".column-trending-people .tabs a",function(b){var c=$(this);if(c.hasClass("active"))return!1;c.addClass("active").siblings("a").removeClass("active");a.find(".top-user-group").hide().filter("."+c.attr("href").slice(1)).show();b.preventDefault()})}
$.fn.TVTicker=function(a){function b(a){a=Math.abs(a);var b=1;!isInteger(a)&&1<a&&(a=parseFloat(a.toString().replace(/^.+\./,"0.")));0<a&&1>a&&(b=Math.pow(10,a.toString().length-2));return b}var c=$('<div class="tv-ticker">').appendTo(this.parent());$('<div class="icon up">').appendTo(c);$('<div class="icon down">').appendTo(c);a=a||{};var d=+a.step||1,e=a.min,g=a.max,h=b(d);this.each(function(){function a(c){n.trigger("tvticker-beforechange");var e=isInteger(d)?parseInt(n.val(),10):parseFloat(n.val());
isNaN(e)&&(e=0);var g=b(e),g=Math.max(h,g);n.val(c(e,g));n.change()}function c(){a(function(a,b){var c=(Math.round(a*b)+Math.round(d*b))/b;void 0!==g&&null!==g&&g<c&&(c=a);return c})}function m(){a(function(a,b){var c=(Math.round(a*b)-Math.round(d*b))/b;void 0!==e&&null!==e&&c<e&&(c=a);return c})}var n=$(this);n.next().find(".up, .down").on("mousedown",function(a){a.preventDefault();n.focus()});n.next().find(".up").click(function(){n.is(":disabled")||c()});n.next().find(".down").click(function(){n.is(":disabled")||
m()});n.keydown(function(a){n.is(":disabled")||(38==a.keyCode?n.next().find(".up").addClass("active"):40==a.keyCode&&n.next().find(".down").addClass("active"))});n.keyup(function(a){n.is(":disabled")||(38==a.keyCode?(c(),n.next().find(".up").removeClass("active")):40==a.keyCode&&(m(),n.next().find(".down").removeClass("active")))});n.mousewheel(function(a,b){0<b?n.next().find(".up").click():n.next().find(".down").click()})});return this};
function showDisconnectedMessage(){"MozWebSocket"in window&&WEB_SOCKET_WAS_CONNECTED?setTimeout("showDisconnectedMessageImpl()","15000"):showDisconnectedMessageImpl()}
function showDisconnectedMessageImpl(){TradingView.trackEvent("System","Disconnect");A83.showNotice("Connection is lost",{html:'<p class="tv-dialog-left">Connection to server was lost<br/><br/>How to fix:<ol class="tv-dialog-left"><li>Check firewall settings and make sure access to websocket ('+WEBSOCKET_HOST+" port "+WEBSOCKET_PORT+') is open. Then click Reconnect or press F5.</li><li>Your browser doesn\u2019t support <strong>WebSocket</strong> technology and does not have <strong>Adobe Flash</strong> plugin installed.<br/>Please, <a href="http://get.adobe.com/flashplayer/" target="_blank">install Flash plugin</a> or consider updating to one of these modern browsers with WebSocket support:<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">Firefox</a></li></ul></li><li>Server broke the connection. Click Reconnect or press F5.</li></ol></p><input class="tv-button xwide" type="button" value="Reconnect" onclick="A83.destroy();"/>',
doNotCloseOnBgClick:!0}).on("destroy",function(){D16.connect()})}function showCriticalErrorMessage(){TradingView.trackEvent("System","Critical Error");A83.showNotice("Critical error appeared",{html:'<input class="tv-dialog-button" type="button" value="Retry" onclick="A83.destroy();"/>',doNotCloseOnBgClick:!0}).on("destroy",function(){D16.connect()})}
function toggleUserSavedCharts(a){var b=$(a).toggleClass("active");$(".my-saved-charts").toggle();b.is(".active")?$(document).bind("click.toggleUserSavedCharts",function(b){$(b.target).is(".saved-charts-button")||toggleUserSavedCharts(a)}):$(document).unbind("click.toggleUserSavedCharts")}function makeDirectionName(){return function(a,b){var c=b(a);return"0"==c?"Neutral":"1"==c?"Long":"Short"}}function gotochart(a){location.href="/v/"+a+"/"}
$.fn.ellipsis=function(){return this.each(function(a,b,c){var d=$(this),e=d.text(),g=e,h=$(this.cloneNode(!0)).hide().css({position:"absolute",overflow:"visible",height:"auto",width:d.width()});a=a||d.height();d.after(h);for(var k=h.height()-a,l,m=0;0<k;)if(g=g.substr(0,g.length-k/2),h.text(g+"\u2026"),k=h.height()-a,l=!0,500<m++){console.warn("Error: too long text");break}d.html(h.text());l&&"function"===typeof c&&c(d);b&&e!=h.text()&&d.attr("title",e);h.remove()},arguments)};
(function(a){var b=a('<div class="blue-tooltip-icon icon" />'),c=a('<div class="blue-tooltip-text" />'),d=a('<div class="blue-tooltip blue-tooltip-hidden" />').append(b).append(c);a.fn.blueTooltip=function(e,g,h){d.parent().length||d.appendTo(document.body);return this.each(function(){var k=a(this);k.data("tooltip",e);k.off("mouseenter.tooltip").on("mouseenter.tooltip",function(){if(!Modernizr.touch){h=h||"";c.html(k.data("tooltip"));d.attr("class","blue-tooltip");d.addClass("blue-tooltip-"+g).addClass(h);
var e=(k.outerWidth()-d.outerWidth())/2,m=0,n=e+k.offset().left+d.outerWidth(),q=e+k.offset().left,r=a(window).width()-5;5>q?m=5-q:n>r&&(m=r-n);e=k.offset().left+e+m;n=0;q="";"top"===g?(n=k.offset().top-d.outerHeight()-10,q="-=10"):"bottom"==g&&(n=k.offset().top+k.outerHeight()+10,q="+=10");d.css({left:e,top:n,opacity:0});b.css({left:Math.round(d.width()/2)-m});d.stop().animate({top:q,opacity:1},200)}}).off("mouseleave.tooltip").on("mouseleave.tooltip",function(a){d.addClass("blue-tooltip-hidden").removeClass(h)})})}})(jQuery);
TradingView.Tooltip=function(){function a(){clearTimeout(h);clearTimeout(k);jQuery.contains(document.body,e[0])&&(e.css("opacity","0"),k=setTimeout(e.detach.bind(e),250))}function b(a){a=$(a);if(0===a.size())return!1;a:{var b=a.data("commonTooltipText"),d=a.attr("title");if(b)d&&(b=d,a.data("commonTooltipText",b),a.removeAttr("title"));else{if(!d){a=void 0;break a}b=d;a.data("commonTooltipText",b);a.removeAttr("title")}d={y:a.offset().top-$(window).scrollTop(),x:a.offset().left-$(window).scrollLeft(),
w:a.outerWidth(),h:a.outerHeight()};a={text:b,rect:d,vertical:a.hasClass("common-tooltip-vertical")}}a&&c(a)}function c(a){var b=jQuery.contains(document.body,e[0]);clearTimeout(h);clearTimeout(k);b?(g.text(a.text),d(a),e.css("opacity","1")):h=setTimeout(function(){e.appendTo(document.body);c(a)},500)}function d(a){var b=a.rect;e.attr("class","common-tooltip-wrapper").css({top:"auto",right:"auto",bottom:"auto",left:"auto"});Modernizr.pointerevents||e.addClass("no-pointer-events");g.css({top:"auto",
right:"auto",bottom:"auto",left:"auto"});var c=$(window).width(),d=$(window).height();((a=a.vertical)&&20>b.w||!a&&20>b.h)&&e.addClass("farther");a?(e.addClass("vertical").css({left:b.x+b.w,top:b.y-(e.outerHeight()-b.h)/2}),g.offset().left+g.outerWidth()+10>c?e.addClass("otl").css({left:"auto",right:c-b.x}):e.addClass("otr")):(e.css({bottom:d-b.y,left:b.x-(e.outerWidth()-b.w)/2}),10>g.offset().top?e.addClass("below").css({bottom:"auto",top:b.y+b.h}):e.addClass("above"),0>g.offset().left-10?g.css("left",
Math.abs(g.offset().left)+10):g.offset().left+g.outerWidth()+10>c&&g.css("left",c-(g.offset().left+g.outerWidth()+10)))}var e=$("<div />").css("opacity","0"),g=$('<div class="common-tooltip-body" />').appendTo(e),h,k;if(!Modernizr.touch)$(document).on("mouseenter",".apply-common-tooltip",function(c){function d(){e.off("mouseleave mousedown",d);a()}if("buttons"in c){if(c.buttons&1)return}else if(1==c.which)return;var e=$(this);b(e);e.on("mouseleave mousedown",d)});return{show:c,showOnElement:b,hide:a}}();
$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){$(this).attr("title")||this.offsetWidth>=this.scrollWidth||$(this).attr("title",$(this).text())})});
A17=function(a,b){this._options=b||{};var c=this;this.id=a.id;var d=this._lastId();if(!d)this._setLastId(this.id);else if(!(this.id<=d||(c=this,this.container=$(Mustache.render(TradingView.templates.globalNotification,a)).prependTo($("body")),c.container.show(),this._options.addClass&&this.container.addClass(this._options.addClass),c.container.css("top",0),this._options.notShiftBody||$("body").addClass("padding-animate").css({paddingTop:c.container.outerHeight()}),this.container.find(".global-notification-close").on("click",
function(){c.close()}),$.browser.msie)))TVXWindowEvents.on(this.KEY+"-close",this._onCloseInAnotherTab.bind(this))};A17.prototype.KEY="globalNotification";
A17.prototype._lastId=function(){var a=TVSettings.getInt(this.KEY,0,!0),b=TVSettings.getInt(this.KEY,0),c=Math.max(b,a);a!=b&&TVSettings.setValue(this.KEY,c);!c&&$.cookie("notification_id")&&(c=~~$.cookie("notification_id"),TVSettings.setValue(this.KEY,c),$.cookie("notification_id",0,{expires:-1,path:"/"}));return c};A17.prototype._setLastId=function(a){TVSettings.setValue(this.KEY,a)};
A17.prototype.close=function(a){var b=this;this.container&&(a?(this.container.remove(),this.container=null):(b.container.css("top",-1*this.container.outerHeight()+"px"),setTimeout(function(){b.container.remove();b.container=null;$(window).resize();b._options.notShiftBody||$("body").removeClass("padding-animate")},1500),TVXWindowEvents.emit(b.KEY+"-close",JSON.stringify([b.id,+new Date])),this._setLastId(b.id)),this._options.notShiftBody||$("body").css({paddingTop:0}))};
A17.prototype._onCloseInAnotherTab=function(a){a=JSON.parse(a);this.id<=a[0]&&this.close(!0)};function closeGlobalNotification(a){$.cookie("notification_id",a,{expires:365,path:"/"});$(".tv-global-notification").slideUp(400,function(){$(window).resize()})}
TradingView.RequestCache=function(a){function b(b){d||e||(e=!0,$.getJSON(a,function(a){e=!1;d=!0;c=a;"function"==typeof b&&b(a)}));c&&"function"==typeof b&&b(c);return c}if(W77.enabled("charting_library"))return b=function(a){"function"==typeof a&&a([]);return a},b.D20=function(){},b;var c,d=!1,e=!1;b.D20=function(){c=null;d=!1};return b};
W77.enabled("charting_library")?ChartingLibraryBackend?(TradingView.getStudyTemplatesList=ChartingLibraryBackend.getStudyTemplatesList,TradingView.getStudyTemplatesList.D20=ChartingLibraryBackend.clearStudyTemplatesListCache):(TradingView.getStudyTemplatesList=function(){},TradingView.getStudyTemplatesList.D20=function(){}):(TradingView.getStudyTemplatesList=new TradingView.RequestCache("/study-templates-ext/"),TradingView.getThemesList=new TradingView.RequestCache("/themes/"));
function getImage(a,b,c){function d(c){c=W77.enabled("charting_library")?(b.snapshotUrl?"":"http://www.tradingview.com/x/")+c:window.location.protocol+"//"+window.location.host+"/x/"+c+"/";k.attr({href:c});l.val(c);g.remove();h.css({visibility:"visible"});setTimeout(function(){var a=l.get(0);a.focus&&a.focus();a.select&&a.select()},0);c=ShareTwitterSnapshot.getStatus(a.activeChartWidget.value().symbolProperty().value(),c);$('<a class="twitter-share-button tv-dialog-social tv-dialog-social-twitter"></a>').attr({href:"https://twitter.com/share?count=none&text="+
encodeURIComponent(c)+"&url=%20"}).appendTo(m);$('<script src="//platform.twitter.com/widgets.js">\x3c/script>').appendTo(m)}b=b||{};A83.createModalDialog($.t("Image URL"),{addClass:"tv-dialog-min-width"});dialog=A83.modalDialog;var e=dialog.find(".tv-dialog-content"),g=$("<p><img src="+TradingView.wrapUrl('"/static/images/loading-small.gif"')+"/></p>").css({textAlign:"center",position:"absolute",width:"100%"}).appendTo(e),h=$('<div class="main">').css({visibility:"hidden"}).appendTo(e),
k=$("<a>").text($.t("Save image")).attr({target:"_blank"}).css("text-decoration","underline"),l=$("<input>").attr({type:"text",readonly:!0}).bind("click focus",function(){this.select&&this.select()});$("<p>").appendTo(h).append(k," "+$.t("or copy url:"));$("<p>").appendTo(h).append($("<form>").append(l));var m=$('<p class="tv-dialog-socials">').appendTo(h);A83.positionDialog();A83.applyHandlers();TradingView.trackEvent("GUI","Get image button");takeSnapshot(a,function(a){c&&c(a);d(a)},
function(){dialog.find(".tv-dialog-error").text("URL cannot be recieved.").show()},{snapshotUrl:b.snapshotUrl});return!1}function getImageSilently(a,b,c){takeSnapshot(a,function(a){c&&c(a)},function(){console.warn("Error while trying to create snapshot.")},{snapshotUrl:b.snapshotUrl});return!1}
function onLoginStateChange(a){$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan).toggleClass("is-not-trial",!(is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan)).toggleClass("is-mobile",!!TradingView.isMobileView);TVSettings.sync(user.settings);
if(is_authenticated){a||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(userBadge(user,!0,"strong")));$(".user-info-username").html(user.username);$(".following_count").html(user.following);$(".followers_count").html(user.followers);$(".saved_charts_count").html(user.saved_charts);$(".published_charts_count").html(user.published_charts);$(".treated_charts_count").html(user.treated_charts_count);$("img.user-picture, .user-picture img").attr("src",user.userpic);
$(".trial-days-left").html(user.trial_days_left||"");$(".header-item-profile").find("a").each(function(a,b){b=$(b);var e=b.attr("rel");e&&b.attr("href",e.replace("%u",user.username))});if("undefined"!==typeof carouselModels)for(var b in carouselModels)carouselModels[b].reload();user.fastpass_script&&eval(user.fastpass_script);user.is_first_login&&(TradingView.trackEvent("Conversion","First login"),user.prort_trial_started&&(A83.showTrialMessageSuccess(),delete user.prort_trial_started),delete user.is_first_login);
setTrialAvailiable(user.trial_availiable)}else user={username:"Guest",following:"0",followers:"0",ignore_list:{}},$(".user-info-username").html(user.username),window.localStorage&&localStorage.removeItem("trial_availiable");window.studyTemplates&&(studyTemplates.refreshStudyTemplateList(),studyTemplates.refreshFavoriteDropdownMenu())}
function markNewsAsRead(){$(".user-picture .notifications-counter").hide().addClass("hide");$(".notifications-counter.counter").removeClass("new").text("0");TVXWindowEvents.emit("zero-notification-counter")}function followButtonTooltip(a){var b=a.hasClass("unfollow")?"Unfollow":"Follow";a.attr("title",b)}function followButtonToolipAll(){$(".follow-link").each(function(a,b){b=$(b);b.data("tv_tooltip")||followButtonTooltip(b)})}
function getSavedChartsList(a){return W77.enabled("charting_library")?ChartingLibraryBackend.getCharts(a):$.getJSON("/my-charts/",a)}function isOnChartEditPage(){return"/e/"==location.pathname.substr(0,3)}
function refreshChartMenuState(){function a(){d.hide();c.show()}function b(b){b={charts:b};if(b.charts&&b.charts.length){e.empty();e.append(Mustache.render(TradingView.templates.lists.savedCharts,b));var c=new A59(e,e.find("ul").eq(0),{additionalClass:"gray",alwaysVisible:!0});e.parent().one("hover",function(){c.updateScrollBar()});e.find("li").each(function(b,c){c=$(c);var d=c.find(".name").text();20<d.length&&c.attr("title",d);$("span.icon",c).click(function(b){var c=
$(this).data("id");e.mouseleave();deleteChart(c,function(){user.saved_charts--;var c=$(b.target).parent().attr("href");$(b.target).parent().parent().remove();user.saved_charts||a();!isOnChartEditPage()||user.saved_charts&&"/e/"+D3.metaInfo().uid+"/"!=c||(location.href="/e/")});return!1})})}else a()}var c=$(".header-button.header-item-chart"),d=$(".header-menu.header-item-chart"),e=d.find(".popup-subblock");d.length&&e.length&&(d.on("closeMenu",function(){e.empty()}),d.on("openMenu",function(){getSavedChartsList(b)}),
is_authenticated&&user.saved_charts?(c.hide(),d.show()):a())}
function urlize(a){var b,c=[],d=0,e="";if(e=a.match(/(https:\/\/|http:\/\/)(www.tradingview.com|beta\d?.tradingview.com|webcharts\d?|localhost\:6285)\/(x|i)\/[0-9a-z]{8}\//gi))for(b=0;b<e.length;b++)a=a.replace(e[b],"<"+d++ +">"),c.push('<div class="ch-item-snapshot-link"><i class="icon icon-snapshot-small" title="Chart Snapshot"></i> <a href="'+e[b]+'" target="_blank">Chart Snapshot</a></div><a target="_blank" href="'+e[b]+'" class="ch-item-snapshot-preview"><img src="'+e[b]+'" alt="" class="snapshot-preview"/></a>');
var g=a.match(/(https:\/\/|http:\/\/)(www.tradingview.com|beta\d?.tradingview.com|webcharts\d?|localhost\:6285)\/v\/[0-9a-z]{8}\//gi);if(g)for(b=0;b<g.length;b++)a=a.replace(g[b],"<"+d++ +">"),e=g[b].match(/\/v\/([0-9a-z]{8})\//i)[1],c.push('<div class="ch-item-chart-link"><i class="icon icon-snapshot-small" title="Published Idea"></i> <a href="'+g[b]+'" target="_blank" data-id="'+e+'">Published Idea</a></div><a target="_blank" href="'+g[b]+'" class="ch-item-chart-preview" data-id="'+e+'"><img src="'+
g[b].replace("/v/","/i/")+'" alt="" class="idea-preview"/></a>');if(e=a.match(/(http:\/\/|http:\/\/www\.|https:\/\/www\.|https:\/\/)[^ <\n]{2,200}/g))for(b=0;b<e.length;b++)g=0===e[b].indexOf("http://")||0===e[b].indexOf("https://")?"":"http://",a=a.replace(e[b],"<"+d++ +">"),c.push("<a target='_blank' href='"+g+e[b]+"'>"+e[b]+"</a>");if(e=a.match(/(\$)[a-z][a-z0-9\._\-]{2,20}/gi))for(b=0;b<e.length;b++)a=a.replace(new RegExp("\\"+e[b],"gi"),"<"+d++ +">"),c.push("<a target='_blank' href='/s/?q="+
e[b].substr(1)+"'>"+e[b]+"</a>");if(e=a.match(/\@[a-z0-9\._\-\u00A0]{2,50}/gi))for(b=0;b<e.length;b++)a=a.replace(new RegExp(e[b],"gi"),"<"+d++ +">"),c.push("<a target='_blank' href='/u/"+e[b].substr(1).replace("\u00a0"," ")+"/'>"+e[b]+"</a>");0<c.length&&(a=a.replace(/<(\d+)>/g,function(a,b){return c[b]?c[b]:""}));return a}
(function(a){jQuery.fn.putCursorAtEnd=function(){return this.each(function(){a(this).focus();if(this.setSelectionRange){var b=2*a(this).val().length;this.setSelectionRange(b,b)}else a(this).val(a(this).val());this.scrollTop=999999})}})(jQuery);
function ShareTwitterSnapshot(a){function b(a,b){return"https://twitter.com/intent/tweet?&status="+encodeURIComponent(ShareTwitterSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{JsBridge.sendEvent("sharing_error")}catch(a){}};else{var c=open("about:blank","snapshot_tweet","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+
Math.round(screen.width/2-275)+",top="+Math.round(screen.height/2-210));this.onSuccess=function(d){c.location.href=b(a,d)};this.onFailure=function(){c.close()}}}ShareTwitterSnapshot.getStatus=function(a,b){return TradingView.isCmeWidget?b+" from cmegroup.com via @tradingview $"+a:"$"+a+" chart "+b+" via http://www.tradingview.com"};
function ShareStocktwitsSnapshot(a){function b(a,b){return"https://stocktwits.com/widgets/share?body="+encodeURIComponent(ShareStocktwitsSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{JsBridge.sendEvent("sharing_error")}catch(a){}};else{var c=open("about:blank","snapshot_tweet","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+
Math.round(screen.width/2-275)+",top="+Math.round(screen.height/2-210));this.onSuccess=function(d){c.location.href=b(a,d)};this.onFailure=function(){c.close()}}}ShareStocktwitsSnapshot.getStatus=function(a,b){return"$"+a+" chart "+b+" via http://www.tradingview.com"};
function authInStocktwits(a){runOrSignIn(function(){user.has_stocktwits?"function"===typeof a&&a():("function"===typeof a&&(user.on_stocktwits_auth_success=function(){a.apply(this,Array.prototype.slice.call(arguments));this.user.on_stocktwits_auth_success&&delete this.user.on_stocktwits_auth_success}.bind(window)),window.open("https://api.stocktwits.com/api/2/oauth/authorize?client_id="+stocktwits_consumer_key+"&response_type=code&redirect_uri="+location.protocol+"//"+location.host+"/accounts/return/stocktwits/&scope=publish_messages",
"stocktwits_permission_request","scrollbars=yes,height=400,width=700").focus())})}TradingView.agoDateFormatter=function(a,b,c){c||(c=TradingView.agoDateFormatter.fullFormat);var d=c(new Date-b),e=d.text,d=d.timeout;a.attr("title",b.toLocaleString()).text(e);e=null;d&&(a.attr("data-ago-date-timer")&&clearTimeout(+a.attr("data-ago-date-timer")),e=setTimeout(function(){TradingView.agoDateFormatter(a,b,c)},d));a.attr("data-ago-date-timer",e)};TradingView.agoDateFormatter.destroy=function(a){$(a).find("*").andSelf().filter("[data-ago-date-timer]").each(function(){clearTimeout(+$(this).attr("data-ago-date-timer"))})};
TradingView.agoDateFormatter.nextMinuteThrough=function(a){return 6E4-a%6E4};TradingView.agoDateFormatter.nextHourThrough=function(a){return 36E5-a%36E5};TradingView.agoDateFormatter.nextDayThrough=function(a){return 864E5-a%864E5};
TradingView.agoDateFormatter.fullFormat=function(a){var b=Math.floor(a/6E4),c="",d=!1;60>b?(c=1>b?"less than a minute":b+" minute"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextMinuteThrough(a)):1440>b?(b=Math.floor(b/60),c=b+" hour"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextHourThrough(a)):43200>b?(b=Math.floor(b/1440),c=b+" day"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextDayThrough(a)):15768E3>b?(b=Math.floor(b/43200),c=b+" month"+(1<b?"s":"")):(b=Math.floor(b/15768E3),c=b+" year"+
(1<b?"s":""));d&&(d+=200);return{text:c+" ago",timeout:d}};TradingView.agoDateFormatter.shortFormat=function(a){var b=Math.floor(a/6E4),c="",d=!1;60>b?(c=(1>b?0:b)+"m",d=TradingView.agoDateFormatter.nextMinuteThrough(a)):1440>b?(b=Math.floor(b/60),c=b+"h",d=TradingView.agoDateFormatter.nextHourThrough(a)):43200>b?(b=Math.floor(b/1440),c=b+"d",d=TradingView.agoDateFormatter.nextDayThrough(a)):15768E3>b?(b=Math.floor(b/43200),c=b+"mn"):(b=Math.floor(b/15768E3),c=b+"y");d&&(d+=200);return{text:c,timeout:d}};
function userlink(a,b){return Mustache.render(TradingView.templates.userlink,{username:a,is_pro:function(){return!!b},is_realtime:function(){return"pro_realtime"==b},is_premium:function(){return"pro_premium"==b},is_trial:function(){return"pro_realtime_trial"==b}},TradingView.templates)}function proBadge(a,b){return void 0===a||a?Mustache.render(TradingView.templates.proBadge,{is_realtime:"pro_realtime"==a,is_premium:"pro_premium"==a,is_trial:"pro_realtime_trial"==a,large_badge:!!b}):""}
function userBadge(a,b,c){var d="",e="";if(a.top_user_info){d=a.top_user_info.badge?a.top_user_info.badge.title:"";e=a.top_user_info.badge?a.top_user_info.badge["class"]:"";if(a.is_pro)switch(d+=" | ",a.pro_plan){case "pro_realtime_trial":d+="Pro Trial";break;case "pro_premium":d+="Premium";break;case "pro_realtime_trial":d+="Pro Plus";break;default:d+="Pro"}a.is_moderator&&(d+=" | Moderator")}return Mustache.render(TradingView.templates.userBadge,{is_moderator:a.is_moderator,is_pro:a.is_pro,is_realtime:"pro_realtime"==
a.pro_plan,is_premium:"pro_premium"==a.pro_plan,is_trial:"pro_realtime_trial"==a.pro_plan,is_top:!!a.top_user_info,badge_class:e,badge_title:d,large_badge:!!b,badge_tag:c},TradingView.templates)}
TradingView.Common={publishChartWidget:function(a){runOrSignIn(function(){saver.publishChart(a)})},publishChart:function(a){runOrSignIn(function(){A83.showPublishIntroDialog().done(function(){saver.publishChart(a)})})},createTrendingSymbols:function(){function a(a){function h(a,b){e[b]=a;quoteSessionMultiplexerInstance.simple.subscribe("trending_symbols_retry",[a],function(a){a.symbolname=b;k(a)})}function k(a){c[a.symbolname]||(c[a.symbolname]={});$.extend(c[a.symbolname],a.values);var b=c[a.symbolname],
d=$("#trending-symbols-item-"+TradingView.symbol2id(a.symbolname)+" .change");a=$("#trending-symbols-item-"+TradingView.symbol2id(a.symbolname)+" .last");var e=new PriceFormatter(b.pricescale||100,b.minmov||1,b.fractional,b.minmove2);a.text(e.format(b.last_price||""));0<b.change_percent?d.removeClass("minus").addClass("plus").text("+"+b.change_percent+"%"):0>b.change_percent?d.removeClass("plus").addClass("minus").text(b.change_percent+"%"):0==b.change_percent&&d.removeClass("plus minus").text(b.change_percent+
"%")}var l=d.splice(0,d.length);a.forEach(function(a){var c=$("#trending-symbols-item-"+TradingView.symbol2id(a.name));c.length?(c.attr("title",a.sessions+" watching "+a.short_name),c.find(".sessions-count").text(a.sessions)):c=$('<a class="trending-symbols-item clearfix" id="trending-symbols-item-'+TradingView.symbol2id(a.name)+'" title="'+a.sessions+" watching "+a.short_name+'" href="/chart/'+a.short_name+"/"+(a.full_name_required?"?exg="+a.exchange:"")+'" target="_blank"><div class="sessions"><span class="sessions-count">'+
a.sessions+'</span> <span class="icon icon-people-watching"></span></div><div class="symbol">'+a.short_name+'</div><div class="last"></div><div class="change"></div></a>').data("symbol",a.name);c.appendTo(b);d.push(a.name)});b.find(".trending-symbols-item").each(function(){-1==d.indexOf($(this).data("symbol"))&&$(this).remove()});a=[];for(var m=0;m<d.length;m++){var n=d[m],q=l.indexOf(n);-1===q?a.push(n):l.splice(q,1)}for(m=0;m<l.length;m++)n=l[m],quoteSessionMultiplexerInstance.simple.unsubscribe("trending_symbols",
n),e[n]&&(quoteSessionMultiplexerInstance.simple.unsubscribe("trending_symbols_retry",e[n]),delete e[n]);a.length&&quoteSessionMultiplexerInstance.simple.subscribe("trending_symbols",a,function(a){"permission_denied"==a.status?h(a.values.alternative,a.symbolname):k(a)});l=a=null}var b=$(".trending-symbols-table"),c={},d=[],e={};a(initialData.trendingSymbols);setInterval(function(){$.getJSON("/index/popular/",function(b){a(b)})},3E4)}};
TradingView.symbol2id=function(a){return a.replace(/[^a-z0-9]/gi,"_")};TradingView.tokenInitialized=$.Deferred();TradingView.tokenExpiration=6E5;
TradingView.registerAuthToken=function(a){var b=this.tokenInitialized,c=new Date(1E3*user.auth_token_timestamp),d=new Date;loginStateChange.subscribe(TradingView,function(e){e&&user?user.auth_token&&(d-c<this.tokenExpiration?(a.setAuthToken(user.auth_token),b.resolve()):this.requestAndSetAuthToken(a).done(function(){b.resolve();console.info("Token expired and recreated.")})):this.isProRealtime()&&this.requestAndSetAuthToken(a).done(function(){b.resolve()})}.bind(this));setTimeout(b.resolve.bind(b),
5E3)};TradingView.requestAndSetAuthToken=function(a,b){var c=$.Deferred();this.requestAuthToken().done(function(d){a.setAuthToken(d,b);c.resolve()});return c};TradingView.requestAuthToken=function(){function a(){d=$.post("/quote_token/",null,"json").done(function(a){b.resolve(a)}).fail(function(){if(!b.isRejected()&&!b.isResolved()){var d=Math.min(1E3*c,3E4);c++;setTimeout(a,d)}})}var b=$.Deferred(),c=0,d;a();b.always(function(){d&&d.abort()});return b};
TradingView.isPro=function(){return is_authenticated&&user.is_pro};TradingView.isProRealtime=function(){return this.isPro()&&("pro_realtime"==user.pro_plan||"pro_realtime_trial"==user.pro_plan)};function updateChartActiveLabel(a,b){null==a&&(a=$(".chart-activity-label"));a=$(a);a.each(function(){var a=$(this),d;null==b?d=a.hasClass("chart-activity-label-active"):(d=b,a.toggleClass("chart-activity-label-active",d));a.find(".chart-activity-label-plate").text(d?"Active":"Closed")})}
TradingView.centerBlock=function(a){var b=$(window),c=a.width(),d=a.height(),e=b.width(),b=b.height();a.css({left:Math.round((e-c)/2)+"px",top:Math.round((b-d)/2)+"px"})};
TradingView.visitPaymentPageSwreg=function(a,b){if(!a.product_ids.hasOwnProperty(b))throw new TypeError("Unknown product");runOrSignIn(function(){if(!(b in{pro:1,pro_yearly:1,pro_realtime:1,pro_realtime_yearly:1}&&user.is_pro&&user.pro_plan==b)){var c={s:a.shop_id,q:1,d:0,v:0,bb:1,clr:1,clro:1,a:user.id,fn:user.first_name,sn:user.last_name,em:user.email,p:a.product_ids[b]},d=Object.keys(c).map(function(a){return encodeURIComponent(a)+"="+encodeURIComponent(c[a])});location.href=a.shop_url.replace(/(\?.*|$)/,
"?"+d.join("&"))}},!0)};
TradingView.visitPaymentPage=function(a,b,c){b=b||"y";c=c||{};var d="/order/";"bitcoin"==c.paymentMethod&&(d="/coinbase/begin/");runOrSignIn(function(){$('<form action="'+d+'" method="post"'+(c.newWindow?' target="_blank"':"")+'><input type="hidden" name="product" value="'+a+'"/><input type="hidden" name="billing_cycle" value="'+b+'"/><input type="hidden" name="fixed_billing_cycle" value="'+(c.fixedCycle?"true":"")+'"/><input type="hidden" name="exchanges_only" value="'+(c.exchangesOnly?"true":"")+
'"/></form>').appendTo(document.body).submit()},!0)};function hash(a){var b=0;if(0==a.length)return b;for(i=0;i<a.length;i++)code=a.charCodeAt(i),b=(b<<5)-b+code,b&=b;return b}function uniq(a){return a.reduce(function(a,c,d){return~a.indexOf(c)?null:a.push(c),a},[])}function bindLate(a,b){return function(){return a[b].apply(a,arguments)}}function debounce(a,b){var c;return function(){clearTimeout(c);c=setTimeout(a.bind.apply(a,[this].concat(Array.prototype.slice.call(arguments))),b)}}
function isLatin(a){return!/[^\u0000-\u00FF\u00A0\u2013-\u2122\u2200-\u23FF]/g.test(a)}function isASCII(a,b){return(b?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(a)}function RegExpEscape(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}
function loadMorePeople(a,b,c){var d=b.$loading||$(),e=b.$button||$(),g=b.$container;d.show();e.hide();var h=c?0:g.children().length;a.data||(a.data={});a.data=$.extend({},a.data,{offset:h});$.ajax(a).done(function(a){var d=a.total,h=a.items;c&&(g.data("loaded",!1),g.empty());0<h.length?h.forEach(function(a){a.follow_button=!is_authenticated||user.id!=a.id;a.links=a.profile.location||a.profile.twitter_username||a.profile.website;a.badge=userBadge(a,!0);a.reputation_delta&&(a.reputation_delta=Math.round(a.reputation_delta));
$(Mustache.render(k,a)).appendTo(g)}):c&&b.empty&&g.append($('<div class="empty"></div>').text(b.empty));g.children().length<d&&e.show();a.thats_all&&g.data("loaded",!0)}).always(function(){d.hide()});var k="<div class='item follow-list-item'>\t<a href='/u/{{ username }}/'><img src='{{ mid_picture_url}}'></a>\t<div class='indent'>\t<div class='description'>\t\t<div class='user-stats'>\t\t\t<span class='user-stats-followers' title='Followers'><a href='/u/{{ username }}/#followers'>{{ followers_count }}</a></span>\t\t\t<span class='user-stats-charts' title='Charts'><a href='/u/{{ username }}/#charts'>{{ charts_count }}</a></span>\t\t\t<span class='user-stats-reputation' title='Reputation'>{{ reputation }}{{# reputation_delta }} (+{{reputation_delta}}){{/ reputation_delta }}</span>\t\t</div>\t\t<div class='username'><a href='/u/{{ username }}/' class='userlink'>{{ username }}</a>{{& badge }}</div>\t\t{{# links }}\t\t<div class='links'>\t\t\t{{# profile.location }}<span class='contact location'>{{ profile.location }}</span>{{/ profile.location }}\t\t\t{{# profile.twitter_username }}<span class='contact twitter'><a href='//twitter.com/{{ profile.twitter_username }}' target='_blank'>{{ profile.twitter_username }}</a></span>{{/ profile.twitter_username }}\t\t\t{{# profile.website }}<span class='contact webpage'><a href='{{ profile.website }}' target='_blank'>{{ profile.website }}</a></span>{{/ profile.website }}\t\t</div>\t\t{{/ links }}\t\t{{# profile.about }}\t\t<div class='about'>{{ profile.about }}</div>\t\t{{/ profile.about }}\t\t{{# follow_button }}\t</div>\t\t<div class='action-buttons'>\t\t\t<button class='follow-user follow-user-{{ id }}{{# follow_status }} active{{/ follow_status }}' title='{{#follow_status}}Unfollow{{/follow_status}}{{^follow_status}}Follow{{/follow_status}}' data-id='{{ id }}'>\t\t\t\t<span class='follow'>Follow</span>\t\t\t\t<span class='following'>Followed</span>\t\t\t\t<span class='unfollow'>Unfollow</span>\t\t\t</button> \t\t\t<button class='message-user message active' title='Send message' data-id='{{ id }}' data-username='{{ username }}'><span class='message'>Message</span></button>\t\t</div>\t\t{{/ follow_button }}\t</div></div>"}
function follow(a){runOrSignIn(function(){var b=$(a.currentTarget),c=b.data("id");if(!b.is(".self")){var d=b.is(".active")?0:1;$.ajax({url:"/social/follow-the-user/",type:"POST",data:{targetId:c,follow:d}}).done(function(){$(".follow-user-"+c).toggleClass("active").attr("title",d?"Unfollow":"Follow")})}})}$("body").on("click","button.follow-user",follow);
TradingView.keyboardBinder=function(){function a(a){c.forEach(function(b,g){b.name===a&&c.splice(g,1)})}function b(a){for(var b=0;b<c.length;b++)if(c[b].name===a)return b}var c=[];$(window).on("keypress",function(a){for(var b=c.length-1;0<=b&&!0!==c[b].func(a);b--);});return{registerListener:function(a,e){var g={name:a,func:e},h=b(g.name);h?c[h]=g:c.push(g)},removeListener:function(b){a(b)},pushBackListener:function(a,e){var g={name:a,func:e},h=b(g.name);h&&c.splice(h,1);c.unshift(g)}}}();
function chartRelationButtons(a){var b=a.closest("[data-chart-id]").data("chart-id");if(!b)throw Error("chartRelationButtons can`t find data-chart-id attribute");a.on("click",".agree",function(a){function d(){e.toggleClass("active",g)}a.preventDefault();var e=$(this),g=e.hasClass("active");runOrSignIn(function(){e.toggleClass("active",!g);$.post("/vote-for-chart/",{id:b,vote:1}).done(function(a){if(a.error)return A83.showNotice("Error",a.error),d();void 0!==a.result_score&&e.text(a.result_score||
"").toggleClass("with-counter",0!==a.result_score)}).fail(d)})});a.on("click",".fav",function(a){function d(){e.toggleClass("active",g)}a.preventDefault();var e=$(this),g=e.hasClass("active");runOrSignIn(function(){e.toggleClass("active",!g);$.post(g?"/remove-from-favorites/":"/add-to-favorites/",{id:b}).done(function(a){if(a.error)return d();void 0!==a.followers&&e.text(a.followers||"").toggleClass("with-counter",0!==a.followers)}).fail(d)})})}
function makeTextContainerEditable(a,b,c){function d(b){a.removeClass("tv-editable-active").on("click",function(){g(c)}).off("mousedownoutside");b&&a.empty().text(b)}function e(b){a.addClass("tv-editable-active").off("click").on("mousedownoutside",function(){d(b)})}function g(c){var g={okButtonText:$.t("OK"),okButtonClass:"tv-button ok",cancelButtonText:$.t("Cancel"),cancelButtonClass:"tv-button cancel"};c=$.extend({},g,c);var l=a.text(),g=Modernizr.touch?"":l,m="textarea"===c.replaceWith?$("<textarea"+
(c.inputClass?'class="'+c.inputClass+'" ':"")+"></textarea>"):$('<input type="text" '+(c.inputClass?'class="'+c.inputClass+'" ':"")+'value="">');m.val(g);var g=$('<div class="buttons"></div>'),n=$('<div class="'+c.okButtonClass+'">'+c.okButtonText+"</div>").appendTo(g),q=$('<div class="'+c.cancelButtonClass+'">'+c.cancelButtonText+"</div>").appendTo(g);e(l);var r="function"===typeof c.onCancel?function(){c.onCancel();d()}:function(){d(l)},u=function(a,c,e){/^\s+$/.test(c)&&(c="");m.attr("disabled",
"disabled");n.addClass("process");b(a,c,e,function(){d()})};n.click(function(b){b.preventDefault();b.stopPropagation();u(a,m.val(),l)});q.click(function(a){a.preventDefault();a.stopPropagation();r()});m.keyup(function(b){b.preventDefault();b.stopPropagation();13!=b.keyCode||b.shiftKey?27==b.keyCode&&r():u(a,m.val(),l)});a.empty().append(m,g);m.select()}!a instanceof $?console.error("$container should be jQuery object"):b?"function"!=typeof b?console.error("onOk should be function"):(a.addClass("tv-editable"),
d()):console.error("onOk required")}
function changeUserProfileField(a){function b(a){var b=Array.prototype.slice.call(arguments);b.shift();"function"===typeof a&&a.apply(this,b)}if(a&&a.name&&"undefined"!=typeof a.value){var c={};c[a.name]=a.value;$.post("/accounts/change_data_json/",c,function(c){!c.errors||$.isEmptyObject(c.errors)?(c=c[a.name],user[a.name]=c,b(a.onSuccess,c)):b(a.onError,c.errors[a.name])}).error(function(c){403===c.status?b(a.onError,"Please, try to reoload page to edit user data"):b(a.onError,A13.isProd()?
"Sorry, an error has occurred":c.responseText)}).always(function(){b(a.onComplete)})}else console.warn("Required options.name and options.value")}
TradingView.inputOnTyping=function(a,b,c){function d(){var a=$(this),d=a.val(),e=b(d);a.removeClass("tv-dialog-text-input-error");"function"===typeof c&&c(d);d!==e&&a.val(e)}function e(a){if(a.ctrlKey||a.metaKey||!a.charCode)return!1;a=a.keyCode||a.which;return 9==a||13==a||16==a||17==a||18==a||19==a||20==a||27==a||33<=a&&40>=a?!1:!0}a instanceof $?("function"!==typeof b&&(b=function(a){return a}),a.each(function(a,b){var c=$(b);c.on("keypress",function(a){if(e(a)){var b=function(){d.call(this);$(this).off("keyup",
b)}.bind(this);$(this).on("keyup",b)}});c.change(d)})):console.warn("'$inputs' should be instance of jQuery")};
TradingView.makeInputNumberOnly=function(a,b){b=b||{};var c=b.integerOnly,d=b.positiveOnly;TradingView.inputOnTyping(a,function(a){a=a.replace(/\,/g,".").replace(/[^0-9\.-]/g,"").replace(/^-/,d?"":"__minus__").replace(/\./,"__point__").replace(/^__point__/,"0__point__").replace(/[\.-]/g,"").replace("__minus__","-").replace("__point__",".").replace(/^0+/,"0");c&&/\d+/.test(a)&&(a=parseInt(a),isInteger(b.minValue)&&(a=Math.max(b.minValue,a)),isInteger(b.maxValue)&&(a=Math.min(b.maxValue,a)));!c&&/^0\d/.test(a)&&
(a=a.toString(),a=a.substring(0,1)+"."+a.substring(1,a.length));return a},b.inputOnTypingCallback)};TradingView.makeInputDateOnly=function(a,b){b=b||{};TradingView.inputOnTyping(a,function(a){if(4==a.length||7==a.length)a+="-";return a=a.substr(0,10)},b.inputOnTypingCallback)};TradingView.makeInputTimeOnly=function(a,b){b=b||{};TradingView.inputOnTyping(a,function(a){2==a.length&&(a+=":");return a=a.substr(0,5)},b.inputOnTypingCallback)};
TradingView.timezoneIsAvailable=function(a){for(var b=0;b<TradingView.availableTimezones.length;b++)if(a===TradingView.availableTimezones[b].id)return!0;return!1};TradingView.showChangeUserStatusDialog=function(){runOrSignIn(function(){A83.showChangeUserStatusDialog()});return!1};
TradingView.getUrlParams=function(){for(var a,b=/\+/g,c=/([^&=]+)=?([^&]*)/g,d=window.location.search.substring(1),e={};a=c.exec(d);)e[decodeURIComponent(a[1].replace(b," "))]=decodeURIComponent(a[2].replace(b," "));return e};TradingView.createUrlParams=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&null!=a[c]&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};function setTrialAvailiable(a){window.localStorage&&(window.localStorage.trial_availiable=a?1:0)}
function translatedIntervalString(a){var b=(""+a).match(/(.*)([DWM])/);return b?b[1]+$.t(b[2],{context:"dates"}):a}function capitalizeFirstLetter(a){return a.charAt(0).toUpperCase()+a.slice(1)}function generateColor(a,b){if(0<=b&&100>=b){var c=parseInt(a.substr(1,2),16),d=parseInt(a.substr(3,2),16),e=parseInt(a.substr(5,2),16);return"rgba("+c+", "+d+", "+e+", "+(1-b/100).toFixed(2)+")"}throw"invalid transparency";}
function pow10Increment(a,b,c){var d=1;0>a&&(d=-1,b=!b);c=Math.abs(c);isFinite(c)||(c=1);a=Math.abs(a);var e=Math.pow(10,Math.floor(Math.log(a)/Math.LN10))||c||0;10*e<=a&&(e*=10);b&&a===e&&(e/=10);e<c&&(e=c);return b?Math.ceil(a/e-1)*e*d:Math.floor(a/e+1)*e*d}function abbreviatedNumber(a){var b=0;a=+a;if(isFinite(a))for(;1E3<=a&&0===a%100;)b++,a/=1E3;var c=" K M G T Y".split(" ")[b];null==c&&(c="e"+3*b);return a+c}function makeFont(a,b,c){c&&(c+=" ");return c+a+"px "+b}
$.fn.filterByData=function(a,b){return this.filter(function(){return $(this).data(a)==b})};
window.adPack=function(){function a(a){if("object"!=typeof a||null===a)a=user;return"Exante"===a.username}function b(a){a.removeClass("settings").addClass("ad-pack");var b=a.find(".form-section.tv-profile-area").eq(0);$('<div class="left-column">').appendTo(a.html(""));var c=$('<div class="right-column">').appendTo(a);[{name:"ad-pack-change-messages",title:"Chart Pop-up Messages",action:"/ad_pack/change_messages/",fields:"default index stock futures forex bitcoin".split(" "),parent:a},{name:"ad-pack-pm-message",
title:"Private Messages",action:"/ad_pack/pm_message/",fields:["message"],sbmText:"Send PM to All Non-Pro Users",parent:c,skip:!0}].forEach(function(a){if(!a.skip){var c=b.clone();c.find("h3").text(a.title);c.find("form").attr({id:a.name,action:a.action,target:a.name+"-target"});c.find("iframe").replaceWith($(document.createElement("iframe")).attr({src:a.action,name:a.name+"-target"}).css({position:"absolute",left:-9999,width:10,height:10}));c.find("tr").each(function(){row=$(this);if(!row.hasClass("error-row"))if(row.hasClass("caption")||
!a.fields.length)row.remove();else{var b=a.fields.shift(),c=row.find("td");c.eq(0).text(b.charAt(0).toUpperCase()+b.substr(1));$(document.createElement("textarea")).attr({name:b,maxLength:Math.pow(2,8),rows:10,cols:40}).appendTo(c.eq(1).html(""))}});a.sbmText&&c.find("input[type=submit]").attr("value",a.sbmText);c.appendTo(a.parent)}});return a}var c=customChatMessageActive=chartPopUpActive=profileTabActive=sendMassPMActive=!1,d;$(function(){c=TradingView.D18("adPackActive");customChatMessageActive=
TradingView.D18("adPackCustomChatMsgActive");chartPopUpActive=TradingView.D18("adPackChartPopUpActive");sendMassPMActive=TradingView.D18("adPackMassPMActive");profileTabActive=TradingView.D18("adPackProfileTabActive");c&&$(document.documentElement).addClass("sp-active")});return{isAdvertiser:a,customChatMessage:function(b,d){c&&customChatMessageActive&&a(b)&&d("exante")},chartPopUp:function(a){if(c&&chartPopUpActive&&!user.is_pro){var b=~~localStorage.getItem("chart-ads-popup-counter-Exante"),
h=~~localStorage.getItem("chart-ads-popup-disabled-Exante");if(!(3<=b||h)){var k,l;a.model().mainSeries().onSymbolResolved().subscribe(null,function(){d||k||(k=setTimeout(function n(){k=null;if(l){var c=a.model().mainSeries().quoteData;c&&(c=l[c.type]||l["default"],String(c).replace(/^\s+|\s+$/g,"")&&(d=A83.createDialog("adPackExante",{addClass:"popup-exante",content:'<div class="message">'+c.replace(/</g,"&lt;").replace(/>/g,"&gt;")+'</div><div class="actions-block"><a class="no-button">No, thank you</a><a href="https://exante.eu/?utm_source=tradingview" class="yes-button" target="_blank">Read more</a></div>',
hideTitle:!0}),d.on("click",".no-button, .yes-button, .tv-dialog-title-close",function(a){a=$(a.target);a.hasClass("no-button")||a.hasClass("tv-dialog-title-close")?(TradingView.trackEvent("AdPack","Exante-Popup-Decline"),localStorage.setItem("chart-ads-popup-counter-Exante",b+1)):a.hasClass("yes-button")&&(TradingView.trackEvent("AdPack","Exante-Popup-Accept"),localStorage.setItem("chart-ads-popup-disabled-Exante",1));A83.destroy("adPackExante");d=null}),A83.positionDialog(d),TradingView.trackEvent("AdPack",
"Exante-Popup-Show")))}else $.ajax("/ad_pack/get_messages/").done(function(a){!a||a.constructor!==Object||a.error?a.error&&window.console&&console.error("AdPack Error: "+a.error):(l=a,n())})},9E5))},!0)}}},setTab:function(c){if(a()&&profileTabActive&&c){var d=c.$decks.filter(".settings"),h=c.$tabs.filter("a[href=#settings]");d&&h&&(d=b(d.clone()).insertAfter(d),h=h.closest(".filter-tabbed"),h=h.clone().insertAfter(h).find(".profile-tab"),h.text("Ad Pack").attr("href","#ad-pack").attr("data-value",
"ad-pack"),c._tabsList["ad-pack"]={showForNotAuth:!1},c.$tabs=c.$tabs.add(h.get(0)),c.$decks=c.$decks.add(d.get(0)))}}}}();$.fn.reverse=[].reverse;D17=function(){function a(a){c.hasOwnProperty(a)||(c[a]=new Delegate);return c[a]}var b={},c={};b.unsubscribe=function(b,c,g){a(b).unsubscribe(g,c)};b.on=function(a,c,g){return b.subscribe(a,c,g)};b.subscribe=function(b,c,g){a(b).subscribe(g,c)};b.emit=function(b,c){a(b).fire(c)};return b}();var TVSettings=function(){function a(a,b){var c;c=r[a];!window.is_authenticated&&null==c&&window.localStorage&&(c=r[a]);return null==c?b:c}function b(a,b){strValue=""+b;r[a]!==strValue&&(r[a]=strValue,e(a));return this}function c(a){null!=r[a]&&(delete r[a],e(a));return this}function d(){w=void 0;u.length&&g()}function e(a){if(window.is_authenticated)u.push(a),w||(w=setTimeout(d,q));else try{null==r[a]?localStorage.removeItem("tradingview."+a):localStorage.setItem("tradingview."+a,r[a])}catch(b){}TVXWindowEvents.emit("settings",
JSON.stringify({key:a,value:r[a]}))}function g(a){if(!TradingView.onWidget()&&window.is_authenticated&&0!==u.length){var b=u;u=[];for(var c={},d=b.length;d--;){var e=b[d],g=r[e];void 0===g&&(g=null);c[e]=g}$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(c)},async:!a})}}function h(){return Object.keys(r)}var k=!1;try{k=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(l){}if(k){var m={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},
k=function(a,b,c){a=m[a];return null===a||void 0===a?b:a},n=function(){};return{loaded:!1,loadedModel:!1,getValue:k,getJSON:k,getBool:k,getFloat:k,getInt:k,setValue:n,setJSON:n,remove:n,restoreDefaults:n,keys:function(){return Object.keys(m)},keysMask:function(){return[]},sync:n}}var q=12E4;"local"===window.environment&&(q=5E3);var r={},u=[],w;TVXWindowEvents.on("settings",function(a){a=JSON.parse(a);null==a.value?delete r[a.key]:r[a.key]=a.value});$(window).on("visibilitychange",function(a,b){b||
g()});$(window).on("unload",function(){g(!0)});return{loaded:!1,loadedModel:!1,getValue:a,getJSON:function(b,d){var e=a(b,void 0);if(null==e)return d;try{return JSON.parse(e)}catch(g){return c(b),d}},getBool:function(b,c){var d=a(b);return null==d?c:d&&"false"!==d&&0!==+d?!0:!1},getFloat:function(b,c,d){d=a(b,void 0,d);if(null==d)return c;c=parseFloat(d);if(!isFinite(c))throw new TypeError('"'+d+'" is not float (key: "'+b+'")');return c},getInt:function(b,c,d){d=a(b,void 0,d);if(null==d)return c;
c=parseInt(d,10);if(!isFinite(c))throw new TypeError('"'+d+'" is not int (key: "'+b+'")');return c},setValue:b,setJSON:function(a,c){var d=JSON.stringify(c);b(a,d);return this},remove:c,restoreDefaults:function(){for(var a=0;a<localStorage.length;a++){var b=localStorage.key(a);"tradingview."===b.substring(0,12)&&(u=[],localStorage.removeItem(b))}$.post("/restoredefaults/",{},function(a){A83.showNotice("Success","Defaults has been successfully restored")}).error(function(a){})},keys:h,keysMask:function(a,
b){var c=h(b),d=[];a=new RegExp("^"+RegExpEscape(a).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi");for(var e=c.length-1;0<=e;e--)a.test(c[e])&&d.push(c[e]),a.lastIndex=0;return d},sync:function(a){if(window.is_authenticated){a=a||{};r=[];if(window.localStorage)for(var c=0===Object.keys(a).length,d=localStorage.length;d--;){var e=localStorage.key(d);if("tradingview."===e.substring(0,12)){if(c){var g=e.substring(12);b(g,localStorage.getItem(e))}localStorage.removeItem(e)}}for(d in a)r[d]=
a[d]+""}else if(r=[],window.localStorage)for(d=localStorage.length;d--;)a=localStorage.key(d),"tradingview."===a.substring(0,12)&&(c=a.substring(12),r[c]=localStorage.getItem(a))}}}();A13=function(){if("www.tradingview.com"==location.host||"dwq4do82y8xi7.cloudfront.net"==location.host||location.host.match(/proxy\d.tradingview.com/)||location.host.match(/prod-[^.]+.tradingview.com/))return"battle";if("beta.tradingview.com"==location.host||"beta2.tradingview.com"==location.host)return"staging";if(location.host.match(/webcharts/))return"staging_local";location.host.match(/^localhost(:\d+)?$/);return"local"};
A13.isLocal=function(){return"local"==this()};A13.isProd=function(){return"battle"==this()};A13.isDebug=function(){return!this.isProd()};TradingView.LOGLEVEL_NORMAL=1;TradingView.LOGLEVEL_DEBUG=2;A46=[];TradingView.LOGHISTORY_LENGTH=100;TradingView.getLogLevel=function(){return TVSettings.getInt("log_level",TradingView.LOGLEVEL_NORMAL)};TradingView.loggingOn=lon=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_DEBUG);TradingView.logNormal("Debug logging enabled")};TradingView.loggingOff=loff=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_NORMAL);TradingView.logNormal("Debug logging disabled")};
TradingView.log=function(){var a;setInterval(function(){a=null},1E3);return function(b,c){c!=a&&("\n"!=c&&A46.unshift(c),A46.length>TradingView.LOGHISTORY_LENGTH&&A46.pop(),"undefined"!==typeof console&&console.log&&b<=TradingView.getLogLevel()&&(a=c,console.log(c)))}}();TradingView.logNormal=function(a){TradingView.log(TradingView.LOGLEVEL_NORMAL,a)};TradingView.logDebug=function(a){TradingView.log(TradingView.LOGLEVEL_DEBUG,a)};
TradingView.remoteDebug=function(){var a={arguments:JSON.stringify(Array.prototype.slice.call(arguments))};$.ajax("/remote_debug/",{data:a})};TradingView.remoteDebugTouch=function(){Modernizr.touch&&this.remoteDebug.apply(this,arguments)};if(A13.isProd()&&"undefined"!==typeof console){var noop=function(){};TradingView.remoteDebug=noop};(function(a){function b(b,d){this.container=a(b);this.options=d||{};!this.options.callbacks&&(this.options.callbacks={});this.column_num=0;this.items=[];this.init();var e=this;window.addEventListener("resize",function(){e.resize()})}b.prototype.fireCallback=function(a,b){if("function"===typeof this.options.callbacks[a])this.options.callbacks[a](b)};b.prototype.resize=function(){this.columnsCount!=this.calculateColumnsCount()&&(this.options.fixHeightOnRecalculate&&this.container.css({height:this.container.height()}),
this.removeColumns(),this.init(!0),this.options.fixHeightOnRecalculate&&this.container.css({height:"auto"}))};b.prototype.getItems=function(){return this.container.find("> "+this.options.itemsSelector).toArray()};b.prototype.addItems=function(a,b){this.items=this.items.concat(a);this.balance(a,b)};b.prototype.balance=function(a,b){switch(this.options.balanceType){case "height":this.balanceHeight(a,b);break;default:this.balanceSimple(a,b)}};b.prototype.balanceHeight=function(b,d){var e=this;this.columns.forEach(function(a){!a.fragment&&
(a.fragment=document.createDocumentFragment())});a.each(b,function(b,c){var k=a(c),l=k.data("cb-height")||k.outerHeight(!0);if(l)k.data("cb-height",l);else throw"Cant get item height";var m=null;if(k.hasClass("two-columns-item")){e.columns.sort(TradingView.sortMultipleFunction("index"));if(2<this.columnsCount)for(var m=null,n,k=this.columns.length-1;0<k;k--){var q=Math.abs(this.columns[k].height-this.columns[k-1].height);if(null===m||q<=m)m=q,n=k-1}else n=0;m=this.columns[n];n=this.columns[n+1];k=
l;q=0;m.height>n.height?k+=m.height-n.height:q=n.height-m.height;var r=document.createElement("div");r.style.height=k+"px";r.className="empty-space";n.fragment.appendChild(r);n.height+=k;q&&(r=document.createElement("div"),r.style.height=q+"px",r.className="empty-space",m.fragment.appendChild(r),m.height+=q)}else e.columns.sort(TradingView.sortMultipleFunction("height","index")),m=e.columns[0];!e.options.maxRow||this.row_num<e.options.maxRow?(m.height+=l,m.fragment.appendChild(c)):d&&e.container[0].removeChild(c)}.bind(this))};
b.prototype.balanceSimple=function(b,d){var e=this;a.each(b,function(a,b){var c=e.columns[this.column_num];!c.fragment&&(c.fragment=document.createDocumentFragment());!e.options.maxRow||this.row_num<e.options.maxRow?(c.fragment.appendChild(b),c.count++):d&&e.container[0].removeChild(b);++this.column_num>=e.columnsCount&&(this.row_num++,this.column_num=0)}.bind(this))};b.prototype.init=function(a){this.row_num=this.column_num=0;this.columnsCount=this.calculateColumnsCount();this.createLayout(this.columnsCount);
a?this.balance(this.items,!1):this.addItems(this.getItems(),!0);this.pushFragmentsToColumns()};b.prototype.calculateColumnsCount=function(){var a=this.container.width(),b=this.options;if(!a)throw"Can't get container width.";for(var e=Math.floor(a/b.columnWidth);0<=e&&e*b.columnWidth+(e-1)*b.gap>a;)e--;return e};b.prototype.createLayout=function(b){this.columns=[];for(var d=document.createDocumentFragment(),e=0;e<b;e++){var g=a('<div class="cb-column"></div>');this.columns.push({target:g,count:0,height:0,
index:e});d.appendChild(g[0])}this.container.prepend(d)};b.prototype.pushFragmentsToColumns=function(a){for(var b=this.columns.length,e=0;e<b;e++){var g=this.columns[e];if(a)for(var h=0;h<g.fragment.childNodes.length;h++)g.fragment.childNodes[h].className+=" show-animate animate-init";g.target.append(g.fragment);delete g.fragment}var k=this;a&&setTimeout(function(){k.container.find(".animate-init").removeClass("animate-init")},1)};b.prototype.removeColumns=function(){this.columns.forEach(function(a){a.target.detach()})};
b.prototype.rescan=function(){this.addItems(this.getItems(),!0);this.pushFragmentsToColumns()};b.prototype.reset=function(){this.items=[];this.removeColumns();this.init()};a.fn.columnsBalancer=function(c){if(a(this).length)return new b(a(this),c);var d=[];a(this).each(function(){d.push(new b(a(this),c))});return d}})(jQuery);A83={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4E3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(a){W77.enabled("constraint_dialogs_movement")&&(a.containment=".chart-page");return a},showIntervalMismatchDialog:function(a){var b;b=!1;A83.createModalDialog("Interval is not applicable");var c=A83.modalDialog;c.css({zIndex:1E3});c.find(".tv-dialog").css("width","400px");c=A83.modalDialog.find(".tv-dialog-content");
c.html('<div class="main"><div class="caption-big"><p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p></div><div class="main-properties"></div></div>');c=c.find(".main-properties");c=$('<div class="dialog-buttons"></div>').appendTo(c);if(a){var d=$('<label class="dialog-trail-checkbox"><input type="checkbox" /> Do not show this message again</label>').appendTo(c).find("input");
d.attr("checked",a.silentIntervalChange.value());d.bind("click",function(){a.silentIntervalChange.setValue(this.checked)})}$('<a class="tv-button ok">OK</a>').appendTo(c).bind("click",function(){A83.destroy()});A83.positionDialog();A83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:b})},showSignInDialog:function(a,b){function c(a){var b;switch(a){case "signup":case "signup-trial":b=m.indexOfPage(k);break;case "recover":b=m.indexOfPage(l);break;default:a="signin",b=m.indexOfPage(h)}d.find('[name="signup_trial"]').val("signup-trial"==
a?1:0);d.find(".show-if-signin, .show-if-signup, .show-if-recover").not(".show-if-"+a).hide();d.find(".show-if-"+a).show();m.setActivePage(b)}if(!is_authenticated){"function"==typeof a?A83.onSigninSuccess=a:delete A83.onSigninSuccess;A83.createModalDialog("Log in",{noHeader:!0,addClass:"auth-dialog"});var d=A83.modalDialog.find(".tv-dialog-content"),e=$('<div class="properties-tabs show-if-signin show-if-signup show-if-signup-trial"></div>').prependTo(d);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Sign In")).appendTo(e);
$('<a href="#" class="properties-tabs-label"></a>').text($.t("Sign Up")).appendTo(e);$('<a href="#" class="properties-tabs-label"></a>').appendTo(e);var g=$(document.createElement("div")).appendTo(d),h=$(document.createElement("div")).addClass("page").appendTo(g),k=$(document.createElement("div")).addClass("page").appendTo(g),l=$(document.createElement("div")).addClass("page recover").appendTo(g),m=new A71(e,g);h.html(TradingView.templates.dialogs.signin);k.html(TradingView.templates.dialogs.auth);
l.html(TradingView.templates.dialogs.recover);c(b&&b.mode);m.tabChanged.subscribe(null,function(a){m.pageAt(a).find('input:eq(0)[type!="hidden"]').focus()});d.find(".recover-link").on("click",function(a){c("recover");a.preventDefault()});d.find(".signup-link").on("click",function(a){c("signup");a.preventDefault()});d.find(".signin-link").on("click",function(a){c("signin");a.preventDefault()});d.find(".auth-dialog-field").each(function(){function a(){c.toggleClass("empty",!c.val());d=!1}var b=$(this).find(".auth-dialog-field-placeholder"),
c=$(this).find("input"),d=!1;a();c.on("blur",function(){b.toggleClass("disabled",!!this.value)});c.on("keypress keydown keyup input paste",function(){d||(d=!0,setTimeout(function(b){a()},0))})});"stocktwits google facebook twitter linkedin yahoo".split(" ").forEach(function(a){var c="/accounts/signin/"+a+"/";d.find(".auth-dialog-social-"+a).on("click",function(a){b&&"signup-trial"==b.mode&&$.cookie("will_start_trial",1,{path:"/"});a.preventDefault();window.open(c,"_blank")})});d.find("#signin-form").on("submit",
function(a){a.preventDefault();var b=$(this).find('[type="submit"]').addClass("process");A83.submit(function(a){""!==a.error?A83.showError("Error: "+a.error):(A83.destroy(),user=a.user,changeLoginState(!0),"function"==typeof A83.onSigninSuccess&&(A83.onSigninSuccess(),delete A83.onSigninSuccess),"undefined"!==typeof next&&next&&(location.href=next));b.removeClass("process")},this)});d.find("#signup-form").on("submit",function(a){var b=this,c=TradingView.getUrlParams().utmsource,
d=TradingView.getUrlParams().utmmedium;null!=c&&(c=$("<input>").attr("type","hidden").attr("name","utm_source").val(c),d=$("<input>").attr("type","hidden").attr("name","utm_medium").val(d),$(b).append(c),$(b).append(d));a.preventDefault();var e=$(b).find('[type="submit"]').addClass("process");A83.submit(function(a){$(".tv-dialog input").removeClass("error");$(".tv-dialog-field-error").hide();if(""!==a.errors)if("object"==typeof a.errors){for(var c in a.errors)$(b).find("input[name^="+c+"]").addClass("error").data("error",
a.errors[c][0]);$(".tv-dialog input.error").first().focus();A83.showError($(".tv-dialog input.error").first().data("error"))}else A83.showError("Error: "+a.errors);else A83.showNotice("Activate Your Account",a.message);e.removeClass("process")},b)});d.find("#recover-form").on("submit",function(a){a.preventDefault();var b=A83.modalDialog;A83.submit(function(a){""!==a.error?A83.showError("Failed: "+a.error):(A83.showMessage("New password is sent to your email."),
setTimeout(function(){A83.modalDialog===b&&A83.destroy()},A83.messageDelay))},this)});A83.positionDialog();A83.applyHandlers(null)}},showPublishIntroDialog:function(a){var b=$.Deferred(),c=TVSettings.getBool("publish.showIntroText",!0);if(a||c){a=A83.createDialog("Please read before publishing");var d=!1;a.css({width:"750px","z-index":130});a.find(".tv-dialog-content").html(Mustache.render(TradingView.templates.dialogs.publishIntro,{do_not_show:!c}));a.draggable(A83._constrainDraggableOptionsIfNeeded({handle:".tv-dialog-title"}));
a.find('input[name="donotshow"]').on("change",function(a){TVSettings.setValue("publish.showIntroText",!$(this).is(":checked"))});$("#publish-intro-continue").click(function(){A83.destroy("Please read before publishing");b.resolve()});a.on("destroy",function(){d=!0;setTimeout(b.resolve,0)});b.always(function(){d||A83.destroy("Please read before publishing")});A83.positionDialog(a);A83.applyHandlers(a)}else b.resolve();return b},showPublishChartDialog:function(a){function b(){h.find(".publish-related").tvtags("extractTags");
var b={name:h.find('[name="name"]').val(),description:h.find('[name="description"]').val(),direction:h.find('input[name="direction"]').val(),is_public:"1"};a.onWidget||(b.tags=h.find(".publish-tags").tvtags("extractTags").tvtags("tagsWithPending").join(","),b.twitter=h.find('input[name="twitter"]').is(":checked")?"1":"",b.stocktwits=h.find('input[name="stocktwits"]').is(":checked")?"1":"",b.is_public=h.find('input[name="public"]').is(":checked")?"1":"",b.related_charts=h.find(".publish-related").tvtags("extractTags").tvtags("tagsWithPending").join(","),
b.chat=h.find('input[name="chat"]').is(":checked")?"1":"");a.publishSource&&(b.publish_source=a.publishSource);var c={onWidget:a.onWidget,publishAllLayout:h.find('[name="publish_entire_layout"]').is(":checked")};if(!b.name.trim())A83.showError("Chart title is required",h),h.find('[name="name"]').focus();else if(!b.description.trim())A83.showError("Chart description is required",h),h.find('[name="description"]').focus();else if(!isLatin(b.name)||!isLatin(b.description))A83.showError("TradingView is only for English-language content at this time.");
else if(!isLatin(b.tags))A83.showError("Please use only English in tags");else if(a.onPublish)a.onPublish(b,c)}function c(){h.show();var b=TVSettings.getJSON("publishchart.size",{w:w,h:A});h.height(Math.max(Math.min(b.h,.9*$(window).height()),A));h.width(Math.max(Math.min(b.w,.9*$(window).width()),w));n();A83.positionDialog(h,{considerScroll:!0});if(a.onShow)a.onShow()}function d(){h.hide();if(a.onMinimize)a.onMinimize()}a=a||{};var e="edit"===a.mode,g=e?"Edit Idea":"Publish Idea",h=A83.createDialog(g,
{addClass:"publish-dialog",hideCloseCross:!e,hideTitle:!0});h.css("width","700px");var k=h.find(".tv-dialog-content"),l=a.onWidget?TradingView.templates.dialogs.publishChartWidget:TradingView.templates.dialogs.publishChart,m=TradingView.clone(window.user||{});m.editMode=e;k.html(Mustache.render(l,m));l=h.find(".tv-dialog-title");$(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"}).appendTo(l);if(!e)$('<a class="tv-dialog-title-minimize"></a>').appendTo(l).on("click",
function(a){a.preventDefault();d()});h.draggable(A83._constrainDraggableOptionsIfNeeded({handle:l}));var n=function(){var a=k.find(".jsfluid"),b=k.children(".main, *[class^=main-]").eq(0);return function(){a.css("height",h.height()-b.position().top-b.outerHeight()+a.height())}}();h.on("resize",function(a){a.stopPropagation();a.preventDefault();n()});l=a.formData||{};l.name&&h.find('[name="name"]').val(l.name);l.description&&h.find('[name="description"]').val(l.description);l.direction&&h.find('input[name="direction"]').val(l.direction);
l.related_charts&&h.find(".publish-related").val(l.related_charts);l.tags&&h.find(".publish-tags").val(l.tags);$("#publish-chart-form").submit(function(a){a.preventDefault();b()});$("#publish-dialog-do-publish").click(function(a){a.preventDefault();b()});h.find('input[name="public"]').on("change",function(a){$(this).is(":checked")||(q.prop("checked",!1).change(),r.prop("checked",!1).change())});var q=h.find('input[name="twitter"]'),r=h.find('input[name="stocktwits"]');q.change(function(){q.is(":checked")&&
(user.has_twitter||window.open("/accounts/permission/twitter/","twitter_permission_request","scrollbars=yes,height=400,width=700").focus())});r.change(function(){r.is(":checked")&&authInStocktwits()});k.find(".publish-direction-buttons .tv-button").on("mousedown",function(){var a=$(this);$(".publish-direction-buttons .tv-button").removeClass("active");a.addClass("active");h.find('input[name="direction"]').val(a.data("val"))}).each(function(){$(this).toggleClass("active",+$(this).data("val")===(+h.find('input[name="direction"]').val()||
0))});h.find(".tv-dialog-readbefore a").on("click",function(a){a.preventDefault();A83.showPublishIntroDialog(!0)});a.isPrivate&&h.find('input[name="public"]').prop("checked",!1).change();(function(){function b(a){a=new Date(a);return[a.getFullYear(),("0"+a.getMonth()).substr(-2),("0"+a.getDate()).substr(-2)].join("-")}function c(a){return(/([0-9A-Za-z-]+)\/?$/.exec(a)||0)[1]}var d={},e=h.find(".publish-related");a.related&&e.val([].concat(a.related).join(","));e.tvtags("init",{suggest:function(a,
b){var e=location.protocol+"//"+location.host+"/v/";a.substr(0,e.length)===e&&(a=c(a)||a);$.ajax("/ideas-json/",{data:{search:a},dataType:"json"}).done(function(a){a=a||[];a.forEach(function(a){d[a.image_url]=a;a.str=e+a.image_url+"/"});b(a)}).error(function(){b(null)})},formatSuggest:function(a){var c=$(document.createElement("span")).addClass("date").text(b(1E3*a.created)+" "),d=$(document.createElement("strong")).text(a.name);a=$(document.createTextNode(" "+[a.short_name||a.pro_symbol,a.resolution].join(", ")));
return{content:$().add(c).add(d).add(a)}},validate:function(a,b){var e=c(a);e?d[e]?b(!0):$.ajax("/ideas-json/"+e+"/",{dataType:"json"}).done(function(a){a&&a.length?(d[a[0].image_url]=a[0],b(!0)):b(!1)}).error(function(){b(!1)}):b(!1)},transform:c,format:function(a){a=a.str;var b=d[a];return b&&a?b.name:"Idea"},keys:["\n",",",/\s/,";"],separator:","}).on("change",n)})();h.find(".publish-tags").tvtags("init",{keys:["\n",",",/\s/,";"],separator:",",addClass:"no-arrow with-ears",format:function(a){return{str:a.str,
addClass:"tag"}},transform:function(a){return a.toLowerCase()},suggest:function(a,b){a||b(null);$.ajax("/tags-json/",{data:{search:a.toLowerCase()},dataType:"json"}).done(function(a){b(a)}).error(function(){b(null)})},maxLength:64,caseInsensitive:!0}).on("change",n);var u=[];a.D6&&function(){function b(){var a=g.value().model();return a?(a=a.mainSeries(),(a.properties().shortName.value()||a.symbol())+" ("+a.interval()+")"):"Active Chart"}function c(){d.toggleClass("hidden",!("s"!==
e.value()&&!l.value()));q.is(":checked")?(r.text("All Charts"),n.attr({"class":"tv-dialog-layout-button tv-dialog-layout-"+e.value()})):(r.text(b()),n.attr({"class":"tv-dialog-layout-button tv-dialog-layout-s"}))}var d=k.find(".tv-dialog-layoutpicker"),e=a.D6.layout.spawn(),g=a.D6.activeChartWidget.spawn(),l=a.D6.maximizeCurrentChart.spawn(),m=A45.symbol.spawn();u=[e,g,l,m];var n=$('<span class="tv-dialog-layout-button">'),q=
$('<input type="checkbox" name="publish_entire_layout">').hide().appendTo(n);$('<i class="icon"></i>').appendTo(n);var r=$("<span></span>").appendTo(n);$('<span class="arrow-icon"></span>').appendTo(n);e.subscribe(c);g.subscribe(c);l.subscribe(c);m.subscribe(c);c();TradingView.bindPopupMenu(n,function(){var a=q.is(":checked");return[{addClass:"tv-dialog-layout-popup tv-dialog-layout-s",title:"Publish Only "+b(),action:function(){q.attr("checked",!1);c()},active:!a,icon:!0},{addClass:"tv-dialog-layout-popup tv-dialog-layout-"+
e.value(),title:"Publish All Charts",action:function(){q.attr("checked",!0);c()},active:a,icon:!0}]},{direction:"up"});n.appendTo(d);h.on("destroy",function(){for(var a=0;a<u.length;a++)u[a].destroy()})}();h.find(".tv-dialog-cancel-button").on("click",function(a){a.preventDefault();e?A83.destroy(g):A83.showConfirm("Cancel publication","Are you sure you want to abandon your post?",function(){A83.destroy(g)})});(function(){function a(){var b=e.val()||"",c=e.prop("selectionStart");
null==c&&(c=b.length);var d=e.prop("selectionEnd");null==d&&(d=b.length);return[b.substring(0,c),b.substring(c,d),b.substring(d)]}function b(a,c){var d=a.slice(0,c).join("").length;e.val(a.join(""));e.prop("selectionEnd",d);e.prop("selectionStart",d);e.focus()}function c(a){g.toggleClass("active",!!a);l.toggleClass("active",!!a);a?k.attr("disabled",!1).focus():k.attr("disabled",!0).blur()}function d(){var e=k.val();k.val("");var g=/\/v\/[a-zA-Z0-9]{8}/.test(e),l=/\/(i|x)\/[a-zA-Z0-9]{8}/.test(e),
m=a();!e||g||l?(g?(m.splice(2,0,"[chart]"+e+"[/chart]"),b(m,3)):l&&(m.splice(2,0,"[image]"+e+"[/image]"),b(m,3)),c(!1)):A83.showError($.t("Please enter a valid idea URL or chart image URL"),h)}var e=h.find('[name="description"]');h.find(".bb-bold").addClass("apply-common-tooltip").attr("title",$.t("Bold")).on("click",function(c){c.preventDefault();c=a();c.splice(2,0,"[/b]");c.splice(1,0,"[b]");b(c,4)});h.find(".bb-italic").addClass("apply-common-tooltip").attr("title",$.t("Italic")).on("click",
function(c){c.preventDefault();c=a();c.splice(2,0,"[/i]");c.splice(1,0,"[i]");b(c,4)});h.find(".bb-list").addClass("apply-common-tooltip").attr("title",$.t("List or list item")).on("click",function(c){c.preventDefault();c=a();var d=!1;c[0].replace(/\[(\/)?list\]/gi,function(a,b){d=!b});d?(c.splice(2,0,""),c.splice(1,0,"\n[*]")):(c.splice(2,0,"\n[/list]"),c.splice(1,0,"[list]\n[*]"));b(c,3)});var g=h.find(".bbcode-embed-form"),k=g.find("input");k.attr("placeholder",$.t("Published idea or chart image URL"));
g.on("touchstartoutside mousedownoutside",function(a){g.hasClass("active")&&($(a.target).parents().andSelf().is(".bb-embed")||c(!1))});var l=h.find(".bb-embed");l.addClass("apply-common-tooltip").attr("title",$.t("Idea or chart snapshot image")).on("click",function(a){a.preventDefault();c(!0);k.val("").focus()});k.on("keypress",function(a){13===a.keyCode&&(d(),a.preventDefault())});h.find(".embed-submit").on("click",function(a){a.preventDefault();d()})})();if(a.onDestroy)h.on("destroy",a.onDestroy);
var w=h.width(),A=h.height();h.resizable({handles:"se",minHeight:A,minWidth:w,stop:function(){TVSettings.setJSON("publishchart.size",{w:h.width(),h:h.height()})}});A83.applyHandlers(h,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0,doNotCloseOnBgClick:!0});c();return{dialog:h,show:c,hide:d,close:function(){A83.destroy(g)}}},showGoProDialog:function(a){a||(a={});A83.createModalDialog("",{noHeader:!0,addClass:"gopro-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3});
b=b.find(".tv-dialog-content");b.html(Mustache.render(TradingView.templates.dialogs.goPro.layout,{trialButton:A10&&A10.trialAvailable&&A10.trialAvailable(),exchangesButton:a.exchangesButton,exchange:a.exchange}));var c=b.find(".col-main .col-copy");a=a.feature?Mustache.render(TradingView.templates.dialogs.goPro.features[a.feature],{exchangesButton:a.exchangesButton,exchange:a.exchange,options:a.featureOptions||{}}):TradingView.templates.dialogs.goPro.defaultCopy;
c.html(a);b.find(".yes-button").on("click",function(a){this.href===location.href&&a.preventDefault();A83.destroy()});b.find(".no-button").on("click",function(a){a.preventDefault();A83.destroy()});A83.positionDialog();A83.applyHandlers(null)},showAddSymbolDialog:function(a,b){b=$.extend({},{title:"Add Symbol",callback:function(a,b){},overlayOption:!1,overlayOptionChecked:TVSettings.getBool("showAddSymbolDialog.checkboxState",!0),okButtonTitle:"Add Symbol"},b||{});var c=A83.createDialog(b.title);
c.css("min-width",0);c.find(".tv-dialog-content").html(Mustache.render(TradingView.templates.dialogs.addSymbol,b)).css("min-width",0);A83.applyHandlers(c);var d=$('<div class="symbol-edit-widget"></div>'),e=$('<input type="text" class="symbol-edit single" placeholder="Symbol" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">').appendTo(d),g=A69.bindToInput(e,{callback:function(a){var d=c.find("#tv-dialog-addsymbol-overlay-checkbox").is(":checked");
if(a){var e=b.callback;e(a,d);$(window).off("keyup.addOverlay");A83.destroy(c.data("title"))}}});c.find("div.symbol-edit-place").replaceWith(d);c.find(".tv-dialog").draggable(A83._constrainDraggableOptionsIfNeeded({handle:".tv-dialog-title"}));c.find("input[type=checkbox]").on("change",function(a){TVSettings.setJSON("showAddSymbolDialog.checkboxState",a.target.checked)});c.find(".ok").on("click",function(){g.acceptTypeIn()});c.show();A83.positionDialog(c);e.focus()},makeDraggable:function(a){a.draggable({handle:".tv-dialog-title"})},
showConfirmInputsDialog:function(a,b,c){function d(a){var b=c.callback;a=a.state();b(a);A83.destroy(e.data("title"))}c=$.extend({},{title:"Confirm Inputs",callback:function(a){},okButtonTitle:"Apply"},c||{});var e=A83.createDialog(c.title,{content:"<div class='main'></div>"});e.css("min-width",0);A83.applyHandlers(e,{beforeDestroy:function(){$(window).unbind("keyup.hideInputsConfirmDialog")}});for(var g=TradingView.merge({},b.defaults.inputs),h=0;h<b.inputs.length;++h){var k=b.inputs[h];
k.confirm||delete g[k.id]}var l=new Property({inputs:g});a=(new $41(l,a.model(),{metaInfo:function(){return b}},!0)).widget();g=e.find(".main");g.append(a);$(window).bind("keyup.hideInputsConfirmDialog",function(a){"13"==a.keyCode&&"textarea"!==a.target.tagName.toLowerCase()&&(d(l),$(window).unbind("keyup.hideInputsConfirmDialog"))});$("select",g).each(function(){var a=$(this),b="tv-select-container dialog";a.hasClass("tv-select-container-fontsize")&&(b+=" tv-select-container-fontsize");
a.selectbox({speed:100,classHolder:b})});$('input[type="text"]',g).addClass("tv-text-input inset dialog");$("input.ticker",g).TVTicker();e.find(".main").append("<div class='tv-dialogs-bottom-button'><span class='tv-button tv-right tv-uppercase ok'>Apply</span></div>");e.find(".ok").on("click",function(){d(l)});e.show();A83.positionDialog(e);g.find("input,select").first().focus()},showUpdateAccountDataDialog:function(a){var b=Mustache.render('<form>{{#html}}<p>{{&html}}</p>{{/html}}<input type="text" value="{{value}}"></form>',
{value:a.value||"",html:a.html});return A83.showCustomDialog({title:a.title,html:b,action:function(b){var d=b.find(".tv-button.ok");d.addClass("process");changeUserProfileField({name:a.paramName,value:b.find("input[type=text]").val(),onSuccess:a.success,onError:function(d){d=(d||[]).join(" ");"function"===typeof a.error?a.error(d):A83.showError(d||"Unexpected error: can't change profile data",b)},onComplete:function(){d.removeClass("process")}});return{notClose:!0}},onCancel:a.cancel})},
showProRTTrialOffer:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");b=b.find(".tv-dialog-content");b.html(Mustache.render(TradingView.templates.dialogs.proRTTrialOffer));b.find("a.trial").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onAccept)a.callbacks.onAccept()});b.find("a.nothanks").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&
a.callbacks.onDecline)a.callbacks.onDecline()});b.find("a.ordernow").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onOrder)a.callbacks.onOrder()});b.find("a.later").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onRemindLater)a.callbacks.onRemindLater()});A83.positionDialog();A83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},showTrialMessage:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",
appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");b=b.find(".tv-dialog-content");b.html('<div class="main"><h3 class="title"></h3><div class="copy"></div><div class="big-buttons"><a href="javascript://" class="big-button ok">OK</a></div></div>');var c=b.find(".title"),d=b.find(".copy"),e=b.find(".big-button.ok"),g=b.find(".big-buttons");a&&a.title?c.html(a.title):c.remove();a&&a.copy?d.html(a.copy):d.remove();a&&a.closeButtonCopy&&e.html(a.closeButtonCopy);a&&
a.replaseCloseBtn&&g.html(a.replaseCloseBtn);b.find("a.ok").on("click",function(b){a&&a.replaseCloseBtnFunc?a.replaseCloseBtnFunc(b):(b.preventDefault(),A83.destroy())});A83.positionDialog();A83.applyHandlers(null)},showTrialMessageSuccess:function(){A83.showTrialMessage({title:"PRO Plus Trial",copy:"<p>Your 30-day free PRO Plus account has been activated. You are now part of a community of 2 million+ ideas that have been created within TradingView charts. To help get the ball rolling, we'd suggest you spend a few minutes familiarizing yourself with our online <a href='/stock-charts-support/'>help section</a>. We hope you enjoy working with TradingView and wish you good trading!</p>",
replaseCloseBtn:"<a href='/e/' class='big-button ok'>LAUNCH CHART</a>",replaseCloseBtnFunc:function(){}})},showTrialConfirmationDialog:function(a){a=a||{};A83.createModalDialog("",{noHeader:!0,addClass:"trialconfirm-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3});var c=b.find(".tv-dialog-content");c.html('<div class="main"><h3 class="title">'+(a.title||"Trial confirmation dialog")+'</h3><div class="copy">'+(a.text||"Trial confirmation text")+'</div><div class="actions-block"><a class="no-button">'+
(a.noText||"No, thank you")+'</a><a class="yes-button">START TRIAL</a></div></div>');b=c.find(".no-button");c=c.find(".yes-button");b.on("click",function(b){b.preventDefault();if("function"==typeof a.onCancel)return a.onCancel(b);A83.destroy()});c.on("click",function(b){if("function"==typeof a.onSubmit)return a.onSubmit(b);b.preventDefault()});A83.positionDialog();A83.applyHandlers(null)},showEarlyAccessDialog:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",
appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");var b=b.find(".tv-dialog-content"),c={};switch(a&&a.reason){case "after 1 week":c.is_1wk=!0;break;case "after 2 weeks":c.is_2wk=!0;break;case "finished":c.is_finished=!0;break;default:c.is_manual=!0}b.html(Mustache.render(TradingView.templates.dialogs.earlyAccess,c));c=null;b.find("a.nothanks").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onDecline)a.callbacks.onDecline()});b.find("a.ordernow").on("click",
function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onOrder)a.callbacks.onOrder()});A83.positionDialog();A83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},showUnsubscribeConfirmationDialog:function(a,b,c){A83.createModalDialog(a);A83.modalDialog.find(".tv-dialog").css("width","450px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="caption-big">Aww, we are sorry to see you go! If you cancel, you will no longer be billed after your current subscription period ends. Your subscription service will continue to be active until the end of the period that you paid for. Sorry, there are no refunds.<br/><br/>If you are sure you want to cancel, click Cancel, otherwise choose Do Not Cancel. If you cancel, we\u2019d really like to know the reason why you are cancelling so we can make things better.</div><textarea style="width: 398px; height: 100px;"></textarea></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide yes" type="button" value="Cancel {{text}} and send feedback" style="margin-right: 10px;"/><input class="tv-button wide no" type="button" value="Do Not Cancel"/></div>',
{text:b}));var d=A83.modalDialog.find(".yes");d.click(function(){var a=A83.modalDialog.find("textarea").val();a?(d.addClass("process"),c(a)):A83.showError("Please enter your feedback")});A83.modalDialog.find(".no").click(function(){A83.destroy()});A83.positionDialog();A83.applyHandlers()},showChangeUserStatusDialog:function(){var a=A83.createDialog("Update status");a.find(".tv-dialog").css("width","400px");a.find(".tv-dialog-content").html('<form><div class="main"><input type="text" name="status" value="'+
("string"==typeof window.user.status?window.user.status.replace(/"/g,"&quot;"):"")+'"></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="submit" value="OK" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="Cancel"/></div></form>');var b=a.find(".ok"),c=a.find('[name="status"]');a.find("form").submit(function(){b.addClass("process");changeUserProfileField({name:"status",value:String(c.val()).replace(/^\s+|\s+$/g,""),onSuccess:function(a){var b=
$("#change-profile-status"),c=a?a:"Add status...";b.hasClass("tv-editable-active")?b.find('input[type="text"], textarea').val(c):b.text(c);$('[name="status"]').val(a);A83.destroy("Update status")},onError:function(a){A83.showError("We'are sorry, something went wrong. Try to reload page.");console.warn(a)},onComplete:function(){b.removeClass("process")}});return!1});a.find(".cancel").click(function(){A83.destroy("Update status")});Modernizr.touch&&c.val("");A83.positionDialog(a,
{considerScroll:!0});A83.applyHandlers(a);c.focus().select()},showScriptSearchDialog:function(a){function b(){value=e.val();if(value!==k){k=value;g.toggle(!!value);l&&(l.abort&&l.abort(),l=null);h.html('<div class="loading"></div>');var a=A56.suggest(k);l=a;A56.list().done(function(b){a.done(function(d){a===l&&c(d,b)})})}}function c(a,b){h.empty();a&&(a.length||$('<p class="nothing">No scripts matched your criteria</p>').appendTo(h),a.forEach(function(a){if(a){var c=
$('<div class="item">');if(a.author){var e=$('<div class="item-avatar">').appendTo(c);$("<img>").attr({src:"/avatar/"+a.author.id+"/","class":"avatar userlink",alt:a.author.username,"data-username":a.author.username}).appendTo(e)}e=$('<div class="item-buttons"></div>').appendTo(c);$(Mustache.render(TradingView.templates.publishedScriptButton,{script_id_part:a.scriptIdPart,script_install_count:a.scriptInstallCount,show_script_install_count:!!a.scriptInstallCount,script_in_library:b.some(function(b){return b.scriptIdPart==
a.scriptIdPart})})).appendTo(e);if(d){var g=$('<a class="pubscript-try-button" title="Add this study to active chart"><span class="label">Try</span></a>');g.on("click",function(b){b.preventDefault();d(a)});g.appendTo(e)}e=$('<div class="item-main">').appendTo(c);g=$('<div class="item-title">').appendTo(e);$("<a>").attr({href:"/v/"+a.imageUrl+"/",target:"_blank"}).text(a.scriptName||a.scriptTitle||"Study").appendTo(g);$('<div class="item-desc">').text(a.description||"").appendTo(e);h.append(c)}}))}
var d=a.onTry;a=A83.createDialog("Search for scripts published by community",{width:815,content:TradingView.templates.dialogs.scriptSearch,addClass:"script-search-dialog"});var e=a.find("input[name=q]"),g=a.find(".input-reset"),h=a.find(".script-search-results");g.on("click",function(){e.val("");b()});var k=void 0,l=null;e.on("input keyup change",b);b();A83.positionDialog(a);A83.applyHandlers(a);return a},showPrioritySupportDialog:function(){A83.showCustomDialog({title:"Priority Support",
html:TradingView.templates.dialogs.proiritySupport,noButtons:!0})},showNotice:function(a,b,c){"object"==typeof b&&(c=b,b="");c=c||{};doNotCloseOnBgClick=c.doNotCloseOnBgClick||!1;html=c.html||"";A83.createModalDialog(a);A83.modalDialog.find(".tv-dialog").css("width","400px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="caption-big-center {{classSuffix}}">{{text}}'+html+"</div></div>",{classSuffix:c.classSuffix||"",text:b}));A83.positionDialog();
A83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:doNotCloseOnBgClick,beforeDestroy:c.onClose});return A83.modalDialog},showConfirm:function(a,b,c,d,e){e=e||{};e.dontAskSetting&&TVSettings.getBool(e.dontAskSetting)?c():(A83.createModalDialog(a,e),A83.modalDialog.find(".tv-dialog").css("width","400px"),A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="caption-big">{{text}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">Do not ask again</label>{{/dontAskSetting}}</div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="button" value="'+
$.t("YES")+'" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="'+$.t("NO")+'"/></div>',{text:b,dontAskSetting:!!e.dontAskSetting})),e.okButtonText&&A83.modalDialog.find(".ok").val(e.okButtonText),e.cancelButtonText&&A83.modalDialog.find(".cancel").val(e.cancelButtonText),A83.modalDialog.find(".ok").click(function(){e.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&TVSettings.setValue(e.dontAskSetting,!0);c();A83.destroy()}),
A83.modalDialog.find(".cancel").click(function(){d&&d();A83.destroy()}),A83.positionDialog(),A83.applyHandlers())},showPrompt:function(a,b,c,d,e){function g(){var a=l.val();if(k){var b=k(a);if(b){!0===b&&(b="Wrong value");A83.showError(b,A83.modalDialog);return}}A83.destroy();c&&c(a)}var h=e&&e.defaultValue,k=e&&e.validate;A83.createModalDialog(a,e);A83.modalDialog.find(".tv-dialog").css("width","400px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="button" value="OK" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="Cancel"/></div>',
{text:b}));var l=A83.modalDialog.find('[name="prompt-value"]');h&&l.val(h);A83.modalDialog.find("form").submit(function(a){g();a.preventDefault()});A83.modalDialog.find(".ok").click(function(a){g();a.preventDefault()});A83.modalDialog.find(".cancel").click(function(){A83.destroy();d&&d(value)});A83.positionDialog();A83.applyHandlers();setTimeout(function(){l.focus().select()},0)},showCustomDialog:function(a){function b(b){var c=a.action(A83.modalDialog),
g=c&&c.notClose;(!c||c.error)&&void 0!==c||g?c.error&&A83.showError(c.error):A83.destroy();b.preventDefault()}function c(b){if("function"===typeof a.onCancel)a.onCancel();else A83.destroy()}A83.createModalDialog(a.title||"Dialog");A83.modalDialog.find(".tv-dialog").css("width",a.width||"400px");A83.modalDialog.find(".tv-dialog-content").html('<div class="main">'+(a.html||"Content")+"</div>"+(a.noButtons?"":'<div class="tv-dialogs-bottom tv-dialog-center">'+(a.noButtonOk?
"":'<input class="tv-button wide ok" type="button" value="OK" style="margin-right: 10px;"/>')+(a.noButtonCnacel?"":'<input class="tv-button wide cancel" type="button" value="Cancel"/>')+"</div>"));a.okButtonText&&A83.modalDialog.find(".ok").val(a.okButtonText);a.cancelButtonText&&A83.modalDialog.find(".cancel").val(a.cancelButtonText);A83.modalDialog.find(".ok").click(b);A83.modalDialog.find("form").submit(b);A83.modalDialog.find(".cancel").click(c);A83.modalDialog.find(".tv-dialog-title-close").click(c);
A83.positionDialog();A83.applyHandlers();return A83.modalDialog},createModalDialog:function(a,b){b=b||{};null!==A83.modalDialog&&A83.destroy();A83.modalDialog=$('<div class="tv-dialog-shadowbox"><div class="tv-dialog tv-dialog-modal'+(b.addClass?" "+b.addClass:"")+'">'+(b.noHeader?"":'<div class="tv-dialog-title">'+(b.noClose?"":'<a class="tv-dialog-title-close"></a>')+'<span class="tv-dialog-title-text">'+a+"</span></div>")+'<div class="tv-dialog-error"></div><div class="tv-dialog-message"></div><div class="tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",
a);b.noShadowBox&&A83.modalDialog.addClass("transparent");b.addClass&&A83.modalDialog.addClass(b.addClass);b.width&&A83.modalDialog.find(".tv-dialog").css({width:b.width});b.content&&A83.modalDialog.find(".tv-dialog-content").html(b.content);var c=$(".fancybox-overlay");c.length&&(c=c.css("z-index"),$(".tv-dialog-shadowbox").css("z-index",c+1));b.zIndex&&A83.modalDialog.css("z-index",b.zIndex)},createDialog:function(a,b){if(A83.isOpen(a)){var c=A83.get(a);
c.find(".tv-dialog-content").html("");c.data("new",!1);return c}b=b||{};c=$(Mustache.render('<div class="tv-dialog tv-dialog-nonmodal {{&addClass}}"><div class="tv-dialog-title{{#hideTitle}} tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="tv-dialog-error"></div><div class="tv-dialog-message"></div><div class="tv-dialog-content"></div></div>',
{addClass:b.addClass||"",hideTitle:b.hideTitle,hideCloseCross:b.hideCloseCross,title:a})).appendTo($("body"));b.width&&c.css({width:b.width});b.content&&c.find(".tv-dialog-content").html(b.content);var d=0,d=A83.dialogs&&A83.dialogs.length?MathEx.max($.map(A83.dialogs,function(a){return parseInt((a.dialog||a).css("z-index"),10)}))+1:110;c.css("z-index",d);c.data("new",!0);c.data("title",a);c.data("id",A83.dialogs.length+1);A83.dialogs.push({title:a,dialog:c,id:A83.dialogs.length+
1});d={start:function(a,b){for(var c=b.helper.css("z-index"),d=0,l=null,m=0;m<A83.dialogs.length;m++){var n=A83.dialogs[m].dialog.css("z-index");n>d&&(d=n,l=A83.dialogs[m].dialog)}b.helper.css("z-index",d);l.css("z-index",c)}};b.dragHandle?d.handle=b.dragHandle:b.hideTitle||(d.handle=".tv-dialog-title");c.draggable(A83._constrainDraggableOptionsIfNeeded(d));return c},positionDialog:function(a,b,c){c=c||{};b=b||c.position;if(a){var d=a.width(),e=a.height(),g=$(window).width(),
h=$(window).height();b&&b.top&&b.left?(d=c.forcePosition?b.left:Math.max(2,Math.min(g-d-4,b.left))+"px",e=c.forcePosition?b.top:Math.max(2,Math.min(h-e-4,b.top))+"px"):b&&b.considerScroll?(b=$(document),d=Math.round((g-d)/2+b.scrollLeft())+"px",e=Math.round((h-e)/2+b.scrollTop())+"px"):(d=Math.round((g-d)/2)+"px",e=Math.round((h-e)/2)+"px");c.smooth?a.animate({left:d,top:e}):a.css({left:d,top:e})}else{c=function(){k.css("margin-left",-Math.round(k.outerWidth()/2)+"px");k.css("margin-top",-Math.round(k.outerHeight()/
2)+"px")};a=A83.modalDialog;var k=a.find(".tv-dialog");c();k.resize(c)}},applyHandlers:function(a,b){var c=!a||a===this.modalDialog;b=b||{};var d=c?function(){A83.destroy()}:function(){A83.destroy(a.data("title"))};a||(a=A83.modalDialog.find(".tv-dialog"));if(b.beforeDestroy)a.on("destroy",b.beforeDestroy);a.find(".tv-dialog-title .tv-dialog-title-close").on("click",d);b.doNotCloseOnBgClick||setTimeout(function(){a.on("mousedownoutside",function(c){c=$(c.target).parents().andSelf();
b.doNotCloseOnBgClickIfShadowbox&&c.is(".tv-dialog-shadowbox")||c.is(".colorpicker, .charts-popup-list, .tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container")||(a.unbind("mousedownoutside"),d())})},0);a.find('input[type="checkbox"]').change(function(){var a=$(this);a.next(".tv-dialog-checkbox-mask").toggleClass("disabled",a.prop("disabled")).toggleClass("tv-dialog-checkbox-mask-active",a.is(":checked"))});c=a.find('input[type="text"]').focus(function(){$(this).addClass("tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textactive")}).first();
Modernizr.touch||b.notFocusFirst||c.focus();a.find('input[type="password"]').focus(function(){$(this).addClass("tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textactive")});a.find("textarea").focus(function(){$(this).addClass("tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textareaactive")});a.find(".tv-dialog-checkbox-mask").click(function(){var a=$(this).prev();a.prop("disabled")||(a.prop("checked",!a[0].checked),
a.change())});$(".tv-dialog .tv-dialog-error").mouseenter(function(){$(this).animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(A83.messageInterval)});$(".tv-dialog .tv-dialog-message").mouseenter(function(){$(this).animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(A83.messageInterval)});
b.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(b){if("27"==b.keyCode)return a?A83.destroy(a.data("title")):A83.destroy(),!1})},showError:function(a,b){var c;b?(c=b.find(".tv-dialog-error"),b.width()):(c=$(".tv-dialog .tv-dialog-error"),$(".tv-dialog").width());c.text(a).css({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(A83.messageInterval);A83.messageInterval=
setInterval(function(){$(".tv-dialog .tv-dialog-error").animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(A83.messageInterval)},A83.messageDelay)},showMessage:function(a){$(".tv-dialog .tv-dialog-message").text(a).css({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(A83.messageInterval);
A83.messageInterval=setTimeout(function(){$(".tv-dialog .tv-dialog-message").animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(A83.messageInterval)},A83.messageDelay)},showStocktwitsDialog:function(a,b){return A83.showCustomDialog({title:"Send Message to stocktwits",html:Mustache.render('<textarea style="width: 100%" maxLength="120">{{text}}</textarea>',{text:a}),action:b})},
isOpen:function(a){for(var b=0;b<A83.dialogs.length;b++)if(A83.dialogs[b].title==a)return!0;return!1},get:function(a){for(var b=0;b<A83.dialogs.length;b++)if(A83.dialogs[b].title==a)return A83.dialogs[b].dialog},submit:function(a,b){var c=b?$(b):$(".tv-dialog form").first(),d=c.serialize(),c=c.attr("action");$.post(c,d,function(b){void 0!==a&&a(b)},"json")},destroy:function(a,b){void 0!==A83.chart&&(A83.chart.destroy(),delete A83.chart);$(window).unbind("keyup.hideDialog");
if(a)for(var c=0;c<A83.dialogs.length;c++)A83.dialogs[c].title==a&&(A83.dialogs[c].dialog.trigger("destroy",b),$(document).unbind("mouseup.hideDialog"+A83.dialogs[c].id),$("input",A83.dialogs[c].dialog).blur(),A83.dialogs[c].dialog.remove(),A83.dialogs.splice(c,1));else A83.modalDialog&&(A83.modalDialog.find(".tv-dialog").trigger("destroy"),A83.modalDialog.remove(),A83.modalDialog=null)},changeTitle:function(a,b){if(a)for(var c=0;c<
A83.dialogs.length;c++)if(A83.dialogs[c].title==a){var c=A83.dialogs[c],d=c.dialog,e=d.find(".tv-dialog-title");c.title=b;d.data("title",b);e.html(e.html().replace(a,b));e.find("a").on("click",function(){A83.destroy(b)});break}},calcHeight:function(a,b,c){null==c&&(c=20);a+=c;c=parseInt($("body").height(),10);a>c&&(b=Math.max(0,b-(a-c)));return b},resizeContent:function(a,b,c){null==c&&(c=20);a+=c;c=parseInt($("body").height(),10);var d=b.height();a>c&&(d=Math.max(0,d-(a-c)),
b.height(d))},resizeContentWidth:function(a,b,c){null==c&&(c=20);a+=c;c=parseInt($(window).width(),10);var d=b.width();a>c&&(d=Math.max(0,d-(a-c)),b.width(d))}};function ChartSaver(a){this.D5=a}ChartSaver.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)};ChartSaver.prototype._fillAsyncInfo=function(a,b,c){var d=JSON.parse(a.content),e=this.D5;b||(c=!0);var g=$.Deferred();c?e.asyncState(!!b).then(function(b){a.content=JSON.stringify($.extend(!0,d,b));g.resolve(a)}):e.activeChartWidget.value().asyncState(!!b).then(function(b){a.content=JSON.stringify($.extend(!0,d,b));g.resolve(a)});return g.promise()};
ChartSaver.prototype._fillSavingInfo=function(a,b){a||(b=!0);var c={publish_request_id:Math.random().toString(36).substring(2)},d=this.D5,e=d.activeChartWidget.value(),g=d.metaInfo,h=e.model().mainSeries(),k=h.properties(),l=h.symbolInfo();if(!(h&&h.symbolInfo()&&g&&l))throw new ReferenceError("Missed required data");g.id.value()&&(c.id=g.id.value());c.name=g.name.value()||"";c.description=g.description.value()||"";c.resolution=h.properties().interval.value();c.symbol_type=l.type||
"";c.exchange=l.exchange||"";c.listed_exchange=l.listed_exchange||"";h.isSpread()?(k=l.legs[0],g=l.base_name[0],g=g.split(":")[1],c.symbol=k,c.short_name=this.verifiedShortName(k,g,e),c.expression=l.full_name):(g=l.ticker||k.symbol.value(),k=k.shortName.value(),c.symbol=g,c.short_name=this.verifiedShortName(g,k,e));k=[];g=0;for(h=l.legs.length;g<h;g++)k.push({symbol:l.legs[g],pro_symbol:l.base_name[g]});c.legs=JSON.stringify(k);c.content=b?JSON.stringify(d.state(!!a)):JSON.stringify(e.state(!!a));
a&&(c.image=JSON.stringify(d.images({onlyActiveChart:!b})));c.is_realtime=a?"0":"1";return c};
ChartSaver.prototype.publishChart=function(a){function b(a,b){c.onPublish(a,$.extend({},b,{closeForm:function(){c._dialogCtl.close()},showError:function(a){A83.showError(a,c._dialogCtl.dialog)}}))}var c=this;TradingView.trackEvent("GUI","Publish Chart");$(".publish-chart-button").removeClass("inprogress");c._dialogCtl?c._dialogCtl.show():c._dialogCtl=A83.showPublishChartDialog($.extend({D6:this.D5,onPublish:b,onMinimize:function(){$(".publish-chart-button").addClass("inprogress")},
onDestroy:function(){delete c._dialogCtl;$(".publish-chart-button").removeClass("inprogress")},related:c._lastPublishUrl},a))};
ChartSaver.prototype.onPublish=function(a,b){function c(a){d.publishInProgress=!1;a=a.responseText;"ok:"===a.substr(0,3)?(a=a.substr(3),a=JSON.parse(a),d.D5.metaInfo.id.value()||d.D5.metaInfo.id.setValue(a.id),b.closeForm&&b.closeForm(),d._lastPublishUrl=a.publishUrl,d.hWnd&&(d.hWnd.location=a.publishUrl)):(b.showError&&b.showError(a||"Error occured while publishing"),d.hWnd&&(d.hWnd.close(),d.hWnd=null))}var d=this;if(!d.publishInProgress){var e=d._fillSavingInfo(!0,
b&&b.publishAllLayout);d._fillAsyncInfo(e,!0,b&&b.publishAllLayout).then(function(b){$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},b,a),complete:c})});d.publishInProgress=!0;!b.onWidget&&""!==a.name&&""!==a.description&&4E3>=a.description.length&&64>=a.name.length&&($.cookie("publish_request_id",e.publish_request_id,{path:"/"}),d.hWnd=window.open("/loading/","_blank"))}};
ChartSaver.prototype.verifiedShortName=function(a,b,c){b||(b="");c=c.model().mainSeries();var d;if(d=!c.isSpread()){var e=b,g=/^[1-9]\//;d=a.replace(g,"");e=e.replace(g,"");d=-1==d.indexOf(e)}d&&!W77.enabled("short_name_may_differ_from_fullname")&&(b=a.substr(a.indexOf(":")+1),c.properties().shortName.setValue(b),TradingView.trackEvent("Chart","short_name differs from full_name"),console.error("short_name differs from full_name"));return b};
ChartSaver.prototype.saveChartSilently=function(a,b,c,d){var e=this.D5.metaInfo;b=this._fillSavingInfo(b);d=d||{};d.chartName&&(b.name=d.chartName);$(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")});saveChart(b,e,a,c,d);$(window).off("beforeunload.savechart")};
function takeSnapshot(a,b,c,d){d=d||{};var e={wl:d.wl,images:JSON.stringify(a.images()),previews:d.previews};if(d.cme||a.activeChartWidget.value().onCmeWidget())e.cme=!0;a=W77.enabled("charting_library")?d.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/";$.post(a,e,function(a){a?b(a):c()}).fail(function(){c()})};A71=function(a,b,c){this._$tabs=a;this._$pages=b;this.options=$.extend({},this._DEFAULT_OPTIONS,c||{});this.tabChanged=new Delegate;this.initActivePage();this.initHandlers()};A71.prototype._DEFAULT_OPTIONS={saveTab:!1};A71.prototype.initActivePage=function(){var a=0;this.options.saveTab&&(a=TVSettings.getInt(this.options.saveTab,0));this.setActivePage(a)};
A71.prototype.setActivePage=function(a){this._$tabs.children().removeClass("active").eq(a).addClass("active");this._$pages.children().removeClass("active").eq(a).addClass("active");this.options.saveTab&&TVSettings.setValue(this.options.saveTab,a);this.tabChanged.fire(a)};A71.prototype.initHandlers=function(){this._$tabs.on("click","*",this._onTabClick.bind(this))};A71.prototype._onTabClick=function(a){a.preventDefault();a=$(a.currentTarget).index();this.setActivePage(a)};
A71.prototype.addPage=function(a,b){var c=this.count();this._$tabs.append(a);this._$pages.append(b);c||this.setActivePage(0);return c};A71.prototype.removePage=function(a){this._$tabs.children().eq(a).remove();this._$pages.children().eq(a).remove();a=this._$tabs.children().filter(".active").length?this._$tabs.children().filter(".active").index():0<=a-1?a-1:0;this.setActivePage(a)};A71.prototype.count=function(){return this._$tabs.children().length};
A71.prototype.index=function(){return this._$tabs.children().filter(".active:eq(0)").index()};A71.prototype.indexOfPage=function(a){return this._$pages.children().index(a)};A71.prototype.pageAt=function(a){return this._$pages.children().eq(a)};TradingView.templates={index:{chartsSection:'<div class="index-charts-tab active" id="index-charts-tab-{{index}}"><div class="index-charts-tab-sizer"><div class="index-charts-tab-container"><div class="clear"></div></div><div class="index-charts-spinner"></div></div><div class="show-more"><a href="/s/?q=&sort={{url}}" id="show-more-button">More {{sectionName}} Ideas</a></div></div>',chartsSectionItem:'<div class="item" id="chart-{{id}}"><a href="/v/{{image_url}}/"><img class="chart-img" src="{{image_mid_url}}" alt="" /></a><div class="caption">{{>iconedFollowSymbolButton}} <a href="/chart/{{short_name}}/{{#full_name_required}}?exg={{exchange}}{{/full_name_required}}" class="symbol" data-symbol="{{symbol}}">{{short_name}}</a>, <span class="interval">{{interval}}</span> <span class="count views"><span class="icon icon-eye" title="Views"></span> {{views_count}}</span><span class="count comments"><span class="icon icon-comment" title="Comments"></span> {{comment_count}}</span></div><a class="cover{{#is_online}} online{{/is_online}}" href="/v/{{image_url}}/"><img class="avatar-pic" src="{{user_picture}}" alt="{{full_name}}"/><div class="user-info">{{full_name}}{{#is_moderator}}<sup class="user-badge mod" title="Moderator}">mod</sup>{{/is_moderator}} {{^is_moderator}}{{#is_pro}}<sup class="user-badge pro{{#is_realtime}} realtime{{/is_realtime}}{{#is_trial}} trial{{/is_trial}}" title="Pro{{#is_realtime}} Realtime{{/is_realtime}}{{#is_trial}} Trial{{/is_trial}}">pro</sup>{{/is_pro}} {{/is_moderator}}<br/><span class="icon icon-charts" title="Charts"></span> {{user_charts}} <span class="icon icon-rating-small" title="Rating"></span> {{followers_count}}</div><div class="clear"></div><div class="name">{{name}}</div><div class="desc">{{desc}}</div><div class="date">{{created_time}}</div><div class="icons">{{> chartBadges}}<span class="chart-direction-label direction-{{direction}}">{{#direction_name}}{{direction}}{{/direction_name}}</span></div></a></div>'},
addressInputsRows:'<tr><td class="half" colspan="6"><p>Address</p><input class="address-autocomplete" type="text" value="" placeholder="{{#addressPlaceholder}}{{addressPlaceholder}}{{/addressPlaceholder}}{{^addressPlaceholder}}Enter your address{{/addressPlaceholder}}"/></td></tr><tr><td colspan="6"><input type="text" autocomplete-name="route" name="STREET" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.STREET}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_street }}{{/reference_transaction_billing_address}}" placeholder="Street" disabled="true"/></td></tr><tr><td class="half" colspan="3"><input type="text" autocomplete-name="locality" name="CITY" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.CITY}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_city }}{{/reference_transaction_billing_address}}" placeholder="City" disabled="true"/></td><td class="half" colspan="3"><input type="text" autocomplete-name="administrative_area_level_1" name="STATE" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.STATE}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_state }}{{/reference_transaction_billing_address}}" placeholder="State/Region" disabled="true"/></td></tr><tr><td class="half" colspan="3"><input type="text" autocomplete-name="country" name="COUNTRY" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.COUNTRY}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_country }}{{/reference_transaction_billing_address}}" placeholder="Country" disabled="true"/><input type="hidden" autocomplete-name="country_code" name="COUNTRYCODE" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.COUNTRYCODE}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_countrycode }}{{/reference_transaction_billing_address}}" /></td><td class="half" colspan="3"><input type="text" autocomplete-name="postal_code" name="ZIP" value="{{#reference_transaction_billing_address}}{{reference_transaction_billing_address.ZIP}}{{/reference_transaction_billing_address}}{{^reference_transaction_billing_address}}{{ user.billing_zip }}{{/reference_transaction_billing_address}}" placeholder="Zip Code" disabled="true"/></td></tr>',
dialogs:{paymentMethod:'<table class="tv-dialog-colomn-table"><tr><td><div class="tv-dialog-title"><span class="tv-dialog-title-text">{{title}}</span><a class="tv-dialog-title-close"></a></div><div class="main">{{#message}}<p>{{message}}</p>{{/message}}{{#pnref}}<div class="order-detail-head" data-method="oneclick-form"><h3><span class="order-checkbox radio active"></span>Make payment with previously used details</h3></div>{{/pnref}}<div class="order-detail-head" data-method="cc-form"><h3><span class="order-checkbox radio{{^pnref}} active{{/pnref}}"></span>Credit Card</h3></div><div class="order-detail-head" data-method="expresscheckout-form"><h3><span class="order-checkbox radio"></span>PayPal</h3></div>{{#pnref}}<div class="order-detail-body oneclick-form active"><p>Your credit card on file is XXXX-XXXX-XXXX-{{ cchint }}</p><form action="/paypal/oneclick/" id="oneclick-form" class="payment-form" method="post"><input type="hidden" name="pnref" value="{{ pnref }}" /><input type="hidden" name="billing_cycle" value="{{billing_cycle}}" /> <input type="hidden" name="child_products" value="{{child_products}}" /> <input type="hidden" name="exchanges_only" value="{{exchanges_only}}" /> {{#reference_transaction_billing_address_is_full}}<input name="ZIP" value="{{reference_transaction_billing_address.ZIP}}" type="hidden"><input name="STREET" value="{{reference_transaction_billing_address.STREET}}" type="hidden"><input name="CITY" value="{{reference_transaction_billing_address.CITY}}" type="hidden"><input name="STATE" value="{{reference_transaction_billing_address.STATE}}" type="hidden"><input name="COUNTRY" value="{{reference_transaction_billing_address.COUNTRY}}" type="hidden"><input name="COUNTRYCODE" value="{{reference_transaction_billing_address.COUNTRYCODE}}" type="hidden">{{/reference_transaction_billing_address_is_full}}{{^reference_transaction_billing_address_is_full}}<table id="oneclick-table">{{>addressInputsRows}}</table>{{/reference_transaction_billing_address_is_full}}</form></div>{{/pnref}}<div class="order-detail-body expresscheckout-form"><p>You will be automatically redirected to PayPal in order to finish your purchase.</p><form action="/paypal/expresscheckout/" id="expresscheckout-form" class="payment-form" method="post"><input type="hidden" name="billing_cycle" value="{{billing_cycle}}" /> <input type="hidden" name="child_products" value="{{child_products}}" /> <input type="hidden" name="exchanges_only" value="{{exchanges_only}}" /> </form></div><div class="order-detail-body cc-form{{^pnref}} active{{/pnref}}"><form action="https://{{ api_host }}" id="cc-form" class="payment-form" method="post"><input type="hidden" name="SECURETOKEN" value="" /><input type="hidden" name="SECURETOKENID" value="" /><input type="hidden" name="EXPDATE" value="" /> <table id="cc-table"><tr><td class="half" colspan="3"><p>First Name</p><input type="text" name="BILLTOFIRSTNAME" value="{{ user.first_name }}" /></td><td class="half" colspan="3"><p>Last Name</p><input type="text" name="BILLTOLASTNAME" value="{{ user.last_name }}" /></td></tr>{{>addressInputsRows}}<tr><td colspan="6"><p>Email</p><input type="text" name="BILLTOEMAIL" value="{{ user.email }}" /></td></tr><tr><td colspan="6"><p>Card Number</p><input type="text" name="ACCT" value="" /></td></tr><tr><td class="half" colspan="3"><p>Card Security Code <span id="cc-table-csc-help-link" href="#csc-help">?</span></p><input type="text" name="CVV2" value="" /></td><td colspan="3"><p>Expiration Date (MM/YY)</p><input class="exp-date" type="text" name="EXPDATEMM" value="" /><span class="slash">/</span><input class="exp-date" type="text" name="EXPDATEYY" value="" /></td></tr></table></form></div><div class="order-purchase-button"><a href="#subscribe" class="green" id="order-subscribe">{{#okText}}{{okText}}{{/okText}}{{^okText}}Subscribe{{/okText}}</a></div></div></td>{{#showTotalColumn}}<td class="tv-dialog-right-colomn"><div class="main"><div class="slip-header">Your Order</div><table class="slip-table">{{#totalsList}}<tr><td>{{name}} ({{billing_cycle_readable}})</td><td>${{cost}}</td></tr>{{/totalsList}}<tr class="slip-divider"><td colspan="2"></td></tr><tr class="slip-total"><td><b>Total</b></td><td>${{total}}</td></tr></table></div></td>{{/showTotalColumn}}</tr></table>',
proiritySupport:'<p><strong>Priority phone support</strong>: +1 (614) 285-3457<br><br>Average waiting time on the phone is less than one minute. Phone support is available Monday-Friday from 6:30 AM until 3:00 PM EST.</p><p><strong>Priority email support</strong>: <a href="mailto:premium@tradingview.com">premium@tradingview.com</a><br><br>E-mail support hours are 4:00 AM \u2013 3 PM EST Monday - Friday. Typical response time is 1 hour during business hours.</p>',publishIntro:'<div class="main"><p>Publishing means sharing your chart and trading idea with the financial web and the investing community. A published idea needs to be detailed and descriptive in order to be meaningful to other traders.</p><p>In effort to make TradingView more useful to a larger number of users, moderators have the right to hide ideas with bad descriptions or not informative from the front page and the gallery. We are NOT limiting any ways of publishing or using TradingView charts. You can still create and publish any kind of charts; your profile and Activity Stream will still show all created charts.</p><p>The best ideas are placed in the <b>Suggested</b> tab, where they receive extra exposure. All suggested ideas are hand-picked by our editorial team based on a number of criteria. We have a dedicated group of people who review every idea published every day to find the most interesting and informative ideas that will be helpful to other members.</p><p><strong>Following below suggestions will help get your ideas suggested:</strong></p><ul><li>A clear title that describes your idea. Don\u2019t just write \u201cMSFT\u201d or \u201cMSFT Short\u201d. A title like this doesn\u2019t say much and won\u2019t attract much interest to your idea.</li><li>A description that clearly states your idea. Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader\u2019s shoes and see if you\u2019d understand the context based on what you wrote. It\u2019s also a good idea to re-post descriptions right on the chart, so your idea can be shared without losing meaning.</li><li>Long-term intervals are better than short-term ones for publishing analysis. An idea on 1 minute bars will probably become obsolete by the time people read it. However a good idea may still be featured.</li><li>Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant.</li><li>Presentation is important. Too much clutter adds to confusion.</li></ul><p>In short, the more understandable and interesting your ideas are, the more you\u2019ll gain respect of others and get discovered by the financial community. We\u2019ll do our best to help showcase good ideas.</p><p>Some authors that we recommend get marked as <b>Suggested Authors</b>, and their ideas get posted to the front page automatically. The basis for recommending authors is multiple factors, which include a large number of interesting ideas. A suggested author has a corresponding badge in their profile.</p><div class="caption-text"><input id="tv-dialog-donotshow-checkbox" type="checkbox" name="donotshow"{{#do_not_show}} checked="checked"{{/do_not_show}}/><span class="tv-dialog-checkbox-mask donotshow{{#do_not_show}} tv-dialog-checkbox-mask-active{{/do_not_show}}"></span> <label for="tv-dialog-donotshow-checkbox"><strong>Do not show this message again</strong></label></div><div class="tv-dialogs-bottom-button"><a class="tv-dialog-button-blue tv-left" id="publish-intro-continue">CONTINUE</a></div></div>',
publishChartWidget:'<div class="main"><form id="publish-chart-form" autocomplete="off"><div class="caption first">IDEA TITLE AND DESCRIPTION*</div><div class="publish-text"><input type="text" name="name" maxlength="64" placeholder="A clear title that describes your idea. Don\'t just write &ldquo;MSFT&rdquo; or &ldquo;MSFT Short&rdquo;."/></div><div class="empty-caption"></div><div class="publish-text autowidth"><textarea name="description" placeholder="Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader\'s shoes and see if you\'d understand the context based on what you wrote. Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant."></textarea></div><div class="empty-caption"></div><input type="hidden" name="tags"/><div class="publish-direction-buttons clearfix"><div class="col-short"><a class="tv-button short" data-val="2">SHORT</a></div><div class="col-long"><a class="tv-button long" data-val="1">LONG</a></div><div class="col-neutral"><a class="tv-button neutral active" data-val="0">NEUTRAL</a></div></div><div class="tv-dialogs-bottom-button"><a class="tv-dialog-button-blue tv-right" id="publish-dialog-do-publish">{{^editMode}}PUBLISH IDEA{{/editMode}}{{#editMode}}EDIT IDEA{{/editMode}}</a><span class="tv-dialog-layoutpicker tv-right"></span><span class="tv-dialog-cancel-button tv-right">Cancel</span></div><input type="hidden" name="direction" value="0"/></form></div>',
publishChart:'<div class="main"><form id="publish-chart-form" autocomplete="off"><div class="caption first">IDEA TITLE AND DESCRIPTION*</div><div class="publish-text"><input type="text" name="name" maxlength="64" placeholder="A clear title that describes your idea. Don\'t just write &ldquo;MSFT&rdquo; or &ldquo;MSFT Short&rdquo;."/></div><div class="empty-caption"></div><div class="bbcode-buttons clearfix"><span tabindex="-1" class="bbcode-button bb-bold"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M12.699 7.579h3.916c3.797-.089 5.041.962 5.151 3.896.072 1.909-1.75 2.441-2.622 2.598v.098c2.103.358 3.155 1.283 3.154 3.311-.002 3.047-2.479 3.925-4.766 3.945h-4.834zm1.611 5.928c2.418.132 5.948.008 5.85-2.344-.11-2.632-3.385-2.242-5.85-2.197zm0 1.367v5.176c2.514.154 6.377.26 6.26-2.676-.104-2.597-3.656-2.5-6.26-2.5z"/></svg></span><span tabindex="-1" class="bbcode-button bb-italic"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M15.624 7.579l-.28 1.281h2.563l-2.463 11.25h-2.563l-.287 1.313h6.782l.287-1.313h-2.594l2.463-11.25h2.594l.28-1.281h-6.782z"/></svg></span><span tabindex="-1" class="bbcode-button bb-list"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M8 8h2v2h-2zM8 13h2v2h-2zM8 18h2v2h-2zM14 8h12v2h-12zM14 13h13v2h-13zM14 18h9v2h-9z"/></svg></span><span tabindex="-1" class="bbcode-button bb-embed"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M26.516 6.394a.85.85 0 0 0-.594.438l-6.719 11.094-4.406-5.469.031-.156c0-.713-.569-1.313-1.281-1.313-.713 0-1.281.6-1.281 1.313l.031.125-4.313 6.688a.85.85 0 1 0 1.438.906l4.125-6.438 4.406 5.5-.031.125c0 .713.569 1.313 1.281 1.313.713 0 1.281-.6 1.281-1.313v-.063l6.906-11.437a.85.85 0 0 0-.781-1.313.85.85 0 0 0-.094 0z"/></svg></span><div class="bbcode-embed-block"><div class="bbcode-embed-form"><input type="text" class="embed" disabled><span class="tv-dialog-button-blue embed-submit">Insert</span></div></div></div><div class="publish-text autowidth jsfluid"><textarea name="description" placeholder="Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader\'s shoes and see if you\'d understand the context based on what you wrote. Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant."></textarea></div>{{^editMode}}<div class="empty-caption"></div><div class="publish-direction-buttons clearfix"><div class="col-short"><a class="tv-button short" data-val="2">SHORT</a></div><div class="col-long"><a class="tv-button long" data-val="1">LONG</a></div><div class="col-neutral"><a class="tv-button neutral active" data-val="0">NEUTRAL</a></div></div>{{/editMode}}<div class="caption">LINK TO RELATED IDEAS</div><input class="publish-related" placeholder="Pick your idea or paste url to someone\'s else idea."><div class="caption">TAGS</div><input class="publish-tags"><div class="tv-dialogs-bottom-button">{{^editMode}}<label class="publish-dialog-privacy tv-right" title="Private Chart Publishing"><input name="public" type="checkbox" checked="checked"/><span class="publish-dialog-privacy-icon"></span></label>{{/editMode}}<a class="tv-dialog-button-blue tv-right" id="publish-dialog-do-publish">{{^editMode}}PUBLISH IDEA{{/editMode}}{{#editMode}}EDIT IDEA{{/editMode}}</a>{{^editMode}}<span class="tv-dialog-layoutpicker tv-right"></span>{{/editMode}}<span class="tv-dialog-cancel-button tv-right">Cancel</span>{{^editMode}}<div class="tv-left repost-to"><span class="repost-to-label">Repost to</span><input id="tv-dialog-twitter-checkbox" type="checkbox" name="twitter"{{#has_twitter}} checked="checked"{{/has_twitter}}/><label for="tv-dialog-twitter-checkbox" class="repost-to-twitter"><span class="icon"></span></label><input id="tv-dialog-stocktwits-checkbox" type="checkbox" name="stocktwits"{{^has_twitter}}{{#has_stocktwits}} checked="checked"{{/has_stocktwits}}{{/has_twitter}}/><label for="tv-dialog-stocktwits-checkbox" class="repost-to-stocktwits"><span class="icon"></span></label><div class="clear"></div></div>{{/editMode}}</div><input type="hidden" name="direction" value="0"/></form></div>',
goPro:{layout:'<div class="col-main"><div class="col-copy"></div><div class="actions-block"><a class="no-button">No, thank you</a>{{^exchangesButton}}{{^trialButton}}<a href="/gopro/" target="_blank" class="yes-button">Upgrade now<span class="arrow-icon"></span></a>{{/trialButton}}{{#trialButton}}<a href="/gopro/" target="_blank" class="yes-button">30 Day Free Trial</a>{{/trialButton}}{{/exchangesButton}}{{#exchangesButton}}<a href="/gopro/" target="_blank" class="yes-button" onclick="pro.visitExchangesPage({newWindow: true}); return false;">Add real-time markets</a>{{/exchangesButton}}</div></div><div class="col-aside"><div class="col-bg"></div><div class="col-copy"><h2>Why <em>Go Pro</em>?</h2><ul><li>Official real-time &amp; intraday data</li><li>Intraday Renko, Kagi, Line Break, PnF charts</li><li>Intraday Spread Charts</li><li>Volume Profile Indicators</li><li>Custom Intervals</li><li>Unlimited saved charts</li><li>Multiple Watch Lists</li><li>Hot Lists</li><li>PRO Badge &amp; Adding Value</li><li>Extended Trading Hours</li><li>Multiple Charts Layout</li><li>Unlimited number of indicators on a chart</li></ul></div></div><div class="clear"></div>',
defaultCopy:"<h2>Upgrade your account</h2><p>This functionality is available only to PRO users.</p><p>Please consider subscribing to our PRO service which includes many other features not available in the free membership.</p>",features:{proRtSymbol:"<h2>Official AMEX, NYSE&nbsp;&amp; NASDAQ Real-time Data</h2><p>You requested a symbol that is available only to PRO Plus and Premium users. You will now be switched to the equivalent BATS symbol.</p><p>NASDAQ and NYSE charge exchange and per-user fees, which means we can\u2019t give this for free to everyone (as much as we'd love&nbsp;to). Our free feed is provided by BATS electronic exchange, which offers approximate volumes and prices with fewer updates.</p><p>If you need only the most complete and accurate data, then consider subscribing to the PRO Plus or Premium service from only $19.95/m that offers actual real-time data from the NYSE/NASDAQ/AMEX exchanges and much more.</p>",
kagiRenko:"<h2>Renko, Kagi, Line Break, Point&nbsp;&amp;&nbsp;Figure</h2><p>Only PRO Plus and Premium subscribers can access intraday Renko, Kagi, Line Break, Point & Figure charts. You will now be switched to a Daily (D) interval.</p><p>Intraday Renko, Kagi, Line Break and Point & Figure charts take considerable resources, so we can't give them out for free to everyone (as much as we'd like&nbsp;to). We can, however, give out these charts for free in the Daily and Weekly resolutions.</p><p>If you do intraday analysis consider subscribing to PRO Plus or Premium service from only $19.95/m.</p>",
hotLists:"<h2>Hot Lists</h2><p>You requested a hotlist that is available only to PRO users.</p><p>HotLists continuously scan the US stock market to identify best trading opportunities and take considerable resources, so we can't give them out for free to everyone (as much as we'd like&nbsp;to).</p><p>If you want to identify opportunities in an efficient manner, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.</p>",
intradaySpread:"<h2>Intraday Spread</h2><p>You requested an intraday spread symbol that is available only to PRO Plus and Premium users. You will now be switched to a Daily (D) interval.</p><p>Spreads for intraday charts are calculated based on 1-minute bars, and then recompiled into the selected interval. This approach is the only correct one, but requires significant server power. This means we can't give spread charts for free to everyone (as much as we'd like&nbsp;to).</p><p>If you do intraday spread analysis consider subscribing to PRO Plus or Premium service from only $19.95/m.</p>",
customIntervals:"<h2>Custom Intervals</h2><p>You requested a custom interval that is available only to PRO&nbsp;users.</p><p>This feature allows you to create any chart, such as 7&nbsp;minutes, 12&nbsp;minutes, or 8&nbsp;hours. If you want to identify opportunities on custom intervals in an efficient manner, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.</p>",multipleWatchLists:"<h2>Multiple Watch Lists</h2><p>Multiple Watch Lists available only to PRO users.</p><p>Any custom watchlist can be saved under a unique name and loaded at any time with one click. All lists are available from any computer, so you have your workspace wherever you go.</p><p>If you want to use different watchlists to quickly assess different sectors of the market, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.</p>",
extendedHours:"<h2>Extended Trading Hours</h2><p>Only PRO Plus and Premium subscibers can access extended hours data on the charts. Extended trading hours include both pre-market and after hours sessions each day the market is open.</p><p>If you want to act quickly to news and events that occur when the regular market is closed, please consider subscribing to PRO Plus or Premium service from only $19.95/m.</p>",multipleCharts:"<h2>Multiple Charts Layout</h2><p>Multiple Charts Layout available only to PRO users.</p><p>You can plot up to 8 charts in one tab of your browser. Moreover, it\u2019s possible to link your charts by resolutions or symbols. And even use global cursor that synchronizes many charts.</p><p>If you want to unlock the power of multiple time frame analysis and add multiple symbols to the same chart layout, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.</p>",
alerts:"<h2>Unlimited server-side alerts</h2><p>You already set {{options.maxAlertsNumber}} alerts. Upgrade to PRO Plus to set unlimited custom alerts and improve your experience!</p><p>TradingView alerts run on powerful and backed-up servers, so you\u2019ll always get notified when something happens and won\u2019t miss a beat. This takes considerable resources, so we can't give an unlimited number of alerts to everyone for free (as much as we'd like to).</p><p>Become a PRO Plus user for just $19.95 and get unlimited alerts! You also get a ton of other useful features, like multiple charts on the same screen, custom chart timeframe like 3-min charts, and our sincere thanks!</p>",
intradayExchange:"<h2>Official real-time, intraday and volume data</h2><p>Only PRO, PRO Plus and Premium users that have a subscription to {{exchange}} Exchange can get official data on real-time prices, volume and intraday history. You'll now be switched to the Daily (D) interval, which is available to all users.</p><p>Exchanges charge per-user fees and redistribution fees from TradingView for delivery of intraday and real-time data. So, we can't give this data for free to everyone (as much as we'd like to).</p><p>If you do intraday analysis, consider subscribing to the {{exchange}} exchange.{{^exchangesButton}} You must subscribe to PRO, PRO Plus or Premium service first (from only 9.95/m).{{/exchangesButton}}</p>",
savedChartsLimit:"<h2>Unlimited Saved Charts</h2><p>You can save up to 5 charts with your subscription. Upgrade to PRO, PRO Plus or Premium membership and save unlimited charts, along with many other exciting features. Starting from only $9.95 a month - upgrade today!</p>",studyLimit:"<h2>Unlimited number of indicators on a chart</h2><p>Your free account allows you to apply up to 10 studies to a chart. Upgrade to PRO, PRO Plus or Premium account to have as many studies on a chart as you want, as well as many other exciting features.</p><p>We are happy to give away as many things for free as possible, however studies are server-based and this takes considerable resources. So we can't give an unlimited number of indicators to everyone for free (as much as we'd like to).</p><p>Become a Pro user for just $9.95 and get unlimited studies! You also get a ton of other useful features, like multiple charts on the same screen, custom chart timeframe like 3-min charts, and our sincere thanks because you support further development of TradingView!</p>",
savedChartsForAlertLimit:"<h2>Unlimited Saved Charts</h2><p>To set an alert on a drawing requires the chart to be saved. Unfortunately you have already saved 5 charts. Upgrade to PRO, PRO Plus or Premium account and save as many charts as you want, along with many other exciting features. Starts from only $9.95 a month - upgrade today!</p>"}},addSymbol:' <div class="main"> <div class="symbol-edit-place"></div>{{#overlayOption}} <div class="tv-dialog-relative">\t<input id="tv-dialog-addsymbol-overlay-checkbox" type="checkbox" name="addsymbol-overlay" {{#overlayOptionChecked}}checked="checked"{{/overlayOptionChecked}} />\t<span class="tv-dialog-checkbox-mask tv-dialog-checkbox-mask{{#overlayOptionChecked}}-active{{/overlayOptionChecked}}"></span>\t<label for="tv-dialog-addsymbol-overlay-checkbox"> Overlay the main chart</label> </div>{{/overlayOption}} <div class="tv-dialogs-bottom-button"> <span class="tv-button tv-right tv-uppercase ok">{{okButtonTitle}}</span> </div> </div>',
billingCycleSelection:'<div class="main billing-cycle-dialog"><div class="bcd-title">Subscription Plans</div><div class="bcd-subtitle">You\'re subscribing to {{ product_title }}</div><div class="bcd-choice-container clearfix"><div class="bcd-choice active" data-cycle="y"><div class="bcd-choice-bg"></div><div class="bcd-choice-marker"></div><div class="bcd-choice-copy"><h5>Buy Annual</h5><div class="bcd-prices"><p>${{price_1_m}} per month</p><p>${{price_1_y}} per year</p><p>Save ${{savings}}</p><p>No monthly invoices</p></div></div></div><div class="bcd-choice" data-cycle="m"><div class="bcd-choice-bg"></div><div class="bcd-choice-marker"></div><div class="bcd-choice-copy"><h5>Buy Monthly</h5><div class="bcd-prices"><p>${{price_2_m}} per month</p><p>${{price_2_y}} per year</p><p>Invoiced every month</p></div></div></div></div><div class="bcd-continue"><a class="bcd-continue-button">Continue</a></div></div>',
symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-cion"></div></div></div><div class="filter"></div><div class="results"></div>',proRTTrialOffer:'<div class="main"><h3>Your Personal Invitation to&nbsp;Go&nbsp;PRO Plus</h3><p>For a limited time, we\u2019re offering a <strong>FREE 1 month</strong> subscription of PRO Plus (no credit card required, no catches or hidden autobilling).</p><p>Our PRO Plus users see amazing benefits. You get advanced trading opportunities using multi symbol statistical arbitrage techniques. <a href="/gopro/" target="_blank">Read more about PRO Plus features</a>.</p><div class="big-buttons two-buttons"><a href="javascript://" class="big-button trial">Activate Offer and GO PRO</a><a href="javascript://" class="big-button nothanks">No, thank you</a></div></div>',
earlyAccess:'<div class="main"><h3>Early Access 50% off{{#is_finished}}&nbsp;&ndash; Final&nbsp;chance{{/is_finished}}</h3>{{#is_1wk}}<p>So&hellip; You\u2019ve had free PRO Plus for a week now. Seeing the advantages?</p><ul><li>Multiple charts layout and watch lists</li><li>Custom intervals and unlimited alerts</li><li>Intraday Renko, Kagi, Line Break, PnF and spread charts</li><li>Volume profile indicators and extended trading hours</li></ul><p>If you like what you see, you have an exclusive chance to get <strong>12&nbsp;months for only $179.4</strong>. That\u2019s less than $15/month and 50% off regular month-to-month payments.</p><p>Do you want to take advantage of this offer now?</p>{{/is_1wk}}{{#is_2wk}}<p>Oh no! You have only 2&nbsp;weeks left in your PRO Plus trial! These benefits will expire in two short weeks:</p><ul><li>Multiple charts layout and watch lists</li><li>Custom intervals and unlimited alerts</li><li>Intraday Renko, Kagi, Line Break, PnF and spread charts</li><li>Volume profile indicators and extended trading hours</li></ul><p>Just for you, we made a special deal that lets you continue for another <strong>12&nbsp;months for only $179.4</strong>. That\u2019s less than $15/month and 50% off regular month-to-month payments.</p><p><strong>Low price available now&nbsp;&ndash; don\u2019t miss this chance!</strong></p>{{/is_2wk}}{{#is_finished}}<p>Don\u2019t cry&hellip; but your free PRO Plus trial has ended! We hope you benefited from useful features and felt good about yourself for supporting the community.</p><p>Now is your <strong>LAST and FINAL</strong> chance to get 12&nbsp;months for <strong>only $179.4</strong> (regular $360). That\u2019s less than $15/month and 50% off regular month-to-month payments.</p><p>Remember, with PRO Plus you benefit from:</p><ul><li>Multiple charts layout and watch lists</li><li>Custom intervals and unlimited alerts</li><li>Intraday Renko, Kagi, Line Break, PnF and spread charts</li><li>Volume profile indicators and extended trading hours</li></ul><p>Don\u2019t miss the last chance to get the special Early Access and secure this low rate! <strong>Act now!</strong></p>{{/is_finished}}{{#is_manual}}<p>Upgrade and get 50% off regular month-to-month payments!</p><p>Just for you, we made a special deal that lets you continue for another 12&nbsp;months for <strong>only $179.4</strong>. That is less than $15/month. Don\u2019t miss the last chance to get the special Early Access and secure this low rate! Act now!</p><p>Remember, with PRO Plus you benefit from:</p><ul><li>Multiple charts layout and watch lists</li><li>Custom intervals and unlimited alerts</li><li>Intraday Renko, Kagi, Line Break, PnF and spread charts</li><li>Volume profile indicators and extended trading hours</li></ul>{{/is_manual}}<div class="big-buttons"><a href="javascript://" class="big-button ordernow">Early Access for $15/Month</a></div><div class="more-controls"><a href="javascript://" class="nothanks">No, thank you</a></div></div>',
auth:'<div class="main"><h2 class="auth-dialog-title"><span class="">Sign Up</span></h2><div class=""><div class="auth-dialog-socials"><a class="auth-dialog-social-facebook">Facebook</a><a class="auth-dialog-social-twitter">Twitter</a><a class="auth-dialog-social-google">Google+</a><a class="auth-dialog-social-stocktwits">StockTwits</a><a class="auth-dialog-social-linkedin">Linked In</a><a class="auth-dialog-social-yahoo">Yahoo!</a></div><div class="auth-dialog-separator"><span class="auth-dialog-separator-copy">Or</span></div></div><div class=""><form id="signup-form" action="/accounts/signup/"><label class="auth-dialog-field"><input name="email" type="text"><span class="auth-dialog-field-placeholder">E-mail</span></label><label class="auth-dialog-field"><input name="username" type="text"><span class="auth-dialog-field-placeholder">Username</span></label><label class="auth-dialog-field"><input name="password" type="password"><span class="auth-dialog-field-placeholder">Password</span></label><input type="hidden" name="signup_trial" value="0"><div class="auth-dialog-notice"><p>By clicking on &ldquo;Sign Up&rdquo; below, you are agreeing to the <a href="/policies/" target="_blank">Terms of Service</a>.</p><p>Note: e-mail will not be publicly displayed.</p></div><div class="auth-dialog-submit"><button class="" type="submit">Sign Up</button></div></form><div class="auth-dialog-footnote">Already have an account? <a class="signin-link">Sign in</a></div></div></div>',
signin:'<div class="main"><h2 class="auth-dialog-title"><span class="show-if-signin">Sign In</span></h2><div class=""><div class="auth-dialog-socials"><a class="auth-dialog-social-facebook">Facebook</a><a class="auth-dialog-social-twitter">Twitter</a><a class="auth-dialog-social-google">Google+</a><a class="auth-dialog-social-stocktwits">StockTwits</a><a class="auth-dialog-social-linkedin">Linked In</a><a class="auth-dialog-social-yahoo">Yahoo!</a></div><div class="auth-dialog-separator"><span class="auth-dialog-separator-copy">Or</span></div></div><div class=""><form id="signin-form" action="/accounts/signin/"><label class="auth-dialog-field"><input name="username" type="text"><span class="auth-dialog-field-placeholder">Username</span></label><label class="auth-dialog-field"><input name="password" type="password"><span class="auth-dialog-field-placeholder">Password</span></label><div class="auth-dialog-group"><label class="auth-dialog-remember"><span class="auth-dialog-remember-pseudo"><input type="checkbox" name="remember" checked /><i class="auth-dialog-remember-view"></i></span><span class="auth-dialog-remember-text">Remember me</span></label><a class="auth-dialog-recover recover-link">Forgot password?</a></div><div class="auth-dialog-submit"><button type="submit">Sign In</button></div></form><div class="auth-dialog-footnote">If you don\'t have an account, <a class="signup-link">Sign&nbsp;up</a></div></div></div>',
recover:'<div class="main"><h2 class="auth-dialog-title recover"><span class="">Recover Password</span></h2><div class=""><form id="recover-form" action="/accounts/forgot_password/"><label class="auth-dialog-field"><input name="email" type="text"><span class="auth-dialog-field-placeholder">E-mail</span></label><div class="auth-dialog-submit"><button type="submit">Recover</button></div></form></div></div>'},lists:{savedCharts:"<ul>{{#charts}}<li><a href='/e/{{url}}/'><span class='name'>{{name}}</span> <span class='subscript'>{{modified}}{{#short_symbol}} | {{short_symbol}}{{#interval}}, {{interval}}{{/interval}}{{/short_symbol}}</span> <span class='icon icon-carousel-item-delete-dark' title='Delete' data-id='{{url}}'></span></a></li>{{/charts}}</ul>"},
userlink:"<a href='/u/{{username}}/' class='userlink'>{{username}}</a>{{> userBadge}}",userBadge:"{{#is_top}}{{> topBadge}}{{/is_top}}{{^is_top}}{{#is_moderator}}{{> modBadge}}{{/is_moderator}}{{^is_moderator}}{{#is_pro}}{{> proBadge}}{{/is_pro}}{{/is_moderator}}{{/is_top}}",proBadge:'<{{badge_tag}}{{^badge_tag}}a href="/gopro/"{{/badge_tag}} class="apply-common-tooltip user-badge pro{{#is_realtime}} realtime{{/is_realtime}}{{#is_premium}} premium{{/is_premium}}{{#is_trial}} trial{{/is_trial}}{{#large_badge}} large{{/large_badge}}" title="{{#is_realtime}}Pro Realtime{{/is_realtime}}{{#is_premium}}Premium{{/is_premium}}{{#is_trial}}Pro Trial{{/is_trial}}{{^is_realtime}}{{^is_premium}}{{^is_trial}}Pro{{/is_trial}}{{/is_premium}}{{/is_realtime}}">pro</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>',
modBadge:"<{{badge_tag}}{{^badge_tag}}a href='/house-rules/'{{/badge_tag}} class='user-badge mod{{#large_badge}} large{{/large_badge}} apply-common-tooltip' title='Moderator'>mod</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>",topBadge:"<{{badge_tag}}{{^badge_tag}}a href='/people/'{{/badge_tag}} class='user-badge top{{#large_badge}} large{{/large_badge}} {{badge_class}} apply-common-tooltip' title='{{badge_title}}'>top</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>",chartBadges:'{{#is_hot}}<span class="icon icon-chart-recommended" title="Suggested Chart"></span>{{/is_hot}}',
iconedFollowSymbolButton:'{{#pro_symbol}}<button class="follow-symbol iconed{{#current_user_follows_symbol}} active{{/current_user_follows_symbol}}" data-symbol="{{pro_symbol}}" title="Follow {{pro_symbol}}"></button>{{/pro_symbol}}',globalNotification:'<div class="tv-global-notification" id="global-notification-{{ id }}"><div class="tv-layout-width"><span class="icon icon-notification-info"></span>{{{ text }}}</div><span class="global-notification-close"><i class="icon icon-notification-close"></i></span></div>',
actionsLog:'<div class="entry"><b>{{#is_system}}<img src="/static/images/small-logo.png" class="log-system-message"/>system{{/is_system}}{{^is_system}}<a href="/u/{{username}}" target="_blank">{{username}}</a>{{/is_system}}</b><div class="entry-time time-upd">{{ created_timestamp }}</div> <div class="message">{{{text}}}</div></div>',onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',
userlinkPopup:'<div class="msg-userlink-popup" data-id="{{ id }}"><div class="msg-userlink-popup-container"><a class="userpic" href="/u/{{ username }}/"><img class="userpic" src="{{#has_picture}}{{big_picture_url}}{{/has_picture}}{{^has_picture}}{{mid_picture_url}}{{/has_picture}}"/></a><div class="content"><div class="username">{{> userlink}}<span class="btc-tip"></span></div><div class="user-stats-small"><span class="user-stats-followers" title="Followers">{{followers_count}}</span><span class="user-stats-charts" title="Charts">{{charts_count}}</span><span class="user-stats-reputation" title="Reputation">{{reputation}}</span></div>{{^is_self}}<div class="action-buttons"><button class="follow-user follow-user-{{ id }}{{#follow_status}} active{{/follow_status}}" title="{{#follow_status}}Unfollow{{/follow_status}}{{^follow_status}}Follow{{/follow_status}}" data-id="{{ id }}"><span class="follow">Follow</span><span class="following">Followed</span><span class="unfollow">Unfollow</span></button> <button class="message-user message active" title="Send message" data-username="{{ username }}" data-id="{{ id }}"><span class="message">Message</span></button></div>{{/is_self}}</div><div class="clear"></div>{{#status}}<div class="user-status">{{status}}</div>{{/status}}<div class="send-form"><p>To: <strong>{{ username }}</strong></p><p><textarea name="message-text"></textarea></p><p class="actions"><button class="message-user active send">Send</button><button class="message-user cancel">Cancel</button></p></div></div></div>',
miniWidgetWizardAddSymbol:'<tr class="symbol-item"><td>{{symbol}}</td><td>{{description}}</td><td>{{timeframe}}</td><td><div class="remove-symbol"></div></td></tr>',userInfoWidgetButtons1:'<div class="buttons layout-2-buttons"><button class="profile-action profile-edit" data-id="{{ id }}" data-username="{{ username }}" title="Edit profile"><span class="">Edit</span></button><button class="profile-action profile-signout" title="Sign out" onclick="signOut(); return false;"><span class="">Sign out</span></button><div class="clear"></div></div>',
userInfoWidgetButtons2:'<div class="buttons layout-1-buttons"><button class="follow-user {{ is_followed_css }} follow-user-{{ id }}" data-id="{{ id }}"><span class="follow" title="Follow"></span><span class="following" title="Following"></span><span class="unfollow" title="Unfollow"></span></button><div class="clear"></div></div>',userInfoWidgetButtons3:'<div class="buttons layout-1-buttons"><button class="profile-action profile-signin" title="Sign in" onclick="runOrSignIn(function() {}); return false;"><span class="">Sign in</span></button><div class="clear"></div></div>'};TradingView.postMessageWrapper=function(){var a={},b={},c={},d,e=0,g=0;window.addEventListener&&window.addEventListener("message",function(c){var e;try{e=JSON.parse(c.data),W77.enabled("charting_library_debug_mode")&&console.log("PostMessage: incoming message: "+JSON.stringify(e))}catch(g){return}e.provider&&"TradingView"==e.provider&&("get"==e.type&&b[e.name]?b[e.name].call(e,e.data,function(a){d.postMessage(JSON.stringify({id:e.id,type:"on",name:e.name,client_id:e.client_id,data:a,provider:"TradingView"}),
"*")}):"on"==e.type?a[e.client_id]&&a[e.client_id][e.id]&&(a[e.client_id][e.id].call(e,e.data),delete a[e.client_id][e.id]):"post"==e.type&&"function"===typeof b[e.name]&&b[e.name].call(e,e.data,function(){}))});return function(h,k){a[k]={};d=c[k]=h;postClientId="";return{on:function(a,c){b[a]=c},get:function(b,d,g){b={id:e++,type:"get",name:b,client_id:k,data:d,provider:"TradingView"};a[k][b.id]=g;c[k].postMessage(JSON.stringify(b),"*")},post:function(a,b,c){b={id:g++,type:"post",name:b,client_id:postClientId,
data:c,provider:"TradingView"};a&&"function"===typeof a.postMessage&&a.postMessage(JSON.stringify(b),"*")},setClientId:function(a){postClientId=a}}}}();TradingView.QuoteTabbedWidget=function(a,b,c){this._id=a;this.$container=b;this._tabs=c||b.data("quoteTabs");this.visible=new WatchedValue(!0);this.animationInProcess=new WatchedValue(!0);this._init()};
TradingView.QuoteTabbedWidget.prototype._init=function(){var a=this;a.$container.empty();a.$container.addClass("quote-tabbed-widget");var b=a.$tabs=$('<div class="tabs"></div>'),c=a.$pages=$('<div class="pages"></div>');a._tabs.forEach(function(a){a.symbols=$.map(a.symbols||[],function(a){if(!a.last||!a.pctchange||!a.pctchangedir)return"undefined"!==typeof a.last&&delete a.last,"undefined"!==typeof a.pctchange&&delete a.pctchange,"undefined"!==typeof a.pctchangedir&&delete a.pctchangedir,a;"down"===
a.pctchangedir?a.changeColor=PriceColorer.formatSign(-1):"up"===a.pctchangedir&&(a.changeColor=PriceColorer.formatSign(1));return a});b.append(Mustache.render('<div class="tab">{{title}}</div>',a));a=$(Mustache.render('<div class="page-wrapper"><div class="page"><table>{{#symbols}}<tr data-symbol={{symbol_full}} {{^last}}data-need-quote-ticker=true{{/last}}><td class="name"><a href="/chart/{{symbol_full}}/" data-symbol={{symbol_full}} class="chart-link{{^symbol}} symbol-short-name{{/symbol}}">{{#symbol}}{{symbol}}{{/symbol}}</a></td><td class="ticker"><span class="symbol-last">{{last}}</span>&nbsp;<span class="symbol-change-pt" {{#changeColor}}style="color: {{changeColor}} "{{/changeColor}}>{{#pctchange}}({{pctchange}}){{/pctchange}}</span></td><td class="chart-cell"><a href="/e/?symbol={{symbol_full}}" class="chart"></a></td></tr>{{/symbols}}</table></div></div>',
a));c.append(a)});var d=new A71(b,c,{saveTab:this._activeTabKey()});a._onTabChanged(d.index());d.tabChanged.subscribe(a,a._onTabChanged);var e=$('<div class="tabs-wrapper"></div>');b.appendTo(e);a.$container.append(e);a.$container.append(c);a.visible.subscribe(function(b){a.$pages.children().each(function(c){c=b?d.index()===c:!1;a._setPageActive($(this),c,!0)})});a.animationInProcess.subscribe(function(b){a.$pages.children().each(function(c){(c=$(this).data("chart"))&&(b?c.unbindOnResize():
a.visible.value()&&c.bindOnResize())})})};TradingView.QuoteTabbedWidget.prototype._onTabChanged=function(a){var b=this;b.$pages.children().each(function(c){b._setPageActive($(this),a===c)})};
TradingView.QuoteTabbedWidget.prototype._setPageActive=function(a,b,c){function d(){a.find("tr").each(function(b){b=$(this);var c=b.data("symbol");if(c){if(b.data("quoteTicker"))b.data("quoteTicker").enabled=!0;else if(b.data("needQuoteTicker")){var d=new TradingView.QuoteTicker(c,b,{changePercentInBrackets:!0});b.data("quoteTicker",d)}b.data("chart")?b.data("chart").connect():(c=new TradingView.MiniChart(c,b.find(".chart"),{minHeight:18,showMessage:!1,onlyLastBars:30,timeframe:{value:"1m"},chartOptions:{grid:{xIsVisible:!1,
yIsVisible:!1},xScale:{visible:!1},yScale:{visible:!1},plot:{line:{color:"#2e5c75",width:1},belowLineFillStyle:"rgba(46,94,117, 0.2)"}}}),a.resize(c.widget.onResize),b.data("chart",c))}})}function e(){a.find("tr").each(function(a){a=$(this);a.data("quoteTicker")&&(a.data("quoteTicker").enabled=!1);a.data("chart")&&a.data("chart").disconnect()})}b?(clearTimeout(a.data("turnOffTimeout")),d()):a.data("turnOffTimeout",setTimeout(function(){e()},1E3*(c?0:60)))};
TradingView.QuoteTabbedWidget.prototype._activeTabKey=function(){return"undefined"!==typeof this._id?"marketsummary.quotestabbedwidget."+this._id+".activetabindex":null};$(function(){var a=$("#market-summary-header"),b=$("#market-summary-body");a.length&&b.length&&(TradingView.marketSummary=new TradingView.MarketSummary(a,b))});
TradingView.MarketSummary=function(a,b){this.$button=$(".market-summary-toggle");this.$header=a;this.$body=b;this.animationInProcess=new WatchedValue(!1);this.bodyIsVisible=new WatchedValue(!1);this.toggled=new Delegate;this.initHeader();this.$button.click(this.toggle.bind(this));IS_OPENED_BY_DEAFAULT=!0;this.toggle(TVSettings.getBool("marketsummary.opened",IS_OPENED_BY_DEAFAULT));loginStateChange.subscribe(this,function(){is_authenticated&&this.toggle(TVSettings.getBool("marketsummary.opened",IS_OPENED_BY_DEAFAULT))})};
TradingView.MarketSummary.POPULAR_QUOTES_TABED_WIDGET=0;TradingView.MarketSummary.ACTIVE_QUOTES_TABED_WIDGET=1;TradingView.MarketSummary.prototype.initHeader=function(){this._initQouteTickers();this._bindChartSearchToLinks()};
TradingView.MarketSummary.prototype.toggle=function(a){function b(){c.animationInProcess.setValue(!1);c.toggled.fire(d)}var c=this;if(!c.animationInProcess.value()){c.animationInProcess.setValue(!0);c.$button.toggleClass("opened",a);var d=c.$button.hasClass("opened");d?c.$body.slideDown(function(){b();c.chart()||c._initChart();c.activeQuotes()||c._initActiveQuotes();c.popularQuotes()||c._initPopularQuotes()}.bind(c)):c.$body.slideUp(b);c.bodyIsVisible.setValue(d);TVSettings.setValue("marketsummary.opened",
d)}};TradingView.MarketSummary.prototype._initQouteTickers=function(){this.$header.find(".market-summary-quote-ticker").each(function(){var a=$(this);new TradingView.QuoteTicker(a.data("symbol"),a)})};TradingView.MarketSummary.prototype.chart=function(){return this._chart};TradingView.MarketSummary.prototype.activeQuotes=function(){return this._activeQuotes};TradingView.MarketSummary.prototype.popularQuotes=function(){return this._popularQuotes};
TradingView.MarketSummary.prototype._initChart=function(){function a(a,b){"boolean"!==typeof b&&(b=!a.hasClass("chart-legend-colored"));var c=a.data();a.find("a").css("border-left-color",b?c.color:"transparent");a.toggleClass("chart-legend-colored",b)}for(var b=this,c=[],d=b.$header.find(".market-summary-quote-ticker.chart-legend"),e=0;e<d.length;e++){var g=d.eq(e),h=g.data();c.push({symbol:h.symbol,options:{line:{color:h.color}}});a(g,!0)}b._chart=new TradingView.MiniChart(c,b.$body.find(".tickers-chart"),
{showMessage:!1,timeframe:{visible:!0,value:"5y"},showTimeframes:!0,chartOptions:{minHeight:18,grid:{xIsVisible:!1,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#3a3b43"}},yScale:{visible:!0,position:"right",isPercentage:!0,paddingLeft:10,paddingRight:4,marginInPercents:10,font:{size:10,family:"Helvetica",color:"#57585d"},drawOverPlotArea:!1,drawTickMarkLine:!1,maxTickMarkAmount:5},xScale:{visible:!1},plot:{line:{width:2},belowLineFillStyle:"transparent",aboveLineFillStyle:"transparent"},
loading:{showWhileNoPlots:!0}}});b.bodyIsVisible.subscribe(function(c){c?b._chart.connect():b._chart.disconnect();d.each(function(){a($(this),c)})});b.animationInProcess.subscribe(function(a){a?b._chart.widget().unbindOnResize():b.bodyIsVisible.value()&&b._chart.widget().bindOnResize()})};TradingView.MarketSummary.prototype._initActiveQuotes=function(){this._activeQuotes=this._createQuotesWidget(TradingView.MarketSummary.ACTIVE_QUOTES_TABED_WIDGET,this.$body.find(".active-quotes"))};
TradingView.MarketSummary.prototype._initPopularQuotes=function(){this._popularQuotes=this._createQuotesWidget(TradingView.MarketSummary.POPULAR_QUOTES_TABED_WIDGET,this.$body.find(".populars-quotes"))};TradingView.MarketSummary.prototype._createQuotesWidget=function(a,b){var c=new TradingView.QuoteTabbedWidget(a,b);this.bodyIsVisible.subscribe(function(a){c.visible.setValue(a)});this.animationInProcess.subscribe(function(a){c.animationInProcess.setValue(a)});this._bindChartSearchToLinks();return c};
TradingView.MarketSummary.prototype._bindChartSearchToLinks=function(a,b){this.$header.add(this.$body).find("a.chart-link:not(.inited)").addClass("inited").click(function(a){if(TradingView.searchCharts&&TradingView.searchCharts.queryField&&TradingView.searchCharts.form){var b=$(this).data("symbol");b&&(TradingView.searchCharts.queryField.val(b),TradingView.searchCharts.form.submit(),a.preventDefault())}})};TradingView.Symbology=function(){};TradingView.Symbology.prototype.convertTo=function(a,b,c){return a};TradingView.Symbology.prototype.convertFrom=function(a){return a};TradingView.YahooSymbology=function(){this.specialFromCases={};for(var a in this.specialCases)this.specialFromCases[this.specialCases[a]]=a;this.exchangeFromMap={};for(a in this.exchangeMap)this.exchangeFromMap[this.exchangeMap[a]]=a};inherit(TradingView.YahooSymbology,TradingView.Symbology);
TradingView.YahooSymbology.prototype.convertTo=function(a,b,c){return a in this.specialCases?this.specialCases[a]:"forex"==b?a+"=X":"TSX"==c?a+".TO":"TSXV"==c?a+".V":"MICEX"==c?a+".ME":"COMEX"==c?a+".CMX":"CME"==c?a+".CME":"CBOT"==c?a+".CBT":"index"==b?"^"+a:a};TradingView.YahooSymbology.prototype.convertFrom=function(a){if(a in this.specialFromCases)return this.specialFromCases[a];var b=a.split("."),c=b[1];return c?(a=this.exchangeFromMap["."+c])?a+":"+b[0]:null:a};
TradingView.YahooSymbology.prototype.exchangeFromMap={};TradingView.YahooSymbology.prototype.exchangeMap={TSX:".TO",TSXV:".V",MICEX:".ME",COMEX:".CMX",CME:".CME",CBOT:".CBT"};TradingView.YahooSymbology.prototype.specialFromCases={};TradingView.YahooSymbology.prototype.specialCases={ESP35:"^IBEX",FRA40:"^FCHI",GER30:"^GDAXI",JPN225:"^N225",NAS100:"^NDX",SPX500:"SPY",SUI30:"^SSMI",UK100:"^FTSE",FTSE:"^DJI",USDOLLAR:"^USDOLLAR",DOWI:"^DJI",DOWT:"^DJT",DOWU:"^DJU"};TradingView.StockTwitsSymbology=function(){};inherit(TradingView.StockTwitsSymbology,TradingView.Symbology);TradingView.StockTwitsSymbology.prototype.convertTo=function(a,b,c){return"futures"==b?a+"_F":a};TradingView.NewsProvider=function(a){if(!this.isValidProvider(a))throw new TypeError("Invalid provider: "+a);this._provider=new this.providers[a];this._baseURL=this._BASE_URL+a+"/"};TradingView.NewsProvider.prototype.isValidProvider=function(a){return a in this.providers};
TradingView.NewsProvider.prototype.providers={yahoo:function(){this.symbology=new TradingView.YahooSymbology},stocktwits:function(){this.symbology=new TradingView.StockTwitsSymbology},fxwirepro:function(){this.symbology=new TradingView.Symbology;this.package_name="tv-fxwirepro";this.feed_realtime="fxwirepro_realtime";this.feed_delayed="fxwirepro_delayed"},futuresmag:function(){this.symbology=new TradingView.Symbology}};
TradingView.NewsProvider.prototype._BASE_URL=W77.enabled("trading_terminal")?"https://www.tradingview.com/headlines/":"/headlines/";TradingView.NewsProvider.prototype.getURLforSymbol=function(a,b,c){a=this.convertSymbol(a,b,c);return this._baseURL+"symbol/"+a+"/"};TradingView.NewsProvider.prototype.convertSymbol=function(a,b,c){return this.getProvider().symbology.convertTo(a,b,c)};TradingView.NewsProvider.prototype.getURLforCategory=function(a){return this._baseURL+"category/"+a+"/"};
TradingView.NewsProvider.prototype.getURLforSpread=function(a){a=a.join(",");return this._baseURL+"spread/"+a+"/"};TradingView.NewsProvider.prototype.getBySymbol=function(a,b,c){var d=this.getProvider(),e="",e=$.isFunction(d.getURLforSymbol)?d.getURLforSymbol(a,b,c):this.getURLforSymbol(a,b,c);return $.ajax(e,{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
TradingView.NewsProvider.prototype.getBySpread=function(a,b,c){var d=this.getProvider();a=a.map(function(a,d){a=A68.ticker(a);return d?a:this.convertSymbol(a,b,c)}.bind(this));var e="",e=$.isFunction(d.getURLforSpread)?d.getURLforSpread(a,b,c):this.getURLforSpread(a);return $.ajax(e,{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
TradingView.NewsProvider.prototype.getByCategory=function(a){var b=this.getProvider();$.isFunction(b.getURLforCategory)?b.getURLforCategory(a):this.getURLforCategory(a);return $.ajax(this.getURLforCategory(a),{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
TradingView.NewsProvider.prototype._onReceived=function(a){if(a)return a.forEach(function(a){a.published=new Date(1E3*a.published)}),$.isFunction(this.getProvider().itemTransform)?a.map(this.getProvider().itemTransform,this._provider):a};TradingView.NewsProvider.prototype.init=function(a){var b=this.getProvider();$.isFunction(b.init)&&b.init(this,a)};TradingView.NewsProvider.prototype.update=function(a){$.isFunction(this.getProvider().update)&&this.getProvider().update(a)};
TradingView.NewsProvider.prototype.destroy=function(){$.isFunction(this.getProvider().destroy)&&this.getProvider().destroy();this.getProvider().$message instanceof $&&this.getProvider().$message.remove()};TradingView.NewsProvider.prototype.options=function(a){return $.isFunction(this.getProvider().getOptions)?this.getProvider().getOptions(a):!1};TradingView.NewsProvider.prototype.getProvider=function(){return this._provider};
TradingView.NewsProvider.prototype.providers.yahoo.prototype.init=function(a,b){this._newsWidget=b.newsWidget;this._providerBase=a};TradingView.NewsProvider.prototype.providers.yahoo.prototype.getURLforSymbol=function(a,b,c){return"MTGOX"==c?this._providerBase.getURLforCategory("bitcoin"):"futures"!=b&&"cfd"!=b||a in this.symbology.specialCases?this._providerBase.getURLforSymbol(a,b,c):this._providerBase.getURLforCategory("futures")};
TradingView.NewsProvider.prototype.providers.yahoo.prototype.getURLforSpread=function(a,b,c){return"MTGOX"==c?this.getByCategory("bitcoin"):"futures"==b||"cfd"==b?this.getByCategory("futures"):this._providerBase.getURLforSpread(a)};TradingView.NewsProvider.prototype.providers.yahoo.prototype.itemTransform=function(a){return{id:a.id,link:a.link,published:a.published,title:a.title,source:this.getSource(a)}};
TradingView.NewsProvider.prototype.providers.yahoo.prototype.getSource=function(a){var b=a.summary&&a.summary.match(/\[[^\-]+\]/g);if(b)return b[0].replace(/\[(at )?|\]/g,"");for(addr in this.NewsSources)if(~a.link.indexOf(addr))return this.NewsSources[addr];return"Yahoo Finance"};
TradingView.NewsProvider.prototype.providers.yahoo.prototype.NewsSources={"allthingsd.com":"AllThingsD","ap.org":"AP","bankrate.com":"Bankrate.com","barrons.com":"Barrons.com","bizjournals.com":"Business Journals","bloomberg.com":"Bloomberg","businessinsider.com":"Business Insider","businesswire.com":"Business Wire","businessweek.com":"BusinessWeek","cnbc.com":"CNBC","cnnmoney.com":"CNNMoney.com","newswire.ca":"CNW Group",consumerreports:"Consumer Reports",creditcards:"CreditCards.com","dailyfx.com":"DailyFX",
"entrepreneur.com":"Entrepreneur",etfdb:"ETF Database",etftrends:"ETF Trends",etfguide:"ETFguide",etfzone:"ETFZone","ft.com":"Financial Times","forbes.com":"Forbes","fortune.cnn.com":"Fortune","foxbusiness.com":"Fox Business","futuresmag.com":"Futuresmag.com",gftforex:"GFT Forex","globenewswire.com":"GlobeNewswire",indieresearch:"IndieResearch",indexuniverse:"IndexUniverse.com","investopedia.com":"Investopedia","investors.com":"Investor's Business Daily",kiplinger:"Kiplinger","marketwatch.com":"MarketWatch",
marketwire:"Marketwire",minyanville:"Minyanville","money.cnn.com":"Money",morningstar:"Morningstar","fool.com":"Motley Fool","nytimes.com":"New York Times","oilprice.com":"Oilprice.com",optionetics:"Optionetics",optionmonster:"optionMONSTER","paidcontent.org":"paidContent.org",newswire:"PR Newswire","reuters.com":"Reuters","seekingalpha.com":"Seeking Alpha","smallcapinvestor.com":"SmallCapInvestor.com",smartmoney:"SmartMoney",atlantic:"The Atlantic","wsj.com":"The Wall Street Journal","theflyonthewall.com":"Theflyonthewall.com",
"thestreet.com":"TheStreet",thomsonreuters:"Thomson Reuters ONE",usnews:"US News & World Report","wallstcheatsheet.com":"Wall St. Cheat Sheet",transcript:"Wall Street Transcript",zacks:"Zacks"};TradingView.NewsProvider.prototype.providers.yahoo.prototype.update=function(a){a=TradingView.NewsWidget.prototype.providers.yahoo.title;this._newsWidget._quoteMetaInfo&&this._newsWidget._quoteMetaInfo.name&&(a+=" for "+this._newsWidget._quoteMetaInfo.name);this._newsWidget._bridge.setTitle(a)};
TradingView.NewsProvider.prototype.providers.stocktwits.prototype.init=function(a,b){this._newsWidget=b.newsWidget};TradingView.NewsProvider.prototype.providers.stocktwits.prototype.update=function(a){a=TradingView.NewsWidget.prototype.providers.stocktwits.title;this._newsWidget._quoteMetaInfo&&this._newsWidget._quoteMetaInfo.name&&(a+=" for "+this._newsWidget._quoteMetaInfo.name);this._newsWidget._bridge.setTitle(a)};
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.init=function(a,b){this._pushstream_channel=this.feed_realtime;this._providerBase=a;this._newsWidget=b.newsWidget;this.currencies={};pro.hasPackage(this.package_name)||(this._pushstream_channel=this.feed_delayed,this._newsWidget.D2.value().delayedWarningShown||(this.showDelayedWarning(),this._newsWidget.updateProperties({delayedWarningShown:!0})));this.setTitle();TradingView.pushStreamMultiplexer.on(this._pushstream_channel,
function(a){a=this.filterNews(a);if(b.onData)b.onData(a,{incremental:!0})}.bind(this))};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getURLforSymbol=function(a,b,c){a=this._providerBase.convertSymbol(a,b,c);b=pro.hasPackage(this.package_name)?this.feed_realtime:this.feed_delayed;return this._providerBase._BASE_URL+b+"/symbol/"+a+"/"};
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getURLforSpread=function(a,b,c){b=pro.hasPackage(this.package_name)?this.feed_realtime:this.feed_delayed;a=a.join(",");return this._providerBase._BASE_URL+b+"/spread/"+a+"/"};
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.update=function(a){this.currencies={};if(Array.isArray(a))for(var b=0;b<a.length;b++)this.currencies[a[b].substr(0,3)]=1,this.currencies[a[b].substr(3,3)]=1;else this.currencies[a.substr(0,3)]=1,this.currencies[a.substr(3,3)]=1};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.destroy=function(){TradingView.pushStreamMultiplexer.off(this._pushstream_channel)};
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.filterNews=function(a){return a.filter(function(a){a.published=new Date(1E3*a.published);return""==a.currency||a.currency in this.currencies},this)};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.showAboutDialog=function(){pro.showProductDialog(this.package_name)};
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.showDelayedWarning=function(){var a=$('<div class="widgetbody-overlay"><span class="ns-fxwire-message-close"></span><div class="ns-fxwire-message"><h3>This is delayed news feed</h3><p>This is delayed FxWire PRO news feed. Want real-time updates and more features?</p><a href="#">Learn More</a></div></div>').appendTo(this._newsWidget._bridge.$body);a.find(".ns-fxwire-message a").click(function(){this.showAboutDialog();a.remove()}.bind(this));
a.find(".ns-fxwire-message-close").click(function(){a.remove()});this.$message=a};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.setTitle=function(a){a="FxWire Pro "+(pro.hasPackage(this.package_name)?"Realtime":"Delayed");this._newsWidget._bridge.setTitle(a)};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getOptions=function(){return[{title:"About and Subscription",action:this.showAboutDialog.bind(this)}]};
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.categories={all:"All Content",news:"News","market-analysis":"Market Analysis","trading-strategies":"Trading Strategies",blogs:"Blogs",commodities:"Commodities",forex:"Forex",options:"Options"};TradingView.NewsProvider.prototype.providers.futuresmag.prototype.getURLforSymbol=function(a,b,c){return this._providerBase.getURLforCategory(this._category)};
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.init=function(a,b){this._news=b.newsWidget;this._providerBase=a;this.setCategory(this._news.D2.value().category||"all",!0)};TradingView.NewsProvider.prototype.providers.futuresmag.prototype.setCategory=function(a,b){this._category=a;this._news.updateProperties({category:a});this._news._bridge.setTitle("Futures Magazine - "+this.categories[a]);b||this._news.update()};
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.getOptions=function(){function a(a){return function(){this.setCategory(a)}.bind(this)}var b=[],c;for(c in this.categories)b.push({title:this.categories[c],action:a.call(this,c),active:c==this._category});b.push({separator:1});b.push({title:"About",action:this.showAboutDialog.bind(this)});return b};
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.showAboutDialog=function(){A83.showNotice("About Futuresmag News Feed","For 40 years Futures has been a thought leader and independent voice of the commodity, futures, options, forex and stock trader. Here is a list of our services, information and directories to help you learn to or continue to trade successfully.")};A45=function(){function a(a,m){function r(u){function A(b){if(W77.enabled("same_data_requery")||J.value()!==b)m?m.setSymbol(b):a.setSymbol(b)}function v(){b.setValue(J.value())}function B(){d.setValue(F.actualSymbol())}function D(){c.setValue(G.shortName.value());var a=F.symbolInfo();a?(B(),a.hasOwnProperty("supported_resolutions")?h.setValue(a.supported_resolutions):h.setValue(void 0),g.setValue(!!a.has_intraday)):g.deleteValue()}function C(b){if(W77.enabled("same_data_requery")||
E.value()!==b)m?m.setResolution(b):a.setResolution(b)}function z(){e.setValue(E.value())}a.modelCreated().unsubscribe(null,r);var F=a.model().mainSeries(),G=F.properties(),J=G.symbol;J.subscribe(null,v);b.setValue(J.value());b.subscribe(A);F.onSymbolResolved().subscribe(null,B);b.hook=function(a){F.symbolSameAsCurrent(a)&&(a=F.actualSymbol());return a};F.onSymbolResolved().subscribe(null,D);F.onSymbolError().subscribe(null,D);D();var E=G.interval;E.subscribe(null,z);e.setValue(E.value());e.subscribe(C);
a.readOnly()&&(b.writeLock=!0);k=function(){J.unsubscribe(null,v);b.unsubscribe(A);F.onSymbolResolved().unsubscribe(null,D);F.onSymbolError().unsubscribe(null,D);E.unsubscribe(null,z);e.unsubscribe(C);delete b.hook;delete b.writeLock;k=new Function;l=new Function}}k();l=function(){return a};var u=a.model();u?r(u):(a.modelCreated().subscribe(null,r),k=function(){a.modelCreated().unsubscribe(null,r);k=new Function;l=new Function},u=a.properties().mainSeriesProperties,b.setValue(u.symbol.value()),e.setValue(u.interval.value()))}
var b=new WatchedValue,c=new WatchedValue,d=new WatchedValue,e=new WatchedValue,g=new WatchedValue,h=new WatchedValue,k=new Function,l=new Function,m=new Function;return{symbol:b,actualSymbol:d,seriesShortSymbol:c.readonly(),interval:e,intraday:g.readonly(),supportedResolutions:h.readonly(),bindToChartWidget:a,unbindFromChartWidget:function(){k()},getChartWidget:function(){return l()},bindToSearchCharts:function(a){function c(a){e=!0;b.setValue(a.resolved_symbol);e=!1}function d(b){e||a.search(b)}
m();var e=!1;a.onSearchBySymbol.subscribe(null,c);b.subscribe(d);m=function(){a.onSearchBySymbol.unsubscribe(null,c);b.unsubscribe(d);m=new Function}},unbindFromSearchCharts:function(){m()},bindToChartWidgetCollection:function(b){k();b.activeChartWidget.subscribe(function(c){k();a(c,b)},{callWithLast:!0})}}}();function linkingSetSymbol(a){a&&"string"===typeof a&&($(".header-chart-panel .symbol-edit-wrap input").val(A68.shortName(a)),A45.symbol.setValue(a))};A15={force_prefix:"forcefeaturetoggle.",enableFeature:function(a){localStorage[this.force_prefix+a]="true"},disableFeature:function(a){localStorage.removeItem(this.force_prefix+a)}};
TradingView.D18=function(a){function b(b){return localStorage["featuretoggle."+b]=Math.random()<=a[b]}if(TradingView.pushStreamMultiplexer)TradingView.pushStreamMultiplexer.on("featuretoggle",function(c){a[c.name]=c.state;b(c.name)});return function(c){if("local"===window.environment||"true"===localStorage[A15.force_prefix+c]||window.is_authenticated&&"undefined"!=typeof user&&user&&user.settings[A15.force_prefix+c])return!0;if(!a[c])return!1;
if(1===a[c])return!0;var d=localStorage["featuretoggle."+c];return void 0===d||null===d?b(c):"true"===d}}(window.featureToggleState||{});(function(a){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var b=function(b){return(a.devicePixelRatio||1)/(b.backingStorePixelRatio||b.webkitBackingStorePixelRatio||b.mozBackingStorePixelRatio||b.msBackingStorePixelRatio||b.oBackingStorePixelRatio||b.backingStorePixelRatio||1)}(document.createElement("canvas").getContext("2d"));2>b||(a.hidpiCanvasRatio=b,function(a){a.drawImagePatchedSource=a.drawImage;a.drawImagePatchedSourceAndDest=a.drawImage;(function(a,b){for(var c in a)a.hasOwnProperty(c)&&
b(a[c],c)})({fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4],drawImagePatchedSourceAndDest:[1,2,3,4,5,6,7,8]},function(d,e){var g=a[e];a[e]=function(){var a,c;if("all"===d)for(c=[],a=arguments.length;0<a--;)c[a]=arguments[a]*b;else for(c=Array.prototype.slice.call(arguments),
a=d.length;0<a--;)c[d[a]]&&(c[d[a]]*=b);return g.apply(this,c)}});a.drawImage=function(a){return function(){return arguments[0]instanceof HTMLCanvasElement?a.drawImagePatchedSourceAndDest.apply(this,arguments):a.drawImagePatchedSource.apply(this,arguments)}}(a);a.fillText=function(a){return function(){var c=Array.prototype.slice.call(arguments);c[1]*=b;c[2]*=b;this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c*b+d});a.apply(this,c);this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,
function(a,c,d){return c/b+d})}}(a.fillText);a.strokeText=function(a){return function(){var c=Array.prototype.slice.call(arguments);c[1]*=b;c[2]*=b;this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c*b+d});a.apply(this,c);this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c/b+d})}}(a.strokeText)}(CanvasRenderingContext2D.prototype),function(a){a.getContext=function(a){return function(c){var g=a.call(this,c);"2d"===c&&this.width!=Math.floor(parseInt(this.style.width)*
b)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=b,this.height*=b);return g}}(a.getContext)}(HTMLCanvasElement.prototype))}})(window);!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=.01+c/d*100;d=Math.max(1-(1-a)/b*(100-c),a);var g=m.substring(0,m.indexOf("Animation")).toLowerCase();return q[e]||(r.insertRule("@"+
(g&&"-"+g+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",r.cssRules.length),q[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;d<n.length;d++)if(c=n[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function g(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)void 0===a[d]&&(a[d]=
c[d])}return a}function h(a,b){return"string"==typeof a?a:a[b%a.length]}function k(a){this.opts=g(a||{},k.defaults,u)}function l(){function c(b,d){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',d)}r.addRule(".spin-vml","behavior:url(#default#VML)");k.prototype.lines=function(a,d){function g(){return e(c("group",{coordsize:n+" "+n,coordorigin:-m+" "+-m}),{width:n,height:n})}function k(a,l,n){b(q,b(e(g(),{rotation:360/d.lines*a+"deg",left:~~l}),b(e(c("roundrect",{arcsize:d.corners}),
{width:m,height:d.width,left:d.radius,top:-d.width>>1,filter:n}),c("fill",{color:h(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var l,m=d.length+d.width,n=2*m;l=2*-(d.width+d.length)+"px";var q=e(g(),{position:"absolute",top:l,left:l});if(d.shadow)for(l=1;l<=d.lines;l++)k(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=d.lines;l++)k(l);return b(a,q)};k.prototype.opacity=function(a,b,c,d){a=a.firstChild;d=d.shadow&&d.lines||0;a&&b+
d<a.childNodes.length&&(a=a.childNodes[b+d],a=a&&a.firstChild,a=a&&a.firstChild,a&&(a.opacity=c))}}var m,n=["webkit","Moz","ms","O"],q={},r=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),u={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2E9,className:"spinner",top:"50%",left:"50%",position:"absolute"};k.defaults={};g(k.prototype,{spin:function(b){this.stop();
var c=this,d=c.opts,g=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width;if(e(g,{left:d.left,top:d.top}),b&&b.insertBefore(g,b.firstChild||null),g.setAttribute("role","progressbar"),c.lines(g,c.opts),!m){var h,k=0,l=(d.lines-1)*(1-d.direction)/2,n=d.fps,q=n/d.speed,r=(1-d.opacity)/(q*d.trail/100),u=q/d.lines;!function P(){k++;for(var a=0;a<d.lines;a++)h=Math.max(1-(k+(d.lines-a)*u)%q*r,d.opacity),c.opacity(g,a*d.direction+l,h,d);c.timeout=
c.el&&setTimeout(P,~~(1E3/n))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,g){function k(b,c){return e(a(),{position:"absolute",width:g.length+g.width+"px",height:g.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/g.lines*n+g.rotate)+"deg) translate("+g.radius+"px,0)",borderRadius:(g.corners*g.width>>1)+"px"})}for(var l,n=0,q=(g.lines-1)*(1-g.direction)/
2;n<g.lines;n++)l=e(a(),{position:"absolute",top:1+~(g.width/2)+"px",transform:g.hwaccel?"translate3d(0,0,0)":"",opacity:g.opacity,animation:m&&c(g.opacity,g.trail,q+n*g.direction,g.lines)+" "+1/g.speed+"s linear infinite"}),g.shadow&&b(l,e(k("#000","0 0 4px #000"),{top:"2px"})),b(d,b(l,k(h(g.color,n),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var w=e(a("group"),{behavior:"url(#default#VML)"});return!d(w,"transform")&&
w.adj?l():m=d(w,"animation"),k});IntervalHelper=function(){var a={},b=/^(\d*)([DWM])$/;a.isDWM=function(a){return(a=b.exec(a+""))?{qty:a[1]||"1",unit:a[2]}:!1};a.isAvailable=function(a){var b=A45.supportedResolutions.value(),e=!1,e="undefined"!=typeof b?-1!=b.indexOf(a):!0;return A45.intraday.value()?e:this.isDWM(a)&&e};a.isMinute=function(a){a=parseInt(a);return 1<=a&&1440>=a};a.isHour=function(a){return 60<=a&&!(a%60)};return a}();StudyInputsHelper=function(){function a(a,b){var c=b.slice(0).toLowerCase();if(a){for(var d=0;d<a.size();++d)if(a.item(d).description.toLowerCase()===c||a.item(d).shortDescription.toLowerCase()===c)return a.item(d);throw Error("Can't find metainfo for `"+b+"`");}throw Error("There is no studies metainfo at all");}function b(a){return a.inputs.map(function(a){return{id:a.id,type:a.type,name:a.name}})}function c(c,d,e){e=a(e.model().studiesMetaData(),c);var l=b(e),m={},n;for(n in d){var q=n.toLowerCase(),
r=l.filter(function(a){return a.name.toLowerCase()===q});0===r.length?console.warn("Uknown input `"+n+"` of `"+c+"`"):(r=r[0],m[r.id]=d[n])}return{id:e.id,name:c,inputs:m}}var d={},e={bool:function(a){return!!a},integer:function(a){return parseInt(a)},"float":function(a){return parseFloat(a)},string:function(a){return a}};d.getStudyRecordFromArray=function(c,d){d=d||D3;var k;var l=d;if(isArray(c)){var m=c.slice(0);k=m[0];for(var l=a(l.model().studiesMetaData(),k),n=l.is_price_study,q=b(l),
r,m=m.splice(1),u=0;u<m.length;++u)r||(r={}),r[q[u].id]=(e[q[u].type]||e.string)(m[u]);k={id:l.id,name:k,overlay:n,inputs:r}}else l=a(l.model().studiesMetaData(),c),k={id:l.id,overlay:l.is_price_study};return k};d.getStudyRecordFromObject=function(a,b,d){d=d||D3;return c(a,b,d)};return d}();A82.ChartapiMessager=function(a,b){this._server=a;this._session=b;this._timezone=null};A82.ChartapiMessager.prototype.setTimezone=function(a){this._timezone="exchange"==a?"exchange":PineJsCalendar.get_timezone(a)};A82.ChartapiMessager.prototype.onRequestMetadata=function(a,b){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,a,b]})};
A82.ChartapiMessager.prototype.onSymbolResolved=function(a,b){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSymbolError=function(a,b){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onStudyError=function(a,b){this._server.receiveLocalResponse({method:"study_error",params:[this._session,a,b]})};
A82.ChartapiMessager.prototype.onSeriesLoading=function(a,b){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSeriesCompleted=function(a,b,c){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,a,c,b]})};A82.ChartapiMessager.prototype.onSeriesError=function(a,b){this._server.receiveLocalResponse({method:"series_error",params:[this._session,a,b]})};
A82.ChartapiMessager.prototype.onSeriesClearData=function(a,b){var c={};c[a]={series:[],turnaround:b};this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,c,{index:0,zoffset:0,changes:[],marks:[]}]})};A82.ChartapiMessager.prototype.onStudyCompleted=function(a,b){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,a,b]})};
A82.ChartapiMessager.prototype.onStudyLoading=function(a,b){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,a,b]})};
A82.ChartapiMessager.prototype.onTickmarksUpdated=function(a,b,c){b=b.slice(0);var d=PineJsCalendar.get_timezone(c.timezone);for(c=0;c<b.length;++c)b[c]=this.timeInTimezone(b[c],d);var d=[],e=[],g;for(c=0;c<b.length;++c){var h=b[c];d.push([this._spanByTime(h,g),h,a+c]);e.push(h);g=h}this._server.receiveLocalResponse({method:"tickmark_update",params:[this._session,{index:a,zoffset:0,changes:e,marks:d}]})};
A82.ChartapiMessager.prototype.onTimescaleUpdate=function(a,b,c,d,e){c=c.slice(0);var g=PineJsCalendar.get_timezone(d.timezone);for(d=0;d<c.length;++d)c[d].value[0]=this.timeInTimezone(c[d].value[0],g);g={};g[a]={series:c,turnaround:b};a=[];b=[];var h;for(d=0;d<c.length;++d){var k=c[d].value[0];a.push([this._spanByTime(k,h),k,e+d]);b.push(k);h=k}this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,g,{index:e,zoffset:0,changes:b,marks:a}]})};
A82.ChartapiMessager.prototype.onSeriesTimeframeUpdate=function(a,b,c,d,e){this._server.receiveLocalResponse({method:"series_timeframe",params:[this._session,a,b,c,d,e]})};A82.ChartapiMessager.prototype.onPointsetDataUpdate=function(a,b,c,d){this._onDataUpdate(a,b,c,void 0,d,1)};A82.ChartapiMessager.prototype.onDataUpdate=function(a,b,c,d,e){this._onDataUpdate(a,b,c,d,e,0)};
A82.ChartapiMessager.prototype._onDataUpdate=function(a,b,c,d,e,g){c=c.slice(0);e=PineJsCalendar.get_timezone(e.timezone);for(var h=0;h<c.length;++h)c[h].value[g]=this.timeInTimezone(c[h].value[g],e);g={};d=d?JSON.stringify({offsets:d}):"";g[a]={s:c,ns:{d:d,indexes:[]},turnaround:b};this._server.receiveLocalResponse({method:"data_update",params:[this._session,g]})};A82.ChartapiMessager.prototype.onQuotesData=function(a){this._server.receiveLocalResponse({method:"quote_symbol_data",params:a})};
A82.ChartapiMessager.prototype.timeInTimezone=function(a,b){return"exchange"==this._timezone?parseInt(PineJsCalendar.utc_to_cal(b,1E3*a).valueOf()/1E3):parseInt(PineJsCalendar.utc_to_cal(this._timezone,1E3*a).valueOf()/1E3)};A82.ChartapiMessager.prototype.timeInGMT=function(a,b){return"exchange"==this._timezone?parseInt(PineJsCalendar.cal_to_utc(b,new Date(1E3*a))/1E3):parseInt(PineJsCalendar.cal_to_utc(this._timezone,new Date(1E3*a))/1E3)};
A82.ChartapiMessager.prototype._spanByTime=function(a,b){var c=[{divisor:1,span:20},{divisor:3E5,span:21},{divisor:18E5,span:22},{divisor:36E5,span:30},{divisor:108E5,span:31},{divisor:216E5,span:32},{divisor:432E5,span:33}];if(b){var d=new Date(1E3*b),e=new Date(1E3*a);if(e.getYear()!=d.getYear())return 70;if(e.getUTCMonth()!=d.getUTCMonth())return 60;if(e.getUTCDate()!=d.getUTCDate())return 50;for(var g=c.length-1;0<=g;--g)if(Math.floor(d/c[g].divisor)!=Math.floor(e/c[g].divisor))return c[g].span}else return 20};
ChartapiMessagerInstances=[];A82.ChartApi=function(a){this._notificationHandlers=[];this._sessions=[];this.studyCounter=0;this._enabled=this._connected=!1;this._studyEngine=new A79(a);this._callbacks={};this._symbolIdCache={};this._seriesIdCache={};this._recentSeriesId=null;this._enableLogging=!1;this._enabledMoreBarsRequest=!0;var b=this;this._studyEngine.on("configuration_received",function(){b._fireEvent("configuration_received")});this._studyEngine.on("realtime_tick",function(a){b._fireEvent("realtime_tick",
{time:a.value[0]/1E3,open:a.value[1],high:a.value[2],low:a.value[3],close:a.value[4],volume:a.value[5]})});this._autosavePause=void 0;this._setupAutoSave();TradingView.availableTimezones=[{id:"UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")}].concat([{id:"Europe/Athens",title:"Athens"},{id:"Europe/Berlin",title:"Berlin"},{id:"America/Bogota",title:"Bogota"},{id:"Asia/Bangkok",title:"Bangkok"},{id:"America/Argentina/Buenos_Aires",title:"Buenos Aires"},{id:"America/Chicago",title:"Chicago"},
{id:"Asia/Hong_Kong",title:"Hong Kong"},{id:"Asia/Kolkata",title:"Kolkata"},{id:"Europe/London",title:"London"},{id:"America/Los_Angeles",title:"Los Angeles"},{id:"Europe/Madrid",title:"Madrid"},{id:"Europe/Moscow",title:"Moscow"},{id:"America/New_York",title:"New York"},{id:"Europe/Paris",title:"Paris"},{id:"America/Sao_Paulo",title:"Sao Paulo"},{id:"Asia/Seoul",title:"Seoul"},{id:"Asia/Shanghai",title:"Shanghai"},{id:"Asia/Singapore",title:"Singapore"},{id:"Australia/Sydney",title:"Sydney"},{id:"Asia/Taipei",
title:"Taipei"},{id:"Asia/Tehran",title:"Tehran"},{id:"Asia/Tokyo",title:"Tokyo"},{id:"America/Toronto",title:"Toronto"},{id:"America/Vancouver",title:"Vancouver"},{id:"Europe/Warsaw",title:"Warsaw"}].map(function(a){a.title=$.t(a.title);return a}).sort(function(a,b){return a.title.localeCompare(b.title)}))};A82.ChartApi.prototype.purgeCache=function(a){this._symbolIdCache={};delete this._recentSeriesId;this._studyEngine.purgeCache();this._studyEngine.purgeRangeExtensionData()};
A82.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(a){this._enabledMoreBarsRequest=a};A82.ChartApi.prototype.setTimeFramesList=function(a){this._timeframes=[];for(var b=/(\d+)(\w+)/,c=0;c<a.length;++c){var d=a[c],e=b.exec(d.text),g=e[2].toLowerCase(),e=parseInt(e[1]),h="y"==g?12*e+"m":e+g,k=PineJS.Symbol.parsePeriod(d.resolution);this._timeframes.push({text:e+$.t(g,{context:"dates",count:e}),value:h,targetResolution:d.resolution,requiresIntraday:k.isIntraday})}};
A82.ChartApi.prototype._setupAutoSave=function(){var a=this,b=!1;A77.undoStack().onChange().subscribe(this,function(){a._autosavePause?b=!0:(a._fireEvent("onAutoSaveNeeded",void 0,!0),a._autosavePause=setTimeout(function(){b&&a._fireEvent("onAutoSaveNeeded",void 0,!0);a._autosavePause=void 0;b=!1},5E3))})};A82.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols};
A82.ChartApi.prototype.availableTimeFrames=function(a,b){return a?this._timeframes.filter(function(b){return b.requiresIntraday&&!a.has_intraday||a.supported_resolutions&&0>a.supported_resolutions.indexOf(b.targetResolution)?!1:!0}):[]};A82.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||{1:1,3:1,5:1,15:1,30:1,45:1,60:1,120:1,180:1,240:1,D:1,W:1,M:1}};A82.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()};
A82.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()};A82.ChartApi.prototype.start=function(){this._enabled=!0;this._fireEvent("start_enabled")};A82.ChartApi.prototype._logMessage=function(a){this._enableLogging&&console.log(a)};A82.ChartApi.prototype.unsubscribe=function(a,b){var c=this._callbacks[a];c&&c.splice(c.indexOf(b),1)};
A82.ChartApi.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};A82.ChartApi.prototype._fireEvent=function(a,b,c){if(this._callbacks.hasOwnProperty(a)){var d=this._callbacks[a].slice(0);c||(this._callbacks[a]=[]);for(a=0;a<d.length;++a)d[a](b)}};A82.ChartApi.prototype.setAuthToken=function(a,b){throw"This method is not implemented";};A82.ChartApi.prototype.authTokenRequired=function(a){return!1};
A82.ChartApi.prototype.chartCreateSession=function(a,b){};A82.ChartApi.prototype.chartDeleteSession=function(a){};A82.ChartApi.prototype.createSession=function(a,b){ChartapiMessagerInstances[a]=new A82.ChartapiMessager(this,a);this._sessions[a]=b;this._notificationHandlers[a]=b;if(this.connected())b.onMessage({method:"connected",params:[]})};A82.ChartApi.prototype.removeSession=function(a){delete this._sessions[a];delete this._notificationHandlers[a];this.chartDeleteSession(a)};
A82.ChartApi.prototype.connected=function(){return this._connected};A82.ChartApi.prototype._getHost=function(a){return a};A82.ChartApi.prototype._isSafari5=function(){return!!navigator.appVersion.match(/\/5\.[^\/]*?Safari\//)};A82.ChartApi.prototype._isIE9=function(){return!!navigator.appVersion.match(/MSIE 9/)};A82.ChartApi.prototype._isIOS5=function(){return!!navigator.appVersion.match(/iPad, CPU 5/)};
A82.ChartApi.prototype._getPort=function(a){return this._isSafari5()||this._isIE9()?8081:a};A82.ChartApi.prototype.connect=function(){if(this._enabled)this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}));else{var a=this;this.on("start_enabled",function(){a.connect()})}};A82.ChartApi.prototype.disconnect=function(){throw"This method is not implemented";};
A82.ChartApi.prototype.switchTimezone=function(a,b){ChartapiMessagerInstances[a].setTimezone(b);if(this._recentSeriesId){this._studyEngine.purgeEndOfDataFlags(this._recentSeriesId);var c=this;this._doWhenSeriesSymbolIdIsReady(this._recentSeriesId,function(b){c._studyEngine.recreateSources(b.name,c._seriesIdCache[c._recentSeriesId].resolution,a);c._doWhenSeriesDataReceived(function(){var e=c._seriesIdCache[c._recentSeriesId].resolution,g=D3.model().mainSeries().data().last();c._studyEngine.rebuildExtrapolatedData(a,
b.name,e,b.info,1E3*g.value[0])})})}};A82.ChartApi.prototype.receiveLocalResponse=function(a){this._logMessage("< "+a.method);this._dispathNotification(a);this._fireEvent("message_"+a.method,void 0,!0)};A82.ChartApi.prototype.getMarks=function(a,b,c,d,e){this._studyEngine.getMarks(a,b,c,d,e)};
A82.ChartApi.prototype.resolveSymbol=function(a,b,c,d,e){function g(b,d){ChartapiMessagerInstances[a].onSymbolError(b,d);h._symbolIdCache[b]={name:c,status:"invalid_symbol"};h._fireEvent(b+"_resolve_fail");h._fireEvent("resolve_fail",b)}this._notificationHandlers[a][b]=new HandlerInfo(d,b);this._symbolIdCache[b]=null;var h=this;this._studyEngine.resolveSymbol(c,function(d){d.errmsg?g(b,d.errmsg):(h._symbolIdCache[b]={name:c,info:d,status:"ok"},h._fireEvent(b+"_resolved",d),h._fireEvent("symbol_resolved",
{symbolInfo:d,symbolId:b}),ChartapiMessagerInstances[a].onSymbolResolved(b,d))},function(a){g(b,a)})};A82.ChartApi.prototype._doWhenSymbolIdIsReady=function(a,b){function c(){e&&(b({name:d._symbolIdCache[a].name,info:d._symbolIdCache[a].info}),e=!1,d.unsubscribe(a+"_resolved",c),d.unsubscribe(a+"_resolve_fail",c))}var d=this,e=!0;this._symbolIdCache[a]?c():(this.on(a+"_resolved",c),this.on(a+"_resolve_fail",c))};
A82.ChartApi.prototype._doWhenSeriesDataReceived=function(a){function b(){D3.model().mainSeries().onCompleted().unsubscribe(null,b);a()}D3.model().mainSeries().onCompleted().subscribe(null,b)};
A82.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(a,b,c){function d(){var b=k._symbolIdCache[k._seriesIdCache[a].symbolId];return{name:b.name,info:b.info}}function e(){k.unsubscribe("symbol_resolved",h);k.unsubscribe("resolve_fail",g)}function g(b){b==k._seriesIdCache[a].symbolId&&c&&(e(),c())}function h(c){c.symbolId==k._seriesIdCache[a].symbolId&&(e(),b(d()))}var k=this;this._symbolIdCache[this._seriesIdCache[a].symbolId]?b(d()):(this.on("symbol_resolved",h),this.on("resolve_fail",
g))};A82.ChartApi.prototype.createSeries=function(a,b,c,d,e,g,h){c=c||"";this._notificationHandlers[a][b]=new HandlerInfo(h,b);this._recentSeriesId=b;var k=this;this._seriesIdCache[b]={symbolId:d,resolution:e,turnaround:c};this._studyEngine.updateSeriesTurnaround(b,c);this._doWhenSeriesSymbolIdIsReady(b,function(d){k._studyEngine.createSeries(d.name,e,a,b,c)})};A82.ChartApi.prototype.removeSeries=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);this._studyEngine.removeSeries(b)};
A82.ChartApi.prototype.setVisibleTimeRange=function(a,b,c,d){var e=D3.model().mainSeries().data(),e=!!e.timeToBarIndex(b,SEARCH_FROM_LEFT),g=this._recentSeriesId;e?(e=D3.model().mainSeries().data(),b=[e.timeToBarIndex(b,SEARCH_FROM_LEFT),e.timeToBarIndex(c,SEARCH_FROM_RIGHT)],ChartapiMessagerInstances[a].onSeriesTimeframeUpdate(g,this._seriesIdCache[g].turnaround,b[0],b[1],!0),d&&d()):console.warn("This method doesn't support moving to not loaded history bars now")};
A82.ChartApi.prototype._exactBarsCountOfTimeFrame=function(a,b){for(var c=D3.model().mainSeries().bars(),d=D3.model().mainSeries().symbolInfo().session,e=c._valueAt(c.size()-1)[0],d=PineJsBarBuilder.alignPeriodsBack(d,a.resolution,a.interval,1,1E3*e),e=c.size(),d=d/1E3,g=0,g=0;g<e&&!(c._valueAt(g)[0]>d);++g);return e-g};
A82.ChartApi.prototype.modifySeries=function(a,b,c,d,e,g,h){c=c||"";var k=this._seriesIdCache[b]?this._seriesIdCache[b].resolution:void 0,l=this;this._notificationHandlers[a][b]=new HandlerInfo(function(h){if("series_completed"==h.method){var n=PineJS.Symbol.parsePeriod(k),q=PineJS.Symbol.parsePeriod(e);q.range&&n.range!=q.range&&(n=D3.model().mainSeries().bars().size(),q=l._exactBarsCountOfTimeFrame(q.range,l._symbolIdCache[d].info),q=Math.max(0,n-1-q),n=Math.max(q,n-1),ChartapiMessagerInstances[a].onSeriesTimeframeUpdate(b,
c,q,n))}g(h)},b);this._recentSeriesId=b;this._studyEngine.updateSeriesTurnaround(b,c);this._seriesIdCache[h]=null;this._seriesIdCache[b]={symbolId:d,resolution:e,turnaround:c};this._doWhenSeriesSymbolIdIsReady(b,function(c){l._studyEngine.purgeEndOfDataFlags(b);l._studyEngine.purgeRangeExtensionData();l._studyEngine.purgeDataCache();l._studyEngine.recreateSources(c.name,e,a,!0)})};
A82.ChartApi.prototype.requestMoreData=function(a,b,c,d){this._enabledMoreBarsRequest&&(this._notificationHandlers[a][b]=new HandlerInfo(d,b),this._studyEngine.extendSeriesRange(b,a,c))};A82.ChartApi.prototype.setStudiesAccessController=function(a){this.studiesAccessController=a};A82.ChartApi.prototype.setWatchlistSettings=function(a){this._watchlistSettings=a};A82.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()};
A82.ChartApi.prototype.requestMetadata=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);c=this.studiesAccessController.getEnabledTools();ChartapiMessagerInstances[a].onRequestMetadata(b,c)};A82.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<STUDY_COUNT_LIMIT};
A82.ChartApi.prototype.createStudy=function(a,b,c,d,e,g,h){if(!this.isCanCreateStudy())throw"Exceeded the limit of studies";var k=this;c=c||"";this._notificationHandlers[a][b]=new HandlerInfo(h,b);var l=this._seriesIdCache[d].resolution;this._doWhenSymbolIdIsReady(this._seriesIdCache[d].symbolId,function(d){k._studyEngine.createStudy(d.name,l,a,b,c,e,g);k.studyCounter++})};
A82.ChartApi.prototype.removeStudy=function(a,b){this._notificationHandlers[a][b]=null;this._studyEngine.removeStudy(b);this.studyCounter--};A82.ChartApi.prototype.modifyStudy=function(a,b,c,d,e){c=c||"";this._notificationHandlers[a][b]=new HandlerInfo(e,b);[a,b,c].concat(d);this._studyEngine.recomputeStudy(b,d,a,c)};
A82.ChartApi.prototype.createPointset=function(a,b,c,d,e,g,h){this._notificationHandlers[a][b]=new HandlerInfo(h,b);var k=this;this._doWhenSymbolIdIsReady(d,function(c){k._studyEngine.createPointset(a,b,c.info.full_name,c.info,e,g)})};A82.ChartApi.prototype.modifyPointset=function(a,b,c,d,e){throw"This call is not implemented";};A82.ChartApi.prototype.removePointset=function(a,b,c){this._notificationHandlers[a][b]=null;this._studyEngine.removePointset(b)};
A82.ChartApi.prototype.requestMoreTickmarks=function(a,b,c,d){this._notificationHandlers[a][b]=new HandlerInfo(d,b);var e=this;this._doWhenSeriesSymbolIdIsReady(b,function(d){e._studyEngine.onMoreTickmarksRequested(a,d.name,d.info,e._seriesIdCache[b].resolution,c)})};A82.ChartApi.prototype.requestFirstBarTime=function(a,b,c,d){this._notificationHandlers[a][b]=new HandlerInfo(d,b)};A82.ChartApi.prototype._invokeHandler=function(a,b){a&&a(b)};
A82.ChartApi.prototype._sendRequest=function(a,b){throw"This method is not implemented";};A82.ChartApi.prototype._onMessage=function(a){throw"This method is not implemented";};A82.ChartApi.prototype._convertTimescaleResponse=function(a){for(var b=a.marks,c=0;c<b.length;++c)b[c]={span:b[c][0],time:b[c][1],index:b[c][2]};return a};
A82.ChartApi.prototype._dispathNotification=function(a){var b=a.params.shift();if(this._notificationHandlers[b])switch(a.method){case "timescale_update":var c=a.params[0];a=a.params[1];var d=this._convertTimescaleResponse(a);d.clear=0===a.changes.length&&0===a.marks.length;this._notificationHandlers[b].onMessage({method:"timescale_update",params:d});for(var e in c)d={},d.customId=e,d.plots=c[e].series,c[e].ns&&(d.nonseries=c[e].ns),d.turnaround=c[e].turnaround,d={method:"data_update",params:d},
this._invokeNotificationHandler(b,e,d);break;case "tickmark_update":d=this._convertTimescaleResponse(a.params[0]);d.changes=[];this._notificationHandlers[b].onMessage({method:"timescale_update",params:d});break;case "data_update":for(e in a.params[0]){var g=a.params[0][e],d={};d.customId=e;d.plots=g.series?g.series:g.plots;d.turnaround=g.turnaround;"s"in g&&"ns"in g&&(d.plots=g.s,d.nonseries=g.ns);for(c in d.plots)for(var h in d.plots[c].value)1E100===d.plots[c].value[h]&&(d.plots[c].value[h]=void 0);
d={method:"data_update",params:d};this._invokeNotificationHandler(b,e,d)}break;case "index_update":for(e in a.params[0])d={method:"index_update",params:a.params[0][e]},this._invokeNotificationHandler(b,e,d);break;case "critical_error":TradingView.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+a.params[0]);this._notificationHandlers[b].onMessage({method:"critical_error",params:a.params});break;case "quote_symbol_data":case "quote_list_fields":case "depth_symbol_error":case "depth_symbol_success":case "dd":case "dpu":case "depth_bar_last_value":this._notificationHandlers[b].onMessage({method:a.method,
params:a.params});break;default:this._invokeNotificationHandler(b,a.params[0],a)}};A82.ChartApi.prototype._invokeNotificationHandler=function(a,b,c){if(void 0!==b){var d=this._notificationHandlers[a][b];"undefined"!==typeof d&&d&&this._invokeHandler(d.handler,c);"series_deleted"!=c.method&&"study_deleted"!=c.method||delete this._notificationHandlers[a][b]}};
A82.ChartApi.prototype.searchSymbolsByName=function(a,b,c,d,e){0==a.length&&0==b.length&&0==c.length&&e([]);this._studyEngine.searchSymbolsByName(a,b,c,e)};A82.ChartApi.prototype._notifySessions=function(a){for(var b in this._sessions){if(!this._sessions.hasOwnProperty(b))break;var c=this._sessions[b];if("function"===typeof c.onMessage)c.onMessage(a)}};A82.ChartApi.prototype.unpack=function(a){throw"This method is not implemented";};
A82.ChartApi.prototype.reconnectTimeout=function(a){throw"This method is not implemented";};A82.ChartApi.prototype.quoteCreateSession=function(a){return this._studyEngine.quoteCreateSession(a)};A82.ChartApi.prototype.quoteDeleteSession=function(a){return this._studyEngine.quoteDeleteSession(a)};A82.ChartApi.prototype.quoteSetFields=function(a,b){return this._studyEngine.quoteSetFields(a,b)};
A82.ChartApi.prototype.quoteAddSymbols=function(a,b){return this._studyEngine.quoteAddSymbols(a,b)};A82.ChartApi.prototype.quoteRemoveSymbols=function(a,b){return this._studyEngine.quoteRemoveSymbols(a,b)};A82.ChartApi.prototype.quoteFastSymbols=function(a,b){return this._studyEngine.quoteFastSymbols(a,b)};A82.ChartApi.prototype.depthCreateSession=function(a,b,c){};A82.ChartApi.prototype.depthDeleteSession=function(a){};
A82.ChartApi.prototype.depthSetSymbol=function(a,b){};A82.ChartApi.prototype.depthClearSymbol=function(a){};A82.ChartApi.prototype.depthSetScale=function(a,b){};A82.ChartApi.prototype.createStudiesAccessController=function(a,b,c){return a?new this.StudiesAccessController(this._studyEngine,JSON.parse(a)):new this.ObsoleteStudiesAccessController(this._studyEngine,b&&JSON.parse(b),c&&JSON.parse(c))};
A82.ChartApi.prototype.StudiesAccessController=function(a,b){this._studyEngine=a;this._studiesAccess=b};A82.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(a){for(var b=null,c=0;c<this._studiesAccess.tools.length;++c){var d=this._studiesAccess.tools[c];if(d.name==a||d==a){b=d;break}}return b};
A82.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(a){a=this._findTool(a.description);return"black"==this._studiesAccess.type?!a||a.grayed:!!a},this)};A82.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};
A82.ChartApi.prototype.ObsoleteStudiesAccessController=function(a,b,c){this._studyEngine=a;this._enabledStudiesList=b;this._disabledStudiesList=c};
A82.ChartApi.prototype.ObsoleteStudiesAccessController.prototype.getEnabledTools=function(){var a=this._studyEngine.studiesMetadata();0<this._enabledStudiesList.length?a=a.filter(function(a){return a.is_hidden_study||0<=this._enabledStudiesList.indexOf(a.description)},this):0<this._disabledStudiesList.length&&(a=a.filter(function(a){return a.is_hidden_study||-1==this._disabledStudiesList.indexOf(a.description)},this));return a};
A82.ChartApi.prototype.ObsoleteStudiesAccessController.prototype.isToolGrayed=function(){return!1};requireFullInterfaceImplementation(A82.ChartApi,"A82.ChartApi",W98,"W98");this.TzData=TzData=function(){var a={"America/New_York":{time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476E3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372E3,-1347228E3,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462E4,-1125871200,-1112565600,-1094421600,-1081116E3,-1062972E3,
-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236E3,-76941E4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836E3,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,
-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,
576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,
1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-17762,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3]},"America/Los_Angeles":{time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236E3,-769420800,-765410400,-687996E3,-662680800,
-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356E3,-337212E3,-323906400,-305762400,-292456800,-273708E3,-261007200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,
152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,
972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,
1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,
-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,
-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,
-1504476E3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372E3,-1347228E3,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462E4,-1125871200,-1112565600,-1094421600,-1081116E3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236E3,-769413600,-765410400,-747266400,
-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836E3,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,
25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,
846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,
1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-21036,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,
-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,
-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,
-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600]},"America/Toronto":{time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712E3,-1567375200,-1554681600,-1534716E3,-1524088800,-1503266400,-149238E4,-1471816800,-1460930400,-1440972E3,-1428876E3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,
-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116E3,-1062972E3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941E4,-765410400,-747266400,-733960800,-715824E3,-702518400,-684374400,-671068800,-652924800,-634176E3,-620863200,-602719200,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,
-418255200,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,136346400,152071200,167796E3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,
372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,
1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,
1919901600,1930788E3],offset:[-19052,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-14400,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3]},"America/Vancouver":{time:[-2713910400,-1632088800,
-1615154400,-880236E3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356E3,-337212E3,-323906400,-305762400,-292456800,-273708E3,-261007200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,
-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,136346400,152071200,167796E3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,
752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,
1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,
-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,
-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,
-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112E3,-1567468800,-1233446400,-1222992E3,-1205971200,-1194048E3,-117288E4,-1162512E3,-1141344E3,-1130976E3,-1109808E3,-109944E4,-1078272E3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352E3,-83376E4,-82728E4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832E3,-71107200,-54777600,
-39052800,-23328E3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408E3,719366400,731462400,938912400,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,
-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/Sao_Paulo":{time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184E4,-570758400,-560217600,-539136E3,-53136E4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,
602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816E3,761702400,782265600,793152E3,813715200,823996800,84456E4,856051200,876096E3,888710400,908064E3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904E3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232E4,1203206400,1224374400,1234656E3,1255824E3,1266710400,1287273600,129816E4,1318723200,1330214400,1350777600,1361059200,
1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576E3,1487462400,1508025600,1518912E3,154008E4,1550361600,1571529600,1581811200,1602979200,1613865600,1634428800,1645315200,1665878400,1677369600,1697328E3,1708214400,1729382400,1739664E3,1760832E3,1771718400,1792281600,1803168E3,1823731200,1834617600,1855180800,1866067200,1887235200,1897516800,1918684800,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,
-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,
-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974E3],offset:[-17776,-17776,-18E3,-14400,-18E3]},"Europe/Moscow":{time:[-2840140800,-1688256E3,-165681E4,-1641340800,-1627956E3,-1618700400,-1596416400,-1593813600,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,
433814400,449625600,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670388400,686113200,695786400,701823600,717548400,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,
1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18E3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,
10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725E4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036E3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582E3,433310400,449031600,465364800,481086E3,496814400,512535600,528264E3,543985200,559713600,575434800,591163200,
606884400,622612800,638334E3,654667200,670388400,686116800,701838E3,717566400,733287600,749016E3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288E3,92259E4,941342400,954039600,972792E3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342E3,1162094400,1174791600,1193544E3,1206846E3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,
1382846400,1396148400,1414296E3,1427598E3,1445745600,1459047600,14778E5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835E4,1667102400,1679799600,1698552E3,1711854E3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102E3,1887854400,1901156400,1919304E3,1932606E3],offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,
10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,
7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Berlin":{time:[-2422051200,-1693702800,-1680476400,-1663452E3,-1650142800,-1632002400,-1618693200,-938901600,-85725E4,-844552800,-828219600,-812498400,-79677E4,-781048800,-776552400,-765925200,-761173200,-748476E3,-733266E3,-717627600,-714603600,-71037E4,-701902800,-684972E3,-670453200,-654127200,-639003600,323834400,338958E3,354679200,370407600,386128800,401857200,417578400,433306800,449028E3,465361200,481082400,496810800,
512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,
1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,
7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,
7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{time:[-3852662400,-1691964E3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034E3,-1570399200,-1552165200,-1538344800,-152253E4,-15075E5,-1490562E3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732E3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314E3,-1315778400,-1301259600,-1284328800,-126981E4,-1253484E3,-1238360400,-1221429600,-1206910800,
-118998E4,-1175461200,-1159135200,-1143406800,-1126476E3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058E3,-1032127200,-1017608400,-1001282400,-986158800,-969228E3,-950475600,-942012E3,-904514400,-896043600,-875484E3,-864594E3,-844034400,-832539600,-812584800,-798066E3,-781048800,-772059600,-764802E3,-748476E3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996E3,-668034E3,-654732E3,-636584400,-622072800,-605739600,-590623200,-57429E4,-558568800,-542235600,-527119200,-512600400,
-496274400,-481150800,-46422E4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298E3,-306972E3,-291848400,-276732E3,-257979600,-245282400,-22653E4,-213228E3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484E3,-100731600,-88034400,-68677200,-59004E3,57726E3,69818400,89175600,101268E3,120625200,132717600,152074800,164167200,183524400,196221600,214974E3,227671200,246423600,259120800,278478E3,290570400,309927600,32202E4,341377200,354675600,372823200,
386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676E3,543978E3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428E3,76473E4,782877600,796179600,814327200,828234E3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482E3,1004234400,1017536400,1035684E3,1048986E3,1067133600,1080435600,1099188E3,1111885200,1130637600,1143334800,1162087200,
1174784400,1193536800,1206838800,1224986400,1238288400,1256436E3,1269738E3,1288490400,1301187600,131994E4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049E4,1509242400,1521939600,1540692E3,1553994E3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444E3,1774746E3,1792893600,1806195600,1824948E3,1837645200,1856397600,1869094800,1887847200,1901149200,
1919296800,1932598800],offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,
0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Madrid":{time:[-2177452800,-1661734800,-1648425600,-1631926800,-1616889600,-1601254800,-1585353600,-1442451600,-1427673600,-1379293200,-1364774400,
-1348448400,-1333324800,-1316394E3,-1301270400,-1284339600,-1269820800,-1029114E3,-1017619200,-1002848400,-986169600,-969238800,-954115200,-940208400,-873075600,-862531200,-842835600,-828230400,-811386E3,-796003200,-779936400,-765414E3,-748486800,-733881600,-652323600,-639183600,135126E3,150253200,167180400,181702800,196815600,212547600,22887E4,243997200,260406E3,276051600,29178E4,307508400,323834400,338958E3,354679200,370407600,386128800,401857200,417578400,433306800,449028E3,465361200,481082400,
496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,
1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,
0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,
3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544E4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618E3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224E3,-1379293200,-1364774400,-1348448400,-1333324800,
-1316394E3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472E3,-1160355600,-1143417600,-1127696400,-1111968E3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012E3,-932432400,-85725E4,-844552800,-828219600,-812498400,-800064E3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178E4,307508400,323834400,338958E3,354679200,370407600,
386128800,401857200,417578400,433306800,449028E3,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,
1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,
1919300400,1932602400],offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,
3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452E3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725E4,-844552800,-828219600,
-812498400,-796600800,-778723200,-762652800,-748483200,-733266E3,-715212E3,-701902800,-684972E3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356E3,-334191600,-323301600,-307580400,-291852E3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404E3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,
543978E3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,
1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,
7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,
3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364E3,-844639200,-828309600,-813189600,57722400,68007600,89172E3,100062E3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924E3,320814E3,341373600,352263600,
372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326E3,530071200,542775600,562125600,57483E4,59418E4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932E3,828241200,846381600,859690800,877831200,891140400,909280800,92259E4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684E3,1048993200,1067133600,1080442800,1099188E3,1111892400,1130637600,1143946800,1162087200,
1174791600,1193536800,1207450800,1223172E3,1238900400,1254621600,127035E4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924E3,1459652400,1475373600,1491102E3,1506823200,1522551600,1538877600,1554606E3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676E3,1680404400,1696125600,1712458800,172818E4,1743908400,1759629600,1775358E3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,
1917482400,1933210800],offset:[36292,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,
39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600]},"Asia/Tokyo":{time:[-2587678861,-2335219200,-1017792E3,-683762400,-672357600,-654732E3,-640908E3,-620258400,-609458400,-588808800,-578008800,1925024400],offset:[33539,32400,32400,32400,36E3,32400,36E3,32400,36E3,32400,36E3,32400]},"Asia/Taipei":{time:[-2335219200,
-1017792E3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856E3,-670636800,-65232E4,-639100800,-620784E3,-607564800,-589248E3,-576028800,-562896E3,-541728E3,-528681600,-510192E3,-497145600,-478656E3,-465609600,-449798400,-433987200,-418176E3,-402451200,-38664E4,-370915200,-355104E3,-339379200,-323568E3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584E3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,
28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176E3,-1167609600,-1073001600,-894153600,-879638400,-766972800,-138758400,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27E3,32400,27E3,27E3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704E4,545184E3,558489600,
576633600,589939200,608688E3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{time:[-2524521600,-2053900800,-1325462400,-1199232E3,-1017792E3,-767318400,-498096E3,-303955200,-293500800,-264902400,-39484800,547603200,560908800,579052800,592358400,1925024400],offset:[30472,30600,32400,30600,32400,32400,32400,28800,32400,28800,30600,32400,36E3,32400,36E3,32400]},
"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776E3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712E4,732758400,748656E3,764294400,780192E3,795830400,811728E3,827366400,843264E3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768E4,1253577600,1269216E3,1285113600,1300752E3,1316649600,
1332288E3,1348185600,1363910400,1379808E3,1395446400,1411344E3,1426982400,144288E4,1458518400,1474416E3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368E3,1916265600,1931904E3],offset:[12344,12344,12600,14400,18E3,14400,12600,16200,12600,16200,12600,16200,
12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Kolkata":{time:[-2840140800,-891561600,-872035200,
-862617600,-764121600,1925011800],offset:[21208,21200,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021E3,-694470600,-683757E3,-668032200,-654726600,-636582600,-623277E3,-605133E3,-591827400,-573683400,-559773E3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877E3,-308781E3,-288822600,-277331400,-257373E3,
-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509E3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381E3,9343800,25068600,40793400,56518200,72243E3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371E3,295414200,309324600,1925020800],offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,
32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]}};"undefined"!==typeof module&&module.exports?module.exports=a:this.TzData=a;return a}(this);this.PineJsCalendar=PineJsCalendar=function(){function a(a){this._name=a;var c=b[a];c||("UTC"!==a&&"Etc/UTC"!==a&&console.error("unknown timezone: "+a),c={time:[],offset:[]});c.time.length!==c.offset.length&&(console.error("timezone transition table doesn't match offset table"),c={time:[],offset:[]});if(!c.time_utc){a=c.time;for(var g=c.offset,h=a.length,k=Array(h),l=0;l<h;l++)a[l]*=1E3,g[l]*=1E3,k[l]=a[l]-g[l];c.time_utc=k}this.tz=c}var b=this.TzData?this.TzData:require("./tzdata.js");a.prototype.offset_utc=
function(b){return a._offset(this.tz.time_utc,this.tz.offset,b)};a.prototype.offset_loc=function(b){return a._offset(this.tz.time,this.tz.offset,b)};a._offset=function(a,b,c){a:{var h=a.length;if(0===h)a=-1;else for(var k=0,l=h-1,m=(k+l)/2|0;;){if(a[m]>c){if(l=m-1,l<k){a=m;break a}}else if(k=m+1,l<k){a=m<h-1?m+1:-1;break a}m=(k+l)/2|0}}return-1===a?0:b[a]};var c={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,
DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:864E5,get_year:function(a){return a.getUTCFullYear()},get_month:function(a){return a.getUTCMonth()},get_hours:function(a){return a.getUTCHours()},get_minutes:function(a){return a.getUTCMinutes()},get_seconds:function(a){return a.getUTCSeconds()},get_day_of_month:function(a){return a.getUTCDate()},get_day_of_week:function(a){return a.getUTCDay()+1},get_day_of_year:function(a){var b=Date.UTC(a.getUTCFullYear(),
0,1,0,0,0,0);return((a.getTime()-b)/c.secondsPerDay|0)+1},get_week_of_year:function(a){var b=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0);a=c.clone(a);c.set_hms(a,0,0,0,0);a.setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7));return((a.getTime()-b)/c.secondsPerDay+1)/7|0},get_minutes_from_midnight:function(a){return 60*c.get_hours(a)+c.get_minutes(a)},set_hms:function(a,b,c,h,k){a.setUTCHours(b);a.setUTCMinutes(c);a.setUTCSeconds(h);a.setUTCMilliseconds(k)},add_days_considering_dst:function(a,b,c){var h=
a.offset_utc(b);b=this.clone(b);this.add_date(b,c);a=a.offset_utc(b);b.setTime(b.getTime()+h-a);return b},add_date:function(a,b){a.setTime(a.getTime()+b*c.secondsPerDay)},clone:function(a){return new Date(a.getTime())},get_days_per_year:function(a){a=a.getUTCFullYear();return this.days_per_year(a)},days_per_year:function(a){return 0!==a%4||0===a%100&&0!==a%400?365:366},get_part:function(a,b){switch(b){case c.YEAR:return c.get_year(a);case c.MONTH:return c.get_month(a);case c.DAY_OF_MONTH:return c.get_day_of_month(a);
case c.WEEK_OF_YEAR:return c.get_week_of_year(a);case c.DAY_OF_WEEK:return c.get_day_of_week(a);case c.HOUR_OF_DAY:return c.get_hours(a);case c.MINUTE:return c.get_minutes(a);case c.DAY_OF_YEAR:return c.get_day_of_year(a);case c.SECOND:return c.get_seconds(a);default:return a.getTime()}},time_minutes:function(a){return 6E4*a},time_minutes_diff:function(a,b){return((a/1E3|0)-(b/1E3|0))/60|0},utc_to_cal:function(a,b){var c=a.offset_utc(b);return new Date(b+c)},get_cal:function(a,b,c,h){b=new Date(Date.UTC(b,
c,h));a=a.offset_utc(+b);return new Date(b.valueOf()-a)},cal_to_utc:function(a,b){var c=b.getTime(),h=a.offset_loc(c);return c-h},get_timezone:function(b){return new a(b)},shift_day:function(a,b){var c;c=a-1+b;6<c?c%=7:0>c&&(c=(7+c%7)%7);return c+1}};"undefined"!==typeof module&&module.exports?module.exports=c:this.PineJsCalendar=c;return c}(this);this.PineJsBarBuilder=PineJsBarBuilder=function(){function a(a,b){switch(a){case "D":return new A(b);case "W":return new v(b);case "M":return new B(b)}console.error("unknown dwm resolution: "+a);return null}function b(a,b,c){var d=b;a.moveTo(d);for(var e=[],g=0,h=0;!c(e,d);){if(5<g)throw console.trace(["0x10",new Date(b),"->",new Date(d)]),"Internal error 0x10 while extrapolating.";d=a.indexOfBar(d);if(-1===d)d=a.startOfBar(0);else if(-2===d)d=a.startOfBar(-2);else{var k=a.startOfBar(d);if(k!=b){if(h&&
h==k)throw console.trace(["0x11",new Date(b),"->",new Date(k)]),"Internal error 0x11 while extrapolating.";h=k;g=0;e.push(k)}d=a.startOfBar(d+1)}a.moveTo(d);g++}return e}function c(a){if(isNaN(a))return NaN;var b=this.indexOfBar(a);-2===b&&(this.moveTo(a),b=this.indexOfBar(a));return 0>b?NaN:this.startOfBar(b)}function d(a,b){this.period=a;this.session=b;this.sessionEnd=this.sessionStart=Number.MIN_VALUE}function e(a,b,c,d){this.period=c;this.sessionTgt=a;this.sessionSrc=b||a;this.builder=d;this.periodStart=
-Number.MAX_VALUE;this.periodEnd=-Number.MAX_VALUE;this.periodLastBarStart=-Number.MAX_VALUE}function g(a,b,c){var d=E.get_day_of_week(b),e=E.get_minutes_from_midnight(b);a=a.findSession(d,e);var e=a.dayOfWeek(),g=a.isOvernight(),d=(e-d+7)%7-(g?1:0);0!==d&&E.add_date(b,d);d=a.start();E.set_hms(b,d/60|0,d%60,0,0);d=a.length();a=new Date(b.valueOf()+6E4*d);b=c.offset_loc(b)/6E4;c=c.offset_loc(a)/6E4;return d+(b-c)}function h(a,b,c){c=E.clone(c);g(b,c,a);return E.cal_to_utc(a,c)}function k(a,b){var c=
E.get_day_of_week(b)-a.firstDayOfWeek;return 0>c?c+7:c}function l(a,b){var c=b+a.firstDayOfWeek;return c>E.SATURDAY?c-E.SATURDAY:c}function m(a,b){var c=E.get_day_of_year(b)-1,d=k(a,b)-c%7;if(0==d)return c/7|0;0<=d&&(d-=7);return(d+c)/7|0}function n(a,b,c){for(var d=0;b<c;++b)d+=a.isWeekEnd(l(a,b))?1:0;return d}function q(a,b){var c=new Date(Date.UTC(b,11,31,23,59)),d=E.days_per_year(b)-r(a,c);E.get_day_of_week(c)!==E.SUNDAY&&E.get_day_of_week(c)!==E.SATURDAY||d--;return d}function r(a,b){var c=E.get_day_of_year(b)-
1,d=k(a,b),e=d-c%7;0>e&&(e+=7);var g=0;c<7-e?g+=n(a,e,d):(c=0==e?0:n(a,e,7),g+=n(a,0,d)+c);return g+m(a,b)*a.weekEndsCount()}function u(){}function w(a){this.sessionsSpec=a}function A(a){this.session=a}function v(a){this.session=a}function B(a){this.session=a}function D(a,b,c){this._dayOfWeek=a;this._start=b;this._length=c}function C(a,b){return a.compareTo(b)}function z(a){function b(a){var d=a.split(";");if(2<d.length)return console.error("Only one `first day` specification expected @ session "+
a),a;if(1==d.length)return a;var e=1,g=0<=d[0].indexOf("-")?NaN:parseInt(d[0]);isNaN(g)&&(e=0,g=parseInt(d[1]));if(g<E.SUNDAY||g>E.SATURDAY)return console.error("Unexpected day index @ session: "+a+"; day index "+g),a;c.firstDayOfWeek=g;return d[e]}var c=this;a=a||"0000-0000";this.entries=[];this.firstDayOfWeek=E.MONDAY;if("24x7"===a.toLowerCase())P.forEach(function(a){this.addSessionEntry(a,0,0)},this);else{a=b(a);var d=!1,e={};a.split("|").forEach(function(a){var b=a.split(":");1!==b.length&&2!==
b.length&&console.error("bad session section: "+a);var c=1===b.length;c&&(d&&console.error("duplicated default section: "+a),d=!0);(c?L:F(b[1])).forEach(function(a){c&&e[a]||(e[a]=b[0])},this)},this);P.forEach(function(b){var c=e[b];c&&c.split(",").forEach(function(c){var d=c.split("-");2!==d.length&&(console.error("bad sessions spec: "+a),d=["0000","0000"]);c=parseInt(d[0]);d=parseInt(d[1]);this.addSessionEntry(b,c%100+60*(c/100|0),d%100+60*(d/100|0))},this)},this)}this.entries.sort(C)}function F(a){for(var b=
[],c=0;c<a.length;c++){var d=a.charAt(c)-0;-1===b.indexOf(d)&&b.push(d)}return b}function G(){}function J(a,b,c){var d=a.length;if(0===d)return-1;for(var e=0,g=d-1,h=(e+g)/2|0;;){var k=c(a[h],b);if(0===k||0<k){if(g=h-1,g<e)return h}else if(e=h+1,g<e)return h<d-1?h+1:-1;h=(e+g)/2|0}}var E=this.PineJsCalendar?this.PineJsCalendar:require("./calendar.js"),I={D:864E5,W:6048E5,M:2592E6};d.prototype.alignTime=c;d.prototype.indexOfBar=function(a){return a<this.sessionStart?-1:a>=this.sessionEnd?-2:E.time_minutes_diff(a,
this.sessionStart)/this.period|0};d.prototype.startOfBar=function(a){if(-2===a)return this.sessionEnd;if(0>a)throw"Negative offset is not supported";return this.sessionStart+E.time_minutes(this.period*a)};d.prototype.isLastBar=function(a,b){var c=this.sessionStart+E.time_minutes(this.period*(a+1)-1);return b>=c};d.prototype.moveTo=function(a){var b=this.session.timezone;a=E.utc_to_cal(b,a);var c=g(this.session.spec,a,this.session.timezone);this.sessionStart=E.cal_to_utc(b,a);this.sessionEnd=this.sessionStart+
E.time_minutes(c)};e.prototype.alignTime=c;e.prototype.indexOfBar=function(a){return a<this.periodStart?-1:a>=this.periodEnd?-2:0};e.prototype.startOfBar=function(a){if(-2===a||0<a)return this.periodEnd;if(-1===a)throw"PRE_SESSION is not supported";return this.periodStart};e.prototype.isLastBar=function(a,b){return b>=this.periodLastBarStart};e.prototype.moveTo=function(a){var b=E.utc_to_cal(this.sessionSrc.timezone,a);a=this.sessionSrc.spec;var b=E.clone(b),c=E.get_day_of_week(b),d=E.get_minutes_from_midnight(b);
a.findSession(c,d).isOvernight()&&E.add_date(b,1);E.set_hms(b,0,0,0,0);c=(this.builder.indexOfPeriod(b)/this.period|0)*this.period;a=this.sessionTgt.timezone;var d=E.get_year(b),b=this.sessionTgt.spec,e=this.builder.startOfPeriod(a,c,d);this.periodStart=h(a,b,e);c=this.builder.startOfPeriod(a,c+this.period,d);this.periodEnd=h(a,b,c)};e.prototype.moveToPrevWorkDay=function(a,b){for(;a.isWeekEnd(E.get_day_of_week(b));)E.add_date(b,-1)};u.prototype.indexOfPeriod=function(a){return E.get_day_of_year(a)-
1};u.prototype.startOfPeriod=function(a,b,c){c=E.get_cal(a,c,E.JANUARY,1);b=E.add_days_considering_dst(a,c,b);return E.utc_to_cal(a,+b)};w.prototype.uber=new u;w.prototype.indexOfPeriod=function(a){return this.uber.indexOfPeriod(a)-r(this.sessionsSpec,a)};w.prototype.startOfPeriod=function(a,b,c){function d(a,b){for(var c=0,e=a;7>e&&(h.sessionsSpec.isWeekEnd(l(h.sessionsSpec,e))||!(0>--b));++e)c++;return c}function e(a,b,c){var d=0,g=0;for(a=c%(7-h.sessionsSpec.weekEndsCount())-(0==a?0:b.businessDays);7>
g&&0<a;++g){var k=h.sessionsSpec.isWeekEnd(l(h.sessionsSpec,g)),d=d+(k?1:0);a-=k?0:1}d=b.weekEnds+d;b=(c-b.businessDays)/(7-h.sessionsSpec.weekEndsCount())|0;b=d+h.sessionsSpec.weekEndsCount()*b;return c+b}var g=q(this.sessionsSpec,c);b>=g&&(c++,b=0);var h=this,g=new Date(Date.UTC(c,E.JANUARY,1)),g=k(this.sessionsSpec,g),m=new function(a,b){this.weekEnds=n(a,b,7);this.calendarDays=7-b;this.businessDays=this.calendarDays-this.weekEnds}(this.sessionsSpec,g);b=b<m.businessDays?d(g,b):e(g,m,b);return this.uber.startOfPeriod(a,
b,c)};A.prototype.indexOfPeriod=function(a){return this.builder().indexOfPeriod(a)};A.prototype.startOfPeriod=function(a,b,c){return this.builder().startOfPeriod(a,b,c)};A.prototype.builder=function(){this._builder||(this._builder=this.session.spec.hasWeekEnds()?new w(this.session.spec):new u);return this._builder};v.prototype.indexOfPeriod=function(a){return m(this.session.spec,a)};v.prototype.startOfPeriod=function(a,b,c){var d=new Date(Date.UTC(c,E.JANUARY,1)),e=k(this.session.spec,d);b=0===e?
7*b:7*(b+1)-e;d=E.get_days_per_year(d);if(b>d)return this.startOfPeriod(a,0,c+(b/d|0));c=E.get_cal(a,c,E.JANUARY,1);c=E.add_days_considering_dst(a,c,b);return E.utc_to_cal(a,+c)};B.prototype.indexOfPeriod=function(a){return E.get_month(a)};B.prototype.startOfPeriod=function(a,b,c){if(0>b){var d=(-b+11)/12|0;c-=d;b+=12*d}else if(b>E.DECEMBER)return E.utc_to_cal(a,+E.get_cal(a,c+1,E.JANUARY,1));b=E.get_cal(a,c,b,1);c=k(this.session.spec,b);4<c&&E.add_date(b,7-c);return E.utc_to_cal(a,+b)};D.prototype.start=
function(){return 0>this._start?this._start+E.minutesPerDay:this._start};D.prototype.isOvernight=function(){return 0>this._start};D.prototype.dayOfWeek=function(){return this._dayOfWeek};D.prototype.length=function(){return this._length};D.prototype.weight=function(){return this._dayOfWeek*E.minutesPerDay+this._start};D.prototype.compareTo=function(a){var b=this.weight(),c=b+this._length;a=a.weight();return b<=a&&a<c?0:b>a?1:-1};var L=[E.MONDAY,E.TUESDAY,E.WEDNESDAY,E.THURSDAY,E.FRIDAY],P=[E.SUNDAY,
E.MONDAY,E.TUESDAY,E.WEDNESDAY,E.THURSDAY,E.FRIDAY,E.SATURDAY];z.prototype.addSessionEntry=function(a,b,c){c<=b&&0!=b&&(b-=E.minutesPerDay);this.entries.push(new D(a,b,c==b?E.minutesPerDay:c-b))};z.prototype.isWeekEnd=function(a){var b=J(this.entries,new D(a,0,0),function(a,b){return a.dayOfWeek()-b.dayOfWeek()});return 0>b||this.entries[b].dayOfWeek()!=a};z.prototype.hasWeekEnds=function(){return 0<this.weekEndsCount()};z.prototype.weekEndsCount=function(){if(void 0==this._weekEndsCount){var a=[];
this.entries.forEach(function(b){a[b.dayOfWeek()]=1},this);this._weekEndsCount=7-a.reduce(function(a,b){return a+(b||0)},0)}return this._weekEndsCount};z.prototype.indexOfSession=function(a,b){var c=J(this.entries,new D(a,b,0),C);return-1===c?0:c};z.prototype.findSession=function(a,b){return this.entries[this.indexOfSession(a,b)]};G.prototype.init=function(a,b){this.timezone="string"===typeof a?E.get_timezone(a):a;this.spec=new z(b);return this};var H={PRE_SESSION:-1,POST_SESSION:-2,LASTBAR_SESSION:-3,
newBarBuilder:function(b,c,g,h){return""===b?new d(c,g):new e(g,h,c,a(b,g))},Session:G,alignPeriodsBack:function(a,b,c,d,e){a=(new G).init("UTC",a);var g=""!=b;g?(c*=I[b],b=I.D):(c*=6E4,b=6E4*a.spec.findSession(0,0)._length);b/=c;a=(g?7:a.spec.hasWeekEnds()?5:7)*b;return d<a?e-d/b*I.D:e-d/a*I.W},extrapolateBarsFrontByCount:function(a,c,d){return b(a,c,function(a,b){return a.length>=d})},extrapolateBarsFrontToTime:function(a,c,d){return b(a,c,function(a,b){return b>d})},lower_bound:J,isTradingNow:function(a,
b){var c=PineJsCalendar.utc_to_cal(b.timezone,+a),d=E.get_day_of_week(c),c=E.get_minutes_from_midnight(c),e=b.spec.findSession(d,c);return d==e._dayOfWeek&&c>=e._start&&c<e._start+e._length},alignToStartOfSession:g,numberOfFullWeeks:m,numberOfWeekEndsSinceYearStart:r,BusinessDaysBuilder:w,alignExchangeTimeToSessionStartAndReturnUTC:h};"undefined"!==typeof module&&module.exports?module.exports=H:this.PineJsBarBuilder=H;return H}.call(this);this.PineJS=PineJS=function(){function a(a,b,c,d,e){c=e;e=0;if(isNaN(a.get(b-1)))return{index:NaN,value:NaN};for(var g=0;g<b;++g)d(a.get(g),c)&&(e=g,c=a.get(g));return{index:e,value:c}}function b(a,b){return 100*a/b}function c(a,b,c,d,e){this._areaRight=a;this._areaLeft=b;this._pivotType=c;this._series=d;this._currentIndex=e.new_var(0);this._currentValue=e.new_var(NaN);this._pivotIndex=e.new_var(-1);this._index=v.n(e);this._isNewBar=e.symbol.isNewBar;a=this._currentIndex.get(1);b=this._currentValue.get(1);
c=this._pivotIndex.get(1);1<this._index&&(this._currentIndex.set(a),this._currentValue.set(b),this._pivotIndex.set(c))}function d(a,b,d){this._deviation=a;a=d.new_var(v.high(d));var e=d.new_var(v.low(d));a.get(2*b+1);e.get(2*b+1);this._pivotHigh=new c(b,b,c.HIGH,a,d);this._pivotLow=new c(b,b,c.LOW,e,d);this._lastVal=d.new_var(NaN);this._lastIndex=d.new_var(-1);this._lastType=d.new_var();this._index=v.n(d);this._isNewBar=d.symbol.isNewBar;this._isBarClosed=d.symbol.isBarClosed;b=this._lastIndex.get(1);
d=this._lastVal.get(1);a=this._lastType.get(1);1<this._index&&this.addPivot(b,d,a);this.processPivot(this._pivotHigh);this.processPivot(this._pivotLow)}function e(a){this.symbol=a;this.vars=[];this.vars_index=0;this.ctx=[];this.ctx_index=0}function g(a){this.mindepth=0;this.original=NaN;this.modified=!1;this.symbol=a}function h(a,b,c,d){this.periodBase=c;this.tickerid=a;this.period=b;this.index=-1;this.updatetime=this.volume=this.close=this.low=this.high=this.open=this.time=NaN;this.isBarClosed=this.isNewBar=
!1;this.session=new A.Session;this.other_sessions={};this.script=d;this.ticker=h.parseTicker(a);a=h.parsePeriod(b);this.resolution=a.resolution;this.interval=a.interval;this.bb_cache={}}function k(a,b,c,d,g,h,k){this.body=g;this.symbols=[];this.runner=d;this.inputCallback=k;this.out=h;this.ctx=new e(this.add_sym(a,b,c));this.init()}function l(a){this.symbols=[];this.barsets=[];this.subscription=[];this.host=a;this.isRecalculated=!1;this.start()}function m(a){this.runner=new l(a)}function n(a,b,c){this.info=
a;this.cloneData=c;this.bars=b?c?TradingView.clone(b):b:[];this.isBarClosed=!0;this.dwm_aligner=void 0}function q(a,b){this.period=a;this.generateEmptyBars=!!b}function r(){}function u(){}var w=this.PineJsCalendar?this.PineJsCalendar:require("./calendar.js"),A=this.PineJsBarBuilder?this.PineJsBarBuilder:require("./barbuilder.js"),v={max_series_size:5E3,n:function(a){return a.symbol.index+1},nz:function(a,b){b=b||0;return isFinite(a)?a:b},na:function(a){return 0==arguments.length?NaN:isNaN(a)?1:0},
isZero:function(a){return 1E-10>=Math.abs(a)},toBool:function(a){return isFinite(a)&&!v.isZero(a)},eq:function(a,b){return v.isZero(a-b)},neq:function(a,b){return!v.eq(a,b)},ge:function(a,b){return v.isZero(a-b)||a>b},gt:function(a,b){return!v.isZero(a-b)&&a>b},lt:function(a,b){return!v.isZero(a-b)&&a<b},le:function(a,b){return v.isZero(a-b)||a<b},and:function(a,b){return isNaN(a)||isNaN(b)?NaN:v.isZero(a)||v.isZero(b)?0:1},or:function(a,b){return isNaN(a)||isNaN(b)?NaN:v.isZero(a)&&v.isZero(b)?0:
1},not:function(a){return isNaN(a)?NaN:v.isZero(a)?1:0}};v.max=Math.max;v.min=Math.min;v.pow=Math.pow;v.abs=Math.abs;v.log=Math.log;v.log10=function(a){return Math.log(a)/Math.LN10};v.sqrt=Math.sqrt;v.sign=function(a){return isNaN(a)?NaN:v.isZero(a)?0:0<a?1:-1};v.exp=Math.exp;v.sin=Math.sin;v.cos=Math.cos;v.tan=Math.tan;v.asin=Math.asin;v.acos=Math.acos;v.atan=Math.atan;v.floor=Math.floor;v.ceil=Math.ceil;v.round=Math.round;v.avg=function(a,b,c,d,e,g){if(2===arguments.length)return(a+b)/2;for(var h=
0,k=0;k<arguments.length;k++)h+=arguments[k];return h/arguments.length};v.open=function(a){return a.symbol.open};v.high=function(a){return a.symbol.high};v.low=function(a){return a.symbol.low};v.close=function(a){return a.symbol.close};v.hl2=function(a){return(a.symbol.high+a.symbol.low)/2};v.hlc3=function(a){return(a.symbol.high+a.symbol.low+a.symbol.close)/3};v.ohlc4=function(a){return(a.symbol.open+a.symbol.high+a.symbol.low+a.symbol.close)/4};v.volume=function(a){return a.symbol.volume};v.time=
function(a,b,c){return a.symbol.bartime(b,c)};v.period=function(a){return a.symbol.period};v.tickerid=function(a){return a.symbol.tickerid};v.ticker=function(a){return a.symbol.ticker};v.interval=function(a){return a.symbol.interval};v.isdwm=function(a){return a.symbol.isdwm()};v.isintraday=function(a){return!a.symbol.isdwm()};v.isdaily=function(a){return"D"===a.symbol.resolution};v.isweekly=function(a){return"W"===a.symbol.resolution};v.ismonthly=function(a){return"M"===a.symbol.resolution};v.year=
function(a,b){return v.timepart(a.symbol,w.YEAR,b)};v.month=function(a,b){return v.timepart(a.symbol,w.MONTH,b)};v.weekofyear=function(a,b){return v.timepart(a.symbol,w.WEEK_OF_YEAR,b)};v.dayofmonth=function(a,b){return v.timepart(a.symbol,w.DAY_OF_MONTH,b)};v.dayofweek=function(a,b){return v.timepart(a.symbol,w.DAY_OF_WEEK,b)};v.hour=function(a,b){return v.timepart(a.symbol,w.HOUR_OF_DAY,b)};v.minute=function(a,b){return v.timepart(a.symbol,w.MINUTE,b)};v.second=function(a,b){return v.timepart(a.symbol,
w.SECOND,b)};v.iff=function(a,b,c){return v.not(a)?c:b};v.rising=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)>a.get(0))return 0;return 1};v.falling=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)<a.get(0))return 0;return 1};v.timepart=function(a,b,c){a=w.utc_to_cal(a.timezone,c||a.bartime());return w.get_part(a,b)};v.rsi=function(a,b){return v.isZero(b)?100:v.isZero(a)?0:100-100/(1+a/b)};v.sum=function(a,b,c){c=c.new_var();a=v.nz(a.get())+v.nz(c.get(1))-v.nz(a.get(b));c.set(a);return a};v.sma=
function(a,b,c){c=v.sum(a,b,c);return v.na(a.get(b-1))?NaN:c/b};v.rma=function(a,b,c){var d=v.sum(a,b,c),e=b-1,g=a.get(e);c=c.new_var();var h=c.get(1);a=a.get();b=v.na(g)?NaN:v.na(h)?d/b:(a+h*e)/b;c.set(b);return b};v.fixnan=function(a,b){var c=b.new_var();if(isNaN(a))return c.get(1);c.set(a);return a};v.tr=function(a){var b=a.new_var(v.close(a));return v.max(v.max(v.high(a)-v.low(a),v.abs(v.high(a)-b.get(1))),v.abs(v.low(a)-b.get(1)))};v.atr=function(a,b){var c=b.new_var(v.tr(b));return v.sma(c,
a,b)};v.ema=function(a,b,c){var d=v.sum(a,b,c);c=c.new_var();var e=a.get(0);a=a.get(b-1);var g=c.get(1);b=v.na(a)?NaN:v.na(g)?d/b:2*(e-g)/(b+1)+g;c.set(b);return b};v.wma=function(a,b,c){c=0;for(var d=b=Math.round(b);0<=d;d--)c+=(b-d)*a.get(d);return 2*c/(b*(b+1))};v.vwma=function(a,b,c){var d=c.new_var(v.volume(c));a=c.new_var(a.get(0)*v.volume(c));return v.sma(a,b,c)/v.sma(d,b,c)};v.swma=function(a,b){return(a.get(0)+2*a.get(1)+2*a.get(2)+a.get(3))/6};v.lowestbars=function(b,c,d){return-a(b,c,d,
function(a,b){return v.lt(a,b)},Number.MAX_VALUE).index};v.lowest=function(b,c,d){return a(b,c,d,function(a,b){return v.lt(a,b)},Number.MAX_VALUE).value};v.highestbars=function(b,c,d){return-a(b,c,d,function(a,b){return v.gt(a,b)},Number.MIN_VALUE).index};v.highest=function(b,c,d){return a(b,c,d,function(a,b){return v.gt(a,b)},Number.MIN_VALUE).value};v.cum=function(a,b){var c=b.new_var(),d=v.nz(c.get(1))+a;c.set(d);return d};v.accdist=function(a){v.open(a);var b=v.high(a),c=v.low(a),d=v.close(a),
e=v.volume(a);return v.cum(d==b&&d==c||b==c?0:e*(2*d-c-b)/(b-c),a)};v.correlation=function(a,b,c,d){var e=v.sma(a,c,d),g=v.sma(b,c,d),h=d.new_var(a.get()*b.get());return(v.sma(h,c,d)-e*g)/Math.sqrt(v.variance2(a,e,c)*v.variance2(b,g,c))};v.stoch=function(a,c,d,e,g){c=v.highest(c,e);d=v.lowest(d,e);return v.fixnan(b(a.get()-d,c-d),g)};v.tsi=function(a,b,c,d){var e=d.new_var(v.change(a));a=d.new_var(v.abs(v.change(a)));e=d.new_var(v.ema(e,c,d));c=d.new_var(v.ema(a,c,d));e=v.ema(e,b,d);b=v.ema(c,b,d);
return e/b};v.cross=function(a,b,c){if(isNaN(a)||isNaN(b))return!1;a=c.new_var(function(a){return 0>a?-1:0==a?0:1}(a-b));return!isNaN(a.get(1))&&a.get(1)!=a.get()};v.linreg=function(a,b,c){for(var d=0,e=0,g=0,h=0,k=0;k<b;++k)var l=a.get(k),m=b-1-k+1,d=d+m,e=e+l,g=g+m*m,h=h+l*m;a=(b*h-d*e)/(b*g-d*d);return e/b-a*d/b+a+a*(b-1-c)};v.sar=function(a,b,c,d){function e(b,c){var d=q.get();r.set(b);q.set(c);t.set(1E3*a);u.set(d);return d}var g=v.high(d),h=v.low(d),k=v.close(d),l=d.new_var(g),m=d.new_var(h),
n=d.new_var(k).get(1),m=m.get(1),l=l.get(1),q=d.new_var(),r=d.new_var(),t=d.new_var(),u=d.new_var();d=u.get(1);if(isNaN(n))return NaN;isNaN(d)&&(v.ge(k,n)?(r.set(1),q.set(Math.max(g,l)),d=Math.min(h,m)):(r.set(-1),d=Math.max(g,l),q.set(Math.min(h,m))),t.set(1E3*a));if(1==r.get()){if(v.gt(g,q.get())&&(q.set(g),t.set(Math.min(t.get()+1E3*b,1E3*c))),v.le(h,d))return e(-1,h)}else if(v.lt(h,q.get())&&(q.set(h),t.set(Math.min(t.get()+1E3*b,1E3*c))),v.ge(g,d))return e(1,g);b=d+t.get()*(q.get()-d)/1E3;1==
r.get()?v.ge(b,h)&&(b=h-1E-7):v.le(b,g)&&(b=g+1E-7);u.set(b);return b};v.alma=function(a,b,c,d){c=Math.floor(c*(b-1));var e=b/d*(b/d);d=[];for(var g=0,h=0;h<b;++h){var k=Math.exp(-1*Math.pow(h-c,2)/(2*e)),g=g+k;d.push(k)}for(h=0;h<b;++h)d[h]/=g;for(h=c=0;h<b;++h)c+=d[h]*a.get(b-h-1);return c};v.wvap=function(a,b){return a.get()-a.get(1)};v.change=function(a){return a.get()-a.get(1)};v.roc=function(a,b){var c=a.get(b);return 100*(a.get()-c)/c};v.dev=function(a,b,c){c=v.sma(a,b,c);return v.dev2(a,b,
c)};v.dev2=function(a,b,c){for(var d=0,e=0;e<b;e++)var g=a.get(e),g=v.abs(g-c),d=d+g;return d/b};v.stdev=function(a,b,c){a=v.variance(a,b,c);return v.sqrt(a)};v.variance=function(a,b,c){c=v.sma(a,b,c);return v.variance2(a,c,b)};v.variance2=function(a,b,c){for(var d=0,e=0;e<c;e++)var g=a.get(e),g=v.abs(g-b),d=d+g*g;return d/c};v.percentrank=function(a,b){if(v.na(a.get(b-1)))return NaN;for(var c=0,d=a.get(),e=1;e<b;e++){var g=a.get(e);v.ge(d,g)&&c++}return 100*c/b};c.LOW=0;c.HIGH=1;c.prototype.isPivotFound=
function(){return-1!=this._pivotIndex.get()};c.prototype.pivotIndex=function(){return this._pivotIndex.get()};c.prototype.currentValue=function(){return this._currentValue.get()};c.prototype.pivotType=function(){return this._pivotType};c.prototype.reset=function(){this._currentValue.set(NaN);this._currentIndex.set(0);this._pivotIndex.set(-1)};c.prototype.isRightSideOk=function(a){return a-this._currentIndex.get()==this._areaRight};c.prototype.isViolate=function(a,b){if(1>a||isNaN(this._currentValue.get()))return!0;
var d=this._series.get(this._index-a);return isNaN(d)?!0:d===this._currentValue.get()?b:this._pivotType==c.HIGH?d>this._currentValue.get():d<this._currentValue.get()};c.prototype.processPoint=function(a){this.isViolate(a,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(a))};c.prototype.isRestartNeeded=function(a){return a-this._currentIndex.get()>this._areaRight};c.prototype.update=function(){this._isNewBar&&this.isPivotFound()&&this.reset();this.processPoint(this._index);if(this.isRightSideOk(this._index)){if(-1==
this._pivotIndex.get()){for(var a=!0,b=0;b<this._areaLeft;++b)if(this.isViolate(this._currentIndex.get()-1-b,!0)){a=!1;break}a&&this._pivotIndex.set(this._currentIndex.get())}}else-1!=this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),b=0;b<=this._areaRight;++b)this.processPoint(this._index-this._areaRight+b)};d.prototype.addPivot=function(a,b,c){this._lastIndex.set(a);this._lastVal.set(b);this._lastType.set(c)};d.prototype.updatePivot=function(a,
b){this._lastIndex.set(a);this._lastVal.set(b)};d.prototype.lastPrice=function(){return this._lastVal.get()};d.prototype.lastIndex=function(){return this._lastIndex.get()};d.prototype.addPoint=function(a,b,d){if(isNaN(this._lastVal.get()))this.addPivot(a,b,d);else{var e=this._lastVal.get();this._lastType.get()==d?(d===c.HIGH?b>e:b<e)&&this.updatePivot(a,b):Math.abs(e-b)/b>this._deviation&&this.addPivot(a,b,d)}};d.prototype.processPivot=function(a){a.update();this._isBarClosed&&a.isPivotFound()&&this.addPoint(a.pivotIndex(),
a.currentValue(),a.pivotType())};v.zigzag=function(a,b,c){return(new d(a,b,c)).lastPrice()};v.zigzagbars=function(a,b,c){a=new d(a,b,c);return-1==a.lastIndex()?NaN:a.lastIndex()-v.n(c)};e.prototype.new_sym=function(a,b,c){return this.symbol.script.add_sym(a,b,c)};e.prototype.select_sym=function(a){this.symbol=this.symbol.script.get_sym(a)};e.prototype.new_var=function(a){var b=this.vars;b.length<=this.vars_index&&b.push(new g(this.symbol));b=b[this.vars_index++];0<arguments.length&&b.set(a);return b};
e.prototype.new_ctx=function(){this.ctx.length<=this.ctx_index&&this.ctx.push(new e(this.symbol));return this.ctx[this.ctx_index++]};e.prototype.prepare=function(a){for(var b=this.vars_index=this.ctx_index=0;b<this.vars.length;b++)this.vars[b].prepare(a);for(b=0;b<this.ctx.length;b++)this.ctx[b].prepare(a)};e.prototype.stop=function(){this.vars=this.symbol=null};g.prototype.valueOf=function(){return this.get(0)};g.prototype.get=function(a){isNaN(a)&&(a=0);a=a||0;return this.hist?a>=this.hist.length?
(console.error("not enough depth: "+this),NaN):this._get(a):(this.mindepth=v.max(this.mindepth,a),NaN)};g.prototype._get=function(a){a=this.hist_pos-a;0>a&&(a+=this.hist.length);return this.hist[a]};g.prototype.set=function(a){this.hist&&(this.hist[this.hist_pos]=a,this.modified=!0)};g.prototype.prepare=function(a){a===this.symbol&&(a.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)};g.prototype.add_hist=function(){if(!this.hist){for(var a=
v.na(this.mindepth)?v.max_series_size:v.min(this.mindepth+1,v.max_series_size),a=Math.round(a),b=Array(a),c=0;c<a;c++)b[c]=NaN;this.hist=b;this.hist_pos=-1}this.hist_pos=(this.hist_pos+1)%this.hist.length;this.hist[this.hist_pos]=this.original};g.prototype.adopt=function(a,b,c){this.hist||(this.mindepth=NaN);var d=b.get(),d=a.indexOf(d);0!==c&&(b=b.get(1),v.na(b)||(a=a.indexOf(b),d=d===a?-1:d));return 0>d?NaN:this._get(d)};g.prototype.indexOf=function(a){if(!this.hist)return this.mindepth=NaN,-1;
if(v.na(a))return-1;for(var b=this.symbol.index+1,c=this.hist.length,d=0,b=(b>c?c:b)-1,c=(b+d)/2|0;;){if(this._get(c)>a){if(d=c+1,d>b)return c+1}else if(b=c-1,d>b)return c;c=(b+d)/2|0}};h.parseTicker=function(a){var b=a.indexOf(":");return-1===b?a:a.substr(b+1)};h.parsePeriod=function(a){var b=(a+"").slice(0),c;0<=b.indexOf(",")&&(a=b.split(","),c=h.parsePeriod(a[1]),b=a[0]);a=!1;var d=b[b.length-1];-1==="DWM".indexOf(d)&&(a=!0,d="");b=parseInt(a?b:1<b.length?b.slice(0,b.length-1):1);return{resolution:d,
interval:b,pureResolution:[b,d].join(""),isIntraday:a,range:c}};h.newBarBuilder=function(a,b,c){a=h.parsePeriod(a);return A.newBarBuilder(a.resolution,a.interval,b,c)};h.newSession=function(a,b){var c=w.get_timezone(a);return(new A.Session).init(c,b)};h.prototype.set_symbolinfo=function(a){a||console.error("WARN: symbolinfo isn't defined for "+this.tickerid);this.info=a;this.timezone=w.get_timezone(a.timezone);this.session.init(this.timezone,a.session);for(var b in this.other_sessions)this.other_sessions.hasOwnProperty(b)&&
this.other_sessions[b].init(this.timezone,b)};h.prototype.get_session=function(a){if(!a)return this.session;var b=this.other_sessions[a];b||(b=new A.Session,this.other_sessions[a]=b);return b};h.prototype.isdwm=function(){return""!==this.resolution};h.prototype.enable_dwm_aligning=function(a,b){this.dwm_aligner=h.newBarBuilder(this.period,a,b)};h.prototype.bartime=function(a,b){var c=this.time;if(a){var d=a;b&&(d+=b);var e=this.bb_cache[d];e||(e=this.get_session(b),e=h.newBarBuilder(a,e),this.bb_cache[d]=
e);c=e.alignTime(c)}if(!this.isdwm()||isNaN(c))return c;var d=w.utc_to_cal(this.timezone,c),g=this.session.spec,k=w.get_day_of_week(d),e=w.get_minutes_from_midnight(d),k=g.findSession(k,e),g=k.isOvernight(),e=k.start()<=e;if(!g||!e)return c;w.add_date(d,1);return w.cal_to_utc(this.timezone,d)};h.prototype.lastbar=function(a){if(!isNaN(a.time)){var b=a.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(b),b=this.dwm_aligner.startOfBar(0));var c=this.time!==b;c&&0<=this.index&&!this.isBarClosed&&(this.isNewBar=
!1,this.isBarClosed=!0,this.script.calc(this));this.time=b;this.open=a.open;this.high=a.high;this.low=a.low;this.close=a.close;this.volume=a.volume;this.updatetime=a.updatetime;this.isNewBar=c;this.isBarClosed=a.isBarClosed;this.isNewBar&&this.index++;this.script.calc(this)}};k.prototype.calc=function(a){var b=this.ctx,c=this.body;b.prepare(a);a=c.main(b,this.inputCallback);!isNaN(b.symbol.time)&&this.out&&this.out(b.symbol,a)};k.prototype.init=function(){var a=this.ctx,b=this.body;b.init&&b.init(a,
this.inputCallback);b.main(a,this.inputCallback)};k.prototype.add_sym=function(a,b,c){a=this.runner.add_sym(a,b,c,this);this.symbols.push(a);a.isdwm()&&1<this.symbols.length&&a.enable_dwm_aligning(this.symbols[0].session,a.session);return a};k.prototype.stop=function(a){this.symbols=null;this.ctx.stop();this.ctx=null};k.prototype.get_sym=function(a){return this.symbols[a]};l.prototype.add_sym=function(a,b,c,d){a=new h(a,b,c,d);this.symbols.push(a);return a};l.prototype.get_sym=function(a){return this.symbols[a]};
l.prototype.start=function(){function a(e,g){var h=l.feed.subscribe(e.tickerid,e.period,e.periodBase,function(a){c.update(g,a)},b.onErrorCallback,b.symbolInfo,b.rangeExtension);d.push(h)}var b=this.host;this._script=new k(b.tickerid,b.period,b.periodBase||b.period,this,b.body,b.out,b.input);for(var c=this,d=[],e=this.symbols,g=0;g<e.length;g++)a(e[g],g);this.subscription=d};l.prototype.stop=function(){var a=this.subscription;if(a||this._script){for(var b=0;b<a.length;b++)l.feed.unsubscribe(a[b]);
this.subscription=null;this._script.stop();this.symbols=this._script=null}else console.warn("Recurring script engine stop happened.")};l.prototype.update=function(a,b){if(b){var c=this.symbols[a];if(this.isRecalculated){var d=b.bar(b.count()-1);d.isBarClosed=b.isLastBarClosed();c.lastbar(d)}else this.barsets[a]||(this.barsets[a]=b,c.set_symbolinfo(b.symbolinfo()),this.recalc())}else console.error("Unexpected barset = null")};l.prototype.recalc=function(){for(var a=this.symbols,b=0;b<a.length;b++)if(!this.barsets[b])return;
for(b=a.length-1;0<=b;b--)for(var c=a[b],d=this.barsets[b],e=d.count(),g=0;g<e;g++){var h=d.bar(g);h.isBarClosed=g===e-1?d.isLastBarClosed():!0;c.lastbar(h)}this.isRecalculated=!0;this.host.recalc(this)};l.feed={subscribe:function(a,b,c,d){console.error("must be initialized with setupFeed")},unsubscribe:function(a){console.error("must be initialized with setupFeed")}};m.prototype.stop=function(){this.runner.stop()};n.prototype._alignBarTime=function(a){this.dwm_aligner.moveTo(a);return this.dwm_aligner.startOfBar(0)};
n.prototype._alignBars=function(){for(var a=this.bars,b=0;b<a.length;b++)a[b].time=this._alignBarTime(a[b].time)};n.prototype.set_dwm_aligner=function(a){this.dwm_aligner||(this.dwm_aligner=a,this._alignBars())};n.prototype.symbolinfo=function(){return this.info};n.prototype.isLastBarClosed=function(){return this.isBarClosed};n.prototype.bar=function(a){return this.bars[a]};n.prototype.count=function(){return this.bars.length};n.prototype.add=function(a,b){var c=this.cloneData?TradingView.clone(a):
a;this.dwm_aligner&&(c.time=this._alignBarTime(c.time));var d=this.bars,e=d.length,g=c.time,h=0===e?NaN:d[e-1].time;0===e||h<g?d.push(c):h===g?d[e-1]=c:console.error("time order violation, prev: "+(new Date(h)).toUTCString()+", cur: "+(new Date(g)).toUTCString());this.isBarClosed=!!b};q.prototype.init=function(a){this.bb=h.newBarBuilder(this.period,a.symbol.session);this.bbEmptyBars=this.generateEmptyBars?h.newBarBuilder(this.period,a.symbol.session):void 0};q.prototype.extrapolate=function(a,b){return isNaN(a)||
isNaN(b)?void 0:A.extrapolateBarsFrontToTime(this.bbEmptyBars,a,b)};q.prototype.main=function(a){var b=a.symbol.time,c=this.bb.alignTime(b),d=a.new_var(c),e=v.na(c),g=d.get(1),h=v.na(g)?1:v.neq(c,g),d=a.new_var(),k=a.new_var(),l=a.new_var(),m=a.new_var(),n=d.get(1),q=k.get(1),r=l.get(1),t=m.get(1),n=e?NaN:h?v.open(a):n,q=e?NaN:h?v.high(a):v.max(v.high(a),q),r=e?NaN:h?v.low(a):v.min(v.low(a),r),u=e?NaN:v.close(a),t=e?NaN:h?v.volume(a):v.volume(a)+t,e=e?NaN:b,b=a.symbol.isBarClosed&&this.bb.isLastBar(b),
g=this.generateEmptyBars&&h?this.extrapolate(g,c):void 0;a=a.new_var(v.close(a)).get(1);a=g instanceof Array?a:NaN;d.set(n);k.set(q);l.set(r);m.set(t);return[c,n,q,r,u,t,e,b,g,a]};r.prototype.main=function(a){var b=a.new_var(v.open(a)),c=a.new_var(v.close(a)),d=b.get(1),e=c.get(1),c=v.ohlc4(a),d=v.na(b.get(1))?(v.open(a)+v.close(a))/2:(d+e)/2;b.set(d);var b=v.max(v.high(a),v.max(d,c)),e=v.min(v.low(a),v.min(d,c)),g=v.volume(a);a=a.symbol;return[a.time,d,b,e,c,g,a.updatetime,a.isBarClosed]};u.prototype.main=
function(a){var b=v.open(a),c=v.high(a),d=v.low(a),e=v.close(a);a=v.volume(a);return[b,c,d,e,a]};var B={Std:v,Series:g,Symbol:h,SymbolInfo:function(a,b){this.timezone=a||"America/New_York";this.session=b||"0000-0000"},StudyEngine:m,BarSet:n,OHLCV:u,BarBuilder:q,HeikenAshi:r,setupFeed:function(a,b){l.feed=a;b&&(h.inputSessionForDWM=h.newSession("UTC","24x7"))}};"undefined"!==typeof module&&module.exports?module.exports=B:this.PineJS=B;return B}(this);PineJSFeed=function(){function a(a){this.host=a;this.cache={}}function b(a){return a.has_empty_bars||a.force_session_rebuild}function c(a){if(0!==a.indexOf("="))return{symbol:a};a=JSON.parse(a.slice(1));a.type&&(0===a.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?a.builder=new d.HeikenAshi:console.error("unknown builder type: "+a.type));"string"!=typeof a.symbol&&(a.session=a.symbol.session||a.session,a.symbol=a.symbol.symbol);return a}var d=this.PineJS?this.PineJS:require("./iljs.js"),e=this.PineJsBarBuilder?
this.PineJsBarBuilder:require("./barbuilder.js"),g=d.Symbol,h=d.StudyEngine,k=d.BarBuilder,l=d.BarSet;a.prototype.getCache=function(a){return this.cache[a]};a.prototype.putCache=function(a,b){this.cache[a]=b};a.prototype.subscribe=function(a,c,d,e,g,h){var k;k=b(h)?"_":"";k=a+c+d+k;var l=this.getCache(k);l||(l=this.createItem(a,c,d,h),this.putCache(k,l));l.listeners.addListener(e,g);return{key:k,listener:e}};a.prototype.unsubscribe=function(a){var b=this.getCache(a.key);b&&b.listeners.removeListener(a.listener)};
a.prototype.removeUnused=function(){var a=[],b;for(b in this.cache)this.cache[b]&&0===this.cache[b].listeners.listenersCount()&&a.push(b);if(0!==a.length){for(b=0;b<a.length;b++){var c=a[b],d=this.cache[c];this.cache[c]=null;d.stop()}this.removeUnused()}};a.prototype.rebuildFrom=function(a,b,c){a=g.parsePeriod(a);b=g.parsePeriod(b);if(""!==a.resolution){if(c.has_weekly_and_monthly)return a.resolution;if("undefined"===typeof c.has_daily||c.has_daily)return"D";""!==b.resolution&&(b.resolution="",b.interval=
c.intraday_multipliers?c.intraday_multipliers[0]:1)}if("undefined"!==typeof c.has_intraday&&!c.has_intraday)return"";b=""!==a.resolution?b.interval:""===b.resolution?Math.min(a.interval,b.interval):a.interval;if(c.intraday_multipliers&&(c=c.intraday_multipliers,-1===c.indexOf(b))){for(a=c.length-1;0<=a;a--){var d=c[a];if(0===b%d)return""+d}return""}return""+b};a.prototype.createItem=function(a,d,e,g){var h=new q;a=c(a);if(a.builder)return new n(h,a.symbol,d,e,a.builder,g);var l=this.rebuildFrom(d,
e,g),r=b(g);return d!==l||r?(e=g.has_empty_bars,g=$.extend({},g),r&&(g.has_empty_bars=!1,g.force_session_rebuild=!1),new n(h,a.symbol,d,l,new k(d,e),g)):new m(h,a.symbol,d,e,a.session&&"extended"!==a.session,this.host,g)};var m=function(a,b,c,d,e,h,k){this.listeners=a;this.host=h;this._aligner_required=g.inputSessionForDWM&&"D"===c;this._aligner_set=!1;var l=this;this.host.resolve(b,function(a){e&&a.regular_session&&(a.session=a.regular_session);var g=l.calculateFromTo(a,d||c,b);l.subs=l.host.subscribe(a,
c,g,function(a){l._aligner_required&&!l._aligner_set&&(a.set_dwm_aligner(l._create_dwm_aligner(c,a.info)),l._aligner_set=!0);l.listeners.fire(a)},function(a){l.listeners.onError(a)})},function(a){l.listeners.onError(a)})};m.prototype._create_dwm_aligner=function(a,b){var c=PineJsCalendar.get_timezone(b.timezone),d=new e.Session;d.init(c,b.session);return g.newBarBuilder(a,d,g.inputSessionForDWM)};m.prototype.stop=function(){this.host.unsubscribe(this.subs)};m.prototype.calculateFromTo=function(a,
b,c){c=g.parsePeriod(b);var d=(new Date).valueOf(),d=a.expired?PineJsCalendar.cal_to_utc(PineJsCalendar.get_timezone(a.timezone),new Date(1E3*a.expiration_date))||d:d,h,k;""===c.resolution?(h=c.interval,k="D"):(h=12*("D"===c.resolution?1:"W"===c.resolution?5:30)*c.interval,k="M");c.range?(h=c.range.interval,k=c.range.resolution):this.host.calculateHistoryDepth&&(b=this.host.calculateHistoryDepth(b,k,h))&&(h=b.intervalBack||h,k=b.resolutionBack||k);a=a.sessionString||a.session;b=e.alignPeriodsBack(a,
k,h,1,d);this.host.getRangeExtension&&(h=this.host.getRangeExtension(),0<h&&(b=e.alignPeriodsBack(a,c.resolution,c.interval,h,b)));return{from:b,to:d+6E4}};var n=function(a,b,c,d,e,g){this.listeners=a;this.isRecalculated=!1;if(""===d)console.error("unsupported resolution for rebuild: "+c),this.listeners.onError("unsupported resolution for rebuild: "+c);else{var k=this;this.engine=new h({tickerid:b,period:d,periodBase:c,body:e,symbolInfo:g,recalc:function(){k._recalc()},out:function(a,b){k._out(a,
b)},onErrorCallback:function(a){k.listeners.onError(a)}})}};n.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")};n.prototype._recalc=function(){this.isRecalculated&&console.error("recalc called twice!");this.barset&&this.listeners.fire(this.barset);this.isRecalculated=!0};n.prototype._out=function(a,b){var c=b[0];if(!isNaN(c)){var c={time:c,open:b[1],high:b[2],low:b[3],close:b[4],volume:b[5],updatetime:b[6]},d=b[7];this.barset||(this.barset=new l(a.info));
var e=b[8];if(e instanceof Array)for(var g=0;g<e.length;g++){var h=b[9],k=e[g];this.barset.add({time:k,open:h,high:h,low:h,close:h,volume:0,updatetime:k},!0);this.isRecalculated&&this.listeners.fire(this.barset)}this.barset.add(c,d);this.isRecalculated&&this.listeners.fire(this.barset)}};var q=function(){this.listeners=[]};q.prototype.listenersCount=function(){return this.listeners.reduce(function(a,b){return a+(b?1:0)},0)};q.prototype.addListener=function(a,b){this.listeners.push({dataListener:a,
onErrorCallback:b});this.barset&&a(this.barset);this.errorMsg&&b(this.errorMsg)};q.prototype.removeListener=function(a){var b=this.listeners.filter(function(b){return b.dataListener==a});0!=b.length&&(b=this.listeners.indexOf(b[0]),delete this.listeners[b])};q.prototype.onError=function(a){this.errorMsg=a||"unspecified error";for(var b=this.listeners,c=b.length,d=0;d<c;d++){var e=b[d];if(e&&e.onErrorCallback)e.onErrorCallback(a)}};q.prototype.fire=function(a){this.barset=a;for(var b=this.listeners,
c=b.length,d=0;d<c;d++){var e=b[d];e&&e.dataListener(a)}};var r={setupFeed:function(b,c){a.instance=new a(b);d.setupFeed(a.instance,c)},parseSymbol:c,unsubscribeUnused:function(){a.instance.removeUnused()}};"undefined"!==typeof module&&module.exports?module.exports=r:this.PineJSFeed=r;return r}(this);A82.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",
scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(a,b,c,d){return PineJS.Std.or(PineJS.Std.and(PineJS.Std.eq(a,b),PineJS.Std.eq(a,c)),PineJS.Std.eq(b,c))?0:(2*a-c-b)/(b-c)*d};this.main=function(a,b){this._context=a;this._input=b;var c=this.f_0(PineJS.Std.close(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context),PineJS.Std.volume(this._context));return[PineJS.Std.cum(c,this._context)]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,
isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",
is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(a,b){return 100*(a+b)/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.high(this._context),e=c+1,d=this._context.new_var(d),d=PineJS.Std.highestbars(d,e,this._context),d=this.f_0(d,c),g=PineJS.Std.low(this._context),g=this._context.new_var(g),e=PineJS.Std.lowestbars(g,
e,this._context),c=this.f_0(e,c);return[d,c]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",
defval:10,type:"integer",min:1,max:1E12}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.gt(a,b)};this.f_1=function(a,b){return PineJS.Std.lt(a,b)};this.f_2=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context)),d=this._context.new_var(d),d=PineJS.Std.sum(d,c,this._context),e=this.f_1(PineJS.Std.close(this._context),
PineJS.Std.open(this._context)),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context);return[this.f_2(d,c)]}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",
shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.tr(this._context),d=this._context.new_var(d);return[PineJS.Std.sma(d,c,this._context)]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,
defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},
1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(a,b){return a-b};this.f_1=function(a){return PineJS.Std.le(a,0)?0:1};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.hl2(this._context),d=this._context.new_var(c),d=PineJS.Std.sma(d,5,this._context),c=this._context.new_var(c),c=PineJS.Std.sma(c,34,this._context),d=this.f_0(d,c),c=this._context.new_var(d),c=PineJS.Std.change(c),
c=this.f_1(c);return[d,c]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",
defval:20,type:"integer",min:1,max:1E12},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.f_3=function(a,b,c){return(a-b)/c};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._context.new_var(c),
g=PineJS.Std.sma(g,d,this._context),c=this._context.new_var(c),d=PineJS.Std.stdev(c,d,this._context),d=this.f_0(e,d),e=this.f_1(g,d),d=this.f_2(g,d);return[this.f_3(e,d,g)]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,
joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(a,b,c,d){return(a-b)/(c-d)};this.main=function(a,b){this._context=a;this._input=b;return[this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",
type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1E12},{id:"in_1",name:"mult",
defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._context.new_var(c),g=PineJS.Std.sma(g,d,this._context),c=this._context.new_var(c),d=PineJS.Std.stdev(c,d,this._context),
d=this.f_0(e,d),e=this.f_1(g,d),d=this.f_2(g,d);return[g,e,d]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",transparency:90,visible:!0}},
inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1E12},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,
max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.f_3=function(a,b,c){return(a-b)/(c-b)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._context.new_var(c),g=PineJS.Std.sma(g,d,this._context),h=this._context.new_var(c),d=PineJS.Std.stdev(h,
d,this._context),d=this.f_0(e,d),e=this.f_1(g,d),g=this.f_2(g,d);return[this.f_3(c,g,e)]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},
description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1E12}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(a,b,c,d){return PineJS.Std.or(PineJS.Std.and(PineJS.Std.eq(a,b),PineJS.Std.eq(a,c)),PineJS.Std.eq(b,c))?0:(2*a-c-b)/(b-c)*d};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=
a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context),PineJS.Std.volume(this._context)),d=this._context.new_var(d),d=PineJS.Std.sum(d,c,this._context),e=PineJS.Std.volume(this._context),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context);return[this.f_1(d,c)]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,
linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:1E12},{id:"in_1",name:"long",defval:10,
type:"integer",min:1,max:1E12}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.accdist(this._context),g=this._context.new_var(e),c=PineJS.Std.ema(g,c,this._context),e=this._context.new_var(e),d=PineJS.Std.ema(e,d,this._context);return[this.f_0(c,d)]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",
shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:1E12},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1E12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1E12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(a,b,c){return a-b*c};this.f_1=function(a,b,c){return a+b*c};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),
d=this._input(1),e=this._input(2),g=PineJS.Std.high(this._context),h=this._context.new_var(g),k=PineJS.Std.highest(h,c,this._context),h=PineJS.Std.atr(c,this._context),k=this.f_0(k,d,h),g=this._context.new_var(g),c=PineJS.Std.lowest(g,c,this._context),d=this.f_1(c,d,h),c=this._context.new_var(k),c=PineJS.Std.highest(c,e,this._context),d=this._context.new_var(d);return[PineJS.Std.lowest(d,e,this._context),c]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,
is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},
constructor:function(){this.f_0=function(a){return PineJS.Std.ge(a,0)?a:0};this.f_1=function(a){return PineJS.Std.ge(a,0)?0:-a};this.f_2=function(a,b){return 100*a/b};this.f_3=function(a,b){return this.f_2(a-b,a+b)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.change(d),e=this.f_0(d),d=this.f_1(d),e=this._context.new_var(e),e=PineJS.Std.sum(e,c,this._context),d=this._context.new_var(d),c=PineJS.Std.sum(d,
c,this._context);return[this.f_3(e,c)]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},
plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1E12}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},
constructor:function(){this.f_0=function(a,b,c){return(a-b)/(.015*c)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._context.new_var(c),e=PineJS.Std.sma(e,d,this._context),g=this._context.new_var(c),d=PineJS.Std.dev(g,d,this._context);return[this.f_0(c,e,d)]}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,
transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",
name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(a,b,c,d){return 100*PineJS.Std.log10(a/(b-c))/d};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.atr(1,this._context),d=this._context.new_var(d),
d=PineJS.Std.sum(d,c,this._context),e=PineJS.Std.high(this._context),e=this._context.new_var(e),e=PineJS.Std.highest(e,c,this._context),g=PineJS.Std.low(this._context),g=this._context.new_var(g),g=PineJS.Std.lowest(g,c,this._context),c=PineJS.Std.log10(c);return[this.f_0(d,e,g,c)]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,
color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},
description:"Directional Movement Index",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:1E12},{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(a){return-a};this.f_1=function(a,b){return PineJS.Std.and(PineJS.Std.gt(a,b),PineJS.Std.gt(a,0))?a:0};this.f_2=function(a,b){return 100*
a/b};this.f_3=function(a,b){return a+b};this.f_4=function(a,b,c){return PineJS.Std.abs(a-b)/(PineJS.Std.eq(c,0)?1:c)};this.f_5=function(a){return 100*a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.high(this._context),e=this._context.new_var(e),g=PineJS.Std.change(e),e=PineJS.Std.low(this._context),e=this._context.new_var(e),e=PineJS.Std.change(e),h=this.f_0(e),e=PineJS.Std.tr(this._context),e=this._context.new_var(e),k=PineJS.Std.rma(e,
c,this._context),e=this.f_1(g,h),e=this._context.new_var(e),e=PineJS.Std.rma(e,c,this._context),e=this.f_2(e,k),e=PineJS.Std.fixnan(e,this._context),g=this.f_1(h,g),g=this._context.new_var(g),c=PineJS.Std.rma(g,c,this._context),c=this.f_2(c,k),c=PineJS.Std.fixnan(c,this._context),g=this.f_3(e,c),g=this.f_4(e,c,g),g=this._context.new_var(g),d=PineJS.Std.rma(g,d,this._context),d=this.f_5(d);return[e,c,d]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,
defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coeff",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:1E12}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",
name:"Correlation Coeff"},constructor:function(){this.init=function(a,b){this._context=a;this._input=b;this._context.new_sym(this._input(0),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;this._input=b;var c=this._context.new_var(this._context.symbol.time);this._input(0);PineJS.Std.period(this._context);var d=PineJS.Std.close(this._context),e=this._input(1);this._context.select_sym(1);var g=this._context.new_var(this._context.symbol.time),
h=PineJS.Std.close(this._context),h=this._context.new_var(h);this._context.select_sym(0);c=h.adopt(g,c,0);d=this._context.new_var(d);c=this._context.new_var(c);return[PineJS.Std.correlation(d,c,e,this._context)]}}},{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:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1},plot_2:{title:"Plot",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:1E12}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.low(this._context),d=this._context.new_var(d),d=PineJS.Std.lowest(d,c,this._context),e=PineJS.Std.high(this._context),
e=this._context.new_var(e),c=PineJS.Std.highest(e,c,this._context),e=PineJS.Std.avg(c,d);return[d,c,e]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double Exponential Moving Average",
shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(a,b){return 2*a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),e=this._context.new_var(d),c=PineJS.Std.ema(e,
c,this._context);return[this.f_0(d,c)]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1E4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",
defval:1E4,type:"integer",min:1,max:1E12},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(a,b,c,d,e){return a*b*(c-d)/e};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.hl2(this._context),e=this._context.new_var(e),e=PineJS.Std.change(e),c=this.f_0(c,e,PineJS.Std.high(this._context),PineJS.Std.low(this._context),
PineJS.Std.volume(this._context)),c=this._context.new_var(c);return[PineJS.Std.sma(c,d,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:"Elders Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:1E12}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(a,b){return a*b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.change(d),
d=this.f_0(d,PineJS.Std.volume(this._context)),d=this._context.new_var(d);return[PineJS.Std.sma(d,c,this._context)]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,
visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",
objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:1E12},{id:"in_1",name:"percent",defval:10,type:"float",min:-1E12,max:1E12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(a,b,c){return a?b:c};this.f_1=function(a,b){return a*(1+b)};this.f_2=function(a,b){return a*(1-b)};this.main=function(a,b){this._context=a;
this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._input(2),h=this._context.new_var(c),h=PineJS.Std.ema(h,d,this._context),c=this._context.new_var(c),d=PineJS.Std.sma(c,d,this._context),g=this.f_0(g,h,d),d=e/100,e=this.f_1(g,d),d=this.f_2(g,d);return[g,e,d]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,
color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},
inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"}],styles:{plot_0:{title:"Tenkan-sen",histogramBase:0,joinPoints:!1},plot_1:{title:"Kijun-sen",histogramBase:0,joinPoints:!1},plot_2:{title:"Chikou span",histogramBase:0,joinPoints:!1},plot_3:{title:"Senkou A",histogramBase:0,joinPoints:!1},plot_4:{title:"Senkou B",histogramBase:0,joinPoints:!1}},description:"Ichimoku Cloud",
shortDescription:"Ichimoku",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:1E12},{id:"in_1",name:"Middle",defval:26,type:"integer",min:1,max:1E12},{id:"in_2",name:"Long",defval:52,type:"integer",min:1,max:1E12},{id:"in_3",name:"displacement",defval:26,type:"integer",min:1,max:1E12}],id:"Ichimoku Cloud@tv-basicstudies-1",scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.f_0=
function(a){return-a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=this._input(3),h=PineJS.Std.low(this._context),k=this._context.new_var(h),l=PineJS.Std.lowest(k,c,this._context),k=PineJS.Std.high(this._context),m=this._context.new_var(k),c=PineJS.Std.highest(m,c,this._context),c=PineJS.Std.avg(l,c),l=this._context.new_var(h),l=PineJS.Std.lowest(l,d,this._context),m=this._context.new_var(k),d=PineJS.Std.highest(m,d,this._context),
d=PineJS.Std.avg(l,d),l=PineJS.Std.avg(c,d),h=this._context.new_var(h),h=PineJS.Std.lowest(h,e,this._context),k=this._context.new_var(k),e=PineJS.Std.highest(k,e,this._context),e=PineJS.Std.avg(h,e),k=PineJS.Std.close(this._context);return[c,d,{value:k,offset:this.f_0(g)},{value:l,offset:g},{value:e,offset:g}]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,
visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator"},
constructor:function(){this.f_0=function(a,b){return PineJS.Std.ge(a,0)?b:-b};this.f_1=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.hlc3(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c),d=this.f_0(c,PineJS.Std.volume(this._context)),c=this._context.new_var(d),c=PineJS.Std.ema(c,34,this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,55,this._context),c=this.f_1(c,d),d=this._context.new_var(c),d=PineJS.Std.ema(d,13,this._context);
return[c,d]}}},{name:"Hull MA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull MA",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Hull MA@tv-basicstudies-1",
scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(a,b){return 2*a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=d/2,g=this._context.new_var(c),e=PineJS.Std.wma(g,e,this._context),c=this._context.new_var(c),c=PineJS.Std.wma(c,d,this._context),c=this.f_0(e,c),d=PineJS.Std.sqrt(d),d=PineJS.Std.round(d),c=this._context.new_var(c);return[PineJS.Std.wma(c,d,this._context)]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",
type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,
type:"integer",min:1,max:1E12},{id:"in_2",name:"mult",defval:1,type:"float",min:-1E12,max:1E12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels"},constructor:function(){this.f_0=function(a,b,c,d){return a?b:c-d};this.f_1=function(a,b,c){return a+b*c};this.f_2=function(a,b,c){return a-b*c};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._input(2),c=this._context.new_var(c),c=PineJS.Std.ema(c,
e,this._context),d=this.f_0(d,PineJS.Std.tr(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,e,this._context),e=this.f_1(c,d,g),g=this.f_2(c,d,g);return[e,c,g]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",
type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1E12}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.linreg(c,
d,0)]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",
type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:1E12},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:1E12},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:1E12},{id:"in_3",name:"roclen4",defval:30,
type:"integer",min:1,max:1E12},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:1E12},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:1E12},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:1E12},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:1E12},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:1E12}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(a,b,c,d){return a+
2*b+3*c+4*d};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=this._input(3),h=this._input(4),k=this._input(5),l=this._input(6),m=this._input(7),n=this._input(8),q=PineJS.Std.close(this._context),r=this._context.new_var(q),c=PineJS.Std.roc(r,c),c=this._context.new_var(c),h=PineJS.Std.sma(c,h,this._context),c=this._context.new_var(q),d=PineJS.Std.roc(c,d),d=this._context.new_var(d),k=PineJS.Std.sma(d,k,this._context),d=this._context.new_var(q),
e=PineJS.Std.roc(d,e),e=this._context.new_var(e),l=PineJS.Std.sma(e,l,this._context),q=this._context.new_var(q),g=PineJS.Std.roc(q,g),g=this._context.new_var(g),m=PineJS.Std.sma(g,m,this._context),m=this.f_0(h,k,l,m),g=this._context.new_var(m),n=PineJS.Std.sma(g,n,this._context);return[m,n]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},
plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",
shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:1E12},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:1E12}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(a,b){return a?b:PineJS.Std.na()};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),g=this._context.new_var(e),c=PineJS.Std.sma(g,c,this._context),
e=this._context.new_var(e),d=PineJS.Std.sma(e,d,this._context),e=PineJS.Std.cross(c,d,this._context),e=this.f_0(e,c);return[c,d,e]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",
transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2E3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",
name:"Money Flow"},constructor:function(){this.f_0=function(a,b,c){return a*(PineJS.Std.le(b,0)?0:c)};this.f_1=function(a,b,c){return a*(PineJS.Std.ge(b,0)?0:c)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.hlc3(this._context),e=this._context.new_var(d),g=PineJS.Std.change(e),e=this.f_0(PineJS.Std.volume(this._context),g,d),e=this._context.new_var(e),e=PineJS.Std.sum(e,c,this._context),d=this.f_1(PineJS.Std.volume(this._context),g,d),d=this._context.new_var(d),
c=PineJS.Std.sum(d,c,this._context);return[PineJS.Std.rsi(e,c)]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",
name:"length",defval:10,type:"integer",min:1,max:1E12}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(a,b){return a-b};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.high(this._context),PineJS.Std.low(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,9,this._context),e=this._context.new_var(d),e=PineJS.Std.ema(e,9,this._context),d=this.f_1(d,
e),d=this._context.new_var(d);return[PineJS.Std.sum(d,c,this._context)]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,
inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1E12}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.ema(c,d,this._context)]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,
linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(a,b,c){return PineJS.Std.gt(a,0)?b:PineJS.Std.lt(c,0)?-b:0*b};this.main=function(a,b){this._context=a;this._input=
b;var c=PineJS.Std.close(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c);return[this.f_0(c,PineJS.Std.volume(this._context),c)]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,
linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",
min:1,max:1E12},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:1E12},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:1E12}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._input(2),h=this._context.new_var(c),d=PineJS.Std.ema(h,d,this._context),
c=this._context.new_var(c),e=PineJS.Std.ema(c,e,this._context),e=this.f_0(d,e),c=this._context.new_var(e),g=PineJS.Std.sma(c,g,this._context);return[this.f_0(e,g),e,g]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,
joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1E12}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.sma(c,d,this._context)]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1E12}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",
name:"Moving Average Weighted"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.wma(c,d,this._context)]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},
plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1E12,max:1E12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1E12,max:1E12},{id:"in_2",name:"maximum",defval:.2,type:"float",min:-1E12,max:1E12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(a,
b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2);return[PineJS.Std.sar(c,d,e,this._context)]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",
shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(a,b,c){return PineJS.Std.gt(a,0)?b:PineJS.Std.lt(c,0)?-b:0*b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c),c=this.f_0(c,PineJS.Std.volume(this._context),c);return[PineJS.Std.cum(c,this._context)]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:1E12},{id:"in_1",name:"longlen",defval:21,type:"integer",
min:1,max:1E12}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(a,b){return(a-b)/b*100};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._context.new_var(c),d=PineJS.Std.sma(g,d,this._context),c=this._context.new_var(c),e=PineJS.Std.sma(c,e,this._context);return[this.f_0(d,e)]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,
isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",
shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:1E12}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(a){return PineJS.Std.max(a,0)};this.f_1=function(a){return-PineJS.Std.min(a,
0)};this.f_2=function(a,b){return PineJS.Std.eq(a,0)?100:PineJS.Std.eq(b,0)?0:100-100/(1+b/a)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c),e=PineJS.Std.change(c),c=this.f_0(e),c=this._context.new_var(c),c=PineJS.Std.rma(c,d,this._context),e=this.f_1(e),e=this._context.new_var(e),d=PineJS.Std.rma(e,d,this._context);return[this.f_2(d,c)]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,
isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",
is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:1E12}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(a,b){return a-b};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context)),d=this._context.new_var(d),d=PineJS.Std.swma(d,this._context),d=this._context.new_var(d),
d=PineJS.Std.sum(d,c,this._context),e=this.f_0(PineJS.Std.high(this._context),PineJS.Std.low(this._context)),e=this._context.new_var(e),e=PineJS.Std.swma(e,this._context),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context),c=this.f_1(d,c),d=this._context.new_var(c),d=PineJS.Std.swma(d,this._context);return[c,d]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,
trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},
{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1E12}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.le(a,0)?0:b};this.f_1=function(a,b){return PineJS.Std.gt(a,0)?0:b};this.f_2=function(a,b){return a/(a+b)*100};this.main=function(a,
b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),e=this._context.new_var(d),c=PineJS.Std.stdev(e,c,this._context),d=this._context.new_var(d),e=PineJS.Std.change(d),d=this.f_0(e,c),d=this._context.new_var(d),d=PineJS.Std.ema(d,14,this._context),c=this.f_1(e,c),c=this._context.new_var(c),c=PineJS.Std.ema(c,14,this._context);return[this.f_2(d,c)]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,
defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,
joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:1E12},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:1E12},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:1E12}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},
constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=PineJS.Std.close(this._context),g=this._context.new_var(g),c=PineJS.Std.tsi(g,c,d,this._context),d=this._context.new_var(c),e=PineJS.Std.ema(d,e,this._context),d=this.f_0(c,e);return[c,e,d]}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,
plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%D",
histogramBase:0,joinPoints:!1},plot_1:{title:"%K",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1E12},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1E12},{id:"in_2",name:"smoothD",defval:3,
type:"integer",min:1,max:1E12}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=PineJS.Std.close(this._context),h=PineJS.Std.high(this._context),k=PineJS.Std.low(this._context),g=this._context.new_var(g),h=this._context.new_var(h),k=this._context.new_var(k),c=PineJS.Std.stoch(g,h,k,c,this._context),c=this._context.new_var(c),d=PineJS.Std.sma(c,
d,this._context),c=this._context.new_var(d),e=PineJS.Std.sma(c,e,this._context);return[d,e]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},
description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:1E12}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(a){return PineJS.Std.log(a)};this.f_1=function(a){return 1E4*a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),
d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),d=this._context.new_var(d),c=PineJS.Std.ema(d,c,this._context),c=this._context.new_var(c),c=PineJS.Std.change(c);return[this.f_1(c)]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,
color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%D",histogramBase:0,joinPoints:!1},plot_1:{title:"%K",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,
bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1E12},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1E12},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1E12},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1E12}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",
name:"Stochastic RSI"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._input(2),h=this._input(3),k=PineJS.Std.rsi(c,d),c=this._context.new_var(k),d=this._context.new_var(k),k=this._context.new_var(k),e=PineJS.Std.stoch(c,d,k,e,this._context),e=this._context.new_var(e),g=PineJS.Std.sma(e,g,this._context),e=this._context.new_var(g),h=PineJS.Std.sma(e,h,this._context);return[g,h]}}},{name:"Triple EMA",
metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",
name:"Triple EMA"},constructor:function(){this.f_0=function(a,b,c){return 3*(a-b)+c};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),e=this._context.new_var(d),e=PineJS.Std.ema(e,c,this._context),g=this._context.new_var(e),c=PineJS.Std.ema(g,c,this._context);return[this.f_0(d,e,c)]}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,
defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1E12}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(a,b){this._context=a;this._input=
b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.vwma(c,d,this._context)]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:1E12},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:1E12}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(a,b){return 100*(a-b)/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),
d=this._input(1),e=PineJS.Std.volume(this._context),g=this._context.new_var(e),c=PineJS.Std.ema(g,c,this._context),e=this._context.new_var(e),d=PineJS.Std.ema(e,d,this._context);return[this.f_0(c,d)]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,
visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,
inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:1E12},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:1E12},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:1E12}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=PineJS.Std.hl2(this._context),h=this._context.new_var(g),c=PineJS.Std.ema(h,
c,this._context),h=this._context.new_var(g),d=PineJS.Std.ema(h,d,this._context),g=this._context.new_var(g),e=PineJS.Std.ema(g,e,this._context);return[{value:c,offset:8},{value:d,offset:5},{value:e,offset:3}]}}},{name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,
value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Willams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],
inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(a,b,c){return 100*(a-b)/(b-c)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.high(this._context),d=this._context.new_var(d),d=PineJS.Std.highest(d,c,this._context),e=PineJS.Std.low(this._context),e=this._context.new_var(e),c=PineJS.Std.lowest(e,c,this._context);return[this.f_0(PineJS.Std.close(this._context),
d,c)]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",
min:-1E12,max:1E12},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:-1E12,max:1E12},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:-1E12,max:1E12}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(a,b){return a+b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),g=PineJS.Std.close(this._context),h=this._context.new_var(g),d=PineJS.Std.roc(h,
d),g=this._context.new_var(g),e=PineJS.Std.roc(g,e),e=this.f_0(d,e),e=this._context.new_var(e);return[PineJS.Std.wma(e,c,this._context)]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},
description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:-1E12,max:1E12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1E12,max:1E12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),e=this._context.new_var(e);
return[PineJS.Std.linreg(e,c,d)]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",
name:"Window Size",defval:9,type:"integer",min:-1E12,max:1E12},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1E12,max:1E12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1E12,max:1E12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),g=this._input(2),c=this._context.new_var(c);return[PineJS.Std.alma(c,
d,e,g)]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,inputs:[{id:"in_0",name:"long",
defval:25,type:"integer",min:-1E12,max:1E12},{id:"in_1",name:"short",defval:13,type:"integer",min:-1E12,max:1E12}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),e=this._context.new_var(e);return[PineJS.Std.tsi(e,d,c,this._context)]}}}];A82.studyLibrary=A82.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",
name:"Source",options:"open high low close hl2 hlc3 ohlc4".split(" "),type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(a,b){this._context=a;this._context.new_sym(b(1),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;var c=this._context.new_var(this._context.symbol.time);PineJS.Std.period(this._context);this._context.select_sym(1);var d=this._context.new_var(this._context.symbol.time),
e=PineJS.Std[b(0)](this._context),e=this._context.new_var(e);this._context.select_sym(0);return[e.adopt(d,c,0)]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{},high:{},low:{},close:{}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",
defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(a,b){this._context=a;this._context.new_sym(b(0),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;var c=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var d=this._context.new_var(this._context.symbol.time),e=this._context.new_var(PineJS.Std.open(this._context)),g=this._context.new_var(PineJS.Std.high(this._context)),
h=this._context.new_var(PineJS.Std.low(this._context)),k=this._context.new_var(PineJS.Std.close(this._context));this._context.select_sym(0);return[e.adopt(d,c,0),g.adopt(d,c,0),h.adopt(d,c,0),k.adopt(d,c,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,
visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{showMA:!1}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},
1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.gt(a,b)?0:1};this.f_1=function(a,b){return a?b:PineJS.Std.na()};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.volume(this._context),e=this.f_0(PineJS.Std.open(this._context),PineJS.Std.close(this._context)),g=PineJS.Std.volume(this._context),g=this._context.new_var(g),g=PineJS.Std.sma(g,
20,this._context),c=this.f_1(c,g);return[d,e,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"ZigZag",shortDescription:"ZigZag",is_price_study:!0,
classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1E3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),c=c/100,e=d/2,d=PineJS.Std.zigzag(c,e,this._context),c=PineJS.Std.zigzagbars(c,e,this._context);return[d,c]}}}]);A81=function(){this._sets={}};A81.prototype._cacheKey=function(a,b){return a};A81.prototype.createPointset=function(a,b,c,d,e,g){b=this._cacheKey(b,c);this._sets.hasOwnProperty(b)||(this._sets[b]=[]);c=[];for(var h=0;h<d.length;++h)if(0!==d[h][1]){var k=e.getPointTimeUTC(d[h][0],d[h][1],g);c.push(k)}else d[h][0]&&c.push(d[h][0]);this._sets[b].push({guid:a,points:c})};
A81.prototype.removePointset=function(a){for(var b in this._sets)for(var c=this._sets[b],d=0;d<c.length;++d)if(c[d].guid==a){c.splice(d,1);return}};A81.prototype._refreshPointsetData=function(a,b,c,d){for(var e=[],g=0;g<a.points.length;++g){var h=a.points[g],k=this._indexOfTime(b,h,c,d);e.push({index:g,value:[k,h]})}return e};
A81.prototype.broadcastPointsetsUpdates=function(a,b,c,d,e,g){a=this._cacheKey(a,b);if(this._sets.hasOwnProperty(a)){b=this._sets[a].length;for(var h=0;h<b;++h){var k=this._sets[a][h],l=this._refreshPointsetData(k,c,d,e);g(k.guid,l)}}};
A81.prototype._indexOfTime=function(a,b,c,d){var e=PineJsBarBuilder.lower_bound(a,1E3*b,function(a,b){return a.value[0]>b?1:a.value[0]<b?-1:0});return 0<=e&&b<a[a.length-1].value[0]?(a[e].value[0]/1E3!==b&&0!==e&&e--,a[e].index):c.indexOfBar(b,d)};A82.ExtrapolationManager=function(){this._storages={}};A82.ExtrapolationManager.prototype._storageKey=function(a,b,c){return a+","+b+","+c};A82.ExtrapolationManager.prototype.remove=function(a,b,c){delete this._storages[this._storageKey(a,b,c)]};
A82.ExtrapolationManager.prototype.storage=function(a,b,c){c=PineJS.Symbol.parsePeriod(c);b=this._storageKey(a,b,c.pureResolution);if(this._storages[b])return this._storages[b];this._storages[b]=new A80(ChartapiMessagerInstances[a],c.pureResolution);return this._storages[b]};A80=function(a,b){this._chartApiMessager=a;this._lastRealBarIndex=this._lastRealBarTime=null;this._resolution=b;this._extrapolatedBarsCache=[];this._onReadyCallbacks=[]};
A80.prototype.ready=function(){return!!this._lastRealBarTime};A80.prototype.rebuild=function(a,b){this._lastRealBarTime=a;this._extrapolatedBarsCache=[];this.ensureExtrapolatedToBar(b,this._lastRealBarIndex)};
A80.prototype.getPointTimeUTC=function(a,b,c){a=0===this._extrapolatedBarsCache.length||a<this._extrapolatedBarsCache[0]?-1:this.indexOfBar(a,c)-this._lastRealBarIndex;this.ensureExtrapolatedToBar(c,a+b+1);return this._extrapolatedBarsCache[a+b]};A80.prototype.indexOfBar=function(a,b){this._ensureExtrapolatedToTime(b,1E3*a);var c=PineJsBarBuilder.lower_bound(this._extrapolatedBarsCache,a,function(a,b){return a>b?1:a<b?-1:0});return this._lastRealBarIndex+c+1};
A80.prototype._extrapolateData=function(a,b){if(!this.ready())throw"No real bars known, so cannot extrapolate anything";var c=b(this._lastRealBarTime);if(c&&0!==c.length){PineJsCalendar.get_timezone(a.timezone);for(var d=0;d<c.length;++d)c[d]/=1E3;c[0]==this._lastRealBarTime/1E3&&(c=c.slice(1));this._extrapolatedBarsCache=c;var e=c.slice(0);e.sort();for(d=0;d<e.length-1;++d)e[d]==e[d+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1E3*e[d]));this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+
1,c,a)}else this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,a)};A80.prototype.onTickmarksNeeded=function(a,b){if(this.ready())this.ensureExtrapolatedToBar(a,b);else{var c=this;this._onReadyCallbacks.push(function(){c.ensureExtrapolatedToBar(a,b)})}};
A80.prototype.ensureExtrapolatedToBar=function(a,b){var c=this;return this._extrapolateData(a,function(d){return c._extrapolatedBarsCache.length>=b||!c._shouldExtrapolateMore()?null:PineJsBarBuilder.extrapolateBarsFrontByCount(c.newBarBuilder(a),d,b)})};
A80.prototype._ensureExtrapolatedToTime=function(a,b){var c=this;return this._extrapolateData(a,function(d){if(d>=b||!c._shouldExtrapolateMore())return null;d=PineJsBarBuilder.extrapolateBarsFrontToTime(c.newBarBuilder(a),d,b);d[d.length-1]<b&&console.warn("Extrapolation error: not enough data created");return d})};A80.prototype.newBarBuilder=function(a){a=PineJS.Symbol.newSession(a.timezone,a.session);return PineJS.Symbol.newBarBuilder(this._resolution,a)};
A80.prototype._shouldExtrapolateMore=function(){return 100>this._extrapolatedBarsCache.length};
A80.prototype.setLastBarTime=function(a,b){this._lastRealBarIndex===a&&this._lastRealBarTime!==b&&(this._extrapolatedBarsCache=[]);this._extrapolatedBarsCache&&this._lastRealBarIndex!==a&&(this._lastRealBarIndex>a?this._extrapolatedBarsCache=[]:this._extrapolatedBarsCache.shift(a-this._lastRealBarIndex));this._lastRealBarIndex=a;this._lastRealBarTime=b;for(var c=0;c<this._onReadyCallbacks.length;++c)this._onReadyCallbacks[c]();this._onReadyCallbacks=[]};A79=function(a){function b(a,b){var c=d._cacheSymbols[a.ticker];void 0===c&&(c=d._cacheSymbols[a.ticker]={});var k=c[b];void 0===k&&(k=c[b]=[]);return k}function c(a,c,h){if(0===h.length)return!0;a=b(a,c);if(a.length===h.length&&a[0].time===h[0].time&&a[a.length-1].time===h[h.length-1].time)return d._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!=a.length&&h[h.length-1].time>=a[0].time&&(c=a[a.length-1].time===h[h.length-1].time,a.splice(0,
a.length),!c))return!1;Array.prototype.unshift.apply(a,h);if(W77.enabled("charting_library_debug_mode"))for(h=1;h<a.length;h++)a[h].time<=a[h-1].time&&console.error("Corrupted bars, time {0} at {1} > {2} at {3}".format(a[h].time,h,a[h-1].time,h-1));return!0}var d=this;this._studiesCache={};this._metainfoCache=[];this._symbolInfoCache={};this._extrapolationManager=new A82.ExtrapolationManager;this._externalDatafeed=a;this._datafeedConfiguration=null;this._callbacks={};this._externalDatafeed.onReady(function(a){d._logMessage("Datafeed settings received: {0}".format(JSON.stringify(a)));
d._datafeedConfiguration=d._adoptConfigurationData(a);d._fireEvent("configuration_received")});this._pointsetsManager=new A81;this._rangeExtensionData={summary:0};this._quotesInfo=[];this._endOfData={};this._cacheSymbols={};this._recursionGuardCounter=0;this._extendedRange=function(){return d._rangeExtensionData.summary};PineJSFeed.setupFeed({resolve:function(a,b,c){d.resolveSymbol(a,b,c)},subscribe:function(a,g,h,k,l){var m=a.ticker,n=m+","+g;d._logMessage("History request for {0} {1}: from `{2}` to {3}".format(m,
g,new Date(h.from),new Date(h.to)));var q=parseInt(h.from/1E3),r=parseInt(h.to/1E3);W77.enabled("log_data_request_time")&&(h=new Date,console.log(h.toLocaleTimeString()+":"+h.getMilliseconds()+"> Requesting data"));var u=function(h,l,u){var D=b(a,g),C=l&&l.version&&1<l.version;if(!u&&C){u=D.length;if(0<h.length){if(d._logMessage("Receiving bars: `{0}` total {1} bars in [{2} ... {3}] ".format(m,h.length,new Date(h[0].time),new Date(h[h.length-1].time))),!c(a,g,h)){d._logMessage("Incremental update failed. Starting full update.");
w(q,r);return}}else d._logMessage("Receiving bars: barset is empty");if(D.length===u&&(u=r-q,u=86400<u?u:86400,!l.noData||l.nextTime)){l.nextTime&&d._logMessage("Next time received: `{0}`".format(new Date(1E3*l.nextTime)));r=l.nextTime||q;q=r-u;w(q,r);return}}h=C?D:h;var z=new PineJS.BarSet(a,h,!0);0<h.length?d._logMessage("Bars to return: `{0}` total {1} bars in [{2} ... {3}] ".format(m,h.length,new Date(h[0].time),new Date(h[h.length-1].time))):d._logMessage("Nothing to return");d._recursionGuardCounter=
0;k(z);a.expired||d._externalDatafeed.subscribeBars(a,g,function(c){if(C){var d=b(a,g),h=d.length,l=c.time,m=0===h?NaN:d[h-1].time;0===h||m<l?d.push(c):m===l?d[h-1]=c:console.error("putToCacheNewBar: time violation, prev: "+(new Date(m)).toUTCString()+", cur: "+(new Date(l)).toUTCString())}z.add(c);k(z)},n)},w=function(c,h){if(4<d._recursionGuardCounter++)d._logMessage("Stop requesting data. 4 attempts to reach the data failed."),u([],{version:2},!0);else{var k=b(a,g);if(0<k.length){k=k[0].time/1E3;
if(c>=k)return d._logMessage("Requested bars which already sent"),u([],{version:2},!1),n;h=k-1}d._logMessage("Requesting data: `{0}` in [{1} ... {2}] ".format(m,new Date(1E3*c),new Date(1E3*h)));d._externalDatafeed.getBars(a,g,c,h,function(a,b){u(a,b)},l)}};w(q,r);return n},unsubscribe:function(a){d._externalDatafeed.unsubscribeBars(a)},calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth,getRangeExtension:this._extendedRange},!W77.enabled("disable_resolution_rebuild"))};
A79.prototype.purgeCache=function(){this._endOfData={};this._symbolInfoCache={}};A79.prototype.purgeDataCache=function(){this._cacheSymbols={}};A79.prototype._logMessage=function(a){W77.enabled("charting_library_debug_mode")&&console.log(a)};A79.prototype._extendRange=function(a){this._rangeExtensionData.summary+=a};
A79.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};A79.prototype._fireEvent=function(a,b){if(this._callbacks.hasOwnProperty(a)){for(var c=this._callbacks[a],d=0;d<c.length;++d)c[d](b);this._callbacks[a]=[]}};
A79.prototype._adoptConfigurationData=function(a){a=TradingView.merge({},a);var b=a.supported_resolutions;if(!b||0===b.length)return a.supported_resolutions=void 0,a;for(var c={},d=0;d<b.length;d++){var e=b[d];if(c.hasOwnProperty(e))throw"Duplicating resolution `"+e+"`";c[e]=1}a.supported_resolutions=c;return a};A79.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions};
A79.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]};A79.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]};A79.prototype._createStudyLogicObject=function(a){var b=a.split("@")[0],c=A82.studyLibrary.filter(function(c){return c.metainfo.id==a||c.metainfo.shortDescription==b});if(0===c.length)throw"Study `"+a+"` not found";return new c[0].constructor};
A79.prototype.getMarks=function(a,b,c,d,e){function g(a){function b(c,d){return isArray(a[c])?a[c][d]:a[c]}if(isArray(a))return a;for(var c=[],d=0;d<a.id.length;++d)c.push({id:b("id",d),time:b("time",d),color:b("color",d),text:b("text",d),label:b("label",d),labelFontColor:b("labelFontColor",d),minSize:b("minSize",d)});return c}var h={red:6,green:5,blue:4,yellow:3};if(this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks){this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(a.full_name,
e,new Date(1E3*b),new Date(1E3*c)));var k=this;this._externalDatafeed.getMarks(a,b,c,function(b){b=g(b).map(function(a){a.time=parseInt(a.time);return a});k._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(a.full_name,e,JSON.stringify(b)));b=b.map(function(a){a.tickmark=a.time;a.direction=h[a.color];a.onClicked=function(){D17.emit("onMarkClick",a.id)};a.label=!!a.label&&a.label[0];return a});d(b)},e)}};
A79.prototype._computeStudy=function(a,b,c,d,e,g,h,k){var l=!0,m=[],n={},q=0,r=this;this.resolveSymbol(b,function(u){if(PineJS.Symbol.parsePeriod(c).isIntraday&&!u.has_intraday)k("Unsupported resolution");else{var w=new PineJS.StudyEngine({tickerid:b,symbolInfo:u,period:c,body:a,onErrorCallback:k,input:function(a){return e[a]},out:function(a,b){for(var c=a.time,d="number"===typeof g?[b]:b,e=0;e<d.length;++e){var g=d[e];g&&"object"==typeof g&&(n["plot_"+e]=g.offset,g=g.value,q++);
"number"===typeof g&&isNaN(g)&&(g=void 0);d[e]=g}e=m.length-1;(g=0>e||c>m[e].value[0])?m.push({index:m.length,value:[c].concat(d)}):m[e].value=[c].concat(d);l||h([m[m.length-1]],g,m.length,n,u)},recalc:function(){l=!1;g(m,0<q?n:void 0,u)}});if(!r._studiesCache[d])throw"This should never happen";r._studiesCache[d].engine=w}},function(a){k(a)})};
A79.prototype._createStudy=function(a,b,c,d,e,g,h){var k=this;ChartapiMessagerInstances[d].onStudyLoading(e,g);k._computeStudy(c,a,b,e,h,function(c,h,n){ChartapiMessagerInstances[d].onDataUpdate(e,g,k._convertBarsTimeToUnix(c),h,n,k._extendedRange(a,b));ChartapiMessagerInstances[d].onStudyCompleted(e,g)},function(c,h,n,q,r){ChartapiMessagerInstances[d].onDataUpdate(e,g,k._convertBarsTimeToUnix(c),q,r,k._extendedRange(a,b))},function(a){ChartapiMessagerInstances[d].onStudyError(e,
a)})};A79.prototype.purgeEndOfDataFlags=function(a){for(var b in this._studiesCache)a&&a!=b||(this._studiesCache[b].firstBarTime=null)};
A79.prototype.recreateSources=function(a,b,c,d){for(var e in this._studiesCache){var g=this._studiesCache[e];g&&g.engine&&g.engine.stop()}PineJSFeed.unsubscribeUnused();for(e in this._studiesCache)if(g=this._studiesCache[e])g.symbol=a,g.resolution=b,"series"==g.type&&this.createSeries(a,b,c,e,g.turnaround,d);for(e in this._studiesCache)(g=this._studiesCache[e])&&"study"==g.type&&this._createStudy(a,b,g.studyObject,c,e,g.turnaround,g.inputs)};
A79.prototype.removeStudy=function(a){this._studiesCache[a]&&this._studiesCache[a].engine&&(this._studiesCache[a].engine.stop(),PineJSFeed.unsubscribeUnused());this._studiesCache[a]=null};A79.prototype.removeSeries=function(a){this.removeStudy(a)};
A79.prototype.recomputeStudy=function(a,b,c,d){var e=this._studiesCache[a];if(!e)throw"This should never happen";e.inputs=b;e.turnaround=d;e.engine&&e.engine.stop();this._createStudy(e.symbol,e.resolution,e.studyObject,c,a,d,b)};A79.prototype._convertBarsTimeToUnix=function(a){for(var b=[],c=0;c<a.length;++c){var d={index:a[c].index,value:[].concat(a[c].value)};d.value[0]/=1E3;b.push(d)}return b};
A79.prototype.createStudy=function(a,b,c,d,e,g,h){g=this._createStudyLogicObject(g);this._studiesCache[d]={studyObject:g,symbol:a,resolution:b,guid:d,type:"study",inputs:h,turnaround:e};this._createStudy(a,b,g,c,d,e,h)};A79.prototype.purgeRangeExtensionData=function(){this._rangeExtensionData={summary:0}};
A79.prototype.extendSeriesRange=function(a,b,c){var d=this._studiesCache[a];if(!d)throw"This should never happen";if(this._isEndOfData(b,a,d.turnaround)){var e=d.engine.runner.host.symbolInfo.data_status;setTimeout(function(){ChartapiMessagerInstances[b].onSeriesCompleted(a,d.turnaround,e)},0)}else{this._extendRange(c+10);var g=this;setTimeout(function(){g.recreateSources(d.symbol,d.resolution,b,!0)},0)}};
A79.prototype.updateSeriesTurnaround=function(a,b){this._studiesCache[a]||(this._studiesCache[a]={});this._studiesCache[a].turnaround=b};
A79.prototype.createSeries=function(a,b,c,d,e,g){function h(a,d,e){n._extrapolationManager.storage(c,a.full_name,b).setLastBarTime(d,e)}var k=new PineJS.OHLCV,l=this._studiesCache[d],m=l&&l.firstBarTime;this._studiesCache[d]={symbol:a,resolution:b,studyObject:k,guid:d,type:"series",turnaround:e};ChartapiMessagerInstances[c].onSeriesLoading(d,e);var n=this;this._computeStudy(k,a,b,d,[],function(a,k,l){MarketStatusWatcher.onMainSeriesSymbolChanged(l.session,l.timezone,l.expired);
k=n._studiesCache[d];if(!k)throw"This should never happen";var w=n._convertBarsTimeToUnix(a),A=0<w.length?1E3*w[0].value[0]:void 0;if(0===w.length||m===A){n._logMessage("Series has no more data on server: {0}".format(l.full_name));n._setEndOfData(c,d,e);if(0===w.length)ChartapiMessagerInstances[c].onSeriesClearData(d,e);ChartapiMessagerInstances[c].onSeriesCompleted(d,e,l.data_status)}else{k.firstBarTime=A;h(l,w.length-1,1E3*w[w.length-1].value[0]);if(g)ChartapiMessagerInstances[c].onSeriesClearData(d,
e);ChartapiMessagerInstances[c].onTimescaleUpdate(d,e,w,l,0);ChartapiMessagerInstances[c].onSeriesCompleted(d,e,l.data_status);k=n._extrapolationManager.storage(c,l.full_name,b);n._pointsetsManager.broadcastPointsetsUpdates(l.full_name,b,a,k,l,function(a,b){ChartapiMessagerInstances[c].onPointsetDataUpdate(a,e,b,l)})}},function(a,b,g,k,l){var m=n._convertBarsTimeToUnix(a);k=m[m.length-1];if(b){if(!n._studiesCache[d])throw"This should never happen";b=g-1;n._logMessage("New bar arrived: symbol {0}, bar {1}".format(l.full_name,
JSON.stringify(k)));ChartapiMessagerInstances[c].onTimescaleUpdate(d,e,[k],l,b);h(l,b,1E3*k.value[0])}else n._logMessage("Last bar update: symbol {0}, bar {1}".format(l.full_name,JSON.stringify(k))),ChartapiMessagerInstances[c].onDataUpdate(d,e,m,void 0,l);n._fireEvent("realtime_tick",a[a.length-1])},function(a){n._logMessage("Series error: {0}".format(a));ChartapiMessagerInstances[c].onSeriesError(d,a)})};
A79.prototype.onMoreTickmarksRequested=function(a,b,c,d,e){this._extrapolationManager.storage(a,c.full_name,d).onTickmarksNeeded(c,e)};A79.prototype.removePointset=function(a){this._pointsetsManager.removePointset(a)};A79.prototype.rebuildExtrapolatedData=function(a,b,c,d,e){this._extrapolationManager.storage(a,d.full_name,c).rebuild(e,d)};
A79.prototype.createPointset=function(a,b,c,d,e,g){var h=this._extrapolationManager.storage(a,d.full_name,e);g=g.slice(0);for(var k=0;k<g.length;++k)g[k][0]=ChartapiMessagerInstances[a].timeInGMT(g[k][0],PineJsCalendar.get_timezone(d.timezone));this._pointsetsManager.createPointset(b,c,e,g,h,d)};A79.prototype.studiesMetadata=function(){0===this._metainfoCache.length&&(this._metainfoCache=A82.studyLibrary.map(function(a){return a.metainfo}));return this._metainfoCache};
A79.prototype.searchSymbolsByName=function(a,b,c,d){this._logMessage("Symbol search requested: user input `{0}`, exchange: `{1}`, type `{2}`".format(a,b,c));var e=this;this._externalDatafeed.searchSymbolsByName(a,b,c,function(a){e._logMessage("Symbol search response: {0}".format(JSON.stringify(a)));d(a)})};
A79.prototype.resolveSymbol=function(a,b,c){function d(a){g._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,a));c(a)}var e=PineJSFeed.parseSymbol(a).symbol,g=this;this._symbolInfoCache.hasOwnProperty(e)?b(this._symbolInfoCache[e]):(this._logMessage("Symbol resolve requested: `{0}` ".format(e)),this._externalDatafeed.resolveSymbol(e,function(a){g._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(a)));a.base_name||(a.base_name=
[a.name]);a.legs||(a.legs=[a.name]);a.exchange||(a.exchange=a["exchange-listed"]);a.full_name||(a.full_name=a.symbol||a.exchange+":"+a.name);a.data_status||(a.data_status="streaming");a.ticker||(a.ticker=a.symbol);!a.session&&a["session-regular"]&&(a.session=a["session-regular"]);!a.minmov&&a.minmovement&&(a.minmov=a.minmovement);g._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(a)));g._symbolInfoCache[e]=g._symbolInfoCache[a.symbol]=a;b(a)},d))};
A79.prototype._stopQuotesSubscription=function(a){this._quotesInfo[a].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[a].listenerGUID),this._quotesInfo[a].listenerGUID=void 0)};
A79.prototype._startQuotesSubscription=function(a){function b(b){b.forEach(function(b){b.symbolname=b.n;b.status=b.s;b.values=b.v;b.values.change=b.v.ch;b.values.last_price=b.v.lp;b.values.change_percent=b.v.chp;ChartapiMessagerInstances[a].onQuotesData([a].concat([b]))})}if(0!==this._quotesInfo[a].symbols.length){var c=this;this._externalDatafeed.getQuotes(this._quotesInfo[a].symbols,function(d){b(d);c._quotesInfo[a].listenerGUID=a;c._externalDatafeed.subscribeQuotes(c._quotesInfo[a].symbols,
c._quotesInfo[a].fastSymbols,b,c._quotesInfo[a].listenerGUID)})}};A79.prototype._restartQuotesSubscription=function(a){this._stopQuotesSubscription(a);this._startQuotesSubscription(a)};A79.prototype.quoteCreateSession=function(a){this._quotesInfo[a]={symbols:[],fastSymbols:[],listenerGUID:void 0}};A79.prototype.quoteDeleteSession=function(a){this._stopQuotesSubscription(a);this._quotesInfo[a]=null};
A79.prototype.quoteSetFields=function(a,b){};A79.prototype.quoteAddSymbols=function(a,b){this._quotesInfo[a].symbols=this._filteredSymbols(this._quotesInfo[a].symbols.concat(b));this._restartQuotesSubscription(a)};A79.prototype.quoteRemoveSymbols=function(a,b){this._quotesInfo[a].symbols=this._quotesInfo[a].symbols.filter(function(a){return 0>b.indexOf(a)});this._restartQuotesSubscription(a)};
A79.prototype.quoteFastSymbols=function(a,b){this._quotesInfo[a].fastSymbols=this._filteredSymbols(b);this._restartQuotesSubscription(a)};A79.prototype._filteredSymbols=function(a){var b=[];a.forEach(function(a){a instanceof Object||0>b.indexOf(a)&&b.push(a)});return b};A79.prototype._isEndOfData=function(a,b,c){return!!this._endOfData[a+"!"+b+"@"+c]};
A79.prototype._setEndOfData=function(a,b,c){this._endOfData[a+"!"+b+"@"+c]=!0};MetainfoTuner=function(){function a(a){W77.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+a)}var b={"volume.transparency":"!transparency"},c={};Object.keys(TradingView.StudyConsts).forEach(function(a){0==a.indexOf("PLOT_")&&0!=a.indexOf("PLOT_TYPE_")&&(c[a.toLowerCase().substring(5)]=TradingView.StudyConsts[a])});var d={setMetainfoProperty:function(d,e,k){e=b[e]||e;e=e.split(".");if(0==e[0].indexOf("!"))d[e[0].slice(1)]=k;else{var l;a:{var m=e[0];for(l in d.styles)if(d.styles[l].title.toLowerCase()==
m.toLowerCase())break a;l=null}a:{for(var m=e[0],n=0;n<d.inputs.length;++n)if(d.inputs[n].name.toLowerCase()==m.toLowerCase()){m={id:d.inputs[n].id,index:n};break a}m=null}n="options"==e[0];if(l||m||n)if(l&&m||l&&n||m&&n)a("Study `{0}` ambiguous identifier `{1}`".format(d.description,e[0]));else if(l)if(m=e[1],"color"==m){var q;b:{for(q in d.plots)if("colorer"==d.plots[q].type&&d.plots[q].target==l){q=d.defaults.palettes[d.plots[q].palette];break b}q=null}m=2<e.length?parseInt(e[2]):NaN;null==q&&
!isNaN(m)&&0<m?a("Plot `{1}` of `{0}` does not have color #{2}".format(d.description,e[0],m)):0==m||isNaN(m)?(d.defaults.styles[l].color=k,null!=q&&(q.colors[0].color=k)):q.colors[m].color=k}else d.defaults.styles[l].hasOwnProperty(m)?("plottype"==m&&(k=c[k]),d.defaults.styles[l][m]=k):a("Plot `{1}` of `{0}` does not have property `{2}`".format(d.description,e[0],m));else m?(e=m.index,d.defaults.inputs[m.id]=k,d.inputs[e].defval=k):d[e[1]]=k;else a("Study `{0}` has no plot or input `{1}`".format(d.description,
e[0]))}},setProperty:function(b,c){var e=b.split(".")[0],l;a:{l=A82.studyLibrary;for(var m=0;m<l.length;++m){var n=l[m].metainfo;if(n.description.toLowerCase()==e.toLowerCase()||n.shortDescription.toLowerCase()==e.toLowerCase()){l=n;break a}}l=null}l?d.setMetainfoProperty(l,b.substring(e.length+1),c):a("Study `{0}` not found".format(e))}};if("undefined"!=typeof __initialMetainfoOverrides&&__initialMetainfoOverrides)for(var e in __initialMetainfoOverrides)d.setProperty(e,__initialMetainfoOverrides[e]);
return d}();var MarketStatusWatcher=function(){function a(){if(c)if(d)D3.D0.mainSeries().marketStatus.setValue("out_of_session");else{var a=PineJsBarBuilder.isTradingNow(new Date,c)?"market":"out_of_session";D3.D0.mainSeries().marketStatus.setValue(a)}}var b={},c,d;b.onMainSeriesSymbolChanged=function(b,g,h){g=PineJsCalendar.get_timezone(g);c=(new PineJsBarBuilder.Session).init(g,b);d=h;a()};setInterval(a,6E4);return b}();function PublishedChartsTimeline(){}$89=function(){};TradingView.study_PivotPointsStandard=function(){};TradingView.study_PivotPointsHighLow=function(){};TradingView.study_ZigZag=function(){};TradingView.study_LinearRegression=function(){};TradingView.study_ElliottWave=function(){};TradingView.ESDStudyBase=function(){};A55=function(){this.hasPackage=function(){return!1}};user={is_pro:!1,settings:{}};A55.prototype.getStudies=function(){return[]};
A55.prototype.getProduct=function(){return{}};A55.prototype.getStudiesOrder=function(){return[]};TradingView.LineToolRegressionTrend=function(){};
TradingView.templates={dialogs:{addSymbol:' <div class="main"> <div class="symbol-edit-place"></div>{{#overlayOption}} <div class="tv-dialog-relative">\t<input id="tv-dialog-addsymbol-overlay-checkbox" type="checkbox" name="addsymbol-overlay" {{#overlayOptionChecked}}checked="checked"{{/overlayOptionChecked}} />\t<span class="tv-dialog-checkbox-mask tv-dialog-checkbox-mask{{#overlayOptionChecked}}-active{{/overlayOptionChecked}}"></span>\t<label for="tv-dialog-addsymbol-overlay-checkbox"> Overlay the main chart</label> </div>{{/overlayOption}} <div class="tv-dialogs-bottom-button"> <span class="tv-button tv-right tv-uppercase ok">{{okButtonTitle}}</span> </div> </div>',symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+
TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-cion"></div></div></div><div class="filter"></div><div class="results"></div>'}};TradingView.AlertLabel=function(){};TradingView.getDataVendorString=function(){};A72={sendReport:function(){}};TradingView.study_VbPVisible=function(){};TradingView.study_VbPSessions=function(){};TradingView.LineToolVbPFixed=function(){};MockupRequestedCache=function(a){a&&a([])};MockupRequestedCache.D20=function(){};
TradingView.getThemesList=MockupRequestedCache;
</script><script>urlParams=(function(){var b,e=/\+/g,d=/([^&=]+)=?([^&]*)/g,h=function(i){return decodeURIComponent(i.replace(e," "))},f=window.location.hash.substring(1),a={};while(b=d.exec(f)){a[h(b[1])]=h(b[2])}var c=window.parent[a.uid];for(var g in c){if(g!="datafeed"){a[g]=JSON.stringify(c[g])}}return a})();var customIndicatorsPresent=!!urlParams.indicatorsFile;var customIndicatorsLodaded=$.Deferred();var chartApiInitializationTimePassed=$.Deferred();$.when(customIndicatorsLodaded,chartApiInitializationTimePassed).done(function(){D16.start()});if(customIndicatorsPresent){$.getScript(urlParams.indicatorsFile).done(function(){if(typeof __customIndicators!="undefined"&&isArray(__customIndicators)){A82.studyLibrary=A82.studyLibrary.concat(__customIndicators);console.log("{0} custom indicators loaded.".format(__customIndicators.length));customIndicatorsLodaded.resolve()}}).fail(function(a){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile,a.statusText,a.status));customIndicatorsLodaded.resolve()})}else{customIndicatorsLodaded.resolve()}pm=TradingView.postMessageWrapper(window.parent);pm.__delayedMesssages=[];pm.on("widgetReady",function(b,a){pm.__delayedMesssages.push({data:b,cb:a});pm.setClientId(b.client_id)});function postMessageToParent(a,b){if(window&&window.parent){pm.post(window.parent,a,b)}}function customizeUI(a){if(a.studiesOverrides){var c=a.studiesOverrides;for(var b in c){MetainfoTuner.setProperty(b,c[b])}}__defaultsOverrides=a.defaultsOverrides}function createChart(){if(!Modernizr.canvas||!Modernizr.canvastext){throw"Charting library cannot be running under this browser"}W77.setEnabled("charting_library_debug_mode",urlParams.debug=="true");is_authenticated=false;headerChartPanel=$(".header-chart-panel");widgetContainer=$("#library-container");tvHeader=$(".tv-header");footer=$("#footer-chart-panel");if(W77.enabled("remove_library_container_border")){widgetContainer.css("border","0px");widgetContainer.css("padding","1px")}customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):undefined,defaultsOverrides:JSON.parse(urlParams.overrides)});if(W77.enabled("saveload_storage_customization")){if(typeof urlParams.chartsStorageUrl=="undefined"||!urlParams.chartsStorageUrl||typeof urlParams.clientId=="undefined"||!urlParams.clientId){W77.setEnabled("saveload_storage_customization",false);W77.setEnabled("header_saveload",false)}else{ChartingLibraryBackend.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl)}}D16=new A82.ChartApi(window.parent[urlParams.uid].datafeed);D16.setTimeFramesList(JSON.parse(urlParams.timeFrames));D16.setStudiesAccessController(D16.createStudiesAccessController(urlParams.studiesAccess,urlParams.enabledStudies,urlParams.disabledStudies));if(W77.enabled("narrow_chart_enabled")){$(".chart-page").css("min-width","240px")}if(W77.enabled("use_localstorage_for_settings")){TVSettings.sync()}var i=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:undefined;var d=urlParams.interval||"D";var g={jqParent:$("#chart-area"),onResize:function(n){var m=$(document.body).height()-2;widgetContainer.height(m);var k=W77.enabled("header_widget")&&headerChartPanel.css("display")!="none"?headerChartPanel.outerHeight():0;var l=m-k-tvHeader.outerHeight()-(footer.length?footer.outerHeight():0);l=Math.max(50,l);n.height(l)},padding:W77.enabled("border_around_the_chart")?5:0,edge:W77.enabled("border_around_the_chart")?5:0,content:i,widgetOptions:{hideIdeas:true,addVolume:true,handleSessionErrors:true,muteSessionErrors:true,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:d,hideSymbolSearch:JSON.parse(urlParams.hideSymbolSearch)}};if(i&&typeof i.extendedData!="undefined"){var e=i.extendedData;g.metaInfo={id:e.uid,name:e.name,description:e.description,uid:e.uid,username:"",tags:"",}}D6=new A8(g);ChartSaverInstance=saver=new ChartSaver(D6);D3=D6.activeChartWidget.value();pro=new A55();var f=JSON.parse(urlParams.favorites);f.intervals=f.intervals.map(function(k){var l=(""+k);if(l.match(/1[DWMYdwmy]/)){l=l.slice(1)}return l});studyTemplates=new A65({D6:D6,notShowQuicks:!W77.enabled("favorites"),});headerWidget=new A5({D6:D6,headerChartPanel:headerChartPanel,hideStudyTemplates:true,favoriteIntervals:f.intervals,interval_options:{interval:d},favoriteChartTypes:f.chartTypes,snapshotUrl:urlParams.snapshotUrl});A45.bindToChartWidgetCollection(D6);var h=function(){};var c=JSON.parse(urlParams.logo);if(c.image){h=function(o,n,k){$(".onchart-custom-logo").remove();var p=$('<img src="'+c.image+'">');var q=!c.link?p:$('<a href="'+c.link+'" target="_blank"/>').append(p);var u=$('<span class="text">Powered&nbsp;by&nbsp;<span><a href="https://www.tradingview.com/" target="_blank"><span class="text logo-highlighted">TradingView</span></a>');var m=$('<div class="onchart-custom-logo"/>').appendTo(n||D3._jqMainDiv);var s=$('<div class="wrapper"/>').appendTo(m);var t=$('<table class="inner">').appendTo(s);var r=$("<tr>").appendTo(t);$('<td class="custom-logo">').append(q).appendTo(r);var l=$("<tr>").appendTo(t);if(W77.enabled("link_to_tradingview")){$('<td class="tv-link">').append(u).appendTo(l)}if(k){m.addClass("on-pane")}}}else{h=function(k,l,n){if(!W77.enabled("link_to_tradingview")){return}$(".onchart-tv-logo").remove();var m=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text">charts&nbsp;by&nbsp;<span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(l||D3._jqMainDiv);if(W77.enabled("minimalistic_logo")){m.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")})}else{m.addClass("expanded")}if(n){m.addClass("on-pane")}}}var b=W77.enabled("widget_logo")&&urlParams.disableLogo!="true";if(b){D3.createLogo=h;if(!W77.enabled("move_logo_to_main_pane")){D3.withModel(null,h)}}TradingView.tokenInitialized.resolve();if(urlParams.toolbarbg){var a="#"+urlParams.toolbarbg;$(".tv-side-toolbar").css("background-color",a);$(".chart-controls-bar").css("background-color",a);$("#chart-area").css("background-color",a);headerChartPanel.css("background-color",a);$("#footer-chart-panel").css("background-color",a)}var j=new A6({container:$(".tv-side-toolbar"),D6:D6,onWidget:true,enabledDrawings:urlParams.enabledDrawings?JSON.parse(urlParams.enabledDrawings):[],disabledDrawings:urlParams.disabledDrawings?JSON.parse(urlParams.disabledDrawings):[],drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):undefined});window.sideToolbar=j;if(urlParams.hideSideToolbar=="true"||!W77.enabled("left_toolbar")){j._fold(true)}window.lineToolPropertiesToolbar=new TradingView.LineToolPropertiesWidget(D6);D3.onDisconnected().subscribe(null,function(k){if(k){showCriticalErrorMessage();return}});$(".tv-content").bind("contextmenu",function(l){var k=$(l.originalEvent.target);if(!k.is("input")&&!k.is("textarea")){return false}});chartApiInitializationTimePassed.resolve();(function(){pm.on("symbolInfo",function(p,q){var n=D3.model().mainSeries().symbolInfo(),o=D3.model().mainSeries().properties().interval.value(),m={name:n.name,exchange:n.exchange,description:n.description,type:n.type,interval:o};q(m)});pm.on("resize",function(){$(window).resize()});pm.on("initializationFinished",function(){A77.clearStack()});function k(n,m){D3.withModel(null,function(){if(D3.model().mainSeries().bars().size()>0){m()}else{var o=function(){m();D3.model().mainSeries().onBarReceived().unsubscribe(null,o)};D3.model().mainSeries().onBarReceived().subscribe(null,o)}})}pm.on("widgetReady",function(n,m){k(n,m);pm.setClientId(n.client_id)});for(var l=0;l<pm.__delayedMesssages.length;++l){k(pm.__delayedMesssages[l].data,pm.__delayedMesssages[l].cb)}pm.on("executeAction",function(m){D3.executeActionByName(m.action)});pm.on("removeAllStudies",function(){D3.removeAllStudies()});pm.on("refreshMarks",function(){D3.refreshMarks()});pm.on("clearMarks",function(){D3.clearMarks()});pm.on("removeAllShapes",function(){D3.removeAllDrawingTools()});pm.on("saveChart",function(){var m=ChartSaverInstance.saveToJSON();postMessageToParent("onChartSaved",JSON.parse(m.content))});pm.on("changeSymbol",function(n){A45.interval.setValue(n.interval);A45.symbol.setValue(n.symbol);function m(){D3.model().mainSeries().onDataLoaded().unsubscribe(null,m);pm.post(window.parent,"symbolChangeFinished",{})}D3.model().mainSeries().onDataLoaded().subscribe(null,m)});pm.on("symbolIntervalRequest",function(){pm.post(window.parent,"symbolInterval",JSON.stringify({symbol:A45.symbol.value(),interval:A45.interval.value()}))});pm.on("removeEntity",function(m){var n=D3.model().chartModel().dataSourceForId(m);if(!n){console.warn("Can't find a source with id: "+m);return}D3.model().chartModel().removeSource(n,true)})})();D3.withModel(null,function(){D3.model().mainSeries().onSymbolResolved().subscribe(null,function(){var l=D3.model().mainSeries().symbolInfo(),m=D3.model().mainSeries().properties().interval.value(),k={name:l.name,exchange:l.exchange,description:l.description,type:l.type,interval:m};postMessageToParent("onSymbolChange",k)});A45.interval.subscribe(function(k){postMessageToParent("onIntervalChange",k)});D16.on("realtime_tick",function(k){postMessageToParent("onTick",k)});D16.on("onAutoSaveNeeded",function(){postMessageToParent("onAutoSaveNeeded")});D17.subscribe("onMarkClick",function(k){postMessageToParent("onMarkClick",k)})});headerWidget.onScreenshotReady(function(k){postMessageToParent("onScreenshotReady",k)})}var localizationReady=$.Deferred();var datafeedReady=$.Deferred();$.when(localizationReady,datafeedReady).done(function(){JSON.parse(urlParams.disabledFeatures).map(function(b){W77.setEnabled(b,false)});JSON.parse(urlParams.enabledFeatures).map(function(b){W77.setEnabled(b,true)});setTimeout(createChart,0);if(W77.enabled("14851")){(function(d,e,j,h,f,c,b){d.GoogleAnalyticsObject=f;d[f]=d[f]||function(){(d[f].q=d[f].q||[]).push(arguments)},d[f].l=1*new Date();c=e.createElement(j),b=e.getElementsByTagName(j)[0];c.async=1;c.src=h;b.parentNode.insertBefore(c,b)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");var a=document.URL.match(new RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-53174009-1","auto");ga("set",{hostname:a,page:a,referrer:a});ga("send","pageview")}});window.parent[urlParams.uid].datafeed.onReady(function(){datafeedReady.resolve()});$(function onDocumentReady(){var b={lng:urlParams.locale,load:"unspecific",resGetPath:"localization/translations/__lng__.json",keyseparator:"@",nsseparator:"@",fallbackLng:"en"};$.i18n.init(b,function a(c){$("html").i18n();localizationReady.resolve();$(window).resize();$(".loading-indicator").hide()})});function setChartType(a){D3.model().mainSeries().properties().style.setValue(a)}function loadChart(a){D3.loadContent(a.json.charts[0],a.extendedData);D17.emit("chart_loaded")}function createStudy(a){a.name=a.name.toLowerCase();var c=StudyMetaInfo.findStudyMetaInfoByDescription(D3.model().studiesMetaData(),a.name);c=$.extend({},c);delete c.state;if(!c){console.warn("Study `"+a.name+"` not found.")}var b={};if(a.overrides){var f=a.overrides;for(var e in f){MetainfoTuner.setMetainfoProperty(c,e,f[e])}b.styles=c.defaults.styles}if(a.inputs){b.inputs=StudyInputsHelper.getStudyRecordFromArray([a.name].concat(a.inputs),D3).inputs}var d=D3.model().chartModel().insertStudy(c,b,a.forceOverlay);if(!!a.lock&&a.lock){d.setUserEditEnabled(false)}if(a.callback){a.callback(d.id())}}function createShape(b){var c=D3.model().timeScale().timePointToIndex(b.point.time);var j={index:c};if(!!b.point.price){j.price=b.point.price}else{var f=["open","high","low","close"];var d=!!b.point.channel?f.indexOf(b.point.channel)+1:1;if(d<=0){d=1}j.price=D3.model().mainSeries().data().valueAt(c)[d]}var a=D3._paneWidgets[0]._state;var e={arrow_up:{name:"LineToolArrowMarkUp",supportsText:true},arrow_down:{name:"LineToolArrowMarkDown",supportsText:true},flag:{name:"LineToolFlagMark",supportsText:false},vertical_line:{name:"LineToolVertLine",supportsText:false},horizontal_line:{name:"LineToolHorzLine",supportsText:false}};var i=e[b.options.shape]||e.flag;var h=new $52(i.name.toLowerCase());if(b.options.overrides){for(var k in b.options.overrides){if(h[k]){h[k].setValue(b.options.overrides[k])}}}if(i.supportsText&&!!b.options.text){h.text.setValue(b.options.text)}var g=D3.model().createLineTool(a,j,i.name,h);if(b.options.lock){g.setUserEditEnabled(false)}if(b.callback){b.callback(g.id())}}function setVisibleRange(a,b){if(typeof a==="undefined"||!a.from||!a.to||isNaN(a.from)||isNaN(a.to)){console.warn("Wrong time range: "+JSON.stringify(a));return}D3.setVisibleTimeRange(parseInt(a.from),parseInt(a.to),b)}function getVisibleRange(d){if(!d){console.warn("Callback expected as argument");return}var c=D3.model().timeScale();var a=c.visibleBars();var b={from:c.indexToUserTime(a.firstBar()<0?0:a.firstBar()),to:c.indexToUserTime(a.lastBar())};d({from:(+b.from||0)/1000,to:(+b.to||0)/1000})}function createStudyTemplate(a,b){b(D3.model().model().studyTemplate(a.saveInterval))}function applyStudyTemplate(a){D3.model().model().restoreStudyTemplate(a,""+(Math.random()*1000))};</script></body></html>