"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[26],{301:(e,t,i)=>{i.d(t,{a:()=>a});const a=(e,t)=>parseFloat((e-e*(t/100)).toFixed(2))},200:(e,t,i)=>{function a(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_${a(e)}`;window.amzn("trackEvent",t)}}function s(e){if("undefined"!=typeof window&&window.amzn){const t=`Product_View_${a(e)}`;window.amzn("trackEvent",t)}}function o(e){if("undefined"!=typeof window&&window.amzn){const t=`Collection_${a(e)}`;window.amzn("trackEvent",t)}}i.d(t,{a:()=>n,b:()=>o,c:()=>r,d:()=>s})},186:(e,t,i)=>{i.d(t,{a:()=>n});var a=i(4);const r={hanger:(0,a.A)(),"tshirt-pants":(0,a.$)()},n=e=>r[e]},187:(e,t,i)=>{i.d(t,{a:()=>oe});var a=i(1),r=i(0),n=i(8),s=i(352),o=i(79),c=i(88),l=i(188);const{wrapper:d,wrapperBadge:u,wrapperImage:p}=l.a,v=({imageMap:e,currentColor:t,alt:i,productLink:a,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:[a&&(0,r.jsx)("a",Object.assign({href:a,target:n?"_blank":"_self",className:u},{children:"View product details"})),(0,r.jsx)("img",{src:e[o]||e[t],alt:i})]}))}))};var m=i(301),h=i(189);const{wrapper:f,wrapperActualPrice:w,wrapperComparePrice:j,wrapperCrossedPrice:b,wrapperActualPriceRed:g,wrapperPercentage:S}=h.a,x=({currentVariant:e,currency:t="$",discountValue:i=0})=>{var a;if(!e)return(0,r.jsx)(r.Fragment,{});const n=(0,m.a)(Number(e.priceV2.amount),i).toFixed(2),o=(null===(a=e.compareAtPrice)||void 0===a?void 0:a.amount)||e.priceV2.amount,c=Number(o)>Number(n),l=((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=l>15;return(0,r.jsxs)("div",Object.assign({className:f},{children:[c&&(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)(w,c&&g)},{children:`${t}${n}`})),d&&(0,r.jsx)("p",Object.assign({className:S},{children:`(${l.toFixed(0)}% off)`}))]}))};var O=i(2),C=i(190);const{wrapper:M,wrapperTitle:N,wrapperDetails:P,wrapperSize:z,wrapperColor:k,wrapperParagraph:y}=C.a,D=({title:e,imageMap:t,options:i,variants:a,colors:n,handle:s,isMainProduct:l,mainProductCurrentVariant:d,outfitDiscount:u,vendor:p,id:m,handleSelectProduct:h,isDesktopDevice:f,handleSoldOutMissyAndPlus:w})=>{var j,b;const g=(null===(j=i[1])||void 0===j?void 0:j.values)||[],{selectedColor:S,selectedSize:C,selectedVariant:D,excludedSizes:V,availableSizes:A,handleColorChange:$,createProductLink:B,ref:T,setSelectedSize:_,isOutfit:E}=(({variants:e,handle:t,title:i,vendor:a,id:r,isMainProduct:n,mainProductCurrentVariant:s,handleSelectProduct:o,outfitDiscount:c,allSizes:l,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:"",h=null!==(p=null==v?void 0:v.optionMap.Color)&&void 0!==p?p:"",[f,w]=(0,O.useState)(n&&s?s.optionMap.Color||"":h),[j,b]=(0,O.useState)(n&&s?s.optionMap.Size||"":m),g=(0,O.useCallback)(((e,t)=>t?`/products/${e}?variant=${t}`:`/products/${e}`),[]),S=(0,O.useRef)(null),x=(0,O.useMemo)((()=>{var n;const s=e.find((e=>e.optionMap.Color===f&&e.optionMap.Size===j));return s?(d&&d(!1),Object.assign(Object.assign({},s),{title:(null==s?void 0:s.title)||i,vendor:a,url:g(t,s.id),productId:r,outfitDiscount:null!==(n=null==s?void 0:s.outfitDiscount)&&void 0!==n?n:c})):(d&&d(!0),S.current)}),[f,j,e,i,a,t,r,g]);(0,O.useEffect)((()=>{x&&(S.current=x)}),[null==x?void 0:x.id]);const{availableSizes:C,excludedSizes:M}=(0,O.useMemo)((()=>{const t=e.filter((e=>e.optionMap.Color===f)),i=new Set(l),a=[];return t.forEach((({optionMap:e,availableForSale:t})=>{const r=e.Size;r&&(i.add(r),t||a.push(r))})),{availableSizes:Array.from(i),excludedSizes:a}}),[f,e]),N=(0,O.useCallback)((e=>{w(e.target.value)}),[]);return(0,O.useEffect)((()=>{x&&o(x)}),[null==x?void 0:x.id]),{selectedColor:f,selectedSize:j,selectedVariant:x,excludedSizes:M,availableSizes:C,handleColorChange:N,createProductLink:g,ref:(0,O.useRef)(null),setSelectedSize:b,isOutfit:!0}})({variants:a,handle:s,title:e,vendor:p,id:m,isMainProduct:l,mainProductCurrentVariant:d,handleSelectProduct:h,outfitDiscount:u,allSizes:g,handleSoldOutMissyAndPlus:w}),F=(0,O.useMemo)((()=>{const e=a.filter((e=>e.optionMap.Color===S));return g.filter((t=>!e.some((e=>e.optionMap.Size===t))))}),[S,a]);return(0,r.jsxs)("div",Object.assign({className:M},{children:[(0,r.jsx)(v,{imageMap:t,currentColor:S,alt:e,productLink:l?"":B(s,null==D?void 0:D.id),isDesktopDevice:f,selectedSize:C}),(0,r.jsxs)("div",Object.assign({className:P},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",Object.assign({className:N},{children:(null==D?void 0:D.title)||e})),(0,r.jsx)(x,{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:a,currentVariant:null!=D?D:{availableForSale:!1,compareAtPrice:{amount:"",currencyCode:"USD"},id:"",optionMap:{Color:"",Size:""},priceCurrency:"USD",priceV2:{amount:"",currencyCode:"USD"},quantityAvailable:0,sku:""},currentColor:S,ref:T,onChangeHandler:$,currency:"$",isOutfit:E})]})),(0,r.jsxs)("div",Object.assign({className:z},{children:[(0,r.jsx)("p",Object.assign({className:y},{children:"Size:"})),A.map(((t,i)=>(0,r.jsx)(c.a,{actualSize:C,setCurrentVariantBySize:e=>_(e),unavailableSizes:[...V,...F],sizeLabel:t,isOutfit:E,sizesNotExistInCurrentVariant:F},t+e+i)))]}))]})]}))]}))};var V=i(4),A=i(191);const{wrapper:$,wrapperIcon:B,wrapperTitle:T,wrapperTitleNoModal:_}=A.a,E=({handleShowOutfit:e,discountTitle:t,noModal:i=!1})=>(0,r.jsxs)("div",Object.assign({className:$},{children:[!i&&(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)(T,i&&_)},{children:t}))]}));var F=i(192);const{wrapper:I,wrapperButton:X,spinner:L,spinnerPath:R,btnBusy:q,wrapperButtonNoModal:U,wrapperNoModal:W,wrapperButtonNoModalMarginBottom:H,discountLabel:Y,priceOriginal:Z,priceDiscounted:G,priceWrapper:J,wrapperButtonMarginTop:K}=F.a,Q=({totalPriceWithDiscount:e,totalOriginalPrice:t,discountPercentage:i,addToCartOutfit:a,selectedProduct:n,isDisabledAddToCartButton:o,isBusy:c,handleShowOutfit:l,noModal:d=!1,isSoldOutMissyAndPlus:u=!1})=>{const p=()=>{const e=(new Date).getTime();return n.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})))},v=e>0,m=o||u,h=v&&i>0;return(0,r.jsxs)("div",Object.assign({class:(0,s.a)(I,d&&W)},{children:[h&&(0,r.jsx)("p",Object.assign({className:Y},{children:`${i}% Off Outfit Discount Applied`})),(0,r.jsxs)("button",Object.assign({disabled:m,onClick:()=>{a({items:p()},l),(0,s.b)("outfit:addToCartButton:clicked")},className:(0,s.a)(X,d&&U,H,h&&K)},{children:["Add Outfit to Cart —",v&&(0,r.jsxs)("span",Object.assign({className:J},{children:[(0,r.jsx)("s",Object.assign({className:Z},{children:`$${t.toFixed(2)}`})),(0,r.jsx)("span",Object.assign({className:G},{children:`$${e.toFixed(2)}`}))]})),c&&(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:q})]})]}))]}))};var ee=i(193);const{wrapper:te,overlay:ie,overlayActive:ae,wrapperOpen:re,wrapperOutfitProducts:ne,wrapperRelative:se}=ee.a,oe=({outfitsProducts:e,handleShowOutfit:t,showOutfit:i,mainProductId:o,currentVariant:c,addToCartOutfit:l,isMobile:d,isBusy:u,pdpButtonText:p,isDesktopDevice:v,discountTitle:m,noModal:h=!1})=>{(0,n.a)(i);const{top:f}=((e,t)=>{const[i,a]=(0,O.useState)(0),r=(0,O.useMemo)((()=>140),[]),n=(0,O.useMemo)((()=>0),[]),s=(0,O.useCallback)((()=>{const e=document.querySelector("header");return e?e.getBoundingClientRect().height:0}),[]),o=(0,O.useCallback)((()=>{if(t)return;const i=window.scrollY;if(0===i)return void a(e?n:r);if(e)return void(i>n&&a("auto"));const o=s(),c=Math.max(o,r-i);a(c)}),[e,r,n,s]);return(0,O.useEffect)((()=>(window.addEventListener("scroll",o),o(),()=>{window.removeEventListener("scroll",o)})),[o]),{top:i}})(d,i),[w,j]=(0,O.useState)([]),[b,g]=(0,O.useState)(!1),S=e=>{g(e)},x=e=>{if(!e.availableForSale)return void j(w.filter((t=>t.productId!==e.productId)));const t=w.findIndex((t=>t.productId===e.productId));if(-1===t)return void j((t=>[...t,e]));const i=[...w];i[t]=e,j(i)},C=!(e.length===w.length)||u,M=w.reduce(((e,t)=>{const i=t.priceV2.amount,a=t.outfitDiscount;return e+((r=Number(i))-r*a/100);var r}),0),N=w.reduce(((e,t)=>e+Number(t.priceV2.amount)),0),P=N>0?Math.round((N-M)/N*100):0;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:(0,s.a)(ie,i&&!h&&ae),onClick:t}),(0,r.jsxs)("div",Object.assign({style:{top:f},className:(0,s.a)(te,i&&re,h&&se)},{children:[(0,r.jsx)(E,{handleShowOutfit:t,discountTitle:m,noModal:h}),(0,r.jsx)("div",Object.assign({className:ne},{children:e.map(((e,t)=>(0,a.createElement)(D,Object.assign({},e,{key:e.title,isMainProduct:e.id===o,mainProductCurrentVariant:c,handleSelectProduct:x,isDesktopDevice:v,handleSoldOutMissyAndPlus:S}))))})),(0,r.jsx)(Q,{selectedProduct:w,totalPriceWithDiscount:M,totalOriginalPrice:N,discountPercentage:P,addToCartOutfit:l,isDisabledAddToCartButton:C,isBusy:u,handleShowOutfit:t,noModal:h,isSoldOutMissyAndPlus:b})]}))]})}}}]);