import{bC as I,aW as M,bD as T,bE as N,ao as _,D as R,aO as D,a as e,ah as E,c as k,bd as L,a_ as h,V as p,P as S,ag as w,y as b,I as x,ak as B,a8 as H,bF as O,bG as F,bH as z,bI as V,bJ as q,aB as C,bK as W,aD as v,B as P,bL as G,bM as J,aR as K,bN as $,bO as U,bP as Y,b0 as j,l as Q,L as X,a9 as Z}from"./app.BTSv6d-3.js";function ne(){const{value:t}=I();return!!t}function oe({children:t}){const l=M(),u=T(),r=N(),s=_(),c=_(),n=R();D(o=>{s.current=void 0,c.current=void 0,"violations"in o&&(s.current=o.violations.map(m=>m.code)),"reasons"in o&&(c.current=o.reasons)});function d(o){o.detail>2&&(l.counter({name:"pay_now_rage_click",value:1}),l.log("rage_click_capture_pay_now_rage_click_detected","pay_now_rage_click",{customerProfile:r?.__typename,numberOfErrors:u?.numberOfErrors()??"unknown",lastInterceptionReasons:c.current,lastViolations:s.current,blocked:n}))}return e("div",{onClickCapture:d,children:t})}function ee({shopId:t,shopName:l,shopLogo:u,amount:r,showDivider:s,isLocalShop:c}){const[n,d]=E(!1),o=k(),m=L();return e(P,{children:[e(h,{columns:["auto","fill"],spacing:"base",children:[e(p,{children:e(S,{size:"small",src:u,alt:l})}),e(p,{blockAlignment:"center",children:[e(w,{"aria-expanded":n,"aria-controls":`separate-payments-collapsible-${t}`,onClick:()=>d(!n),children:e(h,{columns:["fill","auto"],spacing:"base",children:[e(b,{type:"strong",children:l}),e(h,{columns:"auto",spacing:"small200",blockAlignment:"center",children:[!n&&e(b,{type:"strong",children:m(r.amount,{currency:r.currencyCode,form:"short"})}),e(x,{type:n?"chevron-up":"chevron-down",size:"small-200"})]})]})}),e(B,{open:n,id:`separate-payments-collapsible-${t}`,children:[e(H,{spacing:"tight"}),e(O,{title:o("order_summary.cost_table_title"),children:[e(F,{shopId:t}),c&&e(z,{disableTooltip:!0}),e(V,{children:[e(q,{children:e(C,{level:1,children:o("order_summary.total_label")})}),e(W,{children:e(C,{level:1,children:m(r.amount,{currency:r.currencyCode,form:"short"})})})]})]})]})]})]}),s&&e(v,{direction:"inline",borderWidth:"base"})]})}function te(){const t=k(),l=L(),{value:u,loading:r}=G(),s=J(),{name:c,id:n,brandSettings:d,remoteShopsConfigMap:o}=K(),m=$(U),y=Y(()=>{const a=[];for(const[i,g]of s){if(!g)continue;if(i===n){a.push({shopName:c,shopLogo:d?.squareLogo?.url,shopId:n,amount:g});continue}const f=o?.get(i);f&&a.push({shopName:f.name,shopId:i,shopLogo:f.brandSettings?.squareLogo?.url,amount:g})}return a},[s,n,c,d?.squareLogo?.url,o]);if(r||!u||u&&s.size<2)return null;const A=e(X,{textDecoration:"none",overlay:e(j,{heading:t("payment.payments"),children:e(P,{spacing:"base",children:y.map((a,i)=>m?e(ee,{shopId:a.shopId,shopName:a.shopName,shopLogo:a.shopLogo,amount:a.amount,showDivider:i!==y.length-1,isLocalShop:a.shopId===n},a.shopId):e(Q,{children:[e(h,{columns:["auto","fill","auto"],spacing:"base",children:[e(p,{children:e(S,{size:"small",src:a.shopLogo,alt:a.shopName})}),e(p,{blockAlignment:"center",children:e(b,{children:a.shopName})}),e(p,{blockAlignment:"center",children:e(b,{type:"strong",children:l(a.amount.amount,{currency:a.amount.currencyCode,form:"short"})})})]}),i!==y.length-1&&e(v,{direction:"inline",borderWidth:"base"})]},a.shopName||i))})}),children:t("payment.separate_payments_text")});return e(Z,{color:"subdued",children:t("payment.separate_payments_label",{separate_payments_link:A})})}export{oe as R,te as S,ne as u};