1import{k as e,h as a,u as n,w as r,m as i,g as l,T as s,z as t,L as o,ae as d,p as c,q as m,S as u}from"./2c1ab0fe.Bywc2Brn.js";import{dA as h,dB as g,c as p,dC as v,dD as y,dE as f,dF as b,I as S,dG as w,c$ as _,bN as C,dH as x,J as F,z as N}from"./4b4bc88f.C26USmk8.js";import{et as T,K as k,l as z,q as I,bf as B,aH as D,S as E,aS as L,j as A,eu as j,a1 as R,an as O,ev as W,ew as H,ex as M,bR as P,ey as V,ez as G,b as J,ab as Q,eA as U,k as K,dm as q,dJ as Y,eB as $,e2 as X,by as Z,eC as ee,eD as ae,eE as ne,H as re,B as ie,aT as le,dq as se,eF as te,eG as oe,d as de}from"./164ad2e3.DZSd7pLX.js";import{T as ce}from"./7b0c98ea.wJBUDVvK.js";import{u as me,f as ue}from"./1ed8f5e3.CzhdrJHY.js";import{u as he}from"./945a08d6.VZGO8GHT.js";import{c as ge}from"./24773686.CaAVXUiT.js";import"./app.DRs7v1W8.js";import"./d0bb51ec.-Od_3rgw.js";import"./f67abd2c.vvptRNe9.js";import"./60a453ce.Bo_pHupz.js";import"./e12db40c.J_ouQ898.js";import"./9dba8418.BzGnZlrB.js";const pe={FloatingSummaryWrapper:"Uo0Cz","FloatingSummaryWrapper-enter":"vbGnb","FloatingSummaryWrapper-entering":"_30e7y","FloatingSummaryWrapper-exit":"_1LMtV","FloatingSummaryWrapper-exiting":"TEpNv","FloatingSummaryWrapper-exited":"_16LRF",FloatingSummary:"YrNyQ","FloatingSummaryWrapper-hidden":"Ngyh8","FloatingSummary-dark":"Y0h8K"};function ve({merchandise:l,paymentDue:s,onClick:t}){const o=h(),d=g(),c=T(),{i18n:m,checkout:u}=p(),f=u.configuration.layout.isOnePage.value,b=e(()=>s.value.amount>0&&v({comparisonPrice:o.value,payableTotal:s.value,suppressed:d.value,hasStoredValue:c.value})),{colors:{schemes:S={}}}=k(),{orderSummary:{floatingSummary:{visibility:w}={}}}=z(),_="visible"===w&&f,{config:C,floatingElementHidden:x,ready:F}=I("floating_summary"),{offset:N}=me("floating_summary",{active:_}),O=F.value&&!x.value;a(()=>{C.value=_?{blockEndOffset:N.value+32,floatingElementBlockSize:0,floatingElementHiddenBelowTrigger:!0}:void 0},[N.value,C,_]);const W=B(O,O?"fast":"none");if(!_||!F.value||"exited"===W)return null;const H=S?.scheme1?.base?.background,M=Boolean(H&&!y(H));return n("div",{className:i(pe.FloatingSummaryWrapper,pe[`FloatingSummaryWrapper-${W}`],ue.FloatingLayer),style:{"--floating-summary-offset":`${N.value}px`,"--floating-layer-view-transition-name":"vt-floating-summary"},children:n(D,{onClick:t,accessibilityVisibility:"hidden","data-event-name":"floating_summary",children:n(E,{className:i(pe.FloatingSummary,M&&pe["FloatingSummary-dark"]),alignItems:"center",direction:"inline",padding:"small-100",gap:"small-200",children:[n(L,{merchandise:l,size:"small-200",variant:l.length<=3?"inline":"fan",max:3}),n(E,{direction:"inline",alignItems:"center",gap:"small-200",children:[n(E,{gap:"small-400",alignItems:"end",children:[n(r,{when:b,children:()=>n(A,{size:"small",color:"subdued",type:"redundant",translate:!1,children:m.formatCurrency(o.value.amount,{currency:o.value.currencyCode,form:"short"})})}),n(j,{paymentDue:s,hideCurrencyCode:!0})]}),n(R,{type:"chevron-down",size:"small-200"})]})]})})})}function ye(){const{embed:a,shop:n}=p(),r=n.hasFlagEnabled(f),i=b(),l=O();return e(()=>{const e=l.configurationSignal.value.orderSummary?.collapsedSavingsDisplay,n=i.value;return{showTotalSavings:"base"!==e&&!r&&!S(a?.embedder)&&n&&Boolean(0!==n.amount)}})}function fe(){const{i18n:a}=p(),i=b(),l=ye(),s=W(),t=e(()=>l.value.showTotalSavings?i.value:void 0),o=e(()=>null!=s.value||null!=t.value);return n(r,{when:o,children:n(E,{alignItems:"end",gap:"small-500",children:[n(r,{when:s,children:e=>n(H,{bgnAmount:e})}),n(r,{when:t,children:e=>n("div",{className:"JH32S",children:n(E,{direction:"inline",alignItems:"center",gap:"small-400",children:[n(E,{direction:"inline",alignItems:"center",gap:"small-500",children:[n(R,{type:"savings",size:"small",color:"base"}),n(A,{color:"subdued",children:a.translate("order_summary.total_savings")})]}),n(A,{color:"subdued",translate:!1,children:a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"})})]})})})]})})}function be(){const{shop:a,i18n:i,checkout:{negotiator:l}}=p(),s=a.hasFlagEnabled(w),t=M(),o=P(),d=_(),c=e(()=>{const e=l.current.fields.paymentFlexibilityPaymentTermsTemplate.value;if(e?.dueDate){const a=t(e.dueDate,{month:"short"});return i.translate("order_summary.deferred_total_due_date_label",{date:a})}return"FULFILLMENT"===e?.type?i.translate("order_summary.payment_terms_totals.due_on_fulfillment"):i.translate("order_summary.total_due_later_label")});return n(r,{when:()=>l.current.fields.recurringTotals.value||d.value&&o.value,children:n(E,{gap:"small-300",children:[n(V,{cardStyle:!0}),n(r,{when:()=>o.value&&s,children:n(G,{variant:"card"})}),n(r,{when:()=>o.value&&!s?d.value:void 0,children:e=>n(J,{background:"subdued",padding:"small-300",borderRadius:"small",children:n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[n(A,{color:"subdued",children:c}),n(A,{color:"subdued",children:i.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"})})]})})}),n(U,{variant:"card"})]})})}const Se="MTaKn",we="OhxUg",_e="_497ww",Ce="mobileOrderSummary",xe={base:"small-200","large-100":"small-100"};function Fe(){const y=K(),{showTotalSavings:f}=ye().value,b=P(),{checkout:w,i18n:B,shop:{discountCodesEnabled:O,name:W},source:H,embed:M}=p(),{value:V}=w.negotiator.current.fields.merchandiseLines,{configuration:G}=w,U=w.proposal.facts.merchandiseLines??[],me=q(),ue=O&&me.value,pe=G.visibility.showReductions,Fe=S(M?.embedder),Ne=Fe&&"beforeDetails"!==G.orderSummary?.placement,{reductions:{position:Te,disclosureVisibility:ke},orderSummary:{isCollapsible:ze,headerPosition:Ie,defaultState:Be,chevronSize:De="base",collapsedSavingsDisplay:Ee,thumbnailStyle:Le}={}}=z(),Ae="base"===Le,je="base"!==Te&&pe,Re=Y(),Oe="COMPACT"===G.orderSummary?.layoutStyle,We=B.translate("order_summary.payment_terms_totals.due_today_next"),{amount:He,label:Me}=$(),Pe=B.translate("order_summary.pay_merchant_label",{merchant_name:W}),Ve=e(()=>b.value?We:Me.value),Ge=G.orderSummary?.headerPosition??Ie,Je=G.orderSummary?.defaultState??Be,Qe=ze??!0,Ue=_(),Ke=h(),qe=g(),Ye=T(),$e=C(),Xe=x(),Ze=e(()=>"BOTTOM"===Ge&&!0===ze&&(Xe.value||Boolean(w.proposal.facts.taxesIncluded))&&!$e.value&&!Ye.value&&Boolean(Ue.value)),ea="base"===Ee,aa=ea&&v({comparisonPrice:Ke.value,payableTotal:Ue.value,suppressed:qe.value,hasStoredValue:Ye.value}),{lineItems:{priority:na="base"},moneyLines:{color:ra}}=k(),ia=G.visibility.showAside,la=!G.visibility.showOrderSummaryMerchandiseLines||"high"===na,sa=X("bottom",{hideMerchandiseLines:la}),ta=he(sa),oa=Z(),da=ee(),ca=f||aa,ma=e(()=>!ta.value&&Qe),[ua,ha]=t(o(()=>ta.value||"EXPANDED"===Je||"shopPayLogin"===y.value.currentDetour?.type)),[ga,pa]=t(),{triggerNode:va,floatingElementHidden:ya,ready:fa,setTriggerNode:ba}=I("floating_summary"),Sa=d(null),{ref:wa,max:_a}=ae("base");(function({open:e,setOpen:n,enabled:r=!0}){const i=l(new Set),{checkout:{negotiator:t}}=p(),{discountCodeWarningSignal:o}=t.context,d=s(()=>{return(e=o.value||[])&&0!==e.length?e.map(e=>JSON.stringify({code:e.discountCode,errorCode:e.errorCode??null,message:e.message??e.messageHtml??"",tone:e.tone??"info"})):[];var e},[o.value]);a(()=>
1{if(!r)return;const a=d.some(e=>!i.current.has(e));!e&&a&&n(!0),i.current=new Set(d)},[r,e,d,n])})({open:ua,setOpen:ha,enabled:je}),c(()=>{oa.value&&da.value.hasViolations&&ha(!0)});const[Ca,xa]=t(!1),[Fa,Na]=t(!1),Ta=m(()=>{ua&&Ca&&(Na(!0),xa(!1))},[ua,Ca]),ka=B.translate("order_summary.title"),za=m(()=>ha(e=>!e),[]),Ia=m(()=>{const e=va.value;if(!e)return;const a=Sa.value?.offsetHeight??0,n=window.scrollY+e.getBoundingClientRect().top-a;pa({duration:0}),ha(!0),requestAnimationFrame(()=>{window.scrollTo({top:n,behavior:"smooth"}),pa(void 0)})},[va,Sa]),{totalLineQuantities:Ba=0,totalLineQuantitiesFact:Da=0}=ne(),Ea=F(H)?U:V?.lines||[],La=ge(),Aa=m(()=>{ha(!0),xa(!0),Na(!1)},[ha,xa,Na]),ja=l(He.peek()??Ue.peek()),Ra=e(()=>{if(b.value)return{amount:0,currencyCode:Ue.value?.currencyCode??"USD"};const e=He.value??Ue.value;return e&&(ja.current=e),ja.current??{amount:0,currencyCode:"USD"}});if(!La.value)return null;const Oa=B.translate("order_summary.number_items",{count:F(H)?Da:Ba}),Wa=!ca||ua||ea||Ae?"center":"start",Ha=function(e){return void 0===e?"default":e?"simplified":"flex"}(ze),Ma=!Ae||Ea.length<=1,Pa={variant:Ae?"inline-discrete":"fan-legacy",size:Ae?"base":"small",merchandise:Ea,useImageAltTexts:!1,sortByPrice:!Ae},Va="default"===Ha&&!ua,Ga=n("div",{className:Va?"jzkzG":void 0,children:n(Q,{gridAutoFlow:"column",gridTemplateColumns:ua?"minmax(0, 1fr) minmax(auto, max-content) minmax(auto, max-content)":"minmax(0, 1fr) auto auto",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",alignItems:Wa,alignContent:Wa,children:[!ua&&n("span",{className:N({screenReaders:"only"}),children:ka}),n(E,{direction:"inline",gap:"small-200",alignItems:"center",className:"GkiQ5",ref:wa,children:[Ea&&!ua&&n(L,{...Pa,...Ae&&{max:_a.value}}),!ua&&Ma&&n(E,{gap:"small-400",children:[n("div",{className:we,children:n(A,{size:Ne?"base":"large",type:"strong",children:Ve.value})}),n("div",{className:we,children:n(A,{color:"subdued",children:Oa})})]}),ua&&n(re,{level:Ne?3:1,accessibilityRole:"presentation",children:ka})]}),n(E,{direction:"inline",alignItems:ua?"center":"start",gap:"small-200",justifyContent:"end",children:n("div",{className:i(we,ua&&Se),children:n(E,{gap:"small-400",alignItems:"end",children:[aa&&n(A,{size:"base",color:"subdued",type:"redundant",translate:!1,children:B.formatCurrency(Ke.value.amount,{currency:Ke.value.currencyCode,form:"short"})}),n(j,{paymentDue:Ra,alignItems:"center",showCurrencyBadge:!0,size:Fe&&!Ne?"large":void 0}),ua?void 0:n(fe,{})]})})}),n("div",{className:i(ca&&!ua&&!ea&&"EeiAc"),children:n(R,{size:xe[De],type:ua?"chevron-up":"chevron-down",color:"strong"})})]})}),Ja=n("div",{className:_e,children:n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",alignItems:"center",alignContent:"center",children:[n("div",{className:we,children:n(A,{color:ra,children:Pe})}),n(E,{direction:"inline",gap:"large-100",alignItems:"center",children:[n(r,{when:()=>!ta.value,children:n(R,{size:xe[De],type:ua?"chevron-up":"chevron-down",color:"strong"})}),n(j,{paymentDue:Ra,alignItems:"center",showCurrencyBadge:!1})]}),n("span",{className:N({screenReaders:"only"}),children:ka})]})}),Qa=n(r,{when:Ze,children:n("div",{className:_e,children:n(oe,{taxesIncluded:!0,variant:"card"})})}),Ua=n("div",{className:"HoRN2",children:[n(re,{level:Ne?3:1,children:n(r,{when:()=>ua||ta.value,fallback:Ve,children:ka})}),n(r,{when:()=>!ta.value,children:n(u,{children:[n("div",{className:"BKEy4"}),n("div",{className:ua?Se:void 0,children:n(j,{paymentDue:Ra})}),n(R,{size:xe[De],type:ua?"chevron-up":"chevron-down",color:"strong"})]})})]}),Ka=(()=>{switch(Ha){case"default":return n(r,{when:ta,fallback:Ga,children:n("div",{className:we,children:n(re,{level:Ne?3:1,children:ka})})});case"simplified":return Ja;case"flex":return Ua}})(),qa="BOTTOM"===Ge,Ya=n(D,{"data-event-name":ua?"order_summary_hide":"order_summary_show",expanded:ua,controlId:Ce,onClick:za,inlineSize:"100%",className:i("E5sxd",!ua&&fa.value&&!ya.value&&"odSWN"),children:Ka}),$a="hidden"!==ke&&ue&&je&&!ua&&(!Oe||Fe)&&!ze,Xa=n(E,{gap:"base",accessibilityRole:"section",accessibilityLabelledBy:"mobile-order-summary-heading",children:[n(re,{id:"mobile-order-summary-heading",visibility:"hidden",children:ka}),$a?n(ie,{tone:"monochrome",onClick:Aa,commandFor:Ce,size:"small","aria-expanded":!1,children:n(E,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(R,{type:"discount",size:"small-100",tone:"monochrome"}),n(A,{children:B.translate("order_summary.discount_discovery.add_code")})]})}
1):null,n(J,{children:["base"===Te&&pe&&n(le,{id:"inline-reductions",open:!ua,duration:"fast",children:n("div",{ref:Sa,children:n(J,{paddingBlockEnd:"large-400",children:n(se,{monorailSection:"order_summary",headerLevel:Re.value.payment?void 0:2})})})}),n("div",{ref:ba,children:n(J,{display:ia?"@media (inline-size >= medium) none, auto":"auto",className:Va?"QF5CJ":void 0,children:n(ce,{config:ga,onTransitionEnd:Ta,children:[!qa&&Ya,ua?n("div",{id:Ce,children:n(J,{paddingBlockStart:qa?void 0:"small-100",children:n(te,{skipWrappingSection:!0,hideAccessibilityTitle:!0,hideMerchandiseLines:la,hideReductions:!pe,reductionsFieldAutoFocus:Ca,reductionsFieldAutoScroll:Fa})})},"mobile-order-summary-open"):n("div",{id:Ce},"mobile-order-summary-closed"),qa&&ua&&Qa,qa&&Ya]})})})]}),ua?null:n(be,{})]}),Za=n(E,{children:n(J,{display:ia?"@media (inline-size >= medium) none, auto":"auto",children:[!qa&&Qe&&Ka,!qa&&Qe&&n(de,{blockSize:"small-100"}),n(te,{skipWrappingSection:!0,hideAccessibilityTitle:!0,hideMerchandiseLines:la,hideReductions:!pe}),qa&&Qe&&Qa,qa&&Qe&&Ka]})});return n(u,{children:[n(ve,{merchandise:Ea,paymentDue:Ra,onClick:Ia}),n(r,{when:ma,fallback:Za,children:Xa})]})}export{Fe as MobileOrderSummary};
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.