import{j as o,ap as w,a1 as Q,k as I,Z as A,b as X,g as Z,aq as K}from"./main-4c6c1889.js";import{r as d,R as Y}from"./chunk-react-46c63fbc.js";import{c as J}from"./chunk-index-89b7ba38.js";import{D as R}from"./chunk-index-66bf0e46.js";import{m as T,G as l,e as h,i as O,an as V,s as M,f as _,I as L,aA as ee,aB as oe,B as U,L as te,a9 as re}from"./chunk-material-ui-f8a22c88.js";import{S as ae}from"./chunk-index-3b3e465b.js";import{b as ne}from"./chunk-index-a7cb0ea1.js";import{D as ie}from"./chunk-index-9daad173.js";import{U as se}from"./chunk-index-2f451334.js";import{i as le}from"./chunk-generateUtilityClasses-9687b17f.js";import{r as ce}from"./chunk-createSvgIcon-9c70daa0.js";const de=T(e=>({sizeBlock:{marginBlockEnd:9,"@media (max-width: 280px)":{maxWidth:"100%",flexBasis:"100%"}},baseText:{fontFamily:"TTFirsNeue-Light, sans-serif","& > $baseText":{paddingLeft:e.spacing(2),whiteSpace:"nowrap"}},chooseSizeBlock:{cursor:"pointer",marginBlockEnd:9,"& p":{color:"#1e6ee4"}}}),{name:"CurrentSize"});function pe({sizeTitle:e,isShowPickSizeButton:t,pickSizeButtonTitle:n,gridSizeContent:c}){const r=de(),[i,s]=d.useState(!1),a=()=>s(!1),g=()=>s(!0);return o.jsxs(o.Fragment,{children:[o.jsx(l,{item:!0,xs:4,classes:{root:r.sizeBlock},children:o.jsxs(h,{classes:{root:r.baseText},component:"p",variant:"body1",color:"secondary",children:["Размер:",o.jsx(h,{classes:{root:r.baseText},component:"span",variant:"body1",color:"primary",children:e})]})}),t&&o.jsxs(o.Fragment,{children:[o.jsx(l,{item:!0,xs:"auto",sm:5,md:"auto",onClick:g,className:r.chooseSizeBlock,children:o.jsx(h,{classes:{root:r.baseText},variant:"body1",children:n||"Подобрать размер"})}),o.jsx(R,{open:i,onClose:a,onCloseIcon:a,dialogTitle:n||"Подобрать размер",scroll:"paper",maxWidth:!1,children:o.jsx(l,{container:!0,children:o.jsx(l,{item:!0,xs:12,children:c})})})]})]})}const ue=T(e=>({baseText:{fontFamily:"TTFirsNeue-Light, sans-serif","& > $baseText":{paddingLeft:e.spacing(2)}}}),{name:"CurrentSize"}),xe=({colorName:e})=>{const t=ue();return e?o.jsx(l,{item:!0,xs:12,children:o.jsxs(h,{classes:{root:t.baseText},component:"p",variant:"body1",color:"secondary",children:["Цвет:",o.jsx(h,{classes:{root:t.baseText},component:"span",variant:"body1",color:"primary",children:e})]})}):null},he=T(e=>({sizesChip:{width:78,height:40,borderRadius:10,margin:0,fontSize:"1rem","&:after":{content:'""',position:"absolute",top:0,left:0,width:"200%",height:"180%",background:`linear-gradient(to top right,
                transparent calc(49% - 1px),
                #E0E3E6 calc(49.5% - 1px),
                #E0E3E6 calc(48.5% + 1px),
                transparent calc(48% + 1px))`},"& span":{paddingInline:7}},CardPreviewSizeBtn:{minWidth:71,minHeight:32,color:e.color.black100,borderRadius:10,backgroundColor:"#FFFFFF","@media (min-width: 1656px)":{minWidth:87,minHeight:35}},sizesChipOutline:{borderColor:e.color.black40,overflow:"hidden","&:after":{content:'""',position:"absolute",top:0,left:0,width:"200%",height:"180%",background:`linear-gradient(to top right,
                transparent calc(48.5% - 1px),
                #E0E3E6 calc(49% - 1px),
                #E0E3E6 calc(48% + 1px),
                transparent calc(46% + 1px))`},"&:hover":{"background-color":"#FFFFFF !important"}},noQuantity:{color:e.color.black40,borderColor:e.color.black40},popover:{pointerEvents:"none"},paper:{maxWidth:230,padding:"8px 12px",borderRadius:4},popoverText:{fontSize:e.typography.pxToRem(14)},dialogRoot:{minWidth:300,maxWidth:400,padding:24,"& .MuiDialogContent-dividers":{overflow:"initial",border:"none"},"& .MuiDialogTitle-root":{padding:0,"margin-block-end":24,"& h2":{fontSize:"20px",lineHeight:"30px"}}}}),{name:"NoQuantitySize"}),we=e=>{const t=he(),[n,c]=d.useState(null),[r,i]=d.useState(!1),[s,a]=d.useState(!1),[g,f]=d.useState(""),y=x=>{c(x.currentTarget)},v=()=>{c(null)},S=x=>{i(!0)},j=!!n,m=()=>i(!1),[k,{isLoading:C}]=w(),p=()=>{k({email:g,product_id:e.product_id}).unwrap().then(({})=>{a(x=>!0)})},u=x=>{f(x.target.value)};return o.jsxs(o.Fragment,{children:[o.jsx(O,{"aria-owns":j?"mouse-over-popover":void 0,"aria-haspopup":"true",clickable:!0,onMouseEnter:y,onMouseLeave:v,variant:"outlined",classes:{root:e.productPreview?t.CardPreviewSizeBtn:t.sizesChip,outlinedPrimary:J([t.sizesChipOutline,t.noQuantity])},onClick:S,color:"primary",label:e.sizeTitle}),o.jsx(V,{open:j,className:t.popover,style:{top:10},classes:{paper:t.paper},anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:0,onClose:v,disableRestoreFocus:!0,children:o.jsx(h,{variant:"body1",classes:{root:t.popoverText},children:"Кликните на размер для возможности подписаться на его поступления"})}),o.jsx(R,{open:r,PaperProps:{classes:{root:t.dialogRoot}},scroll:"paper",onClose:m,onCloseIcon:m,dialogTitle:s?"Товар добавлен в подписки":"Подписаться на товар",children:o.jsxs(l,{container:!0,item:!0,spacing:3,children:[!s&&o.jsxs(o.Fragment,{children:[o.jsx(xe,{colorName:e.colorName}),o.jsx(pe,{sizeTitle:e.sizeTitle}),o.jsx(l,{item:!0,xs:12,children:o.jsx(M,{required:!0,fullWidth:!0,placeholder:"email",type:"email",onChange:u,value:g})})]}),s&&o.jsx(l,{item:!0,xs:12,children:o.jsx(h,{children:"Мы сообщим вам, когда он поступит на склад"})}),o.jsx(l,{item:!0,xs:12,children:o.jsx(_,{color:"default",variant:"contained",fullWidth:!0,onClick:s?m:p,children:s?"Готово":"Подписаться"})})]})})]})},ge=T(e=>({productRoot:{position:"relative",paddingBottom:e.spacing(5),"&:hover $favoriteIconStyle":{display:"block"}},productSmall:{width:280,"@media (max-width: 1440px)":{width:256},"@media (max-width: 1280px)":{width:256}},productMedium:{width:325,"@media (max-width: 1440px)":{width:256},"@media (max-width: 1280px)":{width:256}},productBig:{width:"100%","@media (max-width: 1440px)":{width:"100%"},"@media (max-width: 1280px)":{width:"100%"},"@media (max-width: 479px)":{width:"100%"}},productMain:{width:"100%","@media (max-width: 1440px)":{width:"100%"},"@media (max-width: 1280px)":{width:"100%"},"@media (max-width: 479px)":{width:"100%"}},containerLink:{height:"inherit"},badgeGrid:{display:"flex",flexDirection:"column",alignItems:"start",position:"absolute",left:"8px",top:"8px",zIndex:1,textTransform:"uppercase","& div":{height:24,fontSize:e.typography.pxToRem(14)},"& div + div":{marginBlockStart:15}},badgeStyle:{borderRadius:9,backgroundColor:e.color.black0,border:"1px solid currentcolor"},badgeSoon:{color:"#b1dff1"},badgeNew:{color:"#1e6ee4"},productImgGrid:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 540px)":{marginBlockEnd:15}},imgHover:{" :first-child":{display:"block"},"& :last-child":{display:"none"},"&:hover :first-child":{display:"none"},"&:hover :last-child":{display:"block"}},productImg:{objectFit:"contain"},productImgTechno:{width:"20%",position:"absolute",bottom:"-5%"},setNoQuantity:{flexDirection:"column","& svg":{margin:"0 !important"}},sizeContainer:{position:"absolute",left:0,bottom:0,padding:"0 10px",zIndex:1e3},sizeBtn:{minWidth:71,minHeight:32,color:e.color.black100,borderRadius:10,backgroundColor:"#FFFFFF","@media (min-width: 1656px)":{minWidth:87,minHeight:35}},sizeBtnClickable:{"&$sizeBtnOutlined":{"&:hover, &:focus":{backgroundColor:"#F0F3F6"}}},favoriteIconStyle:{display:"none",color:"#E0E3E6"},productPageFavoriteIconStyle:{color:e.color.black100},sizeBtnOutlined:{borderColor:e.color.black40},favoriteIcon:{margin:"16px 16px 0 0",right:0,position:"absolute",zIndex:2e3},btnAddToWish:{borderColor:e.color.black100,borderWidth:"1.25px",borderStyle:"solid",borderRadius:"1rem",width:"100%",padding:16,height:"100%"},paper:{maxWidth:230,padding:"8px 12px",borderRadius:4},popoverText:{fontSize:e.typography.pxToRem(14)},customPaperStyle:{width:"230px",padding:"8px 12px",borderRadius:"4px",position:"absolute",zIndex:1,backgroundColor:"#fff",border:"1px solid rgba(0, 16, 61, 0.16)",opacity:1,transform:"none",transition:"opacity 232ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 155ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},productPopUpPosition:{transform:"translateX(-50%)",left:"50%"},catalogPopUpPosition:{top:"32px",left:"50%",transform:"translateX(-50%)"}}),{name:"CardPreview"}),me=({wishListItem:e,open:t,handleClose:n})=>o.jsx(ae,{open:t,onClose:n,title:"Товар добавлен в избранное",children:o.jsx(o.Fragment,{children:!Array.isArray(e==null?void 0:e.data)&&o.jsx(ne,{sku:e==null?void 0:e.data.SKU_ID,itemName:e==null?void 0:e.data.NAME,link:e==null?void 0:e.data.URL,imgPath:e==null?void 0:e.data.IMAGE.PATH,color:e==null?void 0:e.data.COLOR,size:e==null?void 0:e.data.SIZE,currentPrice:e==null?void 0:e.data.PRICES.RETAIL.PRICE_DISPLAY})})}),be=({event:e,inWishlist:t,handleDeleteWishlist:n,handleClick:c,colorRef:r,setClickOnWishListIcon:i,setOpenUserAuth:s,setOpenPopUp:a})=>t?n():(c(r),e.preventDefault(),i&&i(!0),s(!0),a(!0)),fe=e=>{var t;(t=e==null?void 0:e.current)==null||t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},Re=({setClickOnWishListIcon:e,inWishlist:t,productSku:n,isUserAuth:c,addWishList:r,wishListItem:i,colorRef:s,parentRef:a,type:g})=>{const[f]=Q(),y=()=>{f({url:X.user.wishlist.delete,...Z({SITE_ID:"lid",bitrix_sessid:"bitrix_sessid"}),id:n})},[v,S]=d.useState(!1),[j,m]=Y.useState(!1),[k,C]=d.useState(!1),p=ge(),u=g==="productPage",x=u?p.productPageFavoriteIconStyle:p.favoriteIconStyle,P=u?p.btnAddToWish:p.favoriteIcon,F=u?p.productPopUpPosition:p.catalogPopUpPosition,E=I(b=>b.userAuth.authScreen),H=!t&&c&&j,G=i==null?void 0:i.data;d.useEffect(()=>{const b=B=>{var W;a!=null&&a.current&&!((W=a==null?void 0:a.current)!=null&&W.contains(B.target))&&(m(!1),e&&e(!1))};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[a]),d.useEffect(()=>{r&&(S(r),m(!1))},[r]);const q=(b,B)=>{B!=="clickaway"&&S(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:b=>{be({event:b,inWishlist:t,handleDeleteWishlist:y,handleClick:fe,colorRef:s,setClickOnWishListIcon:e,setOpenUserAuth:C,setOpenPopUp:m})},classes:{root:P},type:"button",color:"secondary",children:t&&o.jsx(ee,{color:"primary"})||o.jsx(oe,{className:x})}),H&&o.jsx(U,{className:`${p.customPaperStyle} ${F}`,children:o.jsx(h,{variant:"body1",classes:{root:p.popoverText},children:"Чтобы добавить товар в избранное кликните на цвет, затем на размер."})}),G&&o.jsx(me,{wishListItem:i,open:v,handleClose:q}),!c&&o.jsx(ie,{isWrapped:!0,showCloseIcon:!0,open:k,onClose:()=>C(!1),handlerCloseIcon:()=>C(!1),closeIconPosition:"right",anchor:"right",title:A[E].title,subTitle:A[E].subTitle,children:o.jsx(se,{})})]})};var D={},ye=le;Object.defineProperty(D,"__esModule",{value:!0});var $=D.default=void 0,ve=ye(ce()),N=o;$=D.default=(0,ve.default)([(0,N.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,N.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");const Se=T(()=>({mainBlock:{width:"100%"},soonGrid:{width:"48%"},boxStyle:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",fontSize:"1rem",fontFamily:"TTFirsNeue-Regular,sans-serif",fontWeight:300,lineHeight:"24px",textTransform:"none",padding:9,"& .MuiLink-root:hover":{color:"#3A474E",borderBottom:"1px #3A474E dashed"},"& .MuiLink-underlineAlways":{color:"#1e6ee4",borderBottom:"1px #1e6ee4 dashed",textDecoration:"none"}},soonLogo:{marginInlineEnd:7,color:"#1e6ee4"},soonText:{fontFamily:"CirceWebBold,sans-serif",fontSize:"1.1rem",marginBlockStart:1,color:"#1e6ee4",fontWeight:550},subscribedText:{marginBlockEnd:15},dialogRoot:{minWidth:300,maxWidth:400,padding:24,"& .MuiDialogContent-dividers":{overflow:"initial",border:"none"},"& .MuiDialogTitle-root":{padding:0,"margin-block-end":24,"& h2":{fontSize:"20px",lineHeight:"30px"}}}}),{name:"NoProductStock"}),Oe=({productId:e,isSoon:t,isComingSoon:n,setIsComingSoon:c})=>{const r=Se(),[i,s]=d.useState(!1),[a,g]=d.useState(!1),[f,y]=d.useState(""),[v]=w(),[S]=K(),j=t?"СКОРО":"Нет в наличии",m=()=>{s(!0),S().then(u=>{var E,z;const{data:x,status:P,errors:F}=u.data;if(P==="error")return console.error(F);P==="success"&&y((z=(E=x==null?void 0:x.MAIN)==null?void 0:E.PROFILE)==null?void 0:z.EMAIL)})},k=()=>{s(!1),n&&c(!1)},C=()=>{v({email:f,product_id:e}).unwrap().then(u=>{if(u.status==="error")return g(!1);g(!0)})},p=u=>{y(u.target.value)};return d.useEffect(()=>{n&&s(!0)},[]),o.jsxs(l,{item:!0,container:!0,spacing:3,classes:{root:r.mainBlock},children:[!n&&o.jsxs(o.Fragment,{children:[o.jsxs(l,{item:!0,container:!0,direction:"row",classes:{root:r.soonGrid},children:[t&&o.jsx($,{className:r.soonLogo}),o.jsx(h,{className:r.soonText,children:j})]}),o.jsx(U,{className:r.boxStyle,onClick:m,children:o.jsx(te,{href:"#",underline:"always",children:"Хочу узнать о поступлении"})})]}),o.jsx(re,{open:i,PaperProps:{classes:{root:r.dialogRoot}},scroll:"paper",onClose:k,dialogTitle:a?"Товар добавлен в подписки":"Подписаться на товар",children:o.jsxs(l,{container:!0,item:!0,spacing:3,children:[!a&&o.jsx(o.Fragment,{children:o.jsxs(l,{item:!0,xs:12,children:[o.jsx(h,{className:r.subscribedText,children:"Этот товар скоро поступит в продажу. Хотите узнать об этом первыми? Пожалуйста, оставьте свой e-mail для оповещения."}),o.jsx(M,{required:!0,fullWidth:!0,placeholder:"email",type:"email",onChange:p,value:f})]})}),a&&o.jsx(l,{item:!0,container:!0,justifyContent:"center",xs:12,children:o.jsx(h,{children:"Мы сообщим вам, когда он поступит на склад"})}),o.jsx(l,{item:!0,xs:12,children:o.jsx(_,{color:"default",variant:"contained",fullWidth:!0,onClick:a?()=>k():C,children:a?"Готово":"Подписаться"})})]})})]})};function je(e){if(e&&e.indexOf("/")>-1){const[t,n]=e.split("/");return`linear-gradient(90deg, ${t} 0%, ${n} 100%)`}return e}const ke=T(e=>({chipStyle:{fontFamily:"TTFirsNeue-Light, sans-serif",fontSize:16}}),{name:"Badge"}),Me=e=>{const t=ke(),{badge_text:n,badge_text_color:c,badge_background_color:r}=e,i={color:c,background:je(r)};return o.jsx(O,{classes:{root:t.chipStyle},style:i,label:n})};export{Me as B,xe as C,we as N,Re as W,pe as a,Oe as b,je as g,ge as s};