1import{j as e}from"./jsx-runtime-BldLWdAb.js";import{J as _,y as ut}from"./index-CsOsFUNt.js";import{r as f,b as dt,F as xt,A as U,j as Z,g as Le,L as K,p as mt,h as ft,N as Ie}from"./chunk-TMI4QPZX-D9QXhwIA.js";import{B as ee,c as N,I as E,S as Oe,a as te}from"./Button-CJnu3L3K.js";import{u as F}from"./root-data-krBqGuJA.js";import{r as ht}from"./index-CpYlVArO.js";import{u as le,$ as pt}from"./index-iqFKbo7O.js";import{D as gt,a as bt,b as jt,e as vt,c as Nt,d as wt,f as yt}from"./dialog-ivWQpbI2.js";import{a as S,q as De,A as Me,r as we,t as ye,v as kt,w as Ct,x as Pe,y as St,z as Tt,B as Et,s as I,C as se,D as At,E as $}from"./stripDomain-C7JUGlFD.js";import{i as G,b as J,C as Lt}from"./types-Dfz_2PEH.js";import{I as R}from"./Image-Df1FrJwD.js";import{M as H}from"./Money-BKyqo55C.js";import{S as Fe,a as qe,b as ze,c as Be,d as me,e as ke,f as Ce}from"./select-CQGIMHSB.js";import{u as V,P as ae,A as It}from"./AddToCartButton-JoIAqoo3.js";import{I as he}from"./input-DJWKcJ8R.js";import{k as Ot}from"./constants-BcXRWDNQ.js";import{D as _e}from"./DiscountBadge-BxOYo4qE.js";import{k as Re,a as Dt,T as Mt}from"./TippyTopBanner-BMAoscJm.js";import{t as ue}from"./tailwind.config-In9VHFak.js";import{a as Qe,b as $e,c as He,d as Ue,e as Ve,f as Pt,g as Se,S as Ft}from"./Search-B469z3B5.js";import{p as qt}from"./priceToMoneyV2-Ds0fI7ha.js";import{u as zt,g as Bt,E as _t}from"./schemas-BMkw1pNv.js";import{L as P}from"./Link-UW_zYb5n.js";import{A as Ye,a as Je,b as Ke,c as Ze}from"./accordion-BD27n_FW.js";async function Rt(t){const{redirect:s,return_to:a}=t;try{const r=await fetch("/account/login/multipass",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({return_to:a})});if(!r.ok){const o=`${r.status} /multipass response not ok. ${r.statusText}`;throw new Error(o)}const{data:n,error:l}=await r.json();if(l)throw new Error(l);if(!(n!=null&&n.url))throw new Error("Missing multipass url");return window.location.href=n.url,n}catch(r){const n=r instanceof Error?r.message:"Unknown error";return console.error("â ï¸ Bypassing multipass checkout due to",n),a&&(window.location.href=a),{url:null,token:null,error:n}}}function Qt({checkoutUrl:t,storeDomain:s,checkoutDomain:a}){return t.includes(a)?t:t.replace(s,a)}function Ge(t){const{publicStoreDomain:s,publicCheckoutDomain:a}=F(),[r,n]=f.useState(!1);return{checkoutHandler:f.useCallback(async()=>{if(n(!0),!t)return;const o=Qt({checkoutUrl:t,storeDomain:s,checkoutDomain:a});return await Rt({return_to:o,redirect:!0})},[t,a,s]),isCheckoutSubmitting:r}}function de({checkoutUrl:t}){const{checkoutHandler:s,isCheckoutSubmitting:a}=Ge(t);return e.jsx(ee,{className:"w-full",showArrow:!0,onClick:s,isLoading:a,disabled:a,children:"Check Out"})}function $t({children:t,className:s,disabled:a,mysteryItemId:r,onClick:n}){const o=dt().state!=="idle";return e.jsxs(xt,{method:"post",action:"/cart",children:[e.jsx("input",{name:"redirectTo",type:"hidden",value:"checkout"}),e.jsx("input",{name:"cartFormInput",type:"hidden",value:JSON.stringify({inputs:{lines:[{quantity:1,merchandiseId:r}]},action:_.ACTIONS.LinesAdd})}),e.jsx(ee,{showArrow:!0,type:"submit",className:N(s,"relative"),disabled:a||o,isLoading:o,onClick:n,children:t})]})}function We(t){if(!t)return{name:"",type:""};const[s,a]=t.split(" | ");return{name:s,type:a}}function Ht({checkoutHandler:t}){const{mysteryItemPromise:s}=F(),[a,r]=f.useState(!1),[n,l]=f.useState(!1);f.useEffect(()=>{const i=d=>{d.persisted&&(r(!1),l(!1))};return window.addEventListener("pageshow",i),()=>window.removeEventListener("pageshow",i)},[]);const o=f.useCallback(async()=>{ht.flushSync(()=>{r(!1)}),l(!0);try{await t()}catch(i){console.error(i),le.error("Failed to proceed to checkout. Please try again."),l(!1),r(!0)}},[t]),c=f.useCallback(i=>{if(i){l(!1),r(!0);return}o()},[o]);return e.jsxs(gt,{open:a,onOpenChange:c,children:[e.jsx(bt,{className:"w-full",asChild:!0,children:e.jsx(ee,{showArrow:!0,className:"text-[15px] w-full",children:"Check Out"})}),e.jsx(f.Suspense,{fallback:null,children:e.jsx(U,{resolve:s,children:i=>{var h,g;if(!i)return null;const d=((h=i==null?void 0:i.title)==null?void 0:h.value)??"",u=((g=i==null?void 0:i.description)==null?void 0:g.value)??"",x=i==null?void 0:i.item;if(!x)return null;const m=!x.availableForSale,{name:b}=We(x.title);return e.jsxs(jt,{className:"p-4 w-[calc(100%-2rem)] max-h-[calc(100%-2rem)] md:min-w-[70%]",useOverlayBlur:!0,children:[e.jsxs(vt,{children:[e.jsx(Nt,{className:"pr-10 mb-4 text-left text-2xl font-header lg:text-3xl",children:d}),e.jsx(wt,{asChild:!0,children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("p",{className:"self-start text-left leading-6 text-subtle",children:u}),e.jsxs("div",{className:"w-[300px]",children:[e.jsxs("div",{className:"flex flex-col items-center p-4",children:[e.jsx(R,{loading:"eager",width:240,height:240,className:"max-w-[50%] sm:max-w-full",data:x.product.featuredImage??G,alt:"Mystery Item"}),e.jsx("h3",{className:"text-lg font-header text-default",children:b}),e.jsx("p",{className:"text-base text-center py-1 text-subtle",children:x.product.title}),e.jsxs("div",{className:"flex items-center gap-4",children:[x.compareAtPrice&&e.jsx(H,{as:"s",data:x.c
1ompareAtPrice,className:"text-subtle",withoutTrailingZeros:!0}),e.jsx(H,{data:x.price,className:"text-default text-base",withoutTrailingZeros:!0})]})]}),e.jsx($t,{className:"w-full text-default-negative",mysteryItemId:x.id,disabled:m,onClick:()=>{S(De({variant:x,itemListName:Me.MYSTERY_ITEM}))},children:m?"Out Of Stock":"Add To Cart"})]})]})})]}),e.jsx(yt,{className:"border-t pt-4",children:e.jsx(ee,{className:"self-end",variant:"ghost",showArrow:!0,onClick:o,isLoading:n,children:"No Thanks"})})]})}})})]})}function Ut({cartItems:t,checkoutUrl:s}){const{mysteryItemPromise:a}=F(),{checkoutHandler:r}=Ge(s);return s?e.jsx(f.Suspense,{fallback:e.jsx(de,{checkoutUrl:s}),children:e.jsx(U,{resolve:a,children:n=>{var u,x,m,b;if(!n)return e.jsx(de,{checkoutUrl:s});const l=new Date,o=(u=n==null?void 0:n.startDate)!=null&&u.value?new Date((x=n==null?void 0:n.startDate)==null?void 0:x.value):void 0,c=(m=n==null?void 0:n.endDate)!=null&&m.value?new Date((b=n==null?void 0:n.endDate)==null?void 0:b.value):void 0;let i;return o&&c?i=l>o&&l<c:o?i=l>o:c?i=l<c:i=!!n,t.find(h=>{var g,p,j;if("merchandise"in h){const v=(n==null?void 0:n.item.id)===h.merchandise.id,y=(j=(p=(g=n==null?void 0:n.disqualifyingProducts)==null?void 0:g.references)==null?void 0:p.nodes)==null?void 0:j.some(C=>C.id===h.merchandise.product.id);return v||y}return!1})||!i?e.jsx(de,{checkoutUrl:s}):e.jsx(Ht,{checkoutHandler:r})}})}):null}function Vt({merchandiseId:t,quantity:s,sellingPlanId:a,attributes:r}){return{cartFormInput:JSON.stringify({inputs:{lines:[{merchandiseId:t,quantity:Number(s),sellingPlanId:a,attributes:r}]},action:_.ACTIONS.LinesAdd})}}function Xe({lineIds:t}){return{cartFormInput:JSON.stringify({inputs:{lineIds:t},action:_.ACTIONS.LinesRemove})}}function Yt({lineId:t,merchandiseId:s,quantity:a,attributes:r}){return{cartFormInput:JSON.stringify({inputs:{remove:[t],add:[{merchandiseId:s,quantity:a,attributes:r}]},action:"CustomLinesReplace"})}}function Jt({incentive:t}){const s=t.options[0];return s?s._type==="customOffer"?e.jsx(Kt,{incentive:t}):e.jsx(Zt,{incentive:t,option:s}):(console.error("No option found for incentive:",t),null)}function Kt({incentive:t}){return e.jsx("li",{className:"transition-all duration-200 !pb-0 !border-b-none [&:nth-child(n+2)]:pt-2",children:e.jsx("div",{className:"bg-neutral-light-1 rounded-none border-l-transparent border-t-transparent border-r-transparent !border-b border-b-subtle pl-0 py-3 pr-2 flex gap-4",children:e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs("span",{className:"text-sm label text-secondary-medium text-balance",children:["Unlocked: ",t.title]})})})})})}function Zt({incentive:t,option:s}){var h,g;const{cart:a}=V(),r=(a==null?void 0:a.lines.nodes.filter(J).find(p=>{var j;return((j=p.cartIncentiveId)==null?void 0:j.value)===t.id}))??null,n=Z(),[l,o]=f.useState(()=>{var p;return(r==null?void 0:r.merchandise.id)??((p=s.productVariants[0])==null?void 0:p.id)??""}),c=f.useRef(l),i=f.useMemo(()=>s.productVariants.find(p=>p.id===l),[s.productVariants,l]),u=!!r||n.state!=="idle",x=()=>{const p=s.productVariants.find(j=>j.id===l);p&&n.submit(Vt({merchandiseId:p.id,quantity:1,attributes:[{key:"_cart-incentive-goal",value:t.goal.toString()},{key:"_cart-incentive-id",value:t.id}]}),{method:"POST",action:"/cart"})},m=p=>{if(c.current=l,o(p),!r)return;const j=s.productVariants.find(v=>v.id===p);j&&n.submit(Yt({lineId:r.id,merchandiseId:j.id,quantity:1,attributes:[{key:"_cart-incentive-goal",value:t.goal.toString()},{key:"_cart-incentive-id",value:t.id}]}),{method:"POST",action:"/cart"})},b=()=>{r&&n.submit(Xe({lineIds:[r.id]}),{method:"POST",action:"/cart"})};return f.useEffect(()=>{var p;(p=n.data)!=null&&p.error&&(o(c.current),le.error(n.data.error))},[(h=n.data)==null?void 0:h.error]),e.jsx("li",{className:"transition-all duration-200 !pb-0 !border-b-none [&:nth-child(n+2)]:pt-2",children:e.jsxs("div",{className:N("bg-neutral-light-1 rounded-lg pl-0 py-3 pr-2 flex gap-4",u?"rounded-none border-l-transparent border-t-transparent border-r-transparent !border-b border-b-subtle":"border border-brand-secondary-400"),children:[e.jsxs("div",{className:"flex gap-4 flex-1",children:[e.jsx("div",{children:e.jsx(R,{aspectRatio:"1/1",crop:"top",data:{url:((g=i==null?void 0:i.image)==null?void 0:g.originalSrc)??"",altText:(i==null?void 0:i.productTitle)??""},height:64,loading:"eager",width:64})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs("span",{className:"text-sm label text-secondary-medium text-balance",children:["Unlocked: ",t.title]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Fe,{value:l,onValueChange:m,disabled:n.state!=="idle",children:[e.jsx(qe,{className:"text-left bg-neutral-light-2 px-3 flex-1 h-[38px] text-sm border border-default gap-2 [&>svg]:opacity-100 [&>svg]:text-default [&>svg]:w-4 [&>svg]:h-4",children:e.jsx(ze,{})}),e.jsx(Be,{children:s.productVariants.map(p=>{const j=p.title==="Default Title"?p.productTitle:p.title;return e.jsx(me,{value:p.id,className:"cursor-pointer",children:We(j).name},p.id)})})]}),u?e.jsx("button",{onClick:b,className:"p-1 touch-hitbox","aria-label":"Remove reward",disabled:n.state!=="idle",children:e.jsx(E,{name:"trash-2",size:16,className:N("text-subtle",n.state!=="idle"&&"opacity-50")})}):e.jsx(ee,{onClick:x,disabled:n.state!=="idle",isLoading:n.state!=="idle",children:"Claim"})]})]})]}),u&&e.jsx("div",{className:"flex",children:e.jsx("span",{className:"text-sm font-bold uppercase",children:"Free"})})]})})}function re({lineId:t,value:s,merchandiseId:a,sellingPlanId:r,attributes:n}
1){return{cartFormInput:JSON.stringify({inputs:{lines:[{id:t,quantity:Number(s),merchandiseId:a,sellingPlanId:r,attributes:n}]},action:_.ACTIONS.LinesUpdate})}}function Gt(t,s){const a=(t==null?void 0:t.reduce((r,n)=>{var c,i,d;const l=(i=(c=n.merchandise)==null?void 0:c.product)==null?void 0:i.id,o=(d=n.merchandise)==null?void 0:d.id;return l&&(r[l]={...r[l],[o]:n.quantity}),r},{}))??{};return s.lines.forEach(r=>{var o,c;const n=(c=(o=r.attributes)==null?void 0:o.find(i=>(i==null?void 0:i.key)==="_bmsm-product-id"))==null?void 0:c.value,l=r.merchandiseId??"";n&&a&&(a[n]={...a[n],[l]:r.quantity??0})}),Object.values(a).flatMap(r=>Object.values(r)).reduce((r,n)=>r+n,0)}function Te(t,s){return Gt(t,s)<=15}const et=["flex justify-center items-center size-[38px]","flex text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50"];function fe(t){return e.jsx("button",{className:N("ml-1",...et),"aria-label":"Decrease quantity",name:"decrease-quantity",...t,children:e.jsx("span",{children:e.jsx(E,{name:"minus",size:10})})})}function tt(t){return e.jsx("button",{className:N("mr-1",...et),"aria-label":"Increase quantity",name:"increase-quantity",...t,children:e.jsx("span",{children:e.jsx(E,{name:"plus",size:10})})})}function pe({lineIds:t,children:s,fetcherKey:a}){return e.jsx(_,{route:"/cart",action:_.ACTIONS.LinesRemove,inputs:{lineIds:t},fetcherKey:a,children:s||(r=>e.jsx("button",{"aria-label":"Remove item from cart",className:"flex items-center justify-center size-11",type:"submit",disabled:r.state!=="idle",children:e.jsx(E,{name:"trash-2",size:16,className:"text-subtle"})}))})}function Wt({line:t,byobItems:s,isSpecialOffer:a}){const r=Z(),n=f.useRef(null),{id:l,quantity:o,merchandise:c,bmsmItem:i,bmsmProductId:d}=t,{id:u}=c,x=Number(Math.max(0,o-1).toFixed(0)),m=Number((o+1).toFixed(0)),b=g=>{g.preventDefault();const j=new FormData(g.target).get("cartFormInput");if(!j)return;const v=Number(j)-t.quantity,y=(i==null?void 0:i.value)==="true"?Te(s,{lines:[{quantity:Number(j),merchandiseId:u,attributes:[{key:"_bmsm-product-id",value:(d==null?void 0:d.value)??""}]}]}):!0;if(i&&!y){le.info("You have exceeded the 15-item limit for Build Your Own Bundle items.",{id:"byob-input-qty-limit"});return}v>0&&S(we({line:t,quantity:v})),r.submit(re({lineId:l,value:j,merchandiseId:u}),{method:"post",action:"/cart"})},h=(i==null?void 0:i.value)==="true"?Te(s,{lines:[{quantity:m,merchandiseId:u,attributes:[{key:"_bmsm-product-id",value:(d==null?void 0:d.value)??""}]}]}):!0;return f.useEffect(()=>{h||le.info("You have reached the limit for Build Your Own Bundle items.",{id:"byob-increment-qty-l
1imit"})},[h]),f.useEffect(()=>{n.current&&h&&(n.current.value=String(o))},[o,h]),e.jsxs("div",{className:"flex border-[1px] max-w-fit border-default",children:[e.jsx(ie,{lines:[{id:l,quantity:x,merchandiseId:u}],children:e.jsx(fe,{})}),e.jsx(r.Form,{method:"post",onSubmit:b,children:e.jsx(he,{"aria-label":"Quantity Input",className:N("size-[38px] text-center bg-transparent text-sm font-body border-none rounded-none","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),type:"number",name:"cartFormInput",min:0,max:a?1:void 0,ref:n,defaultValue:o,disabled:!h})}),e.jsx(ie,{lines:[{id:l,quantity:m,merchandiseId:u}],children:e.jsx(tt,{disabled:a||!h,onClick:()=>{S(we({line:t,quantity:1}))}})})]})}function ie({children:t,lines:s,fetcherKey:a}){return e.jsx(_,{route:"/cart",action:_.ACTIONS.LinesUpdate,inputs:{lines:s},fetcherKey:a,children:t})}function st(t,s){const{pathname:a}=Le();return f.useMemo(()=>Xt({handle:t,pathname:a,searchParams:new URLSearchParams,selectedOptions:s}),[t,s,a])}function Xt({handle:t,pathname:s,searchParams:a,selectedOptions:r}){const n=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(s),o=n&&n.length>0?`${n[0]}products/${t}`:`/products/${t}`;r==null||r.forEach(i=>{a.set(i.name,i.value)});const c=a.toString();return o+(c?"?"+a.toString():"")}const{TITLE:es,OPTIONS:ts}=Ot;function ss({bundle:t}){const{toggleCart:s}=V(),a=`bundle-quantity-${t.id}`,r=Z({key:a}),n=Object.keys(t.items),{product:l}=t.items[n[0]].merchandise,o=st(l==null?void 0:l.handle);if(!l)return null;const{featuredImage:c,bundlePrice:i,bundleOriginalPrice:d}=l,[u]=l.title.replace("Item","").split(" | "),x=n.reduce((p,j)=>{var y;const{cost:v}=t.items[j];return p+parseFloat(((y=v==null?void 0:v.totalAmount)==null?void 0:y.amount)??"0")},0);let m;const b=+((i==null?void 0:i.value)??0)/100;!!(l!=null&&l.staticBundleQuantity)?m=+(Number((d==null?void 0:d.value)??0)/100)*t.quantity:m=t.originalPrice&&t.originalPrice>b?t.originalPrice:+(Number((d==null?void 0:d.value)??0)/100);const g=e.jsxs(e.Fragment,{children:[x<m&&e.jsx(H,{as:"s",className:"text-xs text-subtle",data:{amount:String(m),currencyCode:"USD"},withoutTrailingZeros:!0}),e.jsx(H,{as:"strong",className:"text-sm font-bold",data:{amount:String(x),currencyCode:"USD"},withoutTrailingZeros:!0})]});return e.jsx("li",{className:"mx-4",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{children:c&&e.jsx(R,{aspectRatio:"1/1",data:c,height:64,loading:"eager",width:64})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(K,{to:o,onClick:s,className:"inline-block text-sm font-bold border-none hover:underline hover:underline-offset-2 hover:
1decoration-2",children:u}),e.jsx("div",{className:"flex flex-col gap-1.5 text-sm mb-4",children:e.jsx("div",{className:"mb-2",children:e.jsx(as,{items:Object.values(t.items)})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ns,{bundle:t,fetcherKey:a}),e.jsx(pe,{lineIds:t!=null&&t.cartLineId?[t.cartLineId]:Object.keys(t.items),fetcherKey:a})]})]}),e.jsx("div",{className:"flex flex-col items-end col-start-5 col-span-1 tracking-wide pointer-events-none","aria-live":"polite","aria-atomic":"true",children:r.state!=="idle"?e.jsx(Oe,{}):g})]})},t.id)}function as({items:t}){var a,r;const s="sellingPlanAllocation"in t[0]?(r=(a=t[0])==null?void 0:a.sellingPlanAllocation)==null?void 0:r.sellingPlan:void 0;return e.jsxs("dl",{className:"flex flex-col gap-1",children:[t.map(n=>{const{quantity:l,merchandise:o}=n,{value:c}=o[ts][es];return e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-subtle inline",children:`${l}x `}),e.jsx("dd",{className:"text-xs text-subtle inline",children:c})]},o.id)}),s&&e.jsxs("div",{children:[e.jsx("dt",{className:"sr-only",children:"Subscription Information"}),e.jsx("dd",{className:"text-sm inline",children:s.name})]})]})}function ns({bundle:t,fetcherKey:s}){const a=Z({key:s??`bundle-quantity-${t.id}`}),r=f.useRef(null);f.useEffect(()=>{r.current&&(r.current.value=String(t.quantity))},[t.quantity]);function n(){var i;const l=parseInt(((i=r.current)==null?void 0:i.value)??"1",10);if(Number.isNaN(l)||l===t.quantity)return;const o=t.cartLineId?[{id:t.cartLineId,quantity:l}]:Object.values(t.items).reduce((d,u)=>{if(!J(u))return d;const{quantity:x,merchandise:m}=u;if(l===0)return[...d,{quantity:0,id:u.id,merchandiseId:m.id}];const h=x/t.quantity*l;return[...d,{quantity:h,id:u.id,merchandiseId:m.id}]},[]),c=l-t.quantity;c>0&&S(ye({bundle:t,quantity:c})),a.submit({cartFormInput:JSON.stringify({inputs:{lines:o},action:_.ACTIONS.LinesUpdate})},{method:"post",action:"/cart"})}return e.jsxs("div",{className:"flex border-[1px] max-w-fit border-default",children:[t.quantity===1?e.jsx("div",{children:e.jsx(pe,{fetcherKey:s,lineIds:t.cartLineId?[t.cartLineId]:Object.keys(t.items),children:e.jsx(fe,{disabled:a.state!=="idle"})})}):e.jsx(ie,{fetcherKey:s,lines:t.cartLineId?[{id:t.cartLineId,quantity:t.quantity-1}]:Object.values(t.items).map(l=>J(l)?{quantity:l.quantity/t.quantity*(t.quantity-1),id:l.id,merchandiseId:l.merchandise.id}:null).filter(Boolean),children:e.jsx(fe,{disabled:a.state!=="idle"})}),e.jsx(a.Form,{method:"post",action:"/cart",onSubmit:n,children:e.jsx(he,{ref:r,className:N("size-[38px] text-center bg-transparent text-sm font-body border-none rounded-none","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),type:"number",name:"bundleQuantityInput",min:0,onBlur:n,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},defaultValue:t.quantity})}),e.jsx(ie,{fetcherKey:s,lines:t.cartLineId?[{id:t.cartLineId,quantity:t.quantity+1}]:Object.values(t.items).map(l=>{if(!J(l))return null;const o=t.quantity;return{quantity:l.quantity/o*(o+1),id:l.id,merchandiseId:l.merchandise.id}}).filter(Boolean),children:e.jsx(tt,{disabled:a.state!=="idle",onClick:()=>{S(ye({bundle:t,quantity:1}))}})})]})}function at({line:t,priceType:s="regular",className:a,...r}){var o,c;if(!((o=t==null?void 0:t.cost)!=null&&o.amountPerQuantity)||!((c=t==null?void 0:t.cost)!=null&&c.totalAmount))return null;const n=t.merchandise.product.title.split(" | ")[0];let l=s==="regular"?t.cost.totalAmount:t.cost.compareAtAmountPerQuantity;return l==null?null:(s==="compareAt"&&(l={amount:String(Number(l.amount)*t.quantity),currencyCode:l.currencyCode}),e.jsxs("div",{children:[e.jsxs("span",{className:"sr-only",children:[n," price is $",l.amount]}),e.jsx(H,{"data-testid":"final-price",withoutTrailingZeros:!0,...r,data:l,className:N("text-sm font-bold",a)})]}))}const rs=t=>{var s,a;try{const r=JSON.parse(((a=(s=t.formData)==null?void 0:s.get("cartFormInput"))==null?void 0:a.toString())??"{}");return Lt.parse(r)}catch{return}};function ls({line:t,byobItems:s}){var q,z,T,O,B,k,w,D,Y,ne,W;const{toggleCart:a}=V(),{id:r,merchandise:n}=t,{product:l,title:o,image:c,selectedOptions:i}=n,d=st(l.handle,i),u=mt(),x=(z=(q=u.find(L=>
1L.formAction==="/cart"))==null?void 0:q.formData)==null?void 0:z.get("cartFormInput"),m=x&&JSON.parse(x),b=m&&("lines"in m.inputs&&((B=(O=(T=m==null?void 0:m.inputs)==null?void 0:T.lines)==null?void 0:O[0])==null?void 0:B.merchandiseId)===n.id||"lineIds"in m.inputs&&((w=(k=m==null?void 0:m.inputs)==null?void 0:k.lineIds)==null?void 0:w.includes(t.id))),h=m&&(m.action===_.ACTIONS.LinesUpdate||m.action===_.ACTIONS.LinesRemove),g=u.some(L=>L.state!=="idle")&&h&&b,p=i.find(L=>L.name==="Title"&&L.value==="Default Title"),j=((D=t==null?void 0:t.bmsmFreeItem)==null?void 0:D.value)==="true",v=l.handle==="special-offer",y=(Y=t.sellingPlanAllocation)==null?void 0:Y.sellingPlan,C=t.merchandise.product.sellingPlanGroups.nodes,A=y===void 0&&C.length>0,[M,Q]=f.useState(!!y);return e.jsxs("li",{"data-testid":"cart-line-item",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{children:c&&e.jsx(R,{alt:o,aspectRatio:"1/1",data:c,height:64,loading:"eager",width:64})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(K,{to:d,onClick:a,className:"inline-block text-sm font-bold border-none hover:underline hover:underline-offset-2 hover:
1decoration-2",children:l==null?void 0:l.title}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-sm mb-4",children:[!p&&e.jsxs("dl",{children:[e.jsx("dt",{className:"text-sm text-subtle",children:n.title}),e.jsx("dd",{className:"sr-only",children:n.title})]}),((ne=t==null?void 0:t.discountAllocations)==null?void 0:ne.length)>0&&e.jsx("ul",{children:t.discountAllocations.map(L=>{const X="title"in L?L.title:"";return e.jsx(_e,{name:X},X)})})]}),e.jsx("div",{className:"flex items-center",children:j?e.jsx(K,{to:"/products/build-your-bundle",prefetch:"intent",className:"underline text-xs",onClick:a,children:"Edit"}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Wt,{byobItems:s,line:t,isSpecialOffer:v}),e.jsx(pe,{lineIds:[t.id]})]})})]}),e.jsx("div",{className:"flex flex-col items-end tracking-wide pointer-events-none min-w-7","aria-live":"polite","aria-atomic":"true",children:!((W=t==null?void 0:t.cost)!=null&&W.totalAmount)||g?e.jsx(Oe,{}):e.jsxs(e.Fragment,{children:[e.jsx(is,{line:t}),e.jsx(at,{line:t,as:"span"})]})})]}),(A||!!y)&&e.jsx(os,{isSellingPlanSelected:M,line:t,sellingPlan:y,setIsSellingPlanSelected:Q,availableSellingPlanGroups:C})]},r)}function is({line:t}){var n;const{originalPrice:s,finalPrice:a,compareAtPrice:r}=kt(t);return(n=t.sellingPlanAllocation)!=null&&n.sellingPlan&&r!==a?e.jsx(at,{as:"s",className:"text-xs font-normal text-subtle",priceType:"compareAt",line:t}):s!==a&&e.jsx(H,{"data-testid":"original-price",as:"s",className:"text-xs text-subtle",data:{amount:String(s),currencyCode:"USD"},withoutTrailingZeros:!0})}function os({isSellingPlanSelected:t,line:s,sellingPlan:a,setIsSellingPlanSelected:r,availableSellingPlanGroups:n}){var p,j,v,y,C,A,M,Q,q,z,T,O,B,k;const{quantity:l,id:o}=s,c=Z(),i=rs(c),d=(v=(j=(p=n[0])==null?void 0:p.sellingPlans)==null?void 0:j.nodes)==null?void 0:v[0],u=((M=(A=(C=(y=n[0])==null?void 0:y.sellingPlans)==null?void 0:C.nodes)==null?void 0:A.find(w=>w.name===(a==null?void 0:a.name)))==null?void 0:M.id)??(d==null?void 0:d.id),x=i&&!("lineIds"in i.inputs)&&((q=(Q=i.inputs)==null?void 0:Q.lines[0])==null?void 0:q.sellingPlanId),b=((k=(B=(O=(T=(z=n[0])==null?void 0:z.sellingPlans)==null?void 0:T.nodes)==null?void 0:O.find(w=>w.id===x))==null?void 0:B.name)==null?void 0:k.replace("(Recommended)",""))??(a==null?void 0:a.name)??(d==null?void 0:d.name),h=f.useCallback(w=>{w.target.checked?(r(!0),!a&&(d!=null&&d.id)&&c.submit({...re({lineId:s.id,value:String(l),merchandiseId:s.merchandise.id,sellingPlanId:d.id}),optimizely:"subscription_atc"},{method:"post",action:"/cart"})):(r(!1),c.submit(re({lineId:s.id,value:String(l),merchandiseId:s.merchandise.id,sellingPlanId:null}),{method:"post",action:"/cart"}))},[d==null?void 0:d.id,c,s.id,s.merchandise.id,l,a,r]),g=f.useCallback(w=>{w==="one-time-purchase"&&r(!1),c.submit(re({lineId:s.id,value:String(l),sellingPlanId:w==="one-time-purchase"?null:w,merchandiseId:s.merchandise.id}),{method:"post",action:"/cart"})},[s,l,c,r]);return d?e.jsxs("fieldset",{className:N("flex flex-col gap-2 border border-default mt-4 mx-4 px-4 py-[13px] rounded-[4px]",t&&"border-default"),children:[e.jsx("legend",{className:"sr-only",children:"Subscription options"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-4 h-4",children:[e.jsx("input",{type:"checkbox",name:`upsellSellingPlan-${o}`,id:`upsellSellingPlan-${o}`,className:"mb-px appearance-none w-4 h-4 border-2 border-default rounded checked:bg-primary-medium checked:border-brand-primary-600 relative",onChange:h,checked:t}),t&&e.jsx(E,{name:"check",className:"text-subtle-negative absolute top-0 left-0 w-4 h-4 pointer-events-none"})]}),e.jsx("label",{htmlFor:`upsellSellingPlan-${o}`,className:"text-xs font-bold",children:"Upgrade to Subscription"}),e.jsx(ae,{badge:{background_color:"#D9EDFF",border_color:"#D9EDFF",label:"Save 15%",text_color:"#084E8B"},size:"sm",className:"label text-xs font-bold [&>span]:py-px [&>span]:tracking-wide"})]}),t&&e.jsxs(Fe,{name:"sellingPlan",defaultValue:d==null?void 0:d.id,onValueChange:g,value:x||u,children:[e.jsx(qe,{className:"bg-neutral-light-2 border-default [&>
1svg]:text-subtle","data-gtm-id":"cart-subscription-interval-dropdown",children:e.jsx(ze,{children:b})}),e.jsx(cs,{availableSellingPlanGroups:n})]})]}):null}function cs({availableSellingPlanGroups:t}){return e.jsxs(Be,{className:"bg-neutral-light-1 text-default w-[var(--radix-select-trigger-width)] !-translate-y-12",children:[e.jsxs(ke,{className:"px-2.5 pt-2.5",children:[e.jsx(Ce,{className:"text-subtle text-sm font-normal m-0 p-0",children:"Pay Full Price"}),e.jsx(me,{value:"one-time-purchase",children:"One Time Purchase"})]}),e.jsxs(ke,{className:"px-2.5 pb-2.5",children:[e.jsx(Ce,{className:"text-subtle text-sm font-normal m-0 p-0",children:"Subscribe + Save 15%"}),t.map(({sellingPlans:s})=>s.nodes.map((a,r)=>e.jsxs(me,{value:a.id,"data-gtm-id":`cart-subscription-interval-dropdown-${Re(a.name)}`,children:[a.name," ",r===0&&"(Recommended)"]},a.id)))]})]})}function us({items:t}){if(!t||!(t!=null&&t.length))return null;const s=t.slice(0,2);return s.length?e.jsxs("div",{className:"flex-col font-body bg-neutral-light-2 p-4 m-4 rounded-[3px]",children:[e.jsx("p",{className:"mb-4 text-xs label uppercase",children:"Complete Your Routine:"}),e.jsx("div",{className:"flex gap-2 justify-between",children:s.map(a=>e.jsx(ds,{productVariant:a},a.id))})]}):null}function ds({productVariant:t}){const{compareAtPrice:s,price:a,product:r}=t,n=s&&Number(s.amount)>Number(a.amount),[l,o]=r.title.split(" | ");return e.jsxs("section",{className:N("flex flex-col flex-grow items-center relative col-span-1 border border-default rounded-lg p-2 gap-2 max-w-[48%] bg-neutral-light-1"),children:[e.jsx("div",{className:"relative flex items-center justify-center w-full",children:r!=null&&r.featuredImage?e.jsx(R,{className:"group-hover:scale-[1.03] transition-transform duration-500 max-w-[82px] sm:max-w-full",aspectRatio:"1/1",crop:"top",data:r.featuredImage,loading:"eager",width:64,height:64}):null}),e.jsxs("div",{className:"flex flex-col flex-grow items-center justify-between",children:[e.jsxs("div",{className:"text-center mb-2 break-words select-none",children:[e.jsx("p",{className:"group-hover:underline group-hover:underline-offset-2 transition-transform text-sm font-bold",children:l}),e.jsx("p",{className:"text-subtle text-xs",children:o})]}),n?e.jsx(ae,{className:"mb-2 absolute top-1 left-1 sm:top-2 sm:left-2",badge:{label:"Sale",text_color:ue.theme.extend.colors.neutral.white,background_color:ue.theme.extend.colors.neutral.black,border_color:ue.theme.extend.colors.neutral.black},size:"sm"}):null]}),e.jsx(It,{className:"w-full p-2 py-1 min-w-[103px] text-default-negative text-wrap uppercase",lines:[{merchandiseId:t.id,quantity:1}],showArrow:!1,size:"sm",onClick:()=>{S(De({variant:t,itemListName:Me.MINICART_OFFER}))},children:e.jsxs("span",{className:"w-full text-xs","aria-label":`Add ${l} to cart for $${t.price.amount}`,children:["Add â ",e.jsx(H,{as:"span",data:t.price,withoutTrailingZeros:!0})]})})]})}function xs(t){var c;const[s,a]=f.useState([]),r=Z({key:"minicart"}),n=f.useMemo(()=>new Set((t==null?void 0:t.flatMap(i=>"lineComponents"in i?i.lineComponents.map(d=>d.merchandise.sku):i.merchandise.sku).filter(i=>typeof i=="string"))??[]),[t]);f.useEffect(()=>{r.state==="idle"&&!r.data&&r.load("/minicart")},[r]),f.useEffect(()=>{if(!r.data||!n.size)return;const{recommendedBySkuMap:i}=r.data;if(!i||Array.isArray(i))return;const d=[...n].flatMap(u=>i[u]??[]).filter(u=>u&&typeof u=="object"&&"priority"in u).sort((u,x)=>u.priority-x.priority).map(({priority:u,...x})=>x);a(d)},[r.data,n]);const l=new Set;return[...s,...((c=r.data)==null?void 0:c.miniCartOffers)??[]].filter(i=>i&&i.availableForSale&&i.sku&&!n.has(i.sku)&&!l.has(i.sku)?(l.add(i.sku),!0):!1)}function ms({lines:t,incentiveManagerSection:s,className:a}){const r=xs(t);if(!t)return null;const{bundles:n,individualItems:l,byobItems:o}=Ct(t),c=Object.values(n),i=l.filter(u=>{var x;return!((x=u.cartIncentiveId)!=null&&x.value)}
1),d=(s==null?void 0:s.filter(Boolean).length)??0;return e.jsxs("section",{"aria-labelledby":"cart-lines","data-testid":"cart-lines",className:N("overflow-y-auto overflow-x-hidden","[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-neutral-gray-400 [&::-webkit-scrollbar-thumb:hover]:bg-neutral-gray-400/80 [&::-webkit-scrollbar-thumb]:rounded-none",a),children:[e.jsxs("ul",{className:"[&>li]:pt-4 [&>li]:pb-6 px-4 transition-all cart-lines-list","data-incentive-count":d,children:[s,c.map(u=>e.jsx(ss,{bundle:u},u.id)),i.map(u=>e.jsx(ls,{line:u,byobItems:o},u.id))]}),e.jsx(us,{items:r})]})}function fs({subtotal:t,incentives:s,nextIncentive:a}){var d;const r=((d=a==null?void 0:a.options[0])==null?void 0:d._type)==="customOffer",n=Math.max(...s.map(u=>u.goal)),l=(a==null?void 0:a.goal)??n,o=(()=>{if(!a)return 100;const u=s.findIndex(C=>C.goal===a.goal),x=u>0?s[u-1]:null,m=(x==null?void 0:x.goal)??0,b=a.goal,h=Math.max(t-m,0),g=b-m,p=h/g*100,j=m/n*100,v=b/n*100,y=v-j;return Math.min(j+p/100*y,v)})(),c=o>=100,i=Math.max(l-t,0);return e.jsxs("div",{className:"bg-neutral-light-2 rounded-[4px] pt-4 pb-2 px-4 mx-4",children:[e.jsx("div",{className:"flex items-center justify-center mb-3",children:e.jsx("span",{className:"text-sm text-default","aria-live":"polite",children:c?e.jsx("span",{children:"All rewards unlocked!"}):e.jsxs("span",{children:["You're $",i.toFixed(2)," away from",r?" ":" a ",e.jsx("strong",{children:a==null?void 0:a.title}),"!"]})})}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx("div",{className:"h-[7px] bg-neutral-light-1",children:e.jsx("div",{className:"h-full transition-all duration-500 ease-out bg-brand-secondary-500",style:{width:`${o}%`},role:"progressbar","aria-label":"Gift Progress Bar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100})}),s.map(u=>e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2",style:{left:`calc(${u.goal/n*100}% - 20px)`},children:u.goal<=t?e.jsx(E,{name:u.title.toLowerCase().includes("shipping")?"icon-truck-success":"icon-gift-success",size:24,className:"text-white",hidden:!1,"aria-label":"Reward unlocked"}):e.jsx(E,{name:u.title.toLowerCase().includes("shipping")?"icon-truck":"icon-gift",size:24,className:"text-white",hidden:!1,"aria-label":"Reward goal"})},u.goal))]})]})}function hs(){const{cartBanner:t}=F();return e.jsx(f.Suspense,{fallback:null,children:e.jsx(U,{resolve:t,errorElement:e.jsx(e.Fragment,{}),children:s=>{var n,l,o;if(!s||!((o=(l=(n=s.metaobject)==null?void 0:n.banners)==null?void 0:l.references)!=null&&o.nodes.length))return e.jsx(e.Fragment,{});const a=s.metaobject.banners.references.nodes,r=Dt(a).slice(0,2);return r.length===0?e.jsx(e.Fragment,{}):e.jsx("div",{className:"flex flex-col mb-6 gap-2",children:r.map(c=>{var i;return(i=c==null?void 0:c.text)!=null&&i.value?e.jsx("div",{className:"font-header font-bold p-1 rounded-sm text-center text-primary-medium bg-primary-medium/10",children:c.text.value},c.text.value):null})})}})})}function ps({discountItems:t=[]}){return t.length?e.jsx("ul",{children:t.map(s=>e.jsx(_e,{name:s.code,amountOff:{amount:s.amount,currencyCode:"USD"}},s.code))}):null}function gs({subtotal:t,className:s}){var l;const{customer:a,rewardsConfigPromise:r}=F(),n=((l=a==null?void 0:a.loyaltyTier)==null?void 0:l.value.toLowerCase())??"bronze";return e.jsx(f.Suspense,{fallback:null,children:e.jsx(U,{resolve:r,errorElement:null,children:o=>{if(!o||"error"in o)return null;const c=o[n].pointsPerDollar??5,i=Math.round(Number((t==null?void 0:t.amount)??0)*c);return e.jsx("div",{className:N("bg-neutral-light-2 rounded-sm p-2 my-3",s),children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2xs",children:[e.jsx("div",{className:"rewards-star","aria-hidden":"true"}),e.jsxs(K,{to:"/rewards",className:N("text-sm font-bold text-black"),"aria-label":`Earn ${i} Mando Points`,children:["Earn ",i," Mando Points"]})]}),e.jsx(K,{to:"/rewards",className:"text-sm text-black underline underline-offset-[3px] hover:decoration-2","aria-label":"Learn More about Mando Rewards",children:"Learn More"})]})})}})})}const bs=[{name:"payment-apple-pay",label:"Apple Pay",className:"w-[29.29px] h-[18.75px]"},{name:"payment-paypal",label:"PayPal",className:"w-[28.13px] h-[18.75px]"},{name:"payment-google-pay",label:"Google Pay",className:"w-[28.1px] h-[11.22px]"},{name:"payment-shop-pay",label:"Shop Pay",className:"w-[29.56px] h-[7.17px]"}];function js({className:t}){return e.jsx("ul",{"aria-label":"Accepted payment options",className:N("w-full flex items-start justify-center gap-4",t),children:bs.map(({name:s,label:a,className:r})=>e.jsxs("li",{className:"flex size-[30px] shrink-0 items-center justify-center overflow-hidden",children:[e.jsx(E,{name:s,className:r}),e.jsx("span",{className:"sr-only",children:a})]},s))})}function vs({subtotal:t,subtotalWithDiscounts:s,discountAllocations:a=[],children:r=null}){const{discountItems:n}=Pe(a);return e.jsxs("div",{className:"mt-auto border-t border-subtle pt-4 p-4","aria-labelledby":"
1cart-summary",children:[e.jsx(hs,{}),e.jsxs("dl",{className:"flex items-center justify-between",children:[e.jsx("dt",{className:"header-h5",children:"Subtotal"}),e.jsxs("dd",{className:"text-lg font-bold","aria-live":"polite","aria-atomic":"true",children:[e.jsx("span",{className:"sr-only",children:"Subtotal"}),s?e.jsx(H,{data:s,withoutTrailingZeros:!0}):null]})]}),e.jsx(ps,{discountItems:n}),e.jsx("div",{className:"caption text-sm italic tracking-wide mb-4",children:"Taxes and shipping calculated at checkout"}),e.jsx(gs,{subtotal:t}),r,e.jsxs("div",{className:"flex flex-col mt-xs gap-xs",children:[e.jsx("p",{className:"text-xs text-subtle text-center",children:"Free shipping over $25 | 60-day money back guarantee"}),e.jsx(js,{})]})]})}function Ns({cart:t,subtotal:s,subtotalWithDiscounts:a}){const{incentiveSettingsPromise:r}=F();return e.jsx(f.Suspense,{fallback:e.jsx(Ee,{cart:t,subtotal:s,subtotalWithDiscounts:a,incentiveSettings:[]}),children:e.jsx(U,{resolve:r,children:n=>{var o,c;const l=St(((c=(o=n==null?void 0:n.shop)==null?void 0:o.incentiveSettings)==null?void 0:c.value)??"");return e.jsx(Ee,{cart:t,subtotal:s,subtotalWithDiscounts:a,incentiveSettings:l})}})})}function Ee({cart:t,subtotal:s,subtotalWithDiscounts:a,incentiveSettings:r}){var d;const n=f.useMemo(()=>[...r].sort((u,x)=>u.goal-x.goal),[r]),l=Number((s==null?void 0:s.amount)??0),o=n.find(u=>l<u.goal),c=f.useMemo(()=>r.length===0?[]:r.map(u=>l<u.goal?null:e.jsx(Jt,{incentive:u},u.id)),[r,l]),i=c&&c.some(u=>u!==null);return e.jsxs("div",{className:"flex flex-col h-full py-6",children:[e.jsx("h2",{className:"header-h6 pb-4 px-4",children:"Your Cart"}),r.length>0?e.jsxs("div",{children:[e.jsx(fs,{subtotal:l,incentives:n,nextIncentive:o}),e.jsx("div",{"aria-hidden":"true",className:"my-2 h-px w-full bg-neutral-light-3"})]}):e.jsx("div",{"aria-hidden":"true",className:"my-2 h-px w-full bg-neutral-light-3"}),e.jsx(ms,{className:i?"[&>ul>li:first-child]:!pt-0":"",lines:(d=t==null?void 0:t.lines)==null?void 0:d.nodes,incentiveManagerSection:c}),e.jsx(vs,{subtotal:s,subtotalWithDiscounts:a,discountAllocations:t.discountAllocations,children:e.jsx(Ut,{cartItems:t.lines.nodes,checkoutUrl:t.checkoutUrl})})]})}function ws({hidden:t=!1}){const{cartEmptyImagePromise:s,isLoggedIn:a}=F(),{closeCart:r}=V();return e.jsxs("div",{className:N("flex flex-col w-full h-full px-4",t&&"hidden"),children:[e.jsxs("div",{className:"flex flex-col items-center justify-center flex-1",children:[e.jsx("h2",{className:"mb-6 header-h5",children:"Your Cart Is Empty"}),e.jsx(te,{to:"/shop",className:"mb-5 text-[15px]",onClick:r,prefetch:"viewport",children:"Continue Shopping"}),a?null:e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2 text-lg font-bold",children:"Have an account?"}),e.jsxs("p",{className:"text-subtle",children:[e.jsx(K,{to:"/account/login",className:"text-primary-medium underline underline-offset-[3px] hover:decoration-2 mr-1",onClick:r,children:"Log in"}),"to check out faster."]})]})]}),e.jsxs("div",{className:"mt-auto flex flex-col p-4",children:[e.jsx(K,{to:"/collections/bundles",onClick:r,prefetch:"intent",children:e.jsx(f.Suspense,{fallback:null,children:e.jsx(U,{resolve:s,errorElement:null,children:n=>{var o,c,i,d;const l=((d=(i=(c=(o=n==null?void 0:n.metaobject)==null?void 0:o.image)==null?void 0:c.reference)==null?void 0:i.image)==null?void 0:d.url)??"";return l?e.jsx(R,{data:{url:l,altText:"Mando Starter Pack"},aspectRatio:"750/647",sizes:"(max-width: 750px) 40vw, 30vw",loading:"eager"}):null}})})}),e.jsx(te,{to:"/collections/bundles",variant:"ghost",className:"no-underline",onClick:r,children:"Bundles"})]})]})}function ys({toggleCart:t}){return e.jsxs("button",{className:"absolute right-4 top-6 rounded-sm transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-neutral-light-1",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t())},onClick:t,children:[e.jsx("div",{className:"size-6 text-default",children:e.jsx(E,{name:"close-search"})}),e.jsx("span",{className:"sr-only",children:"Close"})]})}function ks({subtotalAmount:t}){const{cart:s}=V(),a=Z();f.useEffect(()=>{var n,l,o,c;if(!s)return;const r=((c=(o=(l=(n=s==null?void 0:s.lines)==null?void 0:n.nodes)==null?void 0:l.filter(J))==null?void 0:o.filter(i=>{var d;return t<Number((d=i.cartIncentiveGoal)==null?void 0:d.value)}))==null?void 0:c.map(i=>i.id))??[];r.length>0&&a.submit(Xe({lineIds:r}),{method:"POST",action:"/cart"})},[s,t])}function Cs(t){return f.useMemo(()=>{var l,o;const s=((o=(l=t==null?void 0:t.lines)==null?void 0:l.nodes)==null?void 0:o.reduce((c,i)=>{var d,u;if(J(i)&&(i!=null&&i.cartIncentiveId))return c+0;if(!J(i)){const x=i.lineComponents.reduce((m,b)=>{var j,v;const h=Number((v=(j=b.cost)==null?void 0:j.amountPerQuantity)==null?void 0:v.amount),g=Number(b.quantity),p=h*g;return m+p},0);return c+x}
1return c+Number((u=(d=i.cost)==null?void 0:d.totalAmount)==null?void 0:u.amount)},0))??0,a=qt(s*100),{discountsTotal:r}=Pe(t==null?void 0:t.discountAllocations),n=Tt(a==null?void 0:a.amount,r);return{subtotal:a,subtotalWithDiscounts:n}},[t])}function Ss(){const{cart:t,isCartOpen:s,toggleCart:a,onCartAnimationEnd:r}=V(),{subtotal:n,subtotalWithDiscounts:l}=Cs(t);return ks({subtotalAmount:Number(n.amount)}),e.jsx("div",{children:e.jsx(Qe,{open:s,onOpenChange:a,children:e.jsxs($e,{side:"right",className:"bg-neutral-light-1 text-default w-full",onCloseAutoFocus:o=>{var c;o.preventDefault(),(c=document.getElementById("cart-badge"))==null||c.focus()},onAnimationEnd:r,children:[e.jsxs(He,{className:"sr-only",children:[e.jsx(Ue,{children:"Cart"}),e.jsx(Ve,{children:"A list of items in your cart"})]}),e.jsx(ys,{toggleCart:a}),e.jsx(Ts,{cart:t,subtotal:n,subtotalWithDiscounts:l})]})})})}function Ts({cart:t,subtotal:s,subtotalWithDiscounts:a}){var n,l;const r=!!((l=(n=t==null?void 0:t.lines)==null?void 0:n.nodes)!=null&&l.length);return r&&t?e.jsx(Ns,{cart:t,subtotal:s,subtotalWithDiscounts:a}):e.jsx(ws,{hidden:r})}const Es="UCvGwz",As="Rk3cKc";function Ls({containerRef:t}){const[s,a]=f.useState(""),[r,n]=f.useState(!1),[l,o]=f.useState(null),c=f.useRef(null),i=f.useRef(null),[d,u]=zt({id:"footer-email-signup",defaultValue:{email:""},constraint:Bt(_t)}),{mode:x}=F(),m=async b=>{var h,g,p,j;if(b.preventDefault(),(h=u.email.errors)!=null&&h[0]||(g=d.errors)!=null&&g[0]){o("A valid email address is required.");return}n(!0),o(null),a("");try{if(typeof window>"u")throw new Error("Cannot subscribe until the page is loaded");const v=u.email.value;if(!(await fetch("https://a.klaviyo.com/client/subscriptions/?company_id=SECtpT",{method:"POST",headers:{revision:"2023-02-22","Content-Type":"application/json"},body:JSON.stringify({data:{type:"subscription",attributes:{list_id:x==="prod"?Es:As,custom_source:"Web marketing subscribe form",email:v}}})})).ok)throw new Error("Invalid response from Klaviyo");S(Et()),(p=c.current)==null||p.reset(),(j=t==null?void 0:t.current)==null||j.focus(),a("Success! Thank you for signing up.");const A=setTimeout(()=>{var M;a(""),(M=t==null?void 0:t.current)==null||M.focus()},8e3);return()=>{clearTimeout(A)}}catch(v){console.error(v),o("Failed to join email subscription. Please try again.")}finally{n(!1)}};return e.jsxs("form",{id:d.id,ref:c,onSubmit:m,className:"flex flex-col",children:[e.jsx("h2",{className:"header-h6 mb-3xs",children:"Sign up for 20% off your first purchase"}),e.jsx("p",{children:"New to Mando? Join our mailing list to receive your exclusive discount plus new scent alerts, offers, and more."}),e.jsxs("div",{className:N("border-2 border-transparent flex h-12 my-m relative",l&&"border-error",!r&&"focus:bg-brand-primary-300 focus-within:bg-brand-primary-300 active:bg-brand-primary-300 rounded-[5px]"),children:[r&&e.jsx("div",{className:"absolute inset-0 bg-neutral-gray-600/10 z-10 cursor-wait"}),e.jsx(he,{type:"email",name:"email",id:"email",ref:i,placeholder:"Email",autoComplete:"email",autoCorrect:"off",autoCapitalize:"off",className:"flex-1 text-default h-full text-[14px] m-0 focus-visible:ring-0 focus-visible:ring-offset-0 rounded-tl-[5px] rounded-bl-[5px] rounded-tr-none rounded-br-none"}),e.jsx(ee,{type:"submit",className:N("w-[92px] rounded-tr-[5px] rounded-br-[5px] rounded-tl-none rounded-bl-none h-full text-base border border-transparent active:bg-button-primary-bg-pressed active:bg-gradient-to-t min-w-[54px]",r&&"bg-primary-medium"),disabled:r,isLoading:r,children:"Submit"})]}),s&&e.jsx("p",{className:"mt-3",children:s}),l&&e.jsx("p",{className:"text-error-medium mt-3",children:l})]})}function ge({className:t,featuredSection:s,onClick:a,loading:r="lazy"}){var o;const{shop:n,publicStoreDomain:l}=F();return s?e.jsx(P,{className:N("group flex flex-col mb-3xl text-subtle-negative w-fit hover:cursor-pointer hover:no-underline",t),"aria-label":s.cta.title,href:I(s.cta.url,((o=n.primaryDomain)==null?void 0:o.url)??"",l),onClick:a,children:e.jsxs("div",{className:"max-w-[225px]",children:[e.jsx(R,{className:"rounded",loading:r,data:s.image,height:s.image.height??0,width:s.image.width??0}),s.title&&e.jsx("p",{className:"eyebrow pt-s pb-3xs",children:s.title}),e.jsxs("span",{className:"button-text-light text-sm label !p-0 !h-fit !w-fit transition inline-flex items-center justify-center text-center group select-none sm:text-left border-none no-underline text-subtle-negative uppercase group-hover:text-neutral-gray-300 tracking-wider",children:[s.cta.title,e.jsx(E,{name:"button-chevron",className:"ml-1 -mr-1 self-center transition-transform group-hover:translate-x-1 text-current",size:10})]})]})}):null}function Is({footer:t,publicStoreDomain:s,primaryDomain:a}
1){if(!t.menu.length)return null;const r=t.menu.slice(0,2),n=t.menu.slice(2);return e.jsxs("div",{className:"hidden md:flex w-full justify-between gap-5xl lg:justify-center text-subtle-negative",children:[e.jsx("div",{className:"xl:w-[220px]",children:e.jsx("ul",{className:"flex flex-col gap-xl",children:r.map(l=>{var o;return e.jsxs("li",{className:"flex flex-col gap-xs",children:[e.jsx("p",{className:"eyebrow text-sm font-bold pb-s text-nowrap",children:l.title}),(o=l.links)==null?void 0:o.map(c=>e.jsx(P,{href:I(c.url,(a==null?void 0:a.url)??"",s),onClick:()=>{S(se({navCategory:l.title??"",clickText:c.title??""}))},children:c.title},c.title))]},l.title)})})}),e.jsxs("div",{className:"xl:w-[220px]",children:[e.jsx("ul",{className:"flex flex-col gap-xl pb-xl",children:n.map(l=>{var o;return e.jsxs("li",{className:"flex flex-col gap-xs",children:[e.jsx("p",{className:"eyebrow text-sm font-bold pb-s",children:l.title}),(o=l.links)==null?void 0:o.map(c=>e.jsx(P,{href:I(c.url,(a==null?void 0:a.url)??"",s),onClick:()=>{S(se({navCategory:l.title??"",clickText:c.title??""}))},children:c.title},c.title))]},l.title)})}),e.jsx(ge,{featuredSection:t.featuredSection,onClick:()=>{var l,o;S(se({navCategory:((l=t.featuredSection)==null?void 0:l.title)??"",clickText:((o=t.featuredSection)==null?void 0:o.cta.title)??""}))}})]})]})}function Os({footer:t,publicStoreDomain:s,primaryDomain:a}){return t.menu.length?e.jsxs("div",{className:"w-full border-t !border-default text-subtle-negative mt-2 gap-y-9max-w-7xl md:hidden",children:[e.jsx(Ye,{type:"single",collapsible:!0,defaultValue:t.menu[0].title,children:t.menu.map((r,n)=>{var l;return e.jsxs(Je,{value:r.title,className:N(n===2?"border-b-0":"","!border-default"),children:[e.jsx(Ke,{className:"eyebrow py-0 pt-s pb-m text-sm font-bold",children:r.title}),e.jsx(Ze,{className:"flex flex-col gap-xs",children:(l=r.links)==null?void 0:l.map(o=>e.jsx(P,{href:I(o.url,(a==null?void 0:a.url)??"",s),onClick:()=>{S(se({navCategory:r.title??"",clickText:o.title??""}))},children:o.title},o.title))})]},r.title)})}),t.featuredSection&&e.jsx(ge,{featuredSection:t.featuredSection,onClick:()=>{var r,n;S(se({navCategory:((r=t.featuredSection)==null?void 0:r.title)??"",clickText:((n=t.featuredSection)==null?void 0:n.cta.title)??""}))}})]}):null}function Ds(t){const{url:s,title:a,icon:r}=t;return e.jsx("a",{"aria-label":a,className:"flex items-center transition-transform hover:scale-[1.07]",href:s,target:"_blank","data-gtm-id":`social-${Re(a)}-link`,rel:"noopener noreferrer",children:e.jsx("svg",{height:r.height||0,width:r.width||0,children:e.jsx("image",{xlinkHref:r.url})})},a)}function Ms({footer:t,publicStoreDomain:s,shop:a}){const r=Le(),n=f.useRef(null),[l,o]=f.useState("home");if(f.useEffect(()=>{r.pathname&&o(r.pathname.replace(/\W/g,"")||"home")},[r.pathname]),!a||!t)return null;const{primaryDomain:c}=a,i=e.jsx("footer",{className:"bg-neutral-dark-2",children:e.jsx("div",{className:"text-subtle-negative",children:"Loading..."})});return e.jsx(f.Suspense,{fallback:i,children:e.jsx(U,{resolve:t,children:d=>d?e.jsxs("footer",{className:"flex flex-col bg-neutral-dark-1 px-lg pt-2xl pb-xl md:px-xl md:pt-2xl md:pb-xs lg:pt-2xl lg:px-3xl font-body text-default-negative z-40",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:gap-[56px] md:pb-3xl",children:[e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsx("div",{className:"pb-3xl md:pb-m max-w-[1000px]",children:e.jsx(R,{className:"w-full h-full object-contain",data:d.logo,height:d.logo.height??0,width:d.logo.width??0})}),e.jsx("div",{className:"md:max-w-[417px] gap-0 focus-visible:outline-none focus:outline-none",ref:n,tabIndex:-1,children:e.jsx(Ls,{containerRef:n},l)}),e.jsxs("div",{className:"flex items-center justify-start gap-6 pb-3xl",children:[e.jsx("p",{className:"font-bold text-lg",children:"Follow us!"}),e.jsx("div",{className:"flex items-center gap-4",children:d.socials.map(({title:u,url:x,icon:m})=>e.jsx(Ds,{url:x,title:u,icon:m},x))})]})]}),e.jsx(Os,{footer:d,publicStoreDomain:s,primaryDomain:c}),e.jsx(Is,{footer:d,publicStoreDomain:s,primaryDomain:c})]}),e.jsx("div",{className:"w-full border-t",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-center w-full gap-xs pt-xs md:justify-between lg:pb-lg",children:[e.jsxs("span",{className:"text-xs",children:["© ",new Date().getFullYear()," Lume Deodorant, LLC"]}),e.jsx("ul",{className:"flex flex-wrap gap-xs md:gap-[35px]",children:d.legalSection.map(u=>e.jsx("li",{className:"text-xs flex-1 whitespace-nowrap text-center",children:e.jsx(P,{href:I(u==null?void 0:u.url,(c==null?void 0:c.url)??"",s),children:u==null?void 0:u.title})},u==null?void 0:u.title))})]})})]}):e.jsx(e.Fragment,{})})})}function Ps({isLoggedIn:t}){return e.jsx(P,{href:"/account/login",className:"flex justify-center items-center size-11",prefetch:"intent","aria-label":t?"Go to your account":"Log in","data-gtm-id":t?"header-account-link":"header-login-link",children:e.jsx(E,{name:"icon-nav-account",className:"touch-hitbox",size:24})})}function Fs(){var r;const{cart:t,toggleCart:s}
1=V(),a=At(((r=t==null?void 0:t.lines)==null?void 0:r.nodes)??[]);return e.jsxs("button",{id:"cart-badge",type:"button",className:"relative flex size-11 items-center justify-center hover:cursor-pointer",onClick:s,onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),s())},children:[e.jsxs("div",{className:"pointer-events-none",children:[e.jsx(E,{name:"icon-nav-cart",size:24}),e.jsx("span",{className:"sr-only",children:"Cart"})]}),!!a&&e.jsx("span",{className:"absolute flex align-items justify-center leading-[17px] text-[10px] bg-brand-secondary-600 rounded-full right-1 top-1 size-[17px] pointer-events-none",children:e.jsx("span",{children:a})})]})}function qs({exposedNav:t}){return e.jsx("nav",{className:N("lg:hidden w-full inline-flex gap-6 px-s bg-neutral-dark-1 h-[44px] items-center overflow-x-auto ","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-gray-600 [&::-webkit-scrollbar-thumb:hover]:bg-gray-600",'after:content-[""] after:absolute after:right-0 after:h-[44px] after:w-[62px] after:bg-gradient-to-l after:from-[theme(colors.neutral.gray.900)] after:to-transparent'),children:t.map(s=>{var a,r,n,l;return e.jsx(te,{asNav:!0,to:I(((a=s.url)==null?void 0:a.value)??""),size:"sm","aria-label":((r=s.title)==null?void 0:r.value)??"",variant:"text-light",showArrow:!1,className:({isActive:o})=>N("whitespace-nowrap snap-center no-underline capitalize text-base font-body font-bold",o&&"text-default-negative"),onClick:()=>{var o;S($({navCategory:"Exposed Navigation",clickText:((o=s.title)==null?void 0:o.value)??""}))},children:(n=s.title)==null?void 0:n.value},(l=s.title)==null?void 0:l.value)})})}function zs({isMenuOpen:t,setIsMenuOpen:s}){return e.jsx("button",{type:"button","aria-label":"Toggle the main menu",id:"hamburger-menu-toggle",className:"flex items-center justify-center text-3xl text-default-negative py-2xs px-xs size-11 lg:hidden",onClick:()=>{s(a=>!a),setTimeout(()=>{document.body.style.pointerEvents="auto"},0)},onKeyDown:a=>{a.key==="Enter"&&s(r=>!r),a.key==="Esc"&&t&&s(!1)},children:e.jsx("span",{className:"pointer-events-none",children:t?e.jsx(E,{name:"close"}):e.jsx(E,{name:"hamburger"})})})}const nt=f.createContext(null);function oe(){const t=f.useContext(nt);if(!t)throw new Error("useMegaMenu must be used within MegaMenuProvider");return t}function Bs({children:t,navigationItems:s}){const[a,r]=f.useState(null),[n,l]=f.useState(!1),o=f.useRef(null),c=f.useRef(null),i=f.useRef(null),d=a!==null?s[a]:null,u=f.useCallback((h,g,p)=>{i.current&&(clearTimeout(i.current),i.current=null),g?(r(h),l(!0),p&&(c.current=p)):(l(!1),r(null),c.current=null)},[]),x=f.useCallback(()=>{l(!1),i.current=setTimeout(()=>{r(null),i.current=null},200)},[]),m=f.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null),l(!0)},[]);f.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),f.useEffect(()=>{if(!n||!o.current)return;const h=g=>{var p;if(g.key==="Escape"){g.preventDefault(),l(!1),r(null),c.current&&c.current.focus();return}if(g.key==="Tab"){const j=(p=o.current)==null?void 0:p.querySelectorAll("a[href], button:not([disabled])");if(!j||j.length===0)return;const v=j[0],y=j[j.length-1],C=c.current;g.shiftKey?document.activeElement===v&&C?(g.preventDefault(),C.focus()):document.activeElement===C&&(g.preventDefault(),y.focus()):document.activeElement===y&&C?(g.preventDefault(),C.focus()):document.activeElement===C&&(g.preventDefault(),v.focus())}};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[n]);const b=f.useMemo(()=>({activeNavIndex:a,activeNavItem:d,isDropdownOpen:n,dropdownRef:o,handleNavItemEnter:u,handleNavLeave:x,handleDropdownEnter:m,setIsDropdownOpen:l}),[a,d,n,u,x,m]);return e.jsx(nt.Provider,{value:b,children:t})}function _s({navigationTriggers:t}){var i,d,u;const{activeNavIndex:s,handleNavItemEnter:a,setIsDropdownOpen:r}=oe(),n=ft(),{decisions:l}=F(),o=((i=l==null?void 0:l.subscription_language)==null?void 0:i.variationKey)!="off",c=(u=(d=l==null?void 0:l.subscription_language)==null?void 0:d.variables)==null?void 0:u.optiSubscribe;return e.jsx("ul",{className:"hidden lg:flex flex-row w-full items-center gap-lg",children:t.map((x,m)=>{var h,g,p,j,v,y,C,A,M,Q,q,z;const b=(p=(g=(h=x.items)==null?void 0:h.references)==null?void 0:g.nodes)==null?void 0:p.length;return e.jsx("li",{className:"relative after:content-[''] after:absolute after:-left-[15%] after:-bottom-5 after:w-[130%] after:h-full after:z-50",children:b?e.jsx("button",{"aria-label":((j=x.title)==null?void 0:j.value)??"",className:N("uppercase text-subtle-negative font-body text-sm font-bold leading-sm tracking-wider hover:text-default-negative transition-colors",s===m&&"text-default-negative underline underline-offset-4"),onMouseEnter:T=>{a(m,!!b,T.currentTarget)},onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),a(m,!!b,T.currentTarget))},onClick:()=>{var T,O,B,k,w;S($({navCategory:((T=x.title)==null?void 0:T.value)??"",clickText:((O=x.title)==null?void 0:O.value)??""})),n(I(((w=(k=(B=x.cta)==null?void 0:B.reference)==null?void 0:k.url)==null?void 0:w.value)??"")),r(!1)},children:(y=(v=x.title)==null?void 0:v.value)!=null&&y.includes("Subscribe & Save")&&o&&c?c:(C=x.title)==null?void 0:C.value}):e.jsx(Ie,{to:I(((A=x.url)==null?void 0:A.value)??""),className:N("uppercase text-subtle-negative font-body text-sm font-bold leading-sm tracking-wider hover:underline hover:underline-offset-4 hover:text-default-negative","[&[aria-current]]:text-default-negative [&[aria-current]]:underline [&[aria-current]]:underline-offset-4"),onMouseEnter:()=>a(m,!!b),onClick:()=>{var T,O;S($({navCategory:((T=x.title)==null?void 0:T.value)??"",clickText:((O=x.title)==null?void 0:O.value)??""}))},children:(Q=(M=x.title)==null?void 0:M.value)!=null&&Q.includes("Subscribe & Save")&&o&&c?c:(q=x.title)==null?void 0:q.value})},(z=x.title)==null?void 0:z.value)})})}function Rs(){const{isDropdownOpen:t}=oe();return e.jsx("div",{className:"fixed inset-0 z-40 bg-neutral-dark-2/80 transition-opacity duration-200",style:{opacity:t?1:0,pointerEvents:t?"auto":"none",visibility:t?"visible":"hidden"},"aria-hidden":!t})}function Qs(){return e.jsx(P,{href:"/","aria-label":"Return to Mando's homepage","data-gtm-id":"header-logo-home-link",children:e.jsx(E,{name:"mando-logotype",className:"min-w-[75px] max-h-[20px] max-w-[90px] md:min-w-[90px] md:max-w-[110px] md:max-h-[48px]","aria-hidden":"true"})})}function rt({title:t,badge:s,cta:a,image:r,aspectRatio:n="4/5",crop:l="center",sizes:o="15vw",onClick:c}){var i,d,u,x;return e.jsx(P,{href:I(((d=(i=a==null?void 0:a.reference)==null?void 0:i.url)==null?void 0:d.value)??""),className:"overflow-hidden w-full group",onClick:()=>c(t),children:e.jsxs("div",{className:N("relative overflow-hidden no-underline aspect-[4/5]",`aspect-[${n}]`),children:[e.jsx("div",{className:"overflow-hidden rounded",children:e.jsx(R,{data:r??G,loading:"eager",className:N("object-contain w-full h-full group-hover:scale-[1.03] transition-transform duration-500"),sizes:o,aspectRatio:n,crop:l})}),e.jsx("div",{className:"absolute inset-0 rounded-bl-[3px] rounded-br-[3px] z-10 bg-gradient-to-t from-neutral-black from-0% via-neutral-black/40 via-33% to-transparent to-70% pointer-events-none"}),e.jsxs("div",{className:"absolute bottom-0 z-10 p-s",children:[s&&e.jsx(ae,{badge:s,variant:"rectangle",size:"none"}),e.jsx("h5",{children:t}),e.jsx("p",{className:"text-sm",children:(x=(u=a==null?void 0:a.reference)==null?void 0:u.title)==null?void 0:x.value})]})]})},t)}function ce(t){var s,a,r,n;return t?{label:((s=t==null?void 0:t.label)==null?void 0:s.value)??"",text_color:((a=t==null?void 0:t.textColor)==null?void 0:a.value)??"",background_color:((r=t==null?void 0:t.backgroundColor)==null?void 0:r.value)??"",border_color:((n=t==null?void 0:t.borderColor)==null?void 0:n.value)??""}:{label:"",text_color:"",background_color:"",border_color:""}}function $s({activeNavItem:t,onClick:s}){var a,r,n,l,o,c,i,d,u,x;return t?e.jsxs("div",{className:"py-lg flex flex-col px-3xl max-w-screen-xl mx-auto",children:[e.jsx("h2",{className:"text-lg font-bold mb-m",children:(a=t.description)==null?void 0:a.value}),e.jsx("div",{className:"flex gap-6 pb-m rounded ",children:(l=(n=(r=t.items)==null?void 0:r.references)==null?void 0:n.nodes)==null?void 0:l.map(m=>{var b,h,g,p,j;return e.jsx(rt,{title:((b=m.title)==null?void 0:b.value)??"",badge:ce((h=m.badge)==null?void 0:h.reference),cta:m.cta??{},image:((p=(g=m.image)==null?void 0:g.reference)==null?void 0:p.image)??G,crop:"center",onClick:s,sizes:"(max-width: 1150px) 200px, 300px"},((j=m.title)==null?void 0:j.value)??"")})}),e.jsx(te,{href:I(((i=(c=(o=t.cta)==null?void 0:o.reference)==null?void 0:c.url)==null?void 0:i.value)??""),variant:"secondary-outline",className:"w-fit self-center mt-s",onClick:()=>{var m,b,h;return s(((h=(b=(m=t.cta)==null?void 0:m.reference)==null?void 0:b.title)==null?void 0:h.value)??"")},children:(x=(u=(d=t.cta)==null?void 0:d.reference)==null?void 0:u.title)==null?void 0:x.value})]}):null}function lt({item:t,onClick:s,className:a}){var o,c,i,d,u,x,m,b,h,g;const r=((o=t.altUrl)==null?void 0:o.value)??`/products/${(i=(c=t.product)==null?void 0:c.reference)==null?void 0:i.handle}`,n=(u=(d=t.thumbnailImageOverride)==null?void 0:d.reference)==null?void 0:u.image,l=ce((x=t.badge)==null?void 0:x.reference);return e.jsx(P,{href:I(r),onClick:()=>{var p;s(((p=t.title)==null?void 0:p.value)??"")},className:N("col-span-2 bg-neutral-dark-2 h-[100px] w-full flex items-center rounded group",a),children:e.jsxs("div",{className:"flex items-center gap-xs p-2xs",children:[e.jsxs("div",{className:"w-[80px] h-[80px] relative",children:[e.jsx(R,{data:n??((b=(m=t.product)==null?void 0:m.reference)==null?void 0:b.featuredImage)??G,sizes:"80px",className:"object-contain w-full h-full transition-transform duration-500 group-hover:scale-[1.03]",aspectRatio:"1/1",loading:"eager"}),l&&e.jsx(ae,{badge:l,variant:"rectangle",size:"none",className:"absolute -top-1 left-0 [&>span]:text-[6.4px]"})]}),e.jsx("span",{className:"text-base font-normal font-body",children:((h=t.title)==null?void 0:h.value)??""})]})},((g=t.title)==null?void 0:g.value)??"")}function Hs({activeNavItem:t,onClick:s}){var a,r,n,l,o,c,i,d,u,x,m,b,h;return t?e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"flex flex-col py-lg pl-3xl pr-2xl flex-1",children:[e.jsx("h2",{className:"text-lg font-bold mb-m",children:(a=t.description)==null?void 0:a.value}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-m gap-y-xs mb-m max-w-[824px]",children:[(l=(n=(r=t.items)==null?void 0:r.references)==null?void 0:n.nodes)==null?void 0:l.map((g,p)=>{var j;return e.jsx(lt,{className:"col-span-1 max-w-[400px]",item:g,onClick:()=>{var v;s(((v=g.title)==null?void 0:v.value)??"")}},((j=g.title)==null?void 0:j.value)??""+p)}),e.jsx(te,{href:I(((i=(c=(o=t.cta)==null?void 0:o.reference)==null?void 0:c.url)==null?void 0:i.value)??""),variant:"secondary-outline",className:"col-span-2 w-fit mx-auto",onClick:()=>{var g,p,j;return s(((j=(p=(g=t.cta)==null?void 0:g.reference)==null?void 0:p.title)==null?void 0:j.value)??"")},children:(x=(u=(d=t.cta)==null?void 0:d.reference)==null?void 0:u.title)==null?void 0:x.value})]})]}),e.jsx("div",{className:"w-[345px] bg-neutral-dark-2 min-h-full flex flex-col gap-s p-lg",children:(h=(b=(m=t.featuredItems)==null?void 0:m.references)==null?void 0:b.nodes)==null?void 0:h.map((g,p)=>{var j,v,y,C,A;
1return e.jsx(rt,{title:((j=g.title)==null?void 0:j.value)??"",badge:ce((v=g.badge)==null?void 0:v.reference),cta:g.cta??{},image:((C=(y=g.image)==null?void 0:y.reference)==null?void 0:C.image)??G,aspectRatio:"5/4",crop:"top",onClick:s},((A=g.title)==null?void 0:A.value)??""+p)})})]}):null}function Us(){var i,d,u;const{activeNavItem:t,isDropdownOpen:s,dropdownRef:a,handleDropdownEnter:r,handleNavLeave:n}=oe(),l=(u=(d=(i=t==null?void 0:t.items)==null?void 0:i.references)==null?void 0:d.nodes)==null?void 0:u[0],c=t&&l&&!l.product?$s:Hs;return e.jsx("div",{ref:a,className:N("hidden h-fit lg:block absolute left-0 right-0 z-[-1] bg-neutral-dark-1 text-default-negative shadow-2xl transition-all duration-200",s?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 -translate-y-[550px] pointer-events-none"),onMouseEnter:r,onMouseLeave:n,...!s&&{inert:""},children:e.jsx(c,{activeNavItem:t,onClick:x=>{var m;S($({navCategory:((m=t==null?void 0:t.title)==null?void 0:m.value)??"",clickText:x})),n()}})})}function Vs({children:t}){const{handleNavLeave:s}=oe();return e.jsxs("div",{className:"relative",onMouseLeave:s,children:[t,e.jsx("div",{className:"hidden lg:block",children:e.jsx(Us,{})})]})}function Ys({isMenuOpen:t}){const[s,a]=f.useState(!0),r=f.useRef(0),[n]=Xs();return f.useEffect(()=>{const l=()=>{const o=window==null?void 0:window.scrollY;if(t){a(!0);return}const c=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height")),i=r.current>o&&n||o<c;a(i),r.current=o};return window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[t,n]),s}function Js({header:t,isLoggedIn:s,isMenuOpen:a,setIsMenuOpen:r}){var i,d,u,x,m,b,h,g,p;const n=(u=(d=(i=t.metaobject)==null?void 0:i.tippyTopBanner)==null?void 0:d.references)==null?void 0:u.nodes,l=((b=(m=(x=t.metaobject)==null?void 0:x.exposedNav)==null?void 0:m.references)==null?void 0:b.nodes)??[],o=((p=(g=(h=t.metaobject)==null?void 0:h.desktopNavigation)==null?void 0:g.references)==null?void 0:p.nodes)??[],c=Ys({isMenuOpen:a});return e.jsxs(Bs,{navigationItems:o,children:[e.jsxs("header",{id:"sticky-header",className:N("fixed w-full z-50 top-0 transition-transform",c?"translate-y-0 onscreen":"-translate-y-header"),role:"banner",children:[!!(n!=null&&n.length)&&e.jsx(Mt,{content:n??[]}),e.jsx(Vs,{children:e.jsxs("nav",{className:"flex justify-between border-b border-neutral-gray-700 items-center min-h-[48px] text-default-negative lg:px-m relative bg-neutral-dark-2","aria-labelledby":"sticky-header","data-testid":"desktop-nav",role:"navigation",children:[e.jsxs("div",{className:"flex flex-1 items-center justify-start gap-2 lg:gap-lg",children:[e.jsx(zs,{isMenuOpen:a,setIsMenuOpen:r}),e.jsx(Qs,{}),e.jsx(_s,{navigationTriggers:o})]}),e.jsxs("div",{className:"flex items-center","aria-label":"header actions",children:[e.jsx(Pt,{}),e.jsx(Ps,{isLoggedIn:s}),e.jsx(Fs,{})]})]})}),!!l.length&&e.jsx(qs,{exposedNav:l})]}),e.jsx(Rs,{})]})}const Ks=f.forwardRef(function({title:s,url:a,onClick:r,className:n},l){return e.jsx("li",{children:e.jsx(Ie,{ref:l,onClick:r,to:I(a),className:N("flex items-center text-default-negative label py-s mx-s border-b border-neutral-gray-800",n),children:s},`${a}-${s}`)})});function Ae({item:t,aspectRatio:s="1/1",onClick:a,className:r}){var l,o,c,i,d,u,x,m,b,h,g;const n=ce((l=t.badge)==null?void 0:l.reference);return e.jsxs(P,{href:I(((i=(c=(o=t.cta)==null?void 0:o.reference)==null?void 0:c.url)==null?void 0:i.value)??""),onClick:()=>{var p;return a(((p=t.title)==null?void 0:p.value)??"")},className:N("flex flex-col gap-2xs hover:no-underline ",r),children:[e.jsxs("div",{className:"relative overflow-hidden no-underline",children:[e.jsx("div",{className:"overflow-hidden rounded",children:e.jsx(R,{data:((u=(d=t.image)==null?void 0:d.reference)==null?void 0:u.image)??G,sizes:"(min-width: 768px) 30vw, 100vw",className:"w-full object-contain",aspectRatio:s,crop:"top"})}),e.jsx("div",{className:"absolute inset-0 rounded-bl-[3px] rounded-br-[3px] z-10 bg-gradient-to-t from-neutral-black from-0% via-neutral-black/40 via-33% to-transparent to-70% pointer-events-none"}),e.jsx("h5",{className:"absolute bottom-2xs left-2xs z-10",children:(x=t.title)==null?void 0:x.value})]}),n&&e.jsx(ae,{badge:n,variant:"rectangle",size:"none"}),e.jsx("p",{className:"text-sm",children:(h=(b=(m=t.cta)==null?void 0:m.reference)==null?void 0:b.title)==null?void 0:h.value})]},(g=t.title)==null?void 0:g.value)}const it=f.forwardRef(({title:t,items:s,onClick:a,description:r,cta:n,featuredItems:l,index:o,onMenuOpenChange:c},i)=>{var d;return(d=s==null?void 0:s.references)!=null&&d.nodes.length?e.jsx(Je,{asChild:!0,value:t,className:"border-none data-[state=open]:bg-neutral-dark-1",ref:i,children:e.jsxs("li",{children:[e.jsx(Ke,{className:"py-s mx-s text-base font-bold label border-b border-neutral-gray-800 data-[state=open]:border-none tracking-wider",iconClassName:"h-6 w-6",onClick:()=>{c(o)},children:t}),e.jsxs(Ze,{className:"flex flex-col bg-neutral-dark-1 pb-0",animationSpeed:"slow",children:[r&&e.jsx("h4",{className:"header-h6 mb-s mx-s",children:r}),e.jsx("div",{className:"grid grid-cols-2 gap-s mx-s",children:s.references.nodes.map((u,x)=>{var m,b;return u.product?e.jsx(lt,{item:u,onClick:h=>{a(),S($({navCategory:t,clickText:h}))}},((m=u.title)==null?void 0:m.value)??""+x):e.jsx(Ae,{item:u,onClick:h=>{a(),S($({navCategory:t,clickText:h??t}))}},((b=u.title)==null?void 0:b.value)??""+x)})}),n&&e.jsx(te,{to:I(n.url),variant:"secondary-outline",className:"w-fit self-center whitespace-nowrap my-lg",onClick:()=>{a(),S($({navCategory:t,clickText:n.title}))},children:n.title}),l&&e.jsx("div",{className:N("overflow-x-auto flex gap-s px-s pb-m","[&::-webkit-scrollbar]:h-1 sm:[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-gray-600 [&::-webkit-scrollbar-thumb:hover]:bg-gray-600 "),children:l.map((u,x)=>{var m;return e.jsx(Ae,{item:u,aspectRatio:"5/4",className:"min-w-[266px]",onClick:()=>{var b;a(),S($({navCategory:t,clickText:((b=u.title)==null?void 0:b.value)??""}))}},((m=u.title)==null?void 0:m.value)??""+x)})})]})]})},t):null});it.displayName="MobileSubMenu";function Zs({mobileHeaderPromise:t,isLoggedIn:s,isMenuOpen:a,setIsMenuOpen:r}){return e.jsx(f.Suspense,{fallback:e.jsx("div",{children:"Loading..."}),children:e.jsx(U,{resolve:t,errorElement:e.jsx("div",{children:"Error loading mobile navigation"}),children:n=>{var c,i,d,u,x;if(!n)return null;const l=((d=(i=(c=n.metaobject)==null?void 0:c.mobileNavigation)==null?void 0:i.references)==null?void 0:d.nodes)??[],o=((x=(u=n.metaobject)==null?void 0:u.mobileNavFeature)==null?void 0:x.reference)??null;return e.jsx(Gs,{mobileNavigation:l,mobileNavFeature:o,isLoggedIn:s,isMenuOpen:a,setIsMenuOpen:r})}})})}function Gs({mobileNavigation:t,mobileNavFeature:s,isLoggedIn:a,isMenuOpen:r,setIsMenuOpen:n}){var j,v,y,C,A,M,Q,q,z,T,O,B;const[l,o]=f.useState(!1),c=f.useRef(null),i=f.useRef(null),d=s?{title:((j=s.title)==null?void 0:j.value)??"",cta:{title:((C=(y=(v=s.cta)==null?void 0:v.reference)==null?void 0:y.title)==null?void 0:C.value)??"",url:((Q=(M=(A=s.cta)==null?void 0:A.reference)==null?void 0:M.url)==null?void 0:Q.value)??""},image:((z=(q=s.image)==null?void 0:q.reference)==null?void 0:z.image)??G}:void 0,u=f.useCallback(()=>{n(k=>!k)},[n]),x=f.useCallback((k,w)=>
1{S($({navCategory:k,clickText:w})),u()},[u]);f.useEffect(()=>{const k=()=>{window.innerWidth>990&&n(!1)};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}},[n]);const m=f.useRef(null),b=f.useCallback(k=>{var w;(w=m.current)==null||w.scrollTo({top:k*57,behavior:"instant"})},[m]),{decisions:h}=F(),g=((T=h==null?void 0:h.subscription_language)==null?void 0:T.variationKey)!="off",p=(B=(O=h==null?void 0:h.subscription_language)==null?void 0:O.variables)==null?void 0:B.optiSubscribe;return e.jsx(Qe,{open:r,onOpenChange:n,children:e.jsxs($e,{side:"left",overlayHeight:"top-[calc(var(--header-height)_-_44px)]",className:N("bg-neutral-dark-2 bottom-0 w-11/12 overflow-auto lg:overflow-hidden","[&::-webkit-scrollbar]:w-0 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-neutral-dark-2 [&::-webkit-scrollbar-thumb:hover]:bg-gray-600 [&::-webkit-scrollbar-thumb]:rounded-full","top-[calc(var(--header-height)_-_44px)]"),onOpenAutoFocus:k=>{k.preventDefault(),c.current&&c.current.focus(),i.current&&i.current.focus()},onCloseAutoFocus:k=>{k.preventDefault(),l&&window.scrollTo(0,0)},onInteractOutside:k=>{const w=k.target;((w==null?void 0:w.id)==="cart-badge"||(w==null?void 0:w.id)==="cart"||(w==null?void 0:w.id)==="hamburger-menu-toggle")&&k.preventDefault()},ref:m,children:[e.jsxs(He,{className:"sr-only",children:[e.jsx(Ue,{children:"Menu"}),e.jsx(Ve,{children:"Site Navigation Menu"}),e.jsx(Se,{onClick:()=>o(!0),children:"Close Menu"})]}),e.jsxs("section",{className:"flex h-full flex-col justify-between","data-testid":"mobile-nav",children:[e.jsx("nav",{role:"navigation","aria-label":"header links",children:e.jsx(Ye,{type:"single",collapsible:!0,className:"bg-neutral-dark-2 text-default-negative",children:e.jsxs("ul",{className:"flex flex-col flex-1",children:[t.map((k,w)=>{var be,je,ve,Ne;const{title:D,url:Y,items:ne,description:W,cta:L,featuredItems:X}=k;if(!(D!=null&&D.value))return null;const ct=L!=null&&L.reference?{title:((be=L.reference.title)==null?void 0:be.value)??"",url:((je=L.reference.url)==null?void 0:je.value)??""}:void 0;return Y!=null&&Y.value?e.jsx(Ks,{ref:w===0?c:null,title:(ve=D.value)!=null&&ve.includes("Subscribe & Save")&&g&&p?p:D.value,url:Y.value,onClick:()=>x(D.value??"",D.value??"")},D.value):e.jsx(it,{title:D.value,items:ne,description:(W==null?void 0:W.value)??"",cta:ct,featuredItems:((Ne=X==null?void 0:X.references)==null?void 0:Ne.nodes)??[],onClick:u,onMenuOpenChange:b,index:w},D.value)}),s&&e.jsx("li",{children:e.jsx(ge,{className:"px-s py-m [&>div:first-of-type]:max-w-full !mb-0 [&>div>img]:mb-2xs",featuredSection:d,loading:"eager",onClick:()=>{var k;return x((d==null?void 0:d.title)??"",((k=d==null?void 0:d.cta)==null?void 0:k.title)??"")}})}),e.jsx("li",{className:"px-s py-m",children:e.jsx(Ft,{className:"w-full",onFormSubmitted:()=>n(!1)})})]})})}),e.jsxs("nav",{className:"flex flex-col bg-neutral-dark-2 border-t border-neutral-gray-800 pt-s pb-2xl mx-s",role:"navigation","aria-label":"account and social links",children:[e.jsxs(P,{className:"text-default-negative flex items-center gap-3xs py-xs",href:a?"/account":"/account/login",onClick:u,prefetch:"intent",children:[e.jsx(E,{name:"icon-nav-account",size:16}),e.jsx("span",{className:"text-lg",children:a?"Account":"Log in"})]}),e.jsx(P,{href:"//help.shopmando.com",className:"text-lg text-default-negative py-xs",children:"Help Center"}),e.jsx(Se,{className:"sr-only",onClick:()=>o(!0),children:"Close Menu"})]})]})]})})}const xe="font-body px-5 py-6 shadow-md rounded-[4px] text-sm leading-sm font-normal tracking-normal",Ws=({...t})=>e.jsx(pt,{className:"toaster group",toastOptions:{style:{gap:"16px"},classNames:{error:N(xe,"bg-error-medium text-default-negative border-none"),info:N(xe,"bg-primary-medium text-default-negative border-none"),success:N(xe,"bg-success-medium text-default-negative border-none gap-4")}},icons:{info:e.jsx(E,{name:"check-circle-fill",size:20})},...t}),ot=f.createContext({stickyHeader:[!0,()=>{}]});function Xs(t=!0){const s=f.useContext(ot);if(!s)throw new Error("useStickyHeader must be used within a Layout");const[,a]=s.stickyHeader;return f.useEffect(()=>(a(t),()=>a(!0)),[t,a]),s.stickyHeader}
1function ka({children:t=null,footer:s,header:a,mobileHeaderPromise:r,shop:n,publicStoreDomain:l,isLoggedIn:o}){const[c,i]=f.useState(!1),d=f.useState(!0),u=f.useRef(null),x=V(),{consent:m,shopAnalytics:b}=F();return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("button",{onClick:()=>{var h;return(h=u.current)==null?void 0:h.focus()},className:"sr-only",children:"Skip to main content"}),e.jsxs(ot.Provider,{value:{stickyHeader:d},children:[e.jsx(Js,{header:a,isLoggedIn:o,isMenuOpen:c,setIsMenuOpen:i}),e.jsx(Ss,{}),e.jsx("main",{ref:u,className:"flex-1",tabIndex:-1,children:t}),e.jsx(Ws,{position:"bottom-right"})]}),e.jsx(Ms,{footer:s,publicStoreDomain:l,shop:n}),e.jsx(Zs,{mobileHeaderPromise:r,isLoggedIn:o,isMenuOpen:c,setIsMenuOpen:i}),e.jsx(ut.Provider,{cart:{...x,metafields:[]},consent:m,shop:b})]})}export{gs as C,ka as L,js as P,We as p,Xs as u};
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.