const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D-mAO_Eb.js","assets/vendor-react-C630P38J.js","assets/vendor-overlay-B61Jbn6n.js","assets/feature-order-6oWWie7u.js","assets/vendor-utils-Cb1MAKRV.js","assets/vendor-query-BjC2S-sR.js","assets/vendor-i18n-D_F5k183.js","assets/vendor-fxts-IS4CCBC4.js","assets/vendor-rhf-CXRF5ML7.js","assets/vendor-zod-BNDLCzeL.js","assets/vendor-runtime-BrGgGswE.js","assets/vendor-hooks-D-WB61cZ.js","assets/vendor-cookie-BFUm5jHE.js","assets/vendor-state-BxLZOG0B.js","assets/vendor-form-ui-C6F7344s.js","assets/vendor-date-XKm2J5pk.js","assets/vendor-form-ui-3MQXPqBX.css","assets/feature-order-vRhoSQS7.css","assets/index-jVNKXFue.js","assets/useMyReviewableList-DeW7KwUt.js","assets/useMyReviewableList-BYjK7K81.css","assets/index-C1BMC10b.css","assets/index-Dkpm1WqR.js","assets/useProductSectionProductList-DqDywqva.js","assets/useProductSectionProductList-nztXiRiu.css","assets/vendor-swiper-CwUwDtZu.js","assets/vendor-swiper-CPwnKXDO.css","assets/index-BM9NY626.js","assets/vendor-meta-D6H5T8-B.js","assets/index-DMXtX4wg.css","assets/index-DbjuhovC.js","assets/index-PcgRmJj1.js","assets/useBrandInfoByBrandNo-Dbef1v7V.js","assets/usePageGuard-CvpeBRdF.js","assets/index-DZcq9_QS.js","assets/index-DaHaQbCN.css","assets/index-BA_x70vC.js","assets/index-Y2alW6Js.css","assets/event-BE3RnkRL.js","assets/event-C5SXUBGs.css","assets/product-ewP7vbJz.js","assets/product-DAt6ob65.css","assets/index-DBEI34A6.css","assets/index-BNNHGh9P.js","assets/index-D8ZtNGH-.js","assets/index-Dq9t2D22.js","assets/index-Cm1RqQJU.css"])))=>i.map(i=>d[i]); import{c as Fe,h as ve,r as oe,j as ae,cc as ls,cd as ds,ce as ms,cf as fe,N as pe,u as D,bF as us,bL as $e,cg as os,H as hs,ch as xs,ci as K,cj as Ue,aG as W,ck as gs,az as bs,d as He,aH as Y,cl as vs,o as ps,cm as js,cn as fs,co as ys,cp as Ns,cq as Cs,cr as _s,cs as rs,Q as ue,a3 as re,B as Ps,ct as Is,aa as Ss,cu as Os,cv as Ts,cw as ks,b8 as qe,cx as ws,R as Ls,cy as Rs,L as Bs,z as Ve,cz as As,cA as Ms,cB as Es}from"./feature-order-6oWWie7u.js";import{j as e,L as ce,o as Ge,r as m,R as J,c as ye,a as zs}from"./vendor-react-C630P38J.js";import{q as ne,p as Ke,j as Fs,f as $s,t as Us,m as Hs}from"./vendor-fxts-IS4CCBC4.js";import{P as je,w as qs}from"./vendor-overlay-B61Jbn6n.js";import{q as Vs}from"./vendor-utils-Cb1MAKRV.js";import{u as Gs}from"./index-CxJZd8CK.js";import{g as Ks,e as Ws,i as Ys,S as Js}from"./index-BM9NY626.js";import{u as le}from"./vendor-i18n-D_F5k183.js";import{c as Qs}from"./vendor-query-BjC2S-sR.js";import{S as ie}from"./vendor-runtime-BrGgGswE.js";import{d as Xs,b as Zs,k as Ds,g as en,a as sn}from"./index-DZcq9_QS.js";import{L as nn}from"./useProductSectionProductList-DqDywqva.js";import{S as tn}from"./index-DPb8dqeu.js";import{S as he,P as on,a as rn,b as xe,N as We,T as an}from"./vendor-swiper-CwUwDtZu.js";import{a as cn}from"./vendor-hooks-D-WB61cZ.js";import"./vendor-rhf-CXRF5ML7.js";import"./vendor-zod-BNDLCzeL.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";var is="plhfhu0",te="plhfhu1",Ye="plhfhu2",ln="plhfhu3",ge="plhfhu5";const dn=({categoryNo:t,currentCategoryNo:r,search:a}={})=>{const n=t??0,l=r??0,{data:o}=Gs({categoryNo:n}),s=Ks(),i=Ws(n,o==null?void 0:o.multiLevelCategories),g=a??Vs.stringify({by:void 0,direction:void 0});return i?e.jsxs("ul",{className:is,children:[!!s&&e.jsxs("li",{className:te,children:[e.jsx(ce,{className:Fe(Ye),to:{pathname:Ge(ve.PRODUCTS.LIST,{categoryNo:String(s)}),search:g},children:"홈"}),i.length>0&&e.jsx(oe,{size:14,strokeWidth:2,color:ae.mediumGray})]}),i.map((x,u)=>e.jsxs("li",{className:te,children:[e.jsx(ce,{className:Fe(Ye,x.categoryNo===Number(l)&&ln),to:{pathname:Ge(ve.PRODUCTS.LIST,{categoryNo:String(x.categoryNo)}),search:g},children:x.label}),u!==i.length-1&&e.jsx(oe,{size:14,strokeWidth:2,color:ae.mediumGray})]},`breadcrumb-${u}-${x.categoryNo}`))]}):null},mn=()=>e.jsxs("ul",{className:is,children:[e.jsxs("li",{className:te,children:[e.jsx("div",{className:ge,style:{width:"30px"}}),e.jsx(oe,{size:14,strokeWidth:2,color:ae.mediumGray})]}),e.jsxs("li",{className:te,children:[e.jsx("div",{className:ge,style:{width:"50px"}}),e.jsx(oe,{size:14,strokeWidth:2,color:ae.mediumGray})]}),e.jsx("li",{className:te,children:e.jsx("div",{className:ge,style:{width:"70px"}})})]}),Ne=({productNo:t,enabled:r=!0})=>{var g;const{productDetailSearchParams:a}=ls(),{data:n,isFetched:l,isError:o,error:s}=ds({productNo:t,searchParams:a,options:{enabled:r}}),i=!!((g=n==null?void 0:n.baseInfo)!=null&&g.usableRestockNoti);return m.useMemo(()=>{var w,L,A,M,k,R,E,j,O,_,q,V,Q,F,$,U;const x=!!(n!=null&&n.liked),u=!!(n!=null&&n.limitations.naverPayHandling),y=(n==null?void 0:n.relatedProductNos)||[],d=n&&ms((w=n==null?void 0:n.status)==null?void 0:w.soldout,(L=n==null?void 0:n.stock)==null?void 0:L.stockCnt,(A=n==null?void 0:n.reservationData)==null?void 0:A.reservationStockCnt),h=(((M=n==null?void 0:n.price)==null?void 0:M.immediateDiscountAmt)??0)>0,N=(((k=n==null?void 0:n.price)==null?void 0:k.immediateDiscountAmt)??0)+(((R=n==null?void 0:n.price)==null?void 0:R.additionDiscountAmt)??0)+(((E=n==null?void 0:n.price)==null?void 0:E.couponDiscountAmt)??0)>0,c=((j=n==null?void 0:n.limitations)==null?void 0:j.maxBuyTimeCnt)??0,v=((O=n==null?void 0:n.limitations)==null?void 0:O.minBuyCnt)||1,p=((_=n==null?void 0:n.limitations)==null?void 0:_.maxBuyDays)||0,C=((q=n==null?void 0:n.limitations)==null?void 0:q.maxBuyPeriodCnt)||0,P=((V=n==null?void 0:n.limitations)==null?void 0:V.maxBuyPersonCnt)||0,b=((Q=n==null?void 0:n.price)==null?void 0:Q.salePrice)??0,I=((F=n==null?void 0:n.price)==null?void 0:F.immediateDiscountAmt)??0,B=(($=n==null?void 0:n.price)==null?void 0:$.additionDiscountAmt)??0,T=((U=n==null?void 0:n.price)==null?void 0:U.couponDiscountAmt)??0,S=fe(b).subtract(I).subtract(B),H=S.subtract(T);return{productDetailData:n,isProductDetailFetched:l,isError:o,error:s,liked:x,isNaverPayAvailable:u,relatedProductNos:y,isRestockAvailable:i,isSoldOut:d,isDefaultDiscount:h,isMaxDiscount:N,maxBuyTimeCnt:c,minBuyCnt:v,maxBuyDays:p,maxBuyPeriodCnt:C,maxBuyPersonCnt:P,salePrice:b,immediateDiscountAmt:I,additionDiscountAmt:B,couponDiscountAmt:T,benefitPrice:S,couponBenefitPrice:H}},[n,l,o,s,i])};var un="wzx3sj0",hn="wzx3sj1";const xn=J.memo(({content:t})=>{const{t:r}=le();return e.jsx("div",{className:un,children:t?e.jsx("div",{className:hn,dangerouslySetInnerHTML:{__html:t||""}}):e.jsx(pe,{text:r("상품 상세 정보가 없습니다.")})})});var gn="_1obj9bj0",Je={selected:"_1obj9bj2 _1obj9bj1",default:"_1obj9bj3 _1obj9bj1"};const bn=({tabList:t=[]})=>{const{isMobile:r}=D(),a=m.useRef(null),n=r?110:140,{tabList:l,selectedTab:o,onTabClick:s}=us({type:"single",list:t}),i=m.useRef(null),g=m.useRef({});m.useEffect(()=>{i.current&&i.current.disconnect();const u=t.filter(d=>{var h;return(h=d.ref)==null?void 0:h.current});if(ne(u))return;const y=`-${n}px 0px -50% 0px`;return i.current=new IntersectionObserver(d=>{if(d.forEach(N=>{var v;const c=(v=u.find(p=>p.ref.current===N.target))==null?void 0:v.id;if(c){if(N.isIntersecting){g.current[c]=!0;return}delete g.current[c]}}),Object.keys(g.current).length>0){const c=u.filter(v=>g.current[v.id]).reduce((v,p)=>{var b,I;const C=((b=v.ref.current)==null?void 0:b.getBoundingClientRect().top)??1/0;return(((I=p.ref.current)==null?void 0:I.getBoundingClientRect().top)??1/0){var h;d.ref.current&&((h=i.current)==null||h.observe(d.ref.current))}),()=>{i.current&&i.current.disconnect()}},[t,n,o,s]);const x=u=>{const y=h=>{var N,c,v,p;try{const C=((N=document.getElementById("header"))==null?void 0:N.offsetHeight)??parseInt(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))??0,P=((c=a.current)==null?void 0:c.offsetHeight)??0;$e&&h.current?$e.scrollTo(h.current,{offset:-(C+P)}):window.scrollTo({top:(((v=h.current)==null?void 0:v.offsetTop)??0)-C-P,behavior:"smooth"})}catch{window.scrollTo({top:(((p=h.current)==null?void 0:p.offsetTop)??0)-0,behavior:"smooth"})}},d=t.find(h=>h.id===u);d&&y(d.ref)};return ne(l)?null:e.jsx("ul",{ref:a,className:gn,children:l.map(({id:u,label:y,counter:d})=>e.jsx("li",{className:(o==null?void 0:o.id)===u?Je.selected:Je.default,onClick:()=>{x(u)},children:e.jsxs("p",{children:[y,!ne(d)&&` (${d})`]})},u))})},vn=J.memo(bn);var pn="tp1v3z0",jn="tp1v3z1",fn="tp1v3z2",yn="tp1v3z3",Nn="tp1v3z4",Cn="tp1v3z5";const _n=({dutyInfo:t})=>{const r=m.useMemo(()=>t?os(t):[],[t]);return e.jsxs("div",{className:pn,children:[e.jsx("h4",{className:jn,children:"상품 정보고시"}),e.jsx("ul",{className:fn,children:r.map(({key:a,value:n},l)=>e.jsxs("li",{className:yn,children:[e.jsx("p",{className:Nn,children:a}),e.jsx("pre",{className:Cn,children:n})]},`${a}-${l}`))})]})},Pn=J.memo(_n);var In="paihoe0",Sn="paihoe1",On="paihoe2";const Qe=({title:t,children:r})=>e.jsxs("div",{className:In,children:[e.jsx("h4",{className:Sn,children:t}),e.jsx("div",{className:On,children:r})]});var Tn="_1gtwyi0",kn="_1gtwyi1",wn="_1gtwyi2",Ln="_1gtwyi3",Rn="_1gtwyi4",Bn="_1gtwyi5",An="_1gtwyi6",Mn="_1gtwyi7",En="_1gtwyi8",zn="_1gtwyi9",Fn="_1gtwyin",$n="_1gtwyio",Un="_1gtwyip",Hn="_1kjazzj0",qn="_1kjazzj1",Vn="_1kjazzj2",Gn="_1kjazzj3",Kn="_1kjazzj4",Wn="_1kjazzj5",Yn="_1kjazzj6",Jn="_1kjazzj7";const Xe=20,Qn=15e3,Xn=({discountBasePrice:t})=>{const{data:r}=Xs({type:"id",banners:[Zs.CREDIT_CARD_BENEFIT]}),a=Ds(r??[])[0];if(!a)return null;const n=Math.min(Math.floor(t*(Xe/100)),Qn),l=t-n;return e.jsxs("section",{className:Hn,children:[e.jsxs("div",{className:qn,children:[e.jsx("p",{className:Vn,children:a.name}),e.jsxs("p",{className:Gn,children:[e.jsxs("strong",{className:Kn,children:[Xe,"%"]}),e.jsx("span",{className:Wn,children:fe(l).format()})]})]}),e.jsx(ce,{className:Yn,to:sn({landingUrlType:a.landingUrlType,landingUrl:a.landingUrl}),target:en(a.browerTargetType),rel:"noopener noreferrer","aria-label":a.name,children:e.jsx("img",{className:Jn,src:a.imageUrl,alt:a.name})})]})};var Zn="_18svzbe0",Dn="_18svzbe1",et="_18svzbe2",st="_18svzbe3",nt="_18svzbe4",tt="_18svzbe5",ot="_18svzbe6",rt="_18svzbe7",it="_18svzbea",Ze="_18svzbeb";const at=W(()=>Y(async()=>{const{CouponDownloadBottomSheet:t}=await import("./index-D-mAO_Eb.js");return{CouponDownloadBottomSheet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({CouponDownloadBottomSheet:t})=>({default:t}))),ct=W(()=>Y(async()=>{const{CouponDownloadModal:t}=await import("./index-D-mAO_Eb.js");return{CouponDownloadModal:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({CouponDownloadModal:t})=>({default:t}))),lt=W(()=>Y(async()=>{const{RestockNotificationModal:t}=await import("./feature-order-6oWWie7u.js").then(r=>r.e1);return{RestockNotificationModal:t}},__vite__mapDeps([3,1,4,5,2,6,7,8,9,10,11,12,13,14,15,16,17])).then(({RestockNotificationModal:t})=>({default:t}))),dt=W(()=>Y(async()=>{const{RestockNotificationBottomSheet:t}=await import("./feature-order-6oWWie7u.js").then(r=>r.e1);return{RestockNotificationBottomSheet:t}},__vite__mapDeps([3,1,4,5,2,6,7,8,9,10,11,12,13,14,15,16,17])).then(({RestockNotificationBottomSheet:t})=>({default:t}))),mt=({isPartialRestockAvailable:t})=>{var k,R,E;const{t:r}=le(),{isMobile:a}=D(),n=ye(),l=Number(n.productNo)||0,{openLoginDialog:o}=hs(),{productDetailData:s,salePrice:i,immediateDiscountAmt:g,additionDiscountAmt:x,couponDiscountAmt:u,benefitPrice:y,couponBenefitPrice:d,minBuyCnt:h,maxBuyTimeCnt:N,maxBuyDays:c,maxBuyPeriodCnt:v,maxBuyPersonCnt:p}=Ne({productNo:l}),{productLimitCount:C}=m.useMemo(()=>xs({salePrice:i,immediateDiscountAmt:g,additionDiscountAmt:x,couponDiscountAmt:u,benefitPrice:y,couponBenefitPrice:d,minBuyCnt:h,maxBuyTimeCnt:N,maxBuyDays:c,maxBuyPeriodCnt:v,maxBuyPersonCnt:p,t:r}),[x,y,d,u,g,c,v,p,N,h,i,r]),{productImageUrl:P,productBaseName:b,productBrandNameKo:I}=m.useMemo(()=>{var j,O;return{productImageUrl:(j=s==null?void 0:s.baseInfo.imageUrlInfo.find(_=>_.type==="IMAGE_URL"))==null?void 0:j.url,productBaseName:K(s==null?void 0:s.baseInfo.productName),productBrandNameKo:K((O=s==null?void 0:s.brand)==null?void 0:O.nameKo)}},[s]),B=m.useCallback(()=>{if(!Ue()){o();return}je.open(j=>a?e.jsx(ie,{fallback:null,children:e.jsx(at,{productNo:l,...j})}):e.jsx(ie,{fallback:null,children:e.jsx(ct,{productNo:l,...j})}))},[a,l,o]),T=m.useCallback(()=>{if(!Ue()){o();return}je.open(j=>a?e.jsx(ie,{fallback:null,children:e.jsx(dt,{productNo:l,productName:b,brandName:I,imageUrl:P,...j})}):e.jsx(ie,{fallback:null,children:e.jsx(lt,{productNo:l,productName:b,brandName:I,imageUrl:P,...j})}))},[b,I,P,l,a,o]),{deliveryFeeLabel:z,remoteDeliveryFeeLabel:S}=gs(s==null?void 0:s.deliveryFee),H=z||S?e.jsxs("div",{className:ot,children:[z&&e.jsx("p",{children:z}),S&&e.jsx("span",{className:rt,children:S})]}):null,w=((k=s==null?void 0:s.baseInfo)==null?void 0:k.placeOriginLabel)||((R=s==null?void 0:s.baseInfo)==null?void 0:R.placeOriginEtcLabel),L=(E=s==null?void 0:s.baseInfo)==null?void 0:E.productManagementCd,A=Math.max(i-g-x,0),M=[{key:"purchase-limit",label:r("구매제한"),content:C?e.jsx("p",{children:C}):null},{key:"origin",label:r("원산지"),content:w?e.jsx("p",{children:w}):null},{key:"product-code",label:r("상품코드"),content:L?e.jsx("p",{children:L}):null},{key:"delivery-fee",label:r("배송비"),content:H}].filter(({content:j})=>!!j);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:Zn,children:[e.jsx(bs,{salePrice:i,immediateDiscountAmt:g,additionDiscountAmt:x,containerClassName:Dn,priceTextClassName:et,standardPriceClassName:st}),e.jsxs("div",{className:it,children:[e.jsx(He,{tone:"dark",className:Ze,onClick:B,children:e.jsx("span",{children:r("쿠폰받기")})}),t&&e.jsx(He,{tone:"gray",variant:"outline",className:Ze,onClick:T,children:e.jsx("p",{children:r("재입고 알림")})})]})]}),e.jsx(Xn,{discountBasePrice:A}),e.jsx("div",{className:nt,children:M.map(({key:j,label:O,content:_})=>e.jsxs("div",{className:tt,children:[e.jsx("label",{children:O}),_]},j))})]})},ut=J.memo(mt),ht=({liked:t,productNo:r})=>{const{isMobile:a}=D();return e.jsx("div",{className:En,id:"productNo","data-product-no":r,children:e.jsxs("div",{className:zn,children:[e.jsx(nn,{isMobile:a,liked:t,productNo:r,variant:"product-detail"}),e.jsx(tn,{})]})})},xt=J.memo(ht),gt=({onGiftButtonClick:t,onCartButtonClick:r,onPurchaseButtonClick:a})=>{const{isTablet:n}=D(),{t:l}=le(),o=ye(),s=Number(o.productNo)||0,{productDetailData:i,liked:g,isRestockAvailable:x,isSoldOut:u}=Ne({productNo:s}),{productName:y,promotionText:d,brandName:h,brandNo:N}=m.useMemo(()=>{var U,ee,se;const F=K(((U=i==null?void 0:i.baseInfo)==null?void 0:U.productName)??""),$=K(((ee=i==null?void 0:i.brand)==null?void 0:ee.name)??"");return{productName:$?`[${$}] ${F}`:F,promotionText:(i==null?void 0:i.baseInfo.promotionText)||"",brandName:$,brandNo:((se=i==null?void 0:i.brand)==null?void 0:se.brandNo)??0}},[i]),{optionView:{productOptionListData:c,getFlatOptionLabel:v,getMultiLevelOptionLabel:p,getOptionImage:C,isFlatOption:P,isOptionDisabled:b,isSomeOptionSoldOut:I,getSelectedOptionValue:B,isFlatOptionUsed:T,isMultiLevelOptionUsed:z,isRequiredOptionUsed:S},selectedOptionState:{filteredSelectedOptionList:H,totalPrice:w},textOptionState:{textOptionInputs:L,productTextOptionInputs:A},optionActions:{onFlatOptionChange:M,onMultiOptionChange:k,onRequiredOptionChange:R,onOptionDeleteClick:E,onPlusClick:j,onMinusClick:O,onChangeProductCount:_,onInputOptionChange:q}}=vs({productNo:s}),V=x&&I,Q=Qs({mutationKey:ps.write(),status:"pending"});return e.jsxs("div",{className:Tn,children:[e.jsxs("div",{className:kn,children:[h&&e.jsxs(ce,{to:{pathname:`${ve.BRANDS.MAIN}/${N}`},className:wn,children:[e.jsx("span",{children:h}),e.jsx(oe,{className:Ln,size:14,strokeWidth:2})]}),e.jsxs("div",{className:Rn,children:[e.jsx("h1",{className:Bn,children:y}),e.jsx(xt,{liked:g,productNo:s})]})]}),d&&e.jsx("p",{className:An,children:d}),e.jsx(ut,{isPartialRestockAvailable:V}),!n&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:Mn,children:[T&&e.jsx(js,{selectState:"relative",onChange:M,optionContext:{flatOptions:(c==null?void 0:c.flatOptions)??[],getFlatOptionLabel:v,getOptionImage:C,isOptionDisabled:b}}),z&&e.jsx(fs,{selectState:"relative",onChange:k,optionContext:{labels:(c==null?void 0:c.labels)??[],multiLevelOptions:(c==null?void 0:c.multiLevelOptions)??[],getMultiLevelOptionLabel:p,getOptionImage:C,isFlatOption:P,isOptionDisabled:b}}),S&&e.jsx(ys,{selectState:"relative",onChange:R,optionContext:{multiLevelOptions:(c==null?void 0:c.multiLevelOptions)??[],getMultiLevelOptionLabel:p,getOptionImage:C,isOptionDisabled:b}}),e.jsx(Ns,{selectedOptionList:H,onOptionDeleteClick:E,onPlusClick:j,onMinusClick:O,onChangeProductCount:_,getSelectedOptionValue:B,textOptionList:L.OPTION,onInputOptionChange:q}),e.jsx(Cs,{target:{type:"product",productNo:s},textOptionInputs:A,onInputOptionChange:q}),e.jsx(_s,{baseProductNo:s}),e.jsxs("div",{className:Fn,children:[e.jsx("label",{className:$n,children:l("총 상품금액")}),e.jsx("p",{className:Un,children:fe(w).format()})]}),e.jsx(rs,{canAddToCart:i==null?void 0:i.limitations.canAddToCart,isSoldOut:!!u,isPending:Q>0,onGiftButtonClick:t,onCartButtonClick:r,onPurchaseButtonClick:a})]})})]})},bt=J.memo(gt);var vt="_1bul0yv0",De="_1bul0yv1",be="_1bul0yv2",pt="_1bul0yv3",jt="_1bul0yv4",es="_1bul0yv5",ft="_1bul0yv6";const yt=({imageUrls:t})=>{const{isMobile:r}=D(),a={modules:[We,an],loop:t.length>1,pagination:{enabled:!0,el:".product-swiper-pagination"},thumbs:{swiper:`.${es}`}},n={modules:[We],watchSlidesProgress:!0,slidesPerView:4,direction:"horizontal",slideToClickedSlide:!0,breakpoints:{[Ps.MD]:{direction:"vertical",slidesPerView:5}}},l={modules:[on,rn],loop:!0,autoplay:{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},pagination:{enabled:!0,el:".product-swiper-pagination"}};return e.jsx("div",{className:vt,children:r?e.jsxs(e.Fragment,{children:[e.jsx(he,{className:De,...l,children:t.map(o=>e.jsx(xe,{className:be,children:e.jsx(ue,{className:pt,src:re(o,860,860),srcSet:[`${re(o,670,670)} 670w`,`${re(o,860,860)} 860w`,`${re(o,1536,1536)} 1536w`].join(", ")})},o))}),t.length>1&&e.jsx("div",{className:`${jt} product-swiper-pagination`})]}):e.jsxs("div",{className:ft,children:[e.jsx(he,{className:es,...n,children:t.map(o=>e.jsx(xe,{className:be,children:e.jsx(ue,{src:o})},o))}),e.jsx(he,{className:De,...a,children:t.map(o=>e.jsx(xe,{className:be,children:e.jsx(ue,{src:o})},o))})]})})},Nt=J.memo(yt),Z=({children:t,errorFallback:r=e.jsx(e.Fragment,{}),suspenseFallback:a=e.jsx(e.Fragment,{})})=>e.jsx(Is,{fallback:a,errorFallback:r,children:t}),ss=({children:t,minHeight:r=320,rootMargin:a="400px 0px"})=>{const{ref:n,isIntersecting:l}=cn({threshold:0,rootMargin:a,freezeOnceVisible:!0});return e.jsx("div",{ref:n,style:l?void 0:{minHeight:`${r}px`},children:l?t:null})};var Ct="_1u5bggl0",_t="_1u5bggl1",Pt="_1u5bggl2",It="_1u5bggl3",ns="_1u5bggl4",St="_1u5bggl5",ts="_1u5bggl6",Ot="_1u5bggl7",Tt="_1u5bggl8",kt="_1u5bggl9",wt="_1u5bggla",Lt="_1u5bgglb";const Rt=W(()=>Y(async()=>{const{RelatedProductList:t}=await import("./index-Dkpm1WqR.js").then(r=>r.i);return{RelatedProductList:t}},__vite__mapDeps([22,1,4,3,5,2,6,7,8,9,10,11,12,13,14,15,16,17,23,24,25,26,27,28,29])).then(({RelatedProductList:t})=>({default:t}))),Bt=W(()=>Y(async()=>{const{ProductReviewSection:t}=await import("./index-DbjuhovC.js");return{ProductReviewSection:t}},__vite__mapDeps([30,31,1,7,8,9,32,5,3,4,2,6,10,11,12,13,14,15,16,17,19,20,33,34,28,25,26,35,36,37,38,39,40,41,42,27])).then(({ProductReviewSection:t})=>({default:t}))),At=W(()=>Y(async()=>{const{ProductInquirySection:t}=await import("./index-BNNHGh9P.js").then(r=>r.i);return{ProductInquirySection:t}},__vite__mapDeps([43,44,1,8,9,3,4,5,2,6,7,10,11,12,13,14,15,16,17,45,34,28,25,26,35,38,39,46,22,23,24,27,29,33])).then(({ProductInquirySection:t})=>({default:t}))),oo=()=>{var _e,Pe,Ie;const{t}=le(),r=Ss(),a=zs(),{isTablet:n}=D(),l=ye(),o=Number(l.productNo)||0,{productDetailData:s,isProductDetailFetched:i,isError:g,error:x,isNaverPayAvailable:u,relatedProductNos:y,isSoldOut:d,maxBuyTimeCnt:h,maxBuyDays:N,maxBuyPeriodCnt:c,maxBuyPersonCnt:v}=Ne({productNo:o});m.useEffect(()=>{var f,G;if(!r){const de=!!((f=s==null?void 0:s.baseInfo)!=null&&f.adult),X=g&&((G=x==null?void 0:x.response)==null?void 0:G.status)&&[401,403].includes(x.response.status);(i&&de||X)&&window.location.replace(Os(`${a.pathname}${a.search}`))}},[i,r,(_e=s==null?void 0:s.baseInfo)==null?void 0:_e.adult,g,x,a.pathname,a.search]);const{selectedOptionList:p,textOptionRequiredInfoList:C,isDefaultOptionUsed:P,productOptionListData:b,productOptionImagesData:I}=Ts({productNo:o}),B=ks(f=>f.addOption),{productTitle:T,productImageUrl:z,productMetaImageUrl:S,productContent:H,productDutyInfo:w,exchangeGuide:L,deliveryGuide:A,reviewCount:M,inquiryCount:k,categoryNo:R}=m.useMemo(()=>{var Oe,Te,ke,we,Le,Re,Be,Ae,Me,Ee,ze;const f=K(((Oe=s==null?void 0:s.brand)==null?void 0:Oe.name)??""),G=f?`[${f}] `:"",de=K((s==null?void 0:s.baseInfo.productName)??""),X=(s==null?void 0:s.baseInfo.imageUrls[0])??"",Se=((Te=s==null?void 0:s.categories[0])==null?void 0:Te.categories)??[];return{productTitle:`${G}${de}`,productImageUrl:X,productMetaImageUrl:X.includes(" ")?`http:${X.replace(" ","%20")}`:`https:${X}`,restockImageUrl:((ke=s==null?void 0:s.baseInfo.imageUrlInfo.find(me=>me.type==="IMAGE_URL"))==null?void 0:ke.url)??"",productContent:Ke([(we=s==null?void 0:s.baseInfo)==null?void 0:we.contentHeader,(Le=s==null?void 0:s.baseInfo)==null?void 0:Le.content,(Re=s==null?void 0:s.baseInfo)==null?void 0:Re.contentFooter],$s(me=>!!me),Fs("")),productDutyInfo:((Be=s==null?void 0:s.baseInfo)==null?void 0:Be.dutyInfo)||"",exchangeGuide:(s==null?void 0:s.exchangeGuide)||"",deliveryGuide:(s==null?void 0:s.deliveryGuide)||"",reviewCount:((Ae=s==null?void 0:s.counter)==null?void 0:Ae.reviewCnt)??0,inquiryCount:((Me=s==null?void 0:s.counter)==null?void 0:Me.inquiryCnt)??0,brandNameKo:(Ee=s==null?void 0:s.brand)==null?void 0:Ee.nameKo,categoryNo:(ze=Se[Se.length-1])==null?void 0:ze.categoryNo}},[s]),E=m.useMemo(()=>({title:T,og:{title:T,image:S},meta:{title:T,image:S}}),[S,T]),O=!!((Pe=qs()[qe.OPTION_BOTTOM_SHEET])!=null&&Pe.isOpen),_=m.useCallback(()=>{je.open(()=>null,{overlayId:qe.OPTION_BOTTOM_SHEET})},[]),q=m.useCallback(()=>n&&!O?(_(),!0):!1,[n,O,_]),{onCartButtonClick:V,onPurchaseButtonClick:Q,onGiftButtonClick:F}=ws({productNo:o,isSoldOut:!!d,canAddToCart:s==null?void 0:s.limitations.canAddToCart,memberOnly:s==null?void 0:s.limitations.memberOnly,quantityLimit:{maxBuyDays:N,maxBuyPeriodCnt:c,maxBuyPersonCnt:v},selectedOptionList:p,textOptionRequiredInfoList:C,isDefaultOptionUsed:P,shouldStopAction:q,clearOptionsAfterAddToCart:!0}),$=m.useCallback(f=>{if(f.saleType!=="SOLD_OUT")if(B({productNo:o,optionNo:f.optionNo,label:f.label||f.value||"",price:f.buyPrice??0,buyPrice:f.buyPrice??0,addPrice:f.addPrice??0,orderCnt:1,stockCnt:f.stockCnt??0,isRequiredOption:!1}),n)_();else{const G=document.querySelector(`.${ns}`);G&&G.scrollIntoView({behavior:"smooth"})}},[B,n,_,o]);Ys(o);const U=m.useRef(null),ee=m.useRef(null),se=m.useRef(null),Ce=m.useRef(null),as=m.useRef(null),cs=m.useMemo(()=>[{id:"baseInfo",label:"상세정보",isSelected:!0,ref:U},{id:"basicInfo",label:"기본정보",isSelected:!1,ref:ee},{id:"review",label:"리뷰",isSelected:!1,ref:se,counter:M},{id:"productInquiry",label:"상품문의",isSelected:!1,ref:Ce,counter:k}],[k,M]);return Ls({product:s}),Rs(),e.jsxs(e.Fragment,{children:[e.jsx(Js,{...E}),e.jsx(Bs,{isLoading:!i,isLoadedAnimation:!0,shouldAnimateOverflow:!1,loadingStyle:{height:"50vh"},children:e.jsxs("div",{className:Ct,children:[e.jsx("div",{className:Pt,children:e.jsx(Ve,{fallback:e.jsx(mn,{}),errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(dn,{categoryNo:R,currentCategoryNo:R})})}),e.jsxs("div",{className:_t,children:[e.jsxs("div",{className:It,children:[e.jsxs("div",{className:ns,children:[e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(Nt,{imageUrls:((Ie=s==null?void 0:s.baseInfo)==null?void 0:Ie.imageUrls)??[]})}),e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(bt,{onGiftButtonClick:F,onCartButtonClick:V,onPurchaseButtonClick:Q})}),!n&&!d&&u&&e.jsx("div",{className:Ot,id:"optionList","data-option-list":Ke(p,Hs(f=>({...f,productNo:o})),Us,JSON.stringify),children:e.jsx(As,{pageType:Ms.PRODUCT_DETAIL,productNo:o})})]}),!ne(y)&&e.jsx(Ve,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(Rt,{productNos:y})})]}),e.jsxs("div",{className:St,ref:as,children:[e.jsx(vn,{tabList:cs}),e.jsxs("div",{className:kt,children:[e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsxs("div",{ref:U,children:[e.jsx(Es,{productNo:o,optionImages:I,flatOptions:(b==null?void 0:b.flatOptions)??[],multiLevelOptions:(b==null?void 0:b.multiLevelOptions)??[],onSelectOption:$}),e.jsx(xn,{content:H})]})}),e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsxs("div",{ref:ee,className:wt,children:[!ne(os(w))&&e.jsx(Pn,{dutyInfo:w}),e.jsx(Qe,{title:t("배송 및 반품"),children:A?e.jsx("div",{className:ts,dangerouslySetInnerHTML:{__html:A}}):e.jsx(pe,{text:t("등록된 배송 및 반품 안내가 없습니다.")})}),e.jsx(Qe,{title:t("교환안내"),children:L?e.jsx("div",{className:ts,dangerouslySetInnerHTML:{__html:L}}):e.jsx(pe,{text:t("등록된 교환 안내가 없습니다.")})})]})}),e.jsx("div",{ref:se,children:e.jsx(ss,{minHeight:900,rootMargin:"300px 0px",children:e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(Bt,{productNo:o})})})}),e.jsx("div",{ref:Ce,className:k===0?Lt:void 0,children:e.jsx(ss,{minHeight:720,rootMargin:"240px 0px",children:e.jsx(Z,{errorFallback:e.jsx(e.Fragment,{}),children:e.jsx(At,{productNo:o,productName:K(s==null?void 0:s.baseInfo.productName),productImageUrl:z})})})})]})]})]}),n&&e.jsx("div",{className:Tt,children:e.jsx(rs,{cartNoticeVariant:"compact",canAddToCart:s==null?void 0:s.limitations.canAddToCart,isSoldOut:!!d,onGiftButtonClick:F,onCartButtonClick:V,onPurchaseButtonClick:_})})]})})]})};export{oo as default};