binbot-charts 0.6.0 → 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.
@@ -20,15 +20,15 @@ var __async = (__this, __arguments, generator) => {
20
20
  var fulfilled = (value) => {
21
21
  try {
22
22
  step(generator.next(value));
23
- } catch (e) {
24
- reject(e);
23
+ } catch (e2) {
24
+ reject(e2);
25
25
  }
26
26
  };
27
27
  var rejected = (value) => {
28
28
  try {
29
29
  step(generator.throw(value));
30
- } catch (e) {
31
- reject(e);
30
+ } catch (e2) {
31
+ reject(e2);
32
32
  }
33
33
  };
34
34
  var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
@@ -39,303 +39,299 @@ var __async = (__this, __arguments, generator) => {
39
39
  // src/components/TVChartContainer.tsx
40
40
  import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
41
41
 
42
- // src/charting_library/charting_library.js
43
- !function(e, t) {
44
- "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 = {});
45
- }(void 0, function(e) {
46
- "use strict";
47
- function t(e2, i2) {
48
- const n2 = __spreadValues({}, e2);
49
- 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]);
50
- return n2;
51
- }
52
- 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: [] } };
53
- let o = false;
54
- function s() {
55
- return "CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)";
56
- }
57
- const r = class {
58
- constructor(e2) {
59
- 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");
60
- if (this._options = t(n, e2), e2.preset) {
61
- const t2 = i[e2.preset];
62
- 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 + "`");
63
- }
64
- "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();
65
- }
66
- onChartReady(e2) {
67
- this._ready ? e2.call(this) : this._readyHandlers.push(e2);
68
- }
69
- headerReady() {
70
- return this._innerWindowLoaded.then(() => this._innerWindow().headerReady());
71
- }
72
- onGrayedObjectClicked(e2) {
73
- this._doWhenInnerApiLoaded((t2) => {
74
- t2.onGrayedObjectClicked(e2);
75
- });
76
- }
77
- onShortcut(e2, t2) {
78
- this._doWhenInnerWindowLoaded((i2) => {
79
- i2.createShortcutAction(e2, t2);
80
- });
81
- }
82
- subscribe(e2, t2) {
83
- this._doWhenInnerApiLoaded((i2) => {
84
- i2.subscribe(e2, t2);
85
- });
86
- }
87
- unsubscribe(e2, t2) {
88
- this._doWhenInnerApiLoaded((i2) => {
89
- i2.unsubscribe(e2, t2);
90
- });
91
- }
92
- chart(e2) {
93
- return this._innerAPI().chart(e2);
94
- }
95
- getLanguage() {
96
- return this._options.locale;
97
- }
98
- setSymbol(e2, t2, i2) {
99
- this._innerAPI().changeSymbol(e2, t2, i2);
100
- }
101
- remove() {
102
- 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);
103
- }
104
- closePopupsAndDialogs() {
105
- this._doWhenInnerApiLoaded((e2) => {
106
- e2.closePopupsAndDialogs();
107
- });
108
- }
109
- selectLineTool(e2) {
110
- this._innerAPI().selectLineTool(e2);
111
- }
112
- selectedLineTool() {
113
- return this._innerAPI().selectedLineTool();
114
- }
115
- save(e2) {
116
- this._innerAPI().saveChart(e2);
117
- }
118
- load(e2, t2) {
119
- this._innerAPI().loadChart({ json: e2, extendedData: t2 });
120
- }
121
- getSavedCharts(e2) {
122
- this._innerAPI().getSavedCharts(e2);
123
- }
124
- loadChartFromServer(e2) {
125
- this._innerAPI().loadChartFromServer(e2);
126
- }
127
- saveChartToServer(e2, t2, i2) {
128
- this._innerAPI().saveChartToServer(e2, t2, i2);
129
- }
130
- removeChartFromServer(e2, t2) {
131
- this._innerAPI().removeChartFromServer(e2, t2);
132
- }
133
- onContextMenu(e2) {
134
- this._doWhenInnerApiLoaded((t2) => {
135
- t2.onContextMenu(e2);
136
- });
137
- }
138
- createButton(e2) {
139
- return this._innerWindow().createButton(e2);
140
- }
141
- createDropdown(e2) {
142
- return this._innerWindow().createDropdown(e2);
143
- }
144
- showNoticeDialog(e2) {
145
- this._doWhenInnerApiLoaded((t2) => {
146
- t2.showNoticeDialog(e2);
147
- });
148
- }
149
- showConfirmDialog(e2) {
150
- this._doWhenInnerApiLoaded((t2) => {
151
- t2.showConfirmDialog(e2);
152
- });
153
- }
154
- showLoadChartDialog() {
155
- this._innerAPI().showLoadChartDialog();
156
- }
157
- showSaveAsChartDialog() {
158
- this._innerAPI().showSaveAsChartDialog();
159
- }
160
- symbolInterval() {
161
- return this._innerAPI().getSymbolInterval();
162
- }
163
- mainSeriesPriceFormatter() {
164
- return this._innerAPI().mainSeriesPriceFormatter();
165
- }
166
- getIntervals() {
167
- return this._innerAPI().getIntervals();
168
- }
169
- getStudiesList() {
170
- return this._innerAPI().getStudiesList();
171
- }
172
- getStudyInputs(e2) {
173
- return this._innerAPI().getStudyInputs(e2);
174
- }
175
- addCustomCSSFile(e2) {
176
- this._innerWindow().addCustomCSSFile(e2);
177
- }
178
- applyOverrides(e2) {
179
- this._options = t(this._options, { overrides: e2 }), this._doWhenInnerWindowLoaded((t2) => {
180
- t2.applyOverrides(e2);
181
- });
182
- }
183
- applyStudiesOverrides(e2) {
184
- this._doWhenInnerWindowLoaded((t2) => {
185
- t2.applyStudiesOverrides(e2);
186
- });
187
- }
188
- watchList() {
189
- return this._innerAPI().watchlist();
190
- }
191
- news() {
192
- return this._innerAPI().news();
193
- }
194
- activeChart() {
195
- return this._innerAPI().activeChart();
196
- }
197
- chartsCount() {
198
- return this._innerAPI().chartsCount();
199
- }
200
- layout() {
201
- return this._innerAPI().layout();
202
- }
203
- setLayout(e2) {
204
- this._innerAPI().setLayout(e2);
205
- }
206
- layoutName() {
207
- return this._innerAPI().layoutName();
208
- }
209
- changeTheme(e2, t2) {
210
- return this._innerWindow().changeTheme(e2, t2);
211
- }
212
- getTheme() {
213
- return this._innerWindow().getTheme();
214
- }
215
- takeScreenshot() {
216
- this._doWhenInnerApiLoaded((e2) => {
217
- e2.takeScreenshot();
218
- });
219
- }
220
- lockAllDrawingTools() {
221
- return this._innerAPI().lockAllDrawingTools();
222
- }
223
- hideAllDrawingTools() {
224
- return this._innerAPI().hideAllDrawingTools();
225
- }
226
- drawOnAllCharts(e2) {
227
- this._innerAPI().drawOnAllCharts(e2);
228
- }
229
- magnetEnabled() {
230
- return this._innerAPI().magnetEnabled();
231
- }
232
- magnetMode() {
233
- return this._innerAPI().magnetMode();
234
- }
235
- undoRedoState() {
236
- return this._innerAPI().undoRedoState();
237
- }
238
- setIntervalLinkingEnabled(e2) {
239
- this._innerAPI().setIntervalLinkingEnabled(e2);
240
- }
241
- setTimeFrame(e2) {
242
- this._innerAPI().setTimeFrame(e2);
243
- }
244
- symbolSync() {
245
- return this._innerAPI().symbolSync();
246
- }
247
- intervalSync() {
248
- return this._innerAPI().intervalSync();
249
- }
250
- crosshairSync() {
251
- return this._innerAPI().crosshairSync();
252
- }
253
- timeSync() {
254
- return this._innerAPI().timeSync();
255
- }
256
- getAllFeatures() {
257
- return this._innerWindow().getAllFeatures();
258
- }
259
- clearUndoHistory() {
260
- return this._innerAPI().clearUndoHistory();
261
- }
262
- undo() {
263
- return this._innerAPI().undo();
264
- }
265
- redo() {
266
- return this._innerAPI().redo();
267
- }
268
- startFullscreen() {
269
- this._innerAPI().startFullscreen();
270
- }
271
- exitFullscreen() {
272
- this._innerAPI().exitFullscreen();
273
- }
274
- takeClientScreenshot(e2) {
275
- return this._innerAPI().takeClientScreenshot(e2);
276
- }
277
- navigationButtonsVisibility() {
278
- return this._innerWindow().getNavigationButtonsVisibility();
279
- }
280
- paneButtonsVisibility() {
281
- return this._innerWindow().getPaneButtonsVisibility();
282
- }
283
- dateFormat() {
284
- return this._innerWindow().getDateFormat();
285
- }
286
- _innerAPI() {
287
- return this._innerWindow().tradingViewApi;
288
- }
289
- _innerWindow() {
290
- return this._iFrame.contentWindow;
291
- }
292
- _doWhenInnerWindowLoaded(e2) {
293
- this._ready ? e2(this._innerWindow()) : this._innerWindowLoaded.then(() => {
294
- e2(this._innerWindow());
295
- });
296
- }
297
- _doWhenInnerApiLoaded(e2) {
298
- this._doWhenInnerWindowLoaded((t2) => {
299
- t2.doWhenApiIsReady(() => e2(this._innerAPI()));
300
- });
301
- }
302
- _autoResizeChart() {
303
- this._options.fullscreen && (this._iFrame.style.height = window.innerHeight + "px");
304
- }
305
- _create() {
306
- const e2 = this._render();
307
- this._options.container_id && console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");
308
- const t2 = this._options.container_id || this._options.container, i2 = "string" == typeof t2 ? document.getElementById(t2) : t2;
309
- if (null === i2) throw new Error(`There is no such element - #${this._options.container}`);
310
- i2.innerHTML = e2, this._iFrame = i2.querySelector(`#${this._id}`);
311
- const n2 = this._iFrame;
312
- (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) => {
313
- const t3 = () => {
314
- n2.removeEventListener("load", t3, false), e3();
315
- };
316
- n2.addEventListener("load", t3, false);
317
- }), this._innerWindowLoaded.then(() => {
318
- this._innerWindow().widgetReady(() => {
319
- this._ready = true;
320
- for (const e3 of this._readyHandlers) try {
321
- e3.call(this);
322
- } catch (e4) {
323
- console.error(e4);
324
- }
325
- this._innerWindow().initializationFinished();
326
- });
42
+ // src/charting_library/charting_library.esm.js
43
+ function e(t2, i2) {
44
+ const n2 = __spreadValues({}, t2);
45
+ 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]);
46
+ return n2;
47
+ }
48
+ 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: [] } };
49
+ 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: [] } };
50
+ var n = false;
51
+ function o() {
52
+ return "CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)";
53
+ }
54
+ var s = class {
55
+ constructor(o2) {
56
+ 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");
57
+ if (this._options = e(i, o2), o2.preset) {
58
+ const e2 = t[o2.preset];
59
+ 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 + "`");
60
+ }
61
+ "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();
62
+ }
63
+ onChartReady(e2) {
64
+ this._ready ? e2.call(this) : this._readyHandlers.push(e2);
65
+ }
66
+ headerReady() {
67
+ return this._innerWindowLoaded.then(() => this._innerWindow().headerReady());
68
+ }
69
+ onGrayedObjectClicked(e2) {
70
+ this._doWhenInnerApiLoaded((t2) => {
71
+ t2.onGrayedObjectClicked(e2);
72
+ });
73
+ }
74
+ onShortcut(e2, t2) {
75
+ this._doWhenInnerWindowLoaded((i2) => {
76
+ i2.createShortcutAction(e2, t2);
77
+ });
78
+ }
79
+ subscribe(e2, t2) {
80
+ this._doWhenInnerApiLoaded((i2) => {
81
+ i2.subscribe(e2, t2);
82
+ });
83
+ }
84
+ unsubscribe(e2, t2) {
85
+ this._doWhenInnerApiLoaded((i2) => {
86
+ i2.unsubscribe(e2, t2);
87
+ });
88
+ }
89
+ chart(e2) {
90
+ return this._innerAPI().chart(e2);
91
+ }
92
+ getLanguage() {
93
+ return this._options.locale;
94
+ }
95
+ setSymbol(e2, t2, i2) {
96
+ this._innerAPI().changeSymbol(e2, t2, i2);
97
+ }
98
+ remove() {
99
+ 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);
100
+ }
101
+ closePopupsAndDialogs() {
102
+ this._doWhenInnerApiLoaded((e2) => {
103
+ e2.closePopupsAndDialogs();
104
+ });
105
+ }
106
+ selectLineTool(e2) {
107
+ this._innerAPI().selectLineTool(e2);
108
+ }
109
+ selectedLineTool() {
110
+ return this._innerAPI().selectedLineTool();
111
+ }
112
+ save(e2) {
113
+ this._innerAPI().saveChart(e2);
114
+ }
115
+ load(e2, t2) {
116
+ this._innerAPI().loadChart({ json: e2, extendedData: t2 });
117
+ }
118
+ getSavedCharts(e2) {
119
+ this._innerAPI().getSavedCharts(e2);
120
+ }
121
+ loadChartFromServer(e2) {
122
+ this._innerAPI().loadChartFromServer(e2);
123
+ }
124
+ saveChartToServer(e2, t2, i2) {
125
+ this._innerAPI().saveChartToServer(e2, t2, i2);
126
+ }
127
+ removeChartFromServer(e2, t2) {
128
+ this._innerAPI().removeChartFromServer(e2, t2);
129
+ }
130
+ onContextMenu(e2) {
131
+ this._doWhenInnerApiLoaded((t2) => {
132
+ t2.onContextMenu(e2);
133
+ });
134
+ }
135
+ createButton(e2) {
136
+ return this._innerWindow().createButton(e2);
137
+ }
138
+ createDropdown(e2) {
139
+ return this._innerWindow().createDropdown(e2);
140
+ }
141
+ showNoticeDialog(e2) {
142
+ this._doWhenInnerApiLoaded((t2) => {
143
+ t2.showNoticeDialog(e2);
144
+ });
145
+ }
146
+ showConfirmDialog(e2) {
147
+ this._doWhenInnerApiLoaded((t2) => {
148
+ t2.showConfirmDialog(e2);
149
+ });
150
+ }
151
+ showLoadChartDialog() {
152
+ this._innerAPI().showLoadChartDialog();
153
+ }
154
+ showSaveAsChartDialog() {
155
+ this._innerAPI().showSaveAsChartDialog();
156
+ }
157
+ symbolInterval() {
158
+ return this._innerAPI().getSymbolInterval();
159
+ }
160
+ mainSeriesPriceFormatter() {
161
+ return this._innerAPI().mainSeriesPriceFormatter();
162
+ }
163
+ getIntervals() {
164
+ return this._innerAPI().getIntervals();
165
+ }
166
+ getStudiesList() {
167
+ return this._innerAPI().getStudiesList();
168
+ }
169
+ getStudyInputs(e2) {
170
+ return this._innerAPI().getStudyInputs(e2);
171
+ }
172
+ addCustomCSSFile(e2) {
173
+ this._innerWindow().addCustomCSSFile(e2);
174
+ }
175
+ applyOverrides(t2) {
176
+ this._options = e(this._options, { overrides: t2 }), this._doWhenInnerWindowLoaded((e2) => {
177
+ e2.applyOverrides(t2);
178
+ });
179
+ }
180
+ applyStudiesOverrides(e2) {
181
+ this._doWhenInnerWindowLoaded((t2) => {
182
+ t2.applyStudiesOverrides(e2);
183
+ });
184
+ }
185
+ watchList() {
186
+ return this._innerAPI().watchlist();
187
+ }
188
+ news() {
189
+ return this._innerAPI().news();
190
+ }
191
+ activeChart() {
192
+ return this._innerAPI().activeChart();
193
+ }
194
+ chartsCount() {
195
+ return this._innerAPI().chartsCount();
196
+ }
197
+ layout() {
198
+ return this._innerAPI().layout();
199
+ }
200
+ setLayout(e2) {
201
+ this._innerAPI().setLayout(e2);
202
+ }
203
+ layoutName() {
204
+ return this._innerAPI().layoutName();
205
+ }
206
+ changeTheme(e2, t2) {
207
+ return this._innerWindow().changeTheme(e2, t2);
208
+ }
209
+ getTheme() {
210
+ return this._innerWindow().getTheme();
211
+ }
212
+ takeScreenshot() {
213
+ this._doWhenInnerApiLoaded((e2) => {
214
+ e2.takeScreenshot();
215
+ });
216
+ }
217
+ lockAllDrawingTools() {
218
+ return this._innerAPI().lockAllDrawingTools();
219
+ }
220
+ hideAllDrawingTools() {
221
+ return this._innerAPI().hideAllDrawingTools();
222
+ }
223
+ drawOnAllCharts(e2) {
224
+ this._innerAPI().drawOnAllCharts(e2);
225
+ }
226
+ magnetEnabled() {
227
+ return this._innerAPI().magnetEnabled();
228
+ }
229
+ magnetMode() {
230
+ return this._innerAPI().magnetMode();
231
+ }
232
+ undoRedoState() {
233
+ return this._innerAPI().undoRedoState();
234
+ }
235
+ setIntervalLinkingEnabled(e2) {
236
+ this._innerAPI().setIntervalLinkingEnabled(e2);
237
+ }
238
+ setTimeFrame(e2) {
239
+ this._innerAPI().setTimeFrame(e2);
240
+ }
241
+ symbolSync() {
242
+ return this._innerAPI().symbolSync();
243
+ }
244
+ intervalSync() {
245
+ return this._innerAPI().intervalSync();
246
+ }
247
+ crosshairSync() {
248
+ return this._innerAPI().crosshairSync();
249
+ }
250
+ timeSync() {
251
+ return this._innerAPI().timeSync();
252
+ }
253
+ getAllFeatures() {
254
+ return this._innerWindow().getAllFeatures();
255
+ }
256
+ clearUndoHistory() {
257
+ return this._innerAPI().clearUndoHistory();
258
+ }
259
+ undo() {
260
+ return this._innerAPI().undo();
261
+ }
262
+ redo() {
263
+ return this._innerAPI().redo();
264
+ }
265
+ startFullscreen() {
266
+ this._innerAPI().startFullscreen();
267
+ }
268
+ exitFullscreen() {
269
+ this._innerAPI().exitFullscreen();
270
+ }
271
+ takeClientScreenshot(e2) {
272
+ return this._innerAPI().takeClientScreenshot(e2);
273
+ }
274
+ navigationButtonsVisibility() {
275
+ return this._innerWindow().getNavigationButtonsVisibility();
276
+ }
277
+ paneButtonsVisibility() {
278
+ return this._innerWindow().getPaneButtonsVisibility();
279
+ }
280
+ dateFormat() {
281
+ return this._innerWindow().getDateFormat();
282
+ }
283
+ _innerAPI() {
284
+ return this._innerWindow().tradingViewApi;
285
+ }
286
+ _innerWindow() {
287
+ return this._iFrame.contentWindow;
288
+ }
289
+ _doWhenInnerWindowLoaded(e2) {
290
+ this._ready ? e2(this._innerWindow()) : this._innerWindowLoaded.then(() => {
291
+ e2(this._innerWindow());
292
+ });
293
+ }
294
+ _doWhenInnerApiLoaded(e2) {
295
+ this._doWhenInnerWindowLoaded((t2) => {
296
+ t2.doWhenApiIsReady(() => e2(this._innerAPI()));
297
+ });
298
+ }
299
+ _autoResizeChart() {
300
+ this._options.fullscreen && (this._iFrame.style.height = window.innerHeight + "px");
301
+ }
302
+ _create() {
303
+ const e2 = this._render();
304
+ this._options.container_id && console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");
305
+ const t2 = this._options.container_id || this._options.container, i2 = "string" == typeof t2 ? document.getElementById(t2) : t2;
306
+ if (null === i2) throw new Error(`There is no such element - #${this._options.container}`);
307
+ i2.innerHTML = e2, this._iFrame = i2.querySelector(`#${this._id}`);
308
+ const n2 = this._iFrame;
309
+ (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) => {
310
+ const t3 = () => {
311
+ n2.removeEventListener("load", t3, false), e3();
312
+ };
313
+ n2.addEventListener("load", t3, false);
314
+ }), this._innerWindowLoaded.then(() => {
315
+ this._innerWindow().widgetReady(() => {
316
+ this._ready = true;
317
+ for (const e3 of this._readyHandlers) try {
318
+ e3.call(this);
319
+ } catch (e4) {
320
+ console.error(e4);
321
+ }
322
+ this._innerWindow().initializationFinished();
327
323
  });
328
- }
329
- _render() {
330
- const e2 = window;
331
- 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);
332
- 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");
333
- 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)) : "");
334
- 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>';
335
- }
336
- };
337
- window.TradingView = window.TradingView || {}, window.TradingView.version = s, e.version = s, e.widget = r, Object.defineProperty(e, "__esModule", { value: true });
338
- });
324
+ });
325
+ }
326
+ _render() {
327
+ const e2 = window;
328
+ 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);
329
+ 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");
330
+ 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)) : "");
331
+ 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>';
332
+ }
333
+ };
334
+ window.TradingView = window.TradingView || {}, window.TradingView.version = o;
339
335
 
