1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1177],{10512:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(71847).A)("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]])},21177:(e,t,s)=>{s.r(t),s.d(t,{WbArticleSheet:()=>A});var a=s(95155),r=s(12115),o=s(27063),d=s(64269),l=s(26991),i=s(73850),n=s(68425),c=s(47734),x=s(73697),h=s(23508),m=s(77568),u=s(80019),j=s(47643),p=s(20562),v=s(8803),f=s(7125),y=s(26617),N=s(35299),b=s(57828),g=s(10512),k=s(42529);function _(e){let{label:t,icon:s,value:r,prevValue:o,conversionPct:l,isFirst:i}=e,n=r-o,c=o>0?(r-o)/o*100:100*(r>0);return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[!i&&(0,a.jsx)("div",{className:"text-muted-foreground text-xs w-8 text-right",children:void 0!==l?"".concat(Number(l).toFixed(1),"%"):""}),i&&(0,a.jsx)("div",{className:"w-8"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"h-8 w-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(s,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-sm",children:(0,d.ZV)(r)}),(o>0||r>0)&&(0,a.jsxs)("span",{className:(0,d.cn)("text-[10px] flex items-center gap-0.5",n>0&&"text-green-600",n<0&&"text-red-600",0===n&&"text-muted-foreground"),children:[n>0?(0,a.jsx)(p.A,{className:"h-2.5 w-2.5"}):n<0?(0,a.jsx)(v.A,{className:"h-2.5 w-2.5"}):(0,a.jsx)(f.A,{className:"h-2.5 w-2.5"}),Math.abs(c).toFixed(0),"%"]})]})]})]})]})}let w={contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:"12px",color:"hsl(var(--popover-foreground))"}};function A(e){let{saName:t,imageUrl:s,open:p,onOpenChange:v,dateFrom:f,dateTo:A,accountId:C}=e,[S,W]=r.useState(null),[z,K]=r.useState(!1);r.useEffect(()=>{if(!t||!p)return void W(null);K(!0);let e=new URLSearchParams({saName:t,from:f,to:A});C&&e.set("accountId",String(C)),fetch("/api/wb/article-stats?".concat(e)).then(e=>e.json()).then(e=>W(e)).catch(console.error).finally(()=>K(!1))},[t,p,f,A,C]);let M=r.useMemo(()=>(null==S?void 0:S.daily)?S.daily.map(e=>({date:new Date(e.report_date).toLocaleDateString("ru-RU",{day:"numeric",month:"short"}),views:e.open_card_count,cart:e.add_to_cart_count,orders:e.orders_count,buyouts:e.buyouts_count,cartConv:Number(e.add_to_cart_conversion)||0,orderConv:Number(e.cart_to_order_conversion)||0,buyoutPct:Number(e.buyout_percent)||0})):[],[S]),F=null==S?void 0:S.totals,P=null==S?void 0:S.prevTotals;return(0,a.jsx)(o.cj,{open:p,onOpenChange:v,children:(0,a.jsxs)(o.h,{side:"right",className:"w-full sm:max-w-lg overflow-y-auto",children:[(0,a.jsx)(o.Fm,{className:"pr-8",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(()=>{let e=(0,d.Me)(s);return e?(0,a.jsx)("img",{src:e,alt:t||"",className:"h-10 w-10 rounded object-cover flex-shrink-0"}):(0,a.jsx)("div",{className:"h-10 w-10 rounded bg-muted flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(y.A,{className:"h-5 w-5 text-muted-foreground"})})})(),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.qp,{className:"text-base",children:t}),(0,a.jsx)(o.Qs,{children:"СÑаÑиÑÑика воÑонки пÑодаж"})]})]})}),z&&(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(N.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),!z&&S&&F&&P&&(0,a.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-3",children:"ÐоÑонка за пеÑиод"}),(0,a.jsxs)("div",{className:"space-y-2 bg-muted/50 rounded-lg p-4",children:[(0,a.jsx)(_,{label:"ÐеÑеÑ
Ð¾Ð´Ñ Ð² каÑÑоÑкÑ",icon:b.A,value:F.total_views,prevValue:P.total_views,isFirst:!0}),(0,a.jsx)("div",{className:"border-l-2 border-dashed border-muted-foreground
1/20 ml-[52px] h-2"}),(0,a.jsx)(_,{label:"ÐÐ¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² коÑзинÑ",icon:g.A,value:F.total_cart,prevValue:P.total_cart,conversionPct:F.avg_cart_conversion}),(0,a.jsx)("div",{className:"border-l-2 border-dashed border-muted-foreground/20 ml-[52px] h-2"}),(0,a.jsx)(_,{label:"ÐаказÑ",icon:y.A,value:F.total_orders,prevValue:P.total_orders,conversionPct:F.avg_order_conversion}),(0,a.jsx)("div",{className:"border-l-2 border-dashed border-muted-foreground/20 ml-[52px] h-2"}),(0,a.jsx)(_,{label:"ÐÑкÑпÑ",icon:k.A,value:F.total_buyouts,prevValue:P.total_buyouts,conversionPct:F.avg_buyout_percent})]})]}),M.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-3",children:"ÐеÑеÑ
Ð¾Ð´Ñ Ð² каÑÑоÑкÑ"}),(0,a.jsx)("div",{className:"h-40",children:(0,a.jsx)(l.u,{width:"100%",height:"100%",children:(0,a.jsxs)(i.Q,{data:M,children:[(0,a.jsx)(n.d,{strokeDasharray:"3 3",className:"stroke-muted"}),(0,a.jsx)(c.W,{dataKey:"date",tick:{fontSize:10}}),(0,a.jsx)(x.h,{tick:{fontSize:10},width:40}),(0,a.jsx)(h.m,{...w}),(0,a.jsx)(m.G,{type:"monotone",dataKey:"views",name:"ÐеÑеÑ
одÑ",stroke:"hsl(262, 83%, 58%)",fill:"hsl(262, 83%, 58%)",fillOpacity:.15,strokeWidth:2})]})})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-3",children:"ÐоÑзина и заказÑ"}),(0,a.jsx)("div",{className:"h-40",children:(0,a.jsx)(l.u,{width:"100%",height:"100%",children:(0,a.jsxs)(u.b,{data:M,children:[(0,a.jsx)(n.d,{strokeDasharray:"3 3",className:"stroke-muted"}),(0,a.jsx)(c.W,{dataKey:"date",tick:{fontSize:10}}),(0,a.jsx)(x.h,{tick:{fontSize:10},width:40}),(0,a.jsx)(h.m,{...w}),(0,a.jsx)(j.N,{type:"monotone",dataKey:"cart",name:"ÐоÑзина",stroke:"hsl(25, 95%, 53%)",strokeWidth:2,dot:!1}),(0,a.jsx)(j.N,{type:"monotone",dataKey:"orders",name:"ÐаказÑ",stroke:"hsl(142, 76%, 36%)",strokeWidth:2,dot:!1})]})})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-3",children:"ÐонвеÑÑии (%)"}),(0,a.jsx)("div",{className:"h-40",children:(0,a.jsx)(l.u,{width:"100%",height:"100%",children:(0,a.jsxs)(u.b,{data:M,children:[(0,a.jsx)(n.d,{strokeDasharray:"3 3",className:"stroke-muted"}),(0,a.jsx)(c.W,{dataKey:"date",tick:{fontSize:10}}),(0,a.jsx)(x.h,{tick:{fontSize:10},width:40,unit:"%"}),(0,a.jsx)(h.m,{...w,formatter:e=>"".concat(Number(e).toFixed(1),"%")}),(0,a.jsx)(j.N,{type:"monotone",dataKey:"cartConv",name:"ÐÑкÑÑÑие â ÐоÑзина",stroke:"hsl(25, 95%, 53%)",strokeWidth:2,dot:!1}),(0,a.jsx)(j.N,{type:"monotone",dataKey:"orderConv",name:"ÐоÑзина â Ðаказ",stroke:"hsl(142, 76%, 36%)",strokeWidth:2,dot:!1}),(0,a.jsx)(j.N,{type:"monotone",dataKey:"buyoutPct",name:"% вÑкÑпа",stroke:"hsl(262, 83%, 58%)",strokeWidth:2,dot:!1})]})})})]})]}),M.length<=1&&(0,a.jsx)("div",{className:"text-sm text-muted-foreground text-center py-4",children:"ÐедоÑÑаÑоÑно даннÑÑ
Ð´Ð»Ñ Ð³ÑаÑиков (нÑжно минимÑм 2 днÑ)"})]}),!z&&(!S||!F)&&t&&(0,a.jsx)("div",{className:"text-sm text-muted-foreground text-center py-12",children:"ÐÐµÑ Ð´Ð°Ð½Ð½ÑÑ
ÑÑаÑиÑÑики Ð´Ð»Ñ ÑÑого аÑÑикÑла"})]})})}},35299:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},42529:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(71847).A)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},73850:(e,t,s)=>{s.d(t,{Q:()=>i});var a=s(66278),r=s(77568),o=s(47734),d=s(73697),l=s(36164),i=(0,a.gu)({chartName:"AreaChart",GraphicalChild:r.G,axisComponents:[{axisType:"xAxis",AxisComp:o.W},{axisType:"yAxis",AxisComp:d.h}],formatAxisMap:l.pr})},80019:(e,t,s)=>{s.d(t,{b:()=>i});var a=s(66278),r=s(47643),o=s(47734),d=s(73697),l=s(36164),i=(0,a.gu)({chartName:"LineChart",GraphicalChild:r.N,axisComponents:[{axisType:"xAxis",AxisComp:o.W},{axisType:"yAxis",AxisComp:d.h}],formatAxisMap:l.pr})}}]);
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.