PageSourceSearch

https://bnpl-consumer.vercel.app/_next/static/chunks/pages/setting…/[paymentMethodId]-d577a5f32f18fc98.js

js bnpl-consumer.vercel.app collected 2026-10-03 06:18:37 UTC 9,181 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1028],{5220:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSP:()=>g,default:()=>j});var a=t(2548),i=t(6152),n=t(2737),l=t(6854),r=t(237),o=t(8842),d=t(5753),c=t(7856),m=t(8099),u=t(6888),h=t(3618),p=t(5226),x=t(1424),f=t(7876),v=t(3991),y=t(2104),g=!0;let j=()=>{let{loading:e}=(0,c.V)(),s=(0,n.useRouter)(),{paymentMethodId:t}=s.query,[g,j]=(0,i.useState)(!1),{t:b,ready:N}=(0,l.Bd)("consumerSettings"),{ready:C,t:w}=(0,l.Bd)("errors"),{data:M,isLoading:k}=m.F.paymentMethods.getCardList.useQuery(),A=(0,i.useMemo)(()=>{var e;return(null!=(e=null==M?void 0:M.paymentMethods)?e:[]).find(e=>e.id===t)},[M,t]),P=m.F.useUtils(),I=m.F.paymentMethods.updatePrimaryStatus.useMutation({onSuccess:()=>{r.Ay.success(b("options.paymentMethods.cardSetAsPrimary")),P.paymentMethods.getCardList.invalidate(),s.push("/settings/payment-methods")},onError:e=>{r.Ay.error(w(e.message))}}),S=m.F.paymentMethods.removeCard.useMutation({onSuccess:()=>{r.Ay.success(b("options.paymentMethods.cardRemovedSuccessfully")),P.paymentMethods.getCardList.invalidate(),s.push("/settings/payment-methods")},onError:e=>{r.Ay.error(w(e.message))}}),[_,D]=(0,i.useState)(!1),[B,R]=(0,i.useState)(!1),E=(0,i.useRef)(null),T=(0,i.useRef)(null),L=[{icon:(0,a.jsx)(p.A,{className:"size-8"}),title:b("options.paymentMethods.setAsPrimary"),onClick:()=>D(!0),isDisabled:!!(null==A?void 0:A.primary)||!!I.isPending,endAdornment:(null==A?void 0:A.primary)&&(0,a.jsx)("span",{className:"text-system-green text-xs font-semibold",children:b("options.paymentMethods.primary")})},{icon:(0,a.jsx)(x.h,{className:"m-1.5 size-5"}),title:b("options.paymentMethods.removeCard"),onClick:()=>R(!0),isDisabled:!!S.isPending}];return((0,i.useEffect)(()=>{j(!0)},[]),(0,i.useEffect)(()=>{_&&E.current&&!E.current.open&&E.current.showModal()},[_]),(0,i.useEffect)(()=>{B&&T.current&&!T.current.open&&T.current.showModal()},[B]),!e&&N&&C&&g&&!k)?A?(0,a.jsxs)(o.A,{variant:"no-nav",children:[(0,a.jsxs)("div",{className:"mb-14 flex flex-col gap-6 md:mb-8",children:[(0,a.jsx)(d.A,{title:b("options.paymentMethods.savedCardTitle"),href:"/settings/payment-methods",hrefLabel:b("options.paymentMethods.title")}),(0,a.jsxs)(u.a,{variant:"card",className:"mx-0! flex flex-col gap-3",children:[(0,a.jsx)("h2",{className:"text-brand-h2",children:b("options.paymentMethods.thisCard")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(p.A,{type:A.type,className:"size-8"}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsxs)("span",{className:"text-body-medium text-system-black",children:["•••• ",A.last4]})})]})]}),(0,a.jsx)("div",{children:(0,a.jsx)(y.A,{items:L,isMobile:!0})}),(0,a.jsx)("div",{className:"hidden",children:(0,a.jsx)(y.A,{items:L,isMobile:!1})})]}),_&&(0,a.jsx)(f.A,{ref:E,title:b("options.paymentMethods.setAsPrimary"),helperText:b("options.paymentMethods.setAsPrimaryConfirmBody"),onClose:()=>D(!1),header:(0,a.jsx)("div",{className:"flex justify-center pb-4",children:(0,a.jsx)("div",{className:"bg-system-green flex h-14 w-14 items-center justify-center rounded-full",children:(0,a.jsx)("span",{className:"text-3xl font-bold text-white",children:"!"})})}),hideCancelIcon:!0,children:(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2.5",children:[(0,a.jsx)("form",{method:"dialog",className:"w-full",children:(0,a.jsx)(v.I,{className:"text-system-black! mx-0! w-full!",variant:"secondary",onClick:()=>{I.isPending||D(!1)},disabled:I.isPending,children:b("common:no")})}),(0,a.jsx)(v.I,{className:"mx-0! w-full!",onClick:()=>{!I.isPending&&A&&I.mutate({cardId:A.id})},loading:I.isPending,children:b("common:yes")})]})}),B&&(0,a.jsx)(f.A,{ref:T,header:(0,a.jsx)("div",{className:"flex justify-center pb-4",children:(0,a.jsx)("div",{className:"bg-system-red flex h-14 w-14 items-center justify-center rounded-full",children:(0,a.jsx)("span",{className:"text-3xl font-bold text-white",children:"!"})})}),title:b("options.paymentMethods.removeCard"),helperText:b("options.paymentMethods.removeCardConfirmBody"),onClose:()=>R(!1),hideCancelIcon:!0,children:(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2.5",children:[(0,a.jsx)("form",{method:"dialog",className:"w-full",children:(0,a.jsx)(v.I,{className:"text-system-black! mx-0! w-full!",variant:"secondary",onClick:()=>{S.isPending||R(!1)},disabled:S.isPending,children:b("common:cancel")})}),(0,a.jsx)(v.I,{className:"mx-0! w-full!",onClick:()=>{!S.isPending&&A&&S.mutate({cardId:A.id})},loading:S.isPending,children:b("options.paymentMethods.removeCardButton")})]})})]}):(0,a.jsxs)(o.A,{variant:"no-nav",children:[(0,a.jsx)(d.A,{title:b("options.paymentMethods.savedCardTitle"),href:"/settings/payment-methods",hrefLabel:b("options.paymentMethods.title")}),(0,a.jsx)("div",{className:"text-body-medium text-system-grey p-8 text-center",children:b("options.paymentMethods.cardNotFound")})]}):(0,a.jsx)(o.A,{variant:"no-nav",children:(0,a.jsx)(h.A,{})})}},5753:(e,s,t)=>{"use strict";t.d(s,{A:()=>h});var a=t(2548),i=t(6152),n=t(5675),l=t.n(n),r=t(2737),o=t(6854),d=t(1028);let c=e=>{let{onClick:s,"aria-label":t}=e;return(0,a.jsx)("button",{type:"button",onClick:s,className:"flex w-fit cursor-pointer items-center","aria-label":t,children:(0,a.jsx)(d.bW,{className:"h-9 w-9"})})},m=e=>{let{href:s,hrefLabel:t,ariaLabel:i}=e;return(0,a.jsxs)(l(),{href:s,className:"flex w-fit items-center",replace:!0,"aria-label":i,children:[(0,a.jsx)(d.bW,{className:"h-9 w-9"}),t&&(0,a.jsx)("span",{className:"text-body-sm-medium -ml-3",children:t})]})},u=i.memo(e=>{let{title:s,href:t,hrefLabel:i,back:n}=e,l=(0,r.useRouter)(),{t:d}=(0,o.Bd)("common");return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[!!(t||n)&&(0,a.jsx)("div",{className:"flex items-center",children:t?(0,a.jsx)(m,{href:t,hrefLabel:i,"aria-label":d("goBack")}):(0,a.jsx)(c,{onClick:()=>l.back(),"aria-label":d("goBack")})}),s&&(0,a.jsx)("h1",{className:"text-headline",id:"page-title",children:s})]})});u.displayName="PageTitle";let h=u},5809:(e,s,t)=>{"use strict";t.d(s,{q:()=>l});var a=t(4032),i=t(8981);let n={loaded:!1,view:"phoneVerify",lastResendTimestamp:void 0},l=(0,a.v)()((0,i.lt)((0,i.Zr)((e,s)=>({...n,reset:()=>e(e=>({...e,...n})),setValues:s=>e(e=>({...e,...s})),setLastResendTimestamp:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return e(e=>({lastResendTimestamp:s}))},resetLastResendTimestamp:()=>e(()=>({lastResendTimestamp:void 0})),parseDetails:(s,t)=>e(e=>t?{view:"completed"}:{view:function(e){for(let t of Object.keys(e).sort((s,t)=>e[s].index-e[t].index)){var s;let a=e[t];if("completed"!==a.status){if("failed"===a.status)return"waitlist";if((null!=(s=a.blockers)?s:[]).every(s=>"completed"===e[s].status)){if("processing"===a.status)return"processing";return t}}}return"processing"}(s)})}),{name:"onboarding-storage"})));l.setState(e=>({...e,loaded:!0}))},5949:(e,s,t)=>{"use strict";t.d(s,{W:()=>l});var a=t(4032),i=t(8981);let n={loaded:!1,basketId:void 0,sellerId:void 0,sellerName:void 0,ecommCustomerData:void 0,redirectSuccessUrl:void 0,redirectFailureUrl:void 0,askBeforeRedirecting:!1,expiration:void 0},l=(0,a.v)()((0,i.lt)((0,i.Zr)((e,s)=>({...n,reset:()=>e(n),storeSession:(s,t,a)=>{let i=new Date;!1===a?i.setHours(i.getHours()+24):i.setMinutes(i.getMinutes()+5),e(e=>{var a,n,l,r,o,d;return{...e,basketId:null==s?void 0:s.id,sellerId:null==s?void 0:s.sellerId,sellerName:t,ecommCustomerData:(null==s?void 0:s.ecommCustomerData)?{id:s.ecommCustomerData.id,name:null!=(a=s.ecommCustomerData.name)?a:void 0,email:null!=(n=s.ecommCustomerData.email)?n:void 0,phone:null!=(l=s.ecommCustomerData.phone)?l:void 0,reference:null!=(r=s.ecommCustomerData.reference)?r:void 0}:void 0,redirectSuccessUrl:null!=(o=null==s?void 0:s.redirectSuccessUrl)?o:void 0,redirectFailureUrl:null!=(d=null==s?void 0:s.redirectFailureUrl)?d:void 0,askBeforeRedirecting:!0,expiration:i}})},setBasketId:s=>e(e=>({...e,basketId:s,askBeforeRedirecting:!1})),isExpired:()=>(e=>!!e&&new Date>e)(s().expiration)}),{name:"ecomm-session-storage"})));l.setState(e=>({...e,loaded:!0}))},7856:(e,s,t)=>{"use strict";
1t.d(s,{V:()=>c});var a=t(6152),i=t(2737),n=t(315),l=t(237),r=t(6854),o=t(5809),d=t(5949);let c=()=>{let{data:e,status:s}=(0,n.wV)(),t=(0,i.useRouter)(),{t:c}=(0,r.Bd)("common"),{parseDetails:m}=(0,o.q)(),{setBasketId:u}=(0,d.W)();return(0,a.useEffect)(()=>{let a=null==e?void 0:e.onboarding;if("unauthenticated"!==s||t.pathname.startsWith("/welcome"))"authenticated"!==s||(null==a?void 0:a.completed)||t.pathname.startsWith("/onboarding")?(null==e?void 0:e.archived)&&(0,n.CI)({callbackUrl:"/welcome"}):(t.push("/onboarding"),(null==a?void 0:a.details)&&m(a.details));else{let e=t.pathname.startsWith("/shop/checkout/");if(e){let e=t.query.basketId;e&&u(e)}let s=(0,l.Ay)(c(e?"notAuthCheckout":"notAuth",{duration:5e3}));return t.push("/welcome"),()=>l.Ay.dismiss(s)}},[s,e,m,t,c,u]),{loading:"loading"===s||"unauthenticated"===s}}},9793:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/payment-methods/[paymentMethodId]",function(){return t(5220)}])}},e=>{e.O(0,[9862,5564,1141,1743,636,6593,8792],()=>e(e.s=9793)),_N_E=e.O()}]);

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.