import{a as V}from"./chunk-SFESX65L.js";import{a as n}from"./chunk-QQAZFEPL.js";import{Da as d,Ea as m,Eg as U,K as y,Lb as f,Oa as h,Vb as S,Wa as l,Xb as p,Yf as E,ba as c,db as _,eb as u,fb as Q,nb as v,sb as D,uc as g}from"./chunk-QXV2GR6R.js";import{i as e}from"./chunk-JJ4RDTEF.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="\u0E44\u0E21\u0E48\u0E08\u0E33\u0E01\u0E31\u0E14",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new n().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="\u0E44\u0E21\u0E48\u0E08\u0E33\u0E01\u0E31\u0E14";}),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="\u0E42\u0E04\u0E27\u0E15\u0E49\u0E32\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14";let i;return i="\u0E42\u0E04\u0E27\u0E15\u0E49\u0E32\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E15\u0E48\u0E2D\u0E27\u0E31\u0E19",[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:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-3ZUOH3GH.js.map