@sync-in/server 1.8.0 → 1.8.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 (55) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/package.json +10 -9
  3. package/server/app.bootstrap.js +4 -2
  4. package/server/app.bootstrap.js.map +1 -1
  5. package/server/applications/files/files.controller.js +12 -4
  6. package/server/applications/files/files.controller.js.map +1 -1
  7. package/server/applications/files/files.controller.spec.js +18 -4
  8. package/server/applications/files/files.controller.spec.js.map +1 -1
  9. package/server/applications/files/services/files-manager.service.js.map +1 -1
  10. package/server/applications/files/services/files-methods.service.js +1 -6
  11. package/server/applications/files/services/files-methods.service.js.map +1 -1
  12. package/server/applications/files/utils/doc-textify/adapters/pdf.js +5 -16
  13. package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
  14. package/server/applications/users/services/users-manager.service.js +1 -2
  15. package/server/applications/users/services/users-manager.service.js.map +1 -1
  16. package/server/applications/users/users.gateway.js +6 -0
  17. package/server/applications/users/users.gateway.js.map +1 -1
  18. package/server/common/image.js +62 -58
  19. package/server/common/image.js.map +1 -1
  20. package/static/3rdpartylicenses.txt +0 -26
  21. package/static/chunk-2VMSXRCB.js +12 -0
  22. package/static/{chunk-X5XGK6T7.js → chunk-3OHSRRKH.js} +1 -1
  23. package/static/{chunk-H6NE33VX.js → chunk-3R4WKOHQ.js} +1 -1
  24. package/static/{chunk-WLMNXRBS.js → chunk-3R74L4UU.js} +1 -1
  25. package/static/{chunk-ZPF2DSQV.js → chunk-5UKZLU5H.js} +1 -1
  26. package/static/{chunk-KFJIQIGR.js → chunk-BQV4FRM6.js} +1 -1
  27. package/static/{chunk-MFLIJH6T.js → chunk-CETH7UYS.js} +1 -1
  28. package/static/{chunk-C36MW4ME.js → chunk-DIT6W7VM.js} +9 -9
  29. package/static/{chunk-YW57T2PF.js → chunk-IQSKQXC3.js} +1 -1
  30. package/static/{chunk-QZU2S5CV.js → chunk-ITUFI2BJ.js} +1 -1
  31. package/static/{chunk-PGZZP5W3.js → chunk-LCTZJ537.js} +1 -1
  32. package/static/{chunk-LVM4QB22.js → chunk-LK2UCQJ6.js} +1 -1
  33. package/static/{chunk-ZTCRGJ6Y.js → chunk-LP5TBXEN.js} +1 -1
  34. package/static/{chunk-BIKLW4YS.js → chunk-LVSNIS5P.js} +1 -1
  35. package/static/{chunk-VM4YX6Q7.js → chunk-MTVSJTIW.js} +1 -1
  36. package/static/{chunk-V3AT2BKP.js → chunk-O6FYXVHI.js} +1 -1
  37. package/static/{chunk-SHIVUDP3.js → chunk-PNR6M34W.js} +1 -1
  38. package/static/{chunk-M3XVNQZQ.js → chunk-QMRBZHE4.js} +1 -1
  39. package/static/{chunk-NO2LTNW3.js → chunk-QSJRY3TF.js} +1 -1
  40. package/static/{chunk-373XVRXW.js → chunk-QUUIRSYT.js} +1 -1
  41. package/static/{chunk-UEQCWMXD.js → chunk-RFH46UW3.js} +1 -1
  42. package/static/{chunk-AY2SZ3G6.js → chunk-RSXHRKM5.js} +1 -1
  43. package/static/{chunk-UJPPR4MX.js → chunk-RV3VZJPZ.js} +1 -1
  44. package/static/{chunk-JSWCNGXJ.js → chunk-S7HNXVRB.js} +1 -1
  45. package/static/{chunk-VKK5BSLX.js → chunk-SJR5R3Y4.js} +1 -1
  46. package/static/{chunk-UG5DMXYO.js → chunk-V3LHHZYN.js} +1 -1
  47. package/static/{chunk-HAS5ZOTR.js → chunk-VJTXJ43D.js} +1 -1
  48. package/static/{chunk-HNQRZALS.js → chunk-VQQKMY2C.js} +1 -1
  49. package/static/{chunk-MSUHTBB2.js → chunk-WSSU2HXE.js} +1 -1
  50. package/static/{chunk-GUGNR5TF.js → chunk-XDZGW64M.js} +2 -2
  51. package/static/{chunk-TPYBFZS5.js → chunk-XTRDKGKG.js} +1 -1
  52. package/static/{chunk-YEKR5OPO.js → chunk-YLWTEC3X.js} +1 -1
  53. package/static/index.html +1 -1
  54. package/static/{main-VOL6OMJ5.js → main-4H5BJY3J.js} +2 -2
  55. package/static/chunk-WJW7CT6G.js +0 -27
