(window.webpackJsonp=window.webpackJsonp||[]).push([["load-chart-dialog"],{"0HKD":function(t,e,i){t.exports={"css-value-list-dialog-item-height":"30px"}},Ald9:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>'},E5yG:function(t,e,i){"use strict";function o(t){return t.replace(a,c)}function n(t,e,i){return null===i?t:t.filter(function(t){return function(t,e,i){return Object.values(i(t)).some(function(t){return e.test(t)})}(t,i,e)})}function s(t){return{title:t.title,symbol:t.symbol}}function r(t){switch(t){case"title":return function(t,e){return t.title.localeCompare(e.title)};case"symbol":return function(t,e){return t.symbol.localeCompare(e.symbol)};case"modified":return function(t,e){return e.modified-t.modified};default:return function(t,e){return t.title.localeCompare(e.title)}}}var l,a,c,d,u,_,h,p,g,f,v,m,w,y,b,j,S,O,C,L,D,I,x,T,A,F,N,R,E,M,B,H,k,q,z;i.r(e),l=i("mrSG"),i("YFKU"),i("HbRj"),a=/[<"'&>]/g,c=function(t){return"&#"+t.charCodeAt(0)+";"},d=i("BxxN"),u=i("pPtI"),_=i("ldgD"),h=i.n(_),p=i("Eyy1"),g=i("Vdly"),f=i("YDhE"),v=i("dTSQ"),m=i("oNDq"),w=i("UIZs"),y=i("TzTt"),b=i("0HKD"),j=parseInt(b["css-value-list-dialog-item-height"]),S=i("uo4K"),O=i("HHbT"),C=i("GWvR"),L=i("rMPu"),D=i("YTOR"),I=window.t("Add to favorites"),x=window.t("Remove from favorites"),T=window.t("Search"),A=function(){function t(t,e){var i=this;this._itemsData=[],this._itemsToRender=[],this._sortMap=null,this._currentSortObj=null,this._itemsCount=0,this._searchRegexp=null,this._dialog=null,this._fieldsExtractorFunc=null,this._isConfirmDialogOpen=!1,this._tvSettingsName=t,this._content=Object(y.b)('<div class="'+L["list-dialog"]+'" id="'+e+'">\n\t\t\t<div class="js-content-search"></div>\n\t\t\t<div class="'+L["list-dialog__sort-wrap"]+'">\n\t\t\t\t<div class="'+L["list-dialog__sort-box"]+' js-content-sort"></div>\n\t\t\t</div>\n\t\t\t<div class="'+L["list-dialog__items-list-container"]+' js-content-body"></div>\n\t\t</div>'),this._contentSearch=Object(p.ensureNotNull)(this._content.querySelector(".js-content-search")),this._contentSort=Object(p.ensureNotNull)(this._content.querySelector(".js-content-sort")),this._contentBody=Object(p.ensureNotNull)(this._content.querySelector(".js-content-body")),this._contentBody.addEventListener("scroll",function(t){return i._scrollHandler(t)},!1)}return t.prototype._setItemsData=function(t){this._itemsData=t},t.prototype._getItemsData=function(){return this._itemsData},t.prototype._setSortMap=function(t){this._sortMap=t},t.prototype._makeItemTemplate=function(t,e,i,n){
var s,r,l,a,c,d,u,_,h,p,g=this,f=t.isActive,v=t.isFavorite,w=t.columns,b=t.url,j=t.id,D=v?L["list-dialog__favorite-icon--starred"]:"",T=f?L["list-dialog__row--item-active"]:"",A="";for(s=0,r=Object.values(w);s<r.length;s++)l=r[s],A+='<div class="'+L["list-dialog__column"]+'">\n\t\t\t\t'+l+"\n\t\t\t</div>";return b?A=function(t,e){return'<a href="'+t+'" class="'+L["list-dialog__columns-row"]+' js-item-link">'+e+"</a>"}(b,A):(c=A,A='<div class="'+L["list-dialog__columns-row"]+'">'+c+"</div>"),(a=Object(y.b)('<div class="'+L["list-dialog__row"]+" "+L["list-dialog__row--item"]+" "+T+" "+D+' js-item" data-id="'+j+'">\n\t\t\t'+(h=(_=v)?O:C,p=_?x:I,'<div class="'+L["list-dialog__favorite-icon"]+' js-favs" title="'+p+'">\n\t\t'+h+"\n\t</div>")+"\n\t\t\t"+A+"\n\t\t\t"+(u=(d=n)?'title="'+d+'"':"",'<div class="'+L["list-dialog__remove-icon"]+' js-remove-button" '+u+">\n\t\t"+S+"\n\t</div>")+"\n\t\t</div>")).addEventListener("click",function(t){t.defaultPrevented||(e.open(),t.preventDefault())}),a.querySelector(".js-remove-button").addEventListener("click",function(t){g._isConfirmDialogOpen=!0;!function(t,e,i){Object(m.createConfirmDialog)({content:o(t)}).then(function(t){t.on("action:yes",function(){e(),t.close()}),t.on("afterClose",function(){return i()}),t.open()})}(i,function(){e.delete().then(function(){return g._removeItem(j)})},function(){g._isConfirmDialogOpen=!1}),t.preventDefault()}),a.querySelector(".js-favs").addEventListener("click",function(t){e.favorite(),g._render(),t.preventDefault()}),a},t.prototype._prepareHighlight=function(t,e){var i,o,n,s,r;if(null!==this._searchRegexp){for(i in t)if(t[i]){if(o=t[i],null===(n=this._searchRegexp.exec(o)))continue;for(s="",r=1;r<n.length;r++)s+=r%2?'<span class="'+D["i-match"]+'">$'+r+"</span>":"$"+r;t[i]=o.replace(this._searchRegexp,s)}e.columns=Object.assign(e.columns,t)}},t.prototype._showDialog=function(t,e,i,o){var n=this;0===e.length?this._emptyList(t.dialogEmpty):(this._setItemsToRender(e),this._initSearch(e,o),this._prepareSort(),this._initHeader(i),this._render()),this._dialog=Object(f.createDialog)({title:t.dialogTitle,width:600,height:550,content:this._content,contentWrapTemplate:"<div>",destroyOnClose:!0,withScroll:!1,isClickOutFn:function(){return!n._isConfirmDialogOpen&&void 0}}),this._dialog.open()},t.prototype._render=function(){this._contentBody.innerHTML="",this._sortList(this._isFavorite.bind(this)),this._renderWithOffset(this._getItemsToRender(),0,this._getMinShownItems())},t.prototype._makeActive=function(t){var e,i=this._contentBody.querySelector(".js-item."+L["list-dialog__row--item-active"]);null!==i&&i.classList.remove(L["list-dialog__row--item-active"]),null!==(e=this._contentBody.querySelector(".js-item[data-id='"+t+"']"))&&e.classList.add(L["list-dialog__row--item-active"])},t.prototype._removeItem=function(t){var e,i;this._filterItems(t),e=this._getItemsData(),this._setItemsToRender(e),null!==(i=this._contentBody.querySelector(".js-item[data-id='"+t+"']"))&&this._contentBody.removeChild(i)},t.prototype._setItemsToRender=function(t){
this._itemsToRender=t},t.prototype._getItemsToRender=function(){return this._itemsToRender},t.prototype._getCurrentSortObj=function(){return this._currentSortObj},t.prototype._emptyList=function(t){this._contentBody.innerHTML='<div class="'+L["list-dialog__empty-list"]+'">'+t+"</div>"},t.prototype._sortList=function(t){var e,i,o,n,s,r=[],l=[];for(e=0,i=this._getItemsToRender();e<i.length;e++)t(o=i[e])?r.push(o):l.push(o);(n=this._getCurrentSortObj())&&(s=n.getPredicate(),l.sort(s),r.sort(s)),this._setItemsToRender(r.concat(l))},t.prototype._prepareSort=function(){var t=this._getSortData();this._currentSortObj=this._getSort(t.sortField),this._currentSortObj&&this._currentSortObj.setIsAscending(t.isAscending)},t.prototype._getMinShownItems=function(){return Math.min(this._itemsCount+50,this._getItemsToRender().length)},t.prototype._renderWithOffset=function(t,e,i){var o,n,s=document.createDocumentFragment();for(o=e;o<i;o++)n=this._renderItem(t[o]),s.appendChild(n);this._contentBody.appendChild(s),this._itemsCount+=50},t.prototype._getSort=function(t){var e=Object(p.ensureNotNull)(this._sortMap).get(t);return e||null},t.prototype._getSortData=function(){return{sortField:g.getValue(this._tvSettingsName+".sort.field",this._defaultSort.sortField),isAscending:g.getBool(this._tvSettingsName+".sort.asc",this._defaultSort.isAscending)}},t.prototype._filterItems=function(t){this._itemsData=this._itemsData.filter(function(e){return e.id!==t})},t.prototype._setSort=function(t){var e=this._currentSortObj,i=this._getSort(t);i===e&&this._currentSortObj?this._currentSortObj.inverse():this._currentSortObj=i,g.setValue(this._tvSettingsName+".sort.field",t),g.setValue(this._tvSettingsName+".sort.asc",Object(p.ensureNotNull)(this._currentSortObj).isAscending())},t.prototype._search=function(t){this._searchRegexp=0!==t.length?function(t){var e=t.split("").map(function(t){return Object(v.regExpEscape)(t)}).join(")(.*?)(");return new RegExp("("+e+")","i")}(t):null;var e=n(this._getItemsData(),Object(p.ensureNotNull)(this._fieldsExtractorFunc),this._searchRegexp);this._setItemsToRender(e),this._resetScroll(),this._render()},t.prototype._initSearch=function(t,e){this._fieldsExtractorFunc=e;var i=Object(w.createSearchControl)({placeholder:T});i.inputChangedDelegate.subscribe(this,this._search),this._contentSearch.appendChild(i.$control[0])},t.prototype._initHeader=function(t){var e,i,o,n,s,r,l,a,c,d=this,u=this._getSortData(),_=L["list-dialog__column--header-active"],h=u.isAscending?"":"i-dropped",p="";for(e=0,i=Object.entries(t);e<i.length;e++)n=(o=i[e])[0],s=o[1],r=n===u.sortField?_:"",p+='<div class="'+L["list-dialog__column"]+" "+L["list-dialog__column--header"]+" "+r+" "+h+' js-column" data-sort="'+n+'">\n\t\t\t\t'+s+'\n\t\t\t\t<span class="tv-caret '+L["list-dialog__column--caret"]+'"></span>\n\t\t\t</div>';for(l=Object(y.b)('<div class="'+L["list-dialog__row"]+" "+L["list-dialog__row--header"]+'">\n\t\t\t'+p+"\n\t\t</div>"),this._contentSort.appendChild(l),a=0,
c=Array.from(l.querySelectorAll(".js-column"));a<c.length;a++)c[a].addEventListener("click",function(t){var e,i=t.target,o=i.dataset.sort;o&&d._setSort(o),0!==(e=l.getElementsByClassName(_)).length&&e[0].classList.remove(_),i.classList.add(_),i.classList.toggle("i-dropped",!d._getSortData().isAscending),d._resetScroll(),d._render()})},t.prototype._scrollHandler=function(t){var e=t.target;e.clientHeight+e.scrollTop>=e.scrollHeight-j/2&&this._renderWithOffset(this._getItemsToRender(),this._itemsCount,this._getMinShownItems())},t.prototype._disableContextMenu=function(){this._content.addEventListener("contextmenu",function(t){var e,i=t.target.parentElement;null!==i&&((e=i)&&e.classList.contains("js-item-link"))||t.preventDefault()})},t.prototype._resetScroll=function(){this._itemsCount=0,this._contentBody.scrollTop=0},t}(),F=function(){function t(t){this._isAscending=!1,this._sortingFunc=t}return t.prototype.getPredicate=function(){var t=this;return function(e,i){var o=t._sortingFunc(e,i);return t._isAscending&&(o*=-1),o}},t.prototype.inverse=function(){this._isAscending=!this._isAscending},t.prototype.setIsAscending=function(t){this._isAscending=t},t.prototype.isAscending=function(){return this._isAscending},t}(),i.d(e,"LoadChartDialog",function(){return z}),N=window.t("Load Chart Layout"),R=window.t("Delete chart layout"),E=window.t("Multiple charts"),M=window.t("Last Modified"),B=window.t("Active Symbol"),H=window.t("Chart Layout Name"),k=window.t("There are no saved charts"),q=window.t("Do you really want to delete Chart Layout '{0}' ?"),z=function(t){function e(e,i){var o,n,l,a=t.call(this,"loadChartDialog","load-chart-dialog")||this;return a._defaultSort={sortField:"modified",isAscending:!1},a._favorites=[],(o=new Map).set("title",new F(r("title"))),o.set("modified",new F(r("modified"))),o.set("symbol",new F(r("symbol"))),a._setSortMap(o),e.forEach(function(t){var e;t.symbol=0!==(e=t).symbol.length?e.symbol+", "+Object(u.getTranslatedResolution)(e.interval):E}),n={title:H,modified:M,symbol:B},l={dialogTitle:N,dialogEmpty:k},a._setFavorites(i),a._setItemsData(e),a._showDialog(l,e,n,s),a}return l.__extends(e,t),e.prototype._isFavorite=function(t){return this._favorites.hasOwnProperty(t.id)},e.prototype._renderItem=function(t){var e,i,n=this,r=t.id,l=t.active,a=t.url,c=t.title,u=t.modified,_=t.symbol,p={id:r,isActive:l(),isFavorite:this._isFavorite(t),url:Object(d.a)({chartId:a}),columns:{title:o(c),modified:(i=u,h.a.unix(i).format("l LT")),symbol:o(_)}},g={open:function(){t.openAction(),n._makeActive(r)},delete:function(){return t.deleteAction()},favorite:function(){n._setItemFavorite(t.id,!n._isFavorite(t)),n._filterFavorites(),t.favoriteAction(n._getFavorites())}};return this._prepareHighlight(s(t),p),e=q.format(c),this._makeItemTemplate(p,g,e,R)},e.prototype._setFavorites=function(t){this._favorites=t},e.prototype._getFavorites=function(){return this._favorites},e.prototype._setItemFavorite=function(t,e){e?this._favorites[t]=e:delete this._favorites[t]},e.prototype._filterFavorites=function(){
var t=this,e=this._getItemsData(),i={};e.forEach(function(e){t._isFavorite(e)&&(i[e.id]=!0)}),this._setFavorites(i)},e}(A)},EulZ:function(t,e,i){},"G0+C":function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18px" height="18px"><path fill-rule="evenodd" d="M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"/></svg>'},GWvR:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M9.901 9.639c-.102-.797.218-1.775.77-2.356l1.438-1.527-2.07-.395c-.784-.142-1.615-.742-2.008-1.446L7.003 2.06 5.97 3.917c-.391.702-1.222 1.301-2 1.443l-2.08.396 1.44 1.526c.547.577.866 1.549.77 2.353l-.262 2.086 1.93-.897a2.95 2.95 0 0 1 1.233-.254c.44 0 .87.085 1.233.254l1.93.897-.263-2.082zm.992-.127l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},HHbT:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M10.893 9.512l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},UIZs:function(t,e,i){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(t){var e,i,n,s=$(d);return t.addClass&&s.addClass(t.addClass),t.withoutControls&&s.addClass("tv-search-row--without-controls"),e=s.find(".js-input-control"),i=s.find(".js-reset-button"),t.placeholder&&e.attr("placeholder",t.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new r.a,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:s,$input:e,inputChangedDelegate:n}}var s,r,l,a,c,d;i.r(e),i.d(e,"createSearchControl",function(){return n}),s=i("aIyQ"),r=i.n(s),l=i("Ald9"),a=i("G0+C"),c=i("EulZ"),d='<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">'+l+'</span><span class="tv-search-row__search-icon">'+a+"</span></div>"},YTOR:function(t,e,i){t.exports={"i-match":"i-match-2pyl0dCc-"}},
qoI1:function(t,e,i){function o(t){var e=n(t);return i(e)}function n(t){var e,i=s[t];if(!(i+1))throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e;return i}var s={"./en-gb":"Oaa7","./en-gb.js":"Oaa7","./es":"iYuL","./es.js":"iYuL","./it":"bpih","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./ko":"Ivi+","./ko.js":"Ivi+","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ru":"lXzo","./ru.js":"lXzo","./tr":"DoHr","./tr.js":"DoHr"};o.keys=function(){return Object.keys(s)},o.resolve=n,t.exports=o,o.id="qoI1"},rMPu:function(t,e,i){t.exports={"css-value-list-dialog-item-height":"30px","list-dialog":"list-dialog-1sgWMCbw-","list-dialog__items-list-container":"list-dialog__items-list-container-3udN82S7-","list-dialog__columns-row":"list-dialog__columns-row-3aXi_jqm-","list-dialog__empty-list":"list-dialog__empty-list-3-j_iMIA-","list-dialog__sort-wrap":"list-dialog__sort-wrap-1I15ultt-","list-dialog__sort-box":"list-dialog__sort-box-YtT0TZlJ-","list-dialog__row":"list-dialog__row-2uvnOH0w-","list-dialog__row--header":"list-dialog__row--header-3X78INHz-","list-dialog__row--item":"list-dialog__row--item-JC8p2W7Z-","list-dialog__row--item-active":"list-dialog__row--item-active-1KBCgO8t-","list-dialog__column":"list-dialog__column-19ZOQoKP-","list-dialog__column--header":"list-dialog__column--header-3SOUE3EQ-","list-dialog__column--header-active":"list-dialog__column--header-active-g3V-G5Px-","list-dialog__column--caret":"list-dialog__column--caret-UwNizK99-","list-dialog__favorite-icon":"list-dialog__favorite-icon-D64HiVDN-","list-dialog__remove-icon":"list-dialog__remove-icon-2jI_v983-","list-dialog__favorite-icon--starred":"list-dialog__favorite-icon--starred-3YY_YpZL-"}}}]);