varOS;!function(t){lete;!function(e){leti;!function(e){classiextendst.GUI.BasicDialog{constructor(){super("OwnerDialog",i.scheme)}main(){if(super.main(),this.oview=this.find("ownview"),!this.data.dbhandle)thrownewError(__("Unable to get owner data handle").__());returnthis.oview.buttons=[{text:"",iconclass:"fa fa-plus-circle",onbtclick:asynct=>{try{constt=awaitthis.openDialog("PromptDialog",{title:__("Owner"),label:__("Name")});this.data.dbhandle.cache={name:t};conste=awaitthis.data.dbhandle.write(void0);if(e.error)thrownewError(e.error);awaitthis.owner_refresh()}catch(t){this.error(t.toString(),t)}}},{text:"",iconclass:"fa fa-minus-circle",onbtclick:asynct=>{try{constt=this.oview.selectedItem;if(!t)return;if(!awaitthis.ask({text:__("Do you realy want to delete: `{0}`",t.data.text)}))return;conste=t.data.$vfs;leti=awaite.remove();if(i.error)thrownewError(i.error.toString());awaitthis.owner_refresh()}catch(t){this.error(t.toString(),t)}}},{text:"",iconclass:"fa fa-pencil-square-o",onbtclick:asynct=>{try{constt=this.oview.selectedItem;if(!t)return;conste=awaitthis.openDialog("PromptDialog",{title:__("Owner"),label:__("Name"),value:t.data.name}),i=t.data.$vfs;i.cache={name:e};consta=awaiti.write(void0);if(a.error)thrownewError(a.error.toString());awaitthis.owner_refresh()}catch(t){this.error(t.toString(),t)}}}],this.owner_refresh()}asyncowner_refresh(){constt=awaitthis.data.dbhandle.read();for(leteoft)e.text=e.name;this.oview.data=t}}e.OwnerDialog=i,i.scheme="<afx-app-window width='200' height='300'>\n <afx-vbox>\n <afx-list-view data-id=\"ownview\"></afx-list-view>\n </afx-vbox>\n</afx-app-window> ";classaextendst.GUI.BasicDialog{constructor(){super("DocDialog",a.scheme)}main(){lett;super.main(),this.flist=this.find("file-list"),this.dlist=this.find("dlist"),this.mlist=this.find("mlist"),this.ylist=this.find("ylist"),this.olist=this.find("olist");conste=this.parent;`sqlite://${e.setting.docpath.asFileHandle().genealogy.join("/")}/docify.db@owners`.asFileHandle().read().then(t=>{if(t.error)returnthis.error(t.error);for(leteoft)e.text=e.name,e.selected=this.data&&this.data.oid===e.id;returnthis.olist.data=t,this.olist.selectedItem?void0:this.olist.selected=0}).catch(t=>this.error(__("Unable to fetch owner list: {0}",t.toString()),t)),this.dlist.push({text:"None",value:0});leti=0;for(t=1;t<=31;t++)this.dlist.push({text:""+t,value:t}),this.data&&parseInt(this.data.day)===t&&(i=t);for(this.dlist.selected=i,this.mlist.push({text:"None",value:0}),i=0,t=1;t<=12;t++)this.mlist.push({text:""+t,value:t}),this.data&&parseInt(this.data.month)===t&&(i=t);this.mlist.selected=i,this.ylist.push({text:"None",value:0}),this.ylist.selected=0;for(lett=1960,e=(newDate).getFullYear(),i=1960<=e;i?t<=e:t>=e;i?t++:t--)this.ylist.push({text:""+t,value:t,selected:this.data&&parseInt(this.data.year)===t});if(this.flist.buttons=[{text:"",iconclass:"fa fa-plus-circle",onbtclick:t=>this.openDialog(newr,{app:e}).then(t=>(t.text=t.filename,this.flist.push(t)))},{text:"",iconclass:"fa fa-minus-circle",onbtclick:t=>{conste=this.flist.selectedItem;if(e)returnthis.flist.delete(e)}}],this.flist.onlistselect=asynct=>awaite.preview(t.data.item.data.path,this.find("preview-canvas")),this.find("btsave").onbtclick=t=>{conste={name:this.find("title").value.trim(),day:this.dlist.selectedItem.data.value,month:this.mlist.selectedItem.data.value,year:this.ylist.selectedItem.data.value,file:Array.from(this.flist.data).map(t=>t.path),note:this.find("note").value.trim(),tags:this.find("tag").value.trim(),oid:parseInt(this.olist.selectedItem.data.id)};returne.name&&""!==e.title?e.file.length>0?(this.handle&&this.handle(e),this.quit()):this.notify(__("Please attach files to the entry")):this.notify(__("Please enter title"))},!this.data)return;this.find("title").value=this.data.name,this.find("note").value=this.data.note,this.find("tag").value=this.data.tags;consta=this.data.file.asFileHandle();returna.text=a.filename,this.flist.data=[a]}}e.DocDialog=a,a.scheme='<afx-app-window width=\'6