fogact 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/README.zh-CN.md +244 -0
- package/bin/cli.js +9 -0
- package/bin/web-server.js +1434 -0
- package/config/upstream.example.json +14 -0
- package/frontend/activate.html +249 -0
- package/frontend/admin/admin-panel-v2.js +1899 -0
- package/frontend/admin/index.html +705 -0
- package/frontend/assets/market-ui.css +1876 -0
- package/frontend/color-test.html +136 -0
- package/frontend/index.html +191 -0
- package/frontend/user/assets/AnnouncementDetail-Dvxmwz0A.js +12 -0
- package/frontend/user/assets/Announcements-CS1tF2mx.js +11 -0
- package/frontend/user/assets/CardBind-CsCxihhP.js +21 -0
- package/frontend/user/assets/CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl.js +1 -0
- package/frontend/user/assets/CardDescription.vue_vue_type_script_setup_true_lang-D-v5Pl7F.js +1 -0
- package/frontend/user/assets/CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5.js +1 -0
- package/frontend/user/assets/Dashboard-rPsmltm5.js +51 -0
- package/frontend/user/assets/DashboardLayout-BUCWGlXC.css +1 -0
- package/frontend/user/assets/DashboardLayout-DDkxHYFj.js +80 -0
- package/frontend/user/assets/Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js +6 -0
- package/frontend/user/assets/Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js +1 -0
- package/frontend/user/assets/Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ.js +1 -0
- package/frontend/user/assets/QuotaPack-B_tJ7Psm.js +6 -0
- package/frontend/user/assets/Renewal-BSDhDmwv.js +6 -0
- package/frontend/user/assets/ScrollArea.vue_vue_type_script_setup_true_lang-DMYwcfpz.js +1 -0
- package/frontend/user/assets/Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_.js +1 -0
- package/frontend/user/assets/Settings-CBdAa3lw.js +11 -0
- package/frontend/user/assets/TooltipTrigger.vue_vue_type_script_setup_true_lang-DtSBjzGo.js +16 -0
- package/frontend/user/assets/Welcome-7IfzEli4.css +1 -0
- package/frontend/user/assets/Welcome-Dtfp6oER.js +1 -0
- package/frontend/user/assets/_plugin-vue_export-helper-5cjT4u0R.js +16 -0
- package/frontend/user/assets/activity-wYWtyqTJ.js +6 -0
- package/frontend/user/assets/announcement-35mOnjRL.js +16 -0
- package/frontend/user/assets/calendar-BFNuCata.js +6 -0
- package/frontend/user/assets/chart-vendor-CULJE59K.js +37 -0
- package/frontend/user/assets/chevron-down-kDbuU1Py.js +6 -0
- package/frontend/user/assets/chevron-right-BayASIm0.js +6 -0
- package/frontend/user/assets/eye-CY62vip0.js +6 -0
- package/frontend/user/assets/gauge-C5NQ-mV8.js +6 -0
- package/frontend/user/assets/index-B8QSyYhS.css +1 -0
- package/frontend/user/assets/index-Da98HOxL.js +91 -0
- package/frontend/user/assets/link-2-DT5R5nGO.js +6 -0
- package/frontend/user/assets/package-rUbExUEn.js +6 -0
- package/frontend/user/assets/plus-CQc6C8wG.js +11 -0
- package/frontend/user/assets/refresh-cw-Y9hCloPL.js +6 -0
- package/frontend/user/assets/useUserPageRefresh-BYZvpNR9.js +1 -0
- package/frontend/user/assets/zap-l5zbZqrM.js +11 -0
- package/frontend/user/index.html +67 -0
- package/install.sh +402 -0
- package/lib/commands/activate.js +144 -0
- package/lib/commands/restore.js +102 -0
- package/lib/commands/test.js +40 -0
- package/lib/config/claude.js +81 -0
- package/lib/config/codex.js +164 -0
- package/lib/config/upstream.js +79 -0
- package/lib/index.js +164 -0
- package/lib/platforms/claude-code.js +35 -0
- package/lib/platforms/codex-cli.js +35 -0
- package/lib/platforms/editor-codex.js +138 -0
- package/lib/platforms/index.js +32 -0
- package/lib/platforms/openclaw.js +118 -0
- package/lib/platforms/opencode.js +89 -0
- package/lib/services/activation-orchestrator.js +666 -0
- package/lib/services/backup-service.js +162 -0
- package/lib/services/cliproxy-api.js +174 -0
- package/lib/services/database.js +461 -0
- package/lib/services/newapi.js +97 -0
- package/lib/services/node-service.js +49 -0
- package/lib/utils/json-file.js +33 -0
- package/package.json +53 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as r,e as i,Q as u}from"./index-Da98HOxL.js";import{j as d,aK as f,aO as m,u as s,x as c,y as p,J as b,i as x}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const v=r("EyeOffIcon",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),k=d({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},emits:["update:modelValue"],setup(o,{emit:l}){const e=o,a=i(e,"modelValue",l,{passive:!0,defaultValue:e.defaultValue});return(V,t)=>f((p(),c("input",{"onUpdate:modelValue":t[0]||(t[0]=n=>x(a)?a.value=n:null),class:b(s(u)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e.class))},null,2)),[[m,s(a)]])}});export{v as E,k as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as r,av as t}from"./index-Da98HOxL.js";import{j as n,D as l,y as c,E as p,G as d,C as i,u as s}from"./chart-vendor-CULJE59K.js";const _=n({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(a){const e=a;return(o,m)=>(c(),l(s(t),i(e,{class:s(r)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.class)}),{default:p(()=>[d(o.$slots,"default")]),_:3},16,["class"]))}});export{_};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aw as c,Q as e,ax as d}from"./index-Da98HOxL.js";import{j as i,d as u,D as m,y as p,u as s,C as f,E as _,H as y,I as C,J as g}from"./chart-vendor-CULJE59K.js";const w=i({__name:"Progress",props:{modelValue:{default:0},max:{},getValueLabel:{},asChild:{type:Boolean},as:{},class:{},indicatorClass:{}},setup(l){const a=l,r=u(()=>{const{class:t,indicatorClass:o,...n}=a;return n});return(t,o)=>(p(),m(s(c),f(r.value,{class:s(e)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",a.class)}),{default:_(()=>[y(s(d),{class:g(["h-full w-full flex-1 transition-all",s(e)("bg-primary",a.indicatorClass)]),style:C(`transform: translateX(-${100-(a.modelValue??0)}%)`)},null,8,["class","style"])]),_:1},16,["class"]))}});export{w as _};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as ye,u as we,X as b,ag as ke,W as Y,au as Z,J as A,a2 as T,$ as F,ai as ee,a4 as he,a3 as $e,ac as qe,_ as B,L as te,C as Ke,E as Ce,G as Ae,H as Pe,M as Le,N as Ne,t as g,at as ae}from"./index-Da98HOxL.js";import{_ as U,a as z}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl.js";import{_ as se}from"./Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ.js";import{_ as le}from"./Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_.js";import{_ as Re,E as Ie}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js";import{_ as Se}from"./Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js";import{G as De}from"./gauge-C5NQ-mV8.js";import{P as ne}from"./package-rUbExUEn.js";import{E as Ee}from"./eye-CY62vip0.js";import{C as Me}from"./chevron-right-BayASIm0.js";import{C as Te}from"./chevron-down-kDbuU1Py.js";import{j as Qe,r as h,d as f,w as je,x as L,A as a,H as r,D as C,z as R,E as c,u as s,P as v,y as _,Q as m,J as I}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const G=ye("GiftIcon",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]),Ve={class:"max-w-7xl mx-auto space-y-6"},Be={class:"grid lg:grid-cols-[1fr,auto,1fr] gap-6"},Ue={class:"flex flex-col gap-4"},ze={class:"flex items-center gap-2"},Ge={class:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center"},He={class:"space-y-3"},Je={class:"text-center py-4"},We={class:"text-2xl font-bold tabular-nums text-primary"},Xe={class:"text-xs text-muted-foreground mt-1"},Oe={class:"space-y-1.5"},Ye={class:"flex items-center justify-between"},Ze={class:"text-xs text-muted-foreground"},Fe={class:"text-xs text-muted-foreground"},et={class:"flex flex-col gap-4"},tt={class:"flex items-center gap-2"},at={class:"w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center"},st={key:0,class:"space-y-3"},lt={class:"text-center py-4"},nt={class:"text-2xl font-bold tabular-nums text-amber-600 dark:text-amber-400"},ot={class:"text-xs text-muted-foreground mt-1"},rt={class:"space-y-1.5"},it={class:"flex items-center justify-between"},ut={class:"text-xs text-muted-foreground"},dt={key:1,class:"flex-1 flex flex-col items-center justify-center rounded-xl border border-dashed border-border/60"},ct={class:"mt-5 pt-5 border-t border-border/40"},mt={class:"flex items-center gap-2 flex-wrap"},vt={class:"text-center space-y-2"},pt={class:"w-12 h-12 rounded-2xl bg-gradient-to-br from-amber-500/20 to-orange-500/20 flex items-center justify-center mx-auto"},ft={key:0,class:"rounded-xl border border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-500/5 p-4 text-sm"},_t={class:"flex gap-3"},xt={class:"font-medium text-amber-800 dark:text-amber-400"},bt={class:"mt-1 text-amber-700/80 dark:text-amber-400/70"},gt={class:"space-y-3"},yt={class:"relative"},wt={class:"rounded-xl border border-dashed border-border/60 bg-muted/20 p-3 text-center text-sm text-muted-foreground"},kt={class:"font-mono text-foreground font-medium"},ht={key:0,class:"space-y-4 py-2"},$t={class:"rounded-xl border border-border/60 bg-muted/20 p-4 space-y-2"},qt={class:"flex flex-wrap items-center gap-2"},Kt={class:"text-sm text-muted-foreground"},Ct={class:"font-mono font-medium text-foreground"},At={class:"space-y-3"},Pt={class:"grid gap-3 sm:grid-cols-2"},Lt={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},Nt={class:"mt-2 text-base font-semibold text-emerald-500"},Rt={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},It={class:"mt-2 text-base font-semibold text-amber-500"},St={class:"rounded-xl border border-border/60 bg-muted/20 p-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4"},Dt={class:"text-base font-semibold text-foreground sm:whitespace-nowrap"},Et={key:0,class:"ml-1 text-sm font-medium text-sky-500/80"},Ot=Qe({__name:"QuotaPack",setup(Mt){const $=we(),N=h(""),q=h(""),P=h(!1),x=h(!1),y=h(!1),S=h(!1),D=h(!1),p=h(null),K=h(null),i=f(()=>$.apiKeyInfo),H=f(()=>{var t;return((t=i.value)==null?void 0:t.status)==="disabled"}),oe=f(()=>{var t;return((t=i.value)==null?void 0:t.status)==="expired"}),Q=f(()=>i.value?H.value?"当前 API Key 已禁用,无法兑换额度包":oe.value?"当前 API Key 已过期,无法兑换额度包":"":"当前没有可用 Key,请先切换到可用 Key"),E=f(()=>Q.value!==""),M=f(()=>{const t=i.value;if(!(t!=null&&t.quota))return{total:0,remaining:0,percent:0,label:"-",remainingLabel:"-"};if(t.billing_type==="count"){const o=t.quota.max_requests||0,d=t.quota.remaining_count||0,n=o>0?Math.round((o-d)/o*100):0;return{total:o,remaining:d,percent:n,label:`${d} / ${o} 次`,remainingLabel:`${d} 次`}}if(t.billing_type==="duration"){const o=t.quota.daily_quota||0,d=t.quota.daily_remaining||0,n=o>0?Math.round((o-d)/o*100):0;return{total:o,remaining:d,percent:n,label:`${b(d)} / ${b(o)}`,remainingLabel:b(d)}}const e=t.quota.total_quota||0,l=t.quota.remaining_quota||0,u=e>0?Math.round((e-l)/e*100):0;return{total:e,remaining:l,percent:u,label:`${b(l)} / ${b(e)}`,remainingLabel:b(l)}}),re=f(()=>{var e,l;const t=i.value;return(e=t==null?void 0:t.timestamps)!=null&&e.expires_at?ke(t.timestamps.expires_at)||"永久有效":(l=t==null?void 0:t.timestamps)!=null&&l.validity_days&&t.timestamps.validity_days>0?`${t.timestamps.validity_days} 天(激活后计算)`:"永久有效"}),w=f(()=>{const t=i.value;if(!(t!=null&&t.quota))return null;if(t.billing_type==="count"){if(!Y(t.quota.requests_pack_expires_at)||!t.quota.requests_pack)return null;const n=t.quota.requests_pack||0,k=t.quota.requests_pack_remaining||0,ge=n>0?Math.round((n-k)/n*100):0;return{total:n,remaining:k,percent:ge,label:`${k} / ${n} 次`,remainingLabel:`${k} 次`,expiresAt:t.quota.requests_pack_expires_at}}if(!Y(t.quota.quota_pack_expires_at)||!t.quota.quota_pack)return null;const l=t.quota.quota_pack||0,u=t.quota.quota_pack_remaining||0,o=l>0?Math.round((l-u)/l*100):0;return{total:l,remaining:u,percent:o,label:`${b(u)} / ${b(l)}`,remainingLabel:b(u),expiresAt:t.quota.quota_pack_expires_at}}),ie=f(()=>{var l;if(!((l=w.value)!=null&&l.expiresAt))return"";const t=new Date(w.value.expiresAt);if(Number.isNaN(t.getTime()))return"";const e=Math.floor((t.getTime()-Date.now())/1e3);return e<=0?"已过期":`剩余${Z(e)}`}),j=f(()=>{var l;if(!((l=w.value)!=null&&l.expiresAt))return!1;const e=(new Date(w.value.expiresAt).getTime()-Date.now())/(1e3*86400);return e>0&&e<7}),ue=f(()=>W(p.value)),de=f(()=>X(p.value)),ce=f(()=>V(p.value).main),J=f(()=>V(p.value).countdown),me=f(()=>pe(q.value));function W(t){var e;return t?((e=i.value)==null?void 0:e.billing_type)==="count"?`+${t.request_amount||0} 次`:`+${b(t.quota_amount||0)}`:"-"}function X(t){var e;return t?((e=i.value)==null?void 0:e.billing_type)==="count"?`${t.new_pack_remaining} 次`:b(t.new_pack_remaining):"-"}function V(t){if(!(t!=null&&t.new_pack_expires_at))return{main:"无",countdown:""};const e=new Date(t.new_pack_expires_at);if(Number.isNaN(e.getTime()))return{main:t.new_pack_expires_at,countdown:""};const l=e.getTime()-Date.now();return l<=0?{main:e.toLocaleString("zh-CN",{hour12:!1}),countdown:"已过期"}:{main:e.toLocaleString("zh-CN",{hour12:!1}),countdown:`剩余${Z(l/1e3)}`}}function ve(t){const e=V(t);return e.countdown?`${e.main} (${e.countdown})`:e.main}function pe(t){const e=t.trim().toUpperCase();if(/^QP-[0-9A-HJKMNPQRSTUVWXYZ]{4}(?:-[0-9A-HJKMNPQRSTUVWXYZ]{4}){3}$/.test(e)){const u=e.split("-");return`${u[0]}-${u[1]}-****-${u[4]}`}return e.length<=8?"****":`${e.slice(0,4)}****${e.slice(-4)}`}function fe(t){return t?[W(t),`兑换后剩余 ${X(t)}`,`新到期时间 ${ve(t)}`].join(","):"额度包已兑换到当前活跃 Key"}function O(){const t=Q.value;return t?(g.error("兑换失败",t),!1):!0}function _e(){x.value||(K.value=null,y.value=!1,p.value=null,q.value="")}je(()=>$.activeKeyId,(t,e)=>{!e||t===e||!p.value&&!y.value||(K.value=null,p.value=null,q.value="",y.value=!1,g.warning("当前活跃 Key 已切换,请重新预览后再兑换"))});async function xe(){var l,u,o,d;if(!O())return;const t=N.value.trim();if(!t||P.value||x.value)return;const e=$.activeKeyId;if(!e){g.error("兑换失败","当前没有可用 Key,请先切换到可用 Key");return}P.value=!0;try{const n=await ae.previewRedeemQuotaPack(t);if($.activeKeyId!==e){K.value=null,p.value=null,q.value="",y.value=!1,g.warning("当前活跃 Key 已切换,请重新预览后再兑换");return}if(!n.preview){g.error("兑换失败",n.message||"无法获取兑换预览");return}p.value=n.preview,q.value=t,K.value=e,y.value=!0}catch(n){const k=((u=(l=n==null?void 0:n.response)==null?void 0:l.data)==null?void 0:u.message)||((d=(o=n==null?void 0:n.response)==null?void 0:o.data)==null?void 0:d.error)||(n==null?void 0:n.message)||"兑换失败,请稍后重试";g.error("兑换失败",k)}finally{P.value=!1}}async function be(){var t,e,l,u;if(O()){if(!p.value||x.value||!K.value||K.value!==$.activeKeyId){K.value=null,p.value=null,q.value="",y.value=!1,g.error("预览已失效","当前活跃 Key 已变化,请重新预览后再兑换");return}x.value=!0;try{const o=await ae.redeemQuotaPack(q.value);if(K.value=null,y.value=!1,p.value=null,q.value="",N.value="",$.applyActiveKeyInfo(o.updated_info),!await $.fetchInfo()){$.applyActiveKeyInfo(o.updated_info),g.success("兑换成功","额度包已兑换成功,但状态刷新失败,请稍后手动刷新确认最新状态");return}g.success("兑换成功",fe(o.redemption||null))}catch(o){const d=((e=(t=o==null?void 0:o.response)==null?void 0:t.data)==null?void 0:e.message)||((u=(l=o==null?void 0:o.response)==null?void 0:l.data)==null?void 0:u.error)||(o==null?void 0:o.message)||"兑换失败,请稍后重试";g.error("兑换失败",d)}finally{x.value=!1}}}return(t,e)=>(_(),L("div",Ve,[e[23]||(e[23]=a("div",{class:"space-y-1"},[a("h1",{class:"text-2xl font-semibold tracking-tight"},"额度包"),a("p",{class:"text-sm text-muted-foreground"}," 兑换额度包为当前 Key 增加额外配额 ")],-1)),r(s(z),{class:"border-border/60 bg-card/80 backdrop-blur-xl overflow-hidden"},{default:c(()=>[r(s(U),{class:"p-6"},{default:c(()=>{var l,u,o,d;return[a("div",Be,[a("div",Ue,[a("div",ze,[a("div",Ge,[r(s(De),{class:"h-4.5 w-4.5 text-primary"})]),e[4]||(e[4]=a("div",null,[a("h3",{class:"text-sm font-semibold"},"基础配额"),a("p",{class:"text-xs text-muted-foreground"},"Key 自带的额度")],-1))]),a("div",He,[a("div",Je,[a("p",We,m(M.value.remainingLabel),1),a("p",Xe,m(M.value.label),1)]),a("div",Oe,[r(s(se),{"model-value":M.value.percent,class:"h-2"},null,8,["model-value"]),a("div",Ye,[a("p",Ze,m(re.value),1),a("p",Fe," 已使用 "+m(M.value.percent)+"% ",1)])])])]),r(s(le),{orientation:"vertical",class:"hidden lg:block"}),r(s(le),{class:"lg:hidden"}),a("div",et,[a("div",tt,[a("div",at,[r(s(ne),{class:"h-4.5 w-4.5 text-amber-500"})]),e[5]||(e[5]=a("div",null,[a("h3",{class:"text-sm font-semibold"},"额度包"),a("p",{class:"text-xs text-muted-foreground"},"兑换获得的额外配额")],-1))]),w.value?(_(),L("div",st,[a("div",lt,[a("p",nt,m(w.value.remainingLabel),1),a("p",ot,m(w.value.label),1)]),a("div",rt,[r(s(se),{"model-value":w.value.percent,class:I(j.value?"h-2 bg-red-500/20":"h-2 bg-amber-500/20"),"indicator-class":j.value?"bg-red-500":"bg-amber-500"},null,8,["model-value","class","indicator-class"]),a("div",it,[a("p",{class:I(["text-xs",j.value?"text-red-500":"text-muted-foreground"])},m(ie.value||"永久有效"),3),a("p",ut," 已使用 "+m(w.value.percent)+"% ",1)])])])):(_(),L("div",dt,[r(s(ne),{class:"h-8 w-8 text-muted-foreground/30 mb-2"}),e[6]||(e[6]=a("p",{class:"text-sm text-muted-foreground"},"暂无有效额度包",-1)),e[7]||(e[7]=a("p",{class:"text-xs text-muted-foreground/70 mt-0.5"}," 兑换后展示在这里 ",-1))]))])]),a("div",ct,[a("div",mt,[e[8]||(e[8]=a("span",{class:"text-xs text-muted-foreground"},"当前 Key",-1)),r(s(A),{variant:"outline",class:"font-mono rounded-full px-2.5 text-xs"},{default:c(()=>{var n;return[v(m(((n=i.value)==null?void 0:n.key_preview)||"-"),1)]}),_:1}),r(s(A),{variant:"outline",class:I(["text-xs",s(F)(((l=i.value)==null?void 0:l.service_type)||"").badge]),title:s(T)(((u=i.value)==null?void 0:u.service_type)||"",(o=i.value)==null?void 0:o.sub_service_type_name)},{default:c(()=>{var n,k;return[v(m(s(T)(((n=i.value)==null?void 0:n.service_type)||"",(k=i.value)==null?void 0:k.sub_service_type_name)),1)]}),_:1},8,["class","title"]),r(s(A),{variant:"outline",class:"text-xs"},{default:c(()=>{var n;return[v(m(s(ee)(((n=i.value)==null?void 0:n.billing_type)||"")),1)]}),_:1}),r(s(A),{variant:"outline",class:I(["text-xs",s(he)(((d=i.value)==null?void 0:d.status)||"")])},{default:c(()=>{var n;return[v(m(s($e)(((n=i.value)==null?void 0:n.status)||"")),1)]}),_:1},8,["class"])])])]}),_:1})]),_:1}),r(s(z),{class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:c(()=>[r(s(U),{class:"p-6 space-y-5"},{default:c(()=>{var l;return[a("div",vt,[a("div",pt,[r(s(G),{class:"h-6 w-6 text-amber-500"})]),e[9]||(e[9]=a("div",null,[a("h2",{class:"text-base font-semibold"},"兑换额度包"),a("p",{class:"text-sm text-muted-foreground"}," 输入兑换码为当前 Key 充值 ")],-1))]),E.value?(_(),L("div",ft,[a("div",_t,[r(s(qe),{class:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),a("div",null,[a("p",xt,m(H.value?"当前 Key 已被禁用":"当前 Key 已过期"),1),a("p",bt,m(Q.value),1)])])])):R("",!0),a("div",gt,[r(s(Se),{for:"quota-pack-code"},{default:c(()=>[...e[10]||(e[10]=[v("兑换码",-1)])]),_:1}),a("div",yt,[r(s(Re),{id:"quota-pack-code",modelValue:N.value,"onUpdate:modelValue":e[0]||(e[0]=u=>N.value=u),type:S.value?"text":"password",placeholder:"请输入额度包兑换码",disabled:P.value||x.value||E.value,autocomplete:"off",spellcheck:"false",class:"pr-9 font-mono text-sm"},null,8,["modelValue","type","disabled"]),a("button",{type:"button",class:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:e[1]||(e[1]=u=>S.value=!S.value)},[S.value?(_(),C(s(Ee),{key:0,class:"h-4 w-4"})):(_(),C(s(Ie),{key:1,class:"h-4 w-4"}))])])]),r(s(B),{class:"w-full",disabled:P.value||x.value||!N.value.trim()||!i.value||E.value,onClick:xe},{default:c(()=>[P.value||x.value?(_(),C(s(te),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):(_(),C(s(G),{key:1,class:"h-4 w-4 mr-2"})),e[11]||(e[11]=v(" 立即兑换 ",-1))]),_:1},8,["disabled"]),a("div",wt,[e[12]||(e[12]=v(" 将兑换到:",-1)),a("span",kt,m(((l=i.value)==null?void 0:l.key_preview)||"-"),1)])]}),_:1})]),_:1}),a("button",{type:"button",class:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",onClick:e[2]||(e[2]=l=>D.value=!D.value)},[D.value?(_(),C(s(Te),{key:1,class:"h-4 w-4"})):(_(),C(s(Me),{key:0,class:"h-4 w-4"})),e[13]||(e[13]=v(" 兑换规则 ",-1))]),D.value?(_(),C(s(z),{key:0,class:"border-border/40"},{default:c(()=>[r(s(U),{class:"p-5"},{default:c(()=>[...e[14]||(e[14]=[a("ul",{class:"space-y-2 text-sm text-muted-foreground"},[a("li",null,"1. 兑换码只能使用一次,并且只会作用于当前活跃 Key。"),a("li",null," 2. 兑换码的服务类型、子服务类型和计费方式必须与当前 Key 完全一致。 "),a("li",null,"3. 如果当前已有有效额度包,系统会叠加额度并自动顺延有效期。"),a("li",null,"4. 已禁用或已过期的 Key 无法兑换额度包。")],-1)])]),_:1})]),_:1})):R("",!0),r(s(Ne),{open:y.value,"onUpdate:open":e[3]||(e[3]=l=>y.value=l)},{default:c(()=>[r(s(Ke),{class:"sm:max-w-xl"},{default:c(()=>{var l,u,o;return[r(s(Ce),null,{default:c(()=>[r(s(Ae),{class:"flex items-center gap-2"},{default:c(()=>[r(s(G),{class:"h-5 w-5 text-amber-500"}),e[15]||(e[15]=v(" 确认兑换额度包 ",-1))]),_:1}),r(s(Pe),null,{default:c(()=>[...e[16]||(e[16]=[v(" 请确认本次兑换结果,确认后将立即作用于当前活跃 Key。 ",-1)])]),_:1})]),_:1}),p.value?(_(),L("div",ht,[a("div",$t,[a("div",qt,[r(s(A),{variant:"outline",class:"font-mono"},{default:c(()=>[v(m(me.value),1)]),_:1}),r(s(A),{variant:"outline",class:I(s(F)(((l=i.value)==null?void 0:l.service_type)||"").badge),title:s(T)(((u=i.value)==null?void 0:u.service_type)||"",(o=i.value)==null?void 0:o.sub_service_type_name)},{default:c(()=>{var d,n;return[v(m(s(T)(((d=i.value)==null?void 0:d.service_type)||"",(n=i.value)==null?void 0:n.sub_service_type_name)),1)]}),_:1},8,["class","title"]),r(s(A),{variant:"outline"},{default:c(()=>{var d;return[v(m(s(ee)(((d=i.value)==null?void 0:d.billing_type)||"")),1)]}),_:1})]),a("p",Kt,[e[17]||(e[17]=v(" 目标 Key:",-1)),a("span",Ct,m(p.value.target_key_preview),1)])]),a("div",At,[a("div",Pt,[a("div",Lt,[e[18]||(e[18]=a("p",{class:"text-xs text-muted-foreground"},"本次新增",-1)),a("p",Nt,m(ue.value),1)]),a("div",Rt,[e[19]||(e[19]=a("p",{class:"text-xs text-muted-foreground"},"兑换后剩余",-1)),a("p",It,m(de.value),1)])]),a("div",St,[e[20]||(e[20]=a("p",{class:"text-xs text-muted-foreground shrink-0"},"新到期时间",-1)),a("p",Dt,[v(m(ce.value)+" ",1),J.value?(_(),L("span",Et,"("+m(J.value)+")",1)):R("",!0)])])])])):R("",!0),r(s(Le),{class:"gap-2 sm:gap-3"},{default:c(()=>[r(s(B),{variant:"outline",disabled:x.value,onClick:_e},{default:c(()=>[...e[21]||(e[21]=[v("取消",-1)])]),_:1},8,["disabled"]),r(s(B),{disabled:x.value||!p.value||E.value,onClick:be},{default:c(()=>[x.value?(_(),C(s(te),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):R("",!0),e[22]||(e[22]=v(" 确认兑换 ",-1))]),_:1},8,["disabled"])]),_:1})]}),_:1})]),_:1},8,["open"])]))}});export{Ot as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{j as ue,r as y,d as g,x,A as s,H as n,D as $,z as b,E as i,u as a,P as p,y as c,Q as o,J as M,F as O,Z as de,B as ce}from"./chart-vendor-CULJE59K.js";import{c as me,u as fe,ab as ve,ag as _e,aj as pe,X as w,au as P,ac as Q,_ as U,L as W,J as C,a2 as V,$ as X,ai as Z,a4 as ge,a3 as xe,C as ye,E as be,G as he,H as we,M as ke,N as $e,t as k,at as Y}from"./index-Da98HOxL.js";import{a as Ce}from"./useUserPageRefresh-BYZvpNR9.js";import{_ as ee,a as te}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl.js";import{_ as Ke,E as qe}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js";import{_ as Ie}from"./Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js";import{_ as De}from"./Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ.js";import{_ as se}from"./Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_.js";import{G as Ae}from"./gauge-C5NQ-mV8.js";import{E as Se}from"./eye-CY62vip0.js";import{C as Be}from"./chevron-right-BayASIm0.js";import{C as Me}from"./chevron-down-kDbuU1Py.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Pe=me("CircleArrowUpIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),Ve={class:"max-w-7xl mx-auto space-y-6"},je={class:"grid lg:grid-cols-[1fr,auto,1fr] gap-6"},Ee={class:"flex flex-col gap-4"},Ne={class:"flex items-center gap-2"},Re={class:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center"},Te={class:"text-xs text-muted-foreground"},Le={class:"space-y-3"},Ue={class:"text-center py-4"},Fe={key:0,class:"text-xs text-muted-foreground mt-1"},Ge={key:0,class:"space-y-1.5"},ze={class:"flex items-center justify-between"},He={class:"text-xs text-muted-foreground"},Je={class:"text-xs text-muted-foreground"},Oe={key:1,class:"text-center"},Qe={class:"text-xs text-muted-foreground"},We={class:"flex flex-col gap-4"},Xe={class:"flex items-center gap-2"},Ze={class:"w-9 h-9 rounded-lg bg-emerald-500/10 flex items-center justify-center"},Ye={key:0,class:"flex-1 flex flex-col items-center justify-center rounded-xl border border-dashed border-amber-200 dark:border-amber-500/20 bg-amber-50/50 dark:bg-amber-500/5 p-4"},et={class:"text-xs text-amber-700/70 dark:text-amber-400/60 mt-0.5"},tt={class:"space-y-3"},st={class:"relative"},at={class:"mt-5 pt-5 border-t border-border/40"},lt={class:"flex items-center gap-2 flex-wrap"},nt={key:0,class:"space-y-4 py-2"},rt={class:"rounded-xl border border-border/60 bg-muted/20 p-4 space-y-2"},ot={class:"flex flex-wrap items-center gap-2"},it={class:"text-sm text-muted-foreground"},ut={class:"font-mono font-medium text-foreground"},dt={class:"space-y-3"},ct={class:"grid gap-3 sm:grid-cols-2"},mt={key:0,class:"rounded-xl border border-border/60 bg-muted/20 p-4"},ft={class:"text-xs text-muted-foreground"},vt={class:"mt-2 text-base font-semibold text-emerald-600 dark:text-emerald-400"},_t={key:1,class:"rounded-xl border border-border/60 bg-muted/20 p-4"},pt={class:"text-xs text-muted-foreground"},gt={class:"mt-2 text-base font-semibold"},xt={key:0,class:"rounded-xl border border-border/60 bg-muted/20 p-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4"},yt={class:"text-base font-semibold text-foreground sm:whitespace-nowrap"},bt={class:"ml-1 text-sm font-medium text-sky-500/80"},ht={key:0,class:"space-y-1"},Vt=ue({__name:"Renewal",setup(wt){const h=fe(),j=y(Date.now());ve(()=>{j.value=Date.now()},6e4);const K=y(""),A=y(!1),v=y(null),E=y(null),q=y(!1),D=y(!1),I=y(!1),S=y(!1),m=g(()=>h.apiKeyInfo);function B(){v.value=null,E.value=null,D.value=!1,K.value=""}Ce(async()=>{},{resetBeforeLoad:()=>{B()}});const ae=g(()=>!m.value||m.value.status==="disabled"),le=g(()=>m.value?m.value.status==="disabled"?"当前 API Key 已禁用,无法续费":"":"当前没有可用 Key,请先切换到可用 Key"),ne=g(()=>{var t;const e=(t=m.value)==null?void 0:t.billing_type;return e==="duration"?"按时长计费":e==="quota"?"按额度计费":e==="count"?"按次数计费":""}),F=g(()=>{var l,u;j.value;const e=m.value;if(!e)return"-";if(e.status==="disabled")return"已禁用";if(!((l=e.timestamps)!=null&&l.activated_at))return"待激活";if(!((u=e.timestamps)!=null&&u.expires_at))return"永久有效";const t=_e(e.timestamps.expires_at);return t==="已过期"?"已过期":t}),re=g(()=>{const e=F.value;return e==="已过期"||e==="已禁用"?"text-destructive":e==="待激活"?"text-amber-500":"text-primary"}),G=g(()=>{var t,l,u;const e=m.value;if(!e)return null;if(!((t=e.timestamps)!=null&&t.activated_at)){const _=(l=e.timestamps)==null?void 0:l.validity_days;return _&&_>0?`激活后 ${_} 天有效`:"永久有效"}return(u=e.timestamps)!=null&&u.expires_at?`${pe(e.timestamps.expires_at,"yyyy-MM-dd")} 到期`:null}),N=g(()=>{var r,f;j.value;const e=m.value;if(!((r=e==null?void 0:e.timestamps)!=null&&r.activated_at)||!((f=e==null?void 0:e.timestamps)!=null&&f.expires_at))return null;const t=new Date(e.timestamps.activated_at).getTime(),u=new Date(e.timestamps.expires_at).getTime()-t;if(u<=0)return 100;const _=Date.now()-t;return Math.round(Math.max(0,Math.min(100,_/u*100)))}),z=g(()=>{const e=m.value;if(!(e!=null&&e.quota))return"";const t=e.quota;return e.billing_type==="duration"?`${w(t.daily_quota||0)}/天`:e.billing_type==="quota"?`剩余 ${w(t.remaining_quota||0)} / ${w(t.total_quota||0)}`:e.billing_type==="count"?`剩余 ${t.remaining_count||0} / ${t.max_requests||0} 次`:""}),R=g(()=>{var t;const e=(t=v.value)==null?void 0:t.preview;if(!e)return null;if(e.daily_quota_change&&!e.quota_change)return{label:"每日额度增加",value:`+${w(e.daily_quota_change.added)}/天`};if(e.time_change&&!e.quota_change&&!e.remaining_change){const l=e.time_change.after_seconds-e.time_change.before_seconds;return{label:"新增时间",value:`+${P(l)}`}}if(e.quota_change)return{label:"新增额度",value:`+${w(e.quota_change.added)}`};if(e.remaining_change){const l=!(e.remaining_change.label||"").includes("次");return{label:l?"新增额度":"新增次数",value:l?`+${w(e.remaining_change.added)}`:`+${e.remaining_change.added} 次`}}return null}),T=g(()=>{var t;const e=(t=v.value)==null?void 0:t.preview;return e?e.daily_quota_change&&!e.quota_change?{label:"续费后每日额度",value:`${w(e.daily_quota_change.after)}/天`}:e.time_change&&!e.quota_change&&!e.remaining_change?{label:"续费后剩余",value:P(e.time_change.after_seconds)}:e.remaining_change?{label:"续费后剩余",value:!(e.remaining_change.label||"").includes("次")?w(e.remaining_change.after):`${e.remaining_change.after} 次`}:null:null}),L=g(()=>{var l;const e=(l=v.value)==null?void 0:l.preview;if(!(e!=null&&e.time_change)||!e.quota_change&&!e.remaining_change)return null;const t=e.time_change;return t.after_seconds<=0?null:{label:t.label||P(t.after_seconds),countdown:P(t.after_seconds)}}),H=g(()=>{var e;return(e=v.value)!=null&&e.warnings?v.value.warnings.filter(t=>!t.includes("不可逆")&&!t.includes("永久消耗")):[]});async function J(){var u,_,d,r;const e=K.value.trim();if(!e||q.value)return;const t=h.activeKey,l=h.activeKeyId;if(t&&t.key===e){k.error("不能用自己续费");return}q.value=!0;try{const f=await Y.renewalPreview(e);if(h.activeKeyId!==l){B(),k.warning("当前活跃 Key 已切换,请重新预览后再操作");return}if(!f.success){k.error("验证失败",f.message||"无法获取续费预览");return}v.value=f,E.value=l,D.value=!0}catch(f){const ie=((_=(u=f==null?void 0:f.response)==null?void 0:u.data)==null?void 0:_.message)||((r=(d=f==null?void 0:f.response)==null?void 0:d.data)==null?void 0:r.error)||(f==null?void 0:f.message)||"验证失败,请检查输入";k.error("验证失败",ie)}finally{q.value=!1}}async function oe(){var t,l,u,_;const e=K.value.trim();if(!(!e||I.value)){if(!v.value||E.value!==h.activeKeyId){B(),k.error("预览已失效","当前活跃 Key 已变化,请重新预览后再续费");return}I.value=!0;try{const d=await Y.renewalExecute(e);if(B(),h.applyActiveKeyInfo(d.updated_info),!await h.fetchInfo()){h.applyActiveKeyInfo(d.updated_info),k.success("续费成功","续费已成功,但状态刷新失败,请稍后手动刷新确认最新状态");return}k.success("续费成功",d.message||"续费成功")}catch(d){const r=((l=(t=d==null?void 0:d.response)==null?void 0:t.data)==null?void 0:l.message)||((_=(u=d==null?void 0:d.response)==null?void 0:u.data)==null?void 0:_.error)||(d==null?void 0:d.message)||"续费失败";k.error("续费失败",r)}finally{I.value=!1}}}return(e,t)=>(c(),x("div",Ve,[t[19]||(t[19]=s("div",{class:"space-y-1"},[s("h1",{class:"text-2xl font-semibold tracking-tight"},"续费"),s("p",{class:"text-sm text-muted-foreground"}," 使用未激活的卡为当前卡续费充值 ")],-1)),n(a(te),{class:"border-border/60 bg-card/80 backdrop-blur-xl overflow-hidden"},{default:i(()=>[n(a(ee),{class:"p-6"},{default:i(()=>{var l,u,_,d;return[s("div",je,[s("div",Ee,[s("div",Ne,[s("div",Re,[n(a(Ae),{class:"h-4.5 w-4.5 text-primary"})]),s("div",null,[t[5]||(t[5]=s("h3",{class:"text-sm font-semibold"},"当前状态",-1)),s("p",Te,o(ne.value),1)])]),s("div",Le,[s("div",Ue,[s("p",{class:M(["text-2xl font-bold tabular-nums",re.value])},o(F.value),3),G.value?(c(),x("p",Fe,o(G.value),1)):b("",!0)]),N.value!==null?(c(),x("div",Ge,[n(a(De),{"model-value":N.value,class:"h-2"},null,8,["model-value"]),s("div",ze,[s("p",He,o(z.value),1),s("p",Je," 已过 "+o(N.value)+"% ",1)])])):(c(),x("div",Oe,[s("p",Qe,o(z.value),1)]))])]),n(a(se),{orientation:"vertical",class:"hidden lg:block"}),n(a(se),{class:"lg:hidden"}),s("div",We,[s("div",Xe,[s("div",Ze,[n(a(Pe),{class:"h-4.5 w-4.5 text-emerald-500"})]),t[6]||(t[6]=s("div",null,[s("h3",{class:"text-sm font-semibold"},"续费充值"),s("p",{class:"text-xs text-muted-foreground"},"使用未激活的卡续费")],-1))]),ae.value?(c(),x("div",Ye,[n(a(Q),{class:"h-8 w-8 text-amber-500/50 mb-2"}),t[7]||(t[7]=s("p",{class:"text-sm text-amber-800 dark:text-amber-400 font-medium"}," 无法续费 ",-1)),s("p",et,o(le.value),1)])):(c(),x(O,{key:1},[s("div",tt,[n(a(Ie),{for:"renewal-source-key"},{default:i(()=>[...t[8]||(t[8]=[p("源卡 API Key",-1)])]),_:1}),s("div",st,[n(a(Ke),{id:"renewal-source-key",modelValue:K.value,"onUpdate:modelValue":t[0]||(t[0]=r=>K.value=r),type:A.value?"text":"password",placeholder:"请输入源卡 API Key",disabled:q.value,autocomplete:"off",spellcheck:"false",class:"pr-9 font-mono text-sm",onKeydown:de(J,["enter"])},null,8,["modelValue","type","disabled"]),s("button",{type:"button",class:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:t[1]||(t[1]=r=>A.value=!A.value)},[A.value?(c(),$(a(Se),{key:0,class:"h-4 w-4"})):(c(),$(a(qe),{key:1,class:"h-4 w-4"}))])])]),n(a(U),{class:"w-full",disabled:q.value||!K.value.trim(),onClick:J},{default:i(()=>[q.value?(c(),$(a(W),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):b("",!0),t[9]||(t[9]=p(" 验证并预览 ",-1))]),_:1},8,["disabled"])],64))])]),s("div",at,[s("div",lt,[t[10]||(t[10]=s("span",{class:"text-xs text-muted-foreground"},"当前 Key",-1)),n(a(C),{variant:"outline",class:"font-mono rounded-full px-2.5 text-xs"},{default:i(()=>{var r;return[p(o(((r=m.value)==null?void 0:r.key_preview)||"-"),1)]}),_:1}),n(a(C),{variant:"outline",class:M(["text-xs",a(X)(((l=m.value)==null?void 0:l.service_type)||"").badge]),title:a(V)(((u=m.value)==null?void 0:u.service_type)||"",(_=m.value)==null?void 0:_.sub_service_type_name)},{default:i(()=>{var r,f;return[p(o(a(V)(((r=m.value)==null?void 0:r.service_type)||"",(f=m.value)==null?void 0:f.sub_service_type_name)),1)]}),_:1},8,["class","title"]),n(a(C),{variant:"outline",class:"text-xs"},{default:i(()=>{var r;return[p(o(a(Z)(((r=m.value)==null?void 0:r.billing_type)||"")),1)]}),_:1}),n(a(C),{variant:"outline",class:M(["text-xs",a(ge)(((d=m.value)==null?void 0:d.status)||"")])},{default:i(()=>{var r;return[p(o(a(xe)(((r=m.value)==null?void 0:r.status)||"")),1)]}),_:1},8,["class"])])])]}),_:1})]),_:1}),s("button",{type:"button",class:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",onClick:t[2]||(t[2]=l=>S.value=!S.value)},[S.value?(c(),$(a(Me),{key:1,class:"h-4 w-4"})):(c(),$(a(Be),{key:0,class:"h-4 w-4"})),t[11]||(t[11]=p(" 续费规则 ",-1))]),S.value?(c(),$(a(te),{key:0,class:"border-border/40"},{default:i(()=>[n(a(ee),{class:"p-5"},{default:i(()=>[...t[12]||(t[12]=[s("ul",{class:"space-y-2 text-sm text-muted-foreground"},[s("li",null," 1. 源卡必须是未激活状态,且与目标卡服务类型、子服务类型和计费方式一致。 "),s("li",null," 2. 续费会将源卡的配额/时间叠加到目标卡,源卡随后会被永久消耗。 "),s("li",null,"3. 已禁用的 Key 无法作为续费目标。"),s("li",null,"4. 此操作不可逆,请在确认前仔细核对续费效果。")],-1)])]),_:1})]),_:1})):b("",!0),n(a($e),{open:D.value,"onUpdate:open":t[4]||(t[4]=l=>D.value=l)},{default:i(()=>[n(a(ye),{class:"sm:max-w-xl"},{default:i(()=>{var l;return[n(a(be),null,{default:i(()=>[n(a(he),null,{default:i(()=>[...t[13]||(t[13]=[p("确认续费",-1)])]),_:1}),n(a(we),null,{default:i(()=>[...t[14]||(t[14]=[p(" 续费后源卡将被永久消耗,此操作不可逆。 ",-1)])]),_:1})]),_:1}),v.value?(c(),x("div",nt,[s("div",rt,[s("div",ot,[n(a(C),{variant:"outline",class:"font-mono"},{default:i(()=>[p(o(v.value.source.key_preview),1)]),_:1}),n(a(C),{variant:"outline",class:M(a(X)(v.value.source.service_type).badge),title:a(V)(v.value.source.service_type,v.value.source.sub_service_type_name)},{default:i(()=>[p(o(a(V)(v.value.source.service_type,v.value.source.sub_service_type_name)),1)]),_:1},8,["class","title"]),n(a(C),{variant:"outline"},{default:i(()=>[p(o(a(Z)(v.value.source.billing_type)),1)]),_:1})]),s("p",it,[t[15]||(t[15]=p(" 目标 Key:",-1)),s("span",ut,o((l=m.value)==null?void 0:l.key_preview),1)])]),s("div",dt,[s("div",ct,[R.value?(c(),x("div",mt,[s("p",ft,o(R.value.label),1),s("p",vt,o(R.value.value),1)])):b("",!0),T.value?(c(),x("div",_t,[s("p",pt,o(T.value.label),1),s("p",gt,o(T.value.value),1)])):b("",!0)]),L.value?(c(),x("div",xt,[t[16]||(t[16]=s("p",{class:"text-xs text-muted-foreground shrink-0"},"续费后有效期",-1)),s("p",yt,[p(o(L.value.label)+" ",1),s("span",bt,"("+o(L.value.countdown)+")",1)])])):b("",!0)]),H.value.length>0?(c(),x("div",ht,[(c(!0),x(O,null,ce(H.value,(u,_)=>(c(),x("div",{key:_,class:"flex gap-2 text-sm text-amber-600 dark:text-amber-400"},[n(a(Q),{class:"h-4 w-4 shrink-0 mt-0.5"}),s("span",null,o(u),1)]))),128))])):b("",!0)])):b("",!0),n(a(ke),{class:"gap-2 sm:gap-3"},{default:i(()=>[n(a(U),{variant:"outline",disabled:I.value,onClick:t[3]||(t[3]=u=>D.value=!1)},{default:i(()=>[...t[17]||(t[17]=[p("取消",-1)])]),_:1},8,["disabled"]),n(a(U),{disabled:I.value,onClick:oe},{default:i(()=>[I.value?(c(),$(a(W),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):b("",!0),t[18]||(t[18]=p(" 确认续费 ",-1))]),_:1},8,["disabled"])]),_:1})]}),_:1})]),_:1},8,["open"])]))}});export{Vt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{az as ee,f as F,h as T,P as H,aA as O,aB as U,l as Y,aC as te,aD as se,O as re,Q as le}from"./index-Da98HOxL.js";import{r as m,d as A,j as y,c as j,D as g,y as S,E as _,G as w,I as q,u as o,w as M,z as G,C as E,L as N,H as I,v as k,$ as z,x as ie,A as ce,P as ue,F as de}from"./chart-vendor-CULJE59K.js";function ve(r,e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){return Math.min(t,Math.max(e,r))}function fe(r){const e=ee({dir:m("ltr")});return A(()=>{var t;return(r==null?void 0:r.value)||((t=e.dir)==null?void 0:t.value)||"ltr"})}function pe(r){const e=ee({nonce:m()});return A(()=>{var t;return(r==null?void 0:r.value)||((t=e.nonce)==null?void 0:t.value)})}const[R,he]=F("ScrollAreaRoot");var _e=y({__name:"ScrollAreaRoot",props:{type:{type:String,required:!1,default:"hover"},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r,{expose:e}){const t=r,l=m(0),a=m(0),n=m(),i=m(),s=m(),u=m(),d=m(!1),v=m(!1),{type:b,dir:p,scrollHideDelay:C}=j(t),P=fe(p);function L(){var f;(f=n.value)==null||f.scrollTo({top:0})}function $(){var f;(f=n.value)==null||f.scrollTo({top:0,left:0})}e({viewport:n,scrollTop:L,scrollTopLeft:$});const{forwardRef:c,currentElement:h}=T();return he({type:b,dir:P,scrollHideDelay:C,scrollArea:h,viewport:n,onViewportChange:f=>{n.value=f||void 0},content:i,onContentChange:f=>{i.value=f},scrollbarX:s,scrollbarXEnabled:d,scrollbarY:u,scrollbarYEnabled:v,onScrollbarXChange:f=>{s.value=f||void 0},onScrollbarYChange:f=>{u.value=f||void 0},onScrollbarXEnabledChange:f=>{d.value=f},onScrollbarYEnabledChange:f=>{v.value=f},onCornerWidthChange:f=>{l.value=f},onCornerHeightChange:f=>{a.value=f}}),(f,D)=>(S(),g(o(H),{ref:o(c),"as-child":t.asChild,as:f.as,dir:o(P),style:q({position:"relative","--reka-scroll-area-corner-width":`${l.value}px`,"--reka-scroll-area-corner-height":`${a.value}px`})},{default:_(()=>[w(f.$slots,"default")]),_:3},8,["as-child","as","dir","style"]))}}),be=_e,me=y({__name:"ScrollAreaCornerImpl",setup(r){const e=R(),t=m(0),l=m(0),a=A(()=>!!t.value&&!!l.value);function n(){var u;const s=((u=e.scrollbarX.value)==null?void 0:u.offsetHeight)||0;e.onCornerHeightChange(s),l.value=s}function i(){var u;const s=((u=e.scrollbarY.value)==null?void 0:u.offsetWidth)||0;e.onCornerWidthChange(s),t.value=s}return O(e.scrollbarX.value,n),O(e.scrollbarY.value,i),M(()=>e.scrollbarX.value,n),M(()=>e.scrollbarY.value,i),(s,u)=>{var d;return a.value?(S(),g(o(H),E({key:0,style:{width:`${t.value}px`,height:`${l.value}px`,position:"absolute",right:o(e).dir.value==="ltr"?0:void 0,left:o(e).dir.value==="rtl"?0:void 0,bottom:0}},(d=s.$parent)==null?void 0:d.$props),{default:_(()=>[w(s.$slots,"default")]),_:3},16,["style"])):G("v-if",!0)}}}),Se=me,ge=y({__name:"ScrollAreaCorner",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,{forwardRef:t}=T(),l=R(),a=A(()=>!!l.scrollbarX.value&&!!l.scrollbarY.value),n=A(()=>l.type.value!=="scroll"&&a.value);return(i,s)=>n.value?(S(),g(Se,E({key:0},e,{ref:o(t)}),{default:_(()=>[w(i.$slots,"default")]),_:3},16)):G("v-if",!0)}}),we=ge;function oe(r,e){return t=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(t-r[0])}}function X(r){const e=ae(r.viewport,r.content),t=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-t)*e;return Math.max(l,18)}function ae(r,e){const t=r/e;return Number.isNaN(t)?0:t}function Ce(r,e=()=>{}){let t={left:r.scrollLeft,top:r.scrollTop},l=0;return(function a(){const n={left:r.scrollLeft,top:r.scrollTop},i=t.left!==n.left,s=t.top!==n.top;(i||s)&&e(),t=n,l=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(l)}function K(r,e,t="ltr"){const l=X(e),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-a,i=e.content-e.viewport,s=n-l,u=t==="ltr"?[0,i]:[i*-1,0],d=ve(r,u[0],u[1]);return oe([0,i],[0,s])(d)}function V(r){return r?Number.parseInt(r,10):0}function Ee(r,e,t,l="ltr"){const a=X(t),n=a/2,i=e||n,s=a-i,u=t.scrollbar.paddingStart+i,d=t.scrollbar.size-t.scrollbar.paddingEnd-s,v=t.content-t.viewport,b=l==="ltr"?[0,v]:[v*-1,0];return oe([u,d],b)(r)}function Z(r,e){return r>0&&r<e}var ye=y({__name:"ScrollAreaScrollbarX",setup(r){const e=R(),t=W(),{forwardRef:l,currentElement:a}=T();N(()=>{a.value&&e.onScrollbarXChange(a.value)});const n=A(()=>t.sizes.value);return(i,s)=>(S(),g(ne,{ref:o(l),"is-horizontal":!0,"data-orientation":"horizontal",style:q({bottom:0,left:o(e).dir.value==="rtl"?"var(--reka-scroll-area-corner-width)":0,right:o(e).dir.value==="ltr"?"var(--reka-scroll-area-corner-width)":0,"--reka-scroll-area-thumb-width":n.value?`${o(X)(n.value)}px`:void 0}),onOnDragScroll:s[0]||(s[0]=u=>o(t).onDragScroll(u.x))},{default:_(()=>[w(i.$slots,"default")]),_:3},8,["style"]))}}),Ae=ye,Pe=y({__name:"ScrollAreaScrollbarY",setup(r){const e=R(),t=W(),{forwardRef:l,currentElement:a}=T();N(()=>{a.value&&e.onScrollbarYChange(a.value)});const n=A(()=>t.sizes.value);return(i,s)=>(S(),g(ne,{ref:o(l),"is-horizontal":!1,"data-orientation":"vertical",style:q({top:0,right:o(e).dir.value==="ltr"?0:void 0,left:o(e).dir.value==="rtl"?0:void 0,bottom:"var(--reka-scroll-area-corner-height)","--reka-scroll-area-thumb-height":n.value?`${o(X)(n.value)}px`:void 0}),onOnDragScroll:s[0]||(s[0]=u=>o(t).onDragScroll(u.y))},{default:_(()=>[w(i.$slots,"default")]),_:3},8,["style"]))}}),Te=Pe,Re=y({__name:"ScrollAreaScrollbarAuto",props:{forceMount:{type:Boolean,required:!1}},setup(r){const e=R(),t=B(),{forwardRef:l}=T(),a=m(!1),n=U(()=>{if(e.viewport.value){const i=e.viewport.value.offsetWidth<e.viewport.value.scrollWidth,s=e.viewport.value.offsetHeight<e.viewport.value.scrollHeight;a.value=t.isHorizontal.value?i:s}},10);return N(()=>n()),O(e.viewport,n),O(e.content,n),(i,s)=>(S(),g(o(Y),{present:i.forceMount||a.value},{default:_(()=>[I(J,E(i.$attrs,{ref:o(l),"data-state":a.value?"visible":"hidden"}),{default:_(()=>[w(i.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),Q=Re,Le=y({inheritAttrs:!1,__name:"ScrollAreaScrollbarGlimpse",props:{forceMount:{type:Boolean,required:!1}},setup(r){const e=R(),t=B(),{forwardRef:l}=T(),{state:a,dispatch:n}=te("hidden",{hidden:{POINTER_ENTER:"glimpse",SCROLL:"scrolling"},glimpse:{HIDE:"hidden",POINTER_LEAVE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"glimpse"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}}),i=A(()=>a.value!=="hidden");function s(){n("POINTER_ENTER")}function u(){n("POINTER_LEAVE")}const d=U(()=>n("SCROLL_END"),100);return k(v=>{if(a.value==="glimpse"){const b=window.setTimeout(()=>n("HIDE"),e.scrollHideDelay.value);v(()=>{window.clearTimeout(b)})}}),k(v=>{if(a.value==="idle"){const b=window.setTimeout(()=>n("HIDE"),e.scrollHideDelay.value);v(()=>{window.clearTimeout(b)})}}),k(v=>{const b=e.viewport.value,p=t.isHorizontal.value?"scrollLeft":"scrollTop";if(b){let C=b[p];const P=()=>{const L=b[p];C!==L&&(n("SCROLL"),d()),C=L};b.addEventListener("scroll",P),v(()=>{b.removeEventListener("scroll",P)})}}),N(()=>{const v=e.scrollArea.value;v&&(v.addEventListener("pointerenter",s),v.addEventListener("pointerleave",u))}),z(()=>{const v=e.scrollArea.value;v&&(v.removeEventListener("pointerenter",s),v.removeEventListener("pointerleave",u))}),(v,b)=>(S(),g(o(Y),{present:v.forceMount||i.value},{default:_(()=>[I(Q,E(v.$attrs,{ref:o(l),"data-state":i.value?"visible":"hidden"}),{default:_(()=>[w(v.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),Ie=Le,$e=y({inheritAttrs:!1,__name:"ScrollAreaScrollbarHover",props:{forceMount:{type:Boolean,required:!1}},setup(r){const e=R(),{forwardRef:t}=T();let l;const a=m(!1);function n(){window.clearTimeout(l),a.value=!0}function i(){l=window.setTimeout(()=>{a.value=!1},e.scrollHideDelay.value)}return N(()=>{const s=e.scrollArea.value;s&&(s.addEventListener("pointerenter",n),s.addEventListener("pointerleave",i))}),z(()=>{const s=e.scrollArea.value;s&&(window.clearTimeout(l),s.removeEventListener("pointerenter",n),s.removeEventListener("pointerleave",i))}),(s,u)=>(S(),g(o(Y),{present:s.forceMount||a.value},{default:_(()=>[I(Q,E(s.$attrs,{ref:o(t),"data-state":a.value?"visible":"hidden"}),{default:_(()=>[w(s.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),De=$e,xe=y({__name:"ScrollAreaScrollbarScroll",props:{forceMount:{type:Boolean,required:!1}},setup(r){const e=R(),t=B(),{forwardRef:l}=T(),{state:a,dispatch:n}=te("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}}),i=A(()=>a.value!=="hidden");k(u=>{if(a.value==="idle"){const d=window.setTimeout(()=>n("HIDE"),e.scrollHideDelay.value);u(()=>{window.clearTimeout(d)})}});const s=U(()=>n("SCROLL_END"),100);return k(u=>{const d=e.viewport.value,v=t.isHorizontal.value?"scrollLeft":"scrollTop";if(d){let b=d[v];const p=()=>{const C=d[v];b!==C&&(n("SCROLL"),s()),b=C};d.addEventListener("scroll",p),u(()=>{d.removeEventListener("scroll",p)})}}),(u,d)=>(S(),g(o(Y),{present:u.forceMount||i.value},{default:_(()=>[I(J,E(u.$attrs,{ref:o(l),"data-state":i.value?"visible":"hidden"}),{default:_(()=>[w(u.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),Ne=xe;const[B,He]=F("ScrollAreaScrollbar");var Oe=y({inheritAttrs:!1,__name:"ScrollAreaScrollbar",props:{orientation:{type:String,required:!1,default:"vertical"},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(r){const e=r,{forwardRef:t}=T(),l=R(),a=A(()=>e.orientation==="horizontal");M(a,()=>{a.value?l.onScrollbarXEnabledChange(!0):l.onScrollbarYEnabledChange(!0)},{immediate:!0}),z(()=>{l.onScrollbarXEnabledChange(!1),l.onScrollbarYEnabledChange(!1)});const{orientation:n,forceMount:i,asChild:s,as:u}=j(e);return He({orientation:n,forceMount:i,isHorizontal:a,as:u,asChild:s}),(d,v)=>o(l).type.value==="hover"?(S(),g(De,E({key:0},d.$attrs,{ref:o(t),"force-mount":o(i)}),{default:_(()=>[w(d.$slots,"default")]),_:3},16,["force-mount"])):o(l).type.value==="scroll"?(S(),g(Ne,E({key:1},d.$attrs,{ref:o(t),"force-mount":o(i)}),{default:_(()=>[w(d.$slots,"default")]),_:3},16,["force-mount"])):o(l).type.value==="glimpse"?(S(),g(Ie,E({key:2},d.$attrs,{ref:o(t),"force-mount":o(i)}),{default:_(()=>[w(d.$slots,"default")]),_:3},16,["force-mount"])):o(l).type.value==="auto"?(S(),g(Q,E({key:3},d.$attrs,{ref:o(t),"force-mount":o(i)}),{default:_(()=>[w(d.$slots,"default")]),_:3},16,["force-mount"])):o(l).type.value==="always"?(S(),g(J,E({key:4},d.$attrs,{ref:o(t),"data-state":"visible"}),{default:_(()=>[w(d.$slots,"default")]),_:3},16)):G("v-if",!0)}}),ke=Oe;const[W,ze]=F("ScrollAreaScrollbarVisible");var Be=y({__name:"ScrollAreaScrollbarVisible",setup(r){const e=R(),t=B(),{forwardRef:l}=T(),a=m({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),n=A(()=>{const c=ae(a.value.viewport,a.value.content);return c>0&&c<1}),i=m(),s=m(0);function u(c,h){if(C.value){const f=e.viewport.value.scrollLeft+c.deltaY;e.viewport.value.scrollLeft=f,Z(f,h)&&c.preventDefault()}else{const f=e.viewport.value.scrollTop+c.deltaY;e.viewport.value.scrollTop=f,Z(f,h)&&c.preventDefault()}}function d(c,h){C.value?s.value=h.x:s.value=h.y}function v(c){s.value=0}function b(c){a.value=c}function p(c,h){return Ee(c,s.value,a.value,h)}const C=A(()=>t.isHorizontal.value);function P(c){C.value?e.viewport.value.scrollLeft=p(c,e.dir.value):e.viewport.value.scrollTop=p(c)}function L(){if(C.value){if(e.viewport.value&&i.value){const c=e.viewport.value.scrollLeft,h=K(c,a.value,e.dir.value);i.value.style.transform=`translate3d(${h}px, 0, 0)`}}else if(e.viewport.value&&i.value){const c=e.viewport.value.scrollTop,h=K(c,a.value);i.value.style.transform=`translate3d(0, ${h}px, 0)`}}function $(c){i.value=c}return ze({sizes:a,hasThumb:n,handleWheelScroll:u,handleThumbDown:d,handleThumbUp:v,handleSizeChange:b,onThumbPositionChange:L,onThumbChange:$,onDragScroll:P}),(c,h)=>C.value?(S(),g(Ae,E({key:0},c.$attrs,{ref:o(l)}),{default:_(()=>[w(c.$slots,"default")]),_:3},16)):(S(),g(Te,E({key:1},c.$attrs,{ref:o(l)}),{default:_(()=>[w(c.$slots,"default")]),_:3},16))}}),J=Be,Ve=y({__name:"ScrollAreaScrollbarImpl",props:{isHorizontal:{type:Boolean,required:!0}},emits:["onDragScroll","onWheelScroll","onThumbPointerDown"],setup(r,{emit:e}){const t=r,l=e,a=R(),n=W(),i=B(),{forwardRef:s,currentElement:u}=T(),d=m(""),v=m();function b(c){var h,f;if(v.value){const D=c.clientX-((h=v.value)==null?void 0:h.left),x=c.clientY-((f=v.value)==null?void 0:f.top);l("onDragScroll",{x:D,y:x})}}function p(c){c.button===0&&(c.target.setPointerCapture(c.pointerId),v.value=u.value.getBoundingClientRect(),d.value=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",a.viewport&&(a.viewport.value.style.scrollBehavior="auto"),b(c))}function C(c){b(c)}function P(c){const h=c.target;h.hasPointerCapture(c.pointerId)&&h.releasePointerCapture(c.pointerId),document.body.style.webkitUserSelect=d.value,a.viewport&&(a.viewport.value.style.scrollBehavior=""),v.value=void 0}function L(c){var x;const h=c.target,f=(x=u.value)==null?void 0:x.contains(h),D=n.sizes.value.content-n.sizes.value.viewport;f&&n.handleWheelScroll(c,D)}N(()=>{document.addEventListener("wheel",L,{passive:!1})}),z(()=>{document.removeEventListener("wheel",L)});function $(){var c,h,f,D,x;u.value&&(t.isHorizontal?n.handleSizeChange({content:((c=a.viewport.value)==null?void 0:c.scrollWidth)??0,viewport:((h=a.viewport.value)==null?void 0:h.offsetWidth)??0,scrollbar:{size:u.value.clientWidth??0,paddingStart:V(getComputedStyle(u.value).paddingLeft),paddingEnd:V(getComputedStyle(u.value).paddingRight)}}):n.handleSizeChange({content:((f=a.viewport.value)==null?void 0:f.scrollHeight)??0,viewport:((D=a.viewport.value)==null?void 0:D.offsetHeight)??0,scrollbar:{size:((x=u.value)==null?void 0:x.clientHeight)??0,paddingStart:V(getComputedStyle(u.value).paddingTop),paddingEnd:V(getComputedStyle(u.value).paddingBottom)}}),n.onThumbPositionChange())}return O(u,$),O(a.content,$),(c,h)=>(S(),g(o(H),{ref:o(s),style:{position:"absolute"},"data-scrollbarimpl":"",as:o(i).as.value,"as-child":o(i).asChild.value,onPointerdown:p,onPointermove:C,onPointerup:P},{default:_(()=>[w(c.$slots,"default")]),_:3},8,["as","as-child"]))}}),ne=Ve,Ye=y({__name:"ScrollAreaThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,t=R(),l=W();function a(p){const P=p.target.getBoundingClientRect(),L=p.clientX-P.left,$=p.clientY-P.top;l.handleThumbDown(p,{x:L,y:$})}function n(p){l.handleThumbUp(p)}const{forwardRef:i,currentElement:s}=T(),u=m(),d=A(()=>t.viewport.value);function v(){if(!u.value){const p=Ce(d.value,l.onThumbPositionChange);u.value=p,l.onThumbPositionChange()}}const b=A(()=>l.sizes.value);return se(b,()=>{l.onThumbChange(s.value),d.value&&(l.onThumbPositionChange(),d.value.addEventListener("scroll",v))}),z(()=>{var p;d.value.removeEventListener("scroll",v),(p=t.viewport.value)==null||p.removeEventListener("scroll",v)}),(p,C)=>(S(),g(o(H),{ref:o(i),"data-state":o(l).hasThumb?"visible":"hidden",style:{width:"var(--reka-scroll-area-thumb-width)",height:"var(--reka-scroll-area-thumb-height)"},"as-child":e.asChild,as:p.as,onPointerdown:a,onPointerup:n},{default:_(()=>[w(p.$slots,"default")]),_:3},8,["data-state","as-child","as"]))}}),qe=Ye,Xe=y({inheritAttrs:!1,__name:"ScrollAreaViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r,{expose:e}){const t=r,{nonce:l}=j(t),a=pe(l),n=R(),i=m();N(()=>{n.onViewportChange(i.value),n.onContentChange(u.value)}),e({viewportElement:i});const{forwardRef:s,currentElement:u}=T();return(d,v)=>(S(),ie(de,null,[ce("div",E({ref_key:"viewportElement",ref:i,"data-reka-scroll-area-viewport":"",style:{overflowX:o(n).scrollbarXEnabled.value?"scroll":"hidden",overflowY:o(n).scrollbarYEnabled.value?"scroll":"hidden"}},d.$attrs,{tabindex:0}),[I(o(H),{ref:o(s),style:q({minWidth:o(n).scrollbarXEnabled.value?"fit-content":void 0}),"as-child":t.asChild,as:d.as},{default:_(()=>[w(d.$slots,"default")]),_:3},8,["style","as-child","as"])],16),I(o(H),{as:"style",nonce:o(a)},{default:_(()=>v[0]||(v[0]=[ue(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-reka-scroll-area-viewport]::-webkit-scrollbar { display:none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),We=Xe;const Me=y({__name:"ScrollBar",props:{orientation:{default:"vertical"},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(r){const e=r,t=re(e,"class");return(l,a)=>(S(),g(o(ke),E(o(t),{class:o(le)("flex touch-none select-none transition-colors",r.orientation==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",r.orientation==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e.class)}),{default:_(()=>[I(o(qe),{class:"relative flex-1 rounded-full bg-border"})]),_:1},16,["class"]))}}),je=y({__name:"ScrollArea",props:{type:{},dir:{},scrollHideDelay:{},asChild:{type:Boolean},as:{},class:{}},setup(r){const e=r,t=re(e,"class");return(l,a)=>(S(),g(o(be),E(o(t),{class:o(le)("relative overflow-hidden",e.class)}),{default:_(()=>[I(o(We),{class:"h-full w-full rounded-[inherit]"},{default:_(()=>[w(l.$slots,"default")]),_:3}),I(Me),I(o(we))]),_:3},16,["class"]))}});export{je as _,fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aE as s,Q as r}from"./index-Da98HOxL.js";import{j as n,D as t,y as p,u as e,C as c}from"./chart-vendor-CULJE59K.js";const f=n({__name:"Separator",props:{orientation:{},decorative:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(o){const a=o;return(l,i)=>(p(),t(e(s),c(a,{class:e(r)("shrink-0 bg-border",a.orientation==="vertical"?"h-full w-[1px]":"h-[1px] w-full",a.class)}),null,16,["class"]))}});export{f as _};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as z,u as F,L as A,J as M,A as J,at as B,t as C}from"./index-Da98HOxL.js";import{_ as K,a as R}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl.js";import{a as U,_ as q}from"./CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5.js";import{_ as H}from"./CardDescription.vue_vue_type_script_setup_true_lang-D-v5Pl7F.js";import{a as Q}from"./useUserPageRefresh-BYZvpNR9.js";import{L as T}from"./link-2-DT5R5nGO.js";import{j as O,r as m,x as d,A as a,H as l,E as f,u as n,y as i,P as I,Q as V,F as W,B as X,J as Y,z as $,D as Z}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ee=z("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const G=z("NetworkIcon",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),te={class:"max-w-7xl mx-auto space-y-6"},se={key:0,class:"flex items-center justify-center py-8"},ae={key:1,class:"rounded-2xl border border-sky-200/70 bg-sky-50/70 p-5 text-sm dark:border-sky-500/20 dark:bg-sky-500/5"},re={class:"flex items-start gap-3"},ne={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-sky-500/10 text-sky-600 dark:text-sky-300"},le={class:"space-y-3"},oe={class:"space-y-1"},ie={class:"flex items-center gap-2"},de={class:"flex items-center gap-2 text-xs text-sky-700 dark:text-sky-300"},ue={key:2,class:"flex flex-col items-center justify-center py-8 text-center text-muted-foreground"},ce={class:"mt-1 max-w-md text-xs leading-5 text-muted-foreground"},me={key:3,class:"flex flex-col items-center justify-center py-8 text-center text-muted-foreground"},fe={key:4,class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},xe=["disabled","onClick"],ye={key:0,class:"absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center"},pe={class:"flex items-start gap-2 pr-8"},ve={class:"min-w-0 flex-1 text-sm font-medium leading-5"},he={key:1,class:"mt-2 text-xs text-primary"},ge={key:2,class:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg"},Be=O({__name:"Settings",setup(ke){const N=F(),g=m(!0),y=m(!1),k=m(null),_=m([]),u=m(null),j=m(!1),c=m(null);async function E({isLatest:o,reason:e}){var s,x,p,v;g.value=!0,o()&&(c.value=null);try{const r=await B.getMyInfo(),h=!!r.is_bound,b=r.channel_group_id||null,w=h?[]:await B.getMyChannelGroups();if(!o())return;j.value=h,u.value=b,_.value=w}catch(r){o()&&(c.value=((x=(s=r==null?void 0:r.response)==null?void 0:s.data)==null?void 0:x.message)||((v=(p=r==null?void 0:r.response)==null?void 0:p.data)==null?void 0:v.error)||(r==null?void 0:r.message)||"加载渠道分组失败",e!=="switch-channel-group"&&C.error("加载渠道分组失败"))}finally{o()&&(g.value=!1)}}const{reload:L}=Q(E,{resetBeforeLoad:()=>{g.value=!0,_.value=[],u.value=null,j.value=!1,c.value=null}});async function P(o){var x,p,v,r,h,b,w,S;if(o.id===u.value||y.value)return;y.value=!0,k.value=o.id;const e=u.value;u.value=o.id;try{await B.switchChannelGroup(o.id)}catch(t){u.value=e;const D=((p=(x=t==null?void 0:t.response)==null?void 0:x.data)==null?void 0:p.message)||((r=(v=t==null?void 0:t.response)==null?void 0:v.data)==null?void 0:r.error)||(t==null?void 0:t.message)||"切换渠道分组失败";C.error(D),y.value=!1,k.value=null;return}let s="";try{await N.fetchInfo()||(s=N.error||"刷新当前 Key 信息失败")}catch(t){s=((b=(h=t==null?void 0:t.response)==null?void 0:h.data)==null?void 0:b.message)||((S=(w=t==null?void 0:t.response)==null?void 0:w.data)==null?void 0:S.error)||(t==null?void 0:t.message)||"刷新当前 Key 信息失败"}s||(await L("switch-channel-group"),c.value&&(s=c.value)),s?C.error(`已切换到「${o.name}」,但刷新状态失败:${s}`):C.success(`已切换到「${o.name}」`),y.value=!1,k.value=null}return(o,e)=>(i(),d("div",te,[e[10]||(e[10]=a("div",{class:"space-y-1"},[a("h1",{class:"text-2xl font-semibold tracking-tight"},"设置"),a("p",{class:"text-sm text-muted-foreground"},"管理您的 API 请求路由和偏好设置")],-1)),l(n(R),{class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:f(()=>[l(n(U),null,{default:f(()=>[l(n(q),{class:"flex items-center gap-2"},{default:f(()=>[l(n(G),{class:"h-5 w-5"}),e[0]||(e[0]=I(" 渠道分组 ",-1))]),_:1}),l(n(H),null,{default:f(()=>[...e[1]||(e[1]=[I(" 选择您的 API 请求路由分组,不同分组使用不同的线路 ",-1)])]),_:1})]),_:1}),l(n(K),null,{default:f(()=>[g.value?(i(),d("div",se,[l(n(A),{class:"h-6 w-6 animate-spin text-muted-foreground"})])):j.value?(i(),d("div",ae,[a("div",re,[a("div",ne,[l(n(T),{class:"h-5 w-5"})]),a("div",le,[a("div",oe,[a("div",ie,[e[3]||(e[3]=a("p",{class:"font-medium text-foreground"},"当前为绑定子卡",-1)),l(n(M),{variant:"outline",class:"border-sky-200 bg-white/80 text-sky-700 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-300"},{default:f(()=>[...e[2]||(e[2]=[I(" 跟随主卡 ",-1)])]),_:1})]),e[4]||(e[4]=a("p",{class:"leading-6 text-muted-foreground"}," 该卡已绑定到主卡,请求路由会跟随主卡的渠道分组。解绑后,此卡才可单独切换渠道分组。 ",-1))]),a("div",de,[l(n(J),{class:"h-3.5 w-3.5"}),e[5]||(e[5]=a("span",null,"当前不提供子卡独立切换入口,避免与实际路由行为不一致。",-1))])])])])):c.value?(i(),d("div",ue,[l(n(G),{class:"h-10 w-10 mb-2 opacity-50"}),e[6]||(e[6]=a("p",{class:"text-sm font-medium text-foreground/80"}," 渠道分组加载失败 ",-1)),a("p",ce,V(c.value),1)])):_.value.length===0?(i(),d("div",me,[l(n(G),{class:"h-10 w-10 mb-2 opacity-50"}),e[7]||(e[7]=a("p",{class:"text-sm font-medium text-foreground/80"}," 当前暂无可用渠道分组配置 ",-1)),e[8]||(e[8]=a("p",{class:"mt-1 max-w-md text-xs leading-5 text-muted-foreground"}," 当存在匹配当前服务与子服务类型的启用分组时,您可以在这里切换请求线路。 ",-1))])):(i(),d("div",fe,[(i(!0),d(W,null,X(_.value,s=>(i(),d("button",{key:s.id,disabled:y.value,class:Y(["relative p-4 rounded-lg border-2 text-left transition-all",[s.id===u.value?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/50"]]),onClick:x=>P(s)},[s.id===u.value?(i(),d("div",ye,[l(n(ee),{class:"h-3 w-3 text-primary-foreground"})])):$("",!0),a("div",pe,[a("div",ve,V(s.name),1),s.is_default?(i(),Z(n(M),{key:0,variant:"outline",class:"shrink-0 whitespace-nowrap text-[10px] border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400"},{default:f(()=>[...e[9]||(e[9]=[I(" 默认 ",-1)])]),_:1})):$("",!0)]),s.id===u.value?(i(),d("p",he," 当前使用中 ")):$("",!0),k.value===s.id?(i(),d("div",ge,[l(n(A),{class:"h-5 w-5 animate-spin"})])):$("",!0)],10,xe))),128))]))]),_:1})]),_:1})]))}});export{Be as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as Le,r as Pt,ak as Ot,al as At,d as Tt,P as xe,f as be,h as oe,am as St,an as at,e as Rt,ao as Dt,k as Ke,D as qt,R as Bt,y as Me,l as kt,T as Et,j as Lt,ap as Mt,O as $t,Q as Ft}from"./index-Da98HOxL.js";import{d as P,r as D,s as Nt,w as me,g as Ht,o as Wt,a0 as se,u as w,v as Re,L as $e,j as M,D as N,y as L,E as R,G as k,aM as lt,a9 as zt,x as Vt,H as fe,C as Q,I as It,c as jt,P as Kt,Q as Xt,_ as Yt,N as Gt,O as Fe,Y as ct,aN as Ut,p as Xe,a2 as Qt,f as Ye}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const No=Le("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ho=Le("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
12
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Wo=Le("SquareTerminalIcon",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Zt=["top","right","bottom","left"],te=Math.min,W=Math.max,ye=Math.round,ge=Math.floor,Y=e=>({x:e,y:e}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"},en={start:"end",end:"start"};function De(e,t,n){return W(e,te(t,n))}function Z(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function Ne(e){return e==="x"?"y":"x"}function He(e){return e==="y"?"height":"width"}const tn=new Set(["top","bottom"]);function X(e){return tn.has(J(e))?"y":"x"}function We(e){return Ne(X(e))}function nn(e,t,n){n===void 0&&(n=!1);const o=ue(e),r=We(e),s=He(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ve(i)),[i,ve(i)]}function on(e){const t=ve(e);return[qe(e),t,qe(t)]}function qe(e){return e.replace(/start|end/g,t=>en[t])}const Ge=["left","right"],Ue=["right","left"],rn=["top","bottom"],sn=["bottom","top"];function an(e,t,n){switch(e){case"top":case"bottom":return n?t?Ue:Ge:t?Ge:Ue;case"left":case"right":return t?rn:sn;default:return[]}}function ln(e,t,n,o){const r=ue(e);let s=an(J(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(qe)))),s}function ve(e){return e.replace(/left|right|bottom|top/g,t=>Jt[t])}function cn(e){return{top:0,right:0,bottom:0,left:0,...e}}function ut(e){return typeof e!="number"?cn(e):{top:e,right:e,bottom:e,left:e}}function we(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Qe(e,t,n){let{reference:o,floating:r}=e;const s=X(t),i=We(t),l=He(i),u=J(t),f=s==="y",a=o.x+o.width/2-r.width/2,c=o.y+o.height/2-r.height/2,p=o[l]/2-r[l]/2;let d;switch(u){case"top":d={x:a,y:o.y-r.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:c};break;case"left":d={x:o.x-r.width,y:c};break;default:d={x:o.x,y:o.y}}switch(ue(t)){case"start":d[i]-=p*(n&&f?-1:1);break;case"end":d[i]+=p*(n&&f?-1:1);break}return d}const un=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:a,y:c}=Qe(f,o,u),p=o,d={},h=0;for(let m=0;m<l.length;m++){const{name:g,fn:y}=l[m],{x:v,y:x,data:_,reset:b}=await y({x:a,y:c,initialPlacement:o,placement:p,strategy:r,middlewareData:d,rects:f,platform:i,elements:{reference:e,floating:t}});a=v??a,c=x??c,d={...d,[g]:{...d[g],..._}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(f=b.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:a,y:c}=Qe(f,p,u)),m=-1)}return{x:a,y:c,placement:p,strategy:r,middlewareData:d}};async function de(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:a="viewport",elementContext:c="floating",altBoundary:p=!1,padding:d=0}=Z(t,e),h=ut(d),g=l[p?c==="floating"?"reference":"floating":c],y=we(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:a,strategy:u})),v=c==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),_=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},b=we(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:u}):v);return{top:(y.top-b.top+h.top)/_.y,bottom:(b.bottom-y.bottom+h.bottom)/_.y,left:(y.left-b.left+h.left)/_.x,right:(b.right-y.right+h.right)/_.x}}const fn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:l,middlewareData:u}=t,{element:f,padding:a=0}=Z(e,t)||{};if(f==null)return{};const c=ut(a),p={x:n,y:o},d=We(r),h=He(d),m=await i.getDimensions(f),g=d==="y",y=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",_=s.reference[h]+s.reference[d]-p[d]-s.floating[h],b=p[d]-s.reference[d],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let C=S?S[x]:0;(!C||!await(i.isElement==null?void 0:i.isElement(S)))&&(C=l.floating[x]||s.floating[h]);const A=_/2-b/2,q=C/2-m[h]/2-1,$=te(c[y],q),K=te(c[v],q),O=$,E=C-m[h]-K,T=C/2-m[h]/2+A,V=De(O,T,E),F=!u.arrow&&ue(r)!=null&&T!==V&&s.reference[h]/2-(T<O?$:K)-m[h]/2<0,H=F?T<O?T-O:T-E:0;return{[d]:p[d]+H,data:{[d]:V,centerOffset:T-V-H,...F&&{alignmentOffset:H}},reset:F}}}),dn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:u,elements:f}=t,{mainAxis:a=!0,crossAxis:c=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Z(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=J(r),v=X(l),x=J(l)===l,_=await(u.isRTL==null?void 0:u.isRTL(f.floating)),b=p||(x||!m?[ve(l)]:on(l)),S=h!=="none";!p&&S&&b.push(...ln(l,m,h,_));const C=[l,...b],A=await de(t,g),q=[];let $=((o=s.flip)==null?void 0:o.overflows)||[];if(a&&q.push(A[y]),c){const T=nn(r,i,_);q.push(A[T[0]],A[T[1]])}if($=[...$,{placement:r,overflows:q}],!q.every(T=>T<=0)){var K,O;const T=(((K=s.flip)==null?void 0:K.index)||0)+1,V=C[T];if(V&&(!(c==="alignment"?v!==X(V):!1)||$.every(B=>X(B.placement)===v?B.overflows[0]>0:!0)))return{data:{index:T,overflows:$},reset:{placement:V}};let F=(O=$.filter(H=>H.overflows[0]<=0).sort((H,B)=>H.overflows[1]-B.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(d){case"bestFit":{var E;const H=(E=$.filter(B=>{if(S){const ee=X(B.placement);return ee===v||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,_t)=>ee+_t,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:E[0];H&&(F=H);break}case"initialPlacement":F=l;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function Ze(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Je(e){return Zt.some(t=>e[t]>=0)}const pn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Z(e,t);switch(o){case"referenceHidden":{const s=await de(t,{...r,elementContext:"reference"}),i=Ze(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Je(i)}}}case"escaped":{const s=await de(t,{...r,altBoundary:!0}),i=Ze(s,n.floating);return{data:{escapedOffsets:i,escaped:Je(i)}}}default:return{}}}}},ft=new Set(["left","top"]);async function hn(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=J(n),l=ue(n),u=X(n)==="y",f=ft.has(i)?-1:1,a=s&&u?-1:1,c=Z(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return l&&typeof h=="number"&&(d=l==="end"?h*-1:h),u?{x:d*a,y:p*f}:{x:p*f,y:d*a}}const gn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:l}=t,u=await hn(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},mn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...u}=Z(e,t),f={x:n,y:o},a=await de(t,u),c=X(J(r)),p=Ne(c);let d=f[p],h=f[c];if(s){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=d+a[g],x=d-a[y];d=De(v,d,x)}if(i){const g=c==="y"?"top":"left",y=c==="y"?"bottom":"right",v=h+a[g],x=h-a[y];h=De(v,h,x)}const m=l.fn({...t,[p]:d,[c]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[p]:s,[c]:i}}}}}},yn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=Z(e,t),a={x:n,y:o},c=X(r),p=Ne(c);let d=a[p],h=a[c];const m=Z(l,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const x=p==="y"?"height":"width",_=s.reference[p]-s.floating[x]+g.mainAxis,b=s.reference[p]+s.reference[x]-g.mainAxis;d<_?d=_:d>b&&(d=b)}if(f){var y,v;const x=p==="y"?"width":"height",_=ft.has(J(r)),b=s.reference[c]-s.floating[x]+(_&&((y=i.offset)==null?void 0:y[c])||0)+(_?0:g.crossAxis),S=s.reference[c]+s.reference[x]+(_?0:((v=i.offset)==null?void 0:v[c])||0)-(_?g.crossAxis:0);h<b?h=b:h>S&&(h=S)}return{[p]:d,[c]:h}}}},vn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:u=()=>{},...f}=Z(e,t),a=await de(t,f),c=J(r),p=ue(r),d=X(r)==="y",{width:h,height:m}=s.floating;let g,y;c==="top"||c==="bottom"?(g=c,y=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=c,g=p==="end"?"top":"bottom");const v=m-a.top-a.bottom,x=h-a.left-a.right,_=te(m-a[g],v),b=te(h-a[y],x),S=!t.middlewareData.shift;let C=_,A=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=v),S&&!p){const $=W(a.left,0),K=W(a.right,0),O=W(a.top,0),E=W(a.bottom,0);d?A=h-2*($!==0||K!==0?$+K:W(a.left,a.right)):C=m-2*(O!==0||E!==0?O+E:W(a.top,a.bottom))}await u({...t,availableWidth:A,availableHeight:C});const q=await i.getDimensions(l.floating);return h!==q.width||m!==q.height?{reset:{rects:!0}}:{}}}};function Ce(){return typeof window<"u"}function ie(e){return ze(e)?(e.nodeName||"").toLowerCase():"#document"}function z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){var t;return(t=(ze(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ze(e){return Ce()?e instanceof Node||e instanceof z(e).Node:!1}function I(e){return Ce()?e instanceof Element||e instanceof z(e).Element:!1}function G(e){return Ce()?e instanceof HTMLElement||e instanceof z(e).HTMLElement:!1}function et(e){return!Ce()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof z(e).ShadowRoot}const wn=new Set(["inline","contents"]);function he(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!wn.has(r)}const xn=new Set(["table","td","th"]);function bn(e){return xn.has(ie(e))}const Cn=[":popover-open",":modal"];function _e(e){return Cn.some(t=>{try{return e.matches(t)}catch{return!1}})}const _n=["transform","translate","scale","rotate","perspective"],Pn=["transform","translate","scale","rotate","perspective","filter"],On=["paint","layout","strict","content"];function Ve(e){const t=Ie(),n=I(e)?j(e):e;return _n.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Pn.some(o=>(n.willChange||"").includes(o))||On.some(o=>(n.contain||"").includes(o))}function An(e){let t=ne(e);for(;G(t)&&!ce(t);){if(Ve(t))return t;if(_e(t))return null;t=ne(t)}return null}function Ie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tn=new Set(["html","body","#document"]);function ce(e){return Tn.has(ie(e))}function j(e){return z(e).getComputedStyle(e)}function Pe(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(ie(e)==="html")return e;const t=e.assignedSlot||e.parentNode||et(e)&&e.host||U(e);return et(t)?t.host:t}function dt(e){const t=ne(e);return ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&he(t)?t:dt(t)}function pe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=dt(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=z(r);if(s){const l=Be(i);return t.concat(i,i.visualViewport||[],he(r)?r:[],l&&n?pe(l):[])}return t.concat(r,pe(r,[],n))}function Be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pt(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=G(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=ye(n)!==s||ye(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function je(e){return I(e)?e:e.contextElement}function le(e){const t=je(e);if(!G(t))return Y(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=pt(t);let i=(s?ye(n.width):n.width)/o,l=(s?ye(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Sn=Y(0);function ht(e){const t=z(e);return!Ie()||!t.visualViewport?Sn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==z(e)?!1:t}function re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=je(e);let i=Y(1);t&&(o?I(o)&&(i=le(o)):i=le(e));const l=Rn(s,n,o)?ht(s):Y(0);let u=(r.left+l.x)/i.x,f=(r.top+l.y)/i.y,a=r.width/i.x,c=r.height/i.y;if(s){const p=z(s),d=o&&I(o)?z(o):o;let h=p,m=Be(h);for(;m&&o&&d!==h;){const g=le(m),y=m.getBoundingClientRect(),v=j(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,_=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;u*=g.x,f*=g.y,a*=g.x,c*=g.y,u+=x,f+=_,h=z(m),m=Be(h)}}return we({width:a,height:c,x:u,y:f})}function Oe(e,t){const n=Pe(e).scrollLeft;return t?t.left+n:re(U(e)).left+n}function gt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Oe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Dn(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=U(o),l=t?_e(t.floating):!1;if(o===i||l&&s)return n;let u={scrollLeft:0,scrollTop:0},f=Y(1);const a=Y(0),c=G(o);if((c||!c&&!s)&&((ie(o)!=="body"||he(i))&&(u=Pe(o)),G(o))){const d=re(o);f=le(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const p=i&&!c&&!s?gt(i,u):Y(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+a.x+p.x,y:n.y*f.y-u.scrollTop*f.y+a.y+p.y}}function qn(e){return Array.from(e.getClientRects())}function Bn(e){const t=U(e),n=Pe(e),o=e.ownerDocument.body,r=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Oe(e);const l=-n.scrollTop;return j(o).direction==="rtl"&&(i+=W(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const tt=25;function kn(e,t){const n=z(e),o=U(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,u=0;if(r){s=r.width,i=r.height;const a=Ie();(!a||a&&t==="fixed")&&(l=r.offsetLeft,u=r.offsetTop)}const f=Oe(o);if(f<=0){const a=o.ownerDocument,c=a.body,p=getComputedStyle(c),d=a.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(o.clientWidth-c.clientWidth-d);h<=tt&&(s-=h)}else f<=tt&&(s+=f);return{width:s,height:i,x:l,y:u}}const En=new Set(["absolute","fixed"]);function Ln(e,t){const n=re(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=G(e)?le(e):Y(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,u=r*s.x,f=o*s.y;return{width:i,height:l,x:u,y:f}}function nt(e,t,n){let o;if(t==="viewport")o=kn(e,n);else if(t==="document")o=Bn(U(e));else if(I(t))o=Ln(t,n);else{const r=ht(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return we(o)}function mt(e,t){const n=ne(e);return n===t||!I(n)||ce(n)?!1:j(n).position==="fixed"||mt(n,t)}function Mn(e,t){const n=t.get(e);if(n)return n;let o=pe(e,[],!1).filter(l=>I(l)&&ie(l)!=="body"),r=null;const s=j(e).position==="fixed";let i=s?ne(e):e;for(;I(i)&&!ce(i);){const l=j(i),u=Ve(i);!u&&l.position==="fixed"&&(r=null),(s?!u&&!r:!u&&l.position==="static"&&!!r&&En.has(r.position)||he(i)&&!u&&mt(e,i))?o=o.filter(a=>a!==i):r=l,i=ne(i)}return t.set(e,o),o}function $n(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?_e(t)?[]:Mn(t,this._c):[].concat(n),o],l=i[0],u=i.reduce((f,a)=>{const c=nt(t,a,r);return f.top=W(c.top,f.top),f.right=te(c.right,f.right),f.bottom=te(c.bottom,f.bottom),f.left=W(c.left,f.left),f},nt(t,l,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Fn(e){const{width:t,height:n}=pt(e);return{width:t,height:n}}function Nn(e,t,n){const o=G(t),r=U(t),s=n==="fixed",i=re(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Y(0);function f(){u.x=Oe(r)}if(o||!o&&!s)if((ie(t)!=="body"||he(r))&&(l=Pe(t)),o){const d=re(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else r&&f();s&&!o&&r&&f();const a=r&&!o&&!s?gt(r,l):Y(0),c=i.left+l.scrollLeft-u.x-a.x,p=i.top+l.scrollTop-u.y-a.y;return{x:c,y:p,width:i.width,height:i.height}}function Se(e){return j(e).position==="static"}function ot(e,t){if(!G(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){const n=z(e);if(_e(e))return n;if(!G(e)){let r=ne(e);for(;r&&!ce(r);){if(I(r)&&!Se(r))return r;r=ne(r)}return n}let o=ot(e,t);for(;o&&bn(o)&&Se(o);)o=ot(o,t);return o&&ce(o)&&Se(o)&&!Ve(o)?n:o||An(e)||n}const Hn=async function(e){const t=this.getOffsetParent||yt,n=this.getDimensions,o=await n(e.floating);return{reference:Nn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(e){return j(e).direction==="rtl"}const zn={convertOffsetParentRelativeRectToViewportRelativeRect:Dn,getDocumentElement:U,getClippingRect:$n,getOffsetParent:yt,getElementRects:Hn,getClientRects:qn,getDimensions:Fn,getScale:le,isElement:I,isRTL:Wn};function vt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vn(e,t){let n=null,o;const r=U(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const f=e.getBoundingClientRect(),{left:a,top:c,width:p,height:d}=f;if(l||t(),!p||!d)return;const h=ge(c),m=ge(r.clientWidth-(a+p)),g=ge(r.clientHeight-(c+d)),y=ge(a),x={rootMargin:-h+"px "+-m+"px "+-g+"px "+-y+"px",threshold:W(0,te(1,u))||1};let _=!0;function b(S){const C=S[0].intersectionRatio;if(C!==u){if(!_)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!vt(f,e.getBoundingClientRect())&&i(),_=!1}try{n=new IntersectionObserver(b,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(e)}return i(!0),s}function In(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,f=je(e),a=r||s?[...f?pe(f):[],...pe(t)]:[];a.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const c=f&&l?Vn(f,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(t)})),n()}),f&&!u&&d.observe(f),d.observe(t));let h,m=u?re(e):null;u&&g();function g(){const y=re(e);m&&!vt(m,y)&&n(),m=y,h=requestAnimationFrame(g)}return n(),()=>{var y;a.forEach(v=>{r&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),c==null||c(),(y=d)==null||y.disconnect(),d=null,u&&cancelAnimationFrame(h)}}const jn=gn,Kn=mn,rt=dn,Xn=vn,Yn=pn,Gn=fn,Un=yn,Qn=(e,t,n)=>{const o=new Map,r={platform:zn,...n},s={...r.platform,_c:o};return un(e,t,{...r,platform:s})};function Zn(e){return e!=null&&typeof e=="object"&&"$el"in e}function ke(e){if(Zn(e)){const t=e.$el;return ze(t)&&ie(t)==="#comment"?null:t}return e}function ae(e){return typeof e=="function"?e():w(e)}function Jn(e){return{name:"arrow",options:e,fn(t){const n=ke(ae(e.element));return n==null?{}:Gn({element:n,padding:e.padding}).fn(t)}}}function wt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const n=wt(e);return Math.round(t*n)/n}function eo(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=P(()=>{var C;return(C=ae(n.open))!=null?C:!0}),s=P(()=>ae(n.middleware)),i=P(()=>{var C;return(C=ae(n.placement))!=null?C:"bottom"}),l=P(()=>{var C;return(C=ae(n.strategy))!=null?C:"absolute"}),u=P(()=>{var C;return(C=ae(n.transform))!=null?C:!0}),f=P(()=>ke(e.value)),a=P(()=>ke(t.value)),c=D(0),p=D(0),d=D(l.value),h=D(i.value),m=Nt({}),g=D(!1),y=P(()=>{const C={position:d.value,left:"0",top:"0"};if(!a.value)return C;const A=it(a.value,c.value),q=it(a.value,p.value);return u.value?{...C,transform:"translate("+A+"px, "+q+"px)",...wt(a.value)>=1.5&&{willChange:"transform"}}:{position:d.value,left:A+"px",top:q+"px"}});let v;function x(){if(f.value==null||a.value==null)return;const C=r.value;Qn(f.value,a.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(A=>{c.value=A.x,p.value=A.y,d.value=A.strategy,h.value=A.placement,m.value=A.middlewareData,g.value=C!==!1})}function _(){typeof v=="function"&&(v(),v=void 0)}function b(){if(_(),o===void 0){x();return}if(f.value!=null&&a.value!=null){v=o(f.value,a.value,x);return}}function S(){r.value||(g.value=!1)}return me([s,i,l,r],x,{flush:"sync"}),me([f,a],b,{flush:"sync"}),me(r,S,{flush:"sync"}),Ht()&&Wt(_),{x:se(c),y:se(p),strategy:se(d),placement:se(h),middlewareData:se(m),isPositioned:se(g),floatingStyles:y,update:x}}function to(e,t){const n=Pt(!1,300);At(()=>{n.value=!1});const o=D(null),r=Ot();function s(){o.value=null,n.value=!1}function i(l,u){const f=l.currentTarget,a={x:l.clientX,y:l.clientY},c=no(a,f.getBoundingClientRect()),p=oo(a,c,1),d=ro(u.getBoundingClientRect()),h=so([...p,...d]);o.value=h,n.value=!0}return Re(l=>{if(e.value&&t.value){const u=a=>i(a,t.value),f=a=>i(a,e.value);e.value.addEventListener("pointerleave",u),t.value.addEventListener("pointerleave",f),l(()=>{var a,c;(a=e.value)==null||a.removeEventListener("pointerleave",u),(c=t.value)==null||c.removeEventListener("pointerleave",f)})}}),Re(l=>{var u;if(o.value){const f=a=>{var g,y;if(!o.value||!(a.target instanceof Element))return;const c=a.target,p={x:a.clientX,y:a.clientY},d=((g=e.value)==null?void 0:g.contains(c))||((y=t.value)==null?void 0:y.contains(c)),h=!io(p,o.value),m=!!c.closest("[data-grace-area-trigger]");d?s():(h||m)&&(s(),r.trigger())};(u=e.value)==null||u.ownerDocument.addEventListener("pointermove",f),l(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",f)})}}),{isPointerInTransit:n,onPointerExit:r.on}}function no(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function oo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function ro(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function io(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s].x,u=t[s].y,f=t[i].x,a=t[i].y;u>o!=a>o&&n<(f-l)*(o-u)/(a-u)+l&&(r=!r)}return r}function so(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),ao(t)}function ao(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function lo(e){const t=D(),n=P(()=>{var r;return((r=t.value)==null?void 0:r.width)??0}),o=P(()=>{var r;return((r=t.value)==null?void 0:r.height)??0});return $e(()=>{const r=Tt(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let u,f;if("borderBoxSize"in l){const a=l.borderBoxSize,c=Array.isArray(a)?a[0]:a;u=c.inlineSize,f=c.blockSize}else u=r.offsetWidth,f=r.offsetHeight;t.value={width:u,height:f}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else t.value=void 0}),{width:n,height:o}}var co=M({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>(L(),N(w(xe),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:R(()=>[k(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),uo=co;const[xt,fo]=be("PopperRoot");var po=M({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=D();return fo({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>k(n.$slots,"default")}}),ho=po,go=M({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=oe(),r=xt();return lt(()=>{r.onAnchorChange(t.reference??o.value)}),(s,i)=>(L(),N(w(xe),{ref:w(n),as:s.as,"as-child":s.asChild},{default:R(()=>[k(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),mo=go;function yo(e){return e!==null}function vo(e){return{name:"transformOrigin",options:e,fn(t){var g,y,v;const{placement:n,rects:o,middlewareData:r}=t,i=((g=r.arrow)==null?void 0:g.centerOffset)!==0,l=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[f,a]=Ee(n),c={start:"0%",center:"50%",end:"100%"}[a],p=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,d=(((v=r.arrow)==null?void 0:v.y)??0)+u/2;let h="",m="";return f==="bottom"?(h=i?c:`${p}px`,m=`${-u}px`):f==="top"?(h=i?c:`${p}px`,m=`${o.floating.height+u}px`):f==="right"?(h=`${-u}px`,m=i?c:`${d}px`):f==="left"&&(h=`${o.floating.width+u}px`,m=i?c:`${d}px`),{data:{x:h,y:m}}}}}function Ee(e){const[t,n="center"]=e.split("-");return[t,n]}const wo={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[zo,xo]=be("PopperContent");var bo=M({inheritAttrs:!1,__name:"PopperContent",props:zt({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...wo}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=xt(),{forwardRef:s,currentElement:i}=oe(),l=D(),u=D(),{width:f,height:a}=lo(u),c=P(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=P(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),d=P(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=P(()=>({padding:p.value,boundary:d.value.filter(yo),altBoundary:d.value.length>0})),m=P(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=St(()=>[jn({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&rt({...h.value,...m.value}),n.avoidCollisions&&Kn({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Un():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&rt({...h.value,...m.value}),Xn({...h.value,apply:({elements:O,rects:E,availableWidth:T,availableHeight:V})=>{const{width:F,height:H}=E.reference,B=O.floating.style;B.setProperty("--reka-popper-available-width",`${T}px`),B.setProperty("--reka-popper-available-height",`${V}px`),B.setProperty("--reka-popper-anchor-width",`${F}px`),B.setProperty("--reka-popper-anchor-height",`${H}px`)}}),u.value&&Jn({element:u.value,padding:n.arrowPadding}),vo({arrowWidth:f.value,arrowHeight:a.value}),n.hideWhenDetached&&Yn({strategy:"referenceHidden",...h.value})]),y=P(()=>n.reference??r.anchor.value),{floatingStyles:v,placement:x,isPositioned:_,middlewareData:b}=eo(y,l,{strategy:n.positionStrategy,placement:c,whileElementsMounted:(...O)=>In(...O,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),S=P(()=>Ee(x.value)[0]),C=P(()=>Ee(x.value)[1]);lt(()=>{_.value&&o("placed")});const A=P(()=>{var E;const O=((E=b.value.arrow)==null?void 0:E.centerOffset)!==0;return n.hideShiftedArrow&&O}),q=D("");Re(()=>{i.value&&(q.value=window.getComputedStyle(i.value).zIndex)});const $=P(()=>{var O;return((O=b.value.arrow)==null?void 0:O.x)??0}),K=P(()=>{var O;return((O=b.value.arrow)==null?void 0:O.y)??0});return xo({placedSide:S,onArrowChange:O=>u.value=O,arrowX:$,arrowY:K,shouldHideArrow:A}),(O,E)=>{var T,V,F;return L(),Vt("div",{ref_key:"floatingRef",ref:l,"data-reka-popper-content-wrapper":"",style:It({...w(v),transform:w(_)?w(v).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q.value,"--reka-popper-transform-origin":[(T=w(b).transformOrigin)==null?void 0:T.x,(V=w(b).transformOrigin)==null?void 0:V.y].join(" "),...((F=w(b).hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[fe(w(xe),Q({ref:w(s)},O.$attrs,{"as-child":n.asChild,as:O.as,"data-side":S.value,"data-align":C.value,style:{animation:w(_)?void 0:"none"}}),{default:R(()=>[k(O.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),Co=bo;const[Ae,_o]=be("TooltipProvider");var Po=M({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:i,disabled:l,content:u}=jt(t);oe();const f=D(!0),a=D(!1),{start:c,stop:p}=at(()=>{f.value=!0},o,{immediate:!1});return _o({isOpenDelayed:f,delayDuration:n,onOpen(){p(),f.value=!1},onClose(){c()},isPointerInTransitRef:a,disableHoverableContent:r,disableClosingTrigger:s,disabled:l,ignoreNonKeyboardFocus:i,content:u}),(d,h)=>k(d.$slots,"default")}}),Oo=Po;const bt="tooltip.open",[Te,Ao]=be("TooltipRoot");var To=M({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;oe();const r=Ae(),s=P(()=>n.disableHoverableContent??r.disableHoverableContent.value),i=P(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),l=P(()=>n.disabled??r.disabled.value),u=P(()=>n.delayDuration??r.delayDuration.value),f=P(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),a=Rt(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});me(a,x=>{r.onClose&&(x?(r.onOpen(),document.dispatchEvent(new CustomEvent(bt))):r.onClose())});const c=D(!1),p=D(),d=P(()=>a.value?c.value?"delayed-open":"instant-open":"closed"),{start:h,stop:m}=at(()=>{c.value=!0,a.value=!0},u,{immediate:!1});function g(){m(),c.value=!1,a.value=!0}function y(){m(),a.value=!1}function v(){h()}return Ao({contentId:"",open:a,stateAttribute:d,trigger:p,onTriggerChange(x){p.value=x},onTriggerEnter(){r.isOpenDelayed.value?v():g()},onTriggerLeave(){s.value?y():m()},onOpen:g,onClose:y,disableHoverableContent:s,disableClosingTrigger:i,disabled:l,ignoreNonKeyboardFocus:f}),(x,_)=>(L(),N(w(ho),null,{default:R(()=>[k(x.$slots,"default",{open:w(a)})]),_:3}))}}),st=To,So=M({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Te(),s=Ae(),{forwardRef:i,currentElement:l}=oe(),u=P(()=>{var a;return n.ariaLabel||((a=l.value)==null?void 0:a.textContent)}),f=P(()=>{const{ariaLabel:a,...c}=n;return Dt(c,s.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return $e(()=>{Ke(window,"scroll",a=>{const c=a.target;c!=null&&c.contains(r.trigger.value)&&r.onClose()}),Ke(window,bt,r.onClose)}),(a,c)=>(L(),N(w(qt),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:c[1]||(c[1]=p=>{var d;w(r).disableClosingTrigger.value&&((d=w(r).trigger.value)!=null&&d.contains(p.target))&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:c[2]||(c[2]=Yt(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=p=>w(r).onClose())},{default:R(()=>[fe(w(Co),Q({ref:w(i),"data-state":w(r).stateAttribute.value},{...a.$attrs,...f.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:R(()=>[k(a.$slots,"default"),fe(w(uo),{id:w(r).contentId,role:"tooltip"},{default:R(()=>[Kt(Xt(u.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Ct=So,Ro=M({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=Bt(e),{forwardRef:o,currentElement:r}=oe(),{trigger:s,onClose:i}=Te(),l=Ae(),{isPointerInTransit:u,onPointerExit:f}=to(s,r);return l.isPointerInTransitRef=u,f(()=>{i()}),(a,c)=>(L(),N(Ct,Q({ref:w(o)},w(n)),{default:R(()=>[k(a.$slots,"default")]),_:3},16))}}),Do=Ro,qo=M({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Te(),s=Me(n,o),{forwardRef:i}=oe();return(l,u)=>(L(),N(w(kt),{present:l.forceMount||w(r).open.value},{default:R(()=>[(L(),N(Gt(w(r).disableHoverableContent.value?Ct:Do),Q({ref:w(i)},w(s)),{default:R(()=>[k(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Bo=qo,ko=M({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>(L(),N(w(Et),Fe(ct(t)),{default:R(()=>[k(n.$slots,"default")]),_:3},16))}}),Eo=ko,Lo=M({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=Te(),o=Ae();n.contentId||(n.contentId=Lt(void 0,"reka-tooltip-content"));const{forwardRef:r,currentElement:s}=oe(),i=D(!1),l=D(!1),u=P(()=>n.disabled.value?{}:{click:m,focus:d,pointermove:c,pointerleave:p,pointerdown:a,blur:h});$e(()=>{n.onTriggerChange(s.value)});function f(){setTimeout(()=>{i.value=!1},1)}function a(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),i.value=!0,document.addEventListener("pointerup",f,{once:!0})}function c(g){g.pointerType!=="touch"&&!l.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),l.value=!0)}function p(){n.onTriggerLeave(),l.value=!1}function d(g){var y,v;i.value||n.ignoreNonKeyboardFocus.value&&!((v=(y=g.target).matches)!=null&&v.call(y,":focus-visible"))||n.onOpen()}function h(){n.onClose()}function m(){n.disableClosingTrigger.value||n.onClose()}return(g,y)=>(L(),N(w(mo),{"as-child":"",reference:g.reference},{default:R(()=>[fe(w(xe),Q({ref:w(r),"aria-describedby":w(n).open.value?w(n).contentId:void 0,"data-state":w(n).stateAttribute.value,as:g.as,"as-child":t.asChild,"data-grace-area-trigger":""},Ut(u.value)),{default:R(()=>[k(g.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Mo=Lo;const Vo=M({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const r=Me(e,t),s=Mt("(hover: none)"),i=D(!1);function l(){i.value=!i.value}return Xe("tooltipToggle",l),Xe("isTouchDevice",Qt(s)),(u,f)=>w(s)?(L(),N(w(st),Q({key:0},w(r),{open:i.value,"onUpdate:open":f[0]||(f[0]=a=>i.value=a),"disable-closing-trigger":!0}),{default:R(()=>[k(u.$slots,"default")]),_:3},16,["open"])):(L(),N(w(st),Fe(Q({key:1},w(r))),{default:R(()=>[k(u.$slots,"default")]),_:3},16))}}),Io=M({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=$t(n,"class"),s=Me(r,o);return(i,l)=>(L(),N(w(Eo),null,{default:R(()=>[fe(w(Bo),Q({...w(s),...i.$attrs},{class:w(Ft)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-white animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:R(()=>[k(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),jo=M({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){const t=e;return(n,o)=>(L(),N(w(Oo),Fe(ct(t)),{default:R(()=>[k(n.$slots,"default")]),_:3},16))}}),Ko=M({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,n=Ye("tooltipToggle",()=>{}),o=Ye("isTouchDevice");function r(){o!=null&&o.value&&n()}return(s,i)=>(L(),N(w(Mo),Q(t,{onClick:r}),{default:R(()=>[k(s.$slots,"default")]),_:3},16))}});export{No as C,mo as P,Ho as S,jo as _,ho as a,Co as b,wo as c,Vo as d,Ko as e,Io as f,Wo as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dot-grid[data-v-699caeec]{background-image:radial-gradient(circle,rgba(255,255,255,.15) 1px,transparent 1px);background-size:24px 24px}.theme-transition{transition:background-color .3s ease,color .3s ease,border-color .3s ease!important}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as K,r as f,d as S,L as P,x as w,A as t,H as a,u as s,P as d,E as x,_ as C,D as n,y as o,F as I}from"./chart-vendor-CULJE59K.js";import{u as V,a as j,b as E,_ as g,K as N,L as $,A as B,t as L}from"./index-Da98HOxL.js";import{_ as v,E as M}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js";import{_ as h}from"./Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js";import{C as T,S as z,M as F,_ as R}from"./_plugin-vue_export-helper-5cjT4u0R.js";import{Z as U,S as _}from"./zap-l5zbZqrM.js";import{A as D}from"./activity-wYWtyqTJ.js";import{E as W}from"./eye-CY62vip0.js";const Z={class:"min-h-screen flex flex-col md:flex-row"},H={class:"relative w-full md:w-1/2 lg:w-[55%] bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 dark:from-gray-950 dark:via-slate-900 dark:to-gray-950 overflow-hidden flex flex-col justify-center py-12 px-6 md:py-16 md:px-10 lg:px-16"},O={class:"relative z-10 max-w-lg mx-auto md:mx-0 md:max-w-none"},q={class:"flex items-center gap-3 mb-8 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.1s"}},G={class:"w-10 h-10 rounded-xl bg-white/10 border border-white/20 flex items-center justify-center backdrop-blur-sm"},J={class:"hidden md:grid grid-cols-1 lg:grid-cols-3 gap-3 mb-10"},Q={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.4s"}},X={class:"w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center mb-3"},Y={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.5s"}},ee={class:"w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center mb-3"},te={class:"rounded-xl bg-white/[0.05] border border-white/[0.08] p-4 opacity-0 animate-scale-in [animation-fill-mode:forwards]",style:{"animation-delay":"0.6s"}},se={class:"w-8 h-8 rounded-lg bg-violet-500/20 flex items-center justify-center mb-3"},ae={class:"right-panel relative w-full md:w-1/2 lg:w-[45%] bg-background flex flex-col justify-center px-6 py-8 md:px-8 lg:px-12"},le={class:"absolute top-4 right-4 z-20"},oe={class:"w-full max-w-sm mx-auto opacity-0 animate-slide-in-right [animation-fill-mode:forwards]",style:{"animation-delay":"0.2s"}},ie={class:"space-y-2"},de={class:"relative"},ne=["disabled"],re={class:"space-y-2"},me={class:"mt-8 pt-6 border-t border-border"},ue={class:"flex items-center justify-center gap-2 text-xs text-muted-foreground"},fe=K({__name:"Welcome",setup(xe){const b=E(),r=V(),c=j(),m=f(""),p=f(""),l=f(!1),u=f(!1),y=S(()=>m.value.trim().length>0);P(()=>{r.hasKeys&&b.push({name:"dashboard"})});async function k(){if(!y.value)return;l.value=!0,r.clearError(),await r.addKey(m.value.trim(),p.value.trim())?b.push({name:"dashboard"}):L.error("验证失败",r.error||"请检查 API Key"),l.value=!1}return(A,e)=>(o(),w("div",Z,[t("div",H,[e[14]||(e[14]=t("div",{class:"absolute inset-0 dot-grid opacity-[0.03]"},null,-1)),e[15]||(e[15]=t("div",{class:"absolute top-[-10%] left-[-5%] w-[400px] h-[400px] bg-blue-500/10 rounded-full blur-3xl animate-float"},null,-1)),e[16]||(e[16]=t("div",{class:"absolute bottom-[-15%] right-[-10%] w-[350px] h-[350px] bg-indigo-500/10 rounded-full blur-3xl animate-float",style:{"animation-duration":"8s","animation-delay":"-2s"}},null,-1)),e[17]||(e[17]=t("div",{class:"absolute top-[40%] right-[20%] w-[250px] h-[250px] bg-cyan-500/8 rounded-full blur-3xl animate-float",style:{"animation-duration":"10s","animation-delay":"-4s"}},null,-1)),t("div",O,[t("div",q,[t("div",G,[a(s(T),{class:"w-5 h-5 text-white"})]),e[4]||(e[4]=t("span",{class:"text-xl font-semibold text-white tracking-wide"},"云驿",-1))]),e[11]||(e[11]=t("h1",{class:"text-3xl lg:text-5xl font-bold text-white leading-tight mb-4 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.2s"}},[d(" 智能 API 中转"),t("br"),d("监控与管理平台 ")],-1)),e[12]||(e[12]=t("p",{class:"text-base lg:text-lg text-white/60 mb-10 max-w-md opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.3s"}}," 为开发者提供高性能的 Claude API 代理服务,实时追踪用量与成本 ",-1)),t("div",J,[t("div",Q,[t("div",X,[a(s(U),{class:"w-4 h-4 text-blue-400"})]),e[5]||(e[5]=t("h3",{class:"text-sm font-medium text-white mb-1"},"极速转发",-1)),e[6]||(e[6]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"低延迟高吞吐的 API 代理服务",-1))]),t("div",Y,[t("div",ee,[a(s(D),{class:"w-4 h-4 text-emerald-400"})]),e[7]||(e[7]=t("h3",{class:"text-sm font-medium text-white mb-1"},"实时监控",-1)),e[8]||(e[8]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"Token 用量与成本实时追踪",-1))]),t("div",te,[t("div",se,[a(s(_),{class:"w-4 h-4 text-violet-400"})]),e[9]||(e[9]=t("h3",{class:"text-sm font-medium text-white mb-1"},"安全可靠",-1)),e[10]||(e[10]=t("p",{class:"text-xs text-white/40 leading-relaxed"},"自动重试与故障转移,服务永不中断",-1))])]),e[13]||(e[13]=t("div",{class:"hidden md:flex items-center gap-2 opacity-0 animate-slide-in-left [animation-fill-mode:forwards]",style:{"animation-delay":"0.7s"}},[t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"Claude API"),t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"Codex API"),t("span",{class:"px-3 py-1.5 rounded-full text-xs font-medium bg-white/[0.06] border border-white/[0.1] text-white/50"},"SSE Streaming")],-1))])]),t("div",ae,[t("div",le,[a(s(g),{variant:"ghost",size:"icon",class:"h-9 w-9 text-muted-foreground hover:text-foreground",onClick:e[0]||(e[0]=i=>s(c).toggleTheme()),title:"切换主题"},{default:x(()=>[s(c).isDark?(o(),n(s(z),{key:0,class:"h-4 w-4"})):(o(),n(s(F),{key:1,class:"h-4 w-4"}))]),_:1})]),t("div",oe,[e[22]||(e[22]=t("div",{class:"mb-8"},[t("h2",{class:"text-2xl font-bold text-foreground mb-2"},"开始使用"),t("p",{class:"text-sm text-muted-foreground"}," 输入您的 API Key 以访问使用量监控面板 ")],-1)),t("form",{onSubmit:C(k,["prevent"]),class:"space-y-5"},[t("div",ie,[a(s(h),{for:"apiKey",class:"flex items-center gap-2 text-sm font-medium"},{default:x(()=>[a(s(N),{class:"h-3.5 w-3.5 text-muted-foreground"}),e[18]||(e[18]=d(" API Key ",-1))]),_:1}),t("div",de,[a(s(v),{id:"apiKey",modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=i=>m.value=i),type:u.value?"text":"password",placeholder:"请输入您的 API Key",class:"pr-10 h-10",disabled:l.value,autocomplete:"off"},null,8,["modelValue","type","disabled"]),t("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:e[2]||(e[2]=i=>u.value=!u.value),disabled:l.value},[u.value?(o(),n(s(M),{key:1,class:"h-4 w-4"})):(o(),n(s(W),{key:0,class:"h-4 w-4"}))],8,ne)])]),t("div",re,[a(s(h),{for:"keyName",class:"text-sm font-medium"},{default:x(()=>[...e[19]||(e[19]=[d("自定义名称(选填)",-1)])]),_:1}),a(s(v),{id:"keyName",modelValue:p.value,"onUpdate:modelValue":e[3]||(e[3]=i=>p.value=i),placeholder:"例如:我的 Claude Key",class:"h-10",disabled:l.value},null,8,["modelValue","disabled"])]),a(s(g),{type:"submit",class:"w-full h-11 gap-2",disabled:l.value||!y.value},{default:x(()=>[l.value?(o(),n(s($),{key:0,class:"h-4 w-4 animate-spin"})):(o(),w(I,{key:1},[e[20]||(e[20]=d(" 开始使用 ",-1)),a(s(B),{class:"h-4 w-4"})],64))]),_:1},8,["disabled"])],32),t("div",me,[t("div",ue,[a(s(_),{class:"h-3.5 w-3.5"}),e[21]||(e[21]=t("span",null,"您的 API Key 仅存储在本地浏览器中",-1))])])])])]))}}),_e=R(fe,[["__scopeId","data-v-699caeec"]]);export{_e as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as t}from"./index-Da98HOxL.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const h=t("CloudIcon",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const s=t("MoonIcon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
12
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const d=t("SunIcon",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),k=(a,e)=>{const o=a.__vccOpts||a;for(const[c,n]of e)o[c]=n;return o};export{h as C,s as M,d as S,k as _};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as t}from"./index-Da98HOxL.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const a=t("ActivityIcon",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);export{a as A};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as D,aF as G,ay as H}from"./index-Da98HOxL.js";import{r as c,d as o}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ee=D("CalendarDaysIcon",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const te=D("MegaphoneIcon",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
|
|
12
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const ne=D("PinIcon",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),b="yunyi_user_announcement_state",f=2,K=20;let z=!1;function h(){return{version:f,readIds:[],tracked:{},snoozedUntilDate:null}}function q(e){return"content_html"in e}function O(e){return{id:e.id,title:e.title,intro:e.intro||"",isPinned:e.isPinned===!0,publishedAt:e.publishedAt||"",updatedAt:e.updatedAt||e.publishedAt||""}}function _(e){return"publishedAt"in e?O(e):{id:e.id,title:e.title,intro:e.intro||"",isPinned:e.is_pinned===!0,publishedAt:e.published_at,updatedAt:(q(e),e.updated_at)}}function Q(e,n){if(e.isPinned!==n.isPinned)return e.isPinned?-1:1;const a=new Date(n.publishedAt).getTime()-new Date(e.publishedAt).getTime();if(a!==0)return a;const r=new Date(n.updatedAt).getTime()-new Date(e.updatedAt).getTime();return r!==0?r:n.id.localeCompare(e.id)}function M(e){return[...e].sort(Q)}function U(){const e=new Date,n=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${n}-${a}-${r}`}function W(e){if(!e||typeof e!="object")return h();const n=e;if(n.version!==1&&n.version!==f)return h();const a=Object.fromEntries(Object.entries(n.tracked||{}).flatMap(([r,s])=>!s||!s.title?[]:[[r,O({...s,id:r})]]));return{version:f,readIds:Array.from(new Set((n.readIds||[]).filter(Boolean))),tracked:a,snoozedUntilDate:n.snoozedUntilDate||null}}const ae=G("announcement",()=>{const e=c(!1),n=c([]),a=c({}),r=c([]),s=c(null),v=c("");function y(){try{localStorage.setItem(b,JSON.stringify({version:f,readIds:n.value,tracked:a.value,snoozedUntilDate:s.value}))}catch{}}function m(t){n.value=t.readIds,a.value=t.tracked,s.value=t.snoozedUntilDate}function T(){try{const t=localStorage.getItem(b);if(!t){m(h());return}m(W(JSON.parse(t)))}catch{m(h())}}function C(t){t.key===b&&T()}function L(){z||(window.addEventListener("storage",C),z=!0)}function l(){e.value||(T(),L(),e.value=!0)}function A(t){if(t.length===0)return;const u={...a.value};let p=!1;t.forEach(Y=>{const i=_(Y),d=u[i.id];(!d||d.title!==i.title||d.intro!==i.intro||d.isPinned!==i.isPinned||d.publishedAt!==i.publishedAt||d.updatedAt!==i.updatedAt)&&(u[i.id]=i,p=!0)}),p&&(a.value=u,y())}async function R(){l();try{const t=await H.getList({limit:K}),u=M(t.items.map(p=>_(p)));return r.value=u,A(u),u}catch{return r.value}}function j(t,u){l(),t&&(u&&A([u]),!n.value.includes(t)&&(n.value=[...n.value,t],y()))}function x(t=I.value){v.value=t}function F(t=U()){l(),s.value=t,v.value=I.value,y()}function V(t){return k.value.has(t)}const k=o(()=>new Set(n.value)),E=o(()=>M(Object.values(a.value))),g=o(()=>E.value.filter(t=>!k.value.has(t.id))),S=o(()=>M(r.value.filter(t=>!k.value.has(t.id)))),N=o(()=>S.value.slice(0,5)),$=o(()=>g.value[0]||null),P=o(()=>g.value.length),B=o(()=>P.value>0),w=o(()=>s.value===U()),I=o(()=>S.value.map(t=>t.id).join("|")),J=o(()=>N.value.length===0||w.value?!1:v.value!==I.value);return{hydrated:e,recentItems:r,snoozedUntilDate:s,trackedItems:E,knownUnreadItems:g,recentUnreadItems:S,popupItems:N,latestUnreadItem:$,unreadCount:P,hasUnread:B,isSnoozedToday:w,shouldShowPopup:J,hydrate:l,refreshRecent:R,trackAnnouncements:A,markAsRead:j,dismissPopupOnce:x,dismissPopupForToday:F,isAnnouncementRead:V}});export{ee as C,te as M,ne as P,ae as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as e}from"./index-Da98HOxL.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const a=e("CalendarIcon",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);export{a as C};
|