diff --git a/app/server/db.mjs b/app/server/db.mjs index 262d841..468450c 100644 --- a/app/server/db.mjs +++ b/app/server/db.mjs @@ -1215,7 +1215,14 @@ function listFootprints(d, query) { case 'profile_upsert': { const p = payload; // 单行语义:更新现有行或插入首行 - const content = JSON.stringify(p.content ?? {}); + // 顶层 key 合并:info / resume / zongce 是相互独立的子文档,各页面只提交自己负责的 + // key(ProfilePage 只有 info、AssessmentPage 有 info+zongce…),整行替换会让其他 + // key 神秘消失;按顶层 key 合并后互不影响,key 内部整体替换(仍是全量提交该子文档)。 + const existingRow = d.prepare('SELECT * FROM profile WHERE deleted_at IS NULL ORDER BY id DESC LIMIT 1').get(); + let prev = {}; + try { prev = JSON.parse(existingRow?.content || '{}'); } catch { prev = {}; } + const merged = { ...prev, ...(p.content ?? {}) }; + const content = JSON.stringify(merged); const existing = d.prepare('SELECT * FROM profile WHERE deleted_at IS NULL ORDER BY id DESC LIMIT 1').get(); withTx(d, () => { const h = hlcNext(d); diff --git a/app/src/lib/zongce.ts b/app/src/lib/zongce.ts index 6619712..d3a9350 100644 --- a/app/src/lib/zongce.ts +++ b/app/src/lib/zongce.ts @@ -98,6 +98,8 @@ export interface ZcItem { overridden?: boolean; note?: string; fromRecord?: number; + /** 聚合条款(ccap/kcap/…)对应的记录 id 列表,用于标注哪些记录参与计分 */ + recordIds?: number[]; } export interface ZcSection { key: string; label: string; cap: number; items: ZcItem[]; subtotal: number } export interface ZcResult { sections: ZcSection[]; total: number; gpa: number | null } @@ -200,7 +202,7 @@ export function computeZongce(opts: { wItems.push(mk('w' + rec.id, rec.title, rec.type_name + ' · ' + (rec.level ?? '') + ' ' + (rec.award_grade ?? ''), auto, undefined, rec.id)); } const wCap = round2(Math.min(wItems.reduce((a, x) => a + x.score, 0), 5)); - sections.push(sec('sports', '文体素质', 10, [...sportsItems, { itemKey: 'wcap', title: '文体类加分(上限 5 分)', source: wItems.length + ' 条记录', score: wCap, note: wItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录' }])); + sections.push(sec('sports', '文体素质', 10, [...sportsItems, { itemKey: 'wcap', title: '文体类加分(上限 5 分)', source: wItems.length + ' 条记录', score: wCap, note: wItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录', recordIds: wItems.map(x => x.fromRecord).filter(Boolean) as number[] }])); // ---- 拓展性素质(17):竞赛获奖(10) + 学生工作(4) + 公益(3) ---- const compItems: ZcItem[] = []; @@ -231,9 +233,9 @@ export function computeZongce(opts: { } const pubCap = round2(Math.min(pubItems.reduce((a, x) => a + x.score, 0), 3)); sections.push(sec('expand', '拓展性素质', 17, [ - { itemKey: 'ccap', title: '竞赛获奖(上限 10 分)', source: compItems.length + ' 条记录', score: compCap, note: compItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录' }, - { itemKey: 'kcap', title: '担任学生工作(上限 4 分)', source: workItems.length + ' 条记录', score: workCap, note: workItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录' }, - { itemKey: 'gcap', title: '公益活动(上限 3 分)', source: pubItems.length + ' 条记录', score: pubCap, note: pubItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录' }, + { itemKey: 'ccap', title: '竞赛获奖(上限 10 分)', source: compItems.length + ' 条记录', score: compCap, note: compItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录', recordIds: compItems.map(x => x.fromRecord).filter(Boolean) as number[] }, + { itemKey: 'kcap', title: '担任学生工作(上限 4 分)', source: workItems.length + ' 条记录', score: workCap, note: workItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录', recordIds: workItems.map(x => x.fromRecord).filter(Boolean) as number[] }, + { itemKey: 'gcap', title: '公益活动(上限 3 分)', source: pubItems.length + ' 条记录', score: pubCap, note: pubItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录', recordIds: pubItems.map(x => x.fromRecord).filter(Boolean) as number[] }, ])); // ---- 奖惩分(±5) ---- @@ -268,7 +270,7 @@ export function computeZongce(opts: { rwItems.push(mk('h' + rec.id, rec.title, source, auto, undefined, rec.id)); } const rwCap = round2(Math.max(Math.min(rwItems.reduce((a, x) => a + x.score, 0), 5), -5)); - sections.push(sec('rewards', '奖惩分', 5, [{ itemKey: 'hcap', title: '奖惩合计(±5 分)', source: rwItems.length + ' 条记录', score: rwCap, note: rwItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录' }])); + sections.push(sec('rewards', '奖惩分', 5, [{ itemKey: 'hcap', title: '奖惩合计(±5 分)', source: rwItems.length + ' 条记录', score: rwCap, note: rwItems.map(x => x.title + ' ' + x.score + '分').join(';') || '无匹配记录', recordIds: rwItems.map(x => x.fromRecord).filter(Boolean) as number[] }])); // 手动条目 for (const m of ov.manual ?? []) { diff --git a/app/src/pages/assessment/AssessmentPage.tsx b/app/src/pages/assessment/AssessmentPage.tsx index f20ae8b..2c546a7 100644 --- a/app/src/pages/assessment/AssessmentPage.tsx +++ b/app/src/pages/assessment/AssessmentPage.tsx @@ -261,7 +261,10 @@ export function AssessmentPage() { // 参与计分的记录 id(画廊中标注「计分」) const matchedSet = useMemo(() => { const s = new Set(); - result.sections.forEach(sec => sec.items.forEach(it => { if (it.fromRecord) s.add(it.fromRecord); })); + result.sections.forEach(sec => sec.items.forEach(it => { + if (it.fromRecord) s.add(it.fromRecord); + for (const rid of it.recordIds ?? []) s.add(rid); + })); return s; }, [result]); diff --git a/sync-server/www/assets/AdminPage-BqF0Bkw4.js b/sync-server/www/assets/AdminPage-DXoVmoIt.js similarity index 98% rename from sync-server/www/assets/AdminPage-BqF0Bkw4.js rename to sync-server/www/assets/AdminPage-DXoVmoIt.js index b342352..22c0084 100644 --- a/sync-server/www/assets/AdminPage-BqF0Bkw4.js +++ b/sync-server/www/assets/AdminPage-DXoVmoIt.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bmyzyg8t.js","assets/index-D9E2kUSE.css"])))=>i.map(i=>d[i]); -import{c as u,u as me,d as ue,$ as he,f as I,a0 as q,r as i,g as x,j as e,E as T,B as t,a1 as W,m,k as Z,a2 as pe,T as J,P as ve,I as b,l as je,H as Y,a3 as ge,a4 as ye,a5 as be,a6 as fe,a7 as ke,a8 as Ne,a9 as Ce,aa as _e,ab as we}from"./index-Bmyzyg8t.js";import{C as ee,a as se,b as ae}from"./card-Diwu5WOM.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-i50OZQTj.js","assets/index-D9E2kUSE.css"])))=>i.map(i=>d[i]); +import{c as u,u as me,d as ue,$ as he,f as I,a0 as q,r as i,g as x,j as e,E as T,B as t,a1 as W,m,k as Z,a2 as pe,T as J,P as ve,I as b,l as je,H as Y,a3 as ge,a4 as ye,a5 as be,a6 as fe,a7 as ke,a8 as Ne,a9 as Ce,aa as _e,ab as we}from"./index-i50OZQTj.js";import{C as ee,a as se,b as ae}from"./card-D8TWS3Zn.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -29,5 +29,5 @@ import{c as u,u as me,d as ue,$ as he,f as I,a0 as q,r as i,g as x,j as e,E as T * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const De=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],ie=u("UsersRound",De);function Pe({i:r}){return r.used_by&&r.holder_gone?e.jsx(m,{color:"var(--danger)",children:"已销户"}):r.used_by?e.jsx(m,{color:"var(--text-3)",children:"已使用"}):r.valid?e.jsx(m,{color:"var(--success)",children:"可用"}):e.jsx(m,{color:"var(--warning)",children:"已停用"})}function Ke(){var V,G,X,U;const r=me(),D=ue(),l=he(),f=I({queryKey:["me-admin"],queryFn:async()=>(await Ce(()=>import("./index-Bmyzyg8t.js").then(a=>a.an),__vite__mapDeps([0,1]))).serverMe(l),enabled:!!q()}),k=I({queryKey:["admin-users"],queryFn:()=>_e(l),enabled:!!q()}),N=I({queryKey:["admin-invites"],queryFn:()=>we(l),enabled:!!q()}),[P,d]=i.useState(""),[re,R]=i.useState(null),[le,C]=i.useState(!1),[v,_]=i.useState(""),[Q,w]=i.useState(""),[de,h]=i.useState(null),[z,S]=i.useState(""),[c,ce]=i.useState("all"),[n,j]=i.useState(null),[K,M]=i.useState(""),[oe,g]=i.useState(!1),y=()=>{r.invalidateQueries({queryKey:["admin-invites"]})},o=s=>d(s.message||"操作失败"),O=x({mutationFn:()=>Ne(l),onSuccess:s=>{var a,p;g(!1),d(""),D("success","演示账号已重建:"+(((a=s.seeded)==null?void 0:a.footprints)??0)+" 条记录 + "+(((p=s.seeded)==null?void 0:p.semesters)??0)+" 学期"),r.invalidateQueries({queryKey:["admin-users"]})},onError:o}),A=x({mutationFn:s=>ke(s,l),onSuccess:s=>{r.invalidateQueries({queryKey:["admin-users"]}),j(null),M(""),d(""),D("success","用户「"+s.username+"」及其全部数据已删除")},onError:o}),L=x({mutationFn:()=>ge(5,l),onSuccess:s=>{y(),d(""),navigator.clipboard.writeText(s.codes.join(` + */const De=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],ie=u("UsersRound",De);function Pe({i:r}){return r.used_by&&r.holder_gone?e.jsx(m,{color:"var(--danger)",children:"已销户"}):r.used_by?e.jsx(m,{color:"var(--text-3)",children:"已使用"}):r.valid?e.jsx(m,{color:"var(--success)",children:"可用"}):e.jsx(m,{color:"var(--warning)",children:"已停用"})}function Ke(){var V,G,X,U;const r=me(),D=ue(),l=he(),f=I({queryKey:["me-admin"],queryFn:async()=>(await Ce(()=>import("./index-i50OZQTj.js").then(a=>a.an),__vite__mapDeps([0,1]))).serverMe(l),enabled:!!q()}),k=I({queryKey:["admin-users"],queryFn:()=>_e(l),enabled:!!q()}),N=I({queryKey:["admin-invites"],queryFn:()=>we(l),enabled:!!q()}),[P,d]=i.useState(""),[re,R]=i.useState(null),[le,C]=i.useState(!1),[v,_]=i.useState(""),[Q,w]=i.useState(""),[de,h]=i.useState(null),[z,S]=i.useState(""),[c,ce]=i.useState("all"),[n,j]=i.useState(null),[K,M]=i.useState(""),[oe,g]=i.useState(!1),y=()=>{r.invalidateQueries({queryKey:["admin-invites"]})},o=s=>d(s.message||"操作失败"),O=x({mutationFn:()=>Ne(l),onSuccess:s=>{var a,p;g(!1),d(""),D("success","演示账号已重建:"+(((a=s.seeded)==null?void 0:a.footprints)??0)+" 条记录 + "+(((p=s.seeded)==null?void 0:p.semesters)??0)+" 学期"),r.invalidateQueries({queryKey:["admin-users"]})},onError:o}),A=x({mutationFn:s=>ke(s,l),onSuccess:s=>{r.invalidateQueries({queryKey:["admin-users"]}),j(null),M(""),d(""),D("success","用户「"+s.username+"」及其全部数据已删除")},onError:o}),L=x({mutationFn:()=>ge(5,l),onSuccess:s=>{y(),d(""),navigator.clipboard.writeText(s.codes.join(` `)).catch(()=>{})},onError:o}),E=x({mutationFn:()=>ye(v.trim(),Q.trim(),l),onSuccess:()=>{y(),C(!1),_(""),w(""),d("")},onError:o}),F=x({mutationFn:s=>be(s.id,s.patch,l),onSuccess:()=>{y(),h(null),d("")},onError:o}),xe=x({mutationFn:s=>fe(s,l),onSuccess:()=>{y(),d("")},onError:o}),$=i.useMemo(()=>{var s;return((s=N.data)==null?void 0:s.invites)??[]},[N.data]),B=i.useMemo(()=>$.filter(s=>c==="valid"?s.valid&&!s.used_by:c==="used"?!!s.used_by&&!s.holder_gone:c==="gone"?!!s.used_by&&!!s.holder_gone:c==="disabled"?!s.valid&&!s.used_by:!0),[$,c]);if(f.data&&!f.data.is_admin)return e.jsx(T,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const H=s=>{navigator.clipboard.writeText(s.code),R(s.id),setTimeout(()=>R(a=>a===s.id?null:a),1500)};return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"管理"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(t,{variant:"secondary",onClick:()=>g(!0),children:[e.jsx(ie,{size:13})," 重建演示账号"]}),e.jsxs(t,{variant:"secondary",onClick:()=>{r.invalidateQueries()},children:[e.jsx(Fe,{size:13})," 刷新"]})]})]}),P&&e.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-md border border-danger/30 bg-danger-subtle px-3 py-2 text-[12px] text-danger",children:[e.jsx("span",{children:P}),e.jsx("button",{className:"rounded p-0.5 hover:bg-surface-3",onClick:()=>d(""),"aria-label":"关闭",children:e.jsx(W,{size:13})})]}),e.jsxs(ee,{children:[e.jsx(se,{title:"用户管理("+(((V=k.data)==null?void 0:V.total)??0)+")",extra:e.jsx(ie,{size:14,className:"text-ink-3"})}),e.jsx(ae,{className:"p-0",children:e.jsxs("div",{className:"divide-y divide-line",children:[(((G=k.data)==null?void 0:G.users)??[]).map(s=>{var p;const a=String(s.id)===String(((p=f.data)==null?void 0:p.user_id)??"");return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13px] font-medium text-ink-1",children:s.username}),s.is_admin&&e.jsx(m,{color:"var(--brand-text)",children:"管理员"}),a&&e.jsx(m,{color:"var(--text-3)",children:"当前登录"})]}),e.jsxs("div",{className:"num mt-0.5 text-[11px] text-ink-3",children:[Z(s.created_at)," · 记录 ",s.records," · 附件 ",s.attachments,"(",pe(s.attachment_bytes||0),")"]})]}),!a&&e.jsxs(t,{size:"sm",variant:"ghost",className:"text-danger hover:bg-danger-subtle",onClick:()=>{j({id:s.id,username:s.username}),M("")},children:[e.jsx(J,{size:13})," 删除"]})]},s.id)}),!(((X=k.data)==null?void 0:X.users)??[]).length&&e.jsx(T,{title:"暂无用户"})]})})]}),e.jsxs(ee,{children:[e.jsx(se,{title:"邀请码("+(((U=N.data)==null?void 0:U.total)??0)+")",extra:e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(t,{size:"sm",variant:"secondary",onClick:()=>{C(s=>!s),d("")},children:[e.jsx(ve,{size:13})," 新建"]}),e.jsx(t,{size:"sm",variant:"primary",disabled:L.isPending,onClick:()=>L.mutate(),children:"批量生成 5 个"})]})}),e.jsxs(ae,{className:"p-0",children:[le&&e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b border-line bg-surface-2 px-4 py-3",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"邀请码(4-32 位字母数字-_)"}),e.jsx(b,{className:"w-[210px]",value:v,placeholder:"如 XIONG-2025",onChange:s=>_(s.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"备注(可选)"}),e.jsx(b,{className:"w-[180px]",value:Q,placeholder:"发给谁 / 用途",onChange:s=>w(s.target.value),onKeyDown:s=>{s.key==="Enter"&&v.trim()&&E.mutate()}})]}),e.jsxs("div",{className:"flex gap-1.5 pb-0.5",children:[e.jsx(t,{size:"sm",variant:"primary",disabled:!v.trim()||E.isPending,onClick:()=>E.mutate(),children:"创建"}),e.jsx(t,{size:"sm",variant:"ghost",onClick:()=>{C(!1),_(""),w("")},children:"取消"})]})]}),e.jsx("div",{className:"flex gap-1 border-b border-line px-4 py-2 text-[12px]",children:[["all","全部"],["valid","可用"],["used","已使用"],["gone","已销户"],["disabled","已停用"]].map(([s,a])=>e.jsx("button",{className:"rounded-md px-2.5 py-1 transition-colors "+(c===s?"bg-brand-subtle font-medium text-brand-text":"text-ink-3 hover:bg-surface-3"),onClick:()=>ce(s),children:a},s))}),B.length?e.jsx("div",{className:"divide-y divide-line max-h-[430px] overflow-y-auto",children:B.map(s=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[e.jsx("button",{className:"num shrink-0 cursor-pointer rounded-sm bg-surface-3 px-1.5 py-0.5 font-mono text-[12px] text-ink-1 transition-colors hover:bg-brand-subtle hover:text-brand-text",title:"点击复制",onClick:()=>H(s),children:re===s.id?e.jsxs("span",{className:"inline-flex items-center gap-1 text-success",children:[e.jsx(te,{size:11}),"已复制"]}):s.code}),e.jsx(Pe,{i:s}),de===s.id?e.jsxs("span",{className:"ml-1 flex min-w-0 flex-1 items-center gap-1",children:[e.jsx(b,{className:"h-7 flex-1 text-[12px]",value:z,autoFocus:!0,placeholder:"备注(64 字以内)",onChange:a=>S(a.target.value),onKeyDown:a=>{a.key==="Enter"&&F.mutate({id:s.id,patch:{remark:z}}),a.key==="Escape"&&h(null)}}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"保存备注",className:"text-success",onClick:()=>F.mutate({id:s.id,patch:{remark:z}}),children:e.jsx(te,{size:13})}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"取消",className:"text-ink-3",onClick:()=>h(null),children:e.jsx(W,{size:13})})]}):e.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-ink-3 hover:text-ink-2",title:s.remark?"点击编辑备注":s.created_by_name?"由 "+s.created_by_name+" 创建 · 点击添加备注":"点击添加备注",onClick:()=>{h(s.id),S(s.remark??"")},children:s.remark||(s.created_by_name?"由 "+s.created_by_name+" 创建":e.jsx("span",{className:"opacity-60",children:"添加备注…"}))}),s.used_by_name&&e.jsxs("span",{className:"shrink-0 text-ink-3",children:["被 ",s.used_by_name," 使用于 ",Z(s.used_at)]}),e.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"复制",className:"text-ink-3",onClick:()=>H(s),children:e.jsx(Me,{size:13})}),!s.used_by&&e.jsxs(e.Fragment,{children:[e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"编辑备注",className:"text-ink-3",onClick:()=>{h(s.id),S(s.remark??"")},children:e.jsx(je,{size:13})}),e.jsx(t,{size:"sm",variant:"ghost",className:s.valid?"text-ink-3 hover:text-warning":"text-ink-3 hover:text-success",onClick:()=>F.mutate({id:s.id,patch:{valid:!s.valid}}),children:s.valid?"停用":"启用"})]}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"删除",className:"text-ink-3 hover:text-danger",onClick:()=>{window.confirm("删除邀请码 "+s.code+"?此操作不可恢复。")&&xe.mutate(s.id)},children:e.jsx(J,{size:13})})]})]},s.id))}):e.jsx(T,{icon:e.jsx(qe,{size:32,strokeWidth:1.5}),title:"暂无符合条件的邀请码",description:"新建自定义邀请码,或批量生成后发给需要注册的用户。"})]})]}),e.jsx(Y,{open:!!n,onClose:()=>j(null),width:460,title:"删除用户(高危操作)",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"ghost",onClick:()=>j(null),children:"取消"}),e.jsxs(t,{variant:"primary",className:"!bg-danger !text-white",disabled:K!==(n==null?void 0:n.username)||A.isPending,onClick:()=>n&&A.mutate(n.id),children:[e.jsx(ne,{size:13})," 永久删除"]})]}),children:e.jsxs("div",{className:"flex flex-col gap-3 text-[12.5px]",children:[e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-danger/30 bg-danger-subtle px-3 py-2.5 text-danger",children:[e.jsx(ne,{size:15,className:"mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("b",{children:"此操作不可撤销!"}),"将永久删除用户「",n==null?void 0:n.username,"」的全部数据:",e.jsxs("ul",{className:"mt-1 list-disc pl-4 text-[12px] leading-relaxed",children:[e.jsx("li",{children:"账号与登录会话(所有设备将被登出)"}),e.jsx("li",{children:"全部记录、成绩、维度与统计数据"}),e.jsx("li",{children:"全部附件文件(服务器本地与图床 COS 上的副本)"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 text-ink-2",children:["请输入用户名 ",e.jsx("b",{className:"text-danger",children:n==null?void 0:n.username})," 以确认:"]}),e.jsx(b,{value:K,onChange:s=>M(s.target.value),placeholder:(n==null?void 0:n.username)??"",autoFocus:!0})]})]})}),e.jsx(Y,{open:oe,onClose:()=>g(!1),width:440,title:"重建演示账号",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"ghost",onClick:()=>g(!1),children:"取消"}),e.jsx(t,{variant:"primary",disabled:O.isPending,onClick:()=>O.mutate(),children:"重建并重新播种"})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将",e.jsx("b",{children:"删除现有 demo 账号及其全部数据"}),",然后重新创建并播种全套虚拟演示数据 (个人信息档案、25 条足迹(含 10 项竞赛获奖与证书附件)、4 学期学科成绩、简历内容)。",e.jsx("div",{className:"mt-2 text-ink-3",children:"demo / demo1234 · 仅影响演示账号,其他用户不受影响。"})]})})]})}export{Ke as AdminPage}; diff --git a/sync-server/www/assets/AssessmentPage-CIzQ48Ah.js b/sync-server/www/assets/AssessmentPage-CIzQ48Ah.js deleted file mode 100644 index ab9bfbf..0000000 --- a/sync-server/www/assets/AssessmentPage-CIzQ48Ah.js +++ /dev/null @@ -1,27 +0,0 @@ -import{c as ve,d as Ce,f as pe,r as k,ai as ke,aj as Se,j as e,S as _e,B,ak as xe,ah as ze,m as me,H as fe,af as Oe,ag as Me,v as Ie,M as Fe}from"./index-Bmyzyg8t.js";import{R as he,P as Ke,C as Ee}from"./rotate-ccw-DBQnyfoK.js";/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Re=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Te=ve("ChevronLeft",Re);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Le=[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]],De=ve("Images",Le),be={politics:{中共党员:3,中共预备党员:2.5,入党积极分子:2,共青团员:1.5,群众:1},conductDefault:8,integrityDefault:2,sportsFactor:.025,gpaFactor:10,table2:{国家级:{一等奖:3,二等奖:2,三等奖:1,优秀奖:.5},省市级:{一等奖:2,二等奖:1,三等奖:.5,优秀奖:.2},区县级:{一等奖:1,二等奖:.5,三等奖:.2,优秀奖:.1},校级:{一等奖:.5,二等奖:.2,三等奖:.1,优秀奖:.05},二级学院:{一等奖:.2,二等奖:.1,三等奖:.05,优秀奖:0}},table4:{校级:{干部:4,干事:2,社团干部:1,学工助理:2},院级:{干部:3,干事:1.5,支部委员:1.5,支部组长:1,班长:1,团支书:1,班委:.5,社团干部:1,学工助理:2}},publicGood:{无偿献血:.5,捐献骨髓:3,国家级:1.5,省市级:1,区县级:.5,校级:.2,二级学院:.1},rewards:{荣誉称号:{院级:.3,校级:.5,区级:1,市级:1.5,国家级:2},英语等级:{三级:.5,四级:1,六级:2},计算机等级:{一级:.5,二级:1,三级:2},职业资格:{从业资格:.5,初级:1,中级:2,高级:3}},penalties:{留校察看:5,记过:4,严重警告:3,警告:2,通报批评:1}};function ie(i){const l=/^(\d{4})-(\d{4})/.exec(String(i??"").trim());return l?l[1]+"-"+l[2]:null}function we(i){const l=/^(\d{4})-(\d{4})$/.exec(i);return l?[l[1]+"-09-01",l[2]+"-09-01"]:null}function ue(i,l){const m=ie(i)??i,b=/^(\d{4})/.exec(m),y=/^(\d{4})/.exec(l??"");if(!b||!y)return m+" 学年";const a=Number(b[1])-Number(y[1])+1,h=["大一","大二","大三","大四","大五","大六","大七"];return a<1?m+" 学年":(h[a-1]??a+"年级")+"("+m+" 学年)"}function We(i,l){if(!l)return!0;const m=(i??"").slice(0,10);return m>=l[0]&&mMath.round(i*100)/100;function ye(i,l,m){var y;return!l||!m?null:((y=i.table2[l])==null?void 0:y[m])??null}function Ge(i){var x,M,G,X;const{year:l,records:m,semesters:b,bands:y,weights:a,profile:h,rules:o,ov:w}=i,C=l==="all"?null:we(l),f=m.filter(t=>t.status!=="draft"&&We(t.start_date??t.created_at,C)),j=t=>{var n;return(n=w.itemOverrides)==null?void 0:n[t]},v=(t,n,d,p,N,U)=>{const K=j(t),Ne=(K==null?void 0:K.score)??p??0;return{itemKey:t,title:n,source:d,score:Ne,overridden:(K==null?void 0:K.score)!=null,note:N,fromRecord:U}},F=(t,n,d,p)=>({key:t,label:n,cap:d,items:p,subtotal:E(p.reduce((N,U)=>N+U.score,0))}),S=[],ee=h.political??"",Z=Object.keys(o.politics).find(t=>ee.includes(t)),u=Z?o.politics[Z]:1,R=w.conduct??o.conductDefault,_=w.integrity??o.integrityDefault;S.push(F("conduct","品行素质",13,[{itemKey:"politics",title:"思想政治基础分("+(ee||"群众")+")",source:"个人信息 · 政治面貌",score:u},{itemKey:"conduct",title:"操行考评成绩",source:"辅导员考评(可修改)",score:R,overridden:w.conduct!=null},{itemKey:"integrity",title:"诚信分",source:"默认满分(可修改)",score:_,overridden:w.integrity!=null}]));const O=t=>{if(t.grade_point!=null)return t.grade_point;if(y&&t.score!=null){const n=y.find(d=>t.score>=d.min&&(t.score=100&&t.score<=d.max));if(n&&n.gp!=null){if(n.gpTop!=null){const d=n.max>=100?n.max:n.max-1,p=(n.gpTop-n.gp)/Math.max(1,d-n.min);return E(n.gp+(t.score-n.min)*p)}return n.gp}}return null},V=t=>a?a[t.category??"其他"]??a.其他??1:1,P=ie(l),q=b.filter(t=>!P||ie(t.term)===P),A=[],D=[];for(const t of q){if(A.push(...t.courses??[]),t.gpa!=null){D.push({term:t.term,gpa:t.gpa,fallback:!1});continue}const n=(t.courses??[]).map(p=>({...p,grade_point:O(p)})).filter(p=>p.grade_point!=null&&p.credit>0);if(!n.length)continue;const d=n.reduce((p,N)=>p+N.credit,0);D.push({term:t.term,gpa:E(n.reduce((p,N)=>p+N.grade_point*V(N)*N.credit,0)/d),fallback:!0})}const T=D.length?E(D.reduce((t,n)=>t+n.gpa,0)/D.length):null,ae=T==null?"该学年暂无学期绩点数据(先在「成绩」页录入学期或课程)":D.some(t=>t.fallback)?"部分学期绩点未录入,按课程推算":void 0,ce=T!=null?E(T*o.gpaFactor):0;S.push(F("academic","学业成绩",60,[{itemKey:"gpa",title:"学年平均学分绩点 "+(T!=null?T.toFixed(2):"—")+" × "+o.gpaFactor,source:"成绩模块 · "+q.length+" 学期"+(D.length?"(绩点均值)":""),score:ce,note:ae||(T==null?void 0:A.length+" 门课程")}]));const W=A.filter(t=>/体育/.test(t.course_name)),te=E(W.reduce((t,n)=>t+(n.score??0),0)*o.sportsFactor),re=[];W.length&&re.push({itemKey:"sports",title:"体育成绩("+W.length+" 学期体育课)",source:"体育课成绩之和 × "+o.sportsFactor,score:Math.min(te,5)});const z=[];for(const t of f.filter(n=>n.type_name==="文体活动")){const n=ye(o,ne(t.level),ge(t.award_grade));n==null&&!((x=j("w"+t.id))!=null&&x.score)||z.push(v("w"+t.id,t.title,t.type_name+" · "+(t.level??"")+" "+(t.award_grade??""),n,void 0,t.id))}const de=E(Math.min(z.reduce((t,n)=>t+n.score,0),5));S.push(F("sports","文体素质",10,[...re,{itemKey:"wcap",title:"文体类加分(上限 5 分)",source:z.length+" 条记录",score:de,note:z.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录"}]));const se=[];for(const t of f.filter(n=>n.type_name==="竞赛"||n.type_name==="科研")){const n=ye(o,ne(t.level),ge(t.award_grade));n==null&&!((M=j("c"+t.id))!=null&&M.score)||se.push(v("c"+t.id,t.title,t.type_name+" · "+(t.level??"")+" "+(t.award_grade??""),n,void 0,t.id))}const J=E(Math.min(se.reduce((t,n)=>t+n.score,0),10)),Q=[];for(const t of f.filter(n=>n.type_name==="学生工作")){const n=ne(t.level)??"院级",d=(t.role??"")+" "+t.title,p=o.table4[n==="国家级"||n==="省市级"||n==="区县级"?"校级":n]??o.table4.院级;let N=null;for(const[U,K]of Object.entries(p))if(d.includes(U)){N=K;break}N==null&&!((G=j("k"+t.id))!=null&&G.score)||Q.push(v("k"+t.id,t.title,"学生工作 · "+(t.level??"院级")+" "+(t.role??""),N,N==null?"请手动填写分值":void 0,t.id))}const Y=E(Math.min(Q.reduce((t,n)=>t+n.score,0),4)),$=[];for(const t of f.filter(n=>n.type_name==="志愿公益")){const n=ne(t.level),d=/献血/.test(t.title);let p=d?o.publicGood.无偿献血:n?o.publicGood[n]??null:null;p==null&&!((X=j("g"+t.id))!=null&&X.score)||$.push(v("g"+t.id,t.title,"公益 · "+(d?"无偿献血":t.level??"校级"),p,void 0,t.id))}const oe=E(Math.min($.reduce((t,n)=>t+n.score,0),3));S.push(F("expand","拓展性素质",17,[{itemKey:"ccap",title:"竞赛获奖(上限 10 分)",source:se.length+" 条记录",score:J,note:se.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录"},{itemKey:"kcap",title:"担任学生工作(上限 4 分)",source:Q.length+" 条记录",score:Y,note:Q.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录"},{itemKey:"gcap",title:"公益活动(上限 3 分)",source:$.length+" 条记录",score:oe,note:$.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录"}]));const s=[];for(const t of f.filter(n=>n.type_name==="荣誉惩处"||n.type_name==="证书技能")){const n=j("h"+t.id),d=t.title+" "+(t.award_grade??"");if(/综合测评奖学金/.test(d))continue;let p=null,N=t.type_name;if(/留校察看/.test(d))p=-o.penalties.留校察看;else if(/记过/.test(d))p=-o.penalties.记过;else if(/严重警告/.test(d))p=-o.penalties.严重警告;else if(/警告/.test(d))p=-o.penalties.警告;else if(/通报批评/.test(d))p=-o.penalties.通报批评;else if(/六级|专八/.test(d))p=o.rewards.英语等级.六级;else if(/四级|专四/.test(d))p=o.rewards.英语等级.四级;else if(/三级/.test(d)&&/英语/.test(d))p=o.rewards.英语等级.三级;else if(/计算机/.test(d)&&/三级/.test(d))p=o.rewards.计算机等级.三级;else if(/计算机/.test(d)&&/二级/.test(d))p=o.rewards.计算机等级.二级;else if(/计算机/.test(d)&&/一级/.test(d))p=o.rewards.计算机等级.一级;else if(/高级/.test(d))p=o.rewards.职业资格.高级;else if(/中级/.test(d))p=o.rewards.职业资格.中级;else if(/初级/.test(d))p=o.rewards.职业资格.初级;else if(/从业|资格证|教师资格|普通话|驾驶证|软考/.test(d))p=o.rewards.职业资格.从业资格;else{const U=ne(t.level),K=U==="省市级"?"市级":U==="区县级"?"区级":U==="二级学院"?"院级":U;K&&o.rewards.荣誉称号[K]!=null&&(p=o.rewards.荣誉称号[K],N="荣誉 · "+K)}p==null&&!(n!=null&&n.score)||s.push(v("h"+t.id,t.title,N,p,void 0,t.id))}const r=E(Math.max(Math.min(s.reduce((t,n)=>t+n.score,0),5),-5));S.push(F("rewards","奖惩分",5,[{itemKey:"hcap",title:"奖惩合计(±5 分)",source:s.length+" 条记录",score:r,note:s.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录"}]));for(const t of w.manual??[]){const n=S.find(d=>d.label===t.section)??S[S.length-1];n.items.push({itemKey:"m"+t.title+t.score,title:t.title,source:"手动添加",score:t.score}),n.subtotal=E(n.items.reduce((d,p)=>d+p.score,0))}const c=E(S.reduce((t,n)=>{const d=n.key==="rewards"?n.subtotal:Math.min(n.subtotal,n.cap);return t+d},0));return{sections:S,total:c,gpa:T}}function I(i){return String(i??"").replace(/&/g,"&").replace(//g,">")}function Ue(i,l){var y;const m="----=_fp_zongce",b=[];b.push(`MIME-Version: 1.0\r -Content-Type: multipart/related; type="text/html"; boundary="`+m+`"\r -\r ---`+m+`\r -Content-Location: document.html\r -Content-Type: text/html; charset="utf-8"\r -Content-Transfer-Encoding: 8bit\r -\r -`+i+`\r -`);for(const a of l){const h=a.dataUri.indexOf(","),o=a.dataUri.slice(0,h),w=a.dataUri.slice(h+1),C=((y=/data:([^;]+)/.exec(o))==null?void 0:y[1])??"image/png";b.push("--"+m+`\r -Content-Location: `+a.name+`\r -Content-Type: `+C+`\r -Content-Transfer-Encoding: base64\r -\r -`+w+`\r -`)}return b.push("--"+m+`--\r -`),new Blob([b.join("")],{type:'multipart/related; type="text/html"; boundary="'+m+'"'})}const g="border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:10.5pt;vertical-align:middle",L='border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:10.5pt;font-family:"黑体",SimHei;letter-spacing:1pt;vertical-align:middle;background:#eef1f6',He='border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:11pt;font-family:"黑体",SimHei;letter-spacing:1.5pt;background:#f5f6f9;text-align:left',je=(i,l)=>''+l+'';function qe(i){const l='
基础项分值 / 规则
政治面貌分'+I(Object.entries(i.politics).map(([f,j])=>f+" "+j+" 分").join(";"))+'
操行考评 / 诚信分默认'+I(i.conductDefault)+" 分 / "+I(i.integrityDefault)+' 分
学业成绩学年平均学分绩点 × '+I(i.gpaFactor)+'(上限 60 分)
体育加分体育课成绩之和 × '+I(i.sportsFactor)+'(上限 5 分)
公益服务'+I(Object.entries(i.publicGood).map(([f,j])=>f+" "+j).join(";"))+"
",m=i.table2,b=i.table4,y=i.rewards,a=Object.keys(m),h=["一等奖","二等奖","三等奖","优秀奖"],o=''+h.map(f=>'").join("")+""+a.map(f=>'"+h.map(j=>{var v;return'"}).join("")+"").join("")+"
获奖级别'+f+"
'+I(f)+"'+I(((v=m[f])==null?void 0:v[j])??"—")+"
",w=''+Object.keys(b).map(f=>'").join("")+"
学生工作级别岗位分值
'+I(f)+''+I(Object.entries(b[f]).map(([j,v])=>j+" "+v).join(";"))+"
",C=''+["荣誉称号","英语等级","计算机等级","职业资格"].map(f=>'").join("")+'
类别分值
'+I(f)+''+I(Object.entries(y[f]??{}).map(([j,v])=>j+" "+v).join(";"))+"
违纪扣分'+I(Object.entries(i.penalties).map(([f,j])=>f+" -"+j).join(";"))+"
";return'
附 2:评分细则参考(默认值,可自行调整)
'+l+o+w+C}function Ae(i,l,m,b,y){const a=u=>I(u),h=m.school?'
'+a(m.school)+"
":"",o=(u,R)=>''+R+''+a(u||"")+"",w=["一","二","三","四","五","六","七","八"],C=[];l.sections.forEach((u,R)=>{const _=u.key==="rewards"?u.subtotal:Math.min(u.subtotal,u.cap);C.push(''+a(w[R]??R+1)+"、"+a(u.label)+"(上限 "+a(u.cap)+" 分)");for(const O of u.items)C.push(''+a(O.title)+(O.overridden?'(已手动修正)':"")+''+a(O.note||O.source)+''+a(O.score)+"");C.push(''+a(u.label)+'小计'+a(_)+"")}),C.push('综合素质测评总分'+a(l.total)+"");const f=''+C.join("")+"
考评项目评分依据分值
",j=[];let v=0;const F=b.map(u=>{const R=u.images.map(_=>{v++;const O="ev"+u.recordId+"_"+j.length;return j.push({name:O,dataUri:_}),'
附图
图 '+v+" "+a(u.title)+"
"}).join("");return''+a(u.title)+'
'+a(u.meta)+''+R+""}).join(""),S=F?'
附 1:加分证明材料
('+a(b.length)+" 项记录 · "+a(v)+' 张材料图)
'+F+"
":"",ee=''+o(m.studentId,"学 号")+o(m.name,"姓 名")+o(m.gender,"性 别")+""+o(m.college,"学 院")+o(m.major,"专 业")+o(m.className,"班 级")+""+o(m.political,"政治面貌")+o(i,"统计周期")+o(m.phone,"电话号码")+"
",Z='学生综合素质测评表
'+h+'

