PageSourceSearch

https://cert-web-sand.vercel.app/assets/CertComparePage-BP_tbRk4.js

js cert-web-sand.vercel.app collected 2026-10-03 06:22:54 UTC 12,343 bytes, 1 lines download raw bytes

1import{u as L,w as A,E,j as e,B as h}from"./index-DNWw9vL6.js";import{r as x,S as v,N as F,as as w,X as U,Z as z,q as D,i as y,W as I,$ as T,P as _,a0 as V}from"./vendor-ui-BEzN-rtg.js";import{B as q}from"./badge-CAn3Rvbr.js";import{S as k}from"./skeleton-D4qHMoUI.js";import"./vendor-react-qkC6yhPU.js";function X(){const{navigate:n}=L(),{removeFromCompare:p}=A(),r=x.useMemo(()=>(new URLSearchParams(window.location.search).get("ids")||"").split(",").map(a=>parseInt(a.trim(),10)).filter(a=>!isNaN(a)&&a>0),[]),[b,C]=x.useState([]),[j,u]=x.useState(!0);x.useEffect(()=>{if(r.length===0){u(!1);return}u(!0),Promise.all(r.map(s=>E(s,null))).then(s=>C(s)).finally(()=>u(!1))},[r.join(",")]);const l=x.useMemo(()=>b.filter(Boolean),[b]),f=s=>{if(!s.stats||s.stats.length===0)return null;const t=s.stats.map(a=>a.pass_rate).filter(a=>a!=null);return t.length===0?null:t.reduce((a,i)=>a+i,0)/t.length},g=(s,t)=>{if(l.length<2)return new Set;const a=l.map(o=>s==="avg_difficulty"?o.avg_difficulty:o.latest_pass_rate),i=a.filter(o=>o!=null);if(i.length<2)return new Set;const m=t==="max"?Math.max(...i):Math.min(...i);return new Set(l.filter((o,P)=>a[P]===m).map(o=>o.qual_id))},S=()=>{if(l.length<2)return new Set;const s=l.map(f),t=s.filter(i=>i!=null);if(t.length<2)return new Set;const a=Math.max(...t);return new Set(l.filter((i,m)=>s[m]!=null&&Math.abs(s[m]-a)<.01).map(i=>i.qual_id))},$=x.useMemo(()=>g("latest_pass_rate","max"),[l]),B=x.useMemo(()=>g("avg_difficulty","min"),[l]),M=x.useMemo(()=>S(),[l]),N=s=>s==null?"text-slate-500":s>70?"pass-high":s>=30?"pass-mid":"pass-low",R=s=>s==null?"text-slate-500":s>=7.5?"text-rose-400":s>=5?"text-amber-400":"text-emerald-400";return!j&&r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] space-y-6 text-center",children:[e.jsx("div",{className:"p-8 bg-slate-900 rounded-full",children:e.jsx(v,{className:"w-14 h-14 text-slate-700"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"비교할 자격증을 선택하세요"}),e.jsx("p",{className:"text-slate-500 max-w-sm",children:"자격증 목록이나 상세 페이지에서 최대 3개를 선택하면 이 페이지에서 나란히 비교할 수 있습니다."})]}),e.jsx(h,{onClick:()=>n("/certs"),className:"bg-blue-600 hover:bg-blue-700 text-white rounded-xl",children:"자격증 탐색하러 가기"})]}):j?e.jsxs("div",{className:"space-y-8 pb-40",children:[e.jsx(k,{className:"h-10 w-64 bg-slate-900 rounded-xl"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"grid gap-4 min-w-[560px]",style:{gridTemplateColumns:`160px repeat(${r.length}, 1fr)`},children:Array.from({length:(r.length+1)*10}).map((s,t)=>e.jsx(k,{className:"h-10 bg-slate-900 rounded-lg"},t))})})]}):e.jsxs("div",{className:"space-y-8 pb-40 max-w-5xl mx-auto",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs(h,{variant:"ghost",onClick:()=>n("/certs"),className:"text-slate-500 hover:text-white -ml-4 flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4"})," 자격증 목록"]}),e.jsxs("div",{className:"flex items-end justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(q,{variant:"outline",className:"border-blue-500/30 text-blue-400 px-3 py-1 flex items-center gap-1.5 w-fit",children:[e.jsx(v,{className:"w-3 h-3"})," 자격증 비교"]}),e.jsxs("h1",{className:"text-3xl font-bold text-white tracking-tight",children:[l.length,"개 자격증 비교 분석"]}),e.jsx("p",{className:"text-slate-500 text-sm",children:"파란색 셀은 해당 항목에서 가장 유리한 값입니다."})]}),l.length<3&&e.jsxs(h,{onClick:()=>n("/certs"),variant:"outline",className:"border-slate-700 text-slate-400 hover:text-white rounded-xl flex items-center gap-2",children:[e.jsx(w,{className:"w-4 h-4"})," 자격증 추가"]})]})]}),e.jsxs("p",{className:"sm:hidden text-[11px] text-slate-600 flex items-center gap-1.5 -mb-4",children:[e.jsx("span",{"aria-hidden":!0,children:"←"})," 좌우로 스크롤하여 비교 ",e.jsx("span",{"aria-hidden":!0,
1children:"→"})]}),e.jsx("div",{className:"overflow-x-auto rounded-2xl border border-slate-800",tabIndex:0,"aria-label":"자격증 비교 표 (좌우 스크롤 가능)",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:`${160+l.length*220}px`},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-800",children:[e.jsx("th",{className:"sticky left-0 z-20 bg-slate-950 w-40 min-w-[160px] px-6 py-5 text-left text-xs font-bold text-slate-600 uppercase tracking-wider",scope:"col"}),l.map(s=>e.jsx("th",{className:"px-6 py-5 text-left min-w-[200px] bg-slate-900/50",scope:"col",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:()=>n(`/certs/${s.qual_id}`),className:"text-base font-bold text-white hover:text-blue-400 transition-colors text-left leading-snug rounded focus-ring",children:s.qual_name}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(q,{className:"bg-slate-800 text-slate-400 border-none text-[10px] px-1.5 py-0",children:s.qual_type||"—"}),s.is_active?e.jsx("span",{className:"text-[10px] text-emerald-500 font-bold",children:"시행중"}):e.jsx("span",{className:"text-[10px] text-slate-500 font-bold",children:"종료"})]}),e.jsxs("button",{type:"button",onClick:()=>p(s.qual_id),className:"flex items-center gap-1 text-[11px] text-slate-600 hover:text-slate-400 transition-colors font-medium rounded focus-ring","aria-label":`${s.qual_name} 비교 제거`,children:[e.jsx(U,{className:"w-3 h-3"})," 제거"]})]})},s.qual_id))]})}),e.jsxs("tbody",{children:[e.jsx(d,{label:"합격률"}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(z,{className:"w-3.5 h-3.5 text-slate-500"}),label:"최근 합격률"}),l.map(s=>{const t=s.latest_pass_rate,a=$.has(s.qual_id)&&t!=null;return e.jsx("td",{className:"px-6 py-4",children:t!=null?e.jsxs("div",{className:`space-y-1.5 ${a?"bg-blue-500/10 rounded-lg px-3 py-2 -mx-3":""}`,children:[e.jsxs("div",{className:`text-base font-black ${N(t)}`,children:[t,"%"]}),e.jsx("div",{className:"h-1.5 bg-slate-800 rounded-full overflow-hidden max-w-[80px]",children:e.jsx("div",{className:`h-full rounded-full ${t>70?"bg-emerald-500":t>=30?"bg-amber-500":"bg-rose-500"}`,style:{width:`${Math.min(t,100)}%`}})})]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"정보 없음"})},s.qual_id)})]}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(D,{className:"w-3.5 h-3.5 text-slate-500"}),label:"평균 합격률"}),l.map(s=>{const t=f(s),a=M.has(s.qual_id)&&t!=null;return e.jsxs("td",{className:"px-6 py-4",children:[t!=null?e.jsxs("span",{className:`text-sm font-bold ${N(t)} ${a?"bg-blue-500/10 rounded-lg px-2 py-1 -mx-2":""}`,children:[t.toFixed(1),"%"]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"정보 없음"}),t!=null&&e.jsxs("span",{className:"text-[10px] text-slate-600 ml-1.5",children:["(",s.stats?.length||0,"회차 평균)"]})]},s.qual_id)})]}),e.jsx(d,{label:"난이도"}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(y,{className:"w-3.5 h-3.5 text-slate-500"}),label:"평균 난이도"}),l.map(s=>{const t=s.avg_difficulty,a=B.has(s.qual_id)&&t!=null;return e.jsx("td",{className:"px-6 py-4",children:t!=null?e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${a?"bg-blue-500/10 rounded-lg px-2 py-1 -mx-2":""}`,children:[e.jsx("span",{className:`text-base font-black ${R(t)}`,children:t.toFixed(1)}),e.jsx("span",{className:"text-[11px] text-slate-600",children:"/10"}),a&&e.jsx("span",{className:"text-[10px] text-blue-400 font-bold",children:"가장 쉬움"})]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"정보 없음"})},s.qual_id)})]}),e.jsx(d,{label:"응시 정보"}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(I,{className:"w-3.5 h-3.5 text-slate-500"}),label:"누적 응시자"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm font-bold text-slate-300 tabular-nums",children:s.total_candidates?s.total_candidates.toLocaleStr
1ing("ko-KR")+"명":"정보 없음"})},s.qual_id))]}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(T,{className:"w-3.5 h-3.5 text-slate-500"}),label:"시험 구성"}),l.map(s=>{const t=[];return(s.written_cnt||0)>0&&t.push(`필기 ${s.written_cnt}과목`),(s.practical_cnt||0)>0&&t.push(`실기 ${s.practical_cnt}과목`),(s.interview_cnt||0)>0&&t.push(`면접 ${s.interview_cnt}과목`),e.jsx("td",{className:"px-6 py-4",children:t.length>0?e.jsx("div",{className:"space-y-0.5",children:t.map(a=>e.jsx("div",{className:"text-sm text-slate-300",children:a},a))}):e.jsx("span",{className:"text-slate-600 text-sm",children:"정보 없음"})},s.qual_id)})]}),e.jsx(d,{label:"자격 분류"}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(_,{className:"w-3.5 h-3.5 text-slate-500"}),label:"자격 등급"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-300 font-medium",children:s.grade_code||"등급 없음"})},s.qual_id))]}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(y,{className:"w-3.5 h-3.5 text-slate-500"}),label:"직무 분류 (NCS)",title:"국가직무능력표준(NCS) 기준 직무 분류 체계"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-300",children:[s.ncs_large,s.main_field].filter(Boolean).join(" › ")||"정보 없음"})},s.qual_id))]}),e.jsxs("tr",{className:"hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(_,{className:"w-3.5 h-3.5 text-slate-500"}),label:"관리 기관"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-400 leading-snug",children:s.managing_body||"정보 없음"})},s.qual_id))]}),e.jsx(d,{label:"커리어"}),e.jsxs("tr",{className:"border-t border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(V,{className:"w-3.5 h-3.5 text-slate-500"}),label:"관련 직무"}),l.map(s=>{const t=s.jobs?.length||0;return e.jsx("td",{className:"px-6 py-4",children:t>0?e.jsxs("button",{type:"button",onClick:()=>n(`/certs/${s.qual_id}#jobs`),className:"text-sm font-bold text-blue-400 hover:text-blue-300 transition-colors rounded focus-ring",children:[t,"개 직무 보기"]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"데이터 없음"})},s.qual_id)})]})]})]})}),l.length<3&&e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t border-slate-800/50",children:[e.jsxs("p",{className:"text-sm text-slate-500",children:["최대 3개까지 비교할 수 있습니다. 지금 ",l.length,"개를 비교 중입니다."]}),e.jsxs(h,{onClick:()=>n("/certs"),variant:"outline",className:"border-slate-700 text-slate-400 hover:text-white rounded-xl text-sm",children:[e.jsx(w,{className:"w-4 h-4 mr-1.5"})," 추가 선택"]})]})]})}function d({label:n}){return e.jsx("tr",{children:e.jsx("td",{colSpan:100,className:"sticky left-0 px-6 py-2 text-[10px] font-black text-slate-600 uppercase tracking-[0.08em] bg-slate-950 border-b border-slate-800/60",children:n})})}function c({icon:n,label:p,title:r}){return e.jsx("td",{className:"sticky left-0 z-10 bg-slate-950 px-6 py-4 text-xs font-bold text-slate-500 whitespace-nowrap border-r border-slate-800/40",children:e.jsxs("div",{className:"flex items-center gap-2",children:[n,p,r&&e.jsx("span",{title:r,"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full border border-slate-700 text-slate-700 hover:border-slate-500 hover:text-slate-400 transition-colors cursor-help text-[9px] font-black leading-none select-none",children:"?"})]})})}export{X as CertComparePage};

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.