metacubexd/assets/Proxies-Lk5uJ4LX.js

12 lines
16 KiB
JavaScript
Raw Normal View History

import{ap as Oe,o as Pe,aq as Be,ar as Ae,as as he,L as Re,at as je,A as ie,N as Se,u as ne,d as e,au as He,i as l,ac as I,av as Fe,aw as ze,D as w,ax as We,ay as Ye,F as B,az as Ke,aA as Ve,aB as Qe,aC as Xe,aD as K,aE as Ze,aF as qe,g as y,aG as Je,aH as Ge,aI as et,aJ as ae,aK as Te,aL as Ne,aM as te,aN as re,aO as ce,Q as tt,t as m,aP as rt,aQ as me,S as P,aR as D,aS as Le,aT as de,Z as V,Y as Ue,a9 as Ee,H as oe,E as nt,W as lt,aU as st,K as it,b as at,y as ct,R as ot,T as dt,B as q,a0 as ut,aV as gt,aW as fe,aX as vt,aY as be,aZ as pe,l as ht}from"./index-Csmv4Fkv.js";import{D as mt}from"./DocumentTitle-DG90V81t.js";import{f as ft}from"./time-CHbJgbks.js";import{I as xe}from"./IconReload--QlVe2wP.js";function ye(n){const r={...n},s={...n},i={},d=c=>{let h=i[c];if(!h){if(!je())return r[c];i[c]=h=ie(r[c],{internal:!0}),delete r[c]}return h[0]()};for(const c in n)Object.defineProperty(s,c,{get:()=>d(c),enumerable:!0});const a=(c,h)=>{const o=i[c];if(o)return o[1](h);c in r&&(r[c]=he(h,[r[c]]))};return[s,(c,h)=>{if(Be(c)){const o=Ae(()=>Object.entries(he(c,s)));Re(()=>{for(const[S,p]of o)a(S,()=>p)})}else a(c,h);return s}]}function bt(n,r){if(Oe.context){const[s,i]=ye(n);return Pe(()=>i(r())),[s,i]}return ye(r())}/**
* @license @tabler/icons-solidjs v3.26.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/var we=Se("outline","brand-speedtest","IconBrandSpeedtest",[["path",{d:"M5.636 19.364a9 9 0 1 1 12.728 0"}],["path",{d:"M16 9l-4 4"}]]);/**
* @license @tabler/icons-solidjs v3.26.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/var pt=Se("outline","chevron-right","IconChevronRight",[["path",{d:"M9 6l6 6l-6 6"}]]),xt=m('<div class="flex flex-col gap-4"><div><div class="flex w-full justify-center"><input class=toggle type=checkbox></div></div><div class="flex flex-col"><input class="input input-bordered w-full"></div><div><input type=number class="input input-bordered w-full"></div><div><select class="select select-bordered w-full"></select></div><div><div class="flex w-full justify-center"><input class=toggle type=checkbox></div></div><div><div class="flex w-full justify-center"><input class=toggle type=checkbox></div></div><div><select class="select select-bordered w-full"></select></div><div><input type=number class="input input-bordered w-full"><input type=number class="input input-bordered w-full">'),yt=m('<option class="flex items-center gap-2">'),wt=m("<option>");const $t=n=>{const[r]=ne();return e(tt,{ref:s=>{var i;return(i=n.ref)==null?void 0:i.call(n,s)},get icon(){return e(He,{size:24})},get title(){return r("proxiesSettings")},get children(){var s=xt(),i=s.firstChild,d=i.firstChild,a=d.firstChild,c=i.nextSibling,h=c.firstChild,o=c.nextSibling,S=o.firstChild,p=o.nextSibling,$=p.firstChild,T=p.nextSibling,M=T.firstChild,x=M.firstChild,N=T.nextSibling,k=N.firstChild,_=k.firstChild,U=N.nextSibling,A=U.firstChild,Q=U.nextSibling,F=Q.firstChild,X=F.nextSibling;return l(i,e(I,{withDivider:!0,get children(){return r("autoCloseConns")}}),d),a.addEventListener("change",g=>Fe(g.target.checked)),l(c,e(I,{withDivider:!0,get children(){return r("urlForLatencyTest")}}),h),h.addEventListener("change",g=>ze(g.target.value)),l(o,e(I,{withDivider:!0,get children(){return[w(()=>r("latencyTestTimeoutDuration"))," (",w(()=>r("ms")),")"]}}),S),S.addEventListener("change",g=>We(Number(g.target.value))),l(p,e(I,{withDivider:!0,get children(){return r("proxiesSorting")}}),$),$.addEventListener("change",g=>Ye(g.target.value)),l($,e(B,{get each(){return Object.values(Ke)},children:g=>(()=>{var E=yt();return E.value=g,l(E,()=>r(g)),E})()})),l(T,e(I,{withDivider:!0,get children(){return r("hideUnavailableProxies")}}),M),x.addEventListener("change",g=>Ve(g.target.checked)),l(N,e(I,{withDivider:!0,get children(){return r("renderInTwoColumns")}}),k),_.addEventListener("change",g=>Qe(g.target.checked)),l(U,e(I,{withDivider:!0,get children(){return r("proxiesPreviewType")}}),A),A.addEventListener("change",g=>Xe(g.target.value)),l(A,e(B,{get each(){return Object.values(K)},children:g=>(()=>{var E=wt();return E.value=g,l(E,()=>r(g)),E})()})),l(Q,e(I,{withDivider:!0,get children(){return r("iconHeight")}}),F),F.addEventListener("change",g=>Ze(Number(g.target.value))),l(Q,e(I,{withDivider:!0,get children(){return r("iconMarginRight")}}),X),X.addEventListener("change",g=>qe(Number(g.target.value))),y(()=>a.checked=Je()),y(()=>h.value=Ge()),y(()=>S.value=et()),y(()=>$.value=ae()),y(()=>x.checked=Te()),y(()=>_.checked=Ne()),y(()=>A.value=te()),y(()=>F.value=re()),y(()=>X.value=ce()),s}})},$e=n=>{const r=()=>te()===K.OFF,s=w(()=>n.proxyNameList.length<=10),i=w(()=>{const a=te();return a===K.BAR||a===K.Auto&&!s()}),d=w(()=>{const a=te();return a===K.DOTS||a===K.Auto&&s()});return e(P,{get when(){return!r()},get children(){return e(rt,{get children(){return[e(me,{get when(){return i()},get children(){return e(Ct,{get proxyNameList(){return n.proxyNameList},get testUrl(){return n.testUrl},get now(){return n.now}})}}),e(me,{get when(){return d()},get children(){return e(Nt,{get proxyNameList(){return n.proxyNameList},get testUrl(){return n.testUrl},get now(){return n.now}})}})]}})}})};var _t=m('<div class="flex items-center gap-2"><div class="my-1 flex flex-1 items-center justify-center overflow-hidden rounded-2xl [&amp;>*]:h-2"><div class=bg-green-600></div><div class=bg-yellow-500></div><div class=bg-red-500></div><div class=bg-neutral>');const Ct=n=>{const{getLatencyByName:r}=de(),s=w(()=>n.proxyNameList.map(o=>r(o,n.testUrl))),i=w(()=>s().length),d=w(()=>s().filter(o=>o>D().NOT_CONNECTED&&o<=D().MEDIUM).length),a=w(()=>s().filter(o=>o>D().MEDIUM&&o<=D().HIGH).length),c=w((