@sync-in/server 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/package.json +2 -3
  4. package/server/app.bootstrap.js +3 -22
  5. package/server/app.bootstrap.js.map +1 -1
  6. package/server/applications/comments/services/comments-queries.service.js +5 -9
  7. package/server/applications/comments/services/comments-queries.service.js.map +1 -1
  8. package/server/applications/users/users.e2e-spec.js +0 -1
  9. package/server/applications/users/users.e2e-spec.js.map +1 -1
  10. package/server/applications/webdav/constants/webdav.js +7 -0
  11. package/server/applications/webdav/constants/webdav.js.map +1 -1
  12. package/server/applications/webdav/utils/bootstrap.js +45 -0
  13. package/server/applications/webdav/utils/bootstrap.js.map +1 -0
  14. package/server/applications/webdav/webdav.controller.js +1 -1
  15. package/server/applications/webdav/webdav.controller.js.map +1 -1
  16. package/server/applications/webdav/webdav.e2e-spec.js +131 -2
  17. package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
  18. package/server/authentication/auth.e2e-spec.js +12 -6
  19. package/server/authentication/auth.e2e-spec.js.map +1 -1
  20. package/server/authentication/guards/auth-basic.guard.spec.js +23 -0
  21. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  22. package/server/authentication/guards/auth-basic.strategy.js +3 -3
  23. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  24. package/server/authentication/guards/auth-digest.strategy.js +32 -11
  25. package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
  26. package/server/authentication/guards/implementations/http-basic.strategy.js +76 -0
  27. package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -0
  28. package/server/authentication/guards/implementations/http-digest.strategy.js +155 -0
  29. package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -0
  30. package/server/authentication/services/auth-manager.service.js +1 -2
  31. package/server/authentication/services/auth-manager.service.js.map +1 -1
  32. package/static/{chunk-XBKCQCBI.js → chunk-2GXOVGTD.js} +1 -1
  33. package/static/{chunk-QHJT5H4M.js → chunk-3MVPXC3U.js} +1 -1
  34. package/static/{chunk-I5SPA4G2.js → chunk-3VRUIWQG.js} +1 -1
  35. package/static/{chunk-L3BIP4AA.js → chunk-3ZBAQTHJ.js} +1 -1
  36. package/static/{chunk-D55YR5X7.js → chunk-76M3BMK6.js} +11 -11
  37. package/static/{chunk-GXWGB7WO.js → chunk-76REYAEA.js} +1 -1
  38. package/static/{chunk-CCZWPM7Q.js → chunk-7HJFIMNF.js} +1 -1
  39. package/static/{chunk-NIR4YE2E.js → chunk-7KAYOR3A.js} +1 -1
  40. package/static/{chunk-O3YLAEVE.js → chunk-AALPWGPB.js} +2 -2
  41. package/static/{chunk-KWFELZTM.js → chunk-CN5YVRFT.js} +1 -1
  42. package/static/{chunk-B6HQYQYG.js → chunk-CVXLHSO5.js} +1 -1
  43. package/static/{chunk-R7PLNX75.js → chunk-D2MLAO5N.js} +1 -1
  44. package/static/{chunk-HGODIZTV.js → chunk-EKWB5W72.js} +1 -1
  45. package/static/{chunk-PQZLR4P3.js → chunk-FTFEQDWH.js} +1 -1
  46. package/static/{chunk-3WZ6F3LC.js → chunk-FWQJ4ZCD.js} +1 -1
  47. package/static/{chunk-FIUF2JM4.js → chunk-IHS5LSJJ.js} +1 -1
  48. package/static/{chunk-G3PL6YX3.js → chunk-J7474P3L.js} +1 -1
  49. package/static/{chunk-LGIVVJDD.js → chunk-JAJ7VXMB.js} +1 -1
  50. package/static/{chunk-T42BV6TR.js → chunk-KEZNIIFH.js} +1 -1
  51. package/static/{chunk-OUHCDDT6.js → chunk-LWSCODLD.js} +1 -1
  52. package/static/{chunk-6WMXMIE4.js → chunk-NIKNG2FX.js} +1 -1
  53. package/static/{chunk-KPOQLDWF.js → chunk-QGHNJVJ6.js} +1 -1
  54. package/static/{chunk-GWRAGN3M.js → chunk-QJ22N76V.js} +1 -1
  55. package/static/{chunk-NJJURHX4.js → chunk-QTPIEEZW.js} +1 -1
  56. package/static/{chunk-ZHOE5VEY.js → chunk-R4VYKZVJ.js} +1 -1
  57. package/static/{chunk-7VRYTDX4.js → chunk-RBTLSPYJ.js} +1 -1
  58. package/static/{chunk-GQHXYX6Z.js → chunk-S44QIK3G.js} +1 -1
  59. package/static/{chunk-45AZ6ZML.js → chunk-S6H2ELRY.js} +1 -1
  60. package/static/{chunk-E32J777S.js → chunk-SPQH3ATC.js} +1 -1
  61. package/static/{chunk-DGCVA6BM.js → chunk-TTWMFWEC.js} +1 -1
  62. package/static/{chunk-ULSPQ3HP.js → chunk-U5E5H2DD.js} +1 -1
  63. package/static/{chunk-LNLBIJZD.js → chunk-VBTZDHZ3.js} +1 -1
  64. package/static/{chunk-I3FR3A45.js → chunk-VZFZUI6D.js} +1 -1
  65. package/static/{chunk-S3TTWPQA.js → chunk-WFMEUST4.js} +1 -1
  66. package/static/{chunk-27Z3SYRL.js → chunk-WRK2FTKU.js} +1 -1
  67. package/static/{chunk-4TPFERL6.js → chunk-WZPF4LS2.js} +1 -1
  68. package/static/{chunk-POUWUMC4.js → chunk-X7NHX5C7.js} +1 -1
  69. package/static/{chunk-XTVNHFKX.js → chunk-XSURUW7C.js} +1 -1
  70. package/static/{chunk-5O66CLTD.js → chunk-XX3JPJUM.js} +1 -1
  71. package/static/{chunk-3RPUQ22U.js → chunk-XZHWESIY.js} +1 -1
  72. package/static/{chunk-3JYMJQYT.js → chunk-ZHUBWKA2.js} +1 -1
  73. package/static/{chunk-XEWLBWFF.js → chunk-ZU5MQTFN.js} +1 -1
  74. package/static/index.html +1 -1
  75. package/static/{main-YKDNJ7LK.js → main-5O3KLGIR.js} +3 -3
