1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2329],{53220:(t,e,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/apply/socialing/payment",function(){return r(93584)}])},4390:(t,e,r)=>{"use strict";r.d(e,{OD:()=>i,_u:()=>a,wc:()=>n}),r(74942);var i=function(t){return t.APP="APP",t.WEB="WEB",t}({});let a=t=>({paymentId:t.paymentId,orderPrice:t.orderPrice,discountPrice:t.discountPrice}),n=t=>({id:t.id,orderPrice:t.orderPrice})},57489:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var i=r(74406),a=r(4390);let n=t=>({id:t.id,orderStatus:t.orderStatus,orderDate:t.orderDate,orderPrice:t.orderPrice,orderKind:t.orderKind,Socialing:t.Socialing,Challenge:t.Challenge,Club:t.Club,Course:t.Course,cancelledPrice:t.cancelledPrice,remainPrice:t.remainPrice,receiptUrl:t.receiptUrl,OrderHistory:t.OrderHistory,memberStatus:t.memberStatus,earlyBird:t.earlyBird}),o=t=>({orderList:t.orderList}),s=t=>({socialingId:t.socialingId,leftDays:t.leftDays,orderPrice:t.orderPrice,refundPrice:t.refundPrice,warningScore:t.warningScore,orderKind:t.orderKind,hasPenalty:t.hasPenalty});class c{static async getMyOrderList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;try{let a="/api/v3/user/me/order?";t&&(a+="orderStatus=".concat(t,"&")),a+="offset=".concat(e,"&limit=").concat(r);let n=await i.FH.get(a);return o(n.data)}catch(t){throw(0,i.EK)(t,!0)}}static async getMyOrderDetail(t){try{let{data:e}=await i.FH.get("/api/v3/user/me/order/".concat(t));return e.Socialing&&"-"===e.Socialing.location&&(e.Socialing.location="ì¨ë¼ì¸"),n(e)}catch(t){throw(0,i.EK)(t,!0)}}static async postValidateSocialing(t){try{let e=await i.FH.post("/api/web/v1/socialing/".concat(t,"/validate"));return(0,a._u)(e.data)}catch(t){throw(0,i.EK)(t,!0)}}static async postApplySocialing(t,e){try{let r=await i.FH.post("/api/web/v1/socialing/".concat(t),e);return(0,a.wc)(r.data)}catch(t){throw(0,i.EK)(t,!0)}}static async getValidateCancelSocialing(t){try{let e=await i.FH.post("/api/web/v1/socialing/".concat(t,"/cancel/validate"));return s(e.data)}catch(t){throw(0,i.EK)(t,!0)}}static async postCancelSocialing(t,e){try{await i.FH.post("/api/web/v1/socialing/".concat(t,"/cancel"),e)}catch(t){throw(0,i.EK)(t,!0)}}}},93584:(t,e,r)=>{"use strict";r.r(e),r.d(e,{__N_SSP:()=>P,default:()=>E});var i=r(86070),a=r(30758),n=r(43317),o=r(67422),s=r(1812),c=r(25903);let l=t=>{var e,r;let i=async()=>t?await c.A.getUserProfile(t):null,a=(0,s.I)({queryKey:[t,"UserDetail"],queryFn:i,staleTime:1/0,enabled:!!t});return{userDetail:{data:null!==(e=a.data)&&void 0!==e?e:null,isLoading:a.isLoading,error:null!==(r=a.error)&&void 0!==r?r:null}}};var u=r(58160),d=r(2632),p=r(43952),h=r(73367),y=r(68159),m=r(74942),g=r(4390),v=r(70543),f=r(57489);let S=(t,e)=>{var r,i,a,n,o;let c=(0,h.jE)(),l=async()=>await v.A.getSocialingDetail(t),u=(0,s.I)({queryKey:[t,"SocialingDetail"],queryFn:l,staleTime:1/0}),S=(0,s.I)({queryKey:[t,"validateSocialing"],queryFn:()=>f.A.postValidateSocialing(t),enabled:!!u.data}),w=(0,y.n)({mutationFn:async r=>{var i;if(!S.data)return null;let a=(null==r?void 0:r.receipt_id)||"",n=null!==(i=S.data.orderPrice)&&void 0!==i?i:0,o=0===n?m.NO.FREE:m.NO.CARD,s={paymentId:S.data.paymentId,receiptId:a,orderKind:o,orderPrice:n,platform:g.OD.WEB,recruitAnswer:e};return console.log("applySocialing payload",s),f.A.postApplySocialing(t,s)}});return{socialingDetail:{data:null!==(r=u.data)&&void 0!==r?r:null,isLoading:u.isLoading,error:null!==(i=u.error)&&void 0!==i?i:null},validateSocialing:{data:null!==(a=S.data)&&void 0!==a?a:null,isLoading:S.isPending,error:null!==(n=S.error)&&void 0!==n?n:null,updateData:e=>{S.data&&c.setQueryData([t,"validateSocialing"],(0,p._)((0,d._)({},S.data),{receiptId:e}))}},applySocialing:{data:null,isLoading:w.isPending,error:null!==(o=w.error)&&void 0!==o?o:null,mutate:w.mutate}}};var w=function(t){return t[t.NOT_STARTED=0]="NOT_STARTED",t[t.PROCESSING=1]="PROCESSING",t[t.COMPLETED=2]="COMPLETED",t}(w||{}),P=!0;let E=t=>{let{bootpay_application_id:e,munto_shuffling_user_id:s}=t,{t:c}=(0,o.A)(),d=(0,n.useRouter)(),{socialingId:p}=d.query,h=(0,a.useRef)(0),y="string"==typeof p?Number(p):0,m=sessionStorage.getItem("recruitAnswer_".concat(y))||"",{socialingDetail:g,validateSocialing:v,applySocialing:f}=S(y,m),{userProfile:w}
1=(0,u.A)(),{userDetail:P}=l(null==w?void 0:w.id),E=async t=>{h.current=2,t&&v.updateData(t),f.mutate({receipt_id:t},{onSuccess:t=>{var e,r,i,a;sessionStorage.removeItem("recruitAnswer_".concat(y));let n=null!==(i=null===(e=v.data)||void 0===e?void 0:e.paymentId)&&void 0!==i?i:"",o=null!==(a=null===(r=v.data)||void 0===r?void 0:r.orderPrice)&&void 0!==a?a:0,s=null==t?void 0:t.id;d.replace("/apply/socialing/done?id=".concat(y,"&orderId=").concat(encodeURIComponent(n),"&paidPrice=").concat(o).concat("number"==typeof s?"&orderRecordId=".concat(s):""))},onError:t=>{console.error("ê²°ì í ì ì² ì²ë¦¬ ì¤í¨:",t),d.replace("/apply/socialing/failure?id=".concat(y))}})},b=t=>{let{club:e,host:r,id:i}=t;return e?"MUNTOWSB".concat(e.id):r.id===Number(s)?"MUNTOWSF".concat(i):"MUNTOWSA".concat(i)},O=async()=>{try{var t,i;if(0!==h.current)return;if(!g.data){console.error("ìì
ë§ ìì¸ ì 보를 ë¶ë¬ì¬ ì ììµëë¤."),d.replace("/apply/socialing/failure?id=".concat(y));return}if(!v.data){console.error("ìì
ë§ ì ì² ì í¨ì± ê²ì¬ ì¤í¨"),d.replace("/apply/socialing/failure?id=".concat(y));return}if(!w){console.error("ì¬ì©ì íë¡í ì ë³´ê° ììµëë¤."),d.replace("/apply/socialing/failure?id=".concat(y));return}if(!P.data){console.error("ì¬ì©ì ìì¸ ì 보를 ë¶ë¬ì¬ ì ììµëë¤."),d.replace("/apply/socialing/failure?id=".concat(y));return}if(0===v.data.orderPrice){await E();return}h.current=1;let{Bootpay:a}=await r.e(6514).then(r.bind(r,36914)),n=await a.requestPayment({application_id:e,price:v.data.orderPrice,order_name:b(g.data),order_id:v.data.paymentId,pg:"nicepay",method:"card",user:{id:w.id.toString(),username:w.name,phone:null!==(t=P.data.phoneNumber)&&void 0!==t?t:void 0,email:P.data.email},items:[{id:y.toString(),name:g.data.name,qty:1,price:v.data.orderPrice}],extra:{open_type:"iframe",card_quota:"0,2,3",escrow:!1}});if("done"===n.event){let t=(null===(i=n.data)||void 0===i?void 0:i.receipt_id)||n.receipt_id;if(t)await E(t);else throw Error(c("Payment receipt ID not received."))}else if("cancel"===n.event)h.current=0,d.back();else throw Error(c("Payment failed: {{event}}",{event:n.event}))}catch(t){console.error("ê²°ì ì²ë¦¬ ì¤ ì¤ë¥ ë°ì:",t),h.current=0,await d.replace("/apply/socialing/failure?id=".concat(y))}};return(0,a.useEffect)(()=>{let t=async()=>{try{let{Bootpay:t}=await r.e(6514).then(r.bind(r,36914));t.dismiss(!0)}catch(t){console.error("Bootpay dismiss ì¤í¨:",t)}h.current=0};return window.addEventListener("popstate",t),g.data&&v.data&&w&&P.data&&O(),()=>{window.removeEventListener("popstate",t)}},[g.data,v.data,w,P.data]),(0,i.jsx)("div",{style:{height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"}})}},68159:(t,e,r)=>{"use strict";r.d(e,{n:()=>u});var i=r(30758),a=r(81235),n=r(17906),o=r(1229),s=r(40903),c=class extends o.Q{#t;#e=void 0;#r;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,s.f8)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,s.EN)(e.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#n(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#n()}mutate(t,e){return this.#i=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){let t=this.#r?.state??(0,a.$)();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){n.jG.batch(()=>{if(this.#i&&this.hasListeners()){let e=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,e,r,i),this.#i.onSettled?.(t.data,null,e,r,i)):t?.type==="error"&&(this.#i.onError?.(t.error,e,r,i),this.#i.onSettled?.(void 0,t.error,e,r,i))}
1this.listeners.forEach(t=>{t(this.#e)})})}},l=r(73367);function u(t,e){let r=(0,l.jE)(e),[a]=i.useState(()=>new c(r,t));i.useEffect(()=>{a.setOptions(t)},[a,t]);let o=i.useSyncExternalStore(i.useCallback(t=>a.subscribe(n.jG.batchCalls(t)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=i.useCallback((t,e)=>{a.mutate(t,e).catch(s.lQ)},[a]);if(o.error&&(0,s.GU)(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}}},t=>{var e=e=>t(t.s=e);t.O(0,[3382,1812,8160,4942,7191,543,636,6593,8792],()=>e(53220)),_N_E=t.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.