import{B}from'./chunk-hXR2OK-Q.js';import{s}from'./chunk-nfSA6zwi.js';import{g as g$1,P as Pc,aQ as Ze,dG as ze,b as Pa,s as sp,v as vV,d as lb,f as Pp,cq as E$,k as w2,W as WB,a3 as H0,cr as T$,o as x2,S as SV}from'./main-DEZ5cZzu.js';function g(i,E){if(i&1&&(sp(0,"div",5)(1,"div",3),vV(2,1),lb(),Pp(3,"my-progress-bar",4),E$(4,"bytes"),lb()),i&2){let e=SV();WB(3),H0("label",e.labelQuotaDaily())("max",e.user?.videoQuotaDaily||0)("value",e.userVideoQuotaUsedDaily)("valueFormatted",T$(4,5,e.userVideoQuotaUsedDaily,1))("maxFormatted",e.userVideoQuotaDaily);}}var b=(()=>{class i{userService=g$1(Pc);auth=g$1(Ze);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(ze()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new s().transform(this.user.videoQuota,0).toString():this.userVideoQuota="\uBB34\uC81C\uD55C",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new s().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="\uBB34\uC81C\uD55C";}),this.userService.getMyVideoQuotaUsed().subscribe(e=>{this.userVideoQuotaUsed=e.videoQuotaUsed,this.userVideoQuotaPercentage=this.userVideoQuotaUsed*100/this.user.videoQuota,this.userVideoQuotaUsedDaily=e.videoQuotaUsedDaily,this.userVideoQuotaDailyPercentage=this.userVideoQuotaUsedDaily*100/this.user.videoQuotaDaily;});}hasDailyQuota(){return this.user.videoQuotaDaily!==-1;}labelQuota(){return`Total video quota: ${new s().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new s().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}static ɵfac=function(o){return new(o||i)();};static ɵcmp=Pa({type:i,selectors:[["my-user-quota"]],decls:7,vars:9,consts:()=>{let e;e="\uCD1D \uB3D9\uC601\uC0C1 \uD560\uB2F9\uB7C9";let o;return o="\uC77C\uC77C \uB3D9\uC601\uC0C1 \uD560\uB2F9\uB7C9",[e,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],[1,"mt-3"]];},template:function(o,t){o&1&&(sp(0,"div",2)(1,"div")(2,"div",3),vV(3,0),lb(),Pp(4,"my-progress-bar",4),E$(5,"bytes"),lb(),w2(6,g,5,8,"div",5),lb()),o&2&&(WB(4),H0("label",t.labelQuota())("max",t.user?.videoQuota||0)("value",t.userVideoQuotaUsed)("valueFormatted",T$(5,6,t.userVideoQuotaUsed,1))("maxFormatted",t.userVideoQuota),WB(2),x2(t.hasDailyQuota()?6:-1));},dependencies:[B,s],encapsulation:2,changeDetection:1});}return i;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{b};//# sourceMappingURL=chunk-BuKyUwX2.js.map