const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["c0b4c58b.CMmuQvH4.js","630ba094.L_X-5TXi.js","6ec9a0fa.rdcQt2v8.js","f025431a.BlsbPO0-.js","4509beb0.BguNH--m.js","app.BAntcNCf.js","assets/app.CGRs8DQS.css","assets/deferred-boot.Drpcgh6C.css","3c7ea602.cDmY7fUC.js","f1384cc2.BX1JbjgR.js","c328865d.BCB1O5to.js","071c0ba4.B9zTdxJO.js","565bff04.DsKYpUCB.js","8b1d1f25.B1zKYogS.js","9e70befa.ByXaMggF.js","cee09e98.C2K-WJtK.js"])))=>i.map(i=>d[i]); import{It as e,Jt as n,Wt as t,ct as a,ft as s,ot as r,pt as i,yt as o,zt as l}from"./630ba094.L_X-5TXi.js";import{f as c}from"./app.BAntcNCf.js";import{Am as d,Eh as u,Fh as m,Gg as p,Hd as v,OO as h,Rm as f,Wd as b,Wh as g,Xg as y,fx as C,lE as I,rc as S,tu as k,ud as x,ux as R,uy as _,wT as E,xO as P}from"./6ec9a0fa.rdcQt2v8.js";import{H as V,q as j}from"./0e3247a0.Csj0q_SF.js";import{t as w}from"./674595ba.CBCkPO6g.js";function M({name:e,digits:n,icon:t}){return o(p,{className:"YVGTZ",direction:"inline",columnGap:"none",rowGap:"small-200",alignItems:"center",inlineSize:"100%",children:[o("span",{className:"zyVks",children:o(h,{children:e})}),o("span",{className:"U4h7p",children:n}),t]})}function L(e){return e?e.nickname&&e.nickname.trim().length>0?e.nickname:e.bank&&e.bank.trim().length>0?e.bank:function(e){const n=u.get(e.toLowerCase());if(n)return n;const t=e.toUpperCase();return f(t)?d(t):e}(e.brand):""}function N(e,n,t){return!!e&&(0===t.size||[...n].some(e=>!t.has(e.code)))}function O(){const{i18n:e}=P(),n=x(g(E));return o(i,{when:n,children:o(v,{errorType:b.PaymentError,tone:"critical",children:e.translate("store_credit_errors.generic_error")})})}var T=r({displayName:"PostPurchaseShouldRender",suspense:!1,load:()=>a(()=>c(()=>import("./c0b4c58b.CMmuQvH4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])))});function z(e){const{checkout:{negotiator:a}}=P(),{value:s}=a.current.fields.paymentMethods,{paymentLines:r}=a.parts,{bankIdNumberSignal:i}=a.context,{binResolution:l,clearInstallments:c,selectedCardBin:d,expandedVisible:u,collapsedVisible:m}=e.msi,p=u.value,v=m.value,h=n(p);t(()=>{h.current&&!p&&(r.value=c(r.value)),h.current=p},[p,c,r]);const f=n(v);t(()=>{f.current&&!v&&(r.value=c(r.value)),f.current=v},[v,c,r]);const b=d.value,g=e.selectedCreditCard.value?.id;t(()=>{if("client"!==l)return;const e=i.peek();i.value="direct"===g&&S(e,b)?e:b},[l,i,b,g]);const C=R(s??[]);return{expandedSlot:C&&p?G({paymentMethod:C,binResolution:l,id:"msiInstallmentsSelect-expanded"}):void 0,collapsedSlot:C&&v?(I=G({paymentMethod:C,binResolution:l,id:"msiInstallmentsSelect-summary"}),o(y,{paddingInlineStart:"large-100",children:o(j,{onSetFieldErrors:()=>{},children:I})})):void 0};var I}function G({paymentMethod:e,binResolution:n,id:t}){return o(V,"server"===n?{paymentMethod:e,isSelected:!0,isVaultedContext:!0,id:t}:{paymentMethod:e,isSelected:!0,canEditBin:!1,id:t})}function H({manager:t}){const{shopPay:a}=P(),{binResolution:r,collapsedVisible:i}=t.msi,o="server"===r?t.selectedCreditCard.value?.id:void 0;return function({enabled:t,selectedCardId:a}){const{checkout:{identity:r,negotiator:i}}=P(),o=w(),c=n(o);c.current=o;const d=n(i);d.current=i;const u=n(void 0),m=s(t),p=s(a);e(()=>{const e="shopPay"===r.current.value,n=m.value,t=p.value;l(()=>{if(!e)return;const a=d.current,{paymentLines:s}=a.parts;if(!n||!t)return u.current=void 0,void(s.value=k(s.value));if(u.current===t)return;u.current=t;const r=I(s.value,"SHOP_PAY")?.method.walletContent?.creditCardInstallments;s.value=C(s.value,c.current({msiEligibleCard:!0,creditCardInstallments:r})),a.negotiate({withResultHandling:!0,silenceViolations:[..._]}).catch(()=>{u.current=void 0})})})}({enabled:i.value&&!a.session.isLoading.value,selectedCardId:o}),null}export{N as a,O as i,z as n,L as o,T as r,M as s,H as t};