import{j as t,e as D,L as B,U as T}from"./main-7700519c.js";import{c as y}from"./chunk-index-cacabe40.js";import{m as S,i as K,u as q,k as h,j as J,G as p,g as j,C as V,at as X,aA as Y,an as Z,l as w,d as b}from"./chunk-material-ui-241eb317.js";import{r as U}from"./chunk-react-caacd912.js";import{s as tt,W as et,B as ot,b as at,N as st}from"./chunk-index-f0886601.js";const rt=S(o=>({cardRoot:{position:"relative",border:"unset",borderRadius:"unset",overflow:"unset"}}),{name:"ProductCard"}),mt=o=>{const a=rt();return t.jsx(K,{variant:"outlined",classes:{root:y(a.cardRoot)},children:o.children})},ut=({url:o,imgUrl:a=[],imgTitle:m,imgAlt:u,technologies:r,badge:i,advertBadge:x,sizes:c,onClickSize:n,containerSize:d,productSku:f,inWishlist:F,setClickOnWishListIcon:C,isUserAuth:N,colorRef:A,parentRef:g,addWishList:I,wishListItem:z,selectColor:H,showDisplayProductSiazes:M,setShowDisplayProductSizes:L,onCardClick:O,productId:_,isComingSoon:k,setIsComingSoon:$})=>{var P,R;const e=tt(),G=D(),[v,Q]=U.useState(!1),W=q("(max-width: 1024px)"),E=s=>{n&&n(s)};return t.jsxs(h,{classes:{root:y(e.productRoot,d==="small"&&e.productSmall,d==="medium"&&e.productMedium,d==="big"&&e.productBig,d==="main"&&e.productMain)},component:"div",ref:g,children:[a==null?void 0:a.map(s=>t.jsx("link",{rel:"preload",href:s,as:"image"})),C&&t.jsx(et,{setClickOnWishListIcon:C,inWishlist:F,productSku:f,isUserAuth:N,colorRef:A,addWishList:I,wishListItem:z,parentRef:g}),t.jsxs(J,{onClick:async s=>{await O(s),G(o,{preventScrollReset:!0,state:{sku:f}})},component:B,to:o??"",classes:{root:e.containerLink},children:[t.jsxs(p,{classes:{root:e.badgeGrid},children:[i&&t.jsx(j,{classes:{root:y(e.badgeStyle,i==="SOON"?e.badgeSoon:e.badgeNew)},label:i}),!Array.isArray(x)&&t.jsx(ot,{...x})]}),t.jsxs(p,{classes:{root:y(e.productImgGrid,(a==null?void 0:a[1])&&e.imgHover)},children:[t.jsx(h,{component:"img",classes:{media:e.productImg},src:a==null?void 0:a[0],alt:u,title:m,loading:"lazy"}),(a==null?void 0:a[1])&&t.jsx(h,{component:"img",classes:{media:e.productImg},src:a[1],alt:u,title:m,loading:"lazy"})]}),t.jsx("meta",{itemProp:"image",content:a==null?void 0:a[0]}),t.jsx(h,{component:"img",classes:{media:e.productImgTechno},src:r==null?void 0:r.image,alt:r==null?void 0:r.name,title:r==null?void 0:r.name})]}),k?t.jsx(at,{productId:_,isComingSoon:k,setIsComingSoon:$}):M&&!W&&t.jsx(V,{maxWidth:!1,disableGutters:!0,classes:{root:e.sizeContainer},children:t.jsx(X,{mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:()=>L(!1),children:t.jsxs(p,{container:!0,spacing:1,children:[c&&((R=(P=Object.values(c))==null?void 0:P.sort((s,l)=>!!s.name<!!l.name?1:-1))==null?void 0:R.sort((s,l)=>!!s.is_available<!!l.is_available?1:-1).map((s,l)=>t.jsx(t.Fragment,{children:s.is_available?t.jsx(p,{item:!0,md:"auto",children:t.jsx(j,{onClick:()=>E(s.id),classes:{root:e.sizeBtn,outlined:e.sizeBtnOutlined,clickable:e.sizeBtnClickable},label:s.name,variant:"outlined"})},l):t.jsx(t.Fragment,{children:v&&t.jsx(p,{item:!0,md:"auto",children:t.jsx(st,{sizeTitle:s.name,productPreview:!0,colorName:H},s.id)},l)})}))),(c==null?void 0:c.find(s=>!s.is_available))&&t.jsx(p,{item:!0,md:"auto",children:t.jsx(j,{variant:"outlined",icon:v?t.jsx(Y,{}):t.jsx(Z,{}),classes:{root:y(e.sizeBtn,e.setNoQuantity),outlined:e.sizeBtnOutlined,clickable:e.sizeBtnClickable},onClick:()=>Q(s=>!s)})})]})})})]})},nt=S(o=>({link:{textDecoration:"none"},cardContentRoot:{padding:0,"&:not(:last-child)":{paddingBottom:o.spacing(1)},"&:last-child":{padding:0}},productCategory:{display:"block",fontFamily:"TTFirsNeue-Light, sans-serif",fontWeight:300,color:o.textColor.black60.color,fontSize:"0.875rem",lineHeight:"1.5rem","@media (max-width: 479px)":{fontSize:o.typography.pxToRem(12),lineHeight:o.typography.pxToRem(14)}},productName:{fontFamily:"TTFirsNeue-Regular,sans-serif",fontWeight:400,fontSize:"0.875rem",lineHeight:"1.5rem",textTransform:"none","@media (max-width: 479px)":{fontSize:o.typography.pxToRem(12),lineHeight:o.typography.pxToRem(14)},"& b":{textTransform:"uppercase",fontFamily:o.typography.h2.fontFamily}},productChipPrice:{color:o.color.black60,height:26,textTransform:"uppercase",borderRadius:9,border:"1px solid #8F9BA4",boxSizing:"border-box",backgroundColor:o.color.black0,fontSize:"0.875rem","@media (max-width: 479px)":{border:"0.75px solid #8F9BA4",borderRadius:"5px",height:"25px",lineHeight:"16px"}},productPrice:{fontFamily:"TTFirsNeue-Medium, sans-serif",fontWeight:400,marginRight:o.spacing(1),"@media (max-width: 479px)":{fontSize:"0.625rem",lineHeight:"1rem"}},productOldPrice:{position:"relative",marginRight:o.spacing(2),"&:after":{position:"absolute",content:"' '",width:"100%",height:"1px",left:"0",top:"9px",background:o.color.black60,border:`1px solid ${o.color.black0}`,transform:"rotate(-3deg)",zIndex:10},"@media (max-width: 479px)":{fontSize:"0.625rem",lineHeight:"1rem","&:after":{top:"5px"}}}}),{name:"ProductInfo"}),xt=({title:o,brandName:a,name:m,price:u,oldPrice:r,percent:i,url:x,metaDesk:c})=>{const n=nt(),d=`${o} ${a} ${m}`;return t.jsxs(t.Fragment,{children:[t.jsx(w,{classes:{root:n.cardContentRoot},children:t.jsxs(B,{className:n.link,title:d,to:x,children:[t.jsx("div",{itemProp:"brand",itemType:"http://schema.org/Brand",itemScope:!0,children:t.jsx("meta",{itemProp:"name",content:a})}),t.jsxs(b,{itemProp:"category",variant:"body1",component:"span",classes:{root:n.productCategory},children:[o,"В "]}),t.jsxs(b,{itemProp:"name",variant:"body1",component:"span",classes:{root:n.productName},children:[t.jsx("b",{children:a})," ",m]})]})}),t.jsx("meta",{itemProp:"description",content:c}),t.jsx("meta",{itemProp:"url",content:x}),t.jsxs(w,{classes:{root:n.cardContentRoot},children:[t.jsxs(b,{itemProp:"offers",itemScope:!0,itemType:"http://schema.org/Offer",variant:"body1",component:"span",classes:{body1:n.productPrice},children:[t.jsx("meta",{itemProp:"price",content:String(u)}),t.jsx("meta",{itemProp:"priceCurrency",content:"RUB"}),t.jsx("link",{itemProp:"availability",href:"http://schema.org/InStock"}),T(u)]})," ",i&&r&&t.jsx(b,{dangerouslySetInnerHTML:{__html:T(r)},variant:"body1",component:"span",classes:{body1:n.productOldPrice}}),i&&t.jsx(j,{classes:{root:n.productChipPrice},label:i})]})]})};export{mt as P,ut as a,xt as b};