import{a as b,j as e,cX as C,c as i,k as f,T as n,cV as M,m as v,ai as $,aC as g,aD as j,aL as E,d as y,n as L,R as w,a9 as U,bz as A,a6 as k,az as P,aB as Y,aE as B,b as u,C as _,W as F,af as G,aq as I,bT as z,bU as V,bV as Z,cY as H,cZ as X,c_ as q,ar as J}from"../index.Crez7j-Y.bundle.js";import{E as m}from"./ExpandSection.D-EhWsaW.bundle.js";import{u as K,a as Q}from"./useFetchMemberOrderDetail.B0wpuhLl.bundle.js";import{P as D,N as W,C as ee}from"./NextActionButton.CZP6ZWPo.bundle.js";import{E as O}from"./EmptyContent.BRQ9JwMr.bundle.js";import"./MyOrderAPIs.DZkd5slp.bundle.js";import"./MemberClaimAPIs.Df7MVfiB.bundle.js";import"./useClaimHooks.DyLDR42V.bundle.js";function se({refundInfo:l}){var c,x,o,d,h,p;const{isDesktop:t,isMobile:a}=b(),s=v.섬네일;return e.jsxs(C,{isMobile:a,children:[t&&e.jsx(i,{display:"flex",gap:2,flexDirection:"column",children:(c=l.refundOrderOptions)==null?void 0:c.map((r,N)=>{var S,T;return e.jsxs(i,{display:"flex",gap:2,alignItems:"center",children:[r.imageUrl&&e.jsx("img",{src:"".concat(r.imageUrl,"?").concat(s,"x").concat(s),alt:(S=r.optionName)!=null?S:"refund-".concat(N),width:s,height:s,style:{border:"1px solid ".concat(f)}}),e.jsxs(i,{children:[e.jsx(n,{variant:"body",component:"span",children:"(수량:".concat((T=r.orderCnt)!=null?T:0,")")}),e.jsx(n,{variant:"subtitle1",component:"span",children:r.productName}),e.jsx(n,{variant:"body",component:"p",children:"".concat(r.optionName,": ").concat(r.optionValue)})]})]},N)})}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"수령자명"})}),e.jsx(i,{flex:a?3:4,children:e.jsx(n,{variant:"subtitle1",fontWeight:400,children:(x=l.exchangeAddress)==null?void 0:x.name})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"수거지 주소"})}),e.jsx(i,{flex:a?3:4,children:e.jsx(n,{variant:"subtitle1",fontWeight:400,children:(o=l.exchangeAddress)==null?void 0:o.addressStr})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"휴대폰 번호"})}),e.jsx(i,{flex:a?3:4,children:e.jsx(n,{variant:"subtitle1",fontWeight:400,children:(d=l.exchangeAddress)==null?void 0:d.contact1})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"전화번호"})}),e.jsx(i,{flex:a?3:4,children:e.jsx(n,{variant:"subtitle1",fontWeight:400,children:(h=l.exchangeAddress)==null?void 0:h.contact2})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"배송 메모"})}),e.jsx(i,{flex:a?3:4,children:e.jsx(n,{variant:"subtitle1",fontWeight:400,children:M((p=l.exchangeAddress)==null?void 0:p.note)})})]})]})}const R=l=>{const{isDesktop:t,isMobile:a}=b();return e.jsxs(e.Fragment,{children:[t&&e.jsx(te,{...l}),a&&e.jsx(ie,{...l})]})};function te(l){const{index:t,length:a,orderOption:s,orderYmdt:c,escrow:x}=l,{formatPriceWithCommas:o}=$(),d=v.주문상세;return e.jsxs(g,{children:[t===0&&e.jsxs(j,{rowSpan:a,align:"center",children:[e.jsx(n,{variant:"body",component:"p",fontWeight:500,children:c&&E(c).format("YYYY-MM-DD")}),e.jsx(n,{variant:"small",component:"p",children:s.orderNo})]}),e.jsx(j,{children:e.jsxs(i,{display:"flex",children:[e.jsx("img",{src:"".concat(s.imageUrl,"?").concat(d,"x").concat(d),alt:s.optionName,style:{border:"1px solid ".concat(f)},width:d,height:d}),e.jsxs(i,{display:"flex",flexDirection:"column",justifyContent:"center",px:1,children:[e.jsx(n,{variant:"body",fontWeight:500,children:s.productName}),e.jsx(n,{variant:"small",children:"".concat(s.optionName," : ").concat(s.optionValue)}),s.inputs.map(h=>e.jsx(n,{variant:"body",children:h.inputValue}))]})]})}),e.jsx(j,{align:"center",children:e.jsx(n,{variant:"body",children:s.orderCnt})}),e.jsx(j,{align:"center",children:e.jsx(n,{variant:"body",component:"span",children:o(s.price.buyAmt,"WON")})}),e.jsx(j,{align:"center",children:e.jsx(i,{display:"flex",flexDirection:"column",gap:1,p:1,children:e.jsx(D,{claimNo:s.claimNo,claimStatusType:s.claimStatusType,claimStatusTypeLabel:s.claimStatusTypeLabel,nextActions:s.nextActions,orderOptionNo:s.orderOptionNo,orderStatusType:s.orderStatusType,orderStatusTypeLabel:s.orderStatusTypeLabel})})}),e.jsx(j,{align:"center",children:e.jsx(i,{display:"flex",flexDirection:"column",gap:1,p:1,children:e.jsx(W,{orderOptionNo:s.orderOptionNo,nextActions:s.nextActions,orderStatusType:s.orderStatusType,claimStatusTypeLabel:s.claimStatusTypeLabel,claimNo:s.claimNo,orderNo:s.orderNo,escrow:x!=null?x:!1})})})]})}function ie(l){const{orderOption:t,escrow:a,onOpenClaimStatusModal:s}=l,{formatPriceWithCommas:c}=$(),x=y.useCallback(()=>{s==null||s(t.claimStatusTypeLabel||"",t.claimNo||0)},[s]),o=A.주문목록;return e.jsxs(e.Fragment,{children:[e.jsxs(i,{py:1,px:2,my:2,bgcolor:L,display:"flex",justifyContent:"space-between",children:[e.jsx(i,{children:e.jsx(n,{variant:"subtitle1",color:w,children:t.claimStatusTypeLabel||t.orderStatusTypeLabel})}),e.jsx(U,{variant:"text",color:"black",disableRipple:!0,onClick:x,sx:{p:0},children:e.jsx(n,{variant:"button",children:"상세 보기"})})]}),e.jsxs(i,{display:"flex",children:[e.jsx("img",{src:"".concat(t.imageUrl,"?").concat(o,"x").concat(o),alt:t.optionName,style:{border:"1px solid ".concat(f)},width:o,height:o}),e.jsxs(i,{display:"flex",flexDirection:"column",justifyContent:"center",px:1,width:"calc(100% - ".concat(A.주문상세,"px)"),children:[e.jsx(n,{variant:"subtitle1",children:t.productName}),e.jsx(n,{variant:"body",children:t.optionValue}),t.inputs.map(d=>e.jsx(n,{variant:"body",children:d.inputValue})),e.jsx(n,{variant:"subtitle1",children:"".concat(c(t.price.buyAmt,"WON")," / ").concat(t.orderCnt,"개")})]})]}),e.jsx(W,{orderOptionNo:t.orderOptionNo,nextActions:t.nextActions,orderStatusType:t.orderStatusType,claimStatusTypeLabel:t.claimStatusTypeLabel,claimNo:t.claimNo,orderNo:t.orderNo,escrow:a!=null?a:!1})]})}function ne({orderDetail:l,isPending:t}){const a=l==null?void 0:l.orderOptionsGroupByPartner.flatMap(x=>x.orderOptionsGroupByDelivery).flatMap(x=>x.orderOptions),{isDesktop:s,isMobile:c}=b();return e.jsxs(i,{bgcolor:k,p:c?0:3,borderRadius:2,children:[s&&e.jsx(ae,{orderDetail:l,isPending:t,orderOptions:a}),c&&e.jsx(le,{orderDetail:l,isPending:t,orderOptions:a})]})}function ae(l){const{orderDetail:t,orderOptions:a,isPending:s}=l;return e.jsxs(P,{size:"small",sx:{"& th":{py:1,px:0,bgcolor:L},"& td":{px:0}},children:[e.jsx(Y,{children:e.jsxs(g,{children:[e.jsx(j,{width:150,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"주문일자(주문번호)"})}),e.jsx(j,{width:350,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"상품정보"})}),e.jsx(j,{width:70,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"수량"})}),e.jsx(j,{width:100,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"결제 금액"})}),e.jsx(j,{width:100,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"진행상태"})}),e.jsx(j,{width:100,align:"center",children:e.jsx(n,{variant:"body",fontWeight:500,children:"접수"})})]})}),e.jsxs(B,{children:[a&&a.length===0&&e.jsx(g,{children:e.jsx(j,{colSpan:6,children:e.jsx(O,{text:"주문 내역이 없습니다.",height:"40dvh"})})}),s&&Array.from({length:5}).map((c,x)=>e.jsx(g,{children:Array.from({length:6}).map((o,d)=>e.jsx(j,{children:e.jsx(u,{sx:{height:100,width:"70%",margin:"auto"}})},d*10))},x)),a==null?void 0:a.map((c,x,o)=>e.jsx(R,{orderOption:c,index:x,length:o.length,orderYmdt:t==null?void 0:t.orderYmdt,escrow:t==null?void 0:t.escrow},c.orderOptionNo))]})]})}function le(l){const{orderDetail:t,orderOptions:a,isPending:s}=l,[c,x]=y.useState({openModal:!1,claimStatusTypeLabel:"",claimNo:0}),o=y.useCallback(()=>x({openModal:!1,claimStatusTypeLabel:"",claimNo:0}),[]),d=y.useCallback((h,p)=>{x({openModal:!0,claimNo:p,claimStatusTypeLabel:h})},[]);return s?e.jsx(e.Fragment,{children:Array.from({length:3}).map((h,p)=>e.jsxs(i,{display:"flex",gap:2,mb:2,children:[e.jsx(u,{variant:"rectangular",sx:{height:100,flex:1}}),e.jsxs(i,{flex:2,children:[e.jsx(u,{variant:"text"}),e.jsx(u,{variant:"text"}),e.jsx(u,{variant:"text"}),e.jsx(u,{variant:"text"})]})]},p))}):(a==null?void 0:a.length)===0?e.jsx(O,{text:"주문 내역이 없습니다.",height:"40dvh"}):e.jsxs(e.Fragment,{children:[e.jsxs(i,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(n,{variant:"subtitle1",children:E(t==null?void 0:t.orderYmdt).format("YYYY-MM-DD")}),e.jsx(n,{variant:"subtitle1",color:_,children:t==null?void 0:t.orderNo})]}),a==null?void 0:a.map((h,p,r)=>e.jsx(R,{index:p,length:r.length,orderOption:h,orderYmdt:t==null?void 0:t.orderYmdt,escrow:t==null?void 0:t.escrow,onOpenClaimStatusModal:d},h.orderOptionNo)),e.jsx(ee,{title:c.claimStatusTypeLabel,claimNo:c.claimNo,open:c.openModal,onClose:o})]})}function re({refundInfo:l}){var s,c,x,o,d;const{isMobile:t}=b(),a=v.섬네일;return e.jsxs(C,{isMobile:t,children:[e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"반품 수거 방법"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:l.returnWayType==="SELLER_COLLECT"?"판매자 수거요청":"구매자 직접반품"})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"반품자명"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:(s=l.returnAddress)==null?void 0:s.name})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"수거지 주소"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:(c=l.returnAddress)==null?void 0:c.addressStr})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"휴대폰 번호"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:(x=l.returnAddress)==null?void 0:x.contact1})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"전화번호"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:(o=l.returnAddress)==null?void 0:o.contact2})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"참고사항"})}),e.jsx(i,{flex:t?3:4,children:e.jsx(n,{variant:"subtitle1",children:M((d=l.returnAddress)==null?void 0:d.note)})})]}),e.jsxs(i,{display:"flex",children:[e.jsx(i,{flex:1,children:e.jsx(n,{variant:"subtitle1",children:"반품 이미지"})}),e.jsxs(i,{flex:t?3:4,children:[l.claimImageUrls.length===0&&e.jsx(n,{variant:"body",children:"-"}),l.claimImageUrls.map((h,p)=>e.jsx(i,{component:"img",src:"".concat(h,"?").concat(a,"x").concat(a),alt:"refund-image-".concat(p),width:a,height:a,border:"1px solid ".concat(f)}))]})]})]})}function ue(){var o,d,h,p;const[l]=F(),t=l.get("orderNo")||"",a=G(J,r=>r.isLogin),{data:s,isPending:c}=a?K(t):Q(t),{isMobile:x}=b();return e.jsx(e.Fragment,{children:e.jsxs(i,{px:{desktop:4,mobile:2},gap:5,component:"section",display:"flex",flexDirection:"column",children:[x&&e.jsx(I,{title:"주문/배송 상세"}),e.jsx(m,{title:"주문/배송 상세",children:e.jsx(ne,{orderDetail:s,isPending:c})}),e.jsx(m,{title:"주문자 정보",children:e.jsx(z,{isPending:c,orderer:s==null?void 0:s.orderer,orderMemo:s==null?void 0:s.orderMemo})}),e.jsx(m,{title:"배송지 정보",children:e.jsx(V,{isPending:c,ShippingAddress:s==null?void 0:s.shippingAddress,deliveryMemo:s==null?void 0:s.deliveryMemo})}),e.jsx(m,{title:"결제 정보",children:e.jsx(Z,{isPending:c,orderNo:t,firstOrderAmount:s==null?void 0:s.firstOrderAmount,payInfo:s==null?void 0:s.payInfo,payTypeLabel:s==null?void 0:s.payTypeLabel,receiptInfos:s==null?void 0:s.receiptInfos})}),(o=s==null?void 0:s.refundInfos)==null?void 0:o.filter(r=>r.refundType!=="ZERO_REFUND").map(r=>e.jsx(y.Fragment,{children:r.refundType!=="ZERO_REFUND"&&e.jsx(m,{title:"환불 정보",children:e.jsx(H,{refundInfo:r})})},r.claimNo)),(d=s==null?void 0:s.additionalPayInfos)==null?void 0:d.map(r=>e.jsx(m,{title:"추가 결제 정보",children:e.jsx(X,{additionalPayInfo:r})},r.claimNo)),(h=s==null?void 0:s.refundInfos)==null?void 0:h.filter(r=>r.claimClassType==="RETURN"||r.claimClassType==="RETURN_EXCHANGE").map(r=>e.jsx(m,{title:"반품 수거 정보",children:e.jsx(re,{refundInfo:r},r.claimNo)})),(p=s==null?void 0:s.refundInfos)==null?void 0:p.filter(r=>r.claimClassType==="RETURN_EXCHANGE").map(r=>e.jsx(m,{title:"교환 출고 정보",children:e.jsx(se,{refundInfo:r},r.claimNo)})),e.jsx(q,{})]})})}export{ue as default};