(function(){var t,e,i;(t=class t extends this.OS.GUI.BasicDialog{constructor(){super("ClientDialog",t.scheme)}main(){var t,e,i,n;if(super.main(),e=$(this.scheme).find("input[type=text]"),this.data)for(i=0,n=e.length;ithis.quit(),this.find("btnok").onbtclick=i=>{var n,s,a;for(n={},s=0,a=e.length;s\n \n \n \n
\n \n \n
\n
\n \n \n
\n
\n',(e=class e extends this.OS.GUI.BasicDialog{constructor(){super("ClientListDialog",e.scheme)}refresh_list(){return this.clist.data=this.parent.setting.clients.map(t=>({text:t.text,url:t.url}))}main(){return super.main(),this.clist=this.find("client-list"),this.clist.buttons=[{text:"",iconclass:"fa fa-plus-circle",onbtclick:e=>this.openDialog(new t,{title:__("Add new client")}).then(t=>(console.log(t),this.parent.setting.clients.push(t),this.clist.data=this.parent.setting.clients.map((t,e)=>({text:t.text,url:t.url}))))},{text:"",iconclass:"fa fa-minus-circle",onbtclick:t=>{var e,i;if(i=this.clist.selectedItem,e=this.clist.selected,i)return this.ask({text:__("Do you realy want to delete: `{0}`",i.data.text)}).then(t=>{if(t)return this.parent.setting.clients.splice(e,1),this.refresh_list()})}},{text:"",iconclass:"fa fa-pencil-square-o",onbtclick:e=>{var i,n;if(n=this.clist.selectedItem,i=this.clist.selected,n)return this.openDialog(new t,{title:__("Edit client"),text:n.data.text,url:n.data.url}).then(t=>{if(t)return this.parent.setting.clients[i].text=t.text,this.parent.setting.clients[i].url=t.url,this.refresh_list()})}}],this.find("btnswitch").onbtclick=t=>{var e;if(e=this.clist.selectedItem)return this.parent.setting.curl=e.data.url,this.parent.setting.cname=e.data.text,this.parent.switchClient(),this.quit()},this.refresh_list()}}).scheme='\n \n \n
\n \n
\n \n',(i=class extends this.OS.application.BaseApplication{constructor(t){super("GPClient",t)}main(){return this.setting.clients||(this.setting.clients=[]),this.container=this.find("container"),this.bindKey("CTRL-M",()=>this.openDialog(new e,{title:__("Client Manager")})),this.switchClient()}switchClient(){return this.setting.curl?(this.container.src=this.setting.curl,this.scheme.apptitle=this.setting.cname):this.notify(__("No client selected, manager client in menu Options > Client manager"))}menu(){return[{text:"__(Options)",nodes:[{text:"__(Client manager)",shortcut:"C-M"}],onchildselect:t=>this.openDialog(new e,{title:__("Client Manager")})}]}}).singleton=!0,this.OS.register("GPClient",i)}).call(this);