binbot-charts 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,15 +35,15 @@ var __async = (__this, __arguments, generator) => {
35
35
  var fulfilled = (value) => {
36
36
  try {
37
37
  step(generator.next(value));
38
- } catch (e) {
39
- reject(e);
38
+ } catch (e2) {
39
+ reject(e2);
40
40
  }
41
41
  };
42
42
  var rejected = (value) => {
43
43
  try {
44
44
  step(generator.throw(value));
45
- } catch (e) {
46
- reject(e);
45
+ } catch (e2) {
46
+ reject(e2);
47
47
  }
48
48
  };
49
49
  var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
@@ -59,303 +59,299 @@ __export(TVChartContainer_exports, {
59
59
  module.exports = __toCommonJS(TVChartContainer_exports);
60
60
  var import_react2 = require("react");
61
61
 
62
- // src/charting_library/charting_library.js
63
- !function(e, t) {
64
- "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).TradingView = {});
65
- }(void 0, function(e) {
66
- "use strict";
67
- function t(e2, i2) {
68
- const n2 = __spreadValues({}, e2);
69
- for (const o2 in i2) "object" != typeof e2[o2] || null === e2[o2] || Array.isArray(e2[o2]) ? void 0 !== i2[o2] && (n2[o2] = i2[o2]) : n2[o2] = t(e2[o2], i2[o2]);
70
- return n2;
71
- }
72
- const i = { mobile: { disabled_features: ["left_toolbar", "header_widget", "timeframes_toolbar", "edit_buttons_in_legend", "context_menus", "control_bar", "border_around_the_chart"], enabled_features: [] } }, n = { width: 800, height: 500, interval: "1D", timezone: "Etc/UTC", container: "", library_path: "", locale: "en", widgetbar: { details: false, watchlist: false, watchlist_settings: { default_symbols: [] } }, overrides: { "mainSeriesProperties.showCountdown": false }, studies_overrides: {}, trading_customization: { position: {}, order: {} }, brokerConfig: { configFlags: {} }, fullscreen: false, autosize: false, disabled_features: [], enabled_features: [], debug: false, logo: {}, time_frames: [{ text: "5y", resolution: "1W" }, { text: "1y", resolution: "1W" }, { text: "6m", resolution: "120" }, { text: "3m", resolution: "60" }, { text: "1m", resolution: "30" }, { text: "5d", resolution: "5" }, { text: "1d", resolution: "1" }], client_id: "0", user_id: "0", charts_storage_api_version: "1.0", favorites: { intervals: [], chartTypes: [] } };
73
- let o = false;
74
- function s() {
75
- return "CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)";
76
- }
77
- const r = class {
78
- constructor(e2) {
79
- if (this._id = `tradingview_${(1048576 * (1 + Math.random()) | 0).toString(16).substring(1)}`, this._ready = false, this._readyHandlers = [], this._onWindowResize = this._autoResizeChart.bind(this), !e2.datafeed) throw new Error("Datafeed is not defined");
80
- if (this._options = t(n, e2), e2.preset) {
81
- const t2 = i[e2.preset];
82
- t2 ? (void 0 !== this._options.disabled_features ? this._options.disabled_features = this._options.disabled_features.concat(t2.disabled_features) : this._options.disabled_features = t2.disabled_features, void 0 !== this._options.enabled_features ? this._options.enabled_features = this._options.enabled_features.concat(t2.enabled_features) : this._options.enabled_features = t2.enabled_features) : console.warn("Unknown preset: `" + e2.preset + "`");
83
- }
84
- "Dark" === this._options.theme && void 0 === this._options.loading_screen && (this._options.loading_screen = { backgroundColor: "#131722" }), this._options.debug && (o || (o = true, console.log("Using CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)"))), this._create();
85
- }
86
- onChartReady(e2) {
87
- this._ready ? e2.call(this) : this._readyHandlers.push(e2);
88
- }
89
- headerReady() {
90
- return this._innerWindowLoaded.then(() => this._innerWindow().headerReady());
91
- }
92
- onGrayedObjectClicked(e2) {
93
- this._doWhenInnerApiLoaded((t2) => {
94
- t2.onGrayedObjectClicked(e2);
95
- });
96
- }
97
- onShortcut(e2, t2) {
98
- this._doWhenInnerWindowLoaded((i2) => {
99
- i2.createShortcutAction(e2, t2);
100
- });
101
- }
102
- subscribe(e2, t2) {
103
- this._doWhenInnerApiLoaded((i2) => {
104
- i2.subscribe(e2, t2);
105
- });
106
- }
107
- unsubscribe(e2, t2) {
108
- this._doWhenInnerApiLoaded((i2) => {
109
- i2.unsubscribe(e2, t2);
110
- });
111
- }
112
- chart(e2) {
113
- return this._innerAPI().chart(e2);
114
- }
115
- getLanguage() {
116
- return this._options.locale;
117
- }
118
- setSymbol(e2, t2, i2) {
119
- this._innerAPI().changeSymbol(e2, t2, i2);
120
- }
121
- remove() {
122
- window.removeEventListener("resize", this._onWindowResize), this._readyHandlers.splice(0, this._readyHandlers.length), delete window[this._id], this._iFrame.parentNode && this._iFrame.parentNode.removeChild(this._iFrame);
123
- }
124
- closePopupsAndDialogs() {
125
- this._doWhenInnerApiLoaded((e2) => {
126
- e2.closePopupsAndDialogs();
127
- });
128
- }
129
- selectLineTool(e2) {
130
- this._innerAPI().selectLineTool(e2);
131
- }
132
- selectedLineTool() {
133
- return this._innerAPI().selectedLineTool();
134
- }
135
- save(e2) {
136
- this._innerAPI().saveChart(e2);
137
- }
138
- load(e2, t2) {
139
- this._innerAPI().loadChart({ json: e2, extendedData: t2 });
140
- }
141
- getSavedCharts(e2) {
142
- this._innerAPI().getSavedCharts(e2);
143
- }
144
- loadChartFromServer(e2) {
145
- this._innerAPI().loadChartFromServer(e2);
146
- }
147
- saveChartToServer(e2, t2, i2) {
148
- this._innerAPI().saveChartToServer(e2, t2, i2);
149
- }
150
- removeChartFromServer(e2, t2) {
151
- this._innerAPI().removeChartFromServer(e2, t2);
152
- }
153
- onContextMenu(e2) {
154
- this._doWhenInnerApiLoaded((t2) => {
155
- t2.onContextMenu(e2);
156
- });
157
- }
158
- createButton(e2) {
159
- return this._innerWindow().createButton(e2);
160
- }
161
- createDropdown(e2) {
162
- return this._innerWindow().createDropdown(e2);
163
- }
164
- showNoticeDialog(e2) {
165
- this._doWhenInnerApiLoaded((t2) => {
166
- t2.showNoticeDialog(e2);
167
- });
168
- }
169
- showConfirmDialog(e2) {
170
- this._doWhenInnerApiLoaded((t2) => {
171
- t2.showConfirmDialog(e2);
172
- });
173
- }
174
- showLoadChartDialog() {
175
- this._innerAPI().showLoadChartDialog();
176
- }
177
- showSaveAsChartDialog() {
178
- this._innerAPI().showSaveAsChartDialog();
179
- }
180
- symbolInterval() {
181
- return this._innerAPI().getSymbolInterval();
182
- }
183
- mainSeriesPriceFormatter() {
184
- return this._innerAPI().mainSeriesPriceFormatter();
185
- }
186
- getIntervals() {
187
- return this._innerAPI().getIntervals();
188
- }
189
- getStudiesList() {
190
- return this._innerAPI().getStudiesList();
191
- }
192
- getStudyInputs(e2) {
193
- return this._innerAPI().getStudyInputs(e2);
194
- }
195
- addCustomCSSFile(e2) {
196
- this._innerWindow().addCustomCSSFile(e2);
197
- }
198
- applyOverrides(e2) {
199
- this._options = t(this._options, { overrides: e2 }), this._doWhenInnerWindowLoaded((t2) => {
200
- t2.applyOverrides(e2);
201
- });
202
- }
203
- applyStudiesOverrides(e2) {
204
- this._doWhenInnerWindowLoaded((t2) => {
205
- t2.applyStudiesOverrides(e2);
206
- });
207
- }
208
- watchList() {
209
- return this._innerAPI().watchlist();
210
- }
211
- news() {
212
- return this._innerAPI().news();
213
- }
214
- activeChart() {
215
- return this._innerAPI().activeChart();
216
- }
217
- chartsCount() {
218
- return this._innerAPI().chartsCount();
219
- }
220
- layout() {
221
- return this._innerAPI().layout();
222
- }
223
- setLayout(e2) {
224
- this._innerAPI().setLayout(e2);
225
- }
226
- layoutName() {
227
- return this._innerAPI().layoutName();
228
- }
229
- changeTheme(e2, t2) {
230
- return this._innerWindow().changeTheme(e2, t2);
231
- }
232
- getTheme() {
233
- return this._innerWindow().getTheme();
234
- }
235
- takeScreenshot() {
236
- this._doWhenInnerApiLoaded((e2) => {
237
- e2.takeScreenshot();
238
- });
239
- }
240
- lockAllDrawingTools() {
241
- return this._innerAPI().lockAllDrawingTools();
242
- }
243
- hideAllDrawingTools() {
244
- return this._innerAPI().hideAllDrawingTools();
245
- }
246
- drawOnAllCharts(e2) {
247
- this._innerAPI().drawOnAllCharts(e2);
248
- }
249
- magnetEnabled() {
250
- return this._innerAPI().magnetEnabled();
251
- }
252
- magnetMode() {
253
- return this._innerAPI().magnetMode();
254
- }
255
- undoRedoState() {
256
- return this._innerAPI().undoRedoState();
257
- }
258
- setIntervalLinkingEnabled(e2) {
259
- this._innerAPI().setIntervalLinkingEnabled(e2);
260
- }
261
- setTimeFrame(e2) {
262
- this._innerAPI().setTimeFrame(e2);
263
- }
264
- symbolSync() {
265
- return this._innerAPI().symbolSync();
266
- }
267
- intervalSync() {
268
- return this._innerAPI().intervalSync();
269
- }
270
- crosshairSync() {
271
- return this._innerAPI().crosshairSync();
272
- }
273
- timeSync() {
274
- return this._innerAPI().timeSync();
275
- }
276
- getAllFeatures() {
277
- return this._innerWindow().getAllFeatures();
278
- }
279
- clearUndoHistory() {
280
- return this._innerAPI().clearUndoHistory();
281
- }
282
- undo() {
283
- return this._innerAPI().undo();
284
- }
285
- redo() {
286
- return this._innerAPI().redo();
287
- }
288
- startFullscreen() {
289
- this._innerAPI().startFullscreen();
290
- }
291
- exitFullscreen() {
292
- this._innerAPI().exitFullscreen();
293
- }
294
- takeClientScreenshot(e2) {
295
- return this._innerAPI().takeClientScreenshot(e2);
296
- }
297
- navigationButtonsVisibility() {
298
- return this._innerWindow().getNavigationButtonsVisibility();
299
- }
300
- paneButtonsVisibility() {
301
- return this._innerWindow().getPaneButtonsVisibility();
302
- }
303
- dateFormat() {
304
- return this._innerWindow().getDateFormat();
305
- }
306
- _innerAPI() {
307
- return this._innerWindow().tradingViewApi;
308
- }
309
- _innerWindow() {
310
- return this._iFrame.contentWindow;
311
- }
312
- _doWhenInnerWindowLoaded(e2) {
313
- this._ready ? e2(this._innerWindow()) : this._innerWindowLoaded.then(() => {
314
- e2(this._innerWindow());
315
- });
316
- }
317
- _doWhenInnerApiLoaded(e2) {
318
- this._doWhenInnerWindowLoaded((t2) => {
319
- t2.doWhenApiIsReady(() => e2(this._innerAPI()));
320
- });
321
- }
322
- _autoResizeChart() {
323
- this._options.fullscreen && (this._iFrame.style.height = window.innerHeight + "px");
324
- }
325
- _create() {
326
- const e2 = this._render();
327
- this._options.container_id && console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");
328
- const t2 = this._options.container_id || this._options.container, i2 = "string" == typeof t2 ? document.getElementById(t2) : t2;
329
- if (null === i2) throw new Error(`There is no such element - #${this._options.container}`);
330
- i2.innerHTML = e2, this._iFrame = i2.querySelector(`#${this._id}`);
331
- const n2 = this._iFrame;
332
- (this._options.autosize || this._options.fullscreen) && (n2.style.width = "100%", this._options.fullscreen || (n2.style.height = "100%")), window.addEventListener("resize", this._onWindowResize), this._onWindowResize(), this._innerWindowLoaded = new Promise((e3) => {
333
- const t3 = () => {
334
- n2.removeEventListener("load", t3, false), e3();
335
- };
336
- n2.addEventListener("load", t3, false);
337
- }), this._innerWindowLoaded.then(() => {
338
- this._innerWindow().widgetReady(() => {
339
- this._ready = true;
340
- for (const e3 of this._readyHandlers) try {
341
- e3.call(this);
342
- } catch (e4) {
343
- console.error(e4);
344
- }
345
- this._innerWindow().initializationFinished();
346
- });
62
+ // src/charting_library/charting_library.esm.js
63
+ function e(t2, i2) {
64
+ const n2 = __spreadValues({}, t2);
65
+ for (const o2 in i2) "object" != typeof t2[o2] || null === t2[o2] || Array.isArray(t2[o2]) ? void 0 !== i2[o2] && (n2[o2] = i2[o2]) : n2[o2] = e(t2[o2], i2[o2]);
66
+ return n2;
67
+ }
68
+ var t = { mobile: { disabled_features: ["left_toolbar", "header_widget", "timeframes_toolbar", "edit_buttons_in_legend", "context_menus", "control_bar", "border_around_the_chart"], enabled_features: [] } };
69
+ var i = { width: 800, height: 500, interval: "1D", timezone: "Etc/UTC", container: "", library_path: "", locale: "en", widgetbar: { details: false, watchlist: false, watchlist_settings: { default_symbols: [] } }, overrides: { "mainSeriesProperties.showCountdown": false }, studies_overrides: {}, trading_customization: { position: {}, order: {} }, brokerConfig: { configFlags: {} }, fullscreen: false, autosize: false, disabled_features: [], enabled_features: [], debug: false, logo: {}, time_frames: [{ text: "5y", resolution: "1W" }, { text: "1y", resolution: "1W" }, { text: "6m", resolution: "120" }, { text: "3m", resolution: "60" }, { text: "1m", resolution: "30" }, { text: "5d", resolution: "5" }, { text: "1d", resolution: "1" }], client_id: "0", user_id: "0", charts_storage_api_version: "1.0", favorites: { intervals: [], chartTypes: [] } };
70
+ var n = false;
71
+ function o() {
72
+ return "CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)";
73
+ }
74
+ var s = class {
75
+ constructor(o2) {
76
+ if (this._id = `tradingview_${(1048576 * (1 + Math.random()) | 0).toString(16).substring(1)}`, this._ready = false, this._readyHandlers = [], this._onWindowResize = this._autoResizeChart.bind(this), !o2.datafeed) throw new Error("Datafeed is not defined");
77
+ if (this._options = e(i, o2), o2.preset) {
78
+ const e2 = t[o2.preset];
79
+ e2 ? (void 0 !== this._options.disabled_features ? this._options.disabled_features = this._options.disabled_features.concat(e2.disabled_features) : this._options.disabled_features = e2.disabled_features, void 0 !== this._options.enabled_features ? this._options.enabled_features = this._options.enabled_features.concat(e2.enabled_features) : this._options.enabled_features = e2.enabled_features) : console.warn("Unknown preset: `" + o2.preset + "`");
80
+ }
81
+ "Dark" === this._options.theme && void 0 === this._options.loading_screen && (this._options.loading_screen = { backgroundColor: "#131722" }), this._options.debug && (n || (n = true, console.log("Using CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)"))), this._create();
82
+ }
83
+ onChartReady(e2) {
84
+ this._ready ? e2.call(this) : this._readyHandlers.push(e2);
85
+ }
86
+ headerReady() {
87
+ return this._innerWindowLoaded.then(() => this._innerWindow().headerReady());
88
+ }
89
+ onGrayedObjectClicked(e2) {
90
+ this._doWhenInnerApiLoaded((t2) => {
91
+ t2.onGrayedObjectClicked(e2);
92
+ });
93
+ }
94
+ onShortcut(e2, t2) {
95
+ this._doWhenInnerWindowLoaded((i2) => {
96
+ i2.createShortcutAction(e2, t2);
97
+ });
98
+ }
99
+ subscribe(e2, t2) {
100
+ this._doWhenInnerApiLoaded((i2) => {
101
+ i2.subscribe(e2, t2);
102
+ });
103
+ }
104
+ unsubscribe(e2, t2) {
105
+ this._doWhenInnerApiLoaded((i2) => {
106
+ i2.unsubscribe(e2, t2);
107
+ });
108
+ }
109
+ chart(e2) {
110
+ return this._innerAPI().chart(e2);
111
+ }
112
+ getLanguage() {
113
+ return this._options.locale;
114
+ }
115
+ setSymbol(e2, t2, i2) {
116
+ this._innerAPI().changeSymbol(e2, t2, i2);
117
+ }
118
+ remove() {
119
+ window.removeEventListener("resize", this._onWindowResize), this._readyHandlers.splice(0, this._readyHandlers.length), delete window[this._id], this._iFrame.parentNode && this._iFrame.parentNode.removeChild(this._iFrame);
120
+ }
121
+ closePopupsAndDialogs() {
122
+ this._doWhenInnerApiLoaded((e2) => {
123
+ e2.closePopupsAndDialogs();
124
+ });
125
+ }
126
+ selectLineTool(e2) {
127
+ this._innerAPI().selectLineTool(e2);
128
+ }
129
+ selectedLineTool() {
130
+ return this._innerAPI().selectedLineTool();
131
+ }
132
+ save(e2) {
133
+ this._innerAPI().saveChart(e2);
134
+ }
135
+ load(e2, t2) {
136
+ this._innerAPI().loadChart({ json: e2, extendedData: t2 });
137
+ }
138
+ getSavedCharts(e2) {
139
+ this._innerAPI().getSavedCharts(e2);
140
+ }
141
+ loadChartFromServer(e2) {
142
+ this._innerAPI().loadChartFromServer(e2);
143
+ }
144
+ saveChartToServer(e2, t2, i2) {
145
+ this._innerAPI().saveChartToServer(e2, t2, i2);
146
+ }
147
+ removeChartFromServer(e2, t2) {
148
+ this._innerAPI().removeChartFromServer(e2, t2);
149
+ }
150
+ onContextMenu(e2) {
151
+ this._doWhenInnerApiLoaded((t2) => {
152
+ t2.onContextMenu(e2);
153
+ });
154
+ }
155
+ createButton(e2) {
156
+ return this._innerWindow().createButton(e2);
157
+ }
158
+ createDropdown(e2) {
159
+ return this._innerWindow().createDropdown(e2);
160
+ }
161
+ showNoticeDialog(e2) {
162
+ this._doWhenInnerApiLoaded((t2) => {
163
+ t2.showNoticeDialog(e2);
164
+ });
165
+ }
166
+ showConfirmDialog(e2) {
167
+ this._doWhenInnerApiLoaded((t2) => {
168
+ t2.showConfirmDialog(e2);
169
+ });
170
+ }
171
+ showLoadChartDialog() {
172
+ this._innerAPI().showLoadChartDialog();
173
+ }
174
+ showSaveAsChartDialog() {
175
+ this._innerAPI().showSaveAsChartDialog();
176
+ }
177
+ symbolInterval() {
178
+ return this._innerAPI().getSymbolInterval();
179
+ }
180
+ mainSeriesPriceFormatter() {
181
+ return this._innerAPI().mainSeriesPriceFormatter();
182
+ }
183
+ getIntervals() {
184
+ return this._innerAPI().getIntervals();
185
+ }
186
+ getStudiesList() {
187
+ return this._innerAPI().getStudiesList();
188
+ }
189
+ getStudyInputs(e2) {
190
+ return this._innerAPI().getStudyInputs(e2);
191
+ }
192
+ addCustomCSSFile(e2) {
193
+ this._innerWindow().addCustomCSSFile(e2);
194
+ }
195
+ applyOverrides(t2) {
196
+ this._options = e(this._options, { overrides: t2 }), this._doWhenInnerWindowLoaded((e2) => {
197
+ e2.applyOverrides(t2);
198
+ });
199
+ }
200
+ applyStudiesOverrides(e2) {
201
+ this._doWhenInnerWindowLoaded((t2) => {
202
+ t2.applyStudiesOverrides(e2);
203
+ });
204
+ }
205
+ watchList() {
206
+ return this._innerAPI().watchlist();
207
+ }
208
+ news() {
209
+ return this._innerAPI().news();
210
+ }
211
+ activeChart() {
212
+ return this._innerAPI().activeChart();
213
+ }
214
+ chartsCount() {
215
+ return this._innerAPI().chartsCount();
216
+ }
217
+ layout() {
218
+ return this._innerAPI().layout();
219
+ }
220
+ setLayout(e2) {
221
+ this._innerAPI().setLayout(e2);
222
+ }
223
+ layoutName() {
224
+ return this._innerAPI().layoutName();
225
+ }
226
+ changeTheme(e2, t2) {
227
+ return this._innerWindow().changeTheme(e2, t2);
228
+ }
229
+ getTheme() {
230
+ return this._innerWindow().getTheme();
231
+ }
232
+ takeScreenshot() {
233
+ this._doWhenInnerApiLoaded((e2) => {
234
+ e2.takeScreenshot();
235
+ });
236
+ }
237
+ lockAllDrawingTools() {
238
+ return this._innerAPI().lockAllDrawingTools();
239
+ }
240
+ hideAllDrawingTools() {
241
+ return this._innerAPI().hideAllDrawingTools();
242
+ }
243
+ drawOnAllCharts(e2) {
244
+ this._innerAPI().drawOnAllCharts(e2);
245
+ }
246
+ magnetEnabled() {
247
+ return this._innerAPI().magnetEnabled();
248
+ }
249
+ magnetMode() {
250
+ return this._innerAPI().magnetMode();
251
+ }
252
+ undoRedoState() {
253
+ return this._innerAPI().undoRedoState();
254
+ }
255
+ setIntervalLinkingEnabled(e2) {
256
+ this._innerAPI().setIntervalLinkingEnabled(e2);
257
+ }
258
+ setTimeFrame(e2) {
259
+ this._innerAPI().setTimeFrame(e2);
260
+ }
261
+ symbolSync() {
262
+ return this._innerAPI().symbolSync();
263
+ }
264
+ intervalSync() {
265
+ return this._innerAPI().intervalSync();
266
+ }
267
+ crosshairSync() {
268
+ return this._innerAPI().crosshairSync();
269
+ }
270
+ timeSync() {
271
+ return this._innerAPI().timeSync();
272
+ }
273
+ getAllFeatures() {
274
+ return this._innerWindow().getAllFeatures();
275
+ }
276
+ clearUndoHistory() {
277
+ return this._innerAPI().clearUndoHistory();
278
+ }
279
+ undo() {
280
+ return this._innerAPI().undo();
281
+ }
282
+ redo() {
283
+ return this._innerAPI().redo();
284
+ }
285
+ startFullscreen() {
286
+ this._innerAPI().startFullscreen();
287
+ }
288
+ exitFullscreen() {
289
+ this._innerAPI().exitFullscreen();
290
+ }
291
+ takeClientScreenshot(e2) {
292
+ return this._innerAPI().takeClientScreenshot(e2);
293
+ }
294
+ navigationButtonsVisibility() {
295
+ return this._innerWindow().getNavigationButtonsVisibility();
296
+ }
297
+ paneButtonsVisibility() {
298
+ return this._innerWindow().getPaneButtonsVisibility();
299
+ }
300
+ dateFormat() {
301
+ return this._innerWindow().getDateFormat();
302
+ }
303
+ _innerAPI() {
304
+ return this._innerWindow().tradingViewApi;
305
+ }
306
+ _innerWindow() {
307
+ return this._iFrame.contentWindow;
308
+ }
309
+ _doWhenInnerWindowLoaded(e2) {
310
+ this._ready ? e2(this._innerWindow()) : this._innerWindowLoaded.then(() => {
311
+ e2(this._innerWindow());
312
+ });
313
+ }
314
+ _doWhenInnerApiLoaded(e2) {
315
+ this._doWhenInnerWindowLoaded((t2) => {
316
+ t2.doWhenApiIsReady(() => e2(this._innerAPI()));
317
+ });
318
+ }
319
+ _autoResizeChart() {
320
+ this._options.fullscreen && (this._iFrame.style.height = window.innerHeight + "px");
321
+ }
322
+ _create() {
323
+ const e2 = this._render();
324
+ this._options.container_id && console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");
325
+ const t2 = this._options.container_id || this._options.container, i2 = "string" == typeof t2 ? document.getElementById(t2) : t2;
326
+ if (null === i2) throw new Error(`There is no such element - #${this._options.container}`);
327
+ i2.innerHTML = e2, this._iFrame = i2.querySelector(`#${this._id}`);
328
+ const n2 = this._iFrame;
329
+ (this._options.autosize || this._options.fullscreen) && (n2.style.width = "100%", this._options.fullscreen || (n2.style.height = "100%")), window.addEventListener("resize", this._onWindowResize), this._onWindowResize(), this._innerWindowLoaded = new Promise((e3) => {
330
+ const t3 = () => {
331
+ n2.removeEventListener("load", t3, false), e3();
332
+ };
333
+ n2.addEventListener("load", t3, false);
334
+ }), this._innerWindowLoaded.then(() => {
335
+ this._innerWindow().widgetReady(() => {
336
+ this._ready = true;
337
+ for (const e3 of this._readyHandlers) try {
338
+ e3.call(this);
339
+ } catch (e4) {
340
+ console.error(e4);
341
+ }
342
+ this._innerWindow().initializationFinished();
347
343
  });
348
- }
349
- _render() {
350
- const e2 = window;
351
- if (e2[this._id] = { datafeed: this._options.datafeed, customFormatters: this._options.custom_formatters || this._options.customFormatters, brokerFactory: this._options.broker_factory || this._options.brokerFactory, overrides: this._options.overrides, studiesOverrides: this._options.studies_overrides, tradingCustomization: this._options.trading_customization, disabledFeatures: this._options.disabled_features, enabledFeatures: this._options.enabled_features, brokerConfig: this._options.broker_config || this._options.brokerConfig, restConfig: this._options.restConfig, favorites: this._options.favorites, logo: this._options.logo, numeric_formatting: this._options.numeric_formatting, rss_news_feed: this._options.rss_news_feed, newsProvider: this._options.news_provider, loadLastChart: this._options.load_last_chart, saveLoadAdapter: this._options.save_load_adapter, loading_screen: this._options.loading_screen, settingsAdapter: this._options.settings_adapter, getCustomIndicators: this._options.custom_indicators_getter, additionalSymbolInfoFields: this._options.additional_symbol_info_fields, headerWidgetButtonsMode: this._options.header_widget_buttons_mode, symbolSearchComplete: this._options.symbol_search_complete }, this._options.saved_data) e2[this._id].chartContent = { json: this._options.saved_data }, this._options.saved_data_meta_info && (e2[this._id].chartContentExtendedData = this._options.saved_data_meta_info);
352
- else if (!this._options.load_last_chart && !this._options.symbol) throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");
353
- const t2 = (this._options.library_path || "") + `${encodeURIComponent(this._options.locale)}-tv-chart.f0bc1e45.html#symbol=` + encodeURIComponent(this._options.symbol || "") + "&interval=" + encodeURIComponent(this._options.interval) + (this._options.timeframe ? "&timeframe=" + encodeURIComponent(this._options.timeframe) : "") + (this._options.toolbar_bg ? "&toolbarbg=" + encodeURIComponent(this._options.toolbar_bg.replace("#", "")) : "") + (this._options.studies_access ? "&studiesAccess=" + encodeURIComponent(JSON.stringify(this._options.studies_access)) : "") + "&widgetbar=" + encodeURIComponent(JSON.stringify(this._options.widgetbar)) + (this._options.drawings_access ? "&drawingsAccess=" + encodeURIComponent(JSON.stringify(this._options.drawings_access)) : "") + "&timeFrames=" + encodeURIComponent(JSON.stringify(this._options.time_frames)) + "&locale=" + encodeURIComponent(this._options.locale) + "&uid=" + encodeURIComponent(this._id) + "&clientId=" + encodeURIComponent(String(this._options.client_id)) + "&userId=" + encodeURIComponent(String(this._options.user_id)) + (this._options.charts_storage_url ? "&chartsStorageUrl=" + encodeURIComponent(this._options.charts_storage_url) : "") + (this._options.charts_storage_api_version ? "&chartsStorageVer=" + encodeURIComponent(this._options.charts_storage_api_version) : "") + (this._options.custom_css_url ? "&customCSS=" + encodeURIComponent(this._options.custom_css_url) : "") + (this._options.auto_save_delay ? "&autoSaveDelay=" + encodeURIComponent(String(this._options.auto_save_delay)) : "") + "&debug=" + encodeURIComponent(String(this._options.debug)) + (this._options.snapshot_url ? "&snapshotUrl=" + encodeURIComponent(this._options.snapshot_url) : "") + (this._options.timezone ? "&timezone=" + encodeURIComponent(this._options.timezone) : "") + (this._options.study_count_limit ? "&studyCountLimit=" + encodeURIComponent(String(this._options.study_count_limit)) : "") + (this._options.symbol_search_request_delay ? "&ssreqdelay=" + encodeURIComponent(String(this._options.symbol_search_request_delay)) : "") + (this._options.compare_symbols ? "&compareSymbols=" + encodeURIComponent(JSON.stringify(this._options.compare_symbols)) : "") + (this._options.theme ? "&theme=" + encodeURIComponent(String(this._options.theme)) : "") + (this._options.header_widget_buttons_mode ? "&header_widget_buttons_mode=" + encodeURIComponent(String(this._options.header_widget_buttons_mode)) : "") + (this._options.time_scale ? "&time_scale=" + encodeURIComponent(JSON.stringify(this._options.time_scale)) : "");
354
- return '<iframe id="' + this._id + '" name="' + this._id + '" src="' + t2 + '"' + (this._options.autosize || this._options.fullscreen ? "" : ' width="' + this._options.width + '" height="' + this._options.height + '"') + ' title="Financial Chart" frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen style="display:block;"></iframe>';
355
- }
356
- };
357
- window.TradingView = window.TradingView || {}, window.TradingView.version = s, e.version = s, e.widget = r, Object.defineProperty(e, "__esModule", { value: true });
358
- });
344
+ });
345
+ }
346
+ _render() {
347
+ const e2 = window;
348
+ if (e2[this._id] = { datafeed: this._options.datafeed, customFormatters: this._options.custom_formatters || this._options.customFormatters, brokerFactory: this._options.broker_factory || this._options.brokerFactory, overrides: this._options.overrides, studiesOverrides: this._options.studies_overrides, tradingCustomization: this._options.trading_customization, disabledFeatures: this._options.disabled_features, enabledFeatures: this._options.enabled_features, brokerConfig: this._options.broker_config || this._options.brokerConfig, restConfig: this._options.restConfig, favorites: this._options.favorites, logo: this._options.logo, numeric_formatting: this._options.numeric_formatting, rss_news_feed: this._options.rss_news_feed, newsProvider: this._options.news_provider, loadLastChart: this._options.load_last_chart, saveLoadAdapter: this._options.save_load_adapter, loading_screen: this._options.loading_screen, settingsAdapter: this._options.settings_adapter, getCustomIndicators: this._options.custom_indicators_getter, additionalSymbolInfoFields: this._options.additional_symbol_info_fields, headerWidgetButtonsMode: this._options.header_widget_buttons_mode, symbolSearchComplete: this._options.symbol_search_complete }, this._options.saved_data) e2[this._id].chartContent = { json: this._options.saved_data }, this._options.saved_data_meta_info && (e2[this._id].chartContentExtendedData = this._options.saved_data_meta_info);
349
+ else if (!this._options.load_last_chart && !this._options.symbol) throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");
350
+ const t2 = (this._options.library_path || "") + `${encodeURIComponent(this._options.locale)}-tv-chart.f0bc1e45.html#symbol=` + encodeURIComponent(this._options.symbol || "") + "&interval=" + encodeURIComponent(this._options.interval) + (this._options.timeframe ? "&timeframe=" + encodeURIComponent(this._options.timeframe) : "") + (this._options.toolbar_bg ? "&toolbarbg=" + encodeURIComponent(this._options.toolbar_bg.replace("#", "")) : "") + (this._options.studies_access ? "&studiesAccess=" + encodeURIComponent(JSON.stringify(this._options.studies_access)) : "") + "&widgetbar=" + encodeURIComponent(JSON.stringify(this._options.widgetbar)) + (this._options.drawings_access ? "&drawingsAccess=" + encodeURIComponent(JSON.stringify(this._options.drawings_access)) : "") + "&timeFrames=" + encodeURIComponent(JSON.stringify(this._options.time_frames)) + "&locale=" + encodeURIComponent(this._options.locale) + "&uid=" + encodeURIComponent(this._id) + "&clientId=" + encodeURIComponent(String(this._options.client_id)) + "&userId=" + encodeURIComponent(String(this._options.user_id)) + (this._options.charts_storage_url ? "&chartsStorageUrl=" + encodeURIComponent(this._options.charts_storage_url) : "") + (this._options.charts_storage_api_version ? "&chartsStorageVer=" + encodeURIComponent(this._options.charts_storage_api_version) : "") + (this._options.custom_css_url ? "&customCSS=" + encodeURIComponent(this._options.custom_css_url) : "") + (this._options.auto_save_delay ? "&autoSaveDelay=" + encodeURIComponent(String(this._options.auto_save_delay)) : "") + "&debug=" + encodeURIComponent(String(this._options.debug)) + (this._options.snapshot_url ? "&snapshotUrl=" + encodeURIComponent(this._options.snapshot_url) : "") + (this._options.timezone ? "&timezone=" + encodeURIComponent(this._options.timezone) : "") + (this._options.study_count_limit ? "&studyCountLimit=" + encodeURIComponent(String(this._options.study_count_limit)) : "") + (this._options.symbol_search_request_delay ? "&ssreqdelay=" + encodeURIComponent(String(this._options.symbol_search_request_delay)) : "") + (this._options.compare_symbols ? "&compareSymbols=" + encodeURIComponent(JSON.stringify(this._options.compare_symbols)) : "") + (this._options.theme ? "&theme=" + encodeURIComponent(String(this._options.theme)) : "") + (this._options.header_widget_buttons_mode ? "&header_widget_buttons_mode=" + encodeURIComponent(String(this._options.header_widget_buttons_mode)) : "") + (this._options.time_scale ? "&time_scale=" + encodeURIComponent(JSON.stringify(this._options.time_scale)) : "");
351
+ return '<iframe id="' + this._id + '" name="' + this._id + '" src="' + t2 + '"' + (this._options.autosize || this._options.fullscreen ? "" : ' width="' + this._options.width + '" height="' + this._options.height + '"') + ' title="Financial Chart" frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen style="display:block;"></iframe>';
352
+ }
353
+ };
354
+ window.TradingView = window.TradingView || {}, window.TradingView.version = o;
359
355
 
360
356
  // src/components/helpers.js
361
357
  var import_react = require("react");
@@ -386,7 +382,7 @@ function getAllSymbols(symbol) {
386
382
  });
387
383
  }
388
384
  });
389
- } catch (e) {
385
+ } catch (e2) {
390
386
  return newSymbols;
391
387
  }
392
388
  return newSymbols;
@@ -408,8 +404,8 @@ function setupSockets(subRequest) {
408
404
  socket.onerror = (error) => {
409
405
  console.log("[socket] Error:", error);
410
406
  };
411
- socket.onmessage = (e) => {
412
- const data = JSON.parse(e.data);
407
+ socket.onmessage = (e2) => {
408
+ const data = JSON.parse(e2.data);
413
409
  if (data.e == void 0) {
414
410
  return;
415
411
  }
@@ -706,7 +702,7 @@ var TVChartContainer = ({
706
702
  "mainSeriesProperties.barStyle.dontDrawOpen": false
707
703
  }
708
704
  };
709
- const tvWidget = new (void 0)(widgetOptions);
705
+ const tvWidget = new s(widgetOptions);
710
706
  tvWidget.onChartReady(() => {
711
707
  tvWidget.subscribe("onTick", (event) => onTick && onTick(event));
712
708
  setWidgetState(tvWidget);