')
.addClass('tv-linetool-properties-toolbar__icon')
.addClass(e)
.append(t)[0];
}
function a(t) {
return l(t, 'tv-linetool-properties-toolbar__icon--line-props');
}
var c,
h,
d,
p,
u,
v,
g,
f,
w,
m,
z,
_,
M,
y,
T,
b = o(823),
x = b.PropertyPage,
C = b.ColorBinding,
L = o(87).BarsMarksContainer,
P = o(0).LineDataSource,
S = o(32),
k = o(964),
B = o(847).bindPopupMenu,
A = o(3).DefaultProperty,
I = o(1221).GroupButtonFloatingToolbar,
E = o(197).showEditObjectDialog,
W = o(103).LineEnd,
V = o(108).isMultipleLayout,
F = o(198);
o(876),
o(1223),
(n.prototype.activeChartWidget = function() {
return this._chartWidgetCollection.activeChartWidget.value();
}),
(n.prototype.selectedSource = function() {
return this._chartWidgetCollection.selectedSource.value();
}),
(n.prototype._init = function() {
(this._floatingToolbar = new I({
addClass: 'tv-linetool-properties-toolbar',
defaultPosition: {
top: F.HEADER_TOOLBAR_HEIGHT_EXPANDED + 15,
left: window.innerWidth / 2,
},
positionSettingsKey: 'properties_toolbar.position',
})),
this._floatingToolbar
.onWidgetStateChanged()
.subscribe(this, this._onPropertyChangedInToolbar),
(this._sourceActions = this._createSourceActions()),
this._sourceActions.forEach(function(t) {
this._floatingToolbar.addWidget(t.button);
}, this);
}),
(n.prototype._bindPopupMenuDirection = function() {
return this._floatingToolbar.isVertical() ? 'right' : 'down';
}),
(n.prototype._onPropertyChangedInToolbar = function(t, e) {
this._currentProperties &&
this.activeChartWidget()
.model()
.setProperty(this._currentProperties[t], e);
}),
(n.prototype._onPropertyChanged = function(t, e) {
this._floatingToolbar.setGroupedWidgetState(t, e.value());
}),
(n.prototype._hideAllSourceActions = function() {
this._sourceActions.forEach(function(t) {
this._floatingToolbar.hideWidget(t.button);
}, this),
(this._sourceActionsVisible = !1);
}),
(n.prototype._updateSourceActionsVisibility = function(t) {
(this._sourceActionsVisible = !1),
this._sourceActions.forEach(function(e) {
!e.isVisibleForSource || e.isVisibleForSource(t)
? (this._floatingToolbar.showWidget(e.button), (this._sourceActionsVisible = !0))
: this._floatingToolbar.hideWidget(e.button);
}, this);
}),
(n.prototype.attachHandlers = function() {
S.tool.subscribe(this.onToolChanged.bind(this), { callWithLast: !0 }),
this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this)),
this._chartWidgetCollection.layout.subscribe(this._updateCloneButtonTitle.bind(this));
}),
(n.prototype._updateCloneButtonTitle = function() {
this._setButtonTitle(this._cloneButton, this._cloneButtonTitle());
}),
(n.prototype.onToolChanged = function(t, e) {
if (t && -1 !== t.toLowerCase().indexOf('linetool')) {
var e = e instanceof A ? e : new A(t.toLowerCase());
this._hideAllSourceActions(),
this.showPropertiesOf(t, e),
this.showTemplatesOf({ tool: t, properties: e }),
this._updateVisibility();
} else this.selectedSource() ? this.onSourceChanged(this.selectedSource()) : this.hide();
}),
(n.prototype.findSourceOnWidget = function(t) {
var e, o, i, n;
for (
e = 0;
e <
this.activeChartWidget()
.model()
.panes().length;
e++
)
for (
o = this.activeChartWidget()
.model()
.panes()[e],
i = o.orderedSources(),
n = 0;
n < i.length;
n++
)
if (i[n] === t) return i[n];
}),
(n.prototype.onSourceChanged = function(t) {
if (
(this._hasAlertWathcedValue &&
(this._hasAlertWathcedValue.destroy(), (this._hasAlertWathcedValue = null)),
!t)
)
return void this.hide();
t instanceof P && !(t instanceof L) && this.findSourceOnWidget(t)
? (!t.userEditEnabled() ||
('LineToolBrush' !== t.toolname &&
this.activeChartWidget()
.model()
.lineBeingCreated())
? this._hideAllSourceActions()
: (this._updateSourceActionsVisibility(t),
t.canHasAlert() &&
((this._hasAlertWathcedValue = t.hasAlert.spawn()),
this._hasAlertWathcedValue.subscribe(
this._updateSourceActionsVisibility.bind(this, t),
))),
this.showPropertiesOf(t.getConstructor(), t.properties()),
this.showTemplatesOf({ source: t }),
this._setupToggleLockButton(t),
this._updateVisibility())
: this.hide();
}),
(n.prototype.showTemplatesOf = function(t) {
var i, n, s, r, l;
e.enabled('line_tool_templates') &&
((i = t.source),
i
? ((n = i.getConstructor()), (s = i.properties()))
: ((n = t.tool), (s = t.properties)),
this._$templatesButton &&
(this._floatingToolbar.removeWidget(this._$templatesButton[0]),
(this._$templatesButton = null)),
(r = this),
(l = function(t) {
if (i) {
r
.activeChartWidget()
.model()
.applyLineToolTemplate(i, t, 'Apply Drawing Template'),
r.onSourceChanged(i);
} else s.merge(t), s.listeners().fire(this), s.saveDefaults(), r.onToolChanged(n, s);
}),
(TradingView.onWidget() && !window.is_authenticated) ||
!e.enabled('linetoolpropertieswidget_template_button') ||
((this._templatesList = new k(n, l, {
buttonInner:
'
' +
o(1224) +
'
',
buttonClass: 'tv-linetool-properties-toolbar__button apply-common-tooltip',
defaultsCallback: function() {
if (void 0 !== i) {
r.activeChartWidget()
.model()
.restoreLineToolFactoryDefaults(i, 'Load default drawing template');
} else s.restoreFactoryDefaults();
r.showPropertiesOf(n, s);
},
saveAsText: $.t('Save Drawing Template As...'),
applyDefaultText: $.t('Apply Default Drawing Template'),
getDataForSaveAs: i
? function() {
return i.template();
}
: null,
popupActiveClass: 'i-dropped',
popupDirection: this._bindPopupMenuDirection.bind(this),
})),
(this._$templatesButton = this._templatesList
.createButton()
.attr('title', $.t('Templates'))),
this._floatingToolbar.addWidget(this._$templatesButton[0], { index: 0 })),
(this._templatesVisible = !0));
}),
(n.prototype.templatesList = function() {
return this._templatesList;
}),
(n.prototype._createButton = function(t) {
var e, o, i;
return (
(t = t || {}),
(e = document.createElement('div')),
this._setButtonTitle(e, t.title),
(e.className += 'tv-linetool-properties-toolbar__button apply-common-tooltip'),
e.addEventListener('click', t.callback),
t.svgIcon &&
((o = document.createElement('div')),
o.classList.add('tv-linetool-properties-toolbar__icon'),
o.appendChild(t.svgIcon),
e.appendChild(o)),
t.addCaret &&
((i = document.createElement('div')),
(i.className =
'tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret'),
e.appendChild(i)),
e
);
}),
(n.prototype._setButtonTitle = function(t, e) {
t.setAttribute('title', e);
}),
(n.prototype._createSettingsButton = function() {
var t = this;
return this._createButton({
title: $.t('Settings'),
callback: function() {
E(t.selectedSource(), t.activeChartWidget().model(), {
onWidget: t.activeChartWidget()._options.onWidget,
});
},
svgIcon: $(o(1225))[0],
});
}),
(n.prototype._createZOrderButton = function() {
var t = this._createButton({
title: $.t('Visual Order'),
callback: function() {
t.classList.contains('i-dropped') ||
$(t).trigger('button-popup', [this._getZOrderActions()]);
}.bind(this),
svgIcon: $(o(1226))[0],
addCaret: !0,
});
return (
B($(t), null, {
direction: this._bindPopupMenuDirection.bind(this),
event: 'button-popup',
reverse: !1,
notCloseOnButtons: !0,
activeClass: 'i-dropped',
}),
t
);
}),
(n.prototype._cloneButtonTitle = function() {
var t = $.t('Clone');
return (
e.enabled('datasource_copypaste') && (t += ', ' + $.t('Copy')),
V(this._chartWidgetCollection.layout.value()) && (t += ', ' + $.t('Sync')),
t
);
}),
(n.prototype._createCloneButton = function() {
var t = this._createButton({
title: this._cloneButtonTitle(),
callback: function() {
t.classList.contains('i-dropped') ||
$(t).trigger('button-popup', [this._getCloneActions()]);
}.bind(this),
svgIcon: $(o(1227))[0],
addCaret: !0,
});
return (
B($(t), null, {
direction: this._bindPopupMenuDirection.bind(this),
event: 'button-popup',
reverse: !1,
notCloseOnButtons: !0,
activeClass: 'i-dropped',
}),
t
);
}),
(n.prototype._createLockButton = function() {
var t = this._createButton({
title: $.t('Lock'),
callback: function() {
this.activeChartWidget().toggleLockSelectedObject();
}.bind(this),
svgIcon: $(o(1023))[0],
});
return (
(this._lockChangeListener = function(e) {
t.classList.toggle('i-active', !!e.value());
}),
t
);
}),
(n.prototype._createHideButton = function() {
return this._createButton({
title: $.t('Hide'),
callback: function() {
this.activeChartWidget().hideSelectedObject();
}.bind(this),
svgIcon: $(o(1228))[0],
});
}),
(n.prototype._createRemoveButton = function() {
return this._createButton({
title: $.t('Remove'),
callback: function() {
this.activeChartWidget().removeSelectedSource();
}.bind(this),
svgIcon: $(o(1229))[0],
});
}),
(n.prototype._createSourceActions = function() {
var t = [];
return (
e.enabled('property_pages') && t.push({ button: this._createSettingsButton() }),
(this._cloneButton = this._createCloneButton()),
t.push(
{ button: this._createZOrderButton() },
{
button: this._cloneButton,
isVisibleForSource: function(t) {
var e = TradingView.className(t.constructor);
return !this.activeChartWidget()
.model()
.model()
.isSingleInstanceLineTool(e);
}.bind(this),
},
{ button: this._createLockButton() },
{ button: this._createHideButton() },
{ button: this._createRemoveButton() },
),
t
);
}),
(n.prototype._getCloneActions = function() {
var t = this.activeChartWidget().model(),
o = this.selectedSource(),
i = [];
return (
o.properties().clonable.value() &&
i.push({
title: $.t('Clone'),
action: function() {
t.cloneLineTool(o);
},
}),
e.enabled('datasource_copypaste')
? (i.push({
title: $.t('Copy'),
shortcut: 'Ctrl-C',
action: function() {
t.copySourceToClip(o);
},
}),
V(this._chartWidgetCollection.layout.value())
? (o.linkKey
? i.push({
title: $.t('Stop syncing'),
action: function() {
t.unlinkLine(o);
},
})
: i.push({
title: $.t('Sync to all charts'),
action: function() {
t.copyToOtherCharts(o);
},
}),
i)
: i)
: i
);
}),
(n.prototype._getZOrderActions = function() {
var t = [],
e = this.selectedSource(),
o = this.activeChartWidget().model(),
i = {
title: $.t('Bring to Front'),
action: function() {
o.bringToFront(e);
},
},
n = {
title: $.t('Send to Back'),
action: function() {
o.sendToBack(e);
},
},
s = {
title: $.t('Bring Forward'),
action: function() {
o.changeZOrder(e, 1);
},
},
r = {
title: $.t('Send Backward'),
action: function() {
o.changeZOrder(e, -1);
},
},
l = o.paneForSource(this.selectedSource()),
a = l.getZOrderMinMax();
return (
e.zorder() === a.minZOrder && ((n.disabled = !0), (r.disabled = !0)),
e.zorder() === a.maxZOrder && ((s.disabled = !0), (i.disabled = !0)),
t.push(i, n, s, r),
t
);
}),
(n.prototype._getPossibleProperty = function(t) {
var e,
o,
i = [],
s = this._defaultToolProperties();
for (e = 0; e < s.length; e++) (o = s[e]), o.name in t && i.push(o);
return (
t.extendLeft ||
(i = i.map(function(t) {
return (
'leftEnd' === t.name &&
(t.comboboxOptions = t.comboboxOptions.filter(function(t) {
return t.value !== n.LINE_EXTEND;
})),
t
);
})),
t.extendRight ||
(i = i.map(function(t) {
return (
'rightEnd' === t.name &&
(t.comboboxOptions = t.comboboxOptions.filter(function(t) {
return t.value !== n.LINE_EXTEND;
})),
t
);
})),
i
);
}),
(n.prototype.showPropertiesOf = function(t, e) {
var o, i, n, l, a, c, h, d;
if (
(this._toolExceptionCases ||
(this._toolExceptionCases = this._createToolExceptionCases()),
(o = this._toolExceptionCases[t] || this._getPossibleProperty(e)),
this._clearProperties(),
(this._propertiesVisible = !1),
o.length)
) {
for (i = {}, n = o.length - 1; n >= 0; --n)
if (((l = o[n]), (a = e[l.name]), 'function' != typeof (c = l.showIf) || c(a, e))) {
if (!a) continue;
if (((this._propertiesVisible = !0), (h = []), 'combobox' !== l.inputType)) {
(d = this.colorPropertyControl(a, l, e)),
this._floatingToolbar.addWidget(d[0], {
index: this._$templatesButton ? 1 : 0,
}),
this._toolbarWidgets.push(d[0]);
continue;
}
l.simple
? l.comboboxOptions.forEach(s.bind(null, h))
: l.comboboxOptions.forEach(r.bind(null, h)),
l.propertyProxy && (a = l.propertyProxy(e, this.activeChartWidget().model())),
(i[l.name] = a),
a.subscribe(this, this._onPropertyChanged.bind(this, l.name, a)),
this._floatingToolbar.addGroupedWidget(
{
id: l.name,
currentStateId: a.value(),
stateWidgetAddClass: 'tv-linetool-properties-toolbar__sub-widget',
states: h,
widgetAddClass: 'tv-linetool-properties-toolbar__grouped-button',
tooltip: l.title,
},
{ index: this._$templatesButton ? 1 : 0 },
);
}
this._currentProperties = i;
}
}),
(n.prototype._updateVisibility = function() {
this._propertiesVisible || this._sourceActionsVisible || this._templatesVisible
? this._show()
: this.hide();
}),
(n.prototype._clearProperties = function() {
this._currentProperties &&
(this._clearProeprtiesOnHideTimeoutId &&
(clearTimeout(this._clearProeprtiesOnHideTimeoutId),
(this._clearProeprtiesOnHideTimeoutId = null)),
Object.keys(this._currentProperties).forEach(function(t) {
this._currentProperties[t].unsubscribeAll(this),
this._floatingToolbar.removeGroupedWidget(t);
}, this),
(this._currentProperties = null),
this._toolbarWidgets.forEach(function(t) {
this._floatingToolbar.removeWidget(t);
}, this),
(this._toolbarWidgets = []),
this.clearBindings());
}),
(n.prototype.hide = function() {
this._floatingToolbar.hide(),
(this._clearProeprtiesOnHideTimeoutId = setTimeout(
this._clearProperties.bind(this),
this._floatingToolbar.hideDuration(),
));
}),
(n.prototype._show = function() {
this._floatingToolbar.show();
}),
(n.prototype.refresh = function() {
this.onSourceChanged(this.selectedSource());
}),
(n.prototype._setupToggleLockButton = function(t) {
t !== this._selectedSourceBk &&
(this._selectedSourceBk &&
this._selectedSourceBk.properties().frozen &&
this._selectedSourceBk
.properties()
.frozen.unsubscribe(this, this._lockChangeListener),
t &&
t.properties().frozen &&
(t.properties().frozen.subscribe(this, this._lockChangeListener),
this._lockChangeListener(t.properties().frozen)),
(this._selectedSourceBk = t));
}),
(n.prototype.bindControl = function(t) {
this._bindings.push(t);
}),
(n.prototype.clearBindings = function(t) {
for (var e = this._bindings.length; e--; ) this._bindings[e].destroy();
this._bindings.length = 0;
}),
(n.prototype.colorPropertyControl = function(t, e, o) {
var i,
s,
r = x.prototype.createColorPicker({
addClass: 'tv-linetool-properties-toolbar__color-picker apply-common-tooltip',
direction: this._bindPopupMenuDirection.bind(this),
});
return (
r.attr('title', e.title),
(i = r.find('input')),
(s = $(e.iconSvgCode)),
s.on('click', function(t) {
i.data('tvcolorpicker') || i.focus();
}),
$(document).on('click', function(t) {
i.data('tvcolorpicker') ? i.addClass('i-active') : i.removeClass('i-active');
}),
i.after(s),
this.bindControl(
new C(r, t, !0, this.activeChartWidget().model(), null, n.getTransparency(e, o)),
),
'string' == typeof e.addClass && r.addClass(e.addClass),
r
);
}),
(n.getTransparency = function(t, e) {
if (t.transparency)
return t.transparencyField ? e[t.transparencyField].value() : e.transparency.value();
}),
(n.prototype.createLineEndPropertyProxy = function(t, e) {
return function(o, s) {
var r, l;
return (
(r = o[e] && o[e].value() ? n.LINE_EXTEND : o[t].value()),
(l = new i(r)),
l.subscribe(this, function(i) {
var n = i.value();
n < 2
? (s.beginUndoMacro(''),
o[t].setValue(n),
o[e] && o[e].setValue(!1),
s.endUndoMacro())
: (s.beginUndoMacro(''),
o[t].setValue(W.Normal),
o[e] && o[e].setValue(!0),
s.endUndoMacro());
}),
l
);
};
}),
(n.LINE_EXTEND = 42),
(c = a(o(1230))),
(h = a(o(1231))),
(d = a(o(1232))),
(p = a(o(1233))),
(u = a(o(1234))),
(v = a(o(1235))),
(g = a(o(1236))),
(f = a(o(1237))),
(w = a(o(1238))),
(m = a(o(1239))),
(z = a(o(1240))),
(_ = a(o(1241))),
(M = o(1242)),
(y = o(1243)),
(T = o(1244)),
(n.prototype._defaultToolProperties = function() {
return [
{ name: 'color', inputType: 'colorPicker', iconSvgCode: M, title: $.t('Color') },
{ name: 'linecolor', inputType: 'colorPicker', iconSvgCode: M, title: $.t('Color') },
{
name: 'backgroundColor',
inputType: 'colorPicker',
iconSvgCode: y,
title: $.t('Background Color'),
transparency: !0,
},
{
name: 'linewidth',
inputType: 'combobox',
comboboxOptions: [
{ value: 1, iconSvgCode: c },
{ value: 2, iconSvgCode: h },
{ value: 3, iconSvgCode: d },
{ value: 4, iconSvgCode: p },
],
title: $.t('Width'),
},
{
name: 'linestyle',
title: $.t('Style'),
inputType: 'combobox',
comboboxOptions: [
{ value: 0, iconSvgCode: c },
{ value: 1, iconSvgCode: u },
{ value: 2, iconSvgCode: v },
],
},
{
name: 'leftEnd',
title: $.t('Left End'),
inputType: 'combobox',
comboboxOptions: [
{ value: W.Normal, iconSvgCode: g },
{ value: W.Arrow, iconSvgCode: f },
{ value: n.LINE_EXTEND, iconSvgCode: w },
],
propertyProxy: this.createLineEndPropertyProxy('leftEnd', 'extendLeft'),
},
{
name: 'rightEnd',
title: $.t('Right End'),
inputType: 'combobox',
comboboxOptions: [
{ value: W.Normal, iconSvgCode: m },
{ value: W.Arrow, iconSvgCode: z },
{ value: n.LINE_EXTEND, iconSvgCode: _ },
],
propertyProxy: this.createLineEndPropertyProxy('rightEnd', 'extendRight'),
},
];
}),
(n.prototype._riskPropertiesExceptionCases = function() {
return [
{
name: 'textcolor',
title: $.t('Text color'),
inputType: 'colorPicker',
iconSvgCode: T,
},
{
name: 'profitBackground',
title: $.t('Profit Background Color'),
inputType: 'colorPicker',
iconSvgCode: y,
transparency: !0,
transparencyField: 'profitBackgroundTransparency',
},
{
name: 'stopBackground',
title: $.t('Stop Background Color'),
inputType: 'colorPicker',
iconSvgCode: y,
transparency: !0,
transparencyField: 'stopBackgroundTransparency',
},
{
name: 'linecolor',
title: $.t('Border color'),
inputType: 'colorPicker',
iconSvgCode: M,
},
];
}),
(n.prototype._elliottPropertiesExceptionCases = function() {
return [{ name: 'color', title: $.t('Color'), inputType: 'colorPicker', iconSvgCode: M }];
}),
(n.prototype._rangeExceptionCases = function() {
return [
{ name: 'linecolor', inputType: 'colorPicker', iconSvgCode: M, title: $.t('Color') },
{
name: 'backgroundColor',
inputType: 'colorPicker',
iconSvgCode: y,
title: $.t('Background Color'),
transparency: !0,
transparencyField: 'backgroundTransparency',
},
{
name: 'linewidth',
inputType: 'combobox',
comboboxOptions: [
{ value: 1, iconSvgCode: c },
{ value: 2, iconSvgCode: h },
{ value: 3, iconSvgCode: d },
{ value: 4, iconSvgCode: p },
],
title: 'Width',
},
];
}),
(n.prototype._textPropertiesExceptionCases = function() {
return [
{ name: 'color', title: $.t('Text color'), inputType: 'colorPicker', iconSvgCode: T },
{
name: 'backgroundColor',
title: $.t('Background Color'),
inputType: 'colorPicker',
iconSvgCode: y,
showIf: function(t, e) {
return !e || !e.fillBackground || !!e.fillBackground.value();
},
},
{
name: 'borderColor',
title: $.t('Border Color'),
inputType: 'colorPicker',
iconSvgCode: M,
},
{
name: 'bordercolor',
title: $.t('Border Color'),
inputType: 'colorPicker',
iconSvgCode: M,
},
{
name: 'fontsize',
title: $.t('Font Size'),
inputType: 'combobox',
simple: !0,
addClass: 'simple fontsize-dropdown',
comboboxOptions: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40],
},
];
}),
(n.prototype._notePropertiesExceptionCases = function() {
return [
{
name: 'markerColor',
title: $.t('Marker Color'),
inputType: 'colorPicker',
iconSvgCode: M,
},
{
name: 'textColor',
title: $.t('Text color'),
inputType: 'colorPicker',
iconSvgCode: T,
},
{
name: 'fontSize',
title: $.t('Font Size'),
inputType: 'combobox',
simple: !0,
addClass: 'simple fontsize-dropdown',
comboboxOptions: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40],
},
];
}),
(n.prototype._brushPropertiesExceptionCases = function() {
return [
{ name: 'linecolor', inputType: 'colorPicker', iconSvgCode: M, title: $.t('Color') },
{
name: 'backgroundColor',
inputType: 'colorPicker',
iconSvgCode: y,
transparency: !0,
showIf: function(t, e) {
return e.fillBackground.value();
},
title: $.t('Background Color'),
},
{
name: 'linewidth',
inputType: 'combobox',
comboboxOptions: [
{ value: 1, iconSvgCode: c },
{ value: 2, iconSvgCode: h },
{ value: 3, iconSvgCode: d },
{ value: 4, iconSvgCode: p },
],
title: $.t('Line Width'),
},
{
name: 'leftEnd',
title: $.t('Left End'),
inputType: 'combobox',
comboboxOptions: [
{ value: W.Normal, iconSvgCode: g },
{ value: W.Arrow, iconSvgCode: f },
],
propertyProxy: this.createLineEndPropertyProxy('leftEnd', 'extendLeft'),
},
{
name: 'rightEnd',
title: $.t('Right End'),
inputType: 'combobox',
comboboxOptions: [
{ value: W.Normal, iconSvgCode: m },
{ value: W.Arrow, iconSvgCode: z },
],
propertyProxy: this.createLineEndPropertyProxy('rightEnd', 'extendRight'),
},
];
}),
(n.prototype._oneColorForAllLines = function() {
return [
{
name: 'collectibleColors',
inputType: 'colorPicker',
iconSvgCode: M,
title: $.t('One color for all lines'),
},
];
}),
(n.prototype._createToolExceptionCases = function() {
return {
LineToolRegressionTrend: [],
LineToolGannSquare: n.prototype._oneColorForAllLines(),
LineToolFibTimeZone: n.prototype._oneColorForAllLines(),
LineToolBrush: n.prototype._brushPropertiesExceptionCases(),
LineToolPolyline: n.prototype._brushPropertiesExceptionCases(),
LineToolText: n.prototype._textPropertiesExceptionCases(),
LineToolTextAbsolute: n.prototype._textPropertiesExceptionCases(),
LineToolBalloon: n.prototype._textPropertiesExceptionCases(),
LineToolCallout: n.prototype._textPropertiesExceptionCases(),
LineToolPriceLabel: n.prototype._textPropertiesExceptionCases(),
LineToolArrowMarkLeft: [],
LineToolArrowMarkRight: [],
LineToolArrowMarkUp: [],
LineToolArrowMarkDown: [],
LineToolFlagMark: [],
LineToolThumbUp: [],
LineToolThumbDown: [],
LineToolElliottCircle: n.prototype._elliottPropertiesExceptionCases(),
LineToolElliottSubminuette: n.prototype._elliottPropertiesExceptionCases(),
LineToolElliottMinor: n.prototype._elliottPropertiesExceptionCases(),
LineToolElliottMinorRetr: n.prototype._elliottPropertiesExceptionCases(),
LineToolElliottMajorRetr: n.prototype._elliottPropertiesExceptionCases(),
LineToolDateRange: n.prototype._rangeExceptionCases(),
LineToolPriceRange: n.prototype._rangeExceptionCases(),
LineToolDateAndPriceRange: n.prototype._rangeExceptionCases(),
LineToolIcon: [
{ name: 'color', title: $.t('Color'), inputType: 'colorPicker', iconSvgCode: y },
],
LineToolNote: n.prototype._notePropertiesExceptionCases(),
LineToolNoteAbsolute: n.prototype._notePropertiesExceptionCases(),
LineToolThreeDrivers: [
{ name: 'color', title: $.t('Text color'), inputType: 'colorPicker', iconSvgCode: M },
],
LineToolRiskRewardLong: n.prototype._riskPropertiesExceptionCases(),
LineToolRiskRewardShort: n.prototype._riskPropertiesExceptionCases(),
LineToolBarsPattern: [
{ name: 'color', title: $.t('Color'), inputType: 'colorPicker', iconSvgCode: y },
],
LineToolProjection: [
{
name: 'color1',
title: $.t('Background color 1'),
inputType: 'colorPicker',
iconSvgCode: y,
transparency: !0,
},
{
name: 'color2',
title: $.t('Background color 2'),
inputType: 'colorPicker',
iconSvgCode: y,
transparency: !0,
},
{
name: 'linewidth',
inputType: 'combobox',
comboboxOptions: [
{ value: 1, iconSvgCode: c },
{ value: 2, iconSvgCode: h },
{ value: 3, iconSvgCode: d },
{ value: 4, iconSvgCode: p },
],
},
],
LineToolFibCircles: n.prototype._oneColorForAllLines(),
LineToolFibChannel: n.prototype._oneColorForAllLines(),
LineToolFibSpeedResistanceArcs: n.prototype._oneColorForAllLines(),
LineToolFibRetracement: n.prototype._oneColorForAllLines(),
LineToolFibSpeedResistanceFan: n.prototype._oneColorForAllLines(),
LineToolTrendBasedFibTime: n.prototype._oneColorForAllLines(),
LineToolFibWedge: n.prototype._oneColorForAllLines(),
LineToolGannComplex: n.prototype._oneColorForAllLines(),
LineToolGannFixed: n.prototype._oneColorForAllLines(),
LineToolGannFan: n.prototype._oneColorForAllLines(),
LineToolPitchfan: n.prototype._oneColorForAllLines(),
LineToolPitchfork: n.prototype._oneColorForAllLines(),
LineToolSchiffPitchfork2: n.prototype._oneColorForAllLines(),
LineToolSchiffPitchfork: n.prototype._oneColorForAllLines(),
LineToolInsidePitchfork: n.prototype._oneColorForAllLines(),
LineToolTrendBasedFibExtension: n.prototype._oneColorForAllLines(),
};
}),
(t.exports = n);
}.call(e, o(5), o(13)));
},
823: function(t, e, o) {
'use strict';
(function(t) {
function i(t, e) {
return '
';
}
function n(t, e) {
(this._model = e),
(this._bindings = []),
(this._property = t),
(this.supportThemeSwitcher = !1);
}
function s(t) {
return t.toUpperCase();
}
function r(t) {
return function(e) {
return e < t ? t : e;
};
}
function l(t) {
return function(e) {
return e > t ? t : e;
};
}
function a(t) {
return function(e) {
var o = parseInt(e, 10);
return I(o) ? t : o;
};
}
function c(t) {
var e = new N();
return function(o) {
var i = e.parse(o);
return I(i) ? t : i;
};
}
function h(t) {
var e = new N();
return function(o) {
var i = e.parse(o);
return I(i) ? t() : i;
};
}
function d(t, e) {
var o = new O(e);
return function(e) {
var i = o.format(e);
return I(i) ? t : i;
};
}
function p() {
return function(t) {
for (var e = t, o = t.replace(/[^\u0000-\u007F]/, ''); o.length !== e.length; )
(e = o), (o = e.replace(/[^\u0000-\u007F]/, ''));
return o;
};
}
function u(t) {
return function(e) {
return 0 === e.length ? t : e;
};
}
function v(t, e) {
return function(o) {
var i = t();
return o === e.value() && i && (i.ticker || i.full_name) ? i.ticker || i.full_name : o;
};
}
function g(t, e, o, i, n, s, r) {
j.call(this, t, e, i, n, s),
(this._transformFunction = o),
(this._setter = r),
this._attachToControl(t, i);
}
function f(t, e, o, i, n) {
g.call(this, t, e, c(e.value()), o, i, n),
this.addFormatter(function(t) {
return new N().format(t);
});
}
function w(t, e, o, i, n, s) {
(this._subControlIds = e),
j.call(this, t, o, i, n, s),
this._forEachSubControl(function(t) {
this._attachToControl(t, i);
});
}
function m(t, e, o, i, n, s, r) {
(this._model = i),
(this._mainSeries = s),
(this._toIntTransformer = a(r)),
(this._disabled = !1),
j.call(this, t, e, o, i, n);
var l = this;
o &&
t.change(function() {
l.setValueToProperty(l.value());
}),
this._mainSeries
.dataEvents()
.barReceived()
.subscribe(this, function() {
l.setValue(this.property().value());
});
}
function z(t, e, o, i, n, s, r) {
j.call(this, t, e, o, i, n),
(this._transform = s),
o &&
t.on(
'accept-symbol',
function(t, e) {
this.setValueToProperty(e), this.setValue(e);
}.bind(this),
),
r && (r.subscribe(this, this._updateDisplayedSymbol), (this._updateDelegate = r));
}
function _(t, e, o, i, n, s, r, l) {
j.call(this, t, e, i, n, s),
(this._transformFunction = o),
(this._propertyChangedHook = l),
(this._setter = r);
var a = this;
i &&
t.change(function() {
a._setter ? a._setter.call(a, a.value()) : a.setValueToProperty(a.value());
});
}
function M(t, e) {
j.call(this, t, e);
}
function y(t, e, o, i, n, s) {
if (!t.is(':checkbox, :radio')) return new b(t, e, o, i, n);
j.call(this, t, e, o, i, n), (this._setter = s);
var r = this;
o &&
t.change(function() {
r._setter ? r._setter.call(r, r.value()) : r.setValueToProperty(r.value());
});
}
function T(t, e, o, i, n, s) {
j.call(this, t, e, o, i, n), (this._inverted = !0 === s);
}
function b(t, e, o, i, n) {
j.call(this, t, e, o, i, n);
var s = this;
o &&
t.click(function() {
var t = $(this)
.toggleClass('active')
.hasClass('active');
s.setValueToProperty(t);
});
}
function x(t, e, o, i, n, s) {
var r, l;
(r = t.is('input') ? t : t.find('input')),
j.call(this, r, e, o, i, n),
(this._transparencyProperty = s),
this.applyOldTransparency(),
(l = this),
o &&
r.change(function() {
l.setValueToProperty(l.value());
});
}
function C(e, o, i, n, s, r) {
function l(t, e) {
var o = c.control().slider('option', 'min'),
i = c.control().slider('option', 'max'),
n = c._property.value();
((o <= n && n <= i) || (o < e.value && e.value < i)) && c.setValueToProperty(e.value);
}
function a(t, e) {
c.setValueToProperty(e.value);
}
isNumber(o.value()) ||
(G.logWarn(
'Property cannot be binded to control, bad value (expect number): ' + o.value(),
),
(o = new t())),
j.call(this, e, o, i, n, s);
var c = this;
i &&
(r
? (e.bind('slidechange', l), e.bind('slide', l))
: (e.bind('slidechange', a), e.bind('slide', a))),
e.bind('slidestart', function(t, e) {
n.beginUndoMacro(s);
}),
e.bind('slidestop', function(t, e) {
n.endUndoMacro();
});
}
function L(t, e, o, i, n, s) {
y.call(this, t, e, i, n, s),
(this._intervalProperty = o),
this._intervalProperty.listeners().subscribe(this, this.onIntervalChanged),
this.onIntervalChanged();
}
function P(t, e, o, i, n) {
(this._control = t),
(this._wv = e),
(this._transformFunction = o),
(this._undoModel = i),
(this._undoText = n),
this._attachToControl(this._control),
(this._setValueBinded = this.setValue.bind(this));
}
function S(t, e, o, i, n, s) {
(this._not = !!s), P.apply(this, arguments);
}
function k(t, e, o, i, n, s, r, l) {
(this._propFrom = e[0]),
(this._propTo = e[1]),
(this._control = t),
(this._applyOnFly = i),
(this._undoModel = n),
(this._undoText = r),
(this._properties = e),
(this._inputsText = s),
(this._transformers = o);
var a = this;
t.slider({
range: !0,
min: o[0],
max: o[1],
values: [a._propFrom.value(), a._propTo.value()],
}),
(this.$rangeHandleFrom = $(t.find('.ui-slider-handle')[0]).addClass('from')),
(this.$rangeHandleTo = $(t.find('.ui-slider-handle')[1]).addClass('to')),
this.setValue(this._propFrom, 0),
this.setValue(this._propTo, 1),
l &&
($(l).on('change', function(t) {
$(this).is(':checked')
? (a._control.slider('enable'),
$(a._inputsText[0]).prop('disabled', !1),
$(a._inputsText[1]).prop('disabled', !1))
: (a._control.slider('disable'),
$(a._inputsText[0]).prop('disabled', !0),
$(a._inputsText[1]).prop('disabled', !0));
}),
$(l).is(':checked')
? (a._control.slider('enable'),
$(a._inputsText[0]).prop('disabled', !1),
$(a._inputsText[1]).prop('disabled', !1))
: (a._control.slider('disable'),
$(a._inputsText[0]).prop('disabled', !0),
$(a._inputsText[1]).prop('disabled', !0))),
s &&
($(s[0]).val(this._control.slider('values', 0)),
$(s[1]).val(this._control.slider('values', 1)),
t.slider({
slide: function(t, e) {
$(s[0]).val(e.values[0]), $(s[1]).val(e.values[1]);
},
}),
$(s).each(function() {
$(this).on('keydown', function(t) {
parseInt($(s[0]).val()) < a._transformers[0]
? $(s[0]).val(a._transformers[0])
: parseInt($(s[1]).val()) > a._transformers[1] && $(s[1]).val(a._transformers[1]),
-1 !== $.inArray(t.keyCode, [46, 8, 9, 27, 13, 110, 190]) ||
(65 === t.keyCode && !0 === t.ctrlKey) ||
(67 === t.keyCode && !0 === t.ctrlKey) ||
(88 === t.keyCode && !0 === t.ctrlKey) ||
(t.keyCode >= 35 && t.keyCode <= 39) ||
((t.shiftKey || t.keyCode < 48 || t.keyCode > 57) &&
(t.keyCode < 96 || t.keyCode > 105) &&
t.preventDefault());
});
}),
$(s[0]).on('keyup', function(t) {
parseInt($(this).val()) < a._transformers[0]
? $(this).val(a._transformers[0])
: parseInt($(this).val()) > a._transformers[1] && $(this).val(a._transformers[1]),
parseInt($(this).val()) > parseInt($(s[1]).val()) && $(this).val(s[1].val()),
a._control.slider('values', 0, $(this).val()),
k.prototype.setValueToProperty.call(a, a._control.slider('values'), 'from');
}),
$(s[1]).on('keyup', function(t) {
parseInt($(this).val()) < a._transformers[0]
? $(this).val(a._transformers[0])
: parseInt($(this).val()) > a._transformers[1] && $(this).val(a._transformers[1]),
parseInt($(this).val()) < $(s[0]).val() && $(this).val(s[0].val()),
a._control.slider('values', 1, $(this).val()),
k.prototype.setValueToProperty.call(a, a._control.slider('values'), 'to');
})),
this._propFrom.listeners().subscribe(this, k.prototype.propertyChanged),
this._propTo.listeners().subscribe(this, k.prototype.propertyChanged),
i &&
t.on('slide', function(t, e) {
a.setValueToProperty(a._control.slider('values'), e.handle);
}),
t.slider({
stop: function(t, e) {
s &&
($(s[0]).val(a._control.slider('values', 0)),
$(s[1]).val(a._control.slider('values', 1))),
a.setValueToProperty(a._control.slider('values'), e.handle);
},
start: function(t, e) {
s &&
($(s[0]).val(a._control.slider('values', 0)),
$(s[1]).val(a._control.slider('values', 1))),
a.setValueToProperty(a._control.slider('values'), e.handle);
},
});
}
function B(t, e, o, i, n, s) {
j.call(this, t, e, o, i, n), (this._separator = s || ' ');
var r = this;
o &&
t.change(function() {
r.setValueToProperty(r.value());
});
}
var A, I, E, W, V, F, D, N, O, R, H, j, G;
o(866),
(A = o(7).ensureNotNull),
(I = o(83).isNaN),
(E = o(24)),
(W = E.rgba),
(V = E.rgbaToString),
(F = E.parseRgb),
(D = o(72).TimePointIndexSearchMode),
(N = o(105).NumericFormatter),
(O = o(193).LimitedPrecisionNumericFormatter),
(R = o(29)),
(H = o(829).addColorPicker),
(j = o(317).Binding),
(G = o(4).getLogger('Chart.PropertyPage')),
(n.prototype.model = function() {
return this._model;
}),
(n.prototype.bindControl = function(t) {
return this._bindings.push(t), t;
}),
(n.prototype.unbindControl = function(t) {
var e = this._bindings.indexOf(t);
-1 !== e && this._bindings.splice(e, 1);
}),
(n.prototype.loadData = function() {
var t, e, o;
for (t = 0; t < this._bindings.length; t++)
(e = this._bindings[t]),
e.properties
? ((o = e.properties()), e.setValue(o[0], 0), e.setValue(o[1], 1))
: e.property &&
(e.transparencyProperty && e.transparencyProperty()
? e.applyOldTransparency()
: e.setValue(e.property().value()));
}),
(n.prototype.saveData = function() {
var t, e;
for (this._model.beginUndoMacro(), t = 0; t < this._bindings.length; t++)
(e = this._bindings[t]),
e.changed() && this._model.setProperty(e.property(), e.value());
this._model.endUndoMacro();
}),
(n.prototype.createLineWidthEditor = function() {
var t = this._model._chartWidget.widget().prop('ownerDocument');
return $('
', t).slider({ max: 4, min: 1, step: 1 });
}),
(n.prototype.createColorPicker = function(t) {
return H(null, t);
}),
(n.prototype.createTextEditor = function(t, e) {
var o = {};
return (
t && (o.width = t),
e && (o.height = e),
$(document.createElement('textarea'))
.css(o)
.addClass('tv-control-input')
);
}),
(n.prototype.createCombo = function(t) {
var e = $(document.createElement('select')),
o = t.reduce(function(t, e) {
return t.add($(document.createElement('option')).prop({ value: e, text: e }));
}, $());
return e.append(o);
}),
(n.prototype.createKeyCombo = function(t) {
var e = $(document.createElement('select'));
return (
$.each(t || [], function(t, o) {
$(document.createElement('option'))
.prop({ value: t, text: o })
.appendTo(e);
}),
e
);
}),
(n.prototype.createFontEditor = function(t) {
var e = t || TradingView.factoryDefaults('chartproperties.editorFontsList');
return this.createCombo(e);
}),
(n.prototype.createFontSizeEditor = function(t) {
var e = t || [10, 11, 12, 14, 16, 20, 24, 28, 32, 40];
return this.createCombo(e).addClass('tv-select-container-fontsize');
}),
(n.prototype.createSeriesMinTickEditor = function() {
var t,
e,
o,
i,
n = "
'), $(n);
}),
(n.prototype.createPrecisionEditor = function() {
var t,
e = "
'), $(e);
}),
(n.prototype.createLabeledCell = function(t, e, o) {
var i,
n,
s,
r,
l = null;
return (
'number' == typeof t.valueOf() ? ((l = t), (i = e), (n = o)) : ((i = t), (n = e)),
(i += ''),
(s = this._labelToId(i)),
(r = $('
')),
$(' |