PageSourceSearch

https://planeta-avtodv.ru/_next/static/chunks/pages/items/[id]-7ed25cd9eca1c124.js

js planeta-avtodv.ru collected 2026-10-08 10:00:49 UTC 14,965 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2075],{8559:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/items/[id]",function(){return t(1675)}])},2296:function(e,s,t){"use strict";var a=t(5893),i=t(7294),l=t(8100),r=t(4635),n=t(8575);let d=({cross:e})=>(0,a.jsxs)("div",{role:"status",className:"py-1",children:[(0,a.jsx)("span",{className:"sr-only",children:e?"Загружаем кросс-аналоги…":"Загружаем аналоги…"}),(0,a.jsx)("div",{"aria-hidden":"true",className:"space-y-2 motion-safe:animate-pulse",children:[0,1,2,3].map(e=>(0,a.jsxs)("div",{className:"flex min-h-[72px] items-center gap-3 py-2",children:[(0,a.jsx)("div",{className:"hidden h-12 w-12 shrink-0 bg-gray-100 md:block"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,a.jsx)("div",{className:`${e%2==0?"w-4/5":"w-2/3"} h-3 bg-gray-200`}),(0,a.jsx)("div",{className:"h-2.5 w-1/3 bg-gray-100"}),(0,a.jsx)("div",{className:"h-2.5 w-1/2 bg-gray-100 md:hidden"})]}),(0,a.jsxs)("div",{className:"hidden w-24 shrink-0 space-y-2 md:block",children:[(0,a.jsx)("div",{className:"h-3 w-20 bg-gray-200"}),(0,a.jsx)("div",{className:"h-2.5 w-14 bg-gray-100"})]})]},e))})]}),c=({item:e,modal:s=!1,cross:t=!1})=>{let c=(0,n.Kv)(),[o,m]=i.useState(1),{data:x,error:u,mutate:h}=(0,l.ZP)(`items/${e.searchId}/analogs?page=${o}${t?"&match_type=cross":""}`,{revalidateOnFocus:!1});return u?(0,a.jsxs)("div",{role:"alert",className:"py-4 text-sm",children:["Не удалось загрузить ",t?"кросс-аналоги":"аналоги",".",(0,a.jsx)("button",{type:"button",onClick:()=>h(),className:"ml-2 text-red-700 underline underline-offset-2",children:"Повторить"})]}):x?0===x.totalItems?(0,a.jsx)("p",{className:"py-4 text-sm text-slate-600",children:t?"Кросс-аналоги не найдены.":"Среди проиндексированных запчастей совпадений по OEM не найдено."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{compact:s,items:x.items,sourceAttribution:{origin:c.origin,selection:t?"cross_analog":"direct_analog",sourceItemId:e.id}}),x.totalPages>1&&(0,a.jsxs)("nav",{"aria-label":t?"Страницы кросс-аналогов":"Страницы аналогов",className:"my-4 flex items-center gap-4 text-sm",children:[(0,a.jsx)("button",{type:"button",disabled:o<=1,onClick:()=>m(e=>e-1),className:"rounded border border-slate-300 px-3 py-2 disabled:opacity-40",children:"Назад"}),(0,a.jsxs)("span",{children:[o," из ",x.totalPages]}),(0,a.jsx)("button",{type:"button",disabled:o>=x.totalPages,onClick:()=>m(e=>e+1),className:"rounded border border-slate-300 px-3 py-2 disabled:opacity-40",children:"Далее"})]})]}):(0,a.jsx)(d,{cross:t})},o=({item:e,modal:s=!1})=>{let t=i.useId(),l=s?`${t}-analogs-title`:"analogs-title",r=`${t}-cross-analogs-title`,n=`${t}-cross-analogs`,[d,o]=i.useState(!1),m=i.useRef(null);return i.useEffect(()=>{if(s||"#analogs"!==window.location.hash)return;let e=window.requestAnimationFrame(()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.scrollIntoView({block:"start"})});return()=>window.cancelAnimationFrame(e)},[e.id,s]),(0,a.jsxs)("section",{ref:m,id:s?void 0:"analogs","aria-labelledby":l,className:`${s?"":"mt-4"} scroll-mt-28 [&_.ProductTable-row]:!py-1 [&_.ProductTable-cell-image]:!p-1 md:[&_.ProductTable-cell-image]:!h-16 md:[&_.ProductTable-cell-image]:!w-16 md:[&_.ProductTable-head-image]:!w-16`,children:[(0,a.jsx)("h2",{id:l,className:s?"sr-only":"!mb-0 text-lg font-semibold",children:"Аналоги"}),(0,a.jsx)("p",{className:"mb-2 mt-1 text-sm text-slate-600",children:"Проверьте применяемость перед заказом."}),(0,a.jsx)(c,{item:e,modal:s}),(0,a.jsx)("button",{type:"button","aria-expanded":d,"aria-controls":n,onClick:()=>o(e=>!e),className:"my-3 text-sm text-gray-600 underline underline-offset-4 hover:text-gray-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-gray-500",children:d?"Скрыть кросс-аналоги":"Показать кросс-аналоги"}),(0,a.jsx)("section",{id:n,"aria-labelledby":r,hidden:!d,children:d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{id:r,className:"mb-1 text-sm font-medium",children:"Через общий аналог"}),(0,a.jsx)(c,{item:e,modal:s,cross:!0})]})})]})};s.Z=e=>(0,a.jsx)(o,{...e},e.item.id)},1705:function(e,s,t){"use strict";t.d(s,{hi:function(){return o}});var a=t(9669),i=t.n(a),l=t(895),r=t.n(l);t(1163);var n=t(6264),d=t.n(n);let c=(0,t(640).uR)(),o=i().create({baseURL:c,withCredentials:!0,transformResponse:[...i().defaults.transformResponse,e=>d().camelizeKeys(e,function(e,s){return/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/.test(e)?e:s(e)})],transformRequest:[e=>d().decamelizeKeys(e),...i().defaults.transformRequest]});o.interceptors.request.use(function(e){let s=r().get("token",{path:"/",domain:"planeta-avtodv.ru"})||void 0;return s&&(e.headers.Authorization=`${s}`),e},function(e){return Promise.reject(e)})},1675:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return R}});
1var a=t(5893),i=t(9008),l=t.n(i),r=t(1163),n=t(7294),d=t(8100),c=t(2296);function o({item:e}){var s;return(null===(s=e.text)||void 0===s?void 0:s.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim())?(0,a.jsxs)("section",{"aria-labelledby":"item-description",className:"mt-4",children:[(0,a.jsx)("h2",{id:"item-description",className:"!mb-2 !text-sm !font-semibold",children:"Описание"}),(0,a.jsx)("div",{className:"text-xs leading-relaxed text-slate-600 [&_img]:max-w-full",dangerouslySetInnerHTML:{__html:e.text}})]}):null}var m=t(1664),x=t.n(m),u=t(5457),h=t(7516),p=t(9749),f=t(9004),b=t(3204),v=t(4622),j=t(5192),g=t(4335),N=t(4224);let y="flex min-h-[36px] w-full items-center justify-center gap-2 rounded-md px-2 py-2 text-xs font-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-700 disabled:cursor-wait disabled:opacity-50";function w({item:e}){var s;let t=(0,r.useRouter)(),{isLogin:i,canOrder:l}=(0,v.Z)(),[c]=(0,j.Z)(),[o,m]=n.useState(!!e.isFavorite),[u,h]=n.useState(!1),[p,f]=n.useState(""),w=n.useRef(!1);n.useEffect(()=>m(!!e.isFavorite),[e.isFavorite]);let _=async()=>{if(!w.current){if(!i){t.push("/signin");return}w.current=!0,h(!0),f("");try{var s;let t=await g.hi.post(`/items/${e.id}/set_favorite`);if(!["create","delete"].includes(null===(s=t.data)||void 0===s?void 0:s.success))throw Error("Favorite update failed");m("create"===t.data.success),(0,d.JG)(`items/${e.searchId}`),(0,d.JG)("/items/favorites")}catch{f("Не удалось обновить избранное. Попробуйте ещё раз.")}finally{w.current=!1,h(!1)}}};return(0,a.jsxs)("div",{className:"mt-3 w-full max-w-[240px] space-y-2",children:[l?(0,a.jsxs)("section",{"aria-label":"Количество и корзины",children:[(0,a.jsx)("p",{className:"mb-2 text-xs text-slate-500",children:"Количество"}),c&&(c.currentId||(null===(s=c.cartItems)||void 0===s?void 0:s[e.id]))?(0,a.jsx)(N.Z,{item:e,presentation:"card"}):(0,a.jsx)(x(),{href:"/cart",className:`${y} border border-slate-200 !text-slate-700`,children:"Открыть корзины"})]}):i?(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Заказ недоступен для вашей учётной записи."}):(0,a.jsx)(x(),{href:"/signin",className:`${y} bg-red-700 !text-white hover:bg-red-800`,children:"Войти для заказа"}),(0,a.jsxs)("button",{type:"button",onClick:_,disabled:u,"aria-pressed":o,"aria-label":o?"Удалить из избранного":"Добавить в избранное",className:`${y} border ${o?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-white text-slate-700 hover:border-slate-400"}`,children:[(0,a.jsx)(b.Z,{className:`h-4 w-4 shrink-0 ${o?"fill-red-700":""}`,"aria-hidden":"true"}),u?"Сохраняем…":o?"В избранном":"В избранное"]}),p&&(0,a.jsx)("p",{role:"alert",className:"text-xs leading-relaxed text-red-700",children:p})]})}function _({item:e}){var s,t,i,l,r,n,d;let c=[["Применяемость",null===(s=e.properties)||void 0===s?void 0:s.applicability],["Страна",null===(t=e.properties)||void 0===t?void 0:t.country],["Гарантия",null===(i=e.properties)||void 0===i?void 0:i.guaranteePeriod],["Размер",null===(l=e.properties)||void 0===l?void 0:l.size],["Тип",null===(r=e.properties)||void 0===r?void 0:r.type],["В упаковке",null===(n=e.properties)||void 0===n?void 0:n.inPack],...(e.catalogItemProperties||[]).map(e=>[e.title,e.value])].filter(([,e])=>null!=e&&""!==String(e).trim());return(0,a.jsxs)("div",{children:[(0,a.jsx)("dl",{className:"space-y-2 text-xs leading-relaxed",children:c.map(([e,s],t)=>(0,a.jsxs)("div",{className:"grid grid-cols-[100px_minmax(0,1fr)] gap-3 pb-2",children:[(0,a.jsx)("dt",{className:"text-slate-500",children:e}),(0,a.jsx)("dd",{className:"m-0 break-words text-slate-800",children:s})]},`${e}-${t}`))}),(0,a.jsx)(f.G,{feature:e.accountingFeature,tnved:null===(d=e.properties)||void 0===d?void 0:d.tnved,className:"mt-2"})]})}function k({item:e}
1){let s=Array.from(new Set((e.oemString||"").split(/[;,\s]+/).filter(e=>e.length>5)));return(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.length?s.map(e=>(0,a.jsx)(x(),{prefetch:!1,href:{pathname:"/search",query:{query:e,query_index:"part_number"}},className:"rounded border border-slate-200 bg-white px-2 py-1 text-[11px] !text-slate-700 hover:border-red-400 hover:!text-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-700",children:e},e)):(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"OEM не указаны"})})}function $({item:e}){return(0,a.jsxs)("p",{className:"flex items-start gap-1.5 text-xs leading-relaxed","aria-label":"Остаток товара",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:`mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full ${e.avaiable?"bg-emerald-600":"bg-slate-400"}`}),(0,a.jsxs)("span",{className:"text-slate-500",children:["Остаток: ",(0,a.jsx)("span",{className:e.avaiable?"font-medium text-emerald-700":"text-slate-600",children:e.avaiableQty??(e.avaiable?"в наличии":"нет на складе")})]})]})}function P({item:e}){var s;return(0,a.jsxs)("header",{className:"min-w-0",children:[(0,a.jsx)("h1",{className:"!m-0 !text-lg !font-semibold !leading-snug !text-slate-900 sm:!text-xl",children:e.title}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-500",children:[(0,a.jsxs)("span",{children:["Код ",(0,a.jsx)("strong",{className:"font-medium text-slate-800",children:(null===(s=e.properties)||void 0===s?void 0:s.code)||e.code})]}),(0,a.jsxs)("span",{children:["Артикул ",(0,a.jsx)("strong",{className:"font-medium text-slate-800",children:e.article})]})]})]})}function I({item:e}){let s=(0,a.jsx)(h.by,{item:e,compact:!0}),t=(0,a.jsx)(_,{item:e}),i=(0,a.jsx)(P,{item:e});return(0,a.jsxs)("article",{className:"min-w-0 text-slate-900",children:[(0,a.jsxs)(l(),{children:[(0,a.jsx)("title",{children:e.seoTitle}),(0,a.jsx)("meta",{name:"description",content:e.seoDescription})]}),(0,a.jsxs)("div",{children:[i,(0,a.jsxs)("div",{className:"mt-5 grid items-start gap-5 lg:grid-cols-[200px_minmax(0,1fr)] xl:grid-cols-[220px_minmax(0,1fr)]",children:[(0,a.jsxs)("div",{className:"mx-auto w-full max-w-[280px] rounded-lg border border-slate-100 bg-white p-3 lg:max-w-none",children:[s,(0,a.jsx)("p",{className:"mt-2 text-center text-[11px] text-slate-400",children:"Нажмите на фото, чтобы увеличить"})]}),(0,a.jsxs)("div",{className:"min-w-0 space-y-4",children:[(0,a.jsxs)("section",{"aria-labelledby":"item-main-info",children:[(0,a.jsx)("h2",{id:"item-main-info",className:"!m-0 rounded-md bg-slate-100 px-3 py-2 !text-sm !font-semibold !text-slate-900",children:"Основная информация"}),(0,a.jsx)("div",{className:"px-3 pt-3",children:t})]}),(0,a.jsxs)("section",{"aria-label":"Предложение",children:[(0,a.jsxs)("div",{className:"grid items-center gap-3 px-3 pb-3 pt-1 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_150px]",children:[(0,a.jsx)("div",{className:"pt-3",children:(0,a.jsx)($,{item:e})}),(0,a.jsxs)("div",{className:"pt-3",children:[(0,a.jsx)("p",{className:"mb-1 text-[11px] text-slate-500",children:"Цена за единицу"}),(0,a.jsx)("div",{className:"whitespace-nowrap text-xl font-semibold text-slate-950",children:(0,u.Z)(e.price)}),(0,a.jsx)(p.et,{item:e})]}),(0,a.jsx)(w,{item:e})]}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1 px-3",children:[(0,a.jsx)(p.Ee,{item:e}),(0,a.jsx)(p.nI,{item:e})]})]})]})]}),(0,a.jsxs)("section",{"aria-labelledby":"item-numbers",className:"mt-5 pt-4",children:[(0,a.jsx)("h2",{id:"item-numbers",className:"!mb-3 !text-sm !font-semibold",children:"OEM-номера"}),(0,a.jsx)(k,{item:e})]})]})]})}function q({item:e,categories:s}){let t=[{title:"Главная",href:"/"},{title:"Каталог",href:"/catalog"},...(s??(e.group?[e.group]:[])).map(e=>({title:e.title,href:`/catalog/${e.link}`})),{title:e.title,href:null}];return(0,a.jsx)("nav",{"aria-label":"Хлебные крошки",className:"mb-5 text-xs leading-relaxed text-slate-500",children:(0,a.jsx)("ol",{className:"!m-0 flex list-none flex-wrap items-baseline gap-x-2 gap-y-1 !p-0",children:t.map((e,s)=>(0,a.jsxs)("li",{className:"flex min-w-0 max-w-full items-baseline gap-2",children:[s>0&&(0,a.jsx)("span",{"aria-hidden":"true",className:"shrink-0 text-slate-400",children:"/"}),e.href?(0,a.jsx)(x(),{href:e.href,className:"min-w-0 break-words !text-slate-500 hover:!text-red-700 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-700",children:e.title}):(0,a.jsx)("span",{"aria-current":"page",className:"min-w-0 break-words text-slate-700",children:e.title})]},e.href??"current"))})})}var E=t(7866),F=t(1705);let Z=()=>{let e=(0,r.useRouter)(),{data:s}=(0,d.ZP)(`items/${e.query.id}`);return(0,a.jsx)(E.Z,{children:(0,a.jsx)("div",{children:s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("link",{rel:"canonical",href:`https://planeta-avtodv.ru/items/${s.item.searchId}`},"canonical")}),(0,a.jsx)(q,{item:s.item,categories:s.breadcrumbs}),(0,a.jsx)(I,{item:s.item},s.item.id),(0,a.jsx)(c.Z,{item:s.item},s.item.id),(0,a.jsx)(o,{item:s.item})]})})})};Z.getInitialProps=async e=>{var s,t;let a=`items/${e.query.id}`,i={};return(null===(t=e.req)||void 0===t?void 0:null===(s=t.cookies)||void 0===s?void 0:s.token)&&(i={Authorization:e.req.cookies.token}),{[a]:(await F.hi.get(`items/${e.query.id}`,{headers:i})).data}};var R=Z}},function(e){e.O(0,[7272,5886,4635,2888,9774,179],function(){return e(e.s=8559)}),_N_E=e.O()}]);

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.