From 629c7e4073c938287c349b42bbb87261bcce802f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Oct 2026 16:09:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A6=E4=B8=8B=E8=A7=92=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=8C=BA=E6=96=87=E6=A1=88=E5=AE=9A=E7=A8=BF=E4=B8=BA?= =?UTF-8?q?=E6=88=91=E7=9A=84=E6=A1=A3=E6=A1=88=E5=B9=B6=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=20www?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/components/layout/Sidebar.tsx | 8 ++++---- .../{AdminPage-CBfyyvpO.js => AdminPage-CVGD_85A.js} | 6 +++--- ...ashboardPage-Cc-wrWjt.js => DashboardPage-Bd9Ohx5Q.js} | 2 +- .../{GradesPage-QAvA3AVI.js => GradesPage-zizJmWpX.js} | 2 +- .../{RecordsPage-BfGvP4ga.js => RecordsPage-tnlmi-lB.js} | 2 +- ...{TaxonomyPage-CwcRnHVH.js => TaxonomyPage-D0c0qsuX.js} | 2 +- .../{TypesPage-k4XFWR3M.js => TypesPage-CN6AAiUh.js} | 2 +- .../www/assets/{card-DipFCG5F.js => card-DPuXHBpL.js} | 2 +- .../www/assets/{index-CAYqMwJw.js => index-DdiJYOyq.js} | 4 ++-- .../assets/{useChart-sd-ke-zx.js => useChart-Bui3ZDic.js} | 2 +- sync-server/www/index.html | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) rename sync-server/www/assets/{AdminPage-CBfyyvpO.js => AdminPage-CVGD_85A.js} (95%) rename sync-server/www/assets/{DashboardPage-Cc-wrWjt.js => DashboardPage-Bd9Ohx5Q.js} (94%) rename sync-server/www/assets/{GradesPage-QAvA3AVI.js => GradesPage-zizJmWpX.js} (99%) rename sync-server/www/assets/{RecordsPage-BfGvP4ga.js => RecordsPage-tnlmi-lB.js} (99%) rename sync-server/www/assets/{TaxonomyPage-CwcRnHVH.js => TaxonomyPage-D0c0qsuX.js} (97%) rename sync-server/www/assets/{TypesPage-k4XFWR3M.js => TypesPage-CN6AAiUh.js} (98%) rename sync-server/www/assets/{card-DipFCG5F.js => card-DPuXHBpL.js} (89%) rename sync-server/www/assets/{index-CAYqMwJw.js => index-DdiJYOyq.js} (90%) rename sync-server/www/assets/{useChart-sd-ke-zx.js => useChart-Bui3ZDic.js} (92%) diff --git a/app/src/components/layout/Sidebar.tsx b/app/src/components/layout/Sidebar.tsx index 6747977..8f3c69b 100644 --- a/app/src/components/layout/Sidebar.tsx +++ b/app/src/components/layout/Sidebar.tsx @@ -98,7 +98,7 @@ export function Sidebar({ open, onClose }: { open: boolean; onClose: () => void
{/* 左下角:账号区 */} - {getToken() ? ( + {/* 左下角账号区 */}{getToken() ? (
{me && (
@@ -124,7 +124,7 @@ export function Sidebar({ open, onClose }: { open: boolean; onClose: () => void onClick={() => setLoginOpen(true)} > - {me ? "账号与同步设置" : "已注册 · 登录同步"} + {me ? "账号与同步设置" : "登录我的档案"} )} {!isWeb && ( @@ -140,9 +140,9 @@ export function Sidebar({ open, onClose }: { open: boolean; onClose: () => void onClick={() => setLoginOpen(true)} > - 登录 / 注册账号 + 我的档案 · 登录 -
未登录 = 本地模式,数据仅存本机
+
未登录=本地模式 · 登录后各端互通
)} {!isWeb && ( diff --git a/sync-server/www/assets/AdminPage-CBfyyvpO.js b/sync-server/www/assets/AdminPage-CVGD_85A.js similarity index 95% rename from sync-server/www/assets/AdminPage-CBfyyvpO.js rename to sync-server/www/assets/AdminPage-CVGD_85A.js index 7dcd075..46d43dd 100644 --- a/sync-server/www/assets/AdminPage-CBfyyvpO.js +++ b/sync-server/www/assets/AdminPage-CVGD_85A.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CAYqMwJw.js","assets/index-BthM1Vey.css"])))=>i.map(i=>d[i]); -import{c as M,u as E,r as I,e as d,Y as c,f as N,j as e,E as l,B as r,P as R,A as o,i as S,T as B,Z as F,_ as K,$ as P,a0 as L,a1 as U,a2 as A,a3 as D}from"./index-CAYqMwJw.js";import{C,a as q,b as z}from"./card-DipFCG5F.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DdiJYOyq.js","assets/index-BthM1Vey.css"])))=>i.map(i=>d[i]); +import{c as M,u as E,r as I,e as d,Y as c,f as N,j as e,E as l,B as r,P as R,A as o,i as S,T as B,Z as F,_ as K,$ as P,a0 as L,a1 as U,a2 as A,a3 as D}from"./index-DdiJYOyq.js";import{C,a as q,b as z}from"./card-DPuXHBpL.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -9,4 +9,4 @@ import{c as M,u as E,r as I,e as d,Y as c,f as N,j as e,E as l,B as r,P as R,A a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const W=[["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"}]],Z=M("UsersRound",W);function i(){return L()&&localStorage.getItem("fp-server-url")||""}function G(){var h,p,j,f,k,g,_,b;const a=E(),[n,t]=I.useState(!1),m=d({queryKey:["me"],queryFn:()=>$(),enabled:!!c()}),x=d({queryKey:["admin-users"],queryFn:()=>U(i()),enabled:!!c()}),u=d({queryKey:["admin-invites"],queryFn:()=>A(i()),enabled:!!c()}),T=N({mutationFn:s=>K(s,i()),onSuccess:()=>{a.invalidateQueries({queryKey:["admin-invites"]}),t(!1)},onError:()=>t(!1)}),w=N({mutationFn:s=>P(s,i()),onSuccess:()=>void a.invalidateQueries({queryKey:["admin-invites"]})});if(m.data&&!m.data.is_admin)return e.jsx(l,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const v=((p=(h=u.data)==null?void 0:h.data)==null?void 0:p.invites)??[],y=((f=(j=x.data)==null?void 0:j.data)==null?void 0:f.users)??[],Q=((g=(k=u.data)==null?void 0:k.data)==null?void 0:g.total)??0;return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 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.jsx(r,{variant:"secondary",onClick:()=>{a.invalidateQueries()},children:"刷新"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(C,{children:[e.jsx(q,{title:"邀请码("+Q+")",extra:e.jsxs(r,{size:"sm",variant:"primary",disabled:n,onClick:()=>{t(!0),T.mutate(5)},children:[e.jsx(R,{size:13})," 批量生成 5 个"]})}),e.jsx(z,{className:"p-0",children:v.length?e.jsx("div",{className:"divide-y divide-line max-h-[420px] overflow-y-auto",children:v.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12.5px]",children:[e.jsx("code",{className:"num rounded-sm px-1.5 py-0.5 "+(s.valid?"bg-success-subtle text-success":"bg-surface-3 text-ink-3"),children:s.code}),s.valid?e.jsx(o,{color:"var(--success)",children:"可用"}):e.jsx(o,{color:"var(--text-3)",children:"已使用"}),s.used_by_name&&e.jsxs("span",{className:"text-ink-3 truncate",children:["被 ",s.used_by_name," 使用于 ",S(s.used_at)]}),!s.used_by&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[e.jsx(r,{size:"sm",variant:"secondary",onClick:()=>{navigator.clipboard.writeText(s.code)},children:"复制"}),!s.valid&&e.jsx(r,{size:"icon-sm",variant:"ghost","aria-label":"作废",className:"text-ink-3",onClick:()=>w.mutate(s.id),children:e.jsx(B,{size:13})})]})]},s.id))}):e.jsx(l,{icon:e.jsx(V,{size:32,strokeWidth:1.5}),title:"暂无邀请码",description:"生成后发给需要注册的用户。"})})]}),e.jsxs(C,{children:[e.jsx(q,{title:"用户("+(((b=(_=x.data)==null?void 0:_.data)==null?void 0:b.total)??0)+")"}),e.jsx(z,{className:"p-0",children:y.length?e.jsx("div",{className:"divide-y divide-line max-h-[420px] overflow-y-auto",children:y.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12.5px]",children:[e.jsx("span",{className:"font-medium text-ink-1",children:s.username}),s.is_admin&&e.jsx(o,{color:"var(--brand-text)",children:"管理员"}),e.jsxs("span",{className:"num ml-auto text-ink-3",children:[s.devices," 设备 · ",s.records," 记录 · ",F(s.attachment_bytes)]})]},s.id))}):e.jsx(l,{icon:e.jsx(Z,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]}),n&&e.jsx("div",{className:"mt-3 text-[12px] text-ink-3",children:"生成中…"})]})}async function $(){const{serverMe:a}=await D(async()=>{const{serverMe:n}=await import("./index-CAYqMwJw.js").then(t=>t.a4);return{serverMe:n}},__vite__mapDeps([0,1]));try{return await a(i())}catch{return null}}export{G as AdminPage}; + */const W=[["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"}]],Z=M("UsersRound",W);function i(){return L()&&localStorage.getItem("fp-server-url")||""}function G(){var h,p,j,f,k,g,_,b;const a=E(),[n,t]=I.useState(!1),m=d({queryKey:["me"],queryFn:()=>$(),enabled:!!c()}),x=d({queryKey:["admin-users"],queryFn:()=>U(i()),enabled:!!c()}),u=d({queryKey:["admin-invites"],queryFn:()=>A(i()),enabled:!!c()}),T=N({mutationFn:s=>K(s,i()),onSuccess:()=>{a.invalidateQueries({queryKey:["admin-invites"]}),t(!1)},onError:()=>t(!1)}),w=N({mutationFn:s=>P(s,i()),onSuccess:()=>void a.invalidateQueries({queryKey:["admin-invites"]})});if(m.data&&!m.data.is_admin)return e.jsx(l,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const v=((p=(h=u.data)==null?void 0:h.data)==null?void 0:p.invites)??[],y=((f=(j=x.data)==null?void 0:j.data)==null?void 0:f.users)??[],Q=((g=(k=u.data)==null?void 0:k.data)==null?void 0:g.total)??0;return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 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.jsx(r,{variant:"secondary",onClick:()=>{a.invalidateQueries()},children:"刷新"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(C,{children:[e.jsx(q,{title:"邀请码("+Q+")",extra:e.jsxs(r,{size:"sm",variant:"primary",disabled:n,onClick:()=>{t(!0),T.mutate(5)},children:[e.jsx(R,{size:13})," 批量生成 5 个"]})}),e.jsx(z,{className:"p-0",children:v.length?e.jsx("div",{className:"divide-y divide-line max-h-[420px] overflow-y-auto",children:v.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12.5px]",children:[e.jsx("code",{className:"num rounded-sm px-1.5 py-0.5 "+(s.valid?"bg-success-subtle text-success":"bg-surface-3 text-ink-3"),children:s.code}),s.valid?e.jsx(o,{color:"var(--success)",children:"可用"}):e.jsx(o,{color:"var(--text-3)",children:"已使用"}),s.used_by_name&&e.jsxs("span",{className:"text-ink-3 truncate",children:["被 ",s.used_by_name," 使用于 ",S(s.used_at)]}),!s.used_by&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[e.jsx(r,{size:"sm",variant:"secondary",onClick:()=>{navigator.clipboard.writeText(s.code)},children:"复制"}),!s.valid&&e.jsx(r,{size:"icon-sm",variant:"ghost","aria-label":"作废",className:"text-ink-3",onClick:()=>w.mutate(s.id),children:e.jsx(B,{size:13})})]})]},s.id))}):e.jsx(l,{icon:e.jsx(V,{size:32,strokeWidth:1.5}),title:"暂无邀请码",description:"生成后发给需要注册的用户。"})})]}),e.jsxs(C,{children:[e.jsx(q,{title:"用户("+(((b=(_=x.data)==null?void 0:_.data)==null?void 0:b.total)??0)+")"}),e.jsx(z,{className:"p-0",children:y.length?e.jsx("div",{className:"divide-y divide-line max-h-[420px] overflow-y-auto",children:y.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12.5px]",children:[e.jsx("span",{className:"font-medium text-ink-1",children:s.username}),s.is_admin&&e.jsx(o,{color:"var(--brand-text)",children:"管理员"}),e.jsxs("span",{className:"num ml-auto text-ink-3",children:[s.devices," 设备 · ",s.records," 记录 · ",F(s.attachment_bytes)]})]},s.id))}):e.jsx(l,{icon:e.jsx(Z,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]}),n&&e.jsx("div",{className:"mt-3 text-[12px] text-ink-3",children:"生成中…"})]})}async function $(){const{serverMe:a}=await D(async()=>{const{serverMe:n}=await import("./index-DdiJYOyq.js").then(t=>t.a4);return{serverMe:n}},__vite__mapDeps([0,1]));try{return await a(i())}catch{return null}}export{G as AdminPage}; diff --git a/sync-server/www/assets/DashboardPage-Cc-wrWjt.js b/sync-server/www/assets/DashboardPage-Bd9Ohx5Q.js similarity index 94% rename from sync-server/www/assets/DashboardPage-Cc-wrWjt.js rename to sync-server/www/assets/DashboardPage-Bd9Ohx5Q.js index 9f77641..8f80443 100644 --- a/sync-server/www/assets/DashboardPage-Cc-wrWjt.js +++ b/sync-server/www/assets/DashboardPage-Bd9Ohx5Q.js @@ -1 +1 @@ -import{r as g,e as v,j as t,S as j,s as S}from"./index-CAYqMwJw.js";import{C as c,a as d,b as x}from"./card-DipFCG5F.js";import{u as N,i as u,a as m}from"./useChart-sd-ke-zx.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-6 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:"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,e as v,j as t,S as j,s as S}from"./index-DdiJYOyq.js";import{C as c,a as d,b as x}from"./card-DPuXHBpL.js";import{u as N,i as u,a as m}from"./useChart-Bui3ZDic.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-6 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:"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-QAvA3AVI.js b/sync-server/www/assets/GradesPage-zizJmWpX.js similarity index 99% rename from sync-server/www/assets/GradesPage-QAvA3AVI.js rename to sync-server/www/assets/GradesPage-zizJmWpX.js index a771f19..b1ff572 100644 --- a/sync-server/www/assets/GradesPage-QAvA3AVI.js +++ b/sync-server/www/assets/GradesPage-zizJmWpX.js @@ -1,4 +1,4 @@ -import{c as K,e as I,j as e,E as O,t as $,u as k,b as S,r as u,f as y,v as H,w as W,B as g,P as q,C as Q,x as J,y as T,z as U,A as N,k as G,T as E,I as j,D as Y,F as C,H as B,J as V}from"./index-CAYqMwJw.js";import{C as f,a as z,b as _}from"./card-DipFCG5F.js";import{u as X,i as M,a as L}from"./useChart-sd-ke-zx.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** +import{c as K,e as I,j as e,E as O,t as $,u as k,b as S,r as u,f as y,v as H,w as W,B as g,P as q,C as Q,x as J,y as T,z as U,A as N,k as G,T as E,I as j,D as Y,F as C,H as B,J as V}from"./index-DdiJYOyq.js";import{C as f,a as z,b as _}from"./card-DPuXHBpL.js";import{u as X,i as M,a as L}from"./useChart-Bui3ZDic.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}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/RecordsPage-BfGvP4ga.js b/sync-server/www/assets/RecordsPage-tnlmi-lB.js similarity index 99% rename from sync-server/www/assets/RecordsPage-BfGvP4ga.js rename to sync-server/www/assets/RecordsPage-tnlmi-lB.js index 3e42104..903bbba 100644 --- a/sync-server/www/assets/RecordsPage-BfGvP4ga.js +++ b/sync-server/www/assets/RecordsPage-tnlmi-lB.js @@ -1,4 +1,4 @@ -import{c as re,j as e,a as u,r as t,u as oe,b as ce,d as de,e as C,f as ue,I as xe,S as m,B as b,P as Y,g as pe,L as me,G as ve,R as he,h as je,i as ge,k as fe,T as ye,E as be,l as Ne,m as ke,C as Se,n as we,o as Ce,p as Ee,s as qe,q as _e}from"./index-CAYqMwJw.js";/** +import{c as re,j as e,a as u,r as t,u as oe,b as ce,d as de,e as C,f as ue,I as xe,S as m,B as b,P as Y,g as pe,L as me,G as ve,R as he,h as je,i as ge,k as fe,T as ye,E as be,l as Ne,m as ke,C as Se,n as we,o as Ce,p as Ee,s as qe,q as _e}from"./index-DdiJYOyq.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-CwcRnHVH.js b/sync-server/www/assets/TaxonomyPage-D0c0qsuX.js similarity index 97% rename from sync-server/www/assets/TaxonomyPage-CwcRnHVH.js rename to sync-server/www/assets/TaxonomyPage-D0c0qsuX.js index d973a5f..2eff499 100644 --- a/sync-server/www/assets/TaxonomyPage-CwcRnHVH.js +++ b/sync-server/www/assets/TaxonomyPage-D0c0qsuX.js @@ -1 +1 @@ -import{j as e,u as k,b as Q,e as q,r as g,f as h,Q as F,U as w,B as j,T as z,I as D,P as T,C as E,V as M,W as B,p as P,X as V}from"./index-CAYqMwJw.js";import{C as K,a as S}from"./card-DipFCG5F.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 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(I,{})]})]})}function C({kind:r,title:m,description:N}){var v;const l=k(),o=Q(),n=(((v=q({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,x)=>s.sort-x.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:m,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,x)=>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[x%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(z,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(D,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var x;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((x=n.at(-1))==null?void 0:x.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 I(){var d;const r=k(),m=Q(),l=[...((d=q({queryKey:["dimensions"],queryFn:V}).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"]}),m("success","已删除"),a(null)},onError:t=>{m("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(z,{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(D,{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{H as TaxonomyPage}; +import{j as e,u as k,b as Q,e as q,r as g,f as h,Q as F,U as w,B as j,T as z,I as D,P as T,C as E,V as M,W as B,p as P,X as V}from"./index-DdiJYOyq.js";import{C as K,a as S}from"./card-DPuXHBpL.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 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(I,{})]})]})}function C({kind:r,title:m,description:N}){var v;const l=k(),o=Q(),n=(((v=q({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,x)=>s.sort-x.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:m,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,x)=>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[x%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(z,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(D,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var x;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((x=n.at(-1))==null?void 0:x.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 I(){var d;const r=k(),m=Q(),l=[...((d=q({queryKey:["dimensions"],queryFn:V}).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"]}),m("success","已删除"),a(null)},onError:t=>{m("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(z,{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(D,{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{H as TaxonomyPage}; diff --git a/sync-server/www/assets/TypesPage-k4XFWR3M.js b/sync-server/www/assets/TypesPage-CN6AAiUh.js similarity index 98% rename from sync-server/www/assets/TypesPage-k4XFWR3M.js rename to sync-server/www/assets/TypesPage-CN6AAiUh.js index 9316263..cf4201e 100644 --- a/sync-server/www/assets/TypesPage-k4XFWR3M.js +++ b/sync-server/www/assets/TypesPage-CN6AAiUh.js @@ -1,4 +1,4 @@ -import{c as P,u as Q,b as z,e as B,r as i,f as T,j as e,B as p,P as F,K as q,A as E,k as D,T as I,C as K,M as L,D as G,F as r,I as j,N as H,S as R,O as W,o as J}from"./index-CAYqMwJw.js";import{C as U}from"./card-DipFCG5F.js";/** +import{c as P,u as Q,b as z,e as B,r as i,f as T,j as e,B as p,P as F,K as q,A as E,k as D,T as I,C as K,M as L,D as G,F as r,I as j,N as H,S as R,O as W,o as J}from"./index-DdiJYOyq.js";import{C as U}from"./card-DPuXHBpL.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-DipFCG5F.js b/sync-server/www/assets/card-DPuXHBpL.js similarity index 89% rename from sync-server/www/assets/card-DipFCG5F.js rename to sync-server/www/assets/card-DPuXHBpL.js index 8ae4410..8546083 100644 --- a/sync-server/www/assets/card-DipFCG5F.js +++ b/sync-server/www/assets/card-DPuXHBpL.js @@ -1 +1 @@ -import{j as s,a}from"./index-CAYqMwJw.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-DdiJYOyq.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-CAYqMwJw.js b/sync-server/www/assets/index-DdiJYOyq.js similarity index 90% rename from sync-server/www/assets/index-CAYqMwJw.js rename to sync-server/www/assets/index-DdiJYOyq.js index 65cb0a0..83f3126 100644 --- a/sync-server/www/assets/index-CAYqMwJw.js +++ b/sync-server/www/assets/index-DdiJYOyq.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-Cc-wrWjt.js","assets/card-DipFCG5F.js","assets/useChart-sd-ke-zx.js","assets/echarts-BIWefrIc.js","assets/GradesPage-QAvA3AVI.js","assets/TypesPage-k4XFWR3M.js","assets/TaxonomyPage-CwcRnHVH.js","assets/AdminPage-CBfyyvpO.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-Bd9Ohx5Q.js","assets/card-DPuXHBpL.js","assets/useChart-Bui3ZDic.js","assets/echarts-BIWefrIc.js","assets/GradesPage-zizJmWpX.js","assets/TypesPage-CN6AAiUh.js","assets/TaxonomyPage-D0c0qsuX.js","assets/AdminPage-CVGD_85A.js"])))=>i.map(i=>d[i]); var S0=n=>{throw TypeError(n)};var Yf=(n,r,s)=>r.has(n)||S0("Cannot "+s);var E=(n,r,s)=>(Yf(n,r,"read from private field"),s?s.call(n):r.get(n)),fe=(n,r,s)=>r.has(n)?S0("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),W=(n,r,s,c)=>(Yf(n,r,"write to private field"),c?c.call(n,s):r.set(n,s),s),Ee=(n,r,s)=>(Yf(n,r,"access private method"),s);var Gs=(n,r,s,c)=>({set _(f){W(n,r,f,s)},get _(){return E(n,r,c)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&c(d)}).observe(document,{childList:!0,subtree:!0});function s(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=s(f);fetch(f.href,h)}})();function Ng(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vf={exports:{}},Fu={};/** * @license React * react-jsx-runtime.production.js @@ -298,4 +298,4 @@ Please change the parent to fr||!Cl();async function Xd(n,r,s=""){const f=await(await fetch(s+"/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,password:r,device_name:fr?"桌面应用":"Web 浏览器"})})).json();if(!f.ok)throw new Error(f.error||"登录失败");return Yd(f.data.token),f.data}async function Kd(n,r,s,c=""){const h=await(await fetch(c+"/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,password:r,invite_code:s,device_name:fr?"桌面应用":"Web 浏览器"})})).json();if(!h.ok)throw new Error(h.error||"注册失败");return Yd(h.data.token),h.data}async function dp(n=""){const s=await(await fetch(n+"/auth/me",{headers:{Authorization:"Bearer "+Cl()}})).json();if(!s.ok)throw new Error(s.error||"会话失效");return s.data}async function Me(n,r){if(fr){const{invoke:d}=await tn(async()=>{const{invoke:v}=await import("./core-DV6XEvTN.js");return{invoke:v}},[]);return d(n,{payload:r??{}})}const s={"Content-Type":"application/json"},c=Cl();c&&(s.Authorization="Bearer "+c);const f=await fetch("/api/"+n,{method:"POST",headers:s,body:JSON.stringify(r??{})});if(f.status===401)throw Vd(),window.dispatchEvent(new CustomEvent("fp-auth-required")),new Error("登录已过期,请重新登录");const h=await f.json();if(!f.ok||!h.ok)throw new Error(h.error||"HTTP "+f.status);return h.data}const WE=()=>Me("app_info"),hp=()=>Me("sync_status"),ic=()=>Me("type_list"),PE=n=>Me("type_upsert",n),IE=n=>Me("type_delete",{id:n}),mp=n=>Me("taxonomy_list",{kind:n}),e4=n=>Me("taxonomy_upsert",n),t4=n=>Me("taxonomy_delete",{id:n}),Zd=()=>Me("dimension_list"),l4=n=>Me("dimension_upsert",n),a4=n=>Me("dimension_delete",{id:n}),yp=(n={})=>Me("footprint_list",{query:n}),Jd=n=>Me("footprint_get",{id:n}),vp=n=>Me("footprint_upsert",{item:n}),n4=n=>Me("footprint_delete",{id:n}),gp=(n={})=>Me("timeline",{query:n}),i4=n=>Me("stats_overview",{year:n}),u4=()=>Me("metric_list"),r4=n=>Me("metric_upsert",n),s4=n=>Me("metric_delete",{key:n}),c4=()=>Me("grades_overview"),o4=n=>Me("semester_upsert",n),f4=n=>Me("semester_delete",{id:n}),d4=n=>Me("course_upsert",n),h4=n=>Me("course_delete",{id:n}),m4=n=>Me("band_upsert",n),y4=n=>Me("band_delete",{id:n}),bd=n=>Me("attachment_add",n),pp=n=>Me("attachment_list",{owner_id:n}),bp=n=>Me("attachment_delete",{id:n}),tr=n=>Me("attachment_read",{id:n}),v4=()=>Me("view_list"),g4=n=>Me("view_upsert",n),p4=n=>Me("view_delete",{id:n});async function b4(n=""){return(await fetch(n+"/admin/invites",{headers:{Authorization:"Bearer "+Cl()}})).json()}async function x4(n,r=""){return(await fetch(r+"/admin/invites/generate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Cl()},body:JSON.stringify({count:n})})).json()}async function S4(n,r=""){return(await fetch(r+"/admin/invites/revoke",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Cl()},body:JSON.stringify({id:n})})).json()}async function E4(n=""){return(await fetch(n+"/admin/users",{headers:{Authorization:"Bearer "+Cl()}})).json()}const _4=Object.freeze(Object.defineProperty({__proto__:null,adminCreateInvites:x4,adminListInvites:b4,adminListUsers:E4,adminRevokeInvite:S4,appInfo:WE,attachmentAdd:bd,attachmentDelete:bp,attachmentList:pp,attachmentRead:tr,bandDelete:y4,bandUpsert:m4,clearToken:Vd,courseDelete:h4,courseUpsert:d4,deleteDimension:a4,deleteTaxonomy:t4,deleteType:IE,footprintDelete:n4,footprintGet:Jd,footprintList:yp,footprintUpsert:vp,getToken:Cl,gradesOverview:c4,isLocalMode:$E,isTauriRef:nc,listDimensions:Zd,listTaxonomy:mp,listTypes:ic,metricDelete:s4,metricList:u4,metricUpsert:r4,semesterDelete:f4,semesterUpsert:o4,serverLogin:Xd,serverMe:dp,serverRegister:Kd,setToken:Yd,statsOverview:i4,syncStatus:hp,timeline:gp,upsertDimension:l4,upsertTaxonomy:e4,upsertType:PE,viewDelete:p4,viewList:v4,viewUpsert:g4},Symbol.toStringTag,{value:"Module"}));function xp(n){var r,s,c="";if(typeof n=="string"||typeof n=="number")c+=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,I0=Sp,T4=(n,r)=>s=>{var c;if((r==null?void 0:r.variants)==null)return I0(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:h}=r,d=Object.keys(f).map(g=>{const x=s==null?void 0:s[g],p=h==null?void 0:h[g];if(x===null)return null;const C=P0(x)||P0(p);return f[g][C]}),v=s&&Object.entries(s).reduce((g,x)=>{let[p,C]=x;return C===void 0||(g[p]=C),g},{}),b=r==null||(c=r.compoundVariants)===null||c===void 0?void 0:c.reduce((g,x)=>{let{class:p,className:C,...L}=x;return Object.entries(L).every(G=>{let[q,U]=G;return Array.isArray(U)?U.includes({...h,...v}[q]):{...h,...v}[q]===U})?[...g,p,C]:g},[]);return I0(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},N4=(n,r)=>{const s=new Array(n.length+r.length);for(let c=0;c({classGroupId:n,validator:r}),Ep=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),Ps="-",eg=[],z4="arbitrary..",O4=n=>{const r=w4(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:c}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return R4(d);const v=d.split(Ps),b=v[0]===""&&v.length>1?1:0;return _p(v,b,r)},getConflictingClassGroupIds:(d,v)=>{if(v){const b=c[d],g=s[d];return b?g?N4(g,b):b:g||eg}return s[d]||eg}}},_p=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],h=s.nextPart.get(f);if(h){const g=_p(n,r+1,h);if(g)return g}const d=s.validators;if(d===null)return;const v=r===0?n.join(Ps):n.slice(r).join(Ps),b=d.length;for(let g=0;gn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),c=r.slice(0,s);return c?z4+c:void 0})(),w4=n=>{const{theme:r,classGroups:s}=n;return j4(s,r)},j4=(n,r)=>{const s=Ep();for(const c in n){const f=n[c];Fd(f,s,c,r)}return s},Fd=(n,r,s,c)=>{const f=n.length;for(let h=0;h{if(typeof n=="string"){M4(n,r,s);return}if(typeof n=="function"){D4(n,r,s,c);return}U4(n,r,s,c)},M4=(n,r,s)=>{const c=n===""?r:Tp(r,n);c.classGroupId=s},D4=(n,r,s,c)=>{if(k4(n)){Fd(n(c),r,s,c);return}r.validators===null&&(r.validators=[]),r.validators.push(C4(s,n))},U4=(n,r,s,c)=>{const f=Object.entries(n),h=f.length;for(let d=0;d{let s=n;const c=r.split(Ps),f=c.length;for(let h=0;h"isThemeGetter"in n&&n.isThemeGetter===!0,H4=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),c=Object.create(null);const f=(h,d)=>{s[h]=d,r++,r>n&&(r=0,c=s,s=Object.create(null))};return{get(h){let d=s[h];if(d!==void 0)return d;if((d=c[h])!==void 0)return f(h,d),d},set(h,d){h in s?s[h]=d:f(h,d)}}},xd="!",tg=":",q4=[],lg=(n,r,s,c,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:c,isExternal:f}),L4=n=>{const{prefix:r,experimentalParseClassName:s}=n;let c=f=>{const h=[];let d=0,v=0,b=0,g;const x=f.length;for(let q=0;qb?g-b:void 0;return lg(h,L,C,G)};if(r){const f=r+tg,h=c;c=d=>d.startsWith(f)?h(d.slice(f.length)):lg(q4,!1,d,void 0,!0)}if(s){const f=c;c=h=>s({className:h,parseClassName:f})}return c},B4=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,c)=>{r.set(s,1e6+c)}),s=>{const c=[];let f=[];for(let h=0;h0&&(f.sort(),c.push(...f),f=[]),c.push(d)):f.push(d)}return f.length>0&&(f.sort(),c.push(...f)),c}},Q4=n=>({cache:H4(n.cacheSize),parseClassName:L4(n),sortModifiers:B4(n),postfixLookupClassGroupIds:G4(n),...O4(n)}),G4=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let c=0;c{const{parseClassName:s,getClassGroupId:c,getConflictingClassGroupIds:f,sortModifiers:h,postfixLookupClassGroupIds:d}=r,v=[],b=n.trim().split(Y4);let g="";for(let x=b.length-1;x>=0;x-=1){const p=b[x],{isExternal:C,modifiers:L,hasImportantModifier:G,baseClassName:q,maybePostfixModifierPosition:U}=s(p);if(C){g=p+(g.length>0?" "+g:g);continue}let Q=!!U,Y;if(Q){const K=q.substring(0,U);Y=c(K);const M=Y&&d[Y]?c(q):void 0;M&&M!==Y&&(Y=M,Q=!1)}else Y=c(q);if(!Y){if(!Q){g=p+(g.length>0?" "+g:g);continue}if(Y=c(q),!Y){g=p+(g.length>0?" "+g:g);continue}Q=!1}const V=L.length===0?"":L.length===1?L[0]:h(L).join(":"),P=G?V+xd:V,Z=P+Y;if(v.indexOf(Z)>-1)continue;v.push(Z);const ce=f(Y,Q);for(let K=0;K0?" "+g:g)}return g},X4=(...n)=>{let r=0,s,c,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let c=0;c{let s,c,f,h;const d=b=>{const g=r.reduce((x,p)=>p(x),n());return s=Q4(g),c=s.cache.get,f=s.cache.set,h=v,v(b)},v=b=>{const g=c(b);if(g)return g;const x=V4(b,s);return f(b,x),x};return h=d,(...b)=>h(X4(...b))},Z4=[],st=n=>{const r=s=>s[n]||Z4;return r.isThemeGetter=!0,r.themeKey=n,r},Cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$4=/\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$/,W4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,P4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xa=n=>J4.test(n),Te=n=>!!n&&!Number.isNaN(Number(n)),Yl=n=>!!n&&Number.isInteger(Number(n)),ed=n=>n.endsWith("%")&&Te(n.slice(0,-1)),ca=n=>F4.test(n),Op=()=>!0,e_=n=>$4.test(n)&&!W4.test(n),$d=()=>!1,t_=n=>P4.test(n),l_=n=>I4.test(n),a_=n=>!ne(n)&&!ie(n),n_=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)),i_=n=>ln(n,jp,$d),ne=n=>Cp.test(n),zn=n=>ln(n,Ap,e_),ag=n=>ln(n,h_,Te),u_=n=>ln(n,Dp,Op),r_=n=>ln(n,Mp,$d),ng=n=>ln(n,Rp,$d),s_=n=>ln(n,wp,l_),Xs=n=>ln(n,Up,t_),ie=n=>zp.test(n),Pu=n=>Gn(n,Ap),c_=n=>Gn(n,Mp),ig=n=>Gn(n,Rp),o_=n=>Gn(n,jp),f_=n=>Gn(n,wp),Ks=n=>Gn(n,Up,!0),d_=n=>Gn(n,Dp,!0),ln=(n,r,s)=>{const c=Cp.exec(n);return c?c[1]?r(c[1]):s(c[2]):!1},Gn=(n,r,s=!1)=>{const c=zp.exec(n);return c?c[1]?r(c[1]):s:!1},Rp=n=>n==="position"||n==="percentage",wp=n=>n==="image"||n==="url",jp=n=>n==="length"||n==="size"||n==="bg-size",Ap=n=>n==="length",h_=n=>n==="number",Mp=n=>n==="family-name",Dp=n=>n==="number"||n==="weight",Up=n=>n==="shadow",m_=()=>{const n=st("color"),r=st("font"),s=st("text"),c=st("font-weight"),f=st("tracking"),h=st("leading"),d=st("breakpoint"),v=st("container"),b=st("spacing"),g=st("radius"),x=st("shadow"),p=st("inset-shadow"),C=st("text-shadow"),L=st("drop-shadow"),G=st("blur"),q=st("perspective"),U=st("aspect"),Q=st("ease"),Y=st("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Z=()=>[...P(),ie,ne],ce=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],M=()=>[ie,ne,b],ae=()=>[Xa,"full","auto",...M()],ge=()=>[Yl,"none","subgrid",ie,ne],I=()=>["auto",{span:["full",Yl,ie,ne]},Yl,ie,ne],he=()=>[Yl,"auto",ie,ne],Je=()=>["auto","min","max","fr",ie,ne],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...M()],$=()=>[Xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],de=()=>[v,Xa,"screen","full","dvw","lvw","svw","min","max","fit",...M()],ke=()=>[Xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],J=()=>[n,ie,ne],Ut=()=>[...P(),ig,ng,{position:[ie,ne]}],al=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Rl=()=>["auto","cover","contain",o_,i_,{size:[ie,ne]}],N=()=>[ed,Pu,zn],B=()=>["","none","full",g,ie,ne],te=()=>["",Te,Pu,zn],se=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Te,ed,ig,ng],je=()=>["","none",G,ie,ne],ue=()=>["none",Te,ie,ne],ye=()=>["none",Te,ie,ne],Gt=()=>[Te,ie,ne],ya=()=>[Xa,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ca],breakpoint:[ca],color:[Op],container:[ca],"drop-shadow":[ca],ease:["in","out","in-out"],font:[a_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ca],shadow:[ca],spacing:["px",Te],text:[ca],"text-shadow":[ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xa,ne,ie,U]}],container:["container"],"container-type":[{"@container":["","normal","size",ie,ne]}],"container-named":[n_],columns:[{columns:[Te,"auto",ne,ie,v]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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:Z()}],overflow:[{overflow:ce()}],"overflow-x":[{"overflow-x":ce()}],"overflow-y":[{"overflow-y":ce()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Yl,"auto",ie,ne]}],basis:[{basis:[Xa,"full","auto",v,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Xa,"auto","initial","none",ne]}],grow:[{grow:["",Te,ie,ne]}],shrink:[{shrink:["",Te,ie,ne]}],order:[{order:[Yl,"first","last","none",ie,ne]}],"grid-cols":[{"grid-cols":ge()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":ge()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Je()}],"auto-rows":[{"auto-rows":Je()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...ke()]}],"min-block-size":[{"min-block":["auto",...ke()]}],"max-block-size":[{"max-block":["none",...ke()]}],w:[{w:[v,"screen",...$()]}],"min-w":[{"min-w":[v,"screen","none",...$()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",s,Pu,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,d_,u_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ed,ne]}],"font-family":[{font:[c_,r_,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,ie,ne]}],"line-clamp":[{"line-clamp":[Te,"none",ie,ag]}],leading:[{leading:["none",h,...M()]}],"list-image":[{"list-image":["none",ie,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ie,zn]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Te,"auto",ie,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[Yl,ie,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,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",ie,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:Ut()}],"bg-repeat":[{bg:al()}],"bg-size":[{bg:Rl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yl,ie,ne],radial:["",ie,ne],conic:["",Yl,ie,ne]},f_,s_]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ie,ne]}],"outline-w":[{outline:["",Te,Pu,zn]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","inner","none",x,Ks,Xs]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",p,Ks,Xs]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Te,zn]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",C,Ks,Xs]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Te,ie,ne]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"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":[Te]}],"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":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ie,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":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"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":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ut()}],"mask-repeat":[{mask:al()}],"mask-size":[{mask:Rl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,ne]}],filter:[{filter:["","none",ie,ne]}],blur:[{blur:je()}],brightness:[{brightness:[Te,ie,ne]}],contrast:[{contrast:[Te,ie,ne]}],"drop-shadow":[{"drop-shadow":["","none",L,Ks,Xs]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Te,ie,ne]}],"hue-rotate":[{"hue-rotate":[Te,ie,ne]}],invert:[{invert:["",Te,ie,ne]}],saturate:[{saturate:[Te,ie,ne]}],sepia:[{sepia:["",Te,ie,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,ne]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ie,ne]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ie,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ie,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ie,ne]}],"backdrop-invert":[{"backdrop-invert":["",Te,ie,ne]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ie,ne]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ie,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ie,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ie,ne]}],ease:[{ease:["linear","initial",Q,ie,ne]}],delay:[{delay:[Te,ie,ne]}],animate:[{animate:["none",Y,ie,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[q,ie,ne]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Gt()}],"skew-x":[{"skew-x":Gt()}],"skew-y":[{"skew-y":Gt()}],transform:[{transform:[ie,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ya()}],"translate-x":[{"translate-x":ya()}],"translate-y":[{"translate-y":ya()}],"translate-z":[{"translate-z":ya()}],"translate-none":["translate-none"],zoom:[{zoom:[Yl,ie,ne]}],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",ie,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":J()}],"scrollbar-track-color":[{"scrollbar-track":J()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ie,ne]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Te,Pu,zn,ag]}],stroke:[{stroke:["none",...J()]}],"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"]}},y_=K4(m_);function zl(...n){return y_(Sp(n))}const v_=T4("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"}}),Dt=_.forwardRef(function({className:r,variant:s,size:c,...f},h){return m.jsx("button",{ref:h,className:zl(v_({variant:s,size:c}),r),...f})}),kp="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",ft=_.forwardRef(function({className:r,...s},c){return m.jsx("input",{ref:c,className:zl(kp,"h-8",r),...s})}),Sd=_.forwardRef(function({className:r,...s},c){return m.jsx("textarea",{ref:c,className:zl(kp,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function Ue({label:n,required:r,hint:s,className:c,children:f}){return m.jsxs("div",{className:zl("flex flex-col gap-1.5",c),children:[m.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&m.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&m.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const ml=_.forwardRef(function({className:r,options:s,children:c,...f},h){return m.jsxs("div",{className:zl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[m.jsx("select",{ref:h,className:zl("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=>m.jsx("option",{value:d.value,children:d.label},d.value)):c}),m.jsx(k3,{size:14,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-ink-3"})]})});function Wi({className:n,color:r,...s}){return m.jsx("span",{className:zl("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 g_({className:n,...r}){return m.jsx("span",{className:zl("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 uc({open:n,onClose:r,title:s,width:c=560,children:f,footer:h}){return _.useEffect(()=>{if(!n)return;const d=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n,r]),n?DS.createPortal(m.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 pt-[8vh]",children:[m.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),m.jsxs("div",{className:"relative w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:c},role:"dialog",children:[m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[m.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),m.jsx(Dt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:m.jsx(fp,{size:15})})]}),m.jsx("div",{className:"px-4 py-4 max-h-[64vh] overflow-y-auto",children:f}),h&&m.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-4 h-14",children:h})]})]}),document.body):null}function p_({icon:n,title:r,description:s,action:c}){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[m.jsx("div",{className:"text-ink-3",children:n??m.jsx(lE,{size:36,strokeWidth:1.5})}),m.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&m.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),c&&m.jsx("div",{className:"mt-2",children:c})]})}const Hp=_.createContext(()=>{});function qp(){return _.useContext(Hp)}const b_={success:m.jsx(B3,{size:15,className:"text-success"}),error:m.jsx(q3,{size:15,className:"text-danger"}),info:m.jsx(nE,{size:15,className:"text-brand"})};function x_({children:n}){const[r,s]=_.useState([]),c=_.useRef(0),f=_.useCallback((h,d)=>{const v=++c.current;s(b=>[...b,{id:v,kind:h,text:d}]),setTimeout(()=>s(b=>b.filter(g=>g.id!==v)),3200)},[]);return m.jsxs(Hp.Provider,{value:f,children:[n,m.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(h=>m.jsxs("div",{className:zl("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:[b_[h.kind],h.text]},h.id))})]})}function S_({open:n,title:r,content:s,onCancel:c,onOk:f,loading:h}){return m.jsx(uc,{open:n,onClose:c,title:r,width:420,footer:m.jsxs(m.Fragment,{children:[m.jsx(Dt,{variant:"secondary",onClick:c,children:"取消"}),m.jsx(Dt,{variant:"danger",onClick:f,disabled:h,children:"确认"})]}),children:m.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function E_({open:n,onClose:r,defaultUrl:s}){const c=or(),[f,h]=_.useState("login"),[d,v]=_.useState(s),[b,g]=_.useState(""),[x,p]=_.useState(""),[C,L]=_.useState(""),[G,q]=_.useState(""),[U,Q]=_.useState(!1),Y=async()=>{if(!b.trim()||!x){q("请填写账号与密码");return}let V=d.trim();V&&!V.startsWith("http")&&(V="https://"+V),Q(!0),q("");try{if(f==="login")await Xd(b.trim(),x,V);else{if(!C.trim())throw new Error("请填写邀请码");await Kd(b.trim(),x,C.trim(),V)}c.invalidateQueries(),r(),window.location.reload()}catch(P){q(P.message)}finally{Q(!1)}};return m.jsx(uc,{open:n,onClose:r,width:440,title:f==="login"?"登录账号":"注册账号",footer:m.jsxs(m.Fragment,{children:[m.jsx(Dt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(Dt,{variant:"primary",onClick:()=>void Y(),disabled:U,children:U?"请稍候…":"确定"})]}),children:m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(Ue,{label:"服务器地址",hint:"默认与网页版同一账号体系",children:m.jsx(ft,{value:d,onChange:V=>v(V.target.value),placeholder:"https://footpr.linyux.cn"})}),m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(ft,{value:b,onChange:V=>g(V.target.value),placeholder:"3-32 位字母数字-_"})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(ft,{type:"password",value:x,onChange:V=>p(V.target.value),placeholder:"至少 8 位"})}),f==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(ft,{value:C,onChange:V=>L(V.target.value),placeholder:"邀请码"})}),G&&m.jsx("div",{className:"text-[12px] text-danger",children:G}),m.jsx("div",{className:"flex text-[12px] text-ink-3 gap-2",children:m.jsx("button",{className:"underline hover:text-ink-1",onClick:()=>{h(f==="login"?"register":"login"),q("")},children:f==="login"?"没有账号?注册":"已有账号?登录"})})]})})}const __=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:rp},{to:"/records",label:"记录",icon:OE},{to:"/grades",label:"成绩",icon:cp},{to:"/dashboard",label:"统计",icon:D3}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:kE},{to:"/types",label:"记录类型",icon:AE},{to:"/taxonomy",label:"字典与维度",icon:qE}]}];function T_(){return m.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function N_(){return nc()&&localStorage.getItem("fp-server-url")||""}function C_({open:n,onClose:r}){const s=!nc(),c=el({queryKey:["sync-status"],queryFn:hp,refetchInterval:15e3}),h=el({queryKey:["me"],queryFn:()=>dp(N_()),enabled:!!Cl(),retry:0}).data??null,[d,v]=_.useState(!1);return m.jsxs("aside",{className:"flex w-[224px] 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:[m.jsxs("div",{className:"flex h-14 items-center gap-2.5 border-b border-line px-4",children:[m.jsx(T_,{}),m.jsxs("div",{className:"leading-tight",children:[m.jsx("div",{className:"text-[14px] font-semibold text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[10px] font-medium tracking-[0.18em] text-ink-3",children:"FOOTPRINTS"})]})]}),m.jsx(E_,{open:d,onClose:()=>v(!1),defaultUrl:localStorage.getItem("fp-server-url")||"https://footpr.linyux.cn"}),m.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:__.map(b=>m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"px-2 pb-1.5 text-[11px] font-medium text-ink-3",children:b.section}),m.jsx("div",{className:"flex flex-col gap-0.5",children:b.items.map(g=>m.jsxs(Zg,{to:g.to,onClick:r,className:({isActive:x})=>zl("flex h-8 items-center gap-2.5 rounded-md px-2 text-[13px] transition-colors",x?"bg-brand-subtle font-medium text-brand-text":"text-ink-2 hover:bg-surface-3 hover:text-ink-1"),children:[m.jsx(g.icon,{size:15,strokeWidth:2}),g.label]},g.to))})]},b.section))}),m.jsxs("div",{className:"border-t border-line px-4 py-3",children:[Cl()?m.jsxs("div",{className:"mb-2",children:[h&&m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"min-w-0 truncate text-[12px] font-medium text-ink-1",title:h.username,children:[h.is_admin&&m.jsx("span",{className:"mr-1 text-brand-text",children:"管理员"}),h.username]}),m.jsx("button",{className:"shrink-0 text-[11px] text-ink-3 underline transition-colors hover:text-danger",onClick:()=>{Vd(),localStorage.removeItem("fp-server-url"),window.location.reload()},children:"退出"})]}),!s&&m.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-[12px] text-ink-2 transition-colors hover:bg-surface-3 hover:text-ink-1",onClick:()=>v(!0),children:[m.jsx(W0,{size:13}),h?"账号与同步设置":"已注册 · 登录同步"]}),!s&&m.jsx("div",{className:"num text-[10px] text-ink-3",children:c.data?"同步 · 待推送 "+c.data.pending_ops:"…"})]}):m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-md bg-brand-subtle px-2 py-1.5 text-[12.5px] font-medium text-brand-text transition-colors hover:brightness-[0.97]",onClick:()=>v(!0),children:[m.jsx(W0,{size:13}),"登录 / 注册账号"]}),m.jsx("div",{className:"text-[10px] text-ink-3",children:"未登录 = 本地模式,数据仅存本机"})]}),!s&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[11px] text-ink-3",children:[m.jsx(z_,{}),"数据库 · 本地存储"]})]})]})}function z_(){return m.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("path",{d:"M11 17l-5-5 5-5"}),m.jsx("path",{d:"M18 17l-5-5 5-5"})]})}const O_={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function R_({onMenu:n}){const{pathname:r}=yl(),s=tc(),[c,f]=_.useState(""),[h,d]=_.useState(document.documentElement.classList.contains("dark")),v=O_[r]??{title:""},b=()=>{const g=!h;d(g),document.documentElement.classList.toggle("dark",g),localStorage.setItem("fp-theme",g?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return m.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-4 border-b border-line bg-surface px-5",children:[m.jsx(Dt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:m.jsx(cE,{size:17})}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:v.title}),v.sub&&m.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:v.sub})]}),m.jsxs("div",{className:"relative ml-auto w-[280px]",children:[m.jsx(wE,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),m.jsx(ft,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:c,onChange:g=>f(g.target.value),onKeyDown:g=>{g.key==="Enter"&&c.trim()&&s("/records?q="+encodeURIComponent(c.trim()))}})]}),m.jsx(Dt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:h?m.jsx(GE,{size:15}):m.jsx(hE,{size:15})}),m.jsxs(Dt,{variant:"primary",onClick:()=>s("/records?new=1"),children:[m.jsx(TE,{size:14}),"新建记录"]})]})}function w_(){return m.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function j_({onAuthed:n}){const[r,s]=_.useState("login"),[c,f]=_.useState(""),[h,d]=_.useState(""),[v,b]=_.useState(""),[g,x]=_.useState(""),[p,C]=_.useState(!1),L=async()=>{if(!c.trim()||!h){x("请填写账号与密码");return}C(!0),x("");try{if(r==="login")await Xd(c.trim(),h);else{if(!v.trim())throw new Error("请填写邀请码");await Kd(c.trim(),h,v.trim())}n()}catch(G){x(G.message)}finally{C(!1)}};return m.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:m.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[m.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[m.jsx(w_,{}),m.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),m.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(r==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{s("login"),x("")},children:"登录"}),m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(r==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{s("register"),x("")},children:"注册"})]}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(ft,{value:c,onChange:G=>f(G.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:G=>{G.key==="Enter"&&L()}})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(ft,{type:"password",value:h,onChange:G=>d(G.target.value),placeholder:"至少 8 位",onKeyDown:G=>{G.key==="Enter"&&L()}})}),r==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(ft,{value:v,onChange:G=>b(G.target.value),placeholder:"邀请码",onKeyDown:G=>{G.key==="Enter"&&L()}})}),g&&m.jsx("div",{className:"text-[12px] text-danger",children:g}),m.jsx(Dt,{variant:"primary",size:"lg",onClick:()=>void L(),disabled:p,children:p?"请稍候…":r==="login"?"进入我的档案":"创建我的档案"}),m.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"数据按账号隔离存储 · 未注册用户请联系管理员获取邀请码"})]})]})})}function A_(){const[n,r]=_.useState(()=>nc()||!!Cl()),[s,c]=_.useState(!1);return _.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?m.jsx(x_,{children:m.jsxs("div",{className:"flex h-full",children:[s&&m.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>c(!1),"aria-hidden":!0}),m.jsx(C_,{open:s,onClose:()=>c(!1)}),m.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[m.jsx(R_,{onMenu:()=>c(!0)}),m.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:m.jsx(Px,{})})]})]})}):m.jsx(j_,{onAuthed:()=>r(!0)})}const ug={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 Lp({status:n}){const r=ug[n]??ug.draft;return m.jsx("span",{className:"inline-flex items-center rounded-sm px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const M_={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function Bp({level:n}){return n?m.jsx(Wi,{color:M_[n]??"var(--text-3)",children:n}):null}const D_={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function Qp({grade:n}){return n?m.jsx(Wi,{color:D_[n]??"var(--text-3)",children:n}):null}function Gp({role:n}){return n?m.jsx(g_,{children:n}):null}function Yp(){return m.jsx(Wi,{color:"var(--danger)",children:"负面"})}const n5=[{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:"体育"}],U_={tag:op,"graduation-cap":cp,trophy:KE,"flask-conical":F3,briefcase:R3,network:yE,"heart-handshake":P3,palette:gE,award:N3,"file-badge":K3,star:BE,"shield-alert":DE,"book-open":z3,"code-2":G3,languages:uE,"mic-2":fE,"pen-line":xE,rocket:CE,users:JE,"building-2":j3,dumbbell:V3};function k_({name:n,color:r,size:s=14,className:c}){const f=U_[n]??op;return m.jsx(f,{size:s,color:r,className:c,strokeWidth:2})}function H_({value:n,onChange:r,placeholder:s}){const[c,f]=_.useState(""),h=()=>{const v=c.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),h()):v.key==="Backspace"&&!c&&n.length&&r(n.slice(0,-1))};return m.jsxs("div",{className:zl("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(v=>m.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,m.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:m.jsx(fp,{size:11})})]},v)),m.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:c,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:h})]})}function rg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function q_({fields:n,value:r,onChange:s,taxonomies:c}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),h=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",g=x=>d.unit?m.jsxs("div",{className:"flex items-center gap-2",children:[x,m.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(Sd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:g(m.jsx(ft,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ft,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...rg(d,c)]})},d.key);case"multiselect":{const x=rg(d,c),p=Array.isArray(v)?v:[];return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(C=>{const L=p.includes(C.value);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(L?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,L?p.filter(G=>G!==C.value):[...p,C.value]),children:C.label},C.value)}),!x.length&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return m.jsx(Ue,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:m.jsx(ft,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ft,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>m.jsx("div",{className:d.widget==="textarea"?"col-span-2":"",children:h(d)},d.key))})}function sg(n){return n?n.slice(0,16).replace("T"," "):""}function L_(n,r){const s=n?n.slice(0,10):"",c=r?r.slice(0,10):"";return s&&c?s+" ~ "+c:s?s+(r===""?"":" 起"):c?"至 "+c:""}function Ed(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function cg({items:n,pending:r,onPick:s,onDeleteSaved:c,onDeletePending:f,onOpenSaved:h,uploading:d}){const v=_.useRef(null),b=n.length+r.length;return m.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[m.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[m.jsx(Qd,{size:13}),"附件(",b,")"]}),m.jsx(Dt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var g;return(g=v.current)==null?void 0:g.click()},children:d?"上传中…":"添加文件"}),m.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:g=>{var x;(x=g.target.files)!=null&&x.length&&s(g.target.files),g.target.value=""}})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(g=>m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[m.jsx(sp,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate "+(h?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>h==null?void 0:h(g),title:g.file_name,children:g.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(g.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>c(g.id),"aria-label":"删除附件",children:m.jsx(pd,{size:13})})]},"s"+g.id)),r.map((g,x)=>{var p;return m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(p=g.mime)!=null&&p.startsWith("image/")&&g.preview?m.jsx("img",{src:g.preview,alt:g.file_name,className:"size-7 shrink-0 rounded object-cover"}):m.jsx(eE,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate text-ink-1",children:g.file_name}),m.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(g.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:m.jsx(pd,{size:13})})]},"p"+x)}),!b&&m.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}function og(n){return new Promise((r,s)=>{const c=new FileReader;c.onload=()=>{var v;const f=String(c.result||""),h=f.indexOf(","),d=(v=n.type)!=null&&v.startsWith("image/")?URL.createObjectURL(n):void 0;r({file_name:n.name,mime:n.type||void 0,size:n.size,data_b64:h>=0?f.slice(h+1):f,preview:d})},c.onerror=()=>s(new Error("读取文件失败")),c.readAsDataURL(n)})}function Vp(n,r,s){if(!s)return;const c=Uint8Array.from(atob(s),d=>d.charCodeAt(0)),f=new Blob([c],{type:r||"application/octet-stream"}),h=URL.createObjectURL(f);if(r!=null&&r.startsWith("image/")||r==="application/pdf")window.open(h,"_blank");else{const d=document.createElement("a");d.href=h,d.download=n,d.click()}setTimeout(()=>URL.revokeObjectURL(h),6e4)}const fg={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:{}},B_=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],dg=80*1024*1024,Q_=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function G_({open:n,onClose:r,footprintId:s,onSaved:c}){var ae,ge,I,he,Je;const f=or(),h=qp(),[d,v]=_.useState(fg),[b,g]=_.useState([]),[x,p]=_.useState(!1),[C,L]=_.useState(""),G=el({queryKey:["types"],queryFn:ic,enabled:n}),q=el({queryKey:["taxonomy-all"],queryFn:()=>mp(),enabled:n}),U=el({queryKey:["dimensions"],queryFn:Zd,enabled:n}),Q=el({queryKey:["footprint",s],queryFn:()=>Jd(s),enabled:n&&!!s}),Y=el({queryKey:["attachments",s],queryFn:()=>pp(s),enabled:n&&!!s}),V=_.useMemo(()=>{var D;return(D=G.data)==null?void 0:D.items.find(ee=>ee.id===d.type_id)},[G.data,d.type_id]),P=el({queryKey:["parent-candidates",d.type_id],queryFn:()=>yp({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});_.useEffect(()=>{if(n)if(L(""),g([]),s&&Q.data){const D=Q.data.item;v({type_id:D.type_id,title:D.title,organizer:D.organizer??"",start_date:(D.start_date??"").slice(0,10),end_date:(D.end_date??"").slice(0,10),status:D.status,role:D.role??"",level:D.level??"",award_grade:D.award_grade??"",rank:D.rank!=null?String(D.rank):"",polarity:D.polarity,weight:String(D.weight??3),description:D.description??"",result:D.result??"",tags:D.tags??[],dimension_ids:D.dimensions??[],group_id:D.group_id??"",parent_id:D.parent_id!=null?String(D.parent_id):"",extras:D.extras??{}})}else v(fg)},[n,s,Q.data]);const Z=_.useMemo(()=>{var ee,X;const D={};for(const $ of((ee=q.data)==null?void 0:ee.items)??[])(D[X=$.kind]??(D[X]=[])).push({value:$.value,label:$.value});return D},[q.data]),ce=gd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const D={};for(const $ of(V==null?void 0:V.form_template)??[])if($.metric&&$.widget==="number"){const de=d.extras[$.key];typeof de=="number"&&!Number.isNaN(de)&&(D[$.metric]=de)}const ee={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:D},X=await vp(ee);for(const $ of b)await bd({owner_id:X.id,file_name:$.file_name,mime:$.mime,size:$.size,data_b64:$.data_b64});return X.id},onSuccess:D=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",D]}),f.invalidateQueries({queryKey:["types"]}),h("success",s?"记录已更新":"记录已创建"),c==null||c(D),r()},onError:D=>L(D.message)}),K=(D,ee)=>v(X=>({...X,[D]:ee})),M=gd({mutationFn:D=>bp(D),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})});return m.jsx(uc,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:m.jsxs(m.Fragment,{children:[C&&m.jsx("span",{className:"mr-auto text-[12px] text-danger",children:C}),m.jsx(Dt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(Dt,{variant:"primary",onClick:()=>ce.mutate(),disabled:ce.isPending,children:ce.isPending?"保存中…":"保存"})]}),children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"类型",required:!0,children:m.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:D=>K("type_id",D.target.value?Number(D.target.value):null),options:[{value:"",label:"请选择"},...(((ae=G.data)==null?void 0:ae.items)??[]).map(D=>({value:String(D.id),label:D.name}))]})}),m.jsx(Ue,{label:"标题",required:!0,children:m.jsx(ft,{value:d.title,onChange:D=>K("title",D.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"组织方 / 所在组织",children:m.jsx(ft,{value:d.organizer,onChange:D=>K("organizer",D.target.value),placeholder:"如:中国工业与应用数学学会"})}),m.jsx(Ue,{label:"开始日期",children:m.jsx(ft,{type:"date",value:d.start_date,onChange:D=>K("start_date",D.target.value)})}),m.jsx(Ue,{label:"结束日期",children:m.jsx(ft,{type:"date",value:d.end_date,onChange:D=>K("end_date",D.target.value)})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"角色",children:m.jsx(ml,{value:d.role,onChange:D=>K("role",D.target.value),options:[{value:"",label:"未设置"},...Z.role??[]]})}),m.jsx(Ue,{label:"级别",children:m.jsx(ml,{value:d.level,onChange:D=>K("level",D.target.value),options:[{value:"",label:"未设置"},...Z.level??[]]})}),m.jsx(Ue,{label:"状态",children:m.jsx(ml,{value:d.status,onChange:D=>K("status",D.target.value),options:Q_})}),m.jsx(Ue,{label:"重要度",children:m.jsx(ml,{value:d.weight,onChange:D=>K("weight",D.target.value),options:[1,2,3,4,5].map(D=>({value:String(D),label:String(D)}))})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"奖等",children:m.jsx(ml,{value:d.award_grade,onChange:D=>K("award_grade",D.target.value),options:[{value:"",label:"未设置"},...B_.map(D=>({value:D,label:D}))]})}),m.jsx(Ue,{label:"名次",children:m.jsx(ft,{type:"number",className:"num",value:d.rank,onChange:D=>K("rank",D.target.value),placeholder:"如 2"})}),m.jsx(Ue,{label:"性质",children:m.jsx(ml,{value:d.polarity,onChange:D=>K("polarity",D.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),m.jsx(Ue,{label:"上级记录",hint:"晋升链",children:m.jsx(ml,{value:d.parent_id,onChange:D=>K("parent_id",D.target.value),options:[{value:"",label:"无"},...(((ge=P.data)==null?void 0:ge.items)??[]).filter(D=>D.id!==s).map(D=>({value:String(D.id),label:D.title.slice(0,24)}))]})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"工作内容 / 描述",children:m.jsx(Sd,{value:d.description,onChange:D=>K("description",D.target.value),placeholder:"具体做了什么、承担什么分工"})}),m.jsx(Ue,{label:"结果 / 产出",children:m.jsx(Sd,{value:d.result,onChange:D=>K("result",D.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"标签",children:m.jsx(H_,{value:d.tags,onChange:D=>K("tags",D)})}),m.jsx(Ue,{label:"成长维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((I=U.data)==null?void 0:I.items)??[]).map(D=>{const ee=d.dimension_ids.includes(D.id);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ee?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>K("dimension_ids",ee?d.dimension_ids.filter(X=>X!==D.id):[...d.dimension_ids,D.id]),children:D.name},D.id)}),!((he=U.data)!=null&&he.items.length)&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:m.jsx(Ue,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:m.jsx(ft,{value:d.group_id,onChange:D=>K("group_id",D.target.value),placeholder:"如 g2025001(可选)"})})}),V&&V.form_template.length>0&&m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsxs("div",{className:"mb-3 text-[12px] font-semibold text-ink-2",children:["类型字段 · ",V.name]}),m.jsx(q_,{fields:V.form_template,value:d.extras,onChange:D=>K("extras",D),taxonomies:Z})]}),s?m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(cg,{items:((Je=Y.data)==null?void 0:Je.items)??[],pending:b,uploading:x,onPick:async D=>{if(s){p(!0);try{let ee=0;for(const X of Array.from(D)){if(X.size>dg){h("error","「"+X.name+"」超过 80MB,已跳过");continue}const $=await og(X);await bd({owner_id:s,file_name:$.file_name,mime:$.mime,size:$.size,data_b64:$.data_b64}),ee++}ee>0&&(f.invalidateQueries({queryKey:["attachments",s]}),h("success","已上传 "+ee+" 个附件"))}catch(ee){h("error",ee.message)}finally{p(!1)}}},onDeleteSaved:D=>M.mutate(D),onDeletePending:()=>{},onOpenSaved:async D=>{try{const ee=await tr(D.id);Vp(ee.file_name,ee.mime??void 0,ee.data_b64)}catch(ee){h("error",ee.message)}}}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可预览(支持图片 / PDF,其余下载)· 单个文件不超过 80MB"})]}):m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(cg,{items:[],pending:b,onPick:async D=>{const ee=[];for(const X of Array.from(D)){if(X.size>dg){h("error","「"+X.name+"」超过 80MB,已跳过");continue}ee.push(await og(X))}g(X=>[...X,...ee])},onDeleteSaved:()=>{},onDeletePending:D=>g(ee=>ee.filter((X,$)=>$!==D))}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]})})}function Y_(n,r,s=480,c=.82){return new Promise((f,h)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),g=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=g;const p=x.getContext("2d");if(!p)return h(new Error("canvas 不可用"));p.drawImage(d,0,0,b,g),f(x.toDataURL("image/webp",c))}catch(v){h(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>h(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function V_({open:n,onClose:r,footprintId:s,onEdit:c}){var K,M,ae,ge;const f=or(),h=qp(),d=el({queryKey:["footprint",s],queryFn:()=>Jd(s),enabled:n&&!!s}),v=el({queryKey:["types"],queryFn:ic,enabled:n}),b=el({queryKey:["dimensions"],queryFn:Zd,enabled:n}),g=(K=d.data)==null?void 0:K.item,x=(M=v.data)==null?void 0:M.items.find(I=>I.id===(g==null?void 0:g.type_id)),p=((g==null?void 0:g.dimensions)??[]).map(I=>{var he,Je;return(Je=(he=b.data)==null?void 0:he.items.find(D=>D.id===I))==null?void 0:Je.name}).filter(Boolean),[C,L]=_.useState(!1),G=gd({mutationFn:()=>tn(()=>Promise.resolve().then(()=>_4),void 0).then(I=>I.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),h("success","记录已删除"),L(!1),r()}}),q=async I=>{try{const he=await tr(I.id);Vp(he.file_name,he.mime??void 0,he.data_b64)}catch(he){h("error",he.message)}},[U,Q]=_.useState({}),Y=(g==null?void 0:g.attachments)??[],V=Y.filter(I=>{var he;return(he=I.mime)==null?void 0:he.startsWith("image/")}),P=Y.filter(I=>{var he;return!((he=I.mime)!=null&&he.startsWith("image/"))}),Z=Y.map(I=>I.id).join(",");_.useEffect(()=>{if(Q({}),!n||!Z)return;let I=!1;return(async()=>{const he={},Je=Y.filter(D=>{var ee;return(ee=D.mime)==null?void 0:ee.startsWith("image/")});for(const D of Je)try{const ee=await tr(D.id);if(I)return;he[D.id]=await Y_(ee.data_b64,ee.mime||"image/png"),Q({...he})}catch{try{const ee=await tr(D.id);he[D.id]="data:"+(ee.mime||"image/png")+";base64,"+ee.data_b64,Q({...he})}catch{}}})(),()=>{I=!0}},[n,s,Z]);const ce=[];if(g&&x)for(const I of x.form_template??[]){const he=(g.extras??{})[I.key];if(he==null||he==="")continue;const Je=Array.isArray(he)?he.join("、"):String(he);ce.push({label:I.label,value:I.unit?Je+" "+I.unit:Je})}return m.jsxs(uc,{open:n,onClose:r,width:680,title:g?g.title:"记录详情",footer:g?m.jsxs(m.Fragment,{children:[m.jsxs(Dt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>L(!0),disabled:G.isPending,children:[m.jsx(pd,{size:13})," 删除"]}),m.jsx(Dt,{variant:"secondary",onClick:r,children:"关闭"}),m.jsxs(Dt,{variant:"primary",onClick:()=>s&&(c==null?void 0:c(s)),children:[m.jsx(EE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!g?m.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx(Wi,{color:g.type_color,children:g.type_name}),m.jsx(Bp,{level:g.level}),m.jsx(Qp,{grade:g.award_grade}),m.jsx(Gp,{role:g.role}),m.jsx(Lp,{status:g.status}),g.polarity==="negative"&&m.jsx(Yp,{}),g.rank!=null&&m.jsxs(Wi,{color:"var(--text-3)",children:["第 ",g.rank," 名"]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px]",children:[m.jsx(On,{label:"时间",value:L_(g.start_date,g.end_date)||"—"}),m.jsx(On,{label:"组织方",value:g.organizer||"—"}),g.group_id&&m.jsx(On,{label:"事件组",value:g.group_id}),g.parent_id!=null&&m.jsx(On,{label:"上级记录",value:"#"+g.parent_id}),m.jsx(On,{label:"创建于",value:sg(g.created_at)}),m.jsx(On,{label:"更新于",value:sg(g.updated_at)})]}),g.description&&m.jsx(Di,{title:"工作内容 / 描述",children:m.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:g.description})}),g.result&&m.jsx(Di,{title:"结果 / 产出",children:m.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:g.result})}),ce.length>0&&m.jsx(Di,{title:x?"类型字段 · "+x.name:"类型字段",children:m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-2",children:ce.map(I=>m.jsx(On,{label:I.label,value:I.value},I.label))})}),g.metrics&&Object.keys(g.metrics).length>0&&m.jsx(Di,{title:"量化指标",children:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(g.metrics).map(([I,he])=>m.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[I,": ",m.jsx("span",{className:"font-medium text-ink-1",children:he})]},I))})}),((((ae=g.tags)==null?void 0:ae.length)??0)>0||p.length>0)&&m.jsx(Di,{title:"标签与维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[g.tags.map(I=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:I},I)),p.map(I=>m.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:I},I))]})}),m.jsx(Di,{title:"附件("+(((ge=g.attachments)==null?void 0:ge.length)??0)+")",children:Y.length?m.jsxs("div",{className:"flex flex-col gap-2.5",children:[V.length>0&&m.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:V.map(I=>m.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(I),title:"点击查看原图:"+I.file_name,children:[U[I.id]?m.jsx("img",{src:U[I.id],alt:I.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):m.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),m.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:I.file_name})]},I.id))}),P.length>0&&m.jsx("div",{className:"flex flex-col gap-1",children:P.map(I=>m.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(I),children:[m.jsx(sp,{size:14,className:"shrink-0 text-ink-3"}),m.jsx("span",{className:"truncate text-ink-1",children:I.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(I.size)}),m.jsx(Qd,{size:12,className:"shrink-0 text-ink-3"})]},I.id))}),m.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片查看原图(原始比例)"})]}):m.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})})]}),m.jsx(S_,{open:C,title:"删除记录",content:g?"确定删除「"+g.title+"」吗?该操作不可撤销。":"",onCancel:()=>L(!1),onOk:()=>G.mutate(),loading:G.isPending})]})}function On({label:n,value:r}){return m.jsxs("div",{className:"flex min-w-0 gap-2",children:[m.jsx("span",{className:"shrink-0 text-ink-3",children:n}),m.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Di({title:n,children:r}){return m.jsxs("div",{children:[m.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function X_(){var Z,ce,K;const[n,r]=_.useState(""),[s,c]=_.useState(""),[f,h]=_.useState(""),[d,v]=_.useState(""),[b,g]=_.useState(null),[x,p]=_.useState(!1),[C,L]=_.useState(null),[G,q]=_.useState(!1),U=el({queryKey:["types"],queryFn:ic}),Q=_.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]),Y=el({queryKey:["timeline",Q],queryFn:()=>gp(Q)}),V=_.useMemo(()=>{var ae;const M=new Set;for(const ge of((ae=Y.data)==null?void 0:ae.groups)??[])M.add(ge.year);return Array.from(M).sort((ge,I)=>I-ge)},[Y.data]),P=M=>{L(M),q(!0)};return m.jsxs("div",{className:"mx-auto max-w-[880px] px-6 py-5",children:[m.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[m.jsx(ft,{className:"w-[220px]",placeholder:"搜索足迹…",value:n,onChange:M=>r(M.target.value)}),m.jsx(ml,{className:"w-[130px]",value:s,onChange:M=>c(M.target.value),options:[{value:"",label:"全部类型"},...(((Z=U.data)==null?void 0:Z.items)??[]).map(M=>({value:String(M.id),label:M.name}))]}),m.jsx(ml,{className:"w-[120px]",value:f,onChange:M=>h(M.target.value),options:[{value:"",label:"全部年份"},...V.map(M=>({value:String(M),label:M+" 年"}))]}),m.jsx(ml,{className:"w-[110px]",value:d,onChange:M=>v(M.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]}),m.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((ce=Y.data)==null?void 0:ce.total)??0," 条"]})]}),Y.isLoading?m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(K=Y.data)!=null&&K.groups.length?m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Y.data.groups.map(M=>m.jsxs("section",{className:"mb-2",children:[m.jsxs("div",{className:"sticky top-0 z-10 -mx-6 flex items-center gap-2 bg-bg/90 px-6 py-2 backdrop-blur",children:[m.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:M.year}),m.jsxs("span",{className:"text-[12px] text-ink-3",children:[M.count," 条记录"]})]}),M.months.map(ae=>m.jsxs("div",{className:"mb-3",children:[m.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[ae.month," 月"]}),m.jsx("div",{className:"flex flex-col gap-2",children:ae.items.map(ge=>m.jsx(K_,{row:ge,onClick:()=>P(ge.id)},ge.id))})]},ae.month))]},M.year))]}):m.jsx(p_,{icon:m.jsx(rp,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),m.jsx(V_,{open:G,onClose:()=>q(!1),footprintId:C,onEdit:M=>{q(!1),g(M),p(!0)}}),m.jsx(G_,{open:x,onClose:()=>p(!1),footprintId:b})]})}function K_({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return m.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:[m.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),m.jsxs("div",{className:"flex items-start gap-3",children:[m.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)]}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),m.jsx(Wi,{color:n.type_color,children:n.type_name}),m.jsx(Bp,{level:n.level}),m.jsx(Qp,{grade:n.award_grade}),m.jsx(Gp,{role:n.role}),m.jsx(Lp,{status:n.status}),n.polarity==="negative"&&m.jsx(Yp,{})]}),n.organizer&&m.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&m.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)&&m.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&&m.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(c=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:c},c)),n.attachment_count>0&&m.jsxs("span",{className:"inline-flex items-center gap-1",children:[m.jsx(Qd,{size:11}),n.attachment_count]})]})]}),m.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:m.jsx(k_,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const Z_=_.lazy(()=>tn(()=>import("./RecordsPage-BfGvP4ga.js"),[]).then(n=>({default:n.RecordsPage}))),J_=_.lazy(()=>tn(()=>import("./DashboardPage-Cc-wrWjt.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),F_=_.lazy(()=>tn(()=>import("./GradesPage-QAvA3AVI.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),$_=_.lazy(()=>tn(()=>import("./TypesPage-k4XFWR3M.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),W_=_.lazy(()=>tn(()=>import("./TaxonomyPage-CwcRnHVH.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),P_=_.lazy(()=>tn(()=>import("./AdminPage-CBfyyvpO.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage})));function Ui(){return m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function I_(){return m.jsx(eS,{children:m.jsxs(El,{element:m.jsx(A_,{}),children:[m.jsx(El,{path:"/",element:m.jsx(L0,{to:"/timeline",replace:!0})}),m.jsx(El,{path:"/timeline",element:m.jsx(X_,{})}),m.jsx(El,{path:"/records",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(Z_,{})})}),m.jsx(El,{path:"/grades",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(F_,{})})}),m.jsx(El,{path:"/dashboard",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(J_,{})})}),m.jsx(El,{path:"/types",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx($_,{})})}),m.jsx(El,{path:"/taxonomy",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(W_,{})})}),m.jsx(El,{path:"/admin",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(P_,{})})}),m.jsx(El,{path:"*",element:m.jsx(L0,{to:"/timeline",replace:!0})})]})})}const e5=new r3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:15e3}}}),hg=localStorage.getItem("fp-theme");(hg==="dark"||!hg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});W2.createRoot(document.getElementById("root")).render(m.jsx(V2.StrictMode,{children:m.jsx(US,{client:e5,children:m.jsx(NS,{children:m.jsx(I_,{})})})}));export{S4 as $,Wi as A,Dt as B,S_ as C,uc as D,p_ as E,Ue as F,Qp as G,d4 as H,ft as I,c4 as J,k_ as K,Bp as L,PE as M,n5 as N,IE as O,TE as P,e4 as Q,Gp as R,ml as S,pd as T,t4 as U,l4 as V,a4 as W,Zd as X,Cl as Y,Ed as Z,x4 as _,zl as a,nc as a0,E4 as a1,b4 as a2,tn as a3,_4 as a4,qp as b,be as c,l5 as d,el as e,gd as f,L_ as g,Lp as h,sg as i,m as j,EE as k,V_ as l,G_ as m,n4 as n,ic as o,mp as p,yp as q,_ as r,i4 as s,cp as t,or as u,m4 as v,y4 as w,h4 as x,o4 as y,f4 as z}; + */const FE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fp=be("X",FE),fr=typeof window<"u"&&"__TAURI_INTERNALS__"in window;function nc(){return fr}const Gd="fp-token";function Cl(){return localStorage.getItem(Gd)}function Yd(n){localStorage.setItem(Gd,n)}function Vd(){localStorage.removeItem(Gd)}const $E=()=>fr||!Cl();async function Xd(n,r,s=""){const f=await(await fetch(s+"/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,password:r,device_name:fr?"桌面应用":"Web 浏览器"})})).json();if(!f.ok)throw new Error(f.error||"登录失败");return Yd(f.data.token),f.data}async function Kd(n,r,s,c=""){const h=await(await fetch(c+"/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,password:r,invite_code:s,device_name:fr?"桌面应用":"Web 浏览器"})})).json();if(!h.ok)throw new Error(h.error||"注册失败");return Yd(h.data.token),h.data}async function dp(n=""){const s=await(await fetch(n+"/auth/me",{headers:{Authorization:"Bearer "+Cl()}})).json();if(!s.ok)throw new Error(s.error||"会话失效");return s.data}async function Me(n,r){if(fr){const{invoke:d}=await tn(async()=>{const{invoke:v}=await import("./core-DV6XEvTN.js");return{invoke:v}},[]);return d(n,{payload:r??{}})}const s={"Content-Type":"application/json"},c=Cl();c&&(s.Authorization="Bearer "+c);const f=await fetch("/api/"+n,{method:"POST",headers:s,body:JSON.stringify(r??{})});if(f.status===401)throw Vd(),window.dispatchEvent(new CustomEvent("fp-auth-required")),new Error("登录已过期,请重新登录");const h=await f.json();if(!f.ok||!h.ok)throw new Error(h.error||"HTTP "+f.status);return h.data}const WE=()=>Me("app_info"),hp=()=>Me("sync_status"),ic=()=>Me("type_list"),PE=n=>Me("type_upsert",n),IE=n=>Me("type_delete",{id:n}),mp=n=>Me("taxonomy_list",{kind:n}),e4=n=>Me("taxonomy_upsert",n),t4=n=>Me("taxonomy_delete",{id:n}),Zd=()=>Me("dimension_list"),l4=n=>Me("dimension_upsert",n),a4=n=>Me("dimension_delete",{id:n}),yp=(n={})=>Me("footprint_list",{query:n}),Jd=n=>Me("footprint_get",{id:n}),vp=n=>Me("footprint_upsert",{item:n}),n4=n=>Me("footprint_delete",{id:n}),gp=(n={})=>Me("timeline",{query:n}),i4=n=>Me("stats_overview",{year:n}),u4=()=>Me("metric_list"),r4=n=>Me("metric_upsert",n),s4=n=>Me("metric_delete",{key:n}),c4=()=>Me("grades_overview"),o4=n=>Me("semester_upsert",n),f4=n=>Me("semester_delete",{id:n}),d4=n=>Me("course_upsert",n),h4=n=>Me("course_delete",{id:n}),m4=n=>Me("band_upsert",n),y4=n=>Me("band_delete",{id:n}),bd=n=>Me("attachment_add",n),pp=n=>Me("attachment_list",{owner_id:n}),bp=n=>Me("attachment_delete",{id:n}),tr=n=>Me("attachment_read",{id:n}),v4=()=>Me("view_list"),g4=n=>Me("view_upsert",n),p4=n=>Me("view_delete",{id:n});async function b4(n=""){return(await fetch(n+"/admin/invites",{headers:{Authorization:"Bearer "+Cl()}})).json()}async function x4(n,r=""){return(await fetch(r+"/admin/invites/generate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Cl()},body:JSON.stringify({count:n})})).json()}async function S4(n,r=""){return(await fetch(r+"/admin/invites/revoke",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Cl()},body:JSON.stringify({id:n})})).json()}async function E4(n=""){return(await fetch(n+"/admin/users",{headers:{Authorization:"Bearer "+Cl()}})).json()}const _4=Object.freeze(Object.defineProperty({__proto__:null,adminCreateInvites:x4,adminListInvites:b4,adminListUsers:E4,adminRevokeInvite:S4,appInfo:WE,attachmentAdd:bd,attachmentDelete:bp,attachmentList:pp,attachmentRead:tr,bandDelete:y4,bandUpsert:m4,clearToken:Vd,courseDelete:h4,courseUpsert:d4,deleteDimension:a4,deleteTaxonomy:t4,deleteType:IE,footprintDelete:n4,footprintGet:Jd,footprintList:yp,footprintUpsert:vp,getToken:Cl,gradesOverview:c4,isLocalMode:$E,isTauriRef:nc,listDimensions:Zd,listTaxonomy:mp,listTypes:ic,metricDelete:s4,metricList:u4,metricUpsert:r4,semesterDelete:f4,semesterUpsert:o4,serverLogin:Xd,serverMe:dp,serverRegister:Kd,setToken:Yd,statsOverview:i4,syncStatus:hp,timeline:gp,upsertDimension:l4,upsertTaxonomy:e4,upsertType:PE,viewDelete:p4,viewList:v4,viewUpsert:g4},Symbol.toStringTag,{value:"Module"}));function xp(n){var r,s,c="";if(typeof n=="string"||typeof n=="number")c+=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,I0=Sp,T4=(n,r)=>s=>{var c;if((r==null?void 0:r.variants)==null)return I0(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:h}=r,d=Object.keys(f).map(g=>{const x=s==null?void 0:s[g],p=h==null?void 0:h[g];if(x===null)return null;const C=P0(x)||P0(p);return f[g][C]}),v=s&&Object.entries(s).reduce((g,x)=>{let[p,C]=x;return C===void 0||(g[p]=C),g},{}),b=r==null||(c=r.compoundVariants)===null||c===void 0?void 0:c.reduce((g,x)=>{let{class:p,className:C,...L}=x;return Object.entries(L).every(G=>{let[q,U]=G;return Array.isArray(U)?U.includes({...h,...v}[q]):{...h,...v}[q]===U})?[...g,p,C]:g},[]);return I0(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},N4=(n,r)=>{const s=new Array(n.length+r.length);for(let c=0;c({classGroupId:n,validator:r}),Ep=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),Ps="-",eg=[],z4="arbitrary..",O4=n=>{const r=w4(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:c}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return R4(d);const v=d.split(Ps),b=v[0]===""&&v.length>1?1:0;return _p(v,b,r)},getConflictingClassGroupIds:(d,v)=>{if(v){const b=c[d],g=s[d];return b?g?N4(g,b):b:g||eg}return s[d]||eg}}},_p=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],h=s.nextPart.get(f);if(h){const g=_p(n,r+1,h);if(g)return g}const d=s.validators;if(d===null)return;const v=r===0?n.join(Ps):n.slice(r).join(Ps),b=d.length;for(let g=0;gn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),c=r.slice(0,s);return c?z4+c:void 0})(),w4=n=>{const{theme:r,classGroups:s}=n;return j4(s,r)},j4=(n,r)=>{const s=Ep();for(const c in n){const f=n[c];Fd(f,s,c,r)}return s},Fd=(n,r,s,c)=>{const f=n.length;for(let h=0;h{if(typeof n=="string"){M4(n,r,s);return}if(typeof n=="function"){D4(n,r,s,c);return}U4(n,r,s,c)},M4=(n,r,s)=>{const c=n===""?r:Tp(r,n);c.classGroupId=s},D4=(n,r,s,c)=>{if(k4(n)){Fd(n(c),r,s,c);return}r.validators===null&&(r.validators=[]),r.validators.push(C4(s,n))},U4=(n,r,s,c)=>{const f=Object.entries(n),h=f.length;for(let d=0;d{let s=n;const c=r.split(Ps),f=c.length;for(let h=0;h"isThemeGetter"in n&&n.isThemeGetter===!0,H4=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),c=Object.create(null);const f=(h,d)=>{s[h]=d,r++,r>n&&(r=0,c=s,s=Object.create(null))};return{get(h){let d=s[h];if(d!==void 0)return d;if((d=c[h])!==void 0)return f(h,d),d},set(h,d){h in s?s[h]=d:f(h,d)}}},xd="!",tg=":",q4=[],lg=(n,r,s,c,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:c,isExternal:f}),L4=n=>{const{prefix:r,experimentalParseClassName:s}=n;let c=f=>{const h=[];let d=0,v=0,b=0,g;const x=f.length;for(let q=0;qb?g-b:void 0;return lg(h,L,C,G)};if(r){const f=r+tg,h=c;c=d=>d.startsWith(f)?h(d.slice(f.length)):lg(q4,!1,d,void 0,!0)}if(s){const f=c;c=h=>s({className:h,parseClassName:f})}return c},B4=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,c)=>{r.set(s,1e6+c)}),s=>{const c=[];let f=[];for(let h=0;h0&&(f.sort(),c.push(...f),f=[]),c.push(d)):f.push(d)}return f.length>0&&(f.sort(),c.push(...f)),c}},Q4=n=>({cache:H4(n.cacheSize),parseClassName:L4(n),sortModifiers:B4(n),postfixLookupClassGroupIds:G4(n),...O4(n)}),G4=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let c=0;c{const{parseClassName:s,getClassGroupId:c,getConflictingClassGroupIds:f,sortModifiers:h,postfixLookupClassGroupIds:d}=r,v=[],b=n.trim().split(Y4);let g="";for(let x=b.length-1;x>=0;x-=1){const p=b[x],{isExternal:C,modifiers:L,hasImportantModifier:G,baseClassName:q,maybePostfixModifierPosition:U}=s(p);if(C){g=p+(g.length>0?" "+g:g);continue}let Q=!!U,Y;if(Q){const K=q.substring(0,U);Y=c(K);const M=Y&&d[Y]?c(q):void 0;M&&M!==Y&&(Y=M,Q=!1)}else Y=c(q);if(!Y){if(!Q){g=p+(g.length>0?" "+g:g);continue}if(Y=c(q),!Y){g=p+(g.length>0?" "+g:g);continue}Q=!1}const V=L.length===0?"":L.length===1?L[0]:h(L).join(":"),P=G?V+xd:V,Z=P+Y;if(v.indexOf(Z)>-1)continue;v.push(Z);const ce=f(Y,Q);for(let K=0;K0?" "+g:g)}return g},X4=(...n)=>{let r=0,s,c,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let c=0;c{let s,c,f,h;const d=b=>{const g=r.reduce((x,p)=>p(x),n());return s=Q4(g),c=s.cache.get,f=s.cache.set,h=v,v(b)},v=b=>{const g=c(b);if(g)return g;const x=V4(b,s);return f(b,x),x};return h=d,(...b)=>h(X4(...b))},Z4=[],st=n=>{const r=s=>s[n]||Z4;return r.isThemeGetter=!0,r.themeKey=n,r},Cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$4=/\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$/,W4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,P4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xa=n=>J4.test(n),Te=n=>!!n&&!Number.isNaN(Number(n)),Yl=n=>!!n&&Number.isInteger(Number(n)),ed=n=>n.endsWith("%")&&Te(n.slice(0,-1)),ca=n=>F4.test(n),Op=()=>!0,e_=n=>$4.test(n)&&!W4.test(n),$d=()=>!1,t_=n=>P4.test(n),l_=n=>I4.test(n),a_=n=>!ne(n)&&!ie(n),n_=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)),i_=n=>ln(n,jp,$d),ne=n=>Cp.test(n),zn=n=>ln(n,Ap,e_),ag=n=>ln(n,h_,Te),u_=n=>ln(n,Dp,Op),r_=n=>ln(n,Mp,$d),ng=n=>ln(n,Rp,$d),s_=n=>ln(n,wp,l_),Xs=n=>ln(n,Up,t_),ie=n=>zp.test(n),Pu=n=>Gn(n,Ap),c_=n=>Gn(n,Mp),ig=n=>Gn(n,Rp),o_=n=>Gn(n,jp),f_=n=>Gn(n,wp),Ks=n=>Gn(n,Up,!0),d_=n=>Gn(n,Dp,!0),ln=(n,r,s)=>{const c=Cp.exec(n);return c?c[1]?r(c[1]):s(c[2]):!1},Gn=(n,r,s=!1)=>{const c=zp.exec(n);return c?c[1]?r(c[1]):s:!1},Rp=n=>n==="position"||n==="percentage",wp=n=>n==="image"||n==="url",jp=n=>n==="length"||n==="size"||n==="bg-size",Ap=n=>n==="length",h_=n=>n==="number",Mp=n=>n==="family-name",Dp=n=>n==="number"||n==="weight",Up=n=>n==="shadow",m_=()=>{const n=st("color"),r=st("font"),s=st("text"),c=st("font-weight"),f=st("tracking"),h=st("leading"),d=st("breakpoint"),v=st("container"),b=st("spacing"),g=st("radius"),x=st("shadow"),p=st("inset-shadow"),C=st("text-shadow"),L=st("drop-shadow"),G=st("blur"),q=st("perspective"),U=st("aspect"),Q=st("ease"),Y=st("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Z=()=>[...P(),ie,ne],ce=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],M=()=>[ie,ne,b],ae=()=>[Xa,"full","auto",...M()],ge=()=>[Yl,"none","subgrid",ie,ne],I=()=>["auto",{span:["full",Yl,ie,ne]},Yl,ie,ne],he=()=>[Yl,"auto",ie,ne],Je=()=>["auto","min","max","fr",ie,ne],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...M()],$=()=>[Xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],de=()=>[v,Xa,"screen","full","dvw","lvw","svw","min","max","fit",...M()],ke=()=>[Xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],J=()=>[n,ie,ne],Ut=()=>[...P(),ig,ng,{position:[ie,ne]}],al=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Rl=()=>["auto","cover","contain",o_,i_,{size:[ie,ne]}],N=()=>[ed,Pu,zn],B=()=>["","none","full",g,ie,ne],te=()=>["",Te,Pu,zn],se=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Te,ed,ig,ng],je=()=>["","none",G,ie,ne],ue=()=>["none",Te,ie,ne],ye=()=>["none",Te,ie,ne],Gt=()=>[Te,ie,ne],ya=()=>[Xa,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ca],breakpoint:[ca],color:[Op],container:[ca],"drop-shadow":[ca],ease:["in","out","in-out"],font:[a_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ca],shadow:[ca],spacing:["px",Te],text:[ca],"text-shadow":[ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xa,ne,ie,U]}],container:["container"],"container-type":[{"@container":["","normal","size",ie,ne]}],"container-named":[n_],columns:[{columns:[Te,"auto",ne,ie,v]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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:Z()}],overflow:[{overflow:ce()}],"overflow-x":[{"overflow-x":ce()}],"overflow-y":[{"overflow-y":ce()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Yl,"auto",ie,ne]}],basis:[{basis:[Xa,"full","auto",v,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Xa,"auto","initial","none",ne]}],grow:[{grow:["",Te,ie,ne]}],shrink:[{shrink:["",Te,ie,ne]}],order:[{order:[Yl,"first","last","none",ie,ne]}],"grid-cols":[{"grid-cols":ge()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":ge()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Je()}],"auto-rows":[{"auto-rows":Je()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...ke()]}],"min-block-size":[{"min-block":["auto",...ke()]}],"max-block-size":[{"max-block":["none",...ke()]}],w:[{w:[v,"screen",...$()]}],"min-w":[{"min-w":[v,"screen","none",...$()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",s,Pu,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,d_,u_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ed,ne]}],"font-family":[{font:[c_,r_,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,ie,ne]}],"line-clamp":[{"line-clamp":[Te,"none",ie,ag]}],leading:[{leading:["none",h,...M()]}],"list-image":[{"list-image":["none",ie,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ie,zn]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Te,"auto",ie,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[Yl,ie,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,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",ie,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:Ut()}],"bg-repeat":[{bg:al()}],"bg-size":[{bg:Rl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yl,ie,ne],radial:["",ie,ne],conic:["",Yl,ie,ne]},f_,s_]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ie,ne]}],"outline-w":[{outline:["",Te,Pu,zn]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","inner","none",x,Ks,Xs]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",p,Ks,Xs]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Te,zn]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",C,Ks,Xs]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Te,ie,ne]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"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":[Te]}],"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":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ie,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":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"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":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ut()}],"mask-repeat":[{mask:al()}],"mask-size":[{mask:Rl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,ne]}],filter:[{filter:["","none",ie,ne]}],blur:[{blur:je()}],brightness:[{brightness:[Te,ie,ne]}],contrast:[{contrast:[Te,ie,ne]}],"drop-shadow":[{"drop-shadow":["","none",L,Ks,Xs]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Te,ie,ne]}],"hue-rotate":[{"hue-rotate":[Te,ie,ne]}],invert:[{invert:["",Te,ie,ne]}],saturate:[{saturate:[Te,ie,ne]}],sepia:[{sepia:["",Te,ie,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,ne]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ie,ne]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ie,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ie,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ie,ne]}],"backdrop-invert":[{"backdrop-invert":["",Te,ie,ne]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ie,ne]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ie,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ie,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ie,ne]}],ease:[{ease:["linear","initial",Q,ie,ne]}],delay:[{delay:[Te,ie,ne]}],animate:[{animate:["none",Y,ie,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[q,ie,ne]}],"perspective-origin":[{"perspective-origin":Z()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Gt()}],"skew-x":[{"skew-x":Gt()}],"skew-y":[{"skew-y":Gt()}],transform:[{transform:[ie,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:Z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ya()}],"translate-x":[{"translate-x":ya()}],"translate-y":[{"translate-y":ya()}],"translate-z":[{"translate-z":ya()}],"translate-none":["translate-none"],zoom:[{zoom:[Yl,ie,ne]}],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",ie,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":J()}],"scrollbar-track-color":[{"scrollbar-track":J()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ie,ne]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Te,Pu,zn,ag]}],stroke:[{stroke:["none",...J()]}],"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"]}},y_=K4(m_);function zl(...n){return y_(Sp(n))}const v_=T4("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"}}),Dt=_.forwardRef(function({className:r,variant:s,size:c,...f},h){return m.jsx("button",{ref:h,className:zl(v_({variant:s,size:c}),r),...f})}),kp="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",ft=_.forwardRef(function({className:r,...s},c){return m.jsx("input",{ref:c,className:zl(kp,"h-8",r),...s})}),Sd=_.forwardRef(function({className:r,...s},c){return m.jsx("textarea",{ref:c,className:zl(kp,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function Ue({label:n,required:r,hint:s,className:c,children:f}){return m.jsxs("div",{className:zl("flex flex-col gap-1.5",c),children:[m.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&m.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&m.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const ml=_.forwardRef(function({className:r,options:s,children:c,...f},h){return m.jsxs("div",{className:zl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[m.jsx("select",{ref:h,className:zl("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=>m.jsx("option",{value:d.value,children:d.label},d.value)):c}),m.jsx(k3,{size:14,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-ink-3"})]})});function Wi({className:n,color:r,...s}){return m.jsx("span",{className:zl("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 g_({className:n,...r}){return m.jsx("span",{className:zl("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 uc({open:n,onClose:r,title:s,width:c=560,children:f,footer:h}){return _.useEffect(()=>{if(!n)return;const d=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n,r]),n?DS.createPortal(m.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 pt-[8vh]",children:[m.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),m.jsxs("div",{className:"relative w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:c},role:"dialog",children:[m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[m.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),m.jsx(Dt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:m.jsx(fp,{size:15})})]}),m.jsx("div",{className:"px-4 py-4 max-h-[64vh] overflow-y-auto",children:f}),h&&m.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-4 h-14",children:h})]})]}),document.body):null}function p_({icon:n,title:r,description:s,action:c}){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[m.jsx("div",{className:"text-ink-3",children:n??m.jsx(lE,{size:36,strokeWidth:1.5})}),m.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&m.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),c&&m.jsx("div",{className:"mt-2",children:c})]})}const Hp=_.createContext(()=>{});function qp(){return _.useContext(Hp)}const b_={success:m.jsx(B3,{size:15,className:"text-success"}),error:m.jsx(q3,{size:15,className:"text-danger"}),info:m.jsx(nE,{size:15,className:"text-brand"})};function x_({children:n}){const[r,s]=_.useState([]),c=_.useRef(0),f=_.useCallback((h,d)=>{const v=++c.current;s(b=>[...b,{id:v,kind:h,text:d}]),setTimeout(()=>s(b=>b.filter(g=>g.id!==v)),3200)},[]);return m.jsxs(Hp.Provider,{value:f,children:[n,m.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(h=>m.jsxs("div",{className:zl("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:[b_[h.kind],h.text]},h.id))})]})}function S_({open:n,title:r,content:s,onCancel:c,onOk:f,loading:h}){return m.jsx(uc,{open:n,onClose:c,title:r,width:420,footer:m.jsxs(m.Fragment,{children:[m.jsx(Dt,{variant:"secondary",onClick:c,children:"取消"}),m.jsx(Dt,{variant:"danger",onClick:f,disabled:h,children:"确认"})]}),children:m.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function E_({open:n,onClose:r,defaultUrl:s}){const c=or(),[f,h]=_.useState("login"),[d,v]=_.useState(s),[b,g]=_.useState(""),[x,p]=_.useState(""),[C,L]=_.useState(""),[G,q]=_.useState(""),[U,Q]=_.useState(!1),Y=async()=>{if(!b.trim()||!x){q("请填写账号与密码");return}let V=d.trim();V&&!V.startsWith("http")&&(V="https://"+V),Q(!0),q("");try{if(f==="login")await Xd(b.trim(),x,V);else{if(!C.trim())throw new Error("请填写邀请码");await Kd(b.trim(),x,C.trim(),V)}c.invalidateQueries(),r(),window.location.reload()}catch(P){q(P.message)}finally{Q(!1)}};return m.jsx(uc,{open:n,onClose:r,width:440,title:f==="login"?"登录账号":"注册账号",footer:m.jsxs(m.Fragment,{children:[m.jsx(Dt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(Dt,{variant:"primary",onClick:()=>void Y(),disabled:U,children:U?"请稍候…":"确定"})]}),children:m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(Ue,{label:"服务器地址",hint:"默认与网页版同一账号体系",children:m.jsx(ft,{value:d,onChange:V=>v(V.target.value),placeholder:"https://footpr.linyux.cn"})}),m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(ft,{value:b,onChange:V=>g(V.target.value),placeholder:"3-32 位字母数字-_"})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(ft,{type:"password",value:x,onChange:V=>p(V.target.value),placeholder:"至少 8 位"})}),f==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(ft,{value:C,onChange:V=>L(V.target.value),placeholder:"邀请码"})}),G&&m.jsx("div",{className:"text-[12px] text-danger",children:G}),m.jsx("div",{className:"flex text-[12px] text-ink-3 gap-2",children:m.jsx("button",{className:"underline hover:text-ink-1",onClick:()=>{h(f==="login"?"register":"login"),q("")},children:f==="login"?"没有账号?注册":"已有账号?登录"})})]})})}const __=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:rp},{to:"/records",label:"记录",icon:OE},{to:"/grades",label:"成绩",icon:cp},{to:"/dashboard",label:"统计",icon:D3}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:kE},{to:"/types",label:"记录类型",icon:AE},{to:"/taxonomy",label:"字典与维度",icon:qE}]}];function T_(){return m.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function N_(){return nc()&&localStorage.getItem("fp-server-url")||""}function C_({open:n,onClose:r}){const s=!nc(),c=el({queryKey:["sync-status"],queryFn:hp,refetchInterval:15e3}),h=el({queryKey:["me"],queryFn:()=>dp(N_()),enabled:!!Cl(),retry:0}).data??null,[d,v]=_.useState(!1);return m.jsxs("aside",{className:"flex w-[224px] 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:[m.jsxs("div",{className:"flex h-14 items-center gap-2.5 border-b border-line px-4",children:[m.jsx(T_,{}),m.jsxs("div",{className:"leading-tight",children:[m.jsx("div",{className:"text-[14px] font-semibold text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[10px] font-medium tracking-[0.18em] text-ink-3",children:"FOOTPRINTS"})]})]}),m.jsx(E_,{open:d,onClose:()=>v(!1),defaultUrl:localStorage.getItem("fp-server-url")||"https://footpr.linyux.cn"}),m.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:__.map(b=>m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"px-2 pb-1.5 text-[11px] font-medium text-ink-3",children:b.section}),m.jsx("div",{className:"flex flex-col gap-0.5",children:b.items.map(g=>m.jsxs(Zg,{to:g.to,onClick:r,className:({isActive:x})=>zl("flex h-8 items-center gap-2.5 rounded-md px-2 text-[13px] transition-colors",x?"bg-brand-subtle font-medium text-brand-text":"text-ink-2 hover:bg-surface-3 hover:text-ink-1"),children:[m.jsx(g.icon,{size:15,strokeWidth:2}),g.label]},g.to))})]},b.section))}),m.jsxs("div",{className:"border-t border-line px-4 py-3",children:[Cl()?m.jsxs("div",{className:"mb-2",children:[h&&m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"min-w-0 truncate text-[12px] font-medium text-ink-1",title:h.username,children:[h.is_admin&&m.jsx("span",{className:"mr-1 text-brand-text",children:"管理员"}),h.username]}),m.jsx("button",{className:"shrink-0 text-[11px] text-ink-3 underline transition-colors hover:text-danger",onClick:()=>{Vd(),localStorage.removeItem("fp-server-url"),window.location.reload()},children:"退出"})]}),!s&&m.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-[12px] text-ink-2 transition-colors hover:bg-surface-3 hover:text-ink-1",onClick:()=>v(!0),children:[m.jsx(W0,{size:13}),h?"账号与同步设置":"登录我的档案"]}),!s&&m.jsx("div",{className:"num text-[10px] text-ink-3",children:c.data?"同步 · 待推送 "+c.data.pending_ops:"…"})]}):m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-md bg-brand-subtle px-2 py-1.5 text-[12.5px] font-medium text-brand-text transition-colors hover:brightness-[0.97]",onClick:()=>v(!0),children:[m.jsx(W0,{size:13}),"我的档案 · 登录"]}),m.jsx("div",{className:"text-[10px] text-ink-3",children:"未登录=本地模式 · 登录后各端互通"})]}),!s&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[11px] text-ink-3",children:[m.jsx(z_,{}),"数据库 · 本地存储"]})]})]})}function z_(){return m.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("path",{d:"M11 17l-5-5 5-5"}),m.jsx("path",{d:"M18 17l-5-5 5-5"})]})}const O_={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function R_({onMenu:n}){const{pathname:r}=yl(),s=tc(),[c,f]=_.useState(""),[h,d]=_.useState(document.documentElement.classList.contains("dark")),v=O_[r]??{title:""},b=()=>{const g=!h;d(g),document.documentElement.classList.toggle("dark",g),localStorage.setItem("fp-theme",g?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return m.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-4 border-b border-line bg-surface px-5",children:[m.jsx(Dt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:m.jsx(cE,{size:17})}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:v.title}),v.sub&&m.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:v.sub})]}),m.jsxs("div",{className:"relative ml-auto w-[280px]",children:[m.jsx(wE,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),m.jsx(ft,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:c,onChange:g=>f(g.target.value),onKeyDown:g=>{g.key==="Enter"&&c.trim()&&s("/records?q="+encodeURIComponent(c.trim()))}})]}),m.jsx(Dt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:h?m.jsx(GE,{size:15}):m.jsx(hE,{size:15})}),m.jsxs(Dt,{variant:"primary",onClick:()=>s("/records?new=1"),children:[m.jsx(TE,{size:14}),"新建记录"]})]})}function w_(){return m.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function j_({onAuthed:n}){const[r,s]=_.useState("login"),[c,f]=_.useState(""),[h,d]=_.useState(""),[v,b]=_.useState(""),[g,x]=_.useState(""),[p,C]=_.useState(!1),L=async()=>{if(!c.trim()||!h){x("请填写账号与密码");return}C(!0),x("");try{if(r==="login")await Xd(c.trim(),h);else{if(!v.trim())throw new Error("请填写邀请码");await Kd(c.trim(),h,v.trim())}n()}catch(G){x(G.message)}finally{C(!1)}};return m.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:m.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[m.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[m.jsx(w_,{}),m.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),m.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(r==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{s("login"),x("")},children:"登录"}),m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(r==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{s("register"),x("")},children:"注册"})]}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(ft,{value:c,onChange:G=>f(G.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:G=>{G.key==="Enter"&&L()}})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(ft,{type:"password",value:h,onChange:G=>d(G.target.value),placeholder:"至少 8 位",onKeyDown:G=>{G.key==="Enter"&&L()}})}),r==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(ft,{value:v,onChange:G=>b(G.target.value),placeholder:"邀请码",onKeyDown:G=>{G.key==="Enter"&&L()}})}),g&&m.jsx("div",{className:"text-[12px] text-danger",children:g}),m.jsx(Dt,{variant:"primary",size:"lg",onClick:()=>void L(),disabled:p,children:p?"请稍候…":r==="login"?"进入我的档案":"创建我的档案"}),m.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"数据按账号隔离存储 · 未注册用户请联系管理员获取邀请码"})]})]})})}function A_(){const[n,r]=_.useState(()=>nc()||!!Cl()),[s,c]=_.useState(!1);return _.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?m.jsx(x_,{children:m.jsxs("div",{className:"flex h-full",children:[s&&m.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>c(!1),"aria-hidden":!0}),m.jsx(C_,{open:s,onClose:()=>c(!1)}),m.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[m.jsx(R_,{onMenu:()=>c(!0)}),m.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:m.jsx(Px,{})})]})]})}):m.jsx(j_,{onAuthed:()=>r(!0)})}const ug={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 Lp({status:n}){const r=ug[n]??ug.draft;return m.jsx("span",{className:"inline-flex items-center rounded-sm px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const M_={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function Bp({level:n}){return n?m.jsx(Wi,{color:M_[n]??"var(--text-3)",children:n}):null}const D_={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function Qp({grade:n}){return n?m.jsx(Wi,{color:D_[n]??"var(--text-3)",children:n}):null}function Gp({role:n}){return n?m.jsx(g_,{children:n}):null}function Yp(){return m.jsx(Wi,{color:"var(--danger)",children:"负面"})}const n5=[{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:"体育"}],U_={tag:op,"graduation-cap":cp,trophy:KE,"flask-conical":F3,briefcase:R3,network:yE,"heart-handshake":P3,palette:gE,award:N3,"file-badge":K3,star:BE,"shield-alert":DE,"book-open":z3,"code-2":G3,languages:uE,"mic-2":fE,"pen-line":xE,rocket:CE,users:JE,"building-2":j3,dumbbell:V3};function k_({name:n,color:r,size:s=14,className:c}){const f=U_[n]??op;return m.jsx(f,{size:s,color:r,className:c,strokeWidth:2})}function H_({value:n,onChange:r,placeholder:s}){const[c,f]=_.useState(""),h=()=>{const v=c.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),h()):v.key==="Backspace"&&!c&&n.length&&r(n.slice(0,-1))};return m.jsxs("div",{className:zl("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(v=>m.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,m.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:m.jsx(fp,{size:11})})]},v)),m.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:c,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:h})]})}function rg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function q_({fields:n,value:r,onChange:s,taxonomies:c}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),h=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",g=x=>d.unit?m.jsxs("div",{className:"flex items-center gap-2",children:[x,m.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(Sd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:g(m.jsx(ft,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ft,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...rg(d,c)]})},d.key);case"multiselect":{const x=rg(d,c),p=Array.isArray(v)?v:[];return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(C=>{const L=p.includes(C.value);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(L?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,L?p.filter(G=>G!==C.value):[...p,C.value]),children:C.label},C.value)}),!x.length&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return m.jsx(Ue,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:m.jsx(ft,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(ft,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>m.jsx("div",{className:d.widget==="textarea"?"col-span-2":"",children:h(d)},d.key))})}function sg(n){return n?n.slice(0,16).replace("T"," "):""}function L_(n,r){const s=n?n.slice(0,10):"",c=r?r.slice(0,10):"";return s&&c?s+" ~ "+c:s?s+(r===""?"":" 起"):c?"至 "+c:""}function Ed(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function cg({items:n,pending:r,onPick:s,onDeleteSaved:c,onDeletePending:f,onOpenSaved:h,uploading:d}){const v=_.useRef(null),b=n.length+r.length;return m.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[m.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[m.jsx(Qd,{size:13}),"附件(",b,")"]}),m.jsx(Dt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var g;return(g=v.current)==null?void 0:g.click()},children:d?"上传中…":"添加文件"}),m.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:g=>{var x;(x=g.target.files)!=null&&x.length&&s(g.target.files),g.target.value=""}})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(g=>m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[m.jsx(sp,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate "+(h?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>h==null?void 0:h(g),title:g.file_name,children:g.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(g.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>c(g.id),"aria-label":"删除附件",children:m.jsx(pd,{size:13})})]},"s"+g.id)),r.map((g,x)=>{var p;return m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(p=g.mime)!=null&&p.startsWith("image/")&&g.preview?m.jsx("img",{src:g.preview,alt:g.file_name,className:"size-7 shrink-0 rounded object-cover"}):m.jsx(eE,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate text-ink-1",children:g.file_name}),m.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(g.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:m.jsx(pd,{size:13})})]},"p"+x)}),!b&&m.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}function og(n){return new Promise((r,s)=>{const c=new FileReader;c.onload=()=>{var v;const f=String(c.result||""),h=f.indexOf(","),d=(v=n.type)!=null&&v.startsWith("image/")?URL.createObjectURL(n):void 0;r({file_name:n.name,mime:n.type||void 0,size:n.size,data_b64:h>=0?f.slice(h+1):f,preview:d})},c.onerror=()=>s(new Error("读取文件失败")),c.readAsDataURL(n)})}function Vp(n,r,s){if(!s)return;const c=Uint8Array.from(atob(s),d=>d.charCodeAt(0)),f=new Blob([c],{type:r||"application/octet-stream"}),h=URL.createObjectURL(f);if(r!=null&&r.startsWith("image/")||r==="application/pdf")window.open(h,"_blank");else{const d=document.createElement("a");d.href=h,d.download=n,d.click()}setTimeout(()=>URL.revokeObjectURL(h),6e4)}const fg={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:{}},B_=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],dg=80*1024*1024,Q_=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function G_({open:n,onClose:r,footprintId:s,onSaved:c}){var ae,ge,I,he,Je;const f=or(),h=qp(),[d,v]=_.useState(fg),[b,g]=_.useState([]),[x,p]=_.useState(!1),[C,L]=_.useState(""),G=el({queryKey:["types"],queryFn:ic,enabled:n}),q=el({queryKey:["taxonomy-all"],queryFn:()=>mp(),enabled:n}),U=el({queryKey:["dimensions"],queryFn:Zd,enabled:n}),Q=el({queryKey:["footprint",s],queryFn:()=>Jd(s),enabled:n&&!!s}),Y=el({queryKey:["attachments",s],queryFn:()=>pp(s),enabled:n&&!!s}),V=_.useMemo(()=>{var D;return(D=G.data)==null?void 0:D.items.find(ee=>ee.id===d.type_id)},[G.data,d.type_id]),P=el({queryKey:["parent-candidates",d.type_id],queryFn:()=>yp({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});_.useEffect(()=>{if(n)if(L(""),g([]),s&&Q.data){const D=Q.data.item;v({type_id:D.type_id,title:D.title,organizer:D.organizer??"",start_date:(D.start_date??"").slice(0,10),end_date:(D.end_date??"").slice(0,10),status:D.status,role:D.role??"",level:D.level??"",award_grade:D.award_grade??"",rank:D.rank!=null?String(D.rank):"",polarity:D.polarity,weight:String(D.weight??3),description:D.description??"",result:D.result??"",tags:D.tags??[],dimension_ids:D.dimensions??[],group_id:D.group_id??"",parent_id:D.parent_id!=null?String(D.parent_id):"",extras:D.extras??{}})}else v(fg)},[n,s,Q.data]);const Z=_.useMemo(()=>{var ee,X;const D={};for(const $ of((ee=q.data)==null?void 0:ee.items)??[])(D[X=$.kind]??(D[X]=[])).push({value:$.value,label:$.value});return D},[q.data]),ce=gd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const D={};for(const $ of(V==null?void 0:V.form_template)??[])if($.metric&&$.widget==="number"){const de=d.extras[$.key];typeof de=="number"&&!Number.isNaN(de)&&(D[$.metric]=de)}const ee={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:D},X=await vp(ee);for(const $ of b)await bd({owner_id:X.id,file_name:$.file_name,mime:$.mime,size:$.size,data_b64:$.data_b64});return X.id},onSuccess:D=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",D]}),f.invalidateQueries({queryKey:["types"]}),h("success",s?"记录已更新":"记录已创建"),c==null||c(D),r()},onError:D=>L(D.message)}),K=(D,ee)=>v(X=>({...X,[D]:ee})),M=gd({mutationFn:D=>bp(D),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})});return m.jsx(uc,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:m.jsxs(m.Fragment,{children:[C&&m.jsx("span",{className:"mr-auto text-[12px] text-danger",children:C}),m.jsx(Dt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(Dt,{variant:"primary",onClick:()=>ce.mutate(),disabled:ce.isPending,children:ce.isPending?"保存中…":"保存"})]}),children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"类型",required:!0,children:m.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:D=>K("type_id",D.target.value?Number(D.target.value):null),options:[{value:"",label:"请选择"},...(((ae=G.data)==null?void 0:ae.items)??[]).map(D=>({value:String(D.id),label:D.name}))]})}),m.jsx(Ue,{label:"标题",required:!0,children:m.jsx(ft,{value:d.title,onChange:D=>K("title",D.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"组织方 / 所在组织",children:m.jsx(ft,{value:d.organizer,onChange:D=>K("organizer",D.target.value),placeholder:"如:中国工业与应用数学学会"})}),m.jsx(Ue,{label:"开始日期",children:m.jsx(ft,{type:"date",value:d.start_date,onChange:D=>K("start_date",D.target.value)})}),m.jsx(Ue,{label:"结束日期",children:m.jsx(ft,{type:"date",value:d.end_date,onChange:D=>K("end_date",D.target.value)})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"角色",children:m.jsx(ml,{value:d.role,onChange:D=>K("role",D.target.value),options:[{value:"",label:"未设置"},...Z.role??[]]})}),m.jsx(Ue,{label:"级别",children:m.jsx(ml,{value:d.level,onChange:D=>K("level",D.target.value),options:[{value:"",label:"未设置"},...Z.level??[]]})}),m.jsx(Ue,{label:"状态",children:m.jsx(ml,{value:d.status,onChange:D=>K("status",D.target.value),options:Q_})}),m.jsx(Ue,{label:"重要度",children:m.jsx(ml,{value:d.weight,onChange:D=>K("weight",D.target.value),options:[1,2,3,4,5].map(D=>({value:String(D),label:String(D)}))})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"奖等",children:m.jsx(ml,{value:d.award_grade,onChange:D=>K("award_grade",D.target.value),options:[{value:"",label:"未设置"},...B_.map(D=>({value:D,label:D}))]})}),m.jsx(Ue,{label:"名次",children:m.jsx(ft,{type:"number",className:"num",value:d.rank,onChange:D=>K("rank",D.target.value),placeholder:"如 2"})}),m.jsx(Ue,{label:"性质",children:m.jsx(ml,{value:d.polarity,onChange:D=>K("polarity",D.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),m.jsx(Ue,{label:"上级记录",hint:"晋升链",children:m.jsx(ml,{value:d.parent_id,onChange:D=>K("parent_id",D.target.value),options:[{value:"",label:"无"},...(((ge=P.data)==null?void 0:ge.items)??[]).filter(D=>D.id!==s).map(D=>({value:String(D.id),label:D.title.slice(0,24)}))]})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"工作内容 / 描述",children:m.jsx(Sd,{value:d.description,onChange:D=>K("description",D.target.value),placeholder:"具体做了什么、承担什么分工"})}),m.jsx(Ue,{label:"结果 / 产出",children:m.jsx(Sd,{value:d.result,onChange:D=>K("result",D.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"标签",children:m.jsx(H_,{value:d.tags,onChange:D=>K("tags",D)})}),m.jsx(Ue,{label:"成长维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((I=U.data)==null?void 0:I.items)??[]).map(D=>{const ee=d.dimension_ids.includes(D.id);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ee?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>K("dimension_ids",ee?d.dimension_ids.filter(X=>X!==D.id):[...d.dimension_ids,D.id]),children:D.name},D.id)}),!((he=U.data)!=null&&he.items.length)&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:m.jsx(Ue,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:m.jsx(ft,{value:d.group_id,onChange:D=>K("group_id",D.target.value),placeholder:"如 g2025001(可选)"})})}),V&&V.form_template.length>0&&m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsxs("div",{className:"mb-3 text-[12px] font-semibold text-ink-2",children:["类型字段 · ",V.name]}),m.jsx(q_,{fields:V.form_template,value:d.extras,onChange:D=>K("extras",D),taxonomies:Z})]}),s?m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(cg,{items:((Je=Y.data)==null?void 0:Je.items)??[],pending:b,uploading:x,onPick:async D=>{if(s){p(!0);try{let ee=0;for(const X of Array.from(D)){if(X.size>dg){h("error","「"+X.name+"」超过 80MB,已跳过");continue}const $=await og(X);await bd({owner_id:s,file_name:$.file_name,mime:$.mime,size:$.size,data_b64:$.data_b64}),ee++}ee>0&&(f.invalidateQueries({queryKey:["attachments",s]}),h("success","已上传 "+ee+" 个附件"))}catch(ee){h("error",ee.message)}finally{p(!1)}}},onDeleteSaved:D=>M.mutate(D),onDeletePending:()=>{},onOpenSaved:async D=>{try{const ee=await tr(D.id);Vp(ee.file_name,ee.mime??void 0,ee.data_b64)}catch(ee){h("error",ee.message)}}}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可预览(支持图片 / PDF,其余下载)· 单个文件不超过 80MB"})]}):m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(cg,{items:[],pending:b,onPick:async D=>{const ee=[];for(const X of Array.from(D)){if(X.size>dg){h("error","「"+X.name+"」超过 80MB,已跳过");continue}ee.push(await og(X))}g(X=>[...X,...ee])},onDeleteSaved:()=>{},onDeletePending:D=>g(ee=>ee.filter((X,$)=>$!==D))}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]})})}function Y_(n,r,s=480,c=.82){return new Promise((f,h)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),g=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=g;const p=x.getContext("2d");if(!p)return h(new Error("canvas 不可用"));p.drawImage(d,0,0,b,g),f(x.toDataURL("image/webp",c))}catch(v){h(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>h(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function V_({open:n,onClose:r,footprintId:s,onEdit:c}){var K,M,ae,ge;const f=or(),h=qp(),d=el({queryKey:["footprint",s],queryFn:()=>Jd(s),enabled:n&&!!s}),v=el({queryKey:["types"],queryFn:ic,enabled:n}),b=el({queryKey:["dimensions"],queryFn:Zd,enabled:n}),g=(K=d.data)==null?void 0:K.item,x=(M=v.data)==null?void 0:M.items.find(I=>I.id===(g==null?void 0:g.type_id)),p=((g==null?void 0:g.dimensions)??[]).map(I=>{var he,Je;return(Je=(he=b.data)==null?void 0:he.items.find(D=>D.id===I))==null?void 0:Je.name}).filter(Boolean),[C,L]=_.useState(!1),G=gd({mutationFn:()=>tn(()=>Promise.resolve().then(()=>_4),void 0).then(I=>I.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),h("success","记录已删除"),L(!1),r()}}),q=async I=>{try{const he=await tr(I.id);Vp(he.file_name,he.mime??void 0,he.data_b64)}catch(he){h("error",he.message)}},[U,Q]=_.useState({}),Y=(g==null?void 0:g.attachments)??[],V=Y.filter(I=>{var he;return(he=I.mime)==null?void 0:he.startsWith("image/")}),P=Y.filter(I=>{var he;return!((he=I.mime)!=null&&he.startsWith("image/"))}),Z=Y.map(I=>I.id).join(",");_.useEffect(()=>{if(Q({}),!n||!Z)return;let I=!1;return(async()=>{const he={},Je=Y.filter(D=>{var ee;return(ee=D.mime)==null?void 0:ee.startsWith("image/")});for(const D of Je)try{const ee=await tr(D.id);if(I)return;he[D.id]=await Y_(ee.data_b64,ee.mime||"image/png"),Q({...he})}catch{try{const ee=await tr(D.id);he[D.id]="data:"+(ee.mime||"image/png")+";base64,"+ee.data_b64,Q({...he})}catch{}}})(),()=>{I=!0}},[n,s,Z]);const ce=[];if(g&&x)for(const I of x.form_template??[]){const he=(g.extras??{})[I.key];if(he==null||he==="")continue;const Je=Array.isArray(he)?he.join("、"):String(he);ce.push({label:I.label,value:I.unit?Je+" "+I.unit:Je})}return m.jsxs(uc,{open:n,onClose:r,width:680,title:g?g.title:"记录详情",footer:g?m.jsxs(m.Fragment,{children:[m.jsxs(Dt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>L(!0),disabled:G.isPending,children:[m.jsx(pd,{size:13})," 删除"]}),m.jsx(Dt,{variant:"secondary",onClick:r,children:"关闭"}),m.jsxs(Dt,{variant:"primary",onClick:()=>s&&(c==null?void 0:c(s)),children:[m.jsx(EE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!g?m.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx(Wi,{color:g.type_color,children:g.type_name}),m.jsx(Bp,{level:g.level}),m.jsx(Qp,{grade:g.award_grade}),m.jsx(Gp,{role:g.role}),m.jsx(Lp,{status:g.status}),g.polarity==="negative"&&m.jsx(Yp,{}),g.rank!=null&&m.jsxs(Wi,{color:"var(--text-3)",children:["第 ",g.rank," 名"]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px]",children:[m.jsx(On,{label:"时间",value:L_(g.start_date,g.end_date)||"—"}),m.jsx(On,{label:"组织方",value:g.organizer||"—"}),g.group_id&&m.jsx(On,{label:"事件组",value:g.group_id}),g.parent_id!=null&&m.jsx(On,{label:"上级记录",value:"#"+g.parent_id}),m.jsx(On,{label:"创建于",value:sg(g.created_at)}),m.jsx(On,{label:"更新于",value:sg(g.updated_at)})]}),g.description&&m.jsx(Di,{title:"工作内容 / 描述",children:m.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:g.description})}),g.result&&m.jsx(Di,{title:"结果 / 产出",children:m.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:g.result})}),ce.length>0&&m.jsx(Di,{title:x?"类型字段 · "+x.name:"类型字段",children:m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-2",children:ce.map(I=>m.jsx(On,{label:I.label,value:I.value},I.label))})}),g.metrics&&Object.keys(g.metrics).length>0&&m.jsx(Di,{title:"量化指标",children:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(g.metrics).map(([I,he])=>m.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[I,": ",m.jsx("span",{className:"font-medium text-ink-1",children:he})]},I))})}),((((ae=g.tags)==null?void 0:ae.length)??0)>0||p.length>0)&&m.jsx(Di,{title:"标签与维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[g.tags.map(I=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:I},I)),p.map(I=>m.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:I},I))]})}),m.jsx(Di,{title:"附件("+(((ge=g.attachments)==null?void 0:ge.length)??0)+")",children:Y.length?m.jsxs("div",{className:"flex flex-col gap-2.5",children:[V.length>0&&m.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:V.map(I=>m.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(I),title:"点击查看原图:"+I.file_name,children:[U[I.id]?m.jsx("img",{src:U[I.id],alt:I.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):m.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),m.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:I.file_name})]},I.id))}),P.length>0&&m.jsx("div",{className:"flex flex-col gap-1",children:P.map(I=>m.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(I),children:[m.jsx(sp,{size:14,className:"shrink-0 text-ink-3"}),m.jsx("span",{className:"truncate text-ink-1",children:I.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Ed(I.size)}),m.jsx(Qd,{size:12,className:"shrink-0 text-ink-3"})]},I.id))}),m.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片查看原图(原始比例)"})]}):m.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})})]}),m.jsx(S_,{open:C,title:"删除记录",content:g?"确定删除「"+g.title+"」吗?该操作不可撤销。":"",onCancel:()=>L(!1),onOk:()=>G.mutate(),loading:G.isPending})]})}function On({label:n,value:r}){return m.jsxs("div",{className:"flex min-w-0 gap-2",children:[m.jsx("span",{className:"shrink-0 text-ink-3",children:n}),m.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Di({title:n,children:r}){return m.jsxs("div",{children:[m.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function X_(){var Z,ce,K;const[n,r]=_.useState(""),[s,c]=_.useState(""),[f,h]=_.useState(""),[d,v]=_.useState(""),[b,g]=_.useState(null),[x,p]=_.useState(!1),[C,L]=_.useState(null),[G,q]=_.useState(!1),U=el({queryKey:["types"],queryFn:ic}),Q=_.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]),Y=el({queryKey:["timeline",Q],queryFn:()=>gp(Q)}),V=_.useMemo(()=>{var ae;const M=new Set;for(const ge of((ae=Y.data)==null?void 0:ae.groups)??[])M.add(ge.year);return Array.from(M).sort((ge,I)=>I-ge)},[Y.data]),P=M=>{L(M),q(!0)};return m.jsxs("div",{className:"mx-auto max-w-[880px] px-6 py-5",children:[m.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[m.jsx(ft,{className:"w-[220px]",placeholder:"搜索足迹…",value:n,onChange:M=>r(M.target.value)}),m.jsx(ml,{className:"w-[130px]",value:s,onChange:M=>c(M.target.value),options:[{value:"",label:"全部类型"},...(((Z=U.data)==null?void 0:Z.items)??[]).map(M=>({value:String(M.id),label:M.name}))]}),m.jsx(ml,{className:"w-[120px]",value:f,onChange:M=>h(M.target.value),options:[{value:"",label:"全部年份"},...V.map(M=>({value:String(M),label:M+" 年"}))]}),m.jsx(ml,{className:"w-[110px]",value:d,onChange:M=>v(M.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]}),m.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((ce=Y.data)==null?void 0:ce.total)??0," 条"]})]}),Y.isLoading?m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(K=Y.data)!=null&&K.groups.length?m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Y.data.groups.map(M=>m.jsxs("section",{className:"mb-2",children:[m.jsxs("div",{className:"sticky top-0 z-10 -mx-6 flex items-center gap-2 bg-bg/90 px-6 py-2 backdrop-blur",children:[m.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:M.year}),m.jsxs("span",{className:"text-[12px] text-ink-3",children:[M.count," 条记录"]})]}),M.months.map(ae=>m.jsxs("div",{className:"mb-3",children:[m.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[ae.month," 月"]}),m.jsx("div",{className:"flex flex-col gap-2",children:ae.items.map(ge=>m.jsx(K_,{row:ge,onClick:()=>P(ge.id)},ge.id))})]},ae.month))]},M.year))]}):m.jsx(p_,{icon:m.jsx(rp,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),m.jsx(V_,{open:G,onClose:()=>q(!1),footprintId:C,onEdit:M=>{q(!1),g(M),p(!0)}}),m.jsx(G_,{open:x,onClose:()=>p(!1),footprintId:b})]})}function K_({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return m.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:[m.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),m.jsxs("div",{className:"flex items-start gap-3",children:[m.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)]}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),m.jsx(Wi,{color:n.type_color,children:n.type_name}),m.jsx(Bp,{level:n.level}),m.jsx(Qp,{grade:n.award_grade}),m.jsx(Gp,{role:n.role}),m.jsx(Lp,{status:n.status}),n.polarity==="negative"&&m.jsx(Yp,{})]}),n.organizer&&m.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&m.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)&&m.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&&m.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(c=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:c},c)),n.attachment_count>0&&m.jsxs("span",{className:"inline-flex items-center gap-1",children:[m.jsx(Qd,{size:11}),n.attachment_count]})]})]}),m.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:m.jsx(k_,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const Z_=_.lazy(()=>tn(()=>import("./RecordsPage-tnlmi-lB.js"),[]).then(n=>({default:n.RecordsPage}))),J_=_.lazy(()=>tn(()=>import("./DashboardPage-Bd9Ohx5Q.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),F_=_.lazy(()=>tn(()=>import("./GradesPage-zizJmWpX.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),$_=_.lazy(()=>tn(()=>import("./TypesPage-CN6AAiUh.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),W_=_.lazy(()=>tn(()=>import("./TaxonomyPage-D0c0qsuX.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),P_=_.lazy(()=>tn(()=>import("./AdminPage-CVGD_85A.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage})));function Ui(){return m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function I_(){return m.jsx(eS,{children:m.jsxs(El,{element:m.jsx(A_,{}),children:[m.jsx(El,{path:"/",element:m.jsx(L0,{to:"/timeline",replace:!0})}),m.jsx(El,{path:"/timeline",element:m.jsx(X_,{})}),m.jsx(El,{path:"/records",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(Z_,{})})}),m.jsx(El,{path:"/grades",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(F_,{})})}),m.jsx(El,{path:"/dashboard",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(J_,{})})}),m.jsx(El,{path:"/types",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx($_,{})})}),m.jsx(El,{path:"/taxonomy",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(W_,{})})}),m.jsx(El,{path:"/admin",element:m.jsx(_.Suspense,{fallback:m.jsx(Ui,{}),children:m.jsx(P_,{})})}),m.jsx(El,{path:"*",element:m.jsx(L0,{to:"/timeline",replace:!0})})]})})}const e5=new r3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:15e3}}}),hg=localStorage.getItem("fp-theme");(hg==="dark"||!hg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});W2.createRoot(document.getElementById("root")).render(m.jsx(V2.StrictMode,{children:m.jsx(US,{client:e5,children:m.jsx(NS,{children:m.jsx(I_,{})})})}));export{S4 as $,Wi as A,Dt as B,S_ as C,uc as D,p_ as E,Ue as F,Qp as G,d4 as H,ft as I,c4 as J,k_ as K,Bp as L,PE as M,n5 as N,IE as O,TE as P,e4 as Q,Gp as R,ml as S,pd as T,t4 as U,l4 as V,a4 as W,Zd as X,Cl as Y,Ed as Z,x4 as _,zl as a,nc as a0,E4 as a1,b4 as a2,tn as a3,_4 as a4,qp as b,be as c,l5 as d,el as e,gd as f,L_ as g,Lp as h,sg as i,m as j,EE as k,V_ as l,G_ as m,n4 as n,ic as o,mp as p,yp as q,_ as r,i4 as s,cp as t,or as u,m4 as v,y4 as w,h4 as x,o4 as y,f4 as z}; diff --git a/sync-server/www/assets/useChart-sd-ke-zx.js b/sync-server/www/assets/useChart-Bui3ZDic.js similarity index 92% rename from sync-server/www/assets/useChart-sd-ke-zx.js rename to sync-server/www/assets/useChart-Bui3ZDic.js index 12fdbb1..134cac1 100644 --- a/sync-server/www/assets/useChart-sd-ke-zx.js +++ b/sync-server/www/assets/useChart-Bui3ZDic.js @@ -1 +1 @@ -import{r}from"./index-CAYqMwJw.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-DdiJYOyq.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 44d1277..467baa7 100644 --- a/sync-server/www/index.html +++ b/sync-server/www/index.html @@ -8,7 +8,7 @@ 足迹 Footprints - +