PageSourceSearch

https://kupitkartinu.ru/_next/static/chunks/7706-818a201d064a69cf.js

js kupitkartinu.ru collected 2026-10-02 11:17:27 UTC 7,572 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7706],{2251:(e,t,r)=>{r.d(t,{I:()=>c});var a=r(5959),s=r(9863);let c=(0,a.v)()((0,s.Zr)((e,t)=>({items:[],addItem:r=>{let a=t().items;a.find(e=>e.id===r.id)||e({items:[...a,r]})},removeItem:r=>{e({items:t().items.filter(e=>e.id!==r)})},toggleItem:e=>t().items.find(t=>t.id===e.id)?(t().removeItem(e.id),!1):(t().addItem(e),!0),clearFavorites:()=>{e({items:[]})},isFavorite:e=>t().items.some(t=>t.id===e),getTotalItems:()=>t().items.length}),{name:"favorites-storage"}))},4051:(e,t,r)=>{r.d(t,{$g:()=>p,AU:()=>m,Q_:()=>d});var a=r(6551);let s=null,c=null,n=(0,a.UW)("currencies");async function l(){return s||(s=(async()=>{try{let e=new AbortController,t=setTimeout(()=>{console.log("[Currency] Request timeout after 15s"),e.abort()},15e3),r=await fetch(n,{signal:e.signal,headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"NextJS-App/1.0"},next:{revalidate:3600}});if(clearTimeout(t),console.log("[Currency] Response status:",r.status),!r.ok){let e=await r.text();throw console.error("[Currency] API error:",{status:r.status,statusText:r.statusText,body:e.substring(0,200)}),Error("HTTP error! status: ".concat(r.status))}let a=await r.json();if(console.log("[Currency] API response data:",a),a.success&&a.currencies){console.log("[Currency] ✅ Currencies loaded:",Object.keys(a.currencies)),c={};let e={};return Object.entries(a.currencies).forEach(t=>{let[r,a]=t;e[r]=a.rate,c[r]={name:a.name,symbol:a.symbol}}),e}throw Error("Failed to fetch currencies")}catch(t){let e=o();return c={RUB:{name:"Российский рубль",symbol:"₽"},USD:{name:"Доллар США",symbol:"$"},EUR:{name:"Евро",symbol:"€"},GBP:{name:"Фунт стерлингов",symbol:"\xa3"}},e}finally{setTimeout(()=>{s=null},216e5)}})())}function o(){return{USD:90,EUR:98,GBP:115,RUB:1}}let i={"₽":"RUB",руб:"RUB",рублей:"RUB",$:"USD",usd:"USD","€":"EUR",eur:"EUR","\xa3":"GBP",gbp:"GBP"};async function u(e){let t=i[e.toLowerCase().trim()];t||(t=e.toUpperCase().replace(/[₽$€£]/g,"").trim());try{return(await l())[t]||1}catch(e){return o()[t]||1}}async function d(e,t){let r;return isNaN(r="string"==typeof e?parseFloat(e.replace(/\s/g,"").replace(",",".")):e)||r<=0?0:r*await u(t)}function p(e){return"".concat(Math.round(e).toLocaleString("ru-RU")," ₽")}async function m(){try{await l()}catch(e){}}},6551:(e,t,r)=>{r.d(t,{UW:()=>s});var a=r(5704);function s(e){let t=e.replace(/^\/+/,"").replace(/^custom\/v1\//,""),r="custom/v1/".concat(t).replace(/^\/+/,"");return"".concat((a.env.WP_API_URL||"https://kupitkartinu.ru").replace(/\/$/,"").replace(/\/wp-json$/i,""),"/wp-json/").concat(r)}},7706:(e,t,r)=>{r.d(t,{ProductCard:()=>d});var a=r(5155),s=r(5239),c=r(2115);let n=(0,r(1847).A)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);var l=r(2251),o=r(2619),i=r.n(o),u=r(4051);let d=e=>{let{id:t,slug:r,title:o,subtitle:d,artistSlug:p,price:m,details:h,size:x,country:f,year:g,imageUrl:y,priority:b=!1,originalPrice:j,currency:v="₽"}=e,[w,U]=(0,c.useState)(!1),[N,S]=(0,c.useState)(!1),[C,R]=(0,c.useState)(!1),[k,I]=(0,c.useState)(0),[E,P]=(0,c.useState)(0),[T,A]=(0,c.useState)(!1),[F,B]=(0,c.useState)("number"==typeof m?"".concat(m.toLocaleString("ru-RU")," ₽"):m),[L,_]=(0,c.useState)(!1),[D,$]=(0,c.useState)(!1),[G,W]=(0,c.useState)(null),z=(0,l.I)(e=>e.toggleItem),q=(0,l.I)(e=>e.isFavorite(t||"".concat(o,"-").concat(Date.now())));(0,c.useEffect)(()=>{let e=!0;return(async()=>{try{await (0,u.AU)(),e&&$(!0)}catch(t){console.error("[ProductCard] Failed to load exchange rates:",t),e&&$(!0)}})(),()=>{e=!1}},[]),(0,c.useEffect)(()=>{let e=!0;return(async()=>{if(!D)return;let t=null;if(null!=j){if("number"==typeof j)t=j;else if("string"==typeof j){let e=parseFloat(j.replace(/[^\d.-]/g,""));isNaN(e)||(t=e)}}if(null===t){if("number"==typeof m)t=m;else if("string"==typeof m){let e=parseFloat(m.replace(/[^\d.-]/g,""));isNaN(e)||(t=e)}}if(null===t||0===t){e&&B("string"==typeof m?m:"".concat(m," ₽"));return}if("₽"!==v&&"RUB"!==v){_(!0),W(null);try{let r=await (0,u.Q_)(t,v);e&&(r>
10?B((0,u.$g)(r)):(B("".concat(t.toLocaleString("ru-RU")," ").concat(v)),W("Курс не найден")))}catch(r){console.error("[ProductCard] Error converting price:",r),e&&(B("".concat(t.toLocaleString("ru-RU")," ").concat(v)),W("Ошибка конвертации"))}finally{e&&_(!1)}}else e&&B("".concat(t.toLocaleString("ru-RU")," ₽"))})(),()=>{e=!1}},[j,m,v,D]),(0,c.useEffect)(()=>{S(!0)},[]);let M=parseInt(F.replace(/[^\d]/g,""))||0,O=r?r.includes("/auctions/")?r:"/product/".concat(r):"#";return(0,a.jsxs)("div",{className:"",children:[(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsx)(i(),{href:O,className:"flex items-center bg-custom-gray-light py-3 px-3  h-[415px]",children:y&&(0,a.jsx)("div",{className:"w-full aspect-square relative overflow-hidden bg-gray-100 h-[370px]",children:(0,a.jsx)(s.default,{src:y||"https://placehold.co/400x500/e5e5e5/gray?text=No+Image",alt:o,fill:!0,sizes:"(max-width: 640px) 280px, (max-width: 1024px) 50vw, 33vw",className:"object-contain transition-opacity duration-300",priority:b,unoptimized:T,onError:()=>{0===k?setTimeout(()=>{I(1),P(e=>e+1)},500):1===k?setTimeout(()=>{I(2),P(e=>e+1)},1e3):2===k?(A(!0),I(3),P(e=>e+1)):R(!0)}},E)})}),L&&(0,a.jsx)("div",{className:"absolute top-2 right-2 bg-black/50 text-white text-xs px-2 py-1 rounded",children:"⟳"}),(0,a.jsx)("button",{onClick:e=>{e.preventDefault(),U(!0);let a=null!=j?"number"==typeof j?j:parseFloat(String(j).replace(/[^\d.-]/g,""))||null:null;z({id:t||"".concat(o,"-").concat(Date.now()),slug:r,artistSlug:p,title:o||"",subtitle:d||"",price:M,originalPrice:a,currency:v,details:h,size:x,country:f,year:g,imageUrl:y}),setTimeout(()=>U(!1),600)},className:"absolute top-10 right-7 w-8 h-8 rounded-full bg-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300 hover:bg-gray-100 z-10 shadow-md [@media(max-width:480px)]:opacity-[1]","aria-label":N&&q?"Удалить из избранного":"Добавить в избранное",children:(0,a.jsx)(n,{className:"w-5 h-5 transition-all duration-300 ".concat(N&&q?"fill-red-500 stroke-red-500":"stroke-black"," ").concat(w?"scale-125":"scale-100"),strokeWidth:1.5})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center text-center mt-10",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-7 justify-center items-center",children:[(0,a.jsxs)("p",{className:"text-custom-gray-dark text-base",children:["\xab",o,"\xbb"]}),(0,a.jsx)("div",{className:"font-gibb text-2xl max-w-[400px]",children:p&&d&&""!==d.trim()&&"неизвестный художник"!=d&&"художник не указан"!==d.toLowerCase()&&"неизвестно"!==d.toLowerCase()?(0,a.jsx)(i(),{href:"/artists/".concat(p),className:"hover:underline cursor-pointer text-[24px] uppercase",children:d}):""}),F&&"0 ₽"!=F&&(0,a.jsx)("p",{className:"text-lg",children:F})]}),(0,a.jsxs)("div",{className:"text-sm text-custom-gray-dark",children:[(0,a.jsx)("span",{children:h}),(0,a.jsx)("span",{children:" • "}),x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:x}),(0,a.jsx)("span",{children:" • "})]}),f&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:f}),(0,a.jsx)("span",{children:" • "})]}),g&&(0,a.jsx)("span",{children:g})]})]})]})}}}]);

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.