340
336
  // src/components/helpers.js
341
337
  import { useEffect, useRef } from "react";
@@ -366,7 +362,7 @@ function getAllSymbols(symbol) {
366
362
  });
367
363
  }
368
364
  });
369
- } catch (e) {
365
+ } catch (e2) {
370
366
  return newSymbols;
371
367
  }
372
368
  return newSymbols;
@@ -388,8 +384,8 @@ function setupSockets(subRequest) {
388
384
  socket.onerror = (error) => {
389
385
  console.log("[socket] Error:", error);
390
386
  };
391
- socket.onmessage = (e) => {
392
- const data = JSON.parse(e.data);
387
+ socket.onmessage = (e2) => {
388
+ const data = JSON.parse(e2.data);
393
389
  if (data.e == void 0) {
394
390
  return;
395
391
  }
@@ -477,7 +473,6 @@ function unsubscribeFromStream(subscriberUID) {
477
473
  var getConfigurationData = () => __async(void 0, null, function* () {
478
474
  return {
479
475
  supports_marks: true,
480
- supports_time: true,
481
476
  supports_timescale_marks: true,
482
477
  supports_time: true,
483
478
  supported_resolutions: [
@@ -530,7 +525,6 @@ var Datafeed = class {
530
525
  }
531
526
  const symbolInfo = () => {
532
527
  return {
533
- ticker: symbolName,
534
528
  name: symbolName,
535
529
  ticker: symbolName,
536
530
  description: symbolName,
@@ -688,7 +682,7 @@ var TVChartContainer = ({
688
682
  "mainSeriesProperties.barStyle.dontDrawOpen": false
689
683
  }
690
684
  };
691
- const tvWidget = new (void 0)(widgetOptions);
685
+ const tvWidget = new s(widgetOptions);
692
686
  tvWidget.onChartReady(() => {
693
687
  tvWidget.subscribe("onTick", (event) => onTick && onTick(event));
694
688
  setWidgetState(tvWidget);