(window.webpackJsonp = window.webpackJsonp || []).push([ ['take-chart-image-dialog-impl'], { '1O6C': function (e, t, n) { 'use strict'; n.d(t, 'a', function () { return p; }); var o = n('mrSG'), r = n('q1tI'), i = n('TSYQ'), s = n('+EG+'), a = n('jAh7'), c = n('QpNh'), l = n('aYmi'), p = (function (e) { function t() { var t = (null !== e && e.apply(this, arguments)) || this; return ( (t._manager = new a.OverlapManager()), (t._handleSlot = function (e) { t._manager.setContainer(e); }), t ); } return ( Object(o.__extends)(t, e), (t.prototype.render = function () { var e = this.props, t = e.rounded, n = void 0 === t || t, a = e.shadowed, p = void 0 === a || a, d = e.fullscreen, u = void 0 !== d && d, m = e.darker, h = void 0 !== m && m, v = e.className, w = e.backdrop, f = i( v, l.dialog, n && l.rounded, p && l.shadowed, u && l.fullscreen, h && l.darker, ), _ = Object(c.a)(this.props); return r.createElement( r.Fragment, null, r.createElement( s.b.Provider, { value: this._manager }, w && r.createElement('div', { className: l.backdrop }), r.createElement( 'div', Object(o.__assign)({}, _, { className: f, style: this._createStyles(), ref: this.props.reference, onFocus: this.props.onFocus, onMouseDown: this.props.onMouseDown, onMouseUp: this.props.onMouseUp, onClick: this.props.onClick, onKeyDown: this.props.onKeyDown, tabIndex: -1, }), this.props.children, ), ), r.createElement(s.a, { reference: this._handleSlot }), ); }), (t.prototype._createStyles = function () { var e = this.props, t = e.bottom, n = e.left, o = e.width; return { bottom: t, left: n, right: e.right, top: e.top, zIndex: e.zIndex, maxWidth: o, height: e.height, }; }), t ); })(r.PureComponent); }, '8MIK': function (e, t, n) { e.exports = { modal: 'modal-C2LSTwhC', content: 'content-tr28wPlV', form: 'form-2GifjSKe', copyForm: 'copyForm-1HuPoKA0', copyBtn: 'copyBtn-1oB8tEqo', shadow: 'shadow-2JTdO0Fb', actions: 'actions-3fKk-h7d', link: 'link-1alPBTTQ', socials: 'socials-rht5Uvp-', icon: 'icon-4wFj5iyU', socialsText: 'socialsText-2yWFq9iu', }; }, BHQn: function (e, t) { e.exports = ''; }, GyvH: function (e, t) { e.exports = ''; }, Iivm: function (e, t, n) { 'use strict'; Object.defineProperty(t, '__esModule', { value: !0 }), n('mrSG').__exportStar(n('swCq'), t); }, RgaO: function (e, t, n) { 'use strict'; n.d(t, 'a', function () { return i; }); var o = n('mrSG'), r = n('8Rai'); function i(e) { var t = e.children, n = Object(o.__rest)(e, ['children']); return t(Object(r.a)(n)); } }, UJLh: function (e, t, n) { e.exports = { wrap: 'wrap-3axdIL2R', container: 'container-p3zks2PX', backdrop: 'backdrop-1qZHPwi_', modal: 'modal-GUK9cvUQ', dialog: 'dialog-2Ei1ngXh', }; }, aYmi: function (e, t, n) { e.exports = { dialog: 'dialog-2APwxL3O', rounded: 'rounded-tXI9mwGE', shadowed: 'shadowed-2M13-xZa', fullscreen: 'fullscreen-2RqU2pqU', darker: 'darker-2nhdv2oS', backdrop: 'backdrop-1tKdKmN_', }; }, fMMV: function (e, t, n) { 'use strict'; n.r(t); n('YFKU'); var o = n('Wt0y'), r = n('mrSG'), i = (n('HbRj'), n('Kxc7')), s = n('BHQF'); function a(e, t, n, o) { return ( void 0 === o && (o = {}), Object(r.__awaiter)(this, void 0, void 0, function () { var a, c, l, p, d, u, m; return Object(r.__generator)(this, function (h) { if (((a = new FormData()), void 0 !== o.previews)) for (c = 0, l = o.previews; c < l.length; c++) (p = l[c]), a.append('previews[]', p); return ( void 0 !== o.cme && a.append('cme', String(o.cme)), void 0 !== o.wl && a.append('wl', String(o.wl)), void 0 !== o.onWidget && a.append('onWidget', String(o.onWidget)), o.isReport && a.append('isReport', String(o.isReport)), (d = window.urlParams) && d.locale && a.append('language', d.locale), (u = e.activeChartWidget.value()), void 0 !== (m = u.widgetCustomer()) && a.append('customer', m), a.append('timezone', u.properties().childs().timezone.value()), a.append('images', JSON.stringify(e.images())), (function (e, t, n, o) { void 0 === o && (o = {}); Object(r.__awaiter)(this, void 0, void 0, function () { var a, c, l; return Object(r.__generator)(this, function (r) { switch (r.label) { case 0: (a = i.enabled('charting_library_base') ? o.snapshotUrl || 'https://www.tradingview.com/snapshot/' : '/snapshot/'), (r.label = 1); case 1: return ( r.trys.push([1, 4, , 5]), [ 4, Object(s.fetch)(a, { body: e, method: 'POST', credentials: 'same-origin', }), ] ); case 2: return [4, (c = r.sent()).text()]; case 3: return (l = r.sent()), c.ok ? t(l) : n(), [3, 5]; case 4: return r.sent(), n(), [3, 5]; case 5: return [2]; } }); }); })(a, t, n, o), [2] ); }); }) ); } var c, l = n('PC8g'), p = n('q1tI'), d = n('i8i4'), u = n('TSYQ'), m = n('1O6C'), h = n('uqKQ'), v = n('RgaO'), w = n('UJLh'), f = (function (e) { function t() { return (null !== e && e.apply(this, arguments)) || this; } return ( Object(r.__extends)(t, e), (t.prototype.render = function () { var e = this, t = this.props, n = t.zIndex, o = t.onClickOutside, i = t.children, s = t.className; return p.createElement( 'div', { style: { zIndex: n } }, p.createElement('div', { className: w.backdrop }), p.createElement( 'div', { className: w.wrap }, p.createElement( 'div', { className: w.container }, p.createElement( v.a, { mouseDown: !0, touchStart: !0, handler: o }, function (t) { return p.createElement( 'div', { className: w.modal, ref: t }, p.createElement( m.a, Object(r.__assign)({}, e.props, { className: u(s, w.dialog), }), i, ), ); }, ), ), ), ); }), (t.defaultProps = { width: 500 }), t ); })(p.PureComponent), _ = Object(h.a)(f), g = n('AVTG'), b = n('Iivm'), y = n('L0Sj'), O = n('oj21'), E = n('jPOK'); !(function (e) { function t(e, t) { return 'cme' === TradingView.widgetCustomer ? t + ' from cmegroup.com via @tradingview $' + e : '#' + e + ' chart ' + t + ' via https://www.tradingview.com'; } function n(e, t) { void 0 === e && (e = 'about:blank'), void 0 === t && (t = 'snapshot_tweet'); var n = Math.round(screen.width / 2 - 275), o = Math.round(screen.height / 2 - 210); return window.open( e, t, 'scrollbars=yes,resizable=yes,toolbar=no,location=yes,\n\t\t\t\twidth=550,height=420,\n\t\t\t\tleft=' + n + ',top=' + o, ); } (e.getStatus = t), (e.shareSnapshot = function (e) { var o = n(); return { onFailure: function () { o.close(); }, onSuccess: function (n) { o.location.href = (function (e, n) { return ( 'https://twitter.com/intent/tweet?&text=' + encodeURIComponent( t( e, (function (e) { return ( window.location.protocol + '//' + window.location.host + '/x/' + e + '/' ); })(n), ), ) ); })(e, n); }, }; }), (e.shareSnapshotInstantly = function (e, o) { n( (function (e, n) { return ( 'https://twitter.com/intent/tweet?&text=' + encodeURIComponent(t(e, n)) ); })(e, o), ); }); })(c || (c = {})); var C = n('ycI/'), S = n('Ialn'), k = n('FQhm'), I = n('ZjKI'), x = n('8MIK'), U = n('BHQn'), j = n('GyvH'), N = (function (e) { function t(t) { var n = e.call(this, t) || this; return ( (n._input = null), (n._hideMessages = function () { n.setState({ message: '', error: '' }); }), (n._setInput = function (e) { n._input = e; }), (n._select = function () { null !== n._input && n._input.select(); }), (n._shareTwitter = function () { c.shareSnapshotInstantly( n.props.symbol || '', n.props.imageUrl || '', ); }), (n._onClose = function () { n.props.onClose && n.props.onClose(), (n._copyBtn = null); }), (n.state = { message: t.message, error: t.error }), n ); } return ( Object(r.__extends)(t, e), (t.prototype.componentDidMount = function () { k.subscribe( I.CLOSE_POPUPS_AND_DIALOGS_COMMAND, this._onClose, null, ); }), (t.prototype.componentWillUnmount = function () { k.unsubscribe( I.CLOSE_POPUPS_AND_DIALOGS_COMMAND, this._onClose, null, ); }), (t.prototype.componentWillReceiveProps = function (e) { this.setState({ message: e.message, error: e.error }); }), (t.prototype.componentDidUpdate = function (e) { var t = this; !e.imageUrl && this.props.imageUrl && setTimeout(function () { null !== t._input && (t._input.select(), t._input.focus()); }); }), (t.prototype.render = function () { var e = this, t = this.props.imageUrl, n = this.state, o = n.message, r = n.error, i = !t && !this.props.message && !this.props.error, s = u(x.copyBtn, !Object(S.isRtl)() && x.shadow); return p.createElement( _, { isOpened: this.props.isOpened, className: x.modal, onClickOutside: this._onClose, 'data-dialog-type': 'take-snapshot-modal', }, p.createElement( g.b, { onClose: this._onClose }, window.t('Image URL'), ), o && p.createElement(g.c, { text: o, isError: !1, onClickOutside: this._hideMessages, }), r && p.createElement(g.c, { text: r, isError: !0, onClickOutside: this._hideMessages, }), p.createElement( g.a, null, p.createElement(C.a, { keyCode: 27, handler: this._onClose }), p.createElement( 'div', { className: x.content }, i && p.createElement(E.a, { size: 'mini' }), p.createElement( 'div', { className: x.form, style: { visibility: t ? 'visible' : 'hidden' }, }, p.createElement( 'div', { className: x.copyForm }, p.createElement(y.b, { reference: this._setInput, readOnly: !0, value: t || '', onClick: this._select, onFocus: this._select, strictLeftDirectionInput: Object(S.isRtl)(), style: Object(S.isRtl)() ? { paddingLeft: 84 } : void 0, }), p.createElement( 'div', { ref: function (t) { return t && e._setupClipboard(t); }, 'data-clipboard-text': t, className: s, }, p.createElement( O.a, { type: 'primary', theme: 'ghost' }, window.t('Copy'), ), ), ), p.createElement( 'div', { className: x.actions }, p.createElement( 'a', { className: x.link, href: t, target: '_blank' }, p.createElement(b.Icon, { icon: j }), p.createElement('span', null, window.t('Save image')), ), p.createElement( 'span', { className: x.socials, onClick: this._shareTwitter }, p.createElement(b.Icon, { className: x.icon, icon: U, }), p.createElement( 'span', { className: x.socialsText }, window.t('Tweet'), ), ), ), ), ), ), ); }), (t.prototype._setupClipboard = function (e) { var t = this; this._copyBtn || ((this._copyBtn = e), n .e('clipboard') .then( function (o) { var r = new (n('sxGJ'))(e); r.on('success', function () { TradingView.trackEvent('GUI', 'Copied Image Link'), t.setState({ message: window.t('Copied to clipboard'), }); }), r.on('error', function () { t.setState({ message: window.t( "Sorry, the Copy Link button doesn't work in your browser. Please select the link and copy it manually.", ), }); }); }.bind(null, n), ) .catch(void 0)); }), (t.defaultProps = { imageUrl: '' }), t ); })(p.Component); function M(e, t, n) { var r; function s(e) { r || ((r = document.createElement('div')), document.body.appendChild(r)), d.render(p.createElement(N, e), r); } function c() { s({ isOpened: !1 }); } void 0 === t && (t = {}), Object(l.trackEvent)('GUI', 'Get image button'), s({ isOpened: !1 }), a( e, function (r) { n && n(r); s({ isOpened: !0, onClose: c, imageUrl: i.enabled('charting_library_base') ? (t.snapshotUrl ? '' : 'https://www.tradingview.com/x/') + r : Object(o.isProd)() ? 'https://www.tradingview.com/x/' + r + '/' : window.location.protocol + '//' + window.location.host + '/x/' + r + '/', symbol: e.activeChartWidget.value().symbolProperty().value(), }); }, function () { s({ isOpened: !0, onClose: c, error: window.t('URL cannot be received'), }); }, { onWidget: e.onWidget, snapshotUrl: t.snapshotUrl, onInvalidSnapshotImage: c, }, ), s({ isOpened: !0, onClose: c }); } function P(e, t, n) { a( e, function (e) { n && n(e); }, function () { console.warn(window.t('Error while trying to create snapshot.')); }, { snapshotUrl: t.snapshotUrl }, ); } n.d(t, 'getImageOfChart', function () { return M; }), n.d(t, 'getImageOfChartSilently', function () { return P; }); }, jPOK: function (e, t, n) { 'use strict'; n.d(t, 'a', function () { return s; }); var o = n('q1tI'), r = n('TSYQ'), i = n('Owlf'); n('SzKR'); function s(e) { var t = r( 'tv-spinner', 'tv-spinner--shown', 'tv-spinner--size_' + (e.size || i.a), ); return o.createElement( 'div', { className: t, style: e.style, role: 'progressbar' }, o.createElement( 'div', { className: 'tv-spinner__spinner-layer' }, o.createElement('div', { className: 'tv-spinner__background tv-spinner__width_element', }), o.createElement('div', { className: 'tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--left', }), o.createElement('div', { className: 'tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--right', }), ), ); } }, swCq: function (e, t, n) { 'use strict'; Object.defineProperty(t, '__esModule', { value: !0 }); var o = n('mrSG'), r = n('q1tI'); t.Icon = r.forwardRef(function (e, t) { var n = e.icon, i = void 0 === n ? '' : n, s = o.__rest(e, ['icon']); return r.createElement( 'span', o.__assign({}, s, { ref: t, dangerouslySetInnerHTML: { __html: i } }), ); }); }, uqKQ: function (e, t, n) { 'use strict'; n.d(t, 'a', function () { return s; }); var o = n('mrSG'), r = n('q1tI'), i = n('AiMB'); function s(e) { return (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(o.__extends)(n, t), (n.prototype.render = function () { var t = this.props, n = t.isOpened, s = t.root; if (!n) return null; var a = r.createElement( e, Object(o.__assign)({}, this.props, { zIndex: 150 }), ); return 'parent' === s ? a : r.createElement(i.a, null, a); }), n ); })(r.PureComponent); } }, }, ]);