import{r as m,j as a,L as j}from"./vendor-react-C630P38J.js";import{p as u,h as z,L as b,c as P,f as v,d as E,t as h,l as A,i as C,m as S,q as x}from"./vendor-fxts-IS4CCBC4.js";import{S as y,N as R,P as g,b as T}from"./vendor-swiper-CwUwDtZu.js";import{u as _,h as w,E as D,t as M,Q as L,ay as k,r as V,N as O,az as G,B}from"./feature-order-CyMOR5ND.js";import"./vendor-utils-Cb1MAKRV.js";import{P as H}from"./index-CiAMQUDP.js";import{u as F,a as K}from"./useProductSectionProductList-cRfRDZxK.js";import{a as W}from"./useBrandInfoByBrandNo-Bs0QBnRc.js";import"./vendor-query-BjC2S-sR.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"./index-Cqr0ypdb.js";import"./vendor-meta-D6H5T8-B.js";var U="isz5530",X="isz5531",q="isz5532",Q="isz5533",Z="isz5534",$="isz5535",J="isz5536",Y="isz5537",f="isz5538",I="isz5539",aa="isz553a",sa="isz553b",ea="isz553c",ra="isz553d",ia="isz553e",ta="isz553f",na="isz553g",da="isz553h",ma="isz553i",oa="isz553j",la="isz553k",ca="isz553l",pa="isz553m";const Na="BRAND_LEFT_",ua="BRAND_RIGHT_",xa=8,Oa=()=>{const{isMobile:i}=_(),{data:d}=F(),e=m.useCallback(r=>u(d,E("sections"),v(c=>c.sectionId.startsWith(r)),P(c=>c.sectionNo),b,z),[d]),t=e(Na),o=e(ua),n=m.useMemo(()=>u([t,o],A,v(r=>!!(r!=null&&r.promotionText)),h),[t,o]),p=m.useCallback(r=>u(n,C(c=>(Number(c.promotionText)||0)===r)),[n]),l=m.useMemo(()=>u(n,S(r=>r.promotionText),h),[n]),{data:s}=W({searchParams:{displayBrandNos:l},options:{enabled:!x(l)}}),N=m.useMemo(()=>(s==null?void 0:s.brands)??[],[s==null?void 0:s.brands]);return x(N)?null:a.jsx("section",{className:U,children:a.jsxs("div",{className:X,children:[a.jsxs("div",{className:q,children:[a.jsx("h2",{className:Q,children:"BRAND VIEW"}),a.jsxs(j,{className:Z,to:w.BRANDS.MAIN,children:[a.jsx("span",{children:"더보기"}),a.jsx(D,{size:16,strokeWidth:2})]})]}),a.jsx("div",{className:$,children:N.map(r=>a.jsx(va,{brandInfo:r,isMobile:i,sectionInfo:p(r.displayBrandNo)},r.displayBrandNo))})]})})},va=({brandInfo:i,isMobile:d,sectionInfo:e})=>{const{data:t}=K({sectionId:(e==null?void 0:e.sectionId)??"",searchParams:{by:"ADMIN_SETTING",soldout:!0,saleStatus:"RESERVATION_AND_ONSALE",pageNumber:1,pageSize:xa,hasTotalCount:!0,hasOptionValues:!1,includeStopProduct:!1,direction:"DESC"},options:{enabled:!!(e!=null&&e.sectionId)}}),o=m.useMemo(()=>{var s;return((s=t==null?void 0:t.products)==null?void 0:s.map(N=>M(N)))??[]},[t==null?void 0:t.products]),n=`brand-swiper-prev-${i.displayBrandNo}`,p=`brand-swiper-next-${i.displayBrandNo}`,l=`brand-swiper-progressbar-${i.displayBrandNo}`;return a.jsxs("article",{children:[a.jsxs("div",{className:J,children:[a.jsxs("div",{className:Y,children:[a.jsx("div",{className:f,children:a.jsx(L,{className:I,src:i.displayAreaContentUrl,alt:i.mainBrandName})}),a.jsxs("div",{className:aa,children:[a.jsx("h3",{className:sa,children:(e==null?void 0:e.sectionName)??i.mainBrandName}),!!(e!=null&&e.sectionExplain)&&a.jsx("p",{className:ea,dangerouslySetInnerHTML:{__html:e==null?void 0:e.sectionExplain}})]})]}),a.jsxs("div",{className:ra,children:[a.jsx("button",{className:n,type:"button","aria-label":`${i.mainBrandName} 이전 상품`,children:a.jsx(k,{size:d?24:30})}),a.jsx("button",{className:p,type:"button","aria-label":`${i.mainBrandName} 다음 상품`,children:a.jsx(V,{size:d?24:30})})]})]}),x(o)?a.jsx(O,{text:"상품 목록이 없습니다."}):a.jsxs(y,{className:ia,modules:[R,g],slidesPerView:2.3,spaceBetween:5,rewind:!0,navigation:{prevEl:`.${n}`,nextEl:`.${p}`},pagination:{el:`.${l}`,type:"progressbar"},breakpoints:{[B.SM+1]:{slidesPerView:2,spaceBetween:10},[B.MD+1]:{slidesPerView:3,spaceBetween:10}},children:[o.map(s=>a.jsx(T,{className:ta,children:a.jsx(H,{...s,isMobile:d,reviewRating:void 0,brandNameComponent:a.jsx("p",{className:da,children:s.brandNameType==="NAME_KO"?s.brandNameKo:s.brandNameType==="NAME_EN"?s.brandNameEn:s.brandName}),productNameComponent:a.jsx("p",{className:ma,children:s.productName}),productPriceComponent:a.jsx(G,{containerClassName:la,standardPriceClassName:pa,priceTextClassName:ca,salePrice:s.salePrice,immediateDiscountAmt:s.immediateDiscountAmt,additionDiscountAmt:s.additionDiscountAmt}),productInformationClassName:na})},s.productNo)),a.jsx("div",{className:oa,children:a.jsx("div",{className:l})})]})]})};export{Oa as default};