(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8942,8537],{93184:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/collections/[slug]",function(){return n(39350)}])},55752:function(e,t,n){"use strict";n.d(t,{W:function(){return i}});var l=n(85893);n(67294);var o=n(86640);let i=e=>{let{className:t,maxWidth:n,children:i}=e,r="number"==typeof n?"".concat(null==n?void 0:n.toString(),"px"):({sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px"})[n];return(0,l.jsx)("div",{style:{maxWidth:null!=r?r:"80rem"},className:(0,o.cn)("mx-auto w-full px-4",t),children:i})}},8647:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var l=n(85893),o=n(86640);function i(e){let{align:t="start",direction:n="row",justify:i="start",wrap:r=!1,className:s,children:c,gap:a,as:d="div",...u}=e,f="flex ".concat({row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"}[n]," ").concat({start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"}[t]," ").concat({normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:" justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"}[i]," ").concat(r?"flex-wrap":""," gap-").concat(a||0," ");return(0,l.jsx)(d,{className:(0,o.cn)(f,s),...u,children:c})}},4331:function(e,t,n){"use strict";n.d(t,{k:function(){return l.k}});var l=n(8647)},77066:function(e,t,n){"use strict";n.d(t,{r:function(){return i},P:function(){return r}});var l=n(85893),o=n(86640);function i(e){let{columns:t=1,gap:n=0,align:i="stretch",justify:r="start",className:s,children:c}=e,a="grid w-full ".concat({none:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-1",12:"grid-cols-12"}[t]||"grid-cols-1"," ").concat({start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"}[i]," ").concat({normal:"justify-items-normal",start:"justify-items-start",end:"justify-items-end",center:"justify-items-center",between:" justify-items-between",around:"justify-items-around",evenly:"justify-items-evenly",stretch:"justify-items-stretch"}[r]," gap-").concat(null!=n?n:0);return(0,l.jsx)("div",{className:(0,o.cn)(a,s),children:c})}function r(e){let{span:t="auto",className:n,children:i}=e;return(0,l.jsx)("div",{className:(0,o.cn)("w-auto ".concat({auto:"col-span-auto",1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"}[t]),n),children:i})}},40858:function(e,t,n){"use strict";n.d(t,{P4:function(){return i.P},W2:function(){return o.W},kC:function(){return l.k},rj:function(){return i.r}});var l=n(4331),o=n(55752),i=n(77066)},84170:function(e,t,n){"use strict";n.d(t,{L:function(){return p},f:function(){return f}});var l=n(85893),o=n(67294),i=n(94901),r=n(22779),s=n(64721),c=n.n(s),a=n(18446),d=n.n(a);let u=(0,o.createContext)({products:null,addToBag:null,addWishlist:()=>{},cart:null,favorited:!1,favorites:null,fetchCollections:()=>{},getPriceDisplay:()=>0,id:null,isAddingToBag:!1,isScript:!1,options:{},price:0,productCollection:null,selected:null,selectedOpt:null,setCart:()=>{},setId:()=>{},setOptions:()=>{},setPrice:()=>{},setSelectedOpt:()=>{},setWishlist:()=>{},wishlist:{productIds:[]}});function f(e){let{children:t}=e,[n,s]=(0,o.useState)(null),[a,f]=(0,o.useState)(null),[p,v]=(0,o.useState)(!1),[h,m]=(0,o.useState)({}),[w,g]=(0,o.useState)([]),[x,y]=(0,o.useState)(null),[j,_]=(0,o.useState)(0),[I,S]=(0,o.useState)({productIds:[]}),[b,k]=(0,o.useState)(!1),[N,C]=(0,o.useState)(null),[E,P]=(0,o.useState)(null),[O,A]=(0,o.useState)(null),D="PSecwid__".concat("25550022","PSfavorites"),[T,B]=(0,o.useState)(!1),[z,W]=(0,o.useState)(0),[L,M]=(0,o.useState)(!1);(0,o.useEffect)(()=>{null!==N&&fetch("/api/ecwid/products/".concat(N)).then(e=>e.json()).then(e=>{e&&f(e.result)}).catch(e=>{})},[N]),(0,o.useMemo)(()=>{let e=null;if(w.length){var t;let n=a&&(null==a?void 0:a.combinations),l=null===(t=n[0])||void 0===t?void 0:t.options.map(e=>e.name),o=null==w?void 0:w.sort((e,t)=>(null==l?void 0:l.indexOf(e.name))-(null==l?void 0:l.indexOf(t.name))),i=o.filter(e=>c()(l,e.name)),r=n.flatMap(e=>{e.options.length;let t=e.options.map(e=>({name:e.name,value:e.value}));if(d()(t,i))return e}).find(e=>e);n.flatMap(e=>{let t=e.options.map(e=>({name:e.name,value:e.value}));if(d()(t,o))return e}).find(e=>e),w.flatMap(e=>n.flatMap(t=>t.options.map(n=>{if(t.options.length<2&&d()({name:n.name,value:n.value},e))return t}))).find(e=>e),r&&y(r),e=w}return e},[w,a]),(0,o.useEffect)(()=>{window.ec=window.ec||{},window.ec.config=window.ec.config||{},window.ec.config.storefrontUrls=window.ec.config.storefrontUrls||{},["/cart"].includes(location.pathname)&&(window.ec.config.storefrontUrls.cleanUrls=!0,window.ec.config.storefrontUrls.queryBasedCleanUrls=!0),window.ec.config.store_main_page_url="".concat("https://www.hickoryhardware.com","/cart"),window.ecwid_script_defer=!0,"/cart"===location.pathname&&(window._xnext_initialization_scripts=[{widgetType:"ProductBrowser",id:"ecwid-shop-store",arg:["id=ecwid-shop-store"]}]),function(){if("undefined"!=typeof Ecwid)try{Ecwid.OnAPILoaded.add(function(){Ecwid.init()})}catch(e){}else W(e=>e+1)}()},[]),(0,o.useEffect)(()=>{if(localStorage.getItem(D)){B(!0);let e=JSON.parse(localStorage.getItem(D));e.productIds.length>0&&(S(t=>({...t,productIds:e.productIds})),k(!!c()(e.productIds,N)))}},[N,T]),(0,o.useEffect)(()=>{(async()=>{let e=JSON.parse(localStorage.getItem(D));if(null==e?void 0:e.productIds)try{let t={ids:null==e?void 0:e.productIds},n=await r.i3.fetch('*[_type=="mainProduct" && ecwidProductId in $ids && !(_id in path("drafts.**"))]',t).then(e=>e),l=await fetch("/api/ecwid/products/search?productIds=".concat(e.productIds)),o=await l.json(),i=null==n?void 0:n.map(e=>{var t;return null===(t=o.items)||void 0===t?void 0:t.map(t=>{if(t.id===e.ecwidProductId)return{...e,...t,ecwidId:t.id,price:t.defaultDisplayedPriceFormatted}}).flat()}).flat().filter(e=>void 0!==e);P(i)}catch(e){}})()},[T]);let q=async e=>{A((await fetch("/api/ecwid/products/search?productIds=".concat(e)).then(e=>e.json())).items)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Provider,{value:{cart:n,setCart:s,products:a,options:h,setOptions:m,price:j,setPrice:_,addToBag:(e,t)=>{v(!0);let n={...e,callback:function(e){e?i.A.success("Product was successfully added to your cart"):i.A.error("There was an error adding this product to your cart."),v(!1)}};t&&Object.keys(t).length&&(n.options=t),setTimeout(()=>{"undefined"!=typeof Ecwid&&Ecwid.Cart.addProduct(n)},1e3)},isAddingToBag:p,getPriceDisplay:e=>{let t="$".concat(e);return"undefined"!=typeof Ecwid&&Ecwid.OnAPILoaded.add(function(){t=Ecwid.formatCurrency(e)}),t},setWishlist:S,wishlist:I,setId:C,id:N,favorited:b,addWishlist:e=>{let t=null==I?void 0:I.productIds,n=c()(t,e)?t.filter(t=>t!==e):t.concat(e);S(e=>({...e,productIds:n})),k(!c()(t,e)),localStorage.setItem(D,JSON.stringify({productIds:n}))},favorites:E,fetchCollections:q,productCollection:O,setSelectedOpt:g,selectedOpt:w,selected:x,isScript:L},children:t}),(0,l.jsx)("div",{style:{zIndex:1},children:(0,l.jsx)(i.I,{delay:5e3,position:"top-center"})})]})}function p(){return(0,o.useContext)(u)}},22779:function(e,t,n){"use strict";n.d(t,{i3:function(){return r}});var l=n(27688),o=n(58495),i=n(34155);(0,l.e)(o.v);let r=(0,l.e)(o.v);(0,l.e)({...o.v,useCdn:!1,token:"sk7Lc8pj1TjSMTDYKjg7Bv2vIfXizQ4PBMDGZoD6kL4JCPJSSFHsHKgEqzGLed84q0BvzqhgpIrwtg1Zk4D7nvJBoPtXNW7Eh8XiXZclZ2wtfh9BwTj79SP1MZlRdukF6q3DcvEC34dJkoZqrDE12c90MOzzbecQ5xmLqygzu7VrNjXKoCtt"}),(0,l.e)({...o.v,useCdn:!1,token:i.env.SANITY_API_WRITE_TOKEN})},19805:function(e,t,n){"use strict";n.r(t);var l=n(85893),o=n(67294),i=n(41664),r=n.n(i),s=n(9008),c=n.n(s),a=n(40858),d=n(40135);t.default=o.memo(function(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c(),{children:(0,l.jsx)("title",{children:"404: Page not found"})}),(0,l.jsxs)("section",{children:[(0,l.jsx)("div",{className:"skew skew-top mr-for-radius",children:(0,l.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,l.jsx)("polygon",{fill:"currentColor",points:"0 0 10 10 0 10"})})}),(0,l.jsx)("div",{className:"skew skew-top ml-for-radius",children:(0,l.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,l.jsx)("polygon",{fill:"currentColor",points:"0 10 10 0 10 10"})})}),(0,l.jsx)("div",{className:"py-20 radius-for-skewed bg-gray-50",children:(0,l.jsx)(a.W2,{children:(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)(d.xv,{fontSize:"4xl",weight:"bold",className:"mb-6 text-primary",children:"Whoops!"}),(0,l.jsx)(d.X6,{type:"h3",fontSize:"4xl",className:"mb-2",weight:"bold",children:"Something went wrong!"}),(0,l.jsx)(d.xv,{muted:!0,className:"mb-8",children:"Sorry, but we are unable to open this page"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(r(),{className:"inline-block w-full px-6 py-2 mb-2 font-bold leading-loose rounded-l-xl rounded-t-xl bg-primary-foreground text-gray-50 hover:bg-primary lg:mb-0 lg:mr-4 lg:w-auto",href:"/",children:"Go back to Homepage"}),(0,l.jsx)("a",{className:"inline-block w-full px-6 py-2 font-bold leading-loose bg-white rounded-l-xl rounded-t-xl hover:bg-gray-50 lg:w-auto",href:"#",children:"Try Again"})]})]})})}),(0,l.jsx)("div",{className:"skew skew-bottom mr-for-radius",children:(0,l.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,l.jsx)("polygon",{fill:"currentColor",points:"0 0 10 0 0 10"})})}),(0,l.jsx)("div",{className:"skew skew-bottom ml-for-radius",children:(0,l.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,l.jsx)("polygon",{fill:"currentColor",points:"0 0 10 0 10 10"})})})]})]})})},39350:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return E},default:function(){return P}});var l=n(85893),o=n(67294),i=n(11163),r=n.n(i),s=n(70386),c=n(72535),a=n(1641),d=n(19805),u=n(47503),f=n(74975),p=n(71146),v=n(33640),h=n(37081),m=n(84170);function w(e){let{data:t}=e,{commonSections:n,name:i,sections:r,_id:s,_type:c}=t,a=(0,o.useContext)(v.z),d=null==n?void 0:n.sections,u=null==r?void 0:r.map(e=>{var t,l,o;let i=null==n?void 0:null===(t=n.sections)||void 0===t?void 0:t.findIndex(e=>{var t;return null==e?void 0:null===(t=e._type)||void 0===t?void 0:t.includes("slotCollectionInfo")}),r={variant:null==n?void 0:null===(o=n.sections)||void 0===o?void 0:null===(l=o[i])||void 0===l?void 0:l.variant};return(null==e?void 0:e._type)==="slotCollectionInfo"&&(null==e?void 0:e.variant)==="defaultVariant"?{...e,...r}:e});if(r){let e=null==r?void 0:r.filter(e=>(null==e?void 0:e._type)!=="slotCollectionInfo");d=(null==e?void 0:e.length)!==0?u:null==r?void 0:r.reduce((e,t)=>{var l,o;let i=null==n?void 0:null===(l=n.sections)||void 0===l?void 0:l.findIndex(e=>{var t;return null==e?void 0:null===(t=e._type)||void 0===t?void 0:t.includes("slotCollectionInfo")});return(null==t?void 0:t.variant)==="defaultVariant"&&(t.variant=null===(o=e[i])||void 0===o?void 0:o.variant),-1!==i&&(e[i]=t),e},[...null==n?void 0:n.sections])}return(0,l.jsx)(l.Fragment,{children:d&&(null==d?void 0:d.map((e,t)=>{let n=(null==e?void 0:e._type)==="slotCart"?"cartSection":(null==e?void 0:e._type)==="slotWishlist"?"wishlistSection":(null==e?void 0:e._type)==="slotCollectionInfo"?"featuredProducts":null==e?void 0:e._type,o=p.z[n],r=(null==e?void 0:e._type)==="slotCollectionInfo"?{id:s,type:c}:{id:null==e?void 0:e._id,type:null==e?void 0:e._type};return o?(0,l.jsx)(h.Z,{document:r,showInlineEditor:a,children:(0,l.jsx)(m.f,{children:(0,l.jsx)(o,{template:{bg:"gray",color:"webriq"},collection:{name:i},data:e})})},t):null}))})}var g=n(79773),x=n(70290),y=n.n(x),j=n(34155);let _="2RO6V94YXJ",I=j.env.ALGOLIA_ADMIN_API_KEY,S=y()(_,"a28b476bf1d9115c49caa74e272c5c4b");y()(_,I);var b=n(36491),k=n(58685);function N(e){let{data:t}=e,n=null==t?void 0:t.collectionData;return n?(null==t?void 0:t.collectionData)&&(0,l.jsxs)(b.p,{routing:{router:(0,g.v)({singletonRouter:r(),routerOptions:{cleanUrlOnDispose:!1}})},searchClient:S,indexName:"hickory_products_index_v2",future:{preserveSharedStateOnUnmount:!0},children:[(0,l.jsx)(k.T,{advancedSyntax:!0,advancedSyntaxFeatures:["exactPhrase"]}),(0,l.jsx)(w,{data:n})]}):null}function C(e){var t;let{data:n,slug:o,token:i=null}=e,r=(0,c.u)(i,a.K6,{slug:o}),s=(null==r?void 0:r[0])||r;return s?(0,l.jsxs)(l.Fragment,{children:[(!s||!(null==s?void 0:s.sections)||(null==s?void 0:null===(t=s.sections)||void 0===t?void 0:t.length)===0)&&(0,l.jsx)(f.Y,{}),(null==n?void 0:n.collectionData)&&(0,l.jsx)(w,{data:s})]}):null}var E=!0,P=o.memo(function(e){let{data:t,preview:n,token:r,source:c}=e,a=(0,i.useRouter)().query.slug;return((0,o.useEffect)(()=>{"undefined"!=typeof Ecwid&&Ecwid.init()},[]),null==t?void 0:t.collectionData)?n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.a,{}),(0,l.jsx)(s.Dz,{fallback:"Loading...",children:(0,l.jsx)(v.Z,{showInlineEditor:"studio"===c,children:(0,l.jsx)(C,{data:t,token:r||null,slug:a})})})]}):(0,l.jsx)(N,{data:t}):(0,l.jsx)(d.default,{})})}},function(e){e.O(0,[5445,232,8159,133,5675,1664,4822,2192,1792,1840,2971,7546,8355,484,7438,135,9089,2888,9774,179],function(){return e(e.s=93184)}),_N_E=e.O()}]);