import{a as f}from"./chunk-3XOOVRWC.js";import{a as r}from"./chunk-Z7MWQHAJ.js";import{Da as n,Db as S,Jb as h,L as p,Na as D,Qh as g,ba as l,gb as c,hb as E,jh as U,mb as m,nb as _,ob as u,pb as Q,tc as v,vc as y}from"./chunk-ZSQR4KTU.js";import{i as d}from"./chunk-IQVXR75E.js";function V(a,i){if(a&1&&(_(0,"div",5)(1,"div",3),S(2,1),u(),Q(3,"my-progress-bar",4),v(4,"bytes"),u()),a&2){let s=h();n(3),m("label",s.labelQuotaDaily())("max",(s.user==null?null:s.user.videoQuotaDaily)||0)("value",s.userVideoQuotaUsedDaily)("valueFormatted",y(4,5,s.userVideoQuotaUsedDaily,1))("maxFormatted",s.userVideoQuotaDaily);}}var N=(()=>{let i=class i{userService=l(g);auth=l(U);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(p()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new r().transform(this.user.videoQuota,0).toString():this.userVideoQuota="\u0E44\u0E21\u0E48\u0E08\u0E33\u0E01\u0E31\u0E14",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().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 r().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new r().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}};d(i,"\u0275fac",function(o){return new(o||i)();}),d(i,"\u0275cmp",D({type:i,selectors:[["my-user-quota"]],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 o;return o="\u0E42\u0E04\u0E27\u0E15\u0E49\u0E32\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E15\u0E48\u0E2D\u0E27\u0E31\u0E19",[t,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],[1,"mt-3"]];},template:function(o,e){o&1&&(_(0,"div",2)(1,"div")(2,"div",3),S(3,0),u(),Q(4,"my-progress-bar",4),v(5,"bytes"),u(),c(6,V,5,8,"div",5),u()),o&2&&(n(4),m("label",e.labelQuota())("max",(e.user==null?null:e.user.videoQuota)||0)("value",e.userVideoQuotaUsed)("valueFormatted",y(5,6,e.userVideoQuotaUsed,1))("maxFormatted",e.userVideoQuota),n(2),E(e.hasDailyQuota()?6:-1));},dependencies:[f,r],encapsulation:2}));let a=i;return a;})();export{N as a};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-2NXVWTSU.js.map