1import{b as M}from"./chunk-7GZFVIA5.js";import{b as y,k as f,m as P}from"./chunk-OF7FCF5J.js";import"./chunk-5EX2TRXF.js";import{$ as d,Fb as g,Ka as l,La as i,Q as p,W as m,fa as u,gb as a,hb as s,wb as r,xb as h,z as c}from"./chunk-VGAOJ7HO.js";var v=(()=>{class n{constructor(t){this.http=t}checkPaymentStatus(t){let e=`${M.CHECK_PAYMENT_STATUS}/${t}`;return this.http.get(e)}static{this.\u0275fac=function(e){return new(e||n)(d(y))}}static{this.\u0275prov=m({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var k=(()=>{class n{constructor(t,e,o){this.route=t,this.router=e,this.paymentApi=o,this.transactionId="",this.statusMessage="Checking payment status..."}ngOnInit(){let t=this.route.snapshot.paramMap.get("id");t?(this.transactionId=t,this.pollingSub=c(0,5e3).pipe(p(()=>this.paymentApi.checkPaymentStatus(this.transactionId))).subscribe({next:e=>this.handleStatus(e),error:e=>{console.error("Error checking payment status",e),this.statusMessage="Error checking payment status. Retrying..."}})):this.statusMessage="Invalid transaction id"}ngOnDestroy(){this.pollingSub?.unsubscribe()}handleStatus(t){switch(t.code){case"PAYMENT_SUCCESS":this.router.navigate(["/order-confirmation",this.transactionId]);break;case"PAYMENT_ERROR":case"PAYMENT_FAILED":this.router.navigate(["/payment-failed",this.transactionId]);break;case"PAYMENT_PENDING":default:this.statusMessage=t.message||"Your payment is in a pending state.";break}}static{this.\u0275fac=function(e){return new(e||n)(i(f),i(P),i(v))}}static{this.\u0275cmp=u({type:n,selectors:[["app-payment-pending"]],standalone:!0,features:[g],decls:7,vars:1,consts:[[1,"payment-pending"]],template:function(e,o){e&1&&(a(0,"div",0)(1,"h2"),r(2,"Payment Processing"),s(),a(3,"p"),r(4),s(),a(5,"p"),r(6,"Please keep this page open while we complete your payment."),s()()),e&2&&(l(4),h(o.statusMessage))},styles:[".payment-pending[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem}.payment-pending[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-bottom:1rem}.payment-pending[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.5rem 0}"]})}}return n})();export{k as PaymentPendingComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.