import{a as N,c as I}from"./chunk-HJJJ4ZT2.js";import{a as p}from"./chunk-3DEA4WWC.js";import{Aa as m,Ad as f,Bb as b,Cc as E,Db as d,Dc as a,Ib as o,Jb as c,Kb as l,Ud as C,Vd as M,Xd as D,Za as n,Zb as h,eb as r,ib as S,lc as y,mc as u,nd as g,oc as v}from"./chunk-GJDGQISV.js";var _=e=>({"pe-none":e}),O=()=>["/menu/Profile/Main/My_Subscription"],k=e=>({"text-decoration-none":e}),A=e=>({"text-capitalize":e});function L(e,i){if(e&1&&(c(0,"div",1)(1,"h5",2),u(2),c(3,"a",3)(4,"u",4)(5,"span",4),u(6,"please"),l(),u(7," process your payment! "),l()()()()),e&2){let t=h();y("alert rounded-0 mb-0 text-center border-bottom "+(t.subscriptionState==null?null:t.subscriptionState.class)),n(2),v(" ",t.subscriptionState==null?null:t.subscriptionState.message," "),n(),o("ngClass",a(7,_,t.isMySubscriptionMenu))("routerLink",E(9,O)),n(),o("ngClass",a(10,k,t.isMySubscriptionMenu)),n(),o("ngClass",a(12,A,t.isNotEmpty(t.currentSubStatus)&&t.currentSubStatus!=t.subsStatusEnum.OVERDUE))}}var x=class e{constructor(i,t,s){this.document=i;this.router=t;this.authService=s}subscriptionStatus;subscriptionState;currentSubStatus;subsStatusEnum=N;isMySubscriptionMenu;htmlStyleElement;htmlBodyElement;ngOnInit(){this.checkMySubscriptionMenu(),this.initSubscriptionStatus(),this.getCurrentSubscriptionStatus()}getCurrentSubscriptionStatus(){this.overrideCssStickyHeader()}checkMySubscriptionMenu(){this.isMySubscriptionMenu=!1,this.router.url.includes("/Profile/Main/My_Subscription")&&(this.isMySubscriptionMenu=!0)}isNotEmpty(i){return p.IsNotEmpty(i)}overrideCssStickyHeader(){if(p.IsNotEmpty(this.currentSubStatus)&&this.currentSubStatus!==0){let i=`.sticky-top-thead th {
              top: 100px !important;
              z-index: 1020;
          }`;this.htmlBodyElement=this.document.getElementsByTagName("body")[0],this.htmlStyleElement=this.document.createElement("style"),this.htmlStyleElement.appendChild(this.document.createTextNode(i)),this.htmlBodyElement.appendChild(this.htmlStyleElement)}}initSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus(),this.subscriptionStatus=[{status:1,class:"alert-warning",message:"Your subscription is overdue. To avoid suspension, "},{status:2,class:"alert-danger",message:"Your subscription is partially suspended."},{status:3,class:"alert-danger",message:"Your subscription is suspended."}],this.subscriptionState=this.subscriptionStatus.filter(i=>i.status==this.currentSubStatus)[0]}ngOnDestroy(){this.htmlBodyElement&&this.htmlBodyElement.removeChild(this.htmlStyleElement)}static \u0275fac=function(t){return new(t||e)(r(m),r(C),r(I))};static \u0275cmp=S({type:e,selectors:[["subscription-alert"]],decls:1,vars:1,consts:[["role","alert",3,"class"],["role","alert"],[1,"fw-normal"],[1,"alert-link",3,"ngClass","routerLink"],[3,"ngClass"]],template:function(t,s){t&1&&b(0,L,8,14,"div",0),t&2&&d((s.subscriptionState==null?null:s.subscriptionState.status)==s.currentSubStatus&&s.isNotEmpty(s.currentSubStatus)?0:-1)},dependencies:[f,g,D,M],encapsulation:2})};export{x as a};
