"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7648],{57351:(e,t,n)=>{n.r(t),n.d(t,{showThemeSaveDialog:()=>r});var o=n(11542),a=n(3615),l=n(22489),i=n(51768),s=n(51264);function r(e,t,r,u,c){async function h(n){(0,i.trackEvent)("GUI","Themes","Save custom theme"),await(0,l.saveTheme)(n,e),t&&t(n)}(0,a.showRename)({title:o.t(null,void 0,n(79355)),text:o.t(null,void 0,n(59233))+":",maxLength:128,source:r||[],onClose:u,onCancel:c,autocompleteFilter:s.autocompleteFilter,onRename:({newValue:e,focusInput:t,dialogClose:i,innerManager:s})=>new Promise((r=>{(0,l.isThemeExist)(e).then((l=>{if(l){const l=o.t(null,{replace:{themeName:e}},n(41018));(0,a.showConfirm)({text:l,onConfirm:({dialogClose:t})=>{h(e).then((()=>{t(),i()}))},onClose:t},s).then((()=>{r()}))}else h(e).then((()=>{r(),i()}))}))}))})}},51264:(e,t,n)=>{function o(e,t){return Boolean(""===e||e&&-1!==t.toLowerCase().indexOf(e.toLowerCase()))}n.d(t,{autocompleteFilter:()=>o})}}]);