PageSourceSearch

https://www.dagym-manager.com/_next/static/chunks/pages/product/dagym-product-03fe6dae4bd1ced5.js

js dagym-manager.com collected 2026-09-26 09:51:51 UTC 71,371 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cdbb5940-db99-477d-900e-63507c1aa000",e._sentryDebugIdIdentifier="sentry-dbid-cdbb5940-db99-477d-900e-63507c1aa000")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3084],{12386:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>e_});var a=l(2860),r=l(72282),n=l(9329),i=l(83004),o=l(12779),d=l(41865),s=l(21373),c=l(19656),u=l(9471),m=l(55869),p=l(55729);let g=()=>{let{toast:e}=(0,m.ztC)(),[t]=(0,d.eot)({fetchPolicy:"network-only"});return{validateFacilityBookingSale:(0,p.useCallback)(async l=>{var a;let r,n=()=>e({message:"대관일정 정보를 불러오지 못했습니다. 잠시 후 다시 시도해 주세요.",status:m.O_3.ERROR});try{r=await t({variables:{id:l}})}catch(e){return n(),!1}if(r.error||!(null==(a=r.data)?void 0:a.dagymProduct))return n(),!1;let i=r.data.dagymProduct.facilityBookingClasses.some(e=>e.isVisible);return i||e({message:"판매 중인 대관일정이 없어 상품을 판매할 수 없습니다. 대관일정을 먼저 판매 설정해 주세요.",status:m.O_3.ERROR}),i},[t,e])}};var y=l(6979),f=l(87027),h=l(88498),P=l(83692),v=l(1909),D=l(41943),b=l(8720),C=l(22721),O=l(55629),R=l(19873),x=l(91852),Y=l(57861),_=l(11613),k=l(94384),I=l(73722),K=l.n(I),L=l(81278),w=l(68999),T=l(56278),E=l(45471),S=l(71535),A=l(42219);let F=e=>{let{photo:t,onClickPhoto:l,onDeletePhoto:r,setHandleRef:n,dragHandleProps:i}=e;return(0,a.FD)("div",{className:"group relative size-20 shrink-0 cursor-grab overflow-hidden rounded-sm",ref:n,...i,onClick:l,"data-sentry-component":"FacilityPhotoCell","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:[(0,a.Y)("img",{src:t.url,alt:"대관장소 사진",draggable:!1,className:"pointer-events-none absolute inset-0 h-full w-full rounded-sm object-cover"}),(0,a.Y)(m.wVr,{shape:"circle",className:"border-border absolute top-2 right-2 hidden border bg-black/60 group-hover:flex",onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),r(t.url)},"data-sentry-element":"DGIconContainer","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:(0,a.Y)(A.US,{color:m.Tjm.WHITE,"data-sentry-element":"CloseIcon","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx"})})]})},N=e=>{var t,l;let{isVisible:r,facilityClass:n,onClose:i,onSaved:o}=e,{toast:s}=(0,m.ztC)(),{compressMany:c,isUploadingRef:u}=(0,S.C)(),{uploadFiles:g}=(0,T.A)(),{open:y,viewer:f}=(0,E.B)(),h=(0,p.useRef)([]),[P,v]=(0,p.useState)(""),[D,b]=(0,p.useState)(""),[C,O]=(0,p.useState)([]),[R,x]=(0,p.useState)(!1),[Y]=(0,d.c0Z)(),_=(0,p.useCallback)(()=>{var e,t,l;v(null!=(e=null==n?void 0:n.displayName)?e:""),b(null!=(t=null==n?void 0:n.description)?t:""),O((null!=(l=null==n?void 0:n.imageUrls)?l:[]).map(e=>({url:e,data:null})))},[n]),k=(0,p.useCallback)(async e=>{if(0===e.length)return;if(C.length+e.length>5)return void s({message:"사진은 최대 ".concat(5,"장까지 첨부할 수 있습니다."),status:m.O_3.ERROR});let t=await c(e);t&&(h.current.push(...t.map(e=>e.url)),O(e=>[...e,...t]))},[C.length,c,s]),I=(0,p.useCallback)(e=>{u.current||O(t=>t.filter(t=>t.url!==e))},[u]),K=(0,p.useCallback)(async()=>{if(!n||R)return;x(!0);let e=C.map(e=>e.data).filter(e=>null!==e);try{let t=[];if(e.length>0){let l=await g(e,"dagym-info");if(!l)return void s({message:"사진 업로드에 실패했습니다. 잠시 후 다시 시도해 주세요.",status:m.O_3.ERROR});t=l.map(e=>e.url)}let l=0,a=C.map(e=>e.data?t[l++]:e.url);
1await Y({variables:{classId:n.classId,input:{displayName:P||null,description:D||null,imageUrls:a}}}),s({message:"대관장소 소개가 저장되었습니다."}),o(),i()}catch(e){s({message:e instanceof Error?e.message:"대관장소 소개 저장에 실패했습니다.",status:m.O_3.ERROR})}finally{x(!1)}},[n,R,P,D,C,g,Y,s,o,i]);return(0,p.useEffect)(()=>{if(r)return void _();h.current.forEach(e=>URL.revokeObjectURL(e)),h.current=[]},[r,_]),(0,p.useEffect)(()=>()=>{h.current.forEach(e=>URL.revokeObjectURL(e))},[]),(0,a.FD)(m.UyD,{open:r,onClose:i,title:"".concat(null!=(t=null==n?void 0:n.className)?t:""," 소개 설정"),rightButtons:[{label:"취소",onClick:i,theme:m.v7Q.CANCEL},{label:"저장",onClick:K,disabled:R,theme:m.v7Q.PRIMARY}],"data-sentry-element":"DGTaskModal","data-sentry-component":"FacilityBookingClassInfoModal","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:[(0,a.FD)(m.VPZ,{gap:16,className:"w-120 py-1","data-sentry-element":"Column","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:[(0,a.Y)(m.pqG,{label:"다짐에 표시할 이름",value:P,onChange:e=>v(e),placeholder:null!=(l=null==n?void 0:n.className)?l:"",message:"비워두면 수업명 그대로 노출됩니다.",maxLength:50,"data-sentry-element":"DGTextField","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx"}),(0,a.Y)(m.VPZ,{gap:8,"data-sentry-element":"Column","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:(0,a.Y)(m.pqG,{label:"설명",multiline:!0,minRows:5,value:D,onChange:e=>b(e),placeholder:"다짐 앱에 보여줄 대관장소 소개를 입력해 주세요. (예: 코트 규격, 바닥재, 이용 안내)",maxLength:200,"data-sentry-element":"DGTextField","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx"})}),(0,a.FD)(m.VPZ,{gap:8,"data-sentry-element":"Column","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:[(0,a.Y)(m.DU,{type:"body2_14_regular",color:m.ajm.TEXT_SECONDARY,"data-sentry-element":"DGText","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx",children:"사진 (최대 ".concat(5,"장)")}),(0,a.Y)(m.GpY,{items:C,orientation:m.RXX.HORIZONTAL,gap:8,onReorder:O,keyExtractor:e=>e.url,renderItem:(e,t)=>{let{setHandleRef:l,dragHandleProps:r}=t;return(0,a.Y)(F,{photo:e,onClickPhoto:()=>y(C.map(e=>e.url),C.findIndex(t=>t.url===e.url)),onDeletePhoto:I,setHandleRef:l,dragHandleProps:r})},footer:C.length<5?(0,a.Y)(w.f,{style:{width:80,height:80},onChangeFiles:k,placeholder:(0,a.Y)(m.DU,{type:"body3_12_regular",className:"text-text_placeholder",children:"사진 추가"}),accept:"image/*"}):void 0,"data-sentry-element":"DGDndList","data-sentry-source-file":"FacilityBookingClassInfoModal.component.tsx"})]})]}),f]})};var M=l(19862);let B=e=>{let{mdMode:t,className:l}=e,r=(0,M.Eg)(t);return r?(0,a.Y)(m.VX3,{color:r.color,filled:r.filled,className:l,"data-sentry-element":"DGBadge","data-sentry-component":"MdModeBadge","data-sentry-source-file":"MdModeBadge.component.tsx",children:r.children}):null},U=e=>e?"":"hover:bg-icon_hover_bg active:bg-icon_pressed_bg",V=e=>{switch(e){case d.Q8q.NoInput:case d.m7e.NeedInfo:return{text:"정보입력 필요",color:m.Tjm.RED_04,tooltipContent:["다짐앱에서 판매하기 위해서는","필수로 입력해야하는 정보가 있습니다."]};case d.Q8q.Pending:case d.m7e.ApproveWaiting:return{text:"승인 대기중",color:m.Tjm.ORANGE_08,tooltipContent:["회원권 변경 사항은 내부 승인 절차를 거치며,","영업일 기준 1~2일이 소요됩니다.","승인이 완료되기 전까지는 기존 설정이 유지됩니다."]};case d.Q8q.Rejected:case d.m7e.ApproveRejected:return{text:"수정요청",color:m.Tjm.RED_04,tooltipContent:["변경 사항 승인이 반려되었습니다.","정보를 다시 입력해 주세요."]};default:return null}},G=(0,p.memo)(function(e){let{isSellingOnDagym:t,onChange:l,className:r,isDragging:n,style:i}=e,[o,d]=(0,p.useState)(!1),s=(0,p.useMemo)(()=>[{label:"판매하기",value:!0,disabled:t},{label:"판매 보류하기",value:!1,disabled:!t}],[t]);return(0,a.Y)(m.vuz,{isOpen:o,onClose:()=>d(!1),dropdownComponent:(0,a.Y)(m.yxA,{itemList:s,selectedValue:t,onChange:e=>{null!==e&&e!==t&&l(e),d(!1)}}),children:(0,a.FD)(m.pX5,{className:(0,m.cn)("rounded-sm border cursor-pointer px-3 py-2",U(n),o?"border-primary":"border-border",r),onClick:()=>d(e=>!e),style:i,children:[(0,a.FD)(m.p0,{gap:4,className:"h-6",children:[(0,a.Y)("div",{className:(0,m.cn)("h-3 w-3 rounded-full",t?"bg-green-05":"bg-d_gray-02")}),(0,a.Y)(m.DU,{type:"body3_12_regular",children:t?"판매":"미판매"})]}),(0,a.Y)(A.de,{size:16,direction:o?"up":"down",color:o?m.ajm.PRIMARY:m.ajm.TEXT_SECONDARY})]})})}),q=(0,p.memo)(function(e){let{item:t,selected:l,isLockerStructure:r,hideStatus:n,onItemClick:i,onSellingChange:o,isDragging:d,setHandleRef:s,dragHandleProps:c}=e,u=(0,p.useMemo)(()=>r||n||!t.status?null:V(t.status),[r,n,t.status]),g=(0,p.useCallback)(()=>{null==i||i(t)},[i,t]),y=(0,p.useCallback)(e=>{null==o||o(t,e)},[o,t]);return(0,a.FD)(m.p0,{gap:8,style:{width:"100%"},children:[(0,a.Y)(m.zHw,{className:(0,m.cn)("flex-1 justify-between",i?"cursor-pointer":"cursor-default",U(d),l?"border-primary":"border-border"),onClick:i?g:void 0,children:(0,a.FD)(m.p0,{gap:8,className:"min-w-0 flex-1",children:[!r&&(0,a.Y)(m.W_3,{setHandleRef:s,dragHandleProps:null!=c?c:{}}),(0,a.Y)(m.DU,{type:"body3_12_regular",ellipsis:!0,className:"min-w-0 flex-1",children:t.label}),t.isSellingOnDagym&&u?(0,a.FD)(m.p0,{gap:4,style:{flexShrink:0},children:[(0,a.Y)(m.DU,{type:"body2_14_bold",color:u.color,children:u.text}),(0,a.Y)(m.Mde,{content:u.tooltipContent})]}):null]})}),(0,a.Y)(G,{isSellingOnDagym:!!t.isSellingOnDagym,onChange:y,style:{width:97},isDragging:d})]})}),j=(0,p.memo)(function(e){var t,l;let{item:r,selected:n,isDagymInstructor:i,onItemClick:o,onSellingChange:d,isDragging:s,setHandleRef:c,dragHandleProps:u}=e,g=(0,p.useMemo)(()=>r.status?V(r.status):null,[r.status]),y=(0,p.useCallback)(()=>{o(r)},[o,r]),f=(0,p.useCallback)(e=>{d(r,e)},[d,r]),P=null!=(l=null==(t=r.productData)?void 0:t.mdMode)?l:void 0;return(0,a.FD)(m.p0,{gap:8,style:{width:"100%",flex:"0 0 auto"},children:[(0,a.FD)(m.zHw,{className:(0,m.cn)("flex-1 cursor-pointer justify-between",U(s),n?"border-primary":"border-border"),onClick:y,children:[(0,a.FD)(m.p0,{gap:8,className:"min-w-0 flex-1",children:[(0,a.Y)(m.W_3,{setHandleRef:c,dragHandleProps:null!=u?u:{}}),(0,a.Y)(m.DU,{type:"body3_12_regular",className:"min-w-0 flex-1",ellipsis:!0,children:r.label}),(0,h.Nw)(P)?(0,a.Y)(B,{mdMode:P,className:"shrink-0"}):null]}),r.isSellingOnDagym&&g?(0,a.FD)(m.p0,{gap:4,style:{flexShrink:0},children:[(0,a.Y)(m.DU,{type:"body2_14_bold",color:g.color,children:g.text}),(0,a.Y)(m.Mde,{content:i?["선생님의 정보는","구성원>다짐 트레이너 관리에서 확인해 주세요."]:g.tooltipContent})]}):null]}),(0,a.Y)(G,{isSellingOnDagym:!!r.isSellingOnDagym,onChange:f,style:{width:97},isDragging:s})]})}),H=[{title:"회원권",value:d.KK5.General},{title:"일일권",value:d.KK5.Daily},{title:"수강권(P.T회원권/체험권)",value:d.KK5.Private},{title:"락커",value:d.KK5.RentalLocker}],W=[];var Z=l(58160),Q=l(28977),X=l(74312),z=l.n(X),J=l(67540);let $=e=>{let{name:t,label:l,width:r=108,unit:n="회",onChangeCount:i,disabled:o}=e,{control:d}=(0,v.xW)();return(0,a.Y)(v.xI,{control:d,name:t,render:e=>{let{field:t}=e;return(0,a.Y)(m.YE5,{label:null!=l?l:"총 이용 횟수",disabled:o,width:(0,h._t)(r,401),value:t.value,suffix:"".concat(n),onChange:e=>{if("number"!=typeof e)return null==i?void 0:i(0);null==i||i(e)}})},"data-sentry-element":"Controller","data-sentry-component":"CountController","data-sentry-source-file":"DagymProductPriceController.tsx"})},ee=e=>{let{periodName:t,periodTypeName:l,label:r,periodTypeList:n,disabled:i,width:o=139,periodWidth:d=60,periodTypeW
1idth:s=75,onChangePeriod:c,onChangePeriodType:u,tooltipContent:p}=e,{control:g,watch:y}=(0,v.xW)(),f=y(l);return(0,a.FD)(m.fGn,{gap:4,className:"relative",style:{minWidth:o*(P.kB/P.F1),width:(0,h._t)(o,401)},"data-sentry-element":"AlignedStartColumn","data-sentry-component":"PeriodController","data-sentry-source-file":"DagymProductPriceController.tsx",children:[p&&(0,a.Y)(m.H_n,{placement:"top",align:"start",isCloseable:!0,children:p}),(0,a.Y)(m.DU,{type:"body1_15_regular",color:i?m.ajm.TEXT_PLACEHOLDER:m.ajm.TEXT_PRIMARY,"data-sentry-element":"DGText","data-sentry-source-file":"DagymProductPriceController.tsx",children:null!=r?r:"등록 기간"}),(0,a.FD)(m.wBh,{gap:4,"data-sentry-element":"AlignedEndRow","data-sentry-source-file":"DagymProductPriceController.tsx",children:[(0,a.Y)(v.xI,{control:g,name:t,rules:{...t.includes("limitPeriod")&&!i?{required:!0,validate:{validatePeriod:e=>!e||!f||(0,h.mF)(e,f)},min:1}:{}},render:e=>{let{field:t,fieldState:{error:l}}=e;return(0,a.Y)(m.YE5,{disabled:i,value:t.value,onChange:e=>{if("number"!=typeof e)return null==c?void 0:c(0);null==c||c(e)},width:(0,h._t)(d,o),hasError:!!l,containerClassName:"w-full flex-[0.66]"})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductPriceController.tsx"}),(0,a.Y)(v.xI,{control:g,name:l,rules:{required:!0},render:e=>{var t,l;let{field:r,fieldState:{error:o}}=e;return(0,a.Y)(m.Ln_,{style:{minWidth:s*(P.kB/P.F1)},itemList:n.map(e=>({value:e.value,label:e.text})),wrapperClassName:"w-full flex-1",onChange:e=>{e&&(null==u||u(e))},selectedValue:null!=(l=null==(t=n.find(e=>e.value===r.value))?void 0:t.value)?l:void 0,disabled:i,placeholder:"개월",hasError:!!o})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductPriceController.tsx"})]})]})},et=e=>{let{name:t,rules:l,label:r,disabled:n,onChangePrice:i,width:o=140}=e,{control:d}=(0,v.xW)();return(0,a.Y)(v.xI,{control:d,name:t,rules:l,render:e=>{var t;let{field:l,fieldState:{error:d}}=e;return(0,a.Y)(m.gwy,{label:r,width:(0,h._t)(o,401),value:l.value,onChange:e=>{if("number"!=typeof e)return null==i?void 0:i(0);null==i||i(e)},onBlur:e=>{let t=e.target.value.replace(/[^0-9]/g,"");null==i||i(t?(0,J.T)(l.value):0)},hasError:!!d,message:null!=(t=null==d?void 0:d.message)?t:"",disabled:n})},"data-sentry-element":"Controller","data-sentry-component":"PriceController","data-sentry-source-file":"DagymProductPriceController.tsx"})};var el=l(22415);let ea=e=>{let{label:t,disabled:l,width:r,...n}=e;return(0,a.FD)(m.VPZ,{gap:4,style:{width:r},className:"shrink-0","data-sentry-element":"Column","data-sentry-component":"CheckboxWithLabel","data-sentry-source-file":"InputWithLabel.component.tsx",children:[(0,a.Y)(m.DU,{type:"body2_14_regular",color:l?m.ajm.TEXT_PLACEHOLDER:m.ajm.TEXT_SECONDARY,"data-sentry-element":"DGText","data-sentry-source-file":"InputWithLabel.component.tsx",children:t}),(0,a.Y)(m.HaE,{className:"h-10","data-sentry-element":"AlignedStartRow","data-sentry-source-file":"InputWithLabel.component.tsx",children:(0,a.Y)(m.TV3,{color:"gray",disabled:l,...n,"data-sentry-element":"DGCheckbox","data-sentry-source-file":"InputWithLabel.component.tsx"})})]})};var er=function(e){return e.Rate="Rate",e.OrderOfArrival="OrderOfArrival",e}(er||{});let en=[{text:"상시할인",value:"Rate"},{text:"선착순할인",value:"OrderOfArrival"}],ei=e=>{let{index:t,isMdMode:l}=e,{toast:r}=(0,m.ztC)(),{control:n,watch:i,setValue:o,clearErrors:s}=(0,v.xW)(),{category:c}=i(),u=i("prices.".concat(t)),p=null==u?void 0:u.defaultPriceOption.defaultPrice,g=!(null==u?void 0:u.defaultPriceOption.isSellingOnDagym)||!(null==u?void 0:u.dagymPriceOption.isAppliedDagymPrice)||!u.isEditable||!!l;return(0,a.FD)(m.HaE,{gap:10,style:{width:"100%"},"data-sentry-element":"AlignedStartRow","data-sentry-component":"DagymPriceItem","data-sentry-source-file":"DagymPriceItem.component.tsx",children:[(0,a.Y)(v.xI,{control:n,name:"prices.".concat(t,".dagymPriceOption.isAppliedDagymPrice"),render:e=>{let{field:n}=e;return(0,a.Y)(ea,{label:"판매",checked:n.value,onChange:e=>{n.onChange(e),s("prices.".concat(t,".dagymPriceOption"))},disabled:!u.defaultPriceOption.isSellingOnDagym||!u.isEditable||!!l,onDisabledClick:()=>{u.isEditable||(c!==d.KK5.RentalLocker&&u.defaultPriceOption.defaultPrice<100?r({message:"100원 이상 금액의 상품을 판매하실 수 있습니다.",status:m.O_3.ERROR}):r({message:"12개월 이하 기간의 상품만 판매하실 수 있습니다.",status:m.O_3.ERROR}))}})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymPriceItem.component.tsx"}),(0,a.Y)(v.xI,{control:n,name:"prices.".concat(t,".dagymPriceOption.discountType"),render:e=>{let{field:l}=e;return(0,a.FD)(m.p0,{gap:4,style:{width:"calc(".concat((0,h._t)(112,516)," + ").concat(74*("OrderOfArrival"===l.value),"px)")},children:[(0,a.Y)(m.Ln_,{label:"할인방식",itemList:en.map(e=>({value:e.value,label:e.text})),onChange:e=>{l.onChange(e),o("prices.".concat(t,".dagymPriceOption.firstComeCount"),"OrderOfArrival"===e?10:void 0,{shouldDirty:!0})},selectedValue:l.value,disabled:g,wrapperStyle:{width:"calc(100% - ".concat(74*("OrderOfArrival"===l.value),"px)")}}),"OrderOfArrival"===l.value&&(0,a.Y)(v.xI,{control:n,name:"prices.".concat(t,".dagymPriceOption.firstComeCount"),rules:{validate:u.dagymPriceOption.isAppliedDagymPrice?{minimumCount:e=>!!e&&e>=3||"선착순 최소 3개",maximumCount:e=>!!e&&e<999||"선착순 최대 999개"}:{}},render:e=>{let{field:t,fieldState:{error:l}}=e;return(0,a.Y)(m.VPZ,{style:{position:"relative"},children:(0,a.Y)(m.YE5,{label:"선착순 개수",suffix:"개",width:70,value:t.value,onChange:t.onChange,hasError:!!l,disabled:g,onBlur:e=>{let l=e.target.value.replace(/[^0-9]/g,"");
1t.onChange(l?t.value:0)},message:(null==l?void 0:l.message)||((0,_.V)(u.dagymPriceOption.firstComeRemainingCount)?"잔여 ".concat(u.dagymPriceOption.firstComeRemainingCount,"개"):void 0),messageProps:{isFloatingMessage:!0}})})}})]})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymPriceItem.component.tsx"}),(0,a.Y)("div",{style:{width:(0,h._t)(108,516)},children:(0,a.Y)(v.xI,{control:n,name:"prices.".concat(t,".dagymPriceOption.discountRate"),render:e=>{var l;let{field:r}=e;return(0,a.Y)(m.Ln_,{label:"할인율",wrapperClassName:"w-full",itemList:((0,h.zN)(c)?el.zy:el.Oo).map(e=>({value:e.value,label:e.text})),onChange:e=>{r.onChange(e),null!==e&&p&&o("prices.".concat(t,".dagymPriceOption.dagymPrice"),(0,J.T)(p,e),{shouldDirty:!0})},selectedValue:null==(l=((0,h.zN)(c)?el.zy:el.Oo).find(e=>e.value===r.value))?void 0:l.value,disabled:g,itemFieldClassName:"w-[106px]"})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymPriceItem.component.tsx"})}),(0,a.Y)(et,{name:"prices.".concat(t,".dagymPriceOption.dagymPrice"),rules:{validate:u.dagymPriceOption.isAppliedDagymPrice?{validatePrice:e=>(0,h.D0)(e,void 0,100*(c!==d.KK5.RentalLocker)),validateDiscountRate:(e,l)=>null!==l.prices[t].dagymPriceOption.discountRate||!!e&&(0,h.CQ)(e,l.prices[t].defaultPriceOption.defaultPrice,(0,h.zN)(l.category)?.1:.01)}:{}},label:"다짐회원가",onChangePrice:e=>{o("prices.".concat(t,".dagymPriceOption.dagymPrice"),e,{shouldDirty:!0})},disabled:g||!!u.dagymPriceOption.discountRate,"data-sentry-element":"PriceController","data-sentry-source-file":"DagymPriceItem.component.tsx"})]})};var eo=l(83958),ed=l(55403);let es=[d.Icn.Month,d.Icn.Week,d.Icn.Day,d.Icn.Hour,d.Icn.Minute].map(e=>({text:(0,eo.V5)(e),value:e})),ec=e=>{var t;let{index:l,productsList:r,isMdMode:n}=e,{toast:i}=(0,m.ztC)(),{control:o,watch:s,setValue:c,clearErrors:u}=(0,v.xW)(),{prices:g,category:y,productType:f,hasCountOrPeriodLimit:P,isFacilityBookingLinked:D}=s(),[b,C]=(0,p.useState)(!1),[O,R]=(0,p.useState)([]),x=g[l],Y=!(0,h.Cm)(y,f,f===d.chg.Period?x.defaultPriceOption.period:x.defaultPriceOption.count,x.defaultPriceOption.periodType),k=!(null==x?void 0:x.defaultPriceOption.isSellingOnDagym)||!x.isEditable,I=k||!!n,K=(null==r?void 0:r.map(e=>({text:null==e?void 0:e.name,value:null==e?void 0:e.id})))||[],L=e=>{c("prices.".concat(l,".defaultPriceOption.defaultPrice"),e,{shouldDirty:!0}),u("prices.".concat(l,".defaultPriceOption.defaultPrice"));let t=null==x?void 0:x.dagymPriceOption,a=(0,J.T)(e,null==t?void 0:t.discountRate);a!==(null==t?void 0:t.dagymPrice)&&c("prices.".concat(l,".dagymPriceOption.dagymPrice"),0!==t.discountRate?a:t.dagymPrice,{shouldDirty:!0})};return(0,p.useEffect)(()=>{let e=null==x?void 0:x.defaultPriceOption.subProduct;if(null==e?void 0:e.productId){let t=r.find(t=>t.id===e.productId);t&&t.prices?R(t.prices.map(e=>{var l;return{text:t.productType===d.chg.Count?"".concat(null==e?void 0:e.count," 회"):"".concat(null==e?void 0:e.period," ").concat(null==(l=es.find(t=>t.value===(null==e?void 0:e.periodType)))?void 0:l.text),value:(null==e?void 0:e.id)||""}})):(R([]),C(!1))}},[l,g,r]),(0,p.useEffect)(()=>{var e;C(!!(null==x||null==(e=x.defaultPriceOption.subProduct)?void 0:e.productId))},[null==(t=x.defaultPriceOption.subProduct)?void 0:t.productId]),(0,a.FD)(m.VPZ,{gap:12,style:{marginBottom:8,width:"100%",minWidth:424},"data-sentry-element":"Column","data-sentry-component":"DefaultPriceItem","data-sentry-source-file":"DefaultPriceItem.component.tsx",children:[(0,a.FD)(m.HaE,{gap:10,"data-sentry-element":"AlignedStartRow","data-sentry-source-file":"DefaultPriceItem.component.tsx",children:[(0,a.Y)(v.xI,{control:o,name:"prices.".concat(l,".defaultPriceOption.isSellingOnDagym"),render:e=>{let{field:t}=e;return(0,a.Y)(ea,{label:"판매",checked:t.value,onChange:e=>{t.onChange(e),u("prices.".concat(l,".defaultPriceOption"))},disabled:!x.isEditable,onDisabledClick:()=>{Y?i({message:"1일 또는 1회 옵션은 일일권으로 판매해 주세요.",status:m.O_3.ERROR}):y!==d.KK5.RentalLocker&&x.defaultPriceOption.defaultPrice<100?i({message:"100원 이상 금액의 상품을 판매하실 수 있습니다.",status:m.O_3.ERROR}):i({message:"12개월 이하 기간의 상품만 판매하실 수 있습니다.",status:m.O_3.ERROR})}})},"data-sentry-element":"Controller","data-sentry-source-file":"DefaultPriceItem.component.tsx"}),y===d.KK5.Daily?(0,a.FD)(a.FK,{children:[(0,a.Y)(et,{name:"prices.".concat(l,".defaultPriceOption.defaultPrice"),rules:{validate:(null==x?void 0:x.defaultPriceOption.isSellingOnDagym)?{validatePrice:e=>(0,h.D0)(e,x.defaultPriceOption.managerProductPrice)}:{}},label:"현장가",onChangePrice:L,disabled:I}),y===d.KK5.Daily&&D?(0,a.Y)(ee,{periodName:"prices.".concat(l,".defaultPriceOption.period"),periodTypeName:"prices.".concat(l,".defaultPriceOption.periodType"),peri
1odTypeList:el.MQ.map(e=>({value:e.value,text:e.text})),label:"이용 시간",disabled:!0}):P&&(0,a.FD)(a.FK,{children:[x.defaultPriceOption.limitPeriod&&(0,a.Y)(ee,{periodName:"prices.".concat(l,".defaultPriceOption.limitPeriod"),periodTypeName:"prices.".concat(l,".defaultPriceOption.limitPeriodType"),periodTypeList:el.MQ.map(e=>({value:e.value,text:e.text})),label:"이용 시간",disabled:!0}),x.defaultPriceOption.limitCount&&(0,a.Y)($,{name:"prices.".concat(l,".defaultPriceOption.limitCount"),label:"입장 횟수",disabled:!0})]}),(0,a.Y)(v.xI,{control:o,name:"prices.".concat(l,".defaultPriceOption.isRecommended"),render:e=>{let{field:t}=e;return(0,a.Y)(ea,{label:"추천여부",checked:t.value,onChange:e=>{t.onChange(e)},disabled:k,width:52})}})]}):(0,a.FD)(a.FK,{children:[f===d.chg.Period&&(0,a.FD)(a.FK,{children:[(0,a.Y)(ee,{periodName:"prices.".concat(l,".defaultPriceOption.period"),periodTypeName:"prices.".concat(l,".defaultPriceOption.periodType"),disabled:!0,periodTypeList:es}),P&&(null==x?void 0:x.defaultPriceOption.limitCount)&&(0,a.Y)($,{name:"prices.".concat(l,".defaultPriceOption.limitCount"),disabled:!0})]}),f===d.chg.Count&&(0,a.Y)($,{name:"prices.".concat(l,".defaultPriceOption.count"),label:"등록 횟수",disabled:!0}),(0,a.Y)(et,{name:"prices.".concat(l,".defaultPriceOption.defaultPrice"),rules:{validate:(null==x?void 0:x.defaultPriceOption.isSellingOnDagym)?{validatePrice:e=>(0,h.D0)(e,x.defaultPriceOption.managerProductPrice,100*(y!==d.KK5.RentalLocker))}:{}},label:"현장가",onChangePrice:L,disabled:I}),f===d.chg.Count&&(y===d.KK5.General||y===d.KK5.Private&&(null==x?void 0:x.defaultPriceOption.limitPeriod))&&(0,a.Y)(ee,{label:"유효기간",periodName:"prices.".concat(l,".defaultPriceOption.limitPeriod"),periodTypeName:"prices.".concat(l,".defaultPriceOption.limitPeriodType"),periodTypeList:es,disabled:P||k,onChangePeriod:e=>{c("prices.".concat(l,".defaultPriceOption.limitPeriod"),e,{shouldDirty:!0})},onChangePeriodType:e=>{c("prices.".concat(l,".defaultPriceOption.limitPeriodType"),e,{shouldDirty:!0})},tooltipContent:y!==d.KK5.General||0!==l||P?void 0:"다짐에서 판매하실 회원권은 유효기간이 필요해요."}),y!==d.KK5.RentalLocker&&(0,a.Y)(v.xI,{control:o,name:"prices.".concat(l,".defaultPriceOption.isRecommended"),render:e=>{let{field:t}=e;return(0,a.Y)(ea,{label:(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"body2_14_regular",color:k?m.ajm.TEXT_PLACEHOLDER:m.ajm.TEXT_SECONDARY,children:"추천"}),0===l?(0,a.Y)(m.Mde,{content:"선택한 옵션에 추천 뱃지를 노출해 판매를 촉진할 수 있습니다."}):null]}),checked:t.value,onChange:e=>{t.onChange(e)},disabled:k,width:60})}}),f===d.chg.Period&&!(0,_.V)(null==x?void 0:x.defaultPriceOption.limitCount)&&(0,a.Y)("div",{className:"h-10 bg-transparent",style:{width:(0,h._t)(108,396)}})]})]}),y===d.KK5.Private&&(0,a.FD)(m.VPZ,{gap:10,style:{paddingLeft:36,width:"100%",minWidth:424},children:[(0,a.Y)(m.TV3,{color:"gray",label:"등록 시 일반 회원권을 무료로 제공합니다.",checked:b&&!k,onChange:e=>{C(e),e||c("prices.".concat(l,".defaultPriceOption.subProduct"),{productId:"",priceId:""},{shouldDirty:!0})},disabled:k}),!k&&b&&(0,a.FD)(m.p0,{gap:4,style:{paddingLeft:20},children:[(0,a.Y)(v.xI,{control:o,rules:{required:b&&!k},name:"prices.".concat(l,".defaultPriceOption.subProduct.productId"),render:e=>{let{field:t,fieldState:{error:l}}=e;return(0,a.Y)(m.Ln_,{selectedValue:t.value,onChange:e=>{t.onChange(e);let l=r.find(t=>t.id===e);l&&l.prices&&R(l.prices.map(e=>({text:(0,ed.a_)(l.productType===d.chg.Count?e.count:e.period,l.productType,e.periodType),value:(null==e?void 0:e.id)||""})))},itemList:K.map(e=>({value:e.value,label:e.text})),label:"제공할 회원권",placeholder:"상품을 선택해 주세요.",wrapperStyle:{width:(0,h._t)(320,440)},hasError:!!l})}}),(0,a.Y)(v.xI,{control:o,name:"prices.".concat(l,".defaultPriceOption.subProduct.priceId"),rules:{required:b&&!k},render:e=>{let{field:t,fieldState:{error:l}}=e;return(0,a.Y)(m.Ln_,{selectedValue:t.value,onChange:t.onChange,itemList:O.map(e=>({value:e.value,label:e.text})),label:"제공할 기간/횟수",placeholder:"주/개월",wrapperStyle:{width:(0,h._t)(113,440),flexShrink:0},hasError:!!l})}})]})]})]})};var eu=l(75779);let em=()=>{let{setValue:e,watch:t,getValues:l,reset:r}=(0,v.xW)(),n=(0,p.useRef)(!1),{data:i,loading:o}=(0,d.Ys)({variables:{category:d.KK5.General},fetchPolicy:"cache-first"}),{data:s,loading:c}=(0,d.Ys)({variables:{category:d.KK5.Private},fetchPolicy:"cache-first"}),u=t("allowedProductIds"),g=(0,p.useMemo)(()=>null!=u?u:[],[u]),y=(0,p.useMemo)(()=>{var e,t;let l=new Set,a=[],r=(e,t)=>{l.has(e.id)||(l.add(e.id),a.push({id:e.id,name:e.name,category:t}))};
1return null==i||null==(e=i.dagymProducts)||e.forEach(e=>{r(e,d.m_O.General)}),null==s||null==(t=s.dagymProducts)||t.forEach(e=>{r(e,d.m_O.Private)}),a},[i,s]),f=(0,p.useMemo)(()=>0===y.length?[]:g.map(e=>y.find(t=>t.id===e)).filter(e=>null!=e),[y,g]),h=(0,p.useMemo)(()=>{if(0===y.length)return[];let e=new Set(g);return y.filter(t=>!e.has(t.id))},[y,g]),P=(0,p.useCallback)(e=>{let t=new Set(e);return y.filter(e=>t.has(e.id)).map(e=>e.id)},[y]),D=(0,p.useCallback)(t=>{e("allowedProductIds",P(t),{shouldDirty:!0})},[P,e]),b=(0,p.useCallback)(e=>{D(g.filter(t=>t!==e.id))},[g,D]),C=(0,p.useCallback)(e=>{D([...g,e.id])},[g,D]),O=(0,p.useCallback)(()=>{D([])},[D]),R=(0,p.useCallback)(()=>{D(y.map(e=>e.id))},[y,D]);(0,p.useEffect)(()=>{if(n.current||o||c||0===y.length)return;n.current=!0;let e=l("allowedProductIds"),t=null==e?y.map(e=>e.id):P(e);r(e=>({...e,allowedProductIds:t}),{keepDirtyValues:!0,keepTouched:!0,keepErrors:!0})},[y,l,r,P,o,c]);let x=(0,p.useCallback)(e=>(0,a.FD)(m.p0,{children:[(0,a.FD)(m.DU,{type:"body3_12_regular",color:m.ajm.TEXT_SECONDARY,children:[el.ew[e.category],">"]}),(0,a.Y)(m.DU,{type:"body3_12_regular",ellipsis:!0,children:e.name})]}),[]);return(0,a.FD)(m.VPZ,{gap:20,className:"col-span-2 w-full","data-sentry-element":"Column","data-sentry-component":"LockerMembershipRestriction","data-sentry-source-file":"LockerMembershipRestriction.tsx",children:[(0,a.FD)(m.VPZ,{gap:4,"data-sentry-element":"Column","data-sentry-source-file":"LockerMembershipRestriction.tsx",children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold","data-sentry-element":"DGText","data-sentry-source-file":"LockerMembershipRestriction.tsx",children:"함께 판매할 회원권"}),(0,a.Y)(m.DU,{type:"body1_15_regular","data-sentry-element":"DGText","data-sentry-source-file":"LockerMembershipRestriction.tsx",children:"아래 회원권 목록에서 드래그&드롭으로 어떤 회원권과 이 락커 상품을 함께 판매하실지 설정하실 수 있습니다."})]}),(0,a.Y)(eu.A,{left:{items:f,title:"결합 가능 회원권",status:"succeeded",titleColor:m.ajm.PRIMARY,headerClassName:"bg-d_blue-01",bulkActionLabel:"모든 회원권 결합 제한하기",emptyMessage:"함께 판매 가능한 회원권이 없어요."},right:{items:h,title:"결합 제한 회원권",status:"failed",titleColor:m.Tjm.RED_05,headerClassName:"bg-red-01",bulkActionLabel:"모든 회원권 결합하기",emptyMessage:"함께 판매를 제한한 회원권이 없어요."},total:y.length,reorderable:!1,onChange:e=>D(e.map(e=>e.id)),onItemClick:(e,t)=>"left"===t?b(e):C(e),onBulkAction:e=>"left"===e?O():R(),renderItemBody:x,"data-sentry-element":"DualListTransferBoard","data-sentry-source-file":"LockerMembershipRestriction.tsx"})]})},ep=(0,o.A)("div",{target:"ekvqtnd0"})("width:",(0,h._t)(1098,P.F1),";height:fit-content;display:grid;grid-template-columns:repeat(2,minmax(424px,1fr));column-gap:20px;row-gap:20px;align-items:start;"),eg=(0,o.A)("span",{target:"ekvqtnd1"})("text-decoration:underline;color:",m.ajm.PRIMARY,";cursor:pointer;"),ey=(0,o.A)("div",{target:"ekvqtnd2"})("display:flex;width:100%;justify-content:center;align-items:center;input{margin-top:0;}"),ef=(0,o.A)("div",{target:"ekvqtnd3"})("width:100%;height:20px;"),eh=e=>{var t;let{control:l,isLocker:r}=e,{toast:n}=(0,m.ztC)(),{data:i}=(0,d.cyK)({skip:!r}),[o]=(0,d.pbC)({refetchQueries:[d.KI6]}),s=null==(t=null==i?void 0:i.isAutoAssignLocker)||t;return(0,a.FD)(m.VPZ,{gap:20,"data-sentry-element":"Column","data-sentry-component":"ProductNameController","data-sentry-source-file":"DagymProductRightSection.tsx",children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold","data-sentry-element":"DGText","data-sentry-source-file":"DagymProductRightSection.tsx",children:"상품 정보"}),(0,a.FD)(m.p0,{style:{gap:12},"data-sentry-element":"AlignedRow","data-sentry-source-file":"DagymProductRightSection.tsx",children:[(0,a.Y)(v.xI,{control:l,name:"name",render:e=>{let{field:t}=e;return(0,a.Y)(m.pqG,{label:"상품 이름",value:t.value,containerClassName:"w-full",disabled:!0})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductRightSection.tsx"}),(0,a.Y)(v.xI,{control:l,name:"displayName",render:e=>{let{field:t}=e;return(0,a.Y)(m.pqG,{label:"다짐에 표시할 이름",value:t.value,onChange:t.onChange,containerClassName:"w-full"})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductRightSection.tsx"})]}),r&&(0,a.Y)(m.TV3,{color:"blue",checked:!s,onChange:e=>{o({variables:{isAutoAssign:!e}}).then(()=>{n({message:e?"회원이 락커 번호를 직접 지정할 수 있도록 설정되었습니다.":"락커 번호가 자동 배정되도록 설정되었습니다."})}).catch(()=>{n({message:"설정 변경에 실패했습니다.",status:m.O_3.ERROR})})},label:"회원님들이 락커의 번호를 직접 지정할 수 있도록 열어둡니다."})]})},eP=e=>{let{control:t,contractTemplateList:l,isContractorUnset:r}=e,n=[{label:"이 회원권은 계약서를 쓰지 않습니다.",value:null},...l];return(0,a.Y)(v.xI,{control:t,name:"contractId",render:e=>{var t;let{field:l}=e,i=null!=l.value&&r;return(0,a.FD)(m.VPZ,{gap:20,children:[(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"결제 후 서명할 전자계약서 선택"}),(0,a.Y)(m.Mde,{placement:"bottom",align:"end",content:["회원님이 이 상품을 결제하고 작성할 계약서를 선택해 주세요.","이번 달 가능한 계약 수 100건을 모두 소진하면 계약서가 전송되지 않으니,","안정적인 계약서 전송을 위해 전자계약서 무제한 플랜을 추천드립니다."]})]}),(0,a.Y)(m.Ln_,{wrapperClassName:"w-full",selectedValue:null==(t=n.find(e=>e.value===l.value))?void 0:t.value,onChange:l.onChange,itemList:n,placeholder:"계약서를 선택해 주세요.",label:"전자계약서",hasError:i,errorMessage:i?"기본 계약담당자가 지정되지 않았습니다. 회
1원 > 전자계약 설정 > 계약서 설정에서 기본 계약서 작성자를 설정해 주세요.":void 0})]})},"data-sentry-element":"Controller","data-sentry-component":"ContractController","data-sentry-source-file":"DagymProductRightSection.tsx"})},ev={DagymProductLeftSection:e=>{var t,l,r,n,i,o;let{currentProduct:s,setCurrentProduct:f,currentInstructor:v,setCurrentInstructor:I,productCategory:w,setProductCategory:T}=e,{product:{canManageDagymProduct:E}}=(0,D.K)(),{toast:S}=(0,m.ztC)(),A=(0,L.useRouter)(),{updateDagymProduct:F,updateDagymProductsSeq:M,updateDagymProductIsOnSale:B,dagymProductActionLoading:U}=(0,y.A)(),{openDagymInstructorRegisterModal:V}=(0,O.w)(),{openDagymProductAlertModal:G,openDeferDagymProductModal:Z,openLockerOperationUpsellModal:Q,close:X}=(0,u.A)(),z=(0,x.A)(e=>{var t;return null==(t=e.initState.plan)?void 0:t.isOperation}),{removeCacheField:J}=(0,C.A)(),{validateFacilityBookingSale:$}=g(),[ee,et]=(0,p.useState)([]),[el,ea]=(0,p.useState)(null),[er,en]=(0,p.useState)(null),{data:ei,loading:eo,refetch:ed}=(0,d.Ys)({variables:{category:w},fetchPolicy:"cache-first",skip:w===d.KK5.Private||!E}),{data:es,loading:ec,refetch:eu}=(0,d.qxK)({fetchPolicy:"cache-first",skip:w!==d.KK5.Private||!E}),{data:em,loading:ep,previousData:eg}=(0,d.OoD)({variables:{categories:[w]},fetchPolicy:"cache-first",skip:!E}),{data:ey}=(0,d.ZBw)({variables:{id:null!=(r=null==s?void 0:s.id)?r:""},skip:!(null==s?void 0:s.id)||w!==d.KK5.RentalLocker,fetchPolicy:"cache-first"}),{data:ef}=(0,d.dsv)({skip:w!==d.KK5.RentalLocker}),{data:eh,refetch:eP}=(0,d.QQc)({variables:{id:null!=(n=null==s?void 0:s.id)?n:""},skip:w!==d.KK5.Daily||!(null==s?void 0:s.id)||!s.isFacilityBookingLinked,fetchPolicy:"cache-first"}),[ev]=(0,d.c0Z)(),[eD]=(0,d.pNZ)(),[eb]=(0,b.Q)(d.bQA,{refetchQueries:[d.AjN]}),eC=(0,p.useMemo)(()=>{var e,t;return null!=(t=null==ey||null==(e=ey.dagymProduct)?void 0:e.allowedLockerStructureIds)?t:[]},[null==ey||null==(t=ey.dagymProduct)?void 0:t.allowedLockerStructureIds]),eO=(0,p.useMemo)(()=>{var e,t;return null!=(t=null==(e=ep?eg:em)?void 0:e.dagymProductsUploadOnDagym)?t:[]},[ep,em,eg]),eR=(0,p.useMemo)(()=>{var e;return(null!=(e=null==ei?void 0:ei.dagymProducts)?e:[]).filter(e=>z||!(0,h.zw)(w,e.isFacilityBookingLinked))},[null==ei?void 0:ei.dagymProducts,z,w]),ex=(0,p.useMemo)(()=>{var e;let t=new Set(eR.map(e=>e.id));return(null!=(e=null==ei?void 0:ei.dagymProducts)?e:[]).filter(e=>!t.has(e.id)).map(e=>e.id)},[null==ei?void 0:ei.dagymProducts,eR]),eY=(0,p.useMemo)(()=>{var e,t;let l=null!=(t=null==eh||null==(e=eh.dagymProduct)?void 0:e.facilityBookingClasses)?t:[];if(!el)return l;let a=new Map(l.map(e=>[e.classId,e])),r=new Set(el);return[...el.map(e=>a.get(e)).filter(_.V),...l.filter(e=>!r.has(e.classId))]},[null==eh||null==(l=eh.dagymProduct)?void 0:l.facilityBookingClasses,el]),e_=(0,p.useMemo)(()=>{var e;if(w===d.KK5.Daily)return 0===eY.length?ee:ee.map(e=>e.id!==(null==s?void 0:s.id)?{...e,subProducts:void 0}:{...e,subProducts:eY.map(e=>({id:e.classId,productId:e.classId,label:e.className,isSellingOnDagym:e.isVisible,status:d.Q8q.Approved}))});if(w!==d.KK5.RentalLocker||!ef)return ee;let t=null!=(e=ef.summaryByLockerStructure)?e:[];return ee.map(e=>e.id!==(null==s?void 0:s.id)?{...e,subProducts:void 0}:{...e,subProducts:t.filter(_.V).map(e=>({id:e.id,productId:e.id,label:e.name,isSellingOnDagym:eC.includes(e.id),status:d.Q8q.Approved}))})},[ee,w,null==s?void 0:s.id,ef,eC,eY]),ek=(0,p.useCallback)(()=>{eR.filter(e=>e.isFacilityBookingLinked&&e.id!==(null==s?void 0:s.id)).forEach(e=>J((0,Y.T3)("DagymProduct",e.id),"facilityBookingClasses"))},[eR,null==s?void 0:s.id,J]),eI=(0,p.useCallback)((e,t,l)=>{var a,r;if(!(null==s?void 0:s.id)||!(null==ey?void 0:ey.dagymProduct))return;let n=l?[...eC,e]:eC.filter(t=>t!==e),i=null==ey?void 0:ey.dagymProduct,o=null!=(a=null==i?void 0:i.name)?a:"";F(s.id,d.chg.Period,{displayName:(null==i?void 0:i.displayName)||o,description:null!=(r=null==i?void 0:i.description)?r:"",allowedLockerStructureIds:n}).then(()=>{S({message:l?"".concat(o," - ").concat(t," 구역이 다짐앱 판매 설정되었습니다."):"".concat(o," - ").concat(t," 구역이 다짐앱 판매 보류되었습니다.")})}).catch(()=>{S({message:"락커 구역 판매 설정 변경에 실패했습니다.",status:m.O_3.ERROR})})},[eC,null==ey?void 0:ey.dagymProduct,null==s?void 0:s.id,F,S]),eK=(0,p.useCallback)((e,t,l)=>{if(!l)return void Z(()=>{eI(e,t,l)});eI(e,t,l)},[Z,eI]),eL=(0,p.useCallback)((e,t,l)=>{ev({variables:{classId:e,input:{isVisible:l}}}).then(()=>{ek(),eP(),S({message:l?"다짐앱에서 ".concat(t," 대관 일정을 선택할 수 있습니다."):"".concat(t,"의 다짐앱 노출을 보류했습니다.")})}).catch(e=>{var t;S({message:null!=(t=e.message)?t:"대관장소 노출 설정 변경에 실패했습니다.",status:m.O_3.ERROR})})},[ev,ek,eP,S]),ew=(0,p.useCallback)((e,t,l)=>{if(!l)return void Z(()=>{eL(e,t,l)});eL(e,t,l)},[Z,eL]),eT=(0,p.useCallback)((e,t)=>{eb({variables:{instructorId:e,isActive:t}}).then(()=>{t&&V({accountId:e,onClose:()=>{S({message:"언제든지 설정하실 수 있습니다."})}})})},[eb,V,S]),eE=(0,p.useCallback)((e,t)=>{w===d.KK5.Private?et(l=>l.map(l=>{var a;return K().isEqual(null==v?void 0:v.instructorId,l.id)?{...l,subProducts:null==(a=l.subProducts)?void 0:a.map(l
1=>K().isEqual(l.id,e)?{...l,isSellingOnDagym:t}:l)}:l})):et(l=>l.map(l=>l.id!==e?l:{...l,isSellingOnDagym:t}))},[w,et,v]),eS=(0,p.useCallback)(e=>{var t,l,a,r,n,i,o,s,c,u;e.isDagymInstructor?(I({instructorId:e.id,isDagymInstructor:e.isSellingOnDagym,instructorName:null!=(a=null==(t=e.instructorData)?void 0:t.instructorName)?a:"",displayName:null!=(r=null==(l=e.instructorData)?void 0:l.displayName)?r:"",dagymProductInfoInList:[],status:e.status}),f(null)):f({id:e.id,productId:null!=(s=null==(n=e.productData)?void 0:n.productId)?s:e.id,name:e.label,isSellingOnDagym:e.isSellingOnDagym,status:e.status,mdMode:null!=(c=null==(i=e.productData)?void 0:i.mdMode)?c:d.gOb.None,isFacilityBookingLinked:null!=(u=null==(o=e.productData)?void 0:o.isFacilityBookingLinked)&&u})},[f,I]),eA=(0,p.useCallback)((e,t,l)=>{eE(e.id,t),B(e.id,t).then(()=>{if(!t)return void S({message:"다짐앱 판매가 보류되었습니다."});switch(l){case d.Q8q.NoInput:case d.Q8q.Rejected:G(()=>{var t;if(w===d.KK5.Private){eS(e),X();return}A.replace({pathname:R.rJ.DAGYM_PRODUCT,query:{category:w,productId:null==(t=e.productData)?void 0:t.productId}}).then(()=>{X()})});return;case d.Q8q.Approved:S({message:"다시 다짐앱 판매를 시작합니다."});return;default:S({message:"다짐앱 판매 승인이 요청되었습니다."});return}}).catch(l=>{var a;eE(e.id,!t),S({message:null!=(a=l.message)?a:"네트워크 오류가 발생하였습니다. 잠시 후에 시도해주세요.",status:m.O_3.ERROR})})},[eE,S,G,X,A,eS,B,w]),eF=(0,p.useCallback)((e,t,l)=>{if(!t)return void Z(()=>{eA(e,t,l)});eA(e,t,l)},[Z,eA]),eN=(0,p.useCallback)((e,t,l)=>{var a,r;return e.isDagymInstructor?void eT(e.id,t):w===d.KK5.Private&&e.status===d.Q8q.Approved&&(null!=(r=null==l?void 0:l.filter(e=>e.isSellingOnDagym&&e.status===d.Q8q.Approved))?r:[]).length<=1&&!t?void S({message:"선생님당 최소 1개의 수강권(P.T회원권)을 판매하셔야 합니다.",status:m.O_3.ERROR}):w===d.KK5.General&&!t&&1===eO.length&&eO.some(t=>{var l;return t.productId===(null==(l=e.productData)?void 0:l.productId)})?void S({message:"최소 1개의 회원권(일반회원권)을 판매하셔야 합니다.",status:m.O_3.ERROR}):w===d.KK5.Daily&&t&&(null==(a=e.productData)?void 0:a.isFacilityBookingLinked)?void $(e.id).then(l=>{l&&eF(e,t,e.status)}):void eF(e,t,e.status)},[eF,eT,eO,w,S,$]);(0,p.useEffect)(()=>{if([d.KK5.General,d.KK5.Daily,d.KK5.Private,d.KK5.RentalLocker].includes(A.query.category)){let e=A.query.category;e!==d.KK5.RentalLocker||z?T(e):Q(),A.query.category=""}A.query.productId&&(w===d.KK5.Private?eu().then(()=>{A.query.productId=""}):ed().then(e=>{let t=e.data.dagymProducts;if(t&&A.query.productId&&""!==A.query.productId){let e=t.find(e=>e.productId===A.query.productId&&(z||!(0,h.zw)(w,e.isFacilityBookingLinked)));e&&(f(e),A.query.productId="")}I(null)}))},[A.query,w,T,ed,eu,f,I,z,Q]),(0,p.useEffect)(()=>{var e,t,l;let a=null==es||null==(l=es.dagymInstructors)||null==(t=l.find(e=>e.instructorId===(null==v?void 0:v.instructorId)))||null==(e=t.dagymProductInfoInList)?void 0:e.filter(e=>e.isSellingOnDagym);(null==a?void 0:a[0])&&f(a[0])},[v,es,f]),(0,p.useEffect)(()=>{if(w!==d.KK5.Private)et((0,h.pf)(eR));else{var e;et((0,h.L6)(null!=(e=null==es?void 0:es.dagymInstructors)?e:[]))}},[w,eR,es]),(0,p.useEffect)(()=>{ea(null)},[null==s?void 0:s.id]);let eM=w===d.KK5.Private?null!=(i=null==v?void 0:v.instructorId)?i:void 0:null!=(o=null==s?void 0:s.id)?o:void 0,eB=w===d.KK5.RentalLocker,eU=w===d.KK5.Private,eV=w===d.KK5.Daily,eG=(0,p.useCallback)(e=>{eS(e)},[eS]),eq=(0,p.useCallback)((e,t)=>{eN(e,t)},[eN]),ej=(0,p.useCallback)(e=>{if(eV){let t=eY.find(t=>t.classId===e.id);en(null!=t?t:null);return}eS(e)},[eV,eY,eS]),eH=(0,p.useCallback)((e,t)=>{if(eB)return void eK(e.id,e.label,t);if(eV)return void ew(e.id,e.label,t);let l=ee.find(t=>{var l;return null==(l=t.subProducts)?void 0:l.some(t=>t.id===e.id)});eN(e,t,null==l?void 0:l.subProducts)},[eB,eV,eK,ew,ee,eN]);return(0,a.FD)(m.VPZ,{className:"h-full shrink-0",style:{width:s?(0,h._t)(516,P.F1):"100%"},gap:20,"data-sentry-element":"Column","data-sentry-component":"DagymProductLeftSection","data-sentry-source-file":"DagymProductLeftSection.tsx",children:[(0,a.Y)(m.UnH,{tabs:H.map(e=>({label:e.title,value:e.value})),selectedValue:w,onChange:e=>{if(e===d.KK5.RentalLocker&&!z)return void Q();T(e)},size:"big",className:"border-none p-0","data-sentry-element":"DGTabBar","data-sentry-source-file":"DagymProductLeftSection.tsx"}),(0,a.FD)(m.h2C,{style:{width:"100%"},"data-sentry-element":"SpacedRow","data-sentry-source-file":"DagymProductLeftSection.tsx",children:[(0,a.FD)(m.VPZ,{gap:4,"data-sentry-element":"Column","data-sentry-source-file":"DagymProductLeftSection.tsx",children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold","data-sentry-element":"DGText","data-sentry-source-file":"DagymProductLeftSection.tsx",children:w===d.KK5.Private?"다짐에서 판매할 P.T 선생님과 상품":"다짐에서 판매할 상품"}),(0,a.Y)(m.DU,{type:"body1_15_regular","data-sentry-element":"DGText","data-sentry-source-file":"DagymProductLeftSection.tsx",children:w===d.KK5.General?"다짐매니저에 등록된 회원권을 판매하실 수 있습니다.":w===d.KK5.Daily?"다짐매니저에 등록된 일일입장권을 판매하실 수 있습니다.":w===d.KK5.RentalLocker?"다짐매니저에 등록한 락커를 판매하실 수 있습니다.":"다짐매니저 구성원에 등록한 선생님들의 P.T회원권과 P.T체험권을 판매하실 수 있습니다."})]}),(0,a.Y)(m.DU,{type:"subtitle_18_bold",className:"shrink-0","data-sentry-element":"DGText","data-sentry-source-file":"DagymProductLeftSection.tsx",children:"판매여부"})]}),(0,a.Y)(m.GpY,{items:e_,keyExtractor:e=>e.id,onReorder:e=>{let t=e.map(e=>e.id),l=[...ee];et(e),M(w===d.KK5.Private?K().flatten(e.map(e=>{var t;return null!=(t=e.subProducts)?t:[]})).map(e=>e.id):[...t,...ex]).catch(e=>{var t;S({message:null!=(t=e.message)?t:"상품 순서 변경에 실패했습니다.",status:m.O_3.ERROR}),et(l)})},renderItem:(e,t)=>
1{var l;let{setHandleRef:r,dragHandleProps:n,isDragging:i}=t,o=(e.isDagymInstructor?null==v?void 0:v.instructorId:null==s?void 0:s.id)===e.id,d=null!=(l=e.subProducts)?l:W;return(0,a.FD)("div",{className:"w-full",children:[(0,a.Y)(j,{item:e,selected:o,isDagymInstructor:eU,onItemClick:eG,onSellingChange:eq,isDragging:i,setHandleRef:r,dragHandleProps:n}),eM===e.id&&d.length>0&&(0,a.Y)("div",{className:"mt-1 ml-9",children:(0,a.Y)(m.GpY,{items:d,keyExtractor:e=>e.id,disabled:eB,onReorder:t=>{let l=t.map(e=>e.id);if(eV){ea(l),eD({variables:{classIds:l}}).then(()=>(ek(),eP())).then(()=>{ea(null)}).catch(e=>{var t;ea(null),eP(),S({message:null!=(t=e.message)?t:"대관장소 순서 변경에 실패했습니다.",status:m.O_3.ERROR})});return}let a=[...ee],r=ee.map(t=>{if(t.id!==e.id||!t.subProducts)return t;let a=new Map(t.subProducts.map(e=>[e.id,e])),r=l.map(e=>a.get(e)).filter(Boolean);return{...t,subProducts:r}});et(r),M(K().flatten(r.map(e=>{var t;return null!=(t=e.subProducts)?t:[]})).map(e=>e.id)).catch(e=>{var t;S({message:null!=(t=e.message)?t:"상품 순서 변경에 실패했습니다.",status:m.O_3.ERROR}),et(a)})},renderItem:(e,t)=>(0,a.Y)(q,{item:e,selected:!eB&&!eV&&(null==s?void 0:s.id)===e.id,isLockerStructure:eB,hideStatus:eV,onItemClick:eB?void 0:ej,onSellingChange:eH,isDragging:t.isDragging,setHandleRef:t.setHandleRef,dragHandleProps:t.dragHandleProps},e.id)})})]})},"data-sentry-element":"DGDndList","data-sentry-source-file":"DagymProductLeftSection.tsx"}),w===d.KK5.General&&(0,a.Y)(m.VIg,{color:m.CeJ.YELLOW,titleIcon:(0,a.Y)(k.U.PinIcon,{}),title:"등록한 회원권은 2가지로 판매될 수 있어요.",content:(0,a.FD)(m.VPZ,{gap:4,children:[(0,a.Y)(m.p0,{style:{alignItems:"flex-start"},children:(0,a.FD)(m.DU,{type:"body3_12_regular",children:[(0,a.Y)("b",{children:"• 단일회원권: "}),"다짐에서 운동시설 1개만 이용하는 회원권이에요. 결제 후 7영업일 이후 정산돼요."]})}),(0,a.Y)(m.p0,{style:{alignItems:"flex-start"},children:(0,a.FD)(m.DU,{type:"body3_12_regular",children:[(0,a.Y)("b",{children:"• 통합회원권: "}),"다짐에서 운동시설 2-3개를 할인된 가격으로 이용할 수 있는 회원권이에요. 회원권 가격에 따라 산정된 [방문당 금액 X 월 출석 횟수]가 다음달 10일 정산되며, 회원님이 하루에 여러 번 출석을 하셔도 일일 1회만, 회원권의 유효기간 내에 출석한 횟수만 정산 가능해요."]})})]})}),w===d.KK5.Daily&&(0,a.Y)(m.VIg,{color:m.CeJ.YELLOW,titleIcon:(0,a.Y)(k.U.PinIcon,{}),title:"일일권은 그룹수업 및 시설 이용 시 적용돼요.",content:(0,a.FD)(m.VPZ,{gap:4,children:[(0,a.Y)(m.DU,{type:"body3_12_regular",children:"• 다짐에서 판매된 일일권의 유효기간은 30일이에요."}),(0,a.Y)(m.DU,{type:"body3_12_regular",children:"• 유효기간 이내에 미사용된 일일권은 정산내역에 포함돼요."}),(0,a.Y)(m.DU,{type:"body3_12_regular",children:"• 사용처리/만료된 건을 모아 익월 말일에 정산돼요. (수수료 10%제외, VAT별도)"})]})}),w===d.KK5.Private&&(0,a.Y)(m.VIg,{color:m.CeJ.YELLOW,titleIcon:(0,a.Y)(k.U.PinIcon,{}),title:"수강권(P.T)/체험권은 이렇게 정산돼요.",content:(0,a.FD)(m.VPZ,{gap:4,children:[(0,a.Y)(m.p0,{style:{alignItems:"flex-start"},children:(0,a.FD)(m.DU,{type:"body3_12_regular",children:[(0,a.Y)("b",{children:"• 수강권(P.T): "}),"결제일로부터 7영업일 후 정산돼요. (카드수수료 포함 3.5% 제외, VAT별도)"]})}),(0,a.Y)(m.p0,{style:{alignItems:"flex-start"},children:(0,a.FD)(m.DU,{type:"body3_12_regular",children:[(0,a.Y)("b",{children:"• 체험권: "}),"사용처리/만료된 건을 모아 익월 말일에 정산돼요. (수수료 10%제외, VAT별도)"]})})]})}),w===d.KK5.RentalLocker&&(0,a.Y)(m.VIg,{color:m.CeJ.YELLOW,titleIcon:(0,a.Y)(k.U.PinIcon,{}),title:"락커는 이렇게 정산돼요.",content:(0,a.Y)(m.DU,{type:"body3_12_regular",children:"• 회원권 상품과 함께 결제만 가능하며, 회원권 종류에 상관없이 결제일로부터 7영업일 후 정산돼요. (카드수수료 포함 3.5%제외, VAT별도)"})}),(0,a.Y)(N,{isVisible:!!er,facilityClass:er,onClose:()=>en(null),onSaved:()=>{ek(),eP()},"data-sentry-element":"FacilityBookingClassInfoModal","data-sentry-source-file":"DagymProductLeftSection.tsx"}),(0,a.Y)(c.R,{isLoading:eo||ec||U,"data-sentry-element":"Loading","data-sentry-source-file":"DagymProductLeftSection.tsx"})]})},DagymProductRightSection:e=>{var t,l,r;let{instructor:n,currentProductCategory:i,mdMode:o}=e,s=(0,h.Nw)(o),{toast:c}=(0,m.ztC)(),g=(0,x.A)(e=>{var t;return null==(t=e.initState.plan)?void 0:t.isOperation}),{openAgreeDefaultPriceModal:f,openAgreeDagymPriceModal:P,openSelectDagymTagModal:D}=(0,u.A)(),{updateDagymProductPolicyAgreement:b}=(0,y.A)(),{close:C}=(0,Q.K)(),O=(0,v.xW)(),{control:R,register:Y,setValue:k,clearErrors:I,watch:K,formState:{errors:L}}=O,{id:w,defaultPriceAgree:T,firstDefaultPriceAgreeTime:E,dagymPriceAgree:S,firstDagymPriceAgreeTime:F,etcProperty:N,category:M,isFacilityBookingLinked:U,isSellingOnDagym:V}=K(),{fields:G}=(0,v.jz)({control:R,name:"additionalProperties"}),{fields:q}=(0,v.jz)({control:R,name:"prices"}),[j,H]=(0,p.useState)(!1),{data:W}=(0,d.Oa0)({fetchPolicy:"cache-first"}),{data:X}=(0,d.iut)({variables:{category:d.KK5.General},fetchPolicy:"cache-first"}),{data:J}=(0,d.Wnz)({fetchPolicy:"cache-first"}),$=!!J&&(!J.kioskContractorAccountId||J.kioskContractorAccountId===Z.qE),ee=(null==W||null==(r=W.contractTemplateList)||null==(l=r.data)||null==(t=l.filter(_.P))?void 0:t.map(e=>({label:e.name,value:e.id})))||[],et=(0,p.useCallback)((e,t)=>{if(k("defaultPriceAgree",e,{shouldDirty:!0}),k("dagymPriceAgree",t,{shouldDirty:!0}),e&&!E||t&&!F){let l={defaultPriceAgree:e,firstDefaultPriceAgreeTime:e?null!=E?E:new Date:null,dagymPriceAgree:t,firstDagymPriceAgreeTime:t?null!=F?F:new Date:null};b(w,l).then(()=>{k("firstDefaultPriceAgreeTime",l.firstDefaultPriceAgreeTime,{shouldDirty:!0}),k("firstDagymPriceAgreeTime",l.firstDagymPriceAgreeTime,{shouldDirty:!0})})}},[w,F,E,b,k,c]);return(0,p.useEffect)(()=>{w&&V&&i===M&&(T?S||S||P(()=>{et(T,!0),C()}):f(()=>{S?(et(!0,!1),C()):P(()=>{et(!0,!0),C()},()=>{et(!0,!1)})}),H(M===d.KK5.Daily&&void 0!==N))},[w,V]),(0,a.Y)(ep,{"data-sentry-element":"RightSection","data-sentry-component":"DagymProductRightSection","data-sentry-source-file":"DagymProductRightSection.tsx",children:(0,a.FD)(v.Op,{...O,"data-sentry-element":"FormProvider","data-sentry-source-file":"DagymProductRightSection.tsx",children:[s&&(0,a.FD)(m.p0,{gap:12,className:"border-d_blue-03 bg-d_blue-01 col-span-2 col-start-1 w-full rounded-lg border px-4 py-[14px]",children:[(0,a.Y)(B,{mdMode:o}),(0,a.Y)(m.DU,{type:"body2_14_regular",color:m.ajm.TEXT_PRIMARY,children:"이 상품은 MD 모드 상품이에요. 가격 및 할인 옵션은 다짐 MD 담당자만 변경할 수 있어요."})]}),(0,a.FD)(m.VPZ,{gap:30,"data-sentry-element":"Column","data-sentry-source-file":"DagymProductRightSection.tsx",children:[[d.KK5.Private,d.KK5.DailyPrivate].includes(M)&&(0,a.FD)(m.VPZ,{gap:20,children:[(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"선생님 정보"}),(0,a.Y)(m.Mde,{content:"[구성원] 메뉴에서 다짐에 표시할 선생님 이름을 변경하실 수 있습니다."})]}),(0,a.FD)(m.p0,{style:{gap:12},children:[(0,a.Y)(m.pqG,{value:null==n?void 0:n.name,label:"선생님 이름",disabled:!0,containerClassName:"w-full"}),(0,a.Y)(m.pqG,{label:"다짐에 표시할 선생님 이름",value:null==n?void 0:n.displayName,disabled:!0,placeholder:"선생님 이름을 입력해 주세요.",containerClassName:"w-full"})]})]}),(0,a.Y)(eh,{control:R,isLocker:M===d.KK5.RentalLocker,"data-sentry-element":"ProductNameController","data-sentry-source-file":"DagymProductRightSection.tsx"})]}
1),(0,a.FD)(m.VPZ,{gap:30,style:{height:"100%",justifyContent:"flex-start"},"data-sentry-element":"Column","data-sentry-source-file":"DagymProductRightSection.tsx",children:[M!==d.KK5.RentalLocker&&g?(0,a.Y)(eP,{control:R,contractTemplateList:ee,isContractorUnset:$}):(0,a.Y)(ef,{}),M!==d.KK5.Daily&&(0,a.Y)(v.xI,{control:R,name:"description",render:e=>{let{field:t}=e;return(0,a.FD)(m.VPZ,{children:[g&&[d.KK5.Private,d.KK5.DailyPrivate].includes(M)&&(0,a.Y)("div",{style:{height:50}}),(0,a.Y)(m.pqG,{multiline:!0,label:M===d.KK5.RentalLocker?"락커 관련 안내사항(선택)":"회원권 관련 안내사항(선택)",height:130,value:t.value,onChange:t.onChange,placeholder:M===d.KK5.RentalLocker?"락커 관련 안내사항을 입력해 주세요.":"회원권 관련 안내사항을 입력해 주세요.",containerClassName:"w-full"})]})}})]}),M===d.KK5.Daily&&(0,a.FD)(m.VPZ,{className:"col-span-2 col-start-1 w-full",gap:20,children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"안내사항(선택)"}),(0,a.Y)(m.VPZ,{gap:8,style:{width:"fit-content"},children:(0,a.FD)(m.p0,{gap:4,style:{flexWrap:"wrap"},children:[G.map((e,t)=>(0,a.Y)(v.xI,{control:R,name:"additionalProperties.".concat(t,".isShown"),render:t=>{let{field:l}=t;return(0,a.Y)(m.sW8,{selected:l.value,onClick:()=>{l.onChange(!l.value)},icon:l.value?(0,a.Y)(A.UX,{size:20,status:"succeeded"}):void 0,children:e.label})}},e.label)),(0,a.Y)(v.xI,{control:R,name:"etcProperty",rules:{required:!!j&&"기타 안내사항을 입력해 주세요."},render:e=>{let{field:t,fieldState:{error:l}}=e;return(0,a.FD)(m.p0,{gap:4,style:{flex:1,minWidth:116},children:[(0,a.Y)(m.sW8,{selected:j,onClick:()=>{H(e=>{let l=!e;return l&&(I("etcProperty"),t.onChange(null)),l})},className:"shrink-0",children:"기타(직접입력)"}),j&&(0,a.Y)(ey,{children:(0,a.Y)(m.pqG,{ref:Y("etcProperty").ref,value:t.value,onChange:t.onChange,containerClassName:"w-full",hasError:!!l,message:null==l?void 0:l.message,placeholder:"예) 다짐 리뷰 작성 시 프로틴 음료 제공"})})]})}})]})})]}),M!==d.KK5.RentalLocker&&(0,a.FD)(m.VPZ,{className:"col-span-2 col-start-1 w-full",gap:20,children:[(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"카테고리"}),(0,a.Y)(m.Mde,{content:"이 회원권의 카테고리를 선택해 주세요. 최대 3개까지 선택하실 수 있습니다."})]}),(0,a.Y)(v.xI,{control:R,name:"tags",rules:{validate:{minLength:e=>!!(null==e?void 0:e.length)}},render:e=>{let{field:{value:t,onChange:l}}=e;return(0,a.FD)(m.p0,{gap:4,children:[null==t?void 0:t.map((e,r)=>(0,a.Y)(m.sW8,{selected:!0,onClick:()=>{l(t.filter((e,t)=>t!==r)),c({message:"선택한 카테고리가 삭제되었습니다."})},deletable:!0,children:"".concat(e.mainTag.label," > ").concat(e.subTag.label)},e.subTag.value)),t&&t.length<3&&(0,a.Y)(m.sW8,{onClick:()=>{D(t,l)},children:"카테고리를 선택해 주세요."})]})}})]}),(0,a.FD)(m.VPZ,{className:"col-span-2 col-start-1 w-full",gap:12,"data-sentry-element":"Column","data-sentry-source-file":"DagymProductRightSection.tsx",children:[(0,a.FD)(m.p0,{gap:4,"data-sentry-element":"AlignedRow","data-sentry-source-file":"DagymProductRightSection.tsx",children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold","data-sentry-element":"DGText","data-sentry-source-file":"DagymProductRightSection.tsx",children:"판매할 옵션 선택"}),(0,a.Y)(m.Mde,{content:["다짐 앱에서 판매할 옵션을 선택해 주세요.","옵션 별 수량과 추천여부도 설정할 수 있습니다."],"data-sentry-element":"DGIconTooltip","data-sentry-source-file":"DagymProductRightSection.tsx"})]}),(0,a.FD)(m.p0,{style:{width:"100%"},gap:20,"data-sentry-element":"AlignedRow","data-sentry-source-file":"DagymProductRightSection.tsx",children:[(0,a.Y)(v.xI,{control:R,name:"defaultPriceAgree",rules:{required:!0},render:e=>{let{field:t}=e;return(0,a.FD)(m.VPZ,{gap:4,style:{width:"100%",minWidth:424},children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"현장가"}),(0,a.FD)(m.pX5,{children:[(0,a.Y)(m.TV3,{color:"blue",checked:!!t.value,hasError:!!L.defaultPriceAgree,onChange:e=>{e?f(()=>{I("defaultPriceAgree"),et(!0,null!=S&&S),C()}):t.onChange(!1)},label:(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"body1_15_bold",color:m.Tjm.YELLOW_10,children:"필수⭐"}),(0,a.FD)(m.DU,{type:"body1_15_regular",color:m.ajm.TEXT_PRIMARY,children:[(0,a.Y)(eg,{onClick:e=>{e.stopPropagation(),f(()=>{I("defaultPriceAgree"),et(!0,null!=S&&S),C()})},children:"현장가 등록 기준"}),"을 확인했습니다."]})]})}),t.value&&E?(0,a.FD)(m.DU,{type:"body4_10_regular",color:m.ajm.TEXT_PLACEHOLDER,children:[z()(E).format("YYYY.MM.DD HH:mm")," 확인 및 동의"]}):null]})]})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductRightSection.tsx"}),(0,a.Y)(v.xI,{control:R,name:"dagymPriceAgree",rules:{required:!0},render:e=>{let{field:t}=e;return(0,a.FD)(m.VPZ,{gap:4,style:{width:"100%",minWidth:424},children:[(0,a.Y)(m.DU,{type:"subtitle_18_bold",children:"다짐회원가"}),(0,a.FD)(m.pX5,{children:[(0,a.Y)(m.TV3,{color:"blue",checked:!!t.value,hasError:!!L.dagymPriceAgree,onChange:e=>{e?P(()=>{I("dagymPriceAgree"),et(null!=T&&T,!0),C()}):t.onChange(!1)},label:(0,a.FD)(m.p0,{gap:4,children:[(0,a.Y)(m.DU,{type:"body1_15_bold",color:m.Tjm.YELLOW_10,children:"필수⭐"}),(0,a.FD)(m.DU,{type:"body1_15_regular",color:m.ajm.TEXT_PRIMARY,children:[(0,a.Y)(eg,{onClick:e=>{e.stopPropagation(),P(()=>{I("dagymPriceAgree"),et(null!=T&&T,!0),C()},()=>{},M===d.KK5.Daily)},children:"다짐회원가 등록 기준"}),"을 확인했습니다."]})]})}),t.value&&F?(0,a.FD)(m.DU,{type:"body4_10_regular",color:m.ajm.TEXT_PLACEHOLDER,children:[z()(F).format("YYYY.MM.DD HH:mm")," 확인 및 동의"]}):null]})]})},"data-sentry-element":"Controller","data-sentry-source-file":"DagymProductRightSection.tsx"})]})]}),null==q?void 0:q.map((e,t)=>(0,a.FD)(p.Fragment,{children:[(0,a.Y)(ec,{index:t,productsList:(null==X?void 0:X.basicProducts)||[],isMdMode:s}),1!==e.defaultPriceOption.count||M===d.KK5.Daily&&U?(0,a.Y)(ei,{index:t,isMdMode:s}):(0,a.Y)("div",{})]},e.id)),M===d.KK5.RentalLocker&&(0,a.Y)(em,{},w)]})})}};function eD(){let e=(0,n._)(["\n          width: 100%;\n          min-width: ","px;\n          max-width: calc(100vw - 232px);\n        "]);return eD=function(){return e},e}function eb(){let e=(0,n._)(["\n          width: ",";\n          min-width: 472px;\n        "]);return eb=function(){return e},e}let eC={id:"",productId:"",name:"",displayName:"",contractId:"",category:d.KK5.General,isFacilityBookingLinked:!1,productType:d.chg.Period,hasCountOrPeriodLimit:!1,isSellingOnDagym:!1,status:d.Q8q.NoInput,prices:[{id:"",priceId:"",defaultPriceOption:{isSellingOnDagym:!1,defaultPrice
1:0,isRecommended:!1,managerProductPrice:0},dagymPriceOption:{isAppliedDagymPrice:!1,discountType:P.oQ.Rate,dagymPrice:0}}],description:"",defaultPriceAgree:!1,dagymPriceAgree:!1,tags:[],allowedLockerStructureIds:[],allowedProductIds:void 0},eO=(0,o.A)("div",{target:"e3hhi4e0"})(e=>{let{isOpen:t}=e;return t?(0,i.AH)(eD(),P.kB):(0,i.AH)(eb(),(0,h._t)(516,P.F1))},"  display:flex;padding:30px;min-height:calc(100vh - 210px);gap:30px;border-radius:20px;border:1px solid ",m.ajm.BORDER,";background:white;"),eR=(0,o.A)("div",{target:"e3hhi4e1"})("width:1px;background:",m.ajm.BORDER,";flex-shrink:0;"),ex=()=>{var e,t,l,r,n;let i=(0,f.Q)(e=>e.product.canManageDagymProduct),{toast:o}=(0,m.ztC)(),D=(0,v.mN)(),{handleSubmit:b,reset:C,formState:{isDirty:O},watch:R,setValue:x,getFieldState:Y,getValues:_}=D,{id:k,category:I}=R(),{updateDagymProduct:K,updateDagymProductIsOnSale:L,dagymProductActionLoading:w}=(0,y.A)(),{openRegisterDagymProductModal:T}=(0,u.A)(),{validateFacilityBookingSale:E}=g(),[S,A]=(0,p.useState)(null),[F,N]=(0,p.useState)(),[M,B]=(0,p.useState)(d.KK5.General),[U,V]=(0,p.useState)(!1),{data:G,loading:q}=(0,d.ZBw)({variables:{id:null!=(l=null==S?void 0:S.id)?l:""},fetchPolicy:"cache-and-network",skip:!(null==S?void 0:S.id)||!i}),j=(null==G||null==(e=G.dagymProduct)?void 0:e.id)===(null==S?void 0:S.id)?null==G||null==(t=G.dagymProduct)?void 0:t.mdMode:void 0,H=U||q,W=e=>{var t,l;V(!0);let{name:a,displayName:r,additionalProperties:n,etcProperty:i,description:s,contractId:c,productType:u}=e,p=M===d.KK5.RentalLocker,g=e.prices.map(e=>{let{defaultPrice:t,isRecommended:l,subProduct:a,isSellingOnDagym:r}=e.defaultPriceOption,{discountRate:n,firstComeCount:i,isAppliedDagymPrice:o,dagymPrice:d,discountType:s}=e.dagymPriceOption;return{id:e.id,defaultPrice:Number(t),isSellingOnDagym:r,subProductOptionId:r?null==a?void 0:a.priceId:null,firstComeCount:s===P.oQ.OrderOfArrival?Number(i):null,discountRate:n,isRecommended:!p&&l,dagymPrice:Number(d),isAppliedDagymPrice:o}}),y={displayName:r||a,additionalProperties:i?[...Array.from(null!=n?n:[]),{index:null!=(l=null==n?void 0:n.length)?l:7,isShown:!0,label:i}]:null!=n?n:void 0,description:s||"",contractId:c,tags:p?null:null==(t=e.tags)?void 0:t.map((e,t)=>{var l,a;return{subTagId:null!=(a=null==(l=e.subTag)?void 0:l.value)?a:"",seq:t}}),allowedProductIds:p?e.allowedProductIds:void 0,prices:g},f=[];e.productType!==d.chg.Count||e.hasCountOrPeriodLimit||(f=e.prices.map(e=>{let{count:t,limitCount:l,period:a,periodType:r,limitPeriod:n,limitPeriodType:i}=e.defaultPriceOption;return u===d.chg.Count?{id:e.priceId,count:t,period:n,periodType:i}:{id:e.priceId,count:l,period:a,periodType:r}})),K(e.id,u,y,f,{context:{hideSnackbar:!0}}).then(t=>{C({...e,hasCountOrPeriodLimit:!0,isSellingOnDagym:!0,prices:e.prices.map(e=>{var l,a,r;return{...e,id:null!=(r=null==t||null==(a=t.prices)||null==(l=a.find(t=>t.priceId===e.priceId))?void 0:l.id)?r:e.id,firstComeRemainingCount:e.dagymPriceOption.firstComeCount}})}),e.isSellingOnDagym&&e.status!==d.Q8q.NoInput?o({message:M===d.KK5.General||M===d.KK5.RentalLocker?"수정 승인이 요청되었습니다.":"다짐앱 정보가 수정되었습니다."}):o({message:M===d.KK5.General||M===d.KK5.RentalLocker?"등록 승인이 요청되었습니다.":"다짐앱에 등록되었습니다."})}).catch(e=>{var t;console.error(e),o({message:null!=(t=e.message)?t:"상품을 수정하는 중 오류가 발생하였습니다.\n잠시 후 시도해주세요.",status:m.O_3.ERROR})}).finally(()=>{V(!1)})},Z=async e=>{if(0===e.prices.filter(e=>e.defaultPriceOption.isSellingOnDagym).length)return void o({message:"최소 1개의 옵션을 판매하셔야 합니다.",status:m.O_3.ERROR});if(M===d.KK5.Daily&&e.isFacilityBookingLinked&&!await E(e.id))return;let t=e.isSellingOnDagym&&e.status!==d.Q8q.NoInput;T(()=>{if(t)return void W(e);L(e.id,!0).then(()=>{W(e)})},M,t)},Q=(0,p.useRef)(O);return(0,p.useEffect)(()=>{Q.current=O},[O]),(0,p.useEffect)(()=>{if(!q){if((null==G?void 0:G.dagymProduct)&&G.dagymProduct.id===k){x("isSellingOnDagym",G.dagymProduct.isSellingOnDagym),x("status",G.dagymProduct.status),x("defaultPriceAgree",G.dagymProduct.defaultPriceAgree),x("dagymPriceAgree",G.dagymProduct.dagymPriceAgree),x("firstDefaultPriceAgreeTime",G.dagymProduct.firstDefaultPriceAgreeTime),x("firstDagymPriceAgreeTime",G.dagymProduct.firstDagymPriceAgreeTime);let e=(0,h.wx)(G.dagymProduct),t=_("prices"),l=new Map(t.map((e,t)=>[e.priceId,t]));if(!(t.length===e.prices.length&&e.prices.every(e=>l.has(e.priceId)))){Q.current||C(e);return}
1e.prices.forEach(e=>{let t=l.get(e.priceId);if(void 0===t)return;let a="prices.".concat(t,".dagymPriceOption.dagymPrice"),r="prices.".concat(t,".dagymPriceOption.discountRate");Y(a).isDirty||x(a,e.dagymPriceOption.dagymPrice),Y(r).isDirty||x(r,e.dagymPriceOption.discountRate)});return}C((null==G?void 0:G.dagymProduct)?(0,h.wx)(G.dagymProduct):eC)}},[G,k,q,Y,_,C,x]),(0,a.FD)(s.G,{isDirty:O,contentClassName:"",footerOptions:{variant:"single",mainButtonLabel:"저장하기",mainButtonProps:{theme:m.v7Q.PRIMARY,disabled:!O,onClick:b(Z,e=>{if(e.tags&&I!==d.KK5.RentalLocker)o({message:"상품의 카테고리를 1개 이상 선택해 주세요.",status:m.O_3.ERROR});else if(e.defaultPriceAgree||e.dagymPriceAgree)o({message:"필수 등록 기준을 확인해 주세요.",status:m.O_3.ERROR});else if(e.prices){var t,l,a,r,n,i,s,c,u,p,g,y,f,h;let P=null==(l=e.prices)||null==(t=l.filter)?void 0:t.call(l,Boolean)[0];if(!P)return;if((null==(a=P.defaultPriceOption)?void 0:a.limitPeriod)||(null==(r=P.defaultPriceOption)?void 0:r.limitPeriodType)){let e=null==(y=P.defaultPriceOption.limitPeriod)||null==(g=y.ref)?void 0:g.value,t=null==(h=P.defaultPriceOption.limitPeriodType)||null==(f=h.ref)?void 0:f.value;o({message:e&&!t?"유효기간은 1년을 넘을 수 없어요.":"올바른 유효기간을 입력해 주세요.",status:m.O_3.ERROR})}else(null==(n=P.dagymPriceOption)?void 0:n.firstComeCount)?o({message:"선착순 개수를 확인해 주세요.",status:m.O_3.ERROR}):I!==d.KK5.RentalLocker&&((null==(s=P.defaultPriceOption)||null==(i=s.defaultPrice)?void 0:i.ref)&&P.defaultPriceOption.defaultPrice.ref.value<100||(null==(u=P.dagymPriceOption)||null==(c=u.dagymPrice)?void 0:c.ref)&&P.dagymPriceOption.dagymPrice.ref.value<100)?o({message:"최저금액 100원 이상의 금액을 입력해 주세요.",status:m.O_3.ERROR}):(null==(p=P.defaultPriceOption)?void 0:p.subProduct)?o({message:"추가 제공할 회원권을 선택해 주세요.",status:m.O_3.ERROR}):o({message:P.defaultPriceOption?"현장가를 다짐매니저에 등록한 상품 가격과\n동일하거나 더 저렴한 금액으로 설정해 주세요.":"다짐회원가를 현장가에 비해\n"+"최소 ".concat(I?10:1,"% 할인된 금액으로 설정해 주세요."),status:m.O_3.ERROR})}else o({message:"필수 입력 항목을 확인해 주세요.",status:m.O_3.ERROR})})}},"data-sentry-element":"EditorLayout","data-sentry-component":"DagymProductList","data-sentry-source-file":"DagymProductList.tsx",children:[(0,a.Y)(eO,{isOpen:null!==S,"data-sentry-element":"MainContainer","data-sentry-source-file":"DagymProductList.tsx",children:(0,a.FD)(v.Op,{...D,"data-sentry-element":"FormProvider","data-sentry-source-file":"DagymProductList.tsx",children:[(0,a.Y)(ev.DagymProductLeftSection,{currentProduct:S,setCurrentProduct:A,currentInstructor:F,setCurrentInstructor:N,productCategory:M,setProductCategory:e=>{A(null),N(null),B(e)},"data-sentry-element":"unknown","data-sentry-source-file":"DagymProductList.tsx"}),!!S&&(0,a.FD)(a.FK,{children:[(0,a.Y)(eR,{}),(0,a.Y)(ev.DagymProductRightSection,{instructor:F?{name:null!=(r=F.instructorName)?r:"",displayName:null!=(n=F.displayName||F.instructorName)?n:""}:void 0,currentProductCategory:M,mdMode:null!=j?j:void 0})]})]})}),(0,a.Y)(c.R,{isLoading:H||w,"data-sentry-element":"Loading","data-sentry-source-file":"DagymProductList.tsx"})]})};var eY=l(85391);let e_=()=>(0,a.Y)(r.A,{domain:eY.zE.PRODUCT,"data-sentry-element":"SubmenuTabLayout","data-sentry-component":"DagymProductPage","data-sentry-source-file":"index.tsx",children:(0,a.Y)(ex,{"data-sentry-element":"DagymProductList","data-sentry-source-file":"index.tsx"})})},15345:(e,t,l)=>{"use strict";l.d(t,{V:()=>a});let a={NO_AUTHORIZATION:"접근 권한이 없습니다.\n관리자에게 문의해 주세요."}},58160:(e,t,l)=>{"use strict";l.d(t,{Ai:()=>r,fA:()=>n,m4:()=>i,qE:()=>a});let a="unselect_value",r="add_value",n="set_contract_template_value",i="no-account"},75779:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(2860),r=l(55869),n=l(42219);let i={left:"left",right:"right"},o=e=>{let{left:t,right:l,total:o,reorderable:d=!0,onChange:s,onItemClick:c,onBulkAction:u,renderItemBody:m,listClassName:p}=e,g=[{id:i.left,items:t.items},{id:i.right,items:l.items}],y=(e,t)=>(0,a.FD)(r.VPZ,{gap:12,className:"flex-1","data-sentry-element":"Column","data-sentry-component":"renderSide","data-sentry-source-file":"DualListTransferBoard.tsx",children:[(0,a.FD)(r.pX5,{className:(0,r.cn)("rounded-[10px] px-2",t.headerClassName),"data-sentry-element":"SpacedAlignedRow","data-sentry-source-file":"DualListTransferBoard.tsx",children:[(0,a.FD)(r.p0,{gap:4,"data-sentry-element":"AlignedRow","data-sentry-source-file":"DualListTransferBoard.tsx",children:[(0,a.Y)(n.UX,{status:t.status,"data-sentry-element":"CheckStatusIcon","data-sentry-source-file":"DualListTransferBoard.tsx"}),(0,a.Y)(r.DU,{type:"body1_15_bold",color:t.titleColor,"data-sentry-element":"DGText","data-sentry-source-file":"DualListTransferBoard.tsx",children:t.title}),(0,a.FD)(r.DU,{type:"body1_15_regular",color:r.ajm.TEXT_SECONDARY,"data-sentry-element":"DGText","data-sentry-source-file":"DualListTransferBoard.tsx",children:["(",t.items.length,"/",o,")"]})]}),(0,a.Y)(r.Up3,{theme:r.v7Q.CANCEL,type:r.K6w.TEXT,size:r.Tv$.MEDIUM,className:"px-0",onClick:()=>u(e),"data-sentry-element":"DGButton","data-sentry-source-file":"DualListTransferBoard.tsx",children:t.bulkActionLabel})]}),(0,a.FD)("div",{className:(0,r.cn)("border-border relative h-[440px] overflow-y-auto rounded-[10px] border bg-white p-5",p),children:[0===t.items.length&&(0,a.Y)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,a.Y)(r.DU,{type:"body1_15_regular",color:r.ajm.TEXT_SECONDARY,children:t.emptyMessage})}),(0,a.Y)(r.GpY,{groupId:e,gap:8,keyExtractor:e=>e.id,className:"min-h-full","data-sentry-element":"DGDndList","data-sentry-source-file":"DualListTransferBoard.tsx"})]})]});return(0,a.Y)(r.QI7,{groups:g,onChange:e=>{var l,a,r,n;let o=null!=(r=null==(l=e.find(e=>e.id===i.left))?void 0:l.items)?r:[],c=null!=(n=null==(a=e.find(e=>e.id===i.right))?void 0:a.items)?n:[];if(!d){let e=new Set(t.items.map(e=>e.id));if(!(o.length!==e.size||o.some(t=>!e.has(t.id))))return}s(o,c)},keyExtractor:e=>e.id,renderItem:(e,l)=>{let{setHandleRef:i,dragHandleProps:o}=l,d=t.items.some(t=>t.id===e.id)?"left":"right";return(0,a.FD)(r.pX5,{ref:i,...o,className:"border-border bg-text_bg hover:bg-icon_hover_bg w-full cursor-pointer rounded border px-2.5 py-[5px]",onClick:()=>null==c?void 0:c(e,d),children:[m(e,d),(0,a.Y)(n.HK,{size:16,direction:"left"===d?"right":"left",color:r.ajm.TEXT_SECONDARY})]})},"data-sentry-element":"DGDndBoard","data-sentry-component":"DualListTransferBoard","data-sentry-source-file":"DualListTransferBoard.tsx",children:(0,a.FD)(r.p0,{gap:8,className:"w-full items-stretch","data-sentry-element":"AlignedRow","data-sentry-source-file":"DualListTransferBoard.tsx",children:[y("left",t),(0,a.Y)("div",{className:"flex w-6 shrink-0 rotate-90 items-center justify-center self-center",children:(0,a.Y)(n.yc,{"data-sentry-element":"SortIcon","data-sentry-source-file":"DualListTransferBoard.tsx"})}),y("right",l)]})})}},78096:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/product/dagym-product",function(){return l(12386)}])},87027:(e,t,l)=>{"use strict";l.d(t,{Q:()=>o});var a=l(15345),r=l(55869),n=l(55729),i=l(41943);function o(e,t){let{toast:l}=(0,r.ztC)(),o=(0,n.useCallback)(n=>{if(!e)return;let i=e(n);if(t){t(i)||l({message:a.V.NO_AUTHORIZATION,status:r.O_3.ERROR});return}"boolean"!=typeof i||i||l({message:a.V.NO_AUTHORIZATION,status:r.O_3.ERROR})},[e,t,l]),d=(0,i.K)(e?o:void 0),s=(0,n.useMemo)(()=>(e=>{let t={...e};return delete t.isLoading,t})(d),[d]);return e?e(s):s}}},e=>{e.O(0,[883,1909,1642,6444,2526,211,2305,7447,8427,6705,8498,3233,7382,2232,636,6593,8792],()=>e(e.s=78096)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.