import{r as l,j as e,L as p}from"./vendor-react-C630P38J.js";import{h as _,q as A}from"./vendor-fxts-IS4CCBC4.js";import{S as f,b as M}from"./vendor-swiper-CwUwDtZu.js";import{u as I,h as j,t as P,E as R,L as C,N as L}from"./feature-order-C2we0F5o.js";import"./vendor-utils-Cb1MAKRV.js";import{u as w}from"./index-nim7WYfB.js";import{e as V,c as k,a as z}from"./usePageGuard-DezxG6D_.js";import{a as T}from"./vendor-query-BjC2S-sR.js";import{n as S}from"./index-DOpJRihs.js";import{P as b}from"./index-BNckj-u7.js";import"./vendor-overlay-B61Jbn6n.js";import"./vendor-i18n-D_F5k183.js";import"./vendor-rhf-CXRF5ML7.js";import"./vendor-zod-BNDLCzeL.js";import"./vendor-runtime-BrGgGswE.js";import"./vendor-hooks-D-WB61cZ.js";import"./vendor-cookie-BFUm5jHE.js";import"./vendor-state-BxLZOG0B.js";import"./vendor-form-ui-C6F7344s.js";import"./vendor-date-XKm2J5pk.js";import"./vendor-meta-D6H5T8-B.js";import"./useProductSectionProductList-DB50oUuG.js";const O=({eventNo:t,sectionNo:i,searchParams:c,options:a})=>T(V({eventNo:t,sectionNo:i,searchParams:c,options:a})),B=({eventNos:t,options:i})=>T(k({eventNos:t,options:i}));var G="_1u3645o0",U="_1u3645o1",H="_1u3645o2",W="_1u3645o3",$="_1u3645o4",q="_1u3645o5",Q="_1u3645o6",Y="_1u3645o7",F="_1u3645o9 _1u3645o8",J="_1u3645oa _1u3645o8",K="_1u3645ob",X="_1u3645oc",Z="_1u3645od",D="_1u3645oe",ee="_1u3645of",se="_1u3645og",oe="_1u3645oh",re="_1u3645oi",te="_1u3645oj";const ie={MAIN_EVENT:"MAIN_EVENT"},Me=()=>{var x,g;const{isMobile:t}=I(),{data:i}=w(),c=((g=(x=i==null?void 0:i.multiLevelCategories)==null?void 0:x.find(o=>o.managementCode===ie.MAIN_EVENT))==null?void 0:g.categoryNo)??0,{data:a}=z({searchParams:{page:{number:1,size:1},keywordInfo:{type:"NAME",value:""},categoryNos:[c],progressStatus:"ING",order:{direction:"DESC",by:"REGISTER_DATE"}},options:{enabled:!!c}}),s=l.useMemo(()=>_((a==null?void 0:a.contents)??[]),[a]),m=(s==null?void 0:s.eventNo)||0,{data:N}=B({eventNos:[m],options:{enabled:!!m}}),v=l.useMemo(()=>{var o,r,h;return((h=(r=(o=_(N??[]))==null?void 0:o.sections)==null?void 0:r[0])==null?void 0:h.sectionNo)??0},[N]),{data:n,isLoading:y}=O({eventNo:m,sectionNo:v,searchParams:{pageNumber:1,pageSize:4,order:"ADMIN_SETTING",saleStatus:"RESERVATION_AND_ONSALE"},options:{enabled:!!m&&!!v}}),d=s?`${j.EVENTS.MAIN}/${s.eventNo}`:j.EVENTS.MAIN,E=l.useMemo(()=>{var o;return((o=s==null?void 0:s.tag)==null?void 0:o.split(",").map(r=>r.trim()).filter(Boolean))??[]},[s==null?void 0:s.tag]),u=l.useMemo(()=>{var o;return((o=n==null?void 0:n.products)==null?void 0:o.slice(0,4).map(r=>P(r)))??[]},[n==null?void 0:n.products]);return s?e.jsx("section",{className:G,children:e.jsxs("div",{className:U,children:[e.jsxs("div",{className:H,children:[e.jsxs("div",{className:W,children:[e.jsxs("div",{className:$,children:[e.jsx("h2",{className:q,children:s.label}),e.jsx("span",{className:Q,children:"NEW"})]}),E.length>0&&e.jsx("div",{className:Y,children:E.map((o,r)=>e.jsxs("span",{className:r===0?J:F,children:["#",o]},`${o}-${r}`))})]}),e.jsxs(p,{className:K,to:d,children:[e.jsx("span",{children:"더보기"}),e.jsx(R,{size:16,strokeWidth:2})]})]}),e.jsx("div",{className:Z,children:e.jsx(p,{to:d,children:e.jsx("img",{src:S(s.mobileimageUrl),alt:s.label,loading:"lazy"})})}),!!(s!=null&&s.promotionText)&&e.jsx("p",{className:X,children:s.promotionText}),e.jsxs("div",{className:D,children:[e.jsx(p,{className:ee,to:d,children:e.jsx("img",{src:S(s.pcImageUrl),alt:s.label,loading:"lazy"})}),e.jsx(C,{isLoading:y,loadingStyle:{margin:"auto 0"},children:A(u)?e.jsx("div",{className:oe,children:e.jsx(L,{text:"전시중인 상품이 없습니다.",style:{height:"150px"}})}):t?e.jsx(f,{className:re,slidesPerView:2.3,spaceBetween:5,children:u.map(o=>e.jsx(M,{className:te,children:e.jsx(b,{...o,isMobile:t,reviewRating:void 0,isVisiblePromotionText:!0})},o.productNo))}):e.jsx("div",{className:se,children:u.map(o=>l.createElement(b,{...o,key:o.productNo,isMobile:t,reviewRating:void 0,isVisiblePromotionText:!0}))})})]})]})}):null};export{Me as default};