PageSourceSearch

https://wei.city/_nuxt/Bqak6f2U.js

js wei.city collected 2026-10-02 01:22:23 UTC 16,323 bytes, 1 lines download raw bytes

1import{_ as ce}from"./C5nUFo7n.js";import{_ as _e}from"./DDrWzmX2.js";import{_ as be}from"./CWYbOWIT.js";import{_ as pe}from"./EF0RuxIi.js";import{_ as fe}from"./DNpeNHpT.js";import{_ as he}from"./uEO6AQu-.js";import{_ as ge}from"./Kx-vQ-Ne.js";import{aQ as we,ee as $e,et as ke,eU as ye,aw as D,eZ as u,cL as m,av as l,aI as n,cv as P,dH as o,aA as b,aH as r,ax as C,dT as I,f as W,d6 as J,c$ as c,as as w,a0 as Ce}from"./Bvar31K0.js";import{aI as Ue,b as Ie,av as Se,f as ze,_ as X,ao as Ae,am as Le,w as qe}from"./CRUriGY9.js";import{A as Me}from"./CIJzp_rw.js";import{A as Te}from"./BhkHly8K.js";import{A as Be}from"./BWOyowJN.js";import{A as We}from"./CEAnGMfG.js";import{N}from"./BDXCR2wv.js";import"./DtZG_71b.js";import"./DhIqmaXN.js";import"./CZXe7L3A.js";import"./DPo-gw8x.js";import"./C19jaIAn.js";import"./C35fMxhs.js";import"./CRJ7K1LL.js";import"./B-p6aW7q.js";import"./CM8LO42l.js";import"./uopmkLbC.js";import"./F6k5FmJu.js";import"./DbnPTcif.js";import"./BQawY1YM.js";import"./CXrjN5r8.js";import"./Bd2A3TxF.js";import"./D9B9_Nup.js";const Ne={class:"wc-bots"},Ve={class:"wc-bots__tools"},Ee={class:"wc-bots__tabs"},He={key:0,class:"wc-bots__msg wc-bots__msg--err"},Ge={key:1,class:"wc-bots__msg wc-bots__msg--ok"},Re={key:0,class:"wc-bots__msg wc-bots__msg--err"},De={class:"wc-bots__tablewrap"},Pe={class:"wc-bots__table wc-rtable"},Qe={style:{width:"80px"}},Fe={style:{width:"100px"}},Ze={style:{width:"80px"}},je={style:{width:"80px"}},Ke={style:{width:"80px"}},Oe={style:{width:"270px"}},Je=["data-label"],Xe={class:"wc-bots__name"},Ye={class:"wc-bots__meta"},xe=["data-label"],et=["data-label"],tt={"data-label":"ChatGPT"},at=["data-label"],lt=["data-label"],st=["data-label"],ot=["data-label"],nt={key:0},it={colspan:"8",class:"wc-bots__empty"},dt={class:"wc-bots__pager"},ut={key:0,class:"wc-bots__msg wc-bots__msg--err"},rt={key:1,class:"wc-bots__msg wc-bots__msg--ok"},mt={key:2,class:"wc-bots__form"},vt={class:"wc-bots__field wc-bots__field--full"},ct={class:"wc-bots__field"},_t={class:"wc-bots__field"},bt={class:"wc-bots__field wc-bots__field--full"},pt={class:"wc-bots__field"},ft={class:"wc-bots__field"},ht={class:"wc-bots__field"},gt={class:"wc-bots__field wc-bots__field--switches"},wt={class:"wc-bots__field wc-bots__field--wide"},$t={class:"wc-bots__field"},kt={class:"wc-bots__divider"},yt={class:"wc-bots__field wc-bots__field--switches"},Ct={class:"wc-bots__field"},Ut={class:"wc-bots__field"},It={class:"wc-bots__field"},St={class:"wc-bots__field"},zt={class:"wc-bots__field"},At={class:"wc-bots__qhead"},Lt={class:"wc-bots__meta"},qt={class:"wc-bots__qrow"},Mt={class:"wc-bots__qops"},Q=20,Tt=we({__name:"bots",setup(Bt){const{t:i}=$e(),Y=ke(),{data:x,isLoading:Wt,isFetching:ee,isError:te}=Ue(),L=w(()=>x.value?.items??[]),$=c("channel"),q=c(""),S=c(1),M=c(""),T=c(""),F=w(()=>L.value.filter(t=>!t.isChannel).length),Z=w(()=>L.value.filter(t=>t.isChannel).length),ae=w(()=>L.value.filter(t=>t.aiChat).length),j=w(()=>{const t=q.value.trim().toLowerCase();return L.value.filter(e=>$.value==="channel"?e.isChannel:!e.isChannel).filter(e=>!t||e.title.toLowerCase().includes(t)||String(e.chatId).includes(t)||(e.userName||"").toLowerCase().includes(t))}),le=w(()=>Math.max(1,Math.ceil(j.value.length/Q))),K=w(()=>j.value.slice((S.value-1)*Q,S.value*Q));ye([$,q],()=>{S.value=1});function se(t){const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toLocaleDateString()}function k(t,e,d){t?(T.value=e,M.value=""):(M.value=d||i("admin.bots.save_failed_retry"),T.value="")}const B=c(new Set);async function z(t,e,d){const p=`${t.chatId}:${e}`;if(!B.value.has(p)){B.value.add(p);try{const g=await Se(t.chatId,e,d);if(g.success){e==="aichat"?t.aiChat=d:e==="image"?t.aiImage=d:e==="web"?t.aiWeb=d:e==="translate"?t.translate=d:e==="lock"&&(t.locked=d,d&&(U.value=0));const f={aichat:"ChatGPT",image:i("admin.bots.feature_image"),web:i("admin.bots.feature_web"),translate:i("admin.bots.feature_translate"),lock:i("admin.bots.feature_lock")};k(!0,d?i("admin.bots.flag_enabled",{title:t.title,feature:f[e]}):i("admin.bots.flag_disabled",{title:t.title,feature:f[e]}))}else k(!1,"",g.error)}catch(g){k(!1,"",g?.data?.error||g?.message)}finally{B.value.delete(p)}}}function A(t,e){return B.value.has(`${t.chatId}:${e}`)}const U=c(0),V=c(0);async function oe(t){if(t.locked){U.value=0,k(!1,"",i("admin.bots.locked_unlock_first",{title:t.title}));return}V.value=t.chatId;try{const e=await ze(t.chatId);e.success?(k(!0,e.error?i("admin.bots.removed_with_note",{title:t.title,note:e.error}):i("admin.bots.bot_left",{title:t.title}
1)),Y.invalidateQueries({queryKey:["admin-bots"]})):k(!1,"",e.error)}catch(e){k(!1,"",e?.data?.error||e?.message)}finally{V.value=0,U.value=0}}const E=c(!1),H=c(!1),G=c(!1),_=c(""),h=c(""),s=c(null),ne=w(()=>[{value:"Easy",label:i("admin.bots.captcha_easy")},{value:"Customize",label:i("admin.bots.captcha_customize")},{value:"ReferTo",label:i("admin.bots.captcha_referto")}]);async function ie(t){E.value=!0,H.value=!0,_.value="",h.value="",s.value=null;try{s.value=await X(t.chatId)}catch(e){_.value=e?.data?.error||e?.message||i("admin.bots.load_failed")}finally{H.value=!1}}async function de(){if(s.value){G.value=!0,_.value="",h.value="";try{const t=await Ae(s.value.chatId,s.value);t.success?h.value=i("common.saved"):_.value=t.error||i("admin.bots.save_failed_retry")}catch(t){_.value=t?.data?.error||t?.message||i("admin.bots.save_failed")}finally{G.value=!1}}}function ue(){s.value?.questions.push({id:"",title:"",questions:"",answer:""})}async function re(t){if(s.value){_.value="",h.value="";try{const e=await Le(s.value.chatId,t);e.success?(h.value=i("admin.bots.question_saved"),await O()):_.value=e.error||i("admin.bots.question_save_failed")}catch(e){_.value=e?.data?.error||e?.message||i("admin.bots.question_save_failed")}}}async function me(t){if(s.value){if(!t.id){s.value.questions=s.value.questions.filter(e=>e!==t);return}_.value="",h.value="";try{const e=await qe(s.value.chatId,t.id);e.success?(h.value=i("admin.bots.question_deleted"),await O()):_.value=e.error||i("admin.bots.delete_failed")}catch(e){_.value=e?.data?.error||e?.message||i("admin.bots.delete_failed")}}}async function O(){if(s.value)try{const t=await X(s.value.chatId);s.value.questions=t.questions}catch{}}return(t,e)=>{const d=ce,p=_e,g=be,f=pe,R=fe,ve=he;return m(),D(Ie,{wide:""},{default:u(()=>[l("div",Ne,[n(Me,{title:t.$t("admin.bots.page_title"),description:t.$t("admin.bots.subtitle",{groups:F.value,channels:Z.value,enabled:ae.value})},{actions:u(()=>[l("div",Ve,[l("div",Ee,[l("button",{type:"button",class:P({"is-on":$.value==="channel"}),onClick:e[0]||(e[0]=a=>$.value="channel")},o(t.$t("admin.bots.channel_tab",{n:Z.value})),3),l("button",{type:"button",class:P({"is-on":$.value==="group"}),onClick:e[1]||(e[1]=a=>$.value="group")},o(t.$t("admin.bots.group_tab",{n:F.value})),3)]),n(d,{value:q.value,"onUpdate:value":e[2]||(e[2]=a=>q.value=a),placeholder:t.$t("admin.bots.search_placeholder"),clearable:"",block:"",style:{"max-width":"240px"}},null,8,["value","placeholder"])])]),_:1},8,["title","description"]),M.value?(m(),b("p",He,[e[23]||(e[23]=l("i",{class:"fa-solid fa-circle-xmark"},null,-1)),r(o(M.value),1)])):C("",!0),T.value?(m(),b("p",Ge,[e[24]||(e[24]=l("i",{class:"fa-solid fa-circle-check"},null,-1)),r(o(T.value),1)])):C("",!0),n(g,{show:I(ee)},{default:u(()=>[I(te)?(m(),b("p",Re,o(t.$t("admin.bots.load_failed_refresh")),1)):(m(),D(Te,{key:1,padded:!1},{default:u(()=>[l("div",De,[l("table",Pe,[l("thead",null,[l("tr",null,[l("th",null,o(t.$t("admin.bots.th_group_channel")),1),l("th",Qe,o(t.$t("admin.bots.th_type")),1),l("th",Fe,o(t.$t("admin.bots.th_create_time")),1),e[25]||(e[25]=l("th",{style:{width:"92px"}},"ChatGPT",-1)),l("th",Ze,o(t.$t("admin.bots.th_image")),1),l("th",je,o(t.$t("admin.bots.th_web")),1),l("th",Ke,o(t.$t("admin.bots.th_translate")),1),l("th",Oe,o(t.$t("admin.bots.th_ops")),1)])]),l("tbody",null,[(m(!0),b(W,null,J(K.value,a=>(m(),b("tr",{key:a.chatId},[l("td",{"data-label":t.$t("admin.bots.th_group_channel")},[l("div",Xe,o(a.title),1),l("div",Ye,[r(o(a.chatId),1),a.userName?(m(),b(W,{key:0},[r(" · @"+o(a.userName),1)],64)):C("",!0)])],8,Je),l("td",{"data-label":t.$t("admin.bots.th_type")},[n(Be,{tone:a.isChannel?"info":"neutral"},{default:u(()=>[r(o(a.isChannel?t.$t("admin.bots.type_channel"):t.$t("admin.bots.type_group")),1)]),_:2},1032,["tone"])],8,xe),l("td",{class:"wc-bots__meta","data-label":t.$t("admin.bots.th_create_time")},o(se(a.createDate)),9,et),l("td",tt,[n(I(N),{size:"small",value:a.aiChat,loading:A(a,"aichat"),"onUpdate:value":v=>z(a,"aichat",v)},null,8,["value","loading","onUpdate:value"])]),l("td",{"data-label":t.$t("admin.bots.th_image")},[n(I(N),{size:"small",value:a.aiImage,loading:A(a,"image"),"onUpdate:value":v=>z(a,"image",v)},null,8,["value","loading","onUpdate:value"])],8,at),l("td",{"data-label":t.$t("admin.bots.th_web")},[n(I(N),{size:"small",value:a.aiWeb,loading:A(a,"web"),"onUpdate:value":v=>z(a,"web",v)},null,8,["value","loading","onUpdate:value"])],8,lt),l("td",{"data-label":t.$t("admin.bots.th_translate")},[n(I(N),{size:"small",value:a.translate,loading:A(a,"translate"),"onUpdate:value":v=>z(a,"translate",v)},null,8,["value","loading","onUpdate:value"])],8,st),l("td",{class:"wc-bots__ops","data-label":t.$t("admin.bots.th_ops")},[n(p,{size:"sm",onClick:v=>ie(a)},{default:u(()=>[e[26]||(e[26]=l("i",{class:"fa-solid fa-gear"},null,-1)),r(" "+o(t.$t("admin.bots.settings_btn")),1)]),_:1},8,["onClick"]),n(p,{size:"sm",variant:a.locked?"warm":"default",loading:A(a,"lock"),title:a.locked?t.$t("admin.bots.locked_title"):t.$t("admin.bots.unlocked_title"),onClick:v=>z(a,"lock",!a.locked)},{default:u(()=>[l("i",{class:P(a.locked?"fa-solid fa-lock":"fa-solid fa-lock-open")},null,2)]),_:2},1032,["variant","loading","title","onClick"]),U.value===a.chatId?(m(),b(W,{key:0},[n(p,{size:"sm",variant:"danger",loading:V.value===a.chatId,onClick:v=>oe(a)},{default:u(()=>[r(o(t.$t("admin.bots.confirm_leave")),1)]),_:1}
1,8,["loading","onClick"]),n(p,{size:"sm",onClick:e[3]||(e[3]=v=>U.value=0)},{default:u(()=>[r(o(t.$t("common.cancel")),1)]),_:1})],64)):(m(),D(p,{key:1,size:"sm",variant:"danger-soft",disabled:a.locked,title:a.locked?t.$t("admin.bots.locked_short_title"):t.$t("admin.bots.leave_remove_title"),onClick:v=>U.value=a.chatId},{default:u(()=>[e[27]||(e[27]=l("i",{class:"fa-solid fa-right-from-bracket"},null,-1)),r(" "+o(t.$t("admin.bots.leave_remove")),1)]),_:1},8,["disabled","title","onClick"]))],8,ot)]))),128)),K.value.length===0?(m(),b("tr",nt,[l("td",it,o(t.$t("admin.bots.no_match",{type:$.value==="channel"?t.$t("admin.bots.type_channel"):t.$t("admin.bots.type_group")})),1)])):C("",!0)])])])]),_:1}))]),_:1},8,["show"]),l("div",dt,[n(ge,{page:S.value,"onUpdate:page":e[4]||(e[4]=a=>S.value=a),"page-count":le.value},null,8,["page","page-count"])]),n(We,{show:E.value,"onUpdate:show":e[22]||(e[22]=a=>E.value=a),title:s.value?t.$t("admin.bots.dialog_title",{name:s.value.title,id:s.value.chatId}):t.$t("admin.bots.settings_btn"),"max-width":"760px",saving:G.value,disabled:!s.value,onSave:de},{default:u(()=>[n(g,{show:H.value},{default:u(()=>[_.value?(m(),b("p",ut,[e[28]||(e[28]=l("i",{class:"fa-solid fa-circle-xmark"},null,-1)),r(o(_.value),1)])):C("",!0),h.value?(m(),b("p",rt,[e[29]||(e[29]=l("i",{class:"fa-solid fa-circle-check"},null,-1)),r(o(h.value),1)])):C("",!0),s.value?(m(),b("div",mt,[l("label",vt,[l("span",null,o(t.$t("admin.bots.welcome_message")),1),n(d,{value:s.value.welcomeInfo,"onUpdate:value":e[5]||(e[5]=a=>s.value.welcomeInfo=a),type:"textarea",rows:3,block:""},null,8,["value"])]),l("label",ct,[l("span",null,o(t.$t("admin.bots.group_rules_url")),1),n(d,{value:s.value.groupRulesUrl,"onUpdate:value":e[6]||(e[6]=a=>s.value.groupRulesUrl=a),block:""},null,8,["value"])]),l("label",_t,[l("span",null,o(t.$t("admin.bots.log_channel_chat_id")),1),n(f,{value:s.value.executiveLogsChId,"onUpdate:value":e[7]||(e[7]=a=>s.value.executiveLogsChId=a),"show-button":!1,style:{width:"100%"}},null,8,["value"])]),l("label",bt,[l("span",null,o(t.$t("admin.bots.welcome_menu_buttons")),1),n(d,{value:s.value.customLinks,"onUpdate:value":e[8]||(e[8]=a=>s.value.customLinks=a),type:"textarea",rows:2,block:""},null,8,["value"])]),l("label",pt,[l("span",null,o(t.$t("admin.bots.new_member_limit")),1),n(f,{value:s.value.restrictedLimit,"onUpdate:value":e[9]||(e[9]=a=>s.value.restrictedLimit=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("label",ft,[l("span",null,o(t.$t("admin.bots.antiflood_mute")),1),n(f,{value:s.value.antifloodMuteHr,"onUpdate:value":e[10]||(e[10]=a=>s.value.antifloodMuteHr=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("label",ht,[l("span",null,o(t.$t("admin.bots.antispam_ratio")),1),n(f,{value:s.value.antiSpamRatio,"onUpdate:value":e[11]||(e[11]=a=>s.value.antiSpamRatio=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("div",gt,[n(R,{modelValue:s.value.longTextZip,"onUpdate:modelValue":e[12]||(e[12]=a=>s.value.longTextZip=a)},{default:u(()=>[r(o(t.$t("admin.bots.long_text_zip")),1)]),_:1},8,["modelValue"]),n(R,{modelValue:s.value.antiAd,"onUpdate:modelValue":e[13]||(e[13]=a=>s.value.antiAd=a)},{default:u(()=>[r(o(t.$t("admin.bots.anti_tg_ad")),1)]),_:1},8,["modelValue"])]),l("label",wt,[l("span",null,o(t.$t("admin.bots.ban_words")),1),n(d,{value:s.value.banWords,"onUpdate:value":e[14]||(e[14]=a=>s.value.banWords=a),type:"textarea",rows:3,block:""},null,8,["value"])]),l("label",$t,[l("span",null,o(t.$t("admin.bots.ban_words_mute_hours")),1),n(f,{value:s.value.banWordsMuteHours,"onUpdate:value":e[15]||(e[15]=a=>s.value.banWordsMuteHours=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("div",kt,[e[30]||(e[30]=l("i",{class:"fa-solid fa-key"},null,-1)),r(" "+o(t.$t("admin.bots.join_verification")),1)]),l("div",yt,[n(R,{modelValue:s.value.captchaEnabled,"onUpdate:modelValue":e[16]||(e[16]=a=>s.value.captchaEnabled=a)},{default:u(()=>[r(o(t.$t("admin.bots.enable_join_verification")),1)]),_:1},8,["modelValue"])]),l("label",Ct,[l("span",null,o(t.$t("admin.bots.verify_mode")),1),n(ve,{value:s.value.captchaMode,"onUpdate:value":e[17]||(e[17]=a=>s.value.captchaMode=a),options:ne.value,block:""}
1,null,8,["value","options"])]),l("label",Ut,[l("span",null,o(t.$t("admin.bots.wait_seconds")),1),n(f,{value:s.value.captchaWaitTimer,"onUpdate:value":e[18]||(e[18]=a=>s.value.captchaWaitTimer=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("label",It,[l("span",null,o(t.$t("admin.bots.wrong_answer_penalty")),1),n(f,{value:s.value.captchaErrBanHours,"onUpdate:value":e[19]||(e[19]=a=>s.value.captchaErrBanHours=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("label",St,[l("span",null,o(t.$t("admin.bots.linked_groups")),1),n(d,{value:s.value.linkGroups,"onUpdate:value":e[20]||(e[20]=a=>s.value.linkGroups=a),block:""},null,8,["value"])]),l("label",zt,[l("span",null,o(t.$t("admin.bots.linked_groups_min_msgs")),1),n(f,{value:s.value.referToGroupAndMinMsgs,"onUpdate:value":e[21]||(e[21]=a=>s.value.referToGroupAndMinMsgs=a),min:0,style:{width:"100%"}},null,8,["value"])]),l("div",At,[l("span",Lt,o(t.$t("admin.bots.custom_question_bank_hint")),1),n(p,{size:"sm",onClick:ue},{default:u(()=>[e[31]||(e[31]=l("i",{class:"fa-solid fa-plus"},null,-1)),r(" "+o(t.$t("admin.bots.add_question")),1)]),_:1})]),(m(!0),b(W,null,J(s.value.questions,(a,v)=>(m(),b("div",{key:a.id||`new-${v}`,class:"wc-bots__qcard"},[l("div",qt,[n(d,{value:a.title,"onUpdate:value":y=>a.title=y,size:"sm",placeholder:t.$t("admin.bots.question_title_ph"),block:""},null,8,["value","onUpdate:value","placeholder"]),n(d,{value:a.answer,"onUpdate:value":y=>a.answer=y,size:"sm",placeholder:t.$t("admin.bots.answer_ph"),block:""},null,8,["value","onUpdate:value","placeholder"])]),n(d,{value:a.questions,"onUpdate:value":y=>a.questions=y,size:"sm",type:"textarea",rows:2,placeholder:t.$t("admin.bots.questions_ph"),block:""},null,8,["value","onUpdate:value","placeholder"]),l("div",Mt,[n(p,{size:"xs",onClick:y=>re(a)},{default:u(()=>[r(o(t.$t("admin.bots.save_question")),1)]),_:1},8,["onClick"]),n(p,{size:"xs",variant:"danger-soft",onClick:y=>me(a)},{default:u(()=>[r(o(t.$t("common.delete")),1)]),_:1},8,["onClick"])])]))),128))])):C("",!0)]),_:1},8,["show"])]),_:1},8,["show","title","saving","disabled"])])]),_:1})}}}),va=Ce(Tt,[["__scopeId","data-v-fa20a88a"]]);export{va 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.