PageSourceSearch

https://static-ca-prod.castlery.com/assets/web/_next/static/chunks/5362-1544038a74e7c8e0.js

js castlery.com collected 2026-09-25 15:13:42 UTC 16,285 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cfc0244a-7ec7-4d73-8f4b-df8bf8264a73",e._sentryDebugIdIdentifier="sentry-dbid-cfc0244a-7ec7-4d73-8f4b-df8bf8264a73")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5362],{5790:function(e,t,n){n.r(t),n.d(t,{PLPBreadcrumbs:function(){return u}});var o=n(63056),r=n(87420),a=n(73953),i=n(78909),l=n(57809),s=n(43071),c=n(49187);let d=e=>{let{title:t,href:n,linkKey:r,isExternalFlag:a=!0,linkVariant:i="plain",sx:s}=e;return(0,o.jsx)(l.NextFortressLink,{level:"caption1",variant:i,...r?{linkKey:r}:{href:n,isExternalFlag:a},sx:{textDecoration:"none",color:"var(--fortress-palette-brand-mono-700)","&:hover":{color:"var(--fortress-palette-brand-terracotta-500)",textDecoration:"underline"},...s},children:t})},u=e=>{let{currentPageName:t,items:n=[],sx:l,homeLinkSx:u}=e,{region:p}=(0,s.useParams)();if(0===n.length&&!t)return null;let v=u&&(null==u?void 0:u.display)==="none",h=[];return v||h.push({key:"home",element:(0,o.jsx)(d,{title:"Home",href:"/".concat(p),linkVariant:"secondary",sx:{display:{xs:"none",md:"inline-flex"},mx:0,...u}})}),n.forEach((e,t)=>{let{pageKey:n,url:a,title:i}=e;a?h.push({key:"item-".concat(t),element:(0,o.jsx)(d,{title:i,href:a,linkKey:n},t)}):h.push({key:"item-".concat(t),element:(0,o.jsx)(r.C,{level:"caption1",children:i})})}),t&&h.push({key:"current",element:(0,o.jsx)(r.C,{level:"caption1",children:t})}),(0,o.jsx)(a.Z,{sx:{px:0,py:1.5,["& .".concat(i.Z.ol," > .").concat(i.Z.li,":first-child + .").concat(i.Z.separator)]:{display:{xs:"none",md:"flex"}},...l},children:h.map(e=>(0,o.jsx)(c.Fragment,{children:e.element},e.key))})}},78412:function(e,t,n){n.r(t),n.d(t,{ProductCard:function(){return F}});var o=n(63056),r=n(49187),a=n(76293),i=n(26759),l=n(58746),s=n(87420),c=n(66919),d=n(32109),u=n(37907),p=n(83698),v=n(77822),h=n(36307);let m="ProductCard-baseImage",x="ProductCard-lifestyleImage",f="ProductCard-wishlist",g="ProductCard-leadTime";function b(e){let{forceHover:t=!1,hasLifestyleImage:n}=e,o=t&&n;return{card:{"@media (min-width: 900px) and (hover: hover) and (pointer: fine)":{...n?{["&:hover .".concat(m)]:{opacity:0},["&:hover .".concat(x)]:{opacity:1}}:{},["&:hover .".concat(f)]:{display:"block"},["&:hover .".concat(g)]:{opacity:1}}},baseImage:{className:m,opacity:o?0:1},lifestyleImage:{className:x,opacity:o?1:0},wishlistClassName:f,leadTimeClassName:g}}var y=n(89636),w=n(78483);n(89805);var j=n(87259);let C=y.default,k=["0.25-lg","0.3-sm","0.5-xs"];function _(e){var t;let{images:n,canonicalLink:a,forceHover:l,prioritizeMainImage:s,onProductClick:c,productBackdropPreview:d=!1}=e,u=(0,r.useRef)(),[p,v]=(0,r.useState)(0),h=n.some(e=>"main"===e.type),m=n.some(e=>"lifestyle"===e.type),x=b({forceHover:l,hasLifestyleImage:h&&m}),f=1===p&&m,g=e=>{var t;null===(t=u.current)||void 0===t||t.slideTo(e)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Z,{component:C,href:a,prefetch:!1,"aria-label":null===(t=n[0])||void 0===t?void 0:t.alt,onClick:e=>{e.defaultPrevented||null==c||c(e)},"data-testid":"product-card-image-gallery",onDragStart:e=>e.preventDefault(),sx:{position:"absolute",inset:0,zIndex:1,display:"block",overflow:"hidden",cursor:{xs:n.length>1?"grab":"pointer",md:"pointer"},"&:active":{cursor:{xs:n.length>1?"grabbing":"pointer",md:"pointer"}},"& .swiper, & .swiper-wrapper, & .swiper-slide":{width:"100%",height:"100%"},["@media (min-width: ".concat(900,"px)")]:{"& .swiper-wrapper":{display:"block",transform:"none !important"},"& .swiper-slide":{position:"absolute",inset:0,width:"100% !important"}}},children:(0,o.jsx)(w.tq,{"data-testid":"product-card-swiper",slidesPerView:1,speed:300,simulateTouch:!0,threshold:5,preventClicks:!0,preventClicksPropagation:!0,allowTouchMove:n.length>1,breakpoints:{900:{enabled:!1,allowTouchMove:!1}},onSwiper:e=>{u.current=e},onSlideChange:e=>v(e.activeIndex),children:n.map((e,t)=>
1{let n="main"===e.type,r=n||0===t&&!h,a=r&&s,l=r?x.baseImage:x.lifestyleImage;return(0,o.jsx)(w.o5,{children:(0,o.jsx)(i.Z,{className:l.className,"data-image-type":e.type,sx:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none",opacity:{xs:1,md:l.opacity},transition:"opacity 0.3s ease"},children:(0,o.jsx)(j.FortressImage,{src:e.src,alt:e.alt,ratio:1,sizes:k,objectFit:n?"contain":"cover",lazy:!a,needPreload:a,productBackdrop:d&&n,backdropRatio:"1:1",sx:{"--AspectRatio-paddingBottom":"0px","& .MuiAspectRatio-content":{position:"absolute",inset:0}}})})},"".concat(e.type,"-").concat(e.src))})})}),n.length>1&&(0,o.jsx)(i.Z,{sx:{position:"absolute",left:0,right:0,bottom:2,zIndex:3,display:{xs:"flex",md:"none"},justifyContent:"center",gap:0,pointerEvents:"none"},children:n.map((e,t)=>{let r=p===t,a=(n.length/2-t-.5)*8,l=f?"var(--fortress-palette-brand-warmLinen-500)":"var(--fortress-palette-brand-mono-700)";return(0,o.jsx)(i.Z,{component:"button",type:"button","aria-label":"Show image ".concat(t+1),"aria-current":r?"true":void 0,onClick:()=>g(t),sx:{position:"relative",width:24,height:24,minWidth:24,p:0,border:0,backgroundColor:"transparent",pointerEvents:"auto",cursor:"pointer","&::after":{content:'""',position:"absolute",left:"50%",marginLeft:"".concat(a,"px"),bottom:2,width:8,height:8,borderRadius:"50%",border:"1px solid",borderColor:r?l:f?"var(--fortress-palette-brand-warmLinen-500)":"var(--fortress-palette-brand-mono-300)",backgroundColor:r?l:"transparent",transform:"translateX(-50%)",transition:"border-color 0.3s ease, background-color 0.3s ease"}}},"pagination-".concat(e.type))})})]})}var I=n(43071),S=n(16598),L=n(11638),E=n(68189);let P=(0,a.default)(()=>n.e(8149).then(n.bind(n,8149)).then(e=>e.WishlistBtn),{loadableGenerated:{webpack:()=>[8149]},ssr:!1}),N="POS"===S.EcEnv.NEXT_PUBLIC_CHANNEL,O=(e,t)=>e.length<=t?e:"".concat(e.slice(0,t),"..."),D=(e,t)=>{let n="/".concat(S.EcEnv.NEXT_PUBLIC_COUNTRY.toLocaleLowerCase(),"/products/").concat(e);if(!(null==t?void 0:t.option_values))return n;let o=t.option_values,r=Object.keys(o).map(e=>{let t=o[e];return(null==t?void 0:t.value)?"".concat(e,"=").concat(t.value):null}).filter(Boolean).join("&");return r?"".concat(n,"?").concat(r):n},Z=e=>!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button),T=(e,t)=>{let n=(0,r.useRef)(!1),o=t=>Math.max(0,Math.min(Number.isFinite(t)?t:0,Math.max(e.length-1,0))),[a,i]=(0,r.useState)(o(t));return(0,r.useEffect)(()=>{e.length>0&&a>=e.length&&i(o(t))},[e.length]),(0,r.useEffect)(()=>{n.current||i(o(t))},[t,e.length]),{currentVariant:e[a]||null,currentVariantIndex:a,setCurrentVariantIndex:e=>{n.current=!0,i(e)}}},z=e=>(0,r.useMemo)(()=>{var t,n,o;let r=["material","color_option","wood","leg_color","frame"],a={},i=new Set;e.forEach(e=>{if(!e.option_values)return;r.forEach(t=>{var n;let o=null===(n=e.option_values)||void 0===n?void 0:n[t];o&&(a[t]||(a[t]=[]),a[t].includes(o.value)||a[t].push(o.value))});let t=e.option_values.length;t&&i.add(t.value)});let l=null!==(o=null!==(n=r.find(e=>{var t,n;return(null!==(n=null===(t=a[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0)>1}))&&void 0!==n?n:r.find(e=>{var t,n;return(null!==(n=null===(t=a[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0)>=1}))&&void 0!==o?o:r[0],s=!1,c=new Set,d=[];e.forEach((e,t)=>{var n;let o=null===(n=e.option_values)||void 0===n?void 0:n[l];if(!o||c.has(o.value))return;c.add(o.value);let r={variant:e,index:t,optionValue:o};Array.isArray(e.tags)&&e.tags.indexOf("Sale")>-1&&!s?(d.unshift(r),s=!0):d.push(r)});let u=(null===(t=a[l])||void 0===t?void 0:t.length)||0,p=i.size,v=0;if(d.length>0)v=d[0].index;else{let t=e.findIndex(e=>Array.isArray(e.tags)&&e.tags.indexOf("Sale")>-1);v=-1!==t?t:0}return{variantOptions:d,selectedOptionType:l,totalOptionsCount:u,lengthVariantsLength:p,initialIndex:v}},[e]);function R(e){let{variantOptions:t,currentVariantIndex:n,onVariantSelect:r,totalOptionsCount:a,optionLimit:i=3}=e;if(t.length<=1)return null;let l=t.slice(0,i),s=l.map(e=>{let{variant:t,index:o,optionValue:r}=e;return{id:"".concat(t.id,"-").concat(r.value,"-").concat(o),value:r.value,label:r.presentation||t.color||"Variant option",image:r.image_src,isSelected:n===o}});return(0,o.jsx)(v.OptionSelector,{options:s,maxDisplay:i,totalOptionsCount:a,size:24,onSelect:e=>{let t=l.find(t=>{let{variant:n,optionValue:o,index:r}=t;return"".concat(n.id,"-").concat(o.value,"-").concat(r)===e});t&&r(t.index)},allowWrap:!0,sx:{mb:{xs:3,md:4}},variant:"square"})}function V(e){var t,n;let{variant:a,productName:d,canonicalLink:u,navigationLink:p,forceHover:v,prioritizeMainImage:h,productBackdropPreview:m=!1,onProductClick:x,isShowWishlistBtn:f,onToastShow:g}=e,y=(0,I.useRouter)(),{t:w}=(0,L.$G)(L.XR.SHARED,{keyPrefix:"common"}),j=b({forceHover:v,hasLifestyleImage:!!(null==a?void 0:a.life_style_image)}),C=(0,r.useMemo)(()=>{var e,t,n;return function(e){let{mainImageSrc:t,lifestyleImageSrc:n,productName:o}=e;return t?[{src:t,alt:o,type:"main"},...n?[{src:n,alt:"".concat(o," lifestyle"),type:"lifestyle"}]:[]]:n?[{src:n,alt:"".concat(o," lifestyle"),type:"lifestyle"}]:[{src:"",alt:o,type:"main"}]}({mainImageSrc:null==a?void 0:null===(t=a.images)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.large,lifestyleImageSrc:null===(n=a.life_style_image)||void 0===n?void 0:n.large,productName:(null==a?void 0:a.name)||d})},[a,d]);return(0,o.jsx)(c.Z,{children:(0,o.jsxs)(i.Z,{sx:{position:"relative",width:"100%",aspectRatio:"1"},children:[(0,o.jsx)(_,{images:C,canonicalLink:u,forceHover:v,prioritizeMainImage:h,productBackdropPreview:m,onProductClick:e=>{x&&x(),p!==u&&Z(e)&&(e.preventDefault(),y.push(p))}},a.id),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(i.Z,{sx:{m:N?1:{xs:2,md:4},position:"absolute",left:0,right:0,top:0,display:"flex",justifyContent:"space-between",alignItems:"flex-start",zIndex:2,pointerEvents:"none"},children:[(0,o.jsxs)(i.Z,{sx:{pointerEvents:"auto",display:"flex",flexDirection:"row",alignItems:"center",gap:3},children:[(null==a?void 0:a.badges)&&a.badges.length>0&&(0,o.jsx)(l.V,{variant:"solid",sx:{backgroundColor:["Sale","Clearance","Extra 5% Off"].includes(null==a?void 0:a.badges[0])?"var(--fortress-palette-brand-burntOrange-400)":"var(--fortress-palette-brand-terracotta-500)"},children:(0,o.jsx)(s.C,{level:"caption2",children:null==a?void 0:a.badges[0]})}),(null==a?void 0:null===(t=a.badges)||void 0===t?void 0:t.includes("Steve's picks"))&&(null==a?void 0:null===(n=a.badges)||void 0===n?void 0:n[0])!=="Steve's picks"&&(0,o.jsx)(l.V,{variant:"solid",sx:{backgroundColor:"var(--fortress-palette-brand-maroonVelvet-500)"},children:(0,o.jsx)(s.C,{level:"caption2",children:"Steve's picks"})})]}),(0,o.jsx)(i.Z,{children:f&&(0,o.jsx)(i.Z,{className:j.wishlistClassName,sx:{dis
1play:{xs:"none",md:v?"block":"none"},transition:"opacity 0.3s ease",pointerEvents:"auto",position:"relative",zIndex:3},children:a.id&&(0,o.jsx)(P,{variantId:a.id,anchorOrigin:{vertical:"bottom",horizontal:"right"},onToastShow:g,showToast:!1})})})]}),E.H.isFeatureEnabled(E.e.LEADTIME_DISPLAY)&&a.lead_time_presentation&&(0,o.jsx)(i.Z,{className:j.leadTimeClassName,sx:{display:{xs:"none",md:"block"},position:"absolute",bottom:0,left:0,right:0,opacity:v?1:0,transition:"opacity 0.3s ease",zIndex:1,pointerEvents:"none"},children:(0,o.jsx)(i.Z,{sx:{width:"100%",maxWidth:"100%",py:2,px:3,textAlign:"center",bgcolor:"var(--fortress-palette-brand-burntOrange-500)"},children:(0,o.jsxs)(s.C,{level:"caption1",sx:{color:"var(--fortress-palette-brand-warmLinen-500)"},children:[w("dispatch")," ",(0,o.jsx)("strong",{children:a.lead_time_presentation})]})})})]})]})})}function A(e){let{product:t,variant:n,canonicalLink:r,navigationLink:a,isLowStock:l,onProductClick:c,variantOptions:p,currentVariantIndex:v,onVariantSelect:h,totalOptionsCount:m,colorOptionLimit:x=3,lengthVariantsLength:f}=e,g=(0,I.useRouter)(),b=(null==n?void 0:n.price)||"",w=0===parseFloat(b)?"Free":"".concat("bundle"===t.product_type?"From ":"").concat((0,L.j6)(b)),j=(null==n?void 0:n.list_price)&&n.price!==n.list_price;return(0,o.jsxs)(d.Z,{sx:{flexGrow:1,bgcolor:"transparent",p:N?1:{xs:2,md:4},pb:{xs:4,md:6},pt:{xs:3,md:4}},children:[(0,o.jsx)(s.C,{level:N?"body1":"h5",mb:{xs:1,md:2},children:(0,o.jsx)(y.default,{href:r,onClick:e=>{c&&c(),a!==r&&Z(e)&&(e.preventDefault(),g.push(a))},style:{textDecoration:"none",color:"inherit"},prefetch:!1,children:t.name})}),(null==n?void 0:n.product_short_description)&&(0,o.jsx)(s.C,{level:"caption1",sx:{mb:{xs:3,md:4},color:"var(--fortress-palette-brand-mono-700)"},children:O(n.product_short_description,38)}),(0,o.jsx)(R,{variantOptions:p,currentVariantIndex:v,onVariantSelect:h,totalOptionsCount:m,optionLimit:x}),f>1&&(0,o.jsxs)(s.C,{level:"body2",mb:6,sx:{color:"var(--fortress-palette-brand-mono-700)"},children:[f," sizes available"]}),(0,o.jsx)(i.Z,{children:j?(0,o.jsxs)(u.ZP,{direction:"row",alignItems:"center",spacing:3,children:[(0,o.jsx)(s.C,{level:N?"body1":"h5",sx:{color:"var(--fortress-palette-brand-terracotta-500)"},children:w}),(0,o.jsx)(s.C,{level:N?"body1":"h5",color:"danger",sx:{textDecoration:"line-through",color:"var(--fortress-palette-brand-mono-500)"},children:(0,L.j6)(n.list_price)})]}):(0,o.jsx)(s.C,{level:N?"body1":"h5",children:w})}),l&&(0,o.jsxs)(s.C,{level:"body2",color:"danger",children:["Only ",null==n?void 0:n.available_quantity," left in stock"]})]})}function F(e){var t,n,a;let{product:i,forceHover:l=!1,onProductClick:s,onVariantSelect:c,onFavoriteClick:d,isShowWishlistBtn:u=!0,hitIndex:v,productBackdropPreview:m=!1}=e,[x,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)("add"),{variantOptions:w,totalOptionsCount:j,lengthVariantsLength:C,initialIndex:k}=z(i.variants),{currentVariant:_,currentVariantIndex:I,setCurrentVariantIndex:L}=T(i.variants,k),E=b({forceHover:l,hasLifestyleImage:!!((null==_?void 0:null===(n=_.images)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.large)&&(null==_?void 0:null===(a=_.life_style_image)||void 0===a?void 0:a.large))}),P=()=>{s&&_&&s(i,_)},N="/".concat(S.EcEnv.NEXT_PUBLIC_COUNTRY.toLocaleLowerCase(),"/products/").concat(i.slug),O=D(i.slug,_),Z=!!((null==_?void 0:_.available_quantity)&&_.available_quantity<=3&&7>=(_.lead_time||0));return _?(0,o.jsxs)(p.ZP,{variant:"plain","data-hit-index":v,"data-hit-sku":null==_?void 0:_.sku,sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"transparent",background:"transparent",boxShadow:"none",border:"none",gap:0,borderRadius:0,p:0,m:0,"--Card-padding":"0px","--Card-radius":"0px","&:hover":{boxShadow:"none"},...E.card},"data-testid":"product-card",children:[(0,o.jsx)(V,{variant:_,productName:i.name,canonicalLink:N,navigationLink:O,forceHover:l,prioritizeMainImage:void 0!==v&&v>=1&&v<=4,productBackdropPreview:m,onProductClick:P,isShowWishlistBtn:u,onToastShow:e=>{y(e),f(!0)}}),(0,o.jsx)(A,{product:i,variant:_,canonicalLink:N,navigationLink:O,isLowStock:Z,onProductClick:P,variantOptions:w,currentVariantIndex:I,onVariantSelect:e=>{L(e),c&&c(e)},totalOptionsCount:j,colorOptionLimit:i.colorOptionLimit,lengthVariantsLength:C}),(0,o.jsx)(h.k,{open:x,onClose:()=>{f(!1)},status:g,anchorOrigin:{vertical:"bottom",horizontal:"right"}})]}):null}},36307:function(e,t,n){n.d(t,{k:function(){return d}});var o=n(63056),r=n(29257),a=n(19171),i=n(87420),l=n(81748),s=n(85588),c=n(96884);let d=e=>{let{open:t,onClose:n,status:d,anchorOrigin:u}=e,{desktop:p,mobile:v}=(0,r.Z)();return(0,o.jsx)(a.F,{open:t,onClose:n,theme:"dark",anchorOrigin:u||{vertical:p?"top":"bottom",horizontal:v?"center":"right"},sx:{position:"fixed",zIndex:9999},startDecorator:(0,o.jsx)(l.g,{}),endDecorator:(0,o.jsx)(s.x,{onClick:n,sx:{cursor:"pointer"}}),actionSlot:"remove"===d?null:(0,o.jsx)(c.CustomLink,{linkKey:"wishlist",children:(0,o.jsx)(i.C,{level:"body1",sx:{color:"var(--fortress-palette-brand-warmLinen-500)",textDecoration:"underline"},children:"View Wishlist"})}),children:(0,o.jsx)(i.C,{level:"body1",sx:e=>({color:e.palette.brand.warmLinen[500]}),children:"remove"===d?"Removed from wishlist!":"Added to wishlist!"})})}},68189:function(e,t,n){n.d(t,{H:function(){return r.e},e:function(){return o.e}});var o=n(30076),r=n(75161)}}]);
2//# sourceMappingURL=5362-1544038a74e7c8e0.js.map

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.