1(self.webpackChunkshopify=self.webpackChunkshopify||[]).push([[391],{9226:function(e,t,a){"use strict";a.d(t,{d:function(){return b}});var n=a(7294),i=a(3935);const r=e2=>{let{missingAmount:t2,amountNeeded:a2}=e2;return n.createElement("div",{className:"flex flex-col items-center justify-center p-4"},t2>0?n.createElement("div",{className:"flex items-center justify-center font-sans text-sm"},n.createElement("div",{className:"text-vital-brand-blue text-sm font-abc-monument-grotesk font-medium leading-[inherit]"},"Add $",t2.toFixed(2)),"\xA0to unlock Free Shipping!"):n.createElement("div",{className:"text-vital-brand-blue font-abc-monument-grotesk text-sm font-medium font-sans"},"You've got Free Shipping!"),n.createElement("div",{className:"w-full h-[4px] bg-[#D8D8D8] rounded mt-2"},n.createElement("div",{className:"h-[4px] bg-vital-brand-blue rounded",style:{width:t2<=0?"100%":`${((a2-t2)/a2*100).toFixed(2)}%`}})))},l=e2=>{let{img:t2,link:a2,title:i2}=e2;return n.createElement("div",{className:"w-[calc(50%-0.5rem)] mt-2 odd:mr-2 even:ml-2 cursor-pointer"},n.createElement("a",{href:a2},n.createElement("img",{className:"h-32 w-full object-cover rounded",src:t2,alt:"Category image"}),n.createElement("div",{className:"text-sm font-sans font-semibold text-dark-gray mt-2"},i2)))};a(8153);const s=e2=>{let{available:t2,id:a2,image:i2,link:r2,price:l2,tags:s2,title:o2,variantId:c2}=e2;const[d2,m2]=s2.reduce(((e3,t3)=>{if(e3.length>0)return e3;switch(t3){case"NEW":return["NEW","bg-blue-500"];case"SEASONAL":return["SEASONAL","bg-green"];case"ONSALE":return["ON SALE","bg-red"];case"Bestseller":return["BEST SELLER","bg-yellow"];default:return[]}}),[]);let[u2,p2]=o2.split("-").map((e3=>e3.trim()));return typeof u2=="string"&&u2.length>25&&(u2=u2.slice(0,22)+"..."),typeof p2=="string"&&p2.length>26&&(p2=p2.slice(0,23)+"..."),n.createElement("div",null,n.createElement("a",{href:r2},n.createElement("div",{className:"flex flex-col mb-2"},n.createElement("div",{className:"relative"},d2?n.createElement("div",{className:`absolute z-10 right-2 top-2 ${m2} ${m2==="bg-yellow"?"text-charcoal":"text-white"} font-bold text-xs text-center px-2 py-2`},d2):void 0,n.createElement("img",{className:"object-cover w-full rounded",loading:"lazy",src:i2,alt:o2}))),n.createElement("div",{className:"h-24"},n.createElement("div",{className:"h-5 mb-1 text-sm font-semibold"},u2),n.createElement("div",{className:"h-5 mb-1 text-sm font-medium"},p2),n.createElement("div",{className:"h-5 mb-1"},n.createElement("div",{className:"mx-auto flex justify-center","data-bv-show":"inline_rating","data-bv-product-id":a2,"data-bv-redirect-url":r2,"data-bv-seo":"false"})),n.createElement("div",{className:"text-xs font-medium"},"$",(Number(l2)/100).toFixed(2)))))};var o=()=>{const e2=(0,n.useContext)(b),t2=e2.categories,a2=e2.products,i2=e2.alternateVersion;let r2=n.createElement("div",{className:"flex flex-grow my-11 px-4 flex-wrap w-full"},t2.filter((e3=>e3.link&&e3.title)).map(((e3,t3)=>n.createElement(l,Object.assign({key:t3},e3)))));return i2&&(r2=n.createElement("div",{className:"flex-grow my-11 glide cart-empty-state product-card-carousel"},n.createElement("div",{className:"glide__track","data-glide-el":"track"},n.createElement("ul",{className:"glide__slides list-none product-card-carousel-slides"},a2.map(((e3,t3)=>{const a3=e3.variants[0];return n.createElement("li",{key:t3,className:"glide__slide product-card-carousel-{{ random }}-slide"},n.createElement(s,{available:a3.available,id:e3.id,image:e3.featured_image,link:`/products/${e3.handle}`,price:a3.price,tags:e3.tags,title:e3.title,variantId:a3.id}))}))))),(0,n.useEffect)((()=>{new globalThis.Glide(".glide.cart-empty-state.product-card-carousel",{gap:16,peek:85,type:"carousel"}).mount()}),[])),n.createElement("div",{className:"flex flex-col items-center my-4"},n.createElement("div",{className:"text-[#183F86] font-abc-monument-grotesk font-medium text-2xl"},e2.emptyStateTitle),n.createElement("div",{className:"font-medium text-sm font-abc-monument-grotesk text-medium-gray"},e2.emptyStateSubtitle),r2,n.createElement("div",{className:"w-full py-3 px-4"},n.createElement("div",null,n.createElement("a",{className:"vital-btn font-abc-monument-grotesk w-full",href:e2.emptyStateCTALink},e2.emptyStateCTAText)),n.createElement("div",{className:"mt-3 text-[#183F86] font-abc-monument-grotesk font-medium text-base text-center"},e2.emptyStateCTASubtext)))},c=a(739),d=a(3548),m=a(8057);function u(e2){return e2.final_price===0}const p=e2=>{let{closeCart:t2,isOpen:a2,shippingWidgetInfo:i2,cartQuantity:l2,resizeImage:s2,onChangeSubscriptionFrequency:p2,removeSubscriptionState:f2,addBundleToCart:g2,cartTotal:h2,totalSavings:v2,recommendedIntervals:x2,termsURL:y2,
1subscriptionDisclosure:w,featuredBannerData:E}=e2;const S=(0,n.useContext)(b);return n.createElement("div",{className:"fixed transition-[z-index]",style:{width:"100%",height:"100vh",zIndex:a2?1e3:-1,backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",top:0,left:0}},n.createElement("div",{className:"fixed inset-0","aria-hidden":"true",onClick:t2}),n.createElement("div",{"aria-hidden":!a2,className:`z-[1000] flex flex-col fixed inset-y-0 right-0 transform transition-transform duration-200 ease-in-out ${a2?"translate-x-0":"translate-x-full"} max-w-xs w-full lg:w-[360px] bg-white shadow-lg z-50 overflow-y-auto`},n.createElement("div",{className:"bg-white p-4 z-50 border-b border-nav-color"},n.createElement("div",{className:"flex items-center justify-between"},n.createElement("div",{className:"flex items-center text-base text-vital-brand-blue font-medium font-sans"},n.createElement("img",{className:"h-6 w-6 mr-3",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/icon-cart.png?v=1676921197",alt:"cart icon"}),"Cart (",l2,")"),n.createElement("img",{className:"cursor-pointer",onClick:t2,alt:"close cart drawer",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/Exit.png?v=1677078429",width:24,height:24}))),n.createElement("div",{className:"relative flex-1"},S.performingAction?n.createElement("div",{className:"z-10 opacity-75 absolute bg-white w-full h-full flex items-center justify-center"},n.createElement("i",{className:"vp-icon-spinner-solid animate-spin"})):null,S.items.length>0?n.createElement(r,{missingAmount:i2.missingAmount,amountNeeded:i2.amountNeeded}):null,n.createElement("div",{className:"flex flex-col px-4"},(_=S.items,[..._].sort(((e3,t3)=>Number(u(t3))-Number(u(e3))))).map(((e3,t3)=>n.createElement("div",null,n.createElement("div",{key:t3,className:"flex mt-3"},n.createElement("div",null,n.createElement("img",{className:"rounded object-cover w-[70px] h-[70px]",src:s2(e3.image,{width:100}),alt:e3.title,style:{maxWidth:"none"}})),n.createElement("div",{className:"flex flex-col ml-2 flex-1 h-[70px] justify-between"},n.createElement("div",{className:"flex justify-between"},n.createElement("div",{className:"text-[#183F86] font-abc-monument-grotesk font-medium text-sm"},e3.product_title.split("-")[0].length>36?e3.product_title.split("-")[0].substring(0,34)+"...":e3.product_title.split("-")[0],n.createElement("br",null),e3.product_title.split("-")[1]?e3.product_title.split("-")[1].length>29?e3.product_title.split("-")[1].substring(0,27)+"...":e3.product_title.split("-")[1]:null,u(e3)?n.createElement("div",{className:"text-[#183F86] font-abc-monument-grotesk font-medium text-xs mt-1"},"\u{1F381} FREE GIFT"):null),!u(e3)&&n.createElement("div",{onClick:()=>S.removeItem(e3.key)},n.createElement("img",{className:"object-cover w-[21px] h-[21px] cursor-pointer",alt:"delete item from cart",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/trash.png?v=1690467957"}))),n.createElement("div",{className:"flex justify-between items-center"},n.createElement("div",{className:"font-abc-monument-grotesk text-vital-brand-blue font-medium text-sm"},u(e3)?e3.isGiftAvailable===!1?"OUT OF STOCK":"FREE":n.createElement(n.Fragment,null,e3.original_price===e3.final_price||e3.selling_plan_allocation?null:n.createElement("span",Object.assign({},e3.discounts.length>0?{title:e3.discounts[0].title+` (-$${(e3.discounts[0].amount/100).toFixed(2)})`}:{},{className:"text-strike-through line-through"}),"$",(e3.original_price/100).toFixed(2)),e3.selling_plan_allocation?n.createElement("span",{className:"text-strike-through line-through"},"$",(e3.selling_plan_allocation.compare_at_price/100).toFixed(2)):null,"\xA0$",(e3.final_price/100).toFixed(2))),!u(e3)&&n.createElement("div",{className:"flex flex-grow-0 text-[#183F86] font-abc-monument-grotesk font-medium text-sm w-[80px] h-[30px] rounded-full border border-[#183F86] items-center justify-between"},n.createElement("div",{onClick:()=>S.decreaseQty(e3),className:"flex-1 cursor-pointer text-center flex items-center justify-center"},n.createElement("i",{className:"vp-icon-minus-regular h-3.5 w-3.5"})),e3.quantity,n.createElement("div",{onClick:()=>S.increaseQty(e3),className:"flex-1 cursor-pointer text-center flex items-center justify-center"},n.createElement("i",{className:"vp-icon-plus-solid h-3.5 w-3.5"})))))),e3.selling_plan_allocation&&!u(e3)?n.createElement("div",{className:"bg-[#F7F7F7] mt-3 rounded flex flex-col full-w py-2 px-3 items-center justify-center"},n.createElement("div",{className:"w-full flex text-[#183F86] font-avenir-next font-medium text-sm items-center"},n.createElement("div",{onClick:()=>f2(e3,t3+1),className:"w-3.5 h-3.5 flex flex-grow-0 items-center justify-center border border-vital-brand-blue bg-vital-brand-blue mr-2 cursor-pointer"},n.createElement("img",{src:"https://cdn.shopify.com/s/files/1/2074/9385/files/Vector_ef8e75e9-fd3b-4800-9d92-70185e3d335e.png?v=1691165059",alt:"check mark",className:"w-[10px] h-[8px] object-contain"})),"Subscribe and Save 15%"),n.createElement(c.R,{value:e3.selling_plan_allocation.selling_plan.options[0].name.split(", ").indexOf(e3.selling_plan_allocation.selling_plan.options[0].value),onChange:a3=>p2(e3,a3,t3+1)},(t4=>{let{open:a3}=t4;return n.createElement(n.Fragment,null,n.createElement("div",{className:"relative w-full my-2"},n.createElement(c.R.Button,{className:"bg-white justify-start relative w-full border border-gray-300 rounded shadow-sm pl-2 pr-2 py-3 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-navy-blue-500 focus:border-indigo-500 sm:text-sm"},n.createElement("span",{className:"pl-1 text-dark-gray font-semibold"},(()=>{const t5=e3.selling_plan_allocation.selling_plan;if(t5.options.length>1&&t5.options[0].name==="Recharge Plan ID"){const e4=t5.options.find((e5=>e5.name==="Order Frequency and Unit"));if(e4)return`Ship every ${e4.value.replace("-"," ")}`}if(t5.options[0].value&&/^\d+$/.test(t5.options[0].value)){const e4=t5.options[0].name.split(", ").slice(1).join(", ");return e4?`Ship every ${e4}`:"Ship every (frequency not found)"}return`Ship every ${t5.options[0].value}`})()),n.createElement("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},n.createElement("svg",{className:"cursor-pointer ml-2",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M2.66699 6.5L8.00033 11.8333L13.3337 6.5",stroke:"#393D40",strokeLinecap:"round",strokeWidth:2,strokeLinejoin:"round"})))),n.createElement(d.u,{show:a3,as:n.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0"},n.createElement(c.R.Options,{className:"w-full max-w-full list-none pl-0 h-60 overflow-auto absolute z-[1000] bg-white border border-light-gray rounded shadow-lg",style:{width:"-webkit-fill-available"}},e3.product.selling_plan_groups[0].selling_plans.map(((t5,a4)=>{let i3="";if(t5.options.length>1&&t5.options[0].name==="Recharge Plan ID"){const e4=t5.options.find((e5=>e5.name==="Order Frequency and Unit"));e4&&(i3=`Ship every ${e4.value.replace("-"," ")}`)}else if(t5.options[0].value&&/^\d+$/.test(t5.options[0].value)){const e4=t5.options[0].name.split(", ").slice(1).join(", ");i3=e4?`Ship every ${e4}`:"Ship every (frequency not found)"}else i3=`Ship every ${t5.options[0].value}`;return n.createElement(c.R.Option,{key:a4,value:a4},(t6=>{let{selected:a5,active:r2}=t6;return n.createElement("div",{className:"flex "+(r2?"bg-navy-blue-500 text-white":"")},a5?n.createElement("span",{className:"'absolute inset-y-0 right-0 flex flex-grow-0 items-center pl-4 "+(r2?"text-white":"text-indigo-600")},n.createElement(m.Z,{className:"h-5 w-5"})):n.createElement("div",{className:"w-[36px]"}),n.createElement("div",{className:"cursor-pointer flex-1 px-4 py-2 "+(a5?"font-semibold":"")},i3," ",x2.variants[e3.variant_id]===i3?"(Recommended)":""))}))}))))))})),n.createElement("div",{className:"flex justify-between items-center w-full text-[13px] text-[#183F86] font-abc-monument-grotesk"},n.createElement("div",{className:"flex"},n.createElement("img",{src:"https://cdn.shopify.com/s/files/1/2074/9385/files/check_1.png?v=1691164729",alt:"check mark",className:"w-[13.75px] h-[16.15px] mr-1"}),"Free Shipping"),n.createElement("div",{className:"flex"},n.createElement("img",{src:"https://cdn.shopify.com/s/files/1/2074/9385/files/check_1.png?v=1691164729",alt:"check mark",className:"w-[13.75px] h-[16.15px] mr-1"}),"Cancel Anytime"),n.createElement("div",{className:"flex"},n.createElement("img",{src:"https://cdn.shopify.com/s/files/1/2074/9385/files/check_1.png?v=1691164729",alt:"check mark",className:"w-[13.75px] h-[16.15px] mr-1"}),"15% Off"))):e3.isSubscribable?n.createElement("div",{className:"bg-[#F7F7F7] mt-3 rounded flex full-w py-2 px-3 items-center justify-center"},n.createElement("div",{className:"flex-1 flex text-sm text-[#183F86] font-avenir-next font-medium items-center"},n.createElement("div",{onClick:()=>
1p2(e3,0,t3+1),className:"w-3.5 h-3.5 border border-[#183F86] mr-2 cursor-pointer"}),"Subscribe and Save 15%"),n.createElement("div",{className:"relative group"},n.createElement("img",{className:"w-[18px] h-[18px] cursor-pointer",alt:"info about subscriptions",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/icons8-info_1.png?v=1691074562"}),n.createElement("div",{className:"absolute hidden group-hover:block"},n.createElement("div",{className:"flex absolute top-[20px] right-[-30px] text-white bg-vital-brand-blue rounded-md p-2 max-w-80 w-max"},S.subscriptionInfoDetails.map(((e4,t4)=>n.createElement("div",{key:t4,className:"flex text-xs font-medium mx-1 mb-0"},n.createElement("img",{className:"w-3 h-4 mr-1",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/check_1_faffbcc8-2ef0-4d68-9ed2-ebaad898e52c.png?v=1697548062",alt:"check icon"}),e4)))),n.createElement("div",{className:"absolute bg-transparent w-0 h-0 border-l-[5px] border-r-[5px] border-b-[8px] border-l-transparent border-r-transparent border-b-vital-brand-blue top-[13px] right-[-14px]"})))):null)))),S.items.length>0&&window.cartAddonManager&&window.cartAddonManager.getProducts().reduce(((e3,t3)=>e3+t3.variants[0].inventory_quantity),0)>0?n.createElement("div",{className:"flex flex-col bg-[#F7F7F7] mt-3 items-center"},n.createElement("div",{className:"my-4 text-[#183F86] font-abc-monument-grotesk font-medium text-center"},window.cartAddonManager.getTitle()),n.createElement("div",{className:"swiper swiper-cart-drawer-suggested-products flex w-[calc(100%-12px)] mb-4"},n.createElement("div",{className:"swiper-wrapper flex"},window.cartAddonManager.getProducts().map(((e3,t3)=>e3.variants[0].inventory_quantity===0?null:n.createElement("div",{className:"swiper-slide flex-none items-center flex mx-1.5 p-3 w-[256px] h-[94px] rounded-lg bg-white border border-[#EBEBEB]"},n.createElement("img",{className:"rounded-lg w-[60px] h-[60px] object-cover",src:s2(e3.featured_image,{width:80}),alt:""}),n.createElement("div",{className:"flex-1 flex flex-col ml-2"},n.createElement("div",{className:"text-xs text-[#183F86] font-abc-monument-grotesk font-medium"},e3.title.split("-")[0]),n.createElement("div",{className:"flex text-xs text-[#183F86] font-abc-monument-grotesk font-medium"},"$",(e3.variants[0].price/100).toFixed(2),"\xA0",e3.variants[0].compare_at_price&&e3.variants[0].compare_at_price>e3.variants[0].price?n.createElement("div",{className:"text-[#818181] line-through"},"$",(e3.variants[0].compare_at_price/100).toFixed(2)):null)),n.createElement("div",{onClick:()=>g2(e3),className:"bg-vital-brand-blue rounded-full font-semibold text-white cursor-pointer text-sm w-[76px] h-[30px] flex flex-grow-0 items-center justify-center"},"Add"))))))):null,S.items.length===0?n.createElement(o,null):null),E.enabled?n.createElement("div",{className:`color-${E.colorScheme}`,style:{fontFamily:`${E.font}, sans-serif`,backgroundImage:`url(${E.image})`,backgroundSize:`${E.backgroundSize}`}},n.createElement("div",{className:"flex bg-color-scheme-accent"},n.createElement("div",{className:"flex flex-1 flex-col items-center justify-center text-center py-4 px-4"},n.createElement("div",{style:{fontFamily:`${E.titleFont}, sans-serif`},className:"text-3xl leading-none text-left font-normal text-color-scheme-background",dangerouslySetInnerHTML:{__html:E.title}}),n.createElement("a",{href:E.CTAAction==="navigate"?E.link:`javascript:window.cartManager.addItem({ 2 quantity: 1, 3 id: ${E.product}, 4 properties: {}, 5 })`,style:{fontFamily:`${E.CTATextFont}, sans-serif`},className:"text-base font-semibold text-color-scheme-buttonBackground bg-color-scheme-background rounded-full py-2 px-4 mt-4"},E.CTAText)),n.createElement("img",{src:E.image,alt:E.title,className:"w-auto h-[212px]",loading:"lazy"}))):null,S.items.length>0?n.createElement("div",{className:"sticky bottom-0 bg-white border-t border-light-gray py-3 px-4 flex flex-col flex-grow-0 z-10"},n.createElement("div",{className:"flex text-sm font-sans justify-between mb-1 text-[#26A074] font-semibold"},n.createElement("div",null,"Savings"),n.createElement("div",null,"$",v2.toFixed(2))),n.createElement("div",{className:"flex text-sm justify-between text-[#183F86] font-abc-monument-grotesk font-medium mb-2"},n.createElement("div",null,"Estimated Total"),n.createElement("div",null,"$",h2.toFixed(2))),w&&S.items.some((e3=>e3.selling_plan_allocation))&&n.createElement("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 mb-3"},n.createElement("p",{className:"text-xs text-gray-600 leading-relaxed"},n.createElement("strong",{className:"text-gray-800"},"Subscribe & Save Disclosure:")," ",w)),n.createElement("form",{className:"flex flex-col",action:"/checkout",method:"post"},n.createElement("button",{type:"submit","data-optmizely-experiment-id":"25143770201","data-optmizely-variation":"a",className:"vital-btn h-[52px]"},n.createElement("img",{className:"w-[20px] h-[20px] mr-2.5",src:"https://cdn.shopify.com/s/files/1/2074/9385/files/Lock.png?v=1692107115",alt:"lock icon"})," Checkout - $",h2.toFixed(2)),n.createElement("button",{type:"submit","data-optmizely-experiment-id":"25143770201","data-optmizely-variation":"b",className:"vital-btn h-[52px] hidden"},"Secure Checkout - $",h2.toFixed(2))),n.createElement("div",{className:"text-[10px] font-medium mt
5-2 text-[#183F86] font-abc-monument-grotesk text-center"},'By clicking "Secure Checkout" and submitting this order, you agree to ',n.createElement("a",{href:y2,className:"text-[#183F86] font-abc-monument-grotesk underline"},"Vital Proteins Terms of Use and Privacy Policy"),".")):null));var _};var f=function(e2,t2,a2,n2){return new(a2||(a2=Promise))((function(i2,r2){function l2(e3){try{o2(n2.next(e3))}catch(e4){r2(e4)}}function s2(e3){try{o2(n2.throw(e3))}catch(e4){r2(e4)}}function o2(e3){var t3;e3.done?i2(e3.value):(t3=e3.value,t3 instanceof a2?t3:new a2((function(e4){e4(t3)}))).then(l2,s2)}o2((n2=n2.apply(e2,t2||[])).next())}))};let g={};function h(e2){let t2=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];document.dispatchEvent(new CustomEvent("shopify:cart:lines-update",{bubbles:!0,detail:{source:"theme",action:e2,lines:t2}}))}const b=n.createContext(null),v=b.Provider;function x(){const e2=(()=>{const[e3,t3]=(0,n.useState)([]),[a3,i3]=(0,n.useState)(!1),[r3,l3]=(0,n.useState)(!1),[s3,o3]=(0,n.useState)(!0),[c3,d3]=(0,n.useState)(globalThis.cartDrawerCategories),[m3,u3]=(0,n.use
5State)(globalThis.cartDrawerCollection),[p2,b3]=(0,n.useState)(globalThis.cartDrawerSeeBVersion),[v2,x2]=(0,n.useState)(globalThis.cartDrawerEmptyStateTitle),[y2,w]=(0,n.useState)(globalThis.cartDrawerEmptyStateSubtitle),[E,S]=(0,n.useState)(globalThis.cartDrawerEmptyStateCTAText),[_,N]=(0,n.useState)(globalThis.cartDrawerEmptyStateCTALink),[k,T]=(0,n.useState)(globalThis.cartDrawerEmptyStateCTASubtext),[C,A]=(0,n.useState)(globalThis.cartDrawerSubscriptionInfoDetails),[F,L]=(0,n.useState)(globalThis.cartDrawerSubscriptionDisclosure),[j,O]=(0,n.useState)(globalThis.cartDrawerTermsURL),[q,D]=(0,n.useState)(0),I=()=>f(void 0,void 0,void 0,(function*(){var e4;try{l3(!0);const a4=yield fetch("/cart.js",{method:"GET",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"}}),n2=yield a4.json(),i4=yield f(void 0,void 0,void 0,(function*(){try{const e5=yield fetch("/cart?view=qty-step",{method:"GET",mode:"same-origin",cache:"no-cache",credentials:"same-origin"});return e5.ok?yield e5.json():{}}catch{return console.log("CartDrawer unable to load minimum quantities."),{}}}));for(let t4 of n2.items){let a5=g[t4.id];a5||(a5=yield fetch(`/products/${t4.handle}.js`,{method:"GET",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"}}),a5=yield a5.json(),g[t4.id]=a5),t4.product=a5,t4.isGiftAvailable=(a5.variants||[]).some((e5=>e5.id===t4.variant_id&&e5.available)),t4.isSubscribable=!!a5.selling_plan_groups[0],t4.quantityMin=((e4=i4[t4.variant_id])===null||e4===void 0?void 0:e4.quantity_min)||1}t3(n2.items),D(n2.total_discount/100),$(n2.items),window.cartManager.items=n2.items,l3(!1)}catch{console.log("CartDrawer unable to load.")}finally{l3(!1),o3(!1)}})),$=e4=>{const t4=document.querySelectorAll(".cartCount"),a4=e4.length>0?e4.reduce(((e5,t5)=>e5+t5.quantity),0):0;if(t4.length>0)for(const e5 of t4)e5.innerHTML=a4.toString()},M=e4=>f(void 0,void 0,void 0,(function*(){var t4;l3(!0);const a4=yield fetch("/cart/add.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e4)});if(!a4.ok){let t5="Sorry, we could not add that to your cart.";try{const e5=yield a4.json();t5=e5.description||e5.message||t5}catch{}return document.dispatchEvent(new CustomEvent("cart:add-error",{bubbles:!0,detail:{message:t5,status:a4.status,items:e4}})),void l3(!1)}yield I(),h("add",(t4=e4.items)!==null&&t4!==void 0?t4:[]),H(),l3(!1)})),z=e4=>f(void 0,void 0,void 0,(function*(){l3(!0),yield fetch("/cart/update.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:{[e4]:0}})}),yield I(),h("remove",[{id:e4,quantity:0}]),l3(!1)})),P=e4=>f(void 0,void 0,void 0,(function*(){yield fetch("/cart/update.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e4)}),yield I(),h("update",Object.entries(e4.updates).map((e5=>{let[t4,a4]=e5;return{id:t4,quantity:a4}})))})),B=(e4,t4,a4)=>f(void 0,void 0,void 0,(function*(){l3(!0);const n2=yield fetch(`/products/${e4.handle}.js`,{method:"GET",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"}}),i4=yield n2.json(),r4={line:a4,quantity:e4.quantity,selling_plan:i4.selling_plan_groups[0].selling_plans[t4].id};yield fetch("/cart/change.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(r4)}),yield I(),h("update",[]),l3(!1)})),R=(e4,t4)=>f(void 0,void 0,void 0,(function*(){l3(!0);const a4={line:t4,quantity:e4.quantity,selling_plan:null};yield fetch("/cart/change.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a4)}),yield I(),h("update",[]),l3(!1)})),U=e4=>f(void 0,void 0,void 0,(function*(){const t4=e4.quantityMin||1,a4=e4.quantity+1;if(t4>1&&a4>10)return;l3(!0);const n2={updates:{[e4.key]:a4}};yield P(n2),l3(!1)})),Q=e4=>f(void 0,void 0,void 0,(function*(){const t4=e4.quantityMin||1,a4=e4.quantity-1;l3(!0);const n2={updates:{[e4.key]:a4<t4?0:a4}};yield P(n2),l3(!1)})),V=()=>f(void 0,void 0,void 0,(function*(){l3(!0),yield fetch("/cart/clear.js",{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify("")}),yield I(),h("remove",[]),l3(!1)})),H=()=>{i3(!0),window.cartManager.cartOpen=!0},G=()=>{i3(!1),window.cartManager.cartOpen=!1};return window.cartManager={categories:c3,products:m3,alternateVersion:p2,setCategories:d3,setProducts:u3,setAlternateVersion:b3,items:e3,totalDiscount:q,cartOpen:a3,performingAction:r3,isLoading:s3,addItem:M,removeItem:z,updateItem:P,removeSubscription:R,changeItem:B,clearCart:V,openCart:H,closeCart:G,increaseQty:U,decreaseQty:Q,getCart:I,emptyStateTitle:v2,setEmptyStateTitle:x2,emptyStateSubtitle:y2,setEmptyStateSubtitle:w,emptyStateCTAText:E,setEmptyStateCTAText:S,emptyStateCTALink:_,setEmptyStateCTALink:N,emptyStateCTASubtext:k,setEmptyStateCTASubtext:T,subscriptionInfoDetail
5s:C,setSubscriptionInfoDetails:A,subscriptionDisclosure:F,setSubscriptionDisclosure:L,termsURL:j,setTermsURL:O},{items:e3,totalDiscount:q,cartOpen:a3,performingAction:r3,isLoading:s3,getCart:I,addItem:M,removeItem:z,updateItem:P,removeSubscription:R,changeItem:B,clearCart:V,openCart:H,closeCart:G,increaseQty:U,decreaseQty:Q,categories:c3,setCategories:d3,products:m3,setProducts:u3,alternateVersion:p2,setAlternateVersion:b3,emptyStateTitle:v2,setEmptyStateTitle:x2,emptyStateSubtitle:y2,setEmptyStateSubtitle:w,emptyStateCTAText:E,setEmptyStateCTAText:S,emptyStateCTALink:_,setEmptyStateCTALink:N,emptyStateCTASubtext:k,setEmptyStateCTASubtext:T,subscriptionInfoDetails:C,setSubscriptionInfoDetails:A,subscriptionDisclosure:F,setSubscriptionDisclosure:L,termsURL:j,setTermsURL:O}})(),t2=(0,n.useRef)(!1),[a2,i2]=(0,n.useState)(!1);(0,n.useEffect)((()=>{e2.getCart()}),[]),(0,n.useEffect)((()=>{t2.current&&(window._uxa=window._uxa||[],e2.cartOpen?window._uxa.push(["setQuery","cart-drawer-open"]):window._uxa.push(["setQuery","cart-drawer-closed"]),window._uxa.push(["trackPageview"])),t2.current=!0}),[e2.cartOpen]);const r2={missingAmount:(()=>{let t3=0;return e2.items.find((e3=>e3.selling_plan_allocation))?0:(e2.items.forEach((e3=>{e3.product.tags.includes("no-free-shipping")||(t3+=e3.quantity*(e3.final_price/100))})),50-t3)})(),amountNeeded:50},l2=e2.items.reduce(((e3,t3)=>e3+t3.quantity),0),s2=e2.items.reduce(((e3,t3)=>e3+t3.final_line_price/100),0),o2=e2.items.reduce(((e3,t3)=>{let a3=0;return t3.selling_plan_allocation?a3=(t3.selling_plan_allocation.compare_at_price-t3.selling_plan_allocation.price)*t3.quantity:t3.compare_at_price&&t3.compare_at_price>t3.price&&(a3=(t3.compare_at_price-t3.price)*t3.quantity),e3+a3/100}),e2.totalDiscount),c2=()=>{window.mobileMenuOpen||(window.cartManager.cartOpen?document.getElementsByTagName("body")[0].style.overflow="hidden":document.getElementsByTagName("body")[0].style.overflow="auto")};(0,n.useEffect)((()=>{a2||(()=>{const e3=setInterval((()=>{const t3=document.querySelector(".swiper-cart-drawer-suggested-products");typeof window<"u"&&window.Swiper!==void 0&&t3&&(clearInterval(e3),new window.Swiper(".swiper-cart-drawer-suggested-products",{slidesPerView:"auto",spaceBetween:12,freeMode:!0,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}}),i2(!0))}),500)})()}),[]),(0,n.useEffect)((()=>(window.addEventListener("resize",c2),()=>{window.removeEventListener("resize",c2)})),[]),(0,n.useEffect)((()=>{c2()}),[e2.cartOpen]);const d2=vitalData.recommendedIntervals||{variants:{}},m2=window.isDesignMode&&window.cartDrawerDesignModeVisible,u2={colorScheme:window.cart_featured_banner_color_scheme,image:window.cart_featured_banner_image,enabled:window.cart_featured_banner_enabled,title:window.cart_featured_banner_title,titleFont:window.cart_featured_banner_title_font,CTAText:window.cart_featured_banner_cta_text,CTATextFont:window.cart_featured_banner_cta_text_font,CTAAction:window.cart_featured_banner_cta_action,product:window.cart_featured_banner_cta_product,link:window.cart_featured_banner_cta_link,backgroundSize:window.cart_featured_banner_background_size},b2=window.location.hash.includes("#show_cart");return(0,n.useEffect)((()=>{b2&&!e2.isLoading&&e2.openCart()}),[e2.isLoading]),n.createElement(v,{value:e2},n.createElement(p,{resizeImage:(e3,t3)=>{const a3=e3.split("."),n2=a3.pop(),i3=a3.join(".");let r3="_";return t3.width&&(r3+=t3.width),t3.width&&!t3.height&&(r3+="x"),t3.height&&(r3+="x"+t3.height),`${i3}${r3}.${n2}`},addBundleToCart:t3=>{window._uxa.push(["ec:cart:add",{sku:t3.variants[0].sku}]);const a3={items:[{quantity:1,id:t3.variants[0].id.toString(),properties:{}}]};e2.addItem(a3)},cartTotal:s2,totalSavings:o2,removeSubscriptionState:(t3,a3)=>{window._uxa.push(["setQuery","cart-drawer-remove-subscription"]),window._uxa.push(["trackPageview"]),e2.removeSubscription(t3,a3)},onChangeSubscriptionFrequency:(t3,a3,n2)=>{window._uxa.push(["setQuery","cart-drawer-add-subscription"]),window._uxa.push(["trackPageview"]),e2.changeItem(t3,a3,n2)},cartQuantity:l2,closeCart:e2.closeCart,isOpen:m2||e2.cartOpen,shippingWidgetInfo:r2,recommendedIntervals:d2,termsURL:e2.termsURL,subscriptionDisclosure:e2.subscriptionDisclosure,featuredBannerData:u2}))}const y=document.getElementById("cart-drawer-container");y&&i.render(n.createElement(x,null),y)},8153:function(){customElements.get("product-card-2022")||customElements.define("product-card-2022",class extends HTMLElement{get title(){return this.getAttribute("title")}get id(){return this.getAttribute("id")}get productId(){return this.getAttribute("productId")}get image(){return this.getAttribute("image")}get price(){return this.getAttribute("price")}get url(){return this.getAttribute("url")}get tags(){return this.getAttribute("tags")}
5get available(){return this.getAttribute("available")}static get observedAttributes(){return["id","tags","title","image","price","url","available"]}constructor(){super(),this.div=document.createElement("div"),this.div.className="tailwind",document.readyState==="loading"?document.addEventListener("DOMContentLoaded",(()=>this.initializeTemplate())):this.initializeTemplate()}initializeTemplate(){let e=document.getElementById("product-card-2022-template");if(!e)return void console.error("product-card-2022-template not found in DOM");let t=e.content.cloneNode(!0);this.div.append(t),this.render()}connectedCallback(){this.render()}attributeChangedCallback(e,t,a){this.render()}render(){if(!this.div.children||this.div.children.length===0)return void console.warn("ProductCard2022 template not loaded yet, skipping render");const e=window.document.querySelectorAll(`product-card-2022[id="${this.id}"]`);e.length>0&&(e[0].innerHTML="");const t=this.div.querySelectorAll(".product-card-2022")[0];if(!t)return void console.error("Product card element not found in template");t.id=this.id;let a=".jpg";this.image.indexOf(a)===-1&&(a=".png");const n=this.image.split(a);t.querySelectorAll("#product-card-2022-image")[0].src=n[0]+"_x400"+a+n[1];const i=this.title.split("-");if(t.querySelectorAll("#product-card-2022-title1")[0].innerHTML=i[0].trim().slice(0,35),i.length>1&&(t.querySelectorAll("#product-card-2022-title2")[0].innerHTML=i[1].trim()),t.querySelectorAll("#product-card-2022-price")[0].innerHTML="$"+this.price,t.querySelectorAll("#product-card-2022-ratings")[0].dataset.bvProductId=this.productId,t.querySelectorAll("#product-card-2022-ratings")[0].dataset.bvRedirectUrl=this.url,t.querySelectorAll("#product-card-2022-new-label")[0].classList.add("hidden"),t.querySelectorAll("#product-card-2022-onsale-label")[0].classList.add("hidden"),t.querySelectorAll("#product-card-2022-seasonal-label")[0].classList.add("hidden"),t.querySelectorAll("#product-card-2022-bestseller-label")[0].classList.add("hidden"),this.tags){if(this.tags.toLowerCase().indexOf("bestseller")>-1)t.querySelectorAll("#product-card-2022-bestseller-label")[0].classList.remove("hidden");else if(this.tags.toLowerCase().indexOf("onsale")>-1||this.tags.toLowerCase().indexOf("onslae")>-1||this.tags.toLowerCase().indexOf("sale")>-1){const e2=t.querySelectorAll("#product-card-2022-onsale-label")[0];e2.classList.remove("hidden"),e2.style.color="#FFF"}else if(this.tags.toLowerCase().indexOf("seasonal")>-1||this.tags.toLowerCase().indexOf("limited time")>-1){const e2=t.querySelectorAll("#product-card-2022-seasonal-label")[0];e2.classList.remove("hidden"),e2.style.color="#FFF"}else if(this.tags.toLowerCase().indexOf("new")>-1){const e2=t.querySelectorAll("#product-card-2022-new-label")[0];e2.classList.remove("hidden"),e2.style.color="#FFF"}}const r=t.querySelector(".cta-label"),l=t.querySelector("a.cta-link")||t.closest("a");r?(r.classList.remove("cta-default"),r.classList.add("cta-disabled"),r.innerHTML="Sold Out",l&&l.removeAttribute("href"),this.available==="true"&&(l&&(l.href=this.url),r.classList.remove("cta-disabled"),r.classList.add("cta-default"),r.innerHTML="View Product"),e.length>0&&e[0].append(this.div)):console.error("CTA label element not found in template")}})}},function(e){e.O(0,[935,710],(function(){return e(e.s=9226)})),e.O()}]); 6//# sourceMappingURL=/cdn/shop/t/1633/assets/cart-drawer.js.map?v=98566905572913209771790784455
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.