@sync-in/server 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -58
- package/environment/environment.dist.yaml +6 -3
- package/migrations/0003_giant_luckman.sql +6 -0
- package/migrations/meta/0003_snapshot.json +2463 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +19 -17
- package/server/app.bootstrap.js +5 -2
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.constants.js +0 -4
- package/server/app.constants.js.map +1 -1
- package/server/app.service.js +7 -6
- package/server/app.service.js.map +1 -1
- package/server/applications/files/constants/only-office.js +12 -0
- package/server/applications/files/constants/only-office.js.map +1 -1
- package/server/applications/files/files.config.js +5 -0
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/files.controller.js +12 -4
- package/server/applications/files/files.controller.js.map +1 -1
- package/server/applications/files/files.controller.spec.js +18 -4
- package/server/applications/files/files.controller.spec.js.map +1 -1
- package/server/applications/files/services/files-content-manager.service.js +6 -6
- package/server/applications/files/services/files-content-manager.service.js.map +1 -1
- package/server/applications/files/services/files-manager.service.js +4 -4
- package/server/applications/files/services/files-manager.service.js.map +1 -1
- package/server/applications/files/services/files-methods.service.js +4 -7
- package/server/applications/files/services/files-methods.service.js.map +1 -1
- package/server/applications/files/services/files-only-office-manager.service.js +2 -2
- package/server/applications/files/services/files-only-office-manager.service.js.map +1 -1
- package/server/applications/files/services/files-parser.service.js +6 -3
- package/server/applications/files/services/files-parser.service.js.map +1 -1
- package/server/applications/files/services/files-scheduler.service.js +51 -3
- package/server/applications/files/services/files-scheduler.service.js.map +1 -1
- package/server/applications/files/services/files-search-manager.service.js +4 -0
- package/server/applications/files/services/files-search-manager.service.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/pdf.js +6 -8
- package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
- package/server/applications/notifications/i18n/de.js +56 -0
- package/server/applications/notifications/i18n/de.js.map +1 -0
- package/server/applications/notifications/i18n/es.js +52 -0
- package/server/applications/notifications/i18n/es.js.map +1 -0
- package/server/applications/notifications/i18n/hi.js +52 -0
- package/server/applications/notifications/i18n/hi.js.map +1 -0
- package/server/applications/notifications/i18n/index.js +73 -8
- package/server/applications/notifications/i18n/index.js.map +1 -1
- package/server/applications/notifications/i18n/it.js +52 -0
- package/server/applications/notifications/i18n/it.js.map +1 -0
- package/server/applications/notifications/i18n/ja.js +52 -0
- package/server/applications/notifications/i18n/ja.js.map +1 -0
- package/server/applications/notifications/i18n/ko.js +52 -0
- package/server/applications/notifications/i18n/ko.js.map +1 -0
- package/server/applications/notifications/i18n/pl.js +52 -0
- package/server/applications/notifications/i18n/pl.js.map +1 -0
- package/server/applications/notifications/i18n/pt.js +52 -0
- package/server/applications/notifications/i18n/pt.js.map +1 -0
- package/server/applications/notifications/i18n/pt_br.js +52 -0
- package/server/applications/notifications/i18n/pt_br.js.map +1 -0
- package/server/applications/notifications/i18n/ru.js +52 -0
- package/server/applications/notifications/i18n/ru.js.map +1 -0
- package/server/applications/notifications/i18n/tr.js +52 -0
- package/server/applications/notifications/i18n/tr.js.map +1 -0
- package/server/applications/notifications/i18n/zh.js +52 -0
- package/server/applications/notifications/i18n/zh.js.map +1 -0
- package/server/applications/notifications/mails/models.js +6 -7
- package/server/applications/notifications/mails/models.js.map +1 -1
- package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
- package/server/applications/shares/dto/create-or-update-share.dto.js +11 -0
- package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
- package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
- package/server/applications/shares/schemas/share.interface.js.map +1 -1
- package/server/applications/shares/schemas/shares.schema.js +9 -0
- package/server/applications/shares/schemas/shares.schema.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.js +46 -17
- package/server/applications/shares/services/shares-manager.service.js.map +1 -1
- package/server/applications/shares/services/shares-queries.service.js +24 -5
- package/server/applications/shares/services/shares-queries.service.js.map +1 -1
- package/server/applications/spaces/constants/cache.js +4 -0
- package/server/applications/spaces/constants/cache.js.map +1 -1
- package/server/applications/spaces/dto/create-or-update-space.dto.js +5 -0
- package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.js +3 -3
- package/server/applications/spaces/guards/space.guard.js.map +1 -1
- package/server/applications/spaces/models/space-props.model.js.map +1 -1
- package/server/applications/spaces/models/space.model.js.map +1 -1
- package/server/applications/spaces/schemas/space.interface.js.map +1 -1
- package/server/applications/spaces/schemas/spaces.schema.js +1 -0
- package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +34 -31
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-queries.service.js +23 -7
- package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-scheduler.service.js +21 -20
- package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
- package/server/applications/spaces/spaces.controller.js +4 -2
- package/server/applications/spaces/spaces.controller.js.map +1 -1
- package/server/applications/spaces/utils/paths.js +14 -16
- package/server/applications/spaces/utils/paths.js.map +1 -1
- package/server/applications/sync/services/sync-manager.service.js +4 -3
- package/server/applications/sync/services/sync-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
- package/server/applications/sync/sync.controller.js +2 -1
- package/server/applications/sync/sync.controller.js.map +1 -1
- package/server/applications/users/constants/routes.js +5 -0
- package/server/applications/users/constants/routes.js.map +1 -1
- package/server/applications/users/constants/user.js +0 -16
- package/server/applications/users/constants/user.js.map +1 -1
- package/server/applications/users/dto/user-properties.dto.js +10 -0
- package/server/applications/users/dto/user-properties.dto.js.map +1 -1
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/applications/users/schemas/user.interface.js.map +1 -1
- package/server/applications/users/schemas/users.schema.js +3 -2
- package/server/applications/users/schemas/users.schema.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.js +1 -0
- package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js +2 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-manager.service.js +7 -2
- package/server/applications/users/services/users-manager.service.js.map +1 -1
- package/server/applications/users/services/users-manager.service.spec.js +1 -0
- package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-queries.service.js +18 -4
- package/server/applications/users/services/users-queries.service.js.map +1 -1
- package/server/applications/users/users.controller.js +15 -0
- package/server/applications/users/users.controller.js.map +1 -1
- package/server/applications/users/users.gateway.js +6 -0
- package/server/applications/users/users.gateway.js.map +1 -1
- package/server/applications/users/utils/test.js +2 -2
- package/server/applications/users/utils/test.js.map +1 -1
- package/server/applications/webdav/constants/routes.js +2 -2
- package/server/applications/webdav/constants/routes.js.map +1 -1
- package/server/applications/webdav/constants/webdav.js +2 -2
- package/server/applications/webdav/constants/webdav.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.spec.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
- package/server/applications/webdav/services/webdav-methods.service.js +3 -2
- package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
- package/server/applications/webdav/utils/webdav.js +1 -2
- package/server/applications/webdav/utils/webdav.js.map +1 -1
- package/server/authentication/auth.config.js +2 -2
- package/server/authentication/auth.config.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +2 -2
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/common/i18n.js +52 -0
- package/server/common/i18n.js.map +1 -0
- package/server/common/image.js +63 -43
- package/server/common/image.js.map +1 -1
- package/server/common/interfaces.js.map +1 -1
- package/server/common/shared.js +5 -2
- package/server/common/shared.js.map +1 -1
- package/server/configuration/config.validation.js +3 -3
- package/server/configuration/config.validation.js.map +1 -1
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +8 -6
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js +22 -17
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/cache.e2e-spec.js +1 -0
- package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
- package/server/infrastructure/cache/cache.module.js +1 -14
- package/server/infrastructure/cache/cache.module.js.map +1 -1
- package/server/infrastructure/cache/services/cache.service.js.map +1 -1
- package/server/infrastructure/database/database.module.js +20 -1
- package/server/infrastructure/database/database.module.js.map +1 -1
- package/server/infrastructure/database/utils.js +48 -0
- package/server/infrastructure/database/utils.js.map +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
- package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -3
- package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
- package/static/3rdpartylicenses.txt +137 -163
- package/static/chunk-2KLC4T2Z.js +1 -0
- package/static/chunk-2VMSXRCB.js +12 -0
- package/static/chunk-3GMLWAFZ.js +1 -0
- package/static/chunk-3OHSRRKH.js +4 -0
- package/static/chunk-3R4WKOHQ.js +1 -0
- package/static/{chunk-7ITZXYYJ.js → chunk-3R74L4UU.js} +1 -1
- package/static/chunk-3XVM35O2.js +1 -0
- package/static/chunk-3YVRP3VM.js +2 -0
- package/static/chunk-5NMSIIQB.js +1 -0
- package/static/chunk-5UKZLU5H.js +1 -0
- package/static/chunk-AF24EYXU.js +1 -0
- package/static/chunk-AKQVEHO6.js +2 -0
- package/static/chunk-BCVX464U.js +2 -0
- package/static/chunk-BQV4FRM6.js +1 -0
- package/static/{chunk-EVIE5F2U.js → chunk-CETH7UYS.js} +1 -1
- package/static/chunk-CHJ64RJM.js +1 -0
- package/static/chunk-DIT6W7VM.js +562 -0
- package/static/chunk-DKSEQTMX.js +1 -0
- package/static/chunk-DM4NXKEP.js +1 -0
- package/static/chunk-DPUVSXRB.js +1 -0
- package/static/chunk-DSWEWLXJ.js +1 -0
- package/static/chunk-FJE6BOFL.js +1 -0
- package/static/chunk-FZ3JPGYZ.js +1 -0
- package/static/chunk-IQSKQXC3.js +1 -0
- package/static/chunk-ITUFI2BJ.js +1 -0
- package/static/chunk-JPT5WEAT.js +1 -0
- package/static/chunk-LCTZJ537.js +1 -0
- package/static/chunk-LK2UCQJ6.js +1 -0
- package/static/chunk-LNTUR3GU.js +1 -0
- package/static/chunk-LP5TBXEN.js +7 -0
- package/static/{chunk-IPAC4VAF.js → chunk-LVSNIS5P.js} +1 -1
- package/static/{chunk-SIPE37PA.js → chunk-MTVSJTIW.js} +1 -1
- package/static/chunk-N3U6637P.js +1 -0
- package/static/chunk-NNV4OXSB.js +1 -0
- package/static/chunk-O6FYXVHI.js +1 -0
- package/static/chunk-OOGP4WSH.js +2 -0
- package/static/chunk-PB4AIT7O.js +1 -0
- package/static/chunk-PCWDQPOM.js +2 -0
- package/static/chunk-PNR6M34W.js +1 -0
- package/static/chunk-PVDHBQRM.js +1 -0
- package/static/chunk-Q5KM7LTX.js +1 -0
- package/static/chunk-QHC6ZPQ4.js +1 -0
- package/static/chunk-QMRBZHE4.js +1 -0
- package/static/chunk-QO6BTONN.js +1 -0
- package/static/chunk-QSJRY3TF.js +1 -0
- package/static/chunk-QUUIRSYT.js +1 -0
- package/static/chunk-RFH46UW3.js +1 -0
- package/static/{chunk-PTGDOWV3.js → chunk-RSXHRKM5.js} +1 -1
- package/static/chunk-RV3VZJPZ.js +1 -0
- package/static/{chunk-QNJFQVYI.js → chunk-S7HNXVRB.js} +1 -1
- package/static/chunk-SBZ572Q4.js +2 -0
- package/static/chunk-SJR5R3Y4.js +1 -0
- package/static/chunk-SLHTEGRU.js +1 -0
- package/static/{chunk-SH5EVL4E.js → chunk-SSFF27P2.js} +1 -1
- package/static/chunk-UNCPXHHT.js +1 -0
- package/static/chunk-URHTCJ7G.js +1 -0
- package/static/chunk-V3LHHZYN.js +1 -0
- package/static/{chunk-DJYJ66UF.js → chunk-VJTXJ43D.js} +1 -1
- package/static/chunk-VQQKMY2C.js +1 -0
- package/static/{chunk-IQOALFYU.js → chunk-WSSU2HXE.js} +1 -1
- package/static/chunk-XDZGW64M.js +3 -0
- package/static/chunk-XTRDKGKG.js +1 -0
- package/static/chunk-YLWTEC3X.js +1 -0
- package/static/chunk-Z5J5F5SX.js +1 -0
- package/static/chunk-ZIJQRARU.js +1 -0
- package/static/index.html +2 -2
- package/static/main-4H5BJY3J.js +9 -0
- package/static/scripts-WRDOQIU5.js +24 -0
- package/static/{styles-A5VYX3CE.css → styles-2C2UNCNB.css} +1 -1
- package/server/applications/spaces/interfaces/space-quota.interface.js +0 -10
- package/server/applications/spaces/interfaces/space-quota.interface.js.map +0 -1
- package/static/chunk-22EANI6R.js +0 -1
- package/static/chunk-3GFGJYMK.js +0 -1
- package/static/chunk-4YGJGZZZ.js +0 -1
- package/static/chunk-5K7HEX3C.js +0 -27
- package/static/chunk-5KLMS6A4.js +0 -1
- package/static/chunk-ATP3BFHV.js +0 -562
- package/static/chunk-BB4G55KE.js +0 -1
- package/static/chunk-EWKSX76T.js +0 -1
- package/static/chunk-FHLACA7V.js +0 -1
- package/static/chunk-GCATNU55.js +0 -1
- package/static/chunk-GYODPCIE.js +0 -1
- package/static/chunk-HZTFYLM5.js +0 -1
- package/static/chunk-JSUKJT6Z.js +0 -1
- package/static/chunk-JXZCNFW7.js +0 -1
- package/static/chunk-LTGFCQR7.js +0 -1
- package/static/chunk-LV3PYKWO.js +0 -1
- package/static/chunk-N2WFNW6M.js +0 -7
- package/static/chunk-ORMRCEGT.js +0 -1
- package/static/chunk-OUTBJSMW.js +0 -1
- package/static/chunk-RS2PX32L.js +0 -1
- package/static/chunk-RSSWH3S2.js +0 -1
- package/static/chunk-RTRJ3KFH.js +0 -1
- package/static/chunk-TKTCBDOG.js +0 -1
- package/static/chunk-V6K2N46L.js +0 -1
- package/static/chunk-XLCCZSQL.js +0 -4
- package/static/chunk-YPEH66GG.js +0 -1
- package/static/chunk-YPOIUQ57.js +0 -1
- package/static/chunk-ZKCFO2OA.js +0 -4
- package/static/main-MZ7HWZXO.js +0 -9
- package/static/scripts-VZVAP2P4.js +0 -30
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
-
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
-
* See the LICENSE file for licensing details
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=space-quota.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/spaces/interfaces/space-quota.interface.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport interface SpaceQuota {\n storageUsage: number\n storageQuota: number\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
|
package/static/chunk-22EANI6R.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="assets",o=".svg",r=`${e}/mimes`,i="file",c="directory",n="directory_share",p="directory_sync",m="directory_disabled",a="directory_error";function s(t){return`${r}/${t}${o}`}var l=`${e}/favicon${o}`,x=`${e}/logo-dark${o}`,d=`${e}/logo${o}`,g=`${e}/protected.png`,y=s(i),$=new Set(["matroska","mpegurl","msvideo"]),b=new Set(["application-gzip","application-zip","application-x-tar"]),z=new Set(["rar","7z","iso","zip","tar","gz","bz2","xz","exe","dll","msi","bat","cmd","sh","apk","appimage","dmg","img","bin","vhd","vmdk","so","o","a","lib","sys","drv","cab"]);export{e as a,i as b,c,n as d,p as e,m as f,a as g,s as h,l as i,x as j,d as k,g as l,y as m,$ as n,b as o,z as p};
|
package/static/chunk-3GFGJYMK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as T,b as S,c as d,d as A,e as c,p as b}from"./chunk-EWKSX76T.js";import{Da as U,V as N,Y as R,Ya as k,fb as h,nb as C,qa as O,ua as l,yb as H,zb as P}from"./chunk-XLCCZSQL.js";import{d as g}from"./chunk-ORMRCEGT.js";import{$ as _,G as a,O as f,Pc as I,Z as m,ca as x,ha as i,p as o,q as u,v as n}from"./chunk-ATP3BFHV.js";var F="Client token is expired";var E={BASE:"auth",LOGIN:"login"};var se=(()=>{let s=class s{constructor(){this.http=i(I),this.router=i(g),this.store=i(C),this.userService=i(b),this.layout=i(P),this.electron=i(H),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(T,{login:e,password:t}).pipe(n(r=>r.server.twoFaEnabled&&r.user.twoFaEnabled?(this.accessExpiration=r.token.access_2fa_expiration,this.refreshExpiration=this.accessExpiration,{success:!0,twoFaEnabled:!0,message:null}):(this.initUserFromResponse(r),{success:!0,message:null})),a(r=>(console.warn(r),o({success:!1,message:r.error.message||r.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(N,e).pipe(n(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.userService.initUser(t.user),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),a(t=>(console.warn(t),t.error.message===F?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),o(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(f(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([E.BASE,E.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([l.BASE,l.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.userService.initUser(e.user,t),this.setServerConfig(e.server))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(d,null).pipe(n(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,!0)),a(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),u(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),o(!1)):this.store.user.getValue()?o(!0):this.http.get(R).pipe(_(t=>{this.userService.initUser(t.user),this.setServerConfig(t.server)}),n(()=>!0),a(t=>(t.status===401?this.logout():console.warn(t),o(!1))))}checkCSRF(e){return e.headers.has(c)?e.clone({headers:e.headers.set(c,k(c))}):e}loginWith2Fa(e){return this.http.post(A,e)}setServerConfig(e){e&&this.store.server.set(e)}refreshTokenHasExpired(){return this.refreshExpiration===0||U()>=this.refreshExpiration}clearCookies(){return this.http.post(S,null)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"});let p=s;return p})();export{E as a,se as b};
|
package/static/chunk-4YGJGZZZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ab as r,B as l,Db as N,Eb as C,Fb as k,Ia as c,Lb as p,Pb as U,Rb as h,Ta as d,Tb as A,Wb as u,lb as w,ob as m,rb as x,sb as b}from"./chunk-XLCCZSQL.js";import{c as a,d as I,h as E,m as $}from"./chunk-22EANI6R.js";import{Pc as M,ca as T,ha as _,v as n}from"./chunk-ATP3BFHV.js";function R(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?I:a),i.mimeUrl=E(i.file.mime)):i.mimeUrl=E(i.parent?.alias?I:a)}function y(i){let e,o=i.file.path?i.file.path.split("/").filter(s=>s&&s!=="."):[];if(i.parent?.id){if(!o.length)return[p.SPACES_SHARES,i.parent.alias];e=`${p.SPACES_SHARES}/${i.parent.alias}`}else i.file.space?.alias?i.file.inTrash?e=`${p.SPACES_TRASH}/${i.file.space.alias}`:(e=`${p.SPACES_FILES}/${i.file.space.alias}`,i.file.space?.root?.alias&&(o.length?e=`${e}/${i.file.space.root.alias}`:o.push(i.file.space.root.name))):i.file?.ownerId?e=`${i.file.inTrash?p.PERSONAL_TRASH:p.PERSONAL_FILES}`:console.warn("unable to find the right file path",i);let t=o.pop();return e&&o.length&&(e=`${e}/${o.join("/")}`),[e,t]}var g=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),R(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=$}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=d(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date((0,l.default)(this.link.expiresAt).local().format("YYYY-MM-DD"));let e=Math.max(0,(0,l.default)(this.link.expiresAt).diff((0,l.default)(),"hours"));e===0?this.hTimeExpirationAgo=0:e<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(e/24)+1}else this.hTimeExpirationAgo=0}};var B=(function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i})(B||{}),D=Object.values(m).filter(i=>i!==m.SHARE_INSIDE).sort().join(":");var P=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[m.SHARE_INSIDE]:[]),Object.assign(this,e),R(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=$}setMembers(e,o){if(e)for(let t of e)t.linkId?this.links.push(new A(t,[...o,m.SHARE_OUTSIDE])):this.members.push(new A(t,o))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(":").filter(e=>e===m.SHARE_INSIDE||e===m.ADD&&this.file.id&&!this.file.isDir?!1:!(e===m.DELETE&&this.file.id&&!this.file.isDir)).join(":")))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(D))}};var f=class{constructor(e){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=h(e.permissions),this.setMembers(c("members",e)),this.setRoots(c("roots",e)),Object.assign(this,e),this.hTimeAgo=(0,l.default)(this.modifiedAt).fromNow(!0),this.newly=d(this.modifiedAt),this.sort()}addRoot(e,o=!1){e.hPerms=U(e.permissions,[m.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=w(e.owner.login)),e.file.mimeUrl=E(e.file?.mime?e.file.mime:a),o?this.roots.unshift(e):this.roots.push(e),e.isDir=e.file.mime===a||!!e.externalPath}havePermission(e){return this.permissions.indexOf(e)>-1}setMembers(e){if(e)for(let o of e){let t=new A(o);t.isLink?this.links.push(t):t.spaceRole===x.IS_MANAGER?this.managers.push(t):this.members.push(t)}}setRoots(e){if(e)for(let o of e)this.addRoot(o)}sort(){u(this.roots,"createdAt",!1),u(this.managers,"createdAt",!1),u(this.members,"createdAt",!1),u(this.links,"createdAt",!1)}};var Oe=(()=>{let e=class e{constructor(){this.http=_(M)}listSpaces(){return this.http.get(N).pipe(n(t=>t.map(s=>new f(s))))}getSpace(t){return this.http.get(`${r.BASE}/${t}`).pipe(n(s=>new f(s)))}getUserSpaceRoots(t){return this.http.get(`${r.BASE}/${t}/${r.ROOTS}`)}createUserSpaceRoots(t,s){return this.http.post(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateUserSpaceRoots(t,s){return this.http.put(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateSpace(t){return this.http.put(`${r.BASE}/${t.id}`,t).pipe(n(s=>s?new f(s):null))}createSpace(t){return this.http.post(r.BASE,t).pipe(n(s=>(s.permissions=b,new f(s))))}deleteSpace(t,s){return this.http.request("delete",`${r.BASE}/${t}`,{body:s})}searchSpaces(t){return this.http.request("search",r.BASE,{body:t})}listSpaceShares(t){return this.http.get(`${r.BASE}/${t}/${r.SHARES}`)}getSpaceShare(t,s){return this.http.get(`${r.BASE}/${t}/${r.SHARES}/${s}`).pipe(n(S=>new P(S)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(S=>new P(S)))}deleteSpaceShare(t,s){return this.http.delete(`${r.BASE}/${t}/${r.SHARES}/${s}`)}getSpaceShareLink(t,s){return this.http.get(`${r.BASE}/${t}/${r.LINKS}/${s}`).pipe(n(S=>new g(S)))}listTrashBins(){return this.http.get(C)}checkSpaceRootPath(t){return this.http.post(k,{path:t})}};e.\u0275fac=function(s){return new(s||e)},e.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{B as a,R as b,y as c,P as d,g as e,f,Oe as g};
|
package/static/chunk-5K7HEX3C.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{a as kr}from"./chunk-QNJFQVYI.js";import{c as Tr}from"./chunk-JXZCNFW7.js";import{a as Mr}from"./chunk-5KLMS6A4.js";import{a as xr,b as wr,c as Ar,d as Dr,e as Nr,h as Or}from"./chunk-ZKCFO2OA.js";import{b as Lr,c as xi,d as Ir,e as Mi}from"./chunk-FHLACA7V.js";import{a as Pr,d as Jt,g as Ot}from"./chunk-4YGJGZZZ.js";import{m as Si,p as _i}from"./chunk-EWKSX76T.js";import{Ab as Sr,Ba as hr,Ca as mr,Cb as _r,Da as gr,Jb as Ci,Ka as vr,Kb as ee,Lb as Dt,Na as xt,P as rt,Pa as Mt,Qa as br,ab as on,f as tr,lb as yr,nb as wt,ob as At,pb as le,qb as Be,sb as Cr,zb as H}from"./chunk-XLCCZSQL.js";import{a as Ei,c as je,d as zr,h as st,m as Nt}from"./chunk-22EANI6R.js";import{d as Xn}from"./chunk-ORMRCEGT.js";import{$ as Gn,$b as bt,$c as Qn,Ab as ke,Ac as Ve,Ad as Et,B as T,C as Gt,Cb as b,Db as qn,Dc as nt,Eb as f,Fb as Wt,Ga as ze,Gb as Kt,Gd as er,Ha as $n,Hb as et,Hc as be,Hd as Ce,Ib as Me,Jb as J,Jf as dr,Kb as Z,L as pt,La as Ji,Lb as Yt,Ld as ir,Lf as ur,Ma as l,Mb as j,Me as or,Na as Zi,Nb as V,Nc as Qt,Ob as Fe,Pb as h,Pc as He,Qa as ht,Qb as R,Ra as me,Rb as se,Sa as en,Tb as mt,Ub as gt,Ue as ar,Uf as fr,Vb as vt,X as jn,Xa as y,Xb as Re,Ya as ge,Yc as gi,Za as xe,Zb as tt,Zf as pr,_a as tn,_b as it,_c as ye,ab as P,ad as Jn,ba as Un,bb as L,bc as Wn,bd as vi,bf as lr,c as Hn,ca as Q,cb as Ut,cc as hi,da as he,dc as ve,ec as mi,ef as yi,f as Bt,fc as yt,fd as Ct,gg as Er,ha as p,hc as Xt,jb as D,kb as N,kd as St,ma as S,na as _,nb as nn,ne as nr,nf as cr,ob as rn,pb as u,qb as c,qc as sn,rb as d,rc as Kn,sb as g,se as rr,tb as $t,u as Qi,ub as qt,ud as bi,v as jt,va as Qe,vb as pi,ve as sr,w as Bn,wb as Je,xb as Ze,ya as ae,yb as Ie,yd as _t,zb as F,zc as Yn,zd as Zn}from"./chunk-ATP3BFHV.js";import{a as oe,b as Ye,j as Xe}from"./chunk-RTRJ3KFH.js";var ml={prefix:"far",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-13.3 0-24 10.7-24 24l0 9.7C118.6 45.3 56 115.4 56 200l0 14.5c0 37.7-10 74.7-29 107.3L5.1 359.2C1.8 365 0 371.5 0 378.2 0 399.1 16.9 416 37.8 416l372.4 0c20.9 0 37.8-16.9 37.8-37.8 0-6.7-1.8-13.3-5.1-19L421 321.7c-19-32.6-29-69.6-29-107.3l0-14.5c0-84.6-62.6-154.7-144-166.3l0-9.7c0-13.3-10.7-24-24-24zM392.4 368l-336.9 0 12.9-22.1C91.7 306 104 260.6 104 214.5l0-14.5c0-66.3 53.7-120 120-120s120 53.7 120 120l0 14.5c0 46.2 12.3 91.5 35.5 131.4L392.4 368zM156.1 464c9.9 28 36.6 48 67.9 48s58-20 67.9-48l-135.8 0z"]};var go={prefix:"far",iconName:"file-zipper",icon:[384,512,["file-archive"],"f1c6","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zM80 104c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm0 80c0 13.3 10.7 24 24 24l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0c-13.3 0-24 10.7-24 24zm64 56l-32 0c-17.7 0-32 14.3-32 32l0 48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-48c0-17.7-14.3-32-32-32zm-16 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]},gl=go;var vl={prefix:"far",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M464 256a208 208 0 1 1 -416 0 208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]};var wi={prefix:"far",iconName:"file",icon:[384,512,[128196,128459,61462],"f15b","M176 48L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-240-88 0c-39.8 0-72-32.2-72-72l0-88zM316.1 160L224 67.9 224 136c0 13.3 10.7 24 24 24l68.1 0zM0 64C0 28.7 28.7 0 64 0L197.5 0c17 0 33.3 6.7 45.3 18.7L365.3 141.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"]};var bl={prefix:"far",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M166.2-16c-13.3 0-25.3 8.3-30 20.8L120 48 24 48C10.7 48 0 58.7 0 72S10.7 96 24 96l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0-16.2-43.2C307.1-7.7 295.2-16 281.8-16L166.2-16zM32 144l0 304c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-304-48 0 0 304c0 8.8-7.2 16-16 16L96 464c-8.8 0-16-7.2-16-16l0-304-48 0zm160 72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176zm112 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176z"]};var yl={prefix:"far",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M144 128a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zm208 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM48 480c0-70.7 57.3-128 128-128l96 0c70.7 0 128 57.3 128 128l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8c0-97.2-78.8-176-176-176l-96 0C78.8 304 0 382.8 0 480l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]};var Cl={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]};var Sl={prefix:"far",iconName:"comment-dots",icon:[512,512,[128172,62075,"commenting"],"f4ad","M0 240c0 54.4 19.3 104.6 51.9 144.9L3.1 474.3c-2 3.7-3.1 7.9-3.1 12.2 0 14.1 11.4 25.5 25.5 25.5 4 0 7.8-.6 11.5-2.1L153.4 460c31.4 12.9 66.1 20 102.6 20 141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240zM94 407.9c9.3-17.1 7.4-38.1-4.8-53.2-26.1-32.3-41.2-71.9-41.2-114.7 0-103.2 90.2-192 208-192s208 88.8 208 192-90.2 192-208 192c-30.2 0-58.7-5.9-84.3-16.4-11.9-4.9-25.3-4.8-37.1 .3L76 440.9 94 407.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]};var _l={prefix:"far",iconName:"flag",icon:[448,512,[127988,61725],"f024","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4 44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0-35.1-17.6-75.4-22-113.5-12.5L48 52 48 24zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8 54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4-48.2-24.1-103.3-30.1-155.6-17.1l-68.6 17.2 0-237z"]};var El={prefix:"far",iconName:"window-restore",icon:[576,512,[],"f2d2","M512 80L224 80c-8.8 0-16 7.2-16 16l0 16-48 0 0-16c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64l-48 0 0-48 48 0c8.8 0 16-7.2 16-16l0-192c0-8.8-7.2-16-16-16zM368 288l-320 0 0 128c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-128zM64 160l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z"]};var Fr={prefix:"far",iconName:"folder-closed",icon:[512,512,[],"e185","M448 400L64 400c-8.8 0-16-7.2-16-16l0-144 416 0 0 144c0 8.8-7.2 16-16 16zm16-208l-416 0 0-96c0-8.8 7.2-16 16-16l138.7 0c3.5 0 6.8 1.1 9.6 3.2L250.7 112c13.8 10.4 30.7 16 48 16L448 128c8.8 0 16 7.2 16 16l0 48zM64 448l384 0c35.3 0 64-28.7 64-64l0-240c0-35.3-28.7-64-64-64L298.7 80c-6.9 0-13.7-2.2-19.2-6.4L241.1 44.8C230 36.5 216.5 32 202.7 32L64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64z"]};var Rr=(()=>{let e=class e{transform(t,n=0,s=void 0){return Mt(t,n,s)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275pipe=tn({name:"pathSlice",type:e,pure:!0});let i=e;return i})();var dn=function(i,e){return dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])},dn(i,e)};function Yr(i,e){dn(i,e);function r(){this.constructor=i}i.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var te=function(){return te=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},te.apply(this,arguments)};function Xr(i,e){var r=typeof Symbol=="function"&&i[Symbol.iterator];if(!r)return i;var t=r.call(i),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=t.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return s}function un(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(Xr(arguments[e]));return i}var vo="An invariant failed, however the error is obfuscated because this is an production build.",Ni=[];Object.freeze(Ni);var vn={};Object.freeze(vn);var bo={};function fn(){return typeof window<"u"?window:typeof global<"u"?global:bo}function ie(){return++v.mobxGuid}function k(i){throw ei(!1,i),"X"}function ei(i,e){if(!i)throw new Error("[mobx] "+(e||vo))}var Vr=[];function De(i,e){return!1}function bn(i){var e=!1;return function(){if(!e)return e=!0,i.apply(this,arguments)}}var Hr=function(){};function yo(i){var e=[];return i.forEach(function(r){e.indexOf(r)===-1&&e.push(r)}),e}function yn(i){return i!==null&&typeof i=="object"}function zt(i){if(i===null||typeof i!="object")return!1;var e=Object.getPrototypeOf(i);return e===Object.prototype||e===null}function Co(i){return It(i)||ut(i)?i:Array.isArray(i)?new Map(i):zt(i)?new Map(Object.entries(i)):k("Cannot convert to map from '"+i+"'")}function So(i,e){for(var r=0;r<e.length;r++)ct(i,e[r],i[e[r]])}function ct(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function ri(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function qe(i,e){var r="isMobX"+i;return e.prototype[r]=!0,function(t){return yn(t)&&t[r]===!0}}function _o(i,e){return typeof i=="number"&&typeof e=="number"&&isNaN(i)&&isNaN(e)}function It(i){return fn().Map!==void 0&&i instanceof fn().Map}function si(i){return i instanceof Set}function Pt(i){for(var e=[];;){var r=i.next();if(r.done)break;e.push(r.value)}return e}function Qr(){return typeof Symbol=="function"&&Symbol.toPrimitive||"@@toPrimitive"}function Jr(i){return i===null?null:typeof i=="object"?""+i:i}function Cn(){return typeof Symbol=="function"&&Symbol.iterator||"@@iterator"}function Sn(i,e){ri(i,Cn(),e)}function ti(i){return i[Cn()]=Eo,i}function _n(){return typeof Symbol=="function"&&Symbol.toStringTag||"@@toStringTag"}function Eo(){return this}var Ii=(function(){function i(e){e===void 0&&(e="Atom@"+ie()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=O.NOT_TRACKING}return i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.reportObserved=function(){return fs(this)},i.prototype.reportChanged=function(){Ne(),qo(this),Oe()},i.prototype.toString=function(){return this.name},i})(),En=qe("Atom",Ii);function xo(i,e,r){e===void 0&&(e=Hr),r===void 0&&(r=Hr);var t=new Ii(i);return ra(t,e),vs(t,r),t}function Zr(i,e){return i===e}function Mo(i,e){return An(i,e)}function wo(i,e){return An(i,e,1)}function Ao(i,e){return _o(i,e)||Zr(i,e)}var Lt={identity:Zr,structural:Mo,default:Ao,shallow:wo},Do={},No={};function Oo(i,e){var r=e?Do:No;return r[i]||(r[i]={configurable:!0,enumerable:e,get:function(){return at(this),this[i]},set:function(t){at(this),this[i]=t}})}function at(i){if(i.__mobxDidRunLazyInitializers!==!0){var e=i.__mobxDecorators;if(e){ct(i,"__mobxDidRunLazyInitializers",!0);for(var r in e){var t=e[r];t.propertyCreator(i,t.prop,t.descriptor,t.decoratorTarget,t.decoratorArguments)}}}}function es(i,e){return function(){var t,n=function(o,a,m,C){if(C===!0)return e(o,a,m,o,t),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var I=o.__mobxDecorators;ct(o,"__mobxDecorators",te({},I))}return o.__mobxDecorators[a]={prop:a,propertyCreator:e,descriptor:m,decoratorTarget:o,decoratorArguments:t},Oo(a,i)};return To(arguments)?(t=Ni,n.apply(null,arguments)):(t=Array.prototype.slice.call(arguments),n)}}function To(i){return(i.length===2||i.length===3)&&typeof i[1]=="string"||i.length===4&&i[3]===!0}function oi(i,e,r){return Cs(i)?i:Array.isArray(i)?M.array(i,{name:r}):zt(i)?M.object(i,void 0,{name:r}):It(i)?M.map(i,{name:r}):si(i)?M.set(i,{name:r}):i}function Po(i,e,r){return i==null||ni(i)||Vi(i)||ut(i)||Ft(i)?i:Array.isArray(i)?M.array(i,{name:r,deep:!1}):zt(i)?M.object(i,void 0,{name:r,deep:!1}):It(i)?M.map(i,{name:r,deep:!1}):si(i)?M.set(i,{name:r,deep:!1}):k(!1)}function ii(i){return i}function Lo(i,e,r){return An(i,e)?e:i}function ki(i){var e=es(!0,function(t,n,s,o,a){var m=s?s.initializer?s.initializer.call(t):s.value:void 0;ba(t,n,m,i)}),r=(typeof process<"u"&&process.env,e);return r.enhancer=i,r}var ts={deep:!0,name:void 0,defaultDecorator:void 0},zo={deep:!1,name:void 0,defaultDecorator:void 0};Object.freeze(ts);Object.freeze(zo);function Tt(i){return i==null?ts:typeof i=="string"?{name:i,deep:!0}:i}function Ai(i){return i.defaultDecorator?i.defaultDecorator.enhancer:i.deep===!1?ii:oi}var xn=ki(oi),Io=ki(Po),is=ki(ii),ko=ki(Lo);function Fo(i,e,r){if(typeof arguments[1]=="string")return xn.apply(null,arguments);if(Cs(i))return i;var t=zt(i)?M.object(i,e,r):Array.isArray(i)?M.array(i,e):It(i)?M.map(i,e):si(i)?M.set(i,e):i;if(t!==i)return t;k(!1)}var Br={box:function(i,e){arguments.length>2&&we("box");var r=Tt(e);return new Ue(i,Ai(r),r.name,!0,r.equals)},shallowBox:function(i,e){return arguments.length>2&&we("shallowBox"),De("observable.shallowBox","observable.box(value, { deep: false })"),M.box(i,{name:e,deep:!1})},array:function(i,e){arguments.length>2&&we("array");var r=Tt(e);return new Pe(i,Ai(r),r.name)},shallowArray:function(i,e){return arguments.length>2&&we("shallowArray"),De("observable.shallowArray","observable.array(values, { deep: false })"),M.array(i,{name:e,deep:!1})},map:function(i,e){arguments.length>2&&we("map");var r=Tt(e);return new Hi(i,Ai(r),r.name)},shallowMap:function(i,e){return arguments.length>2&&we("shallowMap"),De("observable.shallowMap","observable.map(values, { deep: false })"),M.map(i,{name:e,deep:!1})},set:function(i,e){arguments.length>2&&we("set");var r=Tt(e);return new Bi(i,Ai(r),r.name)},object:function(i,e,r){typeof arguments[1]=="string"&&we("object");var t=Tt(r);return sa({},i,e,t)},shallowObject:function(i,e){return typeof arguments[1]=="string"&&we("shallowObject"),De("observable.shallowObject","observable.object(values, {}, { deep: false })"),M.object(i,{},{name:e,deep:!1})},ref:is,shallow:Io,deep:xn,struct:ko},M=Fo;Object.keys(Br).forEach(function(i){return M[i]=Br[i]});function we(i){k("Expected one or two arguments to observable."+i+". Did you accidentally try to use observable."+i+" as decorator?")}var Oi=es(!1,function(i,e,r,t,n){var s=r.get,o=r.set,a=n[0]||{};ya(i,e,te({get:s,set:o},a))}),Ro=Oi({equals:Lt.structural}),U=function(e,r,t){if(typeof r=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Oi.apply(null,arguments);var n=typeof r=="object"?r:{};return n.get=e,n.set=typeof r=="function"?r:n.set,n.name=n.name||e.name||"",new $e(n)};U.struct=Ro;var O=(function(i){return i[i.NOT_TRACKING=-1]="NOT_TRACKING",i[i.UP_TO_DATE=0]="UP_TO_DATE",i[i.POSSIBLY_STALE=1]="POSSIBLY_STALE",i[i.STALE=2]="STALE",i})(O||{}),Se=(function(i){return i[i.NONE=0]="NONE",i[i.LOG=1]="LOG",i[i.BREAK=2]="BREAK",i})(Se||{}),Ti=(function(){function i(e){this.cause=e}return i})();function Zt(i){return i instanceof Ti}function pn(i){switch(i.dependenciesState){case O.UP_TO_DATE:return!1;case O.NOT_TRACKING:case O.STALE:return!0;case O.POSSIBLY_STALE:{for(var e=kt(),r=i.observing,t=r.length,n=0;n<t;n++){var s=r[n];if(Ri(s)){if(v.disableErrorBoundaries)s.get();else try{s.get()}catch{return Ge(e),!0}if(i.dependenciesState===O.STALE)return Ge(e),!0}}return as(i),Ge(e),!1}}}function Fi(i){var e=i.observers.length>0;v.computationDepth>0&&e&&k(!1),!v.allowStateChanges&&(e||v.enforceActions==="strict")&&k(!1)}function ns(i,e,r){var t=ss(!0);as(i),i.newObserving=new Array(i.observing.length+100),i.unboundDepsCount=0,i.runId=++v.runId;var n=v.trackingDerivation;v.trackingDerivation=i;var s;if(v.disableErrorBoundaries===!0)s=e.call(r);else try{s=e.call(r)}catch(o){s=new Ti(o)}return v.trackingDerivation=n,Vo(i),i.observing.length===0&&void 0,os(t),s}function Vo(i){for(var e=i.observing,r=i.observing=i.newObserving,t=O.UP_TO_DATE,n=0,s=i.unboundDepsCount,o=0;o<s;o++){var a=r[o];a.diffValue===0&&(a.diffValue=1,n!==o&&(r[n]=a),n++),a.dependenciesState>t&&(t=a.dependenciesState)}for(r.length=n,i.newObserving=null,s=e.length;s--;){var a=e[s];a.diffValue===0&&ds(a,i),a.diffValue=0}for(;n--;){var a=r[n];a.diffValue===1&&(a.diffValue=0,$o(a,i))}t!==O.UP_TO_DATE&&(i.dependenciesState=t,i.onBecomeStale())}function hn(i){var e=i.observing;i.observing=[];for(var r=e.length;r--;)ds(e[r],i);i.dependenciesState=O.NOT_TRACKING}function rs(i){var e=kt(),r=i();return Ge(e),r}function kt(){var i=v.trackingDerivation;return v.trackingDerivation=null,i}function Ge(i){v.trackingDerivation=i}function ss(i){var e=v.allowStateReads;return v.allowStateReads=i,e}function os(i){v.allowStateReads=i}function as(i){if(i.dependenciesState!==O.UP_TO_DATE){i.dependenciesState=O.UP_TO_DATE;for(var e=i.observing,r=e.length;r--;)e[r].lowestObserverState=O.UP_TO_DATE}}var Pi=0,Ho=1;function ot(i,e){var r=function(){return Bo(i,e,this,arguments)};return r.isMobxAction=!0,r}function Bo(i,e,r,t){var n=jo(i,r,t);try{return e.apply(r,t)}catch(s){throw n.error=s,s}finally{Go(n)}}function jo(i,e,r){var t=K()&&!!i,n=0;if(t){n=Date.now();var s=r&&r.length||0,o=new Array(s);if(s>0)for(var a=0;a<s;a++)o[a]=r[a];ce({type:"action",name:i,object:e,arguments:o})}var m=kt();Ne();var C=ls(!0),I=ss(!0),ne={prevDerivation:m,prevAllowStateChanges:C,prevAllowStateReads:I,notifySpy:t,startTime:n,actionId:Ho++,parentActionId:Pi};return Pi=ne.actionId,ne}function Go(i){Pi!==i.actionId&&k("invalid action stack. did you forget to finish an action?"),Pi=i.parentActionId,i.error!==void 0&&(v.suppressReactionErrors=!0),cs(i.prevAllowStateChanges),os(i.prevAllowStateReads),Oe(),Ge(i.prevDerivation),i.notifySpy&&de({time:Date.now()-i.startTime}),v.suppressReactionErrors=!1}function ls(i){var e=v.allowStateChanges;return v.allowStateChanges=i,e}function cs(i){v.allowStateChanges=i}var Ue=(function(i){Yr(e,i);function e(r,t,n,s,o){n===void 0&&(n="ObservableValue@"+ie()),s===void 0&&(s=!0),o===void 0&&(o=Lt.default);var a=i.call(this,n)||this;return a.enhancer=t,a.name=n,a.equals=o,a.hasUnreportedChange=!1,a.value=t(r,void 0,n),s&&K()&<({type:"create",name:a.name,newValue:""+a.value}),a}return e.prototype.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.prototype.set=function(r){var t=this.value;if(r=this.prepareNewValue(r),r!==v.UNCHANGED){var n=K();n&&ce({type:"update",name:this.name,newValue:r,oldValue:t}),this.setNewValue(r),n&&de()}},e.prototype.prepareNewValue=function(r){if(Fi(this),_e(this)){var t=Ee(this,{object:this,type:"update",newValue:r});if(!t)return v.UNCHANGED;r=t.newValue}return r=this.enhancer(r,this.value,this.name),this.equals(this.value,r)?v.UNCHANGED:r},e.prototype.setNewValue=function(r){var t=this.value;this.value=r,this.reportChanged(),ue(this)&&fe(this,{type:"update",object:this,newValue:r,oldValue:t})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(r){return li(this,r)},e.prototype.observe=function(r,t){return t&&r({object:this,type:"update",newValue:this.value,oldValue:void 0}),ci(this,r)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Jr(this.get())},e})(Ii);Ue.prototype[Qr()]=Ue.prototype.valueOf;var Al=qe("ObservableValue",Ue),$e=(function(){function i(e){this.dependenciesState=O.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=O.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+ie(),this.value=new Ti(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Se.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+ie(),e.set&&(this.setter=ot(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Lt.structural:Lt.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return i.prototype.onBecomeStale=function(){Ko(this)},i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.get=function(){this.isComputing&&k("Cycle detected in computation "+this.name+": "+this.derivation),v.inBatch===0&&this.observers.length===0&&!this.keepAlive?pn(this)&&(this.warnAboutUntrackedRead(),Ne(),this.value=this.computeValue(!1),Oe()):(fs(this),pn(this)&&this.trackAndCompute()&&Wo(this));var e=this.value;if(Zt(e))throw e.cause;return e},i.prototype.peek=function(){var e=this.computeValue(!1);if(Zt(e))throw e.cause;return e},i.prototype.set=function(e){if(this.setter){ei(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else ei(!1,!1)},i.prototype.trackAndCompute=function(){K()&<({object:this.scope,type:"compute",name:this.name});var e=this.value,r=this.dependenciesState===O.NOT_TRACKING,t=this.computeValue(!0),n=r||Zt(e)||Zt(t)||!this.equals(e,t);return n&&(this.value=t),n},i.prototype.computeValue=function(e){this.isComputing=!0,v.computationDepth++;var r;if(e)r=ns(this,this.derivation,this.scope);else if(v.disableErrorBoundaries===!0)r=this.derivation.call(this.scope);else try{r=this.derivation.call(this.scope)}catch(t){r=new Ti(t)}return v.computationDepth--,this.isComputing=!1,r},i.prototype.suspend=function(){this.keepAlive||(hn(this),this.value=void 0)},i.prototype.observe=function(e,r){var t=this,n=!0,s=void 0;return ai(function(){var o=t.get();if(!n||r){var a=kt();e({type:"update",object:t,newValue:o,oldValue:s}),Ge(a)}n=!1,s=o})},i.prototype.warnAboutUntrackedRead=function(){},i.prototype.toJSON=function(){return this.get()},i.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},i.prototype.valueOf=function(){return Jr(this.get())},i})();$e.prototype[Qr()]=$e.prototype.valueOf;var Ri=qe("ComputedValue",$e);var an=(function(){function i(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return i})(),ln=!0,Uo=!1,v=(function(){var i=fn();return i.__mobxInstanceCount>0&&!i.__mobxGlobals&&(ln=!1),i.__mobxGlobals&&i.__mobxGlobals.version!==new an().version&&(ln=!1),ln?i.__mobxGlobals?(i.__mobxInstanceCount+=1,i.__mobxGlobals.UNCHANGED||(i.__mobxGlobals.UNCHANGED={}),i.__mobxGlobals):(i.__mobxInstanceCount=1,i.__mobxGlobals=new an):(setTimeout(function(){Uo||k("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new an)})();function $o(i,e){var r=i.observers.length;r&&(i.observersIndexes[e.__mapid]=r),i.observers[r]=e,i.lowestObserverState>e.dependenciesState&&(i.lowestObserverState=e.dependenciesState)}function ds(i,e){if(i.observers.length===1)i.observers.length=0,us(i);else{var r=i.observers,t=i.observersIndexes,n=r.pop();if(n!==e){var s=t[e.__mapid]||0;s?t[n.__mapid]=s:delete t[n.__mapid],r[s]=n}delete t[e.__mapid]}}function us(i){i.isPendingUnobservation===!1&&(i.isPendingUnobservation=!0,v.pendingUnobservations.push(i))}function Ne(){v.inBatch++}function Oe(){if(--v.inBatch===0){ms();for(var i=v.pendingUnobservations,e=0;e<i.length;e++){var r=i[e];r.isPendingUnobservation=!1,r.observers.length===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof $e&&r.suspend())}v.pendingUnobservations=[]}}function fs(i){var e=v.trackingDerivation;return e!==null?(e.runId!==i.lastAccessedBy&&(i.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=i,i.isBeingObserved||(i.isBeingObserved=!0,i.onBecomeObserved())),!0):(i.observers.length===0&&v.inBatch>0&&us(i),!1)}function qo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale()),t.dependenciesState=O.STALE}}}function Wo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.POSSIBLY_STALE?t.dependenciesState=O.STALE:t.dependenciesState===O.UP_TO_DATE&&(i.lowestObserverState=O.UP_TO_DATE)}}}function Ko(i){if(i.lowestObserverState===O.UP_TO_DATE){i.lowestObserverState=O.POSSIBLY_STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.dependenciesState=O.POSSIBLY_STALE,t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale())}}}function ps(i,e){if(console.log("[mobx.trace] '"+i.name+"' is invalidated due to a change in: '"+e.name+"'"),i.isTracing===Se.BREAK){var r=[];hs(oa(i),r,1),new Function(`debugger;
|
|
2
|
-
/*
|
|
3
|
-
Tracing '`+i.name+`'
|
|
4
|
-
|
|
5
|
-
You are entering this break point because derivation '`+i.name+"' is being traced and '"+e.name+`' is now forcing it to update.
|
|
6
|
-
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
7
|
-
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
8
|
-
|
|
9
|
-
`+(i instanceof $e?i.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
10
|
-
|
|
11
|
-
The dependencies for this derivation are:
|
|
12
|
-
|
|
13
|
-
`+r.join(`
|
|
14
|
-
`)+`
|
|
15
|
-
*/
|
|
16
|
-
`)()}}function hs(i,e,r){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(r).join(" ")+i.name),i.dependencies&&i.dependencies.forEach(function(t){return hs(t,e,r+1)})}var Li=(function(){function i(e,r,t,n){e===void 0&&(e="Reaction@"+ie()),n===void 0&&(n=!1),this.name=e,this.onInvalidate=r,this.errorHandler=t,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=O.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+ie(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Se.NONE}return i.prototype.onBecomeStale=function(){this.schedule()},i.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,v.pendingReactions.push(this),ms())},i.prototype.isScheduled=function(){return this._isScheduled},i.prototype.runReaction=function(){if(!this.isDisposed){if(Ne(),this._isScheduled=!1,pn(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&K()&<({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Oe()}},i.prototype.track=function(e){Ne();var r=K(),t;r&&(t=Date.now(),ce({name:this.name,type:"reaction"})),this._isRunning=!0;var n=ns(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&hn(this),Zt(n)&&this.reportExceptionInDerivation(n.cause),r&&de({time:Date.now()-t}),Oe()},i.prototype.reportExceptionInDerivation=function(e){var r=this;if(this.errorHandler){this.errorHandler(e,this);return}if(v.disableErrorBoundaries)throw e;var t="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";v.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(t,e),K()&<({type:"error",name:this.name,message:t,error:""+e}),v.globalReactionErrorHandlers.forEach(function(n){return n(e,r)})},i.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ne(),hn(this),Oe()))},i.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},i.prototype.toString=function(){return"Reaction["+this.name+"]"},i.prototype.trace=function(e){e===void 0&&(e=!1),la(this,e)},i})();var jr=100,Yo=function(i){return i()};function ms(){v.inBatch>0||v.isRunningReactions||Yo(Xo)}function Xo(){v.isRunningReactions=!0;for(var i=v.pendingReactions,e=0;i.length>0;){++e===jr&&(console.error("Reaction doesn't converge to a stable state after "+jr+" iterations."+(" Probably there is a cycle in the reactive function: "+i[0])),i.splice(0));for(var r=i.splice(0),t=0,n=r.length;t<n;t++)r[t].runReaction()}v.isRunningReactions=!1}var zi=qe("Reaction",Li);function K(){return!!v.spyListeners.length}function lt(i){if(v.spyListeners.length)for(var e=v.spyListeners,r=0,t=e.length;r<t;r++)e[r](i)}function ce(i){var e=te({},i,{spyReportStart:!0});lt(e)}var Qo={spyReportEnd:!0};function de(i){lt(i?te({},i,{spyReportEnd:!0}):Qo)}function Jo(i){return v.spyListeners.push(i),bn(function(){v.spyListeners=v.spyListeners.filter(function(e){return e!==i})})}function Zo(){k(!1)}function Gr(i){return function(e,r,t){if(t){if(t.value)return{value:ot(i,t.value),enumerable:!1,configurable:!0,writable:!0};var n=t.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return ot(i,n.call(this))}}}return ea(i).apply(this,arguments)}}function ea(i){return function(e,r,t){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get:function(){},set:function(n){ct(this,r,w(i,n))}})}}function ta(i,e,r,t){return t===!0?(cn(i,e,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return cn(this,e,r.value||r.initializer.call(this)),this[e]},set:Zo}:{enumerable:!1,configurable:!0,set:function(n){cn(this,e,n)},get:function(){}}}var w=function(e,r,t,n){if(arguments.length===1&&typeof e=="function")return ot(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof r=="function")return ot(e,r);if(arguments.length===1&&typeof e=="string")return Gr(e);if(n===!0)e[r]=ot(e.name||r,t.value);else return Gr(r).apply(null,arguments)};w.bound=ta;function cn(i,e,r){ct(i,e,ot(e,r.bind(i)))}function ai(i,e){e===void 0&&(e=vn);var r=e&&e.name||i.name||"Autorun@"+ie(),t=!e.scheduler&&!e.delay,n;if(t)n=new Li(r,function(){this.track(a)},e.onError,e.requiresObservable);else{var s=gs(e),o=!1;n=new Li(r,function(){o||(o=!0,s(function(){o=!1,n.isDisposed||n.track(a)}))},e.onError,e.requiresObservable)}function a(){i(n)}return n.schedule(),n.getDisposer()}var ia=function(i){return i()};function gs(i){return i.scheduler?i.scheduler:i.delay?function(e){return setTimeout(e,i.delay)}:ia}function dt(i,e,r){r===void 0&&(r=vn),typeof r=="boolean"&&(r={fireImmediately:r},De("Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead"));var t=r.name||"Reaction@"+ie(),n=w(t,r.onError?na(r.onError,e):e),s=!r.scheduler&&!r.delay,o=gs(r),a=!0,m=!1,C,I=r.compareStructural?Lt.structural:r.equals||Lt.default,ne=new Li(t,function(){a||s?Ke():m||(m=!0,o(Ke))},r.onError,r.requiresObservable);function Ke(){if(m=!1,!ne.isDisposed){var Rn=!1;ne.track(function(){var Vn=i(ne);Rn=a||!I(C,Vn),C=Vn}),a&&r.fireImmediately&&n(C,ne),!a&&Rn===!0&&n(C,ne),a&&(a=!1)}}return ne.schedule(),ne.getDisposer()}function na(i,e){return function(){try{return e.apply(this,arguments)}catch(r){i.call(this,r)}}}function ra(i,e,r){return bs("onBecomeObserved",i,e,r)}function vs(i,e,r){return bs("onBecomeUnobserved",i,e,r)}function bs(i,e,r,t){var n=typeof t=="function"?Te(e,r):Te(e),s=typeof t=="function"?t:r,o=n[i];return typeof o!="function"?k(!1):(n[i]=function(){o.call(this),s.call(this)},function(){n[i]=o})}function sa(i,e,r,t){if(0&&r)for(var n in r);t=Tt(t);var s=t.defaultDecorator||(t.deep===!1?is:xn);at(i),wn(i,t.name,s.enhancer),Ne();try{for(var n in e){var o=Object.getOwnPropertyDescriptor(e,n),a=r&&n in r?r[n]:o.get?Oi:s,m=a(i,n,o,!0);m&&Object.defineProperty(i,n,m)}}finally{Oe()}return i}function oa(i,e){return ys(Te(i,e))}function ys(i){var e={name:i.name};return i.observing&&i.observing.length>0&&(e.dependencies=yo(i.observing).map(ys)),e}function aa(i,e){if(i==null)return!1;if(e!==void 0){if(ni(i)){var r=i.$mobx;return r.values&&!!r.values[e]}return!1}return ni(i)||!!i.$mobx||En(i)||zi(i)||Ri(i)}function Cs(i){return arguments.length!==1&&k(!1),aa(i)}function la(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var r=!1;typeof i[i.length-1]=="boolean"&&(r=i.pop());var t=ca(i);if(!t)return k(!1);t.isTracing===Se.NONE&&console.log("[mobx.trace] '"+t.name+"' tracing enabled"),t.isTracing=r?Se.BREAK:Se.LOG}function ca(i){switch(i.length){case 0:return v.trackingDerivation;case 1:return Te(i[0]);case 2:return Te(i[0],i[1])}}function Ae(i,e){e===void 0&&(e=void 0),Ne();try{return i.apply(e)}finally{Oe()}}function _e(i){return i.interceptors!==void 0&&i.interceptors.length>0}function li(i,e){var r=i.interceptors||(i.interceptors=[]);return r.push(e),bn(function(){var t=r.indexOf(e);t!==-1&&r.splice(t,1)})}function Ee(i,e){var r=kt();try{var t=i.interceptors;if(t)for(var n=0,s=t.length;n<s&&(e=t[n](e),ei(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);n++);return e}finally{Ge(r)}}function ue(i){return i.changeListeners!==void 0&&i.changeListeners.length>0}function ci(i,e){var r=i.changeListeners||(i.changeListeners=[]);return r.push(e),bn(function(){var t=r.indexOf(e);t!==-1&&r.splice(t,1)})}function fe(i,e){var r=kt(),t=i.changeListeners;if(t){t=t.slice();for(var n=0,s=t.length;n<s;n++)t[n](e);Ge(r)}}var da=1e4,ua=(function(){var i=!1,e={};return Object.defineProperty(e,"0",{set:function(){i=!0}}),Object.create(e)[0]=1,i===!1})(),mn=0,Mn=(function(){function i(){}return i})();function fa(i,e){typeof Object.setPrototypeOf<"u"?Object.setPrototypeOf(i.prototype,e):typeof i.prototype.__proto__<"u"?i.prototype.__proto__=e:i.prototype=e}fa(Mn,Array.prototype);Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(i){Object.defineProperty(Mn.prototype,i,{configurable:!0,writable:!0,value:Array.prototype[i]})});var Ss=(function(){function i(e,r,t,n){this.array=t,this.owned=n,this.values=[],this.lastKnownLength=0,this.atom=new Ii(e||"ObservableArray@"+ie()),this.enhancer=function(s,o){return r(s,o,e+"[..]")}}return i.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},i.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},i.prototype.intercept=function(e){return li(this,e)},i.prototype.observe=function(e,r){return r===void 0&&(r=!1),r&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ci(this,e)},i.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},i.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var r=this.values.length;if(e!==r)if(e>r){for(var t=new Array(e-r),n=0;n<e-r;n++)t[n]=void 0;this.spliceWithArray(r,0,t)}else this.spliceWithArray(e,r-e)},i.prototype.updateArrayLength=function(e,r){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=r,r>0&&e+r+1>mn&&Es(e+r+1)},i.prototype.spliceWithArray=function(e,r,t){var n=this;Fi(this.atom);var s=this.values.length;if(e===void 0?e=0:e>s?e=s:e<0&&(e=Math.max(0,s+e)),arguments.length===1?r=s-e:r==null?r=0:r=Math.max(0,Math.min(r,s-e)),t===void 0&&(t=Ni),_e(this)){var o=Ee(this,{object:this.array,type:"splice",index:e,removedCount:r,added:t});if(!o)return Ni;r=o.removedCount,t=o.added}t=t.length===0?t:t.map(function(C){return n.enhancer(C,void 0)});var a=t.length-r;this.updateArrayLength(s,a);var m=this.spliceItemsIntoValues(e,r,t);return(r!==0||t.length!==0)&&this.notifyArraySplice(e,t,m),this.dehanceValues(m)},i.prototype.spliceItemsIntoValues=function(e,r,t){var n;if(t.length<da)return(n=this.values).splice.apply(n,un([e,r],t));var s=this.values.slice(e,e+r);return this.values=this.values.slice(0,e).concat(t,this.values.slice(e+r)),s},i.prototype.notifyArrayChildUpdate=function(e,r,t){var n=!this.owned&&K(),s=ue(this),o=s||n?{object:this.array,type:"update",index:e,newValue:r,oldValue:t}:null;n&&ce(te({},o,{name:this.atom.name})),this.atom.reportChanged(),s&&fe(this,o),n&&de()},i.prototype.notifyArraySplice=function(e,r,t){var n=!this.owned&&K(),s=ue(this),o=s||n?{object:this.array,type:"splice",index:e,removed:t,added:r,removedCount:t.length,addedCount:r.length}:null;n&&ce(te({},o,{name:this.atom.name})),this.atom.reportChanged(),s&&fe(this,o),n&&de()},i})(),Pe=(function(i){Yr(e,i);function e(r,t,n,s){n===void 0&&(n="ObservableArray@"+ie()),s===void 0&&(s=!1);var o=i.call(this)||this,a=new Ss(n,t,o,s);if(ri(o,"$mobx",a),r&&r.length){var m=ls(!0);o.spliceWithArray(0,0,r),cs(m)}return ua&&Object.defineProperty(a.array,"0",pa),o}return e.prototype.intercept=function(r){return this.$mobx.intercept(r)},e.prototype.observe=function(r,t){return t===void 0&&(t=!1),this.$mobx.observe(r,t)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),r.map(function(n){return Vi(n)?n.peek():n}))},e.prototype.replace=function(r){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,r)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(r,t,n){n===void 0&&(n=0),arguments.length===3&&De("The array.find fromIndex argument to find will not be supported anymore in the next major");var s=this.findIndex.apply(this,arguments);return s===-1?void 0:this.get(s)},e.prototype.findIndex=function(r,t,n){n===void 0&&(n=0),arguments.length===3&&De("The array.findIndex fromIndex argument to find will not be supported anymore in the next major");for(var s=this.peek(),o=s.length,a=n;a<o;a++)if(r.call(t,s[a],a,this))return a;return-1},e.prototype.splice=function(r,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(r);case 2:return this.$mobx.spliceWithArray(r,t)}return this.$mobx.spliceWithArray(r,t,n)},e.prototype.spliceWithArray=function(r,t,n){return this.$mobx.spliceWithArray(r,t,n)},e.prototype.push=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,r),n.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,r),n.values.length},e.prototype.reverse=function(){var r=this.slice();return r.reverse.apply(r,arguments)},e.prototype.sort=function(r){var t=this.slice();return t.sort.apply(t,arguments)},e.prototype.remove=function(r){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(r);return t>-1?(this.splice(t,1),!0):!1},e.prototype.move=function(r,t){De("observableArray.move is deprecated, use .slice() & .replace() instead");function n(a){if(a<0)throw new Error("[mobx.array] Index out of bounds: "+a+" is negative");var m=this.$mobx.values.length;if(a>=m)throw new Error("[mobx.array] Index out of bounds: "+a+" is not smaller than "+m)}if(n.call(this,r),n.call(this,t),r!==t){var s=this.$mobx.values,o;r<t?o=un(s.slice(0,r),s.slice(r+1,t+1),[s[r]],s.slice(t+1)):o=un(s.slice(0,t),[s[r]],s.slice(t,r),s.slice(r+1)),this.replace(o)}},e.prototype.get=function(r){var t=this.$mobx;if(t){if(r<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[r]);console.warn("[mobx.array] Attempt to read an array index ("+r+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(r,t){var n=this.$mobx,s=n.values;if(r<s.length){Fi(n.atom);var o=s[r];if(_e(n)){var a=Ee(n,{type:"update",object:this,index:r,newValue:t});if(!a)return;t=a.newValue}t=n.enhancer(t,o);var m=t!==o;m&&(s[r]=t,n.notifyArrayChildUpdate(r,t,o))}else if(r===s.length)n.spliceWithArray(r,0,[t]);else throw new Error("[mobx.array] Index out of bounds, "+r+" is larger than "+s.length)},e})(Mn);Sn(Pe.prototype,function(){this.$mobx.atom.reportObserved();var i=this,e=0;return ti({next:function(){return e<i.length?{value:i[e++],done:!1}:{done:!0,value:void 0}}})});Object.defineProperty(Pe.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(i){this.$mobx.setArrayLength(i)}});ct(Pe.prototype,_n(),"Array");["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(i){var e=Array.prototype[i];ei(typeof e=="function","Base function not defined on Array prototype: '"+i+"'"),ct(Pe.prototype,i,function(){return e.apply(this.peek(),arguments)})});So(Pe.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var pa=_s(0);function _s(i){return{enumerable:!1,configurable:!1,get:function(){return this.get(i)},set:function(e){this.set(i,e)}}}function ha(i){Object.defineProperty(Pe.prototype,""+i,_s(i))}function Es(i){for(var e=mn;e<i;e++)ha(e);mn=i}Es(1e3);var ma=qe("ObservableArrayAdministration",Ss);function Vi(i){return yn(i)&&ma(i.$mobx)}var ga={},Hi=(function(){function i(e,r,t){if(r===void 0&&(r=oi),t===void 0&&(t="ObservableMap@"+ie()),this.enhancer=r,this.name=t,this.$mobx=ga,this._keys=new Pe(void 0,ii,this.name+".keys()",!0),typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return i.prototype._has=function(e){return this._data.has(e)},i.prototype.has=function(e){var r=this;if(!v.trackingDerivation)return this._has(e);var t=this._hasMap.get(e);if(!t){var n=t=new Ue(this._has(e),ii,this.name+"."+Di(e)+"?",!1);this._hasMap.set(e,n),vs(n,function(){return r._hasMap.delete(e)})}return t.get()},i.prototype.set=function(e,r){var t=this._has(e);if(_e(this)){var n=Ee(this,{type:t?"update":"add",object:this,newValue:r,name:e});if(!n)return this;r=n.newValue}return t?this._updateValue(e,r):this._addValue(e,r),this},i.prototype.delete=function(e){var r=this;if(_e(this)){var t=Ee(this,{type:"delete",object:this,name:e});if(!t)return!1}if(this._has(e)){var n=K(),s=ue(this),t=s||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&ce(te({},t,{name:this.name,key:e})),Ae(function(){r._keys.remove(e),r._updateHasMapEntry(e,!1);var a=r._data.get(e);a.setNewValue(void 0),r._data.delete(e)}),s&&fe(this,t),n&&de(),!0}return!1},i.prototype._updateHasMapEntry=function(e,r){var t=this._hasMap.get(e);t&&t.setNewValue(r)},i.prototype._updateValue=function(e,r){var t=this._data.get(e);if(r=t.prepareNewValue(r),r!==v.UNCHANGED){var n=K(),s=ue(this),o=s||n?{type:"update",object:this,oldValue:t.value,name:e,newValue:r}:null;n&&ce(te({},o,{name:this.name,key:e})),t.setNewValue(r),s&&fe(this,o),n&&de()}},i.prototype._addValue=function(e,r){var t=this;Ae(function(){var a=new Ue(r,t.enhancer,t.name+"."+Di(e),!1);t._data.set(e,a),r=a.value,t._updateHasMapEntry(e,!0),t._keys.push(e)});var n=K(),s=ue(this),o=s||n?{type:"add",object:this,name:e,newValue:r}:null;n&&ce(te({},o,{name:this.name,key:e})),s&&fe(this,o),n&&de()},i.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},i.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},i.prototype.keys=function(){return this._keys[Cn()]()},i.prototype.values=function(){var e=this,r=0;return ti({next:function(){return r<e._keys.length?{value:e.get(e._keys[r++]),done:!1}:{value:void 0,done:!0}}})},i.prototype.entries=function(){var e=this,r=0;return ti({next:function(){if(r<e._keys.length){var t=e._keys[r++];return{value:[t,e.get(t)],done:!1}}return{done:!0}}})},i.prototype.forEach=function(e,r){var t=this;this._keys.forEach(function(n){return e.call(r,t.get(n),n,t)})},i.prototype.merge=function(e){var r=this;return ut(e)&&(e=e.toJS()),Ae(function(){zt(e)?Object.keys(e).forEach(function(t){return r.set(t,e[t])}):Array.isArray(e)?e.forEach(function(t){var n=Xr(t,2),s=n[0],o=n[1];return r.set(s,o)}):It(e)?e.constructor!==Map?k("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(t,n){return r.set(n,t)}):e!=null&&k("Cannot initialize map from "+e)}),this},i.prototype.clear=function(){var e=this;Ae(function(){rs(function(){e._keys.slice().forEach(function(r){return e.delete(r)})})})},i.prototype.replace=function(e){var r=this;return Ae(function(){for(var t=Co(e),n=r._keys,s=Array.from(t.keys()),o=!1,a=0;a<n.length;a++){var m=n[a];n.length===s.length&&m!==s[a]&&(o=!0),t.has(m)||(o=!0,r.delete(m))}t.forEach(function(C,I){r._data.has(I)||(o=!0),r.set(I,C)}),o&&r._keys.replace(s)}),this},Object.defineProperty(i.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),i.prototype.toPOJO=function(){var e=this,r={};return this._keys.forEach(function(t){return r[typeof t=="symbol"?t:Di(t)]=e.get(t)}),r},i.prototype.toJS=function(){var e=this,r=new Map;return this._keys.forEach(function(t){return r.set(t,e.get(t))}),r},i.prototype.toJSON=function(){return this.toPOJO()},i.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(r){return Di(r)+": "+(""+e.get(r))}).join(", ")+" }]"},i.prototype.observe=function(e,r){return ci(this,e)},i.prototype.intercept=function(e){return li(this,e)},i})();function Di(i){return i&&i.toString?i.toString():new String(i).toString()}Sn(Hi.prototype,function(){return this.entries()});ri(Hi.prototype,_n(),"Map");var ut=qe("ObservableMap",Hi),va={},Bi=(function(){function i(e,r,t){if(r===void 0&&(r=oi),t===void 0&&(t="ObservableSet@"+ie()),this.name=t,this.$mobx=va,this._data=new Set,this._atom=xo(this.name),typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(n,s){return r(n,s,t)},e&&this.replace(e)}return i.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},i.prototype.clear=function(){var e=this;Ae(function(){rs(function(){e._data.forEach(function(r){e.delete(r)})})})},i.prototype.forEach=function(e,r){var t=this;this._data.forEach(function(n){e.call(r,n,n,t)})},Object.defineProperty(i.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),i.prototype.add=function(e){var r=this;if(Fi(this._atom),_e(this)){var t=Ee(this,{type:"add",object:this,newValue:e});if(!t)return this}if(!this.has(e)){Ae(function(){r._data.add(r.enhancer(e,void 0)),r._atom.reportChanged()});var n=K(),s=ue(this),t=s||n?{type:"add",object:this,newValue:e}:null;s&&fe(this,t)}return this},i.prototype.delete=function(e){var r=this;if(_e(this)){var t=Ee(this,{type:"delete",object:this,oldValue:e});if(!t)return!1}if(this.has(e)){var n=K(),s=ue(this),t=s||n?{type:"delete",object:this,oldValue:e}:null;return Ae(function(){r._atom.reportChanged(),r._data.delete(e)}),s&&fe(this,t),!0}return!1},i.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},i.prototype.entries=function(){var e=0,r=Pt(this.keys()),t=Pt(this.values());return ti({next:function(){var n=e;return e+=1,n<t.length?{value:[r[n],t[n]],done:!1}:{done:!0}}})},i.prototype.keys=function(){return this.values()},i.prototype.values=function(){this._atom.reportObserved();var e=this,r=0,t;return this._data.values!==void 0?t=Pt(this._data.values()):(t=[],this._data.forEach(function(n){return t.push(n)})),ti({next:function(){return r<t.length?{value:e.dehanceValue(t[r++]),done:!1}:{done:!0}}})},i.prototype.replace=function(e){var r=this;return Ft(e)&&(e=e.toJS()),Ae(function(){Array.isArray(e)?(r.clear(),e.forEach(function(t){return r.add(t)})):si(e)?(r.clear(),e.forEach(function(t){return r.add(t)})):e!=null&&k("Cannot initialize set from "+e)}),this},i.prototype.observe=function(e,r){return ci(this,e)},i.prototype.intercept=function(e){return li(this,e)},i.prototype.toJS=function(){return new Set(this)},i.prototype.toString=function(){return this.name+"[ "+Pt(this.keys()).join(", ")+" ]"},i})();Sn(Bi.prototype,function(){return this.values()});ri(Bi.prototype,_n(),"Set");var Ft=qe("ObservableSet",Bi),xs=(function(){function i(e,r,t){this.target=e,this.name=r,this.defaultEnhancer=t,this.values={}}return i.prototype.read=function(e,r){if(!(this.target!==e&&(this.illegalAccess(e,r),!this.values[r])))return this.values[r].get()},i.prototype.write=function(e,r,t){var n=this.target;n!==e&&this.illegalAccess(e,r);var s=this.values[r];if(s instanceof $e){s.set(t);return}if(_e(this)){var o=Ee(this,{type:"update",object:n,name:r,newValue:t});if(!o)return;t=o.newValue}if(t=s.prepareNewValue(t),t!==v.UNCHANGED){var a=ue(this),m=K(),o=a||m?{type:"update",object:n,oldValue:s.value,name:r,newValue:t}:null;m&&ce(te({},o,{name:this.name,key:r})),s.setNewValue(t),a&&fe(this,o),m&&de()}},i.prototype.remove=function(e){if(this.values[e]){var r=this.target;if(_e(this)){var t=Ee(this,{object:r,name:e,type:"remove"});if(!t)return}try{Ne();var n=ue(this),s=K(),o=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var t=n||s?{type:"remove",object:r,oldValue:o,name:e}:null;s&&ce(te({},t,{name:this.name,key:e})),n&&fe(this,t),s&&de()}finally{Oe()}}},i.prototype.illegalAccess=function(e,r){console.warn("Property '"+r+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},i.prototype.observe=function(e,r){return ci(this,e)},i.prototype.intercept=function(e){return li(this,e)},i.prototype.getKeys=function(){var e=this;return this.keys===void 0&&(this.keys=new Pe(Object.keys(this.values).filter(function(r){return e.values[r]instanceof Ue}),ii,"keys("+this.name+")",!0)),this.keys.slice()},i})();function wn(i,e,r){e===void 0&&(e=""),r===void 0&&(r=oi);var t=i.$mobx;return t||(zt(i)||(e=(i.constructor.name||"ObservableObject")+"@"+ie()),e||(e="ObservableObject@"+ie()),t=new xs(i,e,r),ri(i,"$mobx",t),t)}function ba(i,e,r,t){var n=wn(i);if(_e(n)){var s=Ee(n,{object:i,name:e,type:"add",newValue:r});if(!s)return;r=s.newValue}var o=n.values[e]=new Ue(r,t,n.name+"."+e,!1);r=o.value,Object.defineProperty(i,e,Ca(e)),n.keys&&n.keys.push(e),_a(n,i,e,r)}function ya(i,e,r){var t=wn(i);r.name=t.name+"."+e,r.context=i,t.values[e]=new $e(r),Object.defineProperty(i,e,Sa(e))}var Ur=Object.create(null),$r=Object.create(null);function Ca(i){return Ur[i]||(Ur[i]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,i)},set:function(e){this.$mobx.write(this,i,e)}})}function qr(i){var e=i.$mobx;return e||(at(i),i.$mobx)}function Sa(i){return $r[i]||($r[i]={configurable:v.computedConfigurable,enumerable:!1,get:function(){return qr(this).read(this,i)},set:function(e){qr(this).write(this,i,e)}})}function _a(i,e,r,t){var n=ue(i),s=K(),o=n||s?{type:"add",object:e,name:r,newValue:t}:null;s&&ce(te({},o,{name:i.name,key:r})),n&&fe(i,o),s&&de()}var Ea=qe("ObservableObjectAdministration",xs);function ni(i){return yn(i)?(at(i),Ea(i.$mobx)):!1}function Te(i,e){if(typeof i=="object"&&i!==null){if(Vi(i))return e!==void 0&&k(!1),i.$mobx.atom;if(Ft(i))return i.$mobx;if(ut(i)){var r=i;if(e===void 0)return Te(r._keys);var t=r._data.get(e)||r._hasMap.get(e);return t||k(!1),t}if(at(i),e&&!i.$mobx&&i[e],ni(i)){if(!e)return k(!1);var t=i.$mobx.values[e];return t||k(!1),t}if(En(i)||Ri(i)||zi(i))return i}else if(typeof i=="function"&&zi(i.$mobx))return i.$mobx;return k(!1)}function Ms(i,e){if(i||k("Expecting some object"),e!==void 0)return Ms(Te(i,e));if(En(i)||Ri(i)||zi(i)||ut(i)||Ft(i))return i;if(at(i),i.$mobx)return i.$mobx;k(!1)}function xa(i,e){var r;return e!==void 0?r=Te(i,e):ni(i)||ut(i)||Ft(i)?r=Ms(i):r=Te(i),r.name}var Wr=Object.prototype.toString;function An(i,e,r){return r===void 0&&(r=-1),gn(i,e,r)}function gn(i,e,r,t,n){if(i===e)return i!==0||1/i===1/e;if(i==null||e==null)return!1;if(i!==i)return e!==e;var s=typeof i;if(s!=="function"&&s!=="object"&&typeof e!="object")return!1;i=Kr(i),e=Kr(e);var o=Wr.call(i);if(o!==Wr.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+i==""+e;case"[object Number]":return+i!=+i?+e!=+e:+i==0?1/+i===1/e:+i==+e;case"[object Date]":case"[object Boolean]":return+i==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(i)===Symbol.valueOf.call(e)}var a=o==="[object Array]";if(!a){if(typeof i!="object"||typeof e!="object")return!1;var m=i.constructor,C=e.constructor;if(m!==C&&!(typeof m=="function"&&m instanceof m&&typeof C=="function"&&C instanceof C)&&"constructor"in i&&"constructor"in e)return!1}if(r===0)return!1;r<0&&(r=-1),t=t||[],n=n||[];for(var I=t.length;I--;)if(t[I]===i)return n[I]===e;if(t.push(i),n.push(e),a){if(I=i.length,I!==e.length)return!1;for(;I--;)if(!gn(i[I],e[I],r-1,t,n))return!1}else{var ne=Object.keys(i),Ke=void 0;if(I=ne.length,Object.keys(e).length!==I)return!1;for(;I--;)if(Ke=ne[I],!(Ma(e,Ke)&&gn(i[Ke],e[Ke],r-1,t,n)))return!1}return t.pop(),n.pop(),!0}function Kr(i){return Vi(i)?i.peek():It(i)||ut(i)||si(i)||Ft(i)?Pt(i.entries()):i}function Ma(i,e){return Object.prototype.hasOwnProperty.call(i,e)}(function(){function i(){}if(i.name!=="testCodeMinification"&&!1)var e})();var wa="$mobx";typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Jo,extras:{getDebugName:xa},$mobx:wa});var Aa=i=>({$implicit:i});function Da(i,e){i&1&&(c(0,"span"),h(1,"loading..."),d())}var Na=["*"],Vt=()=>({dontDetach:!0});function Oa(i,e){if(i&1&&(Je(0),c(1,"div"),Kt(2),d(),Ze()),i&2){let r=f();l(),j("height",r.getTotalHeight())}}function Ta(i,e){if(i&1){let r=F();Je(0),c(1,"input",1),b("click",function(n){S(r);let s=f();return _(s.node.mouseAction("checkboxClick",n))}),d(),Ze()}if(i&2){let r=f();l(),u("checked",r.node.isSelected)("indeterminate",r.node.isPartiallySelected)}}function Pa(i,e){if(i&1){let r=F();c(0,"span",3),b("click",function(n){S(r);let s=f(2);return _(s.node.mouseAction("expanderClick",n))}),g(1,"span",4),d()}if(i&2){let r=f(2);V("toggle-children-wrapper-expanded",r.node.isExpanded)("toggle-children-wrapper-collapsed",r.node.isCollapsed)}}function La(i,e){i&1&&g(0,"span",5)}function za(i,e){if(i&1&&(Je(0),P(1,Pa,2,4,"span",1)(2,La,1,0,"span",2),Ze()),i&2){let r=f();l(),u("ngIf",r.node.hasChildren),l(),u("ngIf",!r.node.hasChildren)}}var Ia=(i,e,r)=>({$implicit:i,node:e,index:r});function ka(i,e){if(i&1&&(c(0,"span"),h(1),d()),i&2){let r=f();l(),R(r.node.displayField)}}var Ps=(i,e,r,t)=>({$implicit:i,node:e,index:r,templates:t});function Fa(i,e){if(i&1&&g(0,"tree-node-checkbox",4),i&2){let r=f(2);u("node",r.node)}}function Ra(i,e){if(i&1){let r=F();c(0,"div",2),P(1,Fa,1,1,"tree-node-checkbox",3),g(2,"tree-node-expander",4),c(3,"div",5),b("click",function(n){S(r);let s=f();return _(s.node.mouseAction("click",n))})("dblclick",function(n){S(r);let s=f();return _(s.node.mouseAction("dblClick",n))})("mouseover",function(n){S(r);let s=f();return _(s.node.mouseAction("mouseOver",n))})("mouseout",function(n){S(r);let s=f();return _(s.node.mouseAction("mouseOut",n))})("contextmenu",function(n){S(r);let s=f();return _(s.node.mouseAction("contextMenu",n))})("treeDrop",function(n){S(r);let s=f();return _(s.node.onDrop(n))})("treeDropDragOver",function(n){S(r);let s=f();return _(s.node.mouseAction("dragOver",n))})("treeDropDragLeave",function(n){S(r);let s=f();return _(s.node.mouseAction("dragLeave",n))})("treeDropDragEnter",function(n){S(r);let s=f();return _(s.node.mouseAction("dragEnter",n))}),g(4,"tree-node-content",6),d()()}if(i&2){let r=f();j("padding-left",r.node.getNodePadding()),l(),u("ngIf",r.node.options.useCheckbox),l(),u("node",r.node),l(),V("node-content-wrapper-active",r.node.isActive)("node-content-wrapper-focused",r.node.isFocused),u("treeAllowDrop",r.node.allowDrop)("allowDragoverStyling",r.node.allowDragoverStyling())("treeDrag",r.node)("treeDragEnabled",r.node.allowDrag()),l(),u("node",r.node)("index",r.index)("template",r.templates.treeNodeTemplate)}}function Va(i,e){if(i&1&&g(0,"tree-node-collection",4),i&2){let r=f(3);u("nodes",r.node.children)("templates",r.templates)("treeModel",r.node.treeModel)}}function Ha(i,e){if(i&1&&g(0,"tree-loading-component",5),i&2){let r=f(3);j("padding-left",r.node.getNodePadding()),u("template",r.templates.loadingTemplate)("node",r.node)}}function Ba(i,e){if(i&1&&(c(0,"div"),P(1,Va,1,3,"tree-node-collection",2)(2,Ha,1,4,"tree-loading-component",3),d()),i&2){let r=f(2);V("tree-children",!0)("tree-children-no-padding",r.node.options.levelPadding),l(),u("ngIf",r.node.children),l(),u("ngIf",!r.node.children)}}function ja(i,e){if(i&1&&(Je(0),P(1,Ba,3,6,"div",1),Ze()),i&2){let r=f();l(),u("treeAnimateOpen",r.node.isExpanded)("treeAnimateOpenSpeed",r.node.options.animateSpeed)("treeAnimateOpenAcceleration",r.node.options.animateAcceleration)("treeAnimateOpenEnabled",r.node.options.animateExpand)}}function Ga(i,e){if(i&1&&g(0,"tree-node",2),i&2){let r=e.$implicit,t=e.index,n=f(2);u("node",r)("index",t)("templates",n.templates)}}function Ua(i,e){if(i&1&&(Je(0),c(1,"div"),P(2,Ga,1,3,"tree-node",1),d(),Ze()),i&2){let r=f();l(),j("margin-top",r.marginTop),l(),u("ngForOf",r.viewportNodes)("ngForTrackBy",r.trackNode)}}function $a(i,e){if(i&1&&g(0,"tree-node-drop-slot",6),i&2){let r=f(3);u("dropIndex",r.node.index)("node",r.node.parent)}}function qa(i,e){if(i&1&&(c(0,"div"),P(1,$a,1,2,"tree-node-drop-slot",3),g(2,"tree-node-wrapper",4)(3,"tree-node-children",5)(4,"tree-node-drop-slot",6),d()),i&2){let r=f(2);Fe(r.node.getClass()),V("tree-node",!0)("tree-node-expanded",r.node.isExpanded&&r.node.hasChildren)("tree-node-collapsed",r.node.isCollapsed&&r.node.hasChildren)("tree-node-leaf",r.node.isLeaf)("tree-node-active",r.node.isActive)("tree-node-focused",r.node.isFocused),l(),u("ngIf",r.index===0),l(),u("node",r.node)("index",r.index)("templates",r.templates),l(),u("node",r.node)("templates",r.templates),l(),u("dropIndex",r.node.index+1)("node",r.node.parent)}}function Wa(i,e){if(i&1&&(Je(0),P(1,qa,5,22,"div",1),Ie(2,2),Ze()),i&2){let r=f();l(),u("ngIf",!r.templates.treeNodeFullTemplate),l(),u("ngTemplateOutlet",r.templates.treeNodeFullTemplate)("ngTemplateOutletContext",hi(3,Ps,r.node,r.node,r.index,r.templates))}}var Ka=["loadingTemplate"],Ya=["treeNodeTemplate"],Xa=["treeNodeWrapperTemplate"],Qa=["treeNodeFullTemplate"],Ja=["viewport"],Za=(i,e,r,t)=>({loadingTemplate:i,treeNodeTemplate:e,treeNodeWrapperTemplate:r,treeNodeFullTemplate:t});function e1(i,e){if(i&1&&g(0,"tree-node-collection",4),i&2){let r=f();u("nodes",r.treeModel.roots)("treeModel",r.treeModel)("templates",hi(3,Za,r.loadingTemplate,r.treeNodeTemplate,r.treeNodeWrapperTemplate,r.treeNodeFullTemplate))}}function t1(i,e){if(i&1&&g(0,"tree-node-drop-slot",5),i&2){let r=f();u("dropIndex",0)("node",r.treeModel.virtualRoot)}}var Ht=(()=>{let e=class e{constructor(){this.templateRef=p(Zi),this.viewContainer=p(en),this.templateBindings={}}ngOnInit(){this.view=this.viewContainer.createEmbeddedView(this.templateRef),this.dispose&&this.dispose(),this.shouldDetach()&&this.view.detach(),this.autoDetect(this.view)}shouldDetach(){return this.treeMobxAutorun&&this.treeMobxAutorun.detach}autoDetect(t){this.dispose=ai(()=>t.detectChanges())}ngOnDestroy(){this.dispose&&this.dispose()}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=xe({type:e,selectors:[["","treeMobxAutorun",""]],inputs:{treeMobxAutorun:"treeMobxAutorun"}});let i=e;return i})(),Y={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,SPACE:32,CONTEXT_MENU:32},B={TOGGLE_ACTIVE:(i,e,r)=>e&&e.toggleActivated(),TOGGLE_ACTIVE_MULTI:(i,e,r)=>e&&e.toggleActivated(!0),TOGGLE_SELECTED:(i,e,r)=>e&&e.toggleSelected(),ACTIVATE:(i,e,r)=>e.setIsActive(!0),DEACTIVATE:(i,e,r)=>e.setIsActive(!1),SELECT:(i,e,r)=>e.setIsSelected(!0),DESELECT:(i,e,r)=>e.setIsSelected(!1),FOCUS:(i,e,r)=>e.focus(),TOGGLE_EXPANDED:(i,e,r)=>e.hasChildren&&e.toggleExpanded(),EXPAND:(i,e,r)=>e.expand(),COLLAPSE:(i,e,r)=>e.collapse(),DRILL_DOWN:(i,e,r)=>i.focusDrillDown(),DRILL_UP:(i,e,r)=>i.focusDrillUp(),NEXT_NODE:(i,e,r)=>i.focusNextNode(),PREVIOUS_NODE:(i,e,r)=>i.focusPreviousNode(),MOVE_NODE:(i,e,r,{from:t,to:n})=>{r.ctrlKey?i.copyNode(t,n):i.moveNode(t,n)}},Rt={mouse:{click:B.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:B.TOGGLE_EXPANDED,checkboxClick:B.TOGGLE_SELECTED,drop:B.MOVE_NODE},keys:{[Y.RIGHT]:B.DRILL_DOWN,[Y.LEFT]:B.DRILL_UP,[Y.DOWN]:B.NEXT_NODE,[Y.UP]:B.PREVIOUS_NODE,[Y.SPACE]:B.TOGGLE_ACTIVE,[Y.ENTER]:B.TOGGLE_ACTIVE}},Ui=class{get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return this.options.scrollOnActivate===void 0?!0:this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return this.options.useTriState===void 0?!0:this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return this.options.allowDragoverStyling===void 0?!0:this.options.allowDragoverStyling}constructor(e={}){this.options=e,this.actionMapping={mouse:{click:this.options?.actionMapping?.mouse?.click??Rt.mouse.click,dblClick:this.options?.actionMapping?.mouse?.dblClick??Rt.mouse.dblClick,contextMenu:this.options?.actionMapping?.mouse?.contextMenu??Rt.mouse.contextMenu,expanderClick:this.options?.actionMapping?.mouse?.expanderClick??Rt.mouse.expanderClick,checkboxClick:this.options?.actionMapping?.mouse?.checkboxClick??Rt.mouse.checkboxClick,drop:this.options?.actionMapping?.mouse?.drop??Rt.mouse.drop,dragStart:this.options?.actionMapping?.mouse?.dragStart??void 0,drag:this.options?.actionMapping?.mouse?.drag??void 0,dragEnd:this.options?.actionMapping?.mouse?.dragEnd??void 0,dragOver:this.options?.actionMapping?.mouse?.dragOver??void 0,dragLeave:this.options?.actionMapping?.mouse?.dragLeave??void 0,dragEnter:this.options?.actionMapping?.mouse?.dragEnter??void 0,mouseOver:this.options?.actionMapping?.mouse?.mouseOver??void 0,mouseOut:this.options?.actionMapping?.mouse?.mouseOut??void 0},keys:{[Y.RIGHT]:B.DRILL_DOWN,[Y.LEFT]:B.DRILL_UP,[Y.DOWN]:B.NEXT_NODE,[Y.UP]:B.PREVIOUS_NODE,[Y.SPACE]:B.TOGGLE_ACTIVE,[Y.ENTER]:B.TOGGLE_ACTIVE}},this.options?.actionMapping?.keys&&(this.actionMapping.keys=oe(oe({},this.actionMapping.keys),this.options.actionMapping.keys)),e.rtl&&(this.actionMapping.keys[Y.RIGHT]=e.actionMapping?.keys[Y.RIGHT]||B.DRILL_UP,this.actionMapping.keys[Y.LEFT]=e.actionMapping?.keys[Y.LEFT]||B.DRILL_DOWN)}getNodeClone(e){if(this.options.getNodeClone)return this.options.getNodeClone(e);let r=Object.assign({},e.data);return r.id&&delete r.id,r}allowDrop(e,r,t){return this.options.allowDrop instanceof Function?this.options.allowDrop(e,r,t):this.options.allowDrop===void 0?!0:this.options.allowDrop}allowDrag(e){return this.options.allowDrag instanceof Function?this.options.allowDrag(e):this.options.allowDrag}nodeClass(e){return this.options.nodeClass?this.options.nodeClass(e):""}nodeHeight(e){if(e.data.virtual)return 0;let r=this.options.nodeHeight||22;return typeof r=="function"&&(r=r(e)),r+(e.index===0?2:1)*this.dropSlotHeight}get dropSlotHeight(){return typeof this.options.dropSlotHeight=="number"?this.options.dropSlotHeight:2}},$={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"},X=function(i,e,r,t){var n=arguments.length,s=n<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,r,t);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},q=class i{get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children.some(e=>e.isSelected)}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children.every(e=>e.isAllSelected)}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw`Element Ref is no longer supported since introducing virtual scroll
|
|
17
|
-
|
|
18
|
-
You may use a template to obtain a reference to the element`}get originalNode(){return this._originalNode}constructor(e,r,t,n){this.data=e,this.parent=r,this.treeModel=t,this.position=0,this.allowDrop=(s,o)=>this.options.allowDrop(s,{parent:this,index:0},o),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,(this.id===void 0||this.id===null)&&(this.id=i1()),this.index=n,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(e){this.treeModel.fireEvent(e)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(e){this.setField("id",e)}getField(e){return this.data[this.options[`${e}Field`]]}setField(e,r){this.data[this.options[`${e}Field`]]=r}_findAdjacentSibling(e,r=!1){let t=this._getParentsChildren(r),n=t.indexOf(this);return t.length>n+e?t[n+e]:null}findNextSibling(e=!1){return this._findAdjacentSibling(1,e)}findPreviousSibling(e=!1){return this._findAdjacentSibling(-1,e)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(e=>!e.isHidden)}getFirstChild(e=!1){let r=e?this.visibleChildren:this.children;return r!=null&&r.length?r[0]:null}getLastChild(e=!1){let r=e?this.visibleChildren:this.children;return r!=null&&r.length?r[r.length-1]:null}findNextNode(e=!0,r=!1){return e&&this.isExpanded&&this.getFirstChild(r)||this.findNextSibling(r)||this.parent&&this.parent.findNextNode(!1,r)}findPreviousNode(e=!1){let r=this.findPreviousSibling(e);return r?r._getLastOpenDescendant(e):this.realParent}_getLastOpenDescendant(e=!1){let r=this.getLastChild(e);return this.isCollapsed||!r?this:r._getLastOpenDescendant(e)}_getParentsChildren(e=!1){return this.parent&&(e?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(e=!1){return this._getParentsChildren(e).indexOf(this)}isDescendantOf(e){return this===e?!0:this.parent&&this.parent.isDescendantOf(e)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),`tree-node-level-${this.level}`].join(" ")}onDrop(e){this.mouseAction("drop",e.event,{from:e.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(e=>{e&&(this.setField("children",e),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(r=>{r.getField("isExpanded")&&r.hasChildren&&r.expand()}))}).then(()=>{this.fireEvent({eventName:$.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(e){Promise.resolve(e(this)).then(()=>{this.children&&this.children.forEach(r=>r.doForAll(e))})}expandAll(){this.doForAll(e=>e.expand())}collapseAll(){this.doForAll(e=>e.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(e){return this.hasChildren&&this.treeModel.setExpandedNode(this,e),this}autoLoadChildren(){this.handler=dt(()=>this.isExpanded,e=>{!this.children&&this.hasChildren&&e&&this.loadNodeChildren()},{fireImmediately:!0})}dispose(){this.children&&this.children.forEach(e=>e.dispose()),this.handler&&this.handler(),this.parent=null,this.children=null}setIsActive(e,r=!1){return this.treeModel.setActiveNode(this,e,r),e&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(e){return this.isSelectable()?this.treeModel.setSelectedNode(this,e):this.visibleChildren.forEach(r=>r.setIsSelected(e)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(e=!1){return this.setIsActive(!this.isActive,e),this}setActiveAndVisible(e=!1){return this.setIsActive(!0,e).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(e=!1){this.treeModel.virtualScroll.scrollIntoView(this,e)}focus(e=!0){let r=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),e&&this.scrollIntoView(),r&&this.fireEvent({eventName:$.blur,node:r}),this.fireEvent({eventName:$.focus,node:this}),this}blur(){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),e&&this.fireEvent({eventName:$.blur,node:this}),this}setIsHidden(e){this.treeModel.setIsHidden(this,e)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(e,r,t=null){this.treeModel.setFocus(!0);let s=this.options.actionMapping.mouse[e];s&&s(this.treeModel,this,r,t)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((e,r)=>new i(e,this,this.treeModel,r))}};X([U],q.prototype,"isHidden",null);X([U],q.prototype,"isExpanded",null);X([U],q.prototype,"isActive",null);X([U],q.prototype,"isFocused",null);X([U],q.prototype,"isSelected",null);X([U],q.prototype,"isAllSelected",null);X([U],q.prototype,"isPartiallySelected",null);X([M],q.prototype,"children",void 0);X([M],q.prototype,"index",void 0);X([M],q.prototype,"position",void 0);X([M],q.prototype,"height",void 0);X([U],q.prototype,"level",null);X([U],q.prototype,"path",null);X([U],q.prototype,"visibleChildren",null);X([w],q.prototype,"setIsSelected",null);X([w],q.prototype,"_initChildren",null);function i1(){return Math.floor(Math.random()*1e13)}var A=function(i,e,r,t){var n=arguments.length,s=n<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,r,t);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},E=(()=>{let e=class e{constructor(){this.options=new Ui,this.eventNames=Object.keys($),this.expandedNodeIds={},this.selectedLeafNodeIds={},this.activeNodeIds={},this.hiddenNodeIds={},this.focusedNodeId=null,this.firstUpdate=!0,this.subscriptions=[]}fireEvent(t){t.treeModel=this,this.events[t.eventName].emit(t),this.events.event.emit(t)}subscribe(t,n){let s=this.events[t].subscribe(n);this.subscriptions.push(s)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this.virtualRoot.visibleChildren}getFirstRoot(t=!1){let n=t?this.getVisibleRoots():this.roots;return n!=null&&n.length?n[0]:null}getLastRoot(t=!1){let n=t?this.getVisibleRoots():this.roots;return n!=null&&n.length?n[n.length-1]:null}get isFocused(){return e.focusedTree===this}isNodeFocused(t){return this.focusedNode===t}isEmptyTree(){return this.roots&&this.roots.length===0}get focusedNode(){return this.focusedNodeId?this.getNodeById(this.focusedNodeId):null}get expandedNodes(){return Object.keys(this.expandedNodeIds).filter(n=>this.expandedNodeIds[n]).map(n=>this.getNodeById(n)).filter(Boolean)}get activeNodes(){return Object.keys(this.activeNodeIds).filter(n=>this.activeNodeIds[n]).map(n=>this.getNodeById(n)).filter(Boolean)}get hiddenNodes(){return Object.keys(this.hiddenNodeIds).filter(n=>this.hiddenNodeIds[n]).map(n=>this.getNodeById(n)).filter(Boolean)}get selectedLeafNodes(){return Object.keys(this.selectedLeafNodeIds).filter(n=>this.selectedLeafNodeIds[n]).map(n=>this.getNodeById(n)).filter(Boolean)}getNodeByPath(t,n=null){if(!t)return null;if(n=n||this.virtualRoot,t.length===0)return n;if(!n.children)return null;let s=t.shift(),o=n.children.find(a=>a.id===s);return o?this.getNodeByPath(t,o):null}getNodeById(t){let n=t.toString();return this.getNodeBy(s=>s.id.toString()===n)}getNodeBy(t,n=null){if(n=n||this.virtualRoot,!n.children)return null;let s=n.children.find(t);if(s)return s;for(let o of n.children){let a=this.getNodeBy(t,o);if(a)return a}}isExpanded(t){return this.expandedNodeIds[t.id]}isHidden(t){return this.hiddenNodeIds[t.id]}isActive(t){return this.activeNodeIds[t.id]}isSelected(t){return this.selectedLeafNodeIds[t.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){this.virtualRoot&&this.virtualRoot.dispose()}unsubscribeAll(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}setData({nodes:t,options:n=null,events:s=null}){n&&(this.options=new Ui(n)),s&&(this.events=s),t&&(this.nodes=t),this.update()}update(){let t={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose(),this.virtualRoot=new q(t,null,this,0),this.roots=this.virtualRoot.children,this.firstUpdate?this.roots&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:$.updateData})}setFocusedNode(t){this.focusedNodeId=t?t.id:null}setFocus(t){e.focusedTree=t?this:null}doForAll(t){this.roots.forEach(n=>n.doForAll(t))}focusNextNode(){let t=this.getFocusedNode(),n=t?t.findNextNode(!0,!0):this.getFirstRoot(!0);n&&n.focus()}focusPreviousNode(){let t=this.getFocusedNode(),n=t?t.findPreviousNode(!0):this.getLastRoot(!0);n&&n.focus()}focusDrillDown(){let t=this.getFocusedNode();if(t&&t.isCollapsed&&t.hasChildren)t.toggleExpanded();else{let n=t?t.getFirstChild(!0):this.getFirstRoot(!0);n&&n.focus()}}focusDrillUp(){let t=this.getFocusedNode();if(t)if(t.isExpanded)t.toggleExpanded();else{let n=t.realParent;n&&n.focus()}}setActiveNode(t,n,s=!1){s?this._setActiveNodeMulti(t,n):this._setActiveNodeSingle(t,n),n?(t.focus(this.options.scrollOnActivate),this.fireEvent({eventName:$.activate,node:t}),this.fireEvent({eventName:$.nodeActivate,node:t})):(this.fireEvent({eventName:$.deactivate,node:t}),this.fireEvent({eventName:$.nodeDeactivate,node:t}))}setSelectedNode(t,n){this.selectedLeafNodeIds=Object.assign({},this.selectedLeafNodeIds,{[t.id]:n}),n?(t.focus(),this.fireEvent({eventName:$.select,node:t})):this.fireEvent({eventName:$.deselect,node:t})}setExpandedNode(t,n){this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[t.id]:n}),this.fireEvent({eventName:$.toggleExpanded,node:t,isExpanded:n})}expandAll(){this.roots.forEach(t=>t.expandAll())}collapseAll(){this.roots.forEach(t=>t.collapseAll())}setIsHidden(t,n){this.hiddenNodeIds=Object.assign({},this.hiddenNodeIds,{[t.id]:n})}setHiddenNodeIds(t){this.hiddenNodeIds=t.reduce((n,s)=>Object.assign(n,{[s]:!0}),{})}performKeyAction(t,n){let s=this.options.actionMapping.keys[n.keyCode];return s?(n.preventDefault(),s(this,t,n),!0):!1}filterNodes(t,n=!0){let s;if(!t)return this.clearFilter();if(t&&typeof t.valueOf()=="string")s=a=>a.displayField.toLowerCase().indexOf(t.toLowerCase())!==-1;else if(t&&typeof t=="function")s=t;else{console.error("Don't know what to do with filter",t),console.error("Should be either a string or function");return}let o={};this.roots.forEach(a=>this._filterNode(o,a,s,n)),this.hiddenNodeIds=o,this.fireEvent({eventName:$.changeFilter})}clearFilter(){this.hiddenNodeIds={},this.fireEvent({eventName:$.changeFilter})}moveNode(t,n){let s=t.getIndexInParent(),o=t.parent;if(!this.canMoveNode(t,n,s))return;let a=o.getField("children");n.parent.getField("children")||n.parent.setField("children",[]);let m=n.parent.getField("children"),C=a.splice(s,1)[0],I=o===n.parent&&n.index>s?n.index-1:n.index;m.splice(I,0,C),o.treeModel.update(),n.parent.treeModel!==o.treeModel&&n.parent.treeModel.update(),this.fireEvent({eventName:$.moveNode,node:C,to:{parent:n.parent.data,index:I},from:{parent:o.data,index:s}})}copyNode(t,n){let s=t.getIndexInParent();if(!this.canMoveNode(t,n,s))return;n.parent.getField("children")||n.parent.setField("children",[]);let o=n.parent.getField("children"),a=this.options.getNodeClone(t);o.splice(n.index,0,a),t.treeModel.update(),n.parent.treeModel!==t.treeModel&&n.parent.treeModel.update(),this.fireEvent({eventName:$.copyNode,node:a,to:{parent:n.parent.data,index:n.index}})}getState(){return{expandedNodeIds:this.expandedNodeIds,selectedLeafNodeIds:this.selectedLeafNodeIds,activeNodeIds:this.activeNodeIds,hiddenNodeIds:this.hiddenNodeIds,focusedNodeId:this.focusedNodeId}}setState(t){t&&Object.assign(this,{expandedNodeIds:t.expandedNodeIds||{},selectedLeafNodeIds:t.selectedLeafNodeIds||{},activeNodeIds:t.activeNodeIds||{},hiddenNodeIds:t.hiddenNodeIds||{},focusedNodeId:t.focusedNodeId})}subscribeToState(t){ai(()=>t(this.getState()))}canMoveNode(t,n,s=void 0){let o=s||t.getIndexInParent();return t.parent===n.parent&&s===n.index?!1:!n.parent.isDescendantOf(t)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(t,n,s,o){let a=s(n);return n.children&&n.children.forEach(m=>{this._filterNode(t,m,s,o)&&(a=!0)}),a||(t[n.id]=!0),o&&a&&n.ensureVisible(),a}_calculateExpandedNodes(t=null){t=t||this.virtualRoot,t.data[this.options.isExpandedField]&&(this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[t.id]:!0})),t.children&&t.children.forEach(n=>this._calculateExpandedNodes(n))}_setActiveNodeSingle(t,n){this.activeNodes.filter(s=>s!==t).forEach(s=>{this.fireEvent({eventName:$.deactivate,node:s}),this.fireEvent({eventName:$.nodeDeactivate,node:s})}),n?this.activeNodeIds={[t.id]:!0}:this.activeNodeIds={}}_setActiveNodeMulti(t,n){this.activeNodeIds=Object.assign({},this.activeNodeIds,{[t.id]:n})}};e.focusedTree=null,e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac});let i=e;return i})();A([M],E.prototype,"roots",void 0);A([M],E.prototype,"expandedNodeIds",void 0);A([M],E.prototype,"selectedLeafNodeIds",void 0);A([M],E.prototype,"activeNodeIds",void 0);A([M],E.prototype,"hiddenNodeIds",void 0);A([M],E.prototype,"focusedNodeId",void 0);A([M],E.prototype,"virtualRoot",void 0);A([U],E.prototype,"focusedNode",null);A([U],E.prototype,"expandedNodes",null);A([U],E.prototype,"activeNodes",null);A([U],E.prototype,"hiddenNodes",null);A([U],E.prototype,"selectedLeafNodes",null);A([w],E.prototype,"setData",null);A([w],E.prototype,"update",null);A([w],E.prototype,"setFocusedNode",null);A([w],E.prototype,"setFocus",null);A([w],E.prototype,"doForAll",null);A([w],E.prototype,"focusNextNode",null);A([w],E.prototype,"focusPreviousNode",null);A([w],E.prototype,"focusDrillDown",null);A([w],E.prototype,"focusDrillUp",null);A([w],E.prototype,"setActiveNode",null);A([w],E.prototype,"setSelectedNode",null);A([w],E.prototype,"setExpandedNode",null);A([w],E.prototype,"expandAll",null);A([w],E.prototype,"collapseAll",null);A([w],E.prototype,"setIsHidden",null);A([w],E.prototype,"setHiddenNodeIds",null);A([w],E.prototype,"filterNodes",null);A([w],E.prototype,"clearFilter",null);A([w],E.prototype,"moveNode",null);A([w],E.prototype,"copyNode",null);A([w],E.prototype,"setState",null);var Dn=(()=>{let e=class e{constructor(){this._draggedElement=null}set(t){this._draggedElement=t}get(){return this._draggedElement}isDragging(){return!!this.get()}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),Le=function(i,e,r,t){var n=arguments.length,s=n<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,r,t);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},ws=500,ji=150,pe=(()=>{let e=class e{get y(){return this.yBlocks*ji}get totalHeight(){return this.treeModel.virtualRoot?this.treeModel.virtualRoot.height:0}constructor(){this.treeModel=p(E),this.yBlocks=0,this.x=0,this.viewportHeight=null,this.viewport=null;let t=this.treeModel;t.virtualScroll=this,this._dispose=[ai(()=>this.fixScroll())]}fireEvent(t){this.treeModel.fireEvent(t)}init(){let t=this.recalcPositions.bind(this);t(),this._dispose=[...this._dispose,dt(()=>this.treeModel.roots,t),dt(()=>this.treeModel.expandedNodeIds,t),dt(()=>this.treeModel.hiddenNodeIds,t)],this.treeModel.subscribe($.loadNodeChildren,t)}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(t){this.yBlocks=t}recalcPositions(){this.treeModel.virtualRoot.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0)}_getPositionAfter(t,n){let s=n;return t.forEach(o=>{o.position=s,s=this._getPositionAfterNode(o,s)}),s}_getPositionAfterNode(t,n){let s=t.getSelfHeight()+n;return t.children&&t.isExpanded&&(s=this._getPositionAfter(t.visibleChildren,s)),t.height=s-n,s}clear(){this._dispose.forEach(t=>t())}setViewport(t){Object.assign(this,{viewport:t,x:t.scrollLeft,yBlocks:Math.round(t.scrollTop/ji),viewportHeight:t.getBoundingClientRect?t.getBoundingClientRect().height:0})}scrollIntoView(t,n,s=!0){if(t.options.scrollContainer){let o=t.options.scrollContainer,a=o.getBoundingClientRect().height,m=o.getBoundingClientRect().top,C=this.viewport.getBoundingClientRect().top+t.position-m;(n||C<o.scrollTop||C+t.getSelfHeight()>o.scrollTop+a)&&(o.scrollTop=s?C-a/2:C)}else(n||t.position<this.y||t.position+t.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=s?t.position-this.viewportHeight/2:t.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/ji)))}getViewportNodes(t){if(!t)return[];let n=t.filter(C=>!C.isHidden);if(!this.isEnabled())return n;if(!this.viewportHeight||!n.length)return[];let s=n.slice(-1)[0];if(!s.height&&s.position===0)return[];let o=As(n,C=>C.position+ws>this.y||C.position+C.height>this.y),a=As(n,C=>C.position-ws>this.y+this.viewportHeight,o),m=[];for(let C=o;C<=a;C++)m.push(n[C]);return m}fixScroll(){let t=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>t&&this._setYBlocks(t/ji)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac});let i=e;return i})();Le([M],pe.prototype,"yBlocks",void 0);Le([M],pe.prototype,"x",void 0);Le([M],pe.prototype,"viewportHeight",void 0);Le([U],pe.prototype,"y",null);Le([U],pe.prototype,"totalHeight",null);Le([w],pe.prototype,"_setYBlocks",null);Le([w],pe.prototype,"recalcPositions",null);Le([w],pe.prototype,"setViewport",null);Le([w],pe.prototype,"scrollIntoView",null);function As(i,e,r=0){let t=r,n=i.length-1;for(;t!==n;){let s=Math.floor((t+n)/2);e(i[s])?n=s:t===s?t=n:t=s}return t}var n1=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-loading-component"]],inputs:{template:"template",node:"node"},decls:2,vars:5,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,s){n&1&&(P(0,Da,2,0,"span",0),Ie(1,1)),n&2&&(u("ngIf",!s.template),l(),u("ngTemplateOutlet",s.template)("ngTemplateOutletContext",bt(3,Aa,s.node)))},dependencies:[Ve,nt],encapsulation:2});let i=e;return i})(),r1=(()=>{let e=class e{constructor(){this.elementRef=p(ae),this.virtualScroll=p(pe),this.setViewport=this.throttle(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init()}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:$.initialized})}),this.elementRef.nativeElement.addEventListener("scroll",this.scrollEventHandler)}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}throttle(t,n){let s=0;return function(){let o=Date.now();o-s>=n&&(t(),s=o)}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-viewport"]],features:[tt([pe])],ngContentSelectors:Na,decls:1,vars:2,consts:[[4,"treeMobxAutorun"]],template:function(n,s){n&1&&(Wt(),P(0,Oa,3,2,"ng-container",0)),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:[Ht],encapsulation:2});let i=e;return i})();function s1(...i){return w(...i)}var o1=Object.assign(s1,w);function a1(...i){return U(...i)}var l1=Object.assign(a1,U);function c1(...i){return M(...i)}var Ds=Object.assign(c1,M),Ns="is-dragging-over",Os="is-dragging-over-disabled",Ls=(()=>{let e=class e{set treeAllowDrop(t){t instanceof Function?this._allowDrop=t:this._allowDrop=(n,s)=>t}allowDrop(t){return this._allowDrop(this.treeDraggedElement.get(),t)}constructor(){this.el=p(ae),this.renderer=p(ht),this.treeDraggedElement=p(Dn),this.ngZone=p(Ut),this.allowDragoverStyling=!0,this.onDropCallback=new L,this.onDragOverCallback=new L,this.onDragLeaveCallback=new L,this.onDragEnterCallback=new L,this._allowDrop=(t,n)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this)}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("dragover",this.dragOverEventHandler),t.addEventListener("dragenter",this.dragEnterEventHandler),t.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let t=this.el.nativeElement;t.removeEventListener("dragover",this.dragOverEventHandler),t.removeEventListener("dragenter",this.dragEnterEventHandler),t.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(t){if(!this.allowDrop(t))return this.allowDragoverStyling?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:t,element:this.treeDraggedElement.get()}),t.preventDefault(),this.allowDragoverStyling&&this.addClass()}onDragEnter(t){this.allowDrop(t)&&(t.preventDefault(),this.onDragEnterCallback.emit({event:t,element:this.treeDraggedElement.get()}))}onDragLeave(t){if(!this.allowDrop(t))return this.allowDragoverStyling?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass()}onDrop(t){this.allowDrop(t)&&(t.preventDefault(),this.onDropCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,Ns)}removeClass(){this.renderer.removeClass(this.el.nativeElement,Ns)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,Os)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,Os)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=xe({type:e,selectors:[["","treeDrop",""]],hostBindings:function(n,s){n&1&&b("drop",function(a){return s.onDrop(a)})},inputs:{allowDragoverStyling:"allowDragoverStyling",treeAllowDrop:"treeAllowDrop"},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}});let i=e;return i})(),zs=(()=>{let e=class e{onDrop(t){this.node.mouseAction("drop",t.event,{from:t.element,to:{parent:this.node,index:this.dropIndex}})}allowDrop(t,n){return this.node.options.allowDrop(t,{parent:this.node,index:this.dropIndex},n)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:"node",dropIndex:"dropIndex"},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeDrop","treeAllowDrop","allowDragoverStyling"]],template:function(n,s){n&1&&(c(0,"div",0),b("treeDrop",function(a){return s.onDrop(a)}),d()),n&2&&u("treeAllowDrop",s.allowDrop.bind(s))("allowDragoverStyling",!0)},dependencies:[Ls],encapsulation:2});let i=e;return i})(),d1=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-checkbox"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["type","checkbox",1,"tree-node-checkbox",3,"click","checked","indeterminate"]],template:function(n,s){n&1&&P(0,Ta,2,2,"ng-container",0),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:[Ht],encapsulation:2});let i=e;return i})(),Nn=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-expander"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["class","toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed","click",4,"ngIf"],["class","toggle-children-placeholder",4,"ngIf"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"],[1,"toggle-children-placeholder"]],template:function(n,s){n&1&&P(0,za,3,2,"ng-container",0),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:[Ht,Ve],encapsulation:2});let i=e;return i})();var u1=(()=>{let e=class e{constructor(){this.el=p(ae),this.renderer=p(ht),this.treeDraggedElement=p(Dn),this.ngZone=p(Ut),this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(t){t.dataTransfer.setData("text",t.target.id),this.treeDraggedElement.set(this.draggedElement),this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragStart",t)}onDrag(t){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("drag",t)}onDragEnd(){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=xe({type:e,selectors:[["","treeDrag",""]],hostBindings:function(n,s){n&1&&b("dragstart",function(a){return s.onDragStart(a)})("dragend",function(){return s.onDragEnd()})},inputs:{draggedElement:[0,"treeDrag","draggedElement"],treeDragEnabled:"treeDragEnabled"}});let i=e;return i})(),On=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-content"]],inputs:{node:"node",index:"index",template:"template"},decls:2,vars:7,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,s){n&1&&(P(0,ka,2,1,"span",0),Ie(1,1)),n&2&&(u("ngIf",!s.template),l(),u("ngTemplateOutlet",s.template)("ngTemplateOutletContext",Wn(3,Ia,s.node,s.node,s.index)))},dependencies:[Ve,nt],encapsulation:2});let i=e;return i})(),f1=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-wrapper"]],inputs:{node:"node",index:"index",templates:"templates"},decls:2,vars:8,consts:[["class","node-wrapper",3,"padding-left",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node",4,"ngIf"],[3,"node"],[1,"node-content-wrapper",3,"click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter","treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled"],[3,"node","index","template"]],template:function(n,s){n&1&&(P(0,Ra,5,15,"div",0),Ie(1,1)),n&2&&(u("ngIf",!s.templates.treeNodeWrapperTemplate),l(),u("ngTemplateOutlet",s.templates.treeNodeWrapperTemplate)("ngTemplateOutletContext",hi(3,Ps,s.node,s.node,s.index,s.templates)))},dependencies:[Ve,d1,Nn,u1,Ls,On,nt],encapsulation:2});let i=e;return i})(),Ts=1.005,p1=(()=>{let e=class e{constructor(){this.renderer=p(ht),this.templateRef=p(Zi),this.viewContainerRef=p(en)}set isOpen(t){t?(this._show(),this.isEnabled&&this._isOpen===!1&&this._animateOpen()):this.isEnabled?this._animateClose():this._hide(),this._isOpen=!!t}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let t=this.animateSpeed,n=this.animateAcceleration,s=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{let o=setInterval(()=>{if(!this._isOpen||!this.innerElement)return clearInterval(o);s+=t;let a=Math.round(s);this.renderer.setStyle(this.innerElement,"max-height",`${a}px`);let m=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;t*=n,n*=Ts,m<a&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(o))},17)})}_animateClose(){if(!this.innerElement)return;let t=this.animateSpeed,n=this.animateAcceleration,s=this.innerElement.getBoundingClientRect().height,o=setInterval(()=>{if(this._isOpen||!this.innerElement)return clearInterval(o);s-=t,this.renderer.setStyle(this.innerElement,"max-height",`${s}px`),t*=n,n*=Ts,s<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(o))},17)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=xe({type:e,selectors:[["","treeAnimateOpen",""]],inputs:{animateSpeed:[0,"treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:[0,"treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:[0,"treeAnimateOpenEnabled","isEnabled"],isOpen:[0,"treeAnimateOpen","isOpen"]}});let i=e;return i})(),Gi=function(i,e,r,t){var n=arguments.length,s=n<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,r,t);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},h1=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-children"]],inputs:{node:"node",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel",4,"ngIf"],["class","tree-node-loading",3,"padding-left","template","node",4,"ngIf"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"template","node"]],template:function(n,s){n&1&&P(0,ja,2,4,"ng-container",0),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:()=>[Ht,p1,Ve,Is,n1],encapsulation:2});let i=e;return i})(),Is=(()=>{let e=class e{constructor(){this._dispose=[]}get nodes(){return this._nodes}set nodes(t){this.setNodes(t)}get marginTop(){let t=this.viewportNodes&&this.viewportNodes.length&&this.viewportNodes[0];return`${t&&t.parent?t.position-t.parent.position-t.parent.getSelfHeight():0}px`}setNodes(t){this._nodes=t}ngOnInit(){this.virtualScroll=this.treeModel.virtualScroll,this._dispose=[dt(()=>this.virtualScroll.getViewportNodes(this.nodes).map(t=>t.index),t=>{this.viewportNodes=t.map(n=>this.nodes[n])},{compareStructural:!0,fireImmediately:!0}),dt(()=>this.nodes,t=>{this.viewportNodes=this.virtualScroll.getViewportNodes(t)})]}ngOnDestroy(){this._dispose.forEach(t=>t())}trackNode(t,n){return n.id}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["tree-node-collection"]],inputs:{nodes:"nodes",treeModel:"treeModel",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"node","index","templates",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","index","templates"]],template:function(n,s){n&1&&P(0,Ua,3,4,"ng-container",0),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:()=>[Ht,Yn,m1],encapsulation:2});let i=e;return Gi([Ds],i.prototype,"_nodes",void 0),Gi([Ds],i.prototype,"viewportNodes",void 0),Gi([l1],i.prototype,"marginTop",null),Gi([o1],i.prototype,"setNodes",null),i})(),m1=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["TreeNode"],["tree-node"]],inputs:{node:"node",index:"index",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node",4,"ngIf"],[3,"node","index","templates"],[3,"node","templates"],[3,"dropIndex","node"]],template:function(n,s){n&1&&P(0,Wa,3,8,"ng-container",0),n&2&&u("treeMobxAutorun",it(1,Vt))},dependencies:[Ht,Ve,zs,f1,h1,nt],encapsulation:2});let i=e;return i})(),ks=(()=>{let e=class e{set nodes(t){}set options(t){}set focused(t){this.treeModel.setFocus(t)}set state(t){this.treeModel.setState(t)}constructor(){this.treeModel=p(E),this.treeDraggedElement=p(Dn);let t=this.treeModel;t.eventNames.forEach(n=>this[n]=new L),t.subscribeToState(n=>this.stateChange.emit(n))}onKeydown(t){if(!this.treeModel.isFocused||["input","textarea"].includes(document.activeElement.tagName.toLowerCase()))return;let n=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(n,t)}onMousedown(t){function n(s,o){return s?s.localName===o?!1:n(s.parentElement,o):!0}n(t.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(t){(t.options||t.nodes)&&this.treeModel.setData({options:t.options&&t.options.currentValue,nodes:t.nodes&&t.nodes.currentValue,events:this.pick(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}pick(t,n){return n.reduce((s,o)=>(t&&t.hasOwnProperty(o)&&(s[o]=t[o]),s),{})}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["Tree"],["tree-root"]],contentQueries:function(n,s,o){if(n&1&&(et(o,Ka,5),et(o,Ya,5),et(o,Xa,5),et(o,Qa,5)),n&2){let a;J(a=Z())&&(s.loadingTemplate=a.first),J(a=Z())&&(s.treeNodeTemplate=a.first),J(a=Z())&&(s.treeNodeWrapperTemplate=a.first),J(a=Z())&&(s.treeNodeFullTemplate=a.first)}},viewQuery:function(n,s){if(n&1&&Me(Ja,5),n&2){let o;J(o=Z())&&(s.viewportComponent=o.first)}},hostBindings:function(n,s){n&1&&b("keydown",function(a){return s.onKeydown(a)},Ji)("mousedown",function(a){return s.onMousedown(a)},Ji)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[tt([E]),Qe],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(n,s){n&1&&(c(0,"tree-viewport",null,0)(2,"div",1),P(3,e1,1,8,"tree-node-collection",2)(4,t1,1,2,"tree-node-drop-slot",3),d()()),n&2&&(l(2),V("node-dragging",s.treeDraggedElement.isDragging())("angular-tree-component-rtl",s.treeModel.options.rtl),l(),u("ngIf",s.treeModel.roots),l(),u("ngIf",s.treeModel.isEmptyTree()))},dependencies:[r1,Ve,Is,zs],encapsulation:2});let i=e;return i})(),Fs=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ge({type:e}),e.\u0275inj=he({imports:[be]});let i=e;return i})();var x=(function(i){return i.MAKE="make",i.COPY="copy",i.MOVE="move",i.DELETE="delete",i.COMPRESS="compress",i.DECOMPRESS="decompress",i.DOWNLOAD="download",i.UPLOAD="upload",i.TOUCH="touch",i.THUMBNAIL="thumbnail",i})(x||{});var $l=".selected",ql="drag-over";var $i=(()=>{let e=class e{constructor(){this.overFlowX="hidden",this.resizeOffset=80,this.useMaxHeight=!0,this.elementRef=p(ae),this.renderer=p(ht),this.layout=p(H),this.renderer.setStyle(this.elementRef.nativeElement,"overflow-y","auto"),this.renderer.setStyle(this.elementRef.nativeElement,"scrollbar-width","thin"),this.resizeSubscription=this.layout.resizeEvent.pipe(jn(1)).subscribe(()=>this.onResize())}ngAfterViewInit(){this.renderer.setStyle(this.elementRef.nativeElement,"overflow-x",this.overFlowX),this.onResize()}ngOnDestroy(){this.resizeSubscription.unsubscribe()}scrollTop(){this.renderer.setProperty(this.elementRef.nativeElement,"scrollTop","0")}scrollIntoView(t=0){setTimeout(()=>this.elementRef.nativeElement.scrollTo({left:0,top:t,behavior:"smooth"}),50)}onResize(){this.renderer.setStyle(this.elementRef.nativeElement,this.useMaxHeight?"max-height":"height",`${window.innerHeight-this.resizeOffset-1}px`)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=xe({type:e,selectors:[["","appAutoResize",""]],inputs:{overFlowX:"overFlowX",resizeOffset:"resizeOffset",useMaxHeight:"useMaxHeight"}});let i=e;return i})();var W={BASE:Sr.BASE,OPERATION:"operation",TASK_OPERATION:"task/operation",TASKS:"tasks",TASKS_DOWNLOAD:"download",RECENTS:"recents",SEARCH:"search",ONLY_OFFICE:"onlyoffice",ONLY_OFFICE_SETTINGS:"settings",ONLY_OFFICE_DOCUMENT:"document",ONLY_OFFICE_CALLBACK:"callback",ONLY_OFFICE_STATUS:"status"},Pn=`${W.BASE}/${W.OPERATION}`,n0=`${Pn}/${x.THUMBNAIL}`,Ln=`${Pn}/${x.MAKE}`,r0=`${Pn}/${x.UPLOAD}`,zn=`${W.BASE}/${W.TASK_OPERATION}`,Rs=`${zn}/${x.DOWNLOAD}`,Vs=`${zn}/${x.COMPRESS}`,Hs=`${zn}/${x.DECOMPRESS}`,di=`${W.BASE}/${W.TASKS}`,Bs=`${W.BASE}/${W.TASKS}/${W.TASKS_DOWNLOAD}`,js=`${W.BASE}/${W.RECENTS}`,Gs=`${W.BASE}/${W.SEARCH}`,qi=`${W.BASE}/${W.ONLY_OFFICE}`,Us=`${qi}/${W.ONLY_OFFICE_SETTINGS}`,s0=`${qi}/${W.ONLY_OFFICE_DOCUMENT}`,o0=`${qi}/${W.ONLY_OFFICE_CALLBACK}`,$s=`${qi}/${W.ONLY_OFFICE_STATUS}`;var v1=(i,e)=>Xe(null,null,function*(){return new Promise((r,t)=>{try{if(window.DocsAPI)return r(null);let n=document.getElementById(e);if(n){let s=setInterval(()=>{if(!n.getAttribute("loading")){if(clearInterval(s),window.DocsAPI)return r(null);let a=qs(e,i,r,t);n.remove(),document.body.appendChild(a)}},500)}else{let s=qs(e,i,r,t);document.body.appendChild(s)}}catch(n){console.error(n)}})}),qs=(i,e,r,t)=>{let n=document.createElement("script");return n.id=i,n.type="text/javascript",n.src=e,n.async=!0,n.onload=()=>{n.removeAttribute("loading"),r(null)},n.onerror=s=>{n.removeAttribute("loading"),t(s)},n.setAttribute("loading",""),n},Ws=v1;var Ks=(()=>{let e=class e{constructor(){this.loadError=new L,this.isFirstOnChanges=!0,this.onLoad=()=>{try{if(window.DocsAPI||this.onError(-3),window?.DocEditor?.instances[this.id]){console.log("Skip loading, instance already exists",this.id);return}window?.DocEditor?.instances||(window.DocEditor={instances:{}}),window.DocEditor.instances[this.id]=window.DocsAPI.DocEditor(this.id,JSON.parse(JSON.stringify(this.config)))}catch(t){console.error(t),this.onError(-1)}}}ngOnInit(){let t=this.documentServerUrl;t.endsWith("/")||(t+="/");let n=`${t}web-apps/apps/api/documents/api.js`;Ws(n,"onlyoffice-api-script").then(()=>this.onLoad()).catch(()=>{this.onError(-2)})}ngOnChanges(t){if(this.isFirstOnChanges){this.isFirstOnChanges=!1;return}if("config"in t&&window?.DocEditor?.instances[this.id]){window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0,console.warn("Important props have been changed, reloading ..."),this.onLoad();return}}ngOnDestroy(){window?.DocEditor?.instances[this.id]&&(window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0)}onError(t){let n;switch(t){case-2:n="Check the settings";break;case-3:n="DocsAPI is not defined";break;default:n="Unknown error !",t=-1}this.loadError.emit(n)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-onlyoffice-document"]],inputs:{id:"id",documentServerUrl:"documentServerUrl",config:"config"},outputs:{loadError:"loadError"},features:[Qe],decls:1,vars:1,consts:[[3,"id"]],template:function(n,s){n&1&&pi(0,"div",0),n&2&&ke("id",s.id)},encapsulation:2});let i=e;return i})();function b1(i,e){if(i&1){let r=F();c(0,"div")(1,"app-files-onlyoffice-document",1),b("loadError",function(n){S(r);let s=f();return _(s.loadError(n))}),d()()}if(i&2){let r=f();j("height",r.currentHeight,"px"),l(),u("id",r.docId)("documentServerUrl",r.documentConfig.documentServerUrl)("config",r.documentConfig.config)}}var Ys=(()=>{let e=class e{constructor(){this.documentConfig=null,this.http=p(He),this.layout=p(H)}ngOnInit(){this.docId=`viewer-doc-${this.file.id}`,this.http.get(`${Us}/${this.file.path}`,{params:new Qt().set("mode",this.mode)}).subscribe({next:t=>{if(!t){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document","Settings are missing");return}this.mode==="edit"&&t.config.editorConfig.mode!=="edit"?t.config.editorConfig.mode="view":t.config.editorConfig.mode=this.mode,t.config.editorConfig.lang=this.layout.getCurrentLanguage(),t.config.editorConfig.region=this.layout.getCurrentLanguage(),this.documentConfig=t},error:t=>{this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",t.error.message)}})}loadError(t){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",t)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-viewer-document"]],inputs:{file:"file",currentHeight:"currentHeight",mode:"mode"},decls:1,vars:1,consts:[[3,"height"],[3,"loadError","id","documentServerUrl","config"]],template:function(n,s){n&1&&D(0,b1,2,5,"div",0),n&2&&N(s.documentConfig?0:-1)},dependencies:[Ks],encapsulation:2});let i=e;return i})();var y1=["*"],re=(()=>{let e=class e{};e.VG_ENDED="ended",e.VG_PAUSED="paused",e.VG_PLAYING="playing",e.VG_LOADING="waiting",e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),fi=(()=>{let e=class e{constructor(){this.medias={},this.playerReadyEvent=new L(!0),this.isPlayerReady=!1}onPlayerReady(t){this.fsAPI=t,this.isPlayerReady=!0,this.playerReadyEvent.emit(this)}getDefaultMedia(){for(let t in this.medias)if(this.medias[t])return this.medias[t]}getMasterMedia(){let t;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){t=this.medias[n];break}return t||this.getDefaultMedia()}isMasterDefined(){let t=!1;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){t=!0;break}return t}getMediaById(t=null){let n=this.medias[t];return(!t||t==="*")&&(n=this),n}play(){for(let t in this.medias)this.medias[t]&&this.medias[t].play()}pause(){for(let t in this.medias)this.medias[t]&&this.medias[t].pause()}get duration(){return this.$$getAllProperties("duration")}set currentTime(t){this.$$setAllProperties("currentTime",t)}get currentTime(){return this.$$getAllProperties("currentTime")}set state(t){this.$$setAllProperties("state",t)}get state(){return this.$$getAllProperties("state")}set volume(t){this.$$setAllProperties("volume",t)}get volume(){return this.$$getAllProperties("volume")}set playbackRate(t){this.$$setAllProperties("playbackRate",t)}get playbackRate(){return this.$$getAllProperties("playbackRate")}get canPlay(){return this.$$getAllProperties("canPlay")}get canPlayThrough(){return this.$$getAllProperties("canPlayThrough")}get isMetadataLoaded(){return this.$$getAllProperties("isMetadataLoaded")}get isWaiting(){return this.$$getAllProperties("isWaiting")}get isCompleted(){return this.$$getAllProperties("isCompleted")}get isLive(){return this.$$getAllProperties("isLive")}get isMaster(){return this.$$getAllProperties("isMaster")}get time(){return this.$$getAllProperties("time")}get buffer(){return this.$$getAllProperties("buffer")}get buffered(){return this.$$getAllProperties("buffered")}get subscriptions(){return this.$$getAllProperties("subscriptions")}get textTracks(){return this.$$getAllProperties("textTracks")}seekTime(t,n=!1){for(let s in this.medias)this.medias[s]&&this.$$seek(this.medias[s],t,n)}$$seek(t,n,s=!1){let o,a=t.duration;s?(this.isMasterDefined()&&(a=this.getMasterMedia().duration),o=n*a/100):o=n,t.currentTime=o}addTextTrack(t,n,s){for(let o in this.medias)this.medias[o]&&this.$$addTextTrack(this.medias[o],t,n,s)}$$addTextTrack(t,n,s,o){t.addTextTrack(n,s,o)}$$getAllProperties(t){let n={},s;for(let a in this.medias)this.medias[a]&&(n[a]=this.medias[a]);switch(Object.keys(n).length){case 0:switch(t){case"state":s=re.VG_PAUSED;break;case"playbackRate":case"volume":s=1;break;case"time":s={current:0,total:0,left:0};break}break;case 1:let a=Object.keys(n)[0];s=n[a][t];break;default:let m=this.getMasterMedia();s=n[m.id][t]}return s}$$setAllProperties(t,n){for(let s in this.medias)this.medias[s]&&(this.medias[s][t]=n)}registerElement(t){this.videogularElement=t}registerMedia(t){this.medias[t.id]=t}unregisterMedia(t){delete this.medias[t.id]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),In=(()=>{let e=class e{constructor(){this.isHiddenSubject=new Bt,this.isHidden=this.isHiddenSubject.asObservable()}state(t){this.isHiddenSubject.next(t)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),ui=(()=>{let e=class e{static getZIndex(){let t=1,n,s=document.getElementsByTagName("*");for(let o=0,a=s.length;o<a;o++)n=parseInt(window.getComputedStyle(s[o])["z-index"],10),n>t&&(t=n+1);return t}static isMobileDevice(){return typeof window.orientation<"u"||navigator.userAgent.indexOf("IEMobile")!==-1}static isiOSDevice(){return(navigator.userAgent.match(/ip(hone|ad|od)/i)||e.isIpadOS())&&!navigator.userAgent.match(/(iemobile)[\/\s]?([\w\.]*)/i)}static isIpadOS(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}static isCordova(){return document.URL.indexOf("http://")===-1&&document.URL.indexOf("https://")===-1}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),kn=(()=>{let e=class e{constructor(){this.nativeFullscreen=!0,this.isFullscreen=!1,this.onChangeFullscreen=new L}init(t,n){this.videogularElement=t,this.medias=n;let s={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",onchange:"fullscreenchange",onerror:"fullscreenerror"},newWebkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},oldWebkit:{enabled:"webkitIsFullScreen",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullScreen",exit:"webkitCancelFullScreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},moz:{enabled:"mozFullScreen",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",onchange:"mozfullscreenchange",onerror:"mozfullscreenerror"},ios:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitEnterFullscreen",exit:"webkitExitFullscreen",onchange:"webkitendfullscreen",onerror:"webkitfullscreenerror"},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",onchange:"MSFullscreenChange",onerror:"MSFullscreenError"}};for(let a in s)if(s[a].enabled in document){this.polyfill=s[a];break}if(ui.isiOSDevice()&&(this.polyfill=s.ios),this.isAvailable=this.polyfill!=null,this.polyfill==null)return;let o;switch(this.polyfill.onchange){case"mozfullscreenchange":o=document;break;case"webkitendfullscreen":o=this.medias.toArray()[0].elem;break;default:o=t}this.fsChangeSubscription=T(o,this.polyfill.onchange).subscribe(()=>{this.onFullscreenChange()})}onFullscreenChange(){this.isFullscreen=!!document[this.polyfill.element],this.onChangeFullscreen.emit(this.isFullscreen)}toggleFullscreen(t=null){return this.isFullscreen?this.exit():this.request(t)}request(t){return t||(t=this.videogularElement),this.isFullscreen=!0,this.onChangeFullscreen.emit(!0),this.isAvailable&&this.nativeFullscreen?ui.isMobileDevice()?((!this.polyfill.enabled&&t===this.videogularElement||ui.isiOSDevice())&&(t=this.medias.toArray()[0].elem),this.enterElementInFullScreen(t)):this.enterElementInFullScreen(this.videogularElement):Promise.resolve()}enterElementInFullScreen(t){return t[this.polyfill.request]()}exit(){return this.isFullscreen=!1,this.onChangeFullscreen.emit(!1),this.isAvailable&&this.nativeFullscreen?document[this.polyfill.exit]():Promise.resolve()}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),z=(()=>{let e=class e{};e.VG_ABORT="abort",e.VG_CAN_PLAY="canplay",e.VG_CAN_PLAY_THROUGH="canplaythrough",e.VG_DURATION_CHANGE="durationchange",e.VG_EMPTIED="emptied",e.VG_ENCRYPTED="encrypted",e.VG_ENDED="ended",e.VG_ERROR="error",e.VG_LOADED_DATA="loadeddata",e.VG_LOADED_METADATA="loadedmetadata",e.VG_LOAD_START="loadstart",e.VG_PAUSE="pause",e.VG_PLAY="play",e.VG_PLAYING="playing",e.VG_PROGRESS="progress",e.VG_RATE_CHANGE="ratechange",e.VG_SEEK="seek",e.VG_SEEKED="seeked",e.VG_SEEKING="seeking",e.VG_STALLED="stalled",e.VG_SUSPEND="suspend",e.VG_TIME_UPDATE="timeupdate",e.VG_VOLUME_CHANGE="volumechange",e.VG_WAITING="waiting",e.VG_LOAD="load",e.VG_ENTER="enter",e.VG_EXIT="exit",e.VG_START_ADS="startads",e.VG_END_ADS="endads",e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Fn=(()=>{let e=class e{constructor(t,n){this.api=t,this.ref=n,this.state=re.VG_PAUSED,this.time={current:0,total:0,left:0},this.buffer={end:0},this.canPlay=!1,this.canPlayThrough=!1,this.isMetadataLoaded=!1,this.isWaiting=!1,this.isCompleted=!1,this.isLive=!1,this.isBufferDetected=!1,this.checkInterval=200,this.currentPlayPos=0,this.lastPlayPos=0,this.playAtferSync=!1,this.bufferDetected=new Bt}ngOnInit(){this.vgMedia.nodeName?this.elem=this.vgMedia:this.elem=this.vgMedia.elem,this.api.registerMedia(this),this.subscriptions={abort:T(this.elem,z.VG_ABORT),canPlay:T(this.elem,z.VG_CAN_PLAY),canPlayThrough:T(this.elem,z.VG_CAN_PLAY_THROUGH),durationChange:T(this.elem,z.VG_DURATION_CHANGE),emptied:T(this.elem,z.VG_EMPTIED),encrypted:T(this.elem,z.VG_ENCRYPTED),ended:T(this.elem,z.VG_ENDED),error:T(this.elem,z.VG_ERROR),loadedData:T(this.elem,z.VG_LOADED_DATA),loadedMetadata:T(this.elem,z.VG_LOADED_METADATA),loadStart:T(this.elem,z.VG_LOAD_START),pause:T(this.elem,z.VG_PAUSE),play:T(this.elem,z.VG_PLAY),playing:T(this.elem,z.VG_PLAYING),progress:T(this.elem,z.VG_PROGRESS),rateChange:T(this.elem,z.VG_RATE_CHANGE),seeked:T(this.elem,z.VG_SEEKED),seeking:T(this.elem,z.VG_SEEKING),stalled:T(this.elem,z.VG_STALLED),suspend:T(this.elem,z.VG_SUSPEND),timeUpdate:T(this.elem,z.VG_TIME_UPDATE),volumeChange:T(this.elem,z.VG_VOLUME_CHANGE),waiting:T(this.elem,z.VG_WAITING),startAds:T(window,z.VG_START_ADS),endAds:T(window,z.VG_END_ADS),mutation:new Hn(t=>{let n=new MutationObserver(s=>{t.next(s)});return n.observe(this.elem,{childList:!0,attributes:!0}),()=>{n.disconnect()}}),bufferDetected:this.bufferDetected},this.mutationObs=this.subscriptions.mutation.subscribe(this.onMutation.bind(this)),this.canPlayObs=this.subscriptions.canPlay.subscribe(this.onCanPlay.bind(this)),this.canPlayThroughObs=this.subscriptions.canPlayThrough.subscribe(this.onCanPlayThrough.bind(this)),this.loadedMetadataObs=this.subscriptions.loadedMetadata.subscribe(this.onLoadMetadata.bind(this)),this.waitingObs=this.subscriptions.waiting.subscribe(this.onWait.bind(this)),this.progressObs=this.subscriptions.progress.subscribe(this.onProgress.bind(this)),this.endedObs=this.subscriptions.ended.subscribe(this.onComplete.bind(this)),this.playingObs=this.subscriptions.playing.subscribe(this.onStartPlaying.bind(this)),this.playObs=this.subscriptions.play.subscribe(this.onPlay.bind(this)),this.pauseObs=this.subscriptions.pause.subscribe(this.onPause.bind(this)),this.timeUpdateObs=this.subscriptions.timeUpdate.subscribe(this.onTimeUpdate.bind(this)),this.volumeChangeObs=this.subscriptions.volumeChange.subscribe(this.onVolumeChange.bind(this)),this.errorObs=this.subscriptions.error.subscribe(this.onError.bind(this)),this.vgMaster&&this.api.playerReadyEvent.subscribe(()=>{this.prepareSync()})}prepareSync(){let t=[];for(let n in this.api.medias)this.api.medias[n]&&t.push(this.api.medias[n].subscriptions.canPlay);this.canPlayAllSubscription=Bn(t).pipe(jt((...n)=>{let s=a=>a?.target?a.target.readyState===4:!1;n.some(s)&&!this.syncSubscription&&(this.startSync(),this.syncSubscription.unsubscribe())})).subscribe()}startSync(){this.syncSubscription=Gt(0,1e3).subscribe(()=>{for(let t in this.api.medias)if(this.api.medias[t]!==this){let n=this.api.medias[t].currentTime-this.currentTime;n<-.3||n>.3?(this.playAtferSync=this.state===re.VG_PLAYING,this.pause(),this.api.medias[t].pause(),this.api.medias[t].currentTime=this.currentTime):this.playAtferSync&&(this.play(),this.api.medias[t].play(),this.playAtferSync=!1)}})}onMutation(t){for(let n=0,s=t.length;n<s;n++){let o=t[n];if(o.type==="attributes"&&o.attributeName==="src"){if(o.target.src&&o.target.src.length>0&&o.target.src.indexOf("blob:")<0){this.loadMedia();break}}else if(o.type==="childList"&&o.removedNodes.length&&o.removedNodes[0].nodeName.toLowerCase()==="source"){this.loadMedia();break}}}loadMedia(){this.vgMedia.pause(),this.vgMedia.currentTime=0,this.stopBufferCheck(),this.isBufferDetected=!0,this.bufferDetected.next(this.isBufferDetected),setTimeout(()=>this.vgMedia.load(),10)}play(){if(!(this.playPromise||this.state!==re.VG_PAUSED&&this.state!==re.VG_ENDED))return this.playPromise=this.vgMedia.play(),this.playPromise&&this.playPromise.then&&this.playPromise.catch&&this.playPromise.then(()=>{this.playPromise=null}).catch(()=>{this.playPromise=null}),this.playPromise}pause(){this.playPromise?this.playPromise.then(()=>{this.vgMedia.pause()}):this.vgMedia.pause()}get id(){let t;return this.vgMedia&&(t=this.vgMedia.id),t}get duration(){return this.vgMedia.duration===1/0?this.specifiedDuration:this.vgMedia.duration}set currentTime(t){this.vgMedia.currentTime=t}get currentTime(){return this.vgMedia.currentTime}set volume(t){this.vgMedia.volume=t}get volume(){return this.vgMedia.volume}set playbackRate(t){this.vgMedia.playbackRate=t}get playbackRate(){return this.vgMedia.playbackRate}get buffered(){return this.vgMedia.buffered}get textTracks(){return this.vgMedia.textTracks}onCanPlay(t){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlay=!0,this.ref.detectChanges()}onCanPlayThrough(t){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlayThrough=!0,this.ref.detectChanges()}onLoadMetadata(t){this.isMetadataLoaded=!0,this.time={current:0,left:0,total:this.duration*1e3},this.state=re.VG_PAUSED;let n=Math.round(this.time.total);this.isLive=n===1/0,this.ref.detectChanges()}onWait(t){this.isWaiting=!0,this.ref.detectChanges()}onComplete(t){this.isCompleted=!0,this.state=re.VG_ENDED,this.ref.detectChanges()}onStartPlaying(t){this.state=re.VG_PLAYING,this.ref.detectChanges()}onPlay(t){this.state=re.VG_PLAYING,this.vgMaster&&(!this.syncSubscription||this.syncSubscription.closed)&&this.startSync(),this.startBufferCheck(),this.ref.detectChanges()}onPause(t){this.state=re.VG_PAUSED,this.vgMaster&&(this.playAtferSync||this.syncSubscription.unsubscribe()),this.stopBufferCheck(),this.ref.detectChanges()}onTimeUpdate(t){let n=this.buffered.length-1;this.time={current:this.currentTime*1e3,total:this.time.total,left:(this.duration-this.currentTime)*1e3},n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onProgress(t){let n=this.buffered.length-1;n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onVolumeChange(t){this.ref.detectChanges()}onError(t){this.ref.detectChanges()}bufferCheck(){let t=1/this.checkInterval;this.currentPlayPos=this.currentTime,!this.isBufferDetected&&this.currentPlayPos<this.lastPlayPos+t&&(this.isBufferDetected=!0),this.isBufferDetected&&this.currentPlayPos>this.lastPlayPos+t&&(this.isBufferDetected=!1),this.bufferDetected.closed||this.bufferDetected.next(this.isBufferDetected),this.lastPlayPos=this.currentPlayPos}startBufferCheck(){this.checkBufferSubscription=Gt(0,this.checkInterval).subscribe(()=>{this.bufferCheck()})}stopBufferCheck(){this.checkBufferSubscription&&this.checkBufferSubscription.unsubscribe(),this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected)}seekTime(t,n=!1){let s,o=this.duration;n?s=t*o/100:s=t,this.currentTime=s}addTextTrack(t,n,s,o){let a=this.vgMedia.addTextTrack(t,n,s);return o&&(a.mode=o),a}ngOnDestroy(){this.vgMedia.src="",this.mutationObs?.unsubscribe(),this.canPlayObs?.unsubscribe(),this.canPlayThroughObs?.unsubscribe(),this.loadedMetadataObs?.unsubscribe(),this.waitingObs?.unsubscribe(),this.progressObs?.unsubscribe(),this.endedObs?.unsubscribe(),this.playingObs?.unsubscribe(),this.playObs?.unsubscribe(),this.pauseObs?.unsubscribe(),this.timeUpdateObs?.unsubscribe(),this.volumeChangeObs?.unsubscribe(),this.errorObs?.unsubscribe(),this.checkBufferSubscription?.unsubscribe(),this.syncSubscription?.unsubscribe(),this.bufferDetected?.complete(),this.bufferDetected?.unsubscribe(),this.api.unregisterMedia(this)}};e.\u0275fac=function(n){return new(n||e)(me(fi),me(sn))},e.\u0275dir=xe({type:e,selectors:[["","vgMedia",""]],inputs:{vgMedia:"vgMedia",vgMaster:"vgMaster"},standalone:!1});let i=e;return i})(),Xs=(()=>{let e=class e{constructor(t,n,s,o){this.api=n,this.fsAPI=s,this.controlsHidden=o,this.isFullscreen=!1,this.isNativeFullscreen=!1,this.areControlsHidden=!1,this.onPlayerReady=new L,this.onMediaReady=new L,this.subscriptions=[],this.elem=t.nativeElement,this.api.registerElement(this.elem)}ngAfterContentInit(){this.medias.toArray().forEach(t=>{this.api.registerMedia(t)}),this.fsAPI.init(this.elem,this.medias),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.subscriptions.push(this.controlsHidden.isHidden.subscribe(this.onHideControls.bind(this))),this.api.onPlayerReady(this.fsAPI),this.onPlayerReady.emit(this.api)}onChangeFullscreen(t){this.fsAPI.nativeFullscreen?this.isNativeFullscreen=t:(this.isFullscreen=t,this.zIndex=t?ui.getZIndex().toString():"auto")}onHideControls(t){this.areControlsHidden=t}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}};e.\u0275fac=function(n){return new(n||e)(me(ae),me(fi),me(kn),me(In))},e.\u0275cmp=y({type:e,selectors:[["vg-player"]],contentQueries:function(n,s,o){if(n&1&&et(o,Fn,5),n&2){let a;J(a=Z())&&(s.medias=a)}},hostVars:8,hostBindings:function(n,s){n&2&&(j("z-index",s.zIndex),V("fullscreen",s.isFullscreen)("native-fullscreen",s.isNativeFullscreen)("controls-hidden",s.areControlsHidden))},outputs:{onPlayerReady:"onPlayerReady",onMediaReady:"onMediaReady"},standalone:!1,features:[tt([fi,kn,In])],ngContentSelectors:y1,decls:1,vars:0,template:function(n,s){n&1&&(Wt(),Kt(0))},styles:[`vg-player{font-family:videogular;position:relative;display:flex;width:100%;height:100%;overflow:hidden;background-color:#000}vg-player.fullscreen{position:fixed;left:0;top:0}vg-player.native-fullscreen.controls-hidden{cursor:none}
|
|
19
|
-
`],encapsulation:2});let i=e;return i})(),C1=[fi,In,kn,ui,z,re];var We=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ge({type:e}),e.\u0275inj=he({providers:[...C1],imports:[be]});let i=e;return i})();var Qs=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ge({type:e}),e.\u0275inj=he({imports:[be,We]});let i=e;return i})();var Js=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ge({type:e}),e.\u0275inj=he({imports:[be,We]});let i=e;return i})();var Zs=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ge({type:e}),e.\u0275inj=he({imports:[be,We]});let i=e;return i})();var eo=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-viewer-media"]],inputs:{currentHeight:"currentHeight",fileUrl:"fileUrl"},decls:4,vars:4,consts:[["media",""],["preload","none","controls","",3,"vgMedia"],["type","video/webm",3,"src"]],template:function(n,s){if(n&1&&(c(0,"vg-player")(1,"video",1,0),g(3,"source",2),d()()),n&2){let o=Yt(2);j("height",s.currentHeight,"px"),l(),u("vgMedia",o),l(2),u("src",s.fileUrl,ze)}},dependencies:[We,Fn,Xs,Js,Zs,Qs],encapsulation:2,changeDetection:0});let i=e;return i})();var to=(()=>{let e=class e{constructor(){this.sanitizer=p(gi),this.pdfjsUrl=`${Ei}/pdfjs/web/viewer.html?file=`}ngOnInit(){this.url=this.sanitizer.bypassSecurityTrustResourceUrl(`${this.pdfjsUrl}${encodeURIComponent(this.fileUrl)}`)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-viewer-pdf"]],inputs:{fileUrl:"fileUrl",currentHeight:"currentHeight"},decls:1,vars:3,consts:[[1,"app-viewer-iframe",3,"src"]],template:function(n,s){n&1&&pi(0,"iframe",0),n&2&&(j("height",s.currentHeight,"px"),ke("src",s.url,$n))},encapsulation:2,changeDetection:0});let i=e;return i})();var _1=["ref"];function io(i){return i&&i.replace(/\r\n|\r/g,`
|
|
20
|
-
`)}var no=(()=>{let e=class e{constructor(){this.className="",this.name="codemirror",this.autoFocus=!1,this.preserveScrollPosition=!1,this.cursorActivity=new L,this.focusChange=new L,this.scroll=new L,this.value="",this.disabled=!1,this.isFocused=!1,this._differs=p(Kn),this._ngZone=p(Ut),this.onChange=t=>{},this.onTouched=()=>{},this.codeMirror=CodeMirror||import("./chunk-SH5EVL4E.js")}set options(t){this._options=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngAfterViewInit(){this.ref&&this._ngZone.runOutsideAngular(()=>{this.textArea=this.codeMirror.fromTextArea(this.ref.nativeElement,this._options),this.textArea.on("cursorActivity",t=>this._ngZone.run(()=>this.cursorActive(t))),this.textArea.on("scroll",this.scrollChanged.bind(this)),this.textArea.on("blur",()=>this._ngZone.run(()=>this.focusChanged(!1))),this.textArea.on("focus",()=>this._ngZone.run(()=>this.focusChanged(!0))),this.textArea.on("change",(t,n)=>this._ngZone.run(()=>this.codemirrorValueChanged(t,n))),this.textArea.setValue(this.value)})}ngDoCheck(){if(!this._differ)return;let t=this._differ.diff(this._options);t&&(t.forEachChangedItem(n=>this.setOptionIfChanged(n.key,n.currentValue)),t.forEachAddedItem(n=>this.setOptionIfChanged(n.key,n.currentValue)),t.forEachRemovedItem(n=>this.setOptionIfChanged(n.key,n.currentValue)))}ngOnDestroy(){this.textArea&&this.textArea.toTextArea()}codemirrorValueChanged(t,n){n.origin!=="setValue"&&(this.value=t.getValue(),this.onChange(this.value))}setOptionIfChanged(t,n){this.textArea&&this.textArea.setOption(t,n)}focusChanged(t){this.onTouched(),this.isFocused=t,this.focusChange.emit(t)}scrollChanged(t){this.scroll.emit(t.getScrollInfo())}cursorActive(t){this.cursorActivity.emit(t)}writeValue(t){if(t==null)return;if(!this.textArea){this.value=t;return}let n=this.textArea.getValue();if(t!==n&&io(n)!==io(t))if(this.value=t,this.preserveScrollPosition){let s=this.textArea.getScrollInfo();this.textArea.setValue(this.value),this.textArea.scrollTo(s.left,s.top)}else this.textArea.setValue(this.value)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this.setOptionIfChanged("readOnly",this.disabled)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["ngx-codemirror"]],viewQuery:function(n,s){if(n&1&&Me(_1,7),n&2){let o;J(o=Z())&&(s.ref=o.first)}},inputs:{className:"className",name:"name",autoFocus:"autoFocus",preserveScrollPosition:"preserveScrollPosition",options:"options"},outputs:{cursorActivity:"cursorActivity",focusChange:"focusChange",scroll:"scroll"},features:[tt([{provide:Qn,useExisting:Un(()=>e),multi:!0}])],decls:3,vars:6,consts:[["ref",""],["autocomplete","off",3,"name"]],template:function(n,s){n&1&&($t(0,"textarea",1,0),h(2," "),qt()),n&2&&(Fe(Re("ngx-codemirror ",s.className)),V("ngx-codemirror--focused",s.isFocused),ke("name",s.name))},encapsulation:2,changeDetection:0});let i=e;return i})();var E1=["CodeMirror"],so=(()=>{let e=class e{constructor(){this.ready=!1,this.http=p(He),this.layout=p(H),this.options={lineNumbers:!1,readOnly:!0,theme:this.layout.switchTheme.getValue()===vr?"material":"default",mode:"null"},this.maxSize=5242880,this.modeUrl=`${Ei}/codemirror/mode/%N/%N.js`,this.mode=null}ngOnInit(){this.ref.codeMirror.modeURL=this.modeUrl;let t=this.ref.codeMirror.findModeByFileName(this.file.name);t?(this.mode=t.mode,this.http.get(this.file.dataUrl,{responseType:"text"}).subscribe(n=>this.content=n)):this.file.size<=this.maxSize?this.http.get(this.file.dataUrl,{responseType:"text"}).subscribe(n=>this.content=n):this.content=this.layout.translateString("This file contains binary data that can not be read")}ngAfterViewInit(){this.mode&&(this.ref.codeMirror.autoLoadMode(this.ref.textArea,this.mode),this.ref.textArea.setOption("mode",this.mode),this.options.lineNumbers=!0)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-viewer-text"]],viewQuery:function(n,s){if(n&1&&Me(E1,7),n&2){let o;J(o=Z())&&(s.ref=o.first)}},inputs:{currentHeight:"currentHeight",file:"file"},decls:3,vars:4,consts:[["CodeMirror",""],[3,"ngModel","options"]],template:function(n,s){n&1&&(c(0,"div"),g(1,"ngx-codemirror",1,0),d()),n&2&&(j("height",s.currentHeight,"px"),l(),u("ngModel",s.content)("options",s.options))},dependencies:[no,_t,Ct,St],styles:[`.CodeMirror{height:100%;font-size:.7rem}
|
|
21
|
-
`],encapsulation:2});let i=e;return i})();function x1(i,e){if(i&1&&(c(0,"div",10),g(1,"img",11),d()),i&2){let r=f(2);j("height",r.currentHeight,"px"),l(),j("max-height",r.currentHeight,"px"),u("src",r.currentFile.dataUrl,ze)}}function M1(i,e){if(i&1&&g(0,"app-files-viewer-pdf",7),i&2){let r=f(2);u("currentHeight",r.currentHeight)("fileUrl",r.currentFile.dataUrl)}}function w1(i,e){if(i&1&&g(0,"app-files-viewer-media",7),i&2){let r=f(2);u("currentHeight",r.currentHeight)("fileUrl",r.currentFile.dataUrl)}}function A1(i,e){if(i&1&&g(0,"app-files-viewer-document",8),i&2){let r=f(2);u("currentHeight",r.currentHeight)("file",r.currentFile)("mode",r.mode)}}function D1(i,e){if(i&1&&g(0,"app-files-viewer-text",9),i&2){let r=f(2);u("currentHeight",r.currentHeight)("file",r.currentFile)}}function N1(i,e){if(i&1&&(c(0,"div",5),D(1,x1,2,5,"div",6)(2,M1,1,2,"app-files-viewer-pdf",7)(3,w1,1,2,"app-files-viewer-media",7)(4,A1,1,3,"app-files-viewer-document",8)(5,D1,1,2,"app-files-viewer-text",9),d()),i&2){let r,t=f();l(),N((r=t.shortMime)==="image"?1:r==="pdf"?2:r==="media"?3:r==="document"?4:5)}}var oo=(()=>{let e=class e{constructor(){this.layout=p(H),this.subscription=this.layout.resizeEvent.subscribe(()=>this.onResize()),this.offsetTop=42}ngOnInit(){this.onResize()}ngOnDestroy(){this.subscription.unsubscribe()}onClose(){this.layout.closeDialog(null,this.currentFile.id)}onMinimize(){this.layout.minimizeDialog(this.currentFile.id,{name:this.currentFile.name,mimeUrl:this.currentFile.mimeUrl})}onResize(){this.currentHeight=window.innerHeight-this.offsetTop}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-viewer-dialog"]],inputs:{currentFile:"currentFile",mode:"mode",shortMime:"shortMime"},decls:8,vars:2,consts:[[1,"modal-header"],[1,"modal-title"],[1,"fas","fa-eye"],["aria-label","Minimize","type","button",1,"btn-minimize","btn-minimize-white",3,"click"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-3",3,"click"],[1,"modal-body"],[1,"d-flex","justify-content-center","bg-black",3,"height"],[3,"currentHeight","fileUrl"],[3,"currentHeight","file","mode"],[3,"currentHeight","file"],[1,"d-flex","justify-content-center","bg-black"],["alt","",1,"img-fluid","align-self-center",3,"src"]],template:function(n,s){n&1&&(c(0,"div",0)(1,"h4",1),g(2,"i",2),c(3,"span"),h(4),d()(),c(5,"button",3),b("click",function(){return s.onMinimize()}),d(),c(6,"button",4),b("click",function(){return s.onClose()}),d()(),D(7,N1,6,1,"div",5)),n&2&&(l(4),R(s.currentFile.name),l(3),N(s.currentFile?7:-1))},dependencies:[to,eo,so,Ys],encapsulation:2});let i=e;return i})();var Wi=class{constructor(e){Object.assign(this,e),this.mimeUrl=st(this.mime),this.setInfos()}fallBackMimeUrl(){this.mimeUrl=Nt}setInfos(){let e=this.path.split("/")[0],r=this.path.split("/")[1]===Be.PERSONAL;this.showedPath=this.path.split("/").slice(r?2:1).join("/"),this.iconClass=e===le.SHARES?"purple":"primary",this.icon=e===le.SHARES?ee.SHARES:r?ee.PERSONAL:ee.SPACES}};var Ki=class{constructor(e){this.inTrash=!1,Object.assign(this,e),this.mimeUrl=st(this.mime),this.iconClass=this.shareId?"purple":"primary",this.icon=this.shareId?ee.SHARES:this.spaceId?ee.SPACES:ee.PERSONAL,this.showedPath=this.path.split("/").slice(this.path.split("/")[1]===Be.PERSONAL?2:1).join("/"),this.inTrash=this.path.split("/")[0]===le.TRASH}fallBackMimeUrl(){this.mimeUrl=Nt}};var ft=(function(i){return i[i.PENDING=0]="PENDING",i[i.SUCCESS=1]="SUCCESS",i[i.ERROR=2]="ERROR",i})(ft||{}),Yi=class{constructor(e,r,t,n){this.props={},this.id=e,this.type=r,this.path=t,this.name=n,(r===x.COPY||r===x.MOVE||r===x.DOWNLOAD)&&(this.props={progress:1},r!==x.DOWNLOAD&&(this.props.src={name:n,path:t}))}};var ao=(()=>{let e=class e{constructor(){this.http=p(He),this.layout=p(H),this.store=p(wt),this.onDone={[x.DELETE]:{title:"Deletion",fileEvent:{delete:!0}},[x.MOVE]:{title:"Move",fileEvent:{delete:!0,reloadFocusOnDst:!0}},[x.COPY]:{title:"Copy",fileEvent:{reload:!0,focus:!0}},[x.DOWNLOAD]:{title:"Download",fileEvent:{reload:!0,focus:!0}},[x.UPLOAD]:{title:"Upload",fileEvent:{reload:!0,focus:!0}},[x.COMPRESS]:{title:"Compression",fileEvent:{reload:!0,focus:!0}},[x.DECOMPRESS]:{title:"Decompression",fileEvent:{reload:!0,focus:!0}}},this.watcher=null,this.watch=Gt(1e3,1e3).pipe(Gn(()=>this.doWatch())),this.loadAll()}addTask(t){t.status===ft.PENDING?(this.store.filesActiveTasks.next([t,...this.store.filesActiveTasks.getValue()]),this.startWatch()):this.store.filesEndedTasks.next([t,...this.store.filesEndedTasks.getValue()])}createUploadTask(t,n,s){let o=new Yi(br(),x.UPLOAD,t,n);return o.status=ft.PENDING,o.startedAt=gr(null,!0),o.props={progress:1,size:0,totalSize:s},this.store.filesActiveTasks.next([o,...this.store.filesActiveTasks.getValue()]),this.layout.showRSideBarTab(xt.TASKS,!0),o}removeAll(){this.http.delete(di).subscribe({next:()=>this.clearEndedTasks(),error:t=>console.error(t)})}remove(t){this.http.delete(`${di}/${t.id}`).subscribe({next:()=>this.deleteTask(t.id,!1),error:n=>console.error(n)})}updateTask(t){if(t.status===ft.PENDING){let n=this.findTask(t.id,!0);Object.assign(n,t)}else this.deleteTask(t.id,!0),this.addTask(t),this.taskDone(t)}loadAll(){this.http.get(di).subscribe({next:t=>t.forEach(n=>this.addTask(n)),error:t=>console.error(t)})}doWatch(){this.store.filesActiveTasks.getValue().length?this.fetchActiveTasks():this.stopWatch()}startWatch(){(!this.watcher||this.watcher.closed)&&(this.layout.showRSideBarTab(xt.TASKS,!0),this.watcher=this.watch.subscribe())}stopWatch(){(this.watcher||!this.watcher.closed)&&(setTimeout(()=>this.layout.hideRSideBarTab(xt.TASKS),3e3),this.watcher.unsubscribe())}fetchActiveTasks(){for(let t of this.store.filesActiveTasks.getValue().filter(n=>n.type!==x.UPLOAD))this.http.get(`${di}/${t.id}`).subscribe({next:n=>this.updateTask(n),error:n=>{n.status===404&&(t.result=n.error.message,t.status=ft.ERROR,this.updateTask(t)),console.warn(n)}})}findTask(t,n){return n?this.store.filesActiveTasks.getValue().find(s=>s.id===t):this.store.filesEndedTasks.getValue().find(s=>s.id===t)}deleteTask(t,n){n?this.store.filesActiveTasks.next(this.store.filesActiveTasks.getValue().filter(s=>s.id!==t)):this.store.filesEndedTasks.next(this.store.filesEndedTasks.getValue().filter(s=>s.id!==t))}taskDone(t){if(t.type in this.onDone){if(this.onDone[t.type].fileEvent){let n=Ye(oe({},this.onDone[t.type].fileEvent),{status:t.status});t.type===x.COPY||t.type===x.MOVE?(n.filePath=t.props.src.path,n.fileName=t.props.src.name,n.fileDstPath=t.path):(n.filePath=t.path,n.fileName=t.name,t.type===x.COMPRESS&&(n.archiveId=t.props.compressInDirectory===!1?t.id:null)),this.store.filesOnEvent.next(n)}t.status===ft.SUCCESS?t.type===x.DELETE?this.removeDeletedChildTasks(t):this.layout.sendNotification("info",`${this.onDone[t.type].title} done`,t.name):this.layout.sendNotification("error",`${this.onDone[t.type].title} failed`,t.name,{error:{message:t.result}})}}removeDeletedChildTasks(t){if(t.path.startsWith(le.SHARES))this.remove(t);else if(t.path.startsWith(le.TRASH)){for(let n of this.store.filesEndedTasks.getValue().filter(s=>s.id!==t.id&&s.type===x.DELETE&&s.path.startsWith(le.FILES))){let s=t.path.replace(le.TRASH,le.FILES);new RegExp(`^${Tr(`${s}/${t.name}`)}(/|$)`).test(`${n.path}/${n.name}`)&&this.remove(n)}this.remove(t)}}clearEndedTasks(){this.store.filesEndedTasks.next([])}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var lo=(()=>{let e=class e{constructor(){this.treeNodeSelected=null,this.treeCopyMoveOn=new Bt,this.clipboardAction="copyPaste",this.http=p(He),this.layout=p(H),this.store=p(wt),this.sanitizer=p(gi),this.filesTasksService=p(ao)}getTreeNode(t,n=!1){return Qi(this.http.get(`${_r}/${t}`,{params:n?new Qt().set("showFiles",n):null}))}addToClipboard(t){if(t.length)if(!this.store.filesClipboard.getValue().length)this.layout.showRSideBarTab(xt.CLIPBOARD,!0),this.store.filesClipboard.next(t);else{let n=t.filter(s=>this.store.filesClipboard.getValue().indexOf(s)===-1);n.length&&this.store.filesClipboard.next([...n,...this.store.filesClipboard.getValue()])}}removeFromClipboard(t){this.store.filesClipboard.next(this.store.filesClipboard.getValue().filter(n=>n.id!==t.id))}clearClipboard(){this.store.filesClipboard.next([])}onPasteClipboard(t){let n=t||this.clipboardAction;if(this.store.filesClipboard.getValue().length){let s=this.currentRoute;this.copyMove([...this.store.filesClipboard.getValue()],s,n==="copyPaste"?x.COPY:x.MOVE),this.clearClipboard()}}download(t){on(t.dataUrl)}copyMove(t,n,s){let o=s===x.MOVE;for(let a of t){o&&(a.isBeingDeleted=!0);let m={dstDirectory:n};this.http.request(s,a.taskUrl,{body:m}).subscribe({next:C=>this.filesTasksService.addTask(C),error:C=>{o&&(a.isBeingDeleted=!1),this.layout.sendNotification("error",s==="move"?"Move failed":"Copy failed",a.name,C)}})}}rename(t,n){if(!this.isValidName(n))return;let o={dstDirectory:t.path.split("/").slice(0,-1).join("/")||".",dstName:n};this.http.request(x.MOVE,t.dataUrl,{body:o}).subscribe({next:a=>{t.rename(a.name),t.isEditable=!1},error:a=>this.layout.sendNotification("error","Rename",t.name,a)})}delete(t){for(let n of t)n.isBeingDeleted=!0,this.http.delete(n.taskUrl).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>{n.isBeingDeleted=!1,this.layout.sendNotification("error","Deletion failed",n.name,s)}})}make(t,n,s=null,o=!1){if(!this.isValidName(n))return;s=s||this.currentRoute;let a={type:t};if(o)return this.http.post(`${Ln}/${s}/${n}`,a);this.http.post(`${Ln}/${s}/${n}`,a).subscribe({next:()=>this.store.filesOnEvent.next({filePath:s,fileName:n,focus:!0,reload:!0}),error:m=>this.layout.sendNotification("error","Creation failed",n,m)})}compress(t){let n=this.currentRoute;this.http.post(`${Vs}/${n}/${t.name}.${t.extension}`,t).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>this.layout.sendNotification("error","Compression failed",t.name,s)})}decompress(t){let n=this.currentRoute;this.http.post(`${Hs}/${n}/${t.name}`,null).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>this.layout.sendNotification("error","Compression failed",t.name,s)})}downloadFromUrl(t,n){if(!this.isValidName(n))return;let s=this.currentRoute,o={url:t};this.http.post(`${Rs}/${s}/${n}`,o).subscribe({next:a=>this.filesTasksService.addTask(a),error:a=>this.layout.sendNotification("error","Download failed",t,a)})}downloadTaskArchive(t){on(`${Bs}/${t}`)}loadRecents(t){this.http.get(js,{params:new Qt().set("limit",t)}).pipe(jt(n=>n.map(s=>new Ki(s)))).subscribe({next:n=>{this.store.filesRecents.update(s=>[...n,...s.slice(t)])},error:n=>this.layout.sendNotification("error","Files","Unable to load",n)})}search(t){return this.http.request("search",Gs,{body:t}).pipe(jt(n=>n.map(s=>(s.content&&(s.content=this.sanitizer.bypassSecurityTrustHtml(s.content)),new Wi(s)))))}openViewerDialog(t,n){return Xe(this,null,function*(){this.http.head(n.dataUrl).subscribe({next:()=>Xe(this,null,function*(){let s;try{s=yield this.viewerHook(t,n)}catch{this.download(n);return}this.layout.openDialog(oo,"full",{id:n.id,initialState:{currentFile:n,mode:t,shortMime:s}})}),error:s=>{console.error(s.message),this.layout.sendNotification("error","Unable to open document",n?.name)}})})}viewerHook(t,n){return Xe(this,null,function*(){let s=yield this.getOnlyOfficeStatus();if(n.shortMime==="document"&&!s){if(n.mime.startsWith("text-"))return"text";throw new Error("Feature not enabled")}return n.shortMime==="pdf"&&t==="edit"&&s?"document":n.shortMime})}getOnlyOfficeStatus(){return Xe(this,null,function*(){if(this.store.filesOnlyOffice().enabled!==null)return this.store.filesOnlyOffice().enabled;try{let t=yield Qi(this.http.get($s));return this.store.filesOnlyOffice.set(t),t.enabled}catch{let t={enabled:!1};return this.store.filesOnlyOffice.set(t),t.enabled}})}isValidName(t){try{return mr(t),!0}catch(n){return this.layout.sendNotification("error","Rename",`${this.layout.translateString(n.message)} : ${hr}`),!1}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var O1=["tree"];function T1(i,e){if(i&1&&(c(0,"span",8),h(1),d()),i&2){let r=f(2);l(),R(r.errorMsg)}}function P1(i,e){i&1&&(c(0,"span",9),h(1,"Navigation Tree"),d())}function L1(i,e){if(i&1){let r=F();c(0,"div",3)(1,"button",6),b("click",function(){S(r);let n=f();return _(n.onRefresh())}),g(2,"fa-icon",7),d(),D(3,T1,2,1,"span",8)(4,P1,2,0,"span",9),d()}if(i&2){let r=f();l(2),u("icon",r.icons.faArrowRotateRight),l(),N(r.errorMsg?3:4)}}function z1(i,e){if(i&1&&(c(0,"span")(1,"span"),h(2),d()()),i&2){let r=f(2);l(2),R(r.store.filesSelection()[0].name)}}function I1(i,e){if(i&1&&(c(0,"span"),g(1,"fa-icon",18),d()),i&2){let r=f(2);l(),u("icon",r.icons.faQuestion)}}function k1(i,e){if(i&1&&(c(0,"span")(1,"span"),h(2),d(),h(3,"\xA0"),c(4,"span",9),h(5,"items"),d()()),i&2){let r=f(2);l(2),R(r.store.filesSelection().length)}}function F1(i,e){if(i&1){let r=F();c(0,"div",10)(1,"div",11)(2,"span",12)(3,"span",9),h(4,"Source"),d(),h(5,":"),d(),D(6,z1,3,1,"span")(7,I1,2,1,"span")(8,k1,6,1,"span"),d(),c(9,"div",13)(10,"span",12)(11,"span",9),h(12,"Destination"),d(),h(13,":"),d(),c(14,"span"),h(15),d()(),c(16,"div",14)(17,"button",15),b("click",function(){S(r);let n=f();return _(n.actionMove())}),g(18,"fa-icon",7),h(19," Move "),d(),c(20,"button",15),b("click",function(){S(r);let n=f();return _(n.actionCopy())}),g(21,"fa-icon",7),h(22," Copy "),d(),c(23,"button",16),b("click",function(){S(r);let n=f();return _(n.actionCancel())}),g(24,"fa-icon",7),h(25," Cancel "),d()()(),g(26,"hr",17)}if(i&2){let r,t=f();l(6),N((r=t.store.filesSelection().length)===1?6:r===0?7:8),l(9),R((t.selection==null?null:t.selection.data.name)||""),l(2),u("disabled",!t.selection||!t.store.filesSelection().length||!t.srcAllowed||!t.dstAllowed),l(),u("icon",t.icons.faArrowsAlt),l(2),u("disabled",!t.selection||!t.store.filesSelection().length||!t.dstAllowed),l(),u("icon",t.icons.faClone),l(3),u("icon",t.icons.faTimes)}}function R1(i,e){if(i&1){let r=F();c(0,"div",19),b("click",function(n){let s=S(r).$implicit;return _(s.mouseAction("click",n))})("tap",function(n){let s=S(r).$implicit;return _(s.mouseAction("dblClick",n))}),g(1,"tree-node-expander",20),c(2,"div",21),g(3,"tree-node-content",22),d()()}if(i&2){let r=e.index,t=e.$implicit;j("padding-left",t.getNodePadding()),V("tree-selected",t.isActive)("tree-disabled",!t.data.enabled),l(),V("toggle-children-file",!t.data.isDir)("toggle-children-shared",t.data.inShare),u("node",t),l(),V("node-content-wrapper-active",t.isActive),l(),u("index",r)("node",t)}}function V1(i,e){if(i&1&&(c(0,"span"),g(1,"fa-icon",23),d()),i&2){let r=f();l(),u("icon",r.icons.faSpinner)}}var co=(()=>{let e=class e{constructor(){this.selected=new L,this.showFiles=!1,this.allowShares=!0,this.allowSpaces=!0,this.enableCopyMove=!0,this.enableNavigateTo=!0,this.sideBarHeader=!0,this.resizeOffset=80,this.toggleNodesAtStartup=!1,this.store=p(wt),this.icons={faArrowRotateRight:ur,faArrowsAlt:lr,faClone:nr,faTimes:cr,faFolder:or,faFile:wi,faQuestion:ir,faAnglesRight:fr,faSpinner:yi},this.options={actionMapping:{mouse:{click:(t,n,s)=>this.onSelect(t,n,s),dblClick:(t,n)=>this.onOpen(n),expanderClick:()=>null}},animateExpand:!1,levelPadding:10,useVirtualScroll:!1,nodeHeight:30,dropSlotHeight:0,allowDrag:!1,allowDrop:!1,getChildren:t=>this.getTreeNode(t)},this.srcAllowed=!0,this.dstAllowed=!0,this.errorMsg=null,this.layout=p(H),this.router=p(Xn),this.user=p(_i),this.filesService=p(lo),this.copyMoveOnHeight=80,this.subscriptions=[],this.preventDblClick=!1,this._copyMoveOn=!1,this.enableCopyMove&&this.subscriptions.push(tr(this.store.filesSelection).subscribe(()=>this.checkAllowed(this.selection)))}get copyMoveOn(){return this._copyMoveOn}set copyMoveOn(t){this._copyMoveOn!==t&&(this._copyMoveOn=t,t?this.resizeOffset+=this.copyMoveOnHeight:this.resizeOffset-=this.copyMoveOnHeight,setTimeout(()=>this.layout.resizeEvent.next(),0))}get selection(){return this.filesService.treeNodeSelected}set selection(t){this.filesService.treeNodeSelected=t,t&&([0,-1,-2].indexOf(t.data.id)===-1?this.selected.emit(t.data):this.selected.emit(null))}ngOnInit(){this.enableCopyMove&&this.subscriptions.push(this.filesService.treeCopyMoveOn.subscribe(()=>this.onCopyMove())),this.initRoot(),setTimeout(()=>this.focusLastNode(),100)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onRefresh(){this.tree.treeModel.activeNodes.length?this.tree.treeModel.activeNodes.forEach(t=>{t.loadNodeChildren().then(()=>this.tree.treeModel.update())}):(this.user.userHavePermission(rt.PERSONAL_SPACE)&&this.tree.treeModel.getNodeById(0).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.user.userHavePermission(rt.SPACES)&&this.tree.treeModel.getNodeById(-1).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.allowShares&&this.user.userHavePermission(rt.SHARES)&&this.tree.treeModel.getNodeById(-2).loadNodeChildren().then(()=>this.tree.treeModel.update()))}actionCancel(){this.copyMoveOn=!1,this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}actionCopy(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,x.COPY),this.copyMoveOn=!1}actionMove(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,x.MOVE),this.copyMoveOn=!1}initRoot(){if(this.nodes=[],this.user.userHavePermission(rt.PERSONAL_SPACE)){let t={id:0,name:this.layout.translateString(Ci.PERSONAL_FILES),path:`${Dt.FILES}/${Be.PERSONAL}`,isDir:!0,inShare:!1,mime:je,quotaIsExceeded:this.store.user.getValue().quotaIsExceeded,enabled:!0,permissions:Cr,children:null,hasChildren:!0,isExpanded:!1};this.checkToggleNodeAtStartup(t,!0)}if(this.allowSpaces&&this.user.userHavePermission(rt.SPACES)){let t={id:-1,name:this.layout.translateString(Ci.SPACES),path:Dt.SPACES,isDir:!0,mime:je,inShare:!1,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}if(this.allowShares&&this.user.userHavePermission(rt.SHARES)){let t={id:-2,name:this.layout.translateString(Ci.SHARES),path:Dt.SHARES,isDir:!0,mime:je,inShare:!0,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}}checkToggleNodeAtStartup(t,n=!1){this.toggleNodesAtStartup?this.getTreeNode(t).then(s=>{t.children=s,n?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update(),this.toggleExpand(this.tree,this.tree.treeModel.getNodeById(t.id),null)}):(n?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update())}focusLastNode(){this.selection&&(this.selection=this.tree.treeModel.getNodeById(this.selection.data.id),this.selection&&B.ACTIVATE(this.tree,this.selection,null))}getTreeNode(t){return this.filesService.getTreeNode(t?.data?.path||t?.path||t,this.showFiles)}collapseChildren(t,n){for(let s of n)[0,-1,-2].indexOf(s.id)===-1&&s.id!==t.id&&(s.data.isExpanded=!1,s.collapse())}toggleExpand(t,n,s){B.TOGGLE_EXPANDED(t,n,s),n.data.isExpanded=!!n.data.isExpanded}onOpen(t){if(!this.copyMoveOn&&this.enableNavigateTo&&t.data.enabled){clearTimeout(this.preventTimer),this.preventDblClick=!0;let n=t.data.path.split("/");n[0]!==Dt.SPACES&&n.unshift(Dt.SPACES),this.router.navigate(n).catch(console.error)}}onSelect(t,n,s){if(!n.data.enabled){this.layout.sendNotification("warning",n.data.name,`${n.data.inShare?"Share":"Space"} is disabled`);return}B.ACTIVATE(t,n,s),this.preventTimer=setTimeout(()=>{this.checkAllowed(n),this.selection=n,this.preventDblClick||n.hasChildren&&(this.collapseChildren(n,n.parent.children),this.toggleExpand(t,n,s)),this.preventDblClick=!1},200)}checkAllowed(t){if(this.copyMoveOn){if(this.store.filesSelection().length)for(let n of this.store.filesSelection()){if(n.root?.alias){this.errorMsg="You can not move an anchored file",this.srcAllowed=!1,this.dstAllowed=!0;return}if(n.lock&&n.lock.ownerLogin!==this.store.user.getValue().login){this.errorMsg="You can not move a locked file",this.srcAllowed=!1,this.dstAllowed=!0;return}}if(t){if([-1,-2].indexOf(t.data.id)>-1){this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.permissions.indexOf(At.ADD)===-1){this.errorMsg="You are not allowed to write here",this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.quotaIsExceeded){this.errorMsg="No more space available",this.srcAllowed=!0,this.dstAllowed=!1;return}}this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}}onCopyMove(){this.onRefresh(),this.copyMoveOn=!0,this.checkAllowed(this.selection)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-tree"]],viewQuery:function(n,s){if(n&1&&Me(O1,7),n&2){let o;J(o=Z())&&(s.tree=o.first)}},inputs:{showFiles:"showFiles",allowShares:"allowShares",allowSpaces:"allowSpaces",enableCopyMove:"enableCopyMove",enableNavigateTo:"enableNavigateTo",sideBarHeader:"sideBarHeader",resizeOffset:"resizeOffset",toggleNodesAtStartup:"toggleNodesAtStartup"},outputs:{selected:"selected"},decls:9,vars:7,consts:[["tree",""],["treeNodeWrapperTemplate",""],["loadingTemplate",""],[1,"sidebar-component-title"],["appAutoResize","",3,"overFlowX","resizeOffset","useMaxHeight"],[3,"nodes","options"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["l10nTranslate","",1,"text-danger","fs-xxs","p-2"],["l10nTranslate",""],[1,"px-2","pt-2","pb-0","fs-xs"],[1,"text-start","text-truncate"],["l10nTranslate","",1,"fs-xs","fw-bold","me-2"],[1,"text-start","text-truncate","mt-1"],[1,"d-flex","justify-content-between","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-secondary",3,"click"],[1,"mx-0","mt-2","mb-0"],[1,"fw-bold","me-1",3,"icon"],[1,"node-wrapper",3,"click","tap"],[3,"node"],[1,"node-content-wrapper"],[3,"index","node"],["animation","spin",1,"fw-bold",3,"icon"]],template:function(n,s){n&1&&(D(0,L1,5,2,"div",3),D(1,F1,27,7),c(2,"div",4)(3,"tree-root",5,0),P(5,R1,4,15,"ng-template",null,1,Xt)(7,V1,2,1,"ng-template",null,2,Xt),d()()),n&2&&(N(s.sideBarHeader?0:-1),l(),N(s.copyMoveOn?1:-1),l(),u("overFlowX","auto")("resizeOffset",s.resizeOffset)("useMaxHeight",!1),l(),u("nodes",s.nodes)("options",s.options))},dependencies:[$i,Fs,ks,On,Nn,Ce,ye],encapsulation:2});let i=e;return i})();function H1(i,e){if(i&1&&(c(0,"span"),g(1,"fa-icon",10),h(2),ve(3,"pathSlice"),d()),i&2){let r=f();l(),u("icon",r.selection.isDir?r.icons.faFolderClosed:r.icons.faFile),l(),se(" ",yt(3,2,r.selection.path,-1)," ")}}function B1(i,e){i&1&&(c(0,"span",2),h(1,"Select a file"),d())}function j1(i,e){if(i&1&&(c(0,"span",7),h(1),d()),i&2){let r=f();l(),R(r.errorSelection)}}var uo=(()=>{let e=class e{constructor(){this.currentRoots=[],this.submitEvent=new L,this.allowSpaces=!1,this.toggleNodesAtStartup=!0,this.mustHaveShareOutsidePermission=!1,this.layout=p(H),this.icons={faFile:wi,faFolderClosed:Fr},this.errorSelection=null,this.selection=null}onSelect(t){if(t){if(this.mustHaveShareOutsidePermission){if(t.permissions.indexOf(At.SHARE_OUTSIDE)===-1){this.errorSelection=this.layout.translateString("You do not have share permission"),this.selection=null;return}if(t.path.split("/").length<=2){this.errorSelection=this.layout.translateString("You can not share a space"),this.selection=null;return}}let n=t,s=this.currentRoots.find(o=>o.file.id===n.id);s?(this.errorSelection=this.layout.translateString("This item is already selected"),this.selection=null):(s=this.currentRoots.find(o=>n.path.startsWith(o.file.path)),s?(this.errorSelection=`${this.layout.translateString("Parent item is already selected")}: ${s.file.path}`,this.selection=null):(this.errorSelection=null,this.selection=n))}else this.selection=null,this.errorSelection=null}onSubmit(){this.submitEvent.emit({id:this.selection.id,name:this.selection.name,path:this.selection.path,mime:this.selection.mime,permissions:this.selection.permissions}),this.layout.closeDialog()}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-files-tree-dialog"]],inputs:{currentRoots:"currentRoots",allowSpaces:"allowSpaces",toggleNodesAtStartup:"toggleNodesAtStartup",mustHaveShareOutsidePermission:"mustHaveShareOutsidePermission"},outputs:{submitEvent:"submitEvent"},decls:13,vars:11,consts:[[1,"modal-header"],[1,"modal-title"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","py-2","px-0"],[3,"selected","enableNavigateTo","enableCopyMove","showFiles","allowShares","allowSpaces","sideBarHeader","toggleNodesAtStartup","resizeOffset"],[1,"modal-footer"],[1,"me-auto","fs-sm","text-danger","text-truncate"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],[3,"icon"]],template:function(n,s){n&1&&(c(0,"div",0)(1,"h4",1),D(2,H1,4,5,"span")(3,B1,2,0,"span",2),d(),c(4,"button",3),b("click",function(){return s.layout.closeDialog()}),d()(),c(5,"div",4)(6,"app-files-tree",5),b("selected",function(a){return s.onSelect(a)}),d()(),c(7,"div",6),D(8,j1,2,1,"span",7),c(9,"button",8),b("click",function(){return s.layout.closeDialog()}),h(10,"Cancel"),d(),c(11,"button",9),b("click",function(){return s.onSubmit()}),h(12,"Confirm"),d()()),n&2&&(l(2),N(s.selection?2:3),l(4),u("enableNavigateTo",!1)("enableCopyMove",!1)("showFiles",!0)("allowShares",!1)("allowSpaces",s.allowSpaces)("sideBarHeader",!1)("toggleNodesAtStartup",s.toggleNodesAtStartup)("resizeOffset",200),l(2),N(s.errorSelection?8:-1),l(3),u("disabled",!s.selection))},dependencies:[Ce,co,ye,Rr],encapsulation:2});let i=e;return i})();function G1(i,e){if(i&1){let r=F();c(0,"input",12),ve(1,"translate"),b("ngModelChange",function(n){S(r);let s=f();return _(s.checkInput(n,!0))}),d()}if(i&2){let r=f();V("is-invalid",!r.rootNameIsValid),u("ngModel",r.newSpaceRoot.name)("placeholder",yt(1,4,"Name",r.locale.language))}}function U1(i,e){if(i&1&&(c(0,"span",9),h(1),d()),i&2){let r=f();l(),R(r.error)}}function $1(i,e){if(i&1){let r=F();c(0,"button",13),b("click",function(){S(r);let n=f();return _(n.onSubmit())}),h(1,"Confirm"),d()}}function q1(i,e){if(i&1){let r=F();c(0,"button",14),b("click",function(){S(r);let n=f();return _(n.onValidRoot())}),h(1,"Check the location"),d()}}var fo=(()=>{let e=class e{constructor(){this.currentRoots=[],this.submitEvent=new L,this.withRootName=!0,this.locale=p(Et),this.layout=p(H),this.icons={faFolderClosed:pr},this.newSpaceRoot={name:"",externalPath:""},this.rootNameIsValid=!1,this.rootPathIsValid=!1,this.rootIsValid=!1,this.spacesService=p(Ot)}ngOnInit(){this.withRootName||(this.rootNameIsValid=!0)}keyEnter(){this.rootIsValid?this.onSubmit():this.onValidRoot()}onValidRoot(){if(this.withRootName&&!this.newSpaceRoot.name||!this.newSpaceRoot.externalPath){this.error="Name and location are required";return}this.newSpaceRoot.externalPath[0]!=="/"&&(this.newSpaceRoot.externalPath="/"+this.newSpaceRoot.externalPath);for(let t of this.currentRoots){let n=t.externalPath[t.externalPath.length-1]==="/"?t.externalPath:`${t.externalPath}/`;if(this.newSpaceRoot.externalPath.startsWith(n)){this.rootPathIsValid=!1,this.error="Parent location already exists in files";return}}this.spacesService.checkSpaceRootPath(this.newSpaceRoot.externalPath).subscribe({next:()=>{this.rootPathIsValid=!0,this.rootNameIsValid=!0,this.rootIsValid=!0,this.error=null},error:t=>{this.rootPathIsValid=!1,this.error=t.error.message}})}onSubmit(){this.submitEvent.emit(this.newSpaceRoot),this.layout.closeDialog()}checkInput(t,n=!1){n?(this.newSpaceRoot.name=t,this.rootNameIsValid=!!t):(this.newSpaceRoot.externalPath=t,this.rootPathIsValid=!!t),this.rootIsValid&&(this.rootIsValid=!1)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-space-root-path-dialog"]],hostBindings:function(n,s){n&1&&b("keyup.enter",function(){return s.keyEnter()})},inputs:{currentRoots:"currentRoots",withRootName:"withRootName"},outputs:{submitEvent:"submitEvent"},decls:14,vars:13,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","form-validation"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModel","is-invalid","placeholder"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-4",3,"ngModelChange","autoFocus","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-sm","text-danger","text-truncate"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModelChange","ngModel","placeholder"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"]],template:function(n,s){n&1&&(c(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),c(3,"span",3),h(4,"Add an external location"),d()(),c(5,"button",4),b("click",function(){return s.layout.closeDialog()}),d()(),c(6,"div",5),D(7,G1,2,7,"input",6),c(8,"input",7),ve(9,"translate"),b("ngModelChange",function(a){return s.checkInput(a)}),d()(),c(10,"div",8),D(11,U1,2,1,"span",9),D(12,$1,2,0,"button",10)(13,q1,2,0,"button",11),d()),n&2&&(l(2),u("icon",s.icons.faFolderClosed),l(5),N(s.withRootName?7:-1),l(),V("is-invalid",!s.rootPathIsValid),u("placeholder",Re("",yt(9,10,"Location",s.locale.language),": /home/sync-in/data"))("autoFocus",!s.withRootName)("ngModel",s.newSpaceRoot.externalPath),l(3),N(s.error?11:-1),l(),N(s.rootIsValid?12:13))},dependencies:[ye,Ce,_t,vi,Ct,bi,St,Si,er],encapsulation:2});let i=e;return i})();var po=(()=>{let e=class e{constructor(){this.locale=p(Et)}ngOnInit(){this.setFilePath()}ngOnChanges(){this.setFilePath()}setFilePath(){let t=this.share.file?Mt(this.share.file.name,-1):"";t?this.fileName=t:this.share.parent?.id?this.fileName=this.share.parent.name:this.share instanceof Jt&&this.share.externalPath&&(this.fileName=this.share.externalPath)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-share-file-name"]],inputs:{share:"share"},features:[Qe],decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],["draggable","false","height","30","width","30","alt","",3,"error","src"],[1,"d-flex","flex-column","overflow-wrap-and-whitespace","ms-2"]],template:function(n,s){n&1&&($t(0,"div",0)(1,"img",1),qn("error",function(){return s.share.fallBackMimeUrl()}),qt(),$t(2,"div",2),h(3),qt()()),n&2&&(l(),ke("src",s.share.mimeUrl,ze),l(2),se(" ",s.fileName," "))},encapsulation:2});let i=e;return i})();function W1(i,e){if(i&1&&(c(0,"span"),h(1),d()),i&2){let r=f();l(),R(r.share.name)}}function K1(i,e){i&1&&(c(0,"span",3),h(1,"Create a new share"),d())}function Y1(i,e){if(i&1&&g(0,"fa-icon",4),i&2){let r=f();u("icon",r.icons.faSpinner)}}function X1(i,e){i&1&&(c(0,"h4",5)(1,"span",3),h(2,"Edit share"),d()())}function Q1(i,e){if(i&1&&(g(0,"fa-icon",39),c(1,"span",40),h(2,"Settings"),d()),i&2){let r=f();u("icon",r.icons.faCog)}}function J1(i,e){if(i&1&&(c(0,"div",19)(1,"label",41),h(2,"File"),d(),g(3,"app-share-file-name",42),d()),i&2){let r=f();l(3),u("share",r.share)}}function Z1(i,e){if(i&1&&(c(0,"div",49)(1,"label",50),h(2,"Deactivation date"),d(),c(3,"div",51),h(4),ve(5,"amDateFormat"),d()()),i&2){let r=f(2);l(4),R(mi(5,1,r.share.disabledAt))}}function el(i,e){if(i&1&&(c(0,"div",31)(1,"div",43)(2,"label",44),h(3,"Creation date"),d(),c(4,"div",45),h(5),ve(6,"amDateFormat"),d()(),c(7,"div",46)(8,"label",47),h(9,"Modification date"),d(),c(10,"div",48),h(11),ve(12,"amDateFormat"),d()(),D(13,Z1,6,3,"div",49),d()),i&2){let r=f();l(5),R(mi(6,3,r.share.createdAt)),l(6),R(mi(12,5,r.share.modifiedAt)),l(2),N(r.share.disabledAt&&!r.share.enabled?13:-1)}}function tl(i,e){if(i&1&&(g(0,"fa-icon",39),c(1,"span",52),h(2,"Members"),d(),c(3,"span"),h(4),d()),i&2){let r=f();u("icon",r.icons.faUsers),l(4),se("(",r.share.members.length,")")}}function il(i,e){if(i&1&&(g(0,"fa-icon",39),c(1,"span",52),h(2,"Links"),d(),c(3,"span"),h(4),d()),i&2){let r=f();u("icon",r.icons.LINKS),l(4),se("(",r.share.links.length,")")}}function nl(i,e){if(i&1){let r=F();c(0,"button",54),b("click",function(){S(r);let n=f(2);return _(n.confirmDeletion=!0)}),h(1," Remove "),d()}if(i&2){let r=f(2);u("disabled",r.confirmDeletion)}}function rl(i,e){if(i&1){let r=F();c(0,"button",57),b("click",function(){S(r);let n=f(3);return _(n.openAdminRootDialog())}),g(1,"fa-icon",39),h(2," External location "),d()}if(i&2){let r=f(3);l(),u("icon",r.icons.faUserShield)}}function sl(i,e){if(i&1){let r=F();c(0,"button",55),b("click",function(){S(r);let n=f(2);return _(n.openSelectRootDialog())}),g(1,"fa-icon",39)(2,"fa-icon",39),h(3," File "),d(),D(4,rl,3,1,"button",56)}if(i&2){let r=f(2);l(),u("icon",r.icons.faPlus),l(),u("icon",r.icons.SHARES),l(2),N(r.user.isAdmin?4:-1)}}function ol(i,e){if(i&1&&D(0,nl,2,1,"button",53)(1,sl,5,3),i&2){let r=f();N(r.share.id?0:r.allowFilesOptions?1:-1)}}function al(i,e){if(i&1){let r=F();c(0,"button",55),b("click",function(){S(r);let n=f();return _(n.openCreateLinkDialog())}),g(1,"fa-icon",39)(2,"fa-icon",39),h(3," Link "),d()}if(i&2){let r=f();l(),u("icon",r.icons.faPlus),l(),u("icon",r.icons.LINKS)}}var ho=(()=>{let e=class e{constructor(){this.parentShareId=null,this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.allowFilesOptions=!0,this.shareChange=new L,this.locale=p(Et),this.layout=p(H),this.icons={SHARED:ee.SHARED_WITH_OTHERS,SHARES:ee.SHARES,LINKS:ee.LINKS,faPlus:dr,faSpinner:yi,faUserShield:sr,faUsers:rr,faCog:ar},this.allowedPermissions=[],this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=p(_i),this.user=this.userService.user,this.sharesService=p(xi),this.linksService=p(Mi),this.spacesService=p(Ot)}ngOnInit(){this.share||([this.share,this.parentShareId]=this.sharesService.initShareFromFile(this.user,this.file,this.isSharesRepo,this.inSharesList)),this.allowedPermissions=Object.keys(this.share.hPerms)}searchMembers(t){let n={search:t,ignoreUserIds:[this.user.id,...this.share.parent?.ownerId?[this.share.parent.ownerId]:[],...this.share.members.filter(s=>s.isUser).map(s=>s.id)],ignoreGroupIds:this.share.members.filter(s=>s.isGroup).map(s=>s.id)};return this.userService.searchMembers(n,[At.SHARE_INSIDE])}openSelectRootDialog(){this.layout.openDialog(uo,"xl",{initialState:{toggleNodesAtStartup:!1,allowSpaces:!0,mustHaveShareOutsidePermission:!0}}).content.submitEvent.pipe(pt(1)).subscribe(n=>{let s=n.path.split("/"),o={id:n.id,name:n.name,path:Mt(n.path,2),permissions:n.permissions,mime:n.mime,ownerId:s[1]===Be.PERSONAL?this.user.id:null,inTrash:!1,isDir:n.mime===je,space:{alias:s[1],name:s[1],root:{alias:"",name:""}}},a=Ye(oe({},this.share),{file:o,externalPath:null});a.name=a.file.name,this.share=new Jt(a),this.allowedPermissions=Object.keys(this.share.hPerms)})}openAdminRootDialog(){this.layout.openDialog(fo,null,{initialState:{withRootName:!1}}).content.submitEvent.pipe(pt(1)).subscribe(n=>{let s=Ye(oe({},this.share),{file:null,externalPath:n.externalPath,name:n.externalPath.split("/").at(-1)});this.share=new Jt(s),this.allowedPermissions=Object.keys(this.share.hPerms)})}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.share,Er.SHARE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.share)}cantSubmit(){return this.submitted||!this.share.externalPath&&!this.share.file}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.parentShareId?this.sharesService.deleteShareChild(this.parentShareId,this.share.id):this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.loading=!1,this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Delete share",this.share.name,n)}}):this.share.id===0?this.sharesService.createShare(this.share).subscribe({next:t=>{this.loading=!1,this.share=t,this.shareChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create share",this.share.name,t)}}):(this.parentShareId?this.sharesService.updateShareChild(this.parentShareId,this.share.id,this.share):this.parentSpaceId?this.spacesService.updateSpaceShare(this.parentSpaceId,this.share):this.sharesService.updateShare(this.share)).subscribe({next:n=>{this.loading=!1,this.share=n,this.shareChange.emit(["update",n]),this.layout.closeDialog()},error:n=>{this.onError(),this.layout.sendNotification("error","Edit share",this.share.name,n)}})}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-share-dialog"]],inputs:{share:"share",file:"file",parentShareId:"parentShareId",parentSpaceId:"parentSpaceId",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList",allowFilesOptions:"allowFilesOptions"},outputs:{shareChange:"shareChange"},decls:57,vars:39,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[1,"mb-3","px-0",2,"max-width","80%"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"mb-3","px-0"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"col-6"],[1,"mb-3"],["for","from","l10nTranslate",""],["id","from",3,"share","showFullPath"],["for","permissions","l10nTranslate",""],[1,"d-flex"],["id","permissions",3,"permissions","replaceEmptyPermissions"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","filterPermissions","allowedPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","shareFilePath","l10nTranslate","",1,"no-select"],["id","shareFilePath",3,"share"],[1,"d-flex","flex-column","align-items-start","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],[1,"d-flex","flex-column","align-items-end","col-4","text-danger","px-0"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(n,s){n&1&&(c(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),D(3,W1,2,1,"span")(4,K1,2,0,"span",3),D(5,Y1,1,1,"fa-icon",4),d(),D(6,X1,3,0,"h4",5),c(7,"button",6),b("click",function(){return s.layout.closeDialog()}),d()(),c(8,"div",7)(9,"tabset",8),g(10,"hr",9),c(11,"tab",10),b("selectTab",function(){return s.tabView=null}),P(12,Q1,3,1,"ng-template",11),c(13,"div",12)(14,"div",13)(15,"div",14)(16,"label",15),h(17," Share name "),d(),c(18,"input",16),vt("ngModelChange",function(a){return gt(s.share.name,a)||(s.share.name=a),a}),d()(),c(19,"div",14)(20,"label",17),h(21," Description "),d(),c(22,"input",18),vt("ngModelChange",function(a){return gt(s.share.description,a)||(s.share.description=a),a}),d()(),c(23,"div",19)(24,"label",20),h(25,"Share status"),d(),c(26,"div",21)(27,"input",22),vt("ngModelChange",function(a){return gt(s.share.enabled,a)||(s.share.enabled=a),a}),d(),c(28,"label",23),h(29),d()()()(),c(30,"div",24),D(31,J1,4,1,"div",19),c(32,"div",25)(33,"label",26),h(34,"Shared from"),d(),g(35,"app-share-repository",27),d(),c(36,"div",25)(37,"label",28),h(38,"File permissions"),d(),c(39,"div",29),g(40,"app-file-permissions",30),d()(),D(41,el,14,7,"div",31),d()()(),c(42,"tab",32),b("selectTab",function(){return s.tabView="members"}),P(43,tl,5,2,"ng-template",11),c(44,"div",9)(45,"app-user-search",33),vt("membersChange",function(a){return gt(s.share.members,a)||(s.share.members=a),a}),d()()(),c(46,"tab",32),b("selectTab",function(){return s.tabView="links"}),P(47,il,5,2,"ng-template",11),c(48,"div",9)(49,"app-user-search",34),vt("membersChange",function(a){return gt(s.share.links,a)||(s.share.links=a),a}),d()()()()(),c(50,"div",35),D(51,ol,2,1),D(52,al,4,2,"button",36),c(53,"button",37),b("click",function(){return s.onCancel()}),h(54,"Cancel"),d(),c(55,"button",38),b("click",function(){return s.onSubmit()}),h(56),d()()),n&2&&(l(2),u("icon",s.icons.SHARED),l(),N(s.share.id?3:4),l(2),N(s.loading?5:-1),l(),N(s.share.id?6:-1),l(),Fe(Re("btn-close btn-close-white ",s.share.id?"ms-2":"ms-auto"," ms-2")),l(2),u("justified",!0),l(9),Fe(Re("form-control form-control-sm ",s.share.name?"":"is-invalid")),mt("ngModel",s.share.name),l(4),mt("ngModel",s.share.description),l(5),mt("ngModel",s.share.enabled),l(2),se(" ",s.share.enabled?"enabled":"disabled"," "),l(2),N(s.share.file!=null&&s.share.file.name||s.share.externalPath?31:-1),l(4),u("share",s.share)("showFullPath",!0),l(5),u("permissions",s.share.hPerms)("replaceEmptyPermissions",!0),l(),N(s.share!=null&&s.share.id?41:-1),l(4),mt("members",s.share.members),u("withPermissions",!0)("filterPermissions",!0)("allowedPermissions",s.allowedPermissions)("searchFunction",s.searchMembers.bind(s)),l(4),mt("members",s.share.links),u("filterPermissions",!0)("allowedPermissions",s.allowedPermissions)("withPermissions",!0)("editFunction",s.openEditLinkDialog.bind(s))("hideInput",!0),l(2),N(s.tabView?-1:51),l(),N(s.tabView==="links"?52:-1),l(3),Fe(Re("btn btn-sm ",s.confirmDeletion?"btn-danger":"btn-primary")),u("disabled",s.cantSubmit()),l(),se(" ",s.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[ye,Ce,Nr,Ar,wr,Dr,Si,Zn,vi,Jn,Ct,bi,_t,St,Or,Lr,po,kr,xr],encapsulation:2});let i=e;return i})();var Xi=class{constructor(e){this.isShareLink=!1,Object.assign(this,e),this.owner.avatarUrl=yr(this.owner.login),this.isShareLink=this.type===Pr.LINK,this.setMimeUrl()}fallBackMimeUrl(){this.mimeUrl=Nt}setMimeUrl(){!this.file||this.file.mime===je?this.mimeUrl=st(zr):this.mimeUrl=st(this.file.mime)}};var mo=i=>({$implicit:i}),ll=(i,e)=>e.id;function cl(i,e){if(i&1&&g(0,"fa-icon",17),i&2){let r=f(3);u("icon",r.icons.LINKS)}}function dl(i,e){i&1&&Ie(0)}function ul(i,e){if(i&1&&(c(0,"ul"),P(1,dl,1,0,"ng-container",10),d()),i&2){let r=f().$implicit;f(2);let t=Yt(15);l(),u("ngTemplateOutlet",t)("ngTemplateOutletContext",bt(2,mo,r.children))}}function fl(i,e){if(i&1){let r=F();c(0,"li")(1,"div",14),b("click",function(){let n=S(r).$implicit,s=f(2);return _(s.onSelect(n))})("dblclick",function(){S(r);let n=f(2);return _(n.openChildShare())}),c(2,"div",15)(3,"img",16),b("error",function(){let n=S(r).$implicit;return _(n.fallBackMimeUrl())}),d(),D(4,cl,1,1,"fa-icon",17),c(5,"span",18),h(6),d()(),c(7,"div",19)(8,"span",20),h(9),d(),g(10,"app-user-avatar",21),d()(),D(11,ul,2,4,"ul"),d()}if(i&2){let r=e.$implicit,t=f(2);l(),V("selected",t.selected&&t.selected.id===r.id),l(2),u("src",r.mimeUrl,ze),l(),N(r.isShareLink?4:-1),l(2),R(r.name),l(3),R(r.owner.fullName),l(),u("user",r.owner)("height",26)("width",26),l(),N((r.children==null?null:r.children.length)>0?11:-1)}}function pl(i,e){if(i&1&&nn(0,fl,12,10,"li",null,ll),i&2){let r=e.$implicit,t=f();rn(t.toShares(r))}}function hl(i,e){i&1&&Ie(0)}var O6=(()=>{let e=class e{constructor(){this.fromAdmin=!1,this.sharesCountEvent=new L,this.layout=p(H),this.icons={SHARED:ee.SHARED_WITH_OTHERS,LINKS:ee.LINKS},this.loading=!1,this.childSharesLength=0,this.sharesService=p(xi),this.linksService=p(Mi),this.spacesService=p(Ot)}ngOnInit(){this.loadChildShares()}toShares(t){return t}loadChildShares(){this.loading=!0;let t;if(this.share)t=this.sharesService.listChildShares(this.share.id);else if(this.space)t=this.spacesService.listSpaceShares(this.space.id);else{console.error("share or space not defined");return}t.subscribe({next:n=>{this.childSharesLength=n.length,this.sharesCountEvent.emit(n.length),this.setShares(n.map(s=>new Xi(s))),this.loading=!1},error:n=>{this.childShares=[],this.childSharesLength=0,this.loading=!1,this.layout.sendNotification("error","Child shares",n.error.message)}})}onSelect(t){this.selected=t}openChildShare(){if(this.selected.isShareLink){let t;if(this.share)t=this.linksService.shareLinkChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShareLink(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:n=>{this.layout.openDialog(Ir,"md",{initialState:{share:n}}).content.shareChange.pipe(pt(1)).subscribe(o=>{let[a,m]=o;a==="update"?this.selected.name=m.name:this.loadChildShares()})},error:n=>this.layout.sendNotification("error","Edit children shares",this.selected.name,n)})}else{let t;if(this.share)t=this.sharesService.getShareChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShare(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:n=>{this.layout.openDialog(ho,"lg",{initialState:Ye(oe(oe({},this.share?{parentShareId:this.share.id}:{}),this.space?{parentSpaceId:this.space.id}:{}),{share:n})}).content.shareChange.pipe(pt(1)).subscribe(o=>{let[a,m]=o;a==="update"?(this.selected.name=m.name,this.selected.alias=m.alias):this.loadChildShares()})},error:n=>this.layout.sendNotification("error","Edit children shares",this.selected.name,n)})}}setShares(t){let n={id:this.share?.id||0,children:[]};this.recurseChildrenShares(t,n),this.childShares=n.children}recurseChildrenShares(t,n){for(let s of t)s.parentId===n.id?(n.children=n.children??[],n.children.push(s),this.recurseChildrenShares(t,s)):n.id===0&&!s.parentId&&(n.children=n.children??[],n.children.push(s),this.recurseChildrenShares(t,s))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=y({type:e,selectors:[["app-shared-children-dialog"]],inputs:{fromAdmin:"fromAdmin",share:"share",space:"space"},outputs:{sharesCountEvent:"sharesCountEvent"},decls:22,vars:9,consts:[["recursiveList",""],[1,"modal-header","align-items-center"],[1,"modal-title","w-100"],[1,"d-flex"],[1,"me-2",3,"icon"],[1,"ms-auto","me-2"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],["appAutoResize","",1,"modal-body",2,"padding-right","24px",3,"resizeOffset"],[1,"tree"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"modal-footer"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"app-div-hovered",3,"click","dblclick"],[1,"me-auto","text-truncate"],["alt","","draggable","false","height","28",3,"error","src"],[1,"align-middle","ms-1",3,"icon"],[1,"ms-1","align-middle"],[1,"d-flex","align-items-center"],[1,"fs-xxxs","me-2"],["tooltipPlacement","top","container","body",3,"user","height","width"]],template:function(n,s){if(n&1){let o=F();c(0,"div",1)(1,"h4",2)(2,"div",3)(3,"div"),g(4,"fa-icon",4),c(5,"span"),h(6),d()(),c(7,"div",5)(8,"span",6),h(9,"Child shares"),d(),h(10),d()()(),c(11,"button",7),b("click",function(){return S(o),_(s.layout.closeDialog())}),d()(),c(12,"div",8)(13,"ul",9),P(14,pl,2,0,"ng-template",null,0,Xt)(16,hl,1,0,"ng-container",10),d()(),c(17,"div",11)(18,"button",12),b("click",function(){return S(o),_(s.openChildShare())}),h(19,"Edit"),d(),c(20,"button",13),b("click",function(){return S(o),_(s.layout.closeDialog())}),h(21,"Close"),d()()}if(n&2){let o=Yt(15);l(4),u("icon",s.icons.SHARED),l(2),R((s.share==null?null:s.share.name)||(s.space==null?null:s.space.name)),l(4),se("\xA0(",s.childSharesLength,") "),l(2),u("resizeOffset",170),l(4),u("ngTemplateOutlet",o)("ngTemplateOutletContext",bt(7,mo,s.childShares)),l(2),u("disabled",!s.selected)}},dependencies:[$i,nt,Ce,ye,Mr],styles:[`ul.tree[_ngcontent-%COMP%], ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:18px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0;line-height:30px;border-left:1px solid rgb(100,100,100);white-space:nowrap}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:inline-flex;width:100%;cursor:pointer;border-radius:4px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-left:none}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{position:relative;top:-.3em;height:1.2rem;width:1rem;color:#fff;border-bottom:1px solid rgb(100,100,100);content:"";display:inline-block}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child:before{border-left:1px solid rgb(100,100,100)}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
`]});let i=e;return i})();export{$l as a,ql as b,$i as c,ml as d,gl as e,vl as f,wi as g,bl as h,yl as i,Cl as j,Sl as k,_l as l,El as m,Fr as n,x as o,Pn as p,n0 as q,r0 as r,zn as s,eo as t,ft as u,ao as v,lo as w,Rr as x,co as y,uo as z,fo as A,ho as B,O6 as C};
|
package/static/chunk-5KLMS6A4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as C,w}from"./chunk-XLCCZSQL.js";import{Ad as x,Eb as n,Fe as y,Ga as p,Gd as _,Mb as m,Xa as u,Yb as s,_c as g,dc as h,fc as f,ha as d,jb as c,kb as l,pb as o,sb as a,se as U,ve as v}from"./chunk-ATP3BFHV.js";function P(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.name," (",t.user.description,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function T(i,e){if(i&1&&(a(0,"fa-icon",2),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("tooltip",s("",t.user.name," (",f(1,12,t.user.type,t.locale.language),")"))("icon",t.icons.faUsers)("placement",t.tooltipPlacement)("container",t.container)}}function b(i,e){if(i&1&&c(0,P,1,8,"img",0)(1,T,2,15,"fa-icon",1),i&2){let t=n();l(t.user.isUser?0:1)}}function I(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.fullName," (",t.user.email,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function S(i,e){if(i&1&&(a(0,"fa-icon",4),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("icon",t.unknownUserAsInfo?t.icons.faLightbulb:t.icons.faUserShield)("tooltip",f(1,10,t.unknownUserAsInfo?"Information":"Administrator",t.locale.language))("placement",t.tooltipPlacement)("container",t.container)}}function M(i,e){if(i&1&&c(0,I,1,8,"img",0)(1,S,2,13,"fa-icon",3),i&2){let t=n();l(t.user.login?0:1)}}var G=(()=>{let e=class e{constructor(){this.isMember=!1,this.unknownUserAsInfo=!1,this.height=30,this.width=30,this.fontSize=16,this.tooltipPlacement="auto",this.container=null,this.locale=d(x),this.icons={faUsers:U,faUserShield:v,faLightbulb:y}}ngOnInit(){this.height<28&&(this.fontSize=13)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=u({type:e,selectors:[["app-user-avatar"]],inputs:{user:"user",isMember:"isMember",unknownUserAsInfo:"unknownUserAsInfo",height:"height",width:"width",fontSize:"fontSize",tooltipPlacement:"tooltipPlacement",container:"container"},decls:2,vars:1,consts:[["alt","",1,"avatar-base-img","cursor-pointer","me-1",3,"height","width","src","tooltip","placement","container"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"]],template:function(r,z){r&1&&c(0,b,2,1)(1,M,2,1),r&2&&l(z.isMember?0:1)},dependencies:[w,C,g,_],encapsulation:2,changeDetection:0});let i=e;return i})();export{G as a};
|