1import{a as ee,b as te}from"./chunk-TWJKMHRU.js";import{e as Z}from"./chunk-SZ4ED4GF.js";import{Aa as v,Ad as x,Cc as N,Dc as j,Ea as a,Fa as r,Ga as m,Gc as R,I,Ic as F,Ka as g,Kc as H,La as b,M as S,Ma as h,N as w,Pa as E,Pi as Q,R as f,S as T,Ve as X,Vf as P,Ya as D,Yd as K,Za as p,_a as l,_d as W,ca as B,ee as Y,fa as o,ga as c,jb as A,lb as O,lf as y,nh as q,pb as s,qa as k,qb as d,qg as $,qh as M,rb as U,se as z,ta as C,wb as V,wh as J}from"./chunk-5QQHIOOS.js";import"./chunk-3YTLEYK6.js";var pe=i=>({orgTTGNumber:i}),_=(()=>{class i{constructor(e){this.activePublicTenantSvc=e}ngOnInit(){this.org=this.activePublicTenantSvc.getActiveTenant();let e=this.org.products.find(n=>n.name===x.TextToGive);e&&e.detail&&e.detail.phoneNumber?this.orgTTGNumber=e.detail.phoneNumber:this.orgTTGNumber="N/A"}static{this.\u0275fac=function(n){return new(n||i)(c(K))}}static{this.\u0275cmp=S({type:i,selectors:[["app-text-to-give-confirmation-expired"]],standalone:!0,features:[A],decls:8,vars:11,consts:[[1,"justify-content-center"],[1,"flex","justify-content-space-between"],[3,"innerHTML"]],template:function(n,t){n&1&&(a(0,"app-card",0)(1,"h5"),p(2),s(3,"translate"),r(),a(4,"div",1),m(5,"p",2),s(6,"displayPhone"),s(7,"translate"),r()()),n&2&&(o(2),l(d(3,2,"LABEL.LINK_EXPIRED")),o(3),C("innerHTML",U(7,6,"MESSAGE.IDLE_TOO_LONG",O(9,pe,d(6,4,t.orgTTGNumber))),B))},dependencies:[P,N,M],encapsulation:2})}}return i})();function le(i,L){if(i&1){let e=g();a(0,"app-card",4,1)(2,"h5")(3,"span"),m(4,"i",6),r(),p(5),s(6,"translate"),r(),a(7,"div",7)(8,"p"),p(9),s(10,"translate"),r()(),a(11,"button",8),s(12,"translate"),b("click",function(){f(e);let t=h();return T(t.goToFunds())}),r()()}i&2&&(o(5),l(d(6,3,"LABEL.CONGRATULATIONS_LINKED_ACCOUNT")),o(4),l(d(10,5,"MESSAGE.PHONE_NUMBER_LINKED_SUCCESSFUL")),o(2),E("label",d(12,7,"LABEL.VIEW_FUNDS")))}function me(i,L){if(i&1){let e=g();a(0,"app-card",4,1)(2,"h5")(3,"span"),m(4,"i",6),r(),p(5),s(6,"translate"),r(),a(7,"div",7)(8,"p"),p(9),s(10,"translate"),r()(),a(11,"button",8),s(12,"translate"),b("click",function(){f(e);let t=h();return T(t.goToFunds())}),r()()}i&2&&(o(5),l(d(6,3,"LABEL.CONGRATULATIONS_SETTING_UP_ACCOUNT")),o(4),l(d(10,5,"MESSAGE.ACCOUNT_CREATED_WITH_PAYMENT_SET_NOW")),o(2),E("label",d(12,7,"LABEL.VIEW_FUNDS")))}function ue(i,L){if(i&1){let e=g();a(0,"app-card",4,1)(2,"h5")(3,"span"),m(4,"i",6),r(),p(5),s(6,"translate"),r(),a(7,"div",7)(8,"p"),p(9),s(10,"translate"),r()(),a(11,"button",9),s(12,"translate"),b("click",function(){f(e);let t=h();return T(t.goToUserAccount())}),r()()}i&2&&(o(5),l(d(6,3,"LABEL.CONGRATULATIONS_SETTING_UP_ACCOUNT")),o(4),l(d(10,5,"MESSAGE.ACCOUNT_CREATED_WITH_PAYMENT_SET_LATER")),o(2),E("label",d(12,7,"LABEL.ADD_PAYMENT_METHOD")))}function he(i,L){i&1&&m(0,"app-text-to-give-confirmation-expired")}function fe(i,L){if(i&1){let e=g();a(0,"div",5)(1,"app-add-donor-payment-method-form",10),b("paymentMethodAdded",function(t){f(e);let u=h();return T(u.paymentMethodAdded(t))})("paymentMethodAddCanceled",function(t){f(e);let u=h();return T(u.onCancel(t))}),r()()}if(i&2){let e=h();o(),C("confirmLabel",e.confirmationLabel)("cancelLabel",e.cancelLabelCaption)("loadingLabel",e.confirmationLabel)}}var G=(()=>{class i{constructor(e,n,t,u,oe,re,ae,se,de){this.activeTenantSvc=e,this.changeDetector=n,this.linkSvc=t,this.notificationSvc=u,this.publicTextToGiveSvc=oe,this.route=re,this.router=ae,this.textToGiveSvc=se,this.userSvc=de,this.isLoading=!1,this.phoneNumberSuccessfullyLinked=!1,this.confirmationLabel="LABEL.ADD_PAYMENT_METHOD",this.cancelLabelCaption="LABEL.SETUP_LATER",this.isPaymentMethodAdded=!1,this.showPaymentMethod=!1,this.isPaymentMethodLoading=!1,this.isSetupLater=!1,this.isExpired=!1}ngOnInit(){if(this.org=this.activeTenantSvc.getActiveTenant(),this.isTextToGiveActive(x.TextToGive)){let e=this.org.products.find(n=>n.name===x.TextToGive);e&&e.detail&&e.detail.phoneNumber?this.orgTTGNumber=e.detail.phoneNumber:this.orgTTGNumber="N/A",this.confirmationNumber=this.route.snapshot.paramMap.get("confirmationNumber"),this.hasValidConfirmationCode()}else{this.goToFunds();return}}ngAfterViewChecked(){this.changeDetector.detectChanges()}getProduct(e){return this.org.products.find(n=>n.name===e)}isTextToGiveActive(e){let n=this.getProduct(e);return n&&n.status==="Live"}linkPhoneNumber(){this.isLoading=!0,this.confirmationNumber!==null&&this.textToGiveSvc.linkPhoneNumber(this.confirmationNumber,this.isPaymentMethodAdded,this.isSetupLater).subscribe({next:e=>{if(e.successfullyLinked){let n=new M;this.notificationSvc.toast({title:"LABEL.SUCCESSFULLY_LINKED",message:"MESSAGE.PHONE_NUMBER_LINKED_TO_ONLINE_GIVING",interpolatedParams:{phoneNumber:n.transform(e.userPhoneNumber)}}),this.phoneNumberSuccessfullyLinked=!0}this.isLoading=!1},error:e=>{this.phoneNumberSuccessfullyLinked=!1,this.isExpired=!0,this.isLoading=!1}})}hasValidConfirmationCode(){this.isLoading=!0,this.confirmationNumber!==null&&this.publicTextToGiveSvc.retrieveUserPhoneNumber(this.confirmationNumber).subscribe({next:e=>{e&&(this.isExpired=!1,this.getActivePaymentMethods()),this.isLoading=!1},error:e=>{this.isLoading=!1,this.isExpired=!0}})}goToFunds(){this.router.navigate(this.linkSvc.fundList())}goToUserAccount(){this.router.navigateByUrl(`${this.org.tenantId}/user/account`)}paymentMethodAdded(e){e&&(this.isPaymentMethodAdded=!0,this.showPaymentMethod=!1,this.linkPhoneNumber())}onCancel(e){this.isSetupLater=!0,this.showPaymentMethod=!1,this.linkPhoneNumber()}getActivePaymentMethods(){this.isLoading=!0,this.userSvc.hasActivePaymentMethod().subscribe({next:e=>{e?(this.showPaymentMethod=!1,this.isLoading=!1,this.linkPhoneNumber()):(this.isLoading=!1,this.showPaymentMethod=!0)},error:e=>{this.showPaymentMethod=!1,this.isLoading=!1,this.linkPhoneNumber()}})}static{this.\u0275fac=function(n){return new(n||i)(c(W),c(V),c(z),c(Y),c(ee),c(R),c(F),c(te),c($))}}static{this.\u0275cmp=S({type:i,selectors:[["app-text-to-give-confirmation"]],standalone:!0,features:[A],decls:8,vars:7,consts:[["confirmationDiv","hubBlockable"],["confirmationCard",""],[3,"isLoading","target"],["hubBlockable","",1,"justify-content-center","align-items-center","flex"],[1,"justify-content-center"],["id","payment_method",1,"justify-content-center","align-items-center","flex","slim"],[1,"icon-giving_product_logo_unbound"],[1,"flex","justify-content-space-between"],["id","view_funds_btn","pButton","",1,"font-bold","view-funds-btn","mobile-btn","w-full",3,"click","label"],["id","view_user_account_btn","pButton","",1,"font-bold","mobile-btn","w-full",3,"click","label"],[3,"paymentMethodAdded","paymentMethodAddCanceled","confirmLabel","cancelLabel","loadingLabel"]],template:function(n,t){if(n&1&&(m(0,"app-blocking-loading-spinner",2),a(1,"div",3,0),k(3,le,13,9,"app-card",4)(4,me,13,9,"app-card",4)(5,ue,13,9,"app-card",4)(6,he,1,0,"app-text-to-give-confirmation-expired")(7,fe,2,3,"div",5),r()),n&2){let u=D(2);C("isLoading",t.isLoading)("target",u),o(3),v(!t.isLoading&&t.phoneNumberSuccessfullyLinked&&!t.isPaymentMethodAdded&&!t.isSetupLater&&!t.showPaymentMethod?3:-1),o(),v(!t.isLoading&&t.phoneNumberSuccessfullyLinked&&t.isPaymentMethodAdded&&!t.isSetupLater&&!t.showPaymentMethod?4:-1),o(),v(!t.isLoading&&t.phoneNumberSuccessfullyLinked&&!t.isPaymentMethodAdded&&t.isSetupLater&&!t.showPaymentMethod?5:-1),o(),v(!t.isLoading&&t.isExpired&&!t.phoneNumberSuccessfullyLinked&&!t.showPaymentMethod?6:-1),o(),v(t.showPaymentMethod?7:-1)}},dependencies:[y,q,P,X,_,J,N],styles:["[_nghost-%COMP%] #updateButton{padding-left:0;padding-right:0}.slim[_ngcontent-%COMP%]{width:500px;margin-left:auto;margin-right:auto}.icon-giving_product_logo_unbound[_ngcontent-%COMP%]{margin-right:.25rem;color:var(--giving-color)!important}"]})}}return i})();var ne=[{path:"",children:[{path:"confirmation",children:[{path:"expired",pathMatch:"full",component:_},{path:":confirmationNumber",canActivate:[Z],runGuardsAndResolvers:"always",component:G}]}]}];var Qe=(()=>
1{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=w({type:i})}static{this.\u0275inj=I({imports:[y,H.forChild(ne),j.forChild(),Q,G,_]})}}return i})();export{G as TextToGiveConfirmationComponent,_ as TextToGiveConfirmationExpiredComponent,Qe as TextToGivePublicModule};
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.