1import{r as e,u as s,h as a,j as t}from"./vendor-react-DejgYtBM.js";import{U as l,S as i,u as r,G as n,H as d,J as c,A as o,s as m,K as x,E as u,M as h,N as g,O as j,P as p,Q as f,R as v,T as N,V as y,W as b,x as _,w,v as k,B as z,D as T,X as C}from"./index-BeIIFw6E.js";import{_ as S}from"./index-BOZr6JVI.js";import{m as I,A as O,i as W,T as $,a as q,f as U,S as P,E as B,I as E,b as K,j as M,q as R,l as A,r as L,B as D,F,p as Q,s as G,t as V,k as H,u as J,v as X,M as Z,w as Y,o as ee}from"./vendor-semi-D8d7bTtM.js";import{S as se,a as ae,b as te,c as le}from"./index-N09zZel9.js";import{T as ie}from"./index-KF7PEnkU.js";import{C as re}from"./Captcha-DqOlJ3BU.js";import{U as ne,S as de,d as ce,e as oe,f as me,c as xe,g as ue,G as he,h as ge,i as je,K as pe,L as fe,T as ve,j as Ne,k as ye,l as be,W as _e,m as we,n as ke,o as ze,B as Te}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./iconBase-SIM2SzwB.js";import"./captchaCrypto-qWW2iG_E.js";function Ce(){try{const e=localStorage.getItem("status");return e?JSON.parse(e):{}}catch{return{}}}const Se=()=>{const[Se,Ie]=e.useContext(l),[Oe,We]=e.useContext(i);let $e=s();const qe=a(),{t:Ue}=r();n();const Pe=d(),Be=(()=>{try{return new URLSearchParams(qe.search).get("tab")||"models"}catch{return"models"}})(),[Ee,Ke]=e.useState(Be);e.useEffect(()=>{try{const e=new URLSearchParams(qe.search).get("tab");e&&Ke(e)}catch{}},[qe.search]);const Me=Oe?.status?.enabled_personal_features,Re=null!=Me?Me.split(",").map(e=>e.trim()).filter(Boolean):null,Ae=null===Re||Re.includes("change_password"),Le=null===Re||Re.includes("delete_account"),De=Oe?.status?.personal_verify_enabled??!0,[Fe,Qe]=e.useState({wechat_verification_code:"",email_verification_code:"",email:"",phone:"",ph
1one_verification_code:"",self_account_deletion_confirmation:"",original_password:"",set_new_password:"",set_new_password_confirmation:""}),[Ge,Ve]=e.useState({}),[He,Je]=e.useState(!1),[Xe,Ze]=e.useState(!1),[Ye,es]=e.useState(!1),[ss,as]=e.useState(!1),[ts,ls]=e.useState(!1),[is,rs]=e.useState(60),[ns,ds]=e.useState(!1),[cs,os]=e.useState(!1),[ms,xs]=e.useState(!1),[us,hs]=e.useState(""),[gs,js]=e.useState(""),[ps,fs]=e.useState(!1),[vs,Ns]=e.useState(!1),[ys,bs]=e.useState(30),[_s,ws]=e.useState(""),[ks,zs]=e.useState([]),[Ts,Cs]=e.useState(()=>{const e=localStorage.getItem("modelsExpanded");return!!e&&JSON.parse(e)}),[Ss,Is]=e.useState("all"),[Os,Ws]=e.useState({warningType:"email",warningThreshold:1e5,webhookUrl:"",webhookSecret:"",notificationEmail:"",acceptUnsetModelRatioModel:!1,recordIpLog:!1,subscriptionOptions:["quota_push","sale_push","back_push","system_push","price_push","token_warning_push","token_exhaust_push"],tokenQuotaWarningPercent:20,wxpusherUid:"",wecomKey:"",dingtalkToken:"",dingtalkSecret:"",dingtalkAtMobiles:"",telegramBotToken:"",telegramChatId:"",feishuWebhookUrl:"",feishuSecret:""}),[$s,qs]=e.useState(!1),[Us,Ps]=e.useState(!1),[Bs,Es]=e.useState("initial"),[Ks,Ms]=e.useState(""),Rs=e.useRef(null),As=e.useRef(null),[Ls,Ds]=e.useState(!0),[Fs,Qs]=e.useState(!0),[Gs,Vs]=e.useState("notify"),[Hs,Js]=e.useState(null),[Xs,Zs]=e.useState(!1),[Ys,ea]=e.useState(!1),[sa,aa]=e.useState(""),[ta,la]=e.useState(null),[ia,ra]=e.useState(!1),[na,da]=e.useState(null),[ca,oa]=e.useState(!0),[ma,xa]=e.useState(!1),[ua,ha]=e.useState(!1);e.useEffect(()=>{if(!Se?.user?.id||!c())return;let e=!1;return(async()=>{xa(!0);try{const s=await o.get("/api/option/getagentoptions"),{success:a,message:t,data:l}=s.data;if(!a)return void m(t||Ue("å 载失败"));!e&&l&&oa(!1!==l.ticket_enabled)}catch(s){m(s.message||Ue("å 载失败"))}finally{e||xa(!1)}})(),()=>{e=!0}},[Se?.user?.id,Se?.user?.role,Ue]);const ga=async()=>{try{const e=await o.get("/api/option/getagentoptions"),{success:s,data:a}=e.data;s&&a&&oa(!1!==a.ticket_enabled)}catch{}};e.useEffect(()=>{const e=Oe?.status||Ce()||{};Ve(e),(Oe?.status?.turnstile_check||e.turnstile_check)&&(xs(!0),hs(Oe?.status?.turnstile_site_key||e.turnstile_site_key)),pa().then(e=>{}),fa().then(),va().then()},[Oe?.status]),e.useEffect(()=>{let e=null;return vs&&ys>0?e=setInterval(()=>{bs(ys-1)},1e3):0===ys&&(Ns(!1),bs(30)),()=>clearInterval(e)},[vs,ys]),e.useEffect(()=>{let e=null;return ts&&is>0?e=setInterval(()=>{rs(is-1)},1e3):0===is&&(ls(!1),rs(60)),()=>clearInterval(e)},[ts,is]),e.useEffect(()=>{if(Se?.user?.setting){const e=JSON.parse(Se.user.setting);Ws({warningType:e.notify_type||"email",warningThreshold:e.quota_
1warning_threshold||x(1),webhookUrl:e.webhook_url||"",webhookSecret:e.webhook_secret||"",notificationEmail:e.notification_email||"",acceptUnsetModelRatioModel:e.accept_unset_model_ratio_model||!1,recordIpLog:e.record_ip_log||!1,subscriptionOptions:e.subscription_options?e.subscription_options.split(","):["quota_push","sale_push","back_push","system_push","price_push","token_warning_push","token_exhaust_push"],tokenQuotaWarningPercent:e.token_quota_warning_percent||20,wxpusherUid:e.wxpusher_uid||"",wecomKey:e.wecom_key||"",dingtalkToken:e.dingtalk_token||"",dingtalkSecret:e.dingtalk_secret||"",dingtalkAtMobiles:e.dingtalk_at_mobiles||"",telegramBotToken:e.telegram_bot_token||"",telegramChatId:e.telegram_chat_id||"",feishuWebhookUrl:e.feishu_webhook_url||"",feishuSecret:e.feishu_secret||""}),e.wxpusher_uid?Ps(!0):Ps(!1)}},[Se?.user?.setting]),e.useEffect(()=>{localStorage.setItem("modelsExpanded",JSON.stringify(Ts))},[Ts]),e.useEffect(()=>()=>{Rs.current&&clearInterval(Rs.current),As.current&&clearTimeout(As.current)},[]);const ja=(e,s)=>{Qe(a=>({...a,[e]:s}))},pa=async()=>{let e=await o.get("/api/user/self");const{success:s,message:a,data:t}=e.data;s?(u(t),Ie({type:"login",payload:t})):m(a)},fa=async()=>{Ds(!0);try{let e=await o.get("/api/user/models");const{success:s,message:a,data:t}=e.data;s?null!=t&&zs(t):m(a)}catch(e){m(Ue("å 载模åå表失败"))}finally{Ds(!1)}},va=async()=>{Zs(!0);try{const e=await o.get("/api/identity_verify/status");e.data.success&&Js(e.data.data)}catch(e){console.error("è·å认è¯ç¶æå¤±è´¥:",e)}finally{Zs(!1)}},Na=async e=>{const s=e||"";Ns(!0),fs(!0);try{const e=[`email=${encodeURIComponent(Fe.email)}`,`turnstile=${encodeURIComponent(gs||"")}`];s&&e.push(`captcha_token=${encodeURIComponent(s)}`);const a=await o.get(`/api/verification?${e.join("&")}`),{success:t,message:l}=a.data;t?w(Ue("éªè¯ç åéæåï¼è¯·æ£æ¥é®ç®±ï¼")):(m(l),Ns(!1))}catch(a){m(a),Ns(!1)}finally{fs(!1)}},ya=e=>/^\+?[1-9]\d{1,14}$/.test(e),ba=()=>Se.user?Se.user.username:"null",_a=async e=>{await k(e)?w(Ue("å·²å¤å¶")+"ï¼"+e):Z.error({title:Ue("æ æ³å¤å¶å°åªè´´æ¿ï¼è¯·æå¨å¤å¶"),content:e})},wa=(e,s)=>{Ws(a=>({...a,[e]:s.target?void 0!==s.target.value?s.target.value:s.target.checked:s}))},ka=async(e="save")=>{try{const s=await o.put("/api/user/setting",{notify_type:Os.warningType,quota_warning_threshold:parseFloat(Os.warningThreshold),webhook_url:Os.webhookUrl,webhook_secret:Os.webhookSecret,notification_email:Os.notificationEmail,wxpusher_uid:Os.wxpusherUid,accept_unset_model_ratio_model:Os.acceptUnsetModelRatioModel,record_ip_log:Os.recordIpLog,subscription_options:Os.subscriptionOptions.join(","),token_quota_warning_percent:Os.tokenQuotaWarningPercent,wecom_key:Os.wecomKey,dingtalk_token:Os.dingtalkToken,dingtalk_secret:Os.dingtalkSecret,dingtalk_at_mobiles:Os.dingtalkAtMobiles,telegram_bot_token:Os.telegramBotToken,telegram_chat_id:Os.telegramChatId,feishu_webhook_url:Os.feishuWebhookUrl,feishu_secret:Os.feishuSecret});return"test"!==e&&(s.data.success?(w(Ue("设置ä¿åæå")),await pa()):m(s.data.message||Ue("设置ä¿å失败"))),{success:!!s.data.success,message:s.data.message}}catch(s){const a=s?.response?.data?.message;return"test"!==e&&m(a||Ue("设置ä¿å失败")),{success:!1,message:a}}},za=async()=>{if("initial"===Bs||"expired"===Bs){Es("loading");try{const e=await o.get("/api/push/wxpusher_qrcode"),{success:s,message:a,data:t}=e.data;s?(Ms(t.qrcode_url),Es("loaded"),Rs.current=setInterval(Ta,2e3),As.current=setTimeout(()=>{clearInterval(Rs.current),Es("expired")},6e4)):(m(a),Es("initial"))}catch(e){console.error("Error fetching QR code:",e),m(Ue("è·åäºç»´ç 失败")),Es("initial")}}},Ta=async()=>{try{const e=await o.get("/api/push/self"),{success:s,data:a}=e.data;s&&a.notice_receiver_uid&&(clearInterval(Rs.current),clearTimeout(As.current),Ps(!0),Es("initial"),w(Ue("ç»å®æåï¼")),await pa())}catch(e){console.error("Error checking bind status:",e)}},Ca=()=>{Z.confirm({title:Ue("确认解ç»"),content:Ue("æ¨ç¡®å®è¦è§£ç»WxPusheråï¼"),onOk:async()=>{try{const e=await o.post("/api/push/unbind_wxpusher"),{success:s,message:a}=e.data;s?(Ps(!1),Es("initial"),Ms(""),w(a),await pa()):m(a)}catch{m(Ue("è§£ç»å¤±è´¥"))}}})};return t.jsxs("div",{className:"bg-background",children:[t.jsx("div",{className:"flex justify-center",children:t.jsx("div",{className:"w-full",children:t.jsxs(I,{className:"!rounded-2xl shadow-lg border-0",children:[t.jsxs(I,{className:"!rounded-2xl !border-0 !shadow-lg overflow-hidden",style:{background:"dark"===Pe?"linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%)":"linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%)",position:"relative"},bodyStyle:{padding:0},children:[t.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[t.jsx("div",{className:"absolute -top-10 -right-10 w-40 h-40 bg-slate-400 dark:bg-slate-500 opacity-5 rounded-full"}),t.jsx("div",{className:"absolute -bottom-16 -left-16 w-48 h-48 bg-slate-300 dark:bg-slate-400 opacity-8 rounded-full"}),t.jsx("div",{className:"absolute top-1/2 right-1/4 w-24 h-24 bg-slate-400 dark:bg-slate-500 opacity-6 rounded-full"})]}),t.jsxs("div",{className:"relative p-4 sm:p-6 md:p-8 text-foreground
1/80",children:[t.jsxs("div",{className:"flex justify-between items-start mb-4 sm:mb-6",children:[t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(O,{size:"large",className:"mr-3 sm:mr-4 shadow-md flex-shrink-0 bg-primary",children:(()=>{const e=ba();return e&&e.length>0?e.slice(0,2).toUpperCase():"NA"})()}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-base sm:text-lg font-semibold truncate text-foreground cursor-pointer",onClick:()=>_a(ba()),title:Ue("ç¹å»å¤å¶"),children:ba()}),t.jsxs("div",{className:"mt-1 flex flex-wrap gap-1 sm:gap-2",children:[t.jsx(W,{size:"small",className:"!rounded-full bg-fill-subtle text-foreground",style:{fontWeight:"500"},children:Ue(h(Se?.user?.role))}),t.jsxs(W,{size:"small",className:"!rounded-full bg-fill-subtle text-foreground cursor-pointer",style:{fontWeight:"500"},onClick:()=>_a(String(Se?.user?.id)),title:Ue("ç¹å»å¤å¶"),children:["ID: ",Se?.user?.id]})]})]})]}),t.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-lg flex items-center justify-center shadow-md flex-shrink-0 ml-2 bg-primary",children:t.jsx(ne,{size:20,className:"text-white"})})]}),t.jsxs("div",{className:"mb-4 sm:mb-6",children:[t.jsx("div",{className:"text-xs sm:text-sm mb-1 sm:mb-2 text-muted-foreground",children:Ue("å½åä½é¢")}),t.jsx("div",{className:"text-2xl sm:text-3xl md:text-4xl font-bold tracking-wide text-foreground cursor-pointer",onClick:()=>_a(g(Se?.user?.quota)),title:Ue("ç¹å»å¤å¶"),children:g(Se?.user?.quota)})]}),t.jsx("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-end",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:flex sm:space-x-6 lg:space-x-8 mb-3 sm:mb-0",children:[t.jsxs("div",{className:"text-center sm:text-left",children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:Ue("å岿¶è")}),t.jsx("div",{className:"text-xs sm:text-sm font-medium truncate text-foreground/80 cursor-pointer",onClick:()=>_a(g(Se?.user?.used_quota)),title:Ue("ç¹å»å¤å¶"),children:g(Se?.user?.used_quota)})]}),t.jsxs("div",{className:"text-center sm:text-left",children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:Ue("è¯·æ±æ¬¡æ°")}),t.jsx("div",{className:"text-xs sm:text-sm font-medium truncate text-foreground/80 cursor-pointer",onClick:()=>_a(String(Se.user?.request_count||0)),title:Ue("ç¹å»å¤å¶"),children:Se.user?.request_count||0})]}),t.jsxs("div",{className:"text-center sm:text-left",children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:Ue("ç¨æ·åç»")}),t.jsx("div",{className:"text-xs sm:text-sm font-medium truncate text-foreground/80 cursor-pointer",onClick:()=>_a(Se?.user?.group||Ue("é»è®¤")),title:Ue("ç¹å»å¤å¶"),children:Se?.user?.group||Ue("é»è®¤")})]})]})}),t.jsx("div",{className:"absolute top-0 left-0 w-full h-2 bg-primary opacity-60"})]})]}),t.jsx("div",{className:"p-4",children:t.jsxs($,{type:"line",activeKey:Ee,onChange:Ke,className:"modern-tabs",children:[t.jsx(q,{tab:t.jsxs("div",{className:"flex items-center",children:[t.jsx(de,{size:16,className:"mr-2"}),Ue("å¯ç¨æ¨¡å")]}),itemKey:"models",children:t.jsx("div",{className:"gap-6 py-4",children:t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsxs("div",{className:"flex items-center mb-4",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-default flex items-center justify-center mr-3",children:t.jsx(de,{size:20,className:"text-foreground"})}),t.jsxs("div",{children:[t.jsx(U.Title,{heading:6,className:"mb-0",children:Ue("模åå表")}),t.jsx("div",{className:"text-muted-foreground text-sm",children:Ue("ç¹å»æ¨¡ååç§°å¯å¤å¶")})]})]}),Ls?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"mb-4",style:{borderBottom:"1px solid hsl(var(--border))"},children:t.jsx("div",{className:"flex overflow-x-auto py-2 gap-2",children:Array.from({length:8}).map((e,s)=>t.jsx(P.Button,{style:{width:0===s?130:100+50*Math.random(),height:36,borderRadius:8}},`cat-${s}`))})}),t.jsx("div",{className:"flex flex-wrap gap-2",children:Array.from({length:20}).map((e,s)=>t.jsx(P.Button,{style:{width:100+100*Math.random(),height:32,borderRadius:16,margin:"4px"}},`model-${s}`))})]}):0===ks.length?t.jsx("div",{className:"py-8",children:t.jsx(B,{image:t.jsx(K,{style:{width:150,height:150}}),darkModeImage:t.jsx(E,{style:{width:150,height:150}}),description:Ue("没æå¯ç¨æ¨¡å"),style:{padding:"24px 0"}})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mb-4",children:t.jsx($,{type:"card",activeKey:Ss,onChange:e=>Is(e),className:"mt-2",children:Object.entries(j(Ue)).map(([e,s])=>{const a="all"===e?ks.length:ks.filter(e=>s.filter({model_name:e})).length;return 0===a&&"all"!==e?null:t.jsx(q,{tab:t.jsxs("span",{className:"flex items-center gap-2",children:[s.icon&&t.jsx("span",{className:"w-4 h-4",children:s.icon}),s.label,t.jsx(W,{color:Ss===e?"red":"grey",size:"small",shape:"circle",children:a})]}),itemKey:e},e)})})}),t.jsx("div",{className:"bg-card rounded-lg p-3",children:(()=>{const e=j(Ue),s="all"===Ss?ks:ks.filter(s=>e[Ss].filter({model_name:s}));return 0===s.length?t.jsx(B,{image:t.jsx(K,{style:{width:120,height:120}}),darkModeImage:t.jsx(E,{style:{width:120,height:120}}),description:Ue("该åç±»ä¸æ²¡æå¯ç¨æ¨¡å"),style:{padding:"16px 0"}}):s.length<=25?t.jsx(M,{wrap:!0,children:s.map(e=>p(e,{size:"large",shape:"circle",onClick:()=>_a(e)}))}):t.jsxs(t.Fragment,{children:[t.jsx(R,{isOpen:Ts,children:t.jsxs(M,{wrap:!0,children:[s.map(e=>p(e,{size:"large",shape:"circle",onClick:()=>_a(e)})),t.jsx(W,{color:"grey",type:"light",className:"cursor-pointer !rounded-lg",onClick:()=>Cs(!1),icon:t.jsx(ce,{size:16}),children:Ue("æ¶èµ·")})]})}),!Ts&&t.jsxs(M,{wrap:!0,children:[s.slice(0,25).map(e=>p(e,{size:"large",shape:"circle",onClick:()=>_a(e)})),t.jsxs(W,{color:"grey",type:"light",className:"cursor-pointer !rounded-lg",onClick:()=>Cs(!0),icon:t.jsx(oe,{size:16}),children:[Ue("æ´å¤")," ",s.length-25," ",Ue("个模å")]})]})]})})()})]})]})})}),t.jsx(q,{tab:t.jsxs("div",{className:"flex items-center",children:[t.jsx(je,{size:16,className:"mr-2"}),Ue("è´¦æ·ç»å®")]}),itemKey:"account",children:t.jsxs("div",{className:"py-4",children:[c()&&t.jsx(I,{className:"!rounded-xl transition-shadow mb-4",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start flex-1 min-w-0",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3 shrink-0",children:t.jsx(me,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("åç«ç¨æ·æ¾ç¤ºæçå·¥å")}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:Ue("åç«å·¥åå
¥å£è¯´æ")})]})]}),ma?t.jsx(A,{}):t.jsx(L,{checked:ca,disabled:ua,onChange:async e=>{ha(!0);try{const s=await o.post("/api/option/updateagentoption",{ticket_enabled:e}),{success:a,message:t}=s.data;a?(oa(e),w(Ue("ä¿åæå")),We({type:"set",payload:{...Oe?.status||{},ticket_enabled:e}})):(m(t||Ue("ä¿å失败")),await ga())}catch(s){m(s.message||Ue("ä¿å失败")),await ga()}finally{ha(!1)}}})]})}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(xe,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("é®ç®±")}
1),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.email?Se.user.email:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>es(!0),className:"!rounded-lg",children:Se.user&&""!==Se.user.email?Ue("ä¿®æ¹ç»å®"):Ue("ç»å®")})]})}),Ge.sms_login_enabled&&t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(ue,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("ææºå·")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&Se.user.phone?Se.user.phone:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>as(!0),className:"!rounded-lg",children:Se.user&&Se.user.phone?Ue("ä¿®æ¹ç»å®"):Ue("ç»å®")})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(se,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("微信")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.wechat_id?Ue("å·²ç»å®"):Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",disabled:!Ge.wechat_login,onClick:()=>Ze(!0),className:"!rounded-lg",children:Se.user&&""!==Se.user.wechat_id?Ue("ä¿®æ¹ç»å®"):Ge.wechat_login?Ue("ç»å®"):Ue("æªå¯ç¨")})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(he,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("GitHub")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.github_id?Se.user.github_id:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>{const e=Se.user&&Se.user.github_id||"",s=()=>C(Ge.github_client_id,!0);""!==e?Z.confirm({title:Ue("ä¿®æ¹ GitHub ç»å®"),centered:!0,content:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{children:[Ue("å½åå·²ç»å® GitHub è´¦å· IDï¼"),t.jsx("strong",{children:e})]}),t.jsx("div",{className:"text-sm text-[var(--semi-color-text-2)]",children:Ue("ç»§ç»æææ¶ä¼å¼¹åº GitHub è´¦å·éæ©é¡µï¼è¯·éæ©è¦ç»å®çè´¦å·ï¼è¥è¦ç»å®å
¶ä»è´¦å·ï¼å¯å¨è¯¥é¡µç»å½å¯¹åºè´¦å·ååéæ©ã")})]}),okText:Ue("ç»§ç»å徿æ"),cancelText:Ue("åæ¶"),onOk:s}):s()},disabled:!Ge.github_oauth,className:"!rounded-lg",children:Ge.github_oauth?Se.user&&""!==Se.user.github_id?Ue("ä¿®æ¹ç»å®"):Ue("ç»å®"):Ue("æªå¯ç¨")})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(ae,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("Google")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.google_id?Se.user.google_id:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>f(Ge.google_client_id,!0),disabled:Se.user&&""!==Se.user.google_id||!Ge.google_oauth,className:"!rounded-lg",children:Ge.google_oauth?Ue("ç»å®"):Ue("æªå¯ç¨")})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(ge,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("OIDC")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.oidc_id?Se.user.oidc_id:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>v(Ge.oidc_authorization_endpoint,Ge.oidc_client_id,!1,!0),disabled:Se.user&&""!==Se.user.oidc_id||!Ge.oidc_enabled,className:"!rounded-lg",children:Ge.oidc_enabled?Ue("ç»å®"):Ue("æªå¯ç¨")})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(te,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("Telegram")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.telegram_id?Se.user.telegram_id:Ue("æªç»å®")})]})]}),t.jsx("div",{className:"flex-shrink-0",children:Ge.telegram_oauth?""!==Se.user.telegram_id?t.jsx(D,{disabled:!0,size:"small",className:"!rounded-lg",children:Ue("å·²ç»å®")}):t.jsx("div",{className:"scale-75",children:t.jsx(ie,{dataAuthUrl:"/api/oauth/telegram/bind",botName:Ge.telegram_bot_name})}):t.jsx(D,{disabled:!0,size:"small",className:"!rounded-lg",children:Ue("æªå¯ç¨")})})]})}),t.jsx(I,{className:"!rounded-xl transition-shadow",bodyStyle:{padding:"16px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mr-3",children:t.jsx(le,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium text-foreground",children:Ue("LinuxDO")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:Se.user&&""!==Se.user.linux_do_id?Se.user.linux_do_id:Ue("æªç»å®")})]})]}),t.jsx(D,{type:"primary",theme:"outline",size:"small",onClick:()=>N(Ge.linuxdo_client_id,!0),disabled:Se.user&&""!==Se.user.linux_do_id||!Ge.linuxdo_oauth,className:"!rounded-lg",children:Ge.linuxdo_oauth?Ue("ç»å®"):Ue("æªå¯ç¨")})]})})]})]})}),t.jsx(q,{tab:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Ne,{size:16,className:"mr-2"}),Ue("å®å
¨è®¾ç½®")]}),itemKey:"security",children:t.jsx("div",{className:"py-4",children:t.jsx("div",{className:"space-y-6",children:t.jsxs(M,{vertical:!0,className:"w-full",children:[t.jsx(I,{className:"!rounded-xl w-full",bodyStyle:{padding:"20px"},shadows:"hover",children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start w-full sm:w-auto",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-fill-subtle flex items-center justify-center mr-4 flex-shrink-0",children:t.jsx(pe,{size:20,className:"text-foreground"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx(U.Title,{heading:6,className:"mb-1",children:Ue("ç³»ç»è®¿é®ä»¤ç")}),t.jsx(U.Text,{type:"tertiary",className:"text-sm",children:Ue("ç¨äºAPIè°ç¨ç身份éªè¯ä»¤çï¼è¯·å¦¥åä¿ç®¡")}),_s&&t.jsx("div",{className:"mt-3",children:t.jsx(F,{readonly:!0,value:_s,onClick:async e=>{e.target.select(),await k(e.target.value),w(Ue("ç³»ç»ä»¤çå·²å¤å¶å°åªåæ¿"))},size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})})})]})]}),t.jsx(D,{type:"primary",theme:"solid",onClick:async()=>{const e=await o.get("/api/user/token"),{success:s,message:a,data:t}=e.data;s?(ws(t),await k(t),w(Ue("令çå·²é置并已å¤å¶å°åªè´´æ¿"))):m(a)},className:"!rounded-lg !bg-primary hover:!bg-primary-hover !text-white w-full sm:w-auto",icon:t.jsx(pe,{size:16}),children:Ue(_s?"éæ°çæ":"çæä»¤ç")})]})}),Ae&&t.jsx(I,{className:"!rounded-xl w-full",bodyStyle:{padding:"20px"},shadows:"hover",children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start w-full sm:w-auto",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-fill-subtle flex items-center justify-center mr-4 flex-shrink-0",children:t.jsx(fe,{size:20,className:"text-foreground"})}),t.jsxs("div",{children:[t.jsx(U.Title,{heading:6,className:"mb-1",children:Ue("å¯ç 管ç")}),t.jsx(U.Text,{type:"tertiary",className:"text-sm",children:Ue("å®ææ´æ¹å¯ç å¯ä»¥æé«è´¦æ·å®å
¨æ§")})]})]}),t.jsx(D,{type:"primary",theme:"solid",onClick:()=>Je(!0),className:"!rounded-lg !bg-primary hover:!bg-primary-hover !text-white w-full sm:w-auto",icon:t.jsx(fe,{size:16}),children:Ue("ä¿®æ¹å¯ç ")})]})}),Le&&t.jsx(I,{className:"!rounded-xl border-red-200 w-full",bodyStyle:{padding:"20px"},shadows:"hover",children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start w-full sm:w-auto",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-fill-subtle flex items-center justify-center mr-4 flex-shrink-0",children:t.jsx(ve,{size:20,className:"text-foreground"})}),t.jsxs("div",{children:[t.jsx(U.Title,{heading:6,className:"mb-1 text-foreground",children:Ue("å é¤è´¦æ·")}),t.jsx(U.Text,{type:"tertiary",className:"text-sm",children:Ue("æ¤æä½ä¸å¯éï¼æææ°æ®å°è¢«æ°¸ä¹
å é¤")})]})]}),t.jsx(D,{type:"danger",theme:"solid",onClick:()=>ds(!0),className:"!rounded-lg w-full sm:w-auto !bg-primary hover:!bg-primary-hover !text-white",icon:t.jsx(ve,{size:16}),children:Ue("å é¤è´¦æ·")})]})})]})})})}),t.jsx(q,{tab:t.jsxs("div",{className:"flex items-center",children:[t.jsx(be,{size:16,className:"mr-2"}),Ue("å®å认è¯"),Hs?.has_any_verification&&t.jsx(W,{color:"green",size:"small",className:"ml-2",children:Ue("已认è¯")})]}),itemKey:"verify",children:t.jsx("div",{className:"py-4",children:Xs?t.jsx("div",{className:"flex justify-center py-12",children:t.jsx(A,{size:"large"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(Q,{type:Hs?.has_any_verification?"success":"info",description:Hs?.has_any_verification?Ue("æ¨å·²å®æ{{type}}认è¯ï¼æ¯ä¸ªè´¦å·åªè½éæ©ä¸ç§è®¤è¯æ¹å¼",{type:Ue("personal"===Hs?.existing_verify_type?"个人":"ä¼ä¸")}):Ue("å®å认è¯åå¯ç³è¯·å¼å
·åç¥¨ãæ¯ä¸ªè´¦å·åªè½éæ©ä¸ç§è®¤è¯æ¹å¼ï¼ä¸ªäººè®¤è¯æä¼ä¸è®¤è¯ï¼ï¼è®¤è¯æååä¸å¯æ´æ¹"),closeIcon:null,className:"!rounded-lg"}),Hs?.has_any_verification&&t.jsx(I,{className:"!rounded-xl",bodyStyle:{padding:"20px"},shadows:"hover",children:t.jsxs("div",{className:"flex items-center flex-wrap gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center flex-shrink-0",children:t.jsx(ye,{size:20,className:"text-green-600"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(U.Title,{heading:6,className:"mb-1",children:Ue("personal"===Hs?.existing_verify_type?"个人认è¯":"ä¼ä¸è®¤è¯")}
1),"personal"===Hs?.existing_verify_type&&Hs?.personal?.record&&t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsxs("div",{children:[Ue("å§å"),": ",Hs.personal.record.cert_name]}),t.jsxs("div",{children:[Ue("身份è¯å·"),": ",Hs.personal.record.cert_no?.replace(/^(.{6}).*(.{4})$/,"$1****$2")]})]}),"enterprise"===Hs?.existing_verify_type&&Hs?.enterprise?.record&&t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsxs("div",{children:[Ue("ä¼ä¸åç§°"),": ",Hs.enterprise.record.ep_cert_name]}),t.jsxs("div",{children:[Ue("ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç "),": ",Hs.enterprise.record.ep_cert_no?.replace(/^(.{6}).*(.{4})$/,"$1****$2")]}),t.jsxs("div",{children:[Ue("æ³äººå§å"),": ",Hs.enterprise.record.legal_person_cert_name]})]})]}),t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:t.jsxs(W,{color:"green",size:"small",className:"!rounded-lg",children:[t.jsx(ye,{size:16,className:"mr-1"}),Ue("已认è¯")]})})]})}),!Hs?.has_any_verification&&t.jsx(I,{className:"!rounded-xl",bodyStyle:{padding:"24px"},shadows:"hover",children:t.jsxs("div",{className:"flex flex-col items-center text-center py-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-fill-default flex items-center justify-center mb-4",children:t.jsx(be,{size:32,className:"text-primary"})}),t.jsx(U.Title,{heading:5,className:"mb-2",children:Ue("å¼å§å®å认è¯")}),t.jsx(U.Text,{type:"tertiary",className:"mb-6",children:Ue("宿å®å认è¯åå¯ç³è¯·å¼å
·å票")}),t.jsx(D,{type:"primary",theme:"solid",size:"large",icon:t.jsx(be,{size:18}),onClick:()=>{da(null),aa(""),ra(!0)},className:"!rounded-lg",style:{background:"linear-gradient(45deg, #0070f3 0%, #00a8ff 100%)",minWidth:200},children:Ue("ç«å³è®¤è¯")})]})})]})})}),t.jsx(q,{tab:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Te,{size:16,className:"mr-2"}),Ue("å
¶ä»è®¾ç½®")]}),itemKey:"notification",children:t.jsxs("div",{className:"py-4",children:[t.jsxs($,{type:"card",defaultActiveKey:"notify",className:"!rounded-lg",onChange:e=>Vs(e),children:[t.jsx(q,{tab:Ue("éç¥è®¾ç½®"),itemKey:"notify",children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-4 pt-4",children:Ue("éç¥æ¹å¼")}),t.jsxs(G,{value:Os.warningType,onChange:e=>wa("warningType",e),type:"pureCard",children:[t.jsx(V,{value:"email",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(xe,{size:16,className:"mr-2 text-foreground"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("é®ä»¶éç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿é®ä»¶æ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"webhook",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(_e,{size:16,className:"mr-2 text-foreground"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("Webhookéç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿HTTPè¯·æ±æ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"wxpusher",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(se,{size:16,className:"mr-2 text-green-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("WxPusheréç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿å¾®ä¿¡å°ç¨åºæ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"wecom",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(we,{size:16,className:"mr-2 text-blue-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("ä¼ä¸å¾®ä¿¡éç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿ä¼ä¸å¾®ä¿¡ç¾¤æºå¨äººæ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"dingtalk",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(me,{size:16,className:"mr-2 text-blue-600"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("éééç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿éé群æºå¨äººæ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"telegram",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(te,{size:16,className:"mr-2 text-sky-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("Telegraméç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿Telegram Botæ¥æ¶éç¥")})]})]})}),t.jsx(V,{value:"feishu",className:"!p-4 !rounded-lg",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(me,{size:16,className:"mr-2 text-red-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:Ue("é£ä¹¦éç¥")}),t.jsx("div",{className:"text-sm text-muted-foreground",children:Ue("éè¿é£ä¹¦ç¾¤æºå¨äººæ¥æ¶éç¥")})]})]})})]})]}),"webhook"===Os.warningType&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("Webhookå°å")}),t.jsx(F,{value:Os.webhookUrl,onChange:e=>wa("webhookUrl",e),placeholder:Ue("请è¾å
¥Webhookå°åï¼ä¾å¦: https://example.com/webhook"),size:"large",className:"!rounded-lg",prefix:t.jsx(_e,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("åªæ¯æhttpsï¼ç³»ç»å°ä»¥ POST æ¹å¼åééç¥ï¼è¯·ç¡®ä¿å°åå¯ä»¥æ¥æ¶ POST 请æ±")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("æ¥å£åè¯ï¼å¯éï¼")}),t.jsx(F,{value:Os.webhookSecret,onChange:e=>wa("webhookSecret",e),placeholder:Ue("请è¾å
¥å¯é¥"),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å¯é¥å°ä»¥ Bearer æ¹å¼æ·»å å°è¯·æ±å¤´ä¸ï¼ç¨äºéªè¯webhook请æ±çåæ³æ§")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsxs("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>Qs(!Fs),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx(ke,{size:16,className:"mr-2 text-foreground"}),t.jsx(U.Text,{strong:!0,className:"text-foreground",children:Ue("Webhook请æ±ç»æ")})]}),Fs?t.jsx(ce,{size:16}):t.jsx(oe,{size:16})]}),t.jsx(R,{isOpen:Fs,children:t.jsx("pre",{className:"mt-4 bg-gray-800 text-gray-100 rounded-lg text-sm overflow-x-auto",children:'{\n "type": "quota_exceed", // éç¥ç±»å\n "title": "æ é¢", // éç¥æ é¢\n "content": "éç¥å
容", // éç¥å
å®¹ï¼æ¯æ {{value}} åéå ä½ç¬¦\n "values": ["å¼1", "å¼2"], // æé¡ºåºæ¿æ¢contentä¸ç {{value}} å ä½ç¬¦\n "timestamp": 1739950503 // æ¶é´æ³\n}\n\n示ä¾ï¼\n{\n "type": "quota_exceed",\n "title": "é¢åº¦é¢è¦éç¥",\n "content": "æ¨çé¢åº¦å³å°ç¨å°½ï¼å½åå©ä½é¢åº¦ä¸º {{value}}",\n "values": ["$0.99"],\n "timestamp": 1739950503\n}'})})]})]}),"email"===Os.warningType&&t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("éç¥é®ç®±")}
1),t.jsx(F,{value:Os.notificationEmail,onChange:e=>wa("notificationEmail",e),placeholder:Ue("ç空å使ç¨è´¦å·ç»å®çé®ç®±"),size:"large",className:"!rounded-lg",prefix:t.jsx(xe,{size:16})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("设置ç¨äºæ¥æ¶é¢åº¦é¢è¦çé®ç®±å°åï¼ä¸å¡«å使ç¨è´¦å·ç»å®çé®ç®±")})]}),"wxpusher"===Os.warningType&&t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("WxPusherç»å®")}),t.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[t.jsx(U.Text,{children:Ue(Us?"å·²ç»å® WxPusher":"è¯·æ«æäºç»´ç ç»å®WxPusher")}),(()=>{const e={width:"150px",height:"150px",display:"flex",justifyContent:"center",alignItems:"center",border:"2px dashed #ccc",borderRadius:"8px",cursor:"pointer",textAlign:"center",fontSize:"14px",color:"#666"};if(Us)return t.jsx("div",{onClick:Ca,style:e,children:t.jsxs("div",{children:[t.jsxs("div",{style:{color:"hsl(var(--success))",marginBottom:"8px"},children:["â ",Ue("å·²ç»å®")]}),t.jsx("div",{children:Ue("ç¹å»è§£ç»")})]})});switch(Bs){case"initial":return t.jsx("div",{onClick:za,style:e,children:Ue("ç¹å»æ¾ç¤ºäºç»´ç ")});case"loading":return t.jsx("div",{style:e,children:t.jsx("div",{children:Ue("çæä¸...")})});case"loaded":return t.jsx("img",{src:Ks,style:{...e,border:"1px solid hsl(var(--border))",cursor:"default"},alt:Ue("WxPusherç»å®äºç»´ç ")});case"expired":return t.jsx("div",{onClick:za,style:{...e,borderColor:"hsl(var(--destructive))",color:"hsl(var(--destructive))"},children:t.jsxs("div",{children:[t.jsx("div",{children:Ue("äºç»´ç å·²è¿æ")}),t.jsx("div",{children:Ue("ç¹å»éæ°è·å")})]})});default:return null}})(),t.jsx("div",{className:"text-muted-foreground text-sm text-center max-w-xs",children:Ue("æ«æäºç»´ç ç»å®WxPusherï¼ç»å®åå°éè¿å¾®ä¿¡æ¥æ¶éç¥")})]})]}),"wecom"===Os.warningType&&t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("ä¼ä¸å¾®ä¿¡æºå¨äººKey")}),t.jsx(F,{value:Os.wecomKey,onChange:e=>wa("wecomKey",e),placeholder:Ue("请è¾å
¥ä¼ä¸å¾®ä¿¡ç¾¤æºå¨äººçKey"),size:"large",className:"!rounded-lg",prefix:t.jsx(we,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å¨ä¼ä¸å¾®ä¿¡ç¾¤ â 群设置 â 群æºå¨äºº â æ·»å æºå¨äºº ä¸è·åWebhookå°åæ«å°¾çkeyå¼")})]}),"dingtalk"===Os.warningType&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("ééæºå¨äººToken")}),t.jsx(F,{value:Os.dingtalkToken,onChange:e=>wa("dingtalkToken",e),placeholder:Ue("请è¾å
¥éé群æºå¨äººçaccess_token"),size:"large",className:"!rounded-lg",prefix:t.jsx(me,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å¨éé群 â 群设置 â æºå¨äºº â æ·»å æºå¨äºº â èªå®ä¹ ä¸è·åWebhookå°åä¸çaccess_tokenå¼")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("å ç¾å¯é¥ï¼å¯éï¼")}),t.jsx(F,{value:Os.dingtalkSecret,onChange:e=>wa("dingtalkSecret",e),placeholder:Ue("请è¾å
¥å ç¾å¯é¥ï¼ä»¥SECå¼å¤´"),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue('妿æºå¨äººå®å
¨è®¾ç½®éæ©äº"å ç¾"ï¼è¯·å¡«åå ç¾å¯é¥ï¼éæ©"èªå®ä¹å
³é®è¯"åæ éå¡«å')})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("@æåææºå·ï¼å¯éï¼")}),t.jsx(F,{value:Os.dingtalkAtMobiles,onChange:e=>wa("dingtalkAtMobiles",e),placeholder:Ue("请è¾å
¥è¢«@æåçææºå·ï¼å¤ä¸ªç¨è±æéå·åé"),size:"large",className:"!rounded-lg",prefix:t.jsx(me,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å¡«åååééç¥æ¶ä¼@å¯¹åºæåï¼ä¾å¦ï¼13800138000,13900139000")})]}),t.jsx("div",{className:"bg-card rounded-xl p-3",children:t.jsxs("div",{className:"text-muted-foreground text-sm",children:[Ue("ééæºå¨äººé
ç½®ææ¡£"),"ï¼",t.jsx("a",{href:"https://open.dingtalk.com/document/development/assign-a-webhook-url-to-an-internal-chatbot",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600 ml-1",children:Ue("æ¥ç宿¹ææ¡£")})]})})]}),"telegram"===Os.warningType&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("Telegram Bot Token")}),t.jsx(F,{value:Os.telegramBotToken,onChange:e=>wa("telegramBotToken",e),placeholder:Ue("请è¾å
¥Telegram Bot Token"),size:"large",className:"!rounded-lg",prefix:t.jsx(te,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("éè¿Telegram @BotFatherå建æºå¨äººè·åToken")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("Telegram Chat ID")}),t.jsx(F,{value:Os.telegramChatId,onChange:e=>wa("telegramChatId",e),placeholder:Ue("请è¾å
¥æ¥æ¶éç¥çChat ID"),size:"large",className:"!rounded-lg",prefix:t.jsx(te,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("个人è天使ç¨@userinfobotè·åï¼ç¾¤ç»éå
å°Botå å
¥ç¾¤ç»åè·å群ç»ID")})]}),t.jsx("div",{className:"bg-card rounded-xl p-3",children:t.jsxs("div",{className:"text-muted-foreground text-sm",children:[Ue("Telegram Boté
ç½®ææ¡£"),"ï¼",t.jsx("a",{href:"https://core.telegram.org/bots#how-do-i-create-a-bot",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600 ml-1",children:Ue("æ¥ç宿¹ææ¡£")})]})})]}),"feishu"===Os.warningType&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("é£ä¹¦Webhookå°å")}),t.jsx(F,{value:Os.feishuWebhookUrl,onChange:e=>wa("feishuWebhookUrl",e),placeholder:Ue("请è¾å
¥é£ä¹¦èªå®ä¹æºå¨äººçWebhookå°å"),size:"large",className:"!rounded-lg",prefix:t.jsx(me,{size:16,className:"m-2"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å¨é£ä¹¦ç¾¤ â 群设置 â 群æºå¨äºº â æ·»å æºå¨äºº â èªå®ä¹æºå¨äºº ä¸è·åWebhookå°å")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("ç¾åå¯é¥ï¼å¯éï¼")}
1),t.jsx(F,{value:Os.feishuSecret,onChange:e=>wa("feishuSecret",e),placeholder:Ue("妿æºå¨äººå¯ç¨äºç¾åæ ¡éªï¼è¯·è¾å
¥å¯é¥"),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("è¥é£ä¹¦æºå¨äººå®å
¨è®¾ç½®å¼å¯äºâç¾åæ ¡éªâï¼è¯·å¡«åå¯é¥ï¼æªå¼å¯å¯ç空")})]})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("订é
äºä»¶")}),t.jsxs(H,{style:{width:"100%"},multiple:!0,value:Os.subscriptionOptions,onChange:e=>wa("subscriptionOptions",e),maxTagCount:5,size:"large",className:"!rounded-lg",children:[t.jsx(H.Option,{value:"quota_push",children:Ue("ä½é¢ä¸è¶³é¢è¦")}),t.jsx(H.Option,{value:"sale_push",children:Ue("ä¿éæ´»å¨éç¥")}),t.jsx(H.Option,{value:"back_push",children:Ue("é²å¤±è-宿éç¥")}),t.jsx(H.Option,{value:"system_push",children:Ue("ç³»ç»å
¬åéç¥")}),t.jsx(H.Option,{value:"price_push",children:Ue("模åè°ä»·éç¥")}),t.jsx(H.Option,{value:"token_warning_push",children:Ue("令çä½é¢ä¸è¶³é¢è¦")}),t.jsx(H.Option,{value:"token_exhaust_push",children:Ue("令çä½é¢ä¸è¶³")})]}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("éæ©æ¨å¸ææ¥æ¶çéç¥ç±»å")})]}),Os.subscriptionOptions.includes("token_warning_push")&&t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("令çä¸è¶³éå¼")}
1),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx(J,{value:Os.tokenQuotaWarningPercent,onChange:e=>wa("tokenQuotaWarningPercent",e??20),min:1,max:100,step:5,precision:0,addonAfter:"%",style:{width:160},size:"large",className:"!rounded-lg"})}),t.jsx("div",{className:"text-muted-foreground text-sm mt-2",children:Ue("å½ä»¤çå©ä½é¢åº¦ä½äºæ»é¢åº¦è¯¥ç¾åæ¯æ¶åéé¢è¦ï¼ä»
对æéé¢åº¦ç令ççæ")})]}),t.jsxs("div",{className:"bg-card rounded-xl",children:[t.jsx(U.Text,{strong:!0,className:"block mb-3",children:Ue("é¢è¦é¢åº¦")}),t.jsxs("div",{className:"space-y-3",children:[t.jsx(J,{value:Os.warningThreshold?parseFloat(b(Os.warningThreshold)):0,onChange:e=>{if(e){const s=y();wa("warningThreshold",e*s)}},style:{width:200},addonBefore:"$",size:"large",className:"!rounded-lg",step:.1,min:0,precision:2}),t.jsxs("div",{className:"text-muted-foreground text-sm",children:[Ue("å½ä½é¢ä½äº")," $",Os.warningThreshold?parseFloat(b(Os.warningThreshold)).toFixed(2):0," ",Ue("æ¶ï¼å°æ¶å°é¢è¦éç¥ï¼30åéæå¤1次ï¼")]})]})]})]})}),t.jsx(q,{tab:Ue("ä»·æ ¼è®¾ç½®"),itemKey:"price",children:t.jsx("div",{className:"py-4",children:t.jsx("div",{className:"space-y-4",children:t.jsx("div",{className:"bg-card rounded-xl",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mt-1",children:t.jsx(ge,{size:20,className:"text-foreground"})}),t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2",children:Ue("æ¥åæªè®¾ç½®ä»·æ ¼æ¨¡å")}),t.jsx("div",{className:"text-muted-foreground text-sm",children:Ue("彿¨¡å没æè®¾ç½®ä»·æ ¼æ¶ä»æ¥åè°ç¨ï¼ä»
彿¨ä¿¡ä»»è¯¥ç½ç«æ¶ä½¿ç¨ï¼å¯è½ä¼äº§çé«é¢è´¹ç¨")})]}),t.jsx(X,{checked:Os.acceptUnsetModelRatioModel,onChange:e=>wa("acceptUnsetModelRatioModel",e.target.checked),className:"ml-4"})]})})]})})})})}),t.jsx(q,{tab:Ue("IPè®°å½"),itemKey:"ip",children:t.jsx("div",{className:"py-4",children:t.jsx("div",{className:"bg-card rounded-xl",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-fill-subtle flex items-center justify-center mt-1",children:t.jsx(Ne,{size:20,className:"text-foreground"})}),t.jsx("div",{className:"flex-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2",children:Ue("è®°å½è¯·æ±ä¸é误æ¥å¿ IP")}),t.jsx("div",{className:"text-muted-foreground text-sm",children:Ue("å¼å¯åï¼ä»
âæ¶è´¹âåâéè¯¯âæ¥å¿å°è®°å½æ¨ç客æ·ç«¯ IP å°å")})]}),t.jsx(X,{checked:Os.recordIpLog,onChange:e=>wa("recordIpLog",e.target.checked),className:"ml-4"})]})})]})})})}),t.jsx(q,{tab:Ue("è¯è¨å好"),itemKey:"language",children:t.jsxs("div",{className:"py-4",children:[t.jsxs("div",{className:"flex items-center mb-4",children:[t.jsx(O,{size:14,color:"violet",className:"mr-3 shadow-md",children:t.jsx(ze,{size:16})}),t.jsxs("div",{children:[t.jsx(U.Text,{className:"text-lg font-medium",children:Ue("å好设置")}),t.jsx("div",{className:"text-xs text-muted-foreground",children:Ue("çé¢è¯è¨åå
¶ä»ä¸ªäººå好")})]})]}),t.jsx(I,{className:"!rounded-xl",shadows:"hover",children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center sm:justify-between gap-4",children:[t.jsxs("div",{className:"flex items-start w-full sm:w-auto",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-violet-50 dark:bg-violet-900/30 flex items-center justify-center mr-4 flex-shrink-0",children:t.jsx(ze,{size:20,className:"text-violet-600 dark:text-violet-400"})}),t.jsxs("div",{children:[t.jsx(U.Title,{heading:6,className:"mb-1",children:Ue("è¯è¨å好")}),t.jsx(U.Text,{type:"tertiary",className:"text-sm",children:Ue("éæ©æ¨çé¦éçé¢è¯è¨ï¼è®¾ç½®å°èªå¨ä¿å并忥尿æè®¾å¤")})]})]}),t.jsx(H,{value:_.language?.startsWith("zh")?"zh":_.language||"zh",onChange:async e=>{const s=_.language?.startsWith("zh")?"zh":_.language||"zh";_.changeLanguage(e);try{const a=Se?.user?.setting?JSON.parse(Se.user.setting):{},t=await o.put("/api/user/setting",{notify_type:a.notify_type||"email",quota_
1warning_threshold:a.quota_warning_threshold||1e5,webhook_url:a.webhook_url||"",webhook_secret:a.webhook_secret||"",notification_email:a.notification_email||"",accept_unset_model_ratio_model:a.accept_unset_model_ratio_model||!1,record_ip_log:a.record_ip_log||!1,wxpusher_uid:a.wxpusher_uid||"",subscription_options:a.subscription_options||"quota_push,sale_push,back_push,system_push,price_push,token_warning_push,token_exhaust_push",wecom_key:a.wecom_key||"",dingtalk_token:a.dingtalk_token||"",dingtalk_secret:a.dingtalk_secret||"",dingtalk_at_mobiles:a.dingtalk_at_mobiles||"",telegram_bot_token:a.telegram_bot_token||"",telegram_chat_id:a.telegram_chat_id||"",language:e});t.data.success?(w(Ue("è¯è¨å好已ä¿å")),await pa()):(m(t.data.message||Ue("ä¿å失败")),_.changeLanguage(s))}catch(a){m(Ue("ä¿å失败ï¼è¯·éè¯")),_.changeLanguage(s)}},style:{width:180},optionList:[{value:"zh",label:Ue("ç®ä½ä¸æ")},{value:"en",label:"English"},{value:"ja",label:"æ¥æ¬èª"},{value:"ko",label:"íêµì´"},{value:"es",label:"Español"},{value:"de",label:"Deutsch"}]})]})}),t.jsx("div",{className:"mt-4",children:t.jsx(U.Text,{type:"tertiary",className:"text-xs",children:Ue("æç¤ºï¼è¯è¨å好ä¼åæ¥å°æ¨ç»å½çææè®¾å¤ï¼å¹¶å½±åAPIè¿åçéè¯¯æ¶æ¯è¯è¨ã")})})]})})]}),"notify"===Gs&&t.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[t.jsx(D,{onClick:async()=>{const e=await ka("test");if(e.success){qs(!0);try{const e=await o.post("/api/push/test",{notify_type:Os.warningType,title:Ue("æµè¯éç¥"),test_agent_mode:!!c(),content:Ue("è¿æ¯ä¸æ¡æµè¯éç¥ï¼å¦ææ¨æ¶å°æ¤æ¶æ¯ï¼è¯´æéç¥é
ç½®æ£ç¡®ã")});e.data.success?w(Ue("æµè¯éç¥åéæå")):m(e.data.message||Ue("æµè¯éç¥åé失败"))}catch(s){const e=s?.response?.data?.message;m(e||Ue("æµè¯éç¥åé失败"))}qs(!1)}else m(e.message||Ue("设置ä¿å失败"))},loading:$s,size:"large",className:"!rounded-lg",icon:t.jsx(Te,{size:16}),children:Ue("åéæµè¯éç¥")}),t.jsx(D,{type:"primary",onClick:ka,size:"large",className:"!rounded-lg !bg-primary hover:!bg-primary-hover !text-white",icon:t.jsx(de,{size:16}),children:Ue("ä¿å设置")})]}),"language"!==Gs&&"notify"!==Gs&&t.jsx("div",{className:"mt-6 flex justify-end",children:t.jsx(D,{type:"primary",onClick:ka,size:"large",className:"!rounded-lg !bg-primary hover:!bg-primary-hover !text-white",icon:t.jsx(de,{size:16}),children:Ue("ä¿å设置")})})]})})]})})]})})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(xe,{size:16,className:"mr-2 text-blue-500"}),Ue("ç»å®é®ç®±å°å")]}),visible:Ye,onCancel:()=>es(!1),onOk:async()=>{if(""===Fe.email_verification_code)return void m(Ue("请è¾å
¥é®ç®±éªè¯ç ï¼"));fs(!0);const e=await o.get(`/api/oauth/email/bind?email=${Fe.email}&code=${Fe.email_verification_code}`),{success:s,message:a}=e.data;s?(w(Ue("é®ç®±è´¦æ·ç»å®æåï¼")),es(!1),Se.user.email=Fe.email):m(a),fs(!1)},size:"small",centered:!0,maskClosable:!1,className:"modern-modal",children:t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"flex gap-3",children:[t.jsx(F,{placeholder:Ue("è¾å
¥é®ç®±å°å"),onChange:e=>ja("email",e),name:"email",type:"email",size:"large",className:"!rounded-lg flex-1",prefix:t.jsx(xe,{size:16})}),t.jsx(D,{onClick:async()=>{if(""===Fe.email)return void m(Ue("请è¾å
¥é®ç®±ï¼"));if(ms&&""===gs)return void z(Ue("请ç¨åå ç§éè¯ï¼Turnstile æ£å¨æ£æ¥ç¨æ·ç¯å¢ï¼"));const e=Oe?.status||Ce()||{};e.captcha_send_code_enabled||e.captcha_register_enabled?os(!0):await Na("")},disabled:vs||ps,className:"!rounded-lg",type:"primary",theme:"outline",size:"large",children:vs?`${Ue("éæ°åé")} (${ys})`:Ue("è·åéªè¯ç ")})]}),t.jsx(F,{placeholder:Ue("éªè¯ç "),name:"email_verification_code",value:Fe.email_verification_code,onChange:e=>ja("email_verification_code",e),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})}),ms&&t.jsx("div",{className:"flex justify-center",children:t.jsx(S,{sitekey:us,onVerify:e=>{js(e)}})})]})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ue,{size:16,className:"mr-2 text-blue-500"}),Ue("ç»å®ææºå·")]}),visible:ss,onCancel:()=>as(!1),onOk:async()=>
1{if(""!==Fe.phone&&ya(Fe.phone))if(""!==Fe.phone_verification_code){fs(!0);try{const e=await o.post("/api/user/phone/bind",{phone:Fe.phone,code:Fe.phone_verification_code}),{success:s,message:a}=e.data;s?(w(Ue("ææºå·ç»å®æåï¼")),as(!1),await pa()):m(a)}catch(e){m(e)}finally{fs(!1)}}else m(Ue("请è¾å
¥éªè¯ç ï¼"));else m(Ue("ææºå·æ ¼å¼ä¸æ£ç¡®"))},confirmLoading:ps,size:"small",centered:!0,maskClosable:!1,className:"modern-modal",children:t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"flex gap-3",children:[t.jsx(F,{placeholder:Ue("è¾å
¥ææºå·"),value:Fe.phone,onChange:e=>ja("phone",e),name:"phone",size:"large",className:"!rounded-lg flex-1",prefix:t.jsx(ue,{size:16})}),t.jsx(D,{onClick:async()=>{if(""!==Fe.phone)if(ya(Fe.phone)){ls(!0),fs(!0);try{const e=await o.post("/api/user/sms/send",{phone:Fe.phone,purpose:"bind"}),{success:s,message:a}=e.data;s?w(Ue("éªè¯ç å·²åé")):(m(a),ls(!1),rs(60))}catch(e){m(e),ls(!1),rs(60)}finally{fs(!1)}}else m(Ue("ææºå·æ ¼å¼ä¸æ£ç¡®"));else m(Ue("请è¾å
¥ææºå·ï¼"))},disabled:ts||ps,className:"!rounded-lg",type:"primary",theme:"outline",size:"large",children:ts?`${Ue("éæ°åé")} (${is})`:Ue("è·åéªè¯ç ")})]}),t.jsx(F,{placeholder:Ue("éªè¯ç "),name:"phone_verification_code",value:Fe.phone_verification_code,onChange:e=>ja("phone_verification_code",e),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})})]})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(se,{className:"mr-2 text-green-500",size:20}),Ue("ç»å®å¾®ä¿¡è´¦æ·")]}),visible:Xe,onCancel:()=>Ze(!1),footer:null,size:"small",centered:!0,className:"modern-modal",children:t.jsxs("div",{className:"space-y-4 py-4 text-center",children:[t.jsx(Y,{src:Ge.wechat_qrcode,className:"mx-auto"}),t.jsx("div",{className:"text-foreground/80",children:t.jsx("p",{children:Ue("微信æ«ç å
³æ³¨å
¬ä¼å·ï¼è¾å
¥ãéªè¯ç ãè·åéªè¯ç ï¼ä¸åéå
ææï¼")})}),t.jsx(F,{placeholder:Ue("éªè¯ç "),name:"wechat_verification_code",value:Fe.wechat_verification_code,onChange:e=>ja("wechat_verification_code",e),size:"large",className:"!rounded-lg",prefix:t.jsx(pe,{size:16})}),t.jsx(D,{type:"primary",theme:"solid",size:"large",onClick:async()=>{if(""===Fe.wechat_verification_code)return;const e=await o.get(`/api/oauth/wechat/bind?code=${Fe.wechat_verification_code}`),{success:s,message:a}=e.data;s?(w(Ue("微信账æ·ç»å®æåï¼")),Ze(!1)):m(a)},className:"!rounded-lg w-full !bg-primary hover:!bg-primary-hover !text-white",icon:t.jsx(se,{size:16}),children:Ue("ç»å®")})]})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ve,{size:16,className:"mr-2 text-red-500"}),Ue("å é¤è´¦æ·ç¡®è®¤")]}),visible:ns,onCancel:()=>ds(!1),onOk:async()=>{if(Fe.self_account_deletion_confirmation!==Se.user.username)return void m(Ue("请è¾å
¥ä½ çè´¦æ·å以确认å é¤ï¼"));const e=await o.delete("/api/user/self"),{success:s,message:a}=e.data;s?(w(Ue("è´¦æ·å·²å é¤ï¼")),await o.get("/api/user/logout"),Ie({type:"logout"}),T(),$e("/login")):m(a)},size:"small",centered:!0,className:"modern-modal",children:t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsx(Q,{type:"danger",description:Ue("æ¨æ£å¨å é¤èªå·±ç叿·ï¼å°æ¸
ç©ºæææ°æ®ä¸ä¸å¯æ¢å¤"),closeIcon:null,className:"!rounded-lg"}),t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2 text-red-600",children:Ue("请è¾å
¥æ¨çç¨æ·å以确认å é¤")}),t.jsx(F,{placeholder:Ue("è¾å
¥ä½ çè´¦æ·å{{username}}以确认å é¤",{username:` ${Se?.user?.username} `}),name:"self_account_deletion_confirmation",value:Fe.self_account_deletion_confirmation,onChange:e=>ja("self_account_deletion_confirmation",e),size:"large",className:"!rounded-lg",prefix:t.jsx(ne,{size:16})})]}),ms&&t.jsx("div",{className:"flex justify-center",children:t.jsx(S,{sitekey:us,onVerify:e=>{js(e)}})})]})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(fe,{size:16,className:"mr-2 text-orange-500"}),Ue("ä¿®æ¹å¯ç ")]}),visible:He,onCancel:()=>Je(!1),onOk:async()=>
1{if(""===Fe.original_password)return void m(Ue("请è¾å
¥åå¯ç ")+"ï¼");if(""===Fe.set_new_password)return void m(Ue("请è¾å
¥æ°å¯ç ")+"ï¼");if(Fe.original_password===Fe.set_new_password)return void m(Ue("æ°å¯ç éè¦ååå¯ç ä¸ä¸è´ï¼"));if(Fe.set_new_password!==Fe.set_new_password_confirmation)return void m(Ue("两次è¾å
¥çå¯ç ä¸ä¸è´")+"ï¼");const e=await o.put("/api/user/self",{original_password:Fe.original_password,password:Fe.set_new_password}),{success:s,message:a}=e.data;s?(w(Ue("å¯ç ä¿®æ¹æåï¼è¯·éæ°ç»å½ï¼")),Je(!1),Ie({type:"logout"}),T(),$e("/login")):(m(a),Je(!1))},size:"small",centered:!0,className:"modern-modal",children:t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2",children:Ue("åå¯ç ")}),t.jsx(F,{name:"original_password",placeholder:Ue("请è¾å
¥åå¯ç "),type:"password",value:Fe.original_password,onChange:e=>ja("original_password",e),size:"large",className:"!rounded-lg",prefix:t.jsx(fe,{size:16})})]}),t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2",children:Ue("æ°å¯ç ")}),t.jsx(F,{name:"set_new_password",placeholder:Ue("请è¾å
¥æ°å¯ç "),type:"password",value:Fe.set_new_password,onChange:e=>ja("set_new_password",e),size:"large",className:"!rounded-lg",prefix:t.jsx(fe,{size:16})})]}),t.jsxs("div",{children:[t.jsx(U.Text,{strong:!0,className:"block mb-2",children:Ue("确认æ°å¯ç ")}),t.jsx(F,{name:"set_new_password_confirmation",placeholder:Ue("è¯·åæ¬¡è¾å
¥æ°å¯ç "),type:"password",value:Fe.set_new_password_confirmation,onChange:e=>ja("set_new_password_confirmation",e),size:"large",className:"!rounded-lg",prefix:t.jsx(fe,{size:16})})]}),ms&&t.jsx("div",{className:"flex justify-center",children:t.jsx(S,{sitekey:us,onVerify:e=>{js(e)}})})]})}),t.jsx(Z,{title:t.jsxs("div",{className:"flex items-center",children:[t.jsx(be,{size:20,className:"mr-2 text-primary"}),Ue(na?"personal"===na?"个人认è¯":"ä¼ä¸è®¤è¯":"éæ©è®¤è¯ç±»å")]}),visible:ia,onCancel:()=>{ra(!1),da(null),aa("")},footer:null,width:na?500:600,centered:!0,className:"verify-modal",children:na?"personal"===na?t.jsxs("div",{className:"py-4",children:[t.jsx(D,{type:"tertiary",icon:t.jsx(ce,{size:16,style:{transform:"rotate(-90deg)"}}),onClick:()=>{da(null),aa("")},className:"mb-4",size:"small",children:Ue("è¿åéæ©")}),t.jsxs(ee,{getFormApi:la,onSubmit:async e=>{if(sa){ea(!0);try{const s=await o.post("/api/identity_verify/personal",{cert_name:e.cert_name,cert_no:e.cert_no,captcha_token:sa});s.data.success?(w(Ue("ä¸ªäººè®¤è¯æå")),ra(!1),da(null),ta&&ta.reset(),await va()):m(s.data.message)}catch(s){m(s.message||Ue("认è¯å¤±è´¥"))}finally{ea(!1),aa("")}}else m(Ue("请å
宿æ»åéªè¯"))},children:[t.jsx(ee.Input,{field:"cert_name",label:Ue("çå®å§å"),placeholder:Ue("请è¾å
¥æ¨ççå®å§å"),rules:[{required:!0,message:Ue("请è¾å
¥çå®å§å")}],size:"large",className:"!rounded-lg"}),t.jsx(ee.Input,{field:"cert_no",label:Ue("身份è¯å·"),placeholder:Ue("请è¾å
¥æ¨ç身份è¯å·"),rules:[{required:!0,message:Ue("请è¾å
¥èº«ä»½è¯å·")},{pattern:/^[0-9]{17}[0-9Xx]$|^[0-9]{15}$/,message:Ue("身份è¯å·æ ¼å¼ä¸æ£ç¡®")}],size:"large",className:"!rounded-lg"}),t.jsx("div",{className:"mt-4",children:sa?t.jsx(D,{type:"primary",theme:"solid",size:"large",block:!0,htmlType:"submit",loading:Ys,className:"!rounded-lg",style:{background:"linear-gradient(45deg, hsl(var(--success)) 0%, hsl(var(--success) / 0.75) 100%)"},children:"â "+Ue("å·²éªè¯ï¼ç¹å»æäº¤")}):t.jsx(re,{onVerified:e=>aa(e),disabled:!1,children:t.jsx(D,{type:"primary",theme:"solid",size:"large",block:!0,className:"!rounded-lg",children:Ue("æäº¤è®¤è¯")})})})]})]}):t.jsxs("div",{className:"py-4",children:[t.jsx(D,{type:"tertiary",icon:t.jsx(ce,{size:16,style:{transform:"rotate(-90deg)"}}),onClick:()=>{da(null),aa("")},className:"mb-4",size:"small",children:Ue("è¿åéæ©")}),t.jsxs(ee,{onSubmit:async e=>{if(sa){ea(!0);try{const s=await o.post("/api/identity_verify/enterprise",{ep_cert_name:e.ep_cert_name,ep_cert_no:e.ep_cert_no,legal_person_cert_name:e.legal_person_cert_name,captcha_token:sa});s.data.success?(w(Ue("ä¼ä¸è®¤è¯æå")),ra(!1),da(null),ta&&ta.reset(),await va()):m(s.data.message)}catch(s){m(s.message||Ue("认è¯å¤±è´¥"))}finally{ea(!1),aa("")}}else m(Ue("请å
宿æ»åéªè¯"))},children:[t.jsx(ee.Input,{field:"ep_cert_name",label:Ue("ä¼ä¸åç§°"),placeholder:Ue("请è¾å
¥ä¼ä¸å
¨ç§°"),rules:[{required:!0,message:Ue("请è¾å
¥ä¼ä¸åç§°")}],size:"large",className:"!rounded-lg"}),t.jsx(ee.Input,{field:"ep_cert_no",label:Ue("ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç "),placeholder:Ue("请è¾å
¥18ä½ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç "),rules:[{required:!0,message:Ue("请è¾å
¥ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç ")},{pattern:/^[0-9A-Za-z]{18}$/,message:Ue("ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç åºä¸º18ä½")}],size:"large",className:"!rounded-lg"}),t.jsx(ee.Input,{field:"legal_person_cert_name",label:Ue("æ³äººå§å"),placeholder:Ue("请è¾å
¥æ³äººçå®å§å"),rules:[{required:!0,message:Ue("请è¾å
¥æ³äººå§å")}],size:"large",className:"!rounded-lg"}),t.jsx("div",{className:"mt-4",children:sa?t.jsx(D,{type:"primary",theme:"solid",size:"large",block:!0,htmlType:"submit",loading:Ys,className:"!rounded-lg",style:{background:"linear-gradient(45deg, hsl(var(--success)) 0%, hsl(var(--success) / 0.75) 100%)"},children:"â "+Ue("å·²éªè¯ï¼ç¹å»æäº¤")}):t.jsx(re,{onVerified:e=>aa(e),disabled:!1,children:t.jsx(D,{type:"primary",theme:"solid",size:"large",block:!0,className:"!rounded-lg",children:Ue("æäº¤è®¤è¯")})})})]})]}):t.jsxs("div",{className:"py-4",children:[t.jsx(U.Text,{type:"tertiary",className:"block text-center mb-4",children:Ue("è¯·éæ©æ¨ç认è¯ç±»åï¼æ¯ä¸ªè´¦å·åªè½éæ©ä¸ç§è®¤è¯æ¹å¼")}),t.jsx(Q,{type:"warning",description:Ue("认è¯å®æåï¼å¼ç¥¨ä¸»ä½åªè½æ¯è®¤è¯ä¸»ä½ï¼ä¸ªäººè®¤è¯åªè½ä»¥æ¬äººåä¹å¼ç¥¨ï¼ä¼ä¸è®¤è¯åªè½ä»¥è¯¥ä¼ä¸åä¹å¼ç¥¨ï¼ï¼è¯·è°¨æ
éæ©ã"),closeIcon:null,className:"!rounded-lg mb-6"}),t.jsxs("div",{className:`grid grid-cols-1 ${De?"sm:grid-cols-2":""} gap-4`,children:[De&&t.jsx(I,{className:"!rounded-xl cursor-pointer transition-all hover:shadow-lg",bodyStyle:{padding:"24px"},shadows:"hover",onClick:()=>da("personal"),children:t.jsxs("div",{className:"flex flex-col items-center text-center",children:[t.jsx("div",{className:"w-14 h-14 roun
1ded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center mb-4",children:t.jsx(ne,{size:28,className:"text-blue-600"})}),t.jsx(U.Title,{heading:6,className:"mb-2",children:Ue("个人认è¯")}),t.jsx(U.Text,{type:"tertiary",size:"small",children:Ue("éç¨äºä¸ªäººç¨æ·å¼å
·æ®éå票")})]})}),t.jsx(I,{className:"!rounded-xl cursor-pointer transition-all hover:shadow-lg",bodyStyle:{padding:"24px"},shadows:"hover",onClick:()=>da("enterprise"),children:t.jsxs("div",{className:"flex flex-col items-center text-center",children:[t.jsx("div",{className:"w-14 h-14 rounded-full bg-orange-100 dark:bg-orange-900 flex items-center justify-center mb-4",children:t.jsx(we,{size:28,className:"text-orange-600"})}),t.jsx(U.Title,{heading:6,className:"mb-2",children:Ue("ä¼ä¸è®¤è¯")}),t.jsx(U.Text,{type:"tertiary",size:"small",children:Ue("éç¨äºä¼ä¸ç¨æ·å¼å
·å¢å¼ç¨å票")})]})})]})]})}),t.jsx(Z,{title:Ue("人æºéªè¯"),visible:cs,footer:null,centered:!0,onCancel:()=>os(!1),bodyStyle:{padding:0},lazyRender:!0,keepDOM:!1,children:cs&&t.jsx(re,{inline:!0,onVerified:e=>{os(!1),Na(e)}})})]})};export{Se as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.