@sync-in/server 1.7.0 → 1.8.0

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 (269) hide show
  1. package/CHANGELOG.md +164 -58
  2. package/environment/environment.dist.yaml +6 -3
  3. package/migrations/0003_giant_luckman.sql +6 -0
  4. package/migrations/meta/0003_snapshot.json +2463 -0
  5. package/migrations/meta/_journal.json +7 -0
  6. package/package.json +16 -15
  7. package/server/app.bootstrap.js +1 -0
  8. package/server/app.bootstrap.js.map +1 -1
  9. package/server/app.constants.js +0 -4
  10. package/server/app.constants.js.map +1 -1
  11. package/server/app.service.js +7 -6
  12. package/server/app.service.js.map +1 -1
  13. package/server/applications/files/constants/only-office.js +12 -0
  14. package/server/applications/files/constants/only-office.js.map +1 -1
  15. package/server/applications/files/files.config.js +5 -0
  16. package/server/applications/files/files.config.js.map +1 -1
  17. package/server/applications/files/services/files-content-manager.service.js +6 -6
  18. package/server/applications/files/services/files-content-manager.service.js.map +1 -1
  19. package/server/applications/files/services/files-manager.service.js +4 -4
  20. package/server/applications/files/services/files-manager.service.js.map +1 -1
  21. package/server/applications/files/services/files-methods.service.js +5 -3
  22. package/server/applications/files/services/files-methods.service.js.map +1 -1
  23. package/server/applications/files/services/files-only-office-manager.service.js +2 -2
  24. package/server/applications/files/services/files-only-office-manager.service.js.map +1 -1
  25. package/server/applications/files/services/files-parser.service.js +6 -3
  26. package/server/applications/files/services/files-parser.service.js.map +1 -1
  27. package/server/applications/files/services/files-scheduler.service.js +51 -3
  28. package/server/applications/files/services/files-scheduler.service.js.map +1 -1
  29. package/server/applications/files/services/files-search-manager.service.js +4 -0
  30. package/server/applications/files/services/files-search-manager.service.js.map +1 -1
  31. package/server/applications/files/utils/doc-textify/adapters/pdf.js +10 -1
  32. package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
  33. package/server/applications/notifications/i18n/de.js +56 -0
  34. package/server/applications/notifications/i18n/de.js.map +1 -0
  35. package/server/applications/notifications/i18n/es.js +52 -0
  36. package/server/applications/notifications/i18n/es.js.map +1 -0
  37. package/server/applications/notifications/i18n/hi.js +52 -0
  38. package/server/applications/notifications/i18n/hi.js.map +1 -0
  39. package/server/applications/notifications/i18n/index.js +73 -8
  40. package/server/applications/notifications/i18n/index.js.map +1 -1
  41. package/server/applications/notifications/i18n/it.js +52 -0
  42. package/server/applications/notifications/i18n/it.js.map +1 -0
  43. package/server/applications/notifications/i18n/ja.js +52 -0
  44. package/server/applications/notifications/i18n/ja.js.map +1 -0
  45. package/server/applications/notifications/i18n/ko.js +52 -0
  46. package/server/applications/notifications/i18n/ko.js.map +1 -0
  47. package/server/applications/notifications/i18n/pl.js +52 -0
  48. package/server/applications/notifications/i18n/pl.js.map +1 -0
  49. package/server/applications/notifications/i18n/pt.js +52 -0
  50. package/server/applications/notifications/i18n/pt.js.map +1 -0
  51. package/server/applications/notifications/i18n/pt_br.js +52 -0
  52. package/server/applications/notifications/i18n/pt_br.js.map +1 -0
  53. package/server/applications/notifications/i18n/ru.js +52 -0
  54. package/server/applications/notifications/i18n/ru.js.map +1 -0
  55. package/server/applications/notifications/i18n/tr.js +52 -0
  56. package/server/applications/notifications/i18n/tr.js.map +1 -0
  57. package/server/applications/notifications/i18n/zh.js +52 -0
  58. package/server/applications/notifications/i18n/zh.js.map +1 -0
  59. package/server/applications/notifications/mails/models.js +6 -7
  60. package/server/applications/notifications/mails/models.js.map +1 -1
  61. package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
  62. package/server/applications/shares/dto/create-or-update-share.dto.js +11 -0
  63. package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
  64. package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
  65. package/server/applications/shares/schemas/share.interface.js.map +1 -1
  66. package/server/applications/shares/schemas/shares.schema.js +9 -0
  67. package/server/applications/shares/schemas/shares.schema.js.map +1 -1
  68. package/server/applications/shares/services/shares-manager.service.js +46 -17
  69. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  70. package/server/applications/shares/services/shares-queries.service.js +24 -5
  71. package/server/applications/shares/services/shares-queries.service.js.map +1 -1
  72. package/server/applications/spaces/constants/cache.js +4 -0
  73. package/server/applications/spaces/constants/cache.js.map +1 -1
  74. package/server/applications/spaces/dto/create-or-update-space.dto.js +5 -0
  75. package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
  76. package/server/applications/spaces/guards/space.guard.js +3 -3
  77. package/server/applications/spaces/guards/space.guard.js.map +1 -1
  78. package/server/applications/spaces/models/space-props.model.js.map +1 -1
  79. package/server/applications/spaces/models/space.model.js.map +1 -1
  80. package/server/applications/spaces/schemas/space.interface.js.map +1 -1
  81. package/server/applications/spaces/schemas/spaces.schema.js +1 -0
  82. package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
  83. package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
  84. package/server/applications/spaces/services/spaces-manager.service.js +34 -31
  85. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  86. package/server/applications/spaces/services/spaces-queries.service.js +23 -7
  87. package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
  88. package/server/applications/spaces/services/spaces-scheduler.service.js +21 -20
  89. package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
  90. package/server/applications/spaces/spaces.controller.js +4 -2
  91. package/server/applications/spaces/spaces.controller.js.map +1 -1
  92. package/server/applications/spaces/utils/paths.js +14 -16
  93. package/server/applications/spaces/utils/paths.js.map +1 -1
  94. package/server/applications/sync/services/sync-manager.service.js +4 -3
  95. package/server/applications/sync/services/sync-manager.service.js.map +1 -1
  96. package/server/applications/sync/services/sync-paths-manager.service.js +1 -1
  97. package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
  98. package/server/applications/sync/services/sync-paths-manager.service.spec.js +1 -1
  99. package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
  100. package/server/applications/sync/sync.controller.js +2 -1
  101. package/server/applications/sync/sync.controller.js.map +1 -1
  102. package/server/applications/users/constants/routes.js +5 -0
  103. package/server/applications/users/constants/routes.js.map +1 -1
  104. package/server/applications/users/constants/user.js +0 -16
  105. package/server/applications/users/constants/user.js.map +1 -1
  106. package/server/applications/users/dto/user-properties.dto.js +10 -0
  107. package/server/applications/users/dto/user-properties.dto.js.map +1 -1
  108. package/server/applications/users/models/user.model.js.map +1 -1
  109. package/server/applications/users/schemas/user.interface.js.map +1 -1
  110. package/server/applications/users/schemas/users.schema.js +3 -2
  111. package/server/applications/users/schemas/users.schema.js.map +1 -1
  112. package/server/applications/users/services/admin-users-manager.service.js +1 -0
  113. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  114. package/server/applications/users/services/admin-users-manager.service.spec.js +2 -1
  115. package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
  116. package/server/applications/users/services/users-manager.service.js +8 -2
  117. package/server/applications/users/services/users-manager.service.js.map +1 -1
  118. package/server/applications/users/services/users-manager.service.spec.js +1 -0
  119. package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
  120. package/server/applications/users/services/users-queries.service.js +18 -4
  121. package/server/applications/users/services/users-queries.service.js.map +1 -1
  122. package/server/applications/users/users.controller.js +15 -0
  123. package/server/applications/users/users.controller.js.map +1 -1
  124. package/server/applications/users/utils/test.js +2 -2
  125. package/server/applications/users/utils/test.js.map +1 -1
  126. package/server/applications/webdav/constants/routes.js +2 -2
  127. package/server/applications/webdav/constants/routes.js.map +1 -1
  128. package/server/applications/webdav/constants/webdav.js +2 -2
  129. package/server/applications/webdav/constants/webdav.js.map +1 -1
  130. package/server/applications/webdav/filters/webdav.filter.js +2 -2
  131. package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
  132. package/server/applications/webdav/filters/webdav.filter.spec.js +2 -2
  133. package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
  134. package/server/applications/webdav/services/webdav-methods.service.js +3 -2
  135. package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
  136. package/server/applications/webdav/utils/webdav.js +1 -2
  137. package/server/applications/webdav/utils/webdav.js.map +1 -1
  138. package/server/authentication/auth.config.js +2 -2
  139. package/server/authentication/auth.config.js.map +1 -1
  140. package/server/authentication/guards/auth-basic.strategy.js +2 -2
  141. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  142. package/server/common/i18n.js +52 -0
  143. package/server/common/i18n.js.map +1 -0
  144. package/server/common/image.js +49 -33
  145. package/server/common/image.js.map +1 -1
  146. package/server/common/interfaces.js.map +1 -1
  147. package/server/common/shared.js +5 -2
  148. package/server/common/shared.js.map +1 -1
  149. package/server/configuration/config.validation.js +3 -3
  150. package/server/configuration/config.validation.js.map +1 -1
  151. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +8 -6
  152. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
  153. package/server/infrastructure/cache/adapters/redis-cache.adapter.js +22 -17
  154. package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
  155. package/server/infrastructure/cache/cache.e2e-spec.js +1 -0
  156. package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
  157. package/server/infrastructure/cache/cache.module.js +1 -14
  158. package/server/infrastructure/cache/cache.module.js.map +1 -1
  159. package/server/infrastructure/cache/services/cache.service.js.map +1 -1
  160. package/server/infrastructure/database/database.module.js +20 -1
  161. package/server/infrastructure/database/database.module.js.map +1 -1
  162. package/server/infrastructure/database/utils.js +48 -0
  163. package/server/infrastructure/database/utils.js.map +1 -1
  164. package/server/infrastructure/scheduler/scheduler.module.js +1 -1
  165. package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
  166. package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -3
  167. package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
  168. package/static/3rdpartylicenses.txt +137 -137
  169. package/static/chunk-2KLC4T2Z.js +1 -0
  170. package/static/chunk-373XVRXW.js +1 -0
  171. package/static/chunk-3GMLWAFZ.js +1 -0
  172. package/static/chunk-3XVM35O2.js +1 -0
  173. package/static/chunk-3YVRP3VM.js +2 -0
  174. package/static/chunk-5NMSIIQB.js +1 -0
  175. package/static/chunk-AF24EYXU.js +1 -0
  176. package/static/chunk-AKQVEHO6.js +2 -0
  177. package/static/{chunk-PTGDOWV3.js → chunk-AY2SZ3G6.js} +1 -1
  178. package/static/chunk-BCVX464U.js +2 -0
  179. package/static/{chunk-IPAC4VAF.js → chunk-BIKLW4YS.js} +1 -1
  180. package/static/chunk-C36MW4ME.js +562 -0
  181. package/static/chunk-CHJ64RJM.js +1 -0
  182. package/static/chunk-DKSEQTMX.js +1 -0
  183. package/static/chunk-DM4NXKEP.js +1 -0
  184. package/static/chunk-DPUVSXRB.js +1 -0
  185. package/static/chunk-DSWEWLXJ.js +1 -0
  186. package/static/chunk-FJE6BOFL.js +1 -0
  187. package/static/chunk-FZ3JPGYZ.js +1 -0
  188. package/static/chunk-GUGNR5TF.js +3 -0
  189. package/static/chunk-H6NE33VX.js +1 -0
  190. package/static/{chunk-DJYJ66UF.js → chunk-HAS5ZOTR.js} +1 -1
  191. package/static/chunk-HNQRZALS.js +1 -0
  192. package/static/chunk-JPT5WEAT.js +1 -0
  193. package/static/{chunk-QNJFQVYI.js → chunk-JSWCNGXJ.js} +1 -1
  194. package/static/chunk-KFJIQIGR.js +1 -0
  195. package/static/chunk-LNTUR3GU.js +1 -0
  196. package/static/chunk-LVM4QB22.js +1 -0
  197. package/static/chunk-M3XVNQZQ.js +1 -0
  198. package/static/{chunk-EVIE5F2U.js → chunk-MFLIJH6T.js} +1 -1
  199. package/static/{chunk-IQOALFYU.js → chunk-MSUHTBB2.js} +1 -1
  200. package/static/chunk-N3U6637P.js +1 -0
  201. package/static/chunk-NNV4OXSB.js +1 -0
  202. package/static/chunk-NO2LTNW3.js +1 -0
  203. package/static/chunk-OOGP4WSH.js +2 -0
  204. package/static/chunk-PB4AIT7O.js +1 -0
  205. package/static/chunk-PCWDQPOM.js +2 -0
  206. package/static/chunk-PGZZP5W3.js +1 -0
  207. package/static/chunk-PVDHBQRM.js +1 -0
  208. package/static/chunk-Q5KM7LTX.js +1 -0
  209. package/static/chunk-QHC6ZPQ4.js +1 -0
  210. package/static/chunk-QO6BTONN.js +1 -0
  211. package/static/chunk-QZU2S5CV.js +1 -0
  212. package/static/chunk-SBZ572Q4.js +2 -0
  213. package/static/chunk-SHIVUDP3.js +1 -0
  214. package/static/chunk-SLHTEGRU.js +1 -0
  215. package/static/{chunk-SH5EVL4E.js → chunk-SSFF27P2.js} +1 -1
  216. package/static/chunk-TPYBFZS5.js +1 -0
  217. package/static/chunk-UEQCWMXD.js +1 -0
  218. package/static/chunk-UG5DMXYO.js +1 -0
  219. package/static/chunk-UJPPR4MX.js +1 -0
  220. package/static/chunk-UNCPXHHT.js +1 -0
  221. package/static/chunk-URHTCJ7G.js +1 -0
  222. package/static/chunk-V3AT2BKP.js +1 -0
  223. package/static/chunk-VKK5BSLX.js +1 -0
  224. package/static/{chunk-SIPE37PA.js → chunk-VM4YX6Q7.js} +1 -1
  225. package/static/chunk-WJW7CT6G.js +27 -0
  226. package/static/{chunk-7ITZXYYJ.js → chunk-WLMNXRBS.js} +1 -1
  227. package/static/chunk-X5XGK6T7.js +4 -0
  228. package/static/chunk-YEKR5OPO.js +1 -0
  229. package/static/chunk-YW57T2PF.js +1 -0
  230. package/static/chunk-Z5J5F5SX.js +1 -0
  231. package/static/chunk-ZIJQRARU.js +1 -0
  232. package/static/chunk-ZPF2DSQV.js +1 -0
  233. package/static/chunk-ZTCRGJ6Y.js +7 -0
  234. package/static/index.html +2 -2
  235. package/static/main-VOL6OMJ5.js +9 -0
  236. package/static/scripts-WRDOQIU5.js +24 -0
  237. package/static/{styles-A5VYX3CE.css → styles-2C2UNCNB.css} +1 -1
  238. package/server/applications/spaces/interfaces/space-quota.interface.js +0 -10
  239. package/server/applications/spaces/interfaces/space-quota.interface.js.map +0 -1
  240. package/static/chunk-22EANI6R.js +0 -1
  241. package/static/chunk-3GFGJYMK.js +0 -1
  242. package/static/chunk-4YGJGZZZ.js +0 -1
  243. package/static/chunk-5K7HEX3C.js +0 -27
  244. package/static/chunk-5KLMS6A4.js +0 -1
  245. package/static/chunk-ATP3BFHV.js +0 -562
  246. package/static/chunk-BB4G55KE.js +0 -1
  247. package/static/chunk-EWKSX76T.js +0 -1
  248. package/static/chunk-FHLACA7V.js +0 -1
  249. package/static/chunk-GCATNU55.js +0 -1
  250. package/static/chunk-GYODPCIE.js +0 -1
  251. package/static/chunk-HZTFYLM5.js +0 -1
  252. package/static/chunk-JSUKJT6Z.js +0 -1
  253. package/static/chunk-JXZCNFW7.js +0 -1
  254. package/static/chunk-LTGFCQR7.js +0 -1
  255. package/static/chunk-LV3PYKWO.js +0 -1
  256. package/static/chunk-N2WFNW6M.js +0 -7
  257. package/static/chunk-ORMRCEGT.js +0 -1
  258. package/static/chunk-OUTBJSMW.js +0 -1
  259. package/static/chunk-RS2PX32L.js +0 -1
  260. package/static/chunk-RSSWH3S2.js +0 -1
  261. package/static/chunk-RTRJ3KFH.js +0 -1
  262. package/static/chunk-TKTCBDOG.js +0 -1
  263. package/static/chunk-V6K2N46L.js +0 -1
  264. package/static/chunk-XLCCZSQL.js +0 -4
  265. package/static/chunk-YPEH66GG.js +0 -1
  266. package/static/chunk-YPOIUQ57.js +0 -1
  267. package/static/chunk-ZKCFO2OA.js +0 -4
  268. package/static/main-MZ7HWZXO.js +0 -9
  269. package/static/scripts-VZVAP2P4.js +0 -30
