1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9922],{59922:function(e,t,r){r.d(t,{rf:function(){return l},h4:function(){return D},L8:function(){return p},FM:function(){return I},V8:function(){return N},T3:function(){return U},K8:function(){return Y},fV:function(){return G}});var i=r(41664),n=r.n(i),s=r(85893),l=function(){return(0,s.jsxs)("section",{className:"flex flex-col gap-4 text-center",children:[(0,s.jsx)("h2",{className:"text-3.5xl font-bold capitalize text-black lg:text-4xl lg:font-medium",children:"Your Wishlist is empty"}),(0,s.jsx)("p",{className:"text-xl text-black",children:"Seems like you don\u2019t have anything in your wishlist yet. Make a wish!"}),(0,s.jsx)("div",{className:"mt-6 flex justify-center",children:(0,s.jsx)(n(),{href:"/catalog",passHref:!0,children:(0,s.jsx)("a",{className:"rounded bg-red-600 py-3 px-4 text-base font-medium uppercase text-white",children:" Start Shopping"})})})]})},a=r(86010),o=r(67294),c=r(16523),u=r(48349),d=r(4898),h=r(74199),p=(0,o.memo)((function(e){var t=e.products,r=e.viewType,i=e.isShareWishListPage,n=void 0!==i&&i,l=(0,c.useProductActions)({gaWriteToLocalStorage:!1,locationName:"Wishlist"}),o=l.bulkAddToCart,p=l.bulkIsLoading,m=function(e){var r=t.map((function(e){return e.product})),i=r.find((function(t){return t.catalogNumber===e})),n=r.indexOf(i);(0,u.x)("select_item",{listName:"Wishlist",products:[i],productIndex:n,writeToLocalStorage:!0})},x=function(e,r){var i=t.map((function(e){return e.product}));e.forEach((function(e){if(e.isIntersecting){var t=i.find((function(e){return e.catalogNumber===r.catalogNumber})),n=i.indexOf(t),s=null===i||void 0===i?void 0:i.slice(n,n+6);(0,u.x)("view_item_list",{products:s,productIndex:n,listPlace:"Wishlist",listName:"Wishlist",writeToLocalStorage:!1,readFromLocalStorage:!1})}}))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:(0,a.Z)("grid auto-rows-auto gap-8",{"grid-cols-1":"list"===r,"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4":"grid"===r}),children:t.map((function(e,t){var i=e.product;return(0,s.jsx)(h.Cv,{isShareWishListPage:n,type:r,product:i,onSelectItem:m,handleIntersection:t%6===0?x:null},i.pid)}))}),(0,s.jsx)("div",{className:"flex w-full justify-end",children:(0,s.jsx)(d.z,{className:"w-full uppercase lg:w-auto",isLoading:p,onClick:function(){return o(function(e){return e.reduce((function(e,t){var r=t.product,i=r.sellable,n=r.shippingWeight,s=r.catalogNumber;return i&&n&&e.push(s),e}),[])}(t))},children:"ADD ALL ITEMS TO THE CART"})})]})})),m=r(91799),x=r(90598),f=r(57748),g=r(8029),v=r(11355),w=r(82299),y=r(10829),j=function(){return(0,s.jsx)("div",{className:"w-full rounded-lg bg-blue-100",children:(0,s.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-2.5 p-4",children:[(0,s.jsx)(y.Z,{className:"mt-0.5"}),(0,s.jsx)("span",{children:"You can remove products from the wishlist you're sharing - don't worry, it will not affect your wishlist on the website"})]})})},b=function(e){var t=e.viewType,r=e.products,i=e.removeFromShareWishList,n=e.isShareListModal,l=void 0!==n&&n,o=function(e){var t=r.map((function(e){return e.product})),i=t.find((function(t){return t.catalogNumber===e})),n=t.indexOf(i);(0,u.x)("select_item",{listName:"Wishlist",products:[i],productIndex:n,writeToLocalStorage:!0})};return(0,s.jsx)("div",{"data-testid":"list",className:(0,a.Z)("grid w-full auto-rows-auto gap-4 lg:gap-8",{"grid-cols-1":"list"===t,"grid-cols-1 sm:grid-cols-2 md:grid-cols-3":"grid"===t,"lg:grid-cols-4":"grid"===t&&!l}),children:r.map((function(e){var r=e.product;return(0,s.jsx)(h.Cv,{removeFromShareWishList:i,type:t,isShareListModal:l,product:r,onSelectItem:o},r.pid)}))})},N=function(e){var t=e.show,r=e.onClose,i=e.onBack,n=e.onClickSenToEmail,l=e.onShare,c=e.shareButtonText,u=e.copyButtonText,h=e.title,p=e.isShareListCreating,y=void 0!==p&&p,N=e.onRemoveFromShareWishList,S=e.shareWishlistProducts,k=e.isWishlistListCreating,L=(0,o.useState)(!S.length),C=L[0],O=L[1],T=S.length,W=(0,o.useRef)(null);(0,o.useEffect)((function(){O(!S.length)}),[S]);return(0,s.jsx)(m.h,{children:(0,s.jsx)(v.u,{appear:!0,show:t,as:o.Fragment,children:(0,s.jsxs)(w.V,{as:"div",onFocus:function(e){var t,r,i;(null===(t=e.target)||void 0===t||t.blur(),null!==(r=W.current)&&void 0!==r&&r.scrollIntoView)&&(null===(i=W.current)||void 0===i||i.scrollIntoView())},className:"relative z-[52]",onClose:r,children:[(0,s.jsx)(v.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"fixed inset-0 bg-[#00000033]"})}),(0,s.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,s.jsx)("div",{className:"flex h-full items-center justify-center lg:h-auto lg:py-16",children:(0,s.jsx)(v.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsxs)(w.V.Panel,{className:(0,a.Z)("relative flex h-full w-full max-w-5xl transform flex-col items-center justify-between overflow-hidden bg-white pt-8 text-left align-middle shadow-[0_4px_10px_rgba(0,0,0,0.1)] transition-all lg:h-auto lg:justify-start lg:rou
1nded-lg lg:pt-14"),children:[(0,s.jsx)(x.Z,{title:"Close",onClick:i,className:"absolute right-5 top-5 h-3.5 w-3.5 cursor-pointer"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-y-2 px-3 lg:px-12",children:[(0,s.jsxs)(w.V.Title,{as:"h2",className:"flex w-full items-center gap-x-1 text-2xl font-bold capitalize text-black lg:gap-x-2 lg:text-4xl lg:font-medium",children:[h,(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z,{className:"lg:hidden"}),(0,s.jsx)(g.Z,{className:"hidden lg:inline"})]})]}),(0,s.jsxs)(w.V.Title,{as:"p",className:"w-full text-tiny capitalize text-black lg:text-xl",children:[T," Items Added"]})]}),(0,s.jsxs)("div",{className:"share-wishlist-view-scroll mt-6 h-full max-h-[640px] w-full overflow-y-auto px-3 lg:mx-6 lg:mt-10 lg:mr-14 lg:h-auto lg:max-h-[520px] lg:pr-6 lg:pl-16 lg:pb-5",children:[(0,s.jsx)("div",{className:"mb-6 lg:mb-10",ref:W,children:(0,s.jsx)(j,{})}),(0,s.jsx)(b,{removeFromShareWishList:N,products:S,isShareListModal:!0,viewType:"grid"})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col-reverse justify-center gap-4 gap-4 py-6 px-3 pb-4 shadow-[0_2px_32px_rgba(0,0,0,0.15)] drop-shadow-[0_2px_32px_rgba(0,0,0,0.0)] lg:flex-row",children:[(0,s.jsx)(d.z,{onClick:n,className:"flex w-full items-center justify-center outline-0 lg:w-60",kind:"bright",isLoading:k,title:"shareWishlist",children:c}),(0,s.jsx)(d.z,{isLoading:y,onClick:l,disabled:C,title:"copyWishlist",className:"flex w-full items-center justify-center lg:w-60",children:u})]})]})})})})]})})})},S=r(50029),k=r(59499),L=r(87794),C=r.n(L),O=r(61590),T=r(19759),W=r(7258),E=r(13037);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}var P={senderName:W.string().max(30,"Sender name must not exceed 30 characters").required("Sender name is required"),recipientEmail:W.string().email("Email address is not valid").required("Recipient email address is required")},F=W.object().shape(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){(0,k.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},P)),_={defaultValues:{senderName:"",recipientEmail:"",Comment:""}},I=function(e){var t=e.showEmailForm,r=e.onClose,i=void 0===r?function(){return null}:r,n=e.sendToEmailText,l=e.userName,u=e.productsCount,h=e.onBack,p=void 0===h?function(){return null}:h,f=e.shareLink,g=e.onSuccess,y=void 0===g?function(){return null}:g,j=e.senderEmail,b=(0,c.useValidation)(E.useSendWishListToUserEmailMutation,(function(){y()}),F,_),N=b.handleSubmit,k=b.renderErrorMessage,L=b.control,W=b.mutation,Z=function(){var e=(0,S.Z)(C().mark((function e(t){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(),e.next=3,W.mutate({email:t.recipientEmail,senderName:t.senderName,comment:t.comment||"",wishListLink:f||"",senderEmail:j});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,s.jsx)(m.h,{children:(0,s.jsx)(v.u,{appear:!0,show:t,as:o.Fragment,children:(0,s.jsxs)(w.V,{as:"div",className:"relative z-[52]",onClose:i,children:[(0,s.jsx)(v.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"fixed inset-0 bg-[#00000033]"})}),(0,s.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,s.jsx)("div",{className:"flex h-full items-center justify-center lg:h-auto lg:py-16",children:(0,s.jsx)(v.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsxs)(w.V.Panel,{className:(0,a.Z)("relative flex h-full w-full max-w-lg transform flex-col items-center justify-between overflow-hidden bg-white px-3 pb-6 pt-14 pt-8 text-left align-middle shadow-[0_4px_10px_rgba(0,0,0,0.1)] transition-all lg:h-auto lg:justify-start lg:rou
1nded-lg lg:pt-14"),children:[(0,s.jsx)(x.Z,{title:"Close",onClick:i,className:"absolute right-5 top-5 h-3.5 w-3.5 cursor-pointer"}),(0,s.jsxs)("div",{className:" h-full w-full overflow-y-auto lg:h-auto lg:px-9 lg:py-2",children:[(0,s.jsx)("div",{className:"flex w-full pb-7",children:(0,s.jsxs)("button",{onClick:p,className:"flex cursor-pointer items-center text-tiny",type:"button",children:[(0,s.jsx)(O.Z,{title:"Back to login",className:"mr-2"}),"Back"]})}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,s.jsx)("div",{className:"text-xl",children:"You will share"}),(0,s.jsxs)(w.V.Title,{as:"h2",className:"flex w-full gap-x-1 text-2xl font-black capitalize text-black lg:gap-x-2 lg:text-4xl lg:font-bold",children:[l,"\u2019s Wishlist"]}),(0,s.jsxs)("div",{className:"pb-6 text-tiny lg:pb-10 lg:text-xl",children:[u,"\xa0 Items Added"]}),(0,s.jsx)("div",{className:"pb-4 text-xl leading-5",children:"You can share your wishlist via email. The people you share it with will not be able to edit your list."})]}),(0,s.jsxs)("form",{children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(T.M,{required:!0,inputClassName:(0,a.Z)("bg-gray-50 placeholder:text-gray-500"),label:"Sender Name","data-testid":"senderName",placeholder:"Enter Sender Name",type:"text",name:"senderName",control:L,error:k("senderName")})}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(T.M,{required:!0,inputClassName:(0,a.Z)("bg-gray-50 placeholder:text-gray-500"),label:"Recipient\u2019s Email","data-testid":"recipientEmail",placeholder:"Enter Recipient\u2019s Email",type:"email",name:"recipientEmail",control:L,error:k("recipientEmail")})}),(0,s.jsx)("div",{className:"mb-10",children:(0,s.jsx)(T.M,{inputClassName:(0,a.Z)("min-h-[92px] bg-gray-50 placeholder:text-gray-500 placeholder:-translate-y-6"),label:"Comment (Optional)","data-testid":"comment",placeholder:"Enter Your Comments",type:"textarea",name:"comment",control:L})})]})]}),(0,s.jsx)(d.z,{onClick:N(Z),className:"order-2 flex w-full items-center justify-center outline-0 sm:w-60 lg:w-60",title:"sendWishlist",children:n})]})})})})]})})})},M=r(10800),z=r(52991),V=r(7955);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){(0,k.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=function(e){var t=e.headlineText,r=e.viewType,i=e.router,n=e.setShowShareModal,l=e.isRegistered,c=e.hasProducts,u=e.isShareWishListPage,h=(0,o.useCallback)((function(e){i.push({pathname:i.pathname,query:R(R({},i.query),e)},void 0,{shallow:!0,scroll:!1})}),[i]);return(0,s.jsxs)("article",{className:"grid grid-cols-[1fr_auto] justify-between",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_auto] items-center lg:grid-cols-[auto_1fr] lg:gap-x-7",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold capitalize text-black lg:text-4xl lg:font-medium",children:t}),l&&c&&!u&&(0,s.jsxs)(d.z,{kind:"simple",className:"justify-self-start !px-0 !text-xl !font-normal normal-case !text-blue-500 hover:underline",size:"s",title:"Share wishlist",onClick:function(){n(!0)},children:[(0,s.jsx)(M.Z,{})," ",(0,s.jsx)("span",{className:"ml-3 hidden lg:inline",children:"Share wishlist"})]})]}),(0,s.jsxs)("div",{className:"hidden flex-row items-center justify-end gap-6 lg:flex",children:[(0,s.jsxs)("button",{className:(0,a.Z)("flex flex-row items-center gap-1 text-xl",{"hover:text-black-600 text-black hover:underline":"grid"===r,"text-grey-900 hover:text-grey-600 hover:underline":"list"===r}),type:"button",title:"Switch to grid view",onClick:function(){return h({viewType:"grid"})},children:[(0,s.jsx)(z.Z,{title:"Grid view",className:(0,a.Z)("shrink-0",{"stroke-blue-500":"grid"===r})}),"Grid view"]}),(0,s.jsxs)("button",{className:(0,a.Z)("flex flex-row items-center gap-1 text-xl",{"hover:text-black-600 text-black hover:underline":"list"===r,"text-grey-900 hover:text-grey-600 hover:underline":"grid"===r}),type:"button",title:"Switch to list view",onClick:function(){return h({viewType:"list"})},children:[(0,s.jsx)(V.Z,{title:"List view",className:(0,a.Z)("shrink-0",{"stroke-blue-500":"list"===r})}),"List view"]})]})]})},A=r(17674),B=function(e){var t=document.URL.split("?"),r=(0,A.Z)(t,2),i=r[0],n=r[1];return n?"".concat(i,"/").concat(e,"?").concat(n):"".concat(i,"/").concat(e)},Y=function(){var e=(0,c.useRendererContext)().gqlClient,t=(0,E.useShareWishListMutation)(e),r=t.mutateAsync,i=t.isLoading,n=(0,o.useState)(!1),s=n[0],l=n[1],a=function(){var e=(0,S.Z)(C().mark((function e(t){var i,n;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=(0,S.Z)(C().mark((function e(){var i,n,s;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(t);case 2:return i=e.sent,n=i.shareWishList.id,s=new Blob([B(n)],{type:"text/plain"}),e.abrupt("return",s);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=new ClipboardItem({"text/plain":i()}),e.next=4,navigator.clipboard.write([n]);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return{isShareListCreating:i,show:s,setShow:l,onHide:function(){l(!1)},onShare:function(e){a(e)}}},H=r(11163),G=function(){var e,t=(0,c.useRendererContext)().gqlClient,r=(0,H.useRouter)().query.wishlist,i="string"===typeof r?[r]:r,n=(0,A.Z)(i,1)[0],s=(0,E.useGetShareWishListQuery)(t,{sharedWishListId:n}),l=s.data,a=s.isLoading,o=s.isFetching,u=(null===l||void 0===l||null===(e=l.getSharedWishList)||void 0===e?void 0:e.wishList)||{},d=u.lineItems,h=void 0===d?[]:d;return{isLoading:a,isFetching:o,name:u.name,numFound:h.length,products:h}},U=function(){var e=(0,c.useRendererContext)().gqlClient,t=(0,E.useShareWishListMutation)(e),r=t.mutateAsync,i=t.isLoading,n=(0,o.useState)(""),s=n[0],l=n[1],a=(0,o.useState)(!1),u=a[0],d=a[1],h=function(){var e=(0,S.Z)(C().mark((function e(t,i){var n,s;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(){var e=(0,S.Z)(C().mark((function e(){var i,n;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(t);case 2:return i=e.sent,n=i.shareWishList.id,e.abrupt("return",B(n));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=3,n();case 3:s=e.sent,l(s),null===i||void 0===i||i();case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();return{isWishlistListCreating:i,showPopup:u,setShowPopup:d,onHidePopup:function(){d(!1)},shareListLink:s,createShareListLink:function(e,t){h(e,t)}}}}}]);
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.