import{Eo as kb,Fo as l$,Gr as Va,Ia as f$,Q as EV,Qi as bV,Wa as g$1,Za as gx,ec as th,er as Qc,ic as u5,it as FB,li as Xe,ps as p5,rs as nt,vc as wp}from"./chunk-B_pj7Jpm.js";import{t as m}from"./chunk-BD06qecY2.js";import{t as x}from"./chunk-CmVGojCQ.js";function E(s,t){if(s&1&&(wp(0,`div`,5)(1,`div`,3),l$(2,1),kb(),th(3,`my-progress-bar`,4),u5(4,`bytes`),kb()),s&2){let e=f$();FB(3),gx(`label`,e.labelQuotaDaily())(`max`,e.user?.videoQuotaDaily||0)(`value`,e.userVideoQuotaUsedDaily)(`valueFormatted`,p5(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(Xe()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new m().transform(this.user.videoQuota,0).toString():this.userVideoQuota="Neograničeno",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new m().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="Neograničeno"}),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=Va({type:s,selectors:[[`my-user-quota`]],decls:7,vars:9,consts:()=>{let t;t="Ukupna kvota videa";let e;return e="Dnevna kvota videa",[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),l$(3,0),kb(),th(4,`my-progress-bar`,4),u5(5,`bytes`),kb(),EV(6,E,5,8,`div`,5),kb()),e&2&&(FB(4),gx(`label`,i.labelQuota())(`max`,i.user?.videoQuota||0)(`value`,i.userVideoQuotaUsed)(`valueFormatted`,p5(5,6,i.userVideoQuotaUsed,1))(`maxFormatted`,i.userVideoQuota),FB(2),bV(i.hasDailyQuota()?6:-1))},dependencies:[x,m],encapsulation:2,changeDetection:1})};export{g as t};
//# debugId=42a2a95e-08d2-5a90-add9-02e2c2475ee7
//# sourceMappingURL=chunk-BeI1LJc42.js.map