import{Fn as MV,Gn as NV,Ja as g$1,Nr as S$,Ri as Ze,Vr as T5,X as D$,Zs as th,Zt as I5,as as nt,br as Qc,gt as Ex,k as Bb,n as $B,s as $a,yc as wp}from"./chunk-b0nJCs5_.js";import{t as m}from"./chunk-DWd4safw.js";import{t as x}from"./chunk-x3pAkggI2.js";function E(s,t){if(s&1&&(wp(0,`div`,5)(1,`div`,3),S$(2,1),Bb(),th(3,`my-progress-bar`,4),T5(4,`bytes`),Bb()),s&2){let e=D$();$B(3),Ex(`label`,e.labelQuotaDaily())(`max`,e.user?.videoQuotaDaily||0)(`value`,e.userVideoQuotaUsedDaily)(`valueFormatted`,I5(4,5,e.userVideoQuotaUsedDaily,1))(`maxFormatted`,e.userVideoQuotaDaily)}}var g=class s{userService=g$1(Qc);auth=g$1(nt);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 m().transform(this.user.videoQuota,0).toString():this.userVideoQuota="무제한",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new m().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="무제한"}),this.userService.getMyVideoQuotaUsed().subscribe(t=>{this.userVideoQuotaUsed=t.videoQuotaUsed,this.userVideoQuotaPercentage=this.userVideoQuotaUsed*100/this.user.videoQuota,this.userVideoQuotaUsedDaily=t.videoQuotaUsedDaily,this.userVideoQuotaDailyPercentage=this.userVideoQuotaUsedDaily*100/this.user.videoQuotaDaily})}hasDailyQuota(){return this.user.videoQuotaDaily!==-1}labelQuota(){return`Total video quota: ${new m().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`}labelQuotaDaily(){return`Total daily video quota: ${new m().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`}static ɵfac=function(e){return new(e||s)};static ɵcmp=$a({type:s,selectors:[[`my-user-quota`]],decls:7,vars:9,consts:()=>{let t;t="총 동영상 할당량";let e;return e="일일 동영상 할당량",[t,e,[1,`user-quota`,`mb-3`],[1,`label`],[`height`,`2rem`,3,`label`,`max`,`value`,`valueFormatted`,`maxFormatted`],[1,`mt-3`]]},template:function(e,i){e&1&&(wp(0,`div`,2)(1,`div`)(2,`div`,3),S$(3,0),Bb(),th(4,`my-progress-bar`,4),T5(5,`bytes`),Bb(),NV(6,E,5,8,`div`,5),Bb()),e&2&&($B(4),Ex(`label`,i.labelQuota())(`max`,i.user?.videoQuota||0)(`value`,i.userVideoQuotaUsed)(`valueFormatted`,I5(5,6,i.userVideoQuotaUsed,1))(`maxFormatted`,i.userVideoQuota),$B(2),MV(i.hasDailyQuota()?6:-1))},dependencies:[x,m],encapsulation:2,changeDetection:1})};export{g as t};
//# debugId=ed2fddc9-8743-52f6-9af6-a96ba681dfc3
//# sourceMappingURL=chunk-Dd-A5No12.js.map