@@ -1 +1 @@
1
- import{b as Ct,c as ht}from"./chunk-MFLIJH6T.js";import{A as ft,C as gt,z as ut}from"./chunk-WJW7CT6G.js";import{a as _t}from"./chunk-JSWCNGXJ.js";import{a as re}from"./chunk-AY2SZ3G6.js";import{c as Xe,f as ct}from"./chunk-UEQCWMXD.js";import{a as it}from"./chunk-TPYBFZS5.js";import{a as pt}from"./chunk-MSUHTBB2.js";import"./chunk-HAS5ZOTR.js";import{a as et,b as nt,c as ot,d as at,e as rt,g as lt,h as st}from"./chunk-X5XGK6T7.js";import{a as oe,b as ae,c as Je,d as Ze,e as tt}from"./chunk-H6NE33VX.js";import{e as dt}from"./chunk-V3AT2BKP.js";import{f as mt,g as ie}from"./chunk-VKK5BSLX.js";import"./chunk-3XVM35O2.js";import"./chunk-BIKLW4YS.js";import"./chunk-SHIVUDP3.js";import{b as Se,d as xe}from"./chunk-UJPPR4MX.js";import{m as Ye,p as te}from"./chunk-HNQRZALS.js";import{C as Oe,Ib as je,Jb as R,Kb as ne,Ma as He,Tb as Ge,Za as Qe,mb as ze,nb as O,qb as Z,r as Me,s as Pe,va as Ue,wa as $e,xa as qe,yb as ee}from"./chunk-GUGNR5TF.js";import{$a as $,$b as Ce,Ab as x,Cd as De,Db as f,Dd as K,Ed as Ae,Ef as Le,Fb as c,Gf as G,Ic as he,If as Be,Jb as B,Kb as N,L,Lb as W,Na as a,Nb as F,Ob as U,Pa as de,Pb as I,Qb as m,Rb as D,Re as Fe,Sb as T,Tb as ue,Ub as M,Ue as Ie,Uf as Ne,Vb as P,Wb as A,Yb as H,Zb as fe,Zc as be,_c as ye,_f as We,bf as Re,cb as q,cd as ve,dg as J,eb as w,ec as b,f as me,fc as Q,fg as Ke,gc as y,hc as ge,hd as we,ia as v,jb as _e,kb as C,lb as g,na as h,oa as S,ob as V,of as j,pb as k,pe as Ve,qb as p,rb as l,rd as Te,sb as s,se as ke,tb as u,vd as Ee,vf as Y,xd as z}from"./chunk-C36MW4ME.js";import{n as X}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as ce,b as pe}from"./chunk-N3U6637P.js";var St=(()=>{let r=class r{transform(n,o,i){if(typeof o>"u"||typeof o=="number"&&typeof i>"u")throw new Error("TimeAddPipe: missing required arguments");return X(n).add(o,i)}};r.\u0275fac=function(o){return new(o||r)},r.\u0275pipe=q({name:"amAdd",type:r,pure:!0});let e=r;return e})();var xt=(()=>{let r=class r{transform(n,o){if(!o)throw new Error("TimeDurationPipe: missing required time unit argument");return X.duration({[o]:n}).humanize()}};r.\u0275fac=function(o){return new(o||r)},r.\u0275pipe=q({name:"amDuration",type:r,pure:!1});let e=r;return e})();function Et(e,r){if(e&1&&(l(0,"span"),m(1),s()),e&2){let t=c();a(),D(t.space.name)}}function Dt(e,r){e&1&&(l(0,"span",3),m(1,"Create a new space"),s())}function Mt(e,r){if(e&1&&u(0,"fa-icon",4),e&2){let t=c();p("icon",t.icons.faSpinner)}}function Pt(e,r){e&1&&(l(0,"h4",5)(1,"span",3),m(2,"Edit space"),s()())}function At(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",48),m(2,"Settings"),s()),e&2){let t=c();p("icon",t.icons.faCog)}}function Vt(e,r){if(e&1&&(l(0,"div",22)(1,"label",49),m(2,"Storage Usage"),s(),u(3,"app-storage-usage",50),s()),e&2){let t=c();a(3),p("item",t.space)}}function kt(e,r){e&1&&(l(0,"small",36),m(1,"At least one manager is required"),s())}function Ft(e,r){if(e&1&&(l(0,"div",57)(1,"label",58),m(2,"Deactivation date"),s(),l(3,"div",59),m(4),b(5,"amDateFormat"),s()()),e&2){let t=c(2);a(4),D(Q(5,1,t.space.disabledAt))}}function It(e,r){if(e&1&&(l(0,"div",37)(1,"div",51)(2,"label",52),m(3,"Creation date"),s(),l(4,"div",53),m(5),b(6,"amDateFormat"),s()(),l(7,"div",54)(8,"label",55),m(9,"Modification date"),s(),l(10,"div",56),m(11),b(12,"amDateFormat"),s()(),C(13,Ft,6,3,"div",57),s()),e&2){let t=c();a(5),D(Q(6,3,t.space.createdAt)),a(6),D(Q(12,5,t.space.modifiedAt)),a(2),g(t.space.disabledAt&&!t.space.enabled?13:-1)}}function Rt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Files"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.faAnchor),a(4),T("(",(t.space.roots==null?null:t.space.roots.length)||0,")")}}function Lt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Members"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.faUsers),a(4),T("(",t.space.members.length,")")}}function Bt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Links"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.LINKS),a(4),T("(",t.space.links.length,")")}}function Nt(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"amAdd"),b(3,"amTimeAgo"),s()),e&2){let t=c(3);a(),T("\xA0",y(3,5,ge(2,1,t.space.disabledAt,t.SPACE_MAX_DISABLED_DAYS,"days"),!0))}}function Wt(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"amDuration"),s()),e&2){let t=c(3);a(),T("\xA0",y(2,1,t.SPACE_MAX_DISABLED_DAYS,"days"))}}function Ot(e,r){if(e&1&&(l(0,"div",62)(1,"span",3),m(2,"Space and data will be deleted in"),s(),l(3,"span",63),C(4,Nt,4,8,"span")(5,Wt,3,4,"span"),s()()),e&2){let t=c(2);a(4),g(t.space.disabledAt?4:5)}}function Ut(e,r){if(e&1){let t=x();l(0,"button",61),f("click",function(){h(t);let o=c();return S(o.confirmDeletion=!0)}),m(1," Remove "),s(),C(2,Ot,6,1,"div",62)}if(e&2){let t=c();p("disabled",t.confirmDeletion),a(2),g(t.space.enabled?-1:2)}}function $t(e,r){if(e&1){let t=x();l(0,"button",64),f("click",function(){h(t);let o=c();return S(o.openCreateLinkDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," Link "),s()}if(e&2){let t=c();a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.LINKS)}}function qt(e,r){if(e&1){let t=x();l(0,"button",66),f("click",function(){h(t);let o=c(2);return S(o.openAdminRootDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," External location "),s()}if(e&2){let t=c(2);a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.faUserShield)}}function Ht(e,r){if(e&1){let t=x();l(0,"button",64),f("click",function(){h(t);let o=c();return S(o.openSelectRootDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," File "),s(),C(4,qt,4,2,"button",65)}if(e&2){let t=c();a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.faAnchor),a(2),g(t.user.isAdmin?4:-1)}}var se=(()=>{let r=class r{constructor(){this.space=new mt({id:0,name:"",createdAt:new Date,enabled:!0,storageUsage:0,storageQuota:null}),this.spaceChange=new de,this.locale=v(z),this.layout=v(ee),this.icons={SPACES:R.SPACES,LINKS:R.LINKS,faPen:j,faAnchor:Y,faUserShield:ke,faPlus:G,faSpinner:Re,faCog:Fe,faUsers:Ve},this.SPACE_MAX_DISABLED_DAYS=30,this.addRootFileEvent=new me,this.allowedLinkPermissions=[O.ADD,O.DELETE,O.MODIFY],this.editManagers=!1,this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=v(te),this.user=this.userService.user,this.spacesService=v(ie),this.linksService=v(dt)}ngOnInit(){this.space.id||this.space.managers.unshift(Ge(this.user,Z.IS_MANAGER))}searchManagers(n){let o={search:n,ignoreUserIds:[...this.space.managers.map(i=>i.id),...this.space.members.filter(i=>i.isUser).map(i=>i.id)],onlyUsers:!0};return this.userService.searchMembers(o)}searchMembers(n){let o={search:n,ignoreUserIds:[...this.space.managers.map(i=>i.id),...this.space.members.filter(i=>i.isUser).map(i=>i.id)],ignoreGroupIds:this.space.members.filter(i=>i.isGroup).map(i=>i.id)};return this.userService.searchMembers(o)}openSelectRootDialog(){this.layout.openDialog(ut,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(L(1)).subscribe(o=>this.addRootFileEvent.next(o))}openAdminRootDialog(){this.layout.openDialog(ft,null,{initialState:{currentRoots:this.space.roots.filter(o=>o.externalPath)}}).content.submitEvent.pipe(L(1)).subscribe(o=>this.addRootFileEvent.next(o))}openEditLinkDialog(n){this.linksService.editLinkDialog(n,this.space,Ke.SPACE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.space)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.space.id===0&&this.layout.closeDialog(),this.spacesService.deleteSpace(this.space.id,{deleteNow:!0}).subscribe({next:()=>{this.loading=!1,this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Delete space",this.space.name,n)}})):this.space.id===0?this.spacesService.createSpace(this.space).subscribe({next:n=>{this.loading=!1,this.space=n,this.spaceChange.emit(["add",n]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Create space",this.space.name,n)}}):this.spacesService.updateSpace(this.space).subscribe({next:n=>{this.loading=!1,n?(this.space=n,this.spaceChange.emit(["update",n])):this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Edit space",this.space.name,n)}})}cantSubmit(){return this.submitted||!this.space.name||!this.space.managers.length}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=$({type:r,selectors:[["app-space-dialog"]],inputs:{space:"space"},outputs:{spaceChange:"spaceChange"},decls:70,vars:48,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[2,"max-width","85%"],[1,"mb-3","px-0"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","align-items-start","mb-3"],[1,"w-100",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","justify-content-between"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],["for","switchFullText","l10nTranslate",""],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"d-flex","flex-column","col-6"],["type","button",3,"click"],["for","editManagers","l10nTranslate","",1,"no-select-pointer"],["id","editManagers",1,"ms-1",3,"icon"],[3,"membersChange","members","searchFunction","editMode","hideInput","customPlaceholder"],["l10nTranslate","",1,"text-danger"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[1,"col-12"],[3,"space","user","addRootFile"],[3,"membersChange","members","withPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],[1,"d-flex","flex-column","align-items-start","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],[1,"d-flex","flex-column","align-items-end","col-4","text-danger","px-0"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[1,"text-danger","white-space-truncate","fs-sm","mx-auto"],[1,"fw-bold"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(o,i){o&1&&(l(0,"div",0)(1,"h4",1),u(2,"fa-icon",2),C(3,Et,2,1,"span")(4,Dt,2,0,"span",3),C(5,Mt,1,1,"fa-icon",4),s(),C(6,Pt,3,0,"h4",5),l(7,"button",6),f("click",function(){return i.layout.closeDialog()}),s()(),l(8,"div",7)(9,"tabset",8),u(10,"hr",9),l(11,"tab",10),f("selectTab",function(){return i.tabView=null}),w(12,At,3,1,"ng-template",11),l(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),m(18," Space name "),s(),l(19,"input",17),A("ngModelChange",function(d){return P(i.space.name,d)||(i.space.name=d),d}),s()(),l(20,"div",15)(21,"label",18),m(22," Description "),s(),l(23,"input",19),A("ngModelChange",function(d){return P(i.space.description,d)||(i.space.description=d),d}),s()(),l(24,"div",20)(25,"app-storage-quota",21),A("quotaChange",function(d){return P(i.space.storageQuota,d)||(i.space.storageQuota=d),d}),s()(),C(26,Vt,4,1,"div",22),l(27,"div",23)(28,"div")(29,"label",24),m(30,"Space status"),s(),l(31,"div",25)(32,"input",26),A("ngModelChange",function(d){return P(i.space.enabled,d)||(i.space.enabled=d),d}),s(),l(33,"label",27),m(34),s()()(),l(35,"div")(36,"label",28),m(37,"Full-text search"),s(),l(38,"div",25)(39,"input",29),A("ngModelChange",function(d){return P(i.space.storageIndexing,d)||(i.space.storageIndexing=d),d}),s(),l(40,"label",30),m(41),s()()()()()(),l(42,"div",31)(43,"div",32),f("click",function(){return i.editManagers=!i.editManagers}),l(44,"label",33),m(45,"Managers"),s(),u(46,"fa-icon",34),s(),l(47,"app-user-search",35),A("membersChange",function(d){return P(i.space.managers,d)||(i.space.managers=d),d}),s(),C(48,kt,2,0,"small",36),C(49,It,14,7,"div",37),s()()(),l(50,"tab",38),f("selectTab",function(){return i.tabView="roots"}),w(51,Rt,5,2,"ng-template",11),l(52,"div",39),u(53,"app-space-manage-roots",40),s()(),l(54,"tab",38),f("selectTab",function(){return i.tabView="members"}),w(55,Lt,5,2,"ng-template",11),l(56,"div",9)(57,"app-user-search",41),A("membersChange",function(d){return P(i.space.members,d)||(i.space.members=d),d}),s()()(),l(58,"tab",38),f("selectTab",function(){return i.tabView="links"}),w(59,Bt,5,2,"ng-template",11),l(60,"div",9)(61,"app-user-search",42),A("membersChange",function(d){return P(i.space.links,d)||(i.space.links=d),d}),s()()()()(),l(62,"div",43),C(63,Ut,3,2),C(64,$t,4,2,"button",44),C(65,Ht,5,3),l(66,"button",45),f("click",function(){return i.onCancel()}),m(67,"Cancel"),s(),l(68,"button",46),f("click",function(){return i.onSubmit()}),m(69),s()()),o&2&&(a(2),p("icon",i.icons.SPACES),a(),g(i.space.id?3:4),a(2),g(i.loading?5:-1),a(),g(i.space.id?6:-1),a(),I(H("btn-close btn-close-white ",i.space.id?"ms-2":"ms-auto"," ms-2")),a(2),p("justified",!0),a(10),I(H("form-control form-control-sm ",i.space.name?"":"is-invalid")),M("ngModel",i.space.name),a(4),M("ngModel",i.space.description),a(2),M("quota",i.space.storageQuota),p("fullWidth",!0),a(),g(i.space.storageUsage?26:-1),a(6),M("ngModel",i.space.enabled),a(2),T(" ",i.space.enabled?"enabled":"disabled"," "),a(5),M("ngModel",i.space.storageIndexing),a(2),T(" ",i.space.storageIndexing?"enabled":"disabled"," "),a(5),p("icon",i.icons.faPen),a(),M("members",i.space.managers),p("searchFunction",i.searchManagers.bind(i))("editMode",i.editManagers)("hideInput",!i.editManagers)("customPlaceholder","Type to search for managers to add"),a(),g(i.space.managers.length?-1:48),a(),g(i.space.id?49:-1),a(4),p("space",i.space)("user",i.user)("addRootFile",i.addRootFileEvent),a(4),M("members",i.space.members),p("withPermissions",!0)("searchFunction",i.searchMembers.bind(i)),a(4),M("members",i.space.links),p("filterPermissions",!0)("allowedPermissions",i.allowedLinkPermissions)("withPermissions",!0)("editFunction",i.openEditLinkDialog.bind(i))("hideInput",!0),a(2),g(!i.tabView&&i.space.id&&i.user.isAdmin?63:-1),a(),g(i.tabView==="links"?64:-1),a(),g(i.tabView==="roots"?65:-1),a(3),I(H("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary")),p("disabled",i.cantSubmit()),a(),T(" ",i.confirmDeletion?"Confirm permanent deletion of data":"Confirm"," "))},dependencies:[K,J,rt,ot,nt,at,Ee,ye,be,ve,Te,we,Ye,ct,st,Ct,Xe,lt,St,xt,et],encapsulation:2});let e=r;return e})();var Qt=["MainContextMenu"],zt=["TargetContextMenu"],Kt=()=>["roots","shares"],bt=(e,r)=>r.id,yt=(e,r)=>r.mid,vt=(e,r)=>r.key;function jt(e,r){if(e&1){let t=x();l(0,"button",3),b(1,"translate"),f("click",function(){h(t);let o=c();return S(o.openSpaceDialog(!0))}),u(2,"fa-icon",7),s()}if(e&2){let t=c();p("tooltip",y(1,2,"New space",t.locale.language)),a(2),p("icon",t.icons.faPlus)}}function Yt(e,r){if(e&1&&(l(0,"span",29),m(1),s()),e&2){let t=c().$implicit,n=c(2);F("font-size",n.galleryMode.textSize,"px"),a(),D(t.hTimeAgo)}}function Gt(e,r){if(e&1&&u(0,"app-user-avatar",30),e&2){let t=r.$implicit,n=c(4);p("user",t)("isMember",!0)("height",n.galleryMode.dimensions/3)("width",n.galleryMode.dimensions/3)}}function Xt(e,r){if(e&1&&(l(0,"span",26),V(1,Gt,1,4,"app-user-avatar",30,yt),s()),e&2){let t=c().$implicit;a(),k(t.managers)}}function Jt(e,r){if(e&1){let t=x();l(0,"div",21),f("click",function(){let o=h(t).$implicit,i=c(2);return S(i.onSelect(o))})("contextmenu",function(o){let i=h(t).$implicit,_=c(2);return S(_.onTargetContextMenu(o,i))})("appTap",function(){let o=h(t).$implicit,i=c(2);return S(i.browse(o))}),l(1,"div",22),u(2,"fa-icon",23),l(3,"span",24),C(4,Yt,2,3,"span",25),s(),C(5,Xt,3,0,"span",26),s(),l(6,"div",27)(7,"span",28),m(8),s()()()}if(e&2){let t=r.$implicit,n=r.$index,o=c(2);F("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),U("disabled",!t.enabled)("selected",t.id===(o.selected==null?null:o.selected.id)),a(),_e("rowIndex",n),a(),F("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),p("icon",o.icons.SPACES),a(2),g(t.newly?4:-1),a(),g(t.managers.length?5:-1),a(2),F("font-size",o.galleryMode.textSize,"px"),a(),D(t.name)}}function Zt(e,r){if(e&1){let t=x();l(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(t);let i=c();return S(i.onContextMenu(o))}),l(3,"div",19),V(4,Jt,9,21,"div",20,bt),s()()()}if(e&2){let t=c();a(),p("childHeight",t.galleryMode.dimensions)("childWidth",t.galleryMode.dimensions)("items",y(2,5,t.spaces,t.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),k(t.scrollView==null?null:t.scrollView.viewPortItems)}}function ei(e,r){if(e&1&&u(0,"fa-icon",37),e&2){let t=c(4);p("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function ti(e,r){if(e&1){let t=x();l(0,"th",36),f("click",function(){h(t);let o=c().$implicit,i=c(2);return S(i.sortBy(o.key))}),m(1),C(2,ei,1,2,"fa-icon",37),s()}if(e&2){let t=c().$implicit,n=c(2);I(t.value.class),F("width",t.value.width,"%"),U("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),T(" ",t.value.label," "),a(),g(n.sortTable.sortParam.column===t.key?2:-1)}}function ii(e,r){if(e&1&&C(0,ti,3,10,"th",35),e&2){let t=r.$implicit;g(t.value.show?0:-1)}}function ni(e,r){if(e&1&&(l(0,"div",40),u(1,"fa-icon",41),l(2,"div",42)(3,"span",28),m(4),s(),l(5,"span",43),m(6),s()()()),e&2){let t=c(3).$implicit,n=c(2);a(),p("icon",n.icons.SPACES)("fixedWidth",!1),a(3),D(t.name),a(2),D(t.description)}}function oi(e,r){if(e&1&&u(0,"app-user-avatar",44),e&2){let t=r.$implicit;p("user",t)("isMember",!0)}}function ai(e,r){if(e&1&&V(0,oi,1,2,"app-user-avatar",44,yt),e&2){let t=c(3).$implicit;k(t.managers)}}function ri(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"joinCounts"),s()),e&2){let t=c(3).$implicit;a(),D(y(2,1,t.counts,Ce(4,Kt)))}}function li(e,r){if(e&1){let t=x();l(0,"span",47),f("click",function(){h(t);let o=c(6);return S(o.openSpaceRootsDialog())}),u(1,"fa-icon",7),m(2),s()}if(e&2){let t=c(4).$implicit,n=c(2);a(),p("icon",n.icons.faAnchor),a(),T("\xA0",t.counts.roots," ")}}function si(e,r){if(e&1){let t=x();l(0,"span",48),f("click",function(){h(t);let o=c(4).$implicit,i=c(2);return S(i.openChildShareDialog(o))}),u(1,"fa-icon",49),l(2,"span"),m(3),s()()}if(e&2){let t=c(4).$implicit,n=c(2);a(),p("icon",n.icons.SHARED),a(2),D(t.counts.shares)}}function ci(e,r){if(e&1&&(C(0,li,3,2,"span",45),C(1,si,4,2,"span",46)),e&2){let t=c(3).$implicit,n=c(2);g(t.counts!=null&&t.counts.roots?0:-1),a(),g(t.role===n.SPACE_ROLE.IS_MANAGER&&t.counts.shares?1:-1)}}function pi(e,r){if(e&1&&u(0,"app-file-permissions",50),e&2){let t=c(4).$implicit;p("permissions",t.hPerms)}}function mi(e,r){if(e&1&&C(0,pi,1,1,"app-file-permissions",50),e&2){let t=c(3).$implicit;g(t.permissions?0:-1)}}function di(e,r){if(e&1&&m(0),e&2){let t=c(3).$implicit;T(" ",t.hTimeAgo," ")}}function _i(e,r){if(e&1&&(l(0,"td"),C(1,ni,7,4,"div",40)(2,ai,2,0)(3,ri,3,5,"span")(4,ci,2,2)(5,mi,1,1)(6,di,1,1),s()),e&2){let t,n=c().$implicit,o=c().$implicit;I(fe("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),F("width",n.value.width,"%"),U("text-align-center",n.value.textCenter),a(),g((t=n.key)==="name"?1:t==="managers"?2:t==="members"?3:t==="infos"?4:t==="permissions"?5:t==="modified"?6:-1)}}function ui(e,r){if(e&1&&C(0,_i,7,9,"td",39),e&2){let t=r.$implicit;g(t.value.show?0:-1)}}function fi(e,r){if(e&1){let t=x();l(0,"tr",38),f("click",function(){let o=h(t).$implicit,i=c(2);return S(i.onSelect(o))})("contextmenu",function(o){let i=h(t).$implicit,_=c(2);return S(_.onTargetContextMenu(o,i))})("appTap",function(){let o=h(t).$implicit,i=c(2);return S(i.browse(o))}),V(1,ui,1,1,null,null,vt),b(3,"keyvalue"),s()}if(e&2){let t=r.$implicit,n=c(2);U("disabled",!t.enabled)("selected",t.id===(n.selected==null?null:n.selected.id)),a(),k(y(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function Ci(e,r){if(e&1){let t=x();l(0,"table",31)(1,"thead")(2,"tr"),V(3,ii,1,1,null,null,vt),b(5,"keyvalue"),s()()(),l(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(t);let i=c();return S(i.onContextMenu(o))}),l(8,"table",31)(9,"tbody",33),V(10,fi,4,7,"tr",34,bt),s()()()}if(e&2){let t=c();a(3),k(y(5,2,t.tableHeaders,t.originalOrderKeyValue)),a(3),p("bufferAmount",5)("items",y(7,5,t.spaces,t.inputFilter.search())),a(4),k(t.scrollView==null?null:t.scrollView.viewPortItems)}}function gi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"New space"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faPlus)}}function hi(e,r){}function Si(e,r){if(e&1){let t=x();w(0,gi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceDialog(!0))}),w(1,hi,0,0,"ng-template",17)}e&2&&(a(),p("divider",!0))}function xi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Refresh"),s()),e&2){let t=c();a(),p("icon",t.icons.faArrowRotateRight)}}function bi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Edit space"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faPen)}}function yi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Edit children shares"),s()),e&2){let t=c(3);a(),p("icon",t.icons.SHARED)}}function vi(e,r){if(e&1){let t=x();w(0,yi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c(2);return S(o.openChildShareDialog())})}}function wi(e,r){if(e&1){let t=x();w(0,bi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceDialog())}),C(1,vi,1,0,null,16)}if(e&2){let t=c();a(),g(t.selected!=null&&t.selected.counts.shares?1:-1)}}function Ti(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Manage my anchored files"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faAnchor)}}function Ei(e,r){if(e&1){let t=x();w(0,Ti,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceRootsDialog())})}}function Di(e,r){}function Mi(e,r){e&1&&w(0,Di,0,0,"ng-template",17),e&2&&p("divider",!0)}function Pi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Informations"),s()),e&2){let t=c();a(),p("icon",t.icons.faCircleInfo)}}var Yn=(()=>{let r=class r{constructor(){this.locale=v(z),this.layout=v(ee),this.SPACE_ROLE=Z,this.originalOrderKeyValue=Qe,this.TAB_MENU=He,this.icons={SPACES:R.SPACES,SHARED:R.SHARED_WITH_OTHERS,faAnchor:Y,faArrowDown:Ne,faArrowUp:Ie,faRotate:Ae,faArrowRotateRight:Be,faUpload:Le,faPlus:G,faPen:j,faCircleInfo:We},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},managers:{label:"Managers",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},members:{label:"Members",width:20,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",managers:"Managers",permissions:"Permissions",modified:"Modified"},this.loading=!1,this.spaces=[],this.selected=null,this.canCreateSpace=!1,this.canEditSpace=!1,this.canManageRoots=!1,this.router=v(xe),this.activatedRoute=v(Se),this.spacesService=v(ie),this.store=v(ze),this.userService=v(te),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],managers:[{prop:"managers",type:"length"}],permissions:[{prop:"permissions",type:"length"}],modified:[{prop:"modified",type:"date"}]},this.sortTable=new tt(this.constructor.name,this.sortSettings),this.loadSpaces(),this.canCreateSpace=this.userService.userHavePermission(Oe.SPACES_ADMIN),this.layout.setBreadcrumbIcon(R.SPACES),this.layout.setBreadcrumbNav({url:`/${ne.SPACES}/${je.SPACES}`,translating:!0,sameLink:!0}),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select)}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadSpaces(){this.loading=!0,this.onSelect(),this.spacesService.listSpaces().subscribe({next:n=>{this.sortBy(this.sortTable.sortParam.column,!1,n),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:n=>{this.spaces=[],this.loading=!1,this.layout.sendNotification("error","Spaces",n.error.message)}})}browse(n){n.enabled?this.router.navigate([ne.FILES,n.alias],{relativeTo:this.activatedRoute}).catch(console.error):this.layout.sendNotification("warning",n.name,"Space is disabled")}onSelect(n=null){n?(this.selected=n,this.canEditSpace=!!n.managers.find(o=>o.id===this.userService.user.id),this.canManageRoots=this.canEditSpace||n.havePermission(O.SHARE_INSIDE)):(this.selected=null,this.canEditSpace=!1,this.canManageRoots=!1),this.store.spaceSelection.set(this.selected)}sortBy(n,o=!0,i){this.spaces=this.sortTable.sortBy(n,o,i||this.spaces)}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}openSpaceDialog(n=!1){n?this.layout.openDialog(se,"xl").content.spaceChange.pipe(L(1)).subscribe(i=>{let[_,d]=i;_==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.concat(d)),this.onSelect(d))}):this.selected&&this.canEditSpace&&this.spacesService.getSpace(this.selected.id).subscribe({next:o=>{this.layout.openDialog(se,"xl",{initialState:{space:o}}).content.spaceChange.pipe(L(1)).subscribe(_=>{let[d,E]=_;d==="update"?(this.selected.name=E.name,this.selected.alias=E.alias,this.selected.description=E.description,this.selected.counts=pe(ce({},E.counts),{shares:this.selected.counts.shares}),this.selected.modifiedAt=E.modifiedAt,this.selected.enabled=E.enabled,this.selected.managers=[...E.managers]):d==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.filter(wt=>wt.id!==E.id)))})},error:o=>this.layout.sendNotification("error","Edit space",this.selected.name,o)})}openSpaceRootsDialog(){setTimeout(()=>{this.layout.openDialog(ht,"md",{initialState:{space:this.selected,user:this.userService.user}})},this.selected?0:100)}openChildShareDialog(n){n&&this.onSelect(n),this.layout.openDialog(gt,null,{initialState:{space:this.selected}}).content.sharesCountEvent.subscribe(i=>this.selected.counts.shares=i)}focusOn(n){let o=this.spaces.find(i=>i.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=$({type:r,selectors:[["app-spaces"]],viewQuery:function(o,i){if(o&1&&(B(ae,5),B(oe,7),B(re,7),B(Qt,7),B(zt,7)),o&2){let _;N(_=W())&&(i.scrollView=_.first),N(_=W())&&(i.inputFilter=_.first),N(_=W())&&(i.btnNavigationView=_.first),N(_=W())&&(i.mainContextMenu=_.first),N(_=W())&&(i.targetContextMenu=_.first)}},decls:34,vars:37,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,"tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[3,"user","isMember","height","width"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["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"],[1,"circle-primary-icon",3,"icon","fixedWidth"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,i){if(o&1){let _=x();l(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(_),S(i.loadSpaces())}),u(3,"fa-icon",4),s(),C(4,jt,3,5,"button",5),l(5,"button",6),b(6,"translate"),f("click",function(){return h(_),S(i.openSpaceDialog())}),u(7,"fa-icon",7),s(),l(8,"button",6),b(9,"translate"),f("click",function(){return h(_),S(i.openChildShareDialog())}),u(10,"fa-icon",7),s(),l(11,"button",6),b(12,"translate"),f("click",function(){return h(_),S(i.openSpaceRootsDialog())}),u(13,"fa-icon",7),s(),l(14,"div",8)(15,"div",9),u(16,"app-input-filter",10),s(),l(17,"app-navigation-view",11),f("sortBy",function(E){return h(_),S(i.sortBy(E))})("switchView",function(E){return h(_),S(i.galleryMode=E)}),s()()(),C(18,Zt,6,8,"div",12)(19,Ci,12,8),l(20,"div",13)(21,"span",14),m(22),b(23,"translate"),s()(),l(24,"context-menu",null,0),C(26,Si,2,1),w(27,xi,3,1,"ng-template",15),f("execute",function(){return h(_),S(i.loadSpaces())}),s(),l(28,"context-menu",null,1),C(30,wi,2,1),C(31,Ei,1,0,null,16),C(32,Mi,1,1,null,17),w(33,Pi,3,1,"ng-template",15),f("execute",function(){return h(_),S(i.layout.showRSideBarTab(i.TAB_MENU.SELECTION))}),s()}o&2&&(a(),p("tooltip",y(2,22,"Refresh",i.locale.language)),a(2),p("icon",i.icons.faArrowRotateRight)("animation",i.loading?"spin":null),a(),g(i.canCreateSpace?4:-1),a(),p("disabled",!i.canEditSpace)("tooltip",y(6,25,"Edit space",i.locale.language)),a(2),p("icon",i.icons.faPen),a(),p("disabled",!i.canEditSpace||!(i.selected!=null&&i.selected.counts.shares))("tooltip",y(9,28,"Edit children shares",i.locale.language)),a(2),p("icon",i.icons.SHARED),a(),p("disabled",!i.canManageRoots)("tooltip",y(12,31,"Manage my anchored files",i.locale.language)),a(2),p("icon",i.icons.faAnchor),a(4),p("sortParams",i.sortTable.sortParam)("sortFields",i.btnSortFields),a(),g(i.galleryMode!=null&&i.galleryMode.enabled?18:19),a(4),ue("",i.spaces.length," ",y(23,34,"spaces",i.locale.language)),a(4),g(i.canCreateSpace?26:-1),a(4),g(i.canEditSpace?30:-1),a(),g(i.canManageRoots?31:-1),a(),g(i.canEditSpace||i.canManageRoots?32:-1))},dependencies:[K,J,it,ae,Pe,Me,qe,$e,Ue,re,oe,_t,Je,he,pt,De,Ze],encapsulation:2});let e=r;return e})();export{Yn as SpacesComponent};
1
+ import{b as Ct,c as ht}from"./chunk-CETH7UYS.js";import{A as ft,C as gt,z as ut}from"./chunk-2VMSXRCB.js";import{a as _t}from"./chunk-S7HNXVRB.js";import{a as re}from"./chunk-RSXHRKM5.js";import{c as Xe,f as ct}from"./chunk-RFH46UW3.js";import{a as it}from"./chunk-XTRDKGKG.js";import{a as pt}from"./chunk-WSSU2HXE.js";import"./chunk-VJTXJ43D.js";import{a as et,b as nt,c as ot,d as at,e as rt,g as lt,h as st}from"./chunk-3OHSRRKH.js";import{a as oe,b as ae,c as Je,d as Ze,e as tt}from"./chunk-3R4WKOHQ.js";import{e as dt}from"./chunk-O6FYXVHI.js";import{f as mt,g as ie}from"./chunk-SJR5R3Y4.js";import"./chunk-3XVM35O2.js";import"./chunk-LVSNIS5P.js";import"./chunk-PNR6M34W.js";import{b as Se,d as xe}from"./chunk-RV3VZJPZ.js";import{m as Ye,p as te}from"./chunk-VQQKMY2C.js";import{C as Oe,Ib as je,Jb as R,Kb as ne,Ma as He,Tb as Ge,Za as Qe,mb as ze,nb as O,qb as Z,r as Me,s as Pe,va as Ue,wa as $e,xa as qe,yb as ee}from"./chunk-XDZGW64M.js";import{$a as $,$b as Ce,$c as ye,$f as We,Ab as x,Db as f,Dd as De,Ed as K,Fb as c,Fd as Ae,Ff as Le,Hf as G,Jb as B,Jc as he,Jf as Be,Kb as N,L,Lb as W,Na as a,Nb as F,Ob as U,Pa as de,Pb as I,Qb as m,Rb as D,Sb as T,Se as Fe,Tb as ue,Ub as M,Vb as P,Ve as Ie,Vf as Ne,Wb as A,Yb as H,Zb as fe,_c as be,cb as q,cf as Re,dd as ve,eb as w,ec as b,eg as J,f as me,fc as Q,gc as y,gg as Ke,hc as ge,ia as v,id as we,jb as _e,kb as C,lb as g,na as h,oa as S,ob as V,pb as k,pf as j,qb as p,qe as Ve,rb as l,sb as s,sd as Te,tb as u,te as ke,wd as Ee,wf as Y,yd as z}from"./chunk-DIT6W7VM.js";import{n as X}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as ce,b as pe}from"./chunk-N3U6637P.js";var St=(()=>{let r=class r{transform(n,o,i){if(typeof o>"u"||typeof o=="number"&&typeof i>"u")throw new Error("TimeAddPipe: missing required arguments");return X(n).add(o,i)}};r.\u0275fac=function(o){return new(o||r)},r.\u0275pipe=q({name:"amAdd",type:r,pure:!0});let e=r;return e})();var xt=(()=>{let r=class r{transform(n,o){if(!o)throw new Error("TimeDurationPipe: missing required time unit argument");return X.duration({[o]:n}).humanize()}};r.\u0275fac=function(o){return new(o||r)},r.\u0275pipe=q({name:"amDuration",type:r,pure:!1});let e=r;return e})();function Et(e,r){if(e&1&&(l(0,"span"),m(1),s()),e&2){let t=c();a(),D(t.space.name)}}function Dt(e,r){e&1&&(l(0,"span",3),m(1,"Create a new space"),s())}function Mt(e,r){if(e&1&&u(0,"fa-icon",4),e&2){let t=c();p("icon",t.icons.faSpinner)}}function Pt(e,r){e&1&&(l(0,"h4",5)(1,"span",3),m(2,"Edit space"),s()())}function At(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",48),m(2,"Settings"),s()),e&2){let t=c();p("icon",t.icons.faCog)}}function Vt(e,r){if(e&1&&(l(0,"div",22)(1,"label",49),m(2,"Storage Usage"),s(),u(3,"app-storage-usage",50),s()),e&2){let t=c();a(3),p("item",t.space)}}function kt(e,r){e&1&&(l(0,"small",36),m(1,"At least one manager is required"),s())}function Ft(e,r){if(e&1&&(l(0,"div",57)(1,"label",58),m(2,"Deactivation date"),s(),l(3,"div",59),m(4),b(5,"amDateFormat"),s()()),e&2){let t=c(2);a(4),D(Q(5,1,t.space.disabledAt))}}function It(e,r){if(e&1&&(l(0,"div",37)(1,"div",51)(2,"label",52),m(3,"Creation date"),s(),l(4,"div",53),m(5),b(6,"amDateFormat"),s()(),l(7,"div",54)(8,"label",55),m(9,"Modification date"),s(),l(10,"div",56),m(11),b(12,"amDateFormat"),s()(),C(13,Ft,6,3,"div",57),s()),e&2){let t=c();a(5),D(Q(6,3,t.space.createdAt)),a(6),D(Q(12,5,t.space.modifiedAt)),a(2),g(t.space.disabledAt&&!t.space.enabled?13:-1)}}function Rt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Files"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.faAnchor),a(4),T("(",(t.space.roots==null?null:t.space.roots.length)||0,")")}}function Lt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Members"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.faUsers),a(4),T("(",t.space.members.length,")")}}function Bt(e,r){if(e&1&&(u(0,"fa-icon",47),l(1,"span",60),m(2,"Links"),s(),l(3,"span"),m(4),s()),e&2){let t=c();p("icon",t.icons.LINKS),a(4),T("(",t.space.links.length,")")}}function Nt(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"amAdd"),b(3,"amTimeAgo"),s()),e&2){let t=c(3);a(),T("\xA0",y(3,5,ge(2,1,t.space.disabledAt,t.SPACE_MAX_DISABLED_DAYS,"days"),!0))}}function Wt(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"amDuration"),s()),e&2){let t=c(3);a(),T("\xA0",y(2,1,t.SPACE_MAX_DISABLED_DAYS,"days"))}}function Ot(e,r){if(e&1&&(l(0,"div",62)(1,"span",3),m(2,"Space and data will be deleted in"),s(),l(3,"span",63),C(4,Nt,4,8,"span")(5,Wt,3,4,"span"),s()()),e&2){let t=c(2);a(4),g(t.space.disabledAt?4:5)}}function Ut(e,r){if(e&1){let t=x();l(0,"button",61),f("click",function(){h(t);let o=c();return S(o.confirmDeletion=!0)}),m(1," Remove "),s(),C(2,Ot,6,1,"div",62)}if(e&2){let t=c();p("disabled",t.confirmDeletion),a(2),g(t.space.enabled?-1:2)}}function $t(e,r){if(e&1){let t=x();l(0,"button",64),f("click",function(){h(t);let o=c();return S(o.openCreateLinkDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," Link "),s()}if(e&2){let t=c();a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.LINKS)}}function qt(e,r){if(e&1){let t=x();l(0,"button",66),f("click",function(){h(t);let o=c(2);return S(o.openAdminRootDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," External location "),s()}if(e&2){let t=c(2);a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.faUserShield)}}function Ht(e,r){if(e&1){let t=x();l(0,"button",64),f("click",function(){h(t);let o=c();return S(o.openSelectRootDialog())}),u(1,"fa-icon",47)(2,"fa-icon",47),m(3," File "),s(),C(4,qt,4,2,"button",65)}if(e&2){let t=c();a(),p("icon",t.icons.faPlus),a(),p("icon",t.icons.faAnchor),a(2),g(t.user.isAdmin?4:-1)}}var se=(()=>{let r=class r{constructor(){this.space=new mt({id:0,name:"",createdAt:new Date,enabled:!0,storageUsage:0,storageQuota:null}),this.spaceChange=new de,this.locale=v(z),this.layout=v(ee),this.icons={SPACES:R.SPACES,LINKS:R.LINKS,faPen:j,faAnchor:Y,faUserShield:ke,faPlus:G,faSpinner:Re,faCog:Fe,faUsers:Ve},this.SPACE_MAX_DISABLED_DAYS=30,this.addRootFileEvent=new me,this.allowedLinkPermissions=[O.ADD,O.DELETE,O.MODIFY],this.editManagers=!1,this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=v(te),this.user=this.userService.user,this.spacesService=v(ie),this.linksService=v(dt)}ngOnInit(){this.space.id||this.space.managers.unshift(Ge(this.user,Z.IS_MANAGER))}searchManagers(n){let o={search:n,ignoreUserIds:[...this.space.managers.map(i=>i.id),...this.space.members.filter(i=>i.isUser).map(i=>i.id)],onlyUsers:!0};return this.userService.searchMembers(o)}searchMembers(n){let o={search:n,ignoreUserIds:[...this.space.managers.map(i=>i.id),...this.space.members.filter(i=>i.isUser).map(i=>i.id)],ignoreGroupIds:this.space.members.filter(i=>i.isGroup).map(i=>i.id)};return this.userService.searchMembers(o)}openSelectRootDialog(){this.layout.openDialog(ut,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(L(1)).subscribe(o=>this.addRootFileEvent.next(o))}openAdminRootDialog(){this.layout.openDialog(ft,null,{initialState:{currentRoots:this.space.roots.filter(o=>o.externalPath)}}).content.submitEvent.pipe(L(1)).subscribe(o=>this.addRootFileEvent.next(o))}openEditLinkDialog(n){this.linksService.editLinkDialog(n,this.space,Ke.SPACE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.space)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.space.id===0&&this.layout.closeDialog(),this.spacesService.deleteSpace(this.space.id,{deleteNow:!0}).subscribe({next:()=>{this.loading=!1,this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Delete space",this.space.name,n)}})):this.space.id===0?this.spacesService.createSpace(this.space).subscribe({next:n=>{this.loading=!1,this.space=n,this.spaceChange.emit(["add",n]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Create space",this.space.name,n)}}):this.spacesService.updateSpace(this.space).subscribe({next:n=>{this.loading=!1,n?(this.space=n,this.spaceChange.emit(["update",n])):this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Edit space",this.space.name,n)}})}cantSubmit(){return this.submitted||!this.space.name||!this.space.managers.length}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=$({type:r,selectors:[["app-space-dialog"]],inputs:{space:"space"},outputs:{spaceChange:"spaceChange"},decls:70,vars:48,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[2,"max-width","85%"],[1,"mb-3","px-0"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","align-items-start","mb-3"],[1,"w-100",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","justify-content-between"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],["for","switchFullText","l10nTranslate",""],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"d-flex","flex-column","col-6"],["type","button",3,"click"],["for","editManagers","l10nTranslate","",1,"no-select-pointer"],["id","editManagers",1,"ms-1",3,"icon"],[3,"membersChange","members","searchFunction","editMode","hideInput","customPlaceholder"],["l10nTranslate","",1,"text-danger"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[1,"col-12"],[3,"space","user","addRootFile"],[3,"membersChange","members","withPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],[1,"d-flex","flex-column","align-items-start","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],[1,"d-flex","flex-column","align-items-end","col-4","text-danger","px-0"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[1,"text-danger","white-space-truncate","fs-sm","mx-auto"],[1,"fw-bold"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(o,i){o&1&&(l(0,"div",0)(1,"h4",1),u(2,"fa-icon",2),C(3,Et,2,1,"span")(4,Dt,2,0,"span",3),C(5,Mt,1,1,"fa-icon",4),s(),C(6,Pt,3,0,"h4",5),l(7,"button",6),f("click",function(){return i.layout.closeDialog()}),s()(),l(8,"div",7)(9,"tabset",8),u(10,"hr",9),l(11,"tab",10),f("selectTab",function(){return i.tabView=null}),w(12,At,3,1,"ng-template",11),l(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),m(18," Space name "),s(),l(19,"input",17),A("ngModelChange",function(d){return P(i.space.name,d)||(i.space.name=d),d}),s()(),l(20,"div",15)(21,"label",18),m(22," Description "),s(),l(23,"input",19),A("ngModelChange",function(d){return P(i.space.description,d)||(i.space.description=d),d}),s()(),l(24,"div",20)(25,"app-storage-quota",21),A("quotaChange",function(d){return P(i.space.storageQuota,d)||(i.space.storageQuota=d),d}),s()(),C(26,Vt,4,1,"div",22),l(27,"div",23)(28,"div")(29,"label",24),m(30,"Space status"),s(),l(31,"div",25)(32,"input",26),A("ngModelChange",function(d){return P(i.space.enabled,d)||(i.space.enabled=d),d}),s(),l(33,"label",27),m(34),s()()(),l(35,"div")(36,"label",28),m(37,"Full-text search"),s(),l(38,"div",25)(39,"input",29),A("ngModelChange",function(d){return P(i.space.storageIndexing,d)||(i.space.storageIndexing=d),d}),s(),l(40,"label",30),m(41),s()()()()()(),l(42,"div",31)(43,"div",32),f("click",function(){return i.editManagers=!i.editManagers}),l(44,"label",33),m(45,"Managers"),s(),u(46,"fa-icon",34),s(),l(47,"app-user-search",35),A("membersChange",function(d){return P(i.space.managers,d)||(i.space.managers=d),d}),s(),C(48,kt,2,0,"small",36),C(49,It,14,7,"div",37),s()()(),l(50,"tab",38),f("selectTab",function(){return i.tabView="roots"}),w(51,Rt,5,2,"ng-template",11),l(52,"div",39),u(53,"app-space-manage-roots",40),s()(),l(54,"tab",38),f("selectTab",function(){return i.tabView="members"}),w(55,Lt,5,2,"ng-template",11),l(56,"div",9)(57,"app-user-search",41),A("membersChange",function(d){return P(i.space.members,d)||(i.space.members=d),d}),s()()(),l(58,"tab",38),f("selectTab",function(){return i.tabView="links"}),w(59,Bt,5,2,"ng-template",11),l(60,"div",9)(61,"app-user-search",42),A("membersChange",function(d){return P(i.space.links,d)||(i.space.links=d),d}),s()()()()(),l(62,"div",43),C(63,Ut,3,2),C(64,$t,4,2,"button",44),C(65,Ht,5,3),l(66,"button",45),f("click",function(){return i.onCancel()}),m(67,"Cancel"),s(),l(68,"button",46),f("click",function(){return i.onSubmit()}),m(69),s()()),o&2&&(a(2),p("icon",i.icons.SPACES),a(),g(i.space.id?3:4),a(2),g(i.loading?5:-1),a(),g(i.space.id?6:-1),a(),I(H("btn-close btn-close-white ",i.space.id?"ms-2":"ms-auto"," ms-2")),a(2),p("justified",!0),a(10),I(H("form-control form-control-sm ",i.space.name?"":"is-invalid")),M("ngModel",i.space.name),a(4),M("ngModel",i.space.description),a(2),M("quota",i.space.storageQuota),p("fullWidth",!0),a(),g(i.space.storageUsage?26:-1),a(6),M("ngModel",i.space.enabled),a(2),T(" ",i.space.enabled?"enabled":"disabled"," "),a(5),M("ngModel",i.space.storageIndexing),a(2),T(" ",i.space.storageIndexing?"enabled":"disabled"," "),a(5),p("icon",i.icons.faPen),a(),M("members",i.space.managers),p("searchFunction",i.searchManagers.bind(i))("editMode",i.editManagers)("hideInput",!i.editManagers)("customPlaceholder","Type to search for managers to add"),a(),g(i.space.managers.length?-1:48),a(),g(i.space.id?49:-1),a(4),p("space",i.space)("user",i.user)("addRootFile",i.addRootFileEvent),a(4),M("members",i.space.members),p("withPermissions",!0)("searchFunction",i.searchMembers.bind(i)),a(4),M("members",i.space.links),p("filterPermissions",!0)("allowedPermissions",i.allowedLinkPermissions)("withPermissions",!0)("editFunction",i.openEditLinkDialog.bind(i))("hideInput",!0),a(2),g(!i.tabView&&i.space.id&&i.user.isAdmin?63:-1),a(),g(i.tabView==="links"?64:-1),a(),g(i.tabView==="roots"?65:-1),a(3),I(H("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary")),p("disabled",i.cantSubmit()),a(),T(" ",i.confirmDeletion?"Confirm permanent deletion of data":"Confirm"," "))},dependencies:[K,J,rt,ot,nt,at,Ee,ye,be,ve,Te,we,Ye,ct,st,Ct,Xe,lt,St,xt,et],encapsulation:2});let e=r;return e})();var Qt=["MainContextMenu"],zt=["TargetContextMenu"],Kt=()=>["roots","shares"],bt=(e,r)=>r.id,yt=(e,r)=>r.mid,vt=(e,r)=>r.key;function jt(e,r){if(e&1){let t=x();l(0,"button",3),b(1,"translate"),f("click",function(){h(t);let o=c();return S(o.openSpaceDialog(!0))}),u(2,"fa-icon",7),s()}if(e&2){let t=c();p("tooltip",y(1,2,"New space",t.locale.language)),a(2),p("icon",t.icons.faPlus)}}function Yt(e,r){if(e&1&&(l(0,"span",29),m(1),s()),e&2){let t=c().$implicit,n=c(2);F("font-size",n.galleryMode.textSize,"px"),a(),D(t.hTimeAgo)}}function Gt(e,r){if(e&1&&u(0,"app-user-avatar",30),e&2){let t=r.$implicit,n=c(4);p("user",t)("isMember",!0)("height",n.galleryMode.dimensions/3)("width",n.galleryMode.dimensions/3)}}function Xt(e,r){if(e&1&&(l(0,"span",26),V(1,Gt,1,4,"app-user-avatar",30,yt),s()),e&2){let t=c().$implicit;a(),k(t.managers)}}function Jt(e,r){if(e&1){let t=x();l(0,"div",21),f("click",function(){let o=h(t).$implicit,i=c(2);return S(i.onSelect(o))})("contextmenu",function(o){let i=h(t).$implicit,_=c(2);return S(_.onTargetContextMenu(o,i))})("appTap",function(){let o=h(t).$implicit,i=c(2);return S(i.browse(o))}),l(1,"div",22),u(2,"fa-icon",23),l(3,"span",24),C(4,Yt,2,3,"span",25),s(),C(5,Xt,3,0,"span",26),s(),l(6,"div",27)(7,"span",28),m(8),s()()()}if(e&2){let t=r.$implicit,n=r.$index,o=c(2);F("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),U("disabled",!t.enabled)("selected",t.id===(o.selected==null?null:o.selected.id)),a(),_e("rowIndex",n),a(),F("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),p("icon",o.icons.SPACES),a(2),g(t.newly?4:-1),a(),g(t.managers.length?5:-1),a(2),F("font-size",o.galleryMode.textSize,"px"),a(),D(t.name)}}function Zt(e,r){if(e&1){let t=x();l(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(t);let i=c();return S(i.onContextMenu(o))}),l(3,"div",19),V(4,Jt,9,21,"div",20,bt),s()()()}if(e&2){let t=c();a(),p("childHeight",t.galleryMode.dimensions)("childWidth",t.galleryMode.dimensions)("items",y(2,5,t.spaces,t.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),k(t.scrollView==null?null:t.scrollView.viewPortItems)}}function ei(e,r){if(e&1&&u(0,"fa-icon",37),e&2){let t=c(4);p("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function ti(e,r){if(e&1){let t=x();l(0,"th",36),f("click",function(){h(t);let o=c().$implicit,i=c(2);return S(i.sortBy(o.key))}),m(1),C(2,ei,1,2,"fa-icon",37),s()}if(e&2){let t=c().$implicit,n=c(2);I(t.value.class),F("width",t.value.width,"%"),U("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),T(" ",t.value.label," "),a(),g(n.sortTable.sortParam.column===t.key?2:-1)}}function ii(e,r){if(e&1&&C(0,ti,3,10,"th",35),e&2){let t=r.$implicit;g(t.value.show?0:-1)}}function ni(e,r){if(e&1&&(l(0,"div",40),u(1,"fa-icon",41),l(2,"div",42)(3,"span",28),m(4),s(),l(5,"span",43),m(6),s()()()),e&2){let t=c(3).$implicit,n=c(2);a(),p("icon",n.icons.SPACES)("fixedWidth",!1),a(3),D(t.name),a(2),D(t.description)}}function oi(e,r){if(e&1&&u(0,"app-user-avatar",44),e&2){let t=r.$implicit;p("user",t)("isMember",!0)}}function ai(e,r){if(e&1&&V(0,oi,1,2,"app-user-avatar",44,yt),e&2){let t=c(3).$implicit;k(t.managers)}}function ri(e,r){if(e&1&&(l(0,"span"),m(1),b(2,"joinCounts"),s()),e&2){let t=c(3).$implicit;a(),D(y(2,1,t.counts,Ce(4,Kt)))}}function li(e,r){if(e&1){let t=x();l(0,"span",47),f("click",function(){h(t);let o=c(6);return S(o.openSpaceRootsDialog())}),u(1,"fa-icon",7),m(2),s()}if(e&2){let t=c(4).$implicit,n=c(2);a(),p("icon",n.icons.faAnchor),a(),T("\xA0",t.counts.roots," ")}}function si(e,r){if(e&1){let t=x();l(0,"span",48),f("click",function(){h(t);let o=c(4).$implicit,i=c(2);return S(i.openChildShareDialog(o))}),u(1,"fa-icon",49),l(2,"span"),m(3),s()()}if(e&2){let t=c(4).$implicit,n=c(2);a(),p("icon",n.icons.SHARED),a(2),D(t.counts.shares)}}function ci(e,r){if(e&1&&(C(0,li,3,2,"span",45),C(1,si,4,2,"span",46)),e&2){let t=c(3).$implicit,n=c(2);g(t.counts!=null&&t.counts.roots?0:-1),a(),g(t.role===n.SPACE_ROLE.IS_MANAGER&&t.counts.shares?1:-1)}}function pi(e,r){if(e&1&&u(0,"app-file-permissions",50),e&2){let t=c(4).$implicit;p("permissions",t.hPerms)}}function mi(e,r){if(e&1&&C(0,pi,1,1,"app-file-permissions",50),e&2){let t=c(3).$implicit;g(t.permissions?0:-1)}}function di(e,r){if(e&1&&m(0),e&2){let t=c(3).$implicit;T(" ",t.hTimeAgo," ")}}function _i(e,r){if(e&1&&(l(0,"td"),C(1,ni,7,4,"div",40)(2,ai,2,0)(3,ri,3,5,"span")(4,ci,2,2)(5,mi,1,1)(6,di,1,1),s()),e&2){let t,n=c().$implicit,o=c().$implicit;I(fe("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),F("width",n.value.width,"%"),U("text-align-center",n.value.textCenter),a(),g((t=n.key)==="name"?1:t==="managers"?2:t==="members"?3:t==="infos"?4:t==="permissions"?5:t==="modified"?6:-1)}}function ui(e,r){if(e&1&&C(0,_i,7,9,"td",39),e&2){let t=r.$implicit;g(t.value.show?0:-1)}}function fi(e,r){if(e&1){let t=x();l(0,"tr",38),f("click",function(){let o=h(t).$implicit,i=c(2);return S(i.onSelect(o))})("contextmenu",function(o){let i=h(t).$implicit,_=c(2);return S(_.onTargetContextMenu(o,i))})("appTap",function(){let o=h(t).$implicit,i=c(2);return S(i.browse(o))}),V(1,ui,1,1,null,null,vt),b(3,"keyvalue"),s()}if(e&2){let t=r.$implicit,n=c(2);U("disabled",!t.enabled)("selected",t.id===(n.selected==null?null:n.selected.id)),a(),k(y(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function Ci(e,r){if(e&1){let t=x();l(0,"table",31)(1,"thead")(2,"tr"),V(3,ii,1,1,null,null,vt),b(5,"keyvalue"),s()()(),l(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(t);let i=c();return S(i.onContextMenu(o))}),l(8,"table",31)(9,"tbody",33),V(10,fi,4,7,"tr",34,bt),s()()()}if(e&2){let t=c();a(3),k(y(5,2,t.tableHeaders,t.originalOrderKeyValue)),a(3),p("bufferAmount",5)("items",y(7,5,t.spaces,t.inputFilter.search())),a(4),k(t.scrollView==null?null:t.scrollView.viewPortItems)}}function gi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"New space"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faPlus)}}function hi(e,r){}function Si(e,r){if(e&1){let t=x();w(0,gi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceDialog(!0))}),w(1,hi,0,0,"ng-template",17)}e&2&&(a(),p("divider",!0))}function xi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Refresh"),s()),e&2){let t=c();a(),p("icon",t.icons.faArrowRotateRight)}}function bi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Edit space"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faPen)}}function yi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Edit children shares"),s()),e&2){let t=c(3);a(),p("icon",t.icons.SHARED)}}function vi(e,r){if(e&1){let t=x();w(0,yi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c(2);return S(o.openChildShareDialog())})}}function wi(e,r){if(e&1){let t=x();w(0,bi,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceDialog())}),C(1,vi,1,0,null,16)}if(e&2){let t=c();a(),g(t.selected!=null&&t.selected.counts.shares?1:-1)}}function Ti(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Manage my anchored files"),s()),e&2){let t=c(2);a(),p("icon",t.icons.faAnchor)}}function Ei(e,r){if(e&1){let t=x();w(0,Ti,3,1,"ng-template",15),f("execute",function(){h(t);let o=c();return S(o.openSpaceRootsDialog())})}}function Di(e,r){}function Mi(e,r){e&1&&w(0,Di,0,0,"ng-template",17),e&2&&p("divider",!0)}function Pi(e,r){if(e&1&&(l(0,"span",51),u(1,"fa-icon",7),m(2,"Informations"),s()),e&2){let t=c();a(),p("icon",t.icons.faCircleInfo)}}var Yn=(()=>{let r=class r{constructor(){this.locale=v(z),this.layout=v(ee),this.SPACE_ROLE=Z,this.originalOrderKeyValue=Qe,this.TAB_MENU=He,this.icons={SPACES:R.SPACES,SHARED:R.SHARED_WITH_OTHERS,faAnchor:Y,faArrowDown:Ne,faArrowUp:Ie,faRotate:Ae,faArrowRotateRight:Be,faUpload:Le,faPlus:G,faPen:j,faCircleInfo:We},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},managers:{label:"Managers",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},members:{label:"Members",width:20,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",managers:"Managers",permissions:"Permissions",modified:"Modified"},this.loading=!1,this.spaces=[],this.selected=null,this.canCreateSpace=!1,this.canEditSpace=!1,this.canManageRoots=!1,this.router=v(xe),this.activatedRoute=v(Se),this.spacesService=v(ie),this.store=v(ze),this.userService=v(te),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],managers:[{prop:"managers",type:"length"}],permissions:[{prop:"permissions",type:"length"}],modified:[{prop:"modified",type:"date"}]},this.sortTable=new tt(this.constructor.name,this.sortSettings),this.loadSpaces(),this.canCreateSpace=this.userService.userHavePermission(Oe.SPACES_ADMIN),this.layout.setBreadcrumbIcon(R.SPACES),this.layout.setBreadcrumbNav({url:`/${ne.SPACES}/${je.SPACES}`,translating:!0,sameLink:!0}),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select)}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadSpaces(){this.loading=!0,this.onSelect(),this.spacesService.listSpaces().subscribe({next:n=>{this.sortBy(this.sortTable.sortParam.column,!1,n),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:n=>{this.spaces=[],this.loading=!1,this.layout.sendNotification("error","Spaces",n.error.message)}})}browse(n){n.enabled?this.router.navigate([ne.FILES,n.alias],{relativeTo:this.activatedRoute}).catch(console.error):this.layout.sendNotification("warning",n.name,"Space is disabled")}onSelect(n=null){n?(this.selected=n,this.canEditSpace=!!n.managers.find(o=>o.id===this.userService.user.id),this.canManageRoots=this.canEditSpace||n.havePermission(O.SHARE_INSIDE)):(this.selected=null,this.canEditSpace=!1,this.canManageRoots=!1),this.store.spaceSelection.set(this.selected)}sortBy(n,o=!0,i){this.spaces=this.sortTable.sortBy(n,o,i||this.spaces)}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}openSpaceDialog(n=!1){n?this.layout.openDialog(se,"xl").content.spaceChange.pipe(L(1)).subscribe(i=>{let[_,d]=i;_==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.concat(d)),this.onSelect(d))}):this.selected&&this.canEditSpace&&this.spacesService.getSpace(this.selected.id).subscribe({next:o=>{this.layout.openDialog(se,"xl",{initialState:{space:o}}).content.spaceChange.pipe(L(1)).subscribe(_=>{let[d,E]=_;d==="update"?(this.selected.name=E.name,this.selected.alias=E.alias,this.selected.description=E.description,this.selected.counts=pe(ce({},E.counts),{shares:this.selected.counts.shares}),this.selected.modifiedAt=E.modifiedAt,this.selected.enabled=E.enabled,this.selected.managers=[...E.managers]):d==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.filter(wt=>wt.id!==E.id)))})},error:o=>this.layout.sendNotification("error","Edit space",this.selected.name,o)})}openSpaceRootsDialog(){setTimeout(()=>{this.layout.openDialog(ht,"md",{initialState:{space:this.selected,user:this.userService.user}})},this.selected?0:100)}openChildShareDialog(n){n&&this.onSelect(n),this.layout.openDialog(gt,null,{initialState:{space:this.selected}}).content.sharesCountEvent.subscribe(i=>this.selected.counts.shares=i)}focusOn(n){let o=this.spaces.find(i=>i.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=$({type:r,selectors:[["app-spaces"]],viewQuery:function(o,i){if(o&1&&(B(ae,5),B(oe,7),B(re,7),B(Qt,7),B(zt,7)),o&2){let _;N(_=W())&&(i.scrollView=_.first),N(_=W())&&(i.inputFilter=_.first),N(_=W())&&(i.btnNavigationView=_.first),N(_=W())&&(i.mainContextMenu=_.first),N(_=W())&&(i.targetContextMenu=_.first)}},decls:34,vars:37,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,"tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[3,"user","isMember","height","width"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["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"],[1,"circle-primary-icon",3,"icon","fixedWidth"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,i){if(o&1){let _=x();l(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(_),S(i.loadSpaces())}),u(3,"fa-icon",4),s(),C(4,jt,3,5,"button",5),l(5,"button",6),b(6,"translate"),f("click",function(){return h(_),S(i.openSpaceDialog())}),u(7,"fa-icon",7),s(),l(8,"button",6),b(9,"translate"),f("click",function(){return h(_),S(i.openChildShareDialog())}),u(10,"fa-icon",7),s(),l(11,"button",6),b(12,"translate"),f("click",function(){return h(_),S(i.openSpaceRootsDialog())}),u(13,"fa-icon",7),s(),l(14,"div",8)(15,"div",9),u(16,"app-input-filter",10),s(),l(17,"app-navigation-view",11),f("sortBy",function(E){return h(_),S(i.sortBy(E))})("switchView",function(E){return h(_),S(i.galleryMode=E)}),s()()(),C(18,Zt,6,8,"div",12)(19,Ci,12,8),l(20,"div",13)(21,"span",14),m(22),b(23,"translate"),s()(),l(24,"context-menu",null,0),C(26,Si,2,1),w(27,xi,3,1,"ng-template",15),f("execute",function(){return h(_),S(i.loadSpaces())}),s(),l(28,"context-menu",null,1),C(30,wi,2,1),C(31,Ei,1,0,null,16),C(32,Mi,1,1,null,17),w(33,Pi,3,1,"ng-template",15),f("execute",function(){return h(_),S(i.layout.showRSideBarTab(i.TAB_MENU.SELECTION))}),s()}o&2&&(a(),p("tooltip",y(2,22,"Refresh",i.locale.language)),a(2),p("icon",i.icons.faArrowRotateRight)("animation",i.loading?"spin":null),a(),g(i.canCreateSpace?4:-1),a(),p("disabled",!i.canEditSpace)("tooltip",y(6,25,"Edit space",i.locale.language)),a(2),p("icon",i.icons.faPen),a(),p("disabled",!i.canEditSpace||!(i.selected!=null&&i.selected.counts.shares))("tooltip",y(9,28,"Edit children shares",i.locale.language)),a(2),p("icon",i.icons.SHARED),a(),p("disabled",!i.canManageRoots)("tooltip",y(12,31,"Manage my anchored files",i.locale.language)),a(2),p("icon",i.icons.faAnchor),a(4),p("sortParams",i.sortTable.sortParam)("sortFields",i.btnSortFields),a(),g(i.galleryMode!=null&&i.galleryMode.enabled?18:19),a(4),ue("",i.spaces.length," ",y(23,34,"spaces",i.locale.language)),a(4),g(i.canCreateSpace?26:-1),a(4),g(i.canEditSpace?30:-1),a(),g(i.canManageRoots?31:-1),a(),g(i.canEditSpace||i.canManageRoots?32:-1))},dependencies:[K,J,it,ae,Pe,Me,qe,$e,Ue,re,oe,_t,Je,he,pt,De,Ze],encapsulation:2});let e=r;return e})();export{Yn as SpacesComponent};
@@ -1 +1 @@
1
- import{d as F,f as y,o as _,t as b}from"./chunk-GUGNR5TF.js";import{$a as I,Db as w,E as D,Gb as N,Hb as L,Ob as C,Pa as p,Sa as k,Va as u,Wa as o,Xa as g,_b as E,ab as O,ac as H,bb as f,da as m,ea as M,jb as A,qb as S,rb as R,sb as j,sc as v,za as l,zc as P}from"./chunk-C36MW4ME.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new p,this.isDisabledChange=new p,this.toggleClick=new p,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(u),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(u),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=f({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=f({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(u),o(c))},t.\u0275dir=f({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};
1
+ import{d as F,f as y,o as _,t as b}from"./chunk-XDZGW64M.js";import{$a as I,Ac as P,Db as w,E as D,Gb as N,Hb as L,Ob as C,Pa as p,Sa as k,Va as u,Wa as o,Xa as g,_b as E,ab as O,ac as H,bb as f,da as m,ea as M,jb as A,qb as S,rb as R,sb as j,tc as v,za as l}from"./chunk-DIT6W7VM.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new p,this.isDisabledChange=new p,this.toggleClick=new p,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(u),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(u),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=f({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=f({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(u),o(c))},t.\u0275dir=f({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};