PageSourceSearch

https://2done.club/vite/2GYnEfsp.js

js 2done.club collected 2026-09-25 21:48:55 UTC 3,417 bytes, 1 lines download raw bytes

1import{e as b,d as S,$ as w,i as x,a8 as V,as as R,ad as Q}from"./app-SxTnnON6.js";import{F as T}from"./5D3Hifdz.js";import{b as H,a as v,e as P,A as $,g as t,h as A,i as a,L as c,H as p,u as m,q as f,j as D,B as r,l as i,F as I,D as L,C as O}from"./BO4IXnZa.js";import"./90S9tBZd.js";const Y=["onClick"],W=["onClick"],K=H({__name:"MkUserSelectDialog",props:{includeSelf:{type:Boolean,default:!1},localOnly:{type:Boolean,default:!1}},emits:["ok","cancel","closed"],setup(_,{emit:E}){const h=E,y=_,n=v(""),d=v(""),k=v([]),N=v([]),l=v(null),B=v();function C(){if(n.value===""&&d.value===""){k.value=[];return}b("users/search-by-username-and-host",{username:n.value,host:y.localOnly?".":d.value,limit:10,detail:!1}).then(o=>{k.value=o.filter(e=>y.includeSelf?!0:e.id!==w?.id)})}async function U(){if(l.value==null)return;const o=await b("users/show",{userId:l.value.id});h("ok",o),B.value.close();let e=S.state.recentlyUsedUsers;e=e.filter(u=>u!==l.value?.id),e.unshift(l.value.id),S.set("recentlyUsedUsers",e.splice(0,16))}function g(){h("cancel"),B.value.close()}return P(()=>{b("users/show",{userIds:S.state.recentlyUsedUsers}).then(o=>{let e=o;e=e.filter(u=>y.localOnly?u.host==null:!0),e=e.filter(u=>y.includeSelf?!0:u.id!==w?.id),N.value=e})}),(o,e)=>{const u=$("MkAvatar"),q=$("MkUserName"),F=$("MkAcct");return t(),A(Q,{ref_key:"dialogEl",ref:B,withOkButton:!0,okButtonDisabled:l.value==null,onClick:e[5]||(e[5]=s=>g()),onClose:e[6]||(e[6]=s=>g()),onOk:e[7]||(e[7]=s=>U()),onClosed:e[8]||(e[8]=s=>o.$emit("closed"))},{header:a(()=>[c(p(m(x).ts.selectUser),1)]),default:a(()=>[f("div",null,[f("div",{class:"xu4Mf"},[o.localOnly?(t(),A(V,{key:0,modelValue:n.value,"onUpdate:modelValue":[e[0]||(e[0]=s=>n.value=s),C],autofocus:!0},{label:a(()=>[c(p(m(x).ts.username),1)]),prefix:a(()=>[c("@")]),_:1},8,["modelValue"])):(t(),A(T,{key:1,minWidth:170},{default:a(()=>[r(V,{modelValue:n.value,"onUpdate:modelValue":[e[1]||(e[1]=s=>n.value=s),C],autofocus:!0},{label:a(()=>[c(p(m(x).ts.username),1)]),prefix:a(()=>[c("@")]),_:1},8,["modelValue"]),r(V,{modelValue:d.value,"onUpdate:modelValue":[e[2]||(e[2]=s=>d.value=s),C],datalist:[m(R)]},{label:a(()=>[c(p(m(x).ts.host),1)]),prefix:a(()=>[c("@")]),_:1},8,["modelValue","datalist"])]),_:1}))],2),n.value!=""||d.value!=""?(t(),i("div",{key:0,class:D(["xdLBZ",{x4RNE:k.value.length>0}])},[k.value.length>0?(t(),i("div",{key:0,class:"xA2h8"},[(t(!0),i(I,null,L(k.value,s=>(t(),i("div",{key:s.id,class:D(["_button",["x7FR4",{xCY0B:l.value&&l.value.id===s.id}]]),onClick:M=>l.value=s,onDblclick:e[3]||(e[3]=M=>U())},[r(u,{user:s,class:"xp6IS",indicator:""},null,8,["user","class"]),f("div",{class:"xlcTD"},[r(q,{user:s,class:"xb67P"},null,8,["user","class"]),r(F,{user:s,class:"xSqlq"},null,8,["user","class"])],2)],42,Y))),128))],2)):(t(),i("div",{key:1,class:"x8QHa"},[f("span",null,p(m(x).ts.noUsers),1)],2))],2)):O("",!0),n.value==""&&d.value==""?(t(),i("div",{key:1,class:"x5L9Q"},[f("div",{class:"xA2h8"},[(t(!0),i(I,null,L(N.value,s=>(t(),i("div",{key:s.id,class:D(["_button",["x7FR4",{xCY0B:l.value&&l.value.id===s.id}]]),onClick:M=>l.value=s,onDblclick:e[4]||(e[4]=M=>U())},[r(u,{user:s,class:"xp6IS",indicator:""},null,8,["user","class"]),f("div",{class:"xlcTD"},[r(q,{user:s,class:"xb67P"},null,8,["user","class"]),r(F,{user:s,class:"xSqlq"},null,8,["user","class"])],2)],42,W))),128))],2)],2)):O("",!0)])]),_:1},8,["okButtonDisabled"])}}});export{K 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.