"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[19],{53:(e,t,r)=>{r.d(t,{a:()=>L});var a=r(0),i=r(24),n=r(2),o=r(5),s=r(104),l=r(3),c=r(45),d=r(28),u=r(29),p=r(37),h=r(4),m=r(39),g=r(71),x=r(6);function f({disruptor:e}){return"bite_disruptor"===e.type?(0,a.jsx)(v,{disruptor:e}):(0,a.jsx)(b,{disruptor:e})}function v({disruptor:e}){return e.biteHtml?(0,a.jsx)("div",{style:{display:"grid"},dangerouslySetInnerHTML:{__html:e.biteHtml}}):(0,a.jsx)(h.Fragment,{})}function b({disruptor:e}){var t;return(0,a.jsxs)("div",{class:m.a.card,style:{color:e.text_color},children:[(0,a.jsx)(j,{media:e.media}),(0,a.jsx)("div",{class:m.a.title,dangerouslySetInnerHTML:{__html:e.title}}),(0,a.jsx)("div",{class:m.a.body,dangerouslySetInnerHTML:{__html:null!==(t=e.body_text)&&void 0!==t?t:""}}),(0,a.jsx)(P,{disruptor:e})]})}function j({media:e}){var t,r;return"image"===e.type&&e.url?(0,a.jsx)(o.a,{src:(0,x.b)(e.url),alt:null!==(t=e.altText)&&void 0!==t?t:"",initialWidth:null!==(r=e.width)&&void 0!==r?r:400,cssClass:m.a.media}):"video"===e.type&&e.sources.length>0?(0,a.jsx)("div",{class:m.a.media,children:(0,a.jsx)(g.a,{sources:e.sources,className:m.a.mediaVideo})}):(0,a.jsx)(h.Fragment,{})}const y={primary:m.a.cta_primary,secondary:m.a.cta_secondary,tertiary:m.a.cta_tertiary};function P({disruptor:e}){var t;if(!e.cta_url||!e.cta_label||!e.cta_style)return(0,a.jsx)(h.Fragment,{});const r=null!==(t=y[e.cta_style])&&void 0!==t?t:m.a.cta_primary;return(0,a.jsx)("a",{href:e.cta_url,class:`${m.a.cta} ${r}`,children:e.cta_label})}var _=r(108),C=r(109),S=r(128),O=r(101),w=r(38),I=r(41),N=r(110),T=r(54),k=r(44),A=r(27),V=r(7);function B({isOpen:e,onClose:t,title:r,products:i,buttonMessage:o,addToCartProperties:s,initialVariantId:l}){const[c,d]=(0,n.useState)(0),u=(0,n.useRef)(null),p=(0,n.useRef)(null),h=(0,n.useMemo)((()=>i.filter(V.c)),[i]),m=()=>{const e=u.current,t=p.current;if(!e||!t)return;const r=e.scrollLeft/(e.scrollWidth-e.clientWidth);t.style.setProperty("--scroll-progress",r.toString())},g=()=>{const e=u.current;if(!e)return;m();const t=e.getBoundingClientRect(),r=Array.from(e.children),a=r[r.length-1];if(!a)return;const i=a.getBoundingClientRect().right-t.right<45;let n=1/0;r.forEach(((e,r)=>{const a=e.getBoundingClientRect();if(i&&a.left<0)return;const o=Math.abs(a.left-t.left)+(a.left<0?20:0);o{const e=u.current;if(e)return e.addEventListener("scroll",g),m(),()=>{e.removeEventListener("scroll",g)}}),[u.current,h.length]),0===h.length)return null;const x=1===h.length;return(0,a.jsx)(I.a,{isOpen:e,onClose:t,variant:"bottomSheet",title:r,size:"large",children:(0,a.jsxs)("div",{className:A.a.modalContent,"data-single-product":x,children:[(0,a.jsx)("button",{type:"button",className:A.a.closeButton,onClick:t,"aria-label":"Close modal",children:(0,a.jsx)(k.a,{size:"20px",iconClass:A.a.closeIcon})}),(0,a.jsxs)("div",{className:A.a.sliderContainer,ref:p,children:[h.length>1&&(0,a.jsx)(T.a,{direction:"left",onClick:()=>{const e=u.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:-t,behavior:"smooth"})},className:A.a.arrowLeft,ariaLabel:"Previous products"}),(0,a.jsx)("div",{className:A.a.productsSlider,ref:u,"data-slider":"true","data-single-product":x,children:h.map((e=>(0,a.jsx)(N.a,{product:e,onClose:t,buttonMessage:o,addToCartProperties:s,initialVariantId:l},e.handle)))}),h.length>1&&(0,a.jsx)(T.a,{direction:"right",onClick:()=>{const e=u.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:t,behavior:"smooth"})},className:A.a.arrowRight,ariaLabel:"Next products"})]}),h.length>1&&(0,a.jsx)("div",{className:A.a.sliderDots,children:h.map(((e,t)=>(0,a.jsx)("button",{type:"button",className:[A.a.dot,t===c&&A.a.dotActive].join(" "),onClick:()=>(e=>{const t=u.current;if(!t)return;const r=Array.from(t.children)[e];r&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})})(t),"aria-label":`Go to product ${t+1}`},t)))})]})})}const H=300;function L({product:e,collectionHandle:t,replaceStateEnabled:r,initialVariantId:i,showSelectedOptions:n}){return(null==e?void 0:e.handle)?!("type"in(o=e))||"disruptor"!==o.type&&"bite_disruptor"!==o.type?(0,a.jsx)(M,{product:e,collectionHandle:t,replaceStateEnabled:r,initialVariantId:i,showSelectedOptions:n}):(0,a.jsx)(f,{disruptor:e}):null;var o}function M({product:e,collectionHandle:t,replaceStateEnabled:r,initialVariantId:h,showSelectedOptions:m}){var g;const{getHexForOptionColor:x,findProductVariantWithOption:f,EXCLUDE_TAGS:v,promo_prefix_tag:b,product_image_height:j,product_image_width:y,disable_color_swatches:P,showVendor:S,cardPriceDisplay:I,soldOutBadgeText:N,onSaleBadgeText:T,quickshopButton:k}=(0,l.c)((e=>({getHexForOptionColor:e.getHexForOptionColor,findProductVariantWithOption:e.findProductVariantWithOption,EXCLUDE_TAGS:e.config.exclude_tags,promo_prefix_tag:e.config.promo_prefix_tag,product_image_width:e.config.product_image_width,product_image_height:e.config.product_image_height,disable_color_swatches:e.config.disable_color_swatches,showVendor:e.showVendor,cardPriceDisplay:e.cardPriceDisplay,soldOutBadgeText:e.soldOutBadgeText,onSaleBadgeText:e.onSaleBadgeText,quickshopButton:e.quickshopButton}))),[A,V]=(0,n.useState)(!1),L=!0===e.isPack,M=k&&"disabled"!==k&&!L,E=e.options.find((e=>"Color"===e.name)),{pricePrefix:F,priceText:$,showCompareAtPrice:q,onSaleDataAttribute:z,compareAtPriceText:U,priceClassName:G,ssrStyle:K}=function(e,t){var r;const{country:a,internationalPricing:i}=(0,l.c)((e=>({country:e.country,internationalPricing:e.internationalPricing}))),o="US"===a||!i,s=(0,n.useMemo)((()=>{const t=[e.handle];if(e.preorderSiblingHandle&&t.push(e.preorderSiblingHandle),e.combinedKey){const r=e.variants.map((e=>{var t;return null===(t=e.selectedOptions)||void 0===t?void 0:t.childProductHandle})).filter((e=>!!e));t.push(...r)}return[...new Set(t)]}),[e.handle,e.preorderSiblingHandle,e.combinedKey,e.variants]),{data:c,classNamesByHandle:d,ssrStylesByHandle:u}=(0,O.a)(s),p=(null===(r=c[s[0]])||void 0===r?void 0:r.currency)||"USD",h=(0,w.b)({currency:p});return(0,n.useMemo)((()=>e.priceTextOverride?{priceText:e.priceTextOverride,pricePrefix:"",showCompareAtPrice:!1,onSaleDataAttribute:{},compareAtPriceText:void 0,priceClassName:d[e.handle]||"",ssrStyle:u[e.handle]}:o?function(e,t,r){const{minPrice:a,maxPrice:i}=D(e),n=W(a,i,e.compareAtRange.maxPrice,t,r);return Object.assign(Object.assign({},n),{priceClassName:"",ssrStyle:void 0})}(e,t,h):function(e,t,r,a,i,n,o){var s,l,c,d;const u=null!==(s=e.priceRange.variantIds)&&void 0!==s?s:[],p=[],h=[],m=[];for(const e of a){const t=null!==(c=null===(l=r[e])||void 0===l?void 0:l.variants)&&void 0!==c?c:[];for(const e of t)null!=e.price.amount&&h.push(e.price.amount),null!=(null===(d=e.compareAtPrice)||void 0===d?void 0:d.amount)&&m.push(e.compareAtPrice.amount),u.includes(e.id)&&null!=e.price.amount&&p.push(e.price.amount)}const g=p.length>0?p:h;if(0===g.length){const{minPrice:r,maxPrice:a}=D(e),s=W(r,a,e.compareAtRange.maxPrice,t,i);return Object.assign(Object.assign({},s),{priceClassName:n[e.handle]||"",ssrStyle:o[e.handle]})}const x=W(Math.min(...g),Math.max(...g),m.length>0?Math.max(...m):void 0,t,i);return Object.assign(Object.assign({},x),{priceClassName:n[e.handle]||"",ssrStyle:o[e.handle]})}(e,t,c,s,h,d,u)),[o,e,t,c,s,h,d,u])}(e,I),X=null!=h?h:e.defaultVariantId,Q=e.variants.find((e=>e.variantId===X)),[J,Y]=(0,n.useState)(null!=Q?Q:e.variants[0]),Z=(0,d.a)(e.imageMap,J)[0],ee=(0,p.b)(e,J);if(!Z)return null;const te=(0,n.useMemo)((()=>{var t,r,a;return v&&(null==v?void 0:v.length)>0?null!==(t=J.badge)&&void 0!==t?t:e.badge:J.oos&&!J.preorderVariant?N||null:J.compareAtPrice&&parseFloat(J.price){r&&(e.preventDefault(),location.replace(ee))},class:i.a.link,"data-orly-type":t,"data-orly-handle":e.handle,children:[(0,a.jsxs)("div",{className:i.a.heroImageContainer,children:[te&&(0,a.jsx)("div",{class:i.a.bestSeller,"data-badge":te,children:te}),(0,a.jsx)(o.a,{src:Z.src,initialWidth:H,cssClass:i.a.heroImage,alt:`${re}: ${Z.model}`,height:j,width:y,fullSizeWidth:ne}),M&&(0,a.jsx)(R,{mode:k,onClick:e=>{e.preventDefault(),e.stopPropagation(),V(!0)}})]}),(0,a.jsxs)("div",{class:i.a.textWrapper,children:[S&&(0,a.jsx)("div",{class:i.a.vendor,children:e.vendor}),m&&J.selectedOptions&&(0,a.jsx)("span",{class:i.a.selectedOptions,children:Object.entries(J.selectedOptions).filter((([e])=>"childProductHandle"!==e)).map((([,e])=>e)).join(" | ")}),(0,a.jsx)("div",{class:i.a.title,children:ae}),ie&&(0,a.jsx)("div",{class:i.a.subtitle,children:ie}),(0,a.jsx)("div",{class:i.a.price,children:(0,a.jsx)("span",{class:G,style:K,children:(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{class:i.a.originalPrice,style:q&&U?void 0:"visibility:hidden",children:U})," ",F,(0,a.jsx)("span",Object.assign({},z,{style:i.a.productCardPrice,children:$}))]})})}),(0,a.jsx)(C.a,{reviewCount:e.reviewCount,reviewRating:e.reviewRating}),b&&e.plpPromoText&&(0,a.jsx)("div",{class:i.a.plpPromoText,children:e.plpPromoText})]})]}),(0,a.jsx)("div",{class:i.a.colorSwatchContainer,children:!P&&E&&(0,a.jsx)(c.a,{product:e,small:!0,maxItems:12,hideLabel:!0,option:E,getHexForOptionColor:x,selectedVariant:J,findProductVariantWithOption:t=>f(t,e,Q),setSelectedVariantId:t=>{const r=e.variants.find((e=>e.variantId===t));r&&Y(r)}})}),M&&(0,a.jsx)(B,{isOpen:A,onClose:()=>V(!1),products:[e],initialVariantId:J.variantId})]})}function R({mode:e,onClick:t}){return"cartButton"===e?(0,a.jsx)("button",{type:"button",className:i.a.quickshopIconButton,onClick:t,"aria-label":"Quick add to cart",children:(0,a.jsx)("div",{className:i.a.quickshopIcon})}):(0,a.jsx)("button",{type:"button",className:i.a.quickshopOverlay,onClick:t,"aria-label":e,children:e})}function W(e,t,r,a,i){const n=null!=t&&e!==t,o="range"===a&&n,s=o?"":n?"From ":"",l=o?`${i(e)} – ${i(t)}`:i(e),c=null!=r&&r>e,d=(0,S.a)(c);let u;return c&&null!=r&&(u=i(r)),{pricePrefix:s,priceText:l,showCompareAtPrice:c,onSaleDataAttribute:d,compareAtPriceText:u}}function D(e){let{minPrice:t,maxPrice:r}=e.priceRange;if(null==t||Number.isNaN(t)){const a=e.variants.find((t=>t.variantId===e.defaultVariantId));a&&(t=parseFloat(a.price),r=t)}return{minPrice:t,maxPrice:r}}},71:(e,t,r)=>{r.d(t,{a:()=>n});var a=r(0),i=r(2);function n({sources:e,className:t,preload:r="metadata"}){const n=(0,i.useRef)(null);return(0,i.useEffect)((()=>{n.current&&n.current.load()}),[e]),(0,a.jsx)("video",{ref:n,class:t,preload:r,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,children:e.map((e=>(0,a.jsx)("source",{src:e.url,type:e.mimeType,width:e.width,height:e.height},e.url)))})}},108:(e,t,r)=>{r.d(t,{a:()=>n});var a=r(2),i=r(7);function n(){const e=(0,i.h)("maxFullSizeWidth","1200","300")();return(0,a.useMemo)((()=>{if(!e)return 1200;try{const t=parseInt(e);if(Number.isNaN(t))return;return t}catch(e){return}}),[e])}}}]);