import{a as V}from"./chunk-BPJDMAWK.js";import{a as n}from"./chunk-7H2UZR47.js";import{Bg as U,Ca as d,Da as m,K as y,Kb as f,Na as h,Ub as S,Va as l,Wb as p,Xf as E,ba as c,cb as _,db as u,eb as Q,mb as v,rb as D,tc as g}from"./chunk-X3RCWQ3R.js";import{i as e}from"./chunk-SR6RTMQI.js";function A(s,a){if(s&1&&(_(0,"div",6)(1,"div",3),v(2,1),u(),Q(3,"my-progress-bar",4),S(4,"bytes"),u()),s&2){let r=D();d(3),l("label",r.labelQuotaDaily())("max",(r.user==null?null:r.user.videoQuotaDaily)||0)("value",r.userVideoQuotaUsedDaily)("valueFormatted",p(4,5,r.userVideoQuotaUsedDaily,1))("maxFormatted",r.userVideoQuotaDaily);}}var N=(()=>{let a=class a{constructor(t,i){e(this,"userService");e(this,"auth");e(this,"userVideoQuota","0");e(this,"userVideoQuotaUsed",0);e(this,"userVideoQuotaPercentage",15);e(this,"userVideoQuotaDaily","0");e(this,"userVideoQuotaUsedDaily",0);e(this,"userVideoQuotaDailyPercentage",15);this.userService=t,this.auth=i;}get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(y()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new n().transform(this.user.videoQuota,0).toString():this.userVideoQuota="ale",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new n().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="ale";}),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 n().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new n().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}};e(a,"\u0275fac",function(i){return new(i||a)(m(U),m(E));}),e(a,"\u0275cmp",c({type:a,selectors:[["my-user-quota"]],standalone:!0,features:[f],decls:7,vars:9,consts:()=>{let t;t="ken pi pana sitelen";let i;return i="ona o ken pana e sitelen pi mute seme lon tenpo suno wan",[t,i,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],["class","mt-3",4,"ngIf"],[1,"mt-3"]];},template:function(i,o){i&1&&(_(0,"div",2)(1,"div")(2,"div",3),v(3,0),u(),Q(4,"my-progress-bar",4),S(5,"bytes"),u(),h(6,A,5,8,"div",5),u()),i&2&&(d(4),l("label",o.labelQuota())("max",(o.user==null?null:o.user.videoQuota)||0)("value",o.userVideoQuotaUsed)("valueFormatted",p(5,6,o.userVideoQuotaUsed,1))("maxFormatted",o.userVideoQuota),d(2),l("ngIf",o.hasDailyQuota()));},dependencies:[g,n,V],encapsulation:2}));let s=a;return s;})();export{N as a};/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*///# sourceMappingURL=chunk-CCWPB53N.js.map