@@ -0,0 +1 @@
1
+ import{Ub as fe,_a as de,yb as pe}from"./chunk-GUGNR5TF.js";import{$a as x,Ab as _,Cd as ce,Db as D,Fb as O,Gb as ee,Hb as te,J as E,Jb as T,Kb as S,La as X,Lb as y,N as z,Na as w,Pa as C,Qa as P,T as N,Va as G,X as V,Z as A,_c as ne,bb as Z,cb as j,cd as oe,dg as ue,ec as ie,f as B,gc as se,ia as u,kb as K,kd as re,kf as me,lb as $,na as H,oa as I,p as L,qb as R,rb as k,sb as M,td as le,ua as Q,ub as q,vb as U,wa as Y,wb as J,wd as he,xd as ae,za as v}from"./chunk-C36MW4ME.js";var be=["iFilter"];function Ce(r,i){if(r&1){let d=_();k(0,"span",3)(1,"fa-icon",4),D("click",function(){H(d);let t=O();return I(t.clear())}),M()()}if(r&2){let d=O();w(),R("icon",d.faTimes)}}var _e=(()=>{let i=class i{constructor(){this.search=Q(""),this.locale=u(ae),this.faTimes=me,this.fb=u(le),this.searchControl=this.fb.control(""),this.subscription=this.searchControl.valueChanges.pipe(E(300),z()).subscribe(e=>this.onType(e))}ngOnDestroy(){this.subscription.unsubscribe()}onKeyPress(e){(e.ctrlKey||e.metaKey)&&e.keyCode===70?(e.preventDefault(),e.stopPropagation(),this.iFilter.nativeElement.focus()):e.keyCode===27&&e.preventDefault()}clear(){this.searchControl&&(this.searchControl.reset(),this.iFilter.nativeElement.value="")}onType(e){this.search.set(e)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-input-filter"]],viewQuery:function(t,s){if(t&1&&T(be,7),t&2){let n;S(n=y())&&(s.iFilter=n.first)}},hostBindings:function(t,s){t&1&&D("keydown",function(h){return s.onKeyPress(h)},X)},decls:5,vars:6,consts:[["iFilter",""],[1,"btn-group",2,"height","30px","max-width","150px"],["type","text",1,"form-control","form-control-sm",2,"padding-right","24px",3,"keyup.escape","placeholder","formControl"],[1,"cursor-pointer",2,"position","absolute","right","5px","top","3px","z-index","1001","font-size","1rem"],["role","button",3,"click","icon"]],template:function(t,s){if(t&1){let n=_();k(0,"div",1)(1,"input",2,0),ie(3,"translate"),D("keyup.escape",function(){return H(n),I(s.clear())}),M(),K(4,Ce,2,1,"span",3),M()}t&2&&(w(),R("placeholder",se(3,3,"Filter",s.locale.language)+" (Ctrl/\u2318+F)")("formControl",s.searchControl),w(3),$(s.search()?4:-1))},dependencies:[he,ne,oe,re,ue,ce],encapsulation:2});let r=i;return r})();var Te=["content"],Se=["shim"],ye=["*"],Ye=(()=>{let i=class i{constructor(){this.isScrollBottom=new C,this.isScrollTop=new C,this.resizeOffset=130,this.galleryMode=!1,this.selectedChat=null,this.items=[],this.childHeight=35,this.bufferAmount=0,this.viewPortItems=[],this.element=u(v),this.renderer=u(G),this.ngZone=u(P),this.layout=u(pe),this.subscriptions=[],this.scrollbarWidth=0,this._scrollChat=new B,this.scrollChat=this._scrollChat.asObservable().pipe(E(50)),this.startupLoop=!0,this.scrollTimer=null,this.lastScrollHeight=-1,this.lastTopPadding=-1,this.toggleLeftSidebar=this.layout.toggleLeftSideBar.pipe(V(1),A(e=>L(e).pipe(N({count:30,delay:10})))),this.tableScrollHovering=()=>{clearTimeout(this.scrollTimer),this.contentElementRef.nativeElement.classList.contains("table-disable-hover")||this.renderer.addClass(this.contentElementRef.nativeElement,"table-disable-hover"),this.scrollTimer=setTimeout(()=>{this.renderer.removeClass(this.contentElementRef.nativeElement,"table-disable-hover")},200),this.refresh()},this.refreshWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0)},this.refreshWithoutDimensions=()=>{this.refresh()},this.refreshChatWithoutDimensions=()=>{this.chatIsScrolledToTop()&&!this.selectedChat.allHistoryLoaded?this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollTop,behavior:"auto"}):(this.refreshWithoutDimensions(),this._scrollChat.next())},this.refreshChatWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0),this.selectedChat.isScrolledToBottom?this.scrollInto(-2):this._scrollChat.next()}}ngOnInit(){this.resizeOffsetHeight(!0),this.addParentEventHandlers(),this.selectedChat?(this.childHeight=1,this.subscriptions.push(this.scrollChat.subscribe(()=>this.checkScrollChat()))):this.galleryMode||this.subscriptions.push(this.toggleLeftSidebar.subscribe(()=>this.resizeTableHeader()))}ngOnDestroy(){this.eventScrollHandler&&(this.eventScrollHandler(),this.eventScrollHandler=void 0),this.subscriptions.forEach(e=>e.unsubscribe())}ngOnChanges(e){if(this.previousStart=void 0,this.previousEnd=void 0,this.galleryMode)this.startupLoop=!0;else{let t=e.items||void 0;(e.items!==void 0&&t.previousValue===void 0||t.previousValue!==void 0&&t.previousValue.length===0)&&(this.startupLoop=!0)}this.refresh(!0),this.checkChangesOnChat(e)}refresh(e=!1){this.ngZone.runOutsideAngular(()=>{(e||!this.dimensionsView)&&this.calculateDimensions(),requestAnimationFrame(()=>this.calculateItems())}),this.resizeTableHeader()}scrollInto(e){if(e===-1){this.element.nativeElement.scrollTo({left:0,top:0,behavior:"auto"});return}else if(e===-2){this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"});return}else if(e===0){this.refresh();return}let t=(this.items||[]).indexOf(e);if(t<0||t>=(this.items||[]).length)return;let s=this.dimensionsView,n=Math.floor(t/s.itemsPerRow)*s.childHeight-s.childHeight*Math.min(t,this.bufferAmount);this.element.nativeElement.scrollTo({left:0,top:n,behavior:"smooth"}),this.refresh()}checkChangesOnChat(e){this.selectedChat&&(e.selectedChat?(this.renderer.setStyle(this.element.nativeElement,"visibility","hidden"),setTimeout(()=>{this.selectedChat.lastScrollPosition===null&&this.saveChatScrollPosition(this.element.nativeElement.scrollHeight),this.element.nativeElement.scrollTo({left:0,top:this.selectedChat.lastScrollPosition,behavior:"auto"}),this.checkScrollChat(),this.renderer.setStyle(this.element.nativeElement,"visibility","visible")},50)):this.chatIsScrolledToBottom()?this.restoreBottomScrollChat():this.chatIsScrolledToTop()&&this.restoreTopScrollChat())}checkScrollChat(){let e=this.chatIsScrolledToBottom(),t=this.chatIsScrolledToTop();t?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop):e?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight):this.saveChatScrollPosition(),this.ngZone.run(()=>{this.isScrollBottom.next(e),this.isScrollTop.next(t)})}saveChatScrollPosition(e=null){this.selectedChat.lastScrollPosition=e||this.element.nativeElement.scrollTop}chatIsScrolledToBottom(){return Math.ceil(this.element.nativeElement.clientHeight/10)*10===Math.ceil((this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop)/10)*10}chatIsScrolledToTop(){return this.element.nativeElement.scrollTop<=300}restoreBottomScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"})},50)}restoreTopScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTop=this.element.nativeElement.scrollHeight-this.selectedChat.lastScrollPosition},50)}resizeOffsetHeight(e=!1){let t=window.innerHeight-this.resizeOffset;(e||this.element.nativeElement.offsetHeight!==t)&&this.renderer.setStyle(this.element.nativeElement,"height",`${t-1}px`)}resizeTableHeader(){!this.selectedChat&&!this.galleryMode&&this.element.nativeElement.previousElementSibling&&this.element.nativeElement.previousElementSibling.classList.contains("app-table")&&setTimeout(()=>this.renderer.setStyle(this.element.nativeElement.previousElementSibling,"width",`${this.element.nativeElement.clientWidth}px`),50)}addParentEventHandlers(){this.ngZone.runOutsideAngular(()=>{this.galleryMode?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshWithoutDimensions):this.selectedChat?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshChatWithoutDimensions):this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.tableScrollHovering),this.selectedChat?this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshChatWithDimensions())):this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshWithDimensions()))})}countItemsPerRow(){if(this.galleryMode){let e,t,s=this.contentElementRef.nativeElement.children;for(s[0]&&(s=s[0].children),t=0;t<s.length&&!(e!==void 0&&e!==s[t].offsetTop);t++)e=s[t].offsetTop;return t}else return 1}calculateDimensions(){let e=this.element.nativeElement,t=e.offsetWidth-e.clientWidth;this.scrollbarWidth!=t&&(this.resizeTableHeader(),this.scrollbarWidth=t);let n=(this.items||[]).length,h=e.clientWidth-this.scrollbarWidth,p=e.clientHeight,c;if(this.childWidth===void 0||this.childHeight===void 0){let F=this.contentElementRef.nativeElement;c=F.children[0]?F.children[0].getBoundingClientRect():{width:h,height:p}}let o=this.childWidth||c.width,m=this.childHeight||c.height,a=this.countItemsPerRow(),f=Math.max(1,Math.floor(h/o));this.galleryMode&&a===0?a=f:a=Math.max(1,a);let l=Math.max(1,Math.floor(p/m)),g=e.scrollTop,ve=Math.max(0,g),b=m*Math.ceil(n/a);l===1&&Math.floor(ve/b*n)+f>=n&&(a=f),b!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",`${b}px`),this.lastScrollHeight=b),this.dimensionsView={itemCount:n,viewWidth:h,viewHeight:p,childWidth:o,childHeight:m,itemsPerRow:a,itemsPerCol:l,itemsPerRowByCalc:f,scrollHeight:b}}calculateItems(){let e=this.element.nativeElement,t=this.dimensionsView,s=this.items||[],n=this.galleryMode?this.bufferAmount*t.itemsPerRowByCalc:this.bufferAmount,h=e.scrollTop;h>t.scrollHeight&&(h=t.scrollHeight);let c=Math.max(0,h)/t.scrollHeight*t.itemCount/t.itemsPerRow,o=Math.min(t.itemCount,Math.ceil(c)*t.itemsPerRow+t.itemsPerRow*(t.itemsPerCol+1)),m=o,a=o%t.itemsPerRow;a&&(m=o+t.itemsPerRow-a);let f=Math.max(0,m-t.itemsPerCol*t.itemsPerRow-t.itemsPerRow),l=Math.min(f,Math.floor(c)*t.itemsPerRow),g=s==null||s.length===0?0:t.childHeight*Math.ceil(l/t.itemsPerRow)-t.childHeight*Math.min(l,this.bufferAmount);g!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`translateY(${g}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`translateY(${g}px)`),this.lastTopPadding=g),l=isNaN(l)?-1:l,o=isNaN(o)?-1:o,l-=n,l=Math.max(0,l),o+=n,o=Math.min(s.length,o),l!==this.previousStart||o!==this.previousEnd?(this.ngZone.run(()=>{this.viewPortItems=s.slice(l,o>=0?o:0)}),this.previousStart=l,this.previousEnd=o,this.startupLoop===!0&&this.refresh()):this.startupLoop===!0&&(this.startupLoop=!1,this.refresh(!0))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-virtual-scroll"]],viewQuery:function(t,s){if(t&1&&(T(Te,7,v),T(Se,7,v)),t&2){let n;S(n=y())&&(s.contentElementRef=n.first),S(n=y())&&(s.shimElementRef=n.first)}},inputs:{resizeOffset:"resizeOffset",galleryMode:"galleryMode",selectedChat:"selectedChat",items:"items",childHeight:"childHeight",childWidth:"childWidth",bufferAmount:"bufferAmount"},outputs:{isScrollBottom:"isScrollBottom",isScrollTop:"isScrollTop"},features:[Y],ngContentSelectors:ye,decls:5,vars:0,consts:[["shim",""],["content",""],[1,"total-padding"],[1,"scrollable-content"]],template:function(t,s){t&1&&(ee(),J(0,"div",2,0),q(2,"div",3,1),te(4),U())},styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:thin}.scrollable-content[_ngcontent-%COMP%]{top:0;left:0;width:100%;position:absolute;will-change:transform}.total-padding[_ngcontent-%COMP%]{width:1px;opacity:0}"],changeDetection:0});let r=i;return r})();var $e=(()=>{let i=class i{constructor(){this.maxMove=10,this.maxDuration=350,this.doubleTapInterval=600,this.doubleTapSlop=24,this.enableDoubleTap=!0,this.emitSingleWhenNoDouble=!1,this.preventGhostClick=!0,this.preventDefault=!1,this.disabled=!1,this.appTap=new C,this.elRef=u(v),this.zone=u(P),this.removeFns=[],this.active=!1,this.pointerId=null,this.startX=0,this.startY=0,this.startTime=0,this.moved=!1,this.lastEmitTs=0,this.pendingSingle=null,this.singleTimer=null,this.onDown=e=>{this.disabled||e.button!==0||this.active||(this.active=!0,this.pointerId=e.pointerId,this.startX=e.clientX,this.startY=e.clientY,this.startTime=e.timeStamp,this.moved=!1,e.target.setPointerCapture?.(e.pointerId))},this.onMove=e=>{if(!(!this.active||e.pointerId!==this.pointerId)&&!this.moved){let t=Math.abs(e.clientX-this.startX),s=Math.abs(e.clientY-this.startY);(t>this.maxMove||s>this.maxMove)&&(this.moved=!0)}},this.onUp=e=>{if(!this.active||e.pointerId!==this.pointerId)return;let t=e.timeStamp-this.startTime,s=Math.abs(e.clientX-this.startX),n=Math.abs(e.clientY-this.startY),h=!this.moved&&s<=this.maxMove&&n<=this.maxMove&&t<=this.maxDuration;if(this.resetGesture(),!h)return;this.preventDefault&&e.preventDefault();let p=performance.now(),c=e.clientX,o=e.clientY;if(!this.enableDoubleTap){this.emit("single",c,o,e);return}if(this.pendingSingle){let m=p-this.pendingSingle.t,a=Math.hypot(c-this.pendingSingle.x,o-this.pendingSingle.y);if(m<=this.doubleTapInterval&&a<=this.doubleTapSlop){clearTimeout(this.singleTimer),this.singleTimer=null,this.pendingSingle=null,this.emit("double",c,o,e);return}}this.pendingSingle={x:c,y:o,t:p},clearTimeout(this.singleTimer),this.singleTimer=setTimeout(()=>{if(this.emitSingleWhenNoDouble){let m=this.pendingSingle;this.emit("single",m.x,m.y)}this.pendingSingle=null,this.singleTimer=null},this.doubleTapInterval)},this.onCancel=()=>this.resetGesture(),this.onKey=e=>{if(this.disabled)return;let t=e.key.toLowerCase();if(t==="enter"||t===" "){if(e.preventDefault(),this.enableDoubleTap&&!this.emitSingleWhenNoDouble)return;this.emit("single",0,0,e)}},this.onContextMenu=e=>{this.preventDefault&&e.preventDefault()},this.onNativeClick=e=>{this.preventGhostClick&&performance.now()-this.lastEmitTs<350&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},this.el=this.elRef.nativeElement,this.zone.runOutsideAngular(()=>{this.add("pointerdown",this.onDown,{passive:!0}),this.add("pointermove",this.onMove,{passive:!0}),this.add("pointerup",this.onUp,{passive:!1}),this.add("pointercancel",this.onCancel,{passive:!0}),this.add("pointerleave",this.onCancel,{passive:!0}),this.add("keydown",this.onKey,{passive:!1}),this.add("contextmenu",this.onContextMenu,{passive:!1}),this.add("click",this.onNativeClick,{passive:!1,capture:!0})})}ngOnDestroy(){for(let e of this.removeFns)e();this.removeFns=[],clearTimeout(this.singleTimer)}emit(e,t,s,n){this.lastEmitTs=performance.now(),this.zone.run(()=>this.appTap.emit({x:t,y:s,type:e,sourceEvent:n}))}add(e,t,s){this.el.addEventListener(e,t,s),this.removeFns.push(()=>this.el.removeEventListener(e,t,s))}resetGesture(){this.active=!1,this.pointerId=null,this.startTime=0}};i.\u0275fac=function(t){return new(t||i)},i.\u0275dir=Z({type:i,selectors:[["","appTap",""]],hostAttrs:[2,"touch-action","manipulation","-webkit-tap-highlight-color","transparent"],inputs:{maxMove:"maxMove",maxDuration:"maxDuration",doubleTapInterval:"doubleTapInterval",doubleTapSlop:"doubleTapSlop",enableDoubleTap:"enableDoubleTap",emitSingleWhenNoDouble:"emitSingleWhenNoDouble",preventGhostClick:"preventGhostClick",preventDefault:"preventDefault",disabled:"disabled"},outputs:{appTap:"appTap"}});let r=i;return r})();var Je=(()=>{let i=class i{transform(e,t,s){return!e?.length||!t?e:de(t,e,s)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275pipe=j({name:"searchFilter",type:i,pure:!0});let r=i;return r})();var ge=class{constructor(i,d){this.defaultId="default",this.keyStore=`sortBy${i}`,this.sortSettings=d,this._sortParam=this.sort}get sortParam(){return this._sortParam||this.sort}get sort(){let i=localStorage.getItem(this.keyStore);return i?JSON.parse(i):{column:this.defaultId,asc:!1}}set sort(i){this._sortParam=i,localStorage.setItem(this.keyStore,JSON.stringify(i))}sortBy(i,d=!0,e){if(!(i in this.sortSettings))return e;d&&(this.sortParam.asc?(this.sortParam.column=this.defaultId,this.sortParam.asc=!1,i=this.defaultId):this.sortParam.column===i?this.sortParam.asc=!this.sortParam.asc:(this.sortParam.column=i,this.sortParam.asc=!1),this.sort=this.sortParam);for(let t of this.sortSettings[i])fe(t.type,e,t.prop,i===this.defaultId?!1:this.sortParam.asc);return[...e]}};export{_e as a,Ye as b,$e as c,Je as d,ge as e};
@@ -1 +1 @@
1
- import{k as F,m as y,s as b,t as _}from"./chunk-XLCCZSQL.js";import{$b as H,Cb as w,E as D,Fb as N,Gb as L,Na as k,Nb as C,Qa as p,Ra as o,Sa as g,Xa as I,Ya as O,Za as u,Zb as E,bb as f,ca as m,da as M,ib as A,pb as S,qb as R,qc as v,rb as j,xc as P,ya as l}from"./chunk-ATP3BFHV.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 f,this.isDisabledChange=new f,this.toggleClick=new f,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(p),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(p),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=u({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=u({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(p),o(c))},t.\u0275dir=u({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-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};
@@ -0,0 +1 @@
1
+ import{Ga as yi,H as hi,Ha as Ei,Ib as Ti,Jb as lt,Ma as Si,Sa as bi,Sb as L,Ta as wi,W as li,X as ie,_ as ut,aa as pi,ba as fi,ca as Mt,da as di,ea as mi,fa as se,ga as W,ha as gi,hb as Ai,ia as _i,ja as z,kb as Z,lb as vi,mb as Ht,yb as tt}from"./chunk-GUGNR5TF.js";import{$a as Ct,$d as si,Ab as ct,Cd as ii,Db as A,Dd as Ut,Fb as D,G as Oe,Ib as Le,Jb as Ue,Kb as Ot,L as xe,Lb as xt,Lf as ai,Mb as te,Na as m,Nb as Me,Ob as H,Oc as Ye,Pa as Pe,Qb as T,Rc as Ft,Sb as Ve,Ub as He,Va as Be,Vb as We,W as Ne,Wa as Q,Wb as $e,Yc as It,_b as Nt,_c as Pt,ab as kt,ad as ht,ae as ri,bb as J,bg as ci,c as Re,ca as at,cd as Bt,da as At,dd as Ke,dg as Vt,ea as vt,ec as qe,ga as Fe,gc as Ge,hd as je,ia as p,ib as De,id as Qe,jb as Rt,kb as R,lb as O,ld as Je,md as Xe,na as M,nf as ni,oa as V,qb as k,rb as f,rd as ze,sb as g,sc as ee,sd as Ze,tb as X,tf as oi,ud as ti,v as S,vd as ei,wa as Ie,wd as Dt,xd as Lt,za as Tt}from"./chunk-C36MW4ME.js";import{n as ui}from"./chunk-DM4NXKEP.js";import{a as U,b as ve,d as Te,f as Ce,j as ke}from"./chunk-N3U6637P.js";var Ci={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var pt={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var l=(function(s){return s.BASE="/api/auth",s.LOGIN="login",s.LOGOUT="logout",s.REFRESH="refresh",s.TOKEN="token",s.TOKEN_REFRESH="token/refresh",s.WS="socket.io",s.TWO_FA_BASE="2fa",s.TWO_FA_ENABLE="enable",s.TWO_FA_DISABLE="disable",s.TWO_FA_LOGIN_VERIFY="login/verify",s.TWO_FA_ADMIN_RESET_USER="reset/user",s})(l||{}),er=`${l.BASE}/${l.LOGIN}`,ir=`${l.BASE}/${l.LOGOUT}`,ki=`${l.BASE}/${l.REFRESH}`,sr=`${l.BASE}/${l.TOKEN}`,rr=`${l.BASE}/${l.TOKEN_REFRESH}`,Ri=`/${l.WS}`,re=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ENABLE}`,Oi=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_DISABLE}`,xi=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_LOGIN_VERIFY}`,Ni=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ADMIN_RESET_USER}`;var Se={};Ce(Se,{Fetch:()=>yt,Manager:()=>Y,NodeWebSocket:()=>P,NodeXHR:()=>I,Socket:()=>q,WebSocket:()=>P,WebTransport:()=>$,XHR:()=>I,connect:()=>K,default:()=>K,io:()=>K,protocol:()=>ye});var C=Object.create(null);C.open="0";C.close="1";C.ping="2";C.pong="3";C.message="4";C.upgrade="5";C.noop="6";var ft=Object.create(null);Object.keys(C).forEach(s=>{ft[C[s]]=s});var dt={type:"error",data:"parser error"};var Pi=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Bi=typeof ArrayBuffer=="function",Di=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,mt=({type:s,data:t},i,e)=>Pi&&t instanceof Blob?i?e(t):Fi(t,e):Bi&&(t instanceof ArrayBuffer||Di(t))?i?e(t):Fi(new Blob([t]),e):e(C[s]+(t||"")),Fi=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Ii(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var ne;function Li(s,t){if(Pi&&s.data instanceof Blob)return s.data.arrayBuffer().then(Ii).then(t);if(Bi&&(s.data instanceof ArrayBuffer||Di(s.data)))return t(Ii(s.data));mt(s,!1,i=>{ne||(ne=new TextEncoder),t(ne.encode(i))})}var Ui="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ui.length;s++)gt[Ui.charCodeAt(s)]=s;var Mi=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let E=new ArrayBuffer(t),w=new Uint8Array(E);for(e=0;e<i;e+=4)n=gt[s.charCodeAt(e)],o=gt[s.charCodeAt(e+1)],a=gt[s.charCodeAt(e+2)],c=gt[s.charCodeAt(e+3)],w[r++]=n<<2|o>>4,w[r++]=(o&15)<<4|a>>2,w[r++]=(a&3)<<6|c&63;return E};var _s=typeof ArrayBuffer=="function",_t=(s,t)=>{if(typeof s!="string")return{type:"message",data:Vi(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:ys(s.substring(1),t)}:ft[i]?s.length>1?{type:ft[i],data:s.substring(1)}:{type:ft[i]}:dt},ys=(s,t)=>{if(_s){let i=Mi(s);return Vi(i,t)}else return{base64:!0,data:s}},Vi=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Hi="",Wi=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{mt(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Hi))})})},$i=(s,t)=>{let i=s.split(Hi),e=[];for(let r=0;r<i.length;r++){let n=_t(i[r],t);if(e.push(n),n.type==="error")break}return e};function qi(){return new TransformStream({transform(s,t){Li(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var oe;function Wt(s){return s.reduce((t,i)=>t+i.length,0)}function $t(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Gi(s,t){oe||(oe=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(Wt(i)<1)break;let c=$t(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(Wt(i)<2)break;let c=$t(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(Wt(i)<8)break;let c=$t(i,8),E=new DataView(c.buffer,c.byteOffset,c.length),w=E.getUint32(0);if(w>Math.pow(2,21)-1){a.enqueue(dt);break}r=w*Math.pow(2,32)+E.getUint32(4),e=3}else{if(Wt(i)<r)break;let c=$t(i,r);a.enqueue(_t(n?c:oe.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(dt);break}}}})}var ae=4;function u(s){if(s)return Es(s)}function Es(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var x=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),_=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Yi="arraybuffer";function qt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var Ss=_.setTimeout,bs=_.clearTimeout;function N(s,t){t.useNativeTimers?(s.setTimeoutFn=Ss.bind(_),s.clearTimeoutFn=bs.bind(_)):(s.setTimeoutFn=_.setTimeout.bind(_),s.clearTimeoutFn=_.clearTimeout.bind(_))}var ws=1.33;function Ki(s){return typeof s=="string"?As(s):Math.ceil((s.byteLength||s.size)*ws)}function As(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function Gt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ji(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function Qi(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var Yt=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},F=class extends u{constructor(t){super(),this.writable=!1,N(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new Yt(t,i,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let i=_t(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=ji(t);return i.length?"?"+i:""}};var et=class extends F{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};$i(t,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Wi(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Gt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var Ji=!1;try{Ji=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Xi=Ji;function vs(){}var ce=class extends et{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},Kt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,N(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=qt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=vs,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zi);else if(typeof addEventListener=="function"){let s="onpagehide"in _?"pagehide":"unload";addEventListener(s,zi,!1)}}function zi(){for(let s in Kt.requests)Kt.requests.hasOwnProperty(s)&&Kt.requests[s].abort()}var Ts=(function(){let s=Zi({xdomain:!1});return s&&s.responseType!==null})(),I=class extends ce{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=Ts&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Kt(Zi,this.uri(),t)}};function Zi(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Xi))return new XMLHttpRequest}catch{}if(!t)try{return new _[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var ts=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ue=class extends F{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=ts?{}:qt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;mt(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Gt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},he=_.WebSocket||_.MozWebSocket,P=class extends ue{createSocket(t,i,e){return ts?new he(t,i,e):i?new he(t,i):new he(t)}doWrite(t,i){this.ws.send(i)}};var $=class extends F{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let i=Gi(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=qi();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var le={websocket:P,webtransport:$,polling:I};var Cs=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ks=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function it(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=Cs.exec(s||""),n={},o=14;for(;o--;)n[ks[o]]=r[o]||"";return i!=-1&&e!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=Rs(n,n.path),n.queryKey=Os(n,n.query),n}function Rs(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function Os(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var pe=typeof addEventListener=="function"&&typeof removeEventListener=="function",jt=[];pe&&addEventListener("offline",()=>{jt.forEach(s=>s())},!1);var Qt=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Yi,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=it(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=it(e.host).host);N(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Qi(this.opts.query)),pe&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},jt.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=ae,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ki(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),pe&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=jt.indexOf(this._offlineEventListener);r!==-1&&jt.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=ae,s})(),Jt=class extends Qt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let i=this.createTransport(t),e=!1;Qt.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",B=>{if(!e)if(B.type==="pong"&&B.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Qt.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(w(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let ot=new Error("probe error");ot.transport=i.name,this.emitReserved("upgradeError",ot)}}))};function n(){e||(e=!0,w(),i.close(),i=null)}let o=B=>{let ot=new Error("probe error: "+B);ot.transport=i.name,n(),this.emitReserved("upgradeError",ot)};function a(){o("transport closed")}function c(){o("socket closed")}function E(B){i&&B.name!==i.name&&n()}let w=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",E)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",E),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},st=class extends Jt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>le[r]).filter(r=>!!r)),super(t,e)}};var yt=class extends et{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var ln=st.protocol;function es(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=it(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Ee={};Ce(Ee,{Decoder:()=>ge,Encoder:()=>me,PacketType:()=>h,protocol:()=>ye});var xs=typeof ArrayBuffer=="function",Ns=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,is=Object.prototype.toString,Fs=typeof Blob=="function"||typeof Blob<"u"&&is.call(Blob)==="[object BlobConstructor]",Is=typeof File=="function"||typeof File<"u"&&is.call(File)==="[object FileConstructor]";function St(s){return xs&&(s instanceof ArrayBuffer||Ns(s))||Fs&&s instanceof Blob||Is&&s instanceof File}function Et(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(Et(s[i]))return!0;return!1}if(St(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Et(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&Et(s[i]))return!0;return!1}function ss(s){let t=[],i=s.data,e=s;return e.data=fe(i,t),e.attachments=t.length,{packet:e,buffers:t}}function fe(s,t){if(!s)return s;if(St(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=fe(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=fe(s[e],t));return i}return s}function rs(s,t){return s.data=de(s.data,t),delete s.attachments,s}function de(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=de(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=de(s[i],t));return s}var Ps=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ye=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),me=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&Et(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=ss(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ns(s){return Object.prototype.toString.call(s)==="[object Object]"}var ge=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new _e(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(St(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ns(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ns(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Ps.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},_e=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let i=rs(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function b(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var Bs=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),q=class extends u{constructor(t,i,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[b(t,"open",this.onopen.bind(this)),b(t,"packet",this.onpacket.bind(this)),b(t,"error",this.onerror.bind(this)),b(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...i){var e,r,n;if(Bs.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let w=this.ids++,B=i.pop();this._registerAckCallback(w,B),o.id=w}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function G(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}G.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};G.prototype.reset=function(){this.attempts=0};G.prototype.setMin=function(s){this.ms=s};G.prototype.setMax=function(s){this.max=s};G.prototype.setJitter=function(s){this.jitter=s};var Y=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,N(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new G({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Ee;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new st(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=b(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=b(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(b(t,"ping",this.onping.bind(this)),b(t,"data",this.ondata.bind(this)),b(t,"error",this.onerror.bind(this)),b(t,"close",this.onclose.bind(this)),b(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){x(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new q(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var bt={};function K(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=es(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=bt[r]&&n in bt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new Y(e,t):(bt[r]||(bt[r]=new Y(e,t)),c=bt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(K,{Manager:Y,Socket:q,io:K,connect:K});var rt=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=K?K:Se;this.ioSocket=n(e,r)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Te(a,["url"]),n=U({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new Re(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(Ne())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,i){return this.ioSocket.off(t,i),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function Ds(s,t){return new rt(s,t)}var os=new Fe("__SOCKET_IO_CONFIG__"),eo=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:os,useValue:i},{provide:rt,useFactory:Ds,deps:[os,De]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=kt({type:s});static \u0275inj=vt({})}return s})();var be={BASE:`${li}/notifications`,UNREAD:"unread"},Xt=be.BASE;var d=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(d||{});var v=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s.AUTH_LOCKED="auth_locked",s.AUTH_2FA="auth_2fa",s})(v||{}),co={COMMENTS:"commented",SPACES:{[d.ADD]:"You now have access to the space",[d.DELETE]:"You no longer have access to the space",[d.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[d.ADD]:"anchored",[d.DELETE]:"unanchored"},SHARES:{[d.ADD]:"shared with you",[d.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[d.ADD]:"You now have access to the share",[d.DELETE]:"You no longer have access to the share",[d.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[d.ADD]:"shared with you",[d.UPDATE]:"You now have access to the space"},SYNC:{[d.DELETE]:"You are no longer synchronizing"},AUTH_2FA:{[d.ADD]:"Two-factor authentication (2FA) on your account has been enabled",[d.DELETE]:"Two-factor authentication (2FA) on your account has been disabled"},AUTH_LOCKED:{[d.DELETE]:"Your account has been locked after several unsuccessful authentication attempts"}};var as=ni;var cs={[v.COMMENTS]:as,[v.SPACES]:lt.SPACES,[v.SPACE_ROOTS]:lt.SPACES,[v.SHARES]:lt.SHARES,[v.LINKS]:lt.LINKS,[v.SYNC]:Ai.SYNC};var zt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=Z(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=cs[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===v.COMMENTS||this.content.app===v.SHARES||this.content.app===v.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var hs=(()=>{let t=class t{constructor(){this.http=p(Ft),this.store=p(Ht),this.layout=p(tt)}getNotifications(e=!1){return this.http.get(`${Xt}${e?`/${be.UNREAD}`:""}`).pipe(S(r=>r.map(n=>new zt(n))))}wasReadNotification(e){return this.http.patch(`${Xt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${Xt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(xe(1)).subscribe(()=>this.layout.showRSideBarTab(Si.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=At({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var y=(function(s){return s.ACCESS="access",s.ACCESS_2FA="access_2fa",s.REFRESH="refresh",s.WS="ws",s.CSRF="csrf",s.CSRF_2FA="csrf_2fa",s})(y||{});var Do="sync-in-csrf";var we=6;var us="sync-in-two-fa-code",ls="sync-in-two-fa-password",Lo={[y.ACCESS]:"/",[y.REFRESH]:ki,[y.WS]:Ri,[y.CSRF]:"/",[y.ACCESS_2FA]:xi,[y.CSRF_2FA]:"/"},Uo=[y.REFRESH,y.ACCESS,y.WS,y.CSRF],Mo=[y.ACCESS_2FA,y.CSRF_2FA];var Us=["Password"];function Ms(s,t){s&1&&(f(0,"label",1),T(1,"Password"),g())}function Vs(s,t){if(s&1){let i=ct();f(0,"div",5),A("click",function(){M(i);let r=D();return V(r.randomPassword())}),f(1,"span"),X(2,"fa-icon",6),g()()}if(s&2){let i=D();m(2),k("icon",i.icons.faDice)}}var ps=(()=>{let t=class t{constructor(){this.passwordChange=new Pe,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.centered=!1,this.locale=p(Lt),this.toggleVisiblePassword=wi,this.icons={faEye:ri,faEyeSlash:ai,faDice:ci}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(yi(this.passwordMinLength+2))}};t.\u0275fac=function(r){return new(r||t)},t.\u0275cmp=Ct({type:t,selectors:[["app-input-password"]],viewQuery:function(r,n){if(r&1&&Ue(Us,7),r&2){let o;Ot(o=xt())&&(n.passwordElement=o.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus",centered:"centered"},outputs:{passwordChange:"passwordChange"},decls:9,vars:16,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm","pe-0",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(r,n){if(r&1){let o=ct();R(0,Ms,2,0,"label",1),f(1,"div",2)(2,"input",3,0),qe(4,"translate"),$e("ngModelChange",function(c){return M(o),We(n.password,c)||(n.password=c),V(c)}),A("keyup",function(){return M(o),V(n.passwordChange.emit(n.password))}),g(),R(5,Vs,3,1,"div",4),f(6,"div",5),A("click",function(){M(o);let c=te(3);return V(n.toggleVisiblePassword(c))}),f(7,"span"),X(8,"fa-icon",6),g()()()}if(r&2){let o=te(3);O(n.showLabel?0:-1),m(2),Me("padding-left",n.centered?"2rem":""),H("is-invalid",n.isRequired&&(n.password==null?null:n.password.length)<n.passwordMinLength)("text-center",n.centered),He("ngModel",n.password),k("disabled",n.disabled)("placeholder",Ge(4,13,n.placeholder,n.locale.language))("required",n.isRequired),m(3),O(n.showGenerator?5:-1),m(3),k("icon",o.type==="text"?n.icons.faEye:n.icons.faEyeSlash)}},dependencies:[ei,Pt,Bt,ze,je,Dt,Vt,Ut,ii],encapsulation:2});let s=t;return s})();var fs=(()=>{let t=class t{constructor(){this.autoFocus=!0,this.autoSelect=!0,this.elementRef=p(Tt)}ngOnInit(){setTimeout(()=>{this.autoFocus&&this.elementRef.nativeElement.focus(),this.autoSelect&&this.elementRef.nativeElement.select()},0)}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=J({type:t,selectors:[["","appAutofocus",""]],inputs:{autoFocus:"autoFocus",autoSelect:"autoSelect"}});let s=t;return s})();function Hs(s,t){s&1&&(f(0,"span",3),T(1,"Two-Factor Authentication"),g())}function Ws(s,t){s&1&&(f(0,"span",3),T(1,"Password Authentication"),g())}function $s(s,t){if(s&1&&T(0),s&2){let i=D();Ve(" ",i.hasError," ")}}function qs(s,t){s&1&&T(0," Enter your password ")}function Gs(s,t){s&1&&T(0," Valid with your TOTP code ")}function Ys(s,t){if(s&1){let i=ct();f(0,"div",9)(1,"app-input-password",13),A("passwordChange",function(r){M(i);let n=D();return V(n.updatePassword(r))}),g()()}if(s&2){let i=D();m(),k("password",i.twoFaForm.value.password)("focus",!0)("centered",!0)}}function Ks(s,t){s&1&&(f(0,"div",14),T(1,"Valid with your TOTP code"),g())}function js(s,t){if(s&1&&(R(0,Ks,2,0,"div",14),f(1,"div",15),X(2,"input",16),g()),s&2){let i=D();O(i.withPassword?0:-1),m(2),k("autoFocus",!i.withPassword)("autoSelect",!i.withPassword)("maxlength",i.twoFaCodelength)}}var ds=(()=>{let t=class t{constructor(){this.withPassword=!1,this.withTwoFaEnabled=!0,this.submitted=!1,this.hasError=null,this.icons={faKey:si,faLock:oi},this.twoFaCodelength=we,this.locale=p(Lt),this.fb=p(ti),this.layout=p(tt)}ngOnInit(){this.twoFaForm=this.fb.group({totpCode:this.fb.control("",this.withTwoFaEnabled?[ht.required,ht.pattern(new RegExp(`^\\d{${we}}$`))]:null),password:this.fb.control("",this.withPassword?[ht.required,ht.minLength(8)]:null)})}onClose(e=!1){this.isValid(e),this.layout.closeDialog()}onSubmit(){this.submitted=!0;let e=new Ye(U(U({},this.withTwoFaEnabled?{[us]:this.twoFaForm.value.totpCode}:{}),this.withPassword?{[ls]:this.twoFaForm.value.password}:{}));this.onClose(e)}updatePassword(e){this.twoFaForm.patchValue({password:e})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275cmp=Ct({type:t,selectors:[["app-user-auth-2fa-verify-dialog"]],inputs:{withPassword:"withPassword",withTwoFaEnabled:"withTwoFaEnabled"},decls:20,vars:9,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa"],[1,"card","shadow-sm"],[1,"card-body"],["l10nTranslate","",1,"d-flex","justify-content-center","align-items-center","mb-3"],[3,"ngSubmit","formGroup"],[1,"mb-4"],[1,"d-grid","gap-2"],["type","submit","l10nTranslate","",1,"btn","btn-primary",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",3,"passwordChange","password","focus","centered"],["l10nTranslate","",1,"text-align-center","mb-3"],[1,"mb-3"],["appAutofocus","","type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","fs-4",3,"autoFocus","autoSelect","maxlength"]],template:function(r,n){r&1&&(f(0,"div",0)(1,"h4",1),X(2,"fa-icon",2),R(3,Hs,2,0,"span",3)(4,Ws,2,0,"span",3),g()(),f(5,"div",4)(6,"div",5)(7,"div",6)(8,"p",7),R(9,$s,1,1)(10,qs,1,0)(11,Gs,1,0),g(),f(12,"form",8),A("ngSubmit",function(){return n.onSubmit()}),R(13,Ys,2,3,"div",9),R(14,js,3,4),f(15,"div",10)(16,"button",11),T(17,"Confirm"),g(),f(18,"button",12),A("click",function(){return n.onClose()}),T(19,"Cancel"),g()()()()()()),r&2&&(m(2),k("icon",n.icons.faLock),m(),O(n.withTwoFaEnabled?3:4),m(5),H("text-danger",n.hasError),m(),O(n.hasError?9:n.withPassword?10:11),m(3),k("formGroup",n.twoFaForm),m(),O(n.withPassword?13:-1),m(),O(n.withTwoFaEnabled?14:-1),m(2),k("disabled",n.twoFaForm.invalid||n.submitted))},dependencies:[Vt,Ut,fs,Dt,Qe,Pt,Bt,Ke,Ze,Je,Xe,ps],encapsulation:2});let s=t;return s})();var Zt=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new L(i))}};var j=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=Z(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=ui(this.currentAccess).fromNow(!0),this.newly=bi(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new L(i)))}};var wt=class{constructor(t){this.setOnlineStatus(Ei("status",t)),this.avatarUrl=Z(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=hi[t]}};var Ja=(()=>{let t=class t{constructor(){this.http=p(Ft),this.layout=p(tt),this.store=p(Ht),this.webSocket=p(rt),this.notifications=p(hs),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(Ci.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(pt.EVENTS.ONLINE_USER).pipe(S(e=>new wt(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(pt.EVENTS.ONLINE_USERS).pipe(S(e=>e.map(r=>new wt(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(pt.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language).catch(console.error),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${gi}${e?`/${e}`:""}`).pipe(S(r=>new Zt(r)))}createPersonalGroup(e){return this.http.post(W,e).pipe(S(r=>new L(r)))}updatePersonalGroup(e,r){return this.http.put(`${W}/${e}`,r).pipe(S(n=>new L(n)))}leavePersonalGroup(e){return this.http.delete(`${_i}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${W}/${e}/${ut.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${W}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${W}/${e}/${ut.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${W}/${e}/${ut.USERS}/${r}`)}listGuests(){return this.http.get(z).pipe(S(e=>e.map(r=>new j(r))))}getGuest(e){return this.http.get(`${z}/${e}`).pipe(S(r=>new j(r)))}createGuest(e){return this.http.post(z,e).pipe(S(r=>new j(r)))}updateGuest(e,r){return this.http.put(`${z}/${e}`,r).pipe(S(n=>n?new j(n):null))}deleteGuest(e){return this.http.delete(`${z}/${e}`)}genAvatar(){this.http.patch(se,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(se,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e,r){return this.http.put(fi,e,{headers:r})}changeLanguage(e){return this.http.put(pi,e)}changeNotification(e){return this.http.put(di,e)}changeStorageIndexing(e){return this.http.put(mi,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(pt.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?ve(U({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",ut.BASE,{body:e}).pipe(S(n=>n.map(o=>new L(o,r))),Oe(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===Ti.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(vi())}checkAppStoreAvailability(){this.http.get(`${ie.BASE}/${ie.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}listAppPasswords(e){return this.http.get(Mt,{headers:e})}generateAppPassword(e,r){return this.http.post(Mt,e,{headers:r})}deleteAppPassword(e){return this.http.delete(`${Mt}/${e}`)}init2Fa(){return this.http.get(re)}enable2Fa(e){return this.http.post(re,e)}disable2Fa(e){return this.http.post(Oi,e)}adminResetUser2Fa(e,r){return this.http.post(`${Ni}/${e}`,null,{headers:r})}auth2FaVerifyDialog(e=!1){return ke(this,null,function*(){let r=this.store.server().twoFaEnabled&&this.user.twoFaEnabled;if(e||r)return new Promise(n=>{let o=this.layout.openDialog(ds,"xs",{initialState:{withPassword:e,withTwoFaEnabled:r}},{keyboard:!1});o.content.isValid=a=>{n(a)}})})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=At({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Qs={provide:It,useExisting:at(()=>Js),multi:!0},Js=(()=>{let t=class t{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}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=J({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&A("click",function(){return n.onClick()}),r&2&&(Rt("aria-pressed",n.state),H("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[Nt([Qs])]});let s=t;return s})(),Xs={provide:It,useExisting:at(()=>ms),multi:!0},ms=(()=>{let t=class t{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,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,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")}};t.\u0275fac=function(r){return new(r||t)(Q(Tt),Q(ee),Q(Be),Q(at(()=>gs),8))},t.\u0275dir=J({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&A("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(Rt("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),H("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[Nt([Xs]),Ie]});let s=t;return s})(),zs={provide:It,useExisting:at(()=>gs),multi:!0},gs=(()=>{let t=class t{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(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.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 r(o,a){let E=(o+(e==="next"?1:-1))%a.length;return E<0&&(E=a.length-1),E}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(Q(ee))},t.\u0275dir=J({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&Le(o,ms,4),r&2){let a;Ot(a=xt())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&A("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&Rt("role",n.role)("tabindex",n.tabindex)},features:[Nt([zs])]});let s=t;return s})(),hc=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=kt({type:t}),t.\u0275inj=vt({});let s=t;return s})();export{er as a,ir as b,ki as c,xi as d,Do as e,we as f,us as g,ls as h,eo as i,v as j,hs as k,ps as l,fs as m,Zt as n,j as o,Ja as p,Js as q,hc as r};
@@ -0,0 +1 @@
1
+ import{n as Y}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-N3U6637P.js";var m={name:"ja",weekdays:"\u65E5\u66DC\u65E5_\u6708\u66DC\u65E5_\u706B\u66DC\u65E5_\u6C34\u66DC\u65E5_\u6728\u66DC\u65E5_\u91D1\u66DC\u65E5_\u571F\u66DC\u65E5".split("_"),weekdaysShort:"\u65E5_\u6708_\u706B_\u6C34_\u6728_\u91D1_\u571F".split("_"),weekdaysMin:"\u65E5_\u6708_\u706B_\u6C34_\u6728_\u91D1_\u571F".split("_"),months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),ordinal:function(_){return _+"\u65E5"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5E74M\u6708D\u65E5",LLL:"YYYY\u5E74M\u6708D\u65E5 HH:mm",LLLL:"YYYY\u5E74M\u6708D\u65E5 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY\u5E74M\u6708D\u65E5",lll:"YYYY\u5E74M\u6708D\u65E5 HH:mm",llll:"YYYY\u5E74M\u6708D\u65E5(ddd) HH:mm"},meridiem:function(_){return _<12?"\u5348\u524D":"\u5348\u5F8C"},relativeTime:{future:"%s\u5F8C",past:"%s\u524D",s:"\u6570\u79D2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65E5",dd:"%d\u65E5",M:"1\u30F6\u6708",MM:"%d\u30F6\u6708",y:"1\u5E74",yy:"%d\u5E74"}};Y.locale(m,null,!0);var e=m;export{e as default};
@@ -1 +1 @@
1
- import{_a as k,v as E,w as L}from"./chunk-XLCCZSQL.js";import{Ad as v,Eb as s,Gc as x,Gd as F,Hd as O,Pb as g,Xa as c,_c as T,dc as r,fc as p,ha as l,jb as f,kb as u,nb as d,ob as h,pb as C,qb as P,rb as y,sb as _,va as m}from"./chunk-ATP3BFHV.js";var D=(e,i)=>i.key;function K(e,i){e&1&&(P(0,"span",0),g(1,"No permissions"),y())}function V(e,i){if(e&1&&(_(0,"fa-icon",1),r(1,"translate")),e&2){let t=i.$implicit,n=s(2);C("icon",t.value.icon)("tooltip",p(1,3,t.value.text,n.locale.language))("placement",n.tooltipPlacement)}}function M(e,i){if(e&1&&(d(0,V,2,6,"fa-icon",1,D),r(2,"keyvalue")),e&2){let t=s();h(p(2,0,t.permissions,t.originalOrderKeyValue))}}var z=(()=>{let i=class i{constructor(){this.permissions={},this.tooltipPlacement="top",this.replaceEmptyPermissions=!1,this.locale=l(v),this.hasPermissions=!1,this.originalOrderKeyValue=k}ngOnChanges(){this.hasPermissions=!!Object.keys(this.permissions).length}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=c({type:i,selectors:[["app-file-permissions"]],inputs:{permissions:"permissions",tooltipPlacement:"tooltipPlacement",replaceEmptyPermissions:"replaceEmptyPermissions"},features:[m],decls:2,vars:1,consts:[["l10nTranslate",""],[1,"cursor-pointer","fs-md",3,"icon","tooltip","placement"]],template:function(o,a){o&1&&f(0,K,2,0,"span",0)(1,M,3,3),o&2&&u(a.replaceEmptyPermissions&&!a.hasPermissions?0:1)},dependencies:[L,E,O,T,x,F],encapsulation:2});let e=i;return e})();export{z as a};
1
+ import{Za as k,r as O,s as E}from"./chunk-GUGNR5TF.js";import{$a as c,Cd as v,Dd as F,Fb as s,Ic as x,Qb as g,dg as L,ec as r,gc as p,ia as l,kb as f,lb as u,ob as d,pb as h,qb as C,rb as P,sb as y,tb as _,wa as m,xd as T}from"./chunk-C36MW4ME.js";var D=(e,i)=>i.key;function K(e,i){e&1&&(P(0,"span",0),g(1,"No permissions"),y())}function V(e,i){if(e&1&&(_(0,"fa-icon",1),r(1,"translate")),e&2){let t=i.$implicit,n=s(2);C("icon",t.value.icon)("tooltip",p(1,3,t.value.text,n.locale.language))("placement",n.tooltipPlacement)}}function M(e,i){if(e&1&&(d(0,V,2,6,"fa-icon",1,D),r(2,"keyvalue")),e&2){let t=s();h(p(2,0,t.permissions,t.originalOrderKeyValue))}}var z=(()=>{let i=class i{constructor(){this.permissions={},this.tooltipPlacement="top",this.replaceEmptyPermissions=!1,this.locale=l(T),this.hasPermissions=!1,this.originalOrderKeyValue=k}ngOnChanges(){this.hasPermissions=!!Object.keys(this.permissions).length}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=c({type:i,selectors:[["app-file-permissions"]],inputs:{permissions:"permissions",tooltipPlacement:"tooltipPlacement",replaceEmptyPermissions:"replaceEmptyPermissions"},features:[m],decls:2,vars:1,consts:[["l10nTranslate",""],[1,"cursor-pointer","fs-md",3,"icon","tooltip","placement"]],template:function(o,a){o&1&&f(0,K,2,0,"span",0)(1,M,3,3),o&2&&u(a.replaceEmptyPermissions&&!a.hasPermissions?0:1)},dependencies:[E,O,F,L,x,v],encapsulation:2});let e=i;return e})();export{z as a};
@@ -0,0 +1 @@
1
+ import{b as R,c as ft}from"./chunk-LVM4QB22.js";import{a as ue,b as z,c as Te,d as vt}from"./chunk-ZTCRGJ6Y.js";import{a as Ct}from"./chunk-MSUHTBB2.js";import{a as ht,b as gt,c as bt}from"./chunk-HAS5ZOTR.js";import{a as S,b as Y,c as tt,e as _t}from"./chunk-VM4YX6Q7.js";import{a as _e,b as pt,c as ct,d as ut,h as dt}from"./chunk-X5XGK6T7.js";import{a as Ge,b as Se,c as lt,d as st,e as mt}from"./chunk-H6NE33VX.js";import"./chunk-SHIVUDP3.js";import{b as Me,d as Pe}from"./chunk-UJPPR4MX.js";import{m as rt,q as at}from"./chunk-HNQRZALS.js";import{A as K,B as et,I as H,Nb as xe,Sb as ye,Va as ve,Za as de,r as je,va as it,wa as nt,xa as ot,yb as V,z as Ze}from"./chunk-GUGNR5TF.js";import{$a as E,$d as le,Ab as A,Bf as Ye,Cd as re,Db as _,Dd as M,E as be,Ed as Ke,Fb as u,Ge as se,Gf as ce,Ha as J,Ic as te,If as Je,Jb as Q,Jd as ae,Kb as q,L as O,Lb as W,Na as s,Nb as Ce,Ob as U,Od as He,Pa as I,Pb as k,Qb as m,Rb as C,Re as qe,Sb as $,Tb as Ee,Ub as X,Ue as We,Uf as Xe,Vb as Z,Wb as ee,Yb as Ae,Zb as De,Zc as Ve,_c as Re,ad as Fe,cd as L,dd as Ue,dg as P,eb as w,ec as v,ed as ke,fc as D,gc as T,gd as j,hd as ie,ia as x,kb as h,lb as g,ld as Oe,md as Ie,na as y,nd as Be,oa as G,ob as B,od as Ne,of as me,pb as N,pd as $e,qb as c,rb as r,sb as a,tb as d,vd as ne,wd as Le,wf as pe,xd as oe,xe as Qe,zf as ze}from"./chunk-C36MW4ME.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as he,b as ge}from"./chunk-N3U6637P.js";var xt=(()=>{let l=class l{constructor(){this.currentMemberIds=[],this.hasChanges=new I,this.layout=x(V),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:se},this.adminService=x(R)}searchMembers(n){let o={search:n,onlyUsers:!0,usersRole:this.parentGroup.type===ue.USER?Ze.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(e=>e.id)]};return this.adminService.searchMembers(o)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(n=>n.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(n=>n.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(o=>o.name).join("<br>"),n,{enableHtml:!0})}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,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"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(o,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Add members"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"app-user-search",7),ee("membersChange",function(f){return Z(e.newMembers,f)||(e.newMembers=f),f}),a()(),r(11,"div",8)(12,"button",9),_("click",function(){return e.layout.closeDialog()}),m(13,"Cancel"),a(),r(14,"button",10),_("click",function(){return e.onSubmit()}),m(15," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPlus),s(2),C(e.parentGroup.name),s(6),X("members",e.newMembers),c("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",e.searchMembers.bind(e)),s(4),c("disabled",e.submitted||!e.newMembers.length))},dependencies:[P,M,dt],encapsulation:2});let t=l;return t})();function wt(t,l){if(t&1&&d(0,"img",9),t&2){let i=u();c("src",i.member.avatarUrl,J)}}function Et(t,l){if(t&1&&d(0,"fa-icon",15),t&2){let i=u();k(i.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",i.icons.GROUPS)}}function At(t,l){if(t&1&&(r(0,"div",7)(1,"span",16),m(2,"from the group"),a(),r(3,"span",11),m(4),v(5,"capitalize"),a()()),t&2){let i=u();s(4),C(D(5,1,i.parentGroup.name))}}function Dt(t,l){t&1&&(r(0,"small",4),m(1,"Only the group will be deleted, the members will no longer be part of it."),a())}var yt=(()=>{let l=class l{constructor(){this.wasDeleted=new I,this.submitted=!1,this.icons={GROUPS:H.GROUPS,faMinus:ae,faUserMinus:pe},this.layout=x(V),this.adminService=x(R)}onSubmit(){this.submitted=!0;let n=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.adminService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.adminService.deleteGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",n,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",n,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,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"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"fw-bold","me-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"mx-1"]],template:function(o,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7),a()(),r(8,"button",5),_("click",function(){return e.onClose()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8),h(12,wt,1,1,"img",9)(13,Et,1,3,"fa-icon",10),a(),r(14,"span",11),m(15),v(16,"capitalize"),a(),r(17,"span",4),m(18,"will be removed"),a(),h(19,At,6,3,"div",7),a(),h(20,Dt,2,0,"small",4),a(),r(21,"div",12)(22,"button",13),_("click",function(){return e.onClose()}),m(23,"Cancel"),a(),r(24,"button",14),_("click",function(){return e.onSubmit()}),m(25," Remove "),a()()),o&2&&(s(2),c("icon",e.member.isUser?e.icons.faUserMinus:e.icons.faMinus),s(2),C(e.member.name),s(3),C(e.member.isUser?"Remove from group":"Delete group"),s(5),g(e.member.isUser?12:13),s(3),C(D(16,8,e.member.name)),s(4),g(e.member.isUser?19:-1),s(),g(e.member.isGroup?20:-1),s(4),c("disabled",e.submitted))},dependencies:[P,M,_t],encapsulation:2});let t=l;return t})();var Mt=(t,l)=>l.value;function Pt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span"),m(2),a()),t&2){let i=u();c("icon",i.icons.faPen),s(2),C(i.group.name)}}function Vt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span",23),m(2,"New group"),a()),t&2){let i=u();c("icon",i.icons.faPlus)}}function Rt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Ft(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Settings"),a()),t&2){let i=u();c("icon",i.icons.faCog)}}function Ut(t,l){if(t&1&&(r(0,"option",21),m(1),a()),t&2){let i=l.$implicit;c("ngValue",i.value),s(),C(i.key)}}function kt(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function Ot(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function It(t,l){t&1&&(r(0,"span",23),m(1,"The group is not visible, its members cannot see it and cannot see each other."),a())}function Bt(t,l){if(t&1&&(r(0,"div",24)(1,"div",18)(2,"label",34),m(3,"Creation date"),a(),r(4,"div",35),m(5),v(6,"amDateFormat"),a()(),r(7,"div",36)(8,"label",37),m(9,"Modification date"),a(),r(10,"div",38),m(11),v(12,"amDateFormat"),a()()()),t&2){let i=u();s(5),C(D(6,2,i.group.createdAt)),s(6),C(D(12,4,i.group.modifiedAt))}}function Nt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Permissions"),a()),t&2){let i=u();c("icon",i.icons.faShieldHalved)}}var we=(()=>{let l=class l{constructor(){this.group=null,this.parentGroup=null,this.groupChange=new I,this.locale=x(oe),this.layout=x(V),this.icons={GROUPS:H.GROUPS,faPen:me,faPlus:ce,faCog:qe,faShieldHalved:Ye},this.submitted=!1,this.originalOrderKeyValue=de,this.allVisibilities={Visible:z.VISIBLE,Private:z.PRIVATE,Isolated:z.ISOLATED},this.adminService=x(R)}ngOnInit(){this.groupForm=new ke({name:new j(this.group?.name||"",Fe.required),description:new j(this.group?.description||""),visibility:new j(this.group?.visibility||z.VISIBLE),applications:new j(this.group?.applications||[]),parent:new j(this.parentGroup)})}updateApplications(n){this.groupForm.controls.applications.setValue(n),this.groupForm.controls.applications.markAsDirty()}onSetParent(n){this.groupForm.controls.parent.setValue(n?{id:n.id,name:n.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(n){let o={search:n,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(o,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let n=this.makeDto();this.adminService.updateGroup(this.group.id,n).subscribe({next:o=>{this.groupChange.emit(["update",o]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}else{let n=this.makeDto(!0);this.adminService.createGroup(n).subscribe({next:o=>{this.groupChange.emit(["add",o]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}}makeDto(n=!1){let o;n?o=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):o=Object.fromEntries(Object.keys(this.groupForm.controls).filter(e=>this.groupForm.controls[e].dirty).map(e=>[e,this.groupForm.controls[e].value]));for(let e in o)switch(e){case"applications":o.permissions=o[e].join(et),delete o.applications;break;case"parent":o.parentId=o[e]?o[e].id:null,delete o.parent;break}return o}onError(n){this.layout.sendNotification("error","Group error",this.groupForm.value.name,n),this.submitted=!1}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-dialog"]],inputs:{group:"group",parentGroup:"parentGroup"},outputs:{groupChange:"groupChange"},decls:50,vars:24,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body","form-validation",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","formControlName","name","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","formControlName","description","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"d-flex","flex-column","align-items-start","col-12","pb-3"],[1,"col-6","pe-4"],["for","visibility","l10nTranslate",""],["id","visibility","formControlName","visibility",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],[1,"d-none","d-sm-block","fst-italic","fs-xxs"],["l10nTranslate",""],[1,"d-flex","align-items-start","col-12","pb-3"],["for","parent","translate",""],["id","parent",3,"data","searchFunction","active","itemIcon","placeholder"],[3,"permissionsChange","permissions"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","modified","l10nTranslate",""],["id","modified"]],template:function(o,e){if(o&1&&(r(0,"div",0)(1,"h4",1),h(2,Pt,3,2)(3,Vt,3,1),a(),h(4,Rt,3,0,"h4",2),r(5,"button",3),_("click",function(){return e.layout.closeDialog()}),a()(),r(6,"div",4)(7,"tabset",5),d(8,"hr",6),r(9,"tab",7),_("selectTab",function(){return e.tabView=null}),w(10,Ft,3,1,"ng-template",8),r(11,"div",9)(12,"div",10)(13,"div",11)(14,"label",12),m(15,"Name"),a(),d(16,"input",13),a(),r(17,"div",14)(18,"label",15),m(19,"Description"),a(),d(20,"input",16),a()(),r(21,"div",17)(22,"div",18)(23,"label",19),m(24,"Visibility"),a(),r(25,"select",20),B(26,Ut,2,2,"option",21,Mt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,kt,2,0,"span",23)(31,Ot,2,0,"span",23)(32,It,2,0,"span",23),a()(),r(33,"div",24)(34,"div",18)(35,"label",25),m(36,"Parent group"),a(),r(37,"app-select",26),v(38,"translate"),_("data",function(f){return e.onSetParent(f)}),a()()(),h(39,Bt,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),w(41,Nt,3,1,"ng-template",8),r(42,"div",9)(43,"div",10)(44,"app-admin-permissions",27),_("permissionsChange",function(f){return e.updateApplications(f)}),a()()()()()(),r(45,"div",28)(46,"button",29),_("click",function(){return e.layout.closeDialog()}),m(47,"Cancel"),a(),r(48,"button",30),_("click",function(){return e.onSubmit()}),m(49," Confirm "),a()()),o&2){let p;s(2),g(e.group?2:3),s(2),g(e.group?4:-1),s(),k(Ae("btn-close btn-close-white ",e.group?"ms-2":"ms-auto"," ms-2")),s(),c("formGroup",e.groupForm),s(),c("justified",!0),s(9),U("is-invalid",e.groupForm.controls.name.invalid),c("autoSelect",!1),s(10),N(T(28,18,e.allVisibilities,e.originalOrderKeyValue)),s(4),g((p=e.groupForm.value.visibility)===e.allVisibilities.Visible?30:p===e.allVisibilities.Private?31:p===e.allVisibilities.Isolated?32:-1),s(7),c("searchFunction",e.searchGroups.bind(e))("active",e.groupForm.value.parent)("itemIcon",e.icons.GROUPS)("placeholder",T(38,21,"Select the parent group",e.locale.language)),s(2),g(e.group?39:-1),s(5),c("permissions",e.groupForm.value.applications),s(4),c("disabled",e.submitted||e.groupForm.invalid)}},dependencies:[P,M,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,rt,ft,vt,ct,ut,pt,te,re,_e],encapsulation:2});let t=l;return t})();var St=(()=>{let l=class l{constructor(){this.layout=x(V),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=K,this.icons={faUserPen:Qe,faKey:le},this.adminService=x(R)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let n=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:n}).subscribe({next:()=>{this.user.setGroupRole(n),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,o)}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,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"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(o,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Edit user"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ee("ngModelChange",function(f){return Z(e.isManager,f)||(e.isManager=f),f}),a(),r(15,"span",4),m(16,"Set as group manager"),a(),d(17,"fa-icon",12),a()()()(),r(18,"small",4),m(19,"As a manager, the user will be able to manage group members but not group properties."),a()(),r(20,"div",13)(21,"button",14),_("click",function(){return e.layout.closeDialog()}),m(22,"Cancel"),a(),r(23,"button",15),_("click",function(){return e.onSubmit()}),m(24," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPen),s(2),C(e.user.name),s(10),X("ngModel",e.isManager),s(3),c("icon",e.icons.faKey),s(6),c("disabled",e.submitted))},dependencies:[P,M,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var $t=["MainContextMenu"],Lt=["TargetContextMenu"],Tt=(t,l)=>l.key,jt=(t,l)=>l.mid;function Kt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let o=u();return G(o.openDialog(!0))}),r(3,"span",14),d(4,"fa-icon",7),m(5),a()()(),r(6,"li",27)(7,"a",28),_("click",function(){y(i);let o=u();return G(o.addUserToGroupDialog())}),r(8,"span",14),d(9,"fa-icon",7),m(10,"Add members"),a()()()()}if(t&2){let i=u();s(2),U("disabled",!!i.currentGroup&&i.personalGroupsView),s(2),c("icon",i.icons.GROUPS),s(),$(" ",i.personalGroupsView?"Personal group":"Group"),s(2),U("disabled",!i.currentGroup),s(2),c("icon",i.icons.faUserPlus)}}function Ht(t,l){if(t&1&&d(0,"fa-icon",31),t&2){let i=u(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function Qt(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let o=u().$implicit,e=u();return G(e.sortBy(o.key))}),m(1),h(2,Ht,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,n=u();k(i.value.class),Ce("width",i.value.width,"%"),U("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),s(),$(" ",i.value.label," "),s(),g(n.sortTable.sortParam.column===i.key?2:-1)}}function qt(t,l){if(t&1&&h(0,Qt,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function Wt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function zt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,n=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",n.icons.GROUPS)}}function Yt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Jt(t,l){if(t&1&&(r(0,"div",34),h(1,Wt,1,1,"img",36)(2,zt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,Yt,1,1,"fa-icon",39),a(),r(7,"span",40),m(8),a()()()),t&2){let i=u(3).$implicit;s(),g(i.isUser?1:2),s(4),$(" ",i.name," "),s(),g(i.isUser&&i.isGroupManager?6:-1),s(2),C(i.description)}}function Xt(t,l){if(t&1&&(r(0,"span"),m(1),v(2,"joinCounts"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.counts))}}function Zt(t,l){if(t&1&&h(0,Xt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function ei(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ti(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ii(t,l){if(t&1&&h(0,ei,2,0,"span",14)(1,ti,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ni(t,l){if(t&1&&(r(0,"div"),m(1),v(2,"amDateFormat"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.modifiedAt))}}function oi(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ni,3,3,"div"),a()),t&2){let i=u(3).$implicit;s(2),C(D(3,2,i.createdAt)),s(2),g(i.modifiedAt?4:-1)}}function ri(t,l){if(t&1&&(r(0,"td"),h(1,Jt,9,4,"div",34)(2,Zt,1,1)(3,ii,2,1)(4,oi,5,4,"div",35),a()),t&2){let i,n=u().$implicit,o=u().$implicit;k(De("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),Ce("width",n.value.width,"%"),U("text-align-center",n.value.textCenter),s(),g((i=n.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ai(t,l){if(t&1&&h(0,ri,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function li(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let o=y(i).$implicit,e=u();return G(e.onSelect(o))})("contextmenu",function(o){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(o,e))})("appTap",function(){let o=y(i).$implicit,e=u();return G(e.browse(o))}),B(1,ai,1,1,null,null,Tt),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,n=u();U("selected",i.mid===(n.selected==null?null:n.selected.mid)),s(),N(T(3,2,n.tableHeaders,n.originalOrderKeyValue))}}function si(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPlus),s(),$(" ",i.personalGroupsView?"Personal group":"Group")}}function mi(t,l){if(t&1){let i=A();w(0,si,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog(!0))})}}function pi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Add members"),a()),t&2){let i=u(2);s(),c("icon",i.icons.faUserPlus)}}function ci(t,l){if(t&1){let i=A();w(0,pi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.addUserToGroupDialog())})}}function ui(t,l){}function di(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Refresh"),a()),t&2){let i=u();s(),c("icon",i.icons.faArrowRotateRight)}}function _i(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPen),s(),$(" ",i.selected.isGroup?"Edit group":"Edit user")}}function fi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Delete group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faMinus)}}function hi(t,l){if(t&1){let i=A();w(0,fi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function gi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Remove from group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faUserMinus)}}function bi(t,l){if(t&1){let i=A();w(0,gi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function Ci(t,l){if(t&1){let i=A();w(0,_i,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog())}),h(1,hi,1,0,null,23)(2,bi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var ao=(()=>{let l=class l{constructor(){this.locale=x(oe),this.originalOrderKeyValue=de,this.icons={GROUPS:H.GROUPS,faRotate:Ke,faPlus:ce,faMinus:ae,faPen:me,faArrowDown:Xe,faArrowUp:We,faKey:le,faUserPlus:se,faUserMinus:pe,faArrowRotateRight:Je,faToggleOn:ze,faToggleOff:He},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"",show:!0,sortable:!0},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},createdAndModified:{label:"Created & Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.personalGroupsView=!1,this.loading=!1,this.selected=null,this.members=[],this.router=x(Pe),this.activatedRoute=x(Me),this.layout=x(V),this.adminService=x(R),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],createdAndModified:[{prop:"modifiedAt",type:"date"},{prop:"createdAt",type:"date"}]},this.sortTable=new mt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(n=>{this.personalGroupsView=n.type===ue.PERSONAL,this.setEnv(n.routes)}),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(n){this.personalGroupsView=n,this.router.navigate([S.BASE,n?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(n){n.isGroup&&this.router.navigate([n.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(n=null){this.selected=n}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)}sortBy(n,o=!0,e){this.members=this.sortTable.sortBy(n,o,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(xt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(o=>o.isUser).map(o=>o.id)}}).content.hasChanges.pipe(be(o=>o),O(1)).subscribe(()=>this.refresh())}openDialog(n=!1,o=!1){n?this.personalGroupsView?this.layout.openDialog(Te,"md").content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="add"&&(b.setGroupRole(K.MANAGER),b.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(b)),this.onSelect(b))}):this.layout.openDialog(we,"md",{initialState:{parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;if(f==="add")if(!this.currentGroup&&!b?.parent||b.parent.id===this.currentGroup.id){let F=new ye(ge(he({},b),{type:xe.GROUP}));this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(new ye(ge(he({},b),{type:xe.GROUP})))),this.onSelect(F)}else this.router.navigate([`${S.BASE}/${S.GROUPS}`,b.parent?.id?b.parent.name:""],{queryParams:{select:b.name}}).catch(console.error)}):o?this.layout.openDialog(yt,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(be(p=>p),O(1)).subscribe(()=>{this.currentGroup?this.selected.counts?.groups?this.loadGroups(this.currentGroup.name):(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()):this.loadGroups()}):this.selected.isGroup?this.personalGroupsView?this.layout.openDialog(Te,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="update"&&(this.selected=Object.assign(this.selected,{name:b.name,description:b.description,modifiedAt:b.modifiedAt}))}):this.adminService.getGroup(this.selected.id).subscribe({next:e=>{this.layout.openDialog(we,"md",{initialState:{group:e,parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(f=>{let[b,F]=f;b==="update"&&(!this.currentGroup&&!F?.parent||F.parent.id===this.currentGroup.id?this.selected=Object.assign(this.selected,F):this.router.navigate([`${S.BASE}/${S.GROUPS}`,F.parent?.id?F.parent.name:""],{queryParams:{select:F.name}}).catch(console.error))})},error:e=>this.layout.sendNotification("error","Edit group",this.selected.name,e)}):this.layout.openDialog(St,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(n){let o;n.length?(o=n[n.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(n)}`:`/${S.BASE}/${S.GROUPS}${ve(n)}`,firstLink:`/${S.BASE}/${S.GROUPS}`,splicing:1,translating:!0,sameLink:!1,mutateLevel:{0:{setTitle:this.personalGroupsView?Y.PGROUPS:Y.GROUPS,translateTitle:!0}}})):this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}/${Y.PGROUPS}`:`/${S.BASE}/${S.GROUPS}/${Y.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}loadGroups(n){this.loading=!0,this.onSelect(),this.adminService.browseGroup(n,this.personalGroupsView).subscribe({next:o=>{this.currentGroup=o.parentGroup,this.sortBy(this.sortTable.sortParam.column,!1,o.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:o=>{this.members=[],this.layout.sendNotification("error","Groups",o.error.message),this.onSelect(),this.loading=!1}})}focusOn(n){let o=this.members.find(e=>e.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(o,e){if(o&1&&(Q(Se,5),Q(Ge,7),Q($t,7),Q(Lt,7)),o&2){let p;q(p=W())&&(e.scrollView=p.first),q(p=W())&&(e.inputFilter=p.first),q(p=W())&&(e.mainContextMenu=p.first),q(p=W())&&(e.targetContextMenu=p.first)}},decls:48,vars:42,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"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],[3,"icon"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["contextMenuItem","",3,"execute"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["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"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,e){if(o&1){let p=A();r(0,"div",2)(1,"button",3),v(2,"translate"),_("click",function(){return y(p),G(e.refresh())}),d(3,"fa-icon",4),a(),r(4,"div",5)(5,"button",6),v(6,"translate"),d(7,"fa-icon",7),a(),w(8,Kt,11,7,"ul",8),a(),r(9,"button",9),v(10,"translate"),_("click",function(){return y(p),G(e.openDialog(!1,!0))}),d(11,"fa-icon",7),a(),r(12,"button",9),v(13,"translate"),_("click",function(){return y(p),G(e.openDialog())}),d(14,"fa-icon",7),a(),r(15,"div",10)(16,"button",11),_("ngModelChange",function(b){return y(p),G(e.onPersonalGroupsView(b))}),r(17,"div",12),d(18,"fa-icon",13),r(19,"span",14),m(20,"Personal groups"),a()()(),r(21,"div",15),d(22,"app-input-filter",16),a()()(),r(23,"table",17)(24,"thead")(25,"tr"),B(26,qt,1,1,null,null,Tt),v(28,"keyvalue"),a()()(),r(29,"app-virtual-scroll",18),v(30,"searchFilter"),_("contextmenu",function(b){return y(p),G(e.onContextMenu(b))}),r(31,"table",17)(32,"tbody",19),B(33,li,4,5,"tr",20,jt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,mi,1,0,null,23),h(42,ci,1,0,null,23),w(43,ui,0,0,"ng-template",24)(44,di,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,Ci,3,1),a()}o&2&&(s(),c("tooltip",T(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",T(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",T(10,27,e.selected!=null&&e.selected.isUser?"Remove from group":"Delete group",e.locale.language)),s(2),c("icon",e.icons.faMinus),s(),c("disabled",!e.selected)("tooltip",T(13,30,e.selected!=null&&e.selected.isGroup?"Edit group":"Edit user",e.locale.language)),s(2),c("icon",e.icons.faPen),s(2),c("ngModel",e.personalGroupsView),s(2),c("icon",e.personalGroupsView?e.icons.faToggleOn:e.icons.faToggleOff),s(8),N(T(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",T(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",T(38,39,"groups",e.locale.language)),s(4),g(e.currentGroup&&!e.personalGroupsView||!e.currentGroup&&e.personalGroupsView?41:-1),s(),g(e.currentGroup?42:-1),s(),c("divider",!0),s(4),g(e.selected?47:-1))},dependencies:[ot,nt,it,P,M,Ge,Se,je,ht,bt,gt,at,ne,L,ie,lt,te,re,st,Ct,_e],encapsulation:2});let t=l;return t})();export{ao as AdminGroupsComponent};
@@ -0,0 +1 @@
1
+ import{n as r}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-N3U6637P.js";var M={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function e(n,t,_){var a=M[_];return Array.isArray(a)&&(a=a[t?0:1]),a.replace("%d",n)}var i={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_M\xE4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xE4rz_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e}};r.locale(i,null,!0);var d=i;export{d as default};
@@ -0,0 +1 @@
1
+ import{e as oe}from"./chunk-VM4YX6Q7.js";import{b as ne}from"./chunk-SHIVUDP3.js";import{d as H}from"./chunk-UJPPR4MX.js";import{n as se,o as I}from"./chunk-HNQRZALS.js";import{B as A,C as W,E as v,Sa as te,Sb as d,Ya as ie,ka as E,kb as re,la as u,ma as K,na as f,oa as Q,pa as a,qa as X,ra as Y,sa as Z,ta as ee,z as R}from"./chunk-GUGNR5TF.js";import{$a as C,Ab as D,Cd as q,Db as k,Dd as z,Fb as g,G as w,Na as S,Pa as O,Qb as U,Rc as F,Sb as L,da as P,ec as $,fc as B,gc as j,ia as c,mb as N,na as x,oa as T,ob as b,pb as G,qb as y,rb as _,sb as l,v as o,xd as V}from"./chunk-C36MW4ME.js";import{n as J}from"./chunk-DM4NXKEP.js";var m=class{constructor(i){this.isAdmin=!1,this.newly=0,this.applications=[],this.currentAccessHover=!1,this.setGroups(i),this.setManagers(i),Object.assign(this,i),this.isAdmin=i.role===R.ADMINISTRATOR,this.userRoleText=ie(R[i.role]),this.avatarUrl=re(i.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=J(this.currentAccess).fromNow(!0),this.newly=te(this.currentAccess),this.permissions&&(this.applications=this.permissions.split(A))}setGroups(i){i?.groups&&(i.groups=i.groups.map(p=>new d(p)))}setManagers(i){i?.managers&&(i.managers=i.managers.map(p=>new d(p)))}};var h=class{constructor(i){Object.assign(this,i),this.permissions&&(this.applications=this.permissions.split(A))}};var Te=(()=>{let i=class i{constructor(){this.http=c(F),this.router=c(H),this.authService=c(ne)}listUsers(e=!1){return this.http.get(e?Q:K).pipe(o(t=>t.map(r=>new m(r))))}getUser(e,t=!1){return this.http.get(`${t?f:u}/${e}`).pipe(o(r=>t?new I(r):new m(r)))}createUser(e,t,r=!1){return this.http.post(r?f:u,e,{headers:t}).pipe(o(n=>r?new I(n):new m(n)))}updateUser(e,t,r,n=!1){return this.http.put(`${n?f:u}/${e}`,t,{headers:r}).pipe(o(M=>n?new I(M):new m(M)))}deleteUser(e,t,r){return this.http.request("delete",`${t.isGuest?f:u}/${e}`,{headers:r,body:t})}browseGroup(e,t=!1){return this.http.get(`${t?Y:X}${e?`/${e}`:""}`).pipe(o(r=>new se(r)))}getGroup(e){return this.http.get(`${a}/${e}`).pipe(o(t=>new h(t)))}createGroup(e){return this.http.post(a,e).pipe(o(t=>new h(t)))}updateGroup(e,t){return this.http.put(`${a}/${e}`,t).pipe(o(r=>new h(r)))}deleteGroup(e){return this.http.delete(`${a}/${e}`)}addUsersToGroup(e,t){return this.http.patch(`${a}/${e}/${E.USERS}`,t)}updateUserFromGroup(e,t,r){return this.http.patch(`${a}/${e}/${E.USERS}/${t}`,r)}removeUserFromGroup(e,t){return this.http.delete(`${a}/${e}/${E.USERS}/${t}`)}searchMembers(e,t=!1){return this.http.request("search",Z,{body:e}).pipe(o(r=>r.map(n=>(t&&delete n.description,new d(n)))),w(()=>[]))}impersonateUser(e,t){return this.http.post(`${ee}/${e}`,null,{headers:t})}initImpersonateUser(e){this.authService.initUserFromResponse(e,!0),this.router.navigate([v.BASE,v.ACCOUNT]).catch(console.error)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=P({token:i,factory:i.\u0275fac,providedIn:"root"});let s=i;return s})();function ae(s,i){if(s&1){let p=D();_(0,"div",3)(1,"label",4)(2,"input",5),k("change",function(t){let r=x(p).$implicit,n=g();return T(n.updatePermissions(r,t))}),l(),U(3),$(4,"translate"),$(5,"capitalize"),l()()}if(s&2){let p=i.$implicit,e=g();S(2),y("checked",e.permissions.indexOf(p)>-1)("value",p),S(),L(" ",B(5,6,j(4,3,p,e.locale.language))," ")}}var Le=(()=>{let i=class i{constructor(){this.permissions=[],this.permissionsChange=new O,this.locale=c(V),this.allApplications=Object.values(W)}updatePermissions(e,t){t.target.checked?this.permissions.push(e):this.permissions.splice(this.permissions.indexOf(e),1),this.permissionsChange.emit(this.permissions)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=C({type:i,selectors:[["app-admin-permissions"]],inputs:{permissions:"permissions"},outputs:{permissionsChange:"permissionsChange"},decls:6,vars:0,consts:[[1,"d-flex","flex-column","col-12","pb-3"],["for","permissions","l10nTranslate",""],["id","permissions",1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"change","checked","value"]],template:function(t,r){t&1&&(_(0,"div",0)(1,"label",1),U(2,"Permissions"),l(),_(3,"div",2),b(4,ae,6,8,"div",3,N),l()()),t&2&&(S(4),G(r.allApplications))},dependencies:[z,oe,q],encapsulation:2});let s=i;return s})();export{m as a,Te as b,Le as c};
@@ -0,0 +1 @@
1
+ import{a as z}from"./chunk-AY2SZ3G6.js";import"./chunk-HAS5ZOTR.js";import{a as L,b as Q,c as xe,d as Ce,e as he}from"./chunk-H6NE33VX.js";import{g as fe}from"./chunk-VKK5BSLX.js";import"./chunk-3XVM35O2.js";import{d as W}from"./chunk-UJPPR4MX.js";import{Ib as ue,Jb as $,Kb as O,Ma as se,Sa as ce,Za as pe,mb as _e,pb as me,r as X,s as Y,va as re,wa as ae,xa as le,yb as de}from"./chunk-GUGNR5TF.js";import{$a as D,Ab as y,Cd as J,Db as x,Dd as G,Fb as a,Ic as U,If as ee,Jb as b,Kb as V,Lb as M,Na as l,Nb as g,Ob as F,Pb as N,Qb as d,Rb as B,Sb as v,Tb as q,Ue as Z,Uf as te,Zb as K,_f as ie,dg as oe,eb as k,ec as f,gc as T,ia as S,jb as H,kb as C,lb as h,na as _,oa as m,ob as P,pb as E,qb as u,rb as s,sb as c,tb as w,xd as j}from"./chunk-C36MW4ME.js";import{n as ne}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-N3U6637P.js";var I=class{constructor(r){this.newly=0,this.isPersonal=!1,Object.assign(this,r),this.isPersonal=this.alias===me.PERSONAL,this.hTimeAgo=ne(this.mtime).fromNow(!0),this.newly=ce(this.mtime)}};var ge=["MainContextMenu"],ye=["TargetContextMenu"],Te=(t,r)=>r.id,we=(t,r)=>r.key;function ve(t,r){if(t&1&&(s(0,"span",25),d(1),c()),t&2){let e=a().$implicit,i=a(2);g("font-size",i.galleryMode.textSize,"px"),l(),B(e.hTimeAgo)}}function Se(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a().$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function be(t,r){if(t&1&&d(0),t&2){let e=a().$implicit;v(" ",e.name," ")}}function Ve(t,r){if(t&1){let e=y();s(0,"div",16),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,p=a(2);return m(p.onTargetContextMenu(n,o))})("appTap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),s(1,"div",17),w(2,"fa-icon",18),s(3,"span",19),C(4,ve,2,3,"span",20),c(),s(5,"span",21)(6,"span",22),d(7),c()()(),s(8,"div",23)(9,"span",24),C(10,Se,2,4)(11,be,1,1),c()()()}if(t&2){let e=r.$implicit,i=r.$index,n=a(2);g("height",n.galleryMode.dimensions,"px")("width",n.galleryMode.dimensions,"px"),F("selected",e.id===(n.selected==null?null:n.selected.id)),l(),H("rowIndex",i),l(),g("min-width",n.galleryMode.image,"px")("min-height",n.galleryMode.image,"px")("font-size",n.galleryMode.faSize,"px"),u("icon",e.isPersonal?n.icons.PERSONAL:n.icons.SPACES),l(2),h(e.newly?4:-1),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),B(e.nb),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),h(e.isPersonal?10:11)}}function Me(t,r){if(t&1){let e=y();s(0,"div",9)(1,"app-virtual-scroll",13),f(2,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(3,"div",14),P(4,Ve,12,21,"div",15,Te),c()()()}if(t&2){let e=a();l(),u("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",T(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),l(3),E(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Pe(t,r){if(t&1&&w(0,"fa-icon",32),t&2){let e=a(4);u("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Ee(t,r){if(t&1){let e=y();s(0,"th",31),x("click",function(){_(e);let n=a().$implicit,o=a(2);return m(o.sortBy(n.key))}),d(1),C(2,Pe,1,2,"fa-icon",32),c()}if(t&2){let e=a().$implicit,i=a(2);N(e.value.class),g("width",e.value.width,"%"),F("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),l(),v(" ",e.value.label," "),l(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Fe(t,r){if(t&1&&C(0,Ee,3,10,"th",30),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Ae(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a(4).$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function Be(t,r){if(t&1&&d(0),t&2){let e=a(4).$implicit;v(" ",e.name," ")}}function $e(t,r){if(t&1&&(s(0,"div",35),w(1,"fa-icon",18),s(2,"span",24),C(3,Ae,2,4)(4,Be,1,1),c()()),t&2){let e=a(3).$implicit,i=a(2);l(),u("icon",e.isPersonal?i.icons.PERSONAL:i.icons.SPACES),l(2),h(e.isPersonal?3:4)}}function Ie(t,r){if(t&1&&(s(0,"span",22),d(1),c()),t&2){let e=a(3).$implicit;l(),B(e.nb)}}function Re(t,r){if(t&1&&d(0),t&2){let e=a(3).$implicit;v(" ",e.hTimeAgo," ")}}function ke(t,r){if(t&1&&(s(0,"td"),C(1,$e,5,2,"div",35)(2,Ie,2,1,"span",22)(3,Re,1,1),c()),t&2){let e,i=a().$implicit,n=a().$implicit;N(K("",i.value.class," ",i.value.newly?"prop-newly-"+n[i.value.newly]:"")),g("width",i.value.width,"%"),F("text-align-center",i.value.textCenter),l(),h((e=i.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function Ne(t,r){if(t&1&&C(0,ke,4,9,"td",34),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Oe(t,r){if(t&1){let e=y();s(0,"tr",33),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,p=a(2);return m(p.onTargetContextMenu(n,o))})("appTap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),P(1,Ne,1,1,null,null,we),f(3,"keyvalue"),c()}if(t&2){let e=r.$implicit,i=a(2);F("selected",e.id===(i.selected==null?null:i.selected.id)),l(),E(T(3,2,i.tableHeaders,i.originalOrderKeyValue))}}function Le(t,r){if(t&1){let e=y();s(0,"table",26)(1,"thead")(2,"tr"),P(3,Fe,1,1,null,null,we),f(5,"keyvalue"),c()()(),s(6,"app-virtual-scroll",27),f(7,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(8,"table",26)(9,"tbody",28),P(10,Oe,4,5,"tr",29,Te),c()()()}if(t&2){let e=a();l(3),E(T(5,2,e.tableHeaders,e.originalOrderKeyValue)),l(3),u("bufferAmount",5)("items",T(7,5,e.trashBins,e.inputFilter.search())),l(4),E(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Qe(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Refresh"),c()),t&2){let e=a();l(),u("icon",e.icons.faArrowRotateRight)}}function ze(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Informations"),c()),t&2){let e=a();l(),u("icon",e.icons.faCircleInfo)}}var ft=(()=>{let r=class r{constructor(){this.locale=S(j),this.layout=S(de),this.originalOrderKeyValue=pe,this.icons={SPACES:$.SPACES,PERSONAL:$.PERSONAL,faArrowDown:te,faArrowUp:Z,faArrowRotateRight:ee,faCircleInfo:ie},this.TAB_MENU=se,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"",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",nb:"Elements",mtime:"Modified"},this.router=S(W),this.store=S(_e),this.spacesService=S(fe),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new he(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon($.TRASH),this.layout.setBreadcrumbNav({url:`/${O.TRASH}/${ue.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i.map(n=>new I(n))),this.loading=!1}})}onSelect(i=null){this.selected=i,this.store.trashSelection.set(this.selected)}sortBy(i,n=!0,o){this.trashBins=this.sortTable.sortBy(i,n,o||this.trashBins)}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,n){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(i,this.targetContextMenu)}browse(i){this.router.navigate([O.SPACES_TRASH,i.alias]).catch(console.error)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=D({type:r,selectors:[["app-spaces-trash"]],viewQuery:function(n,o){if(n&1&&(b(Q,5),b(L,7),b(z,7),b(ge,7),b(ye,7)),n&2){let p;V(p=M())&&(o.scrollView=p.first),V(p=M())&&(o.inputFilter=p.first),V(p=M())&&(o.btnNavigationView=p.first),V(p=M())&&(o.mainContextMenu=p.first),V(p=M())&&(o.targetContextMenu=p.first)}},decls:20,vars:14,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"],[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"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"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-right"],[1,"badge","rounded-pill","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"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"],["l10nTranslate",""],[3,"icon"]],template:function(n,o){if(n&1){let p=y();s(0,"div",2)(1,"button",3),f(2,"translate"),x("click",function(){return _(p),m(o.loadTrashBins())}),w(3,"fa-icon",4),c(),s(4,"div",5)(5,"div",6),w(6,"app-input-filter",7),c(),s(7,"app-navigation-view",8),x("sortBy",function(R){return _(p),m(o.sortBy(R))})("switchView",function(R){return _(p),m(o.galleryMode=R)}),c()()(),C(8,Me,6,8,"div",9)(9,Le,12,8),s(10,"context-menu",null,0),k(12,Qe,3,1,"ng-template",10),x("execute",function(){return _(p),m(o.loadTrashBins())}),c(),s(13,"context-menu",null,1),k(15,ze,3,1,"ng-template",10),x("execute",function(){return _(p),m(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),c(),s(16,"div",11)(17,"span",12),d(18),f(19,"translate"),c()()}n&2&&(l(),u("tooltip",T(2,8,"Refresh",o.locale.language)),l(2),u("icon",o.icons.faArrowRotateRight)("animation",o.loading?"spin":null),l(4),u("sortParams",o.sortTable.sortParam)("sortFields",o.btnSortFields),l(),h(o.galleryMode!=null&&o.galleryMode.enabled?8:9),l(10),q("",o.trashBins.length," ",T(19,11,"trash bins",o.locale.language)))},dependencies:[oe,z,L,Y,X,Q,G,le,ae,re,xe,J,U,Ce],encapsulation:2});let t=r;return t})();export{ft as TrashComponent};
@@ -1 +1 @@
1
- import{x as xe,z as Se}from"./chunk-5K7HEX3C.js";import{a as be}from"./chunk-5KLMS6A4.js";import{g as ge}from"./chunk-ZKCFO2OA.js";import{g as Ce}from"./chunk-4YGJGZZZ.js";import{q as fe,r as _e}from"./chunk-EWKSX76T.js";import{Aa as le,Fa as ce,Kb as de,Mb as ue,Sb as he,_a as pe,eb as y,v as te,w as ie,zb as me}from"./chunk-XLCCZSQL.js";import{Ad as J,Cb as h,Eb as r,Ga as V,Gc as Q,Gd as Z,Hd as ee,Ib as $,Jb as L,Jf as re,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,_c as F,bb as T,dc as C,ec as q,ef as ne,f as A,fc as x,fd as z,ha as b,jb as f,kb as _,kd as Y,ma as S,na as v,nb as w,nf as oe,ob as P,pb as p,qb as l,rb as c,rf as ae,sb as m,ya as B,yd as G,yf as se,zb as E}from"./chunk-ATP3BFHV.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let o=class o{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new T(!0),this.renamingInProgress=new T(!0),this.elementRef=b(B),this.renderer=b(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275dir=U({type:o,selectors:[["","appInputEdit",""]],hostBindings:function(t,a){t&1&&h("blur",function(){return a.onBlur()})("keyup.enter",function(){return a.onEnter()})("keyup.esc",function(){return a.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=o;return i})();var Ee=["InputRename"],Fe=(i,o)=>o.alias,Te=(i,o)=>o.key;function we(i,o){if(i&1&&m(0,"app-user-avatar",14)(1,"div",9),i&2){let n=r().$implicit;p("user",n.owner)}}function Pe(i,o){if(i&1){let n=E();l(0,"input",15,0),h("updateObject",function(t){S(n);let a=r(2);return v(a.onRenameRoot(t))}),c()}if(i&2){let n=r().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,o){if(i&1&&(l(0,"span"),d(1),c()),i&2){let n=r(2).$implicit;s(),g(n.externalPath)}}function Me(i,o){if(i&1&&(l(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=r(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,o){if(i&1&&(l(0,"div",16)(1,"span"),d(2),c()(),l(3,"div",17),f(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=r().$implicit,e=r();s(2),g(n.name),s(2),_(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,o){if(i&1&&(l(0,"div",7)(1,"div",18),d(2),c(),l(3,"div",18),d(4),C(5,"amTimeAgo"),c()()),i&2){let n=r().$implicit;s(2),g(n.alias),s(2),g(q(5,2,n.createdAt))}}function De(i,o){if(i&1){let n=E();l(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let a=r().$implicit,u=r().$implicit;return H(u.hPerms[a.key],t)||(u.hPerms[a.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=r(2).$implicit,a=r();return v(a.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=r().$implicit,e=r().$implicit,t=r();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,o){if(i&1&&(l(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=r().$implicit,e=r().$implicit,t=r();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function je(i,o){if(i&1&&f(0,De,3,9,"button",19)(1,Ae,3,7,"button",20),i&2){let n=r().$implicit,e=r();_(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function Be(i,o){if(i&1){let n=E();l(0,"div",1)(1,"div",2)(2,"div",3),f(3,we,2,1),m(4,"img",4),l(5,"div",5),f(6,Pe,2,2,"input",6)(7,ke,6,2),c()(),f(8,Oe,6,4,"div",7),l(9,"div",8),m(10,"div",9),w(11,je,2,1,null,null,Te),C(13,"keyvalue"),m(14,"div",10),l(15,"button",11),C(16,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.setRenamed(t))}),m(17,"fa-icon",12),c(),l(18,"button",13),C(19,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.removeRoot(t))}),m(20,"fa-icon",12),c()()()()}if(i&2){let n=o.$implicit,e=r();s(3),_(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),_(n.isRenamed?6:7),s(2),_(e.showInfos?8:-1),s(3),P(x(13,14,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(16,17,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(19,20,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let o=class o{constructor(){this.showInfos=!0,this.showUsers=!0,this.addRootFile=null,this.locale=b(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(a=>a.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(a=>a.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-manage-roots"]],viewQuery:function(t,a){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(a.inputRename=u.first)}},inputs:{space:"space",user:"user",showInfos:"showInfos",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],[1,"d-flex","justify-content-end"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,a){t&1&&w(0,Be,21,23,"div",1,Fe),t&2&&P(a.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=o;return i})();function Ve(i,o){if(i&1&&m(0,"fa-icon",3),i&2){let n=r();p("icon",n.icons.faSpinner)}}function Ne(i,o){i&1&&(l(0,"span",5),d(1,"You have no files anchored on this space"),c())}var wt=(()=>{let o=class o{constructor(){this.layout=b(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=b(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-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"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,a){t&1&&(l(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),l(3,"span"),d(4),c()(),f(5,Ve,1,1,"fa-icon",3),l(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),l(9,"button",6),h("click",function(){return a.layout.closeDialog()}),c()(),l(10,"div",7),m(11,"app-space-manage-roots",8),f(12,Ne,2,0,"span",5),c(),l(13,"div",9)(14,"button",10),h("click",function(){return a.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),l(18,"button",12),h("click",function(){return a.layout.closeDialog()}),d(19,"Cancel"),c(),l(20,"button",13),h("click",function(){return a.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",a.icons.SPACES),s(2),g(a.space.name),s(),_(a.loading?5:-1),s(6),p("space",a.space)("user",a.user)("showUsers",!1)("addRootFile",a.addRootFileEvent),s(),_(a.space.roots.length?-1:12),s(3),p("icon",a.icons.faPlus),s(),p("icon",a.icons.faAnchor),s(4),p("disabled",a.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=o;return i})();export{ye as a,Re as b,wt as c};
1
+ import{x as xe,z as Se}from"./chunk-WJW7CT6G.js";import{a as be}from"./chunk-TPYBFZS5.js";import{g as ge}from"./chunk-X5XGK6T7.js";import{g as Ce}from"./chunk-VKK5BSLX.js";import{q as fe,r as _e}from"./chunk-HNQRZALS.js";import{Ea as ce,Jb as de,Lb as ue,Rb as he,Za as pe,db as y,r as te,s as ie,yb as me,za as le}from"./chunk-GUGNR5TF.js";import{$a as R,Ab as E,Cd as Z,Db as h,Dd as ee,Fb as r,Gf as re,Ha as V,Ic as Q,Jb as $,Kb as L,L as j,Lb as W,Na as s,Ob as I,Pa as T,Pb as M,Qb as d,Rb as g,Ub as K,Va as N,Vb as H,Wb as X,Yb as k,bb as U,bf as ne,cd as z,dg as F,ec as C,f as A,fc as q,gc as x,hd as Y,ia as b,kb as f,kf as oe,lb as _,na as S,oa as v,ob as w,of as ae,pb as P,qb as p,rb as l,sb as c,tb as m,vd as G,vf as se,xd as J,za as B}from"./chunk-C36MW4ME.js";import{a as O,b as D}from"./chunk-N3U6637P.js";var ye=(()=>{let o=class o{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new T(!0),this.renamingInProgress=new T(!0),this.elementRef=b(B),this.renderer=b(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275dir=U({type:o,selectors:[["","appInputEdit",""]],hostBindings:function(t,a){t&1&&h("blur",function(){return a.onBlur()})("keyup.enter",function(){return a.onEnter()})("keyup.esc",function(){return a.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=o;return i})();var Ee=["InputRename"],Fe=(i,o)=>o.alias,Te=(i,o)=>o.key;function we(i,o){if(i&1&&m(0,"app-user-avatar",14)(1,"div",9),i&2){let n=r().$implicit;p("user",n.owner)}}function Pe(i,o){if(i&1){let n=E();l(0,"input",15,0),h("updateObject",function(t){S(n);let a=r(2);return v(a.onRenameRoot(t))}),c()}if(i&2){let n=r().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,o){if(i&1&&(l(0,"span"),d(1),c()),i&2){let n=r(2).$implicit;s(),g(n.externalPath)}}function Me(i,o){if(i&1&&(l(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=r(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,o){if(i&1&&(l(0,"div",16)(1,"span"),d(2),c()(),l(3,"div",17),f(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=r().$implicit,e=r();s(2),g(n.name),s(2),_(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,o){if(i&1&&(l(0,"div",7)(1,"div",18),d(2),c(),l(3,"div",18),d(4),C(5,"amTimeAgo"),c()()),i&2){let n=r().$implicit;s(2),g(n.alias),s(2),g(q(5,2,n.createdAt))}}function De(i,o){if(i&1){let n=E();l(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let a=r().$implicit,u=r().$implicit;return H(u.hPerms[a.key],t)||(u.hPerms[a.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=r(2).$implicit,a=r();return v(a.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=r().$implicit,e=r().$implicit,t=r();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,o){if(i&1&&(l(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=r().$implicit,e=r().$implicit,t=r();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function je(i,o){if(i&1&&f(0,De,3,9,"button",19)(1,Ae,3,7,"button",20),i&2){let n=r().$implicit,e=r();_(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function Be(i,o){if(i&1){let n=E();l(0,"div",1)(1,"div",2)(2,"div",3),f(3,we,2,1),m(4,"img",4),l(5,"div",5),f(6,Pe,2,2,"input",6)(7,ke,6,2),c()(),f(8,Oe,6,4,"div",7),l(9,"div",8),m(10,"div",9),w(11,je,2,1,null,null,Te),C(13,"keyvalue"),m(14,"div",10),l(15,"button",11),C(16,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.setRenamed(t))}),m(17,"fa-icon",12),c(),l(18,"button",13),C(19,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.removeRoot(t))}),m(20,"fa-icon",12),c()()()()}if(i&2){let n=o.$implicit,e=r();s(3),_(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),_(n.isRenamed?6:7),s(2),_(e.showInfos?8:-1),s(3),P(x(13,14,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(16,17,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(19,20,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let o=class o{constructor(){this.showInfos=!0,this.showUsers=!0,this.addRootFile=null,this.locale=b(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(a=>a.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(a=>a.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-manage-roots"]],viewQuery:function(t,a){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(a.inputRename=u.first)}},inputs:{space:"space",user:"user",showInfos:"showInfos",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],[1,"d-flex","justify-content-end"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,a){t&1&&w(0,Be,21,23,"div",1,Fe),t&2&&P(a.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=o;return i})();function Ve(i,o){if(i&1&&m(0,"fa-icon",3),i&2){let n=r();p("icon",n.icons.faSpinner)}}function Ne(i,o){i&1&&(l(0,"span",5),d(1,"You have no files anchored on this space"),c())}var wt=(()=>{let o=class o{constructor(){this.layout=b(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=b(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-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"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,a){t&1&&(l(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),l(3,"span"),d(4),c()(),f(5,Ve,1,1,"fa-icon",3),l(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),l(9,"button",6),h("click",function(){return a.layout.closeDialog()}),c()(),l(10,"div",7),m(11,"app-space-manage-roots",8),f(12,Ne,2,0,"span",5),c(),l(13,"div",9)(14,"button",10),h("click",function(){return a.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),l(18,"button",12),h("click",function(){return a.layout.closeDialog()}),d(19,"Cancel"),c(),l(20,"button",13),h("click",function(){return a.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",a.icons.SPACES),s(2),g(a.space.name),s(),_(a.loading?5:-1),s(6),p("space",a.space)("user",a.user)("showUsers",!1)("addRootFile",a.addRootFileEvent),s(),_(a.space.roots.length?-1:12),s(3),p("icon",a.icons.faPlus),s(),p("icon",a.icons.faAnchor),s(4),p("disabled",a.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=o;return i})();export{ye as a,Re as b,wt as c};
@@ -1 +1 @@
1
- import{Cd as f,_a as c,ha as a}from"./chunk-ATP3BFHV.js";var d=(()=>{let t=class t{constructor(){this.translate=a(f)}transform(e,i=[]){let n="";if(!e)return n;for(let[o,s]of Object.entries(e).filter(([l,p])=>i.indexOf(l)===-1))s&&(n+=`${s} ${this.translate.translate(s===1?o.slice(0,-1):o)}, `);return n.slice(0,-2)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275pipe=c({name:"joinCounts",type:t,pure:!0});let r=t;return r})();export{d as a};
1
+ import{cb as c,ia as a,zd as f}from"./chunk-C36MW4ME.js";var d=(()=>{let t=class t{constructor(){this.translate=a(f)}transform(e,i=[]){let n="";if(!e)return n;for(let[o,s]of Object.entries(e).filter(([l,p])=>i.indexOf(l)===-1))s&&(n+=`${s} ${this.translate.translate(s===1?o.slice(0,-1):o)}, `);return n.slice(0,-2)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275pipe=c({name:"joinCounts",type:t,pure:!0});let r=t;return r})();export{d as a};
@@ -0,0 +1 @@
1
+ var k=Object.defineProperty,r=Object.defineProperties;var s=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var n=a=>{throw TypeError(a)};var j=(a,b,c)=>b in a?k(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,t=(a,b)=>{for(var c in b||={})l.call(b,c)&&j(a,c,b[c]);if(f)for(var c of f(b))m.call(b,c)&&j(a,c,b[c]);return a},u=(a,b)=>r(a,s(b));var v=a=>b=>{var c=a[b];if(c)return c();throw new Error("Module not found in bundle: "+b)};var w=(a,b)=>{var c={};for(var d in a)l.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&m.call(a,d)&&(c[d]=a[d]);return c};var x=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),y=(a,b)=>{for(var c in b)k(a,c,{get:b[c],enumerable:!0})};var o=(a,b,c)=>b.has(a)||n("Cannot "+c);var z=(a,b,c)=>(o(a,b,"read from private field"),c?c.call(a):b.get(a)),A=(a,b,c)=>b.has(a)?n("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),B=(a,b,c,d)=>(o(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);var C=(a,b,c)=>new Promise((d,i)=>{var p=e=>{try{g(c.next(e))}catch(h){i(h)}},q=e=>{try{g(c.throw(e))}catch(h){i(h)}},g=e=>e.done?d(e.value):Promise.resolve(e.value).then(p,q);g((c=c.apply(a,b)).next())});export{t as a,u as b,v as c,w as d,x as e,y as f,z as g,A as h,B as i,C as j};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZIJQRARU.js";import"./chunk-N3U6637P.js";export{a as default};