@@ -1 +1 @@
1
- import{a as w}from"./chunk-NMF2ZFBE.js";import{h as O}from"./chunk-XTVNHFKX.js";import{c as S,h as v}from"./chunk-RTNEBRKJ.js";import{Cb as M,pb as V,qb as L,rb as d,vb as N}from"./chunk-O3YLAEVE.js";import{d as R}from"./chunk-QHJT5H4M.js";import{Bb as x,Eb as h,Gb as m,He as D,Ia as E,Kd as k,Oa as l,Oe as A,Tb as c,Ub as T,Vb as P,Wa as b,ab as I,ja as p,lb as C,mb as g,oa as u,pa as _,qg as W,rb as f,sb as i,tb as n,ub as y}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function $(o,s){if(o&1&&(i(0,"div",16)(1,"span",3),c(2),n(),i(3,"span",17),c(4),n()()),o&2){let r=m(2);l(2),T(r.infoMsg),l(2),P(":\xA0",r.syncService.wizard.localPath.origin)}}function U(o,s){if(o&1){let r=x();i(0,"div",5)(1,"fa-icon",13),h("click",function(){u(r);let t=m();return _(t.onReset())}),n(),y(2,"img",14),i(3,"div",15),c(4),n(),C(5,$,5,2,"div",16),n()}if(o&2){let r=m();l(),f("icon",r.icons.faTimesCircle),l(),f("src",r.syncService.wizard.localPath.mimeUrl,E),l(2),T(r.syncService.wizard.localPath.path),l(),g(r.infoMsg?5:-1)}}function Y(o,s){if(o&1){let r=x();i(0,"div",18),h("dragleave",function(t){u(r);let a=m();return _(a.dragLeave(t))})("dragover",function(t){u(r);let a=m();return _(a.dragOver(t))})("drop",function(t){u(r);let a=m();return _(a.drop(t))}),i(1,"div",19)(2,"span",20),c(3,"Drop folder here"),n()()()}}var ie=(()=>{let s=class s{constructor(){this.pathIsValid=!1,this.infoMsg=null,this.syncService=p(O),this.icons={faTimesCircle:D,faArrowCircleRight:A},this.router=p(R),this.renderer=p(b),this.store=p(N),this.layout=p(M),this.layout.setBreadcrumbIcon(L.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_CLIENT}/${V.WIZARD_CLIENT}`,splicing:3,translating:!0,sameLink:!0}),this.syncService.wizard.localPath&&this.checkSelection();let e=this.router.currentNavigation()?.extras.state;e?.file&&this.syncService.addFileToRemotePath(e.file)}dragOver(e){return e.preventDefault(),e.dataTransfer.items[0].type?!1:(e.dataTransfer.dropEffect="copy",e.stopPropagation(),e.target.classList.contains("dropzone")&&this.renderer.addClass(e.target,"active"),!0)}dragLeave(e){e.preventDefault(),e.target.classList.contains("dropzone")&&this.renderer.removeClass(e.target,"active")}drop(e){e.preventDefault(),e.stopPropagation();let t=e.dataTransfer.items[0].webkitGetAsEntry();return t&&t.isDirectory?(this.syncService.wizard.localPath={name:t.name,path:this.syncService.getFilePath(e.dataTransfer.files[0]),mimeUrl:v(S),origin:null},this.checkSelection(),!0):!1}onSelect(){this.syncService.showOpenDialog({properties:[w.DIRECTORY,w.CREATE_DIRECTORY],defaultPath:""}).then(e=>{e.canceled||(this.syncService.wizard.localPath={name:e.filePaths[0].split("\\").pop().split("/").pop(),path:e.filePaths[0],mimeUrl:v(S),origin:null},this.checkSelection())})}onReset(){this.syncService.wizard.localPath=null,this.pathIsValid=!1,this.infoMsg=null}onNext(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onCancel(){this.router.navigate([d.BASE,d.PATHS]).catch(console.error),this.syncService.resetWizard()}checkSelection(){let e=this.store.clientSyncPaths().find(t=>new RegExp(`^${t.settings.localPath}((\\/.*)+|\\/?)$`).test(this.syncService.wizard.localPath.path));e?(this.pathIsValid=!1,this.syncService.wizard.localPath.mimeUrl=v(`${S}_sync`),this.syncService.wizard.localPath.origin=e.settings.localPath,this.infoMsg="The parent directory is already synced"):(this.infoMsg=null,this.pathIsValid=!0)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=I({type:s,selectors:[["app-sync-wizard-client"]],decls:22,vars:4,consts:[[1,"wizard"],[1,"d-flex","flex-column","text-center","fs-sm"],["l10nTranslate","",1,"mb-2"],["l10nTranslate",""],[1,"d-flex","flex-column","h-100"],[1,"d-flex","flex-column","my-auto","fs-sm"],[1,"area"],[1,"d-flex","flex-column","mt-4"],[1,"d-flex","align-items-start"],["type","button","l10nTranslate","",1,"btn","btn-secondary","me-auto",3,"click"],[3,"icon"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click","disabled"],["size","2x",1,"position-absolute","align-self-center","cursor-pointer",2,"margin-left","85px",3,"click","icon"],["alt","","height","96",1,"align-self-center","mb-2",3,"src"],[1,"align-self-center","mt-2","font-size-md","word-break-all","fw-500"],[1,"align-self-center","text-warning","mt-4"],[1,"fw-bold","ms-1"],[1,"area",3,"dragleave","dragover","drop"],["l10nTranslate","",1,"dropzone"],[1,"d-flex","flex-column","justify-content-center","align-self-center"]],template:function(t,a){t&1&&(i(0,"div",0)(1,"div",1)(2,"div",2),c(3,"This wizard will help you synchronize a directory on your computer with a Sync-in directory."),n(),i(4,"div")(5,"div",3),c(6,"To begin, select a folder on your computer."),n(),i(7,"div",3),c(8,'You can drag the folder into the area below or click on the "Select" button.'),n()()(),i(9,"div",4),C(10,U,6,4,"div",5)(11,Y,4,0,"div",6),n(),i(12,"div",7)(13,"div",8)(14,"button",9),h("click",function(){return a.onCancel()}),y(15,"fa-icon",10),c(16," Cancel "),n(),i(17,"button",11),h("click",function(){return a.onSelect()}),c(18,"Select a folder"),n(),i(19,"button",12),h("click",function(){return a.onNext()}),y(20,"fa-icon",10),c(21," Next "),n()()()()),t&2&&(l(10),g(a.syncService.wizard.localPath?10:11),l(5),f("icon",a.icons.faTimesCircle),l(4),f("disabled",!a.pathIsValid),l(),f("icon",a.icons.faArrowCircleRight))},dependencies:[W,k],encapsulation:2});let o=s;return o})();export{ie as SyncWizardClientComponent};
1
+ import{a as w}from"./chunk-NMF2ZFBE.js";import{h as O}from"./chunk-XSURUW7C.js";import{c as S,h as v}from"./chunk-RTNEBRKJ.js";import{Cb as M,pb as V,qb as L,rb as d,vb as N}from"./chunk-AALPWGPB.js";import{d as R}from"./chunk-3MVPXC3U.js";import{Bb as x,Eb as h,Gb as m,He as D,Ia as E,Kd as k,Oa as l,Oe as A,Tb as c,Ub as T,Vb as P,Wa as b,ab as I,ja as p,lb as C,mb as g,oa as u,pa as _,qg as W,rb as f,sb as i,tb as n,ub as y}from"./chunk-76M3BMK6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function $(o,s){if(o&1&&(i(0,"div",16)(1,"span",3),c(2),n(),i(3,"span",17),c(4),n()()),o&2){let r=m(2);l(2),T(r.infoMsg),l(2),P(":\xA0",r.syncService.wizard.localPath.origin)}}function U(o,s){if(o&1){let r=x();i(0,"div",5)(1,"fa-icon",13),h("click",function(){u(r);let t=m();return _(t.onReset())}),n(),y(2,"img",14),i(3,"div",15),c(4),n(),C(5,$,5,2,"div",16),n()}if(o&2){let r=m();l(),f("icon",r.icons.faTimesCircle),l(),f("src",r.syncService.wizard.localPath.mimeUrl,E),l(2),T(r.syncService.wizard.localPath.path),l(),g(r.infoMsg?5:-1)}}function Y(o,s){if(o&1){let r=x();i(0,"div",18),h("dragleave",function(t){u(r);let a=m();return _(a.dragLeave(t))})("dragover",function(t){u(r);let a=m();return _(a.dragOver(t))})("drop",function(t){u(r);let a=m();return _(a.drop(t))}),i(1,"div",19)(2,"span",20),c(3,"Drop folder here"),n()()()}}var ie=(()=>{let s=class s{constructor(){this.pathIsValid=!1,this.infoMsg=null,this.syncService=p(O),this.icons={faTimesCircle:D,faArrowCircleRight:A},this.router=p(R),this.renderer=p(b),this.store=p(N),this.layout=p(M),this.layout.setBreadcrumbIcon(L.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_CLIENT}/${V.WIZARD_CLIENT}`,splicing:3,translating:!0,sameLink:!0}),this.syncService.wizard.localPath&&this.checkSelection();let e=this.router.currentNavigation()?.extras.state;e?.file&&this.syncService.addFileToRemotePath(e.file)}dragOver(e){return e.preventDefault(),e.dataTransfer.items[0].type?!1:(e.dataTransfer.dropEffect="copy",e.stopPropagation(),e.target.classList.contains("dropzone")&&this.renderer.addClass(e.target,"active"),!0)}dragLeave(e){e.preventDefault(),e.target.classList.contains("dropzone")&&this.renderer.removeClass(e.target,"active")}drop(e){e.preventDefault(),e.stopPropagation();let t=e.dataTransfer.items[0].webkitGetAsEntry();return t&&t.isDirectory?(this.syncService.wizard.localPath={name:t.name,path:this.syncService.getFilePath(e.dataTransfer.files[0]),mimeUrl:v(S),origin:null},this.checkSelection(),!0):!1}onSelect(){this.syncService.showOpenDialog({properties:[w.DIRECTORY,w.CREATE_DIRECTORY],defaultPath:""}).then(e=>{e.canceled||(this.syncService.wizard.localPath={name:e.filePaths[0].split("\\").pop().split("/").pop(),path:e.filePaths[0],mimeUrl:v(S),origin:null},this.checkSelection())})}onReset(){this.syncService.wizard.localPath=null,this.pathIsValid=!1,this.infoMsg=null}onNext(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onCancel(){this.router.navigate([d.BASE,d.PATHS]).catch(console.error),this.syncService.resetWizard()}checkSelection(){let e=this.store.clientSyncPaths().find(t=>new RegExp(`^${t.settings.localPath}((\\/.*)+|\\/?)$`).test(this.syncService.wizard.localPath.path));e?(this.pathIsValid=!1,this.syncService.wizard.localPath.mimeUrl=v(`${S}_sync`),this.syncService.wizard.localPath.origin=e.settings.localPath,this.infoMsg="The parent directory is already synced"):(this.infoMsg=null,this.pathIsValid=!0)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=I({type:s,selectors:[["app-sync-wizard-client"]],decls:22,vars:4,consts:[[1,"wizard"],[1,"d-flex","flex-column","text-center","fs-sm"],["l10nTranslate","",1,"mb-2"],["l10nTranslate",""],[1,"d-flex","flex-column","h-100"],[1,"d-flex","flex-column","my-auto","fs-sm"],[1,"area"],[1,"d-flex","flex-column","mt-4"],[1,"d-flex","align-items-start"],["type","button","l10nTranslate","",1,"btn","btn-secondary","me-auto",3,"click"],[3,"icon"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click","disabled"],["size","2x",1,"position-absolute","align-self-center","cursor-pointer",2,"margin-left","85px",3,"click","icon"],["alt","","height","96",1,"align-self-center","mb-2",3,"src"],[1,"align-self-center","mt-2","font-size-md","word-break-all","fw-500"],[1,"align-self-center","text-warning","mt-4"],[1,"fw-bold","ms-1"],[1,"area",3,"dragleave","dragover","drop"],["l10nTranslate","",1,"dropzone"],[1,"d-flex","flex-column","justify-content-center","align-self-center"]],template:function(t,a){t&1&&(i(0,"div",0)(1,"div",1)(2,"div",2),c(3,"This wizard will help you synchronize a directory on your computer with a Sync-in directory."),n(),i(4,"div")(5,"div",3),c(6,"To begin, select a folder on your computer."),n(),i(7,"div",3),c(8,'You can drag the folder into the area below or click on the "Select" button.'),n()()(),i(9,"div",4),C(10,U,6,4,"div",5)(11,Y,4,0,"div",6),n(),i(12,"div",7)(13,"div",8)(14,"button",9),h("click",function(){return a.onCancel()}),y(15,"fa-icon",10),c(16," Cancel "),n(),i(17,"button",11),h("click",function(){return a.onSelect()}),c(18,"Select a folder"),n(),i(19,"button",12),h("click",function(){return a.onNext()}),y(20,"fa-icon",10),c(21," Next "),n()()()()),t&2&&(l(10),g(a.syncService.wizard.localPath?10:11),l(5),f("icon",a.icons.faTimesCircle),l(4),f("disabled",!a.pathIsValid),l(),f("icon",a.icons.faArrowCircleRight))},dependencies:[W,k],encapsulation:2});let o=s;return o})();export{ie as SyncWizardClientComponent};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-5O66CLTD.js";import{a as ge}from"./chunk-S3TTWPQA.js";import"./chunk-HGODIZTV.js";import{a as de}from"./chunk-XEWLBWFF.js";import{a as Ce}from"./chunk-3JYMJQYT.js";import{w as me}from"./chunk-B6HQYQYG.js";import{a as fe}from"./chunk-DGCVA6BM.js";import"./chunk-ZHOE5VEY.js";import"./chunk-GWRAGN3M.js";import{a as N}from"./chunk-3RPUQ22U.js";import{a as B,b as xe}from"./chunk-GQHXYX6Z.js";import"./chunk-27Z3SYRL.js";import{Cb as _e,D as oe,F as R,G as re,J as se,gb as pe,s as J,va as le,wa as ce,xa as ue}from"./chunk-O3YLAEVE.js";import{Bb as G,Bf as ee,Eb as x,Ed as q,Gb as s,Ia as H,Jd as W,Kb as S,Kd as z,L as D,Lb as F,Ld as X,Mb as U,Oa as a,Pc as j,Qb as I,Rb as $,Sb as k,Tb as p,Tf as te,Ub as V,Vb as w,Vf as ie,Wb as O,ab as L,dc as K,ef as Z,fb as M,fg as ne,he as Y,ja as E,kc as g,lb as v,lc as P,mb as h,mc as y,oa as _,pa as m,pb as b,qb as T,qg as ae,rb as d,sb as l,tb as c,ub as C}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";var ye=["MainContextMenu"],we=["TargetContextMenu"],ve=(e,o)=>o.key,be=(e,o)=>o.id,Te=(e,o)=>o.mid;function Ge(e,o){if(e&1&&C(0,"fa-icon",18),e&2){let t=s(3);d("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function Se(e,o){if(e&1){let t=G();l(0,"th",17),x("click",function(){_(t);let r=s().$implicit,n=s();return m(n.sortBy(r.key))}),p(1),v(2,Ge,1,2,"fa-icon",18),c()}if(e&2){let t=s().$implicit,i=s();k(t.value.class),I("width",t.value.width,"%"),$("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),w(" ",t.value.label," "),a(),h(i.sortTable.sortParam.column===t.key?2:-1)}}function Fe(e,o){if(e&1&&v(0,Se,3,10,"th",16),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Ue(e,o){if(e&1&&(l(0,"div",21),C(1,"img",24),l(2,"div",22)(3,"span",25),p(4),c(),l(5,"span",26),p(6),c()()()),e&2){let t=s(3).$implicit;a(),d("src",t.avatarUrl,H),a(3),w(" ",t.login," "),a(2),V(t.email)}}function Ve(e,o){if(e&1&&(l(0,"div",22)(1,"span",25),p(2),c()()),e&2){let t=s(3).$implicit;a(2),V(t.fullName)}}function Ae(e,o){if(e&1&&C(0,"app-user-avatar",27),e&2){let t=o.$implicit;d("user",t)("isMember",!0)}}function Ee(e,o){if(e&1&&b(0,Ae,1,2,"app-user-avatar",27,Te),e&2){let t=s(3).$implicit;T(t.managers)}}function Me(e,o){e&1&&p(0," too many login attempts ")}function $e(e,o){if(e&1&&p(0),e&2){let t=s(4).$implicit;w(" ",t.userIsActiveText," ")}}function ke(e,o){if(e&1&&(l(0,"span",28),v(1,Me,1,0)(2,$e,1,1),c()),e&2){let t=s(3).$implicit;k(t.isActive?"text-success":"text-danger"),a(),h(!t.isActive&&t.passwordAttempts?1:2)}}function Pe(e,o){if(e&1&&(p(0),g(1,"amDateFormat")),e&2){let t=s(3).$implicit;w(" ",P(1,1,t.createdAt)," ")}}function De(e,o){if(e&1&&(l(0,"div",22)(1,"div"),p(2),g(3,"amDateFormat"),c(),l(4,"div"),p(5),g(6,"amDateFormat"),c()()),e&2){let t=s(5).$implicit;a(2),V(P(3,2,t.currentAccess)),a(3),V(P(6,4,t.lastAccess))}}function Ie(e,o){if(e&1&&p(0),e&2){let t=s(5).$implicit;w(" ",t.hTimeAgo," ")}}function Re(e,o){if(e&1){let t=G();l(0,"div",30),x("mouseover",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!0)})("focus",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!0)})("mouseleave",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!1)}),v(1,De,7,6,"div",22)(2,Ie,1,1),c()}if(e&2){let t=s(4).$implicit;a(),h(t.currentAccessHover?1:2)}}function Be(e,o){e&1&&(l(0,"span",28),p(1,"never"),c())}function Ne(e,o){if(e&1&&v(0,Re,3,1,"div",29)(1,Be,2,0,"span",28),e&2){let t=s(3).$implicit;h(t.currentAccess?0:1)}}function Qe(e,o){if(e&1&&(l(0,"td"),v(1,Ue,7,3,"div",21)(2,Ve,3,1,"div",22)(3,Ee,2,0)(4,ke,3,3,"span",23)(5,Pe,2,3)(6,Ne,2,1),c()),e&2){let t,i=s().$implicit,r=s().$implicit;k(K("",i.value.class," ",i.value.newly?"prop-newly-"+r[i.value.newly]:"")),I("width",i.value.width,"%"),$("text-align-center",i.value.textCenter),a(),h((t=i.key)==="login"?1:t==="fullName"?2:t==="managers"?3:t==="isActive"?4:t==="createdAt"?5:t==="currentAccess"?6:-1)}}function He(e,o){if(e&1&&v(0,Qe,7,9,"td",20),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Le(e,o){if(e&1){let t=G();l(0,"tr",19),x("click",function(){let r=_(t).$implicit,n=s();return m(n.onSelect(r))})("contextmenu",function(r){let n=_(t).$implicit,u=s();return m(u.onTargetContextMenu(r,n))})("appTap",function(){_(t);let r=s();return m(r.openGuestDialog())}),b(1,He,1,1,null,null,ve),g(3,"keyvalue"),c()}if(e&2){let t=o.$implicit,i=s();$("disabled",!t.isActive)("selected",t.id===(i.selected==null?null:i.selected.id)),a(),T(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function Oe(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"New guest"),c()),e&2){let t=s();a(),d("icon",t.icons.faPlus)}}function Ke(e,o){}function je(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"Refresh"),c()),e&2){let t=s();a(),d("icon",t.icons.faArrowRotateRight)}}function qe(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"Edit guest"),c()),e&2){let t=s();a(),d("icon",t.icons.faPen)}}var vt=(()=>{let o=class o{constructor(){this.locale=E(q),this.originalOrderKeyValue=pe,this.icons={faRotate:X,faPlus:te,faPen:ee,faArrowDown:ne,faArrowUp:Z,faKey:Y,faArrowRotateRight:ie},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.loading=!1,this.selected=null,this.guests=[],this.layout=E(_e),this.userService=E(me),this.canCreateGuest=this.userService.userHavePermission(oe.GUESTS_ADMIN),this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],createdAt:[{prop:"createdAt",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new xe(this.constructor.name,this.sortSettings),this.loadGuests(),this.layout.setBreadcrumbIcon(se.GUESTS),this.layout.setBreadcrumbNav({url:`/${R.BASE}/${R.GUESTS}/${re.GUESTS}`,splicing:2,translating:!0,sameLink:!0})}loadGuests(){this.loading=!0,this.onSelect(),this.userService.listGuests().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.scrollView.scrollInto(-1),this.loading=!1},error:i=>{this.guests=[],this.layout.sendNotification("error","Guests",i.error.message),this.loading=!1}})}onSelect(i=null){this.selected=i}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,r){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(i,this.targetContextMenu)}sortBy(i,r=!0,n){this.guests=this.sortTable.sortBy(i,r,n||this.guests)}openGuestDialog(i=!1){i?this.layout.openDialog(Q,"md").content.guestChange.pipe(D(1)).subscribe(n=>{let[u,f]=n;u==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.guests,f]),this.onSelect(f))}):this.userService.getGuest(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Q,"md",{initialState:{guest:r}}).content.guestChange.pipe(D(1)).subscribe(u=>{let[f,A]=u;f==="update"?this.selected=Object.assign(this.selected,A):f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.guests.filter(he=>he.id!==A.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=L({type:o,selectors:[["app-user-guests"]],viewQuery:function(r,n){if(r&1&&(S(N,5),S(B,7),S(ye,7),S(we,7)),r&2){let u;F(u=U())&&(n.scrollView=u.first),F(u=U())&&(n.inputFilter=u.first),F(u=U())&&(n.mainContextMenu=u.first),F(u=U())&&(n.targetContextMenu=u.first)}},decls:35,vars:32,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],["l10nTranslate",""],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,n){if(r&1){let u=G();l(0,"div",2)(1,"button",3),g(2,"translate"),x("click",function(){return _(u),m(n.loadGuests())}),C(3,"fa-icon",4),c(),l(4,"button",5),g(5,"translate"),x("click",function(){return _(u),m(n.openGuestDialog(!0))}),C(6,"fa-icon",6),c(),l(7,"button",5),g(8,"translate"),x("click",function(){return _(u),m(n.openGuestDialog())}),C(9,"fa-icon",6),c(),C(10,"app-input-filter",7),c(),l(11,"table",8)(12,"thead")(13,"tr"),b(14,Fe,1,1,null,null,ve),g(16,"keyvalue"),c()()(),l(17,"app-virtual-scroll",9),g(18,"searchFilter"),x("contextmenu",function(A){return _(u),m(n.onContextMenu(A))}),l(19,"table",8)(20,"tbody",10),b(21,Le,4,7,"tr",11,be),c()()(),l(23,"div",12)(24,"span",13),p(25),g(26,"translate"),c()(),l(27,"context-menu",null,0),M(29,Oe,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.openGuestDialog(!0))}),M(30,Ke,0,0,"ng-template",15)(31,je,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.loadGuests())}),c(),l(32,"context-menu",null,1),M(34,qe,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.openGuestDialog())}),c()}r&2&&(a(),d("tooltip",y(2,14,"Refresh",n.locale.language)),a(2),d("icon",n.icons.faRotate)("animation",n.loading?"spin":null),a(),d("disabled",!n.canCreateGuest)("tooltip",y(5,17,"New guest",n.locale.language)),a(2),d("icon",n.icons.faPlus),a(),d("disabled",!n.selected)("tooltip",y(8,20,"Edit guest",n.locale.language)),a(2),d("icon",n.icons.faPen),a(5),T(y(16,23,n.tableHeaders,n.originalOrderKeyValue)),a(3),d("bufferAmount",5)("items",y(18,26,n.guests,n.inputFilter.search())),a(4),T(n.scrollView==null?null:n.scrollView.viewPortItems),a(4),O("",n.guests.length," ",y(26,29,"guests",n.locale.language)),a(5),d("divider",!0))},dependencies:[ae,B,J,z,N,ue,ce,le,ge,de,W,j,fe,Ce],encapsulation:2});let e=o;return e})();export{vt as UserGuestsComponent};
1
+ import{a as Q}from"./chunk-XX3JPJUM.js";import{a as ge}from"./chunk-WFMEUST4.js";import"./chunk-EKWB5W72.js";import{a as de}from"./chunk-ZU5MQTFN.js";import{a as Ce}from"./chunk-ZHUBWKA2.js";import{w as me}from"./chunk-CVXLHSO5.js";import{a as fe}from"./chunk-TTWMFWEC.js";import"./chunk-R4VYKZVJ.js";import"./chunk-QJ22N76V.js";import{a as N}from"./chunk-XZHWESIY.js";import{a as B,b as xe}from"./chunk-S44QIK3G.js";import"./chunk-WRK2FTKU.js";import{Cb as _e,D as oe,F as R,G as re,J as se,gb as pe,s as J,va as le,wa as ce,xa as ue}from"./chunk-AALPWGPB.js";import{Bb as G,Bf as ee,Eb as x,Ed as q,Gb as s,Ia as H,Jd as W,Kb as S,Kd as z,L as D,Lb as F,Ld as X,Mb as U,Oa as a,Pc as j,Qb as I,Rb as $,Sb as k,Tb as p,Tf as te,Ub as V,Vb as w,Vf as ie,Wb as O,ab as L,dc as K,ef as Z,fb as M,fg as ne,he as Y,ja as E,kc as g,lb as v,lc as P,mb as h,mc as y,oa as _,pa as m,pb as b,qb as T,qg as ae,rb as d,sb as l,tb as c,ub as C}from"./chunk-76M3BMK6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";var ye=["MainContextMenu"],we=["TargetContextMenu"],ve=(e,o)=>o.key,be=(e,o)=>o.id,Te=(e,o)=>o.mid;function Ge(e,o){if(e&1&&C(0,"fa-icon",18),e&2){let t=s(3);d("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function Se(e,o){if(e&1){let t=G();l(0,"th",17),x("click",function(){_(t);let r=s().$implicit,n=s();return m(n.sortBy(r.key))}),p(1),v(2,Ge,1,2,"fa-icon",18),c()}if(e&2){let t=s().$implicit,i=s();k(t.value.class),I("width",t.value.width,"%"),$("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),w(" ",t.value.label," "),a(),h(i.sortTable.sortParam.column===t.key?2:-1)}}function Fe(e,o){if(e&1&&v(0,Se,3,10,"th",16),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Ue(e,o){if(e&1&&(l(0,"div",21),C(1,"img",24),l(2,"div",22)(3,"span",25),p(4),c(),l(5,"span",26),p(6),c()()()),e&2){let t=s(3).$implicit;a(),d("src",t.avatarUrl,H),a(3),w(" ",t.login," "),a(2),V(t.email)}}function Ve(e,o){if(e&1&&(l(0,"div",22)(1,"span",25),p(2),c()()),e&2){let t=s(3).$implicit;a(2),V(t.fullName)}}function Ae(e,o){if(e&1&&C(0,"app-user-avatar",27),e&2){let t=o.$implicit;d("user",t)("isMember",!0)}}function Ee(e,o){if(e&1&&b(0,Ae,1,2,"app-user-avatar",27,Te),e&2){let t=s(3).$implicit;T(t.managers)}}function Me(e,o){e&1&&p(0," too many login attempts ")}function $e(e,o){if(e&1&&p(0),e&2){let t=s(4).$implicit;w(" ",t.userIsActiveText," ")}}function ke(e,o){if(e&1&&(l(0,"span",28),v(1,Me,1,0)(2,$e,1,1),c()),e&2){let t=s(3).$implicit;k(t.isActive?"text-success":"text-danger"),a(),h(!t.isActive&&t.passwordAttempts?1:2)}}function Pe(e,o){if(e&1&&(p(0),g(1,"amDateFormat")),e&2){let t=s(3).$implicit;w(" ",P(1,1,t.createdAt)," ")}}function De(e,o){if(e&1&&(l(0,"div",22)(1,"div"),p(2),g(3,"amDateFormat"),c(),l(4,"div"),p(5),g(6,"amDateFormat"),c()()),e&2){let t=s(5).$implicit;a(2),V(P(3,2,t.currentAccess)),a(3),V(P(6,4,t.lastAccess))}}function Ie(e,o){if(e&1&&p(0),e&2){let t=s(5).$implicit;w(" ",t.hTimeAgo," ")}}function Re(e,o){if(e&1){let t=G();l(0,"div",30),x("mouseover",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!0)})("focus",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!0)})("mouseleave",function(){_(t);let r=s(4).$implicit;return m(r.currentAccessHover=!1)}),v(1,De,7,6,"div",22)(2,Ie,1,1),c()}if(e&2){let t=s(4).$implicit;a(),h(t.currentAccessHover?1:2)}}function Be(e,o){e&1&&(l(0,"span",28),p(1,"never"),c())}function Ne(e,o){if(e&1&&v(0,Re,3,1,"div",29)(1,Be,2,0,"span",28),e&2){let t=s(3).$implicit;h(t.currentAccess?0:1)}}function Qe(e,o){if(e&1&&(l(0,"td"),v(1,Ue,7,3,"div",21)(2,Ve,3,1,"div",22)(3,Ee,2,0)(4,ke,3,3,"span",23)(5,Pe,2,3)(6,Ne,2,1),c()),e&2){let t,i=s().$implicit,r=s().$implicit;k(K("",i.value.class," ",i.value.newly?"prop-newly-"+r[i.value.newly]:"")),I("width",i.value.width,"%"),$("text-align-center",i.value.textCenter),a(),h((t=i.key)==="login"?1:t==="fullName"?2:t==="managers"?3:t==="isActive"?4:t==="createdAt"?5:t==="currentAccess"?6:-1)}}function He(e,o){if(e&1&&v(0,Qe,7,9,"td",20),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Le(e,o){if(e&1){let t=G();l(0,"tr",19),x("click",function(){let r=_(t).$implicit,n=s();return m(n.onSelect(r))})("contextmenu",function(r){let n=_(t).$implicit,u=s();return m(u.onTargetContextMenu(r,n))})("appTap",function(){_(t);let r=s();return m(r.openGuestDialog())}),b(1,He,1,1,null,null,ve),g(3,"keyvalue"),c()}if(e&2){let t=o.$implicit,i=s();$("disabled",!t.isActive)("selected",t.id===(i.selected==null?null:i.selected.id)),a(),T(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function Oe(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"New guest"),c()),e&2){let t=s();a(),d("icon",t.icons.faPlus)}}function Ke(e,o){}function je(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"Refresh"),c()),e&2){let t=s();a(),d("icon",t.icons.faArrowRotateRight)}}function qe(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),p(2,"Edit guest"),c()),e&2){let t=s();a(),d("icon",t.icons.faPen)}}var vt=(()=>{let o=class o{constructor(){this.locale=E(q),this.originalOrderKeyValue=pe,this.icons={faRotate:X,faPlus:te,faPen:ee,faArrowDown:ne,faArrowUp:Z,faKey:Y,faArrowRotateRight:ie},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.loading=!1,this.selected=null,this.guests=[],this.layout=E(_e),this.userService=E(me),this.canCreateGuest=this.userService.userHavePermission(oe.GUESTS_ADMIN),this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],createdAt:[{prop:"createdAt",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new xe(this.constructor.name,this.sortSettings),this.loadGuests(),this.layout.setBreadcrumbIcon(se.GUESTS),this.layout.setBreadcrumbNav({url:`/${R.BASE}/${R.GUESTS}/${re.GUESTS}`,splicing:2,translating:!0,sameLink:!0})}loadGuests(){this.loading=!0,this.onSelect(),this.userService.listGuests().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.scrollView.scrollInto(-1),this.loading=!1},error:i=>{this.guests=[],this.layout.sendNotification("error","Guests",i.error.message),this.loading=!1}})}onSelect(i=null){this.selected=i}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,r){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(i,this.targetContextMenu)}sortBy(i,r=!0,n){this.guests=this.sortTable.sortBy(i,r,n||this.guests)}openGuestDialog(i=!1){i?this.layout.openDialog(Q,"md").content.guestChange.pipe(D(1)).subscribe(n=>{let[u,f]=n;u==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.guests,f]),this.onSelect(f))}):this.userService.getGuest(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Q,"md",{initialState:{guest:r}}).content.guestChange.pipe(D(1)).subscribe(u=>{let[f,A]=u;f==="update"?this.selected=Object.assign(this.selected,A):f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.guests.filter(he=>he.id!==A.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=L({type:o,selectors:[["app-user-guests"]],viewQuery:function(r,n){if(r&1&&(S(N,5),S(B,7),S(ye,7),S(we,7)),r&2){let u;F(u=U())&&(n.scrollView=u.first),F(u=U())&&(n.inputFilter=u.first),F(u=U())&&(n.mainContextMenu=u.first),F(u=U())&&(n.targetContextMenu=u.first)}},decls:35,vars:32,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],["l10nTranslate",""],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,n){if(r&1){let u=G();l(0,"div",2)(1,"button",3),g(2,"translate"),x("click",function(){return _(u),m(n.loadGuests())}),C(3,"fa-icon",4),c(),l(4,"button",5),g(5,"translate"),x("click",function(){return _(u),m(n.openGuestDialog(!0))}),C(6,"fa-icon",6),c(),l(7,"button",5),g(8,"translate"),x("click",function(){return _(u),m(n.openGuestDialog())}),C(9,"fa-icon",6),c(),C(10,"app-input-filter",7),c(),l(11,"table",8)(12,"thead")(13,"tr"),b(14,Fe,1,1,null,null,ve),g(16,"keyvalue"),c()()(),l(17,"app-virtual-scroll",9),g(18,"searchFilter"),x("contextmenu",function(A){return _(u),m(n.onContextMenu(A))}),l(19,"table",8)(20,"tbody",10),b(21,Le,4,7,"tr",11,be),c()()(),l(23,"div",12)(24,"span",13),p(25),g(26,"translate"),c()(),l(27,"context-menu",null,0),M(29,Oe,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.openGuestDialog(!0))}),M(30,Ke,0,0,"ng-template",15)(31,je,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.loadGuests())}),c(),l(32,"context-menu",null,1),M(34,qe,3,1,"ng-template",14),x("execute",function(){return _(u),m(n.openGuestDialog())}),c()}r&2&&(a(),d("tooltip",y(2,14,"Refresh",n.locale.language)),a(2),d("icon",n.icons.faRotate)("animation",n.loading?"spin":null),a(),d("disabled",!n.canCreateGuest)("tooltip",y(5,17,"New guest",n.locale.language)),a(2),d("icon",n.icons.faPlus),a(),d("disabled",!n.selected)("tooltip",y(8,20,"Edit guest",n.locale.language)),a(2),d("icon",n.icons.faPen),a(5),T(y(16,23,n.tableHeaders,n.originalOrderKeyValue)),a(3),d("bufferAmount",5)("items",y(18,26,n.guests,n.inputFilter.search())),a(4),T(n.scrollView==null?null:n.scrollView.viewPortItems),a(4),O("",n.guests.length," ",y(26,29,"guests",n.locale.language)),a(5),d("divider",!0))},dependencies:[ae,B,J,z,N,ue,ce,le,ge,de,W,j,fe,Ce],encapsulation:2});let e=o;return e})();export{vt as UserGuestsComponent};
@@ -1 +1 @@
1
- import{a as fe}from"./chunk-4TPFERL6.js";import"./chunk-L3BIP4AA.js";import{h as V}from"./chunk-XTVNHFKX.js";import"./chunk-RTNEBRKJ.js";import{a as z}from"./chunk-3RPUQ22U.js";import{a as Q,b as _e}from"./chunk-GQHXYX6Z.js";import"./chunk-27Z3SYRL.js";import{Cb as M,gb as ce,pb as pe,qb as me,rb as q,s as re,vb as de}from"./chunk-O3YLAEVE.js";import{d as G}from"./chunk-QHJT5H4M.js";import{Bb as b,Cd as ne,Eb as d,Ed as ie,Gb as p,Ia as H,Jd as oe,Kb as $,Kd as P,L as K,Lb as A,Mb as O,Oa as a,Pc as W,Qa as U,Qb as N,Rb as T,Sb as S,Tb as c,Ub as f,Vb as B,Wf as le,ab as k,cc as L,dc as Y,ef as ae,fg as se,gf as D,ja as u,jd as J,kc as E,lb as h,mb as y,mc as F,oa as x,od as X,pa as v,pb as g,qb as w,qg as R,rb as m,sb as n,tb as o,tc as j,ub as C,ud as Z,vd as ee,wd as te}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function Se(t,r){if(t&1&&(n(0,"span",6),c(1,"Events from"),o(),c(2,"\xA0"),n(3,"b"),c(4),o()),t&2){let e=p();a(4),f(e.syncPath.settings.name)}}function xe(t,r){t&1&&(n(0,"span",6),c(1,"All events"),o())}var ue=(()=>{let r=class r{constructor(){this.syncPath=null,this.wasDeleted=new U,this.layout=u(M),this.icons={faTrashCan:D},this.syncService=u(V)}doClear(){this.syncService.deleteTransfers(this.syncPath?.id).then(()=>{this.wasDeleted.emit(),this.layout.closeDialog()})}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=k({type:r,selectors:[["app-sync-transfers-delete-dialog"]],inputs:{syncPath:"syncPath"},outputs:{wasDeleted:"wasDeleted"},decls:18,vars:2,consts:[[1,"modal-header"],["translate","",1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["l10nTranslate",""],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","submit","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(s,l){s&1&&(n(0,"div",0)(1,"h4",1),C(2,"fa-icon",2),n(3,"span",3),c(4,"Clear events"),o()(),n(5,"button",4),d("click",function(){return l.layout.closeDialog()}),o()(),n(6,"div",5),h(7,Se,5,1)(8,xe,2,0,"span",6),n(9,"span"),c(10,"\xA0"),o(),n(11,"span",6),c(12,"will be cleared"),o()(),n(13,"div",7)(14,"button",8),d("click",function(){return l.layout.closeDialog()}),c(15,"Cancel"),o(),n(16,"button",9),d("click",function(){return l.doClear()}),c(17,"Confirm"),o()()),s&2&&(a(2),m("icon",l.icons.faTrashCan),a(5),y(l.syncPath?7:8))},dependencies:[P,R],encapsulation:2});let t=r;return t})();var he=(t,r)=>r.id,ye=(t,r)=>r.key;function ve(t,r){if(t&1&&(n(0,"option",4),c(1),o()),t&2){let e=r.$implicit;m("ngValue",e),a(),f(e.settings.name)}}function Te(t,r){if(t&1&&C(0,"fa-icon",14),t&2){let e=p(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function ge(t,r){if(t&1){let e=b();n(0,"th",23),d("click",function(){x(e);let s=p().$implicit,l=p();return v(l.sortBy(s.key))}),c(1),h(2,Te,1,1,"fa-icon",14),o()}if(t&2){let e=p().$implicit,i=p();S(e.value.class),N("width",e.value.width,"%"),T("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),B(" ",e.value.label," "),a(),y(i.sortTable.sortParam.column===e.key?2:-1)}}function we(t,r){if(t&1&&h(0,ge,3,10,"th",22),t&2){let e=r.$implicit;y(e.value.show?0:-1)}}function be(t,r){if(t&1&&(n(0,"span",26),C(1,"fa-icon",14)(2,"fa-icon",27),n(3,"span",28),c(4),o()()),t&2){let e=p(3).$implicit;a(),S(e.ok?e.sideIconClass:"circle-error-icon-sm"),m("icon",e.sideIcon),a(),T("text-danger",!e.ok),m("icon",e.actionIcon),a(),T("text-danger",!e.ok),a(),f(e.actionText)}}function Ee(t,r){if(t&1&&(n(0,"span",26)(1,"span",29),c(2),o()()),t&2){let e=p(3).$implicit;a(2),f(e.syncPathName)}}function Fe(t,r){if(t&1&&(n(0,"span"),c(1),o(),n(2,"span")(3,"b",33),c(4,"Source"),o(),c(5),o()),t&2){let e=p(4).$implicit;S(e.selected?"overflow-wrap-and-whitespace":"truncate"),a(),f(e.fileDst),a(),S(L("",e.selected?"overflow-wrap-and-whitespace":"truncate"," fs-xxxs")),a(3),B(":\xA0",e.file)}}function ke(t,r){if(t&1&&(n(0,"span"),c(1),o()),t&2){let e=p(4).$implicit;S(e.selected?"overflow-wrap-and-whitespace":"truncate"),a(),f(e.file)}}function Pe(t,r){if(t&1&&(n(0,"span"),c(1),o()),t&2){let e=p(4).$implicit;S(L("",e.selected?"overflow-wrap-and-whitespace":"truncate"," text-danger fs-xxxs")),a(),f(e.error)}}function De(t,r){if(t&1){let e=b();n(0,"div",26)(1,"img",30),d("error",function(){x(e);let s=p(3).$implicit;return v(s.fallBackMimeUrl())}),o(),n(2,"span",31),h(3,Fe,6,7)(4,ke,2,3,"span",32),h(5,Pe,2,4,"span",32),o()()}if(t&2){let e=p(3).$implicit;a(),m("src",e.mimeUrl,H),a(2),y(e.fileDst?3:4),a(2),y(e.ok?-1:5)}}function Re(t,r){if(t&1){let e=b();n(0,"div",34),d("mouseenter",function(){x(e);let s=p(3).$implicit;return v(s.hovered=!0)})("mouseleave",function(){x(e);let s=p(3).$implicit;return v(s.hovered=!1)}),n(1,"span"),c(2),o()()}if(t&2){let e=p(3).$implicit;a(2),f(e.hovered?e.timestamp:e.hTimeAgo)}}function Me(t,r){if(t&1&&(n(0,"td"),h(1,be,5,9,"span",26)(2,Ee,3,1,"span",26)(3,De,6,3,"div",26)(4,Re,3,1,"div"),o()),t&2){let e,i=p().$implicit,s=p().$implicit;S(Y("",i.value.class," ",i.value.newly?"prop-newly-"+s[i.value.newly]:"")),N("width",i.value.width,"%"),T("text-align-center",i.value.textCenter),a(),y((e=i.key)==="action"?1:e==="sync"?2:e==="file"?3:e==="date"?4:-1)}}function Ve(t,r){if(t&1&&h(0,Me,5,9,"td",25),t&2){let e=r.$implicit;y(e.value.show?0:-1)}}function Ie(t,r){if(t&1){let e=b();n(0,"tr",24),d("click",function(){let s=x(e).$implicit,l=p();return v(l.onSelect(s))}),g(1,Ve,1,1,null,null,ye),E(3,"keyvalue"),o()}if(t&2){let e=r.$implicit,i=p();T("selected",e.selected),a(),w(F(3,2,i.tableHeaders,i.originalOrderKeyValue))}}var _t=(()=>{let r=class r{constructor(){if(this.locale=u(ie),this.action=null,this.syncPathSelected=null,this.transfers=[],this.store=u(de),this.originalOrderKeyValue=ce,this.tableHeaders={action:{label:"Action",width:15,textCenter:!1,class:"",show:!0,sortable:!0},sync:{label:"Synchronization",width:15,textCenter:!1,class:"",show:!0,sortable:!0},file:{label:"File",width:55,textCenter:!1,class:"",show:!0,sortable:!0},date:{label:"Date",width:15,textCenter:!0,class:"",newly:"newly",show:!0,sortable:!0}},this.icons={faRedo:le,faTrashCan:D,faArrowDown:se,faArrowUp:ae},this.router=u(G),this.layout=u(M),this.syncService=u(V),this.sortSettings={default:[{prop:"timestamp",type:"date"}],action:[{prop:"actionText",type:"string"}],sync:[{prop:"syncPathName",type:"string"}],file:[{prop:"file",type:"string"}],date:[{prop:"timestamp",type:"date"}]},this.sortTable=new _e(this.constructor.name,this.sortSettings),this.focusOnSyncPathErrorsId=null,this.search=null,this.query=null,this.layout.setBreadcrumbIcon(me.TRANSFERS),this.layout.setBreadcrumbNav({url:`/${q.BASE}/${q.TRANSFERS}/${pe.TRANSFERS}`,splicing:2,translating:!0,sameLink:!0}),j(()=>{this.doSearch(this.inputFilter.search())}),this.checkRouteState(),this.focusOnSyncPathErrorsId){let i=this.store.clientSyncPaths().find(s=>s.id===this.focusOnSyncPathErrorsId);i?(this.syncPathSelected=i,this.onSelectAction("ERROR")):this.refresh()}else this.refresh()}doSearch(i){this.search=i,this.doQueryRefresh()}refresh(){this.onSelect(),this.syncService.getTransfers(this.syncPathSelected?.id,this.query).then(i=>{this.transfers=i.map(s=>new fe(s)),this.scrollView?.scrollInto(-1)})}onSelectPath(i){this.syncPathSelected=i,this.tableHeaders.sync.show=!this.syncPathSelected,this.refresh()}onSelectAction(i){this.action=i,this.doQueryRefresh()}onSelect(i){for(let s of this.transfers.filter(l=>l.selected))s.selected=!1;i&&(i.selected=!0)}openClearDialog(){this.layout.openDialog(ue,"md",{initialState:{syncPath:this.syncPathSelected||null}}).content.wasDeleted.pipe(K(1)).subscribe(()=>this.refresh())}sortBy(i,s=!0,l){this.transfers=this.sortTable.sortBy(i,s,l||this.transfers)}doQueryRefresh(){this.search&&this.action?this.action==="ERROR"?this.query=`(?=.*${this.search})(?=.*"ok":"false")`:this.query=`(?=.*${this.search})(?=.*"action":"${this.action}")`:this.action?this.query=this.action==="ERROR"?'"ok":false':`"action":"${this.action}"`:this.search?this.query=this.search:this.query=null,this.refresh()}checkRouteState(){let i=this.router.currentNavigation()?.extras.state;i?.id&&(this.focusOnSyncPathErrorsId=i.id)}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=k({type:r,selectors:[["app-sync-transfers"]],viewQuery:function(s,l){if(s&1&&($(z,5),$(Q,7)),s&2){let _;A(_=O())&&(l.scrollView=_.first),A(_=O())&&(l.inputFilter=_.first)}},decls:41,vars:20,consts:[[1,"app-top-menu"],[1,"btn-group","btn-group-sm"],[1,"form-select","form-select-sm","font-size-xs",2,"min-width","210px",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],[3,"ngValue"],[1,"form-select","form-select-sm","font-size-xs","ms-1",2,"min-width","170px",3,"ngModelChange","ngModel"],["l10nTranslate","","value","NEW|MKFILE|MKDIR"],["l10nTranslate","","value","DIFF"],["l10nTranslate","","value","MOVE"],["l10nTranslate","","value","COPY"],["l10nTranslate","","value","RM|RMDIR"],["l10nTranslate","","value","ERROR"],[1,"d-flex","ms-auto"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["placement","bottom","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"bufferAmount","items","resizeOffset"],[1,"app-table","mb-3"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["size","sm",1,"circle-gray-icon-sm",3,"icon"],["l10nTranslate","",1,"fs-xxxs"],[1,"fs-xxs","ms-1"],["alt","","width","24",1,"me-2",3,"error","src"],[1,"d-flex","flex-column","fs-xxs"],[3,"class"],["l10nTranslate",""],[3,"mouseenter","mouseleave"]],template:function(s,l){s&1&&(n(0,"div",0)(1,"div",1)(2,"select",2),d("ngModelChange",function(I){return l.onSelectPath(I)}),n(3,"option",3),c(4,"All syncs"),o(),g(5,ve,2,2,"option",4,he),o(),n(7,"select",5),d("ngModelChange",function(I){return l.onSelectAction(I)}),n(8,"option",3),c(9,"All events"),o(),n(10,"option",6),c(11,"Added"),o(),n(12,"option",7),c(13,"Modified"),o(),n(14,"option",8),c(15,"Moved"),o(),n(16,"option",9),c(17,"Copied"),o(),n(18,"option",10),c(19,"Removed"),o(),n(20,"option",11),c(21,"Error"),o()()(),n(22,"div",12)(23,"button",13),E(24,"translate"),d("click",function(){return l.refresh()}),C(25,"fa-icon",14),o(),n(26,"button",15),E(27,"translate"),d("click",function(){return l.openClearDialog()}),C(28,"fa-icon",14),o(),C(29,"app-input-filter",16),o()(),n(30,"table",17)(31,"thead")(32,"tr"),g(33,we,1,1,null,null,ye),E(35,"keyvalue"),o()()(),n(36,"app-virtual-scroll",18)(37,"table",19)(38,"tbody",20),g(39,Ie,4,5,"tr",21,he),o()()()),s&2&&(a(2),m("ngModel",l.syncPathSelected),a(),m("ngValue",null),a(2),w(l.store.clientSyncPaths()),a(2),m("ngModel",l.action),a(),m("ngValue",null),a(15),m("tooltip",F(24,11,"Refresh",l.locale.language)),a(2),m("icon",l.icons.faRedo),a(),m("tooltip",F(27,14,"Clear events",l.locale.language)),a(2),m("icon",l.icons.faTrashCan),a(5),w(F(35,17,l.tableHeaders,l.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",l.transfers)("resizeOffset",105),a(3),w(l.scrollView==null?null:l.scrollView.viewPortItems))},dependencies:[ne,ee,te,Z,J,X,P,re,z,R,Q,oe,W],encapsulation:2});let t=r;return t})();export{_t as SyncTransfersComponent};
1
+ import{a as fe}from"./chunk-WZPF4LS2.js";import"./chunk-3ZBAQTHJ.js";import{h as V}from"./chunk-XSURUW7C.js";import"./chunk-RTNEBRKJ.js";import{a as z}from"./chunk-XZHWESIY.js";import{a as Q,b as _e}from"./chunk-S44QIK3G.js";import"./chunk-WRK2FTKU.js";import{Cb as M,gb as ce,pb as pe,qb as me,rb as q,s as re,vb as de}from"./chunk-AALPWGPB.js";import{d as G}from"./chunk-3MVPXC3U.js";import{Bb as b,Cd as ne,Eb as d,Ed as ie,Gb as p,Ia as H,Jd as oe,Kb as $,Kd as P,L as K,Lb as A,Mb as O,Oa as a,Pc as W,Qa as U,Qb as N,Rb as T,Sb as S,Tb as c,Ub as f,Vb as B,Wf as le,ab as k,cc as L,dc as Y,ef as ae,fg as se,gf as D,ja as u,jd as J,kc as E,lb as h,mb as y,mc as F,oa as x,od as X,pa as v,pb as g,qb as w,qg as R,rb as m,sb as n,tb as o,tc as j,ub as C,ud as Z,vd as ee,wd as te}from"./chunk-76M3BMK6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function Se(t,r){if(t&1&&(n(0,"span",6),c(1,"Events from"),o(),c(2,"\xA0"),n(3,"b"),c(4),o()),t&2){let e=p();a(4),f(e.syncPath.settings.name)}}function xe(t,r){t&1&&(n(0,"span",6),c(1,"All events"),o())}var ue=(()=>{let r=class r{constructor(){this.syncPath=null,this.wasDeleted=new U,this.layout=u(M),this.icons={faTrashCan:D},this.syncService=u(V)}doClear(){this.syncService.deleteTransfers(this.syncPath?.id).then(()=>{this.wasDeleted.emit(),this.layout.closeDialog()})}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=k({type:r,selectors:[["app-sync-transfers-delete-dialog"]],inputs:{syncPath:"syncPath"},outputs:{wasDeleted:"wasDeleted"},decls:18,vars:2,consts:[[1,"modal-header"],["translate","",1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["l10nTranslate",""],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","submit","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(s,l){s&1&&(n(0,"div",0)(1,"h4",1),C(2,"fa-icon",2),n(3,"span",3),c(4,"Clear events"),o()(),n(5,"button",4),d("click",function(){return l.layout.closeDialog()}),o()(),n(6,"div",5),h(7,Se,5,1)(8,xe,2,0,"span",6),n(9,"span"),c(10,"\xA0"),o(),n(11,"span",6),c(12,"will be cleared"),o()(),n(13,"div",7)(14,"button",8),d("click",function(){return l.layout.closeDialog()}),c(15,"Cancel"),o(),n(16,"button",9),d("click",function(){return l.doClear()}),c(17,"Confirm"),o()()),s&2&&(a(2),m("icon",l.icons.faTrashCan),a(5),y(l.syncPath?7:8))},dependencies:[P,R],encapsulation:2});let t=r;return t})();var he=(t,r)=>r.id,ye=(t,r)=>r.key;function ve(t,r){if(t&1&&(n(0,"option",4),c(1),o()),t&2){let e=r.$implicit;m("ngValue",e),a(),f(e.settings.name)}}function Te(t,r){if(t&1&&C(0,"fa-icon",14),t&2){let e=p(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function ge(t,r){if(t&1){let e=b();n(0,"th",23),d("click",function(){x(e);let s=p().$implicit,l=p();return v(l.sortBy(s.key))}),c(1),h(2,Te,1,1,"fa-icon",14),o()}if(t&2){let e=p().$implicit,i=p();S(e.value.class),N("width",e.value.width,"%"),T("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),B(" ",e.value.label," "),a(),y(i.sortTable.sortParam.column===e.key?2:-1)}}function we(t,r){if(t&1&&h(0,ge,3,10,"th",22),t&2){let e=r.$implicit;y(e.value.show?0:-1)}}function be(t,r){if(t&1&&(n(0,"span",26),C(1,"fa-icon",14)(2,"fa-icon",27),n(3,"span",28),c(4),o()()),t&2){let e=p(3).$implicit;a(),S(e.ok?e.sideIconClass:"circle-error-icon-sm"),m("icon",e.sideIcon),a(),T("text-danger",!e.ok),m("icon",e.actionIcon),a(),T("text-danger",!e.ok),a(),f(e.actionText)}}function Ee(t,r){if(t&1&&(n(0,"span",26)(1,"span",29),c(2),o()()),t&2){let e=p(3).$implicit;a(2),f(e.syncPathName)}}function Fe(t,r){if(t&1&&(n(0,"span"),c(1),o(),n(2,"span")(3,"b",33),c(4,"Source"),o(),c(5),o()),t&2){let e=p(4).$implicit;S(e.selected?"overflow-wrap-and-whitespace":"truncate"),a(),f(e.fileDst),a(),S(L("",e.selected?"overflow-wrap-and-whitespace":"truncate"," fs-xxxs")),a(3),B(":\xA0",e.file)}}function ke(t,r){if(t&1&&(n(0,"span"),c(1),o()),t&2){let e=p(4).$implicit;S(e.selected?"overflow-wrap-and-whitespace":"truncate"),a(),f(e.file)}}function Pe(t,r){if(t&1&&(n(0,"span"),c(1),o()),t&2){let e=p(4).$implicit;S(L("",e.selected?"overflow-wrap-and-whitespace":"truncate"," text-danger fs-xxxs")),a(),f(e.error)}}function De(t,r){if(t&1){let e=b();n(0,"div",26)(1,"img",30),d("error",function(){x(e);let s=p(3).$implicit;return v(s.fallBackMimeUrl())}),o(),n(2,"span",31),h(3,Fe,6,7)(4,ke,2,3,"span",32),h(5,Pe,2,4,"span",32),o()()}if(t&2){let e=p(3).$implicit;a(),m("src",e.mimeUrl,H),a(2),y(e.fileDst?3:4),a(2),y(e.ok?-1:5)}}function Re(t,r){if(t&1){let e=b();n(0,"div",34),d("mouseenter",function(){x(e);let s=p(3).$implicit;return v(s.hovered=!0)})("mouseleave",function(){x(e);let s=p(3).$implicit;return v(s.hovered=!1)}),n(1,"span"),c(2),o()()}if(t&2){let e=p(3).$implicit;a(2),f(e.hovered?e.timestamp:e.hTimeAgo)}}function Me(t,r){if(t&1&&(n(0,"td"),h(1,be,5,9,"span",26)(2,Ee,3,1,"span",26)(3,De,6,3,"div",26)(4,Re,3,1,"div"),o()),t&2){let e,i=p().$implicit,s=p().$implicit;S(Y("",i.value.class," ",i.value.newly?"prop-newly-"+s[i.value.newly]:"")),N("width",i.value.width,"%"),T("text-align-center",i.value.textCenter),a(),y((e=i.key)==="action"?1:e==="sync"?2:e==="file"?3:e==="date"?4:-1)}}function Ve(t,r){if(t&1&&h(0,Me,5,9,"td",25),t&2){let e=r.$implicit;y(e.value.show?0:-1)}}function Ie(t,r){if(t&1){let e=b();n(0,"tr",24),d("click",function(){let s=x(e).$implicit,l=p();return v(l.onSelect(s))}),g(1,Ve,1,1,null,null,ye),E(3,"keyvalue"),o()}if(t&2){let e=r.$implicit,i=p();T("selected",e.selected),a(),w(F(3,2,i.tableHeaders,i.originalOrderKeyValue))}}var _t=(()=>{let r=class r{constructor(){if(this.locale=u(ie),this.action=null,this.syncPathSelected=null,this.transfers=[],this.store=u(de),this.originalOrderKeyValue=ce,this.tableHeaders={action:{label:"Action",width:15,textCenter:!1,class:"",show:!0,sortable:!0},sync:{label:"Synchronization",width:15,textCenter:!1,class:"",show:!0,sortable:!0},file:{label:"File",width:55,textCenter:!1,class:"",show:!0,sortable:!0},date:{label:"Date",width:15,textCenter:!0,class:"",newly:"newly",show:!0,sortable:!0}},this.icons={faRedo:le,faTrashCan:D,faArrowDown:se,faArrowUp:ae},this.router=u(G),this.layout=u(M),this.syncService=u(V),this.sortSettings={default:[{prop:"timestamp",type:"date"}],action:[{prop:"actionText",type:"string"}],sync:[{prop:"syncPathName",type:"string"}],file:[{prop:"file",type:"string"}],date:[{prop:"timestamp",type:"date"}]},this.sortTable=new _e(this.constructor.name,this.sortSettings),this.focusOnSyncPathErrorsId=null,this.search=null,this.query=null,this.layout.setBreadcrumbIcon(me.TRANSFERS),this.layout.setBreadcrumbNav({url:`/${q.BASE}/${q.TRANSFERS}/${pe.TRANSFERS}`,splicing:2,translating:!0,sameLink:!0}),j(()=>{this.doSearch(this.inputFilter.search())}),this.checkRouteState(),this.focusOnSyncPathErrorsId){let i=this.store.clientSyncPaths().find(s=>s.id===this.focusOnSyncPathErrorsId);i?(this.syncPathSelected=i,this.onSelectAction("ERROR")):this.refresh()}else this.refresh()}doSearch(i){this.search=i,this.doQueryRefresh()}refresh(){this.onSelect(),this.syncService.getTransfers(this.syncPathSelected?.id,this.query).then(i=>{this.transfers=i.map(s=>new fe(s)),this.scrollView?.scrollInto(-1)})}onSelectPath(i){this.syncPathSelected=i,this.tableHeaders.sync.show=!this.syncPathSelected,this.refresh()}onSelectAction(i){this.action=i,this.doQueryRefresh()}onSelect(i){for(let s of this.transfers.filter(l=>l.selected))s.selected=!1;i&&(i.selected=!0)}openClearDialog(){this.layout.openDialog(ue,"md",{initialState:{syncPath:this.syncPathSelected||null}}).content.wasDeleted.pipe(K(1)).subscribe(()=>this.refresh())}sortBy(i,s=!0,l){this.transfers=this.sortTable.sortBy(i,s,l||this.transfers)}doQueryRefresh(){this.search&&this.action?this.action==="ERROR"?this.query=`(?=.*${this.search})(?=.*"ok":"false")`:this.query=`(?=.*${this.search})(?=.*"action":"${this.action}")`:this.action?this.query=this.action==="ERROR"?'"ok":false':`"action":"${this.action}"`:this.search?this.query=this.search:this.query=null,this.refresh()}checkRouteState(){let i=this.router.currentNavigation()?.extras.state;i?.id&&(this.focusOnSyncPathErrorsId=i.id)}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=k({type:r,selectors:[["app-sync-transfers"]],viewQuery:function(s,l){if(s&1&&($(z,5),$(Q,7)),s&2){let _;A(_=O())&&(l.scrollView=_.first),A(_=O())&&(l.inputFilter=_.first)}},decls:41,vars:20,consts:[[1,"app-top-menu"],[1,"btn-group","btn-group-sm"],[1,"form-select","form-select-sm","font-size-xs",2,"min-width","210px",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],[3,"ngValue"],[1,"form-select","form-select-sm","font-size-xs","ms-1",2,"min-width","170px",3,"ngModelChange","ngModel"],["l10nTranslate","","value","NEW|MKFILE|MKDIR"],["l10nTranslate","","value","DIFF"],["l10nTranslate","","value","MOVE"],["l10nTranslate","","value","COPY"],["l10nTranslate","","value","RM|RMDIR"],["l10nTranslate","","value","ERROR"],[1,"d-flex","ms-auto"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["placement","bottom","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"bufferAmount","items","resizeOffset"],[1,"app-table","mb-3"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["size","sm",1,"circle-gray-icon-sm",3,"icon"],["l10nTranslate","",1,"fs-xxxs"],[1,"fs-xxs","ms-1"],["alt","","width","24",1,"me-2",3,"error","src"],[1,"d-flex","flex-column","fs-xxs"],[3,"class"],["l10nTranslate",""],[3,"mouseenter","mouseleave"]],template:function(s,l){s&1&&(n(0,"div",0)(1,"div",1)(2,"select",2),d("ngModelChange",function(I){return l.onSelectPath(I)}),n(3,"option",3),c(4,"All syncs"),o(),g(5,ve,2,2,"option",4,he),o(),n(7,"select",5),d("ngModelChange",function(I){return l.onSelectAction(I)}),n(8,"option",3),c(9,"All events"),o(),n(10,"option",6),c(11,"Added"),o(),n(12,"option",7),c(13,"Modified"),o(),n(14,"option",8),c(15,"Moved"),o(),n(16,"option",9),c(17,"Copied"),o(),n(18,"option",10),c(19,"Removed"),o(),n(20,"option",11),c(21,"Error"),o()()(),n(22,"div",12)(23,"button",13),E(24,"translate"),d("click",function(){return l.refresh()}),C(25,"fa-icon",14),o(),n(26,"button",15),E(27,"translate"),d("click",function(){return l.openClearDialog()}),C(28,"fa-icon",14),o(),C(29,"app-input-filter",16),o()(),n(30,"table",17)(31,"thead")(32,"tr"),g(33,we,1,1,null,null,ye),E(35,"keyvalue"),o()()(),n(36,"app-virtual-scroll",18)(37,"table",19)(38,"tbody",20),g(39,Ie,4,5,"tr",21,he),o()()()),s&2&&(a(2),m("ngModel",l.syncPathSelected),a(),m("ngValue",null),a(2),w(l.store.clientSyncPaths()),a(2),m("ngModel",l.action),a(),m("ngValue",null),a(15),m("tooltip",F(24,11,"Refresh",l.locale.language)),a(2),m("icon",l.icons.faRedo),a(),m("tooltip",F(27,14,"Clear events",l.locale.language)),a(2),m("icon",l.icons.faTrashCan),a(5),w(F(35,17,l.tableHeaders,l.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",l.transfers)("resizeOffset",105),a(3),w(l.scrollView==null?null:l.scrollView.viewPortItems))},dependencies:[ne,ee,te,Z,J,X,P,re,z,R,Q,oe,W],encapsulation:2});let t=r;return t})();export{_t as SyncTransfersComponent};
@@ -1 +1 @@
1
- import{A as Ht}from"./chunk-E32J777S.js";import{c as X,d as Le,h as ee,m as ue}from"./chunk-RTNEBRKJ.js";import{a as Ut}from"./chunk-HGODIZTV.js";import{b as Bt}from"./chunk-6WMXMIE4.js";import{l as Dt,n as Pt,o as Rt,p as Nt,q as H,r as $t,s as K,w as Ot}from"./chunk-B6HQYQYG.js";import{a as Mt,b as Ft}from"./chunk-GWRAGN3M.js";import{b as Q}from"./chunk-27Z3SYRL.js";import{$a as de,Ba as he,Ca as At,Cb as Y,Db as f,Gb as It,Hb as wt,Ib as xt,Ja as Ie,K as Ct,Mb as xe,N as kt,Na as N,Nb as U,Ob as y,Pb as Tt,W as ce,Wa as Et,gb as bt,ib as vt,s as at,t as lt,tb as yt,w as pt,x as ct,y as mt,ya as C}from"./chunk-O3YLAEVE.js";import{d as se}from"./chunk-QHJT5H4M.js";import{Bb as oe,Cd as rt,Dd as ot,Eb as D,Ed as le,Ee as ft,G as _e,Gb as u,Gf as gt,Jd as pe,Kd as st,L as $e,Oa as l,Od as ht,Pc as je,Qa as Ce,Qb as He,Ra as Be,Rb as J,Sb as P,Tb as c,Ub as W,Vb as M,Wb as Ke,Xb as Ee,Yb as be,Yc as Z,Yf as _t,Zb as ve,ab as re,cc as G,ea as R,ed as qe,f as Re,fd as We,gc as Ve,ha as Oe,hd as ae,ia as ne,ie as dt,ja as d,jd as Ge,kc as b,kd as Ze,lb as A,ld as ye,le as ut,mb as E,mc as v,nb as Ue,nd as _,oa as j,od as Ye,p as z,pa as q,pb as ke,pd as Xe,qb as Ae,qd as ze,qg as me,ra as Me,rb as m,rg as we,sb as s,sd as Je,sg as Lt,t as Ne,tb as a,td as Qe,tg as B,ub as g,ud as et,v as S,vd as tt,wd as it,xa as Fe,xd as nt,yf as St}from"./chunk-D55YR5X7.js";import{n as F}from"./chunk-DM4NXKEP.js";import{a as I,b as T,d as Pe}from"./chunk-KAVP6UXH.js";var $={BASE:`${ce}/link`,LINK:"link",VALIDATION:"validation",ACCESS:"access",DOWNLOAD:"download",AUTH:"auth"},Kt=`${$.BASE}/${$.VALIDATION}`,Vt=`${$.BASE}/${$.ACCESS}`,jt=`${$.BASE}/${$.DOWNLOAD}`,qt=`${$.BASE}/${$.AUTH}`;var h={BASE:`${ce}/shares`,LIST:"list",CHILDREN:"children",LINKS:"links",LINKS_LIST:"links/list",LINKS_UUID:"links/uuid"},Wt=`${h.BASE}/${h.LIST}`,te=`${h.BASE}/${h.LINKS}`,Gt=`${h.BASE}/${h.LINKS_LIST}`,Zt=`${h.BASE}/${h.LINKS_UUID}`;var Yt=new Oe("WindowToken",typeof window<"u"&&window.document?{providedIn:"root",factory:()=>window}:{providedIn:"root",factory:()=>{}});var Xt=(()=>{class o{constructor(i,e,t){this.ngZone=i,this.document=e,this.window=t,this.copySubject=new Re,this.copyResponse$=this.copySubject.asObservable(),this.config={}}configure(i){this.config=i}copy(i){if(!this.isSupported||!i)return this.pushCopyResponse({isSuccess:!1,content:i});let e=this.copyFromContent(i);return e?this.pushCopyResponse({content:i,isSuccess:e}):this.pushCopyResponse({isSuccess:!1,content:i})}get isSupported(){return!!this.document.queryCommandSupported&&!!this.document.queryCommandSupported("copy")&&!!this.window}isTargetValid(i){if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement){if(i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');return!0}throw new Error("Target should be input or textarea")}copyFromInputElement(i,e=!0){try{this.selectTarget(i);let t=this.copyText();return this.clearSelection(e?i:void 0,this.window),t&&this.isCopySuccessInIE11()}catch{return!1}}isCopySuccessInIE11(){let i=this.window.clipboardData;return!(i&&i.getData&&!i.getData("Text"))}copyFromContent(i,e=this.document.body){if(this.tempTextArea&&!e.contains(this.tempTextArea)&&this.destroy(this.tempTextArea.parentElement||void 0),!this.tempTextArea){this.tempTextArea=this.createTempTextArea(this.document,this.window);try{e.appendChild(this.tempTextArea)}catch{throw new Error("Container should be a Dom element")}}this.tempTextArea.value=i;let t=this.copyFromInputElement(this.tempTextArea,!1);return this.config.cleanUpAfterCopy&&this.destroy(this.tempTextArea.parentElement||void 0),t}destroy(i=this.document.body){this.tempTextArea&&(i.removeChild(this.tempTextArea),this.tempTextArea=void 0)}selectTarget(i){return i.select(),i.setSelectionRange(0,i.value.length),i.value.length}copyText(){return this.document.execCommand("copy")}clearSelection(i,e){i&&i.focus(),e.getSelection()?.removeAllRanges()}createTempTextArea(i,e){let t=i.documentElement.getAttribute("dir")==="rtl",n;n=i.createElement("textarea"),n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let p=e.pageYOffset||i.documentElement.scrollTop;return n.style.top=p+"px",n.setAttribute("readonly",""),n}pushCopyResponse(i){this.copySubject.observers.length>0&&this.ngZone.run(()=>{this.copySubject.next(i)})}pushCopyReponse(i){this.pushCopyResponse(i)}}return o.\u0275fac=function(i){return new(i||o)(ne(Be),ne(Me),ne(Yt,8))},o.\u0275prov=R({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Te=(function(o){return o[o.COMMON=0]="COMMON",o[o.LINK=1]="LINK",o})(Te||{}),zt=Object.values(C).filter(o=>o!==C.SHARE_INSIDE).sort().join(":");function ni(o,r){if(o&1&&g(0,"fa-icon",2),o&2){let i=u();P(i.repository.class),He("min-width",i.galleryMode.dimensions/3,"px")("min-height",i.galleryMode.dimensions/3,"px")("font-size",i.galleryMode.faSize/1.8,"px"),m("icon",i.repository.icon)}}function ri(o,r){if(o&1&&g(0,"fa-icon",5),o&2){let i=u(2);P(i.repository.class),m("icon",i.repository.icon)}}function oi(o,r){if(o&1&&(c(0),b(1,"translate")),o&2){let i=u(2);M(" ",v(1,1,i.repository.label,i.locale.language)," ")}}function si(o,r){if(o&1&&c(0),o&2){let i=u(2);M(" ",i.repository.label," ")}}function ai(o,r){if(o&1&&(s(0,"div",1),A(1,ri,1,3,"fa-icon",3),s(2,"span",4),A(3,oi,2,4)(4,si,1,1),a()()),o&2){let i=u();l(),E(i.showIcon?1:-1),l(2),E(i.repository.translate?3:4)}}var Jt=(()=>{let r=class r{constructor(){this.showIcon=!0,this.showFullPath=!1,this.locale=d(le),this.layout=d(Y),this.unknownRepository={icon:ht,label:"",class:"circle-primary-icon",translate:!1}}ngOnInit(){this.setRepository()}ngOnChanges(){this.setRepository()}setRepository(){this.share.parent?.id||this.share.parent?.id===0?this.repository={icon:U.SHARES,label:this.share.parent.name,class:"circle-purple-icon",translate:!1}:this.share.file?.ownerId?this.repository={icon:U.PERSONAL,label:xe.PERSONAL_FILES,class:"circle-primary-icon",translate:!0}:this.share.file?.space?.alias?this.repository={icon:U.SPACES,label:`${this.share.file.space.name}`,class:"circle-primary-icon",translate:!1}:this.share.externalPath?this.repository={icon:U.EXTERNAL,label:"External",class:"circle-primary-icon",translate:!0}:this.repository=I({},this.unknownRepository),this.showFullPath&&this.setFullPath()}setFullPath(){if(!this.repository.label)return;let e=this.share.file?.path?this.share.file.path.split("/").filter(t=>t&&t!=="."):[];this.share.parent?.id&&!this.share.file?.id&&this.share.file?.path.indexOf("/")===-1?e.shift():this.share.file?.space?.alias&&this.share.file.space?.root?.alias&&(e.length?e.unshift(this.share.file.space.root.name):e.push(this.share.file.space.root.name)),this.repository.label===xe.PERSONAL_FILES&&(this.repository.label=this.layout.translateString(this.repository.label)),e.length&&(this.repository.label=`${this.repository.label}/${e.join("/")}`)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=re({type:r,selectors:[["app-share-repository"]],inputs:{share:"share",galleryMode:"galleryMode",showIcon:"showIcon",showFullPath:"showFullPath"},features:[Fe],decls:2,vars:1,consts:[[3,"icon","class","min-width","min-height","font-size"],[1,"d-flex","align-items-center","overflow-wrap-and-whitespace"],[3,"icon"],[1,"me-2",3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"me-2",3,"icon"]],template:function(t,n){t&1&&A(0,ni,1,9,"fa-icon",0)(1,ai,5,2,"div",1),t&2&&E(n.galleryMode?0:1)},dependencies:[me,pe],encapsulation:2});let o=r;return o})();function Se(o){o.file?.id?(o.file.isDir&&(o.file.mime=o.parent?.alias?Le:X),o.mimeUrl=ee(o.file.mime)):o.mimeUrl=ee(o.parent?.alias?Le:X)}function Qt(o){let r,i=o.file.path?o.file.path.split("/").filter(t=>t&&t!=="."):[];if(o.parent?.id){if(!i.length)return[y.SPACES_SHARES,o.parent.alias];r=`${y.SPACES_SHARES}/${o.parent.alias}`}else o.file.space?.alias?o.file.inTrash?r=`${y.SPACES_TRASH}/${o.file.space.alias}`:(r=`${y.SPACES_FILES}/${o.file.space.alias}`,o.file.space?.root?.alias&&(i.length?r=`${r}/${o.file.space.root.alias}`:i.push(o.file.space.root.name))):o.file?.ownerId?r=`${o.file.inTrash?y.PERSONAL_TRASH:y.PERSONAL_FILES}`:console.warn("unable to find the right file path",o);let e=i.pop();return r&&i.length&&(r=`${r}/${i.join("/")}`),[r,e]}var w=class{constructor(r){this.members=[],this.links=[],this.hPerms={},this.setMembers(N("members",r),r.externalPath||r.file?.isDir?[C.SHARE_INSIDE]:[]),Object.assign(this,r),Se(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=ue}setMembers(r,i){if(r)for(let e of r)e.linkId?this.links.push(new K(e,[...i,C.SHARE_OUTSIDE])):this.members.push(new K(e,i))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(":").filter(r=>r===C.SHARE_INSIDE||r===C.ADD&&this.file.id&&!this.file.isDir?!1:!(r===C.DELETE&&this.file.id&&!this.file.isDir)).join(":")))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=H(this.file.permissions):this.externalPath&&(this.hPerms=H(zt))}};var ei=(()=>{let r=class r{constructor(){this.http=d(Z),this.router=d(se)}getShare(e){return this.http.get(`${h.BASE}/${e}`).pipe(S(t=>new w(t)))}createShare(e){return this.http.post(h.BASE,e).pipe(S(t=>new w(t)))}updateShare(e){return this.http.put(`${h.BASE}/${e.id}`,e).pipe(S(t=>new w(t)))}deleteShare(e){return this.http.delete(`${h.BASE}/${e}`)}listShares(){return this.http.get(Wt)}getShareChild(e,t){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}/${t}`).pipe(S(n=>new w(n)))}updateShareChild(e,t,n){return this.http.put(`${h.BASE}/${e}/${h.CHILDREN}/${t}`,n).pipe(S(p=>new w(p)))}deleteShareChild(e,t){return this.http.delete(`${h.BASE}/${e}/${h.CHILDREN}/${t}`)}listChildShares(e){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}`)}initShareFromFile(e,t,n=!1,p=!1){let k,x=null,L=I({id:0,name:"",createdAt:new Date,modifiedAt:new Date,storageIndexing:!0,enabled:!0},n?{parent:{id:0,ownerId:0,alias:t.space.alias,name:t.space.name}}:{});if(t){p&&(x=t.root.id);let De=null;(t?.root?.owner.login===e.login||!t?.space?.alias)&&(t.space=null,De=e.id),k=new w(T(I({},L),{name:t.name,file:T(I({},t),{path:p?".":Et(t.path,2),ownerId:De})}))}else k=new w(L);return[k,x]}goTo(e){if(!e.id)return Ne(z(!1));if(e.externalPath&&!e.parent?.id)return this.router.navigate([y.SPACES_SHARES],{queryParams:{select:e.name}});if(e.parent?.id&&!e.file?.id&&e.file?.path.indexOf("/")===-1)return this.router.navigate([y.SPACES_SHARES],{queryParams:{select:e.parent.name}});{let[t,n]=Qt(e);return this.router.navigate([t],{queryParams:{select:n}})}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var O=class{constructor(r){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,r),Se(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=ue}updatePermission(){this.hPerms=H(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=F(this.link.currentAccess).fromNow(!0),this.newly=de(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date(F(this.link.expiresAt).local().format("YYYY-MM-DD"));let r=Math.max(0,F(this.link.expiresAt).diff(F(),"hours"));r===0?this.hTimeExpirationAgo=0:r<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(r/24)+1}else this.hTimeExpirationAgo=0}};var V=class{constructor(r){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=H(r.permissions),this.setMembers(N("members",r)),this.setRoots(N("roots",r)),Object.assign(this,r),this.hTimeAgo=F(this.modifiedAt).fromNow(!0),this.newly=de(this.modifiedAt),this.sort()}addRoot(r,i=!1){r.hPerms=Rt(r.permissions,[C.SHARE_INSIDE]),r.owner?.login&&(r.owner.avatarUrl=yt(r.owner.login)),r.file.mimeUrl=ee(r.file?.mime?r.file.mime:X),i?this.roots.unshift(r):this.roots.push(r),r.isDir=r.file.mime===X||!!r.externalPath}havePermission(r){return this.permissions.indexOf(r)>-1}setMembers(r){if(r)for(let i of r){let e=new K(i);e.isLink?this.links.push(e):e.spaceRole===he.IS_MANAGER?this.managers.push(e):this.members.push(e)}}setRoots(r){if(r)for(let i of r)this.addRoot(i)}sort(){Q(this.roots,"createdAt",!1),Q(this.managers,"createdAt",!1),Q(this.members,"createdAt",!1),Q(this.links,"createdAt",!1)}};var ti=(()=>{let r=class r{constructor(){this.http=d(Z)}listSpaces(){return this.http.get(It).pipe(S(e=>e.map(t=>new V(t))))}getSpace(e){return this.http.get(`${f.BASE}/${e}`).pipe(S(t=>new V(t)))}getUserSpaceRoots(e){return this.http.get(`${f.BASE}/${e}/${f.ROOTS}`)}createUserSpaceRoots(e,t){return this.http.post(`${f.BASE}/${e}/${f.ROOTS}`,t)}updateUserSpaceRoots(e,t){return this.http.put(`${f.BASE}/${e}/${f.ROOTS}`,t)}updateSpace(e){return this.http.put(`${f.BASE}/${e.id}`,e).pipe(S(t=>t?new V(t):null))}createSpace(e){return this.http.post(f.BASE,e).pipe(S(t=>(t.permissions=At,new V(t))))}deleteSpace(e,t){return this.http.request("delete",`${f.BASE}/${e}`,{body:t})}searchSpaces(e){return this.http.request("search",f.BASE,{body:e})}listSpaceShares(e){return this.http.get(`${f.BASE}/${e}/${f.SHARES}`)}getSpaceShare(e,t){return this.http.get(`${f.BASE}/${e}/${f.SHARES}/${t}`).pipe(S(n=>new w(n)))}updateSpaceShare(e,t){return this.http.put(`${f.BASE}/${e}/${f.SHARES}/${t.id}`,t).pipe(S(n=>new w(n)))}deleteSpaceShare(e,t){return this.http.delete(`${f.BASE}/${e}/${f.SHARES}/${t}`)}getSpaceShareLink(e,t){return this.http.get(`${f.BASE}/${e}/${f.LINKS}/${t}`).pipe(S(n=>new O(n)))}listTrashBins(){return this.http.get(wt)}checkSpaceRootPath(e){return this.http.post(xt,{path:e})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var pi=o=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:o,showWeekNumbers:!1}),ci=(o,r)=>r.key;function mi(o,r){o&1&&(s(0,"span",4),c(1,"Edit link"),a())}function hi(o,r){o&1&&(s(0,"span",4),c(1,"New link"),a())}function di(o,r){o&1&&g(0,"div",54)}function ui(o,r){if(o&1){let i=oe();s(0,"button",53),b(1,"translate"),ve("ngModelChange",function(t){let n=j(i).$implicit,p=u(3);return be(p.permissions[n.key],t)||(p.permissions[n.key]=t),q(t)}),D("ngModelChange",function(){j(i);let t=u(3);return q(t.onPermissionChange())}),g(2,"fa-icon",50),a(),A(3,di,1,0,"div",54)}if(o&2){let i=r.$implicit,e=r.$index,t=r.$count,n=u(3);Ee("ngModel",n.permissions[i.key]),m("tooltip",v(1,4,n.SPACES_PERMISSIONS_TEXT[i.key].text,n.locale.language)),l(2),m("icon",n.SPACES_PERMISSIONS_TEXT[i.key].icon),l(),E(e===t-1?3:-1)}}function fi(o,r){if(o&1&&(ke(0,ui,4,7,null,null,ci),b(2,"keyvalue")),o&2){let i=u(2);Ae(v(2,0,i.permissions,i.originalOrderKeyValue))}}function Si(o,r){if(o&1&&(s(0,"div",51),g(1,"app-share-repository",55),a()),o&2){let i=u(2);l(),m("share",i.share)("showIcon",!0)("showFullPath",!0)}}function gi(o,r){if(o&1){let i=oe();s(0,"div",44),g(1,"fa-icon",45),s(2,"div",46)(3,"span"),c(4),a(),s(5,"span",47),c(6),a()(),s(7,"div",48),A(8,fi,3,3),s(9,"button",49),b(10,"translate"),D("click",function(){j(i);let t=u();return q(t.toggleRequireAuth())}),g(11,"fa-icon",50),a(),s(12,"button",49),b(13,"translate"),D("click",function(){j(i);let t=u();return q(t.copyToClipboard())}),g(14,"fa-icon",50),a()()(),A(15,Si,2,3,"div",51),g(16,"hr",52)}if(o&2){let i=u();l(),m("icon",i.icons.links),l(3),W(i.linkForm.value.name||i.linkForm.value.shareName),l(2),W(i.linkForm.value.email),l(2),E(i.share&&i.permissions?8:-1),l(),P(G("btn btn-sm ",i.linkForm.value.requireAuth?"btn-success":"btn-warning")),m("tooltip",v(10,15,"Password",i.locale.language)),l(2),m("icon",i.linkForm.value.requireAuth?i.icons.faLock:i.icons.faLockOpen),l(),P(G("btn btn-sm ms-2 ",i.linkWasCopied?"btn-info":"btn-secondary")),m("tooltip",v(13,18,"Copy link",i.locale.language)),l(2),m("icon",i.linkWasCopied?i.icons.faClipboardCheck:i.icons.faClipboard),l(),E(i.share?15:-1)}}function _i(o,r){if(o&1&&(s(0,"span"),c(1),a()),o&2){let i=u();P(G("badge rounded-pill ",(i.share?i.share.link.nbAccess:i.link.nbAccess)>=i.linkForm.value.limitAccess?"bg-danger":"bg-success")),l(),Ke(" ",i.share?i.share.link.nbAccess:i.link.nbAccess,"/",i.linkForm.value.limitAccess," ")}}function Ci(o,r){if(o&1&&(s(0,"span",20),c(1),a()),o&2){let i=u();l(),W(i.share?i.share.link.nbAccess:i.link.nbAccess)}}function ki(o,r){if(o&1&&(s(0,"div",27)(1,"label",56),c(2,"Share name"),a(),g(3,"input",57),b(4,"translate"),a(),s(5,"div",27)(6,"label",58),c(7,"Share description"),a(),g(8,"input",59),b(9,"translate"),a()),o&2){let i=u();l(3),J("is-invalid",i.linkForm.controls.shareName.invalid),m("placeholder",v(4,4,"Share name",i.locale.language)),l(5),m("placeholder",v(9,7,"Share description",i.locale.language))}}function Ai(o,r){if(o&1&&(s(0,"option",30),c(1),a()),o&2){let i=r.$implicit,e=u();m("ngValue",i),l(),W(e.i18nLanguageText[i])}}function Ei(o,r){if(o&1&&(s(0,"div",37),g(1,"app-password-strength-bar",60),a()),o&2){let i=u();l(),m("passwordToCheck",i.password)}}function bi(o,r){if(o&1){let i=oe();s(0,"button",61),D("click",function(){j(i);let t=u();return q(t.confirmDeletion=!0)}),c(1," Remove "),a()}if(o&2){let i=u();m("disabled",i.confirmDeletion)}}var ge=(()=>{let r=class r{constructor(){this.layout=d(Y),this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.submitEvent=new Ce,this.shareChange=new Ce,this.locale=d(le),this.confirmDeletion=!1,this.submitted=!1,this.SPACES_PERMISSIONS_TEXT=Tt,this.originalOrderKeyValue=bt,this.icons={faEye:dt,faEyeSlash:_t,links:U.LINKS,faClipboard:ft,faClipboardCheck:ut,faLock:gt,faLockOpen:St},this.languages=this.layout.getLanguages(),this.minDate=Ie(),this.defaultPassword=this.layout.translateString(Ct),this.passwordMinLength=8,this.password="",this.linkIsExpired=!1,this.linkIsHovered=!1,this.linkWasCopied=!1,this.i18nLanguageText=kt,this.userService=d(Ot),this.sharesService=d(ei),this.linksService=d(ii),this.spacesService=d(ti),this.minDate.setDate(this.minDate.getDate()+1)}ngOnInit(){this.link?this.initLink():this.file?this.initFile():this.initShareLink(),this.linkForm.value.requireAuth&&(this.password=this.defaultPassword),this.linkForm.value.expiresAt&&this.isLinkIsExpired(this.share?this.share.link.expiresAt:this.link.expiresAt),this.linkForm.controls.expiresAt.valueChanges.subscribe(e=>this.isLinkIsExpired(e))}onPermissionChange(){let e=$t(this.permissions);this.linkForm.controls.permissions.setValue(e),e!==this.share.link.permissions?this.linkForm.controls.permissions.markAsDirty():this.linkForm.controls.permissions.markAsPristine()}toggleRequireAuth(){this.linkForm.controls.requireAuth.setValue(!this.linkForm.value.requireAuth),this.linkForm.controls.requireAuth.markAsDirty()}copyToClipboard(){this.linksService.copyLinkToClipboard(this.share?this.share.link.uuid:this.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.linkForm.value.name||this.linkForm.value.shareName),setTimeout(()=>this.linkWasCopied=!1,3e3)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion){(this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.layout.sendNotification("success","Link deleted",this.share.link.name||this.share.name),this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:p=>{this.layout.sendNotification("error","Delete share",this.share.name,p),this.layout.closeDialog()}});return}if(this.file?.id){let t=this.share,{link:n}=t,p=Pe(t,["link"]),k=T(I(I({},n),this.linkForm.value),{password:this.mustIncludePassword()?this.password:void 0});p.name=N("shareName",k),p.description=N("shareDescription",k);let x=this.linksService.shareLinkGuestToMember(-1,-1,k);this.sharesService.createShare(T(I({},p),{type:Te.LINK,links:[x]})).subscribe({next:L=>{this.shareChange.emit(["add",L]),this.layout.sendNotification("success","Link created",n.name||L.name),this.layout.closeDialog()},error:L=>{this.layout.sendNotification("error","Link error",this.share.name,L),this.layout.closeDialog()}});return}let e={};for(let n in this.linkForm.controls)this.linkForm.controls[n].dirty&&(e[n]=this.linkForm.controls[n].value);if(this.mustIncludePassword()&&(e.password=this.password),this.share?.id){Object.keys(e).length&&this.linksService.updateLinkFromSpaceOrShare(this.share.link.id,this.share.id,Lt.SHARE,e).subscribe({next:n=>{this.share.name=this.linkForm.value.shareName,this.share.description=this.linkForm.value.shareDescription,this.share.link=Object.assign(this.share.link,n),this.share.updateTimes(),this.share.updatePermission(),this.shareChange.emit(["update",this.share]),this.layout.closeDialog()},error:n=>{this.layout.sendNotification("error","Link error",this.share.link.name||this.share.name,n),this.layout.closeDialog()}}),this.layout.closeDialog();return}this.submitEvent.emit(e)}initFile(){let e=this.sharesService.initShareFromFile(this.userService.user,this.file,this.isSharesRepo,this.inSharesList)[0];this.share=T(I({},e),{link:{id:-1,userId:-1,uuid:"",isActive:!0,requireAuth:!1,permissions:"",nbAccess:0,limitAccess:0}}),this.linksService.genUUID().subscribe(t=>this.share.link.uuid=t),this.initShareLink(),this.onPermissionChange()}initShareLink(){this.linkForm=new ye({shareName:new _(this.share.name,ae.required),shareDescription:new _(this.share.description||""),name:new _(this.share.link?.name||""),email:new _(this.share.link?.email||"",ae.email),language:new _(this.share.link.language||null),limitAccess:new _(this.share.link.limitAccess||null),expiresAt:new _(this.share.link.expiresAt||null),requireAuth:new _(this.share.link.requireAuth||!1),permissions:new _(this.share.link.permissions),isActive:new _(this.share.link.isActive)}),this.permissions=Nt(this.share.file.permissions,this.share.link.permissions,[C.SHARE_INSIDE,C.SHARE_OUTSIDE,...this.share.file.isDir?[]:[C.DELETE,C.ADD]])}initLink(){this.linkForm=new ye({shareName:new _(""),shareDescription:new _(""),name:new _(this.link.name||""),email:new _(this.link.email||"",ae.email),language:new _(this.link.language||null),limitAccess:new _(this.link.limitAccess||null),expiresAt:new _(this.link.expiresAt||null),requireAuth:new _(this.link.requireAuth||!1),permissions:new _(this.link.permissions),isActive:new _(this.link.isActive)}),this.link.id||(this.linkForm.controls.name.markAsDirty(),this.linkForm.controls.isActive.markAsDirty())}isLinkIsExpired(e){if(e==null){if(this.linkIsExpired=!1,e===null)return;this.linkForm.controls.expiresAt.setValue(null)}this.linkIsExpired=Ie()>=e}mustIncludePassword(){return!!this.password.length&&this.password!==this.defaultPassword}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=re({type:r,selectors:[["app-link-dialog"]],inputs:{share:"share",parentSpaceId:"parentSpaceId",link:"link",file:"file",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList"},outputs:{submitEvent:"submitEvent",shareChange:"shareChange"},decls:73,vars:52,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],["autocomplete","off",3,"formGroup"],[1,"d-flex"],[1,"d-flex","flex-column","flex-grow-1"],[1,"d-flex","align-items-center","cursor-pointer","py-2",3,"mouseover","mouseleave","focus","click"],["for","link","l10nTranslate",""],["id","link",1,"ms-auto"],[1,"d-flex","align-items-center","py-2"],["for","state","l10nTranslate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","state","formControlName","isActive","type","checkbox","role","button",1,"form-check-input"],["for","access","l10nTranslate",""],["id","access",1,"ms-auto"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"d-flex","align-items-center"],["for","guestName","l10nTranslate",""],["id","guestName","formControlName","name","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between","px-0"],["for","guestEmail","l10nTranslate",""],["id","guestEmail","autocomplete","off","formControlName","email","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between"],["for","guestLanguage","l10nTranslate",""],["id","guestLanguage","formControlName","language",1,"form-control","form-select","form-select-sm","ms-auto","w-50"],[3,"ngValue"],["for","limitAccess","l10nTranslate",""],["id","limitAccess","formControlName","limitAccess","min","1","type","number",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","expiration","l10nTranslate",""],["bsDatepicker","","id","expiration","formControlName","expiresAt","placement","left","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder","bsConfig"],[1,"d-flex","align-items-center","px-0"],["for","requireAuth","translate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","d-none","d-sm-flex","mx-auto"],["id","requireAuth","formControlName","requireAuth","type","checkbox","role","button",1,"form-check-input"],["placeholder","Set a password",2,"width","45%",3,"passwordChange","isRequired","disabled","passwordMinLength","password","showGenerator"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"d-flex","flex-fill","align-items-center"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","flex-column","overflow-wrap-and-whitespace","me-2"],[1,"fs-xxxs"],[1,"d-flex","ms-auto"],["container","body","type","button",3,"click","tooltip"],["size","lg",3,"icon"],[1,"d-flex","align-items-center","d-none","d-sm-flex","py-2"],[1,"my-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-0","ms-2",3,"ngModelChange","ngModel","tooltip"],[1,"vr","mx-2"],["id","file",3,"share","showIcon","showFullPath"],["for","shareName","l10nTranslate",""],["id","shareName","formControlName","shareName","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","shareDescription","l10nTranslate",""],["id","shareDescription","formControlName","shareDescription","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(t,n){t&1&&(s(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),s(3,"span"),c(4),a()(),s(5,"h4",3),A(6,mi,2,0,"span",4)(7,hi,2,0,"span",4),a(),s(8,"button",5),D("click",function(){return n.layout.closeDialog()}),a()(),s(9,"div",6),A(10,gi,17,21),s(11,"form",7)(12,"div",8)(13,"div",9)(14,"div",10),D("mouseover",function(){return n.linkIsHovered=!0})("mouseleave",function(){return n.linkIsHovered=!1})("focus",function(){return n.linkIsHovered=!0})("click",function(){return n.copyToClipboard()}),s(15,"label",11),c(16,"Link"),a(),s(17,"span",12),c(18),a()(),s(19,"div",13)(20,"label",14),c(21,"Active"),a(),s(22,"div",15),g(23,"input",16),s(24,"span"),c(25),b(26,"translate"),a()()(),s(27,"div",13)(28,"label",17),c(29,"Current access count"),a(),s(30,"span",18),A(31,_i,2,5,"span",19)(32,Ci,2,1,"span",20),a()(),A(33,ki,10,10),s(34,"div",21)(35,"label",22),c(36,"Guest name"),a(),g(37,"input",23),b(38,"translate"),a(),s(39,"div",24)(40,"label",25),c(41,"Guest email"),a(),g(42,"input",26),b(43,"translate"),a(),s(44,"div",27)(45,"label",28),c(46,"Guest language"),a(),s(47,"select",29),ke(48,Ai,2,2,"option",30,Ue),a()(),s(50,"div",27)(51,"label",31),c(52,"Limit access"),a(),g(53,"input",32),b(54,"translate"),a(),s(55,"div",27)(56,"label",33),c(57,"Expiration"),a(),g(58,"input",34),b(59,"translate"),a(),s(60,"div",35)(61,"label",36),c(62,"Password"),a(),A(63,Ei,2,1,"div",37),s(64,"div",15),g(65,"input",38),a(),s(66,"app-input-password",39),ve("passwordChange",function(k){return be(n.password,k)||(n.password=k),k}),a()()()()()(),s(67,"div",40),A(68,bi,2,1,"button",41),s(69,"button",42),D("click",function(){return n.onCancel()}),c(70,"Cancel"),a(),s(71,"button",43),D("click",function(){return n.onSubmit()}),c(72),a()()),t&2&&(l(2),m("icon",n.icons.links),l(2),W(n.linkForm.value.name||n.linkForm.value.shareName),l(2),E(n.share!=null&&n.share.id||n.link!=null&&n.link.id?6:7),l(4),E(n.share||n.link?10:-1),l(),m("formGroup",n.linkForm),l(6),J("text-primary",n.linkIsHovered),l(),M(" ",n.share?n.share.link.uuid:n.link.uuid," "),l(6),P(G("badge rounded-pill ms-3 ",n.linkForm.value.isActive?"bg-primary":"bg-danger")),l(),M(" ",v(26,35,n.linkForm.value.isActive?"yes":"no",n.locale.language)," "),l(6),E(n.linkForm.value.limitAccess?31:32),l(2),E(n.share?33:-1),l(4),m("placeholder",v(38,38,"Guest name",n.locale.language)),l(5),J("is-invalid",n.linkForm.controls.email.invalid),m("placeholder",v(43,41,"Guest email",n.locale.language)),l(6),Ae(n.languages),l(5),m("placeholder",v(54,44,"Unlimited",n.locale.language)),l(5),J("text-danger",n.linkIsExpired),m("placeholder",v(59,47,"Never expires",n.locale.language))("bsConfig",Ve(50,pi,n.minDate)),l(5),E(n.linkForm.value.requireAuth&&n.password!==n.defaultPassword?63:-1),l(3),m("isRequired",n.linkForm.value.requireAuth)("disabled",!n.linkForm.value.requireAuth)("passwordMinLength",n.passwordMinLength),Ee("password",n.password),m("showGenerator",!0),l(2),E(n.share!=null&&n.share.id?68:-1),l(3),P(G("btn btn-sm ",n.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",n.linkForm.invalid||n.linkForm.controls.requireAuth.value&&n.password.length<n.passwordMinLength||n.submitted),l(),M(" ",n.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[me,st,mt,pt,ct,Ft,Mt,rt,Xe,tt,it,We,ze,qe,et,Ge,Ze,nt,Ye,Dt,lt,at,ot,Je,Qe,Jt,Ut,je,pe],encapsulation:2});let o=r;return o})();var ii=(()=>{let r=class r{constructor(){this.router=d(se),this.http=d(Z),this.layout=d(Y),this.authService=d(Bt),this.clipboard=d(Xt),this.filesService=d(Ht)}shareLinksList(){return this.http.get(Gt).pipe(S(e=>e.map(t=>new O(t))))}shareLink(e){return this.http.get(`${te}/${e}`).pipe(S(t=>new O(t)))}shareLinkChild(e,t){return this.http.get(`${te}/${e}/${h.CHILDREN}/${t}`).pipe(S(n=>new O(n)))}linkFromSpaceOrShare(e,t,n){return this.http.get(`${te}/${e}/${n}/${t}`)}linkValidation(e){return this.http.get(`${Kt}/${e}`).pipe(S(t=>t.ok?t.link:(t.error&&(t.error===we.UNAUTHORIZED?this.router.navigate([`${B.LINK}/${e}/${B.AUTH}`]).catch(console.error):this.router.navigate([`${B.LINK}/${e}/${t.error}`]).catch(console.error)),!1)),_e(()=>(this.authService.logout(),z(!1))))}linkAccessOrView(e,t,n){this.http.get(`${Vt}/${e}`).subscribe(p=>{p.token?this.authService.initUserFromResponse(p):this.authService.initUser(p),n?this.filesService.openViewerDialog(n,[],t.share.permissions).catch(console.error):t.space?this.router.navigate([y.SPACES_FILES,t.space.alias]).catch(console.error):t.share.isDir?this.router.navigate([y.SPACES_SHARES,t.share.alias]).catch(console.error):this.router.navigate([y.SPACES_SHARES],{queryParams:{select:t.share.alias}}).catch(console.error)})}linkDownload(e){vt(`${jt}/${e}`)}linkAuthentication(e,t){return this.http.post(`${qt}/${e}`,{password:t}).pipe(S(n=>(this.authService.initUserFromResponse(n),this.router.navigate([`${B.LINK}/${e}`]).catch(console.error),!0)),_e(n=>(n.error.message===we.UNAUTHORIZED?this.layout.sendNotification("error","Link","Bad password"):this.router.navigate([`${B.LINK}/${e}/${n.error.message}`]).catch(console.error),z(!1))))}copyLinkToClipboard(e){this.clipboard.copyFromContent(this.genLink(e))}genUUID(){return this.http.get(Zt).pipe(S(e=>e.uuid))}createLinkDialog(e){this.genUUID().subscribe(t=>{let n=this.layout.openDialog(ge,"md",{initialState:{link:{name:e.name,uuid:t,isActive:!0,nbAccess:0}}});this.subscribeToSubmitLinkModal(n,e)})}updateLinkFromSpaceOrShare(e,t,n,p){return this.http.put(`${te}/${e}/${n}/${t}`,p)}editLinkDialog(e,t,n){if(t.id===0||e?.linkSettings?.uuid){let p=this.layout.openDialog(ge,"md",{initialState:{link:e.linkSettings}});this.subscribeToSubmitLinkModal(p,t,e)}else this.linkFromSpaceOrShare(e.linkId,t.id,n).subscribe({next:p=>{let k=this.layout.openDialog(ge,"md",{initialState:{link:T(I({},p),{permissions:e.permissions})}});this.subscribeToSubmitLinkModal(k,t,e)},error:p=>this.layout.sendNotification("error","Link error",e.name||t.name,p)})}shareLinkGuestToMember(e,t,n){return new K({id:e,linkId:t,name:n.name,description:n.email,createdAt:n.createdAt,permissions:n.permissions,type:Pt.LINK,spaceRole:he.IS_MEMBER,linkSettings:n},[C.SHARE_INSIDE,C.SHARE_OUTSIDE])}subscribeToSubmitLinkModal(e,t,n){e.content.submitEvent.pipe($e(1)).subscribe(p=>{if(Object.keys(p).length){let k=Object.assign(e.content.link,p),x=this.shareLinkGuestToMember(k.userId||-(t.links.length+1),n?.linkId||-(t.links.length+1),k);x.linkId?t.links=[x,...t.links.filter(L=>L.linkId!==x.linkId)]:t.links=[x,...t.links]}e.content.layout.closeDialog()})}genLink(e){return`${document.location.origin}/#/${B.LINK}/${e}`}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();export{Xt as a,Te as b,Jt as c,Se as d,w as e,ei as f,V as g,ti as h,ge as i,ii as j};
1
+ import{A as Ht}from"./chunk-SPQH3ATC.js";import{c as X,d as Le,h as ee,m as ue}from"./chunk-RTNEBRKJ.js";import{a as Ut}from"./chunk-EKWB5W72.js";import{b as Bt}from"./chunk-NIKNG2FX.js";import{l as Dt,n as Pt,o as Rt,p as Nt,q as H,r as $t,s as K,w as Ot}from"./chunk-CVXLHSO5.js";import{a as Mt,b as Ft}from"./chunk-QJ22N76V.js";import{b as Q}from"./chunk-WRK2FTKU.js";import{$a as de,Ba as he,Ca as At,Cb as Y,Db as f,Gb as It,Hb as wt,Ib as xt,Ja as Ie,K as Ct,Mb as xe,N as kt,Na as N,Nb as U,Ob as y,Pb as Tt,W as ce,Wa as Et,gb as bt,ib as vt,s as at,t as lt,tb as yt,w as pt,x as ct,y as mt,ya as C}from"./chunk-AALPWGPB.js";import{d as se}from"./chunk-3MVPXC3U.js";import{Bb as oe,Cd as rt,Dd as ot,Eb as D,Ed as le,Ee as ft,G as _e,Gb as u,Gf as gt,Jd as pe,Kd as st,L as $e,Oa as l,Od as ht,Pc as je,Qa as Ce,Qb as He,Ra as Be,Rb as J,Sb as P,Tb as c,Ub as W,Vb as M,Wb as Ke,Xb as Ee,Yb as be,Yc as Z,Yf as _t,Zb as ve,ab as re,cc as G,ea as R,ed as qe,f as Re,fd as We,gc as Ve,ha as Oe,hd as ae,ia as ne,ie as dt,ja as d,jd as Ge,kc as b,kd as Ze,lb as A,ld as ye,le as ut,mb as E,mc as v,nb as Ue,nd as _,oa as j,od as Ye,p as z,pa as q,pb as ke,pd as Xe,qb as Ae,qd as ze,qg as me,ra as Me,rb as m,rg as we,sb as s,sd as Je,sg as Lt,t as Ne,tb as a,td as Qe,tg as B,ub as g,ud as et,v as S,vd as tt,wd as it,xa as Fe,xd as nt,yf as St}from"./chunk-76M3BMK6.js";import{n as F}from"./chunk-DM4NXKEP.js";import{a as I,b as T,d as Pe}from"./chunk-KAVP6UXH.js";var $={BASE:`${ce}/link`,LINK:"link",VALIDATION:"validation",ACCESS:"access",DOWNLOAD:"download",AUTH:"auth"},Kt=`${$.BASE}/${$.VALIDATION}`,Vt=`${$.BASE}/${$.ACCESS}`,jt=`${$.BASE}/${$.DOWNLOAD}`,qt=`${$.BASE}/${$.AUTH}`;var h={BASE:`${ce}/shares`,LIST:"list",CHILDREN:"children",LINKS:"links",LINKS_LIST:"links/list",LINKS_UUID:"links/uuid"},Wt=`${h.BASE}/${h.LIST}`,te=`${h.BASE}/${h.LINKS}`,Gt=`${h.BASE}/${h.LINKS_LIST}`,Zt=`${h.BASE}/${h.LINKS_UUID}`;var Yt=new Oe("WindowToken",typeof window<"u"&&window.document?{providedIn:"root",factory:()=>window}:{providedIn:"root",factory:()=>{}});var Xt=(()=>{class o{constructor(i,e,t){this.ngZone=i,this.document=e,this.window=t,this.copySubject=new Re,this.copyResponse$=this.copySubject.asObservable(),this.config={}}configure(i){this.config=i}copy(i){if(!this.isSupported||!i)return this.pushCopyResponse({isSuccess:!1,content:i});let e=this.copyFromContent(i);return e?this.pushCopyResponse({content:i,isSuccess:e}):this.pushCopyResponse({isSuccess:!1,content:i})}get isSupported(){return!!this.document.queryCommandSupported&&!!this.document.queryCommandSupported("copy")&&!!this.window}isTargetValid(i){if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement){if(i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');return!0}throw new Error("Target should be input or textarea")}copyFromInputElement(i,e=!0){try{this.selectTarget(i);let t=this.copyText();return this.clearSelection(e?i:void 0,this.window),t&&this.isCopySuccessInIE11()}catch{return!1}}isCopySuccessInIE11(){let i=this.window.clipboardData;return!(i&&i.getData&&!i.getData("Text"))}copyFromContent(i,e=this.document.body){if(this.tempTextArea&&!e.contains(this.tempTextArea)&&this.destroy(this.tempTextArea.parentElement||void 0),!this.tempTextArea){this.tempTextArea=this.createTempTextArea(this.document,this.window);try{e.appendChild(this.tempTextArea)}catch{throw new Error("Container should be a Dom element")}}this.tempTextArea.value=i;let t=this.copyFromInputElement(this.tempTextArea,!1);return this.config.cleanUpAfterCopy&&this.destroy(this.tempTextArea.parentElement||void 0),t}destroy(i=this.document.body){this.tempTextArea&&(i.removeChild(this.tempTextArea),this.tempTextArea=void 0)}selectTarget(i){return i.select(),i.setSelectionRange(0,i.value.length),i.value.length}copyText(){return this.document.execCommand("copy")}clearSelection(i,e){i&&i.focus(),e.getSelection()?.removeAllRanges()}createTempTextArea(i,e){let t=i.documentElement.getAttribute("dir")==="rtl",n;n=i.createElement("textarea"),n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let p=e.pageYOffset||i.documentElement.scrollTop;return n.style.top=p+"px",n.setAttribute("readonly",""),n}pushCopyResponse(i){this.copySubject.observers.length>0&&this.ngZone.run(()=>{this.copySubject.next(i)})}pushCopyReponse(i){this.pushCopyResponse(i)}}return o.\u0275fac=function(i){return new(i||o)(ne(Be),ne(Me),ne(Yt,8))},o.\u0275prov=R({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Te=(function(o){return o[o.COMMON=0]="COMMON",o[o.LINK=1]="LINK",o})(Te||{}),zt=Object.values(C).filter(o=>o!==C.SHARE_INSIDE).sort().join(":");function ni(o,r){if(o&1&&g(0,"fa-icon",2),o&2){let i=u();P(i.repository.class),He("min-width",i.galleryMode.dimensions/3,"px")("min-height",i.galleryMode.dimensions/3,"px")("font-size",i.galleryMode.faSize/1.8,"px"),m("icon",i.repository.icon)}}function ri(o,r){if(o&1&&g(0,"fa-icon",5),o&2){let i=u(2);P(i.repository.class),m("icon",i.repository.icon)}}function oi(o,r){if(o&1&&(c(0),b(1,"translate")),o&2){let i=u(2);M(" ",v(1,1,i.repository.label,i.locale.language)," ")}}function si(o,r){if(o&1&&c(0),o&2){let i=u(2);M(" ",i.repository.label," ")}}function ai(o,r){if(o&1&&(s(0,"div",1),A(1,ri,1,3,"fa-icon",3),s(2,"span",4),A(3,oi,2,4)(4,si,1,1),a()()),o&2){let i=u();l(),E(i.showIcon?1:-1),l(2),E(i.repository.translate?3:4)}}var Jt=(()=>{let r=class r{constructor(){this.showIcon=!0,this.showFullPath=!1,this.locale=d(le),this.layout=d(Y),this.unknownRepository={icon:ht,label:"",class:"circle-primary-icon",translate:!1}}ngOnInit(){this.setRepository()}ngOnChanges(){this.setRepository()}setRepository(){this.share.parent?.id||this.share.parent?.id===0?this.repository={icon:U.SHARES,label:this.share.parent.name,class:"circle-purple-icon",translate:!1}:this.share.file?.ownerId?this.repository={icon:U.PERSONAL,label:xe.PERSONAL_FILES,class:"circle-primary-icon",translate:!0}:this.share.file?.space?.alias?this.repository={icon:U.SPACES,label:`${this.share.file.space.name}`,class:"circle-primary-icon",translate:!1}:this.share.externalPath?this.repository={icon:U.EXTERNAL,label:"External",class:"circle-primary-icon",translate:!0}:this.repository=I({},this.unknownRepository),this.showFullPath&&this.setFullPath()}setFullPath(){if(!this.repository.label)return;let e=this.share.file?.path?this.share.file.path.split("/").filter(t=>t&&t!=="."):[];this.share.parent?.id&&!this.share.file?.id&&this.share.file?.path.indexOf("/")===-1?e.shift():this.share.file?.space?.alias&&this.share.file.space?.root?.alias&&(e.length?e.unshift(this.share.file.space.root.name):e.push(this.share.file.space.root.name)),this.repository.label===xe.PERSONAL_FILES&&(this.repository.label=this.layout.translateString(this.repository.label)),e.length&&(this.repository.label=`${this.repository.label}/${e.join("/")}`)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=re({type:r,selectors:[["app-share-repository"]],inputs:{share:"share",galleryMode:"galleryMode",showIcon:"showIcon",showFullPath:"showFullPath"},features:[Fe],decls:2,vars:1,consts:[[3,"icon","class","min-width","min-height","font-size"],[1,"d-flex","align-items-center","overflow-wrap-and-whitespace"],[3,"icon"],[1,"me-2",3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"me-2",3,"icon"]],template:function(t,n){t&1&&A(0,ni,1,9,"fa-icon",0)(1,ai,5,2,"div",1),t&2&&E(n.galleryMode?0:1)},dependencies:[me,pe],encapsulation:2});let o=r;return o})();function Se(o){o.file?.id?(o.file.isDir&&(o.file.mime=o.parent?.alias?Le:X),o.mimeUrl=ee(o.file.mime)):o.mimeUrl=ee(o.parent?.alias?Le:X)}function Qt(o){let r,i=o.file.path?o.file.path.split("/").filter(t=>t&&t!=="."):[];if(o.parent?.id){if(!i.length)return[y.SPACES_SHARES,o.parent.alias];r=`${y.SPACES_SHARES}/${o.parent.alias}`}else o.file.space?.alias?o.file.inTrash?r=`${y.SPACES_TRASH}/${o.file.space.alias}`:(r=`${y.SPACES_FILES}/${o.file.space.alias}`,o.file.space?.root?.alias&&(i.length?r=`${r}/${o.file.space.root.alias}`:i.push(o.file.space.root.name))):o.file?.ownerId?r=`${o.file.inTrash?y.PERSONAL_TRASH:y.PERSONAL_FILES}`:console.warn("unable to find the right file path",o);let e=i.pop();return r&&i.length&&(r=`${r}/${i.join("/")}`),[r,e]}var w=class{constructor(r){this.members=[],this.links=[],this.hPerms={},this.setMembers(N("members",r),r.externalPath||r.file?.isDir?[C.SHARE_INSIDE]:[]),Object.assign(this,r),Se(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=ue}setMembers(r,i){if(r)for(let e of r)e.linkId?this.links.push(new K(e,[...i,C.SHARE_OUTSIDE])):this.members.push(new K(e,i))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(":").filter(r=>r===C.SHARE_INSIDE||r===C.ADD&&this.file.id&&!this.file.isDir?!1:!(r===C.DELETE&&this.file.id&&!this.file.isDir)).join(":")))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=H(this.file.permissions):this.externalPath&&(this.hPerms=H(zt))}};var ei=(()=>{let r=class r{constructor(){this.http=d(Z),this.router=d(se)}getShare(e){return this.http.get(`${h.BASE}/${e}`).pipe(S(t=>new w(t)))}createShare(e){return this.http.post(h.BASE,e).pipe(S(t=>new w(t)))}updateShare(e){return this.http.put(`${h.BASE}/${e.id}`,e).pipe(S(t=>new w(t)))}deleteShare(e){return this.http.delete(`${h.BASE}/${e}`)}listShares(){return this.http.get(Wt)}getShareChild(e,t){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}/${t}`).pipe(S(n=>new w(n)))}updateShareChild(e,t,n){return this.http.put(`${h.BASE}/${e}/${h.CHILDREN}/${t}`,n).pipe(S(p=>new w(p)))}deleteShareChild(e,t){return this.http.delete(`${h.BASE}/${e}/${h.CHILDREN}/${t}`)}listChildShares(e){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}`)}initShareFromFile(e,t,n=!1,p=!1){let k,x=null,L=I({id:0,name:"",createdAt:new Date,modifiedAt:new Date,storageIndexing:!0,enabled:!0},n?{parent:{id:0,ownerId:0,alias:t.space.alias,name:t.space.name}}:{});if(t){p&&(x=t.root.id);let De=null;(t?.root?.owner.login===e.login||!t?.space?.alias)&&(t.space=null,De=e.id),k=new w(T(I({},L),{name:t.name,file:T(I({},t),{path:p?".":Et(t.path,2),ownerId:De})}))}else k=new w(L);return[k,x]}goTo(e){if(!e.id)return Ne(z(!1));if(e.externalPath&&!e.parent?.id)return this.router.navigate([y.SPACES_SHARES],{queryParams:{select:e.name}});if(e.parent?.id&&!e.file?.id&&e.file?.path.indexOf("/")===-1)return this.router.navigate([y.SPACES_SHARES],{queryParams:{select:e.parent.name}});{let[t,n]=Qt(e);return this.router.navigate([t],{queryParams:{select:n}})}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var O=class{constructor(r){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,r),Se(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=ue}updatePermission(){this.hPerms=H(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=F(this.link.currentAccess).fromNow(!0),this.newly=de(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date(F(this.link.expiresAt).local().format("YYYY-MM-DD"));let r=Math.max(0,F(this.link.expiresAt).diff(F(),"hours"));r===0?this.hTimeExpirationAgo=0:r<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(r/24)+1}else this.hTimeExpirationAgo=0}};var V=class{constructor(r){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=H(r.permissions),this.setMembers(N("members",r)),this.setRoots(N("roots",r)),Object.assign(this,r),this.hTimeAgo=F(this.modifiedAt).fromNow(!0),this.newly=de(this.modifiedAt),this.sort()}addRoot(r,i=!1){r.hPerms=Rt(r.permissions,[C.SHARE_INSIDE]),r.owner?.login&&(r.owner.avatarUrl=yt(r.owner.login)),r.file.mimeUrl=ee(r.file?.mime?r.file.mime:X),i?this.roots.unshift(r):this.roots.push(r),r.isDir=r.file.mime===X||!!r.externalPath}havePermission(r){return this.permissions.indexOf(r)>-1}setMembers(r){if(r)for(let i of r){let e=new K(i);e.isLink?this.links.push(e):e.spaceRole===he.IS_MANAGER?this.managers.push(e):this.members.push(e)}}setRoots(r){if(r)for(let i of r)this.addRoot(i)}sort(){Q(this.roots,"createdAt",!1),Q(this.managers,"createdAt",!1),Q(this.members,"createdAt",!1),Q(this.links,"createdAt",!1)}};var ti=(()=>{let r=class r{constructor(){this.http=d(Z)}listSpaces(){return this.http.get(It).pipe(S(e=>e.map(t=>new V(t))))}getSpace(e){return this.http.get(`${f.BASE}/${e}`).pipe(S(t=>new V(t)))}getUserSpaceRoots(e){return this.http.get(`${f.BASE}/${e}/${f.ROOTS}`)}createUserSpaceRoots(e,t){return this.http.post(`${f.BASE}/${e}/${f.ROOTS}`,t)}updateUserSpaceRoots(e,t){return this.http.put(`${f.BASE}/${e}/${f.ROOTS}`,t)}updateSpace(e){return this.http.put(`${f.BASE}/${e.id}`,e).pipe(S(t=>t?new V(t):null))}createSpace(e){return this.http.post(f.BASE,e).pipe(S(t=>(t.permissions=At,new V(t))))}deleteSpace(e,t){return this.http.request("delete",`${f.BASE}/${e}`,{body:t})}searchSpaces(e){return this.http.request("search",f.BASE,{body:e})}listSpaceShares(e){return this.http.get(`${f.BASE}/${e}/${f.SHARES}`)}getSpaceShare(e,t){return this.http.get(`${f.BASE}/${e}/${f.SHARES}/${t}`).pipe(S(n=>new w(n)))}updateSpaceShare(e,t){return this.http.put(`${f.BASE}/${e}/${f.SHARES}/${t.id}`,t).pipe(S(n=>new w(n)))}deleteSpaceShare(e,t){return this.http.delete(`${f.BASE}/${e}/${f.SHARES}/${t}`)}getSpaceShareLink(e,t){return this.http.get(`${f.BASE}/${e}/${f.LINKS}/${t}`).pipe(S(n=>new O(n)))}listTrashBins(){return this.http.get(wt)}checkSpaceRootPath(e){return this.http.post(xt,{path:e})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var pi=o=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:o,showWeekNumbers:!1}),ci=(o,r)=>r.key;function mi(o,r){o&1&&(s(0,"span",4),c(1,"Edit link"),a())}function hi(o,r){o&1&&(s(0,"span",4),c(1,"New link"),a())}function di(o,r){o&1&&g(0,"div",54)}function ui(o,r){if(o&1){let i=oe();s(0,"button",53),b(1,"translate"),ve("ngModelChange",function(t){let n=j(i).$implicit,p=u(3);return be(p.permissions[n.key],t)||(p.permissions[n.key]=t),q(t)}),D("ngModelChange",function(){j(i);let t=u(3);return q(t.onPermissionChange())}),g(2,"fa-icon",50),a(),A(3,di,1,0,"div",54)}if(o&2){let i=r.$implicit,e=r.$index,t=r.$count,n=u(3);Ee("ngModel",n.permissions[i.key]),m("tooltip",v(1,4,n.SPACES_PERMISSIONS_TEXT[i.key].text,n.locale.language)),l(2),m("icon",n.SPACES_PERMISSIONS_TEXT[i.key].icon),l(),E(e===t-1?3:-1)}}function fi(o,r){if(o&1&&(ke(0,ui,4,7,null,null,ci),b(2,"keyvalue")),o&2){let i=u(2);Ae(v(2,0,i.permissions,i.originalOrderKeyValue))}}function Si(o,r){if(o&1&&(s(0,"div",51),g(1,"app-share-repository",55),a()),o&2){let i=u(2);l(),m("share",i.share)("showIcon",!0)("showFullPath",!0)}}function gi(o,r){if(o&1){let i=oe();s(0,"div",44),g(1,"fa-icon",45),s(2,"div",46)(3,"span"),c(4),a(),s(5,"span",47),c(6),a()(),s(7,"div",48),A(8,fi,3,3),s(9,"button",49),b(10,"translate"),D("click",function(){j(i);let t=u();return q(t.toggleRequireAuth())}),g(11,"fa-icon",50),a(),s(12,"button",49),b(13,"translate"),D("click",function(){j(i);let t=u();return q(t.copyToClipboard())}),g(14,"fa-icon",50),a()()(),A(15,Si,2,3,"div",51),g(16,"hr",52)}if(o&2){let i=u();l(),m("icon",i.icons.links),l(3),W(i.linkForm.value.name||i.linkForm.value.shareName),l(2),W(i.linkForm.value.email),l(2),E(i.share&&i.permissions?8:-1),l(),P(G("btn btn-sm ",i.linkForm.value.requireAuth?"btn-success":"btn-warning")),m("tooltip",v(10,15,"Password",i.locale.language)),l(2),m("icon",i.linkForm.value.requireAuth?i.icons.faLock:i.icons.faLockOpen),l(),P(G("btn btn-sm ms-2 ",i.linkWasCopied?"btn-info":"btn-secondary")),m("tooltip",v(13,18,"Copy link",i.locale.language)),l(2),m("icon",i.linkWasCopied?i.icons.faClipboardCheck:i.icons.faClipboard),l(),E(i.share?15:-1)}}function _i(o,r){if(o&1&&(s(0,"span"),c(1),a()),o&2){let i=u();P(G("badge rounded-pill ",(i.share?i.share.link.nbAccess:i.link.nbAccess)>=i.linkForm.value.limitAccess?"bg-danger":"bg-success")),l(),Ke(" ",i.share?i.share.link.nbAccess:i.link.nbAccess,"/",i.linkForm.value.limitAccess," ")}}function Ci(o,r){if(o&1&&(s(0,"span",20),c(1),a()),o&2){let i=u();l(),W(i.share?i.share.link.nbAccess:i.link.nbAccess)}}function ki(o,r){if(o&1&&(s(0,"div",27)(1,"label",56),c(2,"Share name"),a(),g(3,"input",57),b(4,"translate"),a(),s(5,"div",27)(6,"label",58),c(7,"Share description"),a(),g(8,"input",59),b(9,"translate"),a()),o&2){let i=u();l(3),J("is-invalid",i.linkForm.controls.shareName.invalid),m("placeholder",v(4,4,"Share name",i.locale.language)),l(5),m("placeholder",v(9,7,"Share description",i.locale.language))}}function Ai(o,r){if(o&1&&(s(0,"option",30),c(1),a()),o&2){let i=r.$implicit,e=u();m("ngValue",i),l(),W(e.i18nLanguageText[i])}}function Ei(o,r){if(o&1&&(s(0,"div",37),g(1,"app-password-strength-bar",60),a()),o&2){let i=u();l(),m("passwordToCheck",i.password)}}function bi(o,r){if(o&1){let i=oe();s(0,"button",61),D("click",function(){j(i);let t=u();return q(t.confirmDeletion=!0)}),c(1," Remove "),a()}if(o&2){let i=u();m("disabled",i.confirmDeletion)}}var ge=(()=>{let r=class r{constructor(){this.layout=d(Y),this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.submitEvent=new Ce,this.shareChange=new Ce,this.locale=d(le),this.confirmDeletion=!1,this.submitted=!1,this.SPACES_PERMISSIONS_TEXT=Tt,this.originalOrderKeyValue=bt,this.icons={faEye:dt,faEyeSlash:_t,links:U.LINKS,faClipboard:ft,faClipboardCheck:ut,faLock:gt,faLockOpen:St},this.languages=this.layout.getLanguages(),this.minDate=Ie(),this.defaultPassword=this.layout.translateString(Ct),this.passwordMinLength=8,this.password="",this.linkIsExpired=!1,this.linkIsHovered=!1,this.linkWasCopied=!1,this.i18nLanguageText=kt,this.userService=d(Ot),this.sharesService=d(ei),this.linksService=d(ii),this.spacesService=d(ti),this.minDate.setDate(this.minDate.getDate()+1)}ngOnInit(){this.link?this.initLink():this.file?this.initFile():this.initShareLink(),this.linkForm.value.requireAuth&&(this.password=this.defaultPassword),this.linkForm.value.expiresAt&&this.isLinkIsExpired(this.share?this.share.link.expiresAt:this.link.expiresAt),this.linkForm.controls.expiresAt.valueChanges.subscribe(e=>this.isLinkIsExpired(e))}onPermissionChange(){let e=$t(this.permissions);this.linkForm.controls.permissions.setValue(e),e!==this.share.link.permissions?this.linkForm.controls.permissions.markAsDirty():this.linkForm.controls.permissions.markAsPristine()}toggleRequireAuth(){this.linkForm.controls.requireAuth.setValue(!this.linkForm.value.requireAuth),this.linkForm.controls.requireAuth.markAsDirty()}copyToClipboard(){this.linksService.copyLinkToClipboard(this.share?this.share.link.uuid:this.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.linkForm.value.name||this.linkForm.value.shareName),setTimeout(()=>this.linkWasCopied=!1,3e3)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion){(this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.layout.sendNotification("success","Link deleted",this.share.link.name||this.share.name),this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:p=>{this.layout.sendNotification("error","Delete share",this.share.name,p),this.layout.closeDialog()}});return}if(this.file?.id){let t=this.share,{link:n}=t,p=Pe(t,["link"]),k=T(I(I({},n),this.linkForm.value),{password:this.mustIncludePassword()?this.password:void 0});p.name=N("shareName",k),p.description=N("shareDescription",k);let x=this.linksService.shareLinkGuestToMember(-1,-1,k);this.sharesService.createShare(T(I({},p),{type:Te.LINK,links:[x]})).subscribe({next:L=>{this.shareChange.emit(["add",L]),this.layout.sendNotification("success","Link created",n.name||L.name),this.layout.closeDialog()},error:L=>{this.layout.sendNotification("error","Link error",this.share.name,L),this.layout.closeDialog()}});return}let e={};for(let n in this.linkForm.controls)this.linkForm.controls[n].dirty&&(e[n]=this.linkForm.controls[n].value);if(this.mustIncludePassword()&&(e.password=this.password),this.share?.id){Object.keys(e).length&&this.linksService.updateLinkFromSpaceOrShare(this.share.link.id,this.share.id,Lt.SHARE,e).subscribe({next:n=>{this.share.name=this.linkForm.value.shareName,this.share.description=this.linkForm.value.shareDescription,this.share.link=Object.assign(this.share.link,n),this.share.updateTimes(),this.share.updatePermission(),this.shareChange.emit(["update",this.share]),this.layout.closeDialog()},error:n=>{this.layout.sendNotification("error","Link error",this.share.link.name||this.share.name,n),this.layout.closeDialog()}}),this.layout.closeDialog();return}this.submitEvent.emit(e)}initFile(){let e=this.sharesService.initShareFromFile(this.userService.user,this.file,this.isSharesRepo,this.inSharesList)[0];this.share=T(I({},e),{link:{id:-1,userId:-1,uuid:"",isActive:!0,requireAuth:!1,permissions:"",nbAccess:0,limitAccess:0}}),this.linksService.genUUID().subscribe(t=>this.share.link.uuid=t),this.initShareLink(),this.onPermissionChange()}initShareLink(){this.linkForm=new ye({shareName:new _(this.share.name,ae.required),shareDescription:new _(this.share.description||""),name:new _(this.share.link?.name||""),email:new _(this.share.link?.email||"",ae.email),language:new _(this.share.link.language||null),limitAccess:new _(this.share.link.limitAccess||null),expiresAt:new _(this.share.link.expiresAt||null),requireAuth:new _(this.share.link.requireAuth||!1),permissions:new _(this.share.link.permissions),isActive:new _(this.share.link.isActive)}),this.permissions=Nt(this.share.file.permissions,this.share.link.permissions,[C.SHARE_INSIDE,C.SHARE_OUTSIDE,...this.share.file.isDir?[]:[C.DELETE,C.ADD]])}initLink(){this.linkForm=new ye({shareName:new _(""),shareDescription:new _(""),name:new _(this.link.name||""),email:new _(this.link.email||"",ae.email),language:new _(this.link.language||null),limitAccess:new _(this.link.limitAccess||null),expiresAt:new _(this.link.expiresAt||null),requireAuth:new _(this.link.requireAuth||!1),permissions:new _(this.link.permissions),isActive:new _(this.link.isActive)}),this.link.id||(this.linkForm.controls.name.markAsDirty(),this.linkForm.controls.isActive.markAsDirty())}isLinkIsExpired(e){if(e==null){if(this.linkIsExpired=!1,e===null)return;this.linkForm.controls.expiresAt.setValue(null)}this.linkIsExpired=Ie()>=e}mustIncludePassword(){return!!this.password.length&&this.password!==this.defaultPassword}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=re({type:r,selectors:[["app-link-dialog"]],inputs:{share:"share",parentSpaceId:"parentSpaceId",link:"link",file:"file",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList"},outputs:{submitEvent:"submitEvent",shareChange:"shareChange"},decls:73,vars:52,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],["autocomplete","off",3,"formGroup"],[1,"d-flex"],[1,"d-flex","flex-column","flex-grow-1"],[1,"d-flex","align-items-center","cursor-pointer","py-2",3,"mouseover","mouseleave","focus","click"],["for","link","l10nTranslate",""],["id","link",1,"ms-auto"],[1,"d-flex","align-items-center","py-2"],["for","state","l10nTranslate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","state","formControlName","isActive","type","checkbox","role","button",1,"form-check-input"],["for","access","l10nTranslate",""],["id","access",1,"ms-auto"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"d-flex","align-items-center"],["for","guestName","l10nTranslate",""],["id","guestName","formControlName","name","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between","px-0"],["for","guestEmail","l10nTranslate",""],["id","guestEmail","autocomplete","off","formControlName","email","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between"],["for","guestLanguage","l10nTranslate",""],["id","guestLanguage","formControlName","language",1,"form-control","form-select","form-select-sm","ms-auto","w-50"],[3,"ngValue"],["for","limitAccess","l10nTranslate",""],["id","limitAccess","formControlName","limitAccess","min","1","type","number",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","expiration","l10nTranslate",""],["bsDatepicker","","id","expiration","formControlName","expiresAt","placement","left","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder","bsConfig"],[1,"d-flex","align-items-center","px-0"],["for","requireAuth","translate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","d-none","d-sm-flex","mx-auto"],["id","requireAuth","formControlName","requireAuth","type","checkbox","role","button",1,"form-check-input"],["placeholder","Set a password",2,"width","45%",3,"passwordChange","isRequired","disabled","passwordMinLength","password","showGenerator"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"d-flex","flex-fill","align-items-center"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","flex-column","overflow-wrap-and-whitespace","me-2"],[1,"fs-xxxs"],[1,"d-flex","ms-auto"],["container","body","type","button",3,"click","tooltip"],["size","lg",3,"icon"],[1,"d-flex","align-items-center","d-none","d-sm-flex","py-2"],[1,"my-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-0","ms-2",3,"ngModelChange","ngModel","tooltip"],[1,"vr","mx-2"],["id","file",3,"share","showIcon","showFullPath"],["for","shareName","l10nTranslate",""],["id","shareName","formControlName","shareName","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","shareDescription","l10nTranslate",""],["id","shareDescription","formControlName","shareDescription","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(t,n){t&1&&(s(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),s(3,"span"),c(4),a()(),s(5,"h4",3),A(6,mi,2,0,"span",4)(7,hi,2,0,"span",4),a(),s(8,"button",5),D("click",function(){return n.layout.closeDialog()}),a()(),s(9,"div",6),A(10,gi,17,21),s(11,"form",7)(12,"div",8)(13,"div",9)(14,"div",10),D("mouseover",function(){return n.linkIsHovered=!0})("mouseleave",function(){return n.linkIsHovered=!1})("focus",function(){return n.linkIsHovered=!0})("click",function(){return n.copyToClipboard()}),s(15,"label",11),c(16,"Link"),a(),s(17,"span",12),c(18),a()(),s(19,"div",13)(20,"label",14),c(21,"Active"),a(),s(22,"div",15),g(23,"input",16),s(24,"span"),c(25),b(26,"translate"),a()()(),s(27,"div",13)(28,"label",17),c(29,"Current access count"),a(),s(30,"span",18),A(31,_i,2,5,"span",19)(32,Ci,2,1,"span",20),a()(),A(33,ki,10,10),s(34,"div",21)(35,"label",22),c(36,"Guest name"),a(),g(37,"input",23),b(38,"translate"),a(),s(39,"div",24)(40,"label",25),c(41,"Guest email"),a(),g(42,"input",26),b(43,"translate"),a(),s(44,"div",27)(45,"label",28),c(46,"Guest language"),a(),s(47,"select",29),ke(48,Ai,2,2,"option",30,Ue),a()(),s(50,"div",27)(51,"label",31),c(52,"Limit access"),a(),g(53,"input",32),b(54,"translate"),a(),s(55,"div",27)(56,"label",33),c(57,"Expiration"),a(),g(58,"input",34),b(59,"translate"),a(),s(60,"div",35)(61,"label",36),c(62,"Password"),a(),A(63,Ei,2,1,"div",37),s(64,"div",15),g(65,"input",38),a(),s(66,"app-input-password",39),ve("passwordChange",function(k){return be(n.password,k)||(n.password=k),k}),a()()()()()(),s(67,"div",40),A(68,bi,2,1,"button",41),s(69,"button",42),D("click",function(){return n.onCancel()}),c(70,"Cancel"),a(),s(71,"button",43),D("click",function(){return n.onSubmit()}),c(72),a()()),t&2&&(l(2),m("icon",n.icons.links),l(2),W(n.linkForm.value.name||n.linkForm.value.shareName),l(2),E(n.share!=null&&n.share.id||n.link!=null&&n.link.id?6:7),l(4),E(n.share||n.link?10:-1),l(),m("formGroup",n.linkForm),l(6),J("text-primary",n.linkIsHovered),l(),M(" ",n.share?n.share.link.uuid:n.link.uuid," "),l(6),P(G("badge rounded-pill ms-3 ",n.linkForm.value.isActive?"bg-primary":"bg-danger")),l(),M(" ",v(26,35,n.linkForm.value.isActive?"yes":"no",n.locale.language)," "),l(6),E(n.linkForm.value.limitAccess?31:32),l(2),E(n.share?33:-1),l(4),m("placeholder",v(38,38,"Guest name",n.locale.language)),l(5),J("is-invalid",n.linkForm.controls.email.invalid),m("placeholder",v(43,41,"Guest email",n.locale.language)),l(6),Ae(n.languages),l(5),m("placeholder",v(54,44,"Unlimited",n.locale.language)),l(5),J("text-danger",n.linkIsExpired),m("placeholder",v(59,47,"Never expires",n.locale.language))("bsConfig",Ve(50,pi,n.minDate)),l(5),E(n.linkForm.value.requireAuth&&n.password!==n.defaultPassword?63:-1),l(3),m("isRequired",n.linkForm.value.requireAuth)("disabled",!n.linkForm.value.requireAuth)("passwordMinLength",n.passwordMinLength),Ee("password",n.password),m("showGenerator",!0),l(2),E(n.share!=null&&n.share.id?68:-1),l(3),P(G("btn btn-sm ",n.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",n.linkForm.invalid||n.linkForm.controls.requireAuth.value&&n.password.length<n.passwordMinLength||n.submitted),l(),M(" ",n.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[me,st,mt,pt,ct,Ft,Mt,rt,Xe,tt,it,We,ze,qe,et,Ge,Ze,nt,Ye,Dt,lt,at,ot,Je,Qe,Jt,Ut,je,pe],encapsulation:2});let o=r;return o})();var ii=(()=>{let r=class r{constructor(){this.router=d(se),this.http=d(Z),this.layout=d(Y),this.authService=d(Bt),this.clipboard=d(Xt),this.filesService=d(Ht)}shareLinksList(){return this.http.get(Gt).pipe(S(e=>e.map(t=>new O(t))))}shareLink(e){return this.http.get(`${te}/${e}`).pipe(S(t=>new O(t)))}shareLinkChild(e,t){return this.http.get(`${te}/${e}/${h.CHILDREN}/${t}`).pipe(S(n=>new O(n)))}linkFromSpaceOrShare(e,t,n){return this.http.get(`${te}/${e}/${n}/${t}`)}linkValidation(e){return this.http.get(`${Kt}/${e}`).pipe(S(t=>t.ok?t.link:(t.error&&(t.error===we.UNAUTHORIZED?this.router.navigate([`${B.LINK}/${e}/${B.AUTH}`]).catch(console.error):this.router.navigate([`${B.LINK}/${e}/${t.error}`]).catch(console.error)),!1)),_e(()=>(this.authService.logout(),z(!1))))}linkAccessOrView(e,t,n){this.http.get(`${Vt}/${e}`).subscribe(p=>{p.token?this.authService.initUserFromResponse(p):this.authService.initUser(p),n?this.filesService.openViewerDialog(n,[],t.share.permissions).catch(console.error):t.space?this.router.navigate([y.SPACES_FILES,t.space.alias]).catch(console.error):t.share.isDir?this.router.navigate([y.SPACES_SHARES,t.share.alias]).catch(console.error):this.router.navigate([y.SPACES_SHARES],{queryParams:{select:t.share.alias}}).catch(console.error)})}linkDownload(e){vt(`${jt}/${e}`)}linkAuthentication(e,t){return this.http.post(`${qt}/${e}`,{password:t}).pipe(S(n=>(this.authService.initUserFromResponse(n),this.router.navigate([`${B.LINK}/${e}`]).catch(console.error),!0)),_e(n=>(n.error.message===we.UNAUTHORIZED?this.layout.sendNotification("error","Link","Bad password"):this.router.navigate([`${B.LINK}/${e}/${n.error.message}`]).catch(console.error),z(!1))))}copyLinkToClipboard(e){this.clipboard.copyFromContent(this.genLink(e))}genUUID(){return this.http.get(Zt).pipe(S(e=>e.uuid))}createLinkDialog(e){this.genUUID().subscribe(t=>{let n=this.layout.openDialog(ge,"md",{initialState:{link:{name:e.name,uuid:t,isActive:!0,nbAccess:0}}});this.subscribeToSubmitLinkModal(n,e)})}updateLinkFromSpaceOrShare(e,t,n,p){return this.http.put(`${te}/${e}/${n}/${t}`,p)}editLinkDialog(e,t,n){if(t.id===0||e?.linkSettings?.uuid){let p=this.layout.openDialog(ge,"md",{initialState:{link:e.linkSettings}});this.subscribeToSubmitLinkModal(p,t,e)}else this.linkFromSpaceOrShare(e.linkId,t.id,n).subscribe({next:p=>{let k=this.layout.openDialog(ge,"md",{initialState:{link:T(I({},p),{permissions:e.permissions})}});this.subscribeToSubmitLinkModal(k,t,e)},error:p=>this.layout.sendNotification("error","Link error",e.name||t.name,p)})}shareLinkGuestToMember(e,t,n){return new K({id:e,linkId:t,name:n.name,description:n.email,createdAt:n.createdAt,permissions:n.permissions,type:Pt.LINK,spaceRole:he.IS_MEMBER,linkSettings:n},[C.SHARE_INSIDE,C.SHARE_OUTSIDE])}subscribeToSubmitLinkModal(e,t,n){e.content.submitEvent.pipe($e(1)).subscribe(p=>{if(Object.keys(p).length){let k=Object.assign(e.content.link,p),x=this.shareLinkGuestToMember(k.userId||-(t.links.length+1),n?.linkId||-(t.links.length+1),k);x.linkId?t.links=[x,...t.links.filter(L=>L.linkId!==x.linkId)]:t.links=[x,...t.links]}e.content.layout.closeDialog()})}genLink(e){return`${document.location.origin}/#/${B.LINK}/${e}`}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();export{Xt as a,Te as b,Jt as c,Se as d,w as e,ei as f,V as g,ti as h,ge as i,ii as j};
@@ -1 +1 @@
1
- import{k as L}from"./chunk-RTNEBRKJ.js";import{b as u,e as h}from"./chunk-QHJT5H4M.js";import{Ia as d,Kd as g,Oa as n,Tb as s,Ub as v,Ze as x,ab as f,ja as p,qg as R,rb as c,sb as t,tb as i,ub as o,ug as E}from"./chunk-D55YR5X7.js";import"./chunk-KAVP6UXH.js";var D=(()=>{let e=class e{constructor(){this.logoUrl=L,this.icons={faExclamationCircle:x},this.activatedRoute=p(u),this.activatedRoute.params.subscribe(l=>this.error=E[l.error])}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=f({type:e,selectors:[["app-public-link-error"]],decls:13,vars:3,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-items-center",2,"margin-top","1.2rem","margin-bottom",".6rem"],["size","5x",1,"text-white",3,"icon"],["l10nTranslate","",1,"error-code"],[1,"error-text"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(r,m){r&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),o(3,"img",3),i()(),t(4,"div",4),o(5,"fa-icon",5),i(),t(6,"div",6),s(7,"Link error"),i(),t(8,"div",7),o(9,"span",8),t(10,"div")(11,"span",9),s(12),i()()()()),r&2&&(n(3),c("src",m.logoUrl,d),n(2),c("icon",m.icons.faExclamationCircle),n(7),v(m.error))},dependencies:[h,g,R],encapsulation:2});let a=e;return a})();export{D as PublicLinkErrorComponent};
1
+ import{k as L}from"./chunk-RTNEBRKJ.js";import{b as u,e as h}from"./chunk-3MVPXC3U.js";import{Ia as d,Kd as g,Oa as n,Tb as s,Ub as v,Ze as x,ab as f,ja as p,qg as R,rb as c,sb as t,tb as i,ub as o,ug as E}from"./chunk-76M3BMK6.js";import"./chunk-KAVP6UXH.js";var D=(()=>{let e=class e{constructor(){this.logoUrl=L,this.icons={faExclamationCircle:x},this.activatedRoute=p(u),this.activatedRoute.params.subscribe(l=>this.error=E[l.error])}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=f({type:e,selectors:[["app-public-link-error"]],decls:13,vars:3,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-items-center",2,"margin-top","1.2rem","margin-bottom",".6rem"],["size","5x",1,"text-white",3,"icon"],["l10nTranslate","",1,"error-code"],[1,"error-text"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(r,m){r&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),o(3,"img",3),i()(),t(4,"div",4),o(5,"fa-icon",5),i(),t(6,"div",6),s(7,"Link error"),i(),t(8,"div",7),o(9,"span",8),t(10,"div")(11,"span",9),s(12),i()()()()),r&2&&(n(3),c("src",m.logoUrl,d),n(2),c("icon",m.icons.faExclamationCircle),n(7),v(m.error))},dependencies:[h,g,R],encapsulation:2});let a=e;return a})();export{D as PublicLinkErrorComponent};
@@ -1 +1 @@
1
- import{a as T,b as S,c as d,d as A,e as c,w as b}from"./chunk-B6HQYQYG.js";import{$ as R,Bb as H,Cb as P,F as l,Ia as U,Y as N,eb as k,nb as h,ua as O,vb as C}from"./chunk-O3YLAEVE.js";import{d as g}from"./chunk-QHJT5H4M.js";import{G as a,O as f,Yc as I,_ as m,aa as _,ea as x,ja as s,p as o,q as u,v as n}from"./chunk-D55YR5X7.js";var F="Client token is expired";var E={BASE:"auth",LOGIN:"login"};var ie=(()=>{let i=class i{constructor(){this.http=s(I),this.router=s(g),this.store=s(C),this.userService=s(b),this.layout=s(P),this.electron=s(H),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(T,{login:e,password:t}).pipe(n(r=>r.server.twoFaEnabled&&r.user.twoFaEnabled?(this.accessExpiration=r.token.access_2fa_expiration,this.refreshExpiration=this.accessExpiration,{success:!0,twoFaEnabled:!0,message:null}):(this.initUserFromResponse(r),{success:!0,message:null})),a(r=>(console.warn(r),o({success:!1,message:r.error.message||r.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(N,e).pipe(n(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.initUser(t),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),a(t=>(console.warn(t),t.error.message===F?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),o(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(f(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([E.BASE,E.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([l.BASE,l.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.initUser(e,t))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(d,null).pipe(n(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,!0)),a(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),u(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),o(!1)):this.store.user.getValue()?o(!0):this.http.get(R).pipe(_(t=>this.initUser(t)),n(()=>!0),a(t=>(t.status===401?this.logout():console.warn(t),o(!1))))}checkCSRF(e){return e.headers.has(c)?e.clone({headers:e.headers.set(c,k(c))}):e}loginWith2Fa(e){return this.http.post(A,e)}initUser(e,t=!1){this.userService.initUser(e.user,t),e.server&&this.store.server.set(e.server)}refreshTokenHasExpired(){return this.refreshExpiration===0||U()>=this.refreshExpiration}clearCookies(){return this.http.post(S,null)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"});let p=i;return p})();export{E as a,ie as b};
1
+ import{a as T,b as S,c as d,d as A,e as c,w as b}from"./chunk-CVXLHSO5.js";import{$ as R,Bb as H,Cb as P,F as l,Ia as U,Y as N,eb as k,nb as h,ua as O,vb as C}from"./chunk-AALPWGPB.js";import{d as g}from"./chunk-3MVPXC3U.js";import{G as a,O as f,Yc as I,_ as m,aa as _,ea as x,ja as s,p as o,q as u,v as n}from"./chunk-76M3BMK6.js";var F="Client token is expired";var E={BASE:"auth",LOGIN:"login"};var ie=(()=>{let i=class i{constructor(){this.http=s(I),this.router=s(g),this.store=s(C),this.userService=s(b),this.layout=s(P),this.electron=s(H),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(T,{login:e,password:t}).pipe(n(r=>r.server.twoFaEnabled&&r.user.twoFaEnabled?(this.accessExpiration=r.token.access_2fa_expiration,this.refreshExpiration=this.accessExpiration,{success:!0,twoFaEnabled:!0,message:null}):(this.initUserFromResponse(r),{success:!0,message:null})),a(r=>(console.warn(r),o({success:!1,message:r.error.message||r.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(N,e).pipe(n(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.initUser(t),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),a(t=>(console.warn(t),t.error.message===F?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),o(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(f(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([E.BASE,E.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([l.BASE,l.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.initUser(e,t))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(d,null).pipe(n(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,!0)),a(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),u(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),o(!1)):this.store.user.getValue()?o(!0):this.http.get(R).pipe(_(t=>this.initUser(t)),n(()=>!0),a(t=>(t.status===401?this.logout():console.warn(t),o(!1))))}checkCSRF(e){return e.headers.has(c)?e.clone({headers:e.headers.set(c,k(c))}):e}loginWith2Fa(e){return this.http.post(A,e)}initUser(e,t=!1){this.userService.initUser(e.user,t),e.server&&this.store.server.set(e.server)}refreshTokenHasExpired(){return this.refreshExpiration===0||U()>=this.refreshExpiration}clearCookies(){return this.http.post(S,null)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"});let p=i;return p})();export{E as a,ie as b};
@@ -1 +1 @@
1
- import{b as T,c as I,d as b,f as M,h as S}from"./chunk-E32J777S.js";import{b as o,c as O,d as A,h as d,m as g,o as D,p as s,q as w}from"./chunk-RTNEBRKJ.js";import{q as c}from"./chunk-B6HQYQYG.js";import{$a as E,Ia as m,Na as u,_a as f,tb as p,ya as h}from"./chunk-O3YLAEVE.js";import{n}from"./chunk-DM4NXKEP.js";var N=class{constructor(t,i,r=!1,e){this.shares=[],this.links=[],this.spaces=[],this.syncs=[],this.newly=0,this.isRenamed=!1,this.isImage=!1,this.isViewable=!1,this.isEditable=!1,this.isCompressible=!0,this.isBeingDeleted=!1,this.isSelected=!1,this.isDisabled=!1,this.canBeReShared=!1,this.haveThumbnail=!1,this.setShares(u("shares",t)),Object.assign(this,t),this.path=`${i}/${this.path!=="."?`${this.path}/`:""}${this.root?.alias||this.name}`,this.mime=this.getMime(this.mime,r,e),this.updateHTimeAgo(this.mtime),this.setMimeUrl(),this.setHSize(),this.setRoot(r)}get dataUrl(){return`${T}/${this.path}`}get taskUrl(){return`${b}/${this.path}`}get thumbnailUrl(){return`${I}/${this.path}`}fallBackMimeUrl(){this.mimeUrl=g}rename(t){this.name=t,this.path=[...this.path.split("/").slice(0,-1),this.name].join("/")}updateMime(t){this.mime=t,this.setMimeUrl()}updateHTimeAgo(t){t??=m(null,!0),this.hTimeAgo=n(t).fromNow(!0),this.newly=E(t)}createLock(t){this.lock=t}removeLock(){this.lock=null}getExtension(){let t=this.name.lastIndexOf(".");return t>=0?this.name.slice(t+1).toLowerCase():""}getType(t){return this.isDir?t?A:O:o}getMime(t,i,r){if(this.isDir)return this.isViewable=!1,this.getType(i);if(!t||t===o)return this.isViewable=!0,this.shortMime=s.TEXT,this.getType(i);let e=this.getExtension(),l=t.indexOf("-"),a=l>=0?t.slice(0,l):t;return e===s.PDF?(this.shortMime=s.PDF,this.isViewable=!0,this.isEditable=r.onlyoffice===!0,t):r.collabora===!0&&M.has(e)||r.onlyoffice===!0&&S.has(e)?(this.shortMime=s.DOCUMENT,this.isEditable=!0,this.isViewable=!0,t):e==="mp4"?(this.isViewable=!0,this.shortMime=s.MEDIA,this.haveThumbnail=!0,t):a===s.IMAGE?(this.shortMime=s.IMAGE,this.isImage=!0,this.isViewable=!0,this.haveThumbnail=!0,t):a==="video"||a==="audio"?(this.shortMime=s.MEDIA,this.isViewable=!0,this.haveThumbnail=!0,t):D.has(t)?(this.isCompressible=!1,this.isViewable=!1,t):(w.has(e)||(this.shortMime=s.TEXT,this.isViewable=!0,this.isEditable=!0),t)}setMimeUrl(){this.mimeUrl=d(this.mime)}setRoot(t){this.root&&(this.root.enabled===!1&&(this.isDisabled=!0),this.root.hPerms=c(this.root.permissions,this.isDir?[]:[h.DELETE,h.ADD]),this.root?.owner?.login&&(this.root.owner.avatarUrl=p(this.root.owner.login)),this.canBeReShared=t&&h.SHARE_OUTSIDE in this.root.hPerms)}setHSize(){this.hSize=this.isDir?"\u25CF":f(this.size,0,!0)}setShares(t){if(t?.length)for(let i of t)i.type===0?this.shares.push(i):this.links.push(i)}};export{N as a};
1
+ import{b as T,c as I,d as b,f as M,h as S}from"./chunk-SPQH3ATC.js";import{b as o,c as O,d as A,h as d,m as g,o as D,p as s,q as w}from"./chunk-RTNEBRKJ.js";import{q as c}from"./chunk-CVXLHSO5.js";import{$a as E,Ia as m,Na as u,_a as f,tb as p,ya as h}from"./chunk-AALPWGPB.js";import{n}from"./chunk-DM4NXKEP.js";var N=class{constructor(t,i,r=!1,e){this.shares=[],this.links=[],this.spaces=[],this.syncs=[],this.newly=0,this.isRenamed=!1,this.isImage=!1,this.isViewable=!1,this.isEditable=!1,this.isCompressible=!0,this.isBeingDeleted=!1,this.isSelected=!1,this.isDisabled=!1,this.canBeReShared=!1,this.haveThumbnail=!1,this.setShares(u("shares",t)),Object.assign(this,t),this.path=`${i}/${this.path!=="."?`${this.path}/`:""}${this.root?.alias||this.name}`,this.mime=this.getMime(this.mime,r,e),this.updateHTimeAgo(this.mtime),this.setMimeUrl(),this.setHSize(),this.setRoot(r)}get dataUrl(){return`${T}/${this.path}`}get taskUrl(){return`${b}/${this.path}`}get thumbnailUrl(){return`${I}/${this.path}`}fallBackMimeUrl(){this.mimeUrl=g}rename(t){this.name=t,this.path=[...this.path.split("/").slice(0,-1),this.name].join("/")}updateMime(t){this.mime=t,this.setMimeUrl()}updateHTimeAgo(t){t??=m(null,!0),this.hTimeAgo=n(t).fromNow(!0),this.newly=E(t)}createLock(t){this.lock=t}removeLock(){this.lock=null}getExtension(){let t=this.name.lastIndexOf(".");return t>=0?this.name.slice(t+1).toLowerCase():""}getType(t){return this.isDir?t?A:O:o}getMime(t,i,r){if(this.isDir)return this.isViewable=!1,this.getType(i);if(!t||t===o)return this.isViewable=!0,this.shortMime=s.TEXT,this.getType(i);let e=this.getExtension(),l=t.indexOf("-"),a=l>=0?t.slice(0,l):t;return e===s.PDF?(this.shortMime=s.PDF,this.isViewable=!0,this.isEditable=r.onlyoffice===!0,t):r.collabora===!0&&M.has(e)||r.onlyoffice===!0&&S.has(e)?(this.shortMime=s.DOCUMENT,this.isEditable=!0,this.isViewable=!0,t):e==="mp4"?(this.isViewable=!0,this.shortMime=s.MEDIA,this.haveThumbnail=!0,t):a===s.IMAGE?(this.shortMime=s.IMAGE,this.isImage=!0,this.isViewable=!0,this.haveThumbnail=!0,t):a==="video"||a==="audio"?(this.shortMime=s.MEDIA,this.isViewable=!0,this.haveThumbnail=!0,t):D.has(t)?(this.isCompressible=!1,this.isViewable=!1,t):(w.has(e)||(this.shortMime=s.TEXT,this.isViewable=!0,this.isEditable=!0),t)}setMimeUrl(){this.mimeUrl=d(this.mime)}setRoot(t){this.root&&(this.root.enabled===!1&&(this.isDisabled=!0),this.root.hPerms=c(this.root.permissions,this.isDir?[]:[h.DELETE,h.ADD]),this.root?.owner?.login&&(this.root.owner.avatarUrl=p(this.root.owner.login)),this.canBeReShared=t&&h.SHARE_OUTSIDE in this.root.hPerms)}setHSize(){this.hSize=this.isDir?"\u25CF":f(this.size,0,!0)}setShares(t){if(t?.length)for(let i of t)i.type===0?this.shares.push(i):this.links.push(i)}};export{N as a};
@@ -1 +1 @@
1
- import{Aa as _,Ac as p,Eb as l,Jb as R,Lb as y,Mb as A,Rb as v,Wa as k,Xa as a,bb as B,cb as h,da as d,dd as g,ec as f,fa as C,kb as c,xa as D}from"./chunk-D55YR5X7.js";var O={provide:g,useExisting:d(()=>H),multi:!0},H=(()=>{let i=class i{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};i.\u0275fac=function(n){return new(n||i)},i.\u0275dir=h({type:i,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(n,t){n&1&&l("click",function(){return t.onClick()}),n&2&&(c("aria-pressed",t.state),v("active",t.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[f([O])]});let r=i;return r})(),T={provide:g,useExisting:d(()=>F),multi:!0},F=(()=>{let i=class i{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,n,t,s){this.el=e,this.cdr=n,this.renderer=t,this.group=s,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};i.\u0275fac=function(n){return new(n||i)(a(_),a(p),a(k),a(d(()=>w),8))},i.\u0275dir=h({type:i,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(n,t){n&1&&l("click",function(){return t.toggleIfAllowed()})("keydown.space",function(o){return t.onSpacePressed(o)})("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()}),n&2&&(c("aria-disabled",t.controlOrGroupDisabled)("aria-checked",t.isActive)("role",t.role)("tabindex",t.tabindex),v("disabled",t.hasDisabledClass)("active",t.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[f([T]),D]});let r=i;return r})(),I={provide:g,useExisting:d(()=>w),multi:!0},w=(()=>{let i=class i{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(n=>{n.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let n=this.radioButtons.find(t=>!t.disabled);n&&n.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function n(s,o){let b=(s+(e==="next"?1:-1))%o.length;return b<0&&(b=o.length-1),b}let t=this.getActiveOrFocusedRadio();if(t&&this.radioButtons){let s=this.radioButtons.toArray(),o=s.indexOf(t);for(let u=n(o,s);u!==o;u=n(u,s))if(s[u].canToggle()){s[u].toggleIfAllowed(),s[u].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};i.\u0275fac=function(n){return new(n||i)(a(p))},i.\u0275dir=h({type:i,selectors:[["","btnRadioGroup",""]],contentQueries:function(n,t,s){if(n&1&&R(s,F,4),n&2){let o;y(o=A())&&(t.radioButtons=o)}},hostVars:2,hostBindings:function(n,t){n&1&&l("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()})("keydown.ArrowRight",function(o){return t.selectNext(o)})("keydown.ArrowDown",function(o){return t.selectNext(o)})("keydown.ArrowLeft",function(o){return t.selectPrevious(o)})("keydown.ArrowUp",function(o){return t.selectPrevious(o)}),n&2&&c("role",t.role)("tabindex",t.tabindex)},features:[f([I])]});let r=i;return r})(),U=(()=>{let i=class i{static forRoot(){return{ngModule:i,providers:[]}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=B({type:i}),i.\u0275inj=C({});let r=i;return r})();export{H as a,U as b};
1
+ import{Aa as _,Ac as p,Eb as l,Jb as R,Lb as y,Mb as A,Rb as v,Wa as k,Xa as a,bb as B,cb as h,da as d,dd as g,ec as f,fa as C,kb as c,xa as D}from"./chunk-76M3BMK6.js";var O={provide:g,useExisting:d(()=>H),multi:!0},H=(()=>{let i=class i{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};i.\u0275fac=function(n){return new(n||i)},i.\u0275dir=h({type:i,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(n,t){n&1&&l("click",function(){return t.onClick()}),n&2&&(c("aria-pressed",t.state),v("active",t.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[f([O])]});let r=i;return r})(),T={provide:g,useExisting:d(()=>F),multi:!0},F=(()=>{let i=class i{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,n,t,s){this.el=e,this.cdr=n,this.renderer=t,this.group=s,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};i.\u0275fac=function(n){return new(n||i)(a(_),a(p),a(k),a(d(()=>w),8))},i.\u0275dir=h({type:i,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(n,t){n&1&&l("click",function(){return t.toggleIfAllowed()})("keydown.space",function(o){return t.onSpacePressed(o)})("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()}),n&2&&(c("aria-disabled",t.controlOrGroupDisabled)("aria-checked",t.isActive)("role",t.role)("tabindex",t.tabindex),v("disabled",t.hasDisabledClass)("active",t.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[f([T]),D]});let r=i;return r})(),I={provide:g,useExisting:d(()=>w),multi:!0},w=(()=>{let i=class i{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(n=>{n.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let n=this.radioButtons.find(t=>!t.disabled);n&&n.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function n(s,o){let b=(s+(e==="next"?1:-1))%o.length;return b<0&&(b=o.length-1),b}let t=this.getActiveOrFocusedRadio();if(t&&this.radioButtons){let s=this.radioButtons.toArray(),o=s.indexOf(t);for(let u=n(o,s);u!==o;u=n(u,s))if(s[u].canToggle()){s[u].toggleIfAllowed(),s[u].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};i.\u0275fac=function(n){return new(n||i)(a(p))},i.\u0275dir=h({type:i,selectors:[["","btnRadioGroup",""]],contentQueries:function(n,t,s){if(n&1&&R(s,F,4),n&2){let o;y(o=A())&&(t.radioButtons=o)}},hostVars:2,hostBindings:function(n,t){n&1&&l("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()})("keydown.ArrowRight",function(o){return t.selectNext(o)})("keydown.ArrowDown",function(o){return t.selectNext(o)})("keydown.ArrowLeft",function(o){return t.selectPrevious(o)})("keydown.ArrowUp",function(o){return t.selectPrevious(o)}),n&2&&c("role",t.role)("tabindex",t.tabindex)},features:[f([I])]});let r=i;return r})(),U=(()=>{let i=class i{static forRoot(){return{ngModule:i,providers:[]}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=B({type:i}),i.\u0275inj=C({});let r=i;return r})();export{H as a,U as b};
@@ -1,4 +1,4 @@
1
- import{a as fe}from"./chunk-GXWGB7WO.js";import"./chunk-XBKCQCBI.js";import"./chunk-L3BIP4AA.js";import"./chunk-NMF2ZFBE.js";import{c as me}from"./chunk-3WZ6F3LC.js";import{h as M}from"./chunk-XTVNHFKX.js";import"./chunk-RTNEBRKJ.js";import{a as se}from"./chunk-3JYMJQYT.js";import{e as pe}from"./chunk-ZHOE5VEY.js";import{c as de}from"./chunk-27Z3SYRL.js";import{Cb as O,F as N,G as ae,J as ce,qb as re,rb as H,s as Y}from"./chunk-O3YLAEVE.js";import{d as j}from"./chunk-QHJT5H4M.js";import{$e as te,Bb as R,Bf as ne,Eb as m,Ed as K,Gb as u,Ia as $,Jd as W,Kd as k,L as A,Ld as G,Ma as z,Oa as e,Qa as U,Rb as L,Sb as T,Sd as q,Tb as s,Ub as C,Ue as Z,Vb as S,Vf as oe,Wb as E,We as ee,ab as P,cc as I,ce as J,gf as D,gg as le,he as Q,ja as _,kc as f,lb as y,lc as V,mb as g,mc as h,nf as ie,oa as b,pa as x,pb as B,qb as F,qg as w,rb as c,sb as n,se as X,tb as l,ub as p}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function _e(a,r){if(a&1&&p(0,"fa-icon",4),a&2){let t=u();c("icon",t.icons.faSpinner)}}var ue=(()=>{let r=class r{constructor(){this.wasDeleted=new U,this.layout=_(O),this.icons={faSpinner:ie,faTrashCan:D},this.submitted=!1,this.syncService=_(M)}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.syncService.deleteClient(this.client.id).subscribe({next:()=>{this.layout.sendNotification("info","Client deleted",this.client.info.node),this.wasDeleted.emit(),this.layout.closeDialog()},error:i=>{this.layout.sendNotification("error","Unable to delete client",i.error.message),this.submitted=!1}}))}};r.\u0275fac=function(d){return new(d||r)},r.\u0275cmp=P({type:r,selectors:[["app-sync-client-delete-dialog"]],hostBindings:function(d,o){d&1&&m("keyup.enter",function(){return o.onEnter()},z)},inputs:{client:"client"},outputs:{wasDeleted:"wasDeleted"},decls:21,vars:6,consts:[[1,"modal-header"],["translate","",1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["size","lg",1,"me-2",3,"icon","fixedWidth"],["l10nTranslate","",1,"ms-1"],["translate",""],[1,"modal-footer"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(d,o){d&1&&(n(0,"div",0)(1,"h4",1),p(2,"fa-icon",2),n(3,"span",3),s(4,"Client"),l(),y(5,_e,1,1,"fa-icon",4),l(),n(6,"button",5),m("click",function(){return o.layout.closeDialog()}),l()(),n(7,"div",6)(8,"div")(9,"b"),p(10,"fa-icon",7),s(11),l(),n(12,"span",8),s(13,"will be removed"),l()(),n(14,"small",9),s(15,"The client will no longer have permission to access your account and will no longer be able to synchronize."),l()(),n(16,"div",10)(17,"button",11),m("click",function(){return o.layout.closeDialog()}),s(18,"Cancel"),l(),n(19,"button",12),m("click",function(){return o.onSubmit()}),s(20,"Confirm"),l()()),d&2&&(e(2),c("icon",o.icons.faTrashCan),e(3),g(o.submitted?5:-1),e(5),c("icon",o.client.icon)("fixedWidth",!1),e(),C(o.client.info.node),e(8),c("disabled",o.submitted))},dependencies:[w,k],encapsulation:2,changeDetection:0});let a=r;return a})();var he=(a,r)=>r.id;function ve(a,r){if(a&1&&(p(0,"fa-icon",13),f(1,"translate")),a&2){let t=u(2);c("icon",t.icons.faCircle)("tooltip",h(1,2,"This client",t.locale.language))}}function ye(a,r){if(a&1&&(s(0),f(1,"amTimeAgo")),a&2){let t=u().$implicit;S(" ",h(1,1,t.settings.lastSync,!0)," ")}}function ge(a,r){if(a&1&&(s(0),f(1,"translate")),a&2){let t=u(3);S(" ",h(1,1,"never",t.locale.language)," ")}}function Se(a,r){if(a&1){let t=R();n(0,"div",20),m("click",function(){let d=b(t).$implicit,o=u(2);return x(o.onSelectPath(d))})("dblclick",function(){b(t);let d=u(2);return x(d.onEditPath())}),n(1,"div",21),p(2,"img",22),n(3,"div",23)(4,"span",24),s(5),l(),n(6,"div"),p(7,"fa-icon",25),n(8,"span",26)(9,"span"),s(10),l()()()()(),n(11,"div",27),p(12,"fa-icon",2),s(13),f(14,"amTimeAgo"),l(),n(15,"div"),p(16,"fa-icon",2),y(17,ye,2,4)(18,ge,2,4),l()()}if(a&2){let t=r.$implicit,i=u(2);L("selected",i.selectedPath&&i.selectedPath.id===t.id),e(2),c("src",t.mimeUrl,$),e(3),C(t.settings.name),e(),T(I("d-flex align-items-center text-",t.iconClass)),e(),c("icon",t.icon),e(3),C(t.showedPath),e(2),c("icon",i.icons.faPlusCircle),e(),S(" ",h(14,16,t.createdAt,!0)," "),e(2),T(I("badge rounded-pill sync-newly-",t.newly)),e(),c("icon",i.icons.faRotate),e(),g(t.newly?17:18)}}function be(a,r){if(a&1){let t=R();n(0,"div",8),m("click",function(){let d=b(t).$implicit,o=u();return x(o.onSelectClient(d))}),n(1,"div",9)(2,"div",10)(3,"div",11),p(4,"fa-icon",2),n(5,"div",12),s(6),l(),y(7,ve,2,5,"fa-icon",13),l(),n(8,"div"),p(9,"fa-icon",2),n(10,"div")(11,"span",14),s(12),l(),s(13),f(14,"amTimeAgo"),l()(),n(15,"div",11),p(16,"fa-icon",15),n(17,"div"),s(18),l()(),n(19,"div",11),p(20,"fa-icon",2),n(21,"div"),s(22),l()(),n(23,"div",11),p(24,"fa-icon",2),n(25,"div",16),s(26),l(),n(27,"div",17),s(28),l()(),n(29,"div",11),p(30,"fa-icon",2),n(31,"div"),s(32),l()(),n(33,"div",11),p(34,"fa-icon",2),n(35,"div"),s(36),f(37,"amDateFormat"),f(38,"amDateFormat"),l()()()(),n(39,"div",18),B(40,Se,19,19,"div",19,he),l()()}if(a&2){let t=r.$implicit,i=u();e(),L("selected",i.selected&&i.selected.id===t.id),e(3),c("icon",i.icons.CLIENT),e(2),C(t.info.node),e(),g(t.isCurrentClient?7:-1),e(),T(I("d-flex align-items-center ",t.expiration.reached?"fw-bold text-danger":t.expiration.approaching?"fw-bold text-warning":"")),e(),c("icon",i.icons.faKey),e(3),C(t.expiration.reached?"The access has expired":"The access expires"),e(),S("\xA0",V(14,25,t.expiration.value)," "),e(3),c("icon",t.icon),e(2),E("",t.osName," ",t.info.osRelease),e(2),c("icon",i.icons.faCircleUser),e(2),C(t.info.user),e(2),c("icon",i.icons.faCodeBranch),e(2),C(t.info.type),e(2),C(t.info.version),e(2),c("icon",i.icons.faAt),e(2),E("",t.currentIp,"\xA0-\xA0",t.lastIp),e(2),c("icon",i.icons.faClock),e(2),E("",h(37,27,t.currentAccess,"L HH:mm:ss"),"\xA0-\xA0",h(38,30,t.lastAccess,"L HH:mm:ss")),e(4),F(t.paths)}}var Ze=(()=>{let r=class r{constructor(){this.locale=_(K),this.icons={faArrowRotateRight:oe,faTrashCan:D,CLIENT:re.CLIENT,faCircle:ee,faCircleUser:te,faCodeBranch:J,faAt:q,faClock:X,faRotate:G,faPlusCircle:Z,faMapMarkerAlt:le,faPen:ne,faKey:Q},this.loading=!1,this.clients=[],this.router=_(j),this.layout=_(O),this.syncService=_(M),this.layout.setBreadcrumbIcon(ce.CLIENTS),this.layout.setBreadcrumbNav({url:`/${N.BASE}/${N.CLIENTS}/${ae.CLIENTS}`,splicing:2,translating:!0,sameLink:!0});let i=this.router.currentNavigation()?.extras.state;i?.clientId&&(this.focusOnSelectId=i.clientId,this.focusOnSelectPathId=i.pathId),this.loadClients()}loadClients(){this.loading=!0,this.onSelectClient(),this.onSelectPath(),this.syncService.getClients().subscribe({next:i=>{de(i,"id",!1),this.clients=i,this.focusOnSelectId&&this.onSelectClient(this.clients.find(d=>d.id===this.focusOnSelectId)),this.focusOnSelectPathId&&this.selected&&(this.onSelectPath(this.selected.paths.find(d=>d.id===this.focusOnSelectPathId)),this.focusOnSelectPathId=null)},error:i=>{console.error(i),this.loading=!1,this.layout.sendNotification("error","Clients",i.error.message)}})}onSelectClient(i){this.selected=i||null}onSelectPath(i){this.selectedPath=i||null}onDeleteClient(){this.layout.openDialog(ue,"md",{initialState:{client:this.selected}}).content.wasDeleted.pipe(A(1)).subscribe(()=>this.loadClients())}gotoPath(i){this.syncService.goToPath(i,!1)}onEditPath(){this.selected.isCurrentClient?this.router.navigate([H.BASE,H.PATHS],{state:{id:this.selectedPath.id,withSettings:!0}}).catch(console.error):this.layout.openDialog(fe,"md",{initialState:{syncPathSelected:this.selectedPath,syncClientSelected:this.selected}}).content.mustRefresh.pipe(A(1)).subscribe(()=>{this.focusOnSelectId=this.selected.id,this.focusOnSelectPathId=this.selectedPath.id,this.loadClients()})}};r.\u0275fac=function(d){return new(d||r)},r.\u0275cmp=P({type:r,selectors:[["app-sync-clients"]],decls:16,vars:23,consts:[[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],["placement","auto","type","button",1,"btn","btn-sm","btn-secondary","ms-auto","me-1",3,"click","disabled","tooltip"],["placement","auto","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],["appAutoResize","",1,"app-sync-clients"],[1,"d-flex"],[1,"d-flex",3,"click"],[1,"left-panel","app-div-hovered","col-md-5","col-lg-4","col-sm-12"],[1,"left-panel-content","p-2"],[1,"d-flex","align-items-center"],[1,"me-auto","fw-semibold"],[1,"text-light-green","cursor-pointer",3,"icon","tooltip"],["l10nTranslate",""],[1,"osIcon",3,"icon"],[1,"me-2"],[1,"badge","rounded-pill","bg-primary"],[1,"right-panel","d-none","d-md-flex","d-lg-flex","col-md-7","col-lg-8","p-0"],[1,"d-flex","align-items-center","cursor-pointer","app-div-hovered","py-1","ps-2","pe-4",3,"selected"],[1,"d-flex","align-items-center","cursor-pointer","app-div-hovered","py-1","ps-2","pe-4",3,"click","dblclick"],[1,"d-flex","align-items-center","text-truncate","px-2","py-1","me-auto"],["alt","","draggable","false","height","30",3,"src"],[1,"d-flex","flex-column","text-truncate","ms-2",2,"height","34px"],[1,"fs-xxs","text-truncate","user-select-none"],[1,"me-1",3,"icon"],[1,"fs-xxxs","text-truncate","user-select-none"],[1,"badge","rounded-pill","bg-dark","me-1"]],template:function(d,o){d&1&&(n(0,"div",0)(1,"button",1),f(2,"translate"),m("click",function(){return o.loadClients()}),p(3,"fa-icon",2),l(),n(4,"button",3),f(5,"translate"),m("click",function(){return o.onDeleteClient()}),p(6,"fa-icon",2),l(),n(7,"button",4),f(8,"translate"),m("click",function(){return o.gotoPath(o.selectedPath)}),p(9,"fa-icon",2),l(),n(10,"button",5),f(11,"translate"),m("click",function(){return o.onEditPath()}),p(12,"fa-icon",2),l()(),n(13,"div",6),B(14,be,42,33,"div",7,he),l()),d&2&&(e(),c("tooltip",h(2,11,"Refresh",o.locale.language)),e(2),c("icon",o.icons.faArrowRotateRight),e(),c("disabled",!o.selected)("tooltip",h(5,14,"Remove",o.locale.language)),e(2),c("icon",o.icons.faTrashCan),e(),c("disabled",!o.selectedPath)("tooltip",h(8,17,"Go to",o.locale.language)),e(2),c("icon",o.icons.faMapMarkerAlt),e(),c("disabled",!o.selectedPath)("tooltip",h(11,20,"Edit",o.locale.language)),e(2),c("icon",o.icons.faPen),e(2),F(o.clients))},dependencies:[Y,w,me,k,W,se,pe],styles:[`.app-sync-clients[_ngcontent-%COMP%]{font-size:.7rem;display:flex;flex-direction:column;flex:1 1 auto!important}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;border-right:solid 1px;border-bottom:solid 1px}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] .osIcon[_ngcontent-%COMP%]{font-size:1.2rem;margin-right:.4rem;margin-left:-2px}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]:first-child:not(.osIcon){font-size:1rem;margin-right:.4rem}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:26px}.app-sync-clients[_ngcontent-%COMP%] .right-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-bottom:solid 1px}
1
+ import{a as fe}from"./chunk-76REYAEA.js";import"./chunk-2GXOVGTD.js";import"./chunk-3ZBAQTHJ.js";import"./chunk-NMF2ZFBE.js";import{c as me}from"./chunk-FWQJ4ZCD.js";import{h as M}from"./chunk-XSURUW7C.js";import"./chunk-RTNEBRKJ.js";import{a as se}from"./chunk-ZHUBWKA2.js";import{e as pe}from"./chunk-R4VYKZVJ.js";import{c as de}from"./chunk-WRK2FTKU.js";import{Cb as O,F as N,G as ae,J as ce,qb as re,rb as H,s as Y}from"./chunk-AALPWGPB.js";import{d as j}from"./chunk-3MVPXC3U.js";import{$e as te,Bb as R,Bf as ne,Eb as m,Ed as K,Gb as u,Ia as $,Jd as W,Kd as k,L as A,Ld as G,Ma as z,Oa as e,Qa as U,Rb as L,Sb as T,Sd as q,Tb as s,Ub as C,Ue as Z,Vb as S,Vf as oe,Wb as E,We as ee,ab as P,cc as I,ce as J,gf as D,gg as le,he as Q,ja as _,kc as f,lb as y,lc as V,mb as g,mc as h,nf as ie,oa as b,pa as x,pb as B,qb as F,qg as w,rb as c,sb as n,se as X,tb as l,ub as p}from"./chunk-76M3BMK6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function _e(a,r){if(a&1&&p(0,"fa-icon",4),a&2){let t=u();c("icon",t.icons.faSpinner)}}var ue=(()=>{let r=class r{constructor(){this.wasDeleted=new U,this.layout=_(O),this.icons={faSpinner:ie,faTrashCan:D},this.submitted=!1,this.syncService=_(M)}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.syncService.deleteClient(this.client.id).subscribe({next:()=>{this.layout.sendNotification("info","Client deleted",this.client.info.node),this.wasDeleted.emit(),this.layout.closeDialog()},error:i=>{this.layout.sendNotification("error","Unable to delete client",i.error.message),this.submitted=!1}}))}};r.\u0275fac=function(d){return new(d||r)},r.\u0275cmp=P({type:r,selectors:[["app-sync-client-delete-dialog"]],hostBindings:function(d,o){d&1&&m("keyup.enter",function(){return o.onEnter()},z)},inputs:{client:"client"},outputs:{wasDeleted:"wasDeleted"},decls:21,vars:6,consts:[[1,"modal-header"],["translate","",1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["size","lg",1,"me-2",3,"icon","fixedWidth"],["l10nTranslate","",1,"ms-1"],["translate",""],[1,"modal-footer"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(d,o){d&1&&(n(0,"div",0)(1,"h4",1),p(2,"fa-icon",2),n(3,"span",3),s(4,"Client"),l(),y(5,_e,1,1,"fa-icon",4),l(),n(6,"button",5),m("click",function(){return o.layout.closeDialog()}),l()(),n(7,"div",6)(8,"div")(9,"b"),p(10,"fa-icon",7),s(11),l(),n(12,"span",8),s(13,"will be removed"),l()(),n(14,"small",9),s(15,"The client will no longer have permission to access your account and will no longer be able to synchronize."),l()(),n(16,"div",10)(17,"button",11),m("click",function(){return o.layout.closeDialog()}),s(18,"Cancel"),l(),n(19,"button",12),m("click",function(){return o.onSubmit()}),s(20,"Confirm"),l()()),d&2&&(e(2),c("icon",o.icons.faTrashCan),e(3),g(o.submitted?5:-1),e(5),c("icon",o.client.icon)("fixedWidth",!1),e(),C(o.client.info.node),e(8),c("disabled",o.submitted))},dependencies:[w,k],encapsulation:2,changeDetection:0});let a=r;return a})();var he=(a,r)=>r.id;function ve(a,r){if(a&1&&(p(0,"fa-icon",13),f(1,"translate")),a&2){let t=u(2);c("icon",t.icons.faCircle)("tooltip",h(1,2,"This client",t.locale.language))}}function ye(a,r){if(a&1&&(s(0),f(1,"amTimeAgo")),a&2){let t=u().$implicit;S(" ",h(1,1,t.settings.lastSync,!0)," ")}}function ge(a,r){if(a&1&&(s(0),f(1,"translate")),a&2){let t=u(3);S(" ",h(1,1,"never",t.locale.language)," ")}}function Se(a,r){if(a&1){let t=R();n(0,"div",20),m("click",function(){let d=b(t).$implicit,o=u(2);return x(o.onSelectPath(d))})("dblclick",function(){b(t);let d=u(2);return x(d.onEditPath())}),n(1,"div",21),p(2,"img",22),n(3,"div",23)(4,"span",24),s(5),l(),n(6,"div"),p(7,"fa-icon",25),n(8,"span",26)(9,"span"),s(10),l()()()()(),n(11,"div",27),p(12,"fa-icon",2),s(13),f(14,"amTimeAgo"),l(),n(15,"div"),p(16,"fa-icon",2),y(17,ye,2,4)(18,ge,2,4),l()()}if(a&2){let t=r.$implicit,i=u(2);L("selected",i.selectedPath&&i.selectedPath.id===t.id),e(2),c("src",t.mimeUrl,$),e(3),C(t.settings.name),e(),T(I("d-flex align-items-center text-",t.iconClass)),e(),c("icon",t.icon),e(3),C(t.showedPath),e(2),c("icon",i.icons.faPlusCircle),e(),S(" ",h(14,16,t.createdAt,!0)," "),e(2),T(I("badge rounded-pill sync-newly-",t.newly)),e(),c("icon",i.icons.faRotate),e(),g(t.newly?17:18)}}function be(a,r){if(a&1){let t=R();n(0,"div",8),m("click",function(){let d=b(t).$implicit,o=u();return x(o.onSelectClient(d))}),n(1,"div",9)(2,"div",10)(3,"div",11),p(4,"fa-icon",2),n(5,"div",12),s(6),l(),y(7,ve,2,5,"fa-icon",13),l(),n(8,"div"),p(9,"fa-icon",2),n(10,"div")(11,"span",14),s(12),l(),s(13),f(14,"amTimeAgo"),l()(),n(15,"div",11),p(16,"fa-icon",15),n(17,"div"),s(18),l()(),n(19,"div",11),p(20,"fa-icon",2),n(21,"div"),s(22),l()(),n(23,"div",11),p(24,"fa-icon",2),n(25,"div",16),s(26),l(),n(27,"div",17),s(28),l()(),n(29,"div",11),p(30,"fa-icon",2),n(31,"div"),s(32),l()(),n(33,"div",11),p(34,"fa-icon",2),n(35,"div"),s(36),f(37,"amDateFormat"),f(38,"amDateFormat"),l()()()(),n(39,"div",18),B(40,Se,19,19,"div",19,he),l()()}if(a&2){let t=r.$implicit,i=u();e(),L("selected",i.selected&&i.selected.id===t.id),e(3),c("icon",i.icons.CLIENT),e(2),C(t.info.node),e(),g(t.isCurrentClient?7:-1),e(),T(I("d-flex align-items-center ",t.expiration.reached?"fw-bold text-danger":t.expiration.approaching?"fw-bold text-warning":"")),e(),c("icon",i.icons.faKey),e(3),C(t.expiration.reached?"The access has expired":"The access expires"),e(),S("\xA0",V(14,25,t.expiration.value)," "),e(3),c("icon",t.icon),e(2),E("",t.osName," ",t.info.osRelease),e(2),c("icon",i.icons.faCircleUser),e(2),C(t.info.user),e(2),c("icon",i.icons.faCodeBranch),e(2),C(t.info.type),e(2),C(t.info.version),e(2),c("icon",i.icons.faAt),e(2),E("",t.currentIp,"\xA0-\xA0",t.lastIp),e(2),c("icon",i.icons.faClock),e(2),E("",h(37,27,t.currentAccess,"L HH:mm:ss"),"\xA0-\xA0",h(38,30,t.lastAccess,"L HH:mm:ss")),e(4),F(t.paths)}}var Ze=(()=>{let r=class r{constructor(){this.locale=_(K),this.icons={faArrowRotateRight:oe,faTrashCan:D,CLIENT:re.CLIENT,faCircle:ee,faCircleUser:te,faCodeBranch:J,faAt:q,faClock:X,faRotate:G,faPlusCircle:Z,faMapMarkerAlt:le,faPen:ne,faKey:Q},this.loading=!1,this.clients=[],this.router=_(j),this.layout=_(O),this.syncService=_(M),this.layout.setBreadcrumbIcon(ce.CLIENTS),this.layout.setBreadcrumbNav({url:`/${N.BASE}/${N.CLIENTS}/${ae.CLIENTS}`,splicing:2,translating:!0,sameLink:!0});let i=this.router.currentNavigation()?.extras.state;i?.clientId&&(this.focusOnSelectId=i.clientId,this.focusOnSelectPathId=i.pathId),this.loadClients()}loadClients(){this.loading=!0,this.onSelectClient(),this.onSelectPath(),this.syncService.getClients().subscribe({next:i=>{de(i,"id",!1),this.clients=i,this.focusOnSelectId&&this.onSelectClient(this.clients.find(d=>d.id===this.focusOnSelectId)),this.focusOnSelectPathId&&this.selected&&(this.onSelectPath(this.selected.paths.find(d=>d.id===this.focusOnSelectPathId)),this.focusOnSelectPathId=null)},error:i=>{console.error(i),this.loading=!1,this.layout.sendNotification("error","Clients",i.error.message)}})}onSelectClient(i){this.selected=i||null}onSelectPath(i){this.selectedPath=i||null}onDeleteClient(){this.layout.openDialog(ue,"md",{initialState:{client:this.selected}}).content.wasDeleted.pipe(A(1)).subscribe(()=>this.loadClients())}gotoPath(i){this.syncService.goToPath(i,!1)}onEditPath(){this.selected.isCurrentClient?this.router.navigate([H.BASE,H.PATHS],{state:{id:this.selectedPath.id,withSettings:!0}}).catch(console.error):this.layout.openDialog(fe,"md",{initialState:{syncPathSelected:this.selectedPath,syncClientSelected:this.selected}}).content.mustRefresh.pipe(A(1)).subscribe(()=>{this.focusOnSelectId=this.selected.id,this.focusOnSelectPathId=this.selectedPath.id,this.loadClients()})}};r.\u0275fac=function(d){return new(d||r)},r.\u0275cmp=P({type:r,selectors:[["app-sync-clients"]],decls:16,vars:23,consts:[[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],["placement","auto","type","button",1,"btn","btn-sm","btn-secondary","ms-auto","me-1",3,"click","disabled","tooltip"],["placement","auto","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],["appAutoResize","",1,"app-sync-clients"],[1,"d-flex"],[1,"d-flex",3,"click"],[1,"left-panel","app-div-hovered","col-md-5","col-lg-4","col-sm-12"],[1,"left-panel-content","p-2"],[1,"d-flex","align-items-center"],[1,"me-auto","fw-semibold"],[1,"text-light-green","cursor-pointer",3,"icon","tooltip"],["l10nTranslate",""],[1,"osIcon",3,"icon"],[1,"me-2"],[1,"badge","rounded-pill","bg-primary"],[1,"right-panel","d-none","d-md-flex","d-lg-flex","col-md-7","col-lg-8","p-0"],[1,"d-flex","align-items-center","cursor-pointer","app-div-hovered","py-1","ps-2","pe-4",3,"selected"],[1,"d-flex","align-items-center","cursor-pointer","app-div-hovered","py-1","ps-2","pe-4",3,"click","dblclick"],[1,"d-flex","align-items-center","text-truncate","px-2","py-1","me-auto"],["alt","","draggable","false","height","30",3,"src"],[1,"d-flex","flex-column","text-truncate","ms-2",2,"height","34px"],[1,"fs-xxs","text-truncate","user-select-none"],[1,"me-1",3,"icon"],[1,"fs-xxxs","text-truncate","user-select-none"],[1,"badge","rounded-pill","bg-dark","me-1"]],template:function(d,o){d&1&&(n(0,"div",0)(1,"button",1),f(2,"translate"),m("click",function(){return o.loadClients()}),p(3,"fa-icon",2),l(),n(4,"button",3),f(5,"translate"),m("click",function(){return o.onDeleteClient()}),p(6,"fa-icon",2),l(),n(7,"button",4),f(8,"translate"),m("click",function(){return o.gotoPath(o.selectedPath)}),p(9,"fa-icon",2),l(),n(10,"button",5),f(11,"translate"),m("click",function(){return o.onEditPath()}),p(12,"fa-icon",2),l()(),n(13,"div",6),B(14,be,42,33,"div",7,he),l()),d&2&&(e(),c("tooltip",h(2,11,"Refresh",o.locale.language)),e(2),c("icon",o.icons.faArrowRotateRight),e(),c("disabled",!o.selected)("tooltip",h(5,14,"Remove",o.locale.language)),e(2),c("icon",o.icons.faTrashCan),e(),c("disabled",!o.selectedPath)("tooltip",h(8,17,"Go to",o.locale.language)),e(2),c("icon",o.icons.faMapMarkerAlt),e(),c("disabled",!o.selectedPath)("tooltip",h(11,20,"Edit",o.locale.language)),e(2),c("icon",o.icons.faPen),e(2),F(o.clients))},dependencies:[Y,w,me,k,W,se,pe],styles:[`.app-sync-clients[_ngcontent-%COMP%]{font-size:.7rem;display:flex;flex-direction:column;flex:1 1 auto!important}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;border-right:solid 1px;border-bottom:solid 1px}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] .osIcon[_ngcontent-%COMP%]{font-size:1.2rem;margin-right:.4rem;margin-left:-2px}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]:first-child:not(.osIcon){font-size:1rem;margin-right:.4rem}.app-sync-clients[_ngcontent-%COMP%] .left-panel[_ngcontent-%COMP%] .left-panel-content[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:26px}.app-sync-clients[_ngcontent-%COMP%] .right-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-bottom:solid 1px}
2
2
 
3
3
 
4
4