"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[26],{301:(e,t,a)=>{a.d(t,{a:()=>i});const i=(e,t)=>parseFloat((e-e*(t/100)).toFixed(2))},200:(e,t,a)=>{function i(e){return e.replace(/[^a-zA-Z0-9]/g,"_")}function r(){"undefined"!=typeof window&&window.amzn&&window.amzn("trackEvent","PageView")}function n(e){if("undefined"!=typeof window&&window.amzn){const t=`Add_to_cart_${i(e)}`;window.amzn("trackEvent",t)}}function s(e){if("undefined"!=typeof window&&window.amzn){const t=`Product_View_${i(e)}`;window.amzn("trackEvent",t)}}function o(e){if("undefined"!=typeof window&&window.amzn){const t=`Collection_${i(e)}`;window.amzn("trackEvent",t)}}a.d(t,{a:()=>n,b:()=>o,c:()=>r,d:()=>s})},186:(e,t,a)=>{a.d(t,{a:()=>n});var i=a(4);const r={hanger:(0,i.A)(),"tshirt-pants":(0,i.$)()},n=e=>r[e]},187:(e,t,a)=>{a.d(t,{a:()=>ae});var i=a(1),r=a(0),n=a(8),s=a(352),o=a(93),l=a(101),c=a(188);const{wrapper:d,wrapperBadge:u,wrapperImage:p}=c.a,v=({imageMap:e,currentColor:t,alt:a,productLink:i,isDesktopDevice:n,selectedSize:s})=>{const o=["1X","2X","3X","4X","5X","6X","7X","8X","9X","10X"].includes(s)?`${t} Plus`:t;return(0,r.jsx)("div",Object.assign({className:d},{children:(0,r.jsxs)("div",Object.assign({className:p},{children:[i&&(0,r.jsx)("a",Object.assign({href:i,target:n?"_blank":"_self",className:u},{children:"View product details"})),(0,r.jsx)("img",{src:e[o]||e[t],alt:a})]}))}))};var m=a(301),f=a(189);const{wrapper:w,wrapperActualPrice:h,wrapperComparePrice:j,wrapperCrossedPrice:b,wrapperActualPriceRed:S,wrapperPercentage:x}=f.a,g=({currentVariant:e,currency:t="$",discountValue:a=0})=>{var i;if(!e)return(0,r.jsx)(r.Fragment,{});const n=(0,m.a)(Number(e.priceV2.amount),a).toFixed(2),o=(null===(i=e.compareAtPrice)||void 0===i?void 0:i.amount)||e.priceV2.amount,l=Number(o)>Number(n),c=((e,t)=>{if(e<=0||t<0||t>e)throw new Error("Invalid price values");return(e-t)/e*100})(Number(o),Number(n)),d=c>15;return(0,r.jsxs)("div",Object.assign({className:w},{children:[l&&(0,r.jsx)("p",Object.assign({className:(0,s.a)(j,b)},{children:`${t}${o}`})),(0,r.jsx)("p",Object.assign({className:(0,s.a)(h,l&&S)},{children:`${t}${n}`})),d&&(0,r.jsx)("p",Object.assign({className:x},{children:`(${c.toFixed(0)}% off)`}))]}))};var O=a(2),C=a(190);const{wrapper:M,wrapperTitle:P,wrapperDetails:z,wrapperSize:N,wrapperColor:k,wrapperParagraph:y}=C.a,D=({title:e,imageMap:t,options:a,variants:i,colors:n,handle:s,isMainProduct:c,mainProductCurrentVariant:d,outfitDiscount:u,vendor:p,id:m,handleSelectProduct:f,isDesktopDevice:w,handleSoldOutMissyAndPlus:h})=>{var j,b;const S=(null===(j=a[1])||void 0===j?void 0:j.values)||[],{selectedColor:x,selectedSize:C,selectedVariant:D,excludedSizes:V,availableSizes:A,handleColorChange:$,createProductLink:B,ref:_,setSelectedSize:E,isOutfit:T}=(({variants:e,handle:t,title:a,vendor:i,id:r,isMainProduct:n,mainProductCurrentVariant:s,handleSelectProduct:o,outfitDiscount:l,allSizes:c,handleSoldOutMissyAndPlus:d})=>{var u,p;const v=e.find((e=>e.availableForSale)),m=null!==(u=null==v?void 0:v.optionMap.Size)&&void 0!==u?u:"",f=null!==(p=null==v?void 0:v.optionMap.Color)&&void 0!==p?p:"",[w,h]=(0,O.useState)(n&&s?s.optionMap.Color||"":f),[j,b]=(0,O.useState)(n&&s?s.optionMap.Size||"":m),S=(0,O.useCallback)(((e,t)=>t?`/products/${e}?variant=${t}`:`/products/${e}`),[]),x=(0,O.useRef)(null),g=(0,O.useMemo)((()=>{var n;const s=e.find((e=>e.optionMap.Color===w&&e.optionMap.Size===j));return s?(d&&d(!1),Object.assign(Object.assign({},s),{title:(null==s?void 0:s.title)||a,vendor:i,url:S(t,s.id),productId:r,outfitDiscount:null!==(n=null==s?void 0:s.outfitDiscount)&&void 0!==n?n:l})):(d&&d(!0),x.current)}),[w,j,e,a,i,t,r,S]);(0,O.useEffect)((()=>{g&&(x.current=g)}),[null==g?void 0:g.id]);const{availableSizes:C,excludedSizes:M}=(0,O.useMemo)((()=>{const t=e.filter((e=>e.optionMap.Color===w)),a=new Set(c),i=[];return t.forEach((({optionMap:e,availableForSale:t})=>{const r=e.Size;r&&(a.add(r),t||i.push(r))})),{availableSizes:Array.from(a),excludedSizes:i}}),[w,e]),P=(0,O.useCallback)((e=>{h(e.target.value)}),[]);return(0,O.useEffect)((()=>{g&&o(g)}),[null==g?void 0:g.id]),{selectedColor:w,selectedSize:j,selectedVariant:g,excludedSizes:M,availableSizes:C,handleColorChange:P,createProductLink:S,ref:(0,O.useRef)(null),setSelectedSize:b,isOutfit:!0}})({variants:i,handle:s,title:e,vendor:p,id:m,isMainProduct:c,mainProductCurrentVariant:d,handleSelectProduct:f,outfitDiscount:u,allSizes:S,handleSoldOutMissyAndPlus:h}),F=(0,O.useMemo)((()=>{const e=i.filter((e=>e.optionMap.Color===x));return S.filter((t=>!e.some((e=>e.optionMap.Size===t))))}),[x,i]);return(0,r.jsxs)("div",Object.assign({className:M},{children:[(0,r.jsx)(v,{imageMap:t,currentColor:x,alt:e,productLink:c?"":B(s,null==D?void 0:D.id),isDesktopDevice:w,selectedSize:C}),(0,r.jsxs)("div",Object.assign({className:z},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",Object.assign({className:P},{children:(null==D?void 0:D.title)||e})),(0,r.jsx)(g,{currentVariant:D,discountValue:null!==(b=null==D?void 0:D.outfitDiscount)&&void 0!==b?b:u})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",Object.assign({className:k},{children:[(0,r.jsx)("p",Object.assign({className:y},{children:"Color:"})),(0,r.jsx)(o.a,{colors:n,variants:i,currentVariant:null!=D?D:{availableForSale:!1,compareAtPrice:{amount:"",currencyCode:"USD"},id:"",optionMap:{Color:"",Size:""},priceCurrency:"USD",priceV2:{amount:"",currencyCode:"USD"},quantityAvailable:0,sku:""},currentColor:x,ref:_,onChangeHandler:$,currency:"$",isOutfit:T})]})),(0,r.jsxs)("div",Object.assign({className:N},{children:[(0,r.jsx)("p",Object.assign({className:y},{children:"Size:"})),A.map(((t,a)=>(0,r.jsx)(l.a,{actualSize:C,setCurrentVariantBySize:e=>E(e),unavailableSizes:[...V,...F],sizeLabel:t,isOutfit:T,sizesNotExistInCurrentVariant:F},t+e+a)))]}))]})]}))]}))};var V=a(4),A=a(191);const{wrapper:$,wrapperIcon:B,wrapperTitle:_,wrapperTitleNoModal:E}=A.a,T=({handleShowOutfit:e,discountTitle:t,noModal:a=!1})=>(0,r.jsxs)("div",Object.assign({className:$},{children:[!a&&(0,r.jsx)("div",Object.assign({onClick:e,className:B},{children:(0,r.jsx)(V.m,{})})),t&&(0,r.jsx)("h1",Object.assign({className:(0,s.a)(_,a&&E)},{children:t}))]}));var F=a(192);const{wrapper:I,wrapperButton:X,spinner:L,spinnerPath:R,btnBusy:U,wrapperButtonNoModal:q,wrapperNoModal:W,wrapperButtonNoModalMarginBottom:H}=F.a,Y=({totalPriceWithDiscount:e,addToCartOutfit:t,selectedProduct:a,isDisabledAddToCartButton:i,isBusy:n,handleShowOutfit:o,noModal:l=!1,isSoldOutMissyAndPlus:c=!1})=>{const d=()=>{const e=(new Date).getTime();return a.map((t=>({id:t.id,quantity:1,properties:{_outfitId:e},image:"",product_title:t.title,variant_title:"",variant_id:Number(t.id),price:100*Number(t.priceV2.amount),final_price:100*Number(t.priceV2.amount),url:t.url,vendor:t.vendor,sku:t.sku})))},u=e>0,p=i||c;return(0,r.jsx)("div",Object.assign({class:(0,s.a)(I,l&&W)},{children:(0,r.jsxs)("button",Object.assign({disabled:p,onClick:()=>t({items:d()},o),className:(0,s.a)(X,l&&q,H)},{children:["Add outfit to cart "+(u?`(${e.toFixed(2)})`:""),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",Object.assign({className:L,viewBox:"0 0 50 50"},{children:(0,r.jsx)("circle",{className:(0,s.a)(R),cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})})),(0,r.jsx)("span",{className:U})]})]}))}))};var Z=a(193);const{wrapper:G,overlay:J,overlayActive:K,wrapperOpen:Q,wrapperOutfitProducts:ee,wrapperRelative:te}=Z.a,ae=({outfitsProducts:e,handleShowOutfit:t,showOutfit:a,mainProductId:o,currentVariant:l,addToCartOutfit:c,isMobile:d,isBusy:u,pdpButtonText:p,isDesktopDevice:v,discountTitle:m,noModal:f=!1})=>{(0,n.a)(a);const{top:w}=((e,t)=>{const[a,i]=(0,O.useState)(0),r=(0,O.useMemo)((()=>140),[]),n=(0,O.useMemo)((()=>0),[]),s=(0,O.useCallback)((()=>{if(t)return;const a=window.scrollY;if(0===a)return void i(e?n:r);if(e)return void(a>n&&i("auto"));const s=Math.max(0,r-a);i(s)}),[e,r,n]);return(0,O.useEffect)((()=>(window.addEventListener("scroll",s),s(),()=>{window.removeEventListener("scroll",s)})),[s]),{top:a}})(d,a),[h,j]=(0,O.useState)([]),[b,S]=(0,O.useState)(!1),x=e=>{S(e)},g=e=>{if(!e.availableForSale)return void j(h.filter((t=>t.productId!==e.productId)));const t=h.findIndex((t=>t.productId===e.productId));if(-1===t)return void j((t=>[...t,e]));const a=[...h];a[t]=e,j(a)},C=!(e.length===h.length)||u,M=h.reduce(((e,t)=>{const a=t.priceV2.amount,i=t.outfitDiscount;return e+((r=Number(a))-r*i/100);var r}),0);return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("div",{className:(0,s.a)(J,a&&!f&&K),onClick:t}),(0,r.jsxs)("div",Object.assign({style:{top:w},className:(0,s.a)(G,a&&Q,f&&te)},{children:[(0,r.jsx)(T,{handleShowOutfit:t,discountTitle:m,noModal:f}),(0,r.jsx)("div",Object.assign({className:ee},{children:e.map(((e,t)=>(0,i.createElement)(D,Object.assign({},e,{key:e.title,isMainProduct:e.id===o,mainProductCurrentVariant:l,handleSelectProduct:g,isDesktopDevice:v,handleSoldOutMissyAndPlus:x}))))})),(0,r.jsx)(Y,{selectedProduct:h,totalPriceWithDiscount:M,addToCartOutfit:c,isDisabledAddToCartButton:C,isBusy:u,handleShowOutfit:t,noModal:f,isSoldOutMissyAndPlus:b})]}))]})}}}]);