import{m as n,t as p,v as s,ab as d,bx as D,by as z,aC as q,k as E,G as N,u as G,h as $,jL as X,r as h,j as e,c8 as P,P as k,jM as Q,a7 as I,a8 as F,jN as C,b$ as J,ao as U,cG as Z,ad as ee,i as te,jJ as re,jO as ie,aE as ne,jP as oe,y as se,N as V,bE as R,aq as ae,ah as le,bF as L,z as ce,al as O,S as de}from"./index-E0AVXOTn.js";import{P as pe}from"./index-Dq8xrBOI.js";import{u as xe}from"./uniq-D_biwgiI.js";import{u as me,a as ue}from"./useEvent-BXRcVznK.js";import"./uniqBy-DN1049mB.js";const ge=n.section(["display:flex;flex-direction:column;gap:12px;padding:24px 20px 0;border-top:8px solid ",";","{align-items:flex-start;gap:20px;border-top:none;padding:0 20px 120px;}"],p.gray20,s.SM),he=n.h2(["",";","{display:flex;justify-content:space-between;align-items:center;width:100%;",";}"],d.title2_semibold,s.SM,d.title1_semibold),be=n.button(["display:flex;justify-content:center;align-items:center;gap:2px;"," color:",";svg{transform:translateY(-1px);}"],d.body1_regular,p.gray80),Y=n(D)(["width:calc(100% + 40px);margin-left:-20px;padding:0 20px;"]),H=n(z)(["cursor:pointer;display:flex;flex-direction:column;gap:12px;height:auto;"]);Y.displayName="Swiper";H.displayName="SwiperSlide";const ye=n.ul(["display:grid;grid-template-columns:repeat(4,1fr);gap:24px;"]),Se=n.li(["cursor:pointer;display:flex;flex-direction:column;gap:16px;height:auto;"]),fe=n.div(["position:relative;width:100%;aspect-ratio:1 / 1;border-radius:4px;overflow:hidden;background-color:",";flex-shrink:0;img{width:100%;height:100%;object-fit:cover;}","{border-radius:8px;}"],p.gray10,s.SM),we=n.div(["display:flex;flex-direction:column;gap:4px;","{gap:8px;}"],s.SM),je=n.span(["align-self:flex-start;min-height:19px;padding:2px 6px;border-radius:25px;background-color:",";",";color:",";","{padding:4px 10px;",";}"],p.gray20,d.label_small_badge,p.gray80,s.SM,d.label_big_badge),ve=n.p(["",";color:",";display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","{",";}"],d.body1_medium,p.black,s.SM,d.heading_semibold),Me=n.p(["",";color:",";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","{",";}"],d.body2_regular,p.gray80,s.SM,d.body1_regular),Te=n(q)(["display:flex;align-items:center;justify-content:center;gap:4px;margin-top:12px;width:100%;height:52px;background-color:",";border:1px solid ",";border-radius:8px;",";color:",";svg{width:16px;height:16px;}","{max-width:480px;margin:0 auto;}"],p.white,p.gray50,d.headline2_semibold,p.black,s.SM),Ce=n.div(["width:100%;"]),c={Container:ge,Title:he,DesktopMoreButton:be,SwiperArticleList:Y,SwiperArticleItem:H,ArticleList:ye,ArticleItem:Se,ThumbnailWrapper:fe,InfoBox:we,CurrentArticleBadge:je,ArticleName:ve,ArticleDescription:Me,MoreButton:Te,Pagination:Ce},Ae=({currentArticleNo:o})=>{const{t:a}=E(),{isMobile:w}=N(),S=G(),[l,f]=$(),m={page:{size:w?10:4,number:Number(l.get("pageNumber"))||1},order:{by:l.get("by")??"REGISTER_DATE",direction:l.get("direction")??"DESC"},eventYn:"Y"},{data:x}=X({searchParams:m}),y=i=>S(`${k.ARTICLES.MAIN}/${i}`),T=()=>{S(k.ARTICLES.MAIN)},t={slidesPerView:1.8,spaceBetween:12},r=h.useMemo(()=>((x==null?void 0:x.totalCount)??0)-1,[x]);return r===0?null:e.jsxs(c.Container,{children:[e.jsxs(c.Title,{children:[a("다른 아티클 보기"),!w&&e.jsxs(c.DesktopMoreButton,{onClick:()=>T(),children:[e.jsx("span",{children:a("아티클 더보기")}),e.jsx(P,{})]})]}),w?e.jsxs(e.Fragment,{children:[e.jsx(c.SwiperArticleList,{...t,children:x==null?void 0:x.contents.map(i=>{const u=i.eventNo===o;return e.jsxs(c.SwiperArticleItem,{onClick:()=>y(i.eventNo),children:[e.jsx(c.ThumbnailWrapper,{children:e.jsx("img",{src:i.mobileimageUrl||i.pcImageUrl,alt:i.label,loading:"lazy"})}),e.jsxs(c.InfoBox,{children:[e.jsx(c.ArticleName,{dangerouslySetInnerHTML:{__html:i.label}}),e.jsx(c.ArticleDescription,{dangerouslySetInnerHTML:{__html:i.promotionText||""}})]}),u&&e.jsx(c.CurrentArticleBadge,{children:a("현재 아티클")})]},i.eventNo)})}),e.jsxs(c.MoreButton,{onClick:()=>T(),children:[e.jsx("span",{children:a("아티클 더보기")}),e.jsx(P,{})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(c.ArticleList,{children:x==null?void 0:x.contents.map(i=>{const u=i.eventNo===o;return e.jsxs(c.ArticleItem,{onClick:()=>y(i.eventNo),children:[e.jsx(c.ThumbnailWrapper,{children:e.jsx("img",{src:i.mobileimageUrl||i.pcImageUrl,alt:i.label,loading:"lazy"})}),e.jsxs(c.InfoBox,{children:[e.jsx(c.ArticleName,{dangerouslySetInnerHTML:{__html:i.label}}),e.jsx(c.ArticleDescription,{dangerouslySetInnerHTML:{__html:i.promotionText||""}})]}),u&&e.jsx(c.CurrentArticleBadge,{children:a("현재 아티클")})]},i.eventNo)})}),e.jsx(c.Pagination,{children:e.jsx(pe,{type:"extend",totalCount:r,currentPage:m.page.number,pageSize:m.page.size,onPageClick:i=>{const u=window.scrollY;f(j=>({...Object.fromEntries(j),pageNumber:i.toString()}),{replace:!0}),requestAnimationFrame(()=>{window.scrollTo({top:u})}),f(j=>({...Object.fromEntries(j),pageNumber:i.toString()}))}})})]})]})},Ne=n.div(["display:flex;flex-direction:column;gap:12px;","{gap:24px;}"],s.SM);n.h3(["",";","{",";}"],d.article_bold,s.SM,d.title2_semibold);const _e=n.ul(["width:100%;margin:0 auto;max-width:1400px;display:grid;grid-template-columns:repeat( ",",minmax(0,1fr) );grid-row-gap:24px;grid-column-gap:7px;align-items:stretch;& > li{height:100%;box-sizing:border-box;}","{grid-template-columns:repeat( ",",minmax(0,1fr) );grid-row-gap:48px;grid-column-gap:20px;}"],({$columnsRepeatCount:o})=>o||5,s.SM,({$columnsRepeatCount:o})=>o||2),B={Container:Ne,ProductList:_e},Ie=h.forwardRef(({sectionNo:o,articleNo:a,articleKey:w,setSectionList:S},l)=>{const[f]=$(),b=f.get("preview")==="true",{isMobile:m}=N(),{data:x}=Q({eventKey:w}),y=me({queries:C.DEFAULT_PAGE_NUMBER_LIST.map(t=>{const r={pageNumber:t,pageSize:C.DEFAULT_PAGE_SIZE,order:"ADMIN_SETTING",saleStatus:"RESERVATION_AND_ONSALE",includeStopProduct:!0,...b&&{preview:b}};return{queryKey:re.productSection(a,o,r),queryFn:async()=>{const{data:i}=await ie.getEventProductDisplaySection(a,o,r);return i}}}),combine:t=>({sectionNo:t[0].data.sectionNo,productCount:t.reduce((r,{data:i})=>r+i.products.length,0),data:t.flatMap(({data:r})=>r.products),isLoading:t.some(({isLoading:r})=>r)})});h.useEffect(()=>{y&&y.data.length!==0&&S(t=>I([...t,y.sectionNo],xe,F))},[y]);const T=h.useMemo(()=>x?I(x,Z("section"),U(t=>t.sectionNo===o),J,t=>m?(t==null?void 0:t.mobilePerRow)||C.MOBILE_PER_ROW:(t==null?void 0:t.pcPerRow)||C.PC_PER_ROW):m?C.MOBILE_PER_ROW:C.PC_PER_ROW,[x,m,o]);return y.productCount===0?e.jsx(e.Fragment,{}):e.jsx(B.Container,{id:`${o}`,ref:l,children:e.jsx(B.ProductList,{$columnsRepeatCount:T,children:y.data.map(t=>e.jsx("li",{children:e.jsx(ee,{liked:t.liked,likeCount:t.likeCount,isSoldOut:t.isSoldOut,productName:t.productName,productNo:t.productNo,brandName:te(t.brandNameKo)?"":`${t.brandNameKo}`,reviewRating:t.reviewRating,totalReviewCount:t.totalReviewCount,imageUrls:t.imageUrls,salePrice:t.salePrice,immediateDiscountAmt:t.immediateDiscountAmt,couponDiscountAmt:t.couponDiscountAmt,additionDiscountAmt:t.additionDiscountAmt,stickerInfos:t.stickerInfos,brandNo:t.brandNo,customProperties:t.customProperties.map(r=>({propName:r.propertyName,propType:r.propertyType,propValue:r.propertyValue,propNo:r.propertyNo,propValueNo:r.propertyValueNo,isMultipleSelection:!1}))})},`${o}-${t.productNo}`))})})}),Ee=n.div(["display:flex;flex-direction:column;gap:20px;width:100%;max-width:1980px;margin:0 auto;img{display:block;margin:0 auto;width:auto;max-width:100%;object-fit:cover;}","{gap:120px;}"],s.SM),Pe=n.div(["aspect-ratio:1 / 1;","{& > img{aspect-ratio:1 / 1;max-width:610px;}aspect-ratio:auto;display:flex;justify-content:center;align-items:stretch;background-color:",";}"],s.SM,p.gray10),ke=n.div(["display:flex;flex-direction:column;gap:6px;padding:0 20px;margin-bottom:20px;","{flex:1;justify-content:space-between;padding:60px 48px 48px;margin-bottom:0;}"],s.SM),Re=n.h1([""," font-size:2.6rem;","{",";font-size:6.4rem;}"],d.title1_semibold,s.SM,d.article_pc_title),Le=n.p([""," color:",";","{",";}"],d.body1_regular,p.gray60,s.SM,d.headline1_regular),Oe=n.div(["","{max-width:792px;margin:0 auto;}"],s.SM),Be=n.div(["padding:12px 20px 50px;border-bottom:8px solid ",";*:not(font){all:revert;}",";& *{display:revert;",";line-height:170%;letter-spacing:-0.013em;}& b{display:inline-block !important;font-weight:600 !important;}table{all:revert;border:1px solid black;}table{all:revert;border-spacing:2px;border-color:gray;border-width:1px;border-style:solid;border-collapse:collapse;box-sizing:border-box;}tbody,tr{all:revert;vertical-align:middle;border-color:inherit;border-width:1px;border-style:solid;border:1px solid #ececec;padding:5px 3px;}th{all:revert;font-weight:bold;vertical-align:inherit;border:1px solid #ececec;padding:5px 3px;}td{all:revert;vertical-align:inherit;border:1px solid #ececec;padding:5px 3px;}","{max-width:792px;margin:0 auto;padding:0;border-bottom:0;}"],p.gray20,ne,oe.pretendard,s.SM),g={TopContainer:Ee,MainImageContent:Pe,TitleBox:ke,Title:Re,MetaInfo:Le,ImageContent:Oe,Content:Be},De=({articleData:{label:o,top:a,pcImageUrl:w,mobileimageUrl:S,startYmdt:l}})=>{const{t:f}=E(),{isMobile:b}=N(),m={author:"by WannaMake",data:se(l).format("YY.MM.DD")};return b&&!a.mobile.url||!b&&!a.pc.url?e.jsx(V,{text:f("상세 내용이 없습니다.")}):b?e.jsxs(g.TopContainer,{children:[e.jsx(g.MainImageContent,{children:e.jsx("img",{src:S,alt:o})}),e.jsxs(g.TitleBox,{children:[e.jsx(g.Title,{children:o}),e.jsxs(g.MetaInfo,{children:[m.author," / ",m.data]})]}),a.mobile.type==="FILE"&&a.mobile.url!==""&&e.jsx(g.ImageContent,{children:e.jsx("img",{src:a.mobile.url,alt:o})}),a.mobile.type==="HTML"&&e.jsx(g.Content,{dangerouslySetInnerHTML:{__html:a.mobile.url}})]}):e.jsxs(g.TopContainer,{children:[e.jsxs(g.MainImageContent,{children:[e.jsx("img",{src:w,alt:o}),e.jsxs(g.TitleBox,{children:[e.jsx(g.Title,{children:o}),e.jsxs(g.MetaInfo,{children:[m.author," / ",m.data]})]})]}),a.pc.type==="FILE"&&a.pc.url!==""&&e.jsx(g.ImageContent,{children:e.jsx("img",{src:a.pc.url,alt:o})}),a.pc.type==="HTML"&&e.jsx(g.Content,{dangerouslySetInnerHTML:{__html:a.pc.url}})]})},ze=h.memo(De),$e=n.section(["width:100%;"]),Fe=n.div(["width:100%;margin:0 auto;","{max-width:1200px;}","{max-width:1440px;}"],s.SM,s.XXL),Ue=n.div(["display:flex;flex-direction:column;gap:60px;padding:0 20px;","{gap:60px;}"],s.SM),Ve=n.nav(["position:sticky;top:var(--header-top);z-index:10;width:calc(100% + 40px);margin-left:-20px;margin-bottom:20px;background-color:",";border-bottom:1px solid ",";","{width:calc(100vw - (var(--scrollbar-width) / 2));margin-left:calc(50% - 50vw);margin-bottom:60px;}"],p.white,p.gray20,s.SM),Ye=n.div(["width:100%;margin:0 auto;padding:0 20px;","{max-width:1200px;}","{max-width:1440px;}"],s.SM,s.XXL),W=n(D)(["width:100%;> div{width:fit-content;}","{padding:0;.swiper-wrapper{margin:0 auto;}}"],s.SM),K=n(z)(["width:auto;box-sizing:border-box;position:relative;button{width:100%;padding:16px 2px 12px;position:relative;color:",";"," "," ","{"," ","}}"],p.gray60,d.headline1_regular,({$isSelected:o})=>o&&R(["color:",";"," border-bottom:2px solid ",";"],p.black,d.headline2_medium,p.black),s.SM,d.heading_semibold,({$isSelected:o})=>o&&R(["&::after{bottom:0;}"]));W.displayName="SwiperWrapper";K.displayName="SwiperSlide";const M={ArticleContainer:$e,ArticleInnerSection:Fe,ProductsContainer:Ue,StickyTab:Ve,TabListInner:Ye,TabList:W,TabItem:K},Xe=()=>{const{t:o}=E(),{isMobile:a}=N(),S=ae().articleKey,{data:l}=ue({eventKey:S,searchParams:{includeNonMemberCoupon:!0},options:{select:t=>(t==null?void 0:t.eventYn)==="Y"?t:void 0}}),f=h.useRef(new Map),[b,m]=h.useState([]),x=h.useMemo(()=>l?I(l.section,le(t=>({label:t.label,sectionNo:t.sectionNo})),U(t=>O(t.sectionNo,b)),F):[],[l,b]),y=({sectionTabList:t,activeSectionNo:r,onTabClick:i})=>{const[u,j]=h.useState(),_={slidesPerView:"auto",spaceBetween:a?14:18},A=h.useMemo(()=>t.findIndex(v=>v.sectionNo===r),[t,r]);return h.useEffect(()=>{u&&A!==-1&&u.slideTo(A)},[u,A]),e.jsx(M.StickyTab,{"aria-label":"기획전 섹션 메뉴",children:e.jsx(M.TabListInner,{children:e.jsx(M.TabList,{..._,onSwiper:j,role:"tablist",children:t.map(v=>e.jsx(M.TabItem,{role:"presentation",$isSelected:r===v.sectionNo,children:e.jsx("button",{role:"tab","aria-selected":r===v.sectionNo,onClick:()=>{i(v.sectionNo)},children:e.jsx("span",{children:v.label})})},v.sectionNo))})})})},T=h.useCallback(t=>{const r=f.current.get(`${t}`);if(!r)return;const u=parseFloat(getComputedStyle(document.body).getPropertyValue("--header-top")||"0"),j=r.getBoundingClientRect(),_=window.scrollY,A=j.top+_-u;window.scrollTo({top:A,behavior:"smooth"})},[]);return l?e.jsx(M.ArticleContainer,{children:e.jsxs(L,{gap:a?"0":"90px",children:[l==null?void 0:l.orders.map(t=>t==="TOP"?e.jsx(ze,{articleData:l},"TOP"):null),e.jsx(M.ArticleInnerSection,{children:e.jsxs(L,{gap:a?"60px":"90px",children:[l==null?void 0:l.orders.map(t=>t==="SECTIONS"&&!ce(l.section)?e.jsx(M.ProductsContainer,{children:l.section.map(({sectionNo:r})=>{const i=O(r,b);return e.jsxs("div",{style:{display:i?"block":"none"},ref:u=>{u&&f.current.set(`${r}`,u)},children:[x.length>0&&e.jsx(y,{sectionTabList:x,activeSectionNo:r,onTabClick:T}),e.jsx(de,{children:e.jsx(Ie,{articleKey:S,articleNo:l.eventNo,sectionNo:r,setSectionList:m})})]},r)})},"SECTIONS"):null),e.jsx(Ae,{currentArticleNo:l.eventNo})]})})]})}):e.jsx(V,{text:o("존재하지 않는 아티클입니다.")})};export{Xe as default};