1import{$ as q,ac as A,U as I,I as M,j as c,x as S,S as N,p as e,q as P,s as E,V as Q}from"./index-BWvEU_Q7.js";import{F as $,T as K,R as L}from"./index-Dtkrj0oJ.js";import{B as T}from"./BackLinkNavigation-DVq90UeF.js";import{F as d}from"./FormField-DhHudv_g.js";import{b as V,c as w}from"./idea-Bqh5pVPx.js";import{u as f}from"./usePeriod-Blj9AGo9.js";import{c as B}from"./Alert-CQ6VCnYw.js";import{r as D}from"./InfoCircleIcon-BPNPdQH6.js";import"./position-D2JDXoTC.js";import"./Radio-qCjy9rjH.js";import"./Tooltip-CBgkcnUA.js";import"./Fade-BFlyCT_Z.js";import"./ChevronLeftOutlineIcon-62pBNaOH.js";const U="_container_1cg7i_1",z="_buttonAlign_1cg7i_20",G="_formContainer_1cg7i_25",H="_formFieldContainer_1cg7i_31",l={container:U,buttonAlign:z,formContainer:G,formFieldContainer:H},J=()=>{const{currentPhase:a}=f(),{data:t,isLoading:n,isFetched:r}=q({queryKey:["preferences",a],queryFn:A(()=>V(a)),select:o=>o.preferences,staleTime:60*1e3});return{data:t,isLoading:n,isFetched:r}},O=()=>I({mutationFn:({idea_id:a,phase:t,preference:n,motivation:r,role:o})=>w(a,t,n,r,o)});function de(){const{idea_id:a}=M(),[t,n]=c.useState(""),[r,o]=c.useState(""),[i,y]=c.useState(null),x=S(),{data:j}=J(),{currentPhase:v}=f(),[u,C]=c.useState(""),_=i!==null&&t.trim()!==""&&r!=="",{mutate:b}=O(),m=N(),F=s=>{o(s.target.id)},k=()=>{i!==null&&b({idea_id:a??"",phase:v,preference:i,motivation:t,role:r.toUpperCase()},{onSuccess:async()=>{await Promise.all([m.refetchQueries({queryKey:["ideas"]}),m.refetchQueries({queryKey:["user"]})]),x("/hackathon"),Q("ìì´ëì´ ì§ìì´ ìë£ëììµëë¤.",{type:"primary"})},onError:s=>{var p,h,g;const R=((g=(h=(p=s==null?void 0:s.response)==null?void 0:p.data)==null?void 0:h.error)==null?void 0:g.message)||"ì ì ìë ì¤ë¥ê° ë°ìíììµëë¤.";C(R)}})};return e.jsxs("div",{className:l.container,children:[e.jsx(T,{backLink:`/hackathon/detail/${a}`}),e.jsx(P,{as:"h4",typography:"heading4",color:"text-normal",children:"ì§ìí기"}),e.jsxs("div",{className:l.formContainer,children:[e.jsxs("div",{className:l.formFieldContainer,children:[e.jsx(d,{label:"í´ë¹ ìì´ëì´ë ëª ì§ë§ì¸ê°ì?",required:!0,children:e.jsx($,{selectedValue:i?`${i}ì§ë§`:"",placeholder:"ì§ë§ì ì íí´ì£¼ì¸ì",options:(j??[]).map(s=>({id:s.number,name:`${s.number}ì§ë§`,disabled:!s.is_active})),onChange:s=>y(parseInt(s.target.value))})}),e.jsx(d,{label:"í¨ê» íê³ ì¶ì ì´ì 를 ìì±í´ì£¼ì¸ì",required:!0,children:e.jsx(K,{placeholder:"250ì ì´ë´ë¡ ìì±í´ì£¼ì¸ì",value:t,onChange:s=>n(s.target.value)})}),e.jsx(d,{label:"ë³¸ì¸ íí¸ë¥¼ ì íí´ì£¼ì¸ì",required:!0,children:e.jsx(L,{value:r,onChange:F})}),u&&e.jsx(B,{color:"danger",leftIcon:D,fade:!0,children:u})]}),e.jsx("div",{className:l.buttonAlign,children:e.jsx(E,{size:"xl",color:"primary",disabled:!_,onClick:k,children:"ì§ìí기"})})]})]})}export{de as default};
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.