import{sI as y,sJ as P,sK as p,fd as h,e7 as m,sL as C,b as u,aL as S,sM as a,sN as c,oa as O,x as R,jf as I,sO as E,sP as A,oU as v,sQ as L,ii as T,sR as D,oV as k,sS as M,i0 as g,gl as d}from"./app.BXvw8ij6.js";import{T as l}from"./vendor.CynPCimz.js";function q(){const e=y(),s=P(),n=p(),o=h(["CUSTOM","STORE_CREDIT"]),t=m(),{value:i}=C(),f=t&&!i?.amount.amount;let r=null;return e?s?r="giftCard":n?r="storeCredit":o?r="redeemables":f&&(r="deferred"):r="freeOrder",r}const x=()=>{const{source:{type:e}}=u(),s=S();return l(()=>e==="shopPayExternal"?a.ShopPayExternal:s?a.CheckoutOneRedesign:a.CheckoutOne,[s,e])},b=()=>{const e=x();return l(()=>e===a.ShopPayExternal?c.ShopPayExternal:c.CheckoutOne,[e])},F=()=>{const{shopPay:e}=u(),s=y(),n=O(),o=R().paymentLines.value,t=e.user.paymentMethods,i=e.session.selectedPaymentMethod;if(s)return n?.payment?_(i,t):U(o)},U=e=>{if(e?.length)return I(e,"APPLE_PAY")?"APPLE_PAY":E(e)?"IDEAL":A(e)?"CUSTOM_ONSITE":"CREDIT_CARD"},_=(e,s)=>{if(!(!e&&!s.length))return e&&v(e)||L(s)?"APPLE_PAY":e&&T(e)||D(s)?"IDEAL":e&&k(e)||M(s)?"CUSTOM_ONSITE":"CREDIT_CARD"};function G(){const e=g(),{shouldPreSelectInstallments:s}=u().shopPay.config,n=l(()=>{const t=[];return e.isPointOfSale&&t.push(d.PointOfSale),s&&t.push(d.SpiBanner),e.preselectSpi&&t.push(e.preselectSpi),t},[e.isPointOfSale,s,e.preselectSpi]),o=n.length>0;return{spiPreselected:o,preselectionReason:o?n.join(","):void 0}}export{b as a,q as b,G as c,F as u};
