Add nosleep to cracker interface

This commit is contained in:
Jack Kingsman committed 2026-01-06 21:16:05 -08:00
1 parent 1eba08ce88
commit e33275a2fc
7 files changed
+576 -539

No files matched your search

+14
View File
@@ -76,6 +76,20 @@ MESHCORE_SERIAL_PORT=/dev/ttyUSB0 uv run uvicorn app.main:app --host 0.0.0.0 --p
Access the app at http://localhost:8000 (or your server's IP/hostname).
### HTTPS (Required for WebGPU Cracking)
WebGPU requires a secure context. To use the channel key cracker, serve over HTTPS:
```bash
# Generate self-signed cert
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'
# Run with SSL
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=key.pem --ssl-certfile=cert.pem
```
Accept the browser security warning on first visit. For locally-trusted certs without warnings, use [mkcert](https://github.com/FiloSottile/mkcert).
### Systemd Service (Linux)
To run as a system service:
+542
View File
@@ -0,0 +1,542 @@
function o1(r,o){for(var a=0;a<o.length;a++){const s=o[a];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in r)){const l=Object.getOwnPropertyDescriptor(s,c);l&&Object.defineProperty(r,c,l.get?l:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&s(A)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function nu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Oe={};/**
* @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 eh;function a1(){if(eh)return Oe;eh=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=p&&k[p]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function y(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}y.prototype.isReactComponent={},y.prototype.setState=function(k,O){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,O,"setState")},y.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function x(){}x.prototype=y.prototype;function C(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}var w=C.prototype=new x;w.constructor=C,b(w,y.prototype),w.isPureReactComponent=!0;var T=Array.isArray,R=Object.prototype.hasOwnProperty,D={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function I(k,O,z){var V,re={},ue=null,de=null;if(O!=null)for(V in O.ref!==void 0&&(de=O.ref),O.key!==void 0&&(ue=""+O.key),O)R.call(O,V)&&!N.hasOwnProperty(V)&&(re[V]=O[V]);var oe=arguments.length-2;if(oe===1)re.children=z;else if(1<oe){for(var Be=Array(oe),ze=0;ze<oe;ze++)Be[ze]=arguments[ze+2];re.children=Be}if(k&&k.defaultProps)for(V in oe=k.defaultProps,oe)re[V]===void 0&&(re[V]=oe[V]);return{$$typeof:r,type:k,key:ue,ref:de,props:re,_owner:D.current}}function F(k,O){return{$$typeof:r,type:k.type,key:O,ref:k.ref,props:k.props,_owner:k._owner}}function j(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function L(k){var O={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(z){return O[z]})}var G=/\/+/g;function K(k,O){return typeof k=="object"&&k!==null&&k.key!=null?L(""+k.key):O.toString(36)}function ee(k,O,z,V,re){var ue=typeof k;(ue==="undefined"||ue==="boolean")&&(k=null);var de=!1;if(k===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(k.$$typeof){case r:case o:de=!0}}if(de)return de=k,re=re(de),k=V===""?"."+K(de,0):V,T(re)?(z="",k!=null&&(z=k.replace(G,"$&/")+"/"),ee(re,O,z,"",function(ze){return ze})):re!=null&&(j(re)&&(re=F(re,z+(!re.key||de&&de.key===re.key?"":(""+re.key).replace(G,"$&/")+"/")+k)),O.push(re)),1;if(de=0,V=V===""?".":V+":",T(k))for(var oe=0;oe<k.length;oe++){ue=k[oe];var Be=V+K(ue,oe);de+=ee(ue,O,z,Be,re)}else if(Be=v(k),typeof Be=="function")for(k=Be.call(k),oe=0;!(ue=k.next()).done;)ue=ue.value,Be=V+K(ue,oe++),de+=ee(ue,O,z,Be,re);else if(ue==="object")throw O=String(k),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return de}function se(k,O,z){if(k==null)return k;var V=[],re=0;return ee(k,V,"","",function(ue){return O.call(z,ue,re++)}),V}function J(k){if(k._status===-1){var O=k._result;O=O(),O.then(function(z){(k._status===0||k._status===-1)&&(k._status=1,k._result=z)},function(z){(k._status===0||k._status===-1)&&(k._status=2,k._result=z)}),k._status===-1&&(k._status=0,k._result=O)}if(k._status===1)return k._result.default;throw k._result}var ne={current:null},W={transition:null},X={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:se,forEach:function(k,O,z){se(k,function(){O.apply(this,arguments)},z)},count:function(k){var O=0;return se(k,function(){O++}),O},toArray:function(k){return se(k,function(O){return O})||[]},only:function(k){if(!j(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},Oe.Component=y,Oe.Fragment=a,Oe.Profiler=c,Oe.PureComponent=C,Oe.StrictMode=s,Oe.Suspense=f,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,Oe.act=Z,Oe.cloneElement=function(k,O,z){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var V=b({},k.props),re=k.key,ue=k.ref,de=k._owner;if(O!=null){if(O.ref!==void 0&&(ue=O.ref,de=D.current),O.key!==void 0&&(re=""+O.key),k.type&&k.type.defaultProps)var oe=k.type.defaultProps;for(Be in O)R.call(O,Be)&&!N.hasOwnProperty(Be)&&(V[Be]=O[Be]===void 0&&oe!==void 0?oe[Be]:O[Be])}var Be=arguments.length-2;if(Be===1)V.children=z;else if(1<Be){oe=Array(Be);for(var ze=0;ze<Be;ze++)oe[ze]=arguments[ze+2];V.children=oe}return{$$typeof:r,type:k.type,key:re,ref:ue,props:V,_owner:de}},Oe.createConLine truncated
* @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 rh;function s1(){if(rh)return da;rh=1;var r=ou(),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(u,f,h){var m,p={},v=null,_=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(_=f.ref);for(m in f)s.call(f,m)&&!l.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:o,type:u,key:v,ref:_,props:p,_owner:c.current}}return da.Fragment=a,da.jsx=A,da.jsxs=A,da}var nh;function i1(){return nh||(nh=1,ic.exports=s1()),ic.exports}var P=i1(),B=ou();const he=nu(B),au=o1({__proto__:null,default:he},[B]);var js={},cc={exports:{}},rr={},uc={exports:{}},dc={};/**
* @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.
*/var oh;function l1(){return oh||(oh=1,(function(r){function o(W,X){var Z=W.length;W.push(X);e:for(;0<Z;){var k=Z-1>>>1,O=W[k];if(0<c(O,X))W[k]=X,W[Z]=O,Z=k;else break e}}function a(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var X=W[0],Z=W.pop();if(Z!==X){W[0]=Z;e:for(var k=0,O=W.length,z=O>>>1;k<z;){var V=2*(k+1)-1,re=W[V],ue=V+1,de=W[ue];if(0>c(re,Z))ue<O&&0>c(de,re)?(W[k]=de,W[ue]=Z,k=ue):(W[k]=re,W[V]=Z,k=V);else if(ue<O&&0>c(de,Z))W[k]=de,W[ue]=Z,k=ue;else break e}}return X}function c(W,X){var Z=W.sortIndex-X.sortIndex;return Z!==0?Z:W.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,u=A.now();r.unstable_now=function(){return A.now()-u}}var f=[],h=[],m=1,p=null,v=3,_=!1,b=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,C=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(W){for(var X=a(h);X!==null;){if(X.callback===null)s(h);else if(X.startTime<=W)s(h),X.sortIndex=X.expirationTime,o(f,X);else break;X=a(h)}}function T(W){if(S=!1,w(W),!b)if(a(f)!==null)b=!0,J(R);else{var X=a(h);X!==null&&ne(T,X.startTime-W)}}function R(W,X){b=!1,S&&(S=!1,x(I),I=-1),_=!0;var Z=v;try{for(w(X),p=a(f);p!==null&&(!(p.expirationTime>X)||W&&!L());){var k=p.callback;if(typeof k=="function"){p.callback=null,v=p.priorityLevel;var O=k(p.expirationTime<=X);X=r.unstable_now(),typeof O=="function"?p.callback=O:p===a(f)&&s(f),w(X)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var V=a(h);V!==null&&ne(T,V.startTime-X),z=!1}return z}finally{p=null,v=Z,_=!1}}var D=!1,N=null,I=-1,F=5,j=-1;function L(){return!(r.unstable_now()-j<F)}function G(){if(N!==null){var W=r.unstable_now();j=W;var X=!0;try{X=N(!0,W)}finally{X?K():(D=!1,N=null)}}else D=!1}var K;if(typeof C=="function")K=function(){C(G)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,se=ee.port2;ee.port1.onmessage=G,K=function(){se.postMessage(null)}}else K=function(){y(G,0)};function J(W){N=W,D||(D=!0,K())}function ne(W,X){I=y(function(){W(r.unstable_now())},X)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(W){W.callback=null},r.unstable_continueExecution=function(){b||_||(b=!0,J(R))},r.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<W?Math.floor(1e3/W):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(W){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var Z=v;v=X;try{return W()}finally{v=Z}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Z=v;v=W;try{return X()}finally{v=Z}},r.unstable_scheduleCallback=function(W,X,Z){var k=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?k+Z:k):Z=k,W){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Z+O,W={id:m++,callback:X,priorityLevel:W,startTime:Z,expirationTime:O,sortIndex:-1},Z>k?(W.sortIndex=Z,o(h,W),a(f)===null&&W===a(h)&&(S?(x(I),I=-1):S=!0,ne(T,Z-k))):(W.sortIndex=O,o(f,W),b||_||(b=!0,J(R))),W},r.unstable_shouldYield=L,r.unstable_wrapCallback=function(W){var X=v;return function(){var Z=v;v=X;try{return W.apply(this,arguments)}finally{v=Z}}}})(dc)),dc}var ah;function c1(){return ah||(ah=1,uc.exports=l1()),uc.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 sh;function u1(){if(sh)return rr;sh=1;var r=ou(),o=c1();function a(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 s=new Set,c={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function v(e){return f.call(p,e)?!0:f.call(m,e)?!1:h.test(e)?p[e]=!0:(m[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)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 S(e,t,n,i,d,g,E){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=g,this.removeEmptyString=E}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];y[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new S(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){y[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function C(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-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function w(e,t,n,i){var d=y.hasOwnProperty(t)?y[t]:null;(d!==null?d.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!= Line truncated
`+k+e}var z=!1;function V(e,t){if(!e||z)return"";z=!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(Y){var i=Y}Reflect.construct(e,[],t)}else{try{t.call()}catch(Y){i=Y}e.call(t.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var d=Y.stack.split(`
`),g=i.stack.split(`
`),E=d.length-1,M=g.length-1;1<=E&&0<=M&&d[E]!==g[M];)M--;for(;1<=E&&0<=M;E--,M--)if(d[E]!==g[M]){if(E!==1||M!==1)do if(E--,M--,0>M||d[E]!==g[M]){var H=`
`+d[E].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=E&&0<=M);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function re(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function ue(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 N:return"Fragment";case D:return"Portal";case F:return"Profiler";case I:return"StrictMode";case K:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(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 ue(t);case 8:return t===I?"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 oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,g=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(E){i=""+E,g.call(this,E)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){e._valueTracker||(e._valueTracker=ze(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Be(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ft(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 Je(e,t){var n=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ar(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=oe(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ut(e,t){t=t.checked,t!=null&&w(e,"checked",t,!1)}function Et(e,t){Ut(e,t);var n=oe(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ht(e,t.type,n):t.hasOwnProperty("defaultValue")&&ht(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ht(e,t,n){(t!=="number"||ft(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var It=Array.isArray;function nt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d<n.length;d++)t["$"+n[d]]=!0;for(n=0;n<e.length;n++)d=t.hasOwnProperty("$"+e[n].value),e[n].selected!==d&&(e[n].selected=d),d&&i&&(e[n].defaultSelected=!0)}else{for(n=""+oe(n),t=null,d=0;d<e.length;d++){if(e[d].value===n){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ve(e,t){if(t.dangerouslySetInnerHTML! Line truncated
`).replace(gm,"")}function Ka(e,t,n){if(t=vd(t),vd(e)!==t&&n)throw Error(a(425))}function Ya(){}var Ji=null,$i=null;function el(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 tl=typeof setTimeout=="function"?setTimeout:void 0,vm=typeof clearTimeout=="function"?clearTimeout:void 0,yd=typeof Promise=="function"?Promise:void 0,ym=typeof queueMicrotask=="function"?queueMicrotask:typeof yd<"u"?function(e){return yd.resolve(null).then(e).catch(xm)}:tl;function xm(e){setTimeout(function(){throw e})}function rl(e,t){var n=t,i=0;do{var d=n.nextSibling;if(e.removeChild(n),d&&d.nodeType===8)if(n=d.data,n==="/$"){if(i===0){e.removeChild(d),Fo(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Fo(t)}function an(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 xd(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 Jn=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Jn,Yo="__reactProps$"+Jn,Ur="__reactContainer$"+Jn,nl="__reactEvents$"+Jn,wm="__reactListeners$"+Jn,bm="__reactHandles$"+Jn;function Sn(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xd(e);e!==null;){if(n=e[Dr])return n;e=xd(e)}return t}e=n,n=e.parentNode}return null}function Zo(e){return e=e[Dr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $n(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Za(e){return e[Yo]||null}var ol=[],eo=-1;function sn(e){return{current:e}}function st(e){0>eo||(e.current=ol[eo],ol[eo]=null,eo--)}function et(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Lt=sn(ln),Xt=sn(!1),En=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},g;for(g in n)d[g]=t[g];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Jt(e){return e=e.childContextTypes,e!=null}function Xa(){st(Xt),st(Lt)}function wd(e,t,n){if(Lt.current!==ln)throw Error(a(168));et(Lt,t),et(Xt,n)}function bd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,de(e)||"Unknown",d));return Z({},n,i)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,En=Lt.current,et(Lt,e),et(Xt,Xt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=bd(e,t,En),i.__reactInternalMemoizedMergedChildContext=e,st(Xt),st(Lt),et(Lt,e)):st(Xt),et(Xt,n)}var Wr=null,$a=!1,al=!1;function Cd(e){Wr===null?Wr=[e]:Wr.push(e)}function _m(e){$a=!0,Cd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Wr=null,$a=!1}catch(d){throw Wr!==null&&(Wr=Wr.slice(e+1)),Su(Ei,cn),d}finally{Ye=t,al=!1}}return null}var ro=[],no=0,es=null,ts=0,hr=[],Ar=0,Rn=null,Qr=1,Gr="";function Tn(e,t){ro[no++]=ts,ro[no++]=es,es=e,ts=t}function kd(e,t,n){hr[Ar++]=Qr,hr[Ar++]=Gr,hr[Ar++]=Rn,Rn=e;var i=Qr;e=Gr;var d=32-br(i)-1;i&=~(1<<d),n+=1;var g=32-br(t)+d;if(30<g){var E=d-d%5;g=(i&(1<<E)-1).toString(32),i>>=E,d-=E,Qr=1<<32-br(t)+d|n<<d|i,Gr=g+e}else Qr=1<<g|n<<d|i,Gr=e}function sl(e){e.return!==null&&(Tn(e,1),kd(e,1,0))}function il(e){for(;e===es;)es=ro[--no],ro[no]=null,ts=ro[--no],ro[no]=null;for(;e===Rn;)Rn=hr[--Ar],hr[Ar]=null,Gr=hr[--Ar],hr[Ar]=null,Qr=hr[--Ar],hr[Ar]=null}var ir=null,lr=null,lt=!1,Cr=null;function Sd(e,t){var n=vr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ed(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ir=e,lr=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ir=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:Qr,overflow:Gr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ir=e,lr=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cl(e){if(lt){var t=lr;if(t){var n=t;if(!Ed(e,t)){if(ll(e))throw Error(a(418));t=an(n.nextSibling);var i=ir;t&&Ed(e,t)?Sd(i,n):(e.flags=e.flags&-4097|2,lt=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,lt=!1,ir=e}}}function Rd(e){for(e=e. Line truncated
Error generating stack: `+g.message+`
`+g.stack}return{value:e,source:t,stack:d,digest:null}}function Pl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Nm=typeof WeakMap=="function"?WeakMap:Map;function cf(e,t,n){n=Kr(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){ws||(ws=!0,ql=i),Nl(e,t)},n}function uf(e,t,n){n=Kr(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=t.value;n.payload=function(){return i(d)},n.callback=function(){Nl(e,t)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(n.callback=function(){Nl(e,t),typeof i!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var E=t.stack;this.componentDidCatch(t.value,{componentStack:E!==null?E:""})}),n}function df(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Nm;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(n)||(d.add(n),e=Gm.bind(null,e,t,n),t.then(e,e))}function ff(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 hf(e,t,n,i,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Kr(-1,1),t.tag=2,dn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Dm=T.ReactCurrentOwner,$t=!1;function Gt(e,t,n,i){t.child=e===null?Nd(t,null,n,i):ao(t,e.child,n,i)}function Af(e,t,n,i,d){n=n.render;var g=t.ref;return io(t,d),i=_l(e,t,n,i,g,d),n=Cl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&n&&sl(t),t.flags|=1,Gt(e,t,i,d),t.child)}function pf(e,t,n,i,d){if(e===null){var g=n.type;return typeof g=="function"&&!ec(g)&&g.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=g,mf(e,t,g,i,d)):(e=Es(n.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,(e.lanes&d)===0){var E=g.memoizedProps;if(n=n.compare,n=n!==null?n:Wo,n(E,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=gn(g,i),e.ref=t.ref,e.return=t,t.child=e}function mf(e,t,n,i,d){if(e!==null){var g=e.memoizedProps;if(Wo(g,i)&&e.ref===t.ref)if($t=!1,t.pendingProps=i=g,(e.lanes&d)!==0)(e.flags&131072)!==0&&($t=!0);else return t.lanes=e.lanes,Yr(e,t,d)}return Dl(e,t,n,i,d)}function gf(e,t,n){var i=t.pendingProps,d=i.children,g=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(fo,cr),cr|=n;else{if((n&1073741824)===0)return e=g!==null?g.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(fo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=g!==null?g.baseLanes:n,et(fo,cr),cr|=i}else g!==null?(i=g.baseLanes|n,t.memoizedState=null):i=n,et(fo,cr),cr|=i;return Gt(e,t,d,n),t.child}function vf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dl(e,t,n,i,d){var g=Jt(n)?En:Lt.current;return g=to(t,g),io(t,d),n=_l(e,t,n,i,g,d),i=Cl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&i&&sl(t),t.flags|=1,Gt(e,t,n,d),t.child)}function yf(e,t,n,i,d){if(Jt(n)){var g=!0;Ja(t)}else g=!1;if(io(t,d),t.stateNode===null)ms(e,t),sf(t,n,i),Bl(t,n,i,d),i=!0;else if(e===null){var E=t.stateNode,M=t.memoizedProps;E.props=M;var H=E.context,Y=n.contextType;typeof Y=="object"&&Y!==null?Y=pr(Y):(Y=Jt(n)?En:Lt.current,Y=to(t,Y));var ie=n.getDerivedStateFromProps,ce=typeof ie=="function"||typeof E.getSnapshotBeforeUpdate=="function";ce||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==i||H!==Y)&&lf(t,E,i,Y),un=!1;var ae=t.memoizedState;E.state=ae,is(t,i,E,d),H=t.memoizedState,M!==i||ae!==H||Xt.current||un?(typeof ie=="function"&&(Tl(t,n,ie,i),H=t.memoizedState),(M=un||af(t,n,M,i,ae,H,Y))?(ce||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),E.props=i,E.state=H,E.context=Y,i=M):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{E=t.stateNode,Id(e,t),M=t.memoizedProps,Y=t.type===t.elementType?M:kr(t.type,M),E.props=Y,ce=t.pendingProps,ae=E.context,H=n.contextType,typeof H=="object"&&H!==null?H=pr(H):(H=Jt(n)?En:Lt.current,H=to(t,H));var pe=n.getDerivedStateFromProps;(ie=typeof pe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==ce||ae!==H)&&lf(t,E,i,H),un=!1,ae=t.memoizedState,E Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const p1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),ch=r=>{const o=m1(r);return o.charAt(0).toUpperCase()+o.slice(1)},oA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),g1=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var v1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y1=B.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:A,...u},f)=>B.createElement("svg",{ref:f,...v1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:oA("lucide",c),...!l&&!g1(u)&&{"aria-hidden":"true"},...u},[...A.map(([h,m])=>B.createElement(h,m)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const su=(r,o)=>{const a=B.forwardRef(({className:s,...c},l)=>B.createElement(y1,{ref:l,iconNode:o,className:oA(`lucide-${p1(ch(r))}`,`lucide-${r}`,s),...c}));return a.displayName=ch(r),a};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],w1=su("check",x1);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const b1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_1=su("menu",b1);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const C1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aA=su("x",C1);var sA=nA();const iA=nu(sA);function k1(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const S1=r=>{switch(r){case"success":return T1;case"info":return P1;case"warning":return B1;case"error":return N1;default:return null}},E1=Array(12).fill(0),R1=({visible:r,className:o})=>he.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},E1.map((a,s)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),T1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),B1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),P1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),D1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I1=()=>{const[r,o]=he.useState(document.hidden);return he.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Qc=1;class j1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Qc++,A=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,A;const u=c.then(async h=>{if(A=["resolve",h],he.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(O1(h)&&!h.ok){l=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,b=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...b})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,Line truncated
`).map((J,ne,W)=>P.jsxs("span",{children:[J,ne<W.length-1&&P.jsx("br",{})]},ne)),!L&&P.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:bh(x.sender_timestamp||x.received_at)}),x.outgoing&&(x.acked?" ✓":" ?")]})]})]},x.id)})]})}const uv=B.forwardRef(function({onSend:o,disabled:a,placeholder:s},c){const[l,A]=B.useState(""),[u,f]=B.useState(!1),h=B.useRef(null);B.useImperativeHandle(c,()=>({appendText:v=>{var _;A(b=>b+v),(_=h.current)==null||_.focus()}}));const m=B.useCallback(async v=>{v.preventDefault();const _=l.trim();if(!(!_||u||a)){f(!0);try{await o(_),A("")}catch(b){console.error("Failed to send message:",b)}finally{f(!1)}}},[l,u,a,o]),p=B.useCallback(v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),m(v))},[m]);return P.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:m,children:[P.jsx(bt,{ref:h,type:"text",value:l,onChange:v=>A(v.target.value),onKeyDown:p,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),P.jsx(Vr,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function St(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function dv(r,o){const a=B.createContext(o),s=l=>{const{children:A,...u}=l,f=B.useMemo(()=>u,Object.values(u));return P.jsx(a.Provider,{value:f,children:A})};s.displayName=r+"Provider";function c(l){const A=B.useContext(a);if(A)return A;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Sa(r,o=[]){let a=[];function s(l,A){const u=B.createContext(A),f=a.length;a=[...a,A];const h=p=>{var x;const{scope:v,children:_,...b}=p,S=((x=v==null?void 0:v[r])==null?void 0:x[f])||u,y=B.useMemo(()=>b,Object.values(b));return P.jsx(S.Provider,{value:y,children:_})};h.displayName=l+"Provider";function m(p,v){var S;const _=((S=v==null?void 0:v[r])==null?void 0:S[f])||u,b=B.useContext(_);if(b)return b;if(A!==void 0)return A;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[h,m]}const c=()=>{const l=a.map(A=>B.createContext(A));return function(u){const f=(u==null?void 0:u[r])||l;return B.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,fv(c,...o)]}function fv(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const A=s.reduce((u,{useScope:f,scopeName:h})=>{const p=f(l)[`__scope${h}`];return{...u,...p}},{});return B.useMemo(()=>({[`__scope${o.scopeName}`]:A}),[A])}};return a.scopeName=o.scopeName,a}var So=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},hv=au[" useId ".trim().toString()]||(()=>{}),Av=0;function ba(r){const[o,a]=B.useState(hv());return So(()=>{a(s=>s??String(Av++))},[r]),o?`radix-${o}`:""}var pv=au[" useInsertionEffect ".trim().toString()]||So;function Ai({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,A]=mv({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const m=B.useRef(r!==void 0);B.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,s])}const h=B.useCallback(m=>{var p;if(u){const v=gv(m)?m(r):m;v!==r&&((p=A.current)==null||p.call(A,v))}else l(m)},[u,r,l,A]);return[f,h]}function mv({defaultProp:r,onChange:o}){const[a,s]=B.useState(r),c=B.useRef(a),l=B.useRef(o);return pv(()=>{l.current=o},[o]),B.useEffect(()=>{var A;c.current!==a&&((A=l.current)==null||A.call(l,a),c.current=a)},[a,c]),[a,s,l]}function gv(r){return typeof r=="function"}function vv(r){const o=yv(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(wv);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function yv(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=_v(c),u=bv(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var xv=Symbol("radix.slottable");function wv(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===xv}function bv(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function _v(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.getLine truncated
.`.concat(qv,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(u,"px ").concat(s,`;
}
body[`).concat(_o,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(A,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(s,`;
`),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(oi,` {
right: `).concat(u,"px ").concat(s,`;
}
.`).concat(ai,` {
margin-right: `).concat(u,"px ").concat(s,`;
}
.`).concat(oi," .").concat(oi,` {
right: 0 `).concat(s,`;
}
.`).concat(ai," .").concat(ai,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(_o,`] {
`).concat(Kv,": ").concat(u,`px;
}
`)},Ph=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},h2=function(){B.useEffect(function(){return document.body.setAttribute(_o,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},A2=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;h2();var l=B.useMemo(function(){return u2(c)},[c]);return B.createElement(d2,{styles:f2(l,!o,c,a?"":"!important")})},Xc=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Xc=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Xc=!1}var mo=Xc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},MA=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!p2(r)&&a[o]==="visible")},m2=function(r){return MA(r,"overflowY")},g2=function(r){return MA(r,"overflowX")},Nh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=OA(r,s);if(c){var l=FA(r,s),A=l[1],u=l[2];if(A>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},v2=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},y2=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},OA=function(r,o){return r==="v"?m2(o):g2(o)},FA=function(r,o){return r==="v"?v2(o):y2(o)},x2=function(r,o){return r==="h"&&o==="rtl"?-1:1},w2=function(r,o,a,s,c){var l=x2(r,window.getComputedStyle(o).direction),A=l*s,u=a.target,f=o.contains(u),h=!1,m=A>0,p=0,v=0;do{if(!u)break;var _=FA(r,u),b=_[0],S=_[1],y=_[2],x=S-y-l*b;(b||x)&&OA(r,u)&&(p+=x,v+=b);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dh=function(r){return[r.deltaX,r.deltaY]},Ih=function(r){return r&&"current"in r?r.current:r},b2=function(r,o){return r[0]===o[0]&&r[1]===o[1]},_2=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},C2=0,go=[];function k2(r){var o=B.useRef([]),a=B.useRef([0,0]),s=B.useRef(),c=B.useState(C2++)[0],l=B.useState(jA)[0],A=B.useRef(r);B.useEffect(function(){A.current=r},[r]),B.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Gv([r.lockRef.current],(r.shards||[]).map(Ih),!0).filter(Boolean);return S.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=B.useCallback(function(S,y){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!A.current.allowPinchZoom;var x=zs(S),C=a.current,w="deltaX"in S?S.deltaX:C[0]-x[0],T="deltaY"in S?S.deltaY:C[1]-x[1],R,D=S.target,N=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in S&&N==="h"&&D.type==="range")return!1;var I=window.getSelection(),F=I&&I.anchorNode,j=F?F===D||F.contains(D):!1;if(j)return!1;var L=Nh(N,D);if(!L)return!0;if(L?R=N:(R=N==="v"?"h":"v",L=Nh(N,D)),!L)return!1;if(!s.current&&"changedTouches"in S&&(w||T)&&(s.current=R),!R)return!0;var G=s.current||R;return w2(G,y,S,G==="h"?w:T)},[]),f=B.useCallback(function(S){var y=S;if(!(!go.length||go[go.length-1]!==l)){var x="deltaY"in y?Dh(y):zs(y),C=o.current.filter(function(R){return R.name===y.type&&(R.target===y.target||y.target===R.shadowParent)&&b2(R.delta,x)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var w=(A.current.shards||[]).map(Ih).filter(Boolean).filter(function(R){return R.contains(y.target)}),T=w.length>0?u(y,w[0]):!A.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),h=B.useCallback(function(S,y,x,C){var w={name:S,delta:y,target:x,should:C,shadowParent:S2(x)};o.current.push(w),setTimeout(function(){o.current=o.current.filter(function(T){return T!==w})},1)},[]),m=B.useCallback(function(S){a.current=zs(S),s.current=void 0},[]),p=B.useCallback(function(S){h(S.type,Dh(S),S.target,u(S,r.lockRef.current))},[]),v=B.useCallback(function(S){h(S.type,zs(S),S.target,u(S,r.lockRef.current))},[]);B.useEffect(function(){return go.push(l),r.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,mo),document.addEventListener("touchmove",f,mo),document.addEventListener("touchstart",m,mo),function(){go=go.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,mo),document.removeEventListener("touchmove",f,mo),document.removeEventListener("touchstart",m,mo)}},[]);var _=r.removeScrollBar,b=r.inert;return B.createElement(B.Fragment,null,b?B.createElement(l,{styles:_2(c)}):null,_?B.createElement(A2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function S2(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const E2=t2(IA,k2);var LA=B.forwardRef(function(r,o){return B.createElement(pi,zr({},r,{ref:o,sideCar:E2}))});LA.classNames=pi.classNames;var R2=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},vo=new WeakMap,Vs=new WeakMap,Us={},wc=0,HA=function(r){return r&&(r.host||HA(r.parentNode))},T2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=HA(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},B2=function(r,o,a,s){var c=T2(o,Array.isArray(r)?r:[r]);Us[a]||(Us[a]=new WeakMap);var l=Us[a],A=[],u=new Set,f=new Set(c),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};c.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var _=v.getAttribute(s),b=_!==null&&_!=="false",S=(vo.get(v)||0)+1,y=(l.get(v)||0)+1;vo.set(v,S),l.set(v,y),A.push(v),S===1&&b&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),b||v.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return m(o),u.clear(),wc++,function(){A.forEach(function(p){var v=vo.get(p)-1,_=l.get(p)-1;vo.set(p,v),l.set(p,_),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),_||p.removeAttribute(a)}),wc--,wc||(vo=new WeakMap,vo=new WeakMap,Vs=new WeakMap,Us={})}},P2=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=R2(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),B2(s,c,a,"aria-hidden")):function(){return null}};function N2(r){const o=D2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(j2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function D2(r){const o=B.forwardRef((a,s)=>{const{children:c Line truncated
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return B.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},G2="DialogDescriptionWarning",q2=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t0(G2).contentName}}.`;return B.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},r0=VA,n0=QA,gi=GA,vi=qA,yi=YA,xi=XA,o0=$A;const a0=r0,K2=n0,s0=B.forwardRef(({className:r,...o},a)=>P.jsx(gi,{ref:a,className:Ze("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));s0.displayName=gi.displayName;const fu=B.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(s0,{}),P.jsxs(vi,{ref:s,className:Ze("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,P.jsxs(o0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[P.jsx(aA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fu.displayName=vi.displayName;const hu=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});hu.displayName="DialogHeader";const Au=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});Au.displayName="DialogFooter";const pu=B.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ze("text-lg font-semibold leading-none tracking-tight",r),...o}));pu.displayName=yi.displayName;const Y2=B.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ze("text-sm text-muted-foreground",r),...o}));Y2.displayName=xi.displayName;function jh(r){const o=Z2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(J2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Z2(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=ey(c),u=$2(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var X2=Symbol("radix.slottable");function J2(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X2}function $2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ey(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function ty(r){const o=r+"CollectionProvider",[a,s]=Sa(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),A=S=>{const{scope:y,children:x}=S,C=he.useRef(null),w=he.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:w,collectionRef:C,children:x})};A.displayName=o;const u=r+"CollectionSlot",f=jh(u),h=he.forwardRef((S,y)=>{const{scope:x,children:C}=S,w=l(u,x),T=yr(y,w.collectionRef);return P.jsx(f,{ref:T,children:C})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=jh(m),_=he.forwardRef((S,y)=>{const{scope:x,children:C,...w}=S,T=he.useRef(null),R=yr(y,T),D=l(m,x);return he.useEffect(()=>(D.itemMap.set(T,{ref:T,...w}),()=>void D.itemMap.delete(T))),P.jsx(v,{[p]:"",ref:R,children:C})});_.displayName=m;function b(S){const y=l(r+"CollectionConsumer",S);return he.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const w=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((D,N)=>w.indexOf(D.ref.current)-w.indexOf(N.ref.current))},[y.coll Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),R4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),T4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<35){const b={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:m}),f+=32;const p=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&A.push({name:"Ciphertext",description:`Encrypted message data (${c.length-35} bytes). Contains encrypted plaintext with this structure:
• Timestamp (4 bytes) - send time as unix timestamp
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
• Password (remaining bytes) - password for repeater/room`,startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),B4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const m={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(m.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),m}const A=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=A),h}catch(A){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),P4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let h=0;h<l;h++)A.push((0,a.byteToHex)(c[1+h]));const u=c[1+l];let f="";return c.length>1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),N4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.include Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return bo(a,o)}countNamesForLength(o){return xa(o)}async runBatch(o,a,s,c,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],m=l&&A?1:0;let p,v=0,_=0;if(m){const R=new Uint8Array(l.length/2);for(let j=0;j<R.length;j++)R[j]=parseInt(l.substr(j*2,2),16);v=R.length*8;const D=Math.ceil(R.length/4)*4,N=new Uint8Array(D);N.set(R),p=new Uint32Array(D/4);for(let j=0;j<p.length;j++)p[j]=N[j*4]<<24|N[j*4+1]<<16|N[j*4+2]<<8|N[j*4+3];const I=parseInt(A.substr(0,2),16),F=parseInt(A.substr(2,2),16);_=I<<24|F<<16}else p=new Uint32Array([0]);const b=Math.max(p.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<b)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:b,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=b,this.bindGroupDirty=!0);const S=new Uint32Array([o,s,a,c,_,p.length,v,m]);this.device.queue.writeBuffer(this.paramsBuffer,0,S),this.device.queue.writeBuffer(this.ciphertextBuffer,0,p),this.device.queue.writeBuffer(this.matchCountBuffer,0,sp.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const y=this.device.createCommandEncoder(),x=y.beginComputePass();x.setPipeline(this.pipeline),x.setBindGroup(0,this.bindGroup),x.dispatchWorkgroups(Math.ceil(c/(256*16))),x.end(),y.copyBufferToBuffer(this.matchCountBuffer,0,f,0,4),y.copyBufferToBuffer(this.matchIndicesBuffer,0,h,0,1024*4),this.device.queue.submit([y.finish()]),await f.mapAsync(GPUMapMode.READ);const w=new Uint32Array(f.getMappedRange())[0];f.unmap();const T=[];if(w>0){await h.mapAsync(GPUMapMode.READ);const R=new Uint32Array(h.getMappedRange());for(let D=0;D<Math.min(w,1024);D++)T.push(R[D]);h.unmap()}return T}destroy(){var o,a,s,c,l,A,u,f;(o=this.paramsBuffer)==null||o.destroy(),(a=this.matchCountBuffer)==null||a.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(u=this.matchIndicesReadBuffers[0])==null||u.destroy(),(f=this.matchIndicesReadBuffers[1])==null||f.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}};ap.ZERO_DATA=new Uint32Array([0]);var V4=ap;function U4(){return typeof navigator<"u"&&"gpu"in navigator}var W4=/^[a-z0-9-]+$/,Q4=/^[a-z0-9].*[a-z0-9]$|^[a-z0-9]$/,G4=/ Line truncated
`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter($h)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter($h)}abort(){this.abortFlag=!0}isGpuAvailable(){return U4()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await Zh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:A,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new V4,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let m=0,p=performance.now(),v=1,_=0;if(o!=null&&o.startFrom){const D=F4(o.startFrom);D&&(v=D.length,_=D.index+1,_>=xa(v)&&(v++,_=0))}let b=0;for(let D=v;D<=s;D++)b+=xa(D);b-=_;const S=(D,N,I)=>{if(!a)return;const j=(performance.now()-h)/1e3,L=j>0?Math.round(m/j):0,G=b-m,K=L>0?G/L:0;a({checked:m,total:b,percent:b>0?Math.min(100,m/b*100):0,rateKeysPerSec:L,etaSeconds:K,elapsedSeconds:j,currentLength:N,currentPosition:I,phase:D})},y=D=>{if(!L4(A,u,D))return{valid:!1};const N=Zh.ChannelCrypto.decryptGroupTextMessage(A,u,D);return!N.success||!N.data?{valid:!1}:this.useTimestampFilter&&!H4(N.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!z4(N.data.message)?{valid:!1}:{valid:!0,message:N.data.message}};if(v===1&&_===0){S("public-key",0,ru);const D=Jh(li);if(l===D){const N=y(li);if(N.valid)return{found:!0,roomName:ru,key:li,decryptedMessage:N.message}}}if(this.wordlist.length>0&&v===1&&_===0)for(let D=0;D<this.wordlist.length;D++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[D]};const N=this.wordlist[D],I=Xh("#"+N),F=Jh(I);if(parseInt(F,16)===f){const L=y(I);if(L.valid)return{found:!0,roomName:N,key:I,decryptedMessage:L.message}}const j=performance.now();j-p>=200&&(S("wordlist",N.length,N),p=j,await new Promise(L=>setTimeout(L,0)))}const x=32768,C=1e3;let w=x,T=!1;for(let D=v;D<=s;D++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(D,0)||void 0};const N=xa(D);let I=D===v?_:0;for(;I<N;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(D,I)||void 0};const F=Math.min(w,N-I),j=performance.now(),L=await this.gpuInstance.runBatch(f,D,I,F,A,u),G=performance.now()-j;if(m+=F,!T&&F>=x&&G>0){const ee=C/G,se=Math.round(F*ee),J=Math.pow(2,Math.round(Math.log2(Math.max(x,se))));w=Math.max(x,J),T=!0}for(const ee of L){const se=bo(D,ee);if(!se)continue;const J=Xh("#"+se),ne=y(J);if(ne.valid)return{found:!0,roomName:se,key:J,decryptedMessage:ne.message}}I+=F;const K=performance.now();if(K-p>=200){const ee=bo(D,Math.min(I,N-1))||"";S("bruteforce",D,ee),p=K,await new Promise(se=>setTimeout(se,0))}}}return{found:!1,resumeFrom:bo(s,xa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information:
crypto-js/ripemd160.js:
(** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*)
crypto-js/mode-ctr-gladman.js:
(** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*)
@noble/ed25519/index.js:
(*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
*/var Uc,eA;function K4(){return eA||(eA=1,Uc={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAALine truncated
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(u=>(this.enabled=!0,u)).catch(u=>{throw this.enabled=!1,u})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return Wc=c,Wc}var Z4=Y4();const X4=nu(Z4);function J4({packets:r,channels:o,onChannelCreate:a}){const[s,c]=B.useState(!1),[l,A]=B.useState(6),[u,f]=B.useState(!1),[h,m]=B.useState(null),[p,v]=B.useState(new Map),[_,b]=B.useState([]),[S,y]=B.useState(!1),[x,C]=B.useState(null),w=B.useRef(null),T=B.useRef(null),R=B.useRef(!1),D=B.useRef(!1),N=B.useRef(!1),I=B.useRef(new Map),F=B.useRef(!1),j=B.useRef(6);B.useEffect(()=>{const X=new q4;w.current=X,C(X.isGpuAvailable());const Z=new X4;return T.current=Z,X.loadWordlist("/words_alpha.txt").then(()=>y(!0)).catch(k=>console.error("Failed to load wordlist:",k)),()=>{X.destroy(),w.current=null,Z.disable(),T.current=null}},[]);const L=new Set(o.map(X=>X.key.toUpperCase())),G=r.filter(X=>X.payload_type==="GROUP_TEXT"&&!X.decrypted);B.useEffect(()=>{v(X=>{const Z=new Map(X);let k=!1;for(const O of G)Z.has(O.id)||(Z.set(O.id,{packet:O,attempts:0,lastAttemptLength:0,status:"pending"}),k=!0);return k?(I.current=Z,Z):X})},[G.length]),B.useEffect(()=>{I.current=p},[p]),B.useEffect(()=>{F.current=u},[u]),B.useEffect(()=>{j.current=l},[l]);const K=Array.from(p.values()).filter(X=>X.status==="pending").length,ee=Array.from(p.values()).filter(X=>X.status==="cracked").length,se=Array.from(p.values()).filter(X=>X.status==="failed").length,J=B.useCallback(async()=>{if(N.current||!w.current||!R.current)return;const X=I.current;let Z=null,k=null;for(const[V,re]of X.entries())if(re.status==="pending"){Z=re,k=V;break}if(!Z&&F.current){const V=Array.from(X.entries()).filter(([,re])=>re.status==="failed"&&re.lastAttemptLength<10);V.length>0&&(V.sort((re,ue)=>re[1].lastAttemptLength-ue[1].lastAttemptLength),[k,Z]=V[0])}if(!Z||k===null){R.current&&setTimeout(()=>J(),1e3);return}N.current=!0;const O=j.current,z=Z.lastAttemptLength>0?Z.lastAttemptLength+1:O;try{const V=await w.current.crack(Z.packet.data,{maxLength:z,useTimestampFilter:!0,useUtf8Filter:!0},re=>{m(re)});if(D.current){D.current=!1,N.current=!1,m(null);return}if(V.found&&V.roomName&&V.key){v(de=>{const oe=new Map(de),Be=oe.get(k);return Be&&oe.set(k,{...Be,status:"cracked",attempts:Be.attempts+1,lastAttemptLength:z}),oe});const re={roomName:V.roomName,key:V.key,packetId:k,message:V.decryptedMessage||"",crackedAt:Date.now()};b(de=>[...de,re]);const ue=V.key.toUpperCase();if(!L.has(ue))try{await a("#"+V.roomName,V.key)}catch(de){console.error("Failed to create channel:",de)}}else v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}catch(V){console.error("Cracking error:",V),v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}N.current=!1,m(null),R.current&&setTimeout(()=>J(),100)},[L,a]),ne=()=>{var X;if(!x){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}c(!0),R.current=!0,D.current=!1,(X=T.current)==null||X.enable(),J()},W=()=>{var X,Z;c(!1),R.current=!1,D.current=!0,(X=w.current)==null||X.abort(),(Z=T.current)==null||Z.disable()};return P.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[P.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[P.jsx("button",{onClick:s?W:ne,disabled:!S||x===!1,className:Ze("px-4 py-1.5 rounded text-sm font-medium",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:s?"Stop":"Start Cracking"}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),P.jsx("input",{type:"number",min:1,max:10,value:l,onChange:X=>A(Math.min(10,Math.max(1,parseInt(X.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),P.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[P.jsx("input",{type:"checkbox",checked:u,onChange:X=>f(X.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),P.jsxs("div",{className:"flex gap-4 text-sm",children:[P.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",P.jsx("span",{className:"text-foreground font-medium",children:K})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",P.jsx("span",{className:"text-green-500 font-medium",children:ee})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",P.jsx("span",{className:"text-destructive font-medium",children:se})]})]}),h&&P.jsxs("div",{className:"space-y-1",children:[P.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[P.jsxs("span",{children:[h.phase==="wordlist"?"Dictionary":h.phase==="bruteforce"?"Bruteforce":"Public Key",h.phase===" Line truncated
-536
View File
@@ -1,536 +0,0 @@
function ev(r,o){for(var a=0;a<o.length;a++){const s=o[a];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in r)){const l=Object.getOwnPropertyDescriptor(s,c);l&&Object.defineProperty(r,c,l.get?l:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const p of l.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function Zh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Ie={};/**
* @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 Qf;function tv(){if(Qf)return Ie;Qf=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),p=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.iterator;function g(E){return E===null||typeof E!="object"?null:(E=m&&E[m]||E["@@iterator"],typeof E=="function"?E:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,C={};function x(E,I,H){this.props=E,this.context=I,this.refs=C,this.updater=H||S}x.prototype.isReactComponent={},x.prototype.setState=function(E,I){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,I,"setState")},x.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function w(){}w.prototype=x.prototype;function k(E,I,H){this.props=E,this.context=I,this.refs=C,this.updater=H||S}var b=k.prototype=new w;b.constructor=k,_(b,x.prototype),b.isPureReactComponent=!0;var R=Array.isArray,P=Object.prototype.hasOwnProperty,j={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function D(E,I,H){var V,re={},ce=null,pe=null;if(I!=null)for(V in I.ref!==void 0&&(pe=I.ref),I.key!==void 0&&(ce=""+I.key),I)P.call(I,V)&&!B.hasOwnProperty(V)&&(re[V]=I[V]);var oe=arguments.length-2;if(oe===1)re.children=H;else if(1<oe){for(var Ae=Array(oe),ze=0;ze<oe;ze++)Ae[ze]=arguments[ze+2];re.children=Ae}if(E&&E.defaultProps)for(V in oe=E.defaultProps,oe)re[V]===void 0&&(re[V]=oe[V]);return{$$typeof:r,type:E,key:ce,ref:pe,props:re,_owner:j.current}}function F(E,I){return{$$typeof:r,type:E.type,key:I,ref:E.ref,props:E.props,_owner:E._owner}}function O(E){return typeof E=="object"&&E!==null&&E.$$typeof===r}function L(E){var I={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(H){return I[H]})}var G=/\/+/g;function $(E,I){return typeof E=="object"&&E!==null&&E.key!=null?L(""+E.key):I.toString(36)}function J(E,I,H,V,re){var ce=typeof E;(ce==="undefined"||ce==="boolean")&&(E=null);var pe=!1;if(E===null)pe=!0;else switch(ce){case"string":case"number":pe=!0;break;case"object":switch(E.$$typeof){case r:case o:pe=!0}}if(pe)return pe=E,re=re(pe),E=V===""?"."+$(pe,0):V,R(re)?(H="",E!=null&&(H=E.replace(G,"$&/")+"/"),J(re,I,H,"",function(ze){return ze})):re!=null&&(O(re)&&(re=F(re,H+(!re.key||pe&&pe.key===re.key?"":(""+re.key).replace(G,"$&/")+"/")+E)),I.push(re)),1;if(pe=0,V=V===""?".":V+":",R(E))for(var oe=0;oe<E.length;oe++){ce=E[oe];var Ae=V+$(ce,oe);pe+=J(ce,I,H,Ae,re)}else if(Ae=g(E),typeof Ae=="function")for(E=Ae.call(E),oe=0;!(ce=E.next()).done;)ce=ce.value,Ae=V+$(ce,oe++),pe+=J(ce,I,H,Ae,re);else if(ce==="object")throw I=String(E),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return pe}function ae(E,I,H){if(E==null)return E;var V=[],re=0;return J(E,V,"","",function(ce){return I.call(H,ce,re++)}),V}function Q(E){if(E._status===-1){var I=E._result;I=I(),I.then(function(H){(E._status===0||E._status===-1)&&(E._status=1,E._result=H)},function(H){(E._status===0||E._status===-1)&&(E._status=2,E._result=H)}),E._status===-1&&(E._status=0,E._result=I)}if(E._status===1)return E._result.default;throw E._result}var ne={current:null},U={transition:null},te={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:U,ReactCurrentOwner:j};function X(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:ae,forEach:function(E,I,H){ae(E,function(){I.apply(this,arguments)},H)},count:function(E){var I=0;return ae(E,function(){I++}),I},toArray:function(E){return ae(E,function(I){return I})||[]},only:function(E){if(!O(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ie.Component=x,Ie.Fragment=a,Ie.Profiler=c,Ie.PureComponent=k,Ie.StrictMode=s,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ie.act=X,Ie.cloneElement=function(E,I,H){if(E==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+E+".");var V=_({},E.props),re=E.key,ce=E.ref,pe=E._owner;if(I!=null){if(I.ref!==void 0&&(ce=I.ref,pe=j.current),I.key!==void 0&&(re=""+I.key),E.type&&E.type.defaultProps)var oe=E.type.defaultProps;for(Ae in I)P.call(I,Ae)&&!B.hasOwnProperty(Ae)&&(V[Ae]=I[Ae]===void 0&&oe!==void 0?oe[Ae]:I[Ae])}var Ae=arguments.length-2;if(Ae===1)V.children=H;else if(1<Ae){oe=Array(Ae);for(var ze=0;ze<Ae;ze++)oe[ze]=arguments[ze+2];V.children=oe}return{$$typeof:r,type:E.type,key:re,ref:ce,props:V,_owner:pe}},Ie.createContexLine truncated
* @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 Jf;function rv(){if(Jf)return da;Jf=1;var r=tu(),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function p(u,f,h){var v,m={},g=null,S=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(S=f.ref);for(v in f)s.call(f,v)&&!l.hasOwnProperty(v)&&(m[v]=f[v]);if(u&&u.defaultProps)for(v in f=u.defaultProps,f)m[v]===void 0&&(m[v]=f[v]);return{$$typeof:o,type:u,key:g,ref:S,props:m,_owner:c.current}}return da.Fragment=a,da.jsx=p,da.jsxs=p,da}var eh;function nv(){return eh||(eh=1,ic.exports=rv()),ic.exports}var A=nv(),N=tu();const fe=Zh(N),ru=ev({__proto__:null,default:fe},[N]);var Os={},cc={exports:{}},rr={},uc={exports:{}},dc={};/**
* @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.
*/var th;function ov(){return th||(th=1,(function(r){function o(U,te){var X=U.length;U.push(te);e:for(;0<X;){var E=X-1>>>1,I=U[E];if(0<c(I,te))U[E]=te,U[X]=I,X=E;else break e}}function a(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var te=U[0],X=U.pop();if(X!==te){U[0]=X;e:for(var E=0,I=U.length,H=I>>>1;E<H;){var V=2*(E+1)-1,re=U[V],ce=V+1,pe=U[ce];if(0>c(re,X))ce<I&&0>c(pe,re)?(U[E]=pe,U[ce]=X,E=ce):(U[E]=re,U[V]=X,E=V);else if(ce<I&&0>c(pe,X))U[E]=pe,U[ce]=X,E=ce;else break e}}return te}function c(U,te){var X=U.sortIndex-te.sortIndex;return X!==0?X:U.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var p=Date,u=p.now();r.unstable_now=function(){return p.now()-u}}var f=[],h=[],v=1,m=null,g=3,S=!1,_=!1,C=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(U){for(var te=a(h);te!==null;){if(te.callback===null)s(h);else if(te.startTime<=U)s(h),te.sortIndex=te.expirationTime,o(f,te);else break;te=a(h)}}function R(U){if(C=!1,b(U),!_)if(a(f)!==null)_=!0,Q(P);else{var te=a(h);te!==null&&ne(R,te.startTime-U)}}function P(U,te){_=!1,C&&(C=!1,w(D),D=-1),S=!0;var X=g;try{for(b(te),m=a(f);m!==null&&(!(m.expirationTime>te)||U&&!L());){var E=m.callback;if(typeof E=="function"){m.callback=null,g=m.priorityLevel;var I=E(m.expirationTime<=te);te=r.unstable_now(),typeof I=="function"?m.callback=I:m===a(f)&&s(f),b(te)}else s(f);m=a(f)}if(m!==null)var H=!0;else{var V=a(h);V!==null&&ne(R,V.startTime-te),H=!1}return H}finally{m=null,g=X,S=!1}}var j=!1,B=null,D=-1,F=5,O=-1;function L(){return!(r.unstable_now()-O<F)}function G(){if(B!==null){var U=r.unstable_now();O=U;var te=!0;try{te=B(!0,U)}finally{te?$():(j=!1,B=null)}}else j=!1}var $;if(typeof k=="function")$=function(){k(G)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ae=J.port2;J.port1.onmessage=G,$=function(){ae.postMessage(null)}}else $=function(){x(G,0)};function Q(U){B=U,j||(j=!0,$())}function ne(U,te){D=x(function(){U(r.unstable_now())},te)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(U){U.callback=null},r.unstable_continueExecution=function(){_||S||(_=!0,Q(P))},r.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<U?Math.floor(1e3/U):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(U){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var X=g;g=te;try{return U()}finally{g=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(U,te){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var X=g;g=U;try{return te()}finally{g=X}},r.unstable_scheduleCallback=function(U,te,X){var E=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?E+X:E):X=E,U){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=X+I,U={id:v++,callback:te,priorityLevel:U,startTime:X,expirationTime:I,sortIndex:-1},X>E?(U.sortIndex=X,o(h,U),a(f)===null&&U===a(h)&&(C?(w(D),D=-1):C=!0,ne(R,X-E))):(U.sortIndex=I,o(f,U),_||S||(_=!0,Q(P))),U},r.unstable_shouldYield=L,r.unstable_wrapCallback=function(U){var te=g;return function(){var X=g;g=te;try{return U.apply(this,arguments)}finally{g=X}}}})(dc)),dc}var rh;function av(){return rh||(rh=1,uc.exports=ov()),uc.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 nh;function sv(){if(nh)return rr;nh=1;var r=tu(),o=av();function a(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 s=new Set,c={};function l(e,t){p(e,t),p(e+"Capture",t)}function p(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,v={},m={};function g(e){return f.call(m,e)?!0:f.call(v,e)?!1:h.test(e)?m[e]=!0:(v[e]=!0,!1)}function S(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _(e,t,n,i){if(t===null||typeof t>"u"||S(e,t,n,i))return!0;if(i)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 C(e,t,n,i,d,y,T){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=y,this.removeEmptyString=T}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){x[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];x[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){x[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){x[e]=new C(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){x[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){x[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){x[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){x[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){x[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function k(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-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){x[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),x.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){x[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,i){var d=x.hasOwnProperty(t)?x[t]:null;(d!==null?d.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!= Line truncated
`+E+e}var H=!1;function V(e,t){if(!e||H)return"";H=!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(Y){var i=Y}Reflect.construct(e,[],t)}else{try{t.call()}catch(Y){i=Y}e.call(t.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var d=Y.stack.split(`
`),y=i.stack.split(`
`),T=d.length-1,M=y.length-1;1<=T&&0<=M&&d[T]!==y[M];)M--;for(;1<=T&&0<=M;T--,M--)if(d[T]!==y[M]){if(T!==1||M!==1)do if(T--,M--,0>M||d[T]!==y[M]){var z=`
`+d[T].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=T&&0<=M);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function re(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function ce(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 B:return"Fragment";case j:return"Portal";case F:return"Profiler";case D:return"StrictMode";case $:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}function pe(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 ce(t);case 8:return t===D?"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 oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Ae(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,y=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(T){i=""+T,y.call(this,T)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){e._valueTracker||(e._valueTracker=ze(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Ae(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ft(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 Ze(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ar(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=oe(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vt(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Tt(e,t){Vt(e,t);var n=oe(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ht(e,t.type,n):t.hasOwnProperty("defaultValue")&&ht(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ht(e,t,n){(t!=="number"||ft(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dt=Array.isArray;function nt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d<n.length;d++)t["$"+n[d]]=!0;for(n=0;n<e.length;n++)d=t.hasOwnProperty("$"+e[n].value),e[n].selected!==d&&(e[n].selected=d),d&&i&&(e[n].defaultSelected=!0)}else{for(n=""+oe(n),t=null,d=0;d<e.length;d++){if(e[d].value===n){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ue(e,t){if(t.dangerouslySetInnerHTML!= Line truncated
`).replace(hm,"")}function $a(e,t,n){if(t=md(t),md(e)!==t&&n)throw Error(a(425))}function Ya(){}var Zi=null,Ji=null;function el(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 tl=typeof setTimeout=="function"?setTimeout:void 0,pm=typeof clearTimeout=="function"?clearTimeout:void 0,vd=typeof Promise=="function"?Promise:void 0,mm=typeof queueMicrotask=="function"?queueMicrotask:typeof vd<"u"?function(e){return vd.resolve(null).then(e).catch(vm)}:tl;function vm(e){setTimeout(function(){throw e})}function rl(e,t){var n=t,i=0;do{var d=n.nextSibling;if(e.removeChild(n),d&&d.nodeType===8)if(n=d.data,n==="/$"){if(i===0){e.removeChild(d),Fo(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Fo(t)}function an(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 yd(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 Zn=Math.random().toString(36).slice(2),jr="__reactFiber$"+Zn,Yo="__reactProps$"+Zn,Vr="__reactContainer$"+Zn,nl="__reactEvents$"+Zn,ym="__reactListeners$"+Zn,gm="__reactHandles$"+Zn;function En(e){var t=e[jr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vr]||n[jr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yd(e);e!==null;){if(n=e[jr])return n;e=yd(e)}return t}e=n,n=e.parentNode}return null}function Xo(e){return e=e[jr]||e[Vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Xa(e){return e[Yo]||null}var ol=[],eo=-1;function sn(e){return{current:e}}function st(e){0>eo||(e.current=ol[eo],ol[eo]=null,eo--)}function et(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Ht=sn(ln),Qt=sn(!1),Tn=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},y;for(y in n)d[y]=t[y];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Zt(e){return e=e.childContextTypes,e!=null}function Qa(){st(Qt),st(Ht)}function gd(e,t,n){if(Ht.current!==ln)throw Error(a(168));et(Ht,t),et(Qt,n)}function xd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,pe(e)||"Unknown",d));return X({},n,i)}function Za(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,Tn=Ht.current,et(Ht,e),et(Qt,Qt.current),!0}function wd(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=xd(e,t,Tn),i.__reactInternalMemoizedMergedChildContext=e,st(Qt),st(Ht),et(Ht,e)):st(Qt),et(Qt,n)}var Wr=null,Ja=!1,al=!1;function bd(e){Wr===null?Wr=[e]:Wr.push(e)}function xm(e){Ja=!0,bd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Wr=null,Ja=!1}catch(d){throw Wr!==null&&(Wr=Wr.slice(e+1)),Su(Ti,cn),d}finally{Ye=t,al=!1}}return null}var ro=[],no=0,es=null,ts=0,hr=[],pr=0,Pn=null,Kr=1,Gr="";function Rn(e,t){ro[no++]=ts,ro[no++]=es,es=e,ts=t}function _d(e,t,n){hr[pr++]=Kr,hr[pr++]=Gr,hr[pr++]=Pn,Pn=e;var i=Kr;e=Gr;var d=32-_r(i)-1;i&=~(1<<d),n+=1;var y=32-_r(t)+d;if(30<y){var T=d-d%5;y=(i&(1<<T)-1).toString(32),i>>=T,d-=T,Kr=1<<32-_r(t)+d|n<<d|i,Gr=y+e}else Kr=1<<y|n<<d|i,Gr=e}function sl(e){e.return!==null&&(Rn(e,1),_d(e,1,0))}function il(e){for(;e===es;)es=ro[--no],ro[no]=null,ts=ro[--no],ro[no]=null;for(;e===Pn;)Pn=hr[--pr],hr[pr]=null,Gr=hr[--pr],hr[pr]=null,Kr=hr[--pr],hr[pr]=null}var ir=null,lr=null,lt=!1,kr=null;function Sd(e,t){var n=gr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function kd(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ir=e,lr=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ir=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Pn!==null?{id:Kr,overflow:Gr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ir=e,lr=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cl(e){if(lt){var t=lr;if(t){var n=t;if(!kd(e,t)){if(ll(e))throw Error(a(418));t=an(n.nextSibling);var i=ir;t&&kd(e,t)?Sd(i,n):(e.flags=e.flags&-4097|2,lt=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,lt=!1,ir=e}}}function Cd(e){for(e=e. Line truncated
Error generating stack: `+y.message+`
`+y.stack}return{value:e,source:t,stack:d,digest:null}}function Al(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Bl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pm=typeof WeakMap=="function"?WeakMap:Map;function af(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){bs||(bs=!0,ql=i),Bl(e,t)},n}function sf(e,t,n){n=$r(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=t.value;n.payload=function(){return i(d)},n.callback=function(){Bl(e,t)}}var y=e.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(n.callback=function(){Bl(e,t),typeof i!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var T=t.stack;this.componentDidCatch(t.value,{componentStack:T!==null?T:""})}),n}function lf(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Pm;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(n)||(d.add(n),e=Um.bind(null,e,t,n),t.then(e,e))}function cf(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 uf(e,t,n,i,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$r(-1,1),t.tag=2,dn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Rm=R.ReactCurrentOwner,Jt=!1;function Gt(e,t,n,i){t.child=e===null?Rd(t,null,n,i):ao(t,e.child,n,i)}function df(e,t,n,i,d){n=n.render;var y=t.ref;return io(t,d),i=Sl(e,t,n,i,y,d),n=kl(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&n&&sl(t),t.flags|=1,Gt(e,t,i,d),t.child)}function ff(e,t,n,i,d){if(e===null){var y=n.type;return typeof y=="function"&&!ec(y)&&y.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=y,hf(e,t,y,i,d)):(e=Ts(n.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(y=e.child,(e.lanes&d)===0){var T=y.memoizedProps;if(n=n.compare,n=n!==null?n:Wo,n(T,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=yn(y,i),e.ref=t.ref,e.return=t,t.child=e}function hf(e,t,n,i,d){if(e!==null){var y=e.memoizedProps;if(Wo(y,i)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=i=y,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,Yr(e,t,d)}return jl(e,t,n,i,d)}function pf(e,t,n){var i=t.pendingProps,d=i.children,y=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(fo,cr),cr|=n;else{if((n&1073741824)===0)return e=y!==null?y.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(fo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=y!==null?y.baseLanes:n,et(fo,cr),cr|=i}else y!==null?(i=y.baseLanes|n,t.memoizedState=null):i=n,et(fo,cr),cr|=i;return Gt(e,t,d,n),t.child}function mf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function jl(e,t,n,i,d){var y=Zt(n)?Tn:Ht.current;return y=to(t,y),io(t,d),n=Sl(e,t,n,i,y,d),i=kl(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&i&&sl(t),t.flags|=1,Gt(e,t,n,d),t.child)}function vf(e,t,n,i,d){if(Zt(n)){var y=!0;Za(t)}else y=!1;if(io(t,d),t.stateNode===null)vs(e,t),nf(t,n,i),Nl(t,n,i,d),i=!0;else if(e===null){var T=t.stateNode,M=t.memoizedProps;T.props=M;var z=T.context,Y=n.contextType;typeof Y=="object"&&Y!==null?Y=mr(Y):(Y=Zt(n)?Tn:Ht.current,Y=to(t,Y));var ie=n.getDerivedStateFromProps,ue=typeof ie=="function"||typeof T.getSnapshotBeforeUpdate=="function";ue||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==i||z!==Y)&&of(t,T,i,Y),un=!1;var se=t.memoizedState;T.state=se,is(t,i,T,d),z=t.memoizedState,M!==i||se!==z||Qt.current||un?(typeof ie=="function"&&(Rl(t,n,ie,i),z=t.memoizedState),(M=un||rf(t,n,M,i,se,z,Y))?(ue||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(t.flags|=4194308)):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=z),T.props=i,T.state=z,T.context=Y,i=M):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{T=t.stateNode,Ad(e,t),M=t.memoizedProps,Y=t.type===t.elementType?M:Cr(t.type,M),T.props=Y,ue=t.pendingProps,se=T.context,z=n.contextType,typeof z=="object"&&z!==null?z=mr(z):(z=Zt(n)?Tn:Ht.current,z=to(t,z));var me=n.getDerivedStateFromProps;(ie=typeof me=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==ue||se!==z)&&of(t,T,i,z),un=!1,se=t.memoizedState,T Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dv=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fv=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),sh=r=>{const o=fv(r);return o.charAt(0).toUpperCase()+o.slice(1)},e0=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),hv=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var pv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mv=N.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:p,...u},f)=>N.createElement("svg",{ref:f,...pv,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:e0("lucide",c),...!l&&!hv(u)&&{"aria-hidden":"true"},...u},[...p.map(([h,v])=>N.createElement(h,v)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nu=(r,o)=>{const a=N.forwardRef(({className:s,...c},l)=>N.createElement(mv,{ref:l,iconNode:o,className:e0(`lucide-${dv(sh(r))}`,`lucide-${r}`,s),...c}));return a.displayName=sh(r),a};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yv=nu("check",vv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gv=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xv=nu("menu",gv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],t0=nu("x",wv);var r0=Jh();const n0=Zh(r0);function bv(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const _v=r=>{switch(r){case"success":return Cv;case"info":return Tv;case"warning":return Ev;case"error":return Pv;default:return null}},Sv=Array(12).fill(0),kv=({visible:r,className:o})=>fe.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},fe.createElement("div",{className:"sonner-spinner"},Sv.map((a,s)=>fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Cv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ev=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Tv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Pv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Rv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Nv=()=>{const[r,o]=fe.useState(document.hidden);return fe.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Vc=1;class Av{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Vc++,p=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),p?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,p;const u=c.then(async h=>{if(p=["resolve",h],fe.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(jv(h)&&!h.ok){l=!1;const m=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,g=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,_=typeof m=="object"&&!fe.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:g,..._})}else if(h instanceof Error){l=!1;const m=typeof a.error=="function"?await a.error(h):a.error,Line truncated
`).map((Q,ne,U)=>A.jsxs("span",{children:[Q,ne<U.length-1&&A.jsx("br",{})]},ne)),!L&&A.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:xh(w.sender_timestamp||w.received_at)}),w.outgoing&&(w.acked?" ✓":" ?")]})]})]},w.id)})]})}const sy=N.forwardRef(function({onSend:o,disabled:a,placeholder:s},c){const[l,p]=N.useState(""),[u,f]=N.useState(!1),h=N.useRef(null);N.useImperativeHandle(c,()=>({appendText:g=>{var S;p(_=>_+g),(S=h.current)==null||S.focus()}}));const v=N.useCallback(async g=>{g.preventDefault();const S=l.trim();if(!(!S||u||a)){f(!0);try{await o(S),p("")}catch(_){console.error("Failed to send message:",_)}finally{f(!1)}}},[l,u,a,o]),m=N.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),v(g))},[v]);return A.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:v,children:[A.jsx(_t,{ref:h,type:"text",value:l,onChange:g=>p(g.target.value),onKeyDown:m,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),A.jsx(Ur,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function Et(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function iy(r,o){const a=N.createContext(o),s=l=>{const{children:p,...u}=l,f=N.useMemo(()=>u,Object.values(u));return A.jsx(a.Provider,{value:f,children:p})};s.displayName=r+"Provider";function c(l){const p=N.useContext(a);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Ea(r,o=[]){let a=[];function s(l,p){const u=N.createContext(p),f=a.length;a=[...a,p];const h=m=>{var w;const{scope:g,children:S,..._}=m,C=((w=g==null?void 0:g[r])==null?void 0:w[f])||u,x=N.useMemo(()=>_,Object.values(_));return A.jsx(C.Provider,{value:x,children:S})};h.displayName=l+"Provider";function v(m,g){var C;const S=((C=g==null?void 0:g[r])==null?void 0:C[f])||u,_=N.useContext(S);if(_)return _;if(p!==void 0)return p;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[h,v]}const c=()=>{const l=a.map(p=>N.createContext(p));return function(u){const f=(u==null?void 0:u[r])||l;return N.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,ly(c,...o)]}function ly(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const p=s.reduce((u,{useScope:f,scopeName:h})=>{const m=f(l)[`__scope${h}`];return{...u,...m}},{});return N.useMemo(()=>({[`__scope${o.scopeName}`]:p}),[p])}};return a.scopeName=o.scopeName,a}var Eo=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},cy=ru[" useId ".trim().toString()]||(()=>{}),uy=0;function _a(r){const[o,a]=N.useState(cy());return Eo(()=>{a(s=>s??String(uy++))},[r]),o?`radix-${o}`:""}var dy=ru[" useInsertionEffect ".trim().toString()]||Eo;function pi({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,p]=fy({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const v=N.useRef(r!==void 0);N.useEffect(()=>{const m=v.current;m!==u&&console.warn(`${s} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=u},[u,s])}const h=N.useCallback(v=>{var m;if(u){const g=hy(v)?v(r):v;g!==r&&((m=p.current)==null||m.call(p,g))}else l(v)},[u,r,l,p]);return[f,h]}function fy({defaultProp:r,onChange:o}){const[a,s]=N.useState(r),c=N.useRef(a),l=N.useRef(o);return dy(()=>{l.current=o},[o]),N.useEffect(()=>{var p;c.current!==a&&((p=l.current)==null||p.call(l,a),c.current=a)},[a,c]),[a,s,l]}function hy(r){return typeof r=="function"}function py(r){const o=my(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find(yy);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function my(r){const o=N.forwardRef((a,s)=>{const{children:c,...l}=a;if(N.isValidElement(c)){const p=xy(c),u=gy(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var vy=Symbol("radix.slottable");function yy(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===vy}function gy(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function xy(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.getLine truncated
.`.concat(Vy,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(u,"px ").concat(s,`;
}
body[`).concat(So,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(p,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(s,`;
`),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(oi,` {
right: `).concat(u,"px ").concat(s,`;
}
.`).concat(ai,` {
margin-right: `).concat(u,"px ").concat(s,`;
}
.`).concat(oi," .").concat(oi,` {
right: 0 `).concat(s,`;
}
.`).concat(ai," .").concat(ai,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(So,`] {
`).concat(Wy,": ").concat(u,`px;
}
`)},Ph=function(){var r=parseInt(document.body.getAttribute(So)||"0",10);return isFinite(r)?r:0},cg=function(){N.useEffect(function(){return document.body.setAttribute(So,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(So):document.body.setAttribute(So,r.toString())}},[])},ug=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;cg();var l=N.useMemo(function(){return sg(c)},[c]);return N.createElement(ig,{styles:lg(l,!o,c,a?"":"!important")})},Yc=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return Yc=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Yc=!1}var vo=Yc?{passive:!1}:!1,dg=function(r){return r.tagName==="TEXTAREA"},B0=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!dg(r)&&a[o]==="visible")},fg=function(r){return B0(r,"overflowY")},hg=function(r){return B0(r,"overflowX")},Rh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=j0(r,s);if(c){var l=D0(r,s),p=l[1],u=l[2];if(p>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},pg=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},mg=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},j0=function(r,o){return r==="v"?fg(o):hg(o)},D0=function(r,o){return r==="v"?pg(o):mg(o)},vg=function(r,o){return r==="h"&&o==="rtl"?-1:1},yg=function(r,o,a,s,c){var l=vg(r,window.getComputedStyle(o).direction),p=l*s,u=a.target,f=o.contains(u),h=!1,v=p>0,m=0,g=0;do{if(!u)break;var S=D0(r,u),_=S[0],C=S[1],x=S[2],w=C-x-l*_;(_||w)&&j0(r,u)&&(m+=w,g+=_);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(v&&Math.abs(m)<1||!v&&Math.abs(g)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Nh=function(r){return[r.deltaX,r.deltaY]},Ah=function(r){return r&&"current"in r?r.current:r},gg=function(r,o){return r[0]===o[0]&&r[1]===o[1]},xg=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},wg=0,yo=[];function bg(r){var o=N.useRef([]),a=N.useRef([0,0]),s=N.useRef(),c=N.useState(wg++)[0],l=N.useState(A0)[0],p=N.useRef(r);N.useEffect(function(){p.current=r},[r]),N.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var C=Uy([r.lockRef.current],(r.shards||[]).map(Ah),!0).filter(Boolean);return C.forEach(function(x){return x.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=N.useCallback(function(C,x){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!p.current.allowPinchZoom;var w=zs(C),k=a.current,b="deltaX"in C?C.deltaX:k[0]-w[0],R="deltaY"in C?C.deltaY:k[1]-w[1],P,j=C.target,B=Math.abs(b)>Math.abs(R)?"h":"v";if("touches"in C&&B==="h"&&j.type==="range")return!1;var D=window.getSelection(),F=D&&D.anchorNode,O=F?F===j||F.contains(j):!1;if(O)return!1;var L=Rh(B,j);if(!L)return!0;if(L?P=B:(P=B==="v"?"h":"v",L=Rh(B,j)),!L)return!1;if(!s.current&&"changedTouches"in C&&(b||R)&&(s.current=P),!P)return!0;var G=s.current||P;return yg(G,x,C,G==="h"?b:R)},[]),f=N.useCallback(function(C){var x=C;if(!(!yo.length||yo[yo.length-1]!==l)){var w="deltaY"in x?Nh(x):zs(x),k=o.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&gg(P.delta,w)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var b=(p.current.shards||[]).map(Ah).filter(Boolean).filter(function(P){return P.contains(x.target)}),R=b.length>0?u(x,b[0]):!p.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),h=N.useCallback(function(C,x,w,k){var b={name:C,delta:x,target:w,should:k,shadowParent:_g(w)};o.current.push(b),setTimeout(function(){o.current=o.current.filter(function(R){return R!==b})},1)},[]),v=N.useCallback(function(C){a.current=zs(C),s.current=void 0},[]),m=N.useCallback(function(C){h(C.type,Nh(C),C.target,u(C,r.lockRef.current))},[]),g=N.useCallback(function(C){h(C.type,zs(C),C.target,u(C,r.lockRef.current))},[]);N.useEffect(function(){return yo.push(l),r.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",f,vo),document.addEventListener("touchmove",f,vo),document.addEventListener("touchstart",v,vo),function(){yo=yo.filter(function(C){return C!==l}),document.removeEventListener("wheel",f,vo),document.removeEventListener("touchmove",f,vo),document.removeEventListener("touchstart",v,vo)}},[]);var S=r.removeScrollBar,_=r.inert;return N.createElement(N.Fragment,null,_?N.createElement(l,{styles:xg(c)}):null,S?N.createElement(ug,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function _g(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const Sg=Qy(N0,bg);var O0=N.forwardRef(function(r,o){return N.createElement(mi,zr({},r,{ref:o,sideCar:Sg}))});O0.classNames=mi.classNames;var kg=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},go=new WeakMap,Us=new WeakMap,Vs={},bc=0,M0=function(r){return r&&(r.host||M0(r.parentNode))},Cg=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=M0(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},Eg=function(r,o,a,s){var c=Cg(o,Array.isArray(r)?r:[r]);Vs[a]||(Vs[a]=new WeakMap);var l=Vs[a],p=[],u=new Set,f=new Set(c),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};c.forEach(h);var v=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))v(g);else try{var S=g.getAttribute(s),_=S!==null&&S!=="false",C=(go.get(g)||0)+1,x=(l.get(g)||0)+1;go.set(g,C),l.set(g,x),p.push(g),C===1&&_&&Us.set(g,!0),x===1&&g.setAttribute(a,"true"),_||g.setAttribute(s,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return v(o),u.clear(),bc++,function(){p.forEach(function(m){var g=go.get(m)-1,S=l.get(m)-1;go.set(m,g),l.set(m,S),g||(Us.has(m)||m.removeAttribute(s),Us.delete(m)),S||m.removeAttribute(a)}),bc--,bc||(go=new WeakMap,go=new WeakMap,Us=new WeakMap,Vs={})}},Tg=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=kg(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),Eg(s,c,a,"aria-hidden")):function(){return null}};function Pg(r){const o=Rg(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find(Ag);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Rg(r){const o=N.forwardRef((a,s)=>{const{children:c Line truncated
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return N.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},Ug="DialogDescriptionWarning",Vg=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q0(Ug).contentName}}.`;return N.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},Z0=F0,J0=z0,yi=U0,gi=V0,xi=K0,wi=q0,ep=Y0;const tp=Z0,Wg=J0,rp=N.forwardRef(({className:r,...o},a)=>A.jsx(yi,{ref:a,className:Xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));rp.displayName=yi.displayName;const cu=N.forwardRef(({className:r,children:o,...a},s)=>A.jsxs(Wg,{children:[A.jsx(rp,{}),A.jsxs(gi,{ref:s,className:Xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,A.jsxs(ep,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[A.jsx(t0,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cu.displayName=gi.displayName;const uu=({className:r,...o})=>A.jsx("div",{className:Xe("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});uu.displayName="DialogHeader";const du=({className:r,...o})=>A.jsx("div",{className:Xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});du.displayName="DialogFooter";const fu=N.forwardRef(({className:r,...o},a)=>A.jsx(xi,{ref:a,className:Xe("text-lg font-semibold leading-none tracking-tight",r),...o}));fu.displayName=xi.displayName;const Kg=N.forwardRef(({className:r,...o},a)=>A.jsx(wi,{ref:a,className:Xe("text-sm text-muted-foreground",r),...o}));Kg.displayName=wi.displayName;function Bh(r){const o=Gg(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find($g);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Gg(r){const o=N.forwardRef((a,s)=>{const{children:c,...l}=a;if(N.isValidElement(c)){const p=Xg(c),u=Yg(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var qg=Symbol("radix.slottable");function $g(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===qg}function Yg(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function Xg(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function Qg(r){const o=r+"CollectionProvider",[a,s]=Ea(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),p=C=>{const{scope:x,children:w}=C,k=fe.useRef(null),b=fe.useRef(new Map).current;return A.jsx(c,{scope:x,itemMap:b,collectionRef:k,children:w})};p.displayName=o;const u=r+"CollectionSlot",f=Bh(u),h=fe.forwardRef((C,x)=>{const{scope:w,children:k}=C,b=l(u,w),R=xr(x,b.collectionRef);return A.jsx(f,{ref:R,children:k})});h.displayName=u;const v=r+"CollectionItemSlot",m="data-radix-collection-item",g=Bh(v),S=fe.forwardRef((C,x)=>{const{scope:w,children:k,...b}=C,R=fe.useRef(null),P=xr(x,R),j=l(v,w);return fe.useEffect(()=>(j.itemMap.set(R,{ref:R,...b}),()=>void j.itemMap.delete(R))),A.jsx(g,{[m]:"",ref:P,children:k})});S.displayName=v;function _(C){const x=l(r+"CollectionConsumer",C);return fe.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const b=Array.from(k.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((j,B)=>b.indexOf(j.ref.current)-b.indexOf(B.ref.current))},[x.coll Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),k3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const _={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:v}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),C3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<35){const _={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:v}),f+=32;const m=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&p.push({name:"Ciphertext",description:`Encrypted message data (${c.length-35} bytes). Contains encrypted plaintext with this structure:
• Timestamp (4 bytes) - send time as unix timestamp
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
• Password (remaining bytes) - password for repeater/room`,startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),E3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const v={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(v.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),v}const p=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=p),h}catch(p){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),T3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const p=[];for(let h=0;h<l;h++)p.push((0,a.byteToHex)(c[1+h]));const u=c[1+l];let f="";return c.length>1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:p,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),P3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const _={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:v}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-4};return l!=null&&l.include Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return _o(a,o)}countNamesForLength(o){return wa(o)}async runBatch(o,a,s,c,l,p){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],v=l&&p?1:0;let m,g=0,S=0;if(v){const P=new Uint8Array(l.length/2);for(let O=0;O<P.length;O++)P[O]=parseInt(l.substr(O*2,2),16);g=P.length*8;const j=Math.ceil(P.length/4)*4,B=new Uint8Array(j);B.set(P),m=new Uint32Array(j/4);for(let O=0;O<m.length;O++)m[O]=B[O*4]<<24|B[O*4+1]<<16|B[O*4+2]<<8|B[O*4+3];const D=parseInt(p.substr(0,2),16),F=parseInt(p.substr(2,2),16);S=D<<24|F<<16}else m=new Uint32Array([0]);const _=Math.max(m.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<_)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:_,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=_,this.bindGroupDirty=!0);const C=new Uint32Array([o,s,a,c,S,m.length,g,v]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,m),this.device.queue.writeBuffer(this.matchCountBuffer,0,r1.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const x=this.device.createCommandEncoder(),w=x.beginComputePass();w.setPipeline(this.pipeline),w.setBindGroup(0,this.bindGroup),w.dispatchWorkgroups(Math.ceil(c/(256*16))),w.end(),x.copyBufferToBuffer(this.matchCountBuffer,0,f,0,4),x.copyBufferToBuffer(this.matchIndicesBuffer,0,h,0,1024*4),this.device.queue.submit([x.finish()]),await f.mapAsync(GPUMapMode.READ);const b=new Uint32Array(f.getMappedRange())[0];f.unmap();const R=[];if(b>0){await h.mapAsync(GPUMapMode.READ);const P=new Uint32Array(h.getMappedRange());for(let j=0;j<Math.min(b,1024);j++)R.push(P[j]);h.unmap()}return R}destroy(){var o,a,s,c,l,p,u,f;(o=this.paramsBuffer)==null||o.destroy(),(a=this.matchCountBuffer)==null||a.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(p=this.matchCountReadBuffers[1])==null||p.destroy(),(u=this.matchIndicesReadBuffers[0])==null||u.destroy(),(f=this.matchIndicesReadBuffers[1])==null||f.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}};t1.ZERO_DATA=new Uint32Array([0]);var F3=t1;function H3(){return typeof navigator<"u"&&"gpu"in navigator}var L3=/^[a-z0-9-]+$/,z3=/^[a-z0-9].*[a-z0-9]$|^[a-z0-9]$/,U3=/ Line truncated
`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter(Xh)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(Xh)}abort(){this.abortFlag=!0}isGpuAvailable(){return H3()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await qh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:p,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new F3,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let v=0,m=performance.now(),g=1,S=0;if(o!=null&&o.startFrom){const j=D3(o.startFrom);j&&(g=j.length,S=j.index+1,S>=wa(g)&&(g++,S=0))}let _=0;for(let j=g;j<=s;j++)_+=wa(j);_-=S;const C=(j,B,D)=>{if(!a)return;const O=(performance.now()-h)/1e3,L=O>0?Math.round(v/O):0,G=_-v,$=L>0?G/L:0;a({checked:v,total:_,percent:_>0?Math.min(100,v/_*100):0,rateKeysPerSec:L,etaSeconds:$,elapsedSeconds:O,currentLength:B,currentPosition:D,phase:j})},x=j=>{if(!O3(p,u,j))return{valid:!1};const B=qh.ChannelCrypto.decryptGroupTextMessage(p,u,j);return!B.success||!B.data?{valid:!1}:this.useTimestampFilter&&!M3(B.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!I3(B.data.message)?{valid:!1}:{valid:!0,message:B.data.message}};if(g===1&&S===0){C("public-key",0,eu);const j=Yh(li);if(l===j){const B=x(li);if(B.valid)return{found:!0,roomName:eu,key:li,decryptedMessage:B.message}}}if(this.wordlist.length>0&&g===1&&S===0)for(let j=0;j<this.wordlist.length;j++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[j]};const B=this.wordlist[j],D=$h("#"+B),F=Yh(D);if(parseInt(F,16)===f){const L=x(D);if(L.valid)return{found:!0,roomName:B,key:D,decryptedMessage:L.message}}const O=performance.now();O-m>=200&&(C("wordlist",B.length,B),m=O,await new Promise(L=>setTimeout(L,0)))}const w=32768,k=1e3;let b=w,R=!1;for(let j=g;j<=s;j++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:_o(j,0)||void 0};const B=wa(j);let D=j===g?S:0;for(;D<B;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:_o(j,D)||void 0};const F=Math.min(b,B-D),O=performance.now(),L=await this.gpuInstance.runBatch(f,j,D,F,p,u),G=performance.now()-O;if(v+=F,!R&&F>=w&&G>0){const J=k/G,ae=Math.round(F*J),Q=Math.pow(2,Math.round(Math.log2(Math.max(w,ae))));b=Math.max(w,Q),R=!0}for(const J of L){const ae=_o(j,J);if(!ae)continue;const Q=$h("#"+ae),ne=x(Q);if(ne.valid)return{found:!0,roomName:ae,key:Q,decryptedMessage:ne.message}}D+=F;const $=performance.now();if($-m>=200){const J=_o(j,Math.min(D,B-1))||"";C("bruteforce",j,J),m=$,await new Promise(ae=>setTimeout(ae,0))}}}return{found:!1,resumeFrom:_o(s,wa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information:
crypto-js/ripemd160.js:
(** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*)
crypto-js/mode-ctr-gladman.js:
(** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*)
@noble/ed25519/index.js:
(*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
*/function W3({packets:r,channels:o,onChannelCreate:a}){const[s,c]=N.useState(!1),[l,p]=N.useState(6),[u,f]=N.useState(!1),[h,v]=N.useState(null),[m,g]=N.useState(new Map),[S,_]=N.useState([]),[C,x]=N.useState(!1),[w,k]=N.useState(null),b=N.useRef(null),R=N.useRef(!1),P=N.useRef(!1),j=N.useRef(!1),B=N.useRef(new Map),D=N.useRef(!1),F=N.useRef(6);N.useEffect(()=>{const U=new V3;return b.current=U,k(U.isGpuAvailable()),U.loadWordlist("/words_alpha.txt").then(()=>x(!0)).catch(te=>console.error("Failed to load wordlist:",te)),()=>{U.destroy(),b.current=null}},[]);const O=new Set(o.map(U=>U.key.toUpperCase())),L=r.filter(U=>U.payload_type==="GROUP_TEXT"&&!U.decrypted);N.useEffect(()=>{g(U=>{const te=new Map(U);let X=!1;for(const E of L)te.has(E.id)||(te.set(E.id,{packet:E,attempts:0,lastAttemptLength:0,status:"pending"}),X=!0);return X?(B.current=te,te):U})},[L.length]),N.useEffect(()=>{B.current=m},[m]),N.useEffect(()=>{D.current=u},[u]),N.useEffect(()=>{F.current=l},[l]);const G=Array.from(m.values()).filter(U=>U.status==="pending").length,$=Array.from(m.values()).filter(U=>U.status==="cracked").length,J=Array.from(m.values()).filter(U=>U.status==="failed").length,ae=N.useCallback(async()=>{if(j.current||!b.current||!R.current)return;const U=B.current;let te=null,X=null;for(const[H,V]of U.entries())if(V.status==="pending"){te=V,X=H;break}if(!te&&D.current){const H=Array.from(U.entries()).filter(([,V])=>V.status==="failed"&&V.lastAttemptLength<10);H.length>0&&(H.sort((V,re)=>V[1].lastAttemptLength-re[1].lastAttemptLength),[X,te]=H[0])}if(!te||X===null){R.current&&setTimeout(()=>ae(),1e3);return}j.current=!0;const E=F.current,I=te.lastAttemptLength>0?te.lastAttemptLength+1:E;try{const H=await b.current.crack(te.packet.data,{maxLength:I,useTimestampFilter:!0,useUtf8Filter:!0},V=>{v(V)});if(P.current){P.current=!1,j.current=!1,v(null);return}if(H.found&&H.roomName&&H.key){g(ce=>{const pe=new Map(ce),oe=pe.get(X);return oe&&pe.set(X,{...oe,status:"cracked",attempts:oe.attempts+1,lastAttemptLength:I}),pe});const V={roomName:H.roomName,key:H.key,packetId:X,message:H.decryptedMessage||"",crackedAt:Date.now()};_(ce=>[...ce,V]);const re=H.key.toUpperCase();if(!O.has(re))try{await a("#"+H.roomName,H.key)}catch(ce){console.error("Failed to create channel:",ce)}}else g(V=>{const re=new Map(V),ce=re.get(X);return ce&&re.set(X,{...ce,status:"failed",attempts:ce.attempts+1,lastAttemptLength:I}),re})}catch(H){console.error("Cracking error:",H),g(V=>{const re=new Map(V),ce=re.get(X);return ce&&re.set(X,{...ce,status:"failed",attempts:ce.attempts+1,lastAttemptLength:I}),re})}j.current=!1,v(null),R.current&&setTimeout(()=>ae(),100)},[O,a]),Q=()=>{if(!w){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}c(!0),R.current=!0,P.current=!1,ae()},ne=()=>{var U;c(!1),R.current=!1,P.current=!0,(U=b.current)==null||U.abort()};return A.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[A.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[A.jsx("button",{onClick:s?ne:Q,disabled:!C||w===!1,className:Xe("px-4 py-1.5 rounded text-sm font-medium",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:s?"Stop":"Start Cracking"}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),A.jsx("input",{type:"number",min:1,max:10,value:l,onChange:U=>p(Math.min(10,Math.max(1,parseInt(U.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),A.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[A.jsx("input",{type:"checkbox",checked:u,onChange:U=>f(U.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),A.jsxs("div",{className:"flex gap-4 text-sm",children:[A.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",A.jsx("span",{className:"text-foreground font-medium",children:G})]}),A.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",A.jsx("span",{className:"text-green-500 font-medium",children:$})]}),A.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",A.jsx("span",{className:"text-destructive font-medium",children:J})]})]}),h&&A.jsxs("div",{className:"space-y-1",children:[A.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[A.jsxs("span",{children:[h.phase==="wordlist"?"Dictionary":h.phase==="bruteforce"?"Bruteforce":"Public Key",h.phase==="bruteforce"&&` - Length ${h.currentLength}`,": ",h.currentPosition]}),A.jsxs("span",{children:[h.rateKeysPerSec>=1e9?`${(h.rateKeysPerSec/1e9).toFixed(2)} Gkeys/s`:`${(h.rateKeysPerSec/1e6).toFixed(1)} Mkeys/s`," ","• ETA: ",h.etaSeconds<60?`${Math.round(h.etaSeconds)}s`:`${Math.round(h.etaSeconds/60)Line truncated
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RemoteTerm for MeshCore</title>
<script type="module" crossorigin src="/assets/index-DeS_VBWV.js"></script>
<script type="module" crossorigin src="/assets/index-B-xot-vl.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DlaqriQ9.css">
</head>
<body>
+7
View File
@@ -18,6 +18,7 @@
"clsx": "^2.1.1",
"lucide-react": "^0.562.0",
"meshcore-cracker": "file:../references/standalone_cracker",
"nosleep.js": "^0.12.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sonner": "^2.0.7",
@@ -3616,6 +3617,12 @@
"node": ">=0.10.0"
}
},
"node_modules/nosleep.js": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",
"integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==",
"license": "MIT"
},
"node_modules/nwsapi": {
"version": "2.2.23",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz",
+2 -1
View File
@@ -11,7 +11,6 @@
"test:run": "vitest run"
},
"dependencies": {
"meshcore-cracker": "file:../references/standalone_cracker",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-label": "^2.1.8",
@@ -21,6 +20,8 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.562.0",
"meshcore-cracker": "file:../references/standalone_cracker",
"nosleep.js": "^0.12.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sonner": "^2.0.7",
+10 -1
View File
@@ -1,5 +1,6 @@
import { useState, useEffect, useRef, useCallback } from 'react';
import { GroupTextCracker, type ProgressReport } from 'meshcore-cracker';
import NoSleep from 'nosleep.js';
import type { RawPacket, Channel } from '../types';
import { cn } from '@/lib/utils';
@@ -35,6 +36,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
const [gpuAvailable, setGpuAvailable] = useState<boolean | null>(null);
const crackerRef = useRef<GroupTextCracker | null>(null);
const noSleepRef = useRef<NoSleep | null>(null);
const isRunningRef = useRef(false);
const abortedRef = useRef(false);
const isProcessingRef = useRef(false);
@@ -42,12 +44,15 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
const retryFailedRef = useRef(false);
const maxLengthRef = useRef(6);
// Initialize cracker
// Initialize cracker and NoSleep
useEffect(() => {
const cracker = new GroupTextCracker();
crackerRef.current = cracker;
setGpuAvailable(cracker.isGpuAvailable());
const noSleep = new NoSleep();
noSleepRef.current = noSleep;
// Load wordlist
cracker.loadWordlist('/words_alpha.txt')
.then(() => setWordlistLoaded(true))
@@ -56,6 +61,8 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
return () => {
cracker.destroy();
crackerRef.current = null;
noSleep.disable();
noSleepRef.current = null;
};
}, []);
@@ -265,6 +272,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
setIsRunning(true);
isRunningRef.current = true;
abortedRef.current = false;
noSleepRef.current?.enable();
processNext();
};
@@ -273,6 +281,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
isRunningRef.current = false;
abortedRef.current = true;
crackerRef.current?.abort();
noSleepRef.current?.disable();
};