(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5513],{64426:function(t,e,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/favorite",function(){return i(49208)}])},75060:function(t,e,i){"use strict";i.d(e,{Z:function(){return m}});var a=i(85893),n=i(41664),s=i.n(n),r=i(11163),l=i(74717),o=i.n(l),p=i(67294),c=i(33802);function u(t){let{item:e,position:i}=t,{asPath:n}=(0,r.useRouter)(),l=String(i),[u,m]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{m(!0)},[]),(0,a.jsx)(a.Fragment,{children:u&&(0,a.jsxs)("span",{itemProp:"itemListElement",itemScope:!0,itemType:"http://schema.org/ListItem",children:[n.split("?")[0]!==e.link&&n.split("#")[0]!==e.link?(0,a.jsx)(s(),{itemProp:"item",href:e.link,className:o().item,children:(0,a.jsx)("span",{itemProp:"name",children:c.Z.htmlEntitiesConvert(e.title)})}):(0,a.jsx)("span",{itemProp:"item",className:"".concat(o().item," ").concat(o().itemLast),children:(0,a.jsx)("span",{itemProp:"name",children:c.Z.htmlEntitiesConvert(e.title)})}),(0,a.jsx)("meta",{itemProp:"position",content:l})]})})}function m(t){let{title:e}=t,i=(0,r.useRouter)(),n=i.asPath.split("?")[0];n=n.split("/#")[0];let s=n.split("/").filter(t=>t.length>0),l=s.map((t,i)=>{i==s.length-1&&(t=e||t),"catalog"==t&&(t="Каталог"),"news"==t&&(t="Новости"),"nashi-nagrady"==t&&(t="Награды"),"stati"==t&&(t="Статьи"),"promo"==t&&(t="Акции"),"otzyvy"==t&&(t="Отзывы"),"pressa-o-nas"==t&&(t="Публикации"),"parazity-i-zabolevaniya"==t&&(t="Заболевания"),"prochie-tovary"==t&&(t="Прочие товары"),"kursy"==t&&(t="Комплексы"),"preparaty"==t&&(t="Препараты"),"lektsii"==t&&(t="Лекции"),"literatura"==t&&(t="Литература"),"sertifikati"==t&&(t="Сертификаты");let a="/"+s.slice(0,i+1).join("/")+"/";return{link:a,title:t}}),o=[{link:"/",title:"Главная"},...l];return(0,a.jsx)("div",{className:"mb-[42px] mt-[30px]",itemProp:"http://schema.org/breadcrumb",itemScope:!0,itemType:"http://schema.org/BreadcrumbList",children:null==o?void 0:o.map((t,e)=>(0,a.jsx)(u,{item:t,position:e+1},t.link))})}},15206:function(t,e,i){"use strict";var a=i(85893);e.Z=t=>{let{title:e}=t;return(0,a.jsx)("h1",{className:"text-[25px] xs:text-[33px] lg:text-[40px] mb-[30px]",children:e})}},49208:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return h}});var a=i(85893),n=i(9008),s=i.n(n),r=i(75060),l=i(15206),o=i(83046),p=i(28935),c=i(41664),u=i.n(c),m=i(51761),d=i(67294),f=i(33299);function h(){let{favorites:t}=(0,o.i)(t=>t),{data:e}=(0,f.useSession)(),[i,n]=(0,m.$A)(),[c,h]=(0,d.useState)([]);return(0,d.useEffect)(()=>{e&&i({"populate[favorites][populate][product_set][populate][product][populate]":"image","populate[favorites][populate][header]":"*","populate[favorites][populate][section]":"*","populate[favorites][populate][image]":"*","populate[favorites][populate][images]":"*","filters[user]":e.id,"filters[application]":1}).unwrap().then(t=>{if(t.data[0]&&t.data[0].attributes.favorites.data.length>0){let e=[];t.data[0].attributes.favorites.data.map(t=>{e.push(t)}),h(e)}}).catch(t=>console.warn(t))},[t,null==e?void 0:e.id]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s(),{children:[(0,a.jsx)("title",{children:"Избранное - НПК Оптисалт"}),(0,a.jsx)("meta",{name:"description",content:"Избранное - НПК Оптисалт"}),(0,a.jsx)("meta",{name:"keywords",content:"Избранное - НПК Оптисалт"}),(0,a.jsx)("meta",{name:"robots",content:"index, follow"})]}),(0,a.jsx)(r.Z,{title:"Избранное"}),(0,a.jsx)(l.Z,{title:"Избранное"}),(0,a.jsx)("div",{className:"flex flex-wrap",children:e?c.length>0?c.map(t=>(0,a.jsx)("div",{className:"w-full xs:w-1/2 md:w-1/3 lg:w-1/4 p-2.5",children:(0,a.jsx)(p.Z,{product:t})},t.id)):(0,a.jsx)(u(),{href:"/catalog/",children:"В каталог"}):t.length>0?t.map(t=>(0,a.jsx)("div",{className:"w-full xs:w-1/2 md:w-1/3 lg:w-1/4 p-2.5",children:(0,a.jsx)(p.Z,{product:t})},t.id)):(0,a.jsx)(u(),{href:"/catalog/",children:"В каталог"})})]})}},36929:function(){},44233:function(){},71431:function(){},74717:function(t){t.exports={item:"BreadcrumbItem_item__MLbRw",itemLast:"BreadcrumbItem_itemLast__4oVpP"}}},function(t){t.O(0,[8933,9509,2606,5646,1987,8935,9774,2888,179],function(){return t(t.s=64426)}),_N_E=t.O()}]);