学生综合素质测评表

测评学年:'+a(i)+"

"+ee+f+S+qe(y)+'
学生签名:_____班长签名:_____辅导员签名:_____日期:______

说明:本表依据《学生综合素质测评评分细则》自动生成(细则默认值见附 2,可自行调整);带「已手动修正」标记的分值为手动核定结果。导出前请核对加分记录与证明材料一致。

第 '+je("PAGE","1")+" 页(共 "+je("NUMPAGES","1")+" 页)

";return Ue(Z,j)}const H=({value:i,onChange:l,wide:m})=>e.jsx("input",{type:"number",step:"0.05",className:"num rounded-md border border-neutral-200 bg-white px-1 py-0.5 text-right text-[11.5px] focus:border-brand focus:outline-none "+(m?"w-[76px]":"w-[58px]"),value:i,onChange:b=>l(b.target.value===""?0:Number(b.target.value))}),le=({head:i,children:l})=>e.jsxs("table",{className:"w-full border border-neutral-200 text-[11.5px]",children:[e.jsx("thead",{children:e.jsx("tr",{children:i.map((m,b)=>e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:m},b))})}),e.jsx("tbody",{children:l})]});function Ze(){var $,oe;const i=Ce(),l=pe({queryKey:["profile"],queryFn:Me}),m=pe({queryKey:["zc-records"],queryFn:()=>Ie({page:1,page_size:500})}),b=pe({queryKey:["grades"],queryFn:Fe}),y=($=l.data)==null?void 0:$.content,a={...(y==null?void 0:y.info)??{}},[h,o]=k.useState(""),[w,C]=k.useState({}),[f,j]=k.useState([]),[v,F]=k.useState(!1),[S,ee]=k.useState(!1),Z=k.useRef(null),[u,R]=k.useState(be),[_,O]=k.useState(null);k.useEffect(()=>{var s,r;y&&(C(((s=y.zongce)==null?void 0:s.overrides)??{}),(r=y.zongce)!=null&&r.rules&&R(y.zongce.rules))},[y]);const V=((oe=m.data)==null?void 0:oe.items)??[],P=k.useMemo(()=>{var s;return Array.from(new Set((((s=b.data)==null?void 0:s.semesters)??[]).map(r=>ie(r.term)).filter(Boolean))).sort()},[b.data]);k.useEffect(()=>{var s;y&&(C(((s=y.zongce)==null?void 0:s.overrides)??{}),!h&&P.length&&o(P[0]))},[y,b.data]);const q=w[h]??{},A=k.useMemo(()=>{var s,r,c;return Ge({year:h||"all",records:V,semesters:((s=b.data)==null?void 0:s.semesters)??[],bands:(r=b.data)==null?void 0:r.bands,weights:(c=b.data)==null?void 0:c.weights,profile:a,rules:u,ov:q})},[V,b.data,a,u,q,h]),D=a.eduStart||(P.length?P[0]+"-09":""),T=h==="all"||!h?"全部学年":ue(h,D),ae=k.useMemo(()=>{const s=h&&h!=="all"?we(h):null;return V.filter(r=>{if(r.status==="draft")return!1;if(!s)return!0;const c=(r.start_date??r.created_at??"").slice(0,10);return c>=s[0]&&cr.id)},[V,h]),ce=k.useMemo(()=>{const s=new Set;return A.sections.forEach(r=>r.items.forEach(c=>{c.fromRecord&&s.add(c.fromRecord)})),s},[A]);k.useEffect(()=>{let s=!0;return(async()=>{const r=[];for(const c of ae){const x=V.find(M=>M.id===c);try{const M=await ke(c),G=[];for(const X of M.items.filter(t=>t.id&&(t.mime??"").startsWith("image/"))){const t=await Se(X.id);t.data_b64&&G.push("data:"+(X.mime==="image/jpeg"?"image/jpeg":"image/webp")+";base64,"+t.data_b64)}if(G.length){const X=[x==null?void 0:x.type_name,x==null?void 0:x.level,x==null?void 0:x.award_grade].filter(Boolean).join(" · ");r.push({recordId:c,title:(x==null?void 0:x.title)??"记录 "+c,meta:X,images:G})}}catch{}}s&&j(r)})(),()=>{s=!1}},[ae.join(",")]);const W=k.useMemo(()=>{const s=[];for(const r of f)for(const c of r.images)s.push({src:c,title:r.title});return s},[f]),te=s=>void Oe({info:a,zongce:{rules:s.rules??u,overrides:s.overrides??w}}).catch(r=>i("error",r.message)),re=s=>{C(r=>({...r,[h]:s})),te({overrides:{...w,[h]:s}})},z=s=>{const r=JSON.parse(JSON.stringify(u));s(r),R(r),te({rules:r})},de=()=>{const s=JSON.parse(JSON.stringify(be));R(s),te({rules:s}),i("success","评分细则已恢复默认")},se=()=>{const s=Ae(T,A,a,f,u),r=URL.createObjectURL(s),c=document.createElement("a");c.href=r,c.download="综合素质测评_"+T+".doc",c.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4),i("success","综测表已导出(.doc,附证明材料图 "+W.length+" 张 + 细则参考)")},J=_?W.findIndex(s=>s.src===_.src):-1,Q=s=>{const r=J+s;r>=0&&ro(s.target.value),options:[...P.map(s=>({value:s,label:ue(s,D)})),{value:"all",label:"全部学年"}]}),e.jsxs(B,{variant:"secondary",onClick:()=>{const s=!S;ee(s),s&&setTimeout(()=>{var r;return(r=Z.current)==null?void 0:r.scrollIntoView({behavior:"smooth",block:"start"})},80)},children:[e.jsx(xe,{size:13})," 评分细则参考"]}),e.jsxs(B,{variant:"secondary",onClick:se,children:[e.jsx(ze,{size:13})," 导出 Word"]}),e.jsxs(B,{variant:"secondary",onClick:()=>F(!0),children:[e.jsx(he,{size:13})," 初始化"]}),e.jsxs(B,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(Ke,{size:13})," 打印"]})]})]}),S&&e.jsxs("div",{ref:Z,className:"no-print mb-4 scroll-mt-16 rounded-xl border border-line bg-white p-4 shadow-card",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{size:15,className:"text-neutral-500"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:"评分细则参考"}),e.jsx("span",{className:"text-[11.5px] text-neutral-400",children:"默认值可自行调整,调整后即时生效并随档案保存"})]}),e.jsxs(B,{variant:"ghost",onClick:de,children:[e.jsx(he,{size:13})," 恢复默认"]})]}),e.jsxs("div",{className:"mt-3 grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-neutral-600",children:"基础分值"}),e.jsxs(le,{head:["项目","分值"],children:[Object.entries(u.politics).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:r,onChange:c=>z(x=>{x.politics[s]=c})})})]},s)),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"操行考评默认分"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:u.conductDefault,onChange:s=>z(r=>{r.conductDefault=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"诚信分默认"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:u.integrityDefault,onChange:s=>z(r=>{r.integrityDefault=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"学业成绩(绩点 ×)"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:u.gpaFactor,onChange:s=>z(r=>{r.gpaFactor=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"体育加分(成绩 ×)"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:u.sportsFactor,onChange:s=>z(r=>{r.sportsFactor=s})})})]})]}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"公益服务"}),e.jsx(le,{head:["项目","分值"],children:Object.entries(u.publicGood).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:r,onChange:c=>z(x=>{x.publicGood[s]=c})})})]},s))}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"违纪扣分"}),e.jsx(le,{head:["项目","扣分"],children:Object.entries(u.penalties).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:r,onChange:c=>z(x=>{x.penalties[s]=c})})})]},s))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-neutral-600",children:"竞赛 / 文体奖项加分(级别 × 奖项)"}),e.jsxs("table",{className:"w-full border border-neutral-200 text-[11.5px]",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:"级别"}),["一等奖","二等奖","三等奖","优秀奖"].map(s=>e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:s},s))]})}),e.jsx("tbody",{children:Object.entries(u.table2).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1 font-medium text-neutral-700",children:s}),["一等奖","二等奖","三等奖","优秀奖"].map(c=>e.jsx("td",{className:"border-b border-neutral-100 px-1 py-1",children:e.jsx(H,{value:r[c]??0,onChange:x=>z(M=>{M.table2[s][c]=x})})},c))]},s))})]}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"学生工作"}),e.jsx(le,{head:["级别 / 岗位","分值"],children:Object.entries(u.table4).flatMap(([s,r])=>Object.entries(r).map(([c,x])=>e.jsxs("tr",{children:[e.jsxs("td",{className:"border-b border-neutral-100 px-2 py-1",children:[s," · ",c]}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:x,onChange:M=>z(G=>{G.table4[s][c]=M})})})]},s+c)))}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"荣誉与证照加分"}),e.jsx(le,{head:["类别 / 等级","分值"],children:Object.entries(u.rewards).flatMap(([s,r])=>Object.entries(r).map(([c,x])=>e.jsxs("tr",{children:[e.jsxs("td",{className:"border-b border-neutral-100 px-2 py-1",children:[s," · ",c]}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(H,{value:x,onChange:M=>z(G=>{G.rewards[s][c]=M})})})]},s+c)))})]})]})]}),e.jsxs("div",{className:"print-sheet mx-auto w-full max-w-[820px] rounded-xl border border-line bg-white shadow-card sm:p-8",children:[a.school&&e.jsx("div",{className:"text-center text-[11px] tracking-widest text-neutral-500",children:a.school}),e.jsx("h1",{className:"mt-0.5 text-center text-[19px] font-bold tracking-wide text-neutral-900",children:"学生综合素质测评表"}),e.jsxs("div",{className:"mt-1 text-center text-[12px] text-neutral-500",children:["测评学年:",T]}),e.jsx("div",{className:"mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-neutral-300 bg-neutral-300 text-[12.5px] sm:grid-cols-3",children:[["学 号",a.studentId],["姓 名",a.name],["性 别",a.gender],["学 院",a.college],["专 业",a.major],["班 级",a.className],["政治面貌",a.political],["统计周期",T],["电话号码",a.phone]].map(([s,r])=>e.jsxs("div",{className:"flex bg-white",children:[e.jsx("span",{className:"w-[62px] shrink-0 bg-neutral-50 px-2 py-1.5 font-medium text-neutral-500",children:s}),e.jsx("span",{className:"min-w-0 flex-1 truncate px-2 py-1.5 text-neutral-900",children:r||"—"})]},s))}),e.jsxs("div",{className:"mt-4 flex items-center justify-center rounded-lg bg-gradient-to-r from-neutral-900 to-neutral-700 px-4 py-2.5 text-white",children:[e.jsx("span",{className:"text-[12px] opacity-80",children:"综合素质测评总分"}),e.jsx("span",{className:"num ml-3 text-[26px] font-bold leading-none",children:A.total}),e.jsx("span",{className:"ml-1.5 text-[12px] opacity-80",children:"/ 100 分"})]}),A.sections.map(s=>e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-4 w-1 rounded-full bg-brand"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:s.label}),e.jsxs(me,{className:"no-print",color:"var(--text-3)",children:["上限 ",s.cap," 分"]})]}),e.jsxs("span",{className:"num rounded-md bg-neutral-100 px-2 py-0.5 text-[12px] font-semibold text-neutral-700",children:["小计 ",s.key==="rewards"?s.subtotal:Math.min(s.subtotal,s.cap)]})]}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 rounded-lg border border-neutral-200 bg-neutral-50/60 p-3",children:[s.items.map(r=>e.jsxs("div",{className:"flex items-center gap-2 text-[12.5px]",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-neutral-900",children:r.title}),e.jsx("span",{className:"ml-2 text-[11px] text-neutral-400",children:r.source}),r.note&&e.jsx("div",{className:"text-[11px] leading-relaxed text-neutral-400",children:r.note})]}),e.jsx("input",{type:"number",step:"0.1",className:"num w-[72px] rounded-md border border-neutral-200 bg-white px-1.5 py-0.5 text-right text-[12px] focus:border-brand focus:outline-none",value:r.score,onChange:c=>{var x;if(r.itemKey==="conduct"||r.itemKey==="integrity")re({...q,[r.itemKey]:Number(c.target.value)});else{const M={...q.itemOverrides??{},[r.itemKey]:{...((x=q.itemOverrides)==null?void 0:x[r.itemKey])??{},score:Number(c.target.value)}};re({...q,itemOverrides:M})}}})]},r.itemKey)),!s.items.length&&e.jsx("div",{className:"text-[12px] text-neutral-400",children:"暂无数据"})]})]},s.key)),(f.length>0||Y>0)&&e.jsxs("div",{className:"mt-7",children:[e.jsx("div",{className:"flex items-center justify-between border-t border-neutral-200 pt-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{size:15,className:"text-neutral-500"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:"附:加分证明材料"}),e.jsxs("span",{className:"text-[11.5px] text-neutral-400",children:["共 ",f.length," 项记录 · ",Y," 张图片(点击可放大)"]})]})}),e.jsx("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",children:f.map(s=>e.jsxs("div",{className:"rounded-lg border border-neutral-200 bg-white p-2.5 transition-shadow hover:shadow-md",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[ce.has(s.recordId)?e.jsx(me,{color:"var(--brand-text)",children:"计分"}):e.jsx(me,{className:"no-print",color:"var(--text-3)",children:"未计分"}),e.jsx("div",{className:"min-w-0 truncate text-[12.5px] font-semibold text-neutral-800",children:s.title})]}),e.jsx("div",{className:"shrink-0 text-[10.5px] text-neutral-400",children:s.meta})]}),e.jsx("div",{className:"mt-2 gap-2 "+(s.images.length>1?"grid grid-cols-2":"flex"),children:s.images.map((r,c)=>e.jsx("button",{onClick:()=>O({src:r,title:s.title,index:W.findIndex(x=>x.src===r)}),className:"group overflow-hidden rounded-md border border-neutral-200 bg-neutral-50",children:e.jsx("img",{src:r,alt:"证明 "+(c+1),className:"aspect-[4/3] w-full object-cover transition-transform group-hover:scale-[1.03]"})},c))})]},s.recordId))})]}),e.jsx("div",{className:"mt-6 border-t border-neutral-200 pt-3 text-[11px] leading-relaxed text-neutral-400",children:"计分依据:《学生综合素质测评评分细则》(默认值可在上方「评分细则参考」查看与修改)。 自动匹配条目均可手动修正分值;「初始化」清除本学年全部手动修正。导出 Word / 打印前请核对加分记录与证明材料一致。"})]}),e.jsx(fe,{open:!!_,onClose:()=>O(null),width:920,title:_?_.title+"("+(J+1)+"/"+Y+")":"",footer:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs(B,{variant:"secondary",disabled:J<=0,onClick:()=>Q(-1),children:[e.jsx(Te,{size:13})," 上一张"]}),e.jsx("span",{className:"num text-[12px] text-ink-3",children:_?J+1+" / "+Y:""}),e.jsxs(B,{variant:"primary",disabled:J>=Y-1,onClick:()=>Q(1),children:["下一张 ",e.jsx(Ee,{size:13})]})]}),children:_&&e.jsx("img",{src:_.src,alt:_.title,className:"mx-auto max-h-[74vh] rounded-md"})}),e.jsx(fe,{open:v,onClose:()=>F(!1),width:440,title:"初始化综测",footer:e.jsxs(e.Fragment,{children:[e.jsx(B,{variant:"ghost",onClick:()=>F(!1),children:"取消"}),e.jsx(B,{variant:"primary",onClick:()=>{const s={...w};delete s[h],C(s),te({overrides:s}),F(!1),i("success","已恢复自动计算")},children:"恢复自动计算"})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将清除 ",e.jsx("b",{children:h==="all"||!h?"全部学年":ue(h,D)})," 的全部手动修正 (分值覆盖、操行/诚信分修改),恢复为按细则规则的自动计算结果。",e.jsx("div",{className:"mt-2 text-ink-3",children:"记录数据、个人信息与评分细则不受影响。"})]})})]})}export{Ze as AssessmentPage}; diff --git a/sync-server/www/assets/AssessmentPage-zL5UB5l9.js b/sync-server/www/assets/AssessmentPage-zL5UB5l9.js new file mode 100644 index 0000000..59176dc --- /dev/null +++ b/sync-server/www/assets/AssessmentPage-zL5UB5l9.js @@ -0,0 +1,27 @@ +import{c as ve,d as Ce,f as pe,r as S,ai as ke,aj as Se,j as e,S as _e,B as A,ak as xe,ah as ze,m as me,H as fe,af as Oe,ag as Ie,v as Me,M as Re}from"./index-i50OZQTj.js";import{R as he,P as Fe,C as Ke}from"./rotate-ccw-C9On11h9.js";/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ee=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Te=ve("ChevronLeft",Ee);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Le=[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]],De=ve("Images",Le),be={politics:{中共党员:3,中共预备党员:2.5,入党积极分子:2,共青团员:1.5,群众:1},conductDefault:8,integrityDefault:2,sportsFactor:.025,gpaFactor:10,table2:{国家级:{一等奖:3,二等奖:2,三等奖:1,优秀奖:.5},省市级:{一等奖:2,二等奖:1,三等奖:.5,优秀奖:.2},区县级:{一等奖:1,二等奖:.5,三等奖:.2,优秀奖:.1},校级:{一等奖:.5,二等奖:.2,三等奖:.1,优秀奖:.05},二级学院:{一等奖:.2,二等奖:.1,三等奖:.05,优秀奖:0}},table4:{校级:{干部:4,干事:2,社团干部:1,学工助理:2},院级:{干部:3,干事:1.5,支部委员:1.5,支部组长:1,班长:1,团支书:1,班委:.5,社团干部:1,学工助理:2}},publicGood:{无偿献血:.5,捐献骨髓:3,国家级:1.5,省市级:1,区县级:.5,校级:.2,二级学院:.1},rewards:{荣誉称号:{院级:.3,校级:.5,区级:1,市级:1.5,国家级:2},英语等级:{三级:.5,四级:1,六级:2},计算机等级:{一级:.5,二级:1,三级:2},职业资格:{从业资格:.5,初级:1,中级:2,高级:3}},penalties:{留校察看:5,记过:4,严重警告:3,警告:2,通报批评:1}};function ie(i){const l=/^(\d{4})-(\d{4})/.exec(String(i??"").trim());return l?l[1]+"-"+l[2]:null}function we(i){const l=/^(\d{4})-(\d{4})$/.exec(i);return l?[l[1]+"-09-01",l[2]+"-09-01"]:null}function ue(i,l){const m=ie(i)??i,b=/^(\d{4})/.exec(m),y=/^(\d{4})/.exec(l??"");if(!b||!y)return m+" 学年";const a=Number(b[1])-Number(y[1])+1,h=["大一","大二","大三","大四","大五","大六","大七"];return a<1?m+" 学年":(h[a-1]??a+"年级")+"("+m+" 学年)"}function We(i,l){if(!l)return!0;const m=(i??"").slice(0,10);return m>=l[0]&&mMath.round(i*100)/100;function ye(i,l,m){var y;return!l||!m?null:((y=i.table2[l])==null?void 0:y[m])??null}function Ge(i){var x,I,G,ee;const{year:l,records:m,semesters:b,bands:y,weights:a,profile:h,rules:o,ov:w}=i,C=l==="all"?null:we(l),f=m.filter(t=>t.status!=="draft"&&We(t.start_date??t.created_at,C)),j=t=>{var n;return(n=w.itemOverrides)==null?void 0:n[t]},v=(t,n,d,p,N,U)=>{const F=j(t),Ne=(F==null?void 0:F.score)??p??0;return{itemKey:t,title:n,source:d,score:Ne,overridden:(F==null?void 0:F.score)!=null,note:N,fromRecord:U}},R=(t,n,d,p)=>({key:t,label:n,cap:d,items:p,subtotal:K(p.reduce((N,U)=>N+U.score,0))}),_=[],te=h.political??"",J=Object.keys(o.politics).find(t=>te.includes(t)),u=J?o.politics[J]:1,E=w.conduct??o.conductDefault,z=w.integrity??o.integrityDefault;_.push(R("conduct","品行素质",13,[{itemKey:"politics",title:"思想政治基础分("+(te||"群众")+")",source:"个人信息 · 政治面貌",score:u},{itemKey:"conduct",title:"操行考评成绩",source:"辅导员考评(可修改)",score:E,overridden:w.conduct!=null},{itemKey:"integrity",title:"诚信分",source:"默认满分(可修改)",score:z,overridden:w.integrity!=null}]));const O=t=>{if(t.grade_point!=null)return t.grade_point;if(y&&t.score!=null){const n=y.find(d=>t.score>=d.min&&(t.score=100&&t.score<=d.max));if(n&&n.gp!=null){if(n.gpTop!=null){const d=n.max>=100?n.max:n.max-1,p=(n.gpTop-n.gp)/Math.max(1,d-n.min);return K(n.gp+(t.score-n.min)*p)}return n.gp}}return null},Q=t=>a?a[t.category??"其他"]??a.其他??1:1,P=ie(l),H=b.filter(t=>!P||ie(t.term)===P),q=[],D=[];for(const t of H){if(q.push(...t.courses??[]),t.gpa!=null){D.push({term:t.term,gpa:t.gpa,fallback:!1});continue}const n=(t.courses??[]).map(p=>({...p,grade_point:O(p)})).filter(p=>p.grade_point!=null&&p.credit>0);if(!n.length)continue;const d=n.reduce((p,N)=>p+N.credit,0);D.push({term:t.term,gpa:K(n.reduce((p,N)=>p+N.grade_point*Q(N)*N.credit,0)/d),fallback:!0})}const T=D.length?K(D.reduce((t,n)=>t+n.gpa,0)/D.length):null,ae=T==null?"该学年暂无学期绩点数据(先在「成绩」页录入学期或课程)":D.some(t=>t.fallback)?"部分学期绩点未录入,按课程推算":void 0,ce=T!=null?K(T*o.gpaFactor):0;_.push(R("academic","学业成绩",60,[{itemKey:"gpa",title:"学年平均学分绩点 "+(T!=null?T.toFixed(2):"—")+" × "+o.gpaFactor,source:"成绩模块 · "+H.length+" 学期"+(D.length?"(绩点均值)":""),score:ce,note:ae||(T==null?void 0:q.length+" 门课程")}]));const W=q.filter(t=>/体育/.test(t.course_name)),se=K(W.reduce((t,n)=>t+(n.score??0),0)*o.sportsFactor),re=[];W.length&&re.push({itemKey:"sports",title:"体育成绩("+W.length+" 学期体育课)",source:"体育课成绩之和 × "+o.sportsFactor,score:Math.min(se,5)});const k=[];for(const t of f.filter(n=>n.type_name==="文体活动")){const n=ye(o,ne(t.level),ge(t.award_grade));n==null&&!((x=j("w"+t.id))!=null&&x.score)||k.push(v("w"+t.id,t.title,t.type_name+" · "+(t.level??"")+" "+(t.award_grade??""),n,void 0,t.id))}const de=K(Math.min(k.reduce((t,n)=>t+n.score,0),5));_.push(R("sports","文体素质",10,[...re,{itemKey:"wcap",title:"文体类加分(上限 5 分)",source:k.length+" 条记录",score:de,note:k.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录",recordIds:k.map(t=>t.fromRecord).filter(Boolean)}]));const Y=[];for(const t of f.filter(n=>n.type_name==="竞赛"||n.type_name==="科研")){const n=ye(o,ne(t.level),ge(t.award_grade));n==null&&!((I=j("c"+t.id))!=null&&I.score)||Y.push(v("c"+t.id,t.title,t.type_name+" · "+(t.level??"")+" "+(t.award_grade??""),n,void 0,t.id))}const $=K(Math.min(Y.reduce((t,n)=>t+n.score,0),10)),Z=[];for(const t of f.filter(n=>n.type_name==="学生工作")){const n=ne(t.level)??"院级",d=(t.role??"")+" "+t.title,p=o.table4[n==="国家级"||n==="省市级"||n==="区县级"?"校级":n]??o.table4.院级;let N=null;for(const[U,F]of Object.entries(p))if(d.includes(U)){N=F;break}N==null&&!((G=j("k"+t.id))!=null&&G.score)||Z.push(v("k"+t.id,t.title,"学生工作 · "+(t.level??"院级")+" "+(t.role??""),N,N==null?"请手动填写分值":void 0,t.id))}const X=K(Math.min(Z.reduce((t,n)=>t+n.score,0),4)),V=[];for(const t of f.filter(n=>n.type_name==="志愿公益")){const n=ne(t.level),d=/献血/.test(t.title);let p=d?o.publicGood.无偿献血:n?o.publicGood[n]??null:null;p==null&&!((ee=j("g"+t.id))!=null&&ee.score)||V.push(v("g"+t.id,t.title,"公益 · "+(d?"无偿献血":t.level??"校级"),p,void 0,t.id))}const oe=K(Math.min(V.reduce((t,n)=>t+n.score,0),3));_.push(R("expand","拓展性素质",17,[{itemKey:"ccap",title:"竞赛获奖(上限 10 分)",source:Y.length+" 条记录",score:$,note:Y.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录",recordIds:Y.map(t=>t.fromRecord).filter(Boolean)},{itemKey:"kcap",title:"担任学生工作(上限 4 分)",source:Z.length+" 条记录",score:X,note:Z.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录",recordIds:Z.map(t=>t.fromRecord).filter(Boolean)},{itemKey:"gcap",title:"公益活动(上限 3 分)",source:V.length+" 条记录",score:oe,note:V.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录",recordIds:V.map(t=>t.fromRecord).filter(Boolean)}]));const s=[];for(const t of f.filter(n=>n.type_name==="荣誉惩处"||n.type_name==="证书技能")){const n=j("h"+t.id),d=t.title+" "+(t.award_grade??"");if(/综合测评奖学金/.test(d))continue;let p=null,N=t.type_name;if(/留校察看/.test(d))p=-o.penalties.留校察看;else if(/记过/.test(d))p=-o.penalties.记过;else if(/严重警告/.test(d))p=-o.penalties.严重警告;else if(/警告/.test(d))p=-o.penalties.警告;else if(/通报批评/.test(d))p=-o.penalties.通报批评;else if(/六级|专八/.test(d))p=o.rewards.英语等级.六级;else if(/四级|专四/.test(d))p=o.rewards.英语等级.四级;else if(/三级/.test(d)&&/英语/.test(d))p=o.rewards.英语等级.三级;else if(/计算机/.test(d)&&/三级/.test(d))p=o.rewards.计算机等级.三级;else if(/计算机/.test(d)&&/二级/.test(d))p=o.rewards.计算机等级.二级;else if(/计算机/.test(d)&&/一级/.test(d))p=o.rewards.计算机等级.一级;else if(/高级/.test(d))p=o.rewards.职业资格.高级;else if(/中级/.test(d))p=o.rewards.职业资格.中级;else if(/初级/.test(d))p=o.rewards.职业资格.初级;else if(/从业|资格证|教师资格|普通话|驾驶证|软考/.test(d))p=o.rewards.职业资格.从业资格;else{const U=ne(t.level),F=U==="省市级"?"市级":U==="区县级"?"区级":U==="二级学院"?"院级":U;F&&o.rewards.荣誉称号[F]!=null&&(p=o.rewards.荣誉称号[F],N="荣誉 · "+F)}p==null&&!(n!=null&&n.score)||s.push(v("h"+t.id,t.title,N,p,void 0,t.id))}const r=K(Math.max(Math.min(s.reduce((t,n)=>t+n.score,0),5),-5));_.push(R("rewards","奖惩分",5,[{itemKey:"hcap",title:"奖惩合计(±5 分)",source:s.length+" 条记录",score:r,note:s.map(t=>t.title+" "+t.score+"分").join(";")||"无匹配记录",recordIds:s.map(t=>t.fromRecord).filter(Boolean)}]));for(const t of w.manual??[]){const n=_.find(d=>d.label===t.section)??_[_.length-1];n.items.push({itemKey:"m"+t.title+t.score,title:t.title,source:"手动添加",score:t.score}),n.subtotal=K(n.items.reduce((d,p)=>d+p.score,0))}const c=K(_.reduce((t,n)=>{const d=n.key==="rewards"?n.subtotal:Math.min(n.subtotal,n.cap);return t+d},0));return{sections:_,total:c,gpa:T}}function M(i){return String(i??"").replace(/&/g,"&").replace(//g,">")}function Ue(i,l){var y;const m="----=_fp_zongce",b=[];b.push(`MIME-Version: 1.0\r +Content-Type: multipart/related; type="text/html"; boundary="`+m+`"\r +\r +--`+m+`\r +Content-Location: document.html\r +Content-Type: text/html; charset="utf-8"\r +Content-Transfer-Encoding: 8bit\r +\r +`+i+`\r +`);for(const a of l){const h=a.dataUri.indexOf(","),o=a.dataUri.slice(0,h),w=a.dataUri.slice(h+1),C=((y=/data:([^;]+)/.exec(o))==null?void 0:y[1])??"image/png";b.push("--"+m+`\r +Content-Location: `+a.name+`\r +Content-Type: `+C+`\r +Content-Transfer-Encoding: base64\r +\r +`+w+`\r +`)}return b.push("--"+m+`--\r +`),new Blob([b.join("")],{type:'multipart/related; type="text/html"; boundary="'+m+'"'})}const g="border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:10.5pt;vertical-align:middle",L='border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:10.5pt;font-family:"黑体",SimHei;letter-spacing:1pt;vertical-align:middle;background:#eef1f6',Be='border:0.75pt solid #3a3a3a;padding:5pt 8pt;font-size:11pt;font-family:"黑体",SimHei;letter-spacing:1.5pt;background:#f5f6f9;text-align:left',je=(i,l)=>''+l+'';function He(i){const l='
基础项分值 / 规则
政治面貌分'+M(Object.entries(i.politics).map(([f,j])=>f+" "+j+" 分").join(";"))+'
操行考评 / 诚信分默认'+M(i.conductDefault)+" 分 / "+M(i.integrityDefault)+' 分
学业成绩学年平均学分绩点 × '+M(i.gpaFactor)+'(上限 60 分)
体育加分体育课成绩之和 × '+M(i.sportsFactor)+'(上限 5 分)
公益服务'+M(Object.entries(i.publicGood).map(([f,j])=>f+" "+j).join(";"))+"
",m=i.table2,b=i.table4,y=i.rewards,a=Object.keys(m),h=["一等奖","二等奖","三等奖","优秀奖"],o=''+h.map(f=>'").join("")+""+a.map(f=>'"+h.map(j=>{var v;return'"}).join("")+"").join("")+"
获奖级别'+f+"
'+M(f)+"'+M(((v=m[f])==null?void 0:v[j])??"—")+"
",w=''+Object.keys(b).map(f=>'").join("")+"
学生工作级别岗位分值
'+M(f)+''+M(Object.entries(b[f]).map(([j,v])=>j+" "+v).join(";"))+"
",C=''+["荣誉称号","英语等级","计算机等级","职业资格"].map(f=>'").join("")+'
类别分值
'+M(f)+''+M(Object.entries(y[f]??{}).map(([j,v])=>j+" "+v).join(";"))+"
违纪扣分'+M(Object.entries(i.penalties).map(([f,j])=>f+" -"+j).join(";"))+"
";return'
附 2:评分细则参考(默认值,可自行调整)
'+l+o+w+C}function qe(i,l,m,b,y){const a=u=>M(u),h=m.school?'
'+a(m.school)+"
":"",o=(u,E)=>''+E+''+a(u||"")+"",w=["一","二","三","四","五","六","七","八"],C=[];l.sections.forEach((u,E)=>{const z=u.key==="rewards"?u.subtotal:Math.min(u.subtotal,u.cap);C.push(''+a(w[E]??E+1)+"、"+a(u.label)+"(上限 "+a(u.cap)+" 分)");for(const O of u.items)C.push(''+a(O.title)+(O.overridden?'(已手动修正)':"")+''+a(O.note||O.source)+''+a(O.score)+"");C.push(''+a(u.label)+'小计'+a(z)+"")}),C.push('综合素质测评总分'+a(l.total)+"");const f=''+C.join("")+"
考评项目评分依据分值
",j=[];let v=0;const R=b.map(u=>{const E=u.images.map(z=>{v++;const O="ev"+u.recordId+"_"+j.length;return j.push({name:O,dataUri:z}),'
附图
图 '+v+" "+a(u.title)+"
"}).join("");return''+a(u.title)+'
'+a(u.meta)+''+E+""}).join(""),_=R?'
附 1:加分证明材料
('+a(b.length)+" 项记录 · "+a(v)+' 张材料图)
'+R+"
":"",te=''+o(m.studentId,"学 号")+o(m.name,"姓 名")+o(m.gender,"性 别")+""+o(m.college,"学 院")+o(m.major,"专 业")+o(m.className,"班 级")+""+o(m.political,"政治面貌")+o(i,"统计周期")+o(m.phone,"电话号码")+"
",J='学生综合素质测评表
'+h+'

学生综合素质测评表

测评学年:'+a(i)+"

"+te+f+_+He(y)+'
学生签名:_____班长签名:_____辅导员签名:_____日期:______

说明:本表依据《学生综合素质测评评分细则》自动生成(细则默认值见附 2,可自行调整);带「已手动修正」标记的分值为手动核定结果。导出前请核对加分记录与证明材料一致。

第 '+je("PAGE","1")+" 页(共 "+je("NUMPAGES","1")+" 页)

";return Ue(J,j)}const B=({value:i,onChange:l,wide:m})=>e.jsx("input",{type:"number",step:"0.05",className:"num rounded-md border border-neutral-200 bg-white px-1 py-0.5 text-right text-[11.5px] focus:border-brand focus:outline-none "+(m?"w-[76px]":"w-[58px]"),value:i,onChange:b=>l(b.target.value===""?0:Number(b.target.value))}),le=({head:i,children:l})=>e.jsxs("table",{className:"w-full border border-neutral-200 text-[11.5px]",children:[e.jsx("thead",{children:e.jsx("tr",{children:i.map((m,b)=>e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:m},b))})}),e.jsx("tbody",{children:l})]});function Ze(){var V,oe;const i=Ce(),l=pe({queryKey:["profile"],queryFn:Ie}),m=pe({queryKey:["zc-records"],queryFn:()=>Me({page:1,page_size:500})}),b=pe({queryKey:["grades"],queryFn:Re}),y=(V=l.data)==null?void 0:V.content,a={...(y==null?void 0:y.info)??{}},[h,o]=S.useState(""),[w,C]=S.useState({}),[f,j]=S.useState([]),[v,R]=S.useState(!1),[_,te]=S.useState(!1),J=S.useRef(null),[u,E]=S.useState(be),[z,O]=S.useState(null);S.useEffect(()=>{var s,r;y&&(C(((s=y.zongce)==null?void 0:s.overrides)??{}),(r=y.zongce)!=null&&r.rules&&E(y.zongce.rules))},[y]);const Q=((oe=m.data)==null?void 0:oe.items)??[],P=S.useMemo(()=>{var s;return Array.from(new Set((((s=b.data)==null?void 0:s.semesters)??[]).map(r=>ie(r.term)).filter(Boolean))).sort()},[b.data]);S.useEffect(()=>{var s;y&&(C(((s=y.zongce)==null?void 0:s.overrides)??{}),!h&&P.length&&o(P[0]))},[y,b.data]);const H=w[h]??{},q=S.useMemo(()=>{var s,r,c;return Ge({year:h||"all",records:Q,semesters:((s=b.data)==null?void 0:s.semesters)??[],bands:(r=b.data)==null?void 0:r.bands,weights:(c=b.data)==null?void 0:c.weights,profile:a,rules:u,ov:H})},[Q,b.data,a,u,H,h]),D=a.eduStart||(P.length?P[0]+"-09":""),T=h==="all"||!h?"全部学年":ue(h,D),ae=S.useMemo(()=>{const s=h&&h!=="all"?we(h):null;return Q.filter(r=>{if(r.status==="draft")return!1;if(!s)return!0;const c=(r.start_date??r.created_at??"").slice(0,10);return c>=s[0]&&cr.id)},[Q,h]),ce=S.useMemo(()=>{const s=new Set;return q.sections.forEach(r=>r.items.forEach(c=>{c.fromRecord&&s.add(c.fromRecord);for(const x of c.recordIds??[])s.add(x)})),s},[q]);S.useEffect(()=>{let s=!0;return(async()=>{const r=[];for(const c of ae){const x=Q.find(I=>I.id===c);try{const I=await ke(c),G=[];for(const ee of I.items.filter(t=>t.id&&(t.mime??"").startsWith("image/"))){const t=await Se(ee.id);t.data_b64&&G.push("data:"+(ee.mime==="image/jpeg"?"image/jpeg":"image/webp")+";base64,"+t.data_b64)}if(G.length){const ee=[x==null?void 0:x.type_name,x==null?void 0:x.level,x==null?void 0:x.award_grade].filter(Boolean).join(" · ");r.push({recordId:c,title:(x==null?void 0:x.title)??"记录 "+c,meta:ee,images:G})}}catch{}}s&&j(r)})(),()=>{s=!1}},[ae.join(",")]);const W=S.useMemo(()=>{const s=[];for(const r of f)for(const c of r.images)s.push({src:c,title:r.title});return s},[f]),se=s=>void Oe({info:a,zongce:{rules:s.rules??u,overrides:s.overrides??w}}).catch(r=>i("error",r.message)),re=s=>{C(r=>({...r,[h]:s})),se({overrides:{...w,[h]:s}})},k=s=>{const r=JSON.parse(JSON.stringify(u));s(r),E(r),se({rules:r})},de=()=>{const s=JSON.parse(JSON.stringify(be));E(s),se({rules:s}),i("success","评分细则已恢复默认")},Y=()=>{const s=qe(T,q,a,f,u),r=URL.createObjectURL(s),c=document.createElement("a");c.href=r,c.download="综合素质测评_"+T+".doc",c.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4),i("success","综测表已导出(.doc,附证明材料图 "+W.length+" 张 + 细则参考)")},$=z?W.findIndex(s=>s.src===z.src):-1,Z=s=>{const r=$+s;r>=0&&ro(s.target.value),options:[...P.map(s=>({value:s,label:ue(s,D)})),{value:"all",label:"全部学年"}]}),e.jsxs(A,{variant:"secondary",onClick:()=>{const s=!_;te(s),s&&setTimeout(()=>{var r;return(r=J.current)==null?void 0:r.scrollIntoView({behavior:"smooth",block:"start"})},80)},children:[e.jsx(xe,{size:13})," 评分细则参考"]}),e.jsxs(A,{variant:"secondary",onClick:Y,children:[e.jsx(ze,{size:13})," 导出 Word"]}),e.jsxs(A,{variant:"secondary",onClick:()=>R(!0),children:[e.jsx(he,{size:13})," 初始化"]}),e.jsxs(A,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(Fe,{size:13})," 打印"]})]})]}),_&&e.jsxs("div",{ref:J,className:"no-print mb-4 scroll-mt-16 rounded-xl border border-line bg-white p-4 shadow-card",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{size:15,className:"text-neutral-500"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:"评分细则参考"}),e.jsx("span",{className:"text-[11.5px] text-neutral-400",children:"默认值可自行调整,调整后即时生效并随档案保存"})]}),e.jsxs(A,{variant:"ghost",onClick:de,children:[e.jsx(he,{size:13})," 恢复默认"]})]}),e.jsxs("div",{className:"mt-3 grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-neutral-600",children:"基础分值"}),e.jsxs(le,{head:["项目","分值"],children:[Object.entries(u.politics).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:r,onChange:c=>k(x=>{x.politics[s]=c})})})]},s)),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"操行考评默认分"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:u.conductDefault,onChange:s=>k(r=>{r.conductDefault=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"诚信分默认"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:u.integrityDefault,onChange:s=>k(r=>{r.integrityDefault=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"学业成绩(绩点 ×)"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:u.gpaFactor,onChange:s=>k(r=>{r.gpaFactor=s})})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:"体育加分(成绩 ×)"}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:u.sportsFactor,onChange:s=>k(r=>{r.sportsFactor=s})})})]})]}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"公益服务"}),e.jsx(le,{head:["项目","分值"],children:Object.entries(u.publicGood).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:r,onChange:c=>k(x=>{x.publicGood[s]=c})})})]},s))}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"违纪扣分"}),e.jsx(le,{head:["项目","扣分"],children:Object.entries(u.penalties).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:s}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:r,onChange:c=>k(x=>{x.penalties[s]=c})})})]},s))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-neutral-600",children:"竞赛 / 文体奖项加分(级别 × 奖项)"}),e.jsxs("table",{className:"w-full border border-neutral-200 text-[11.5px]",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:"级别"}),["一等奖","二等奖","三等奖","优秀奖"].map(s=>e.jsx("th",{className:"border-b border-neutral-200 bg-neutral-50 px-2 py-1 text-left font-medium text-neutral-500",children:s},s))]})}),e.jsx("tbody",{children:Object.entries(u.table2).map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1 font-medium text-neutral-700",children:s}),["一等奖","二等奖","三等奖","优秀奖"].map(c=>e.jsx("td",{className:"border-b border-neutral-100 px-1 py-1",children:e.jsx(B,{value:r[c]??0,onChange:x=>k(I=>{I.table2[s][c]=x})})},c))]},s))})]}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"学生工作"}),e.jsx(le,{head:["级别 / 岗位","分值"],children:Object.entries(u.table4).flatMap(([s,r])=>Object.entries(r).map(([c,x])=>e.jsxs("tr",{children:[e.jsxs("td",{className:"border-b border-neutral-100 px-2 py-1",children:[s," · ",c]}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:x,onChange:I=>k(G=>{G.table4[s][c]=I})})})]},s+c)))}),e.jsx("div",{className:"mb-1.5 mt-3 text-[12px] font-semibold text-neutral-600",children:"荣誉与证照加分"}),e.jsx(le,{head:["类别 / 等级","分值"],children:Object.entries(u.rewards).flatMap(([s,r])=>Object.entries(r).map(([c,x])=>e.jsxs("tr",{children:[e.jsxs("td",{className:"border-b border-neutral-100 px-2 py-1",children:[s," · ",c]}),e.jsx("td",{className:"border-b border-neutral-100 px-2 py-1",children:e.jsx(B,{value:x,onChange:I=>k(G=>{G.rewards[s][c]=I})})})]},s+c)))})]})]})]}),e.jsxs("div",{className:"print-sheet mx-auto w-full max-w-[820px] rounded-xl border border-line bg-white shadow-card sm:p-8",children:[a.school&&e.jsx("div",{className:"text-center text-[11px] tracking-widest text-neutral-500",children:a.school}),e.jsx("h1",{className:"mt-0.5 text-center text-[19px] font-bold tracking-wide text-neutral-900",children:"学生综合素质测评表"}),e.jsxs("div",{className:"mt-1 text-center text-[12px] text-neutral-500",children:["测评学年:",T]}),e.jsx("div",{className:"mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-neutral-300 bg-neutral-300 text-[12.5px] sm:grid-cols-3",children:[["学 号",a.studentId],["姓 名",a.name],["性 别",a.gender],["学 院",a.college],["专 业",a.major],["班 级",a.className],["政治面貌",a.political],["统计周期",T],["电话号码",a.phone]].map(([s,r])=>e.jsxs("div",{className:"flex bg-white",children:[e.jsx("span",{className:"w-[62px] shrink-0 bg-neutral-50 px-2 py-1.5 font-medium text-neutral-500",children:s}),e.jsx("span",{className:"min-w-0 flex-1 truncate px-2 py-1.5 text-neutral-900",children:r||"—"})]},s))}),e.jsxs("div",{className:"mt-4 flex items-center justify-center rounded-lg bg-gradient-to-r from-neutral-900 to-neutral-700 px-4 py-2.5 text-white",children:[e.jsx("span",{className:"text-[12px] opacity-80",children:"综合素质测评总分"}),e.jsx("span",{className:"num ml-3 text-[26px] font-bold leading-none",children:q.total}),e.jsx("span",{className:"ml-1.5 text-[12px] opacity-80",children:"/ 100 分"})]}),q.sections.map(s=>e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-4 w-1 rounded-full bg-brand"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:s.label}),e.jsxs(me,{className:"no-print",color:"var(--text-3)",children:["上限 ",s.cap," 分"]})]}),e.jsxs("span",{className:"num rounded-md bg-neutral-100 px-2 py-0.5 text-[12px] font-semibold text-neutral-700",children:["小计 ",s.key==="rewards"?s.subtotal:Math.min(s.subtotal,s.cap)]})]}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 rounded-lg border border-neutral-200 bg-neutral-50/60 p-3",children:[s.items.map(r=>e.jsxs("div",{className:"flex items-center gap-2 text-[12.5px]",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-neutral-900",children:r.title}),e.jsx("span",{className:"ml-2 text-[11px] text-neutral-400",children:r.source}),r.note&&e.jsx("div",{className:"text-[11px] leading-relaxed text-neutral-400",children:r.note})]}),e.jsx("input",{type:"number",step:"0.1",className:"num w-[72px] rounded-md border border-neutral-200 bg-white px-1.5 py-0.5 text-right text-[12px] focus:border-brand focus:outline-none",value:r.score,onChange:c=>{var x;if(r.itemKey==="conduct"||r.itemKey==="integrity")re({...H,[r.itemKey]:Number(c.target.value)});else{const I={...H.itemOverrides??{},[r.itemKey]:{...((x=H.itemOverrides)==null?void 0:x[r.itemKey])??{},score:Number(c.target.value)}};re({...H,itemOverrides:I})}}})]},r.itemKey)),!s.items.length&&e.jsx("div",{className:"text-[12px] text-neutral-400",children:"暂无数据"})]})]},s.key)),(f.length>0||X>0)&&e.jsxs("div",{className:"mt-7",children:[e.jsx("div",{className:"flex items-center justify-between border-t border-neutral-200 pt-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{size:15,className:"text-neutral-500"}),e.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:"附:加分证明材料"}),e.jsxs("span",{className:"text-[11.5px] text-neutral-400",children:["共 ",f.length," 项记录 · ",X," 张图片(点击可放大)"]})]})}),e.jsx("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",children:f.map(s=>e.jsxs("div",{className:"rounded-lg border border-neutral-200 bg-white p-2.5 transition-shadow hover:shadow-md",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[ce.has(s.recordId)?e.jsx(me,{color:"var(--brand-text)",children:"计分"}):e.jsx(me,{className:"no-print",color:"var(--text-3)",children:"未计分"}),e.jsx("div",{className:"min-w-0 truncate text-[12.5px] font-semibold text-neutral-800",children:s.title})]}),e.jsx("div",{className:"shrink-0 text-[10.5px] text-neutral-400",children:s.meta})]}),e.jsx("div",{className:"mt-2 gap-2 "+(s.images.length>1?"grid grid-cols-2":"flex"),children:s.images.map((r,c)=>e.jsx("button",{onClick:()=>O({src:r,title:s.title,index:W.findIndex(x=>x.src===r)}),className:"group overflow-hidden rounded-md border border-neutral-200 bg-neutral-50",children:e.jsx("img",{src:r,alt:"证明 "+(c+1),className:"aspect-[4/3] w-full object-cover transition-transform group-hover:scale-[1.03]"})},c))})]},s.recordId))})]}),e.jsx("div",{className:"mt-6 border-t border-neutral-200 pt-3 text-[11px] leading-relaxed text-neutral-400",children:"计分依据:《学生综合素质测评评分细则》(默认值可在上方「评分细则参考」查看与修改)。 自动匹配条目均可手动修正分值;「初始化」清除本学年全部手动修正。导出 Word / 打印前请核对加分记录与证明材料一致。"})]}),e.jsx(fe,{open:!!z,onClose:()=>O(null),width:920,title:z?z.title+"("+($+1)+"/"+X+")":"",footer:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs(A,{variant:"secondary",disabled:$<=0,onClick:()=>Z(-1),children:[e.jsx(Te,{size:13})," 上一张"]}),e.jsx("span",{className:"num text-[12px] text-ink-3",children:z?$+1+" / "+X:""}),e.jsxs(A,{variant:"primary",disabled:$>=X-1,onClick:()=>Z(1),children:["下一张 ",e.jsx(Ke,{size:13})]})]}),children:z&&e.jsx("img",{src:z.src,alt:z.title,className:"mx-auto max-h-[74vh] rounded-md"})}),e.jsx(fe,{open:v,onClose:()=>R(!1),width:440,title:"初始化综测",footer:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"ghost",onClick:()=>R(!1),children:"取消"}),e.jsx(A,{variant:"primary",onClick:()=>{const s={...w};delete s[h],C(s),se({overrides:s}),R(!1),i("success","已恢复自动计算")},children:"恢复自动计算"})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将清除 ",e.jsx("b",{children:h==="all"||!h?"全部学年":ue(h,D)})," 的全部手动修正 (分值覆盖、操行/诚信分修改),恢复为按细则规则的自动计算结果。",e.jsx("div",{className:"mt-2 text-ink-3",children:"记录数据、个人信息与评分细则不受影响。"})]})})]})}export{Ze as AssessmentPage}; diff --git a/sync-server/www/assets/DashboardPage-BQFeFR8x.js b/sync-server/www/assets/DashboardPage-DEMHppda.js similarity index 94% rename from sync-server/www/assets/DashboardPage-BQFeFR8x.js rename to sync-server/www/assets/DashboardPage-DEMHppda.js index c2109eb..d612da4 100644 --- a/sync-server/www/assets/DashboardPage-BQFeFR8x.js +++ b/sync-server/www/assets/DashboardPage-DEMHppda.js @@ -1 +1 @@ -import{r as g,f as v,j as t,S as j,t as S}from"./index-Bmyzyg8t.js";import{C as c,a as d,b as x}from"./card-Diwu5WOM.js";import{u as N,i as u,a as m}from"./useChart-rSzOuKiQ.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; +import{r as g,f as v,j as t,S as j,t as S}from"./index-i50OZQTj.js";import{C as c,a as d,b as x}from"./card-D8TWS3Zn.js";import{u as N,i as u,a as m}from"./useChart-B6jW3CzL.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; diff --git a/sync-server/www/assets/GradesPage-BUHN14mZ.js b/sync-server/www/assets/GradesPage-Dza_nNMi.js similarity index 99% rename from sync-server/www/assets/GradesPage-BUHN14mZ.js rename to sync-server/www/assets/GradesPage-Dza_nNMi.js index 7609e98..6e412ed 100644 --- a/sync-server/www/assets/GradesPage-BUHN14mZ.js +++ b/sync-server/www/assets/GradesPage-Dza_nNMi.js @@ -1,4 +1,4 @@ -import{c as $,f as O,j as e,E as H,w as U,u as k,d as C,r as u,g as y,x as W,y as J,B as j,P as E,I as g,z as Y,C as A,A as V,D as B,F as X,m as S,l as Q,T as q,H as Z,J as z,K as M,S as T,M as D}from"./index-Bmyzyg8t.js";import{C as w,a as G,b as F}from"./card-Diwu5WOM.js";import{u as ee,i as K,a as P}from"./useChart-rSzOuKiQ.js";import{u as se,i as te,b as ae,a as re,c as ne,d as le,e as ie,f as oe}from"./echarts-BIWefrIc.js";/** +import{c as $,f as O,j as e,E as H,w as U,u as k,d as C,r as u,g as y,x as W,y as J,B as j,P as E,I as g,z as Y,C as A,A as V,D as B,F as X,m as S,l as Q,T as q,H as Z,J as z,K as M,S as T,M as D}from"./index-i50OZQTj.js";import{C as w,a as G,b as F}from"./card-D8TWS3Zn.js";import{u as ee,i as K,a as P}from"./useChart-B6jW3CzL.js";import{u as se,i as te,b as ae,a as re,c as ne,d as le,e as ie,f as oe}from"./echarts-BIWefrIc.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ProfilePage-Blh11W5U.js b/sync-server/www/assets/ProfilePage-DaXiKJFl.js similarity index 99% rename from sync-server/www/assets/ProfilePage-Blh11W5U.js rename to sync-server/www/assets/ProfilePage-DaXiKJFl.js index 6d5e07d..a21133e 100644 --- a/sync-server/www/assets/ProfilePage-Blh11W5U.js +++ b/sync-server/www/assets/ProfilePage-DaXiKJFl.js @@ -1,4 +1,4 @@ -import{c as E,u as P,d as S,r as p,f as q,g as F,j as e,B as f,l as B,ac as L,H as z,J as k,S as M,I as Q,ad as _,ae as K,af as v,ag as T}from"./index-Bmyzyg8t.js";/** +import{c as E,u as P,d as S,r as p,f as q,g as F,j as e,B as f,l as B,ac as L,H as z,J as k,S as M,I as Q,ad as _,ae as K,af as v,ag as T}from"./index-i50OZQTj.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/RecordsPage-P1KGDld8.js b/sync-server/www/assets/RecordsPage-Dobdj8A6.js similarity index 99% rename from sync-server/www/assets/RecordsPage-P1KGDld8.js rename to sync-server/www/assets/RecordsPage-Dobdj8A6.js index e826e59..eeb3c1e 100644 --- a/sync-server/www/assets/RecordsPage-P1KGDld8.js +++ b/sync-server/www/assets/RecordsPage-Dobdj8A6.js @@ -1,4 +1,4 @@ -import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-Bmyzyg8t.js";/** +import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-i50OZQTj.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ResumePage-D6LTsd6o.js b/sync-server/www/assets/ResumePage-BWRRWx8h.js similarity index 99% rename from sync-server/www/assets/ResumePage-D6LTsd6o.js rename to sync-server/www/assets/ResumePage-BWRRWx8h.js index 821e5de..ccb641c 100644 --- a/sync-server/www/assets/ResumePage-D6LTsd6o.js +++ b/sync-server/www/assets/ResumePage-BWRRWx8h.js @@ -1,4 +1,4 @@ -import{c as B,d as ve,f as te,r as E,j as e,B as R,ah as Ne,af as L,J as U,S as se,ad as ce,P as q,H as we,a9 as Ce,T as ne,I as W,ag as Se,v as _e}from"./index-Bmyzyg8t.js";import{C as ie,a as ae,b as re}from"./card-Diwu5WOM.js";import{R as le,P as ze,C as Re}from"./rotate-ccw-DBQnyfoK.js";/** +import{c as B,d as ve,f as te,r as E,j as e,B as R,ah as Ne,af as L,J as U,S as se,ad as ce,P as q,H as we,a9 as Ce,T as ne,I as W,ag as Se,v as _e}from"./index-i50OZQTj.js";import{C as ie,a as ae,b as re}from"./card-D8TWS3Zn.js";import{R as le,P as ze,C as Re}from"./rotate-ccw-C9On11h9.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/TaxonomyPage-C83kP-EQ.js b/sync-server/www/assets/TaxonomyPage-DT0lqT-7.js similarity index 97% rename from sync-server/www/assets/TaxonomyPage-C83kP-EQ.js rename to sync-server/www/assets/TaxonomyPage-DT0lqT-7.js index 9078e6c..527b605 100644 --- a/sync-server/www/assets/TaxonomyPage-C83kP-EQ.js +++ b/sync-server/www/assets/TaxonomyPage-DT0lqT-7.js @@ -1 +1 @@ -import{j as e,u as k,d as q,f as z,r as g,g as h,W as F,X as w,B as j,T as D,I as Q,P as T,C as E,Y as M,Z as B,s as P,_ as I}from"./index-Bmyzyg8t.js";import{C as K,a as S}from"./card-Diwu5WOM.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function A(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(O,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function O(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:I}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{A as TaxonomyPage}; +import{j as e,u as k,d as q,f as z,r as g,g as h,W as F,X as w,B as j,T as D,I as Q,P as T,C as E,Y as M,Z as B,s as P,_ as I}from"./index-i50OZQTj.js";import{C as K,a as S}from"./card-D8TWS3Zn.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function A(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(O,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function O(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:I}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{A as TaxonomyPage}; diff --git a/sync-server/www/assets/TypesPage-DxXV3aWW.js b/sync-server/www/assets/TypesPage-C26iumiS.js similarity index 98% rename from sync-server/www/assets/TypesPage-DxXV3aWW.js rename to sync-server/www/assets/TypesPage-C26iumiS.js index e1d95fd..dd2ad46 100644 --- a/sync-server/www/assets/TypesPage-DxXV3aWW.js +++ b/sync-server/www/assets/TypesPage-C26iumiS.js @@ -1,4 +1,4 @@ -import{c as D,u as K,d as I,f as L,r,g as q,j as e,B as p,P as F,N as O,m as _,l as H,T as P,C as R,O as G,H as J,J as i,I as j,Q as U,S as z,U as V,V as W,q as X}from"./index-Bmyzyg8t.js";import{C as Y}from"./card-Diwu5WOM.js";/** +import{c as D,u as K,d as I,f as L,r,g as q,j as e,B as p,P as F,N as O,m as _,l as H,T as P,C as R,O as G,H as J,J as i,I as j,Q as U,S as z,U as V,V as W,q as X}from"./index-i50OZQTj.js";import{C as Y}from"./card-D8TWS3Zn.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/card-Diwu5WOM.js b/sync-server/www/assets/card-D8TWS3Zn.js similarity index 89% rename from sync-server/www/assets/card-Diwu5WOM.js rename to sync-server/www/assets/card-D8TWS3Zn.js index 7ca97c6..4c47e54 100644 --- a/sync-server/www/assets/card-Diwu5WOM.js +++ b/sync-server/www/assets/card-D8TWS3Zn.js @@ -1 +1 @@ -import{j as s,a}from"./index-Bmyzyg8t.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; +import{j as s,a}from"./index-i50OZQTj.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; diff --git a/sync-server/www/assets/index-Bmyzyg8t.js b/sync-server/www/assets/index-i50OZQTj.js similarity index 99% rename from sync-server/www/assets/index-Bmyzyg8t.js rename to sync-server/www/assets/index-i50OZQTj.js index 44a3dc9..fc5d7d8 100644 --- a/sync-server/www/assets/index-Bmyzyg8t.js +++ b/sync-server/www/assets/index-i50OZQTj.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BQFeFR8x.js","assets/card-Diwu5WOM.js","assets/useChart-rSzOuKiQ.js","assets/echarts-BIWefrIc.js","assets/GradesPage-BUHN14mZ.js","assets/TypesPage-DxXV3aWW.js","assets/TaxonomyPage-C83kP-EQ.js","assets/AdminPage-BqF0Bkw4.js","assets/ResumePage-D6LTsd6o.js","assets/rotate-ccw-DBQnyfoK.js","assets/AssessmentPage-CIzQ48Ah.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DEMHppda.js","assets/card-D8TWS3Zn.js","assets/useChart-B6jW3CzL.js","assets/echarts-BIWefrIc.js","assets/GradesPage-Dza_nNMi.js","assets/TypesPage-C26iumiS.js","assets/TaxonomyPage-DT0lqT-7.js","assets/AdminPage-DXoVmoIt.js","assets/ResumePage-BWRRWx8h.js","assets/rotate-ccw-C9On11h9.js","assets/AssessmentPage-zL5UB5l9.js"])))=>i.map(i=>d[i]); var Cv=n=>{throw TypeError(n)};var Kf=(n,r,s)=>r.has(n)||Cv("Cannot "+s);var T=(n,r,s)=>(Kf(n,r,"read from private field"),s?s.call(n):r.get(n)),he=(n,r,s)=>r.has(n)?Cv("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),P=(n,r,s,o)=>(Kf(n,r,"write to private field"),o?o.call(n,s):r.set(n,s),s),Se=(n,r,s)=>(Kf(n,r,"access private method"),s);var Ys=(n,r,s,o)=>({set _(f){P(n,r,f,s)},get _(){return T(n,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const d of m.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();var V5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ag(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zf={exports:{}},Iu={};/** * @license React * react-jsx-runtime.production.js @@ -334,4 +334,4 @@ Please change the parent to Te("app_info"),T4=()=>Te("sync_status"),ro=()=>Te("type_list"),N4=n=>Te("type_upsert",n),C4=n=>Te("type_delete",{id:n}),E0=n=>Te("taxonomy_list",{kind:n}),w4=n=>Te("taxonomy_upsert",n),j4=n=>Te("taxonomy_delete",{id:n}),Wd=()=>Te("dimension_list"),z4=n=>Te("dimension_upsert",n),O4=n=>Te("dimension_delete",{id:n}),_0=(n={})=>Te("footprint_list",{query:n}),Id=n=>Te("footprint_get",{id:n}),T0=n=>Te("footprint_upsert",{item:n}),R4=n=>Te("footprint_delete",{id:n}),N0=(n={})=>Te("timeline",{query:n}),A4=n=>Te("stats_overview",{year:n}),M4=()=>Te("metric_list"),D4=n=>Te("metric_upsert",n),U4=n=>Te("metric_delete",{key:n}),k4=()=>Te("grades_overview"),H4=n=>Te("semester_upsert",n),q4=n=>Te("semester_delete",{id:n}),L4=n=>Te("course_upsert",n),B4=n=>Te("course_delete",{id:n}),Q4=n=>Te("band_upsert",n),G4=n=>Te("band_delete",{id:n}),C0=n=>Te("attachment_list",{owner_id:n}),w0=n=>Te("attachment_delete",{id:n}),eo=n=>Te("attachment_read",{id:n});async function Td(n,r,s){const o=new URLSearchParams({owner:String(n),name:r.name,mime:r.type||"application/octet-stream"}),f=await fetch(Ol()+"/sync/attachment/raw?"+o,{method:"PUT",headers:{authorization:"Bearer "+pl(),"content-type":r.type||"application/octet-stream"},body:r}),m=await f.json().catch(()=>({ok:!1,error:"HTTP "+f.status}));if(!m.ok)throw new Error(m.error||"上传失败");const d=m.data.item;if(s)try{await Te("attachment_set_thumb",{id:d.id,thumb_b64:s})}catch{}return d}async function j0(n){var f;const r=await fetch(Ol()+"/api/attachment_download",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+pl()},body:JSON.stringify({id:n})});if(!r.ok){const m=await r.json().catch(()=>null);throw new Error((m==null?void 0:m.error)||"下载失败")}const s=decodeURIComponent(r.headers.get("x-file-name")||((f=(r.headers.get("content-disposition")||"").match(/UTF-8''([^;]+)/))==null?void 0:f[1])||"file"),o=r.headers.get("content-type")||void 0;return{blob:await r.blob(),file_name:s,mime:o}}const z0=n=>Te("attachment_thumb",{id:n}),Y4=()=>Te("view_list"),V4=n=>Te("view_upsert",n),X4=n=>Te("view_delete",{id:n});async function nu(n,r,s){const o=await fetch((s||Ol())+n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+pl()},body:JSON.stringify(r??{})}),f=await o.json().catch(()=>({ok:!1,error:"HTTP "+o.status}));if(!f.ok)throw new Error(f.error||"请求失败");return f.data}async function O0(n,r){const s=await fetch((r||Ol())+n,{headers:{Authorization:"Bearer "+pl()}}),o=await s.json().catch(()=>({ok:!1,error:"HTTP "+s.status}));if(!o.ok)throw new Error(o.error||"请求失败");return o.data}const K4=n=>O0("/admin/invites",n),Z4=n=>O0("/admin/users",n),J4=(n,r)=>nu("/admin/invites/generate",{count:n},r),F4=(n,r,s)=>nu("/admin/invites/create",{code:n,remark:r},s),$4=(n,r,s)=>nu("/admin/invites/update",{id:n,...r},s),P4=n=>nu("/admin/demo-rebuild",{},n),W4=(n,r)=>nu("/admin/users/delete",{user_id:n},r),I4=(n,r)=>nu("/admin/invites/delete",{id:n},r),e_=()=>Te("gpa_settings_get",{}),t_=n=>Te("gpa_settings_upsert",{weights:n}),l_=()=>Te("profile_get",{}),a_=n=>Te("profile_upsert",{content:n});async function n_(n){const r=await new Promise((f,m)=>{const d=new FileReader;d.onload=()=>f(String(d.result||"").split(",")[1]||""),d.onerror=()=>m(new Error("读取文件失败")),d.readAsDataURL(n)}),o=await(await fetch(Ol()+"/api/profile_photo",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+pl()},body:JSON.stringify({data_b64:r,file_name:n.name,mime:n.type||"image/png"})})).json().catch(()=>null);if(!(o!=null&&o.ok))throw new Error((o==null?void 0:o.error)||"证件照上传失败");return o.data.url}const i_=Object.freeze(Object.defineProperty({__proto__:null,AuthError:_d,adminCreateInvite:F4,adminDeleteInvite:I4,adminDeleteUser:W4,adminDemoRebuild:P4,adminGenerateInvites:J4,adminListInvites:K4,adminListUsers:Z4,adminUpdateInvite:$4,appInfo:_4,attachmentDelete:w0,attachmentDownload:j0,attachmentList:C0,attachmentRead:eo,attachmentThumb:z0,attachmentUploadRaw:Td,bandDelete:G4,bandUpsert:Q4,clearToken:Fd,courseDelete:B4,courseUpsert:L4,deleteDimension:O4,deleteTaxonomy:j4,deleteType:C4,footprintDelete:R4,footprintGet:Id,footprintList:_0,footprintUpsert:T0,getServerUrl:Ol,getToken:pl,gpaSettingsGet:e_,gpaSettingsUpsert:t_,gradesOverview:k4,listDimensions:Wd,listTaxonomy:E0,listTypes:ro,metricDelete:U4,metricList:M4,metricUpsert:D4,profileGet:l_,profilePhotoUpload:n_,profileUpsert:a_,semesterDelete:q4,semesterUpsert:H4,serverLogin:$d,serverMe:b0,serverRegister:Pd,setServerUrl:S0,setToken:Jd,statsOverview:A4,syncStatus:T4,timeline:N0,upsertDimension:z4,upsertTaxonomy:w4,upsertType:N4,viewDelete:X4,viewList:Y4,viewUpsert:V4},Symbol.toStringTag,{value:"Module"}));function R0(n){var r,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var f=n.length;for(r=0;rtypeof n=="boolean"?`${n}`:n===0?"0":n,ag=A0,u_=(n,r)=>s=>{var o;if((r==null?void 0:r.variants)==null)return ag(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:m}=r,d=Object.keys(f).map(v=>{const x=s==null?void 0:s[v],g=m==null?void 0:m[v];if(x===null)return null;const _=lg(x)||lg(g);return f[v][_]}),p=s&&Object.entries(s).reduce((v,x)=>{let[g,_]=x;return _===void 0||(v[g]=_),v},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((v,x)=>{let{class:g,className:_,...k}=x;return Object.entries(k).every(K=>{let[q,D]=K;return Array.isArray(D)?D.includes({...m,...p}[q]):{...m,...p}[q]===D})?[...v,g,_]:v},[]);return ag(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},r_=(n,r)=>{const s=new Array(n.length+r.length);for(let o=0;o({classGroupId:n,validator:r}),M0=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),to="-",ng=[],o_="arbitrary..",c_=n=>{const r=d_(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return f_(d);const p=d.split(to),b=p[0]===""&&p.length>1?1:0;return D0(p,b,r)},getConflictingClassGroupIds:(d,p)=>{if(p){const b=o[d],v=s[d];return b?v?r_(v,b):b:v||ng}return s[d]||ng}}},D0=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],m=s.nextPart.get(f);if(m){const v=D0(n,r+1,m);if(v)return v}const d=s.validators;if(d===null)return;const p=r===0?n.join(to):n.slice(r).join(to),b=d.length;for(let v=0;vn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?o_+o:void 0})(),d_=n=>{const{theme:r,classGroups:s}=n;return h_(s,r)},h_=(n,r)=>{const s=M0();for(const o in n){const f=n[o];eh(f,s,o,r)}return s},eh=(n,r,s,o)=>{const f=n.length;for(let m=0;m{if(typeof n=="string"){y_(n,r,s);return}if(typeof n=="function"){p_(n,r,s,o);return}v_(n,r,s,o)},y_=(n,r,s)=>{const o=n===""?r:U0(r,n);o.classGroupId=s},p_=(n,r,s,o)=>{if(g_(n)){eh(n(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(s_(s,n))},v_=(n,r,s,o)=>{const f=Object.entries(n),m=f.length;for(let d=0;d{let s=n;const o=r.split(to),f=o.length;for(let m=0;m"isThemeGetter"in n&&n.isThemeGetter===!0,b_=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const f=(m,d)=>{s[m]=d,r++,r>n&&(r=0,o=s,s=Object.create(null))};return{get(m){let d=s[m];if(d!==void 0)return d;if((d=o[m])!==void 0)return f(m,d),d},set(m,d){m in s?s[m]=d:f(m,d)}}},Nd="!",ig=":",x_=[],ug=(n,r,s,o,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:f}),S_=n=>{const{prefix:r,experimentalParseClassName:s}=n;let o=f=>{const m=[];let d=0,p=0,b=0,v;const x=f.length;for(let q=0;qb?v-b:void 0;return ug(m,k,_,K)};if(r){const f=r+ig,m=o;o=d=>d.startsWith(f)?m(d.slice(f.length)):ug(x_,!1,d,void 0,!0)}if(s){const f=o;o=m=>s({className:m,parseClassName:f})}return o},E_=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let f=[];for(let m=0;m0&&(f.sort(),o.push(...f),f=[]),o.push(d)):f.push(d)}return f.length>0&&(f.sort(),o.push(...f)),o}},__=n=>({cache:b_(n.cacheSize),parseClassName:S_(n),sortModifiers:E_(n),postfixLookupClassGroupIds:T_(n),...c_(n)}),T_=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let o=0;o{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:f,sortModifiers:m,postfixLookupClassGroupIds:d}=r,p=[],b=n.trim().split(N_);let v="";for(let x=b.length-1;x>=0;x-=1){const g=b[x],{isExternal:_,modifiers:k,hasImportantModifier:K,baseClassName:q,maybePostfixModifierPosition:D}=s(g);if(_){v=g+(v.length>0?" "+v:v);continue}let H=!!D,Q;if(H){const F=q.substring(0,D);Q=o(F);const U=Q&&d[Q]?o(q):void 0;U&&U!==Q&&(Q=U,H=!1)}else Q=o(q);if(!Q){if(!H){v=g+(v.length>0?" "+v:v);continue}if(Q=o(q),!Q){v=g+(v.length>0?" "+v:v);continue}H=!1}const Z=k.length===0?"":k.length===1?k[0]:m(k).join(":"),J=K?Z+Nd:Z,Y=J+Q;if(p.indexOf(Y)>-1)continue;p.push(Y);const de=f(Q,H);for(let F=0;F0?" "+v:v)}return v},w_=(...n)=>{let r=0,s,o,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let o=0;o{let s,o,f,m;const d=b=>{const v=r.reduce((x,g)=>g(x),n());return s=__(v),o=s.cache.get,f=s.cache.set,m=p,p(b)},p=b=>{const v=o(b);if(v)return v;const x=C_(b,s);return f(b,x),x};return m=d,(...b)=>m(w_(...b))},z_=[],ct=n=>{const r=s=>s[n]||z_;return r.isThemeGetter=!0,r.themeKey=n,r},H0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,O_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,R_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,D_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ja=n=>O_.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Xl=n=>!!n&&Number.isInteger(Number(n)),ad=n=>n.endsWith("%")&&_e(n.slice(0,-1)),fa=n=>R_.test(n),L0=()=>!0,k_=n=>A_.test(n)&&!M_.test(n),th=()=>!1,H_=n=>D_.test(n),q_=n=>U_.test(n),L_=n=>!ne(n)&&!ue(n),B_=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),Q_=n=>nn(n,G0,th),ne=n=>H0.test(n),zn=n=>nn(n,Y0,k_),rg=n=>nn(n,F_,_e),G_=n=>nn(n,X0,L0),Y_=n=>nn(n,V0,th),sg=n=>nn(n,B0,th),V_=n=>nn(n,Q0,q_),Ks=n=>nn(n,K0,H_),ue=n=>q0.test(n),lr=n=>Vn(n,Y0),X_=n=>Vn(n,V0),og=n=>Vn(n,B0),K_=n=>Vn(n,G0),Z_=n=>Vn(n,Q0),Zs=n=>Vn(n,K0,!0),J_=n=>Vn(n,X0,!0),nn=(n,r,s)=>{const o=H0.exec(n);return o?o[1]?r(o[1]):s(o[2]):!1},Vn=(n,r,s=!1)=>{const o=q0.exec(n);return o?o[1]?r(o[1]):s:!1},B0=n=>n==="position"||n==="percentage",Q0=n=>n==="image"||n==="url",G0=n=>n==="length"||n==="size"||n==="bg-size",Y0=n=>n==="length",F_=n=>n==="number",V0=n=>n==="family-name",X0=n=>n==="number"||n==="weight",K0=n=>n==="shadow",$_=()=>{const n=ct("color"),r=ct("font"),s=ct("text"),o=ct("font-weight"),f=ct("tracking"),m=ct("leading"),d=ct("breakpoint"),p=ct("container"),b=ct("spacing"),v=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),_=ct("text-shadow"),k=ct("drop-shadow"),K=ct("blur"),q=ct("perspective"),D=ct("aspect"),H=ct("ease"),Q=ct("animate"),Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...J(),ue,ne],de=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],U=()=>[ue,ne,b],I=()=>[Ja,"full","auto",...U()],le=()=>[Xl,"none","subgrid",ue,ne],Ve=()=>["auto",{span:["full",Xl,ue,ne]},Xl,ue,ne],Fe=()=>[Xl,"auto",ue,ne],ie=()=>["auto","min","max","fr",ue,ne],Ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...U()],ee=()=>[Ja,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],R=()=>[p,Ja,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ae=()=>[Ja,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],X=()=>[n,ue,ne],ke=()=>[...J(),og,sg,{position:[ue,ne]}],Nt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Rl=()=>["auto","cover","contain",K_,Q_,{size:[ue,ne]}],C=()=>[ad,lr,zn],G=()=>["","none","full",v,ue,ne],W=()=>["",_e,lr,zn],ce=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[_e,ad,og,sg],Ae=()=>["","none",K,ue,ne],se=()=>["none",_e,ue,ne],ye=()=>["none",_e,ue,ne],Vt=()=>[_e,ue,ne],ga=()=>[Ja,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[L0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[L_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",_e],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ja,ne,ue,D]}],container:["container"],"container-type":[{"@container":["","normal","size",ue,ne]}],"container-named":[B_],columns:[{columns:[_e,"auto",ne,ue,p]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:de()}],"overflow-x":[{"overflow-x":de()}],"overflow-y":[{"overflow-y":de()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",ue,ne]}],basis:[{basis:[Ja,"full","auto",p,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Ja,"auto","initial","none",ne]}],grow:[{grow:["",_e,ue,ne]}],shrink:[{shrink:["",_e,ue,ne]}],order:[{order:[Xl,"first","last","none",ue,ne]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":Fe()}],"col-end":[{"col-end":Fe()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":Fe()}],"row-end":[{"row-end":Fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Ne(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...Ne()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ne()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[p,"screen",...ee()]}],"min-w":[{"min-w":[p,"screen","none",...ee()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[d]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",s,lr,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,J_,G_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ad,ne]}],"font-family":[{font:[X_,Y_,r]}],"font-features":[{"font-features":[ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[f,ue,ne]}],"line-clamp":[{"line-clamp":[_e,"none",ue,rg]}],leading:[{leading:["none",m,...U()]}],"list-image":[{"list-image":["none",ue,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ue,zn]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[_e,"auto",ue,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Xl,ue,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue,ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ke()}],"bg-repeat":[{bg:Nt()}],"bg-size":[{bg:Rl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,ue,ne],radial:["",ue,ne],conic:["",Xl,ue,ne]},Z_,V_]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:C()}],"gradient-via-pos":[{via:C()}],"gradient-to-pos":[{to:C()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ue,ne]}],"outline-w":[{outline:["",_e,lr,zn]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","inner","none",x,Zs,Ks]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",g,Zs,Ks]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[_e,zn]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,Zs,Ks]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[_e,ue,ne]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[ue,ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":J()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ke()}],"mask-repeat":[{mask:Nt()}],"mask-size":[{mask:Rl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ne]}],filter:[{filter:["","none",ue,ne]}],blur:[{blur:Ae()}],brightness:[{brightness:[_e,ue,ne]}],contrast:[{contrast:[_e,ue,ne]}],"drop-shadow":[{"drop-shadow":["","none",k,Zs,Ks]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",_e,ue,ne]}],"hue-rotate":[{"hue-rotate":[_e,ue,ne]}],invert:[{invert:["",_e,ue,ne]}],saturate:[{saturate:[_e,ue,ne]}],sepia:[{sepia:["",_e,ue,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ne]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ue,ne]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ue,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ue,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ue,ne]}],"backdrop-invert":[{"backdrop-invert":["",_e,ue,ne]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ue,ne]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ue,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ue,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ue,ne]}],ease:[{ease:["linear","initial",H,ue,ne]}],delay:[{delay:[_e,ue,ne]}],animate:[{animate:["none",Q,ue,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[q,ue,ne]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Vt()}],"skew-x":[{"skew-x":Vt()}],"skew-y":[{"skew-y":Vt()}],transform:[{transform:[ue,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ga()}],"translate-x":[{"translate-x":ga()}],"translate-y":[{"translate-y":ga()}],"translate-z":[{"translate-z":ga()}],"translate-none":["translate-none"],zoom:[{zoom:[Xl,ue,ne]}],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue,ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":X()}],"scrollbar-track-color":[{"scrollbar-track":X()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue,ne]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[_e,lr,zn,rg]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},P_=j_($_);function gl(...n){return P_(A0(n))}const W_=u_("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors select-none disabled:pointer-events-none disabled:opacity-45",{variants:{variant:{primary:"bg-brand text-white hover:bg-brand-hover shadow-card",secondary:"bg-surface text-ink-1 border border-line hover:bg-surface-3 hover:border-line-strong",ghost:"text-ink-2 hover:bg-surface-3 hover:text-ink-1",subtle:"bg-brand-subtle text-brand-text hover:brightness-[0.97]",danger:"bg-danger text-white hover:brightness-110","danger-ghost":"text-danger hover:bg-danger-subtle"},size:{sm:"h-7 px-2.5 text-[12px]",md:"h-8 px-3 text-[13px]",lg:"h-9 px-4 text-sm",icon:"h-8 w-8 p-0","icon-sm":"h-7 w-7 p-0"}},defaultVariants:{variant:"secondary",size:"md"}}),zt=E.forwardRef(function({className:r,variant:s,size:o,...f},m){return h.jsx("button",{ref:m,className:gl(W_({variant:s,size:o}),r),...f})}),Z0="w-full rounded-md border border-line bg-surface px-2.5 text-[13px] text-ink-1 placeholder:text-ink-3 transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",nt=E.forwardRef(function({className:r,...s},o){return h.jsx("input",{ref:o,className:gl(Z0,"h-8",r),...s})}),Cd=E.forwardRef(function({className:r,...s},o){return h.jsx("textarea",{ref:o,className:gl(Z0,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function De({label:n,required:r,hint:s,className:o,children:f}){return h.jsxs("div",{className:gl("flex flex-col gap-1.5",o),children:[h.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&h.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const ml=E.forwardRef(function({className:r,options:s,children:o,...f},m){return h.jsxs("div",{className:gl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[h.jsx("select",{ref:m,className:gl("w-full h-8 appearance-none rounded-md border border-line bg-surface pl-2.5 pr-7 text-[13px] text-ink-1","transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50",r),...f,children:s?s.map(d=>h.jsx("option",{value:d.value,children:d.label},d.value)):o}),h.jsx(J3,{size:14,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-ink-3"})]})});function Ii({className:n,color:r,...s}){return h.jsx("span",{className:gl("inline-flex items-center gap-1 rounded-sm border px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",n),style:r?{color:r,borderColor:r+"44",backgroundColor:r+"14"}:void 0,...s})}function I_({className:n,...r}){return h.jsx("span",{className:gl("inline-flex items-center gap-1 rounded-sm border border-line bg-surface-2 px-1.5 py-px text-[11px] leading-[18px] font-medium text-ink-2 whitespace-nowrap",n),...r})}function so({open:n,onClose:r,title:s,width:o=560,children:f,footer:m}){return E.useEffect(()=>{if(!n)return;const d=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n,r]),n?KS.createPortal(h.jsxs("div",{className:"fixed inset-0 z-50 flex justify-center overflow-y-auto p-3 sm:p-6",children:[h.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),h.jsxs("div",{className:"animate-in relative my-auto w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:o},role:"dialog",children:[h.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[h.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),h.jsx(zt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:h.jsx(g0,{size:15})})]}),h.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-3 py-3 sm:px-4 sm:py-4",children:f}),m&&h.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-3 py-2.5 sm:h-14 sm:flex-nowrap sm:px-4 sm:py-0",children:m})]})]}),document.body):null}function e5({icon:n,title:r,description:s,action:o}){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[h.jsx("div",{className:"text-ink-3",children:n??h.jsx(xE,{size:36,strokeWidth:1.5})}),h.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&h.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),o&&h.jsx("div",{className:"mt-2",children:o})]})}const J0=E.createContext(()=>{});function oo(){return E.useContext(J0)}const t5={success:h.jsx(W3,{size:15,className:"text-success"}),error:h.jsx($3,{size:15,className:"text-danger"}),info:h.jsx(EE,{size:15,className:"text-brand"})};function l5({children:n}){const[r,s]=E.useState([]),o=E.useRef(0),f=E.useCallback((m,d)=>{const p=++o.current;s(b=>[...b,{id:p,kind:m,text:d}]),setTimeout(()=>s(b=>b.filter(v=>v.id!==p)),3200)},[]);return h.jsxs(J0.Provider,{value:f,children:[n,h.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(m=>h.jsxs("div",{className:gl("pointer-events-auto flex items-center gap-2 rounded-md border border-line bg-surface px-3 py-2 text-[13px] text-ink-1 shadow-pop","animate-in"),children:[t5[m.kind],m.text]},m.id))})]})}function a5({open:n,title:r,content:s,onCancel:o,onOk:f,loading:m}){return h.jsx(so,{open:n,onClose:o,title:r,width:420,footer:h.jsxs(h.Fragment,{children:[h.jsx(zt,{variant:"secondary",onClick:o,children:"取消"}),h.jsx(zt,{variant:"danger",onClick:f,disabled:m,children:"确认"})]}),children:h.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function n5({size:n=44}){return h.jsxs("svg",{width:n,height:n,viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function i5({open:n,onClose:r,defaultUrl:s}){const o=lu(),f=oo(),[m,d]=E.useState("login"),[p,b]=E.useState(s||"https://footpr.linyux.cn"),[v,x]=E.useState(""),[g,_]=E.useState(""),[k,K]=E.useState(""),[q,D]=E.useState(""),[H,Q]=E.useState(!1),Z=async()=>{if(!v.trim()||!g){D("请填写账号与密码");return}let J=p.trim();J&&!J.startsWith("http")&&(J="https://"+J),Q(!0),D("");try{if(m==="login")await $d(v.trim(),g,J);else{if(!k.trim())throw new Error("请填写邀请码");await Pd(v.trim(),g,k.trim(),J)}o.invalidateQueries(),f("success",m==="login"?"已登录 · 同步已开启":"已注册登录 · 同步已开启"),r(),setTimeout(()=>window.location.reload(),300)}catch(Y){D(Y.message)}finally{Q(!1)}};return n?h.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-bg/95",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(n5,{}),h.jsx("div",{className:"text-[17px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[10px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("login"),D("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("register"),D("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(De,{label:"服务器地址",hint:"与网页版同一账号体系",children:h.jsx(nt,{value:p,onChange:J=>b(J.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:v,onChange:J=>x(J.target.value),placeholder:"3-32 位字母数字-_"})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:g,onChange:J=>_(J.target.value),placeholder:"至少 8 位"})}),m==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:k,onChange:J=>K(J.target.value),placeholder:"邀请码"})}),q&&h.jsx("div",{className:"text-[12px] text-danger",children:q}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void Z(),disabled:H,children:H?"请稍候…":m==="login"?"登录并同步":"注册并同步"}),h.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"登录后本机数据将多端同步"})]})]})}):null}const u5=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:m0},{to:"/records",label:"记录",icon:PE},{to:"/grades",label:"成绩",icon:p0},{to:"/dashboard",label:"统计",icon:K3}]},{section:"个人",items:[{to:"/profile",label:"个人信息",icon:b4},{to:"/resume",label:"我的简历",icon:IE},{to:"/assessment",label:"综合测评",icon:eE}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:r4},{to:"/types",label:"记录类型",icon:a4},{to:"/taxonomy",label:"字典与维度",icon:o4}]}];function r5(){return h.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"0",y2:"26",children:[h.jsx("stop",{stopColor:"#4359e8"}),h.jsx("stop",{offset:"1",stopColor:"#2a3ab8"})]})}),h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"7",fill:"url(#lg)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:".95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:".7"})]})}function s5({open:n,onClose:r}){const s=lu(),f=yl({queryKey:["me",pl()??""],refetchOnMount:"always",queryFn:()=>b0(),enabled:!!pl(),retry:0}).data??null,[m,d]=E.useState(!1);return h.jsxs("aside",{className:gl("no-print","flex w-[236px] shrink-0 flex-col border-r border-line bg-surface","max-lg:fixed max-lg:inset-y-0 max-lg:left-0 max-lg:z-40 max-lg:transition-transform",n?"max-lg:translate-x-0":"max-lg:-translate-x-full"),children:[h.jsx(i5,{open:m,onClose:()=>d(!1),defaultUrl:"https://footpr.linyux.cn"}),h.jsxs("div",{className:"flex h-[60px] items-center gap-3 border-b border-line px-5",children:[h.jsx(r5,{}),h.jsxs("div",{className:"leading-tight",children:[h.jsx("div",{className:"text-[15px] font-bold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[9px] font-medium tracking-[0.24em] text-ink-3",children:"FOOTPRINTS"})]})]}),h.jsx("nav",{className:"flex-1 overflow-y-auto px-2.5 py-4",children:u5.map(p=>h.jsxs("div",{className:"mb-5",children:[h.jsx("div",{className:"px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-ink-3",children:p.section}),h.jsx("div",{className:"flex flex-col gap-0.5",children:p.items.map(b=>h.jsxs(e0,{to:b.to,onClick:r,className:({isActive:v})=>gl("relative flex h-[34px] items-center gap-3 rounded-lg px-3 text-[13px] font-medium transition-all duration-150",v?"bg-brand-subtle text-brand-text nav-active":"text-ink-2 hover:bg-surface-3 hover:text-ink-1"),children:[h.jsx(b.icon,{size:16,strokeWidth:1.8}),b.label]},b.to))})]},p.section))}),h.jsx("div",{className:"border-t border-line px-3 py-3",children:pl()&&f?h.jsxs("div",{className:"rounded-lg bg-surface-2 px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-brand text-[10px] font-bold text-white",children:f.username.charAt(0).toUpperCase()}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"truncate text-[12px] font-semibold text-ink-1",title:f.username,children:f.username}),f.is_admin&&h.jsx("div",{className:"text-[10px] text-brand-text",children:"管理员"})]})]}),h.jsx("button",{className:"shrink-0 rounded p-1 text-ink-3 transition-colors hover:bg-surface-3 hover:text-danger",title:"退出登录",onClick:()=>{Fd(),s.clear(),window.location.reload()},children:h.jsx(OE,{size:13})})]}),h.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[10px] text-success",children:[h.jsx(lE,{size:10}),"云端同步已开启"]})]}):h.jsxs("button",{className:"flex w-full items-center justify-center gap-2 rounded-lg border border-brand/30 bg-brand-subtle px-3 py-2 text-[13px] font-medium text-brand-text transition-all hover:shadow-brand",onClick:()=>d(!0),children:[h.jsx(jE,{size:14}),"登录我的档案"]})})]})}const o5={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function c5({onMenu:n}){const{pathname:r}=bl(),s=no(),[o,f]=E.useState(""),[m,d]=E.useState(document.documentElement.classList.contains("dark")),p=o5[r]??{title:""},b=()=>{const v=!m;d(v),document.documentElement.classList.toggle("dark",v),localStorage.setItem("fp-theme",v?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return h.jsxs("header",{className:"no-print flex h-14 shrink-0 items-center gap-2 border-b border-line bg-surface px-3 sm:gap-4 sm:px-5",children:[h.jsx(zt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:h.jsx(AE,{size:17})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:p.title}),p.sub&&h.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:p.sub})]}),h.jsxs("div",{className:"relative ml-auto hidden w-[240px] md:block lg:w-[280px]",children:[h.jsx(t4,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),h.jsx(nt,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:o,onChange:v=>f(v.target.value),onKeyDown:v=>{v.key==="Enter"&&o.trim()&&s("/records?q="+encodeURIComponent(o.trim()))}})]}),h.jsx(zt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:m?h.jsx(h4,{size:15}):h.jsx(kE,{size:15})}),h.jsxs(zt,{variant:"primary",onClick:()=>s("/records?new=1"),"aria-label":"新建记录",children:[h.jsx(ZE,{size:14}),h.jsx("span",{className:"hidden sm:inline",children:"新建记录"})]})]})}function f5(){return h.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function d5(){const[n,r]=E.useState("login"),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,p]=E.useState(""),[b,v]=E.useState(""),[x,g]=E.useState(!1),_="__TAURI_INTERNALS__"in window,[k,K]=E.useState(Ol()),q=H=>{K(H),S0(H)},D=async()=>{if(!s.trim()||!f){v("请填写账号与密码");return}g(!0),v("");try{if(n==="login")await $d(s.trim(),f,k);else{if(!d.trim())throw new Error("请填写邀请码");await Pd(s.trim(),f,d.trim(),k)}setTimeout(()=>window.location.reload(),200)}catch(H){v(H.message)}finally{g(!1)}};return h.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(f5,{}),h.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("login"),v("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("register"),v("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[_&&h.jsx(De,{label:"服务器地址",hint:"默认即可",children:h.jsx(nt,{value:k,onChange:H=>q(H.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:s,onChange:H=>o(H.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:H=>{H.key==="Enter"&&D()}})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:f,onChange:H=>m(H.target.value),placeholder:"至少 8 位",onKeyDown:H=>{H.key==="Enter"&&D()}})}),n==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:d,onChange:H=>p(H.target.value),placeholder:"邀请码",onKeyDown:H=>{H.key==="Enter"&&D()}})}),b&&h.jsx("div",{className:"text-[12px] text-danger",children:b}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void D(),disabled:x,children:x?"请稍候…":n==="login"?"进入我的档案":"创建我的档案"}),h.jsx("button",{type:"button",className:"mt-1 flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line px-3 py-2 text-[11.5px] text-ink-3 transition-colors hover:border-brand/40 hover:text-brand-text",onClick:()=>{o("demo"),m("demo1234")},children:"演示账号:demo / demo1234(点击填充)"})]})]})})}function h5(){const[n,r]=E.useState(()=>!!pl()),[s,o]=E.useState(!1);return E.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?h.jsx(l5,{children:h.jsxs("div",{className:"flex h-full",children:[s&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>o(!1),"aria-hidden":!0}),h.jsx(s5,{open:s,onClose:()=>o(!1)}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[h.jsx(c5,{onMenu:()=>o(!0)}),h.jsx("main",{className:"app-scroll min-h-0 flex-1 overflow-y-auto",children:h.jsx(cS,{})})]})]})}):h.jsx(d5,{})}const Gn="inline-flex h-[22px] min-w-[52px] items-center justify-center gap-1 rounded-sm border px-2 text-[11.5px] font-medium whitespace-nowrap",cg={draft:{label:"草稿",color:"var(--text-3)",bg:"var(--surface-3)"},ongoing:{label:"进行中",color:"var(--brand-text)",bg:"var(--brand-subtle)"},submitted:{label:"已提交待果",color:"var(--warning)",bg:"var(--warning-subtle)"},finished:{label:"已完结",color:"var(--success)",bg:"var(--success-subtle)"}};function F0({status:n}){const r=cg[n]??cg.draft;return h.jsx("span",{className:Gn+" border-transparent",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const m5={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function $0({level:n}){return n?h.jsx(Ii,{color:m5[n]??"var(--text-3)",className:Gn,children:n}):null}const y5={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function P0({grade:n}){return n?h.jsx(Ii,{color:y5[n]??"var(--text-3)",className:Gn,children:n}):null}function W0({role:n}){return n?h.jsx(I_,{className:Gn,children:n}):null}function I0(){return h.jsx(Ii,{color:"var(--danger)",className:Gn,children:"负面"})}const Z5=[{name:"tag",label:"通用"},{name:"graduation-cap",label:"学业"},{name:"trophy",label:"竞赛"},{name:"flask-conical",label:"科研"},{name:"briefcase",label:"实习"},{name:"network",label:"学生工作"},{name:"heart-handshake",label:"志愿"},{name:"palette",label:"文体"},{name:"award",label:"荣誉"},{name:"file-badge",label:"证书"},{name:"star",label:"收藏"},{name:"shield-alert",label:"惩处"},{name:"book-open",label:"阅读"},{name:"code-2",label:"技术"},{name:"languages",label:"语言"},{name:"mic-2",label:"文艺"},{name:"pen-line",label:"发表"},{name:"rocket",label:"项目"},{name:"users",label:"团队"},{name:"building-2",label:"组织"},{name:"dumbbell",label:"体育"}],p5={tag:v0,"graduation-cap":p0,trophy:v4,"flask-conical":hE,briefcase:Q3,network:qE,"heart-handshake":pE,palette:BE,award:H3,"file-badge":cE,star:f4,"shield-alert":i4,"book-open":L3,"code-2":nE,languages:TE,"mic-2":DE,"pen-line":YE,rocket:FE,users:S4,"building-2":Y3,dumbbell:sE};function v5({name:n,color:r,size:s=14,className:o}){const f=p5[n]??v0;return h.jsx(f,{size:s,color:r,className:o,strokeWidth:2})}const fg=new Map,g5=25*1024*1024;async function b5(n){const r=fg.get(n.id);if(r)return r;const s=await eo(n.id);return(n.size??0)<=g5&&fg.set(n.id,s),s}function dg(n){const r=(n.mime||"").toLowerCase(),s=(n.file_name.split(".").pop()||"").toLowerCase();return r.startsWith("image/")||["png","jpg","jpeg","gif","webp","bmp","svg"].includes(s)?"image":r==="application/pdf"||s==="pdf"?"pdf":s==="docx"||r.includes("wordprocessingml")?"docx":s==="xlsx"||s==="xls"||r.includes("spreadsheetml")||r==="application/vnd.ms-excel"?"xlsx":r.startsWith("audio/")||["mp3","wav","m4a","flac","ogg"].includes(s)?"audio":r.startsWith("video/")||["mp4","mov","webm","mkv"].includes(s)?"video":r.startsWith("text/")||["txt","md","csv","json","log","srt"].includes(s)?"text":"other"}function x5(n){return Uint8Array.from(atob(n),r=>r.charCodeAt(0))}const S5={image:"图片",pdf:"PDF 文档",text:"文本文件",audio:"音频",video:"视频",docx:"Word 文档(.docx)",xlsx:"Excel 表格(.xlsx)",other:"该类型暂不支持在线预览"};function e1({att:n,onClose:r}){const s=oo(),[o,f]=E.useState(!1),[m,d]=E.useState(""),[p,b]=E.useState(null);E.useEffect(()=>{if(!n){b(null),d("");return}let x=!1;const g=[];return f(!0),d(""),b(null),(async()=>{try{const _=dg(n),k=n.remote_url||null;if(k&&(_==="image"||_==="pdf"||_==="audio"||_==="video")){b({kind:_,objectUrl:k}),f(!1);return}let K=n.mime??void 0,q;if(k)q=new Uint8Array(await(await fetch(k)).arrayBuffer());else{const D=await b5(n);K=D.mime,q=x5(D.data_b64)}if(x)return;if(_==="text"){const D=new TextDecoder().decode(q);b({kind:_,text:D.length>4e5?D.slice(0,4e5)+` -…(已截断)`:D})}else if(_==="docx"){const H=(await(await vl(()=>import("./mammoth.browser-BLgWCU1X.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await vl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const v=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:v==="image"||v==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+S5[v]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(uE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(CE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&p&&h.jsxs(h.Fragment,{children:[p.kind==="image"&&h.jsx("img",{src:p.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),p.kind==="pdf"&&h.jsx("iframe",{src:p.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),p.kind==="audio"&&h.jsx("audio",{controls:!0,src:p.objectUrl,className:"w-full"}),p.kind==="video"&&h.jsx("video",{controls:!0,src:p.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),p.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:p.text}),(p.kind==="docx"||p.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:p.html||""}}),p.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function E5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const p=o.trim();p&&!n.includes(p)&&r([...n,p]),f("")},d=p=>{p.key==="Enter"||p.key===","?(p.preventDefault(),m()):p.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:gl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(p=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[p,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==p)),children:h.jsx(g0,{size:11})})]},p)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:p=>f(p.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function _5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,p)=>s({...r,[d]:p}),m=d=>{const p=r[d.key],b=d.required&&(p==null||p==="")?"该项必填":"",v=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(Cd,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:v(h.jsx(nt,{type:"number",step:"any",className:"num",value:p==null?"":String(p),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(p??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(p??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(p)?p:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function T5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function wd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const p=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*p)),v=Math.max(1,Math.round(d.naturalHeight*p)),x=document.createElement("canvas");x.width=b,x.height=v;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,v),f(x.toDataURL("image/webp",o))}catch(p){m(p instanceof Error?p:new Error(String(p)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const p=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var v;return(v=p.current)==null?void 0:v.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:v=>{var x;(x=v.target.files)!=null&&x.length&&s(v.target.files),v.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(v=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(v),title:v.file_name,children:v.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(v.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(v.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+v.id)),r.map((v,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=v.mime)!=null&&g.startsWith("image/")&&v.preview?h.jsx("img",{src:v.preview,alt:v.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(gE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:v.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(v.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function pg(n){var d,p,b,v;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(v=n.type)!=null&&v.startsWith("image/")?URL.createObjectURL(n):void 0}}const Ps={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},vg={core:["level","role","award_grade","organizer"]},J5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys(Ps).map(n=>({value:n,label:n+"式布局"}))];function N5(n,r){return r&&Ps[r]?Ps[r]:n?Ps[n]??vg:vg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},C5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,w5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function j5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Ne,re,V,ee;const f=lu(),m=oo(),[d,p]=E.useState(gg),[b,v]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:ro,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>C0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=N5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),v([]),s&&Z.data){const R=Z.data.item;p({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else p(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>p(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>w0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...C5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:w5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(_5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(Cd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(Cd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(E5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Ne=Q.data)==null?void 0:Ne.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await pg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await pg(X))}v(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>v(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function z5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),p=yl({queryKey:["types"],queryFn:ro,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),v=(U=d.data)==null?void 0:U.item,x=(I=p.data)==null?void 0:I.items.find(ie=>ie.id===(v==null?void 0:v.type_id)),g=((v==null?void 0:v.dimensions)??[]).map(ie=>{var Ne,re;return(re=(Ne=b.data)==null?void 0:Ne.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>vl(()=>Promise.resolve().then(()=>i_),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(v==null?void 0:v.attachments)??[],J=Z.filter(ie=>{var Ne;return(Ne=ie.mime)==null?void 0:Ne.startsWith("image/")}),Y=Z.filter(ie=>{var Ne;return!((Ne=ie.mime)!=null&&Ne.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Ne=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Ne){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await eo(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await eo(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(v&&x)for(const ie of x.form_template??[]){const Ne=(v.extras??{})[ie.key];if(Ne==null||Ne==="")continue;const re=Array.isArray(Ne)?Ne.join("、"):String(Ne);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:v?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(XE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!v?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:v.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:v.type_color,className:Gn,children:v.type_name}),h.jsx($0,{level:v.level}),h.jsx(P0,{grade:v.award_grade}),h.jsx(W0,{role:v.role}),h.jsx(F0,{status:v.status}),v.polarity==="negative"&&h.jsx(I0,{}),v.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",v.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:T5(v.start_date,v.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:v.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=v.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=v.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),v.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:v.description})}),v.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:v.result})}),v.metrics&&Object.keys(v.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(v.metrics).map(([ie,Ne])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Ne})]},ie))})}),((((Fe=v.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(v.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(v.updated_at)]}),v.group_id&&h.jsxs("span",{children:["事件组 ",v.group_id]}),v.parent_id!=null&&h.jsxs("span",{children:["上级 #",v.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(a5,{open:_,title:"删除记录",content:v?"确定删除「"+v.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function O5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,p]=E.useState(""),[b,v]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:ro}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>p(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(R5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx(e5,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(z5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),v(U),g(!0)}}),h.jsx(j5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function R5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(v5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const A5=E.lazy(()=>vl(()=>import("./RecordsPage-P1KGDld8.js"),[]).then(n=>({default:n.RecordsPage}))),M5=E.lazy(()=>vl(()=>import("./DashboardPage-BQFeFR8x.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),D5=E.lazy(()=>vl(()=>import("./GradesPage-BUHN14mZ.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),U5=E.lazy(()=>vl(()=>import("./TypesPage-DxXV3aWW.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),k5=E.lazy(()=>vl(()=>import("./TaxonomyPage-C83kP-EQ.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),H5=E.lazy(()=>vl(()=>import("./AdminPage-BqF0Bkw4.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage}))),q5=E.lazy(()=>vl(()=>import("./ProfilePage-Blh11W5U.js"),[]).then(n=>({default:n.ProfilePage}))),L5=E.lazy(()=>vl(()=>import("./ResumePage-D6LTsd6o.js"),__vite__mapDeps([8,1,9])).then(n=>({default:n.ResumePage}))),B5=E.lazy(()=>vl(()=>import("./AssessmentPage-CIzQ48Ah.js"),__vite__mapDeps([10,9])).then(n=>({default:n.AssessmentPage})));function da(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function Q5(){return h.jsx(dS,{children:h.jsxs(Yt,{element:h.jsx(h5,{}),children:[h.jsx(Yt,{path:"/",element:h.jsx(Vv,{to:"/timeline",replace:!0})}),h.jsx(Yt,{path:"/timeline",element:h.jsx(O5,{})}),h.jsx(Yt,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(A5,{})})}),h.jsx(Yt,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(D5,{})})}),h.jsx(Yt,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(M5,{})})}),h.jsx(Yt,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(U5,{})})}),h.jsx(Yt,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(k5,{})})}),h.jsx(Yt,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(H5,{})})}),h.jsx(Yt,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(q5,{})})}),h.jsx(Yt,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(L5,{})})}),h.jsx(Yt,{path:"/assessment",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(B5,{})})}),h.jsx(Yt,{path:"*",element:h.jsx(Vv,{to:"/timeline",replace:!0})})]})})}const G5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:G5,children:h.jsx(HS,{children:h.jsx(Q5,{})})})}));export{Ol as $,B4 as A,zt as B,a5 as C,H4 as D,e5 as E,q4 as F,P0 as G,so as H,nt as I,De as J,L4 as K,$0 as L,k4 as M,v5 as N,N4 as O,ZE as P,Z5 as Q,W0 as R,ml as S,Ed as T,J5 as U,C4 as V,w4 as W,j4 as X,z4 as Y,O4 as Z,Wd as _,gl as a,pl as a0,g0 as a1,wd as a2,J4 as a3,F4 as a4,$4 as a5,I4 as a6,W4 as a7,P4 as a8,vl as a9,Z4 as aa,K4 as ab,b4 as ac,Cd as ad,n_ as ae,a_ as af,l_ as ag,uE as ah,C0 as ai,z0 as aj,y0 as ak,V5 as al,Ag as am,i_ as an,KS as b,pe as c,oo as d,X5 as e,yl as f,Sd as g,T5 as h,F0 as i,h as j,mg as k,XE as l,Ii as m,z5 as n,j5 as o,R4 as p,ro as q,E as r,E0 as s,A4 as t,lu as u,_0 as v,p0 as w,Q4 as x,G4 as y,t_ as z}; +…(已截断)`:D})}else if(_==="docx"){const H=(await(await vl(()=>import("./mammoth.browser-CNmNgOI4.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await vl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const v=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:v==="image"||v==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+S5[v]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(uE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(CE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&p&&h.jsxs(h.Fragment,{children:[p.kind==="image"&&h.jsx("img",{src:p.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),p.kind==="pdf"&&h.jsx("iframe",{src:p.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),p.kind==="audio"&&h.jsx("audio",{controls:!0,src:p.objectUrl,className:"w-full"}),p.kind==="video"&&h.jsx("video",{controls:!0,src:p.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),p.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:p.text}),(p.kind==="docx"||p.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:p.html||""}}),p.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function E5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const p=o.trim();p&&!n.includes(p)&&r([...n,p]),f("")},d=p=>{p.key==="Enter"||p.key===","?(p.preventDefault(),m()):p.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:gl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(p=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[p,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==p)),children:h.jsx(g0,{size:11})})]},p)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:p=>f(p.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function _5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,p)=>s({...r,[d]:p}),m=d=>{const p=r[d.key],b=d.required&&(p==null||p==="")?"该项必填":"",v=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(Cd,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:v(h.jsx(nt,{type:"number",step:"any",className:"num",value:p==null?"":String(p),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(p??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(p??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(p)?p:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(p??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function T5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function wd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const p=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*p)),v=Math.max(1,Math.round(d.naturalHeight*p)),x=document.createElement("canvas");x.width=b,x.height=v;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,v),f(x.toDataURL("image/webp",o))}catch(p){m(p instanceof Error?p:new Error(String(p)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const p=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var v;return(v=p.current)==null?void 0:v.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:v=>{var x;(x=v.target.files)!=null&&x.length&&s(v.target.files),v.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(v=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(v),title:v.file_name,children:v.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(v.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(v.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+v.id)),r.map((v,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=v.mime)!=null&&g.startsWith("image/")&&v.preview?h.jsx("img",{src:v.preview,alt:v.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(gE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:v.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(v.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function pg(n){var d,p,b,v;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(v=n.type)!=null&&v.startsWith("image/")?URL.createObjectURL(n):void 0}}const Ps={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},vg={core:["level","role","award_grade","organizer"]},J5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys(Ps).map(n=>({value:n,label:n+"式布局"}))];function N5(n,r){return r&&Ps[r]?Ps[r]:n?Ps[n]??vg:vg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},C5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,w5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function j5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Ne,re,V,ee;const f=lu(),m=oo(),[d,p]=E.useState(gg),[b,v]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:ro,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>C0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=N5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),v([]),s&&Z.data){const R=Z.data.item;p({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else p(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>p(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>w0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...C5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:w5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(_5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(Cd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(Cd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(E5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Ne=Q.data)==null?void 0:Ne.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await pg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await pg(X))}v(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>v(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function z5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),p=yl({queryKey:["types"],queryFn:ro,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),v=(U=d.data)==null?void 0:U.item,x=(I=p.data)==null?void 0:I.items.find(ie=>ie.id===(v==null?void 0:v.type_id)),g=((v==null?void 0:v.dimensions)??[]).map(ie=>{var Ne,re;return(re=(Ne=b.data)==null?void 0:Ne.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>vl(()=>Promise.resolve().then(()=>i_),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(v==null?void 0:v.attachments)??[],J=Z.filter(ie=>{var Ne;return(Ne=ie.mime)==null?void 0:Ne.startsWith("image/")}),Y=Z.filter(ie=>{var Ne;return!((Ne=ie.mime)!=null&&Ne.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Ne=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Ne){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await eo(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await eo(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(v&&x)for(const ie of x.form_template??[]){const Ne=(v.extras??{})[ie.key];if(Ne==null||Ne==="")continue;const re=Array.isArray(Ne)?Ne.join("、"):String(Ne);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:v?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(XE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!v?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:v.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:v.type_color,className:Gn,children:v.type_name}),h.jsx($0,{level:v.level}),h.jsx(P0,{grade:v.award_grade}),h.jsx(W0,{role:v.role}),h.jsx(F0,{status:v.status}),v.polarity==="negative"&&h.jsx(I0,{}),v.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",v.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:T5(v.start_date,v.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:v.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=v.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=v.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:wd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),v.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:v.description})}),v.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:v.result})}),v.metrics&&Object.keys(v.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(v.metrics).map(([ie,Ne])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Ne})]},ie))})}),((((Fe=v.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(v.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(v.updated_at)]}),v.group_id&&h.jsxs("span",{children:["事件组 ",v.group_id]}),v.parent_id!=null&&h.jsxs("span",{children:["上级 #",v.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(a5,{open:_,title:"删除记录",content:v?"确定删除「"+v.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function O5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,p]=E.useState(""),[b,v]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:ro}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>p(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(R5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx(e5,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(z5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),v(U),g(!0)}}),h.jsx(j5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function R5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(v5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const A5=E.lazy(()=>vl(()=>import("./RecordsPage-Dobdj8A6.js"),[]).then(n=>({default:n.RecordsPage}))),M5=E.lazy(()=>vl(()=>import("./DashboardPage-DEMHppda.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),D5=E.lazy(()=>vl(()=>import("./GradesPage-Dza_nNMi.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),U5=E.lazy(()=>vl(()=>import("./TypesPage-C26iumiS.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),k5=E.lazy(()=>vl(()=>import("./TaxonomyPage-DT0lqT-7.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),H5=E.lazy(()=>vl(()=>import("./AdminPage-DXoVmoIt.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage}))),q5=E.lazy(()=>vl(()=>import("./ProfilePage-DaXiKJFl.js"),[]).then(n=>({default:n.ProfilePage}))),L5=E.lazy(()=>vl(()=>import("./ResumePage-BWRRWx8h.js"),__vite__mapDeps([8,1,9])).then(n=>({default:n.ResumePage}))),B5=E.lazy(()=>vl(()=>import("./AssessmentPage-zL5UB5l9.js"),__vite__mapDeps([10,9])).then(n=>({default:n.AssessmentPage})));function da(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function Q5(){return h.jsx(dS,{children:h.jsxs(Yt,{element:h.jsx(h5,{}),children:[h.jsx(Yt,{path:"/",element:h.jsx(Vv,{to:"/timeline",replace:!0})}),h.jsx(Yt,{path:"/timeline",element:h.jsx(O5,{})}),h.jsx(Yt,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(A5,{})})}),h.jsx(Yt,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(D5,{})})}),h.jsx(Yt,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(M5,{})})}),h.jsx(Yt,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(U5,{})})}),h.jsx(Yt,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(k5,{})})}),h.jsx(Yt,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(H5,{})})}),h.jsx(Yt,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(q5,{})})}),h.jsx(Yt,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(L5,{})})}),h.jsx(Yt,{path:"/assessment",element:h.jsx(E.Suspense,{fallback:h.jsx(da,{}),children:h.jsx(B5,{})})}),h.jsx(Yt,{path:"*",element:h.jsx(Vv,{to:"/timeline",replace:!0})})]})})}const G5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:G5,children:h.jsx(HS,{children:h.jsx(Q5,{})})})}));export{Ol as $,B4 as A,zt as B,a5 as C,H4 as D,e5 as E,q4 as F,P0 as G,so as H,nt as I,De as J,L4 as K,$0 as L,k4 as M,v5 as N,N4 as O,ZE as P,Z5 as Q,W0 as R,ml as S,Ed as T,J5 as U,C4 as V,w4 as W,j4 as X,z4 as Y,O4 as Z,Wd as _,gl as a,pl as a0,g0 as a1,wd as a2,J4 as a3,F4 as a4,$4 as a5,I4 as a6,W4 as a7,P4 as a8,vl as a9,Z4 as aa,K4 as ab,b4 as ac,Cd as ad,n_ as ae,a_ as af,l_ as ag,uE as ah,C0 as ai,z0 as aj,y0 as ak,V5 as al,Ag as am,i_ as an,KS as b,pe as c,oo as d,X5 as e,yl as f,Sd as g,T5 as h,F0 as i,h as j,mg as k,XE as l,Ii as m,z5 as n,j5 as o,R4 as p,ro as q,E as r,E0 as s,A4 as t,lu as u,_0 as v,p0 as w,Q4 as x,G4 as y,t_ as z}; diff --git a/sync-server/www/assets/mammoth.browser-BLgWCU1X.js b/sync-server/www/assets/mammoth.browser-CNmNgOI4.js similarity index 99% rename from sync-server/www/assets/mammoth.browser-BLgWCU1X.js rename to sync-server/www/assets/mammoth.browser-CNmNgOI4.js index c35ff3b..927e182 100644 --- a/sync-server/www/assets/mammoth.browser-BLgWCU1X.js +++ b/sync-server/www/assets/mammoth.browser-CNmNgOI4.js @@ -1,4 +1,4 @@ -import{al as dt,am as mn}from"./index-Bmyzyg8t.js";function vn(ut,Et){for(var P=0;Poe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;goe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;g0&&(Ee=X.concat(Ee),X=[]),r.map(ne(fe),K(Ee),function(Se,Me){return new a.Paragraph(Me,Se)}).insertExtra()},"w:r":function(re){return r.map(ie(re.firstOrEmpty("w:rPr")),K(re.children),function(fe,_e){var Ee=Ie();return Ee!==null&&(_e=[new a.Hyperlink(_e,Ee)]),new a.Run(_e,fe)})},"w:fldChar":be,"w:instrText":Le,"w:t":function(re){return c(new a.Text(re.text()))},"w:tab":function(re){return c(new a.Tab)},"w:noBreakHyphen":function(){return c(new a.Text("‑"))},"w:softHyphen":function(re){return c(new a.Text("­"))},"w:sym":Be,"w:hyperlink":function(re){var fe=re.attributes["r:id"],_e=re.attributes["w:anchor"];return K(re.children).map(function(Ee){function Se(Pe){var Fe=re.attributes["w:tgtFrame"]||null;return new a.Hyperlink(Ee,E.extend({targetFrame:Fe},Pe))}if(fe){var Me=x.findTargetByRelationshipId(fe);return _e&&(Me=e.replaceFragment(Me,_e)),Se({href:Me})}else return _e?Se({anchor:_e}):Ee})},"w:tbl":l,"w:tr":o,"w:tc":D,"w:footnoteReference":f("footnote"),"w:endnoteReference":f("endnote"),"w:commentReference":$,"w:br":function(re){var fe=re.attributes["w:type"];return fe==null||fe==="textWrapping"?c(a.lineBreak):fe==="page"?c(a.pageBreak):fe==="column"?c(a.columnBreak):h([p("Unsupported break type: "+fe)])},"w:bookmarkStart":function(re){var fe=re.attributes["w:name"];return fe==="_GoBack"?_():c(new a.BookmarkStart({name:fe}))},"mc:AlternateContent":function(re){return V(re.firstOrEmpty("mc:Fallback"))},"w:sdt":function(re){var fe=K(re.firstOrEmpty("w:sdtContent").children);return fe.map(function(_e){var Ee=re.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(Ee){var Se=Ee.first("wordml:checked"),Me=!!Se&&Q(Se.attributes["wordml:val"]),Pe=a.checkbox({checked:Me}),Fe=!1,Ze=_e.map(i._elementsOfType(a.types.text,function(N){return N.value.length>0&&!Fe?(Fe=!0,Pe):N}));return Fe?Ze:Pe}else return _e})},"w:customXml":V,"w:ins":V,"w:moveFromRangeEnd":V,"w:moveFromRangeStart":V,"w:moveTo":V,"w:moveToRangeEnd":V,"w:moveToRangeStart":V,"w:object":V,"w:smartTag":V,"w:drawing":V,"w:pict":function(re){return V(re).toExtra()},"v:roundrect":V,"v:shape":V,"v:textbox":V,"w:txbxContent":V,"wp:inline":ae,"wp:anchor":ae,"v:imagedata":Ae,"v:group":V,"v:rect":V};return{readXmlElement:pe,readXmlElements:K};function l(re){var fe=t(re.firstOrEmpty("w:tblPr"));return K(re.children).flatMap(G).flatMap(function(_e){return fe.map(function(Ee){return a.Table(_e,Ee)})})}function t(re){return Re(re).map(function(fe){return{styleId:fe.styleId,styleName:fe.name}})}function o(re){var fe=re.firstOrEmpty("w:trPr"),_e=!!fe.first("w:del");if(_e)return _();var Ee=!!fe.first("w:tblHeader");return K(re.children).map(function(Se){return a.TableRow(Se,{isHeader:Ee})})}function D(re){return K(re.children).map(function(fe){var _e=re.firstOrEmpty("w:tcPr"),Ee=_e.firstOrEmpty("w:gridSpan").attributes["w:val"],Se=Ee?parseInt(Ee,10):1,Me=a.TableCell(fe,{colSpan:Se});return Me._vMerge=C(_e),Me})}function C(re){var fe=re.first("w:vMerge");if(fe){var _e=fe.attributes["w:val"];return _e==="continue"||!_e}else return null}function G(re){var fe=E.any(re,function(Se){return Se.type!==a.types.tableRow});if(fe)return te(re),n(re,[p("unexpected non-row element in table, cell merging may be incorrect")]);var _e=E.any(re,function(Se){return E.any(Se.children,function(Me){return Me.type!==a.types.tableCell})});if(_e)return te(re),n(re,[p("unexpected non-cell element in table row, cell merging may be incorrect")]);var Ee={};return re.forEach(function(Se){var Me=0;Se.children.forEach(function(Pe){Pe._vMerge&&Ee[Me]?Ee[Me].rowSpan++:(Ee[Me]=Pe,Pe._vMerge=!1),Me+=Pe.colSpan})}),re.forEach(function(Se){Se.children=Se.children.filter(function(Me){return!Me._vMerge}),Se.children.forEach(function(Me){delete Me._vMerge})}),c(re)}function te(re){re.forEach(function(fe){var _e=i.getDescendantsOfType(fe,a.types.tableCell);_e.forEach(function(Ee){delete Ee._vMerge})})}function ae(re){var fe=re.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return m(fe.map(de.bind(null,re)))}function de(re,fe){var _e=re.firstOrEmpty("wp:docPr"),Ee=_e.attributes,Se=Te(Ee.descr)?Ee.title:Ee.descr,Me=me(fe);return Me===null?h([p("Could not find image file for a:blip element")]):ze(Me,Se).map(function(Pe){var Fe=_e.firstOrEmpty("a:hlinkClick"),Ze=Fe.attributes["r:id"];if(Ze){var N=x.findTargetByRelationshipId(Ze);return new a.Hyperlink([Pe],{href:N})}else return Pe})}function Te(re){return re==null||/^\s*$/.test(re)}function me(re){var fe=re.attributes["r:embed"],_e=re.attributes["r:link"];if(fe)return Ue(fe);if(_e){var Ee=x.findTargetByRelationshipId(_e);return{path:Ee,read:B.read.bind(B,Ee)}}else return null}function Ae(re){var fe=re.attributes["r:id"];return fe?ze(Ue(fe),re.attributes["o:title"]):h([p("A v:imagedata element without a relationship ID was ignored")])}function Ue(re){var fe=e.uriToZipEntryName("word",x.findTargetByRelationshipId(re));return{path:fe,read:ee.read.bind(ee,fe)}}function ze(re,fe){var _e=W.findContentType(re.path),Ee=a.Image({readImage:re.read,altText:fe,contentType:_e}),Se=w[_e]?[]:p("Image of type "+_e+" is unlikely to display in web browsers");return n(Ee,Se)}function He(re,fe){return p(re+" style with ID "+fe+" was referenced but not defined in the document")}}function y(k,A,O){var X=A.firstOrEmpty("w:ilvl").attributes["w:val"],x=A.firstOrEmpty("w:numId").attributes["w:val"];if(X!==void 0&&x!==void 0)return O.findLevel(x,X);if(k!=null){var W=O.findLevelByParagraphStyleId(k);if(W!=null)return W}return x!==void 0?O.findLevel(x,"0"):null}var w={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},v={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:moveFrom":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(k){return new r(null,null,k)}function _(){return new r(null)}function c(k){return new r(k)}function n(k,A){return new r(k,null,A)}function r(k,A,O){this.value=k||[],this.extra=A||[],this._result=new g({element:this.value,extra:A},O),this.messages=this._result.messages}r.prototype.toExtra=function(){return new r(null,I(this.extra,this.value),this.messages)},r.prototype.insertExtra=function(){var k=this.extra;return k&&k.length?new r(I(this.value,k),null,this.messages):this},r.prototype.map=function(k){var A=this._result.map(function(O){return k(O.element)});return new r(A.value,this.extra,A.messages)},r.prototype.flatMap=function(k){var A=this._result.flatMap(function(O){return k(O.element)._result});return new r(A.value.element,I(this.extra,A.value.extra),A.messages)},r.map=function(k,A,O){return new r(O(k.value,A.value),I(k.extra,A.extra),k.messages.concat(A.messages))};function m(k){var A=g.combine(E.pluck(k,"_result"));return new r(E.flatten(E.pluck(A.value,"element")),E.filter(E.flatten(E.pluck(A.value,"extra")),U),A.messages)}function I(k,A){return E.flatten([k,A])}function U(k){return k}},{"../documents":4,"../results":25,"../transforms":30,"../xml":35,"./uris":16,"dingbat-to-unicode":50,underscore:67}],6:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;function a(g){function p(i){return E.combine(i.getElementsByTagName("w:comment").map(u))}function u(i){var e=i.attributes["w:id"];function s(d){return(i.attributes[d]||"").trim()||null}return g.readXmlElements(i.children).map(function(d){return M.comment({commentId:e,body:d,authorName:s("w:author"),authorInitials:s("w:initials")})})}return p}R.createCommentsReader=a},{"../documents":4,"../results":25}],7:[function(P,oe,R){R.readContentTypesFromXml=E;var M={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};R.defaultContentTypes=a({},{});function E(g){var p=Object.create(null),u=Object.create(null);return g.children.forEach(function(i){if(i.name==="content-types:Default"&&(p[i.attributes.Extension]=i.attributes.ContentType),i.name==="content-types:Override"){var e=i.attributes.PartName;e.charAt(0)==="/"&&(e=e.substring(1)),u[e]=i.attributes.ContentType}}),a(u,p)}function a(g,p){return{findContentType:function(u){var i=g[u];if(i)return i;var e=u.split("."),s=e[e.length-1];if(Object.prototype.hasOwnProperty.call(p,s))return p[s];var d=M[s.toLowerCase()];return d?"image/"+d:null}}}},{}],8:[function(P,oe,R){R.DocumentXmlReader=a;var M=P("../documents"),E=P("../results").Result;function a(g){var p=g.bodyReader;function u(i){var e=i.first("w:body");if(e==null)throw new Error("Could not find the body element: are you sure this is a docx file?");var s=p.readXmlElements(e.children).map(function(d){return new M.Document(d,{notes:g.notes,comments:g.comments})});return new E(s.value,s.messages)}return{convertXmlToDocument:u}}},{"../documents":4,"../results":25}],9:[function(P,oe,R){R.read=_,R._findPartPaths=c;var M=P("../promises"),E=P("../documents"),a=P("../results").Result,g=P("../zipfile"),p=P("./office-xml-reader").readXmlFromZipFile,u=P("./body-reader").createBodyReader,i=P("./document-xml-reader").DocumentXmlReader,e=P("./relationships-reader"),s=P("./content-types-reader"),d=P("./numbering-xml"),y=P("./styles-reader"),w=P("./notes-reader"),v=P("./comments-reader"),h=P("./files").Files;function _(x,W,ee){W=W||{},ee=ee||{};var B=new h({externalFileAccess:ee.externalFileAccess,relativeToFile:W.path});return M.props({contentTypes:k(x),partPaths:c(x),docxFile:x,files:B}).also(function(Y){return{styles:O(x,Y.partPaths.styles)}}).also(function(Y){return{numbering:A(x,Y.partPaths.numbering,Y.styles)}}).also(function(Y){return{footnotes:I(Y.partPaths.footnotes,Y,function(T,K){return K?w.createFootnotesReader(T)(K):new a([])}),endnotes:I(Y.partPaths.endnotes,Y,function(T,K){return K?w.createEndnotesReader(T)(K):new a([])}),comments:I(Y.partPaths.comments,Y,function(T,K){return K?v.createCommentsReader(T)(K):new a([])})}}).also(function(Y){return{notes:Y.footnotes.flatMap(function(T){return Y.endnotes.map(function(K){return new E.Notes(T.concat(K))})})}}).then(function(Y){return I(Y.partPaths.mainDocument,Y,function(T,K){return Y.notes.flatMap(function(pe){return Y.comments.flatMap(function(ne){var ce=new i({bodyReader:T,notes:pe,comments:ne});return ce.convertXmlToDocument(K)})})})})}function c(x){return X(x).then(function(W){var ee=n({docxFile:x,relationships:W,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!x.exists(ee))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return m({filename:U(ee),readElement:e.readRelationships,defaultValue:e.defaultValue})(x).then(function(B){function Y(T){return n({docxFile:x,relationships:B,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+T,basePath:g.splitPath(ee).dirname,fallbackPath:"word/"+T+".xml"})}return{mainDocument:ee,comments:Y("comments"),endnotes:Y("endnotes"),footnotes:Y("footnotes"),numbering:Y("numbering"),styles:Y("styles")}})})}function n(x){var W=x.docxFile,ee=x.relationships,B=x.relationshipType,Y=x.basePath,T=x.fallbackPath,K=ee.findTargetsByType(B),pe=K.map(function(ce){return r(g.joinPath(Y,ce),"/")}),ne=pe.filter(function(ce){return W.exists(ce)});return ne.length===0?T:ne[0]}function r(x,W){return x.substring(0,W.length)===W?x.substring(W.length):x}function m(x){return function(W){return p(W,x.filename).then(function(ee){return ee?x.readElement(ee):x.defaultValue})}}function I(x,W,ee){var B=m({filename:U(x),readElement:e.readRelationships,defaultValue:e.defaultValue});return B(W.docxFile).then(function(Y){var T=new u({relationships:Y,contentTypes:W.contentTypes,docxFile:W.docxFile,numbering:W.numbering,styles:W.styles,files:W.files});return p(W.docxFile,x).then(function(K){return ee(T,K)})})}function U(x){var W=g.splitPath(x);return g.joinPath(W.dirname,"_rels",W.basename+".rels")}var k=m({filename:"[Content_Types].xml",readElement:s.readContentTypesFromXml,defaultValue:s.defaultContentTypes});function A(x,W,ee){return m({filename:W,readElement:function(B){return d.readNumberingXml(B,{styles:ee})},defaultValue:d.defaultNumbering})(x)}function O(x,W){return m({filename:W,readElement:y.readStylesXml,defaultValue:y.defaultStyles})(x)}var X=m({filename:"_rels/.rels",readElement:e.readRelationships,defaultValue:e.defaultValue})},{"../documents":4,"../promises":23,"../results":25,"../zipfile":40,"./body-reader":5,"./comments-reader":6,"./content-types-reader":7,"./document-xml-reader":8,"./files":1,"./notes-reader":10,"./numbering-xml":11,"./office-xml-reader":12,"./relationships-reader":13,"./styles-reader":15}],10:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;R.createFootnotesReader=a.bind(this,"footnote"),R.createEndnotesReader=a.bind(this,"endnote");function a(g,p){function u(s){return E.combine(s.getElementsByTagName("w:"+g).filter(i).map(e))}function i(s){var d=s.attributes["w:type"];return d!=="continuationSeparator"&&d!=="separator"}function e(s){var d=s.attributes["w:id"];return p.readXmlElements(s.children).map(function(y){return M.Note({noteType:g,noteId:d,body:y})})}return u}},{"../documents":4,"../results":25}],11:[function(P,oe,R){var M=P("underscore");R.readNumberingXml=a,R.Numbering=E,R.defaultNumbering=new E({},{});function E(i,e,s){var d=M.flatten(M.values(e).map(function(_){return M.values(_.levels)})),y=M.indexBy(d.filter(function(_){return _.paragraphStyleId!=null}),"paragraphStyleId");function w(_,c){return v(_,c,Object.create(null))}function v(_,c,n){if(n[_])return null;n[_]=!0;var r=i[_];if(!r)return null;var m=e[r.abstractNumId];if(m){if(m.numStyleLink==null)return e[r.abstractNumId].levels[c];var I=s.findNumberingStyleById(m.numStyleLink);return v(I.numId,c,n)}else return null}function h(_){return y[_]||null}return{findLevel:w,findLevelByParagraphStyleId:h}}function a(i,e){if(!e||!e.styles)throw new Error("styles is missing");var s=g(i),d=u(i);return new E(d,s,e.styles)}function g(i){var e=Object.create(null);return i.getElementsByTagName("w:abstractNum").forEach(function(s){var d=s.attributes["w:abstractNumId"];e[d]=p(s)}),e}function p(i){var e=Object.create(null),s=null;i.getElementsByTagName("w:lvl").forEach(function(y){var w=y.attributes["w:ilvl"],v=y.firstOrEmpty("w:numFmt").attributes["w:val"],h=v!=="bullet",_=y.firstOrEmpty("w:pStyle").attributes["w:val"];w===void 0?s={isOrdered:h,level:"0",paragraphStyleId:_}:e[w]={isOrdered:h,level:w,paragraphStyleId:_}}),s!==null&&e[s.level]===void 0&&(e[s.level]=s);var d=i.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:e,numStyleLink:d}}function u(i){var e=Object.create(null);return i.getElementsByTagName("w:num").forEach(function(s){var d=s.attributes["w:numId"],y=s.first("w:abstractNumId").attributes["w:val"];e[d]={abstractNumId:y}}),e}},{underscore:67}],12:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.read=p,R.readXmlFromZipFile=u;var g={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function p(s){return a.readString(s,g).then(function(d){return e(d)[0]})}function u(s,d){return s.exists(d)?s.read(d,"utf-8").then(i).then(p):E.resolve(null)}function i(s){return s.replace(/^\uFEFF/g,"")}function e(s){return s.type==="element"?s.name==="mc:AlternateContent"?s.firstOrEmpty("mc:Fallback").children:(s.children=M.flatten(s.children.map(e,!0)),[s]):[s]}},{"../promises":23,"../xml":35,underscore:67}],13:[function(P,oe,R){R.readRelationships=M,R.defaultValue=new E([]),R.Relationships=E;function M(a){var g=[];return a.children.forEach(function(p){if(p.name==="relationships:Relationship"){var u={relationshipId:p.attributes.Id,target:p.attributes.Target,type:p.attributes.Type};g.push(u)}}),new E(g)}function E(a){var g=Object.create(null);a.forEach(function(u){g[u.relationshipId]=u.target});var p=Object.create(null);return a.forEach(function(u){p[u.type]||(p[u.type]=[]),p[u.type].push(u.target)}),{findTargetByRelationshipId:function(u){return g[u]},findTargetsByType:function(u){return p[u]||[]}}}},{}],14:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.writeStyleMap=i,R.readStyleMap=y;var g="http://schemas.zwobble.org/mammoth/style-map",p="mammoth/style-map",u="/"+p;function i(w,v){return w.write(p,v),e(w).then(function(){return s(w)})}function e(w){var v="word/_rels/document.xml.rels",h="http://schemas.openxmlformats.org/package/2006/relationships",_="{"+h+"}Relationship";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"Id",{Id:"rMammothStyleMap",Type:g,Target:u});var r={"":h};return w.write(v,a.writeString(c,r))})}function s(w){var v="[Content_Types].xml",h="http://schemas.openxmlformats.org/package/2006/content-types",_="{"+h+"}Override";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"PartName",{PartName:u,ContentType:"text/prs.mammoth.style-map"});var r={"":h};return w.write(v,a.writeString(c,r))})}function d(w,v,h,_){var c=M.find(w,function(n){return n.name===v&&n.attributes[h]===_[h]});c?c.attributes=_:w.push(a.element(v,_))}function y(w){return w.exists(p)?w.read(p,"utf8"):E.resolve(null)}},{"../promises":23,"../xml":35,underscore:67}],15:[function(P,oe,R){R.readStylesXml=E,R.Styles=M,R.defaultStyles=new M({},{});function M(i,e,s,d){return{findParagraphStyleById:function(y){return i[y]},findCharacterStyleById:function(y){return e[y]},findTableStyleById:function(y){return s[y]},findNumberingStyleById:function(y){return d[y]}}}M.EMPTY=new M({},{},{},{});function E(i){var e=Object.create(null),s=Object.create(null),d=Object.create(null),y=Object.create(null);return i.getElementsByTagName("w:style").forEach(function(w){var v=a(w),h;switch(v.type){case"paragraph":h=e;break;case"character":h=s;break;case"table":h=d;break;case"numbering":h=y;break}h&&h[v.styleId]===void 0&&(h[v.styleId]=v)}),new M(e,s,d,y)}function a(i){var e=i.attributes["w:type"];if(e==="numbering")return p(e,i);var s=u(i),d=g(i);return{type:e,styleId:s,name:d}}function g(i){var e=i.first("w:name");return e?e.attributes["w:val"]:null}function p(i,e){var s=u(e),d=e.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:i,numId:d,styleId:s}}function u(i){return i.attributes["w:styleId"]}},{}],16:[function(P,oe,R){R.uriToZipEntryName=M,R.replaceFragment=E;function M(a,g){return g.charAt(0)==="/"?g.substr(1):a+"/"+g}function E(a,g){var p=a.indexOf("#");return p!==-1&&(a=a.substring(0,p)),a+"#"+g}},{}],17:[function(P,oe,R){var M=P("../styles/html-paths");function E(s,d,y){return g(M.element(s,d,{fresh:!1}),y)}function a(s,d,y){var w=M.element(s,d,{fresh:!0});return g(w,y)}function g(s,d){return{type:"element",tag:s,children:d||[]}}function p(s){return{type:"text",value:s}}var u={type:"forceWrite"};R.freshElement=a,R.nonFreshElement=E,R.elementWithTag=g,R.text=p,R.forceWrite=u;var i={br:!0,hr:!0,img:!0,input:!0};function e(s){return s.children.length===0&&i[s.tag.tagName]}R.isVoidElement=e},{"../styles/html-paths":28}],18:[function(P,oe,R){var M=P("./ast");R.freshElement=M.freshElement,R.nonFreshElement=M.nonFreshElement,R.elementWithTag=M.elementWithTag,R.text=M.text,R.forceWrite=M.forceWrite,R.simplify=P("./simplify");function E(i,e){e.forEach(function(s){a(i,s)})}function a(i,e){g[e.type](i,e)}var g={element:p,text:u,forceWrite:function(){}};function p(i,e){M.isVoidElement(e)?i.selfClosing(e.tag.tagName,e.tag.attributes):(i.open(e.tag.tagName,e.tag.attributes),E(i,e.children),i.close(e.tag.tagName))}function u(i,e){i.text(e.value)}R.write=E},{"./ast":17,"./simplify":19}],19:[function(P,oe,R){var M=P("underscore"),E=P("./ast");function a(c){return g(d(c))}function g(c){var n=[];return c.map(p).forEach(function(r){s(n,r)}),n}function p(c){return u[c.type](c)}var u={element:i,text:e,forceWrite:e};function i(c){return E.elementWithTag(c.tag,g(c.children))}function e(c){return c}function s(c,n){var r=c[c.length-1];n.type==="element"&&!n.tag.fresh&&r&&r.type==="element"&&n.tag.matchesElement(r.tag)?(n.tag.separator&&s(r.children,E.text(n.tag.separator)),n.children.forEach(function(m){s(r.children,m)})):c.push(n)}function d(c){return y(c,function(n){return w[n.type](n)})}function y(c,n){return M.flatten(M.map(c,n),!0)}var w={element:h,text:_,forceWrite:v};function v(c){return[c]}function h(c){var n=d(c.children);return n.length===0&&!E.isVoidElement(c)?[]:[E.elementWithTag(c.tag,n)]}function _(c){return c.value.length===0?[]:[c]}oe.exports=a},{"./ast":17,underscore:67}],20:[function(P,oe,R){var M=P("underscore"),E=P("./promises"),a=P("./html");R.imgElement=g;function g(u){return function(i,e){return E.resolve(u(i)).then(function(s){var d={};return i.altText&&(d.alt=i.altText),M.extend(d,s),[a.freshElement("img",d)]})}}R.inline=R.imgElement,R.dataUri=g(function(u){return u.readAsBase64String().then(function(i){return{src:"data:"+u.contentType+";base64,"+i}})});function p(u){return u.contentType.split(/\/|\\/)[1]}R.imageFilenameExtension=p},{"./html":18,"./promises":23,underscore:67}],21:[function(P,oe,R){(function(M){var E=P("underscore"),a=P("./docx/docx-reader"),g=P("./docx/style-map"),p=P("./document-to-html").DocumentConverter,u=P("./raw-text").convertElementToRawText,i=P("./style-reader").readStyle,e=P("./options-reader").readOptions,s=P("./promises"),d=P("./unzip"),y=P("./results").Result;R.convertToHtml=w,R.convertToMarkdown=v,R.convert=h,R.extractRawText=r,R.images=P("./images"),R.transforms=P("./transforms"),R.underline=P("./underline"),R.embedStyleMap=m,R.readEmbeddedStyleMap=_;function w(I,U){return h(I,U)}function v(I,U){var k=Object.create(U||{});return k.outputFormat="markdown",h(I,k)}function h(I,U){U=e(U);var k=d.openZip(I).then(function(A){return g.readStyleMap(A).then(function(O){return U.embeddedStyleMap=O,A})}).then(function(A){return a.read(A,I,U).then(function(O){return O.map(U.transformDocument)}).then(function(O){return c(O,U)})});return s.toExternalPromise(k)}function _(I){var U=d.openZip(I).then(g.readStyleMap);return s.toExternalPromise(U)}function c(I,U){var k=n(U.readStyleMap()),A=E.extend({},U,{styleMap:k.value}),O=new p(A);return I.flatMapThen(function(X){return k.flatMapThen(function(x){return O.convertToHtml(X)})})}function n(I){return y.combine((I||[]).map(i)).map(function(U){return U.filter(function(k){return!!k})})}function r(I){var U=d.openZip(I).then(a.read).then(function(k){return k.map(u)});return s.toExternalPromise(U)}function m(I,U){var k=d.openZip(I).then(function(A){return g.writeStyleMap(A,U).then(function(){return A})}).then(function(A){return A.toArrayBuffer()}).then(function(A){return{toArrayBuffer:function(){return A},toBuffer:function(){return M.from(A)}}});return s.toExternalPromise(k)}R.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}}).call(this,P("buffer").Buffer)},{"./document-to-html":3,"./docx/docx-reader":9,"./docx/style-map":14,"./images":20,"./options-reader":22,"./promises":23,"./raw-text":24,"./results":25,"./style-reader":26,"./transforms":30,"./underline":31,"./unzip":2,buffer:48,underscore:67}],22:[function(P,oe,R){R.readOptions=g;var M=P("underscore"),E=R._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],a=R._standardOptions={externalFileAccess:!1,transformDocument:u,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function g(i){return i=i||{},M.extend({},a,i,{customStyleMap:p(i.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(p(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(E)),e}})}function p(i){return i?M.isString(i)?i.split(` `).map(function(e){return e.trim()}).filter(function(e){return e!==""&&e.charAt(0)!=="#"}):i:[]}function u(i){return i}},{underscore:67}],23:[function(P,oe,R){(function(M){var E=P("underscore");R.defer=u,R.Promise=Promise,R.resolve=Promise.resolve.bind(Promise),R.reject=Promise.reject.bind(Promise),R.forEachSeries=function(d,y){var w=0,v=u(),h=function(){if(w"u"?!1:{}.toString.call(M).toLowerCase()==="[object process]"}}).call(this,P("_process"))},{_process:66,underscore:67}],24:[function(P,oe,R){var M=P("./documents");function E(a){if(a.type==="text")return a.value;if(a.type===M.types.tab)return" ";var g=a.type==="paragraph"?` diff --git a/sync-server/www/assets/rotate-ccw-DBQnyfoK.js b/sync-server/www/assets/rotate-ccw-C9On11h9.js similarity index 95% rename from sync-server/www/assets/rotate-ccw-DBQnyfoK.js rename to sync-server/www/assets/rotate-ccw-C9On11h9.js index 9d44f73..f0e2d07 100644 --- a/sync-server/www/assets/rotate-ccw-DBQnyfoK.js +++ b/sync-server/www/assets/rotate-ccw-C9On11h9.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-Bmyzyg8t.js";/** +import{c as t}from"./index-i50OZQTj.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/useChart-rSzOuKiQ.js b/sync-server/www/assets/useChart-B6jW3CzL.js similarity index 92% rename from sync-server/www/assets/useChart-rSzOuKiQ.js rename to sync-server/www/assets/useChart-B6jW3CzL.js index 8e12b18..ac7ff97 100644 --- a/sync-server/www/assets/useChart-rSzOuKiQ.js +++ b/sync-server/www/assets/useChart-B6jW3CzL.js @@ -1 +1 @@ -import{r}from"./index-Bmyzyg8t.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; +import{r}from"./index-i50OZQTj.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; diff --git a/sync-server/www/index.html b/sync-server/www/index.html index 528fd18..20e9061 100644 --- a/sync-server/www/index.html +++ b/sync-server/www/index.html @@ -9,7 +9,7 @@ 足迹 Footprints - +