1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5784],{5784:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var l=n(57437),a=n(2265),i=n(57586),s=n(13100),r=n(40875),c=n(30401),d=n(34415),o=n(45884),x=n(18930),m=n(99397),u=n(69076),h=n(89227),f=n(33276),p=n(46211),b=n(93448),g=n(25450),j=n(91455),z=n(4908),w=n(25368);let v=[{id:"multi",label:"ë½ê¸°"},{id:"team",label:"í ëë기"},{id:"order",label:"ë°í ìì"},{id:"lucky",label:"ëí¤ ëë¡ì°"},{id:"roulette",label:"룰ë "},{id:"timer",label:"íì´ë¨¸"}];function N(){let{students:e,classes:t}=(0,z.AF)(),[N,y]=(0,a.useState)("ë´ì íê¸"),[k,C]=(0,a.useState)("multi"),[S,E]=(0,a.useState)(!1),[F,M]=(0,a.useState)([]),[A,I]=(0,a.useState)(""),[T,Z]=(0,a.useState)(3),[_,L]=(0,a.useState)(4),[R,B]=(0,a.useState)([]),[O,D]=(0,a.useState)([]),[P,W]=(0,a.useState)(null),[q,J]=(0,a.useState)(""),[X,G]=(0,a.useState)([]),[Q,V]=(0,a.useState)([]),[H,K]=(0,a.useState)([]),[Y,U]=(0,a.useState)([{id:"1",name:"í목 1",weight:1},{id:"2",name:"í목 2",weight:1},{id:"3",name:"í목 3",weight:1}]),[$,ee]=(0,a.useState)(!1),[et,en]=(0,a.useState)(null),[el,ea]=(0,a.useState)(null),[ei,es]=(0,a.useState)("idle"),[er,ec]=(0,a.useState)(null),[ed,eo]=(0,a.useState)(!1),[ex,em]=(0,a.useState)("timer"),[eu,eh]=(0,a.useState)(300),[ef,ep]=(0,a.useState)(300),[eb,eg]=(0,a.useState)(0),[ej,ez]=(0,a.useState)([]),[ew,ev]=(0,a.useState)(!1),[eN,ey]=(0,a.useState)(!1),[ek,eC]=(0,a.useState)(!1),[eS,eE]=(0,a.useState)(!1),eF=(0,a.useRef)(null),eM=(0,a.useRef)(null),eA=(0,a.useRef)(null),eI=(0,a.useRef)(null),eT=()=>{try{let e=new(window.AudioContext||window.webkitAudioContext),t=0,n=()=>{if(t>=4)return;let l=e.createOscillator(),a=e.createGain();l.connect(a),a.connect(e.destination),l.type="square",l.frequency.setValueAtTime(880,e.currentTime),a.gain.setValueAtTime(.3,e.currentTime),a.gain.exponentialRampToValueAtTime(.001,e.currentTime+.15),l.start(e.currentTime),l.stop(e.currentTime+.15),t++,eI.current=setTimeout(n,300)};n()}catch(e){}};(0,a.useEffect)(()=>{let e=()=>{let e=document.fullscreenElement||document.webkitFullscreenElement;e?e===eA.current?eC(!0):ey(!0):(ey(!1),eC(!1))};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e)}},[]);let eZ=async()=>{if(ek)document.exitFullscreen?await document.exitFullscreen():eC(!1);else try{let e=eA.current;(null==e?void 0:e.requestFullscreen)?await e.requestFullscreen():eC(!0)}catch(e){eC(!0)}},e_=async()=>{if(eN)document.fullscreenElement&&document.exitFullscreen?await document.exitFullscreen():ey(!1);else{var e;if(null===(e=eM.current)||void 0===e?void 0:e.requestFullscreen)try{await eM.current.requestFullscreen()}catch(e){ey(!0)}else ey(!0)}},eL=(0,a.useRef)(null),eR=(0,a.useRef)(null),eB=(0,a.useRef)(null),eO=["ë´ì íê¸",...t.filter(e=>"ë´ì íê¸"!==e)],eD=e.filter(e=>{var t;return"ë´ì íê¸"===N?"ë´ì íê¸"===e.homeClassId:e.homeClassId===N||(null===(t=e.customClassIds)||void 0===t?void 0:t.includes(N))}).sort((e,t)=>e.number-t.number);(0,a.useEffect)(()=>{V(eD.map(e=>({id:e.id,name:e.name,number:e.number}))),K([])},[N,e]);let eP=(0,a.useRef)(!1),eW=e.length>0;(0,a.useEffect)(()=>{if(!N||!eW)return;eP.current=!1;let e=new Set(eD.map(e=>e.id)),t=t=>{let n=t.filter(e=>e&&e.id).map(e=>e.id);return n.length>0&&n.every(t=>e.has(t))},n=[],l=localStorage.getItem("random-picker-teams-".concat(N));if(l)try{let e=JSON.parse(l);Array.isArray(e)&&e.length>0&&e.every(e=>Array.isArray(e))&&t(e.flat())&&(n=e)}catch(e){}B(n);let a=localStorage.getItem("random-picker-teamNames-".concat(N));if(a)try{D(JSON.parse(a))}catch(e){D([])}else D([]);let i=[],s=localStorage.getItem("random-picker-order-".concat(N));if(s)try{let e=JSON.parse(s);Array.isArray(e)&&t(e)&&(i=e)}catch(e){}G(i),"team"===k&&n.length>0?es("result"):"order"===k&&i.length>0?es("result"):es("idle"),M([]),eP.current=!0},[N,eW]),(0,a.useEffect)(()=>{N&&eP.current&&0!==R.length&&localStorage.setItem("random-picker-teams-".concat(N),JSON.stringify(R))},[R]),(0,a.useEffect)(()=>{N&&eP.current&&localStorage.setItem("random-picker-teamNames-".concat(N),JSON.stringify(O))},[O]),(0,a.useEffect)(()=>{N&&eP.current&&0!==X.length&&localStorage.setItem("random-picker-order-".concat(N),JSON.stringify(X))},[X]),(0,a.useEffect)(()=>(ew?"timer"===ex?eF.current=setInterval(()=>{ep(e=>e<=1?(ev(!1),eE(!0),eT(),0):e-1)},1e3):eF.current=setInterval(()=>{eg(e=>e+10)},10):eF.current&&clearInterval(eF.current),()=>{eF.current&&clearInterval(eF.current)}),[ew,ex]);let eq=()=>{if($||0===Y.length)return;en(null),ea(null),ee(!0);let e=Math.random()*Y.reduce((e,t)=>
1e+t.weight,0),t=Y[0];for(let n of Y)if((e-=n.weight)<=0){t=n;break}ea(t.id)},eJ=(0,a.useCallback)(()=>{ee(!1);let e=Y.find(e=>e.id===el);e&&en(e.name)},[el,Y]),eX=e=>{let t=Math.floor(e/1e3);return"".concat(Math.floor(t/60).toString().padStart(2,"0"),":").concat((t%60).toString().padStart(2,"0"),".").concat(Math.floor(e%1e3/10).toString().padStart(2,"0"))};(0,a.useEffect)(()=>()=>{eL.current&&clearInterval(eL.current),eR.current&&clearInterval(eR.current),eF.current&&clearInterval(eF.current)},[]);let eG=e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},eQ=(0,a.useCallback)(e=>{eR.current&&clearInterval(eR.current),ec(e),eR.current=setInterval(()=>{ec(e=>!e||e<=1?(eR.current&&clearInterval(eR.current),null):e-1)},1e3)},[]),eV=(0,a.useCallback)(()=>{0===eD.length||S||(E(!0),es("shuffling"),M([]),eQ(3),setTimeout(()=>{let e=eG(eD);M(e.slice(0,Math.min(T,e.length)).map(e=>({id:e.id,name:e.name,number:e.number}))),es("result"),E(!1)},3e3))},[eD,S,T,eQ]),eH=(0,a.useCallback)(()=>{0===eD.length||S||(E(!0),es("shuffling"),B([]),D([]),eQ(3),setTimeout(()=>{let e=eG(eD),t=Array.from({length:_},()=>[]);e.forEach((e,n)=>t[n%_].push({id:e.id,name:e.name,number:e.number})),B(t),es("result"),E(!1)},3e3))},[eD,S,_,eQ]),eK=(0,a.useCallback)(()=>{0===eD.length||S||(E(!0),es("shuffling"),G([]),eQ(2),setTimeout(()=>{G(eG(eD).map(e=>({id:e.id,name:e.name,number:e.number}))),es("result"),E(!1)},2e3))},[eD,S,eQ]),eY=(0,a.useCallback)(()=>{if(0===Q.length||S)return;E(!0);let e=0;eL.current=setInterval(()=>{if(I(Q[Math.floor(Math.random()*Q.length)].name),++e>=15){eL.current&&clearInterval(eL.current);let e=Math.floor(Math.random()*Q.length),t=Q[e];K(e=>[...e,t]),V(t=>t.filter((t,n)=>n!==e)),I(""),E(!1),(async()=>{let{default:e}=await n.e(9235).then(n.bind(n,79235));(eB.current?e.create(eB.current,{resize:!0,useWorker:!0}):e)({particleCount:120,spread:100,origin:{y:.6},colors:["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"]})})()}},80)},[Q,S]),eU=()=>{V(eD.map(e=>({id:e.id,name:e.name,number:e.number}))),K([])},e$=()=>{M([]),B([]),G([]),es("idle"),ec(null),"lucky"===k&&eU()};return(0,l.jsxs)("div",{className:"flex flex-col h-full bg-[#fafaf9] dark:bg-zinc-950",children:[(0,l.jsxs)("div",{className:"px-5 pt-8 pb-3 sticky top-0 z-40 bg-[#fafaf9]/90 dark:bg-zinc-950/90 backdrop-blur-md",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,l.jsx)("h2",{className:"text-[17px] font-bold text-zinc-900 dark:text-zinc-100",children:"ëë¤ ë½ê¸°"}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("button",{onClick:()=>eo(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-full text-[13px] font-medium text-zinc-700 dark:text-zinc-300 active:scale-95 transition shadow-sm",children:[N,(0,l.jsx)(r.Z,{size:13,className:(0,b.cn)("text-zinc-400 dark:text-zinc-500 transition-transform duration-200",ed&&"rotate-180")})]}),(0,l.jsx)(i.M,{children:ed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-[200]",onClick:()=>eo(!1)}),(0,l.jsx)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.12},className:"absolute right-0 top-full mt-1.5 z-[201] bg-white rounded-2xl shadow-xl border border-zinc-100 overflow-hidden",style:{minWidth:150},children:eO.map((e,t)=>(0,l.jsxs)("button",{onClick:()=>{y(e),eo(!1)},className:(0,b.cn)("w-full flex items-center justify-between px-4 py-3 text-[14px] transition-colors",t>0&&"border-t border-zinc-100/80",e===N?"font-semibold text-zinc-900 bg-zinc-50":"font-medium text-zinc-600 dark:text-zinc-400 active:bg-zinc-50"),children:[e,e===N&&(0,l.jsx)(c.Z,{size:13,className:"text-zinc-500 ml-3 shrink-0",strokeWidth:2.5})]},e))})]})})]})]}),(0,l.jsx)("div",{className:"flex gap-1.5 mt-3 overflow-x-auto scrollbar-hide pb-0.5",children:v.map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>{C(e.id),M([]),"team"===e.id&&R.length>0?es("result"):"order"===e.id&&X.length>0?es("result"):es("idle")},className:(0,g.Fk)(k===e.id,"flex-none whitespace-nowrap"),children:e.label},e.id))})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto px-5 mobile-scroll-with-floating",children:"timer"!==k&&0===eD.length?(0,l.jsx)("div",{className:"flex flex-col items-center justify-center h-48 text-zinc-300",children:(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"íì ë°ì´í°ê° ììµëë¤"})}):(0,l.jsxs)(l.Fragment,{children:["multi"===k&&(0,l.jsxs)("div",{className:"flex flex-col gap-4 pt-3",children:[(0,l.jsxs)("div",{className:"py-2 flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-[13px] font-medium text-zinc-600 dark:text-zinc-400",children:"ë½ì ì¸ì"}),(0,l.jsx)(j.s,{value:T,onChange:Z,"aria-label":"ë½ì ì¸ì ì",className:"gap-1 bg-zinc-100 rounded-lg p-1",itemClassName:"w-8 h-8 rounded-md text-[13px] font-bold active:scale-90",activeItem
1ClassName:"text-zinc-900",inactiveItemClassName:"text-zinc-500",indicatorClassName:"bg-[#e5e4e0] rounded-md",options:[1,2,3,4,5,6].map(e=>({key:e,label:e}))})]}),(0,l.jsxs)(i.M,{mode:"wait",children:["idle"===ei&&(0,l.jsx)(s.E.div,{initial:{opacity:0},animate:{opacity:1},className:"py-4 flex flex-col items-center gap-4",children:(0,l.jsx)("div",{className:"grid grid-cols-4 gap-3 w-full",children:eD.map(e=>(0,l.jsxs)("div",{className:"flex flex-col items-center p-3 bg-zinc-100/70 rounded-xl",children:[(0,l.jsx)("span",{className:"text-[11px] text-zinc-400 font-bold",children:e.number}),(0,l.jsx)("span",{className:"text-[13px] font-semibold text-zinc-700 dark:text-zinc-300 mt-0.5",children:e.name})]},e.id))})},"idle"),"shuffling"===ei&&(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},className:"min-h-[280px] py-10 flex flex-col items-center justify-center gap-5",children:[(0,l.jsx)("div",{className:"w-20 h-20 rounded-full border-4 border-zinc-200 border-t-zinc-900 animate-spin"}),null!==er&&(0,l.jsx)("span",{className:"text-4xl font-black text-zinc-900 tabular-nums",children:er}),(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"ì ë° ì¤..."})]},"shuffling"),"result"===ei&&F.length>0&&(0,l.jsxs)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"flex flex-col gap-2",children:[(0,l.jsx)("p",{className:"text-[11px] font-bold text-zinc-400 uppercase tracking-widest px-1",children:"ì ë° ê²°ê³¼"}),F.map((e,t)=>(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.08*t},className:"bg-white/80 border border-zinc-200/70 rounded-2xl px-5 py-4 flex items-center gap-4 shadow-sm",children:[(0,l.jsx)("span",{className:"w-8 h-8 rounded-full bg-blue-500 text-white text-xs font-bold flex items-center justify-center shrink-0",children:t+1}),(0,l.jsxs)("span",{className:"text-[11px] text-zinc-400 font-medium w-6",children:[e.number,"ë²"]}),(0,l.jsx)("span",{className:"text-[16px] font-bold text-zinc-900",children:e.name})]},e.id))]},"result")]})]}),"team"===k&&(0,l.jsxs)("div",{className:"flex flex-col gap-4 pt-3",children:[(0,l.jsxs)("div",{className:"py-2 flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-[13px] font-medium text-zinc-600 dark:text-zinc-400",children:"í ì"}),(0,l.jsx)(j.s,{value:_,onChange:L,"aria-label":"ëë í ì",className:"gap-1 bg-zinc-100 rounded-lg p-1",itemClassName:"w-8 h-8 rounded-md text-[13px] font-bold active:scale-90",activeItem
1ClassName:"text-zinc-900",inactiveItemClassName:"text-zinc-500",indicatorClassName:"bg-[#e5e4e0] rounded-md",options:[2,3,4,5,6].map(e=>({key:e,label:e}))})]}),(0,l.jsxs)(i.M,{mode:"wait",children:["shuffling"===ei&&(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},className:"min-h-[280px] py-10 flex flex-col items-center justify-center gap-5",children:[(0,l.jsx)("div",{className:"w-20 h-20 rounded-full border-4 border-zinc-200 border-t-zinc-900 animate-spin"}),null!==er&&(0,l.jsx)("span",{className:"text-4xl font-black text-zinc-900 tabular-nums",children:er}),(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"í ëëë ì¤..."})]},"shuffling"),"result"===ei&&R.length>0?(0,l.jsx)(s.E.div,{className:"flex flex-col gap-3",children:R.map((e,t)=>(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.06*t},className:"py-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[P===t?(0,l.jsx)("input",{type:"text",autoFocus:!0,value:q,onChange:e=>J(e.target.value),onBlur:()=>{let e=[...O];for(;e.length<=t;)e.push("");e[t]=q.trim(),D(e),W(null)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur(),"Escape"===e.key&&W(null)},className:"text-[13px] font-bold text-zinc-800 dark:text-zinc-200 bg-transparent outline-none border-b border-zinc-300 focus:border-zinc-500 w-24",maxLength:20}):(0,l.jsx)("span",{className:"text-[13px] font-bold text-zinc-800 dark:text-zinc-200 cursor-pointer active:text-zinc-500 transition-colors",onClick:()=>{W(t),J(O[t]||"".concat(t+1,"모ë "))},children:O[t]||"".concat(t+1,"모ë ")}),(0,l.jsxs)("span",{className:"text-[11px] bg-zinc-100 text-zinc-500 rounded-full px-2 py-0.5 font-medium",children:[e.length,"ëª
"]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-1.5 bg-zinc-100/70 rounded-xl px-3.5 py-2",children:[(0,l.jsx)("span",{className:"text-[10px] font-bold text-zinc-400",children:e.number}),(0,l.jsx)("span",{className:"text-[13px] font-semibold text-zinc-800 dark:text-zinc-200",children:e.name})]},e.id))})]},t))},"teams"):(0,l.jsxs)(s.E.div,{className:"min-h-[260px] py-8 flex flex-col items-center justify-center gap-2",children:[(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"ë²í¼ì ëë¬ íì ëë ë³´ì¸ì"}),(0,l.jsxs)("p",{className:"text-[11px] text-zinc-300",children:[eD.length,"ëª
/ ",_,"í"]})]},"idle-team")]})]}),"order"===k&&(0,l.jsx)("div",{className:"flex flex-col gap-4 pt-3",children:(0,l.jsxs)(i.M,{mode:"wait",children:["shuffling"===ei&&(0,l.jsxs)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"min-h-[280px] py-10 flex flex-col items-center justify-center gap-5",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-full border-4 border-zinc-200 border-t-zinc-900 animate-spin"}),null!==er&&(0,l.jsx)("span",{className:"text-4xl font-black text-zinc-900",children:er}),(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"ìì ì íë ì¤..."})]},"shuffling"),("idle"===ei||"result"===ei&&0===X.length)&&(0,l.jsxs)(s.E.div,{className:"min-h-[260px] py-8 flex flex-col items-center justify-center gap-2",children:[(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"ë²í¼ì ëë¬ ë°í ìì를 ì í´ë³´ì¸ì"}),(0,l.jsxs)("p",{className:"text-[11px] text-zinc-300",children:["ì´ ",eD.length,"ëª
"]})]},"idle-order"),"result"===ei&&X.length>0&&(0,l.jsx)(s.E.div,{className:"flex flex-col gap-2",children:X.map((e,t)=>(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:Math.min(.03*t,.5)},className:"bg-white/80 border border-zinc-200/70 rounded-2xl px-5 py-3.5 flex items-center gap-4",children:[(0,l.jsx)("span",{className:"w-7 h-7 rounded-lg bg-[#e5e4e0] text-zinc-900 text-[11px] font-bold flex items-center justify-center shrink-0",children:t+1}),(0,l.jsxs)("span",{className:"text-[11px] text-zinc-400 font-medium",children:[e.number,"ë²"]}),(0,l.jsx)("span",{className:"text-[14px] font-semibold text-zinc-900",children:e.name})]},e.id))},"order-result")]})}),"lucky"===k&&(0,l.jsxs)("div",{className:"flex flex-col gap-4 pt-3",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"py-3 flex flex-col items-center gap-1",children:[(0,l.jsx)("span",{className:"text-[10px] font-bold text-zinc-400 uppercase tracking-widest",children:"ë¨ì ì¸ì"}),(0,l.jsx)("span",{className:"text-3xl font-black text-zinc-900 tabular-nums",children:Q.length})]}),(0,l.jsxs)("div",{className:"py-3 flex flex-col items-center gap-1",children:[(0,l.jsx)("span",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-widest",children:"ë½í ì¸ì"}),(0,l.jsx)("span",{className:"text-3xl font-black text-blue-500 tabular-nums",children:H.length})]})]}),(0,l.jsxs)("div",{className:"relative overflow-hidden",style:{minHeight:230},children:[(0,l.jsx)("canvas",{ref:eB,className:"absolute inset-0 w-full h-full pointer-events-none z-0"}),(0,l.jsx)("div",{className:"relative z-10 flex flex-col items-center justify-center p-8",style:{minHeight:230},children:(0,l.jsx)(i.M,{mode:"wait",children:S&&A?(0,l.jsx)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.08},className:"text-6xl font-black text-zinc-900 text-center",children:A},"animating"):H.length>0?(0,l.jsxs)(s.E.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex flex-col items-center gap-2",children:[(0,l.jsx)("p",{className:"text-[11px] font-bold text-zinc-400 uppercase tracking-widest",children:"ë¹ì²¨!"}),(0,l.jsx)("p",{className:"text-6xl font-black text-zinc-900",children:H[H.length-1].name}),(0,l.jsxs)("p",{className:"text-sm text-zinc-500",children:[H[H.length-1].number,"ë²"]})]},"winner"):(0,l.jsx)(s.E.div,{className:"flex flex-col items-center gap-2",children:(0,l.jsx)("p",{className:"text-sm text-zinc-400",children:"ë½ê¸° ë²í¼ì ëë¬ì£¼ì¸ì"})},"idle-lucky")})})]}),H.length>0&&(0,l.jsxs)("div",{className:"pt-3",children:[(0,l.jsx)("p",{className:"text-[11px] font-bold text-zinc-400 uppercase tracking-widest mb-3",children:"ë¹ì²¨ 기ë¡"}),(0,l.jsx)("div",{className:"flex flex-col gap-1.5",children:(0,l.jsx)(i.M,{initial:!1,children:[...H].reverse().map((e,t)=>(0,l.jsxs)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},className:(0,b.cn)("flex items-center gap-3 px-3 py-2.5 rounded-xl",0===t?"bg-blue-50 border border-blue-100":"bg-zinc-50"),children:[(0,l.jsx)("span",{className:(0,b.cn)("w-5 h-5 rounded-full text-[10px] font-bold flex items-center justify-center shrink-0",0===t?"bg-[#007AFF] text-white":"bg-zinc-200 text-zinc-500"),children:H.length-t}),(0,l.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[e.number,"ë²"]}),(0,l.jsx)("span",{className:"text-[13px] font-semibold text-zinc-800 dark:text-zinc-200",children:e.name})]},e.id))})})]})]}),"roulette"===k&&(0,l.jsxs)("div",{ref:eA,className:(0,b.cn)("flex flex-col transition-all",ek?"fixed inset-0 z-[9999] bg-[#fafaf9] items-center justify-center gap-4 mobile-fullscreen-safe px-6":"gap-4 pt-3 mobile-picker-stage"),children:[(0,l.jsx)("button",{"aria-label":ek?"ì ì²´íë©´ ì¢
ë£":"ì ì²´íë©´",onClick:eZ,className:(0,b.cn)("absolute z-50 p-2.5 bg-white shadow-sm rounded-full transition-all active:scale-95 border border-zinc-100",ek?"top-12 right-6":"top-2 right-0"),children:ek?(0,l.jsx)(d.Z,{size:20}):(0,l.jsx)(o.Z,{size:20})}),(0,l.jsx)("div",{className:(0,b.cn)("relative flex flex-col items-center justify-center w-full mx-auto",ek?"shrink-0":"flex-1 min-h-[220px] max-w-[320px] mb-4"),children:(0,l.jsx)(w.c,{items:Y,isSpinning:$,targetId:el,onFinished:eJ,size:ek?Math.min(460,.92*window.innerWidth):Math.min(280,.75*window.innerWidth),highlightId:!$&&et?el:null})}),!ek&&(0,l.jsxs)("div",{className:"p-1 shrink-0 flex flex-col h-[200px]",children:[(0,l.jsx)("div",{className:"flex-1 overflow-y-auto mb-2 pr-1 custom-scrollbar",children:(0,l.jsx)("div",{className:"flex flex-col gap-2",children:Y.map((e,t)=>(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2 px-1",children:[(0,l.jsx)("div",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:w.Q[t%w.Q.length]}}),(0,l.jsx)("input",{type:"text",value:e.name,onChange:t=>U(n=>n.map(n=>n.id===e.id?{...n,name:t.target.value}:n)),className:"flex-1 min-w-0 bg-zinc-50 text-zinc-800 dark:text-zinc-200 text-sm outline-none px-2 py-1.5 rounded-md border border-zinc-200 focus:border-blue-400",placeholder:"í목 ì´ë¦"}),(0,l.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,l.jsx)("span",{className:"text-zinc-400 text-[10px] font-medium",children:"ë¹ì¨"}),(0,l.jsx)("input",{type:"number",min:1,max:100,value:e.weight,onChange:t=>U(n=>n.map(n=>n.id===e.id?{...n,weight:Math.max(1,Number(t.target.value))}:n)),className:"w-[42px] bg-zinc-50 text-zinc-800 dark:text-zinc-200 text-sm text-center rounded-md px-1 py-1.5 outline-none border border-zinc-200 focus:border-blue-400"})]}),(0,l.jsx)("button",{"aria-label":"ìì ",onClick:()=>U(t=>t.filter(t=>t.id!==e.id)),disabled:Y.length<=2,className:"p-1.5 text-zinc-300 hover:text-red-400 transition-colors disabled:opacity-20 shrink-0",children:(0,l.jsx)(x.Z,{size:16})})]},e.id))})}),(0,l.jsxs)("div",{className:"flex items-center justify-between shrink-0 pt-2 border-t border-zinc-100",children:[(0,l.jsxs)("button",{onClick:()=>U(e=>[...e,{id:Date.now().toString(),name:"í목 ".concat(e.length+1),weight:1}]),className:"flex items-center gap-1 text-zinc-500 hover:text-zinc-800 text-sm font-medium transition-colors",children:[(0,l.jsx)(m.Z,{size:16}),(0,l.jsx)("span",{children:"ì¶ê°"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>{en(null),ea(null)},disabled:$,className:"px-4 py-2 rounded-full bg-white hover:bg-zinc-50 border border-zinc-200 text-zinc-600 dark:text-zinc-400 font-bold text-sm transition active:scale-95 disabled:opacity-50 shadow-sm",children:"ì´ê¸°í"}),(0,l.jsx)("button",{onClick:eq,disabled:$||Y.length<2,className:"px-6 py-2 rounded-full bg-[#007AFF] hover:bg-[#0066D6] text-white font-bold text-sm transition active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed shadow-md",children:$?"ë리ë ì¤...":"ë리기"})]})]})]}),ek&&(0,l.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,l.jsx)("button",{onClick:()=>{en(null),ea(null)},disabled:$,className:"px-6 py-3 rounded-full bg-white border border-zinc-200 text-zinc-700 dark:text-zinc-300 font-bold text-sm shadow-sm active:scale-95 disabled:opacity-50",children:"ì´ê¸°í"}),(0,l.jsx)("button",{onClick:eq,disabled:$||Y.length<2,className:"px-10 py-3 rounded-full bg-[#007AFF] text-white font-bold text-base shadow-md active:scale-95 disabled:opacity-50",children:$?"ë리ë ì¤...":"ë리기"})]})]}),"timer"===k&&(0,l.jsxs)("div",{ref:eM,className:(0,b.cn)("flex flex-col gap-4 pt-3 transition-all",eN?"fixed inset-0 z-[9999] bg-[#fafaf9] px-4 mobile-fullscreen-safe pt-12":"h-full relative"),children:[(0,l.jsx)("button",{"aria-label":eN?"ì ì²´íë©´ ì¢
ë£":"ì ì²´íë©´",onClick:e_,className:(0,b.cn)("absolute z-50 p-2.5 text-zinc-400 hover:text-zinc-600 bg-white shadow-sm rounded-full transition-all active:scale-95 border border-zinc-100",eN?"top-12 right-6":"top-2 right-0"),children:eN?(0,l.jsx)(d.Z,{size:20}):(0,l.jsx)(o.Z,{size:20})}),(0,l.jsx)(j.s,{value:ex,onChange:e=>{em(e),ev(!1)},"aria-label":"ìê° ì¸¡ì ë°©ì",equalWidth:!0,className:"gap-1.5 p-1 bg-white border border-zinc-100 rounded-xl max-w-[200px] mx-auto
1shadow-sm",itemClassName:"py-1.5 text-[13px] font-bold rounded-lg whitespace-nowrap",activeItemClassName:"text-zinc-900",inactiveItemClassName:"text-zinc-400",indicatorClassName:"bg-zinc-100 rounded-lg shadow-sm",options:[{key:"timer",label:"íì´ë¨¸"},{key:"stopwatch",label:"ì¤í±ìì¹"}]}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center py-6 min-h-[360px]",children:["timer"===ex&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{children:"@keyframes timerShake{0%,100%{transform:translateX(0)}20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}"}),(0,l.jsx)("div",{style:eS?{animation:"timerShake 0.4s ease-in-out infinite"}:{},className:(0,b.cn)("font-black tabular-nums leading-none mb-auto mt-auto tracking-tight whitespace-nowrap px-1 transition-colors duration-300",eN?"text-[clamp(7rem,22vw,14rem)]":"text-[clamp(5rem,20vw,11rem)]",eS?"text-red-500":"text-zinc-900"),children:"".concat(Math.floor(ef/60).toString().padStart(2,"0"),":").concat((ef%60).toString().padStart(2,"0"))}),!ew&&(0,l.jsxs)("div",{className:"flex flex-wrap justify-center gap-1.5 mb-8 px-2",children:[(0,l.jsx)("button",{onClick:()=>{eh(e=>Math.max(0,e-60)),ep(e=>Math.max(0,e-60))},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"-1ë¶"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>Math.max(0,e-10)),ep(e=>Math.max(0,e-10))},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"-10ì´"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>Math.max(0,e-1)),ep(e=>Math.max(0,e-1))},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"-1ì´"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>e+1),ep(e=>e+1)},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"+1ì´"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>e+10),ep(e=>e+10)},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"+10ì´"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>e+60),ep(e=>e+60)},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"+1ë¶"}),(0,l.jsx)("button",{onClick:()=>{eh(e=>e+300),ep(e=>e+300)},className:"px-2.5 py-1.5 rounded-lg bg-zinc-50 border border-zinc-100 text-zinc-500 font-medium text-[12px]",children:"+5ë¶"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4 mt-auto",children:[(0,l.jsx)("button",{"aria-label":"íì´ë¨¸ ì´ê¸°í",onClick:()=>{ev(!1),eE(!1),eI.current&&clearTimeout(eI.current),ew||ef!==eu||300===eu?ep(eu):(eh(300),ep(300))},className:"w-14 h-14 rounded-full bg-zinc-100 flex items-center justify-center text-zinc-500 transition-transform active:scale-95",children:(0,l.jsx)(u.Z,{size:22})}),(0,l.jsx)("button",{"aria-label":ew?"ì¼ìì ì§":"ì¬ì",onClick:()=>ev(!ew),className:(0,b.cn)("w-16 h-16 rounded-full flex items-center justify-center transition-transform active:scale-95 shadow-md",ew?"bg-red-500 shadow-red-500/30 text-white":"bg-[#007AFF] shadow-blue-500/30 text-white"),children:ew?(0,l.jsx)(h.Z,{size:28,fill:"white",color:"white"}):(0,l.jsx)(f.Z,{size:28,fill:"white",color:"white",className:"ml-1"})})]})]}),"stopwatch"===ex&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:(0,b.cn)("font-black text-zinc-900 tabular-nums leading-none tracking-tight whitespace-nowrap px-1 mb-auto mt-auto transition",eN?"text-[clamp(6rem,16vw,10rem)]":"text-[clamp(4rem,15vw,8rem)]"),children:eX(eb)}),ej.length>0&&(0,l.jsx)("div",{className:"absolute bottom-[90px] left-0 right-0 max-h-[120px] overflow-y-auto custom-scrollbar flex flex-col items-center gap-1 pb-2 z-0",style:{WebkitMaskImage:"linear-gradient(to bottom, transparent, black 25%)"},children:ej.map((e,t)=>(0,l.jsx)("div",{className:"text-zinc-900 dark:text-zinc-100 font-black text-[1.2rem] tabular-nums tracking-widest shrink-0",children:eX(e)},t))}),(0,l.jsxs)("div",{className:"flex items-center gap-4 mt-auto pt-4 relative z-10",children:[(0,l.jsx)("button",{"aria-label":ew?"ì¢
ë£":"ì´ê¸°í",onClick:()=>{ew?ez(e=>[eb,...e]):(ev(!1),eg(0),ez([]))}
1,className:"w-14 h-14 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-zinc-500 dark:text-zinc-400 transition-transform active:scale-95",children:ew?(0,l.jsx)(p.Z,{size:22}):(0,l.jsx)(u.Z,{size:22})}),(0,l.jsx)("button",{"aria-label":ew?"ì¼ìì ì§":"ì¬ì",onClick:()=>ev(!ew),className:(0,b.cn)("w-16 h-16 rounded-full flex items-center justify-center transition-transform active:scale-95 shadow-md",ew?"bg-red-500 shadow-red-500/30 text-white":"bg-[#007AFF] shadow-blue-500/30 text-white"),children:ew?(0,l.jsx)(h.Z,{size:28,fill:"white",color:"white"}):(0,l.jsx)(f.Z,{size:28,fill:"white",color:"white",className:"ml-1"})})]})]})]})]})]})}),"timer"!==k&&eD.length>0&&(0,l.jsx)("div",{className:"px-5 mobile-bottom-action-bar pt-4 bg-[#fafaf9]/80 backdrop-blur-xl border-t border-zinc-100 shadow-[0_-5px_20px_rgba(0,0,0,0.03)] z-50",children:(0,l.jsxs)("div",{className:"flex gap-2 max-w-md mx-auto",children:["multi"===k&&(0,l.jsx)("button",{onClick:"result"===ei?e$:eV,disabled:S,className:(0,b.cn)("w-full py-4 rounded-2xl text-[15px] font-bold flex items-center justify-center gap-2 transition active:scale-[0.98]",S?"bg-zinc-200 text-zinc-400":"result"===ei?"bg-zinc-100 text-zinc-700 dark:text-zinc-300":"bg-[#007AFF] text-white"),children:S?"ë½ë ì¤...":"result"===ei?"ë¤ì ë½ê¸°":"".concat(T,"ëª
ë½ê¸°")}),"team"===k&&(0,l.jsx)("button",{onClick:"result"===ei?e$:eH,disabled:S,className:(0,b.cn)("w-full py-4 rounded-2xl text-[15px] font-bold flex items-center justify-center gap-2 transition active:scale-[0.98]",S?"bg-zinc-200 text-zinc-400":"result"===ei?"bg-zinc-100 text-zinc-700 dark:text-zinc-300":"bg-[#007AFF] text-white"),children:S?"ëëë ì¤...":"result"===ei?"ë¤ì ëë기":"í ëë기"}),"order"===k&&(0,l.jsx)("button",{onClick:"result"===ei?e$:eK,disabled:S,className:(0,b.cn)("w-full py-4 rounded-2xl text-[15px] font-bold flex items-center justify-center gap-2 transition active:scale-[0.98]",S?"bg-zinc-200 text-zinc-400":"result"===ei?"bg-zinc-100 text-zinc-700 dark:text-zinc-300":"bg-[#007AFF] text-white"),children:S?"ì íë ì¤...":"result"===ei?"ë¤ì ì í기":"ìì ì í기"}),"lucky"===k&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{onClick:eU,className:"flex-none px-4 py-4 rounded-2xl text-[14px] font-bold bg-zinc-100 text-zinc-600 dark:text-zinc-400 flex items-center gap-1.5 active:scale-[0.98] transition",children:[(0,l.jsx)(u.Z,{size:15}),"ì´ê¸°í"]}),(0,l.jsx)("button",{onClick:eY,disabled:S||0===Q.length,className:(0,b.cn)("flex-1 py-4 rounded-2xl text-[15px] font-bold transition active:scale-[0.98]",S||0===Q.length?"bg-zinc-200 text-zinc-400":"bg-[#007AFF] text-white"),children:S?"ë½ë ì¤...":0===Q.length?"모ë ë½ììµëë¤":"ë½ê¸°"})]})]})})]})}},25368:function(e,t,n){n.d(t,{Q:function(){return r},c:function(){return c}});var l=n(57437),a=n(2265),i=n(19653),s=n(13100);let r=["#7BaEB3","#DDA77B","#A0B084","#AE8F9E","#7D93B5","#D78A76","#E0B878","#82A1B1","#D6A8A8","#7A9E88"];function c(e){let{items:t,isSpinning:n,targetId:c,onFinished:d,size:o=400,highlightId:x}=e,m=(0,a.useRef)(null),[u,h]=(0,a.useState)(0),f=(0,i._)(),p=(0,a.useMemo)(()=>t.reduce((e,t)=>e+t.weight,0),[t]);return(0,a.useEffect)(()=>{let e=m.current;if(!e||0===t.length)return;let n=e.getContext("2d");if(!n)return;let l=window.devicePixelRatio||1;e.width=o*l,e.height=o*l,n.scale(l,l);let a=o/2,i=o/2,s=o/2-12;n.clearRect(0,0,o,o);let c=-Math.PI/2;t.forEach((e,t)=>{let l=e.weight/p*2*Math.PI,d=c+l,m=x&&x!==e.id;n.globalAlpha=m?.2:1,n.beginPath(),n.moveTo(a,i),n.arc(a,i,s,c,d),n.closePath();let u=c+l/2,h=a+.1*s*Math.cos(u),f=i+.1*s*Math.sin(u),b=a+Math.cos(u)*s,g=i+Math.sin(u)*s,j=n.createLinearGradient(h,f,b,g),z=e.color||r[t%r.length];j.addColorStop(0,z),j.addColorStop(1,"#"+z.replace(/^#/,"").replace(/../g,e=>("0"+Math.min(255,Math.max(0,parseInt(e,16)+-15)).toString(16)).substr(-2))),n.fillStyle=j,n.fill(),n.strokeStyle="rgba(255, 255, 255, 0.4)",n.lineWidth=2,n.stroke(),n.save(),n.translate(a,i),n.rotate(u),n.textAlign="right",n.textBaseline="middle",n.fillStyle="#ffffff",n.font="bold ".concat(Math.max(14,o/22),'px "Pretendard", "Apple SD Gothic Neo", sans-serif'),n.shadowColor="rgba(0,0,0,0.2)",n.shadowBlur=4,n.shadowOffsetX=1,n.shadowOffsetY=1;let w=.65*s,v=e.name;n.measureText(v).width>
1w&&(v=v.substring(0,8)+"..."),n.fillText(v,s-20,0),n.restore(),c=d,n.globalAlpha=1}),n.beginPath(),n.arc(a,i,.12*o,0,2*Math.PI),n.fillStyle="#FFFFFF",n.fill(),n.strokeStyle="#E4E4E7",n.lineWidth=6,n.stroke(),n.beginPath(),n.arc(a,i,.04*o,0,2*Math.PI),n.fillStyle="#F4F4F5",n.fill()},[t,o,p,x]),(0,a.useEffect)(()=>{if(n&&c){let e=0,n=0;for(let l of t){let t=l.weight/p*360;if(l.id===c){n=e/p*360+t/2;break}e+=l.weight}let l=t.find(e=>e.id===c),a=(2520+(360-n)+(l?l.weight/p:0)*216*(Math.random()-.5))%360-u%360;a<0&&(a+=360);let i=u+a+2520;f.start({rotate:i,transition:{type:"tween",ease:[.12,.85,.15,1],duration:5.5}}).then(()=>{h(i),d()})}},[n,c,t,p,u,f,d]),(0,l.jsxs)("div",{className:"relative flex items-center justify-center drop-shadow-[0_8px_24px_rgba(0,0,0,0.12)] h-full w-full",style:{width:o,height:o},children:[(0,l.jsx)("div",{className:"absolute inset-[-12px] rounded-full border-[8px] border-[#E5E4E0] bg-white shadow-sm"}),(0,l.jsx)("div",{className:"absolute inset-[-4px] rounded-full border border-black/5 pointer-events-none"}),(0,l.jsx)(s.E.div,{className:"relative rounded-full overflow-hidden will-change-transform z-10",animate:f,style:{width:"100%",height:"100%"},children:(0,l.jsx)("canvas",{ref:m,style:{width:"100%",height:"100%"}})}),(0,l.jsx)("div",{className:"absolute top-[-20px] left-1/2 -translate-x-1/2 z-20 flex flex-col items-center drop-shadow-[0_4px_6px_rgba(0,0,0,0.3)]",style:{transformOrigin:"top center"},children:(0,l.jsx)(s.E.div,{animate:n?{rotate:[0,-10,15,-12,8,-5,0]}:{},transition:{repeat:n?1/0:0,repeatType:"loop",duration:.3,ease:"linear"},style:{transformOrigin:"50% 10%"},children:(0,l.jsxs)("svg",{width:"40",height:"48",viewBox:"0 0 40 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M20 48L3.48386 20.3117C-3.69345 8.2934 4.95461 -7.60416e-07 18.9168 0L21.0832 1.4878e-07C35.0454 1.09672e-06 43.6935 8.2934 36.5161 20.3117L20 48Z",fill:"#FCA5A5"}),(0,l.jsx)("path",{d:"M20 45L5.59814 20.871C-0.342171 10.9209 6.81432 1 18.4285 1L21.5715 1.25997e-06C33.1857 1.45828e-06 40.3422 10.9209 34.4019 20.871L20 45Z",fill:"#EF4444",stroke:"#DC2626",strokeWidth:"2"}),(0,l.jsx)("circle",{cx:"20",cy:"12",r:"4",fill:"#FEE2E2"})]})})})]})}},25450:function(e,t,n){n.d(t,{Fk:function(){return a}});var l=n(93448);function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return(0,l.cn)("inline-flex items-center justify-center h-8 px-3 rounded-full text-[13px] transition active:scale-[0.96]",e?"bg-white dark:bg-[#1C1C1E] text-zinc-900 dark:text-zinc-100 font-semibold border border-zinc-200/90 dark:border-white/[0.12] shadow-[0_1px_2px_rgba(0,0,0,0.04)]":"bg-zinc-100/80 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 font-medium border border-transparent",...n)}}}]);
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.