1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[932],{40932:(e,t,a)=>{a.d(t,{A:()=>W});var n=a(59827),i=a(4452),r=a(85651),o=a(40029),l=a(70351),s=a(17600),c=a(29081);let d=({flow:e})=>{let t=e===c.T.PTM;return(0,n.Y)(o.B3,{children:(0,n.FD)(o.gY,{children:["Eleg\xed la ",(0,n.Y)("strong",{children:"app de tu banco"})," o ",(0,n.Y)("strong",{children:"app MODO"}),` para ${t?"pagar":"hacer la transferencia"}`]})})};var p=a(72223),u=a(38269),m=a(19671);let h=u.default.div.withConfig({componentId:"sc-95aceee4-0"})(["align-items:center;background:",";border-radius:0 0 20px 20px;display:flex;font-weight:600;gap:5px;height:90px;justify-content:center;text-align:center;"],m.w4.color.slimGray),g=u.default.div.withConfig({componentId:"sc-95aceee4-1"})(["height:100vh;background:",";"],m.w4.color.white),f=u.default.div.withConfig({componentId:"sc-95aceee4-2"})(["display:flex;flex-direction:column;justify-content:center;gap:5px;align-items:center;width:100%;"]),v=u.default.div.withConfig({componentId:"sc-95aceee4-3"})(["margin:3em 3em 2em;"]),w=u.default.div.withConfig({componentId:"sc-95aceee4-4"})(["font-size:16px;line-height:24px;text-align:center;font-family:var(--font-red-hat-display,'Red Hat Display'),Poppins;"]),y=u.default.div.withConfig({componentId:"sc-95aceee4-5"})(["background:",";margin:2em;padding:0.8em 0;width:90%;display:flex;justify-content:center;align-items:center;border-radius:18px;"],e=>e.theme.color.brand.primary),E=u.default.p.withConfig({componentId:"sc-95aceee4-6"})(["font-size:16px;"]),I=u.default.p.withConfig({componentId:"sc-95aceee4-7"})(["color:",";font-family:var(--font-red-hat-display,'Red Hat Display'),Poppins;font-weight:bold;font-size:18px;"],m.w4.color.white),b=u.default.p.withConfig({componentId:"sc-95aceee4-8"})(["background:",";padding:8px 22px;border-radius:30px;border:2px solid ",";margin-top:5px;text-align:center;font-size:16px;"],m.w4.color.white,m.w4.color.endedPromotions),_=u.default.p.withConfig({componentId:"sc-95aceee4-9"})(["margin:16px;background:",";border-radius:18px;padding:8px 20px;text-align:center;font-size:16px;"],m.w4.color.tertiaryGray08);var x=a(27804);let k="BLOCKED",Y="VOIDED",C="ACCEPTED",N="REJECTED",S="CANCELLED",A="ERROR",R=async({url:e,paymentIntentionId:t})=>{if(!t)return null;try{let{data:a}=await x.A.get(`${e}/merchants/ecommerce/payment-intention/${t}`);return a}catch(e){return console.error("Failed to fetch payment intention:",e),null}},P="Volver a la tienda",T="/static/images/paymentStatusError.svg";var D=a(68462),L=a.n(D),U=a(72277);let F=({status:e,storeName:t})=>{let a=(0,i.useRouter)(),[r,o]=(0,p.useState)(!1),{theme:l}=(0,U.dU)(),[s,c]=(0,p.useState)({title:"",desc:"",imgUrl:"",buttonText:""});return(0,p.useEffect)(()=>{(({status:e,setStatusWording:t,setIsPaymentSuccess:a})=>{switch(e){case Y:t({title:"Pago expirado",desc:"Volv\xe9 a la tienda y realiz\xe1 nuevamente el pago.",imgUrl:"/static/images/paymentStatusWarning.svg",buttonText:"Volver a intentar"});break;case k:t({title:"Por el momento no podes pagar\n con MODO en esta tienda",desc:"Intent\xe1 m\xe1s tarde para finalizar tu compra",imgUrl:"/static/images/qrError.svg",buttonText:P});break;case N:t({title:"Pago denegado",desc:"Por favor, volv\xe9 a la tienda y reintent\xe1 el pago.",imgUrl:T,buttonText:P});break;case S:case A:t({title:"Error en el pago",desc:"Por favor, volv\xe9 a la tienda y reintent\xe1 el pago.",imgUrl:T,buttonText:P});break;case C:a(!0),t({title:"Tu pago fue exitoso",desc:"",imgUrl:"/static/images/paymentStatusSuccess.svg",buttonText:""});break;default:t({title:"",desc:"",imgUrl:""})}})({status:e,setStatusWording:c,setIsPaymentSuccess:o})},[e]),(0,n.FD)(n.FK,{children:[(0,n.Y)(h,{children:s.title}),(0,n.Y)(g,{children:(0,n.FD)(f,{children:[(0,n.Y)(v,{children:s.imgUrl&&(0,n.Y)(L(),{src:s.imgUrl,alt:s.title,width:104,height:104})}),(0,n.Y)(w,{children:s.desc}),r&&t?(0,n.FD)(n.FK,{children:[(0,n.Y)(E,{children:"Pagaste a"}),(0,n.Y)(b,{children:t}),(0,n.Y)(_,{children:"Recibir\xe1s un mail confirmando tu compra.\n Ante cualquier duda consult\xe1 con la tienda."})]}):(0,n.Y)(y,{theme:l,onClick:()=>{let{callback:e}=a.query,t=decodeURIComponent(e);a.push(t)},children:(0,n.Y)(I,{children:s.buttonText})})]})})]})};var M=a(93858),q=a(49736),O=a(14284),$=a(11945);let z=({app:e,link:t,androidLink:a,packageName:r,flow:l,paymentInfo:d})=>{let p=(0,i.useRouter)(),u=l===c.T.PTM,m=e.name;return e?(0,n.FD)(o.Ct,{className:"mb-5",onClick:()=>{e&&((0,q.w)({eventName:"Landing App Selected",properties:{paymentFlow:"online",paymentSource:"online deeplink",bank:m,mobileFlowAvailable:!0,isLastUsedApp:!0,merchantName:d?.storeName,storeId:d?.storeId,status:d?.status,paymentIntentionId:d?.paymentIntentionId}}),p.push((0,s.Jv)({isAndroid:M.m0,packageName:r,name:m,link:t,androidLink:a})))},children:[(0,n.FD)(o.Rr,{children:[(0,n.Y)("img",{src:e.image_url,className:"mr-1 app-button-image",alt:"app-icon"}),(0,n.FD)(o.en,{children:[(0,n.Y)("p",{children:u?"Volv\xe9 a pagar con":"Volv\xe9 a transferir con"}),(0,n.Y)(o.td,{children:e.name})]})]}),(0,n.Y)(o.cL,{children:(0,n.Y)(O.g,{icon:$.XkK,size:"sm"})})]}):null},V=({src:e,className:t,alt:a})=>{let[i,r]=(0,p.useState)(!1);return i||!e?null:(0,n.Y)("img",{src:e,className:t,alt:a,onError:()=>r(!0)})},B=({app:e,link:t,androidLink:a,packageName:r,name:l,iconUrl:c,onClick:d,flow:p,paymentInfo:u})=>{let m=(0,i.useRouter)(),h=(0,s.Jv)({isAndroid:M.m0,packageName:r,name:l,link:t,androidLink:a}),g=a||t?a||t:"",f="Nueva App Macro"===l;return(0,n.Y)(o.Bd,{onClick:()=>{d?.({name:l,mobileFlowAvailable:!!g&&""!==g,paymentInfo:u}),""!=g&&((0,s.BJ)({app:e,flow:p}),m.push(h))},"data-testid":"button",children:(0,n.FD)(o.bP,{children:[(0,n.FD)(o.hh,{children:[f&&(0,n.Y)(o.Q7,{children:"Nueva"}),(0,n.Y)(V,{src:c,className:"mr-1 app-button-image",alt:"app-icon"})]}),(0,n.Y)(o.sS,{children:l})]})})};var K=a(19444);let j=async({url:e,paymentRequestId:t})=>{if(!t)return null;try{let{data:a}=await x.A.get(`${e}/${t}`);return a}catch(e){return console.error("Failed to fetch payment request:",e),null}};var H=a(50839);let J=!1,Q=new Set([k,Y,N,A,S,C]);var G=a(64069);let W=({apps:e,linkProperty:t,onClick:a,paymentEcommerceParams:u,flow:m})=>{let h=(0,i.useRouter)(),g=(0,s.Vx)({flow:m,router:h}),f=u?.callback,v=u?.callbackSuccess,w={qr:u?.qr,callback:f,callbackSuccess:v},{isLoading:y,showApps:E,paymentIntentionStatus:I,paymentInfo:b}=(({flow:e,router:t})=>{let[a,n]=(0,p.useState)(!1),[i,r]=(0,p.useState)(void 0),[o,l]=(0,p.useState)(!0),[s,d]=(0,p.useState)("CREATED");return(0,p.useEffect)(()=>{let i=(e,t)=>{if(!a&&!J){let a=e?.additionalInfo?.storeName||e?.additional_info?.store_name;(0,q.w)({eventName:"Landing App List Showed",properties:{paymentIntentionId:e?.payment_request_id||e.paymentIntentionId,paymentFlow:t,version:e?.payment_request_id?"v2":"v1",paymentSource:"online deeplink",merchantName:a,storeId:e?.storeId||!1,status:e?.
1status}}),J=!0}},o=async e=>{n(!0);let t=(0,K.lh)("ONLINE_PAYMENT_REQUEST_API_URL",H.env.ONLINE_PAYMENT_REQUEST_API_URL),a=await j({url:t,paymentRequestId:e});a&&(d(a.status),l(!Q.has(a.status))),a?.additional_info&&r({paymentIntentionId:a.payment_request_id,amount:a.additional_info.amount,storeName:a.additional_info.store_name,storeId:!1,status:a?.status}),n(!1),i(a,"online")},s=async e=>{n(!0);let t=(0,K.lh)("API_BASE_MERCHANTS_URL",H.env.API_BASE_MERCHANTS_URL),a=await R({url:t,paymentIntentionId:e});a&&(d(a.status),l(!Q.has(a.status))),a?.additionalInfo&&r({paymentIntentionId:a.paymentIntentionId,...a.additionalInfo,storeId:a.storeId,status:a?.status}),n(!1),i(a,"online")},p=async()=>{if(e!==c.T.PTM)return;let{paymentIntentionId:a,paymentRequestId:n}=t.query;n?await o(n):a&&await s(a)};return p(),window.addEventListener("focus",p),()=>{window.removeEventListener("focus",p)}},[]),{isLoading:a,paymentInfo:i,paymentIntentionStatus:s,showApps:o}})({flow:m,router:h}),_=e=>"redirect-to-store"===e[t]?(0,l.w8)(e.app_info):e[t]&&null!==e[t]&&""!==e[t]&&t===r.f.PAYMENT_ECOMMERCE?((e,t)=>{let{qr:a,callback:n,callbackSuccess:i}
1=t,r=new URL(e),o=new URLSearchParams(r.search);return o.set("qr",a),o.set("callback",n),o.set("callbackSuccess",i),r.search=o.toString(),r.href})(e[t],w):e[t],x=e=>t===r.f.PAYMENT_ECOMMERCE?_(e):e.coupon_android_url;return(0,n.Y)(n.FK,{children:E?(0,n.FD)(n.FK,{children:[(0,n.Y)(d,{flow:m}),y?(0,n.Y)(G.y,{}):(0,n.Y)(o.fj,{children:(0,n.FD)(o.MP,{children:[g&&(0,n.Y)(z,{app:g,link:_(g),androidLink:x(g),packageName:s.EL.includes(g.name)?"":g.app_info?.android?.package_name,flow:m,paymentInfo:b}),(0,n.Y)(o.PE,{children:e.map(e=>(0,n.Y)(B,{app:e,iconUrl:e.image_url,name:e.name,packageName:s.EL.includes(e.name)?"":e.app_info?.android?.package_name,link:_(e),androidLink:x(e),onClick:a,flow:m,paymentInfo:b},e.name))})]})})]}):(0,n.Y)(F,{status:I,storeName:b?.storeName})})}},70351:(e,t,a)=>{a.d(t,{$W:()=>i,V0:()=>r,w8:()=>o});var n=a(74448);let i=e=>`https://play.google.com/store/apps/details?id=${e.android.package_name}`,r=e=>`https://apps.apple.com/ar/app/${e.ios.app_name}/id${e.ios.app_id}`,o=e=>(0,n.Cu)()?r(e):i(e)}}]);
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.