mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-10-23 09:42:21 +00:00
Draft 1 of the homebaked visualizer
This commit is contained in:
1 parent
d6f6913ef2
commit
52319a8863
16 files changed
+2556
-584
No files matched your search
+542
@@ -0,0 +1,542 @@
|
||||
var my=Object.defineProperty;var gy=(n,s,i)=>s in n?my(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Wo=(n,s,i)=>gy(n,typeof s!="symbol"?s+"":s,i);function xy(n,s){for(var i=0;i<s.length;i++){const l=s[i];if(typeof l!="string"&&!Array.isArray(l)){for(const c in l)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(l,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>l[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const p of u.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Gf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function gx(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var s=n.default;if(typeof s=="function"){var i=function l(){return this instanceof l?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};i.prototype=s.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(l){var c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(i,l,c.get?c:{enumerable:!0,get:function(){return n[l]}})}),i}var $f={exports:{}},el={},Kf={exports:{}},At={};/**
|
||||
* @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 $p;function Ay(){if($p)return At;$p=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),p=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),A=Symbol.iterator;function _(N){return N===null||typeof N!="object"?null:(N=A&&N[A]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function w(N,U,K){this.props=N,this.context=U,this.refs=C,this.updater=K||k}w.prototype.isReactComponent={},w.prototype.setState=function(N,U){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,U,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function B(){}B.prototype=w.prototype;function S(N,U,K){this.props=N,this.context=U,this.refs=C,this.updater=K||k}var T=S.prototype=new B;T.constructor=S,R(T,w.prototype),T.isPureReactComponent=!0;var F=Array.isArray,M=Object.prototype.hasOwnProperty,z={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function j(N,U,K){var Y,fe={},me=null,Se=null;if(U!=null)for(Y in U.ref!==void 0&&(Se=U.ref),U.key!==void 0&&(me=""+U.key),U)M.call(U,Y)&&!H.hasOwnProperty(Y)&&(fe[Y]=U[Y]);var we=arguments.length-2;if(we===1)fe.children=K;else if(1<we){for(var de=Array(we),he=0;he<we;he++)de[he]=arguments[he+2];fe.children=de}if(N&&N.defaultProps)for(Y in we=N.defaultProps,we)fe[Y]===void 0&&(fe[Y]=we[Y]);return{$$typeof:n,type:N,key:me,ref:Se,props:fe,_owner:z.current}}function X(N,U){return{$$typeof:n,type:N.type,key:U,ref:N.ref,props:N.props,_owner:N._owner}}function V(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function $(N){var U={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(K){return U[K]})}var ee=/\/+/g;function W(N,U){return typeof N=="object"&&N!==null&&N.key!=null?$(""+N.key):U.toString(36)}function re(N,U,K,Y,fe){var me=typeof N;(me==="undefined"||me==="boolean")&&(N=null);var Se=!1;if(N===null)Se=!0;else switch(me){case"string":case"number":Se=!0;break;case"object":switch(N.$$typeof){case n:case s:Se=!0}}if(Se)return Se=N,fe=fe(Se),N=Y===""?"."+W(Se,0):Y,F(fe)?(K="",N!=null&&(K=N.replace(ee,"$&/")+"/"),re(fe,U,K,"",function(he){return he})):fe!=null&&(V(fe)&&(fe=X(fe,K+(!fe.key||Se&&Se.key===fe.key?"":(""+fe.key).replace(ee,"$&/")+"/")+N)),U.push(fe)),1;if(Se=0,Y=Y===""?".":Y+":",F(N))for(var we=0;we<N.length;we++){me=N[we];var de=Y+W(me,we);Se+=re(me,U,K,de,fe)}else if(de=_(N),typeof de=="function")for(N=de.call(N),we=0;!(me=N.next()).done;)me=me.value,de=Y+W(me,we++),Se+=re(me,U,K,de,fe);else if(me==="object")throw U=String(N),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Se}function pe(N,U,K){if(N==null)return N;var Y=[],fe=0;return re(N,Y,"","",function(me){return U.call(K,me,fe++)}),Y}function ie(N){if(N._status===-1){var U=N._result;U=U(),U.then(function(K){(N._status===0||N._status===-1)&&(N._status=1,N._result=K)},function(K){(N._status===0||N._status===-1)&&(N._status=2,N._result=K)}),N._status===-1&&(N._status=0,N._result=U)}if(N._status===1)return N._result.default;throw N._result}var Ae={current:null},G={transition:null},xe={ReactCurrentDispatcher:Ae,ReactCurrentBatchConfig:G,ReactCurrentOwner:z};function Z(){throw Error("act(...) is not supported in production builds of React.")}return At.Children={map:pe,forEach:function(N,U,K){pe(N,function(){U.apply(this,arguments)},K)},count:function(N){var U=0;return pe(N,function(){U++}),U},toArray:function(N){return pe(N,function(U){return U})||[]},only:function(N){if(!V(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},At.Component=w,At.Fragment=i,At.Profiler=c,At.PureComponent=S,At.StrictMode=l,At.Suspense=g,At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xe,At.act=Z,At.cloneElement=function(N,U,K){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var Y=R({},N.props),fe=N.key,me=N.ref,Se=N._owner;if(U!=null){if(U.ref!==void 0&&(me=U.ref,Se=z.current),U.key!==void 0&&(fe=""+U.key),N.type&&N.type.defaultProps)var we=N.type.defaultProps;for(de in U)M.call(U,de)&&!H.hasOwnProperty(de)&&(Y[de]=U[de]===void 0&&we!==void 0?we[de]:U[de])}var de=arguments.length-2;if(de===1)Y.children=K;else if(1<de){we=Array(de);for(var he=0;he<de;he++)we[he]=arguments[he+2];Y.children=we}return{$$typeof:n,type:N.type,key:fe,ref:me,props:Y,_owner:Se}},At.creLine 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 Qp;function vy(){if(Qp)return el;Qp=1;var n=M0(),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function p(d,g,m){var x,A={},_=null,k=null;m!==void 0&&(_=""+m),g.key!==void 0&&(_=""+g.key),g.ref!==void 0&&(k=g.ref);for(x in g)l.call(g,x)&&!u.hasOwnProperty(x)&&(A[x]=g[x]);if(d&&d.defaultProps)for(x in g=d.defaultProps,g)A[x]===void 0&&(A[x]=g[x]);return{$$typeof:s,type:d,key:_,ref:k,props:A,_owner:c.current}}return el.Fragment=i,el.jsx=p,el.jsxs=p,el}var Yp;function yy(){return Yp||(Yp=1,$f.exports=vy()),$f.exports}var b=yy(),D=M0();const Te=aa(D),I0=xy({__proto__:null,default:Te},[D]);var Vc={},Qf={exports:{}},Kn={},Yf={exports:{}},Xf={};/**
|
||||
* @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 Xp;function _y(){return Xp||(Xp=1,(function(n){function s(G,xe){var Z=G.length;G.push(xe);e:for(;0<Z;){var N=Z-1>>>1,U=G[N];if(0<c(U,xe))G[N]=xe,G[Z]=U,Z=N;else break e}}function i(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var xe=G[0],Z=G.pop();if(Z!==xe){G[0]=Z;e:for(var N=0,U=G.length,K=U>>>1;N<K;){var Y=2*(N+1)-1,fe=G[Y],me=Y+1,Se=G[me];if(0>c(fe,Z))me<U&&0>c(Se,fe)?(G[N]=Se,G[me]=Z,N=me):(G[N]=fe,G[Y]=Z,N=Y);else if(me<U&&0>c(Se,Z))G[N]=Se,G[me]=Z,N=me;else break e}}return xe}function c(G,xe){var Z=G.sortIndex-xe.sortIndex;return Z!==0?Z:G.id-xe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var p=Date,d=p.now();n.unstable_now=function(){return p.now()-d}}var g=[],m=[],x=1,A=null,_=3,k=!1,R=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var xe=i(m);xe!==null;){if(xe.callback===null)l(m);else if(xe.startTime<=G)l(m),xe.sortIndex=xe.expirationTime,s(g,xe);else break;xe=i(m)}}function F(G){if(C=!1,T(G),!R)if(i(g)!==null)R=!0,ie(M);else{var xe=i(m);xe!==null&&Ae(F,xe.startTime-G)}}function M(G,xe){R=!1,C&&(C=!1,B(j),j=-1),k=!0;var Z=_;try{for(T(xe),A=i(g);A!==null&&(!(A.expirationTime>xe)||G&&!$());){var N=A.callback;if(typeof N=="function"){A.callback=null,_=A.priorityLevel;var U=N(A.expirationTime<=xe);xe=n.unstable_now(),typeof U=="function"?A.callback=U:A===i(g)&&l(g),T(xe)}else l(g);A=i(g)}if(A!==null)var K=!0;else{var Y=i(m);Y!==null&&Ae(F,Y.startTime-xe),K=!1}return K}finally{A=null,_=Z,k=!1}}var z=!1,H=null,j=-1,X=5,V=-1;function $(){return!(n.unstable_now()-V<X)}function ee(){if(H!==null){var G=n.unstable_now();V=G;var xe=!0;try{xe=H(!0,G)}finally{xe?W():(z=!1,H=null)}}else z=!1}var W;if(typeof S=="function")W=function(){S(ee)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,pe=re.port2;re.port1.onmessage=ee,W=function(){pe.postMessage(null)}}else W=function(){w(ee,0)};function ie(G){H=G,z||(z=!0,W())}function Ae(G,xe){j=w(function(){G(n.unstable_now())},xe)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_continueExecution=function(){R||k||(R=!0,ie(M))},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_getFirstCallbackNode=function(){return i(g)},n.unstable_next=function(G){switch(_){case 1:case 2:case 3:var xe=3;break;default:xe=_}var Z=_;_=xe;try{return G()}finally{_=Z}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(G,xe){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Z=_;_=G;try{return xe()}finally{_=Z}},n.unstable_scheduleCallback=function(G,xe,Z){var N=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?N+Z:N):Z=N,G){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=Z+U,G={id:x++,callback:xe,priorityLevel:G,startTime:Z,expirationTime:U,sortIndex:-1},Z>N?(G.sortIndex=Z,s(m,G),i(g)===null&&G===i(m)&&(C?(B(j),j=-1):C=!0,Ae(F,Z-N))):(G.sortIndex=U,s(g,G),R||k||(R=!0,ie(M))),G},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(G){var xe=_;return function(){var Z=_;_=xe;try{return G.apply(this,arguments)}finally{_=Z}}}})(Xf)),Xf}var Jp;function wy(){return Jp||(Jp=1,Yf.exports=_y()),Yf.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 em;function by(){if(em)return Kn;em=1;var n=M0(),s=wy();function i(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,c={};function u(e,r){p(e,r),p(e+"Capture",r)}function p(e,r){for(c[e]=r,e=0;e<r.length;e++)l.add(r[e])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,x={},A={};function _(e){return g.call(A,e)?!0:g.call(x,e)?!1:m.test(e)?A[e]=!0:(x[e]=!0,!1)}function k(e,r,a,h){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return h?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,r,a,h){if(r===null||typeof r>"u"||k(e,r,a,h))return!0;if(h)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function C(e,r,a,h,y,E,I){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=h,this.attributeNamespace=y,this.mustUseProperty=a,this.propertyName=e,this.type=r,this.sanitizeURL=E,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){w[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];w[r]=new C(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){w[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){w[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){w[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){w[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){w[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){w[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){w[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function S(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 r=e.replace(B,S);w[r]=new C(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(B,S);w[r]=new C(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(B,S);w[r]=new C(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){w[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),w.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){w[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function T(e,r,a,h){var y=w.hasOwnProperty(r)?w[r]:null;(y!==null?y.type!==0:h||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=
Line truncated
|
||||
`+N+e}var K=!1;function Y(e,r){if(!e||K)return"";K=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(ue){var h=ue}Reflect.construct(e,[],r)}else{try{r.call()}catch(ue){h=ue}e.call(r.prototype)}else{try{throw Error()}catch(ue){h=ue}e()}}catch(ue){if(ue&&h&&typeof ue.stack=="string"){for(var y=ue.stack.split(`
|
||||
`),E=h.stack.split(`
|
||||
`),I=y.length-1,q=E.length-1;1<=I&&0<=q&&y[I]!==E[q];)q--;for(;1<=I&&0<=q;I--,q--)if(y[I]!==E[q]){if(I!==1||q!==1)do if(I--,q--,0>q||y[I]!==E[q]){var J=`
|
||||
`+y[I].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=I&&0<=q);break}}}finally{K=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?U(e):""}function fe(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=Y(e.type,!1),e;case 11:return e=Y(e.type.render,!1),e;case 1:return e=Y(e.type,!0),e;default:return""}}function me(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 H:return"Fragment";case z:return"Portal";case X:return"Profiler";case j:return"StrictMode";case W:return"Suspense";case re:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $:return(e.displayName||"Context")+".Consumer";case V:return(e._context.displayName||"Context")+".Provider";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pe:return r=e.displayName||null,r!==null?r:me(e.type)||"Memo";case ie:r=e._payload,e=e._init;try{return me(e(r))}catch{}}return null}function Se(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(r);case 8:return r===j?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function de(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function he(e){var r=de(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),h=""+e[r];if(!e.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var y=a.get,E=a.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return y.call(this)},set:function(I){h=""+I,E.call(this,I)}}),Object.defineProperty(e,r,{enumerable:a.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Ze(e){e._valueTracker||(e._valueTracker=he(e))}function Fe(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),h="";return e&&(h=de(e)?e.checked?"true":"false":e.value),e=h,e!==a?(r.setValue(e),!0):!1}function ge(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 Le(e,r){var a=r.checked;return Z({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function We(e,r){var a=r.defaultValue==null?"":r.defaultValue,h=r.checked!=null?r.checked:r.defaultChecked;a=we(r.value!=null?r.value:a),e._wrapperState={initialChecked:h,initialValue:a,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function lt(e,r){r=r.checked,r!=null&&T(e,"checked",r,!1)}function et(e,r){lt(e,r);var a=we(r.value),h=r.type;if(a!=null)h==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Ue(e,r.type,a):r.hasOwnProperty("defaultValue")&&Ue(e,r.type,we(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function Ne(e,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var h=r.type;if(!(h!=="submit"&&h!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,a||r===e.value||(e.value=r),e.defaultValue=r}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function Ue(e,r,a){(r!=="number"||ge(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var ot=Array.isArray;function tt(e,r,a,h){if(e=e.options,r){r={};for(var y=0;y<a.length;y++)r["$"+a[y]]=!0;for(a=0;a<e.length;a++)y=r.hasOwnProperty("$"+e[a].value),e[a].selected!==y&&(e[a].selected=y),y&&h&&(e[a].defaultSelected=!0)}else{for(a=""+we(a),r=null,y=0;y<e.length;y++){if(e[y].value===a){e[y].selected=!0,h&&(e[y].defaultSelected=!0);return}r!==null||e[y].disabled||(r=e[y])}r!==null&&(r.selected=!0)}}function oe(e,r){if(r.dangerouslySetInnerHTM
Line truncated
|
||||
`).replace(Q,"")}function ce(e,r,a){if(r=se(r),se(e)!==r&&a)throw Error(i(425))}function be(){}var Ie=null,nt=null;function ht(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ln=typeof setTimeout=="function"?setTimeout:void 0,on=typeof clearTimeout=="function"?clearTimeout:void 0,Ln=typeof Promise=="function"?Promise:void 0,Sn=typeof queueMicrotask=="function"?queueMicrotask:typeof Ln<"u"?function(e){return Ln.resolve(null).then(e).catch(Yi)}:ln;function Yi(e){setTimeout(function(){throw e})}function ja(e,r){var a=r,h=0;do{var y=a.nextSibling;if(e.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"){if(h===0){e.removeChild(y),tr(r);return}h--}else a!=="$"&&a!=="$?"&&a!=="$!"||h++;a=y}while(a);tr(r)}function Qr(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function rc(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return e;r--}else a==="/$"&&r++}e=e.previousSibling}return null}var mi=Math.random().toString(36).slice(2),gr="__reactFiber$"+mi,Xi="__reactProps$"+mi,Dt="__reactContainer$"+mi,Ji="__reactEvents$"+mi,Hd="__reactListeners$"+mi,Vd="__reactHandles$"+mi;function gi(e){var r=e[gr];if(r)return r;for(var a=e.parentNode;a;){if(r=a[Dt]||a[gr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rc(e);e!==null;){if(a=e[gr])return a;e=rc(e)}return r}e=a,a=e.parentNode}return null}function xi(e){return e=e[gr]||e[Dt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ai(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Ns(e){return e[Xi]||null}var Ud=[],Fs=-1;function eo(e){return{current:e}}function Ut(e){0>Fs||(e.current=Ud[Fs],Ud[Fs]=null,Fs--)}function Ht(e,r){Fs++,Ud[Fs]=e.current,e.current=r}var to={},Bn=eo(to),Zn=eo(!1),Fo=to;function Ls(e,r){var a=e.type.contextTypes;if(!a)return to;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===r)return h.__reactInternalMemoizedMaskedChildContext;var y={},E;for(E in a)y[E]=r[E];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=y),y}function Wn(e){return e=e.childContextTypes,e!=null}function ic(){Ut(Zn),Ut(Bn)}function gh(e,r,a){if(Bn.current!==to)throw Error(i(168));Ht(Bn,r),Ht(Zn,a)}function xh(e,r,a){var h=e.stateNode;if(r=r.childContextTypes,typeof h.getChildContext!="function")return a;h=h.getChildContext();for(var y in h)if(!(y in r))throw Error(i(108,Se(e)||"Unknown",y));return Z({},a,h)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Fo=Bn.current,Ht(Bn,e),Ht(Zn,Zn.current),!0}function Ah(e,r,a){var h=e.stateNode;if(!h)throw Error(i(169));a?(e=xh(e,r,Fo),h.__reactInternalMemoizedMergedChildContext=e,Ut(Zn),Ut(Bn),Ht(Bn,e)):Ut(Zn),Ht(Zn,a)}var vi=null,sc=!1,Zd=!1;function vh(e){vi===null?vi=[e]:vi.push(e)}function Fv(e){sc=!0,vh(e)}function no(){if(!Zd&&vi!==null){Zd=!0;var e=0,r=Ct;try{var a=vi;for(Ct=1;e<a.length;e++){var h=a[e];do h=h(!0);while(h!==null)}vi=null,sc=!1}catch(y){throw vi!==null&&(vi=vi.slice(e+1)),Nl(pa,no),y}finally{Ct=r,Zd=!1}}return null}var Ms=[],Is=0,ac=null,lc=0,xr=[],Ar=0,Lo=null,yi=1,_i="";function Mo(e,r){Ms[Is++]=lc,Ms[Is++]=ac,ac=e,lc=r}function yh(e,r,a){xr[Ar++]=yi,xr[Ar++]=_i,xr[Ar++]=Lo,Lo=e;var h=yi;e=_i;var y=32-ft(h)-1;h&=~(1<<y),a+=1;var E=32-ft(r)+y;if(30<E){var I=y-y%5;E=(h&(1<<I)-1).toString(32),h>>=I,y-=I,yi=1<<32-ft(r)+y|a<<y|h,_i=E+e}else yi=1<<E|a<<y|h,_i=e}function Wd(e){e.return!==null&&(Mo(e,1),yh(e,1,0))}function qd(e){for(;e===ac;)ac=Ms[--Is],Ms[Is]=null,lc=Ms[--Is],Ms[Is]=null;for(;e===Lo;)Lo=xr[--Ar],xr[Ar]=null,_i=xr[--Ar],xr[Ar]=null,yi=xr[--Ar],xr[Ar]=null}var sr=null,ar=null,$t=!1,Rr=null;function _h(e,r){var a=wr(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=e,r=e.deletions,r===null?(e.deletions=[a],e.flags|=16):r.push(a)}function wh(e,r){switch(e.tag){case 5:var a=e.type;return r=r.nodeType!==1||a.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,sr=e,ar=Qr(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,sr=e,ar=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Lo!==null?{id:yi,overflow:_i}:null,e.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=wr(18,null,null,0),a.stateNode=r,a.return=e,e.child=a,sr=e,ar=null,!0):!1;default:return!1}}function Gd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $d(e){if($t){var r=ar;if(r){var a=r;if(!wh(e,r)){if(Gd(e))throw Error(i(418));r=Qr(a.nextSibling);var h=sr;r&&wh(e,r)?_h(h,a):(e.flags=e.flags&-4097|2,$t=!1,sr=e)}}else{if(Gd(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,sr=e}}}function bh(e){for(e=e.r
Line truncated
|
||||
Error generating stack: `+E.message+`
|
||||
`+E.stack}return{value:e,source:r,stack:y,digest:null}}function xf(e,r,a){return{value:e,source:null,stack:a??null,digest:r??null}}function Af(e,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var Uv=typeof WeakMap=="function"?WeakMap:Map;function rp(e,r,a){a=bi(-1,a),a.tag=3,a.payload={element:null};var h=r.value;return a.callback=function(){Bc||(Bc=!0,Nf=h),Af(e,r)},a}function ip(e,r,a){a=bi(-1,a),a.tag=3;var h=e.type.getDerivedStateFromError;if(typeof h=="function"){var y=r.value;a.payload=function(){return h(y)},a.callback=function(){Af(e,r)}}var E=e.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){Af(e,r),typeof h!="function"&&(so===null?so=new Set([this]):so.add(this));var I=r.stack;this.componentDidCatch(r.value,{componentStack:I!==null?I:""})}),a}function op(e,r,a){var h=e.pingCache;if(h===null){h=e.pingCache=new Uv;var y=new Set;h.set(r,y)}else y=h.get(r),y===void 0&&(y=new Set,h.set(r,y));y.has(a)||(y.add(a),e=ry.bind(null,e,r,a),r.then(e,e))}function sp(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function ap(e,r,a,h,y){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=bi(-1,1),r.tag=2,io(a,r,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=y,e)}var Zv=F.ReactCurrentOwner,qn=!1;function Mn(e,r,a,h){r.child=e===null?Sh(r,null,a,h):js(r,e.child,a,h)}function lp(e,r,a,h,y){a=a.render;var E=r.ref;return Hs(r,y),h=cf(e,r,a,h,E,y),a=uf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):($t&&a&&Wd(r),r.flags|=1,Mn(e,r,h,y),r.child)}function cp(e,r,a,h,y){if(e===null){var E=a.type;return typeof E=="function"&&!zf(E)&&E.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=E,up(e,r,E,h,y)):(e=Fc(a.type,null,h,r,r.mode,y),e.ref=r.ref,e.return=r,r.child=e)}if(E=e.child,(e.lanes&y)===0){var I=E.memoizedProps;if(a=a.compare,a=a!==null?a:Gr,a(I,h)&&e.ref===r.ref)return Ci(e,r,y)}return r.flags|=1,e=uo(E,h),e.ref=r.ref,e.return=r,r.child=e}function up(e,r,a,h,y){if(e!==null){var E=e.memoizedProps;if(Gr(E,h)&&e.ref===r.ref)if(qn=!1,r.pendingProps=h=E,(e.lanes&y)!==0)(e.flags&131072)!==0&&(qn=!0);else return r.lanes=e.lanes,Ci(e,r,y)}return vf(e,r,a,h,y)}function dp(e,r,a){var h=r.pendingProps,y=h.children,E=e!==null?e.memoizedState:null;if(h.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ht(Ws,lr),lr|=a;else{if((a&1073741824)===0)return e=E!==null?E.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,Ht(Ws,lr),lr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=E!==null?E.baseLanes:a,Ht(Ws,lr),lr|=h}else E!==null?(h=E.baseLanes|a,r.memoizedState=null):h=a,Ht(Ws,lr),lr|=h;return Mn(e,r,y,a),r.child}function fp(e,r){var a=r.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function vf(e,r,a,h,y){var E=Wn(a)?Fo:Bn.current;return E=Ls(r,E),Hs(r,y),a=cf(e,r,a,h,E,y),h=uf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):($t&&h&&Wd(r),r.flags|=1,Mn(e,r,a,y),r.child)}function hp(e,r,a,h,y){if(Wn(a)){var E=!0;oc(r)}else E=!1;if(Hs(r,y),r.stateNode===null)bc(e,r),tp(r,a,h),gf(r,a,h,y),h=!0;else if(e===null){var I=r.stateNode,q=r.memoizedProps;I.props=q;var J=I.context,ue=a.contextType;typeof ue=="object"&&ue!==null?ue=vr(ue):(ue=Wn(a)?Fo:Bn.current,ue=Ls(r,ue));var ke=a.getDerivedStateFromProps,Be=typeof ke=="function"||typeof I.getSnapshotBeforeUpdate=="function";Be||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(q!==h||J!==ue)&&np(r,I,h,ue),ro=!1;var Ce=r.memoizedState;I.state=Ce,pc(r,h,I,y),J=r.memoizedState,q!==h||Ce!==J||Zn.current||ro?(typeof ke=="function"&&(mf(r,a,ke,h),J=r.memoizedState),(q=ro||ep(r,a,q,h,Ce,J,ue))?(Be||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(r.flags|=4194308)):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=J),I.props=h,I.state=J,I.context=ue,h=q):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{I=r.stateNode,Ph(e,r),q=r.memoizedProps,ue=r.type===r.elementType?q:Nr(r.type,q),I.props=ue,Be=r.pendingProps,Ce=I.context,J=a.contextType,typeof J=="object"&&J!==null?J=vr(J):(J=Wn(a)?Fo:Bn.current,J=Ls(r,J));var Ve=a.getDerivedStateFromProps;(ke=typeof Ve=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(q!==Be||Ce!==J)&&np(r,I,h,J),ro=!1,Ce=r.m
Line truncated
|
||||
`)}function $s(n,s,i){const l=Math.floor(Date.now()/1e3);return{id:-Date.now(),type:"PRIV",conversation_key:n,text:s,sender_timestamp:l,received_at:l,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function Ry(n){const s=D.useRef(null),i=D.useRef(null),l=D.useCallback(()=>{i.current!==null&&(clearInterval(i.current),i.current=null),s.current=null},[]),c=D.useCallback(async()=>{const p=s.current;if(!p)return;let d=null,g=null;for(let m=0;m<2;m++)try{d=await dt.requestTelemetry(p.conversationId,"");break}catch(x){g=x instanceof Error?x:new Error("Unknown error"),m===0&&await new Promise(A=>setTimeout(A,2e3))}if(d){const m=$s(p.conversationId,Dy(p,d),!1);n(x=>[...x,m])}else{const m=$s(p.conversationId,`Duty cycle poll failed after retry: ${(g==null?void 0:g.message)??"Unknown error"}`,!1);n(x=>[...x,m])}},[n]),u=D.useCallback(async(p,d)=>{const g=p.trim().toLowerCase();if(g==="dutycycle_start"){l();let m=null,x=null;for(let k=0;k<2;k++)try{m=await dt.requestTelemetry(d,"");break}catch(R){x=R instanceof Error?R:new Error("Unknown error"),k===0&&await new Promise(C=>setTimeout(C,2e3))}if(!m){const k=$s(d,`Failed to start duty cycle tracking after retry: ${(x==null?void 0:x.message)??"Unknown error"}`,!1);return n(R=>[...R,k]),!0}const A=Math.floor(Date.now()/1e3);s.current={startTime:A,uptime:m.uptime_seconds,txAirtime:m.airtime_seconds,rxAirtime:m.rx_airtime_seconds,sentFlood:m.sent_flood,sentDirect:m.sent_direct,recvFlood:m.recv_flood,recvDirect:m.recv_direct,conversationId:d};const _=$s(d,`Airtime/duty cycle statistics gathering begins at ${A}. Logs will follow every 5 minutes. To stop, run dutycycle_stop or navigate away from this conversation.`,!1);return n(k=>[...k,_]),i.current=window.setInterval(c,Py),!0}if(g==="dutycycle_stop"){if(s.current&&s.current.conversationId===d){await c(),l();const m=$s(d,"Airtime/duty cycle statistics gathering stopped.",!1);n(x=>[...x,m])}else{const m=$s(d,"Duty cycle tracking is not active.",!1);n(x=>[...x,m])}return!0}return!1},[n,l,c]);return D.useEffect(()=>()=>{i.current!==null&&clearInterval(i.current)},[]),{handleAirtimeCommand:u,stopTracking:l}}function eu(n){if(n<60)return`${n}s`;const s=Math.floor(n/86400),i=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return s>0?i>0&&l>0?`${s}d${i}h${l}m`:i>0?`${s}d${i}h`:l>0?`${s}d${l}m`:`${s}d`:i>0?l>0?`${i}h${l}m`:`${i}h`:`${l}m`}function Ny(n){return["Telemetry",`Battery Voltage: ${n.battery_volts.toFixed(3)}V`,`Uptime: ${eu(n.uptime_seconds)}`,`TX Airtime: ${eu(n.airtime_seconds)}`,`RX Airtime: ${eu(n.rx_airtime_seconds)}`,"",`Noise Floor: ${n.noise_floor_dbm} dBm`,`Last RSSI: ${n.last_rssi_dbm} dBm`,`Last SNR: ${n.last_snr_db.toFixed(1)} dB`,"",`Packets: ${n.packets_received.toLocaleString()} rx / ${n.packets_sent.toLocaleString()} tx`,`Flood: ${n.recv_flood.toLocaleString()} rx / ${n.sent_flood.toLocaleString()} tx`,`Direct: ${n.recv_direct.toLocaleString()} rx / ${n.sent_direct.toLocaleString()} tx`,`Duplicates: ${n.flood_dups.toLocaleString()} flood / ${n.direct_dups.toLocaleString()} direct`,"",`TX Queue: ${n.tx_queue_len}`,`Debug Flags: ${n.full_events}`].join(`
|
||||
`)}function Fy(n){if(n.length===0)return`Neighbors
|
||||
No neighbors reported`;const s=[...n].sort((l,c)=>c.snr-l.snr),i=[`Neighbors (${s.length})`];for(const l of s){const c=l.name||l.pubkey_prefix,u=l.snr>=0?`+${l.snr.toFixed(1)}`:l.snr.toFixed(1);i.push(`${c}, ${u} dB [${eu(l.last_heard_seconds)} ago]`)}return i.join(`
|
||||
`)}function Ly(n){if(n.length===0)return`ACL
|
||||
No ACL entries`;const s=[`ACL (${n.length})`];for(const i of n){const l=i.name||i.pubkey_prefix;s.push(`${l}: ${i.permission_name}`)}return s.join(`
|
||||
`)}function qo(n,s,i,l=0){const c=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:n,text:s,sender_timestamp:c,received_at:c,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function My(n,s,i){const[l,c]=D.useState(!1),{handleAirtimeCommand:u,stopTracking:p}=Ry(i);D.useEffect(()=>{c(!1),p()},[n==null?void 0:n.id,p]);const d=D.useMemo(()=>{if(!n||n.type!=="contact")return!1;const x=s.find(A=>A.public_key===n.id);return(x==null?void 0:x.type)===td},[n,s]),g=D.useCallback(async x=>{if(!(!n||n.type!=="contact")&&d)try{const A=await dt.requestTelemetry(n.id,x),_=qo(n.id,Ny(A),!1,0),k=qo(n.id,Fy(A.neighbors),!1,1),R=qo(n.id,Ly(A.acl),!1,2);i(C=>[...C,_,k,R]),c(!0)}catch(A){const _=qo(n.id,`Telemetry request failed: ${A instanceof Error?A.message:"Unknown error"}`,!1,0);i(k=>[...k,_])}},[n,d,i]),m=D.useCallback(async x=>{if(!n||n.type!=="contact"||!d||!l||await u(x,n.id))return;const _=qo(n.id,`> ${x}`,!0,0);i(k=>[...k,_]);try{const k=await dt.sendRepeaterCommand(n.id,x),R=qo(n.id,k.response,!1,1);k.sender_timestamp&&(R.sender_timestamp=k.sender_timestamp),i(C=>[...C,R])}catch(k){const R=qo(n.id,`Command failed: ${k instanceof Error?k.message:"Unknown error"}`,!1,1);i(C=>[...C,R])}},[n,d,l,i,u]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:g,handleRepeaterCommand:m}}const Ax="remoteterm-lastMessageTime",vx="remoteterm-sortOrder";let Wu={};function im(n){Wu={...n}}function om(){return{...Wu}}function Jf(n,s){return Wu[n]=s,{...Wu}}function Or(n,s){return`${n}-${s}`}function Iy(){try{const n=localStorage.getItem(Ax);return n?JSON.parse(n):{}}catch{return{}}}function Oy(){try{return localStorage.getItem(vx)==="alpha"?"alpha":"recent"}catch{return"recent"}}function sm(){try{localStorage.removeItem(Ax),localStorage.removeItem(vx)}catch{}}function am(n,s){if(!s)return!1;const i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${i}\\]`,"i").test(n)}function jy(n,s,i,l=null){const[c,u]=D.useState({}),[p,d]=D.useState({}),[g,m]=D.useState(om),x=D.useRef(l);D.useEffect(()=>{x.current=l},[l]);const A=D.useRef(new Set),_=D.useRef(new Set);D.useEffect(()=>{const B=n.filter(F=>!A.current.has(F.key)),S=s.filter(F=>F.public_key&&!_.current.has(F.public_key));if(B.length===0&&S.length===0)return;B.forEach(F=>A.current.add(F.key)),S.forEach(F=>_.current.add(F.public_key)),(async()=>{const F=[...B.map(M=>({type:"CHAN",conversation_key:M.key})),...S.map(M=>({type:"PRIV",conversation_key:M.public_key}))];if(F.length!==0)try{const z={};for(let V=0;V<F.length;V+=200){const $=F.slice(V,V+200),ee=await dt.getMessagesBulk($,O0);Object.assign(z,ee)}const H={},j={},X={};for(const V of B){const $=z[`CHAN:${V.key}`]||[];if($.length>0){const ee=Or("channel",V.key),W=V.last_read_at||0,re=$.filter(ie=>!ie.outgoing&&ie.received_at>W);re.length>0&&(H[ee]=re.length,re.some(ie=>am(ie.text,x.current))&&(j[ee]=!0));const pe=Math.max(...$.map(ie=>ie.received_at));X[ee]=pe,Jf(ee,pe)}}for(const V of S){const $=z[`PRIV:${V.public_key}`]||[];if($.length>0){const ee=Or("contact",V.public_key),W=V.last_read_at||0,re=$.filter(ie=>!ie.outgoing&&ie.received_at>W);re.length>0&&(H[ee]=re.length,re.some(ie=>am(ie.text,x.current))&&(j[ee]=!0));const pe=Math.max(...$.map(ie=>ie.received_at));X[ee]=pe,Jf(ee,pe)}}Object.keys(H).length>0&&u(V=>({...V,...H})),Object.keys(j).length>0&&d(V=>({...V,...j})),m(om())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[n,s]),D.useEffect(()=>{if(i&&i.type!=="raw"&&i.type!=="map"){const B=Or(i.type,i.id);u(S=>{if(S[B]){const T={...S};return delete T[B],T}return S}),d(S=>{if(S[B]){const T={...S};return delete T[B],T}return S}),i.type==="channel"?dt.markChannelRead(i.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):i.type==="contact"&&dt.markContactRead(i.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})}},[i]);const k=D.useCallback((B,S)=>{u(T=>({...T,[B]:(T[B]||0)+1})),S&&d(T=>({...T,[B]:!0}))},[]),R=D.useCallback(()=>{u({}),d({}),dt.markAllRead().catch(B=>{console.error("Failed to mark all as read on server:",B)})},[]),C=D.useCallback(B=>{if(B.type==="raw"||B.type==="map")return;const S=Or(B.type,B.id);u(T=>{if(T[S]){const F={...T};return delete F[S],F}return T}),d(T=>{if(T[S]){const F={...T};return delete F[S],F}return T}),B.type==="channel"?dt.markChannelRead(B.id).catch(T=>{console.error("Failed to mark channel as read on server:",T)}):B.type==="contact"&&dt.markContactRead(B.id).catch(T=>{console.error("Failed to mark contact as read on server:",T)})},[]),w=D.useCallback(B=>{let S=null;if(B.type==="CHAN"&&B.conversation_key?S=Or("channel",B.conversation_key):B.type==="PRIV"&&B.conversation_key&&(S=Or("contact",B.conversation_key)),S){const T=B.received_at||Math.floor(Date.now()/1e3),F=Jf(S,T);m(F)}},[]);return{unreadCounts:c,mentions:p,lastMessageTimes:g,incrementUnread:k,markAllRead:R,markConversationRead:C,trackNewMessage:w}}var j0=xx();const yx=aa(j0);function zy(n){if(ty
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 m_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g_=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,i,l)=>l?l.toUpperCase():i.toLowerCase()),um=n=>{const s=g_(n);return s.charAt(0).toUpperCase()+s.slice(1)},_x=(...n)=>n.filter((s,i,l)=>!!s&&s.trim()!==""&&l.indexOf(s)===i).join(" ").trim(),x_=n=>{for(const s in n)if(s.startsWith("aria-")||s==="role"||s==="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 A_={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 v_=D.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:u,iconNode:p,...d},g)=>D.createElement("svg",{ref:g,...A_,width:s,height:s,stroke:n,strokeWidth:l?Number(i)*24/Number(s):i,className:_x("lucide",c),...!u&&!x_(d)&&{"aria-hidden":"true"},...d},[...p.map(([m,x])=>D.createElement(m,x)),...Array.isArray(u)?u:[u]]));/**
|
||||
* @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 z0=(n,s)=>{const i=D.forwardRef(({className:l,...c},u)=>D.createElement(v_,{ref:u,iconNode:s,className:_x(`lucide-${m_(um(n))}`,`lucide-${n}`,l),...c}));return i.displayName=um(n),i};/**
|
||||
* @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 y_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],__=z0("check",y_);/**
|
||||
* @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 w_=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],b_=z0("menu",w_);/**
|
||||
* @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 C_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wx=z0("x",C_);function E_({health:n,config:s,onSettingsClick:i,onMenuClick:l}){const c=(n==null?void 0:n.radio_connected)??!1,[u,p]=D.useState(!1),d=async()=>{p(!0);try{const g=await dt.reconnectRadio();g.connected&&bt.success("Reconnected",{description:g.message})}catch(g){bt.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return b.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&b.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:b.jsx(b_,{className:"h-5 w-5"})}),b.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),b.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[b.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-[#4caf50]":"bg-[#666]"}`}),b.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:c?"Connected":"Disconnected"})]}),s&&b.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[b.jsx("span",{className:"text-[#e0e0e0]",children:s.name||"Unnamed"}),b.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(s.public_key),bt.success("Public key copied!")},title:"Click to copy public key",children:s.public_key.toLowerCase()})]}),!c&&b.jsx("button",{onClick:d,disabled:u,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Reconnecting...":"Reconnect"}),b.jsxs("button",{onClick:i,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[b.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const k_=12;function S_(n){return n.slice(0,k_)}function Ti(n,s){return n||S_(s)}const mo=2,B_={text:"🛜",background:"#444444",textColor:"#ffffff"};function P_(n){let s=0;for(let i=0;i<n.length;i++){const l=n.charCodeAt(i);s=(s<<5)-s+l,s=s&s}return Math.abs(s)}const T_=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function D_(n,s){if(!n)return s.slice(0,2).toUpperCase();const i=n.match(T_);if(i)return i[0];const l=n.match(/[a-zA-Z]/g);if(!l||l.length===0)return s.slice(0,2).toUpperCase();const c=n.indexOf(" ");if(c!==-1){const u=l[0],p=n.slice(c+1).match(/[a-zA-Z]/);if(p)return(u+p[0]).toUpperCase()}return l[0].toUpperCase()}function R_(n){const s=P_(n),i=s%360,l=50+(s>>8)%30,c=35+(s>>16)%20,u=`hsl(${i}, ${l}%, ${c}%)`,p=c<45?"#ffffff":"#000000";return{background:u,text:p}}function N_(n,s,i){if(i===mo)return B_;const l=D_(n,s),c=R_(s);return{text:l,background:c.background,textColor:c.text}}function v0({name:n,publicKey:s,size:i=28,contactType:l}){const c=N_(n,s,l);return b.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:c.background,color:c.textColor,width:i,height:i,fontSize:i*.45},children:c.text})}const bx="remoteterm-favorites";function ts(n,s,i){return n.some(l=>l.type===s&&l.id===i)}function F_(){try{const n=localStorage.getItem(bx);return n?JSON.parse(n):[]}catch{return[]}}function dm(){try{localStorage.removeItem(bx)}catch{}}function Cx(n){var s,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(s=0;s<c;s++)n[s]&&(i=Cx(n[s]))&&(l&&(l+=" "),l+=i)}else for(i in n)n[i]&&(l&&(l+=" "),l+=i);return l}function Ex(){for(var n,s,i=0,l="",c=arguments.length;i<c;i++)(n=arguments[i])&&(s=Cx(n))&&(l&&(l+=" "),l+=s);return l}const L_=(n,s)=>{const i=new Array(n.length+s.length);for(let l=0;l<n.length;l++)i[l]=n[l];for(let l=0;l<s.length;l++)i[n.length+l]=s[l];return i},M_=(n,s)=>({classGroupId:n,validator:s}),kx=(n=new Map,s=null,i)=>({nextPart:n,validators:s,classGroupId:i}),qu="-",fm=[],I_="arbitrary..",O_=n=>{const s=z_(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return j_(p);const d=p.split(qu),g=d[0]===""&&d.length>1?1:0;return Sx(d,g,s)},getConflictingClassGroupIds:(p,d)=>{if(d){const g=l[p],m=i[p];return g?m?L_(m,g):g:m||fm}return i[p]||fm}}},Sx=(n,s,i)=>{if(n.length-s===0)return i.classGroupId;const c=n[s],u=i.nextPart.get(c);if(u){const m=Sx(n,s+1,u);if(m)return m}const p=i.validators;if(p===null)return;const d=s===0?n.join(qu):n.slice(s).join(qu),g=p.length;for(let m=0;m<g;m++){const x=p[m];if(x.validator(d))return x.classGroupId}},j_=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=n.slice(1,-1),i=s.indexOf(":"),l=s.slice(0,i);return l?I_+l:void 0})(),z_=n=>{const{theme:s,classGroLine truncated
|
||||
.`.concat(ww,` {
|
||||
overflow: hidden `).concat(l,`;
|
||||
padding-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
body[`).concat(ea,`] {
|
||||
overflow: hidden `).concat(l,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([s&&"position: relative ".concat(l,";"),i==="margin"&&`
|
||||
padding-left: `.concat(c,`px;
|
||||
padding-top: `).concat(u,`px;
|
||||
padding-right: `).concat(p,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
`),i==="padding"&&"padding-right: ".concat(d,"px ").concat(l,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(nu,` {
|
||||
right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ru,` {
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(nu," .").concat(nu,` {
|
||||
right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ru," .").concat(ru,` {
|
||||
margin-right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
body[`).concat(ea,`] {
|
||||
`).concat(bw,": ").concat(d,`px;
|
||||
}
|
||||
`)},Pm=function(){var n=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(n)?n:0},Vw=function(){D.useEffect(function(){return document.body.setAttribute(ea,(Pm()+1).toString()),function(){var n=Pm()-1;n<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,n.toString())}},[])},Uw=function(n){var s=n.noRelative,i=n.noImportant,l=n.gapMode,c=l===void 0?"margin":l;Vw();var u=D.useMemo(function(){return jw(c)},[c]);return D.createElement(zw,{styles:Hw(u,!s,c,i?"":"!important")})},w0=!1;if(typeof window<"u")try{var Qc=Object.defineProperty({},"passive",{get:function(){return w0=!0,!0}});window.addEventListener("test",Qc,Qc),window.removeEventListener("test",Qc,Qc)}catch{w0=!1}var Qs=w0?{passive:!1}:!1,Zw=function(n){return n.tagName==="TEXTAREA"},Kx=function(n,s){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[s]!=="hidden"&&!(i.overflowY===i.overflowX&&!Zw(n)&&i[s]==="visible")},Ww=function(n){return Kx(n,"overflowY")},qw=function(n){return Kx(n,"overflowX")},Tm=function(n,s){var i=s.ownerDocument,l=s;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var c=Qx(n,l);if(c){var u=Yx(n,l),p=u[1],d=u[2];if(p>d)return!0}l=l.parentNode}while(l&&l!==i.body);return!1},Gw=function(n){var s=n.scrollTop,i=n.scrollHeight,l=n.clientHeight;return[s,i,l]},$w=function(n){var s=n.scrollLeft,i=n.scrollWidth,l=n.clientWidth;return[s,i,l]},Qx=function(n,s){return n==="v"?Ww(s):qw(s)},Yx=function(n,s){return n==="v"?Gw(s):$w(s)},Kw=function(n,s){return n==="h"&&s==="rtl"?-1:1},Qw=function(n,s,i,l,c){var u=Kw(n,window.getComputedStyle(s).direction),p=u*l,d=i.target,g=s.contains(d),m=!1,x=p>0,A=0,_=0;do{if(!d)break;var k=Yx(n,d),R=k[0],C=k[1],w=k[2],B=C-w-u*R;(R||B)&&Qx(n,d)&&(A+=B,_+=R);var S=d.parentNode;d=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!g&&d!==document.body||g&&(s.contains(d)||s===d));return(x&&Math.abs(A)<1||!x&&Math.abs(_)<1)&&(m=!0),m},Yc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Dm=function(n){return[n.deltaX,n.deltaY]},Rm=function(n){return n&&"current"in n?n.current:n},Yw=function(n,s){return n[0]===s[0]&&n[1]===s[1]},Xw=function(n){return`
|
||||
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
||||
`)},Jw=0,Ys=[];function e2(n){var s=D.useRef([]),i=D.useRef([0,0]),l=D.useRef(),c=D.useState(Jw++)[0],u=D.useState($x)[0],p=D.useRef(n);D.useEffect(function(){p.current=n},[n]),D.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var C=_w([n.lockRef.current],(n.shards||[]).map(Rm),!0).filter(Boolean);return C.forEach(function(w){return w.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var d=D.useCallback(function(C,w){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!p.current.allowPinchZoom;var B=Yc(C),S=i.current,T="deltaX"in C?C.deltaX:S[0]-B[0],F="deltaY"in C?C.deltaY:S[1]-B[1],M,z=C.target,H=Math.abs(T)>Math.abs(F)?"h":"v";if("touches"in C&&H==="h"&&z.type==="range")return!1;var j=window.getSelection(),X=j&&j.anchorNode,V=X?X===z||X.contains(z):!1;if(V)return!1;var $=Tm(H,z);if(!$)return!0;if($?M=H:(M=H==="v"?"h":"v",$=Tm(H,z)),!$)return!1;if(!l.current&&"changedTouches"in C&&(T||F)&&(l.current=M),!M)return!0;var ee=l.current||M;return Qw(ee,w,C,ee==="h"?T:F)},[]),g=D.useCallback(function(C){var w=C;if(!(!Ys.length||Ys[Ys.length-1]!==u)){var B="deltaY"in w?Dm(w):Yc(w),S=s.current.filter(function(M){return M.name===w.type&&(M.target===w.target||w.target===M.shadowParent)&&Yw(M.delta,B)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var T=(p.current.shards||[]).map(Rm).filter(Boolean).filter(function(M){return M.contains(w.target)}),F=T.length>0?d(w,T[0]):!p.current.noIsolation;F&&w.cancelable&&w.preventDefault()}}},[]),m=D.useCallback(function(C,w,B,S){var T={name:C,delta:w,target:B,should:S,shadowParent:t2(B)};s.current.push(T),setTimeout(function(){s.current=s.current.filter(function(F){return F!==T})},1)},[]),x=D.useCallback(function(C){i.current=Yc(C),l.current=void 0},[]),A=D.useCallback(function(C){m(C.type,Dm(C),C.target,d(C,n.lockRef.current))},[]),_=D.useCallback(function(C){m(C.type,Yc(C),C.target,d(C,n.lockRef.current))},[]);D.useEffect(function(){return Ys.push(u),n.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:_}),document.addEventListener("wheel",g,Qs),document.addEventListener("touchmove",g,Qs),document.addEventListener("touchstart",x,Qs),function(){Ys=Ys.filter(function(C){return C!==u}),document.removeEventListener("wheel",g,Qs),document.removeEventListener("touchmove",g,Qs),document.removeEventListener("touchstart",x,Qs)}},[]);var k=n.removeScrollBar,R=n.inert;return D.createElement(D.Fragment,null,R?D.createElement(u,{styles:Xw(c)}):null,k?D.createElement(Uw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function t2(n){for(var s=null;n!==null;)n instanceof ShadowRoot&&(s=n.host,n=n.host),n=n.parentNode;return s}const n2=Tw(Gx,e2);var Xx=D.forwardRef(function(n,s){return D.createElement(rd,ii({},n,{ref:s,sideCar:n2}))});Xx.classNames=rd.classNames;var r2=function(n){if(typeof document>"u")return null;var s=Array.isArray(n)?n[0]:n;return s.ownerDocument.body},Xs=new WeakMap,Xc=new WeakMap,Jc={},l0=0,Jx=function(n){return n&&(n.host||Jx(n.parentNode))},i2=function(n,s){return s.map(function(i){if(n.contains(i))return i;var l=Jx(i);return l&&n.contains(l)?l:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},o2=function(n,s,i,l){var c=i2(s,Array.isArray(n)?n:[n]);Jc[i]||(Jc[i]=new WeakMap);var u=Jc[i],p=[],d=new Set,g=new Set(c),m=function(A){!A||d.has(A)||(d.add(A),m(A.parentNode))};c.forEach(m);var x=function(A){!A||g.has(A)||Array.prototype.forEach.call(A.children,function(_){if(d.has(_))x(_);else try{var k=_.getAttribute(l),R=k!==null&&k!=="false",C=(Xs.get(_)||0)+1,w=(u.get(_)||0)+1;Xs.set(_,C),u.set(_,w),p.push(_),C===1&&R&&Xc.set(_,!0),w===1&&_.setAttribute(i,"true"),R||_.setAttribute(l,"true")}catch(B){console.error("aria-hidden: cannot operate on ",_,B)}})};return x(s),d.clear(),l0++,function(){p.forEach(function(A){var _=Xs.get(A)-1,k=u.get(A)-1;Xs.set(A,_),u.set(A,k),_||(Xc.has(A)||A.removeAttribute(l),Xc.delete(A)),k||A.removeAttribute(i)}),l0--,l0||(Xs=new WeakMap,Xs=new WeakMap,Xc=new WeakMap,Jc={})}},s2=function(n,s,i){i===void 0&&(i="data-aria-hidden");var l=Array.from(Array.isArray(n)?n:[n]),c=r2(n);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),o2(l,c,i,"aria-hidden")):function(){return null}};function a2(n){const s=l2(n),i=D.forwardRef((l,c)=>{const{children:u,...p}=l,d=D.Children.toArray(u),g=d.find(u2);if(g){const m=g.props.children,x=d.map(A=>A===g?D.Children.count(m)>1?D.Children.only(null):D.isValidElement(m)?m.props.children:null:A);return b.jsx(s,{...p,ref:c,children:D.isValidElement(m)?D.cloneElement(m,void 0,x):null})}return b.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function l2(n){const s=D.forwardRef((i,l)=>{const{childre
Line truncated
|
||||
|
||||
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return D.useEffect(()=>{n&&(document.getElementById(n)||console.error(i))},[i,n]),null},_2="DialogDescriptionWarning",w2=({contentRef:n,descriptionId:s})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pA(_2).contentName}}.`;return D.useEffect(()=>{var u;const c=(u=n.current)==null?void 0:u.getAttribute("aria-describedby");s&&c&&(document.getElementById(s)||console.warn(l))},[l,n,s]),null},mA=tA,gA=iA,od=oA,sd=sA,ad=lA,ld=uA,xA=fA;const G0=mA,b2=gA,AA=D.forwardRef(({className:n,...s},i)=>b.jsx(od,{ref:i,className:pt("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",n),...s}));AA.displayName=od.displayName;const cd=D.forwardRef(({className:n,children:s,...i},l)=>b.jsxs(b2,{children:[b.jsx(AA,{}),b.jsxs(sd,{ref:l,className:pt("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",n),...i,children:[s,b.jsxs(xA,{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:[b.jsx(wx,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cd.displayName=sd.displayName;const ud=({className:n,...s})=>b.jsx("div",{className:pt("flex flex-col space-y-1.5 text-center sm:text-left",n),...s});ud.displayName="DialogHeader";const $0=({className:n,...s})=>b.jsx("div",{className:pt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...s});$0.displayName="DialogFooter";const dd=D.forwardRef(({className:n,...s},i)=>b.jsx(ad,{ref:i,className:pt("text-lg font-semibold leading-none tracking-tight",n),...s}));dd.displayName=ad.displayName;const fd=D.forwardRef(({className:n,...s},i)=>b.jsx(ld,{ref:i,className:pt("text-sm text-muted-foreground",n),...s}));fd.displayName=ld.displayName;function C2(){const n=window.location.hash.slice(1);if(!n)return null;if(n==="raw")return{type:"raw",name:"raw"};if(n==="map")return{type:"map",name:"map"};if(n==="visualizer")return{type:"visualizer",name:"visualizer"};if(n.startsWith("map/focus/")){const c=n.slice(10);return c?{type:"map",name:"map",mapFocusKey:decodeURIComponent(c)}:{type:"map",name:"map"}}const s=n.indexOf("/");if(s===-1)return null;const i=n.slice(0,s),l=decodeURIComponent(n.slice(s+1));return(i==="channel"||i==="contact")&&l?{type:i,name:l}:null}function vA(n){return`#map/focus/${encodeURIComponent(n)}`}function E2(n){if(!n)return"";if(n.type==="raw")return"#raw";if(n.type==="map")return"#map";if(n.type==="visualizer")return"#visualizer";const s=n.type==="channel"&&n.name.startsWith("#")?n.name.slice(1):n.name;return`#${n.type}/${encodeURIComponent(s)}`}function k2(n){const s=E2(n);s!==window.location.hash&&window.history.replaceState(null,"",s||window.location.pathname)}function S2({open:n,onClose:s,paths:i,senderInfo:l,contacts:c,config:u}){const p=i.map(g=>({...g,resolved:O1(g.path,l,c,u)})),d=i.length===1;return b.jsx(G0,{open:n,onOpenChange:g=>!g&&s(),children:b.jsxs(cd,{className:"max-w-md max-h-[80vh] flex flex-col",children:[b.jsxs(ud,{children:[b.jsxs(dd,{children:["Message Path",!d&&`s (${i.length})`]}),b.jsx(fd,{children:d?b.jsxs(b.Fragment,{children:["This shows ",b.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):b.jsxs(b.Fragment,{children:["This message was received via ",b.jsxs("strong",{children:[i.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[p.map((g,m)=>b.jsxs("div",{children:[!d&&b.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",m+1," — received ",ra(g.received_at)]}),b.jsx(B2,{resolved:g.resolved,senderInfo:l,hideStraightLine:!d})]},m)),!d&&p.length>0&&(()=>{const g=p[0].resolved;return Rt(g.sender.lat,g.sender.lon)&&Rt(g.receiver.lat,g.receiver.lon)?b.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[b.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),b.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((Y,fe,me)=>b.jsxs("span",{children:[D2(Y,d),fe<me.length-1&&b.jsx("br",{})]},fe)),!xe&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:ra(j.sender_timestamp||j.received_at)}),!j.outgoing&&j.paths&&j.paths.length>0&&b.jsx(Fm,{paths:j.paths,variant:"inline",onClick:()=>C({paths:j.paths,senderInfo:M(j,V,ee)})})]}),j.outgoing&&(j.acked>0?` ✓${j.acked>1?j.acked:""}`:" ?")]})]})]},j.id)})]}),_&&b.jsx("button",{onClick:S,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:b.jsx("polyline",{points:"6 9 12 15 18 9"})})}),R&&b.jsx(S2,{open:!0,onClose:()=>C(null),paths:R.paths,senderInfo:R.senderInfo,contacts:s,config:g??null})]})}const Lm=156,N2=140,F2=156,L2=120,M2=8,I2=D.forwardRef(function({onSend:s,disabled:i,placeholder:l,isRepeaterMode:c,conversationType:u,senderName:p},d){const[g,m]=D.useState(""),[x,A]=D.useState(!1),_=D.useRef(null);D.useImperativeHandle(d,()=>({appendText:M=>{var z;m(H=>H+M),(z=_.current)==null||z.focus()}}));const k=D.useMemo(()=>{if(u==="contact")return{warningAt:N2,dangerAt:Lm,hardLimit:Lm};if(u==="channel"){const M=(p==null?void 0:p.length)??10,z=Math.max(1,F2-M-2);return{warningAt:L2,dangerAt:Math.max(1,z-M2),hardLimit:z}}return null},[u,p]),{limitState:R,warningMessage:C}=D.useMemo(()=>{if(!k)return{limitState:"normal",warningMessage:null};const M=g.length;return M>=k.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:M>=k.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:M>=k.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[g.length,k]),w=k?k.hardLimit-g.length:0,B=D.useCallback(async M=>{M.preventDefault();const z=g.trim();if(c){if(x||i)return;A(!0);try{await s(z),m("")}catch(H){console.error("Failed to request telemetry:",H),bt.error("Failed to request telemetry",{description:H instanceof Error?H.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var H;return(H=_.current)==null?void 0:H.focus()},0)}else{if(!z||x||i)return;A(!0);try{await s(z),m("")}catch(H){console.error("Failed to send message:",H),bt.error("Failed to send message",{description:H instanceof Error?H.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var H;return(H=_.current)==null?void 0:H.focus()},0)}},[g,x,i,s,c]),S=D.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),B(M))},[B]),T=c?!0:g.trim().length>0,F=!c&&k!==null;return b.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:B,children:[b.jsxs("div",{className:"flex gap-2",children:[b.jsx(rn,{ref:_,type:c?"password":"text",autoComplete:c?"off":void 0,value:g,onChange:M=>m(M.target.value),onKeyDown:S,placeholder:l||(c?"Enter password for admin login...":"Type a message..."),disabled:i||x,className:"flex-1 min-w-0"}),b.jsx(wn,{type:"submit",disabled:i||x||!T,className:"flex-shrink-0",children:x?c?"Logging in...":"Sending...":c?g.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),F&&b.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[b.jsxs("span",{className:pt("tabular-nums",R==="error"||R==="danger"?"text-red-500 font-medium":R==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",k.hardLimit,w<0&&` (${w})`]}),C&&b.jsxs("span",{className:pt(R==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function Mm(n){const s=O2(n),i=D.forwardRef((l,c)=>{const{children:u,...p}=l,d=D.Children.toArray(u),g=d.find(z2);if(g){const m=g.props.children,x=d.map(A=>A===g?D.Children.count(m)>1?D.Children.only(null):D.isValidElement(m)?m.props.children:null:A);return b.jsx(s,{...p,ref:c,children:D.isValidElement(m)?D.cloneElement(m,void 0,x):null})}return b.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function O2(n){const s=D.forwardRef((i,l)=>{const{children:c,...u}=i;if(D.isValidElement(c)){const p=V2(c),d=H2(u,c.props);return c.type!==D.Fragment&&(d.ref=l?El(l,p):p),D.cloneElement(c,d)}return D.Children.count(c)>1?D.Children.only(null):null});return s.displayName=`${n}.SlotClone`,s}var j2=Symbol("radix.slottable");function z2(n){return D.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===j2}function H2(n,s){const i={...s};for(const l in s){const c=n[l],u=s[l];/^on[A-Z]/.test(l)?c&&u?i[l]=(...d)=>{const g=u(...d);return c(...d),g}:c&&(i[l]=c):l==="style"?i[l]={...c,...u}:l==="className"&&(i[l]=[c,u].filter(Boolean).join(" "))}return{...n,...i}}functio
Line truncated
|
||||
(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.
|
||||
*/return(function(l){var c=i,u=c.lib,p=u.WordArray,d=u.Hasher,g=c.algo,m=p.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),x=p.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),A=p.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),_=p.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),k=p.create([0,1518500249,1859775393,2400959708,2840853838]),R=p.create([1352829926,1548603684,1836072691,2053994217,0]),C=g.RIPEMD160=d.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(z,H){for(var j=0;j<16;j++){var X=H+j,V=z[X];z[X]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360}var $=this._hash.words,ee=k.words,W=R.words,re=m.words,pe=x.words,ie=A.words,Ae=_.words,G,xe,Z,N,U,K,Y,fe,me,Se;K=G=$[0],Y=xe=$[1],fe=Z=$[2],me=N=$[3],Se=U=$[4];for(var we,j=0;j<80;j+=1)we=G+z[H+re[j]]|0,j<16?we+=w(xe,Z,N)+ee[0]:j<32?we+=B(xe,Z,N)+ee[1]:j<48?we+=S(xe,Z,N)+ee[2]:j<64?we+=T(xe,Z,N)+ee[3]:we+=F(xe,Z,N)+ee[4],we=we|0,we=M(we,ie[j]),we=we+U|0,G=U,U=N,N=M(Z,10),Z=xe,xe=we,we=K+z[H+pe[j]]|0,j<16?we+=F(Y,fe,me)+W[0]:j<32?we+=T(Y,fe,me)+W[1]:j<48?we+=S(Y,fe,me)+W[2]:j<64?we+=B(Y,fe,me)+W[3]:we+=w(Y,fe,me)+W[4],we=we|0,we=M(we,Ae[j]),we=we+Se|0,K=Se,Se=me,me=M(fe,10),fe=Y,Y=we;we=$[1]+Z+me|0,$[1]=$[2]+N+Se|0,$[2]=$[3]+U+K|0,$[3]=$[4]+G+Y|0,$[4]=$[0]+xe+fe|0,$[0]=we},_doFinalize:function(){var z=this._data,H=z.words,j=this._nDataBytes*8,X=z.sigBytes*8;H[X>>>5]|=128<<24-X%32,H[(X+64>>>9<<4)+14]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360,z.sigBytes=(H.length+1)*4,this._process();for(var V=this._hash,$=V.words,ee=0;ee<5;ee++){var W=$[ee];$[ee]=(W<<8|W>>>24)&16711935|(W<<24|W>>>8)&4278255360}return V},clone:function(){var z=d.clone.call(this);return z._hash=this._hash.clone(),z}});function w(z,H,j){return z^H^j}function B(z,H,j){return z&H|~z&j}function S(z,H,j){return(z|~H)^j}function T(z,H,j){return z&j|H&~j}function F(z,H,j){return z^(H|~j)}function M(z,H){return z<<H|z>>>32-H}c.RIPEMD160=d._createHelper(C),c.HmacRIPEMD160=d._createHmacHelper(C)})(),i.RIPEMD160})})(Au)),Au.exports}var vu={exports:{}},qb=vu.exports,tg;function xd(){return tg||(tg=1,(function(n,s){(function(i,l){n.exports=l(wt())})(qb,function(i){(function(){var l=i,c=l.lib,u=c.Base,p=l.enc,d=p.Utf8,g=l.algo;g.HMAC=u.extend({init:function(m,x){m=this._hasher=new m.init,typeof x=="string"&&(x=d.parse(x));var A=m.blockSize,_=A*4;x.sigBytes>_&&(x=m.finalize(x)),x.clamp();for(var k=this._oKey=x.clone(),R=this._iKey=x.clone(),C=k.words,w=R.words,B=0;B<A;B++)C[B]^=1549556828,w[B]^=909522486;k.sigBytes=R.sigBytes=_,this.reset()},reset:function(){var m=this._hasher;m.reset(),m.update(this._iKey)},update:function(m){return this._hasher.update(m),this},finalize:function(m){var x=this._hasher,A=x.finalize(m);x.reset();var _=x.finalize(this._oKey.clone().concat(A));return _}})})()})})(vu)),vu.exports}var yu={exports:{}},Gb=yu.exports,ng;function $b(){return ng||(ng=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),Bl(),xd())})(Gb,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.SHA256,m=d.HMAC,x=d.PBKDF2=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:25e4}),init:function(A){this.cfg=this.cfg.extend(A)},compute:function(A,_){for(var k=this.cfg,R=m.create(k.hasher,A),C=p.create(),w=p.create([1]),B=C.words,S=w.words,T=k.keySize,F=k.iterations;B.length<T;){var M=R.update(_).finalize(w);R.reset();for(var z=M.words,H=z.length,j=M,X=1;X<F;X++){j=R.finalize(j),R.reset();for(var V=j.words,$=0;$<H;$++)z[$]^=V[$]}C.concat(M),S[0]++}return C.sigBytes=T*4,C}});l.PBKDF2=function(A,_,k){return x.create(k).compute(A,_)}})(),i.PBKDF2})})(yu)),yu.exports}var _u={exports:{}},Kb=_u.exports,rg;function vo(){return rg||(rg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),YA(),xd())})(Kb,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.MD5,m=d.EvpKDF=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,A){for(var _,k=this.cfg,R=k.hasher.create(),C=p.create(),w=C.words,B=k.keySize,S=k.iterations;w.length<B;){_&&R.update(_),_=R.update(x).finalize(A),R.reset();for(var T=1;T<S;T++)_=R.finalize(_),R.reset();C.concat(_)}return C.sigBytes=B*4,C}});l.EvpKDF=function(x,A,_){return m.create(_).compute(x,A)}})(),i.EvpKDF})})(_u)),_u.exports}var wu={exports:{}},Qb=wu.exports,Line truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return i.mode.CTRGladman=(function(){var l=i.lib.BlockCipherMode.extend();function c(d){if((d>>24&255)===255){var g=d>>16&255,m=d>>8&255,x=d&255;g===255?(g=0,m===255?(m=0,x===255?x=0:++x):++m):++g,d=0,d+=g<<16,d+=m<<8,d+=x}else d+=1<<24;return d}function u(d){return(d[0]=c(d[0]))===0&&(d[1]=c(d[1])),d}var p=l.Encryptor=l.extend({processBlock:function(d,g){var m=this._cipher,x=m.blockSize,A=this._iv,_=this._counter;A&&(_=this._counter=A.slice(0),this._iv=void 0),u(_);var k=_.slice(0);m.encryptBlock(k,0);for(var R=0;R<x;R++)d[g+R]^=k[R]}});return l.Decryptor=p,l})(),i.mode.CTRGladman})})(Eu)),Eu.exports}var ku={exports:{}},rC=ku.exports,lg;function iC(){return lg||(lg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(rC,function(i){return i.mode.OFB=(function(){var l=i.lib.BlockCipherMode.extend(),c=l.Encryptor=l.extend({processBlock:function(u,p){var d=this._cipher,g=d.blockSize,m=this._iv,x=this._keystream;m&&(x=this._keystream=m.slice(0),this._iv=void 0),d.encryptBlock(x,0);for(var A=0;A<g;A++)u[p+A]^=x[A]}});return l.Decryptor=c,l})(),i.mode.OFB})})(ku)),ku.exports}var Su={exports:{}},oC=Su.exports,cg;function sC(){return cg||(cg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(oC,function(i){return i.mode.ECB=(function(){var l=i.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(c,u){this._cipher.encryptBlock(c,u)}}),l.Decryptor=l.extend({processBlock:function(c,u){this._cipher.decryptBlock(c,u)}}),l})(),i.mode.ECB})})(Su)),Su.exports}var Bu={exports:{}},aC=Bu.exports,ug;function lC(){return ug||(ug=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(aC,function(i){return i.pad.AnsiX923={pad:function(l,c){var u=l.sigBytes,p=c*4,d=p-u%p,g=u+d-1;l.clamp(),l.words[g>>>2]|=d<<24-g%4*8,l.sigBytes+=d},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Ansix923})})(Bu)),Bu.exports}var Pu={exports:{}},cC=Pu.exports,dg;function uC(){return dg||(dg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(cC,function(i){return i.pad.Iso10126={pad:function(l,c){var u=c*4,p=u-l.sigBytes%u;l.concat(i.lib.WordArray.random(p-1)).concat(i.lib.WordArray.create([p<<24],1))},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Iso10126})})(Pu)),Pu.exports}var Tu={exports:{}},dC=Tu.exports,fg;function fC(){return fg||(fg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(dC,function(i){return i.pad.Iso97971={pad:function(l,c){l.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(l,c)},unpad:function(l){i.pad.ZeroPadding.unpad(l),l.sigBytes--}},i.pad.Iso97971})})(Tu)),Tu.exports}var Du={exports:{}},hC=Du.exports,hg;function pC(){return hg||(hg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(hC,function(i){return i.pad.ZeroPadding={pad:function(l,c){var u=c*4;l.clamp(),l.sigBytes+=u-(l.sigBytes%u||u)},unpad:function(l){for(var c=l.words,u=l.sigBytes-1,u=l.sigBytes-1;u>=0;u--)if(c[u>>>2]>>>24-u%4*8&255){l.sigBytes=u+1;break}}},i.pad.ZeroPadding})})(Du)),Du.exports}var Ru={exports:{}},mC=Ru.exports,pg;function gC(){return pg||(pg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(mC,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding})})(Ru)),Ru.exports}var Nu={exports:{}},xC=Nu.exports,mg;function AC(){return mg||(mg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),xn())})(xC,function(i){return(function(l){var c=i,u=c.lib,p=u.CipherParams,d=c.enc,g=d.Hex,m=c.format;m.Hex={stringify:function(x){return x.ciphertext.toString(g)},parse:function(x){var A=g.parse(x);return p.create({ciphertext:A})}}})(),i.format.Hex})})(Nu)),Nu.exports}var Fu={exports:{}},vC=Fu.exports,gg;function yC(){return gg||(gg=1,(function(n,s){(function(i,l,c){n.exports=l(wt(),ss(),as(),vo(),xn())})(vC,function(i){return(function(){var l=i,c=l.lib,u=c.BlockCipher,p=l.algo,d=[],g=[],m=[],x=[],A=[],_=[],k=[],R=[],C=[],w=[];(function(){for(var T=[],F=0;F<256;F++)F<128?T[F]=F<<1:T[F]=F<<1^283;for(var M=0,z=0,F=0;F<256;F++){var H=z^z<<1^z<<2^z<<3^z<<4;H=H>>>8^H&255^99,d[M]=H,g[H]=M;var j=T[M],X=T[j],V=T[X],$=T[H]*257^H*16843008;m[M]=$<<24|$>>>8,x[M]=$<<16|$>>>16,A[M]=$<<8|$>>>24,_[M]=$;var $=V*16843009^X*65537^j*257^M*16843008;k[H]=$<<24|$>>>8,R[H]=$<<16|$>>>16,C[H]=$<<8|$>>>24,w[H]=$,M?(M=j^T[T[T[V^j]]],z^=T[T[z]]):M=z=1}})();var B=[0,1,2,4,8,16,32,64,128,27,54],S=p.AES=u.extend({_doReset:function(){var T;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,M=F.words,z=F.sigBytes/4,H=this._nRounds=z+6,j=(H+1)*4,X=this._keySchedule=[],V=0;V<j;V++)V<z?X[V]=M[V]:(T=X[V-1],V%z?z>6&&V%z==4&&(T=d[T>>>24]<<24|d[T>>>16&255]<<16|d[T>>>8&255]<<8|d[T&255]):(T=T<<8|T>>>24,T=d[T>>>24]<<24|d[T>>>16&255]<<16|d[T>>>8&255]<<8|d[T&255],T^=B[V/z|0]<<24),X[V]=X[V-z]^T);for(var $=this._invKeySchedule=[],ee=0;ee<j;ee++){var V=j-ee;if(ee%4)var T=X[V];else var T=X[V-4];ee<4||V<=4?$[ee]=T:$[ee]=k[d[T>>>24]]^R[d[T>>>16&255]]^C[d[T>>>8&255]]^w[d[T&255]]}}},encryLine 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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return ll.RequestPayloadDecoder=i,ll}var cl={},jg;function nE(){if(jg)return cl;jg=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.ResponsePayloadDecoder=void 0;const n=ur(),s=bn();class i{static decode(c,u){try{if(c.length<4){const R={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return cl.ResponsePayloadDecoder=i,cl}var ul={},zg;function rE(){if(zg)return ul;zg=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.AnonRequestPayloadDecoder=void 0;const n=ur(),s=bn();class i{static decode(c,u){try{if(c.length<35){const R={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.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:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[0]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${m}`,startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.bytesToHex)(c.subarray(1,33));u!=null&&u.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:d+g,endByte:d+g+31,value:x}),g+=32;const A=(0,s.bytesToHex)(c.subarray(33,35));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(35));u!=null&&u.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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-35};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return ul.AnonRequestPayloadDecoder=i,ul}var dl={},Hg;function iE(){if(Hg)return dl;Hg=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.AckPayloadDecoder=void 0;const n=ur(),s=bn();class i{static decode(c,u){try{if(c.length<4){const x={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return u!=null&&u.includeSegments&&(x.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),x}const p=[],d=(u==null?void 0:u.segmentOffset)||0,g=(0,s.bytesToHex)(c.subarray(0,4));u!=null&&u.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${g}`,startByte:d,endByte:d+3,value:g}),u!=null&&u.includeSegments&&c.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:d+4,endByte:d+c.length-1,value:(0,s.bytesToHex)(c.subarray(4))});const m={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!0,checksum:g};return u!=null&&u.includeSegments&&(m.segments=p),m}catch(p){return{type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}}return dl.AckPayloadDecoder=i,dl}var fl={},Vg;function oE(){if(Vg)return fl;Vg=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.PathPayloadDecoder=void 0;const n=ur(),s=bn();class i{static decode(c){try{if(c.length<2)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const u=c[0];if(c.length<1+u+1)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+u+1} bytes for path length + path + extra type)`],pathLength:u,pathHashes:[],extraType:0,extraData:""};const p=[];for(let m=0;m<u;m++)p.push((0,s.byteToHex)(c[1+m]));const d=c[1+u];let g="";return c.length>1+u+1&&(g=(0,s.bytesToHex)(c.subarray(1+u+1))),{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!0,pathLength:u,pathHashes:p,extraType:d,extraData:g}}catch(u){return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return fl.PathPayloadDecoder=i,fl}var hl={},Ug;function sE(){if(Ug)return hl;Ug=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.TextMessagePayloadDecoder=void 0;const n=ur(),s=bn();class i{static decode(c,u){try{if(c.length<4){const R={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,i
Line truncated
|
||||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/var wE=gl.exports,Qg;function bE(){return Qg||(Qg=1,(function(n,s){(function(i,l){l(s)})(wE,(function(i){var l="1.9.4";function c(t){var o,f,v,P;for(f=1,v=arguments.length;f<v;f++){P=arguments[f];for(o in P)t[o]=P[o]}return t}var u=Object.create||(function(){function t(){}return function(o){return t.prototype=o,new t}})();function p(t,o){var f=Array.prototype.slice;if(t.bind)return t.bind.apply(t,f.call(arguments,1));var v=f.call(arguments,2);return function(){return t.apply(o,v.length?v.concat(f.call(arguments)):arguments)}}var d=0;function g(t){return"_leaflet_id"in t||(t._leaflet_id=++d),t._leaflet_id}function m(t,o,f){var v,P,O,Q;return Q=function(){v=!1,P&&(O.apply(f,P),P=!1)},O=function(){v?P=arguments:(t.apply(f,arguments),setTimeout(Q,o),v=!0)},O}function x(t,o,f){var v=o[1],P=o[0],O=v-P;return t===v&&f?t:((t-P)%O+O)%O+P}function A(){return!1}function _(t,o){if(o===!1)return t;var f=Math.pow(10,o===void 0?6:o);return Math.round(t*f)/f}function k(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function R(t){return k(t).split(/\s+/)}function C(t,o){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?u(t.options):{});for(var f in o)t.options[f]=o[f];return t.options}function w(t,o,f){var v=[];for(var P in t)v.push(encodeURIComponent(f?P.toUpperCase():P)+"="+encodeURIComponent(t[P]));return(!o||o.indexOf("?")===-1?"?":"&")+v.join("&")}var B=/\{ *([\w_ -]+) *\}/g;function S(t,o){return t.replace(B,function(f,v){var P=o[v];if(P===void 0)throw new Error("No value provided for variable "+f);return typeof P=="function"&&(P=P(o)),P})}var T=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function F(t,o){for(var f=0;f<t.length;f++)if(t[f]===o)return f;return-1}var M="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function z(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var H=0;function j(t){var o=+new Date,f=Math.max(0,16-(o-H));return H=o+f,window.setTimeout(t,f)}var X=window.requestAnimationFrame||z("RequestAnimationFrame")||j,V=window.cancelAnimationFrame||z("CancelAnimationFrame")||z("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,o,f){if(f&&X===j)t.call(o);else return X.call(window,p(t,o))}function ee(t){t&&V.call(window,t)}var W={__proto__:null,extend:c,create:u,bind:p,get lastId(){return d},stamp:g,throttle:m,wrapNum:x,falseFn:A,formatNum:_,trim:k,splitWords:R,setOptions:C,getParamString:w,template:S,isArray:T,indexOf:F,emptyImageUrl:M,requestFn:X,cancelFn:V,requestAnimFrame:$,cancelAnimFrame:ee};function re(){}re.extend=function(t){var o=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=o.__super__=this.prototype,v=u(f);v.constructor=o,o.prototype=v;for(var P in this)Object.prototype.hasOwnProperty.call(this,P)&&P!=="prototype"&&P!=="__super__"&&(o[P]=this[P]);return t.statics&&c(o,t.statics),t.includes&&(pe(t.includes),c.apply(null,[v].concat(t.includes))),c(v,t),delete v.statics,delete v.includes,v.options&&(v.options=f.options?u(f.options):{},c(v.options,t.options)),v._initHooks=[],v.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var O=0,Q=v._initHooks.length;O<Q;O++)v._initHooks[O].call(this)}},o},re.include=function(t){var o=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=o,this.mergeOptions(t.options)),this},re.mergeOptions=function(t){return c(this.prototype.options,t),this},re.addInitHook=function(t){var o=Array.prototype.slice.call(arguments,1),f=typeof t=="function"?t:function(){this[t].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function pe(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=T(t)?t:[t];for(var o=0;o<t.length;o++)t[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var ie={on:function(t,o,f){if(typeof t=="object")for(var v in t)this._on(v,t[v],o);else{t=R(t);for(var P=0,O=t.length;P<O;P++)this._on(t[P],o,f)}return this},off:function(t,o,f){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var v in t)this._off(v,t[v],o);else{t=R(t);for(var P=arguments.length===1,O=0,Q=t.length;O<Q;O++)P?this._off(t[O]):this._off(t[O],o,f)}return this},_on:function(t,o,f,v){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(t,o,f)===!1){f===this&&(f=void 0);var P={fn:o,ctx:f};v&&(P.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(P)}},_off:function(t,o,f){var v,P,O;if(this._events&&(v=this._events[t],!!v)){if(arguments.length===1){if(this._firingCount)for(P=0,O=v.length;P<O;P++)v[P].fn=A;delete this._events[t];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var Q=this.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 32 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 32u;
|
||||
|
||||
@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 s=await navigator.gpu.requestAdapter();if(!s)return console.warn("No GPU adapter found"),!1;this.device=await s.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 i=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:i,entryPoint:"main"}}),!0}catch(s){return console.error("WebGPU initialization failed:",s),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(s,i){return es(i,s)}countNamesForLength(s){return vl(s)}async runBatch(s,i,l,c,u,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 d=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const g=this.matchCountReadBuffers[d],m=this.matchIndicesReadBuffers[d],x=u&&p?1:0;let A,_=0,k=0;if(x){const M=new Uint8Array(u.length/2);for(let V=0;V<M.length;V++)M[V]=parseInt(u.substr(V*2,2),16);_=M.length*8;const z=Math.ceil(M.length/4)*4,H=new Uint8Array(z);H.set(M),A=new Uint32Array(z/4);for(let V=0;V<A.length;V++)A[V]=H[V*4]<<24|H[V*4+1]<<16|H[V*4+2]<<8|H[V*4+3];const j=parseInt(p.substr(0,2),16),X=parseInt(p.substr(2,2),16);k=j<<24|X<<16}else A=new Uint32Array([0]);const R=Math.max(A.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<R)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:R,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=R,this.bindGroupDirty=!0);const C=new Uint32Array([s,l,i,c,k,A.length,_,x]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,A),this.device.queue.writeBuffer(this.matchCountBuffer,0,bd.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 w=this.device.createCommandEncoder(),B=w.beginComputePass();B.setPipeline(this.pipeline),B.setBindGroup(0,this.bindGroup),B.dispatchWorkgroups(Math.ceil(c/(256*32))),B.end(),w.copyBufferToBuffer(this.matchCountBuffer,0,g,0,4),w.copyBufferToBuffer(this.matchIndicesBuffer,0,m,0,1024*4),this.device.queue.submit([w.finish()]),await g.mapAsync(GPUMapMode.READ);const T=new Uint32Array(g.getMappedRange())[0];g.unmap();const F=[];if(T>0){await m.mapAsync(GPUMapMode.READ);const M=new Uint32Array(m.getMappedRange());for(let z=0;z<Math.min(T,1024);z++)F.push(M[z]);m.unmap()}return F}destroy(){var s,i,l,c,u,p,d,g;(s=this.paramsBuffer)==null||s.destroy(),(i=this.matchCountBuffer)==null||i.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(u=this.matchCountReadBuffers[0])==null||u.destroy(),(p=this.matchCountReadBuffers[1])==null||p.destroy(),(d=this.matchIndicesReadBuffers[0])==null||d.destroy(),(g=this.matchIndicesReadBuffers[1])==null||g.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}}bd.ZERO_DATA=new Uint32Array([0]);function Zk(){return typeof navigator<"u"&&"gpu"in navigator}class dx{runBatch(s,i,l,c,u,p){const d=[],g=s.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(u=>u.trim().toLowerCase()).filter(u=>u.length>0);this.wordlist=c.filter(fx)}setWordlist(s){this.wordlist=s.map(i=>i.trim().toLowerCase()).filter(fx)}abort(){this.abortFlag=!0}isGpuAvailable(){return Zk()}async decodePacket(s){var l;const i=s.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!i||!/^[0-9a-fA-F]+$/.test(i))return null;try{const u=(l=(await jt.MeshCorePacketDecoder.decodeWithVerification(i,{})).payload)==null?void 0:l.decoded;return!(u!=null&&u.channelHash)||!(u!=null&&u.ciphertext)||!(u!=null&&u.cipherMac)?null:{channelHash:u.channelHash,ciphertext:u.ciphertext,cipherMac:u.cipherMac,isGroupText:!0}}catch{return null}}async crack(s,i,l){this.abortFlag=!1,this.useTimestampFilter=(i==null?void 0:i.useTimestampFilter)??!0,this.useUtf8Filter=(i==null?void 0:i.useUtf8Filter)??!0,this.useSenderFilter=(i==null?void 0:i.useSenderFilter)??!0,this.validSeconds=(i==null?void 0:i.validSeconds)??N0,this.useCpu=(i==null?void 0:i.forceCpu)??!1;const c=(i==null?void 0:i.maxLength)??8,u=(i==null?void 0:i.startingLength)??1,p=(i==null?void 0:i.useDictionary)??!0,d=(i==null?void 0:i.startFromType)??"bruteforce",g=s.toLowerCase(),m=await this.decodePacket(g);if(!m)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:x,ciphertext:A,cipherMac:_}=m,k=parseInt(x,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new dx):this.gpuInstance||(this.gpuInstance=new bd,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new dx));const R=performance.now();let C=0,w=performance.now(),B=u,S=0,T=0,F=!1;if(i!=null&&i.startFrom){const W=i.startFrom.toLowerCase();if(d==="dictionary"){const re=this.wordlist.indexOf(W);re>=0&&(T=re+1)}else{F=!0;const re=Hk(W);re&&(B=Math.max(u,re.length),S=re.index+1,S>=vl(B)&&(B++,S=0))}}let M=0;p&&!F&&this.wordlist.length>0&&(M+=this.wordlist.length-T);for(let W=B;W<=c;W++)M+=vl(W);M-=S;const z=(W,re,pe)=>{if(!l)return;const Ae=(performance.now()-R)/1e3,G=Ae>0?Math.round(C/Ae):0,xe=M-C,Z=G>0?xe/G:0;l({checked:C,total:M,percent:M>0?Math.min(100,C/M*100):0,rateKeysPerSec:G,etaSeconds:Z,elapsedSeconds:Ae,currentLength:re,currentPosition:pe,phase:W})},H=W=>{if(!Pv(A,_,W))return{valid:!1};const re=jt.ChannelCrypto.decryptGroupTextMessage(A,_,W);return!re.success||!re.data?{valid:!1}:this.useTimestampFilter&&!Vk(re.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Uk(re.data.message)?{valid:!1}:this.useSenderFilter&&!re.data.sender?{valid:!1}:{valid:!0,message:re.data.sender?`${re.data.sender}: ${re.data.message}`:re.data.message}};if(!F&&T===0&&B===u&&S===0){z("public-key",0,R0);const W=L0(Zu);if(x===W){const re=H(Zu);if(re.valid)return{found:!0,roomName:R0,key:Zu,decryptedMessage:re.message}}}if(p&&!F&&this.wordlist.length>0)for(let W=T;W<this.wordlist.length;W++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[W],resumeType:"dictionary"};const re=this.wordlist[W],pe=F0("#"+re),ie=L0(pe);if(parseInt(ie,16)===k){const G=H(pe);if(G.valid)return{found:!0,roomName:re,key:pe,decryptedMessage:G.message,resumeFrom:re,resumeType:"dictionary"}}C++;const Ae=performance.now();Ae-w>=200&&(z("wordlist",re.length,re),w=Ae,await new Promise(G=>setTimeout(G,0)))}const j=this.useCpu?1024:32768,X=(i==null?void 0:i.gpuDispatchMs)??1e3;let V=j,$=!1;for(let W=B;W<=c;W++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(W,0)||void 0,resumeType:"bruteforce"};const re=vl(W);let pe=W===B?S:0;for(;pe<re;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(W,pe)||void 0,resumeType:"bruteforce"};const ie=Math.min(V,re-pe),Ae=performance.now();let G;this.useCpu?G=this.cpuInstance.runBatch(k,W,pe,ie,A,_):G=await this.gpuInstance.runBatch(k,W,pe,ie,A,_);const xe=performance.now()-Ae;if(C+=ie,!this.useCpu&&!$&&ie>=j&&xe>0){const N=X/xe,U=Math.round(ie*N),K=Math.pow(2,Math.round(Math.log2(Math.max(j,U))));V=Math.max(j,K),$=!0}for(const N of G){const U=es(W,N);if(!U)continue;const K=F0("#"+U),Y=H(K);if(Y.valid)return{found:!0,roomName:U,key:K,decryptedMessage:Y.message,resumeFrom:U,resumeType:"bruteforce"}}pe+=ie;const Z=performance.now();if(Z-w>=200){const N=es(W,Math.min(pe,re-1))||"";z("bruteforce",W,N),w=Z,await new Promise(U=>setTimeout(U,0))}}}return{found:!1,resumeFrom:es(c,vl(c)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var g0,hx;function Kk(){return hx||(hx=1,g0={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAA
Line 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(d=>(this.enabled=!0,d)).catch(d=>{throw this.enabled=!1,d})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):i()?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 x0=c,x0}var Yk=Qk();const Xk=aa(Yk);function Jk(n){if(n.length<4)return null;try{const i=parseInt(n.slice(0,2),16)&3;let l=2;if(i===0||i===3){if(n.length<l+8)return null;l+=8}if(n.length<l+2)return null;const c=parseInt(n.slice(l,l+2),16);l+=2;const u=c*2;return n.length<l+u?null:(l+=u,n.slice(l))}catch{return null}}function eS({packets:n,channels:s,onChannelCreate:i,onRunningChange:l,visible:c=!1}){const[u,p]=D.useState(!1),[d,g]=D.useState(6),[m,x]=D.useState(!1),[A,_]=D.useState(!0),[k,R]=D.useState(!1),[C,w]=D.useState(null),[B,S]=D.useState(new Map),[T,F]=D.useState([]),[M,z]=D.useState(!1),[H,j]=D.useState(null),[X,V]=D.useState(null),[$,ee]=D.useState(0),W=D.useRef(null),re=D.useRef(null),pe=D.useRef(!1),ie=D.useRef(!1),Ae=D.useRef(!1),G=D.useRef(new Map),xe=D.useRef(!1),Z=D.useRef(6),N=D.useRef(!0),U=D.useRef(!1),K=D.useRef(new Set),Y=D.useRef(new Set);D.useEffect(()=>{const ge=new $k;W.current=ge,j(ge.isGpuAvailable());const Le=new Xk;return re.current=Le,()=>{ge.destroy(),W.current=null,Le.disable(),re.current=null}},[]),D.useEffect(()=>{!c||M||Rk(async()=>{const{ENGLISH_WORDLIST:ge}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:ge}},[]).then(({ENGLISH_WORDLIST:ge})=>{W.current&&(W.current.setWordlist(ge),z(!0))}).catch(ge=>{console.error("Failed to load wordlist:",ge),bt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[c,M]),D.useEffect(()=>{const ge=()=>{dt.getUndecryptedPacketCount().then(({count:We})=>V(We)).catch(()=>V(null))};ge();const Le=setInterval(ge,36e5);return()=>clearInterval(Le)},[]);const fe=D.useMemo(()=>new Set(s.map(ge=>ge.key.toUpperCase())),[s]),me=n.filter(ge=>ge.payload_type==="GROUP_TEXT"&&!ge.decrypted);D.useEffect(()=>{let ge=0;S(Le=>{const We=new Map(Le);let lt=!1;for(const et of me)if(!We.has(et.id)){const Ne=Jk(et.data);if(Ne&&Y.current.has(Ne)){ge++;continue}Ne&&Y.current.add(Ne),We.set(et.id,{packet:et,attempts:0,lastAttemptLength:0,status:"pending"}),lt=!0}return lt?(G.current=We,We):Le}),ge>0&&ee(Le=>Le+ge)},[me.length]),D.useEffect(()=>{G.current=B},[B]),D.useEffect(()=>{xe.current=m},[m]),D.useEffect(()=>{Z.current=d},[d]),D.useEffect(()=>{N.current=A},[A]),D.useEffect(()=>{U.current=k},[k]),D.useEffect(()=>{K.current=new Set(me.map(ge=>ge.id))},[me]),D.useEffect(()=>{l==null||l(u)},[u,l]);const Se=Array.from(B.values()).filter(ge=>ge.status==="pending").length,we=Array.from(B.values()).filter(ge=>ge.status==="cracked").length,de=Array.from(B.values()).filter(ge=>ge.status==="failed").length,he=D.useCallback(async()=>{if(Ae.current||!W.current||!pe.current)return;const ge=G.current;let Le=null,We=null;for(const[Ue,ot]of ge.entries())if(ot.status==="pending"){Le=ot,We=Ue;break}if(!Le&&xe.current){const Ue=Array.from(ge.entries()).filter(([,ot])=>ot.status==="failed"&&ot.lastAttemptLength<10);Ue.length>0&&(Ue.sort((ot,tt)=>ot[1].lastAttemptLength-tt[1].lastAttemptLength),[We,Le]=Ue[0])}if(!Le||We===null){pe.current&&setTimeout(()=>he(),1e3);return}if(!K.current.has(We)){S(Ue=>{const ot=new Map(Ue);return ot.delete(We),ot}),pe.current&&setTimeout(()=>he(),10);return}Ae.current=!0;const lt=Z.current,et=Le.lastAttemptLength>0,Ne=et?Le.lastAttemptLength+1:lt;try{const Ue=await W.current.crack(Le.packet.data,{maxLength:Ne,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...U.current&&{gpuDispatchMs:1e4},...et&&{useDictionary:!1,startingLength:Ne}},ot=>{w(ot)});if(ie.current){ie.current=!1,Ae.current=!1,w(null);return}if(Ue.found&&Ue.roomName&&Ue.key){S(oe=>{const Re=new Map(oe),qe=Re.get(We);return qe&&Re.set(We,{...qe,status:"cracked",attempts:qe.attempts+1,lastAttemptLength:Ne}),Re});const ot={roomName:Ue.roomName,key:Ue.key,packetId:We,message:Ue.decryptedMessage||"",crackedAt:Date.now()};F(oe=>[...oe,ot]);const tt=Ue.key.toUpperCase();if(!fe.has(tt))try{const oe="#"+Ue.roomName;await i(oe,Ue.key),N.current&&await dt.decryptHistoricalPackets({key_type:"channel",channel_name:oe})}catch(oe){console.error("Failed to create channel or decrypt historical:",oe),bt.error("Failed to save cracked channel",{description:oe instanceof Error?oe.message:"Channel discovered but could not be saved"})}}else S(ot=>{const tt=new Map(ot),oe=tt.get(We);return oe&&tt.set(We,{...oe,status:"failed",attempts:oe.attempts+1,lastAttemptLength:Ne}),tt})}catch(Ue){console.error("Cracking error:",Ue),S(ot=>{const tt=new Map(ot),oe=tt.get(We);return oe&&tt.set(We,{...oe,status:"failed",attempts:oe.attempts+1,lastAttemptLength:Ne}),tt})}Ae.current=!1,w(null),pe.current&&setTimeout(()=>he(),100)},[fe,i]),Ze=()=>{var ge;if(!H){bt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),pe.current=!0,ie.current=!1,(ge=re.current)==null||ge.enable(),he()},Fe=()=>{var ge,Le;p(!1),pe.current=!1,ie.current=!0,(ge=W.current)==null||ge.abort(),(Le=re.current)=
Line truncated
|
||||
//# sourceMappingURL=index-B7TRWRoH.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAACG,EAAE,UAAU,iBAAiB,GACnQA,EAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,GAAG,EAAEA,EAAE,UAAUH,EAAE,UAAU,SAASI,EAAER,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAAC,IAAIQ,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEN,EAAEO,EAAEL,EAAE,SAAS,EAAEK,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEd,EAAEK,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGpB,GAAGA,EAAE,aAAa,IAAIe,KAAKI,GAAEnB,EAAE,aAAamB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS5B,EAAE,KAAKa,EAAE,IAAIiB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,EAAEtB,EAAEK,EAAE,CAAC,MAAM,CAAC,SAASlB,EAAE,KAAKa,EAAE,KAAK,IAAIK,EAAE,IAAIL,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASuB,EAAEvB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASqC,EAAOxB,EAAE,CAAC,IAAIK,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIL,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOK,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIyB,GAAE,OAAO,SAASC,EAAE1B,EAAEK,EAAE,CAAC,OAAiB,OAAOL,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYwB,EAAO,GAAGxB,EAAE,GAAG,EAAEK,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,GAAE3B,EAAEK,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOjB,GAAmBiB,KAAd,aAA6BA,KAAZ,aAAcjB,EAAE,MAAK,IAAIkB,GAAE,GAAG,GAAUlB,IAAP,KAASkB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOlB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE8B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAElB,EAAEgB,GAAEA,GAAEE,EAAC,EAAElB,EAAOe,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASN,GAAN,OAAUM,EAAEN,EAAE,QAAQyB,GAAE,KAAK,EAAE,KAAKE,GAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASN,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASgB,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,EAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,GAAE,KAAK,EAAE,KAAKzB,CAAC,GAAGK,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAEV,CAAC,EAAE,QAAQmB,GAAE,EAAEA,GAAEnB,EAAE,OAAOmB,KAAI,CAACF,GACrfjB,EAAEmB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAErB,EAAEC,CAAC,EAAe,OAAOoB,IAApB,WAAsB,IAAIpB,EAAEoB,GAAE,KAAKpB,CAAC,EAAEmB,GAAE,EAAE,EAAEF,GAAEjB,EAAE,KAAI,GAAI,MAAMiB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOL,CAAC,EAAE,MAAM,mDAAuEK,IAApB,kBAAsB,qBAAqB,OAAO,KAAKL,CAAC,EAAE,KAAK,IAAI,EAAE,IAAIK,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE5B,EAAEK,EAAEC,EAAE,CAAC,GAASN,GAAN,KAAQ,OAAOA,EAAE,IAAIe,EAAE,GAAGC,GAAE,EAAE,OAAAW,GAAE3B,EAAEe,EAAE,GAAG,GAAG,SAASf,GAAE,CAAC,OAAOK,EAAE,KAAKC,EAAEN,GAAEgB,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,GAAE7B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAIK,EAAEL,EAAE,QAAQK,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,EAAE,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,CAAC,EAAOL,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAE,CAAC,GAAOL,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI8B,GAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBF,GAAE,wBAAwBC,EAAE,kBAAkBnB,CAAC,EAAE,SAASqB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIN,GAAE,QAAQ,SAAS5B,EAAEK,EAAEC,EAAE,CAACsB,GAAE5B,EAAE,UAAU,CAACK,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASN,EAAE,CAAC,IAAIK,EAAE,EAAE,OAAAuB,GAAE5B,EAAE,UAAU,CAACK,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASL,EAAE,CAAC,OAAO4B,GAAE5B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACuB,EAAEvB,CAAC,EAAE,Line truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
-542
@@ -1,542 +0,0 @@
|
||||
var Dv=Object.defineProperty;var Rv=(r,a,o)=>a in r?Dv(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o;var Oo=(r,a,o)=>Rv(r,typeof a!="symbol"?a+"":a,o);function Fv(r,a){for(var o=0;o<a.length;o++){const l=a[o];if(typeof l!="string"&&!Array.isArray(l)){for(const d in l)if(d!=="default"&&!(d in r)){const f=Object.getOwnPropertyDescriptor(l,d);f&&Object.defineProperty(r,d,f.get?f:{enumerable:!0,get:()=>l[d]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))l(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function o(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(d){if(d.ep)return;d.ep=!0;const f=o(d);fetch(d.href,f)}})();var Bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Mg(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var a=r.default;if(typeof a=="function"){var o=function l(){return this instanceof l?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};o.prototype=a.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(r).forEach(function(l){var d=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(o,l,d.get?d:{enumerable:!0,get:function(){return r[l]}})}),o}var Pf={exports:{}},Za={},Tf={exports:{}},ft={};/**
|
||||
* @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 bp;function Nv(){if(bp)return ft;bp=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function w(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,k={};function E(B,V,K){this.props=B,this.context=V,this.refs=k,this.updater=K||T}E.prototype.isReactComponent={},E.prototype.setState=function(B,V){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,V,"setState")},E.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function D(){}D.prototype=E.prototype;function P(B,V,K){this.props=B,this.context=V,this.refs=k,this.updater=K||T}var S=P.prototype=new D;S.constructor=P,F(S,E.prototype),S.isPureReactComponent=!0;var N=Array.isArray,M=Object.prototype.hasOwnProperty,z={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function j(B,V,K){var Y,ce={},fe=null,we=null;if(V!=null)for(Y in V.ref!==void 0&&(we=V.ref),V.key!==void 0&&(fe=""+V.key),V)M.call(V,Y)&&!H.hasOwnProperty(Y)&&(ce[Y]=V[Y]);var Ae=arguments.length-2;if(Ae===1)ce.children=K;else if(1<Ae){for(var Ue=Array(Ae),Ye=0;Ye<Ae;Ye++)Ue[Ye]=arguments[Ye+2];ce.children=Ue}if(B&&B.defaultProps)for(Y in Ae=B.defaultProps,Ae)ce[Y]===void 0&&(ce[Y]=Ae[Y]);return{$$typeof:r,type:B,key:fe,ref:we,props:ce,_owner:z.current}}function J(B,V){return{$$typeof:r,type:B.type,key:V,ref:B.ref,props:B.props,_owner:B._owner}}function U(B){return typeof B=="object"&&B!==null&&B.$$typeof===r}function Q(B){var V={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(K){return V[K]})}var te=/\/+/g;function G(B,V){return typeof B=="object"&&B!==null&&B.key!=null?Q(""+B.key):V.toString(36)}function re(B,V,K,Y,ce){var fe=typeof B;(fe==="undefined"||fe==="boolean")&&(B=null);var we=!1;if(B===null)we=!0;else switch(fe){case"string":case"number":we=!0;break;case"object":switch(B.$$typeof){case r:case a:we=!0}}if(we)return we=B,ce=ce(we),B=Y===""?"."+G(we,0):Y,N(ce)?(K="",B!=null&&(K=B.replace(te,"$&/")+"/"),re(ce,V,K,"",function(Ye){return Ye})):ce!=null&&(U(ce)&&(ce=J(ce,K+(!ce.key||we&&we.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+B)),V.push(ce)),1;if(we=0,Y=Y===""?".":Y+":",N(B))for(var Ae=0;Ae<B.length;Ae++){fe=B[Ae];var Ue=Y+G(fe,Ae);we+=re(fe,V,K,Ue,ce)}else if(Ue=w(B),typeof Ue=="function")for(B=Ue.call(B),Ae=0;!(fe=B.next()).done;)fe=fe.value,Ue=Y+G(fe,Ae++),we+=re(fe,V,K,Ue,ce);else if(fe==="object")throw V=String(B),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return we}function de(B,V,K){if(B==null)return B;var Y=[],ce=0;return re(B,Y,"","",function(fe){return V.call(K,fe,ce++)}),Y}function ie(B){if(B._status===-1){var V=B._result;V=V(),V.then(function(K){(B._status===0||B._status===-1)&&(B._status=1,B._result=K)},function(K){(B._status===0||B._status===-1)&&(B._status=2,B._result=K)}),B._status===-1&&(B._status=0,B._result=V)}if(B._status===1)return B._result.default;throw B._result}var pe={current:null},q={transition:null},he={ReactCurrentDispatcher:pe,ReactCurrentBatchConfig:q,ReactCurrentOwner:z};function Z(){throw Error("act(...) is not supported in production builds of React.")}return ft.Children={map:de,forEach:function(B,V,K){de(B,function(){V.apply(this,arguments)},K)},count:function(B){var V=0;return de(B,function(){V++}),V},toArray:function(B){return de(B,function(V){return V})||[]},only:function(B){if(!U(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},ft.Component=E,ft.Fragment=o,ft.Profiler=d,ft.PureComponent=P,ft.StrictMode=l,ft.Suspense=g,ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=he,ft.act=Z,ft.cloneElement=function(B,V,K){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var Y=F({},B.props),ce=B.key,fe=B.ref,we=B._owner;if(V!=null){if(V.ref!==void 0&&(fe=V.ref,we=z.current),V.key!==void 0&&(ce=""+V.key),B.type&&B.type.defaultProps)var Ae=B.type.defaultProps;for(Ue in V)M.call(V,Ue)&&!H.hasOwnProperty(Ue)&&(Y[Ue]=V[Ue]===void 0&&Ae!==void 0?Ae[Ue]:V[Ue])}var Ue=arguments.length-2;if(Ue===1)Y.children=K;else if(1<Ue){Ae=Array(Ue);for(var Ye=0;Ye<Ue;Ye++)Ae[Ye]=arguments[Ye+2];Y.children=Ae}return{$$typeof:r,type:B.type,key:ce,ref:fe,props:Y,_owner:we}},ft.creLine 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 Ep;function Lv(){if(Ep)return Za;Ep=1;var r=h0(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function p(h,g,m){var v,y={},w=null,T=null;m!==void 0&&(w=""+m),g.key!==void 0&&(w=""+g.key),g.ref!==void 0&&(T=g.ref);for(v in g)l.call(g,v)&&!f.hasOwnProperty(v)&&(y[v]=g[v]);if(h&&h.defaultProps)for(v in g=h.defaultProps,g)y[v]===void 0&&(y[v]=g[v]);return{$$typeof:a,type:h,key:w,ref:T,props:y,_owner:d.current}}return Za.Fragment=o,Za.jsx=p,Za.jsxs=p,Za}var kp;function Mv(){return kp||(kp=1,Pf.exports=Lv()),Pf.exports}var b=Mv(),R=h0();const Ee=Ys(R),p0=Fv({__proto__:null,default:Ee},[R]);var Bu={},Df={exports:{}},Zn={},Rf={exports:{}},Ff={};/**
|
||||
* @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 Sp;function Iv(){return Sp||(Sp=1,(function(r){function a(q,he){var Z=q.length;q.push(he);e:for(;0<Z;){var B=Z-1>>>1,V=q[B];if(0<d(V,he))q[B]=he,q[Z]=V,Z=B;else break e}}function o(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var he=q[0],Z=q.pop();if(Z!==he){q[0]=Z;e:for(var B=0,V=q.length,K=V>>>1;B<K;){var Y=2*(B+1)-1,ce=q[Y],fe=Y+1,we=q[fe];if(0>d(ce,Z))fe<V&&0>d(we,ce)?(q[B]=we,q[fe]=Z,B=fe):(q[B]=ce,q[Y]=Z,B=Y);else if(fe<V&&0>d(we,Z))q[B]=we,q[fe]=Z,B=fe;else break e}}return he}function d(q,he){var Z=q.sortIndex-he.sortIndex;return Z!==0?Z:q.id-he.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();r.unstable_now=function(){return p.now()-h}}var g=[],m=[],v=1,y=null,w=3,T=!1,F=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(q){for(var he=o(m);he!==null;){if(he.callback===null)l(m);else if(he.startTime<=q)l(m),he.sortIndex=he.expirationTime,a(g,he);else break;he=o(m)}}function N(q){if(k=!1,S(q),!F)if(o(g)!==null)F=!0,ie(M);else{var he=o(m);he!==null&&pe(N,he.startTime-q)}}function M(q,he){F=!1,k&&(k=!1,D(j),j=-1),T=!0;var Z=w;try{for(S(he),y=o(g);y!==null&&(!(y.expirationTime>he)||q&&!Q());){var B=y.callback;if(typeof B=="function"){y.callback=null,w=y.priorityLevel;var V=B(y.expirationTime<=he);he=r.unstable_now(),typeof V=="function"?y.callback=V:y===o(g)&&l(g),S(he)}else l(g);y=o(g)}if(y!==null)var K=!0;else{var Y=o(m);Y!==null&&pe(N,Y.startTime-he),K=!1}return K}finally{y=null,w=Z,T=!1}}var z=!1,H=null,j=-1,J=5,U=-1;function Q(){return!(r.unstable_now()-U<J)}function te(){if(H!==null){var q=r.unstable_now();U=q;var he=!0;try{he=H(!0,q)}finally{he?G():(z=!1,H=null)}}else z=!1}var G;if(typeof P=="function")G=function(){P(te)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,de=re.port2;re.port1.onmessage=te,G=function(){de.postMessage(null)}}else G=function(){E(te,0)};function ie(q){H=q,z||(z=!0,G())}function pe(q,he){j=E(function(){q(r.unstable_now())},he)}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(q){q.callback=null},r.unstable_continueExecution=function(){F||T||(F=!0,ie(M))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_getFirstCallbackNode=function(){return o(g)},r.unstable_next=function(q){switch(w){case 1:case 2:case 3:var he=3;break;default:he=w}var Z=w;w=he;try{return q()}finally{w=Z}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,he){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Z=w;w=q;try{return he()}finally{w=Z}},r.unstable_scheduleCallback=function(q,he,Z){var B=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?B+Z:B):Z=B,q){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=Z+V,q={id:v++,callback:he,priorityLevel:q,startTime:Z,expirationTime:V,sortIndex:-1},Z>B?(q.sortIndex=Z,a(m,q),o(g)===null&&q===o(m)&&(k?(D(j),j=-1):k=!0,pe(N,Z-B))):(q.sortIndex=V,a(g,q),F||T||(F=!0,ie(M))),q},r.unstable_shouldYield=Q,r.unstable_wrapCallback=function(q){var he=w;return function(){var Z=w;w=he;try{return q.apply(this,arguments)}finally{w=Z}}}})(Ff)),Ff}var Bp;function Ov(){return Bp||(Bp=1,Rf.exports=Iv()),Rf.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 Pp;function jv(){if(Pp)return Zn;Pp=1;var r=h0(),a=Ov();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,d={};function f(e,n){p(e,n),p(e+"Capture",n)}function p(e,n){for(d[e]=n,e=0;e<n.length;e++)l.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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={},y={};function w(e){return g.call(y,e)?!0:g.call(v,e)?!1:m.test(e)?y[e]=!0:(v[e]=!0,!1)}function T(e,n,s,c){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function F(e,n,s,c){if(n===null||typeof n>"u"||T(e,n,s,c))return!0;if(c)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function k(e,n,s,c,x,_,I){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=x,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=_,this.removeEmptyString=I}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];E[n]=new k(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new k(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){E[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function P(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 n=e.replace(D,P);E[n]=new k(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(D,P);E[n]=new k(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(D,P);E[n]=new k(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,n,s,c){var x=E.hasOwnProperty(n)?E[n]:null;(x!==null?x.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=
Line truncated
|
||||
`+B+e}var K=!1;function Y(e,n){if(!e||K)return"";K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ue){var c=ue}Reflect.construct(e,[],n)}else{try{n.call()}catch(ue){c=ue}e.call(n.prototype)}else{try{throw Error()}catch(ue){c=ue}e()}}catch(ue){if(ue&&c&&typeof ue.stack=="string"){for(var x=ue.stack.split(`
|
||||
`),_=c.stack.split(`
|
||||
`),I=x.length-1,W=_.length-1;1<=I&&0<=W&&x[I]!==_[W];)W--;for(;1<=I&&0<=W;I--,W--)if(x[I]!==_[W]){if(I!==1||W!==1)do if(I--,W--,0>W||x[I]!==_[W]){var X=`
|
||||
`+x[I].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=I&&0<=W);break}}}finally{K=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?V(e):""}function ce(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=Y(e.type,!1),e;case 11:return e=Y(e.type.render,!1),e;case 1:return e=Y(e.type,!0),e;default:return""}}function fe(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 H:return"Fragment";case z:return"Portal";case J:return"Profiler";case j:return"StrictMode";case G:return"Suspense";case re:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case U:return(e._context.displayName||"Context")+".Provider";case te:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case de:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case ie:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}function we(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(n);case 8:return n===j?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ue(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ye(e){var n=Ue(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var x=s.get,_=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return x.call(this)},set:function(I){c=""+I,_.call(this,I)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(I){c=""+I},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ct(e){e._valueTracker||(e._valueTracker=Ye(e))}function pt(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return e&&(c=Ue(e)?e.checked?"true":"false":e.value),e=c,e!==s?(n.setValue(e),!0):!1}function Be(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,n){var s=n.checked;return Z({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function ct(e,n){var s=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;s=Ae(n.value!=null?n.value:s),e._wrapperState={initialChecked:c,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Lt(e,n){n=n.checked,n!=null&&S(e,"checked",n,!1)}function at(e,n){Lt(e,n);var s=Ae(n.value),c=n.type;if(s!=null)c==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?qe(e,n.type,s):n.hasOwnProperty("defaultValue")&&qe(e,n.type,Ae(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function mt(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function qe(e,n,s){(n!=="number"||Be(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var tt=Array.isArray;function nt(e,n,s,c){if(e=e.options,n){n={};for(var x=0;x<s.length;x++)n["$"+s[x]]=!0;for(s=0;s<e.length;s++)x=n.hasOwnProperty("$"+e[s].value),e[s].selected!==x&&(e[s].selected=x),x&&c&&(e[s].defaultSelected=!0)}else{for(s=""+Ae(s),n=null,x=0;x<e.length;x++){if(e[x].value===s){e[x].selected=!0,c&&(e[x].defaultSelected=!0);return}n!==null||e[x].disabled||(n=e[x])}n!==null&&(n.selected=!0)}}function He(e,n){if(n.dangerouslySetInnerHTM
Line truncated
|
||||
`).replace($,"")}function le(e,n,s){if(n=oe(n),oe(e)!==n&&s)throw Error(o(425))}function xe(){}var Pe=null,We=null;function it(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var an=typeof setTimeout=="function"?setTimeout:void 0,nn=typeof clearTimeout=="function"?clearTimeout:void 0,Fn=typeof Promise=="function"?Promise:void 0,En=typeof queueMicrotask=="function"?queueMicrotask:typeof Fn<"u"?function(e){return Fn.resolve(null).then(e).catch(qi)}:an;function qi(e){setTimeout(function(){throw e})}function Pa(e,n){var s=n,c=0;do{var x=s.nextSibling;if(e.removeChild(s),x&&x.nodeType===8)if(s=x.data,s==="/$"){if(c===0){e.removeChild(x),Yn(n);return}c--}else s!=="$"&&s!=="$?"&&s!=="$!"||c++;s=x}while(s);Yn(n)}function Zr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Ul(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var ci=Math.random().toString(36).slice(2),fr="__reactFiber$"+ci,Gi="__reactProps$"+ci,kt="__reactContainer$"+ci,Ki="__reactEvents$"+ci,wd="__reactListeners$"+ci,bd="__reactHandles$"+ci;function di(e){var n=e[fr];if(n)return n;for(var s=e.parentNode;s;){if(n=s[kt]||s[fr]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ul(e);e!==null;){if(s=e[fr])return s;e=Ul(e)}return n}e=s,s=e.parentNode}return null}function fi(e){return e=e[fr]||e[kt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Es(e){return e[Gi]||null}var Cd=[],ks=-1;function Qi(e){return{current:e}}function It(e){0>ks||(e.current=Cd[ks],Cd[ks]=null,ks--)}function Nt(e,n){ks++,Cd[ks]=e.current,e.current=n}var $i={},kn=Qi($i),jn=Qi(!1),So=$i;function Ss(e,n){var s=e.type.contextTypes;if(!s)return $i;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var x={},_;for(_ in s)x[_]=n[_];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=x),x}function zn(e){return e=e.childContextTypes,e!=null}function Zl(){It(jn),It(kn)}function W0(e,n,s){if(kn.current!==$i)throw Error(o(168));Nt(kn,n),Nt(jn,s)}function q0(e,n,s){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return s;c=c.getChildContext();for(var x in c)if(!(x in n))throw Error(o(108,we(e)||"Unknown",x));return Z({},s,c)}function Wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$i,So=kn.current,Nt(kn,e),Nt(jn,jn.current),!0}function G0(e,n,s){var c=e.stateNode;if(!c)throw Error(o(169));s?(e=q0(e,n,So),c.__reactInternalMemoizedMergedChildContext=e,It(jn),It(kn),Nt(kn,e)):It(jn),Nt(jn,s)}var pi=null,ql=!1,Ed=!1;function K0(e){pi===null?pi=[e]:pi.push(e)}function $x(e){ql=!0,K0(e)}function Yi(){if(!Ed&&pi!==null){Ed=!0;var e=0,n=vt;try{var s=pi;for(vt=1;e<s.length;e++){var c=s[e];do c=c(!0);while(c!==null)}pi=null,ql=!1}catch(x){throw pi!==null&&(pi=pi.slice(e+1)),vl(ia,Yi),x}finally{vt=n,Ed=!1}}return null}var Bs=[],Ps=0,Gl=null,Kl=0,hr=[],pr=0,Bo=null,mi=1,gi="";function Po(e,n){Bs[Ps++]=Kl,Bs[Ps++]=Gl,Gl=e,Kl=n}function Q0(e,n,s){hr[pr++]=mi,hr[pr++]=gi,hr[pr++]=Bo,Bo=e;var c=mi;e=gi;var x=32-rt(c)-1;c&=~(1<<x),s+=1;var _=32-rt(n)+x;if(30<_){var I=x-x%5;_=(c&(1<<I)-1).toString(32),c>>=I,x-=I,mi=1<<32-rt(n)+x|s<<x|c,gi=_+e}else mi=1<<_|s<<x|c,gi=e}function kd(e){e.return!==null&&(Po(e,1),Q0(e,1,0))}function Sd(e){for(;e===Gl;)Gl=Bs[--Ps],Bs[Ps]=null,Kl=Bs[--Ps],Bs[Ps]=null;for(;e===Bo;)Bo=hr[--pr],hr[pr]=null,gi=hr[--pr],hr[pr]=null,mi=hr[--pr],hr[pr]=null}var nr=null,rr=null,Ht=!1,kr=null;function $0(e,n){var s=xr(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function Y0(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,nr=e,rr=Zr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,nr=e,rr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Bo!==null?{id:mi,overflow:gi}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=xr(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,nr=e,rr=null,!0):!1;default:return!1}}function Bd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pd(e){if(Ht){var n=rr;if(n){var s=n;if(!Y0(e,n)){if(Bd(e))throw Error(o(418));n=Zr(s.nextSibling);var c=nr;n&&Y0(e,n)?$0(c,s):(e.flags=e.flags&-4097|2,Ht=!1,nr=e)}}else{if(Bd(e))throw Error(o(418));e.flags=e.flags&-4097|2,Ht=!1,nr=e}}}function X0(e){for(e=e.r
Line truncated
|
||||
Error generating stack: `+_.message+`
|
||||
`+_.stack}return{value:e,source:n,stack:x,digest:null}}function Yd(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function Xd(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var ov=typeof WeakMap=="function"?WeakMap:Map;function Rh(e,n,s){s=xi(-1,s),s.tag=3,s.payload={element:null};var c=n.value;return s.callback=function(){pu||(pu=!0,pf=c),Xd(e,n)},s}function Fh(e,n,s){s=xi(-1,s),s.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var x=n.value;s.payload=function(){return c(x)},s.callback=function(){Xd(e,n)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(s.callback=function(){Xd(e,n),typeof c!="function"&&(to===null?to=new Set([this]):to.add(this));var I=n.stack;this.componentDidCatch(n.value,{componentStack:I!==null?I:""})}),s}function Nh(e,n,s){var c=e.pingCache;if(c===null){c=e.pingCache=new ov;var x=new Set;c.set(n,x)}else x=c.get(n),x===void 0&&(x=new Set,c.set(n,x));x.has(s)||(x.add(s),e=vv.bind(null,e,n,s),n.then(e,e))}function Lh(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Mh(e,n,s,c,x){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=xi(-1,1),n.tag=2,Ji(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=x,e)}var sv=N.ReactCurrentOwner,Hn=!1;function Nn(e,n,s,c){n.child=e===null?nh(n,null,s,c):Ds(n,e.child,s,c)}function Ih(e,n,s,c,x){s=s.render;var _=n.ref;return Fs(n,x),c=Ud(e,n,s,c,_,x),s=Zd(),e!==null&&!Hn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~x,vi(e,n,x)):(Ht&&s&&kd(n),n.flags|=1,Nn(e,n,c,x),n.child)}function Oh(e,n,s,c,x){if(e===null){var _=s.type;return typeof _=="function"&&!_f(_)&&_.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=_,jh(e,n,_,c,x)):(e=yu(s.type,null,c,n,n.mode,x),e.ref=n.ref,e.return=n,n.child=e)}if(_=e.child,(e.lanes&x)===0){var I=_.memoizedProps;if(s=s.compare,s=s!==null?s:Hr,s(I,c)&&e.ref===n.ref)return vi(e,n,x)}return n.flags|=1,e=oo(_,c),e.ref=n.ref,e.return=n,n.child=e}function jh(e,n,s,c,x){if(e!==null){var _=e.memoizedProps;if(Hr(_,c)&&e.ref===n.ref)if(Hn=!1,n.pendingProps=c=_,(e.lanes&x)!==0)(e.flags&131072)!==0&&(Hn=!0);else return n.lanes=e.lanes,vi(e,n,x)}return Jd(e,n,s,c,x)}function zh(e,n,s){var c=n.pendingProps,x=c.children,_=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(Is,ir),ir|=s;else{if((s&1073741824)===0)return e=_!==null?_.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Nt(Is,ir),ir|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=_!==null?_.baseLanes:s,Nt(Is,ir),ir|=c}else _!==null?(c=_.baseLanes|s,n.memoizedState=null):c=s,Nt(Is,ir),ir|=c;return Nn(e,n,x,s),n.child}function Hh(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Jd(e,n,s,c,x){var _=zn(s)?So:kn.current;return _=Ss(n,_),Fs(n,x),s=Ud(e,n,s,c,_,x),c=Zd(),e!==null&&!Hn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~x,vi(e,n,x)):(Ht&&c&&kd(n),n.flags|=1,Nn(e,n,s,x),n.child)}function Vh(e,n,s,c,x){if(zn(s)){var _=!0;Wl(n)}else _=!1;if(Fs(n,x),n.stateNode===null)uu(e,n),Th(n,s,c),$d(n,s,c,x),c=!0;else if(e===null){var I=n.stateNode,W=n.memoizedProps;I.props=W;var X=I.context,ue=s.contextType;typeof ue=="object"&&ue!==null?ue=mr(ue):(ue=zn(s)?So:kn.current,ue=Ss(n,ue));var _e=s.getDerivedStateFromProps,be=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function";be||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(W!==c||X!==ue)&&Dh(n,I,c,ue),Xi=!1;var ve=n.memoizedState;I.state=ve,eu(n,c,I,x),X=n.memoizedState,W!==c||ve!==X||jn.current||Xi?(typeof _e=="function"&&(Qd(n,s,_e,c),X=n.memoizedState),(W=Xi||Ph(n,s,W,c,ve,X,ue))?(be||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(n.flags|=4194308)):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=X),I.props=c,I.state=X,I.context=ue,c=W):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{I=n.stateNode,ih(e,n),W=n.memoizedProps,ue=n.type===n.elementType?W:Sr(n.type,W),I.props=ue,be=n.pendingProps,ve=I.context,X=s.contextType,typeof X=="object"&&X!==null?X=mr(X):(X=zn(s)?So:kn.current,X=Ss(n,X));var Ne=s.getDerivedStateFromProps;(_e=typeof Ne=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(W!==be||ve!==X)&&Dh(n,I,c,X),Xi=!1,ve=n.m
Line truncated
|
||||
`)}function zs(r,a,o){const l=Math.floor(Date.now()/1e3);return{id:-Date.now(),type:"PRIV",conversation_key:r,text:a,sender_timestamp:l,received_at:l,paths:null,txt_type:0,signature:null,outgoing:o,acked:1}}function Kv(r){const a=R.useRef(null),o=R.useRef(null),l=R.useCallback(()=>{o.current!==null&&(clearInterval(o.current),o.current=null),a.current=null},[]),d=R.useCallback(async()=>{const p=a.current;if(!p)return;let h=null,g=null;for(let m=0;m<2;m++)try{h=await et.requestTelemetry(p.conversationId,"");break}catch(v){g=v instanceof Error?v:new Error("Unknown error"),m===0&&await new Promise(y=>setTimeout(y,2e3))}if(h){const m=zs(p.conversationId,Gv(p,h),!1);r(v=>[...v,m])}else{const m=zs(p.conversationId,`Duty cycle poll failed after retry: ${(g==null?void 0:g.message)??"Unknown error"}`,!1);r(v=>[...v,m])}},[r]),f=R.useCallback(async(p,h)=>{const g=p.trim().toLowerCase();if(g==="dutycycle_start"){l();let m=null,v=null;for(let T=0;T<2;T++)try{m=await et.requestTelemetry(h,"");break}catch(F){v=F instanceof Error?F:new Error("Unknown error"),T===0&&await new Promise(k=>setTimeout(k,2e3))}if(!m){const T=zs(h,`Failed to start duty cycle tracking after retry: ${(v==null?void 0:v.message)??"Unknown error"}`,!1);return r(F=>[...F,T]),!0}const y=Math.floor(Date.now()/1e3);a.current={startTime:y,uptime:m.uptime_seconds,txAirtime:m.airtime_seconds,rxAirtime:m.rx_airtime_seconds,sentFlood:m.sent_flood,sentDirect:m.sent_direct,recvFlood:m.recv_flood,recvDirect:m.recv_direct,conversationId:h};const w=zs(h,`Airtime/duty cycle statistics gathering begins at ${y}. Logs will follow every 5 minutes. To stop, run dutycycle_stop or navigate away from this conversation.`,!1);return r(T=>[...T,w]),o.current=window.setInterval(d,Wv),!0}if(g==="dutycycle_stop"){if(a.current&&a.current.conversationId===h){await d(),l();const m=zs(h,"Airtime/duty cycle statistics gathering stopped.",!1);r(v=>[...v,m])}else{const m=zs(h,"Duty cycle tracking is not active.",!1);r(v=>[...v,m])}return!0}return!1},[r,l,d]);return R.useEffect(()=>()=>{o.current!==null&&clearInterval(o.current)},[]),{handleAirtimeCommand:f,stopTracking:l}}function zu(r){if(r<60)return`${r}s`;const a=Math.floor(r/86400),o=Math.floor(r%86400/3600),l=Math.floor(r%3600/60);return a>0?o>0&&l>0?`${a}d${o}h${l}m`:o>0?`${a}d${o}h`:l>0?`${a}d${l}m`:`${a}d`:o>0?l>0?`${o}h${l}m`:`${o}h`:`${l}m`}function Qv(r){return["Telemetry",`Battery Voltage: ${r.battery_volts.toFixed(3)}V`,`Uptime: ${zu(r.uptime_seconds)}`,`TX Airtime: ${zu(r.airtime_seconds)}`,`RX Airtime: ${zu(r.rx_airtime_seconds)}`,"",`Noise Floor: ${r.noise_floor_dbm} dBm`,`Last RSSI: ${r.last_rssi_dbm} dBm`,`Last SNR: ${r.last_snr_db.toFixed(1)} dB`,"",`Packets: ${r.packets_received.toLocaleString()} rx / ${r.packets_sent.toLocaleString()} tx`,`Flood: ${r.recv_flood.toLocaleString()} rx / ${r.sent_flood.toLocaleString()} tx`,`Direct: ${r.recv_direct.toLocaleString()} rx / ${r.sent_direct.toLocaleString()} tx`,`Duplicates: ${r.flood_dups.toLocaleString()} flood / ${r.direct_dups.toLocaleString()} direct`,"",`TX Queue: ${r.tx_queue_len}`,`Debug Flags: ${r.full_events}`].join(`
|
||||
`)}function $v(r){if(r.length===0)return`Neighbors
|
||||
No neighbors reported`;const a=[...r].sort((l,d)=>d.snr-l.snr),o=[`Neighbors (${a.length})`];for(const l of a){const d=l.name||l.pubkey_prefix,f=l.snr>=0?`+${l.snr.toFixed(1)}`:l.snr.toFixed(1);o.push(`${d}, ${f} dB [${zu(l.last_heard_seconds)} ago]`)}return o.join(`
|
||||
`)}function Yv(r){if(r.length===0)return`ACL
|
||||
No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const l=o.name||o.pubkey_prefix;a.push(`${l}: ${o.permission_name}`)}return a.join(`
|
||||
`)}function jo(r,a,o,l=0){const d=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:r,text:a,sender_timestamp:d,received_at:d,paths:null,txt_type:0,signature:null,outgoing:o,acked:1}}function Xv(r,a,o){const[l,d]=R.useState(!1),{handleAirtimeCommand:f,stopTracking:p}=Kv(o);R.useEffect(()=>{d(!1),p()},[r==null?void 0:r.id,p]);const h=R.useMemo(()=>{if(!r||r.type!=="contact")return!1;const v=a.find(y=>y.public_key===r.id);return(v==null?void 0:v.type)===Oc},[r,a]),g=R.useCallback(async v=>{if(!(!r||r.type!=="contact")&&h)try{const y=await et.requestTelemetry(r.id,v),w=jo(r.id,Qv(y),!1,0),T=jo(r.id,$v(y.neighbors),!1,1),F=jo(r.id,Yv(y.acl),!1,2);o(k=>[...k,w,T,F]),d(!0)}catch(y){const w=jo(r.id,`Telemetry request failed: ${y instanceof Error?y.message:"Unknown error"}`,!1,0);o(T=>[...T,w])}},[r,h,o]),m=R.useCallback(async v=>{if(!r||r.type!=="contact"||!h||!l||await f(v,r.id))return;const w=jo(r.id,`> ${v}`,!0,0);o(T=>[...T,w]);try{const T=await et.sendRepeaterCommand(r.id,v),F=jo(r.id,T.response,!1,1);T.sender_timestamp&&(F.sender_timestamp=T.sender_timestamp),o(k=>[...k,F])}catch(T){const F=jo(r.id,`Command failed: ${T instanceof Error?T.message:"Unknown error"}`,!1,1);o(k=>[...k,F])}},[r,h,l,o,f]);return{repeaterLoggedIn:l,activeContactIsRepeater:h,handleTelemetryRequest:g,handleRepeaterCommand:m}}const Og="remoteterm-lastMessageTime",jg="remoteterm-sortOrder";let Tc={};function Fp(r){Tc={...r}}function Np(){return{...Tc}}function Nf(r,a){return Tc[r]=a,{...Tc}}function Rr(r,a){return`${r}-${a}`}function Jv(){try{const r=localStorage.getItem(Og);return r?JSON.parse(r):{}}catch{return{}}}function ey(){try{return localStorage.getItem(jg)==="alpha"?"alpha":"recent"}catch{return"recent"}}function Lp(){try{localStorage.removeItem(Og),localStorage.removeItem(jg)}catch{}}function Mp(r,a){if(!a)return!1;const o=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${o}\\]`,"i").test(r)}function ty(r,a,o,l=null){const[d,f]=R.useState({}),[p,h]=R.useState({}),[g,m]=R.useState(Np),v=R.useRef(l);R.useEffect(()=>{v.current=l},[l]);const y=R.useRef(new Set),w=R.useRef(new Set);R.useEffect(()=>{const D=r.filter(N=>!y.current.has(N.key)),P=a.filter(N=>N.public_key&&!w.current.has(N.public_key));if(D.length===0&&P.length===0)return;D.forEach(N=>y.current.add(N.key)),P.forEach(N=>w.current.add(N.public_key)),(async()=>{const N=[...D.map(M=>({type:"CHAN",conversation_key:M.key})),...P.map(M=>({type:"PRIV",conversation_key:M.public_key}))];if(N.length!==0)try{const z={};for(let U=0;U<N.length;U+=200){const Q=N.slice(U,U+200),te=await et.getMessagesBulk(Q,m0);Object.assign(z,te)}const H={},j={},J={};for(const U of D){const Q=z[`CHAN:${U.key}`]||[];if(Q.length>0){const te=Rr("channel",U.key),G=U.last_read_at||0,re=Q.filter(ie=>!ie.outgoing&&ie.received_at>G);re.length>0&&(H[te]=re.length,re.some(ie=>Mp(ie.text,v.current))&&(j[te]=!0));const de=Math.max(...Q.map(ie=>ie.received_at));J[te]=de,Nf(te,de)}}for(const U of P){const Q=z[`PRIV:${U.public_key}`]||[];if(Q.length>0){const te=Rr("contact",U.public_key),G=U.last_read_at||0,re=Q.filter(ie=>!ie.outgoing&&ie.received_at>G);re.length>0&&(H[te]=re.length,re.some(ie=>Mp(ie.text,v.current))&&(j[te]=!0));const de=Math.max(...Q.map(ie=>ie.received_at));J[te]=de,Nf(te,de)}}Object.keys(H).length>0&&f(U=>({...U,...H})),Object.keys(j).length>0&&h(U=>({...U,...j})),m(Np())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[r,a]),R.useEffect(()=>{if(o&&o.type!=="raw"&&o.type!=="map"){const D=Rr(o.type,o.id);f(P=>{if(P[D]){const S={...P};return delete S[D],S}return P}),h(P=>{if(P[D]){const S={...P};return delete S[D],S}return P}),o.type==="channel"?et.markChannelRead(o.id).catch(P=>{console.error("Failed to mark channel as read on server:",P)}):o.type==="contact"&&et.markContactRead(o.id).catch(P=>{console.error("Failed to mark contact as read on server:",P)})}},[o]);const T=R.useCallback((D,P)=>{f(S=>({...S,[D]:(S[D]||0)+1})),P&&h(S=>({...S,[D]:!0}))},[]),F=R.useCallback(()=>{f({}),h({}),et.markAllRead().catch(D=>{console.error("Failed to mark all as read on server:",D)})},[]),k=R.useCallback(D=>{if(D.type==="raw"||D.type==="map")return;const P=Rr(D.type,D.id);f(S=>{if(S[P]){const N={...S};return delete N[P],N}return S}),h(S=>{if(S[P]){const N={...S};return delete N[P],N}return S}),D.type==="channel"?et.markChannelRead(D.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):D.type==="contact"&&et.markContactRead(D.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})},[]),E=R.useCallback(D=>{let P=null;if(D.type==="CHAN"&&D.conversation_key?P=Rr("channel",D.conversation_key):D.type==="PRIV"&&D.conversation_key&&(P=Rr("contact",D.conversation_key)),P){const S=D.received_at||Math.floor(Date.now()/1e3),N=Nf(P,S);m(N)}},[]);return{unreadCounts:d,mentions:p,lastMessageTimes:g,incrementUnread:T,markAllRead:F,markConversationRead:k,trackNewMessage:E}}var g0=Ig();const zg=Ys(g0);function ny(r){if(ty
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 Dy=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ry=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,l)=>l?l.toUpperCase():o.toLowerCase()),jp=r=>{const a=Ry(r);return a.charAt(0).toUpperCase()+a.slice(1)},Hg=(...r)=>r.filter((a,o,l)=>!!a&&a.trim()!==""&&l.indexOf(a)===o).join(" ").trim(),Fy=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="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 Ny={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 Ly=R.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:d="",children:f,iconNode:p,...h},g)=>R.createElement("svg",{ref:g,...Ny,width:a,height:a,stroke:r,strokeWidth:l?Number(o)*24/Number(a):o,className:Hg("lucide",d),...!f&&!Fy(h)&&{"aria-hidden":"true"},...h},[...p.map(([m,v])=>R.createElement(m,v)),...Array.isArray(f)?f:[f]]));/**
|
||||
* @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 A0=(r,a)=>{const o=R.forwardRef(({className:l,...d},f)=>R.createElement(Ly,{ref:f,iconNode:a,className:Hg(`lucide-${Dy(jp(r))}`,`lucide-${r}`,l),...d}));return o.displayName=jp(r),o};/**
|
||||
* @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 My=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Iy=A0("check",My);/**
|
||||
* @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 Oy=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jy=A0("menu",Oy);/**
|
||||
* @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 zy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vg=A0("x",zy);function Hy({health:r,config:a,onSettingsClick:o,onMenuClick:l}){const d=(r==null?void 0:r.radio_connected)??!1,[f,p]=R.useState(!1),h=async()=>{p(!0);try{const g=await et.reconnectRadio();g.connected&&xt.success("Reconnected",{description:g.message})}catch(g){xt.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return b.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&b.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:b.jsx(jy,{className:"h-5 w-5"})}),b.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),b.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[b.jsx("div",{className:`w-2 h-2 rounded-full ${d?"bg-[#4caf50]":"bg-[#666]"}`}),b.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:d?"Connected":"Disconnected"})]}),a&&b.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[b.jsx("span",{className:"text-[#e0e0e0]",children:a.name||"Unnamed"}),b.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(a.public_key),xt.success("Public key copied!")},title:"Click to copy public key",children:a.public_key.toLowerCase()})]}),!d&&b.jsx("button",{onClick:h,disabled:f,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:f?"Reconnecting...":"Reconnect"}),b.jsxs("button",{onClick:o,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[b.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const Vy=12;function Uy(r){return r.slice(0,Vy)}function Ei(r,a){return r||Uy(a)}const Xf=2,Zy={text:"🛜",background:"#444444",textColor:"#ffffff"};function Wy(r){let a=0;for(let o=0;o<r.length;o++){const l=r.charCodeAt(o);a=(a<<5)-a+l,a=a&a}return Math.abs(a)}const qy=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function Gy(r,a){if(!r)return a.slice(0,2).toUpperCase();const o=r.match(qy);if(o)return o[0];const l=r.match(/[a-zA-Z]/g);if(!l||l.length===0)return a.slice(0,2).toUpperCase();const d=r.indexOf(" ");if(d!==-1){const f=l[0],p=r.slice(d+1).match(/[a-zA-Z]/);if(p)return(f+p[0]).toUpperCase()}return l[0].toUpperCase()}function Ky(r){const a=Wy(r),o=a%360,l=50+(a>>8)%30,d=35+(a>>16)%20,f=`hsl(${o}, ${l}%, ${d}%)`,p=d<45?"#ffffff":"#000000";return{background:f,text:p}}function Qy(r,a,o){if(o===Xf)return Zy;const l=Gy(r,a),d=Ky(a);return{text:l,background:d.background,textColor:d.text}}function Jf({name:r,publicKey:a,size:o=28,contactType:l}){const d=Qy(r,a,l);return b.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:d.background,color:d.textColor,width:o,height:o,fontSize:o*.45},children:d.text})}const Ug="remoteterm-favorites";function Ko(r,a,o){return r.some(l=>l.type===a&&l.id===o)}function $y(){try{const r=localStorage.getItem(Ug);return r?JSON.parse(r):[]}catch{return[]}}function zp(){try{localStorage.removeItem(Ug)}catch{}}function Zg(r){var a,o,l="";if(typeof r=="string"||typeof r=="number")l+=r;else if(typeof r=="object")if(Array.isArray(r)){var d=r.length;for(a=0;a<d;a++)r[a]&&(o=Zg(r[a]))&&(l&&(l+=" "),l+=o)}else for(o in r)r[o]&&(l&&(l+=" "),l+=o);return l}function Wg(){for(var r,a,o=0,l="",d=arguments.length;o<d;o++)(r=arguments[o])&&(a=Zg(r))&&(l&&(l+=" "),l+=a);return l}const Yy=(r,a)=>{const o=new Array(r.length+a.length);for(let l=0;l<r.length;l++)o[l]=r[l];for(let l=0;l<a.length;l++)o[r.length+l]=a[l];return o},Xy=(r,a)=>({classGroupId:r,validator:a}),qg=(r=new Map,a=null,o)=>({nextPart:r,validators:a,classGroupId:o}),Dc="-",Hp=[],Jy="arbitrary..",e_=r=>{const a=n_(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:l}=r;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return t_(p);const h=p.split(Dc),g=h[0]===""&&h.length>1?1:0;return Gg(h,g,a)},getConflictingClassGroupIds:(p,h)=>{if(h){const g=l[p],m=o[p];return g?m?Yy(m,g):g:m||Hp}return o[p]||Hp}}},Gg=(r,a,o)=>{if(r.length-a===0)return o.classGroupId;const d=r[a],f=o.nextPart.get(d);if(f){const m=Gg(r,a+1,f);if(m)return m}const p=o.validators;if(p===null)return;const h=a===0?r.join(Dc):r.slice(a).join(Dc),g=p.length;for(let m=0;m<g;m++){const v=p[m];if(v.validator(h))return v.classGroupId}},t_=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),o=a.indexOf(":"),l=a.slice(0,o);return l?Jy+l:void 0})(),n_=r=>{const{theme:a,classGroLine truncated
|
||||
.`.concat(O1,` {
|
||||
overflow: hidden `).concat(l,`;
|
||||
padding-right: `).concat(h,"px ").concat(l,`;
|
||||
}
|
||||
body[`).concat(qs,`] {
|
||||
overflow: hidden `).concat(l,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([a&&"position: relative ".concat(l,";"),o==="margin"&&`
|
||||
padding-left: `.concat(d,`px;
|
||||
padding-top: `).concat(f,`px;
|
||||
padding-right: `).concat(p,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(h,"px ").concat(l,`;
|
||||
`),o==="padding"&&"padding-right: ".concat(h,"px ").concat(l,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(Vu,` {
|
||||
right: `).concat(h,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(Uu,` {
|
||||
margin-right: `).concat(h,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(Vu," .").concat(Vu,` {
|
||||
right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(Uu," .").concat(Uu,` {
|
||||
margin-right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
body[`).concat(qs,`] {
|
||||
`).concat(j1,": ").concat(h,`px;
|
||||
}
|
||||
`)},im=function(){var r=parseInt(document.body.getAttribute(qs)||"0",10);return isFinite(r)?r:0},iw=function(){R.useEffect(function(){return document.body.setAttribute(qs,(im()+1).toString()),function(){var r=im()-1;r<=0?document.body.removeAttribute(qs):document.body.setAttribute(qs,r.toString())}},[])},ow=function(r){var a=r.noRelative,o=r.noImportant,l=r.gapMode,d=l===void 0?"margin":l;iw();var f=R.useMemo(function(){return tw(d)},[d]);return R.createElement(nw,{styles:rw(f,!a,d,o?"":"!important")})},n0=!1;if(typeof window<"u")try{var Mu=Object.defineProperty({},"passive",{get:function(){return n0=!0,!0}});window.addEventListener("test",Mu,Mu),window.removeEventListener("test",Mu,Mu)}catch{n0=!1}var Vs=n0?{passive:!1}:!1,sw=function(r){return r.tagName==="TEXTAREA"},mA=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!sw(r)&&o[a]==="visible")},aw=function(r){return mA(r,"overflowY")},lw=function(r){return mA(r,"overflowX")},om=function(r,a){var o=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var d=gA(r,l);if(d){var f=AA(r,l),p=f[1],h=f[2];if(p>h)return!0}l=l.parentNode}while(l&&l!==o.body);return!1},uw=function(r){var a=r.scrollTop,o=r.scrollHeight,l=r.clientHeight;return[a,o,l]},cw=function(r){var a=r.scrollLeft,o=r.scrollWidth,l=r.clientWidth;return[a,o,l]},gA=function(r,a){return r==="v"?aw(a):lw(a)},AA=function(r,a){return r==="v"?uw(a):cw(a)},dw=function(r,a){return r==="h"&&a==="rtl"?-1:1},fw=function(r,a,o,l,d){var f=dw(r,window.getComputedStyle(a).direction),p=f*l,h=o.target,g=a.contains(h),m=!1,v=p>0,y=0,w=0;do{if(!h)break;var T=AA(r,h),F=T[0],k=T[1],E=T[2],D=k-E-f*F;(F||D)&&gA(r,h)&&(y+=D,w+=F);var P=h.parentNode;h=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!g&&h!==document.body||g&&(a.contains(h)||a===h));return(v&&Math.abs(y)<1||!v&&Math.abs(w)<1)&&(m=!0),m},Iu=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},sm=function(r){return[r.deltaX,r.deltaY]},am=function(r){return r&&"current"in r?r.current:r},hw=function(r,a){return r[0]===a[0]&&r[1]===a[1]},pw=function(r){return`
|
||||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||||
`)},mw=0,Us=[];function gw(r){var a=R.useRef([]),o=R.useRef([0,0]),l=R.useRef(),d=R.useState(mw++)[0],f=R.useState(pA)[0],p=R.useRef(r);R.useEffect(function(){p.current=r},[r]),R.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(d));var k=I1([r.lockRef.current],(r.shards||[]).map(am),!0).filter(Boolean);return k.forEach(function(E){return E.classList.add("allow-interactivity-".concat(d))}),function(){document.body.classList.remove("block-interactivity-".concat(d)),k.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(d))})}}},[r.inert,r.lockRef.current,r.shards]);var h=R.useCallback(function(k,E){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!p.current.allowPinchZoom;var D=Iu(k),P=o.current,S="deltaX"in k?k.deltaX:P[0]-D[0],N="deltaY"in k?k.deltaY:P[1]-D[1],M,z=k.target,H=Math.abs(S)>Math.abs(N)?"h":"v";if("touches"in k&&H==="h"&&z.type==="range")return!1;var j=window.getSelection(),J=j&&j.anchorNode,U=J?J===z||J.contains(z):!1;if(U)return!1;var Q=om(H,z);if(!Q)return!0;if(Q?M=H:(M=H==="v"?"h":"v",Q=om(H,z)),!Q)return!1;if(!l.current&&"changedTouches"in k&&(S||N)&&(l.current=M),!M)return!0;var te=l.current||M;return fw(te,E,k,te==="h"?S:N)},[]),g=R.useCallback(function(k){var E=k;if(!(!Us.length||Us[Us.length-1]!==f)){var D="deltaY"in E?sm(E):Iu(E),P=a.current.filter(function(M){return M.name===E.type&&(M.target===E.target||E.target===M.shadowParent)&&hw(M.delta,D)})[0];if(P&&P.should){E.cancelable&&E.preventDefault();return}if(!P){var S=(p.current.shards||[]).map(am).filter(Boolean).filter(function(M){return M.contains(E.target)}),N=S.length>0?h(E,S[0]):!p.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),m=R.useCallback(function(k,E,D,P){var S={name:k,delta:E,target:D,should:P,shadowParent:Aw(D)};a.current.push(S),setTimeout(function(){a.current=a.current.filter(function(N){return N!==S})},1)},[]),v=R.useCallback(function(k){o.current=Iu(k),l.current=void 0},[]),y=R.useCallback(function(k){m(k.type,sm(k),k.target,h(k,r.lockRef.current))},[]),w=R.useCallback(function(k){m(k.type,Iu(k),k.target,h(k,r.lockRef.current))},[]);R.useEffect(function(){return Us.push(f),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:w}),document.addEventListener("wheel",g,Vs),document.addEventListener("touchmove",g,Vs),document.addEventListener("touchstart",v,Vs),function(){Us=Us.filter(function(k){return k!==f}),document.removeEventListener("wheel",g,Vs),document.removeEventListener("touchmove",g,Vs),document.removeEventListener("touchstart",v,Vs)}},[]);var T=r.removeScrollBar,F=r.inert;return R.createElement(R.Fragment,null,F?R.createElement(f,{styles:pw(d)}):null,T?R.createElement(ow,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function Aw(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const xw=q1(hA,gw);var xA=R.forwardRef(function(r,a){return R.createElement(zc,Yr({},r,{ref:a,sideCar:xw}))});xA.classNames=zc.classNames;var vw=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Zs=new WeakMap,Ou=new WeakMap,ju={},Uf=0,vA=function(r){return r&&(r.host||vA(r.parentNode))},yw=function(r,a){return a.map(function(o){if(r.contains(o))return o;var l=vA(o);return l&&r.contains(l)?l:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},_w=function(r,a,o,l){var d=yw(a,Array.isArray(r)?r:[r]);ju[o]||(ju[o]=new WeakMap);var f=ju[o],p=[],h=new Set,g=new Set(d),m=function(y){!y||h.has(y)||(h.add(y),m(y.parentNode))};d.forEach(m);var v=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(w){if(h.has(w))v(w);else try{var T=w.getAttribute(l),F=T!==null&&T!=="false",k=(Zs.get(w)||0)+1,E=(f.get(w)||0)+1;Zs.set(w,k),f.set(w,E),p.push(w),k===1&&F&&Ou.set(w,!0),E===1&&w.setAttribute(o,"true"),F||w.setAttribute(l,"true")}catch(D){console.error("aria-hidden: cannot operate on ",w,D)}})};return v(a),h.clear(),Uf++,function(){p.forEach(function(y){var w=Zs.get(y)-1,T=f.get(y)-1;Zs.set(y,w),f.set(y,T),w||(Ou.has(y)||y.removeAttribute(l),Ou.delete(y)),T||y.removeAttribute(o)}),Uf--,Uf||(Zs=new WeakMap,Zs=new WeakMap,Ou=new WeakMap,ju={})}},ww=function(r,a,o){o===void 0&&(o="data-aria-hidden");var l=Array.from(Array.isArray(r)?r:[r]),d=vw(r);return d?(l.push.apply(l,Array.from(d.querySelectorAll("[aria-live], script"))),_w(l,d,o,"aria-hidden")):function(){return null}};function bw(r){const a=Cw(r),o=R.forwardRef((l,d)=>{const{children:f,...p}=l,h=R.Children.toArray(f),g=h.find(kw);if(g){const m=g.props.children,v=h.map(y=>y===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:y);return b.jsx(a,{...p,ref:d,children:R.isValidElement(m)?R.cloneElement(m,void 0,v):null})}return b.jsx(a,{...p,ref:d,children:f})});return o.displayName=`${r}.Slot`,o}function Cw(r){const a=R.forwardRef((o,l)=>{const{childre
Line truncated
|
||||
|
||||
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return R.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},Iw="DialogDescriptionWarning",Ow=({contentRef:r,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${NA(Iw).contentName}}.`;return R.useEffect(()=>{var f;const d=(f=r.current)==null?void 0:f.getAttribute("aria-describedby");a&&d&&(document.getElementById(a)||console.warn(l))},[l,r,a]),null},LA=_A,MA=CA,Vc=EA,Uc=kA,Zc=BA,Wc=TA,IA=RA;const C0=LA,jw=MA,OA=R.forwardRef(({className:r,...a},o)=>b.jsx(Vc,{ref:o,className:ut("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),...a}));OA.displayName=Vc.displayName;const qc=R.forwardRef(({className:r,children:a,...o},l)=>b.jsxs(jw,{children:[b.jsx(OA,{}),b.jsxs(Uc,{ref:l,className:ut("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),...o,children:[a,b.jsxs(IA,{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:[b.jsx(Vg,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qc.displayName=Uc.displayName;const Gc=({className:r,...a})=>b.jsx("div",{className:ut("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});Gc.displayName="DialogHeader";const E0=({className:r,...a})=>b.jsx("div",{className:ut("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});E0.displayName="DialogFooter";const Kc=R.forwardRef(({className:r,...a},o)=>b.jsx(Zc,{ref:o,className:ut("text-lg font-semibold leading-none tracking-tight",r),...a}));Kc.displayName=Zc.displayName;const Qc=R.forwardRef(({className:r,...a},o)=>b.jsx(Wc,{ref:o,className:ut("text-sm text-muted-foreground",r),...a}));Qc.displayName=Wc.displayName;function zw(){const r=window.location.hash.slice(1);if(!r)return null;if(r==="raw")return{type:"raw",name:"raw"};if(r==="map")return{type:"map",name:"map"};if(r.startsWith("map/focus/")){const d=r.slice(10);return d?{type:"map",name:"map",mapFocusKey:decodeURIComponent(d)}:{type:"map",name:"map"}}const a=r.indexOf("/");if(a===-1)return null;const o=r.slice(0,a),l=decodeURIComponent(r.slice(a+1));return(o==="channel"||o==="contact")&&l?{type:o,name:l}:null}function jA(r){return`#map/focus/${encodeURIComponent(r)}`}function Hw(r){if(!r)return"";if(r.type==="raw")return"#raw";if(r.type==="map")return"#map";const a=r.type==="channel"&&r.name.startsWith("#")?r.name.slice(1):r.name;return`#${r.type}/${encodeURIComponent(a)}`}function Vw(r){const a=Hw(r);a!==window.location.hash&&window.history.replaceState(null,"",a||window.location.pathname)}function Uw({open:r,onClose:a,paths:o,senderInfo:l,contacts:d,config:f}){const p=o.map(g=>({...g,resolved:e1(g.path,l,d,f)})),h=o.length===1;return b.jsx(C0,{open:r,onOpenChange:g=>!g&&a(),children:b.jsxs(qc,{className:"max-w-md max-h-[80vh] flex flex-col",children:[b.jsxs(Gc,{children:[b.jsxs(Kc,{children:["Message Path",!h&&`s (${o.length})`]}),b.jsx(Qc,{children:h?b.jsxs(b.Fragment,{children:["This shows ",b.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):b.jsxs(b.Fragment,{children:["This message was received via ",b.jsxs("strong",{children:[o.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[p.map((g,m)=>b.jsxs("div",{children:[!h&&b.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",m+1," — received ",Ks(g.received_at)]}),b.jsx(Zw,{resolved:g.resolved,senderInfo:l,hideStraightLine:!h})]},m)),!h&&p.length>0&&(()=>{const g=p[0].resolved;return St(g.sender.lat,g.sender.lon)&&St(g.receiver.lat,g.receiver.lon)?b.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[b.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),b.jsx("span",{className:"text-sm font-medium",children:Qo(Fr(g.sender.lat,g.sender.lon,g.receiver.lat,g.receiver.lon))})]}):null})()]}),b.jsx(E0,{children:b
Line truncated
|
||||
`).map((Y,ce,fe)=>b.jsxs("span",{children:[Gw(Y,h),ce<fe.length-1&&b.jsx("br",{})]},ce)),!he&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Ks(j.sender_timestamp||j.received_at)}),!j.outgoing&&j.paths&&j.paths.length>0&&b.jsx(um,{paths:j.paths,variant:"inline",onClick:()=>k({paths:j.paths,senderInfo:M(j,U,te)})})]}),j.outgoing&&(j.acked>0?` ✓${j.acked>1?j.acked:""}`:" ?")]})]})]},j.id)})]}),w&&b.jsx("button",{onClick:P,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:b.jsx("polyline",{points:"6 9 12 15 18 9"})})}),F&&b.jsx(Uw,{open:!0,onClose:()=>k(null),paths:F.paths,senderInfo:F.senderInfo,contacts:a,config:g??null})]})}const cm=156,Qw=140,$w=156,Yw=120,Xw=8,Jw=R.forwardRef(function({onSend:a,disabled:o,placeholder:l,isRepeaterMode:d,conversationType:f,senderName:p},h){const[g,m]=R.useState(""),[v,y]=R.useState(!1),w=R.useRef(null);R.useImperativeHandle(h,()=>({appendText:M=>{var z;m(H=>H+M),(z=w.current)==null||z.focus()}}));const T=R.useMemo(()=>{if(f==="contact")return{warningAt:Qw,dangerAt:cm,hardLimit:cm};if(f==="channel"){const M=(p==null?void 0:p.length)??10,z=Math.max(1,$w-M-2);return{warningAt:Yw,dangerAt:Math.max(1,z-Xw),hardLimit:z}}return null},[f,p]),{limitState:F,warningMessage:k}=R.useMemo(()=>{if(!T)return{limitState:"normal",warningMessage:null};const M=g.length;return M>=T.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:M>=T.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:M>=T.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[g.length,T]),E=T?T.hardLimit-g.length:0,D=R.useCallback(async M=>{M.preventDefault();const z=g.trim();if(d){if(v||o)return;y(!0);try{await a(z),m("")}catch(H){console.error("Failed to request telemetry:",H),xt.error("Failed to request telemetry",{description:H instanceof Error?H.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var H;return(H=w.current)==null?void 0:H.focus()},0)}else{if(!z||v||o)return;y(!0);try{await a(z),m("")}catch(H){console.error("Failed to send message:",H),xt.error("Failed to send message",{description:H instanceof Error?H.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var H;return(H=w.current)==null?void 0:H.focus()},0)}},[g,v,o,a,d]),P=R.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),D(M))},[D]),S=d?!0:g.trim().length>0,N=!d&&T!==null;return b.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:D,children:[b.jsxs("div",{className:"flex gap-2",children:[b.jsx(tn,{ref:w,type:d?"password":"text",autoComplete:d?"off":void 0,value:g,onChange:M=>m(M.target.value),onKeyDown:P,placeholder:l||(d?"Enter password for admin login...":"Type a message..."),disabled:o||v,className:"flex-1 min-w-0"}),b.jsx(yn,{type:"submit",disabled:o||v||!S,className:"flex-shrink-0",children:v?d?"Logging in...":"Sending...":d?g.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),N&&b.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[b.jsxs("span",{className:ut("tabular-nums",F==="error"||F==="danger"?"text-red-500 font-medium":F==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",T.hardLimit,E<0&&` (${E})`]}),k&&b.jsxs("span",{className:ut(F==="error"?"text-red-500":"text-yellow-500"),children:["— ",k]})]})]})});function dm(r){const a=e2(r),o=R.forwardRef((l,d)=>{const{children:f,...p}=l,h=R.Children.toArray(f),g=h.find(n2);if(g){const m=g.props.children,v=h.map(y=>y===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:y);return b.jsx(a,{...p,ref:d,children:R.isValidElement(m)?R.cloneElement(m,void 0,v):null})}return b.jsx(a,{...p,ref:d,children:f})});return o.displayName=`${r}.Slot`,o}function e2(r){const a=R.forwardRef((o,l)=>{const{children:d,...f}=o;if(R.isValidElement(d)){const p=i2(d),h=r2(f,d.props);return d.type!==R.Fragment&&(h.ref=l?dl(l,p):p),R.cloneElement(d,h)}return R.Children.count(d)>1?R.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var t2=Symbol("radix.slottable");function n2(r){return R.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===t2}function r2(r,a){const o={...a};for(const l in a){const d=r[l],f=a[l];/^on[A-Z]/.test(l)?d&&f?o[l]=(...h)=>{const g=f(...h);return d(...h),g}:d&&(o[l]=d):l==="style"?o[l]={...d,...f}:l==="className"&&(o[l]=[d,f].filter(Boolean).join(" "))}return{...r,...o}}functio
Line truncated
|
||||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/var Y2=ol.exports,pm;function X2(){return pm||(pm=1,(function(r,a){(function(o,l){l(a)})(Y2,(function(o){var l="1.9.4";function d(t){var i,u,A,C;for(u=1,A=arguments.length;u<A;u++){C=arguments[u];for(i in C)t[i]=C[i]}return t}var f=Object.create||(function(){function t(){}return function(i){return t.prototype=i,new t}})();function p(t,i){var u=Array.prototype.slice;if(t.bind)return t.bind.apply(t,u.call(arguments,1));var A=u.call(arguments,2);return function(){return t.apply(i,A.length?A.concat(u.call(arguments)):arguments)}}var h=0;function g(t){return"_leaflet_id"in t||(t._leaflet_id=++h),t._leaflet_id}function m(t,i,u){var A,C,O,$;return $=function(){A=!1,C&&(O.apply(u,C),C=!1)},O=function(){A?C=arguments:(t.apply(u,arguments),setTimeout($,i),A=!0)},O}function v(t,i,u){var A=i[1],C=i[0],O=A-C;return t===A&&u?t:((t-C)%O+O)%O+C}function y(){return!1}function w(t,i){if(i===!1)return t;var u=Math.pow(10,i===void 0?6:i);return Math.round(t*u)/u}function T(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return T(t).split(/\s+/)}function k(t,i){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?f(t.options):{});for(var u in i)t.options[u]=i[u];return t.options}function E(t,i,u){var A=[];for(var C in t)A.push(encodeURIComponent(u?C.toUpperCase():C)+"="+encodeURIComponent(t[C]));return(!i||i.indexOf("?")===-1?"?":"&")+A.join("&")}var D=/\{ *([\w_ -]+) *\}/g;function P(t,i){return t.replace(D,function(u,A){var C=i[A];if(C===void 0)throw new Error("No value provided for variable "+u);return typeof C=="function"&&(C=C(i)),C})}var S=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function N(t,i){for(var u=0;u<t.length;u++)if(t[u]===i)return u;return-1}var M="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function z(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var H=0;function j(t){var i=+new Date,u=Math.max(0,16-(i-H));return H=i+u,window.setTimeout(t,u)}var J=window.requestAnimationFrame||z("RequestAnimationFrame")||j,U=window.cancelAnimationFrame||z("CancelAnimationFrame")||z("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function Q(t,i,u){if(u&&J===j)t.call(i);else return J.call(window,p(t,i))}function te(t){t&&U.call(window,t)}var G={__proto__:null,extend:d,create:f,bind:p,get lastId(){return h},stamp:g,throttle:m,wrapNum:v,falseFn:y,formatNum:w,trim:T,splitWords:F,setOptions:k,getParamString:E,template:P,isArray:S,indexOf:N,emptyImageUrl:M,requestFn:J,cancelFn:U,requestAnimFrame:Q,cancelAnimFrame:te};function re(){}re.extend=function(t){var i=function(){k(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=i.__super__=this.prototype,A=f(u);A.constructor=i,i.prototype=A;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(i[C]=this[C]);return t.statics&&d(i,t.statics),t.includes&&(de(t.includes),d.apply(null,[A].concat(t.includes))),d(A,t),delete A.statics,delete A.includes,A.options&&(A.options=u.options?f(u.options):{},d(A.options,t.options)),A._initHooks=[],A.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var O=0,$=A._initHooks.length;O<$;O++)A._initHooks[O].call(this)}},i},re.include=function(t){var i=this.prototype.options;return d(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},re.mergeOptions=function(t){return d(this.prototype.options,t),this},re.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),u=typeof t=="function"?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function de(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=S(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var ie={on:function(t,i,u){if(typeof t=="object")for(var A in t)this._on(A,t[A],i);else{t=F(t);for(var C=0,O=t.length;C<O;C++)this._on(t[C],i,u)}return this},off:function(t,i,u){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var A in t)this._off(A,t[A],i);else{t=F(t);for(var C=arguments.length===1,O=0,$=t.length;O<$;O++)C?this._off(t[O]):this._off(t[O],i,u)}return this},_on:function(t,i,u,A){if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}if(this._listens(t,i,u)===!1){u===this&&(u=void 0);var C={fn:i,ctx:u};A&&(C.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(C)}},_off:function(t,i,u){var A,C,O;if(this._events&&(A=this._events[t],!!A)){if(arguments.length===1){if(this._firingCount)for(C=0,O=A.length;C<O;C++)A[C].fn=y;delete this._events[t];return}if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}var $=this.Line truncated
|
||||
(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.
|
||||
*/return(function(l){var d=o,f=d.lib,p=f.WordArray,h=f.Hasher,g=d.algo,m=p.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),v=p.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),y=p.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),w=p.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),T=p.create([0,1518500249,1859775393,2400959708,2840853838]),F=p.create([1352829926,1548603684,1836072691,2053994217,0]),k=g.RIPEMD160=h.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(z,H){for(var j=0;j<16;j++){var J=H+j,U=z[J];z[J]=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360}var Q=this._hash.words,te=T.words,G=F.words,re=m.words,de=v.words,ie=y.words,pe=w.words,q,he,Z,B,V,K,Y,ce,fe,we;K=q=Q[0],Y=he=Q[1],ce=Z=Q[2],fe=B=Q[3],we=V=Q[4];for(var Ae,j=0;j<80;j+=1)Ae=q+z[H+re[j]]|0,j<16?Ae+=E(he,Z,B)+te[0]:j<32?Ae+=D(he,Z,B)+te[1]:j<48?Ae+=P(he,Z,B)+te[2]:j<64?Ae+=S(he,Z,B)+te[3]:Ae+=N(he,Z,B)+te[4],Ae=Ae|0,Ae=M(Ae,ie[j]),Ae=Ae+V|0,q=V,V=B,B=M(Z,10),Z=he,he=Ae,Ae=K+z[H+de[j]]|0,j<16?Ae+=N(Y,ce,fe)+G[0]:j<32?Ae+=S(Y,ce,fe)+G[1]:j<48?Ae+=P(Y,ce,fe)+G[2]:j<64?Ae+=D(Y,ce,fe)+G[3]:Ae+=E(Y,ce,fe)+G[4],Ae=Ae|0,Ae=M(Ae,pe[j]),Ae=Ae+we|0,K=we,we=fe,fe=M(ce,10),ce=Y,Y=Ae;Ae=Q[1]+Z+fe|0,Q[1]=Q[2]+B+we|0,Q[2]=Q[3]+V+K|0,Q[3]=Q[4]+q+Y|0,Q[4]=Q[0]+he+ce|0,Q[0]=Ae},_doFinalize:function(){var z=this._data,H=z.words,j=this._nDataBytes*8,J=z.sigBytes*8;H[J>>>5]|=128<<24-J%32,H[(J+64>>>9<<4)+14]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360,z.sigBytes=(H.length+1)*4,this._process();for(var U=this._hash,Q=U.words,te=0;te<5;te++){var G=Q[te];Q[te]=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360}return U},clone:function(){var z=h.clone.call(this);return z._hash=this._hash.clone(),z}});function E(z,H,j){return z^H^j}function D(z,H,j){return z&H|~z&j}function P(z,H,j){return(z|~H)^j}function S(z,H,j){return z&j|H&~j}function N(z,H,j){return z^(H|~j)}function M(z,H){return z<<H|z>>>32-H}d.RIPEMD160=h._createHelper(k),d.HmacRIPEMD160=h._createHmacHelper(k)})(),o.RIPEMD160})})(ic)),ic.exports}var oc={exports:{}},Hb=oc.exports,Fm;function nd(){return Fm||(Fm=1,(function(r,a){(function(o,l){r.exports=l(At())})(Hb,function(o){(function(){var l=o,d=l.lib,f=d.Base,p=l.enc,h=p.Utf8,g=l.algo;g.HMAC=f.extend({init:function(m,v){m=this._hasher=new m.init,typeof v=="string"&&(v=h.parse(v));var y=m.blockSize,w=y*4;v.sigBytes>w&&(v=m.finalize(v)),v.clamp();for(var T=this._oKey=v.clone(),F=this._iKey=v.clone(),k=T.words,E=F.words,D=0;D<y;D++)k[D]^=1549556828,E[D]^=909522486;T.sigBytes=F.sigBytes=w,this.reset()},reset:function(){var m=this._hasher;m.reset(),m.update(this._iKey)},update:function(m){return this._hasher.update(m),this},finalize:function(m){var v=this._hasher,y=v.finalize(m);v.reset();var w=v.finalize(this._oKey.clone().concat(y));return w}})})()})})(oc)),oc.exports}var sc={exports:{}},Vb=sc.exports,Nm;function Ub(){return Nm||(Nm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),pl(),nd())})(Vb,function(o){return(function(){var l=o,d=l.lib,f=d.Base,p=d.WordArray,h=l.algo,g=h.SHA256,m=h.HMAC,v=h.PBKDF2=f.extend({cfg:f.extend({keySize:128/32,hasher:g,iterations:25e4}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,w){for(var T=this.cfg,F=m.create(T.hasher,y),k=p.create(),E=p.create([1]),D=k.words,P=E.words,S=T.keySize,N=T.iterations;D.length<S;){var M=F.update(w).finalize(E);F.reset();for(var z=M.words,H=z.length,j=M,J=1;J<N;J++){j=F.finalize(j),F.reset();for(var U=j.words,Q=0;Q<H;Q++)z[Q]^=U[Q]}k.concat(M),P[0]++}return k.sigBytes=S*4,k}});l.PBKDF2=function(y,w,T){return v.create(T).compute(y,w)}})(),o.PBKDF2})})(sc)),sc.exports}var ac={exports:{}},Zb=ac.exports,Lm;function fo(){return Lm||(Lm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),bx(),nd())})(Zb,function(o){return(function(){var l=o,d=l.lib,f=d.Base,p=d.WordArray,h=l.algo,g=h.MD5,m=h.EvpKDF=f.extend({cfg:f.extend({keySize:128/32,hasher:g,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,y){for(var w,T=this.cfg,F=T.hasher.create(),k=p.create(),E=k.words,D=T.keySize,P=T.iterations;E.length<D;){w&&F.update(w),w=F.update(v).finalize(y),F.reset();for(var S=1;S<P;S++)w=F.finalize(w),F.reset();k.concat(w)}return k.sigBytes=D*4,k}});l.EvpKDF=function(v,y,w){return m.create(w).compute(v,y)}})(),o.EvpKDF})})(ac)),ac.exports}var lc={exports:{}},Wb=lc.exports,Line truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return o.mode.CTRGladman=(function(){var l=o.lib.BlockCipherMode.extend();function d(h){if((h>>24&255)===255){var g=h>>16&255,m=h>>8&255,v=h&255;g===255?(g=0,m===255?(m=0,v===255?v=0:++v):++m):++g,h=0,h+=g<<16,h+=m<<8,h+=v}else h+=1<<24;return h}function f(h){return(h[0]=d(h[0]))===0&&(h[1]=d(h[1])),h}var p=l.Encryptor=l.extend({processBlock:function(h,g){var m=this._cipher,v=m.blockSize,y=this._iv,w=this._counter;y&&(w=this._counter=y.slice(0),this._iv=void 0),f(w);var T=w.slice(0);m.encryptBlock(T,0);for(var F=0;F<v;F++)h[g+F]^=T[F]}});return l.Decryptor=p,l})(),o.mode.CTRGladman})})(dc)),dc.exports}var fc={exports:{}},Xb=fc.exports,zm;function Jb(){return zm||(zm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(Xb,function(o){return o.mode.OFB=(function(){var l=o.lib.BlockCipherMode.extend(),d=l.Encryptor=l.extend({processBlock:function(f,p){var h=this._cipher,g=h.blockSize,m=this._iv,v=this._keystream;m&&(v=this._keystream=m.slice(0),this._iv=void 0),h.encryptBlock(v,0);for(var y=0;y<g;y++)f[p+y]^=v[y]}});return l.Decryptor=d,l})(),o.mode.OFB})})(fc)),fc.exports}var hc={exports:{}},eC=hc.exports,Hm;function tC(){return Hm||(Hm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(eC,function(o){return o.mode.ECB=(function(){var l=o.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(d,f){this._cipher.encryptBlock(d,f)}}),l.Decryptor=l.extend({processBlock:function(d,f){this._cipher.decryptBlock(d,f)}}),l})(),o.mode.ECB})})(hc)),hc.exports}var pc={exports:{}},nC=pc.exports,Vm;function rC(){return Vm||(Vm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(nC,function(o){return o.pad.AnsiX923={pad:function(l,d){var f=l.sigBytes,p=d*4,h=p-f%p,g=f+h-1;l.clamp(),l.words[g>>>2]|=h<<24-g%4*8,l.sigBytes+=h},unpad:function(l){var d=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=d}},o.pad.Ansix923})})(pc)),pc.exports}var mc={exports:{}},iC=mc.exports,Um;function oC(){return Um||(Um=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(iC,function(o){return o.pad.Iso10126={pad:function(l,d){var f=d*4,p=f-l.sigBytes%f;l.concat(o.lib.WordArray.random(p-1)).concat(o.lib.WordArray.create([p<<24],1))},unpad:function(l){var d=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=d}},o.pad.Iso10126})})(mc)),mc.exports}var gc={exports:{}},sC=gc.exports,Zm;function aC(){return Zm||(Zm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(sC,function(o){return o.pad.Iso97971={pad:function(l,d){l.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(l,d)},unpad:function(l){o.pad.ZeroPadding.unpad(l),l.sigBytes--}},o.pad.Iso97971})})(gc)),gc.exports}var Ac={exports:{}},lC=Ac.exports,Wm;function uC(){return Wm||(Wm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(lC,function(o){return o.pad.ZeroPadding={pad:function(l,d){var f=d*4;l.clamp(),l.sigBytes+=f-(l.sigBytes%f||f)},unpad:function(l){for(var d=l.words,f=l.sigBytes-1,f=l.sigBytes-1;f>=0;f--)if(d[f>>>2]>>>24-f%4*8&255){l.sigBytes=f+1;break}}},o.pad.ZeroPadding})})(Ac)),Ac.exports}var xc={exports:{}},cC=xc.exports,qm;function dC(){return qm||(qm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(cC,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(xc)),xc.exports}var vc={exports:{}},fC=vc.exports,Gm;function hC(){return Gm||(Gm=1,(function(r,a){(function(o,l,d){r.exports=l(At(),gn())})(fC,function(o){return(function(l){var d=o,f=d.lib,p=f.CipherParams,h=d.enc,g=h.Hex,m=d.format;m.Hex={stringify:function(v){return v.ciphertext.toString(g)},parse:function(v){var y=g.parse(v);return p.create({ciphertext:y})}}})(),o.format.Hex})})(vc)),vc.exports}var yc={exports:{}},pC=yc.exports,Km;function mC(){return Km||(Km=1,(function(r,a){(function(o,l,d){r.exports=l(At(),Xo(),Jo(),fo(),gn())})(pC,function(o){return(function(){var l=o,d=l.lib,f=d.BlockCipher,p=l.algo,h=[],g=[],m=[],v=[],y=[],w=[],T=[],F=[],k=[],E=[];(function(){for(var S=[],N=0;N<256;N++)N<128?S[N]=N<<1:S[N]=N<<1^283;for(var M=0,z=0,N=0;N<256;N++){var H=z^z<<1^z<<2^z<<3^z<<4;H=H>>>8^H&255^99,h[M]=H,g[H]=M;var j=S[M],J=S[j],U=S[J],Q=S[H]*257^H*16843008;m[M]=Q<<24|Q>>>8,v[M]=Q<<16|Q>>>16,y[M]=Q<<8|Q>>>24,w[M]=Q;var Q=U*16843009^J*65537^j*257^M*16843008;T[H]=Q<<24|Q>>>8,F[H]=Q<<16|Q>>>16,k[H]=Q<<8|Q>>>24,E[H]=Q,M?(M=j^S[S[S[U^j]]],z^=S[S[z]]):M=z=1}})();var D=[0,1,2,4,8,16,32,64,128,27,54],P=p.AES=f.extend({_doReset:function(){var S;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var N=this._keyPriorReset=this._key,M=N.words,z=N.sigBytes/4,H=this._nRounds=z+6,j=(H+1)*4,J=this._keySchedule=[],U=0;U<j;U++)U<z?J[U]=M[U]:(S=J[U-1],U%z?z>6&&U%z==4&&(S=h[S>>>24]<<24|h[S>>>16&255]<<16|h[S>>>8&255]<<8|h[S&255]):(S=S<<8|S>>>24,S=h[S>>>24]<<24|h[S>>>16&255]<<16|h[S>>>8&255]<<8|h[S&255],S^=D[U/z|0]<<24),J[U]=J[U-z]^S);for(var Q=this._invKeySchedule=[],te=0;te<j;te++){var U=j-te;if(te%4)var S=J[U];else var S=J[U-4];te<4||U<=4?Q[te]=S:Q[te]=T[h[S>>>24]]^F[h[S>>>16&255]]^k[h[S>>>8&255]]^E[h[S&255]]}}},encryLine 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:h+g,endByte:h+d.length-1,value:w});const T={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:m,sourceHash:v,cipherMac:y,ciphertext:w};return f!=null&&f.includeSegments&&(T.segments=p),T}catch(p){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Xa.RequestPayloadDecoder=o,Xa}var Ja={},Ag;function YC(){if(Ag)return Ja;Ag=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.ResponsePayloadDecoder=void 0;const r=sr(),a=_n();class o{static decode(d,f){try{if(d.length<4){const F={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return f!=null&&f.includeSegments&&(F.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:f.segmentOffset||0,endByte:(f.segmentOffset||0)+d.length-1,value:(0,a.bytesToHex)(d)}]),F}const p=[],h=(f==null?void 0:f.segmentOffset)||0;let g=0;const m=(0,a.byteToHex)(d[g]);f!=null&&f.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+g,endByte:h+g,value:m}),g+=1;const v=(0,a.byteToHex)(d[g]);f!=null&&f.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+g,endByte:h+g,value:v}),g+=1;const y=(0,a.bytesToHex)(d.subarray(g,g+2));f!=null&&f.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+g,endByte:h+g+1,value:y}),g+=2;const w=(0,a.bytesToHex)(d.subarray(g));f!=null&&f.includeSegments&&d.length>g&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:h+g,endByte:h+d.length-1,value:w});const T={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:v,cipherMac:y,ciphertext:w,ciphertextLength:d.length-4};return f!=null&&f.includeSegments&&(T.segments=p),T}catch(p){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ja.ResponsePayloadDecoder=o,Ja}var el={},xg;function XC(){if(xg)return el;xg=1,Object.defineProperty(el,"__esModule",{value:!0}),el.AnonRequestPayloadDecoder=void 0;const r=sr(),a=_n();class o{static decode(d,f){try{if(d.length<35){const F={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return f!=null&&f.includeSegments&&(F.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:f.segmentOffset||0,endByte:(f.segmentOffset||0)+d.length-1,value:(0,a.bytesToHex)(d)}]),F}const p=[],h=(f==null?void 0:f.segmentOffset)||0;let g=0;const m=(0,a.byteToHex)(d[0]);f!=null&&f.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${m}`,startByte:h+g,endByte:h+g,value:m}),g+=1;const v=(0,a.bytesToHex)(d.subarray(1,33));f!=null&&f.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:h+g,endByte:h+g+31,value:v}),g+=32;const y=(0,a.bytesToHex)(d.subarray(33,35));f!=null&&f.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:h+g,endByte:h+g+1,value:y}),g+=2;const w=(0,a.bytesToHex)(d.subarray(35));f!=null&&f.includeSegments&&d.length>35&&p.push({name:"Ciphertext",description:`Encrypted message data (${d.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:h+g,endByte:h+d.length-1,value:w});const T={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:v,cipherMac:y,ciphertext:w,ciphertextLength:d.length-35};return f!=null&&f.includeSegments&&(T.segments=p),T}catch(p){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return el.AnonRequestPayloadDecoder=o,el}var tl={},vg;function JC(){if(vg)return tl;vg=1,Object.defineProperty(tl,"__esModule",{value:!0}),tl.AckPayloadDecoder=void 0;const r=sr(),a=_n();class o{static decode(d,f){try{if(d.length<4){const v={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return f!=null&&f.includeSegments&&(v.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:f.segmentOffset||0,endByte:(f.segmentOffset||0)+d.length-1,value:(0,a.bytesToHex)(d)}]),v}const p=[],h=(f==null?void 0:f.segmentOffset)||0,g=(0,a.bytesToHex)(d.subarray(0,4));f!=null&&f.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${g}`,startByte:h,endByte:h+3,value:g}),f!=null&&f.includeSegments&&d.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:h+4,endByte:h+d.length-1,value:(0,a.bytesToHex)(d.subarray(4))});const m={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:g};return f!=null&&f.includeSegments&&(m.segments=p),m}catch(p){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}}return tl.AckPayloadDecoder=o,tl}var nl={},yg;function eE(){if(yg)return nl;yg=1,Object.defineProperty(nl,"__esModule",{value:!0}),nl.PathPayloadDecoder=void 0;const r=sr(),a=_n();class o{static decode(d){try{if(d.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const f=d[0];if(d.length<1+f+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+f+1} bytes for path length + path + extra type)`],pathLength:f,pathHashes:[],extraType:0,extraData:""};const p=[];for(let m=0;m<f;m++)p.push((0,a.byteToHex)(d[1+m]));const h=d[1+f];let g="";return d.length>1+f+1&&(g=(0,a.bytesToHex)(d.subarray(1+f+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:f,pathHashes:p,extraType:h,extraData:g}}catch(f){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[f instanceof Error?f.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return nl.PathPayloadDecoder=o,nl}var rl={},_g;function tE(){if(_g)return rl;_g=1,Object.defineProperty(rl,"__esModule",{value:!0}),rl.TextMessagePayloadDecoder=void 0;const r=sr(),a=_n();class o{static decode(d,f){try{if(d.length<4){const F={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return f!=null&&f.includeSegments&&(F.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:f.segmentOffset||0,endByte:(f.segmentOffset||0)+d.length-1,value:(0,a.bytesToHex)(d)}]),F}const p=[],h=(f==null?void 0:f.segmentOffset)||0;let g=0;const m=(0,a.byteToHex)(d[g]);f!=null&&f.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+g,endByte:h+g,value:m}),g+=1;const v=(0,a.byteToHex)(d[g]);f!=null&&f.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+g,endByte:h+g,value:v}),g+=1;const y=(0,a.bytesToHex)(d.subarray(g,g+2));f!=null&&f.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+g,endByte:h+g+1,value:y}),g+=2;const w=(0,a.bytesToHex)(d.subarray(g));f!=null&&f.includeSegments&&d.length>g&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:h+g,endByte:h+d.length-1,value:w});const T={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:v,cipherMac:y,ciphertext:w,ciphertextLength:d.length-4};return f!=null&&f.includeSegments&&(T.segments=p),T}catch(p){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i
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 32 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 32u;
|
||||
|
||||
@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 a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.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 d=0;d<2;d++)this.matchCountReadBuffers[d]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[d]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return Go(o,a)}countNamesForLength(a){return sl(a)}async runBatch(a,o,l,d,f,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 h=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const g=this.matchCountReadBuffers[h],m=this.matchIndicesReadBuffers[h],v=f&&p?1:0;let y,w=0,T=0;if(v){const M=new Uint8Array(f.length/2);for(let U=0;U<M.length;U++)M[U]=parseInt(f.substr(U*2,2),16);w=M.length*8;const z=Math.ceil(M.length/4)*4,H=new Uint8Array(z);H.set(M),y=new Uint32Array(z/4);for(let U=0;U<y.length;U++)y[U]=H[U*4]<<24|H[U*4+1]<<16|H[U*4+2]<<8|H[U*4+3];const j=parseInt(p.substr(0,2),16),J=parseInt(p.substr(2,2),16);T=j<<24|J<<16}else y=new Uint32Array([0]);const F=Math.max(y.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<F)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:F,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=F,this.bindGroupDirty=!0);const k=new Uint32Array([a,l,o,d,T,y.length,w,v]);this.device.queue.writeBuffer(this.paramsBuffer,0,k),this.device.queue.writeBuffer(this.ciphertextBuffer,0,y),this.device.queue.writeBuffer(this.matchCountBuffer,0,id.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 E=this.device.createCommandEncoder(),D=E.beginComputePass();D.setPipeline(this.pipeline),D.setBindGroup(0,this.bindGroup),D.dispatchWorkgroups(Math.ceil(d/(256*32))),D.end(),E.copyBufferToBuffer(this.matchCountBuffer,0,g,0,4),E.copyBufferToBuffer(this.matchIndicesBuffer,0,m,0,1024*4),this.device.queue.submit([E.finish()]),await g.mapAsync(GPUMapMode.READ);const S=new Uint32Array(g.getMappedRange())[0];g.unmap();const N=[];if(S>0){await m.mapAsync(GPUMapMode.READ);const M=new Uint32Array(m.getMappedRange());for(let z=0;z<Math.min(S,1024);z++)N.push(M[z]);m.unmap()}return N}destroy(){var a,o,l,d,f,p,h,g;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(d=this.ciphertextBuffer)==null||d.destroy(),(f=this.matchCountReadBuffers[0])==null||f.destroy(),(p=this.matchCountReadBuffers[1])==null||p.destroy(),(h=this.matchIndicesReadBuffers[0])==null||h.destroy(),(g=this.matchIndicesReadBuffers[1])==null||g.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}}id.ZERO_DATA=new Uint32Array([0]);function mE(){return typeof navigator<"u"&&"gpu"in navigator}class Dg{runBatch(a,o,l,d,f,p){const h=[],g=a.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(f=>f.trim().toLowerCase()).filter(f=>f.length>0);this.wordlist=d.filter(Rg)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(Rg)}abort(){this.abortFlag=!0}isGpuAvailable(){return mE()}async decodePacket(a){var l;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const f=(l=(await Bg.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:l.decoded;return!(f!=null&&f.channelHash)||!(f!=null&&f.ciphertext)||!(f!=null&&f.cipherMac)?null:{channelHash:f.channelHash,ciphertext:f.ciphertext,cipherMac:f.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,l){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.useSenderFilter=(o==null?void 0:o.useSenderFilter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??c0,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const d=(o==null?void 0:o.maxLength)??8,f=(o==null?void 0:o.startingLength)??1,p=(o==null?void 0:o.useDictionary)??!0,h=(o==null?void 0:o.startFromType)??"bruteforce",g=a.toLowerCase(),m=await this.decodePacket(g);if(!m)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:v,ciphertext:y,cipherMac:w}=m,T=parseInt(v,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new Dg):this.gpuInstance||(this.gpuInstance=new id,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new Dg));const F=performance.now();let k=0,E=performance.now(),D=f,P=0,S=0,N=!1;if(o!=null&&o.startFrom){const G=o.startFrom.toLowerCase();if(h==="dictionary"){const re=this.wordlist.indexOf(G);re>=0&&(S=re+1)}else{N=!0;const re=fE(G);re&&(D=Math.max(f,re.length),P=re.index+1,P>=sl(D)&&(D++,P=0))}}let M=0;p&&!N&&this.wordlist.length>0&&(M+=this.wordlist.length-S);for(let G=D;G<=d;G++)M+=sl(G);M-=P;const z=(G,re,de)=>{if(!l)return;const pe=(performance.now()-F)/1e3,q=pe>0?Math.round(k/pe):0,he=M-k,Z=q>0?he/q:0;l({checked:k,total:M,percent:M>0?Math.min(100,k/M*100):0,rateKeysPerSec:q,etaSeconds:Z,elapsedSeconds:pe,currentLength:re,currentPosition:de,phase:G})},H=G=>{if(!Wx(y,w,G))return{valid:!1};const re=Bg.ChannelCrypto.decryptGroupTextMessage(y,w,G);return!re.success||!re.data?{valid:!1}:this.useTimestampFilter&&!hE(re.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!pE(re.data.message)?{valid:!1}:this.useSenderFilter&&!re.data.sender?{valid:!1}:{valid:!0,message:re.data.sender?`${re.data.sender}: ${re.data.message}`:re.data.message}};if(!N&&S===0&&D===f&&P===0){z("public-key",0,u0);const G=f0(Pc);if(v===G){const re=H(Pc);if(re.valid)return{found:!0,roomName:u0,key:Pc,decryptedMessage:re.message}}}if(p&&!N&&this.wordlist.length>0)for(let G=S;G<this.wordlist.length;G++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[G],resumeType:"dictionary"};const re=this.wordlist[G],de=d0("#"+re),ie=f0(de);if(parseInt(ie,16)===T){const q=H(de);if(q.valid)return{found:!0,roomName:re,key:de,decryptedMessage:q.message,resumeFrom:re,resumeType:"dictionary"}}k++;const pe=performance.now();pe-E>=200&&(z("wordlist",re.length,re),E=pe,await new Promise(q=>setTimeout(q,0)))}const j=this.useCpu?1024:32768,J=(o==null?void 0:o.gpuDispatchMs)??1e3;let U=j,Q=!1;for(let G=D;G<=d;G++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Go(G,0)||void 0,resumeType:"bruteforce"};const re=sl(G);let de=G===D?P:0;for(;de<re;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Go(G,de)||void 0,resumeType:"bruteforce"};const ie=Math.min(U,re-de),pe=performance.now();let q;this.useCpu?q=this.cpuInstance.runBatch(T,G,de,ie,y,w):q=await this.gpuInstance.runBatch(T,G,de,ie,y,w);const he=performance.now()-pe;if(k+=ie,!this.useCpu&&!Q&&ie>=j&&he>0){const B=J/he,V=Math.round(ie*B),K=Math.pow(2,Math.round(Math.log2(Math.max(j,V))));U=Math.max(j,K),Q=!0}for(const B of q){const V=Go(G,B);if(!V)continue;const K=d0("#"+V),Y=H(K);if(Y.valid)return{found:!0,roomName:V,key:K,decryptedMessage:Y.message,resumeFrom:V,resumeType:"bruteforce"}}de+=ie;const Z=performance.now();if(Z-E>=200){const B=Go(G,Math.min(de,re-1))||"";z("bruteforce",G,B),E=Z,await new Promise(V=>setTimeout(V,0))}}}return{found:!1,resumeFrom:Go(d,sl(d)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var Qf,Fg;function yE(){return Fg||(Fg=1,Qf={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAA
Line 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(h=>(this.enabled=!0,h)).catch(h=>{throw this.enabled=!1,h})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):o()?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 $f=d,$f}var wE=_E();const bE=Ys(wE);function CE(r){if(r.length<4)return null;try{const o=parseInt(r.slice(0,2),16)&3;let l=2;if(o===0||o===3){if(r.length<l+8)return null;l+=8}if(r.length<l+2)return null;const d=parseInt(r.slice(l,l+2),16);l+=2;const f=d*2;return r.length<l+f?null:(l+=f,r.slice(l))}catch{return null}}function EE({packets:r,channels:a,onChannelCreate:o,onRunningChange:l,visible:d=!1}){const[f,p]=R.useState(!1),[h,g]=R.useState(6),[m,v]=R.useState(!1),[y,w]=R.useState(!0),[T,F]=R.useState(!1),[k,E]=R.useState(null),[D,P]=R.useState(new Map),[S,N]=R.useState([]),[M,z]=R.useState(!1),[H,j]=R.useState(null),[J,U]=R.useState(null),[Q,te]=R.useState(0),G=R.useRef(null),re=R.useRef(null),de=R.useRef(!1),ie=R.useRef(!1),pe=R.useRef(!1),q=R.useRef(new Map),he=R.useRef(!1),Z=R.useRef(6),B=R.useRef(!0),V=R.useRef(!1),K=R.useRef(new Set),Y=R.useRef(new Set);R.useEffect(()=>{const Be=new vE;G.current=Be,j(Be.isGpuAvailable());const Ze=new bE;return re.current=Ze,()=>{Be.destroy(),G.current=null,Ze.disable(),re.current=null}},[]),R.useEffect(()=>{!d||M||Ab(async()=>{const{ENGLISH_WORDLIST:Be}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Be}},[]).then(({ENGLISH_WORDLIST:Be})=>{G.current&&(G.current.setWordlist(Be),z(!0))}).catch(Be=>{console.error("Failed to load wordlist:",Be),xt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[d,M]),R.useEffect(()=>{const Be=()=>{et.getUndecryptedPacketCount().then(({count:ct})=>U(ct)).catch(()=>U(null))};Be();const Ze=setInterval(Be,36e5);return()=>clearInterval(Ze)},[]);const ce=R.useMemo(()=>new Set(a.map(Be=>Be.key.toUpperCase())),[a]),fe=r.filter(Be=>Be.payload_type==="GROUP_TEXT"&&!Be.decrypted);R.useEffect(()=>{let Be=0;P(Ze=>{const ct=new Map(Ze);let Lt=!1;for(const at of fe)if(!ct.has(at.id)){const mt=CE(at.data);if(mt&&Y.current.has(mt)){Be++;continue}mt&&Y.current.add(mt),ct.set(at.id,{packet:at,attempts:0,lastAttemptLength:0,status:"pending"}),Lt=!0}return Lt?(q.current=ct,ct):Ze}),Be>0&&te(Ze=>Ze+Be)},[fe.length]),R.useEffect(()=>{q.current=D},[D]),R.useEffect(()=>{he.current=m},[m]),R.useEffect(()=>{Z.current=h},[h]),R.useEffect(()=>{B.current=y},[y]),R.useEffect(()=>{V.current=T},[T]),R.useEffect(()=>{K.current=new Set(fe.map(Be=>Be.id))},[fe]),R.useEffect(()=>{l==null||l(f)},[f,l]);const we=Array.from(D.values()).filter(Be=>Be.status==="pending").length,Ae=Array.from(D.values()).filter(Be=>Be.status==="cracked").length,Ue=Array.from(D.values()).filter(Be=>Be.status==="failed").length,Ye=R.useCallback(async()=>{if(pe.current||!G.current||!de.current)return;const Be=q.current;let Ze=null,ct=null;for(const[qe,tt]of Be.entries())if(tt.status==="pending"){Ze=tt,ct=qe;break}if(!Ze&&he.current){const qe=Array.from(Be.entries()).filter(([,tt])=>tt.status==="failed"&&tt.lastAttemptLength<10);qe.length>0&&(qe.sort((tt,nt)=>tt[1].lastAttemptLength-nt[1].lastAttemptLength),[ct,Ze]=qe[0])}if(!Ze||ct===null){de.current&&setTimeout(()=>Ye(),1e3);return}if(!K.current.has(ct)){P(qe=>{const tt=new Map(qe);return tt.delete(ct),tt}),de.current&&setTimeout(()=>Ye(),10);return}pe.current=!0;const Lt=Z.current,at=Ze.lastAttemptLength>0,mt=at?Ze.lastAttemptLength+1:Lt;try{const qe=await G.current.crack(Ze.packet.data,{maxLength:mt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...V.current&&{gpuDispatchMs:1e4},...at&&{useDictionary:!1,startingLength:mt}},tt=>{E(tt)});if(ie.current){ie.current=!1,pe.current=!1,E(null);return}if(qe.found&&qe.roomName&&qe.key){P(He=>{const Et=new Map(He),Gt=Et.get(ct);return Gt&&Et.set(ct,{...Gt,status:"cracked",attempts:Gt.attempts+1,lastAttemptLength:mt}),Et});const tt={roomName:qe.roomName,key:qe.key,packetId:ct,message:qe.decryptedMessage||"",crackedAt:Date.now()};N(He=>[...He,tt]);const nt=qe.key.toUpperCase();if(!ce.has(nt))try{const He="#"+qe.roomName;await o(He,qe.key),B.current&&await et.decryptHistoricalPackets({key_type:"channel",channel_name:He})}catch(He){console.error("Failed to create channel or decrypt historical:",He),xt.error("Failed to save cracked channel",{description:He instanceof Error?He.message:"Channel discovered but could not be saved"})}}else P(tt=>{const nt=new Map(tt),He=nt.get(ct);return He&&nt.set(ct,{...He,status:"failed",attempts:He.attempts+1,lastAttemptLength:mt}),nt})}catch(qe){console.error("Cracking error:",qe),P(tt=>{const nt=new Map(tt),He=nt.get(ct);return He&&nt.set(ct,{...He,status:"failed",attempts:He.attempts+1,lastAttemptLength:mt}),nt})}pe.current=!1,E(null),de.current&&setTimeout(()=>Ye(),100)},[ce,o]),Ct=()=>{var Be;if(!H){xt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),de.current=!0,ie.current=!1,(Be=re.current)==null||Be.enable(),Ye()},pt=()=>{var Be,Ze;p(!1),de.current=!1,ie.current=!0,(Be=G.current)==null||Be.abort(),(Ze=re.current)=
Line truncated
|
||||
//# sourceMappingURL=index-D6IU3K0A.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAAS,EAAEH,EAAEI,EAAEC,EAAE,CAAC,KAAK,MAAML,EAAE,KAAK,QAAQI,EAAE,KAAK,KAAKD,EAAE,KAAK,QAAQE,GAAGJ,CAAC,CAAC,EAAE,UAAU,iBAAiB,GACnQ,EAAE,UAAU,SAAS,SAASD,EAAEI,EAAE,CAAC,GAAc,OAAOJ,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEI,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASM,GAAG,EAAEA,EAAE,UAAU,EAAE,UAAU,SAASC,EAAEP,EAAEI,EAAEC,EAAE,CAAC,KAAK,MAAML,EAAE,KAAK,QAAQI,EAAE,KAAK,KAAKD,EAAE,KAAK,QAAQE,GAAGJ,CAAC,CAAC,IAAIO,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEL,EAAEM,EAAE,EAAE,SAAS,EAAEA,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEb,EAAEI,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGnB,GAAGA,EAAE,aAAa,IAAIc,KAAKI,GAAElB,EAAE,aAAakB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS3B,EAAE,KAAKa,EAAE,IAAIgB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,EAAErB,EAAEI,EAAE,CAAC,MAAM,CAAC,SAASjB,EAAE,KAAKa,EAAE,KAAK,IAAII,EAAE,IAAIJ,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASsB,EAAEtB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASoC,EAAOvB,EAAE,CAAC,IAAII,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIJ,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOI,EAAEJ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIwB,GAAE,OAAO,SAASC,EAAEzB,EAAEI,EAAE,CAAC,OAAiB,OAAOJ,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYuB,EAAO,GAAGvB,EAAE,GAAG,EAAEI,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,GAAE1B,EAAEI,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOhB,GAAmBgB,KAAd,aAA6BA,KAAZ,aAAchB,EAAE,MAAK,IAAIiB,GAAE,GAAG,GAAUjB,IAAP,KAASiB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOjB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE6B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAEjB,EAAEe,GAAEA,GAAEE,EAAC,EAAEjB,EAAOc,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASL,GAAN,OAAUK,EAAEL,EAAE,QAAQwB,GAAE,KAAK,EAAE,KAAKE,GAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASL,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASe,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,EAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,GAAE,KAAK,EAAE,KAAKxB,CAAC,GAAGI,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAET,CAAC,EAAE,QAAQkB,GAAE,EAAEA,GAAElB,EAAE,OAAOkB,KAAI,CAACF,GACrfhB,EAAEkB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAEpB,EAAEC,CAAC,EAAe,OAAOmB,IAApB,WAAsB,IAAInB,EAAEmB,GAAE,KAAKnB,CAAC,EAAEkB,GAAE,EAAE,EAAEF,GAAEhB,EAAE,KAAI,GAAI,MAAMgB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOJ,CAAC,EAAE,MAAM,mDAAuEI,IAApB,kBAAsB,qBAAqB,OAAO,KAAKJ,CAAC,EAAE,KAAK,IAAI,EAAE,IAAII,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE3B,EAAEI,EAAEC,EAAE,CAAC,GAASL,GAAN,KAAQ,OAAOA,EAAE,IAAIc,EAAE,GAAGC,GAAE,EAAE,OAAAW,GAAE1B,EAAEc,EAAE,GAAG,GAAG,SAASd,GAAE,CAAC,OAAOI,EAAE,KAAKC,EAAEL,GAAEe,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,GAAE5B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAII,EAAEJ,EAAE,QAAQI,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQJ,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQI,EAAC,EAAE,SAASA,EAAE,EAAQJ,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQI,EAAC,CAAC,EAAOJ,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQI,EAAE,CAAC,GAAOJ,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI6B,GAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBF,GAAE,wBAAwBC,EAAE,kBAAkBnB,CAAC,EAAE,SAASqB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIN,GAAE,QAAQ,SAAS3B,EAAEI,EAAEC,EAAE,CAACsB,GAAE3B,EAAE,UAAU,CAACI,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASL,EAAE,CAAC,IAAII,EAAE,EAAE,OAAAuB,GAAE3B,EAAE,UAAU,CAACI,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASJ,EAAE,CAAC,OAAO2B,GAAE3B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACsB,EAAEtB,CAAC,EAAE,MAAM,MAAMLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
Vendored
+2
-2
@@ -13,8 +13,8 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<script type="module" crossorigin src="/assets/index-D6IU3K0A.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CcK6B7WY.css">
|
||||
<script type="module" crossorigin src="/assets/index-B7TRWRoH.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-tIXvIK_l.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Generated
+432
-2
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "remoteterm-meshcore-frontend",
|
||||
"version": "1.2.0",
|
||||
"version": "1.4.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "remoteterm-meshcore-frontend",
|
||||
"version": "1.2.0",
|
||||
"version": "1.4.1",
|
||||
"dependencies": {
|
||||
"@michaelhart/meshcore-decoder": "^0.2.7",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-label": "^2.1.8",
|
||||
@@ -16,12 +17,14 @@
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"d3-force": "^3.0.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"lucide-react": "^0.562.0",
|
||||
"meshcore-hashtag-cracker": "^1.6.0",
|
||||
"nosleep.js": "^0.12.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-force-graph-2d": "^1.29.0",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"sonner": "^2.0.7",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
@@ -31,6 +34,7 @@
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@testing-library/jest-dom": "^6.6.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@types/d3-force": "^3.0.10",
|
||||
"@types/leaflet": "^1.9.21",
|
||||
"@types/node": "^25.0.3",
|
||||
"@types/react": "^18.3.12",
|
||||
@@ -687,6 +691,8 @@
|
||||
},
|
||||
"node_modules/@michaelhart/meshcore-decoder": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@michaelhart/meshcore-decoder/-/meshcore-decoder-0.2.7.tgz",
|
||||
"integrity": "sha512-a3zNbqeACibYy7XlMx6F2fMfg8FT+mP7lcYCmr8EvQk2MvBw7Qs7+bV2DAnwTf+51IRZqFEPCq55GB0scsw1WA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@noble/ed25519": "^2.3.0",
|
||||
@@ -1429,6 +1435,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@tweenjs/tween.js": {
|
||||
"version": "25.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-25.0.0.tgz",
|
||||
"integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/aria-query": {
|
||||
"version": "5.0.4",
|
||||
"dev": true,
|
||||
@@ -1472,6 +1484,13 @@
|
||||
"@babel/types": "^7.28.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/d3-force": {
|
||||
"version": "3.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz",
|
||||
"integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.8",
|
||||
"dev": true,
|
||||
@@ -1893,6 +1912,15 @@
|
||||
"url": "https://opencollective.com/vitest"
|
||||
}
|
||||
},
|
||||
"node_modules/accessor-fn": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/accessor-fn/-/accessor-fn-1.5.3.tgz",
|
||||
"integrity": "sha512-rkAofCwe/FvYFUlMB0v0gWmhqtfAtV1IUkdPbfhTUyYniu5LrC0A0UJkTH0Jv3S8SvwkmfuAlY+mQIJATdocMA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.15.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
||||
@@ -2069,6 +2097,16 @@
|
||||
"baseline-browser-mapping": "dist/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/bezier-js": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/bezier-js/-/bezier-js-6.1.4.tgz",
|
||||
"integrity": "sha512-PA0FW9ZpcHbojUCMu28z9Vg/fNkwTj5YhusSAjHHDfHDGLxJ6YUKrAN2vk1fP2MMOxVw4Oko16FMlRGVBGqLKg==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://github.com/Pomax/bezierjs/blob/master/FUNDING.md"
|
||||
}
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
"version": "2.3.0",
|
||||
"license": "MIT",
|
||||
@@ -2188,6 +2226,18 @@
|
||||
],
|
||||
"license": "CC-BY-4.0"
|
||||
},
|
||||
"node_modules/canvas-color-tracker": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/canvas-color-tracker/-/canvas-color-tracker-1.3.2.tgz",
|
||||
"integrity": "sha512-ryQkDX26yJ3CXzb3hxUVNlg1NKE4REc5crLBq661Nxzr8TNd236SaEf2ffYLXyI5tSABSeguHLqcVq4vf9L3Zg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tinycolor2": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/chai": {
|
||||
"version": "5.3.3",
|
||||
"dev": true,
|
||||
@@ -2387,6 +2437,236 @@
|
||||
"devOptional": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/d3-array": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
|
||||
"integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"internmap": "1 - 2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-binarytree": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/d3-binarytree/-/d3-binarytree-1.0.2.tgz",
|
||||
"integrity": "sha512-cElUNH+sHu95L04m92pG73t2MEJXKu+GeKUN1TJkFsu93E5W8E9Sc3kHEGJKgenGvj19m6upSn2EunvMgMD2Yw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/d3-color": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
|
||||
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-dispatch": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
|
||||
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-drag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
|
||||
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-selection": "3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-ease": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
|
||||
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-force": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",
|
||||
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-quadtree": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-force-3d": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/d3-force-3d/-/d3-force-3d-3.0.6.tgz",
|
||||
"integrity": "sha512-4tsKHUPLOVkyfEffZo1v6sFHvGFwAIIjt/W8IThbp08DYAsXZck+2pSHEG5W1+gQgEvFLdZkYvmJAbRM2EzMnA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"d3-binarytree": "1",
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-octree": "1",
|
||||
"d3-quadtree": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-format": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
|
||||
"integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-interpolate": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
|
||||
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-octree": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-octree/-/d3-octree-1.1.0.tgz",
|
||||
"integrity": "sha512-F8gPlqpP+HwRPMO/8uOu5wjH110+6q4cgJvgJT6vlpy3BEaDIKlTZrgHKZSp/i1InRpVfh4puY/kvL6MxK930A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/d3-quadtree": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
|
||||
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-scale": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
|
||||
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-array": "2.10.0 - 3",
|
||||
"d3-format": "1 - 3",
|
||||
"d3-interpolate": "1.2.0 - 3",
|
||||
"d3-time": "2.1.1 - 3",
|
||||
"d3-time-format": "2 - 4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-scale-chromatic": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
|
||||
"integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3",
|
||||
"d3-interpolate": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-selection": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-time": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
|
||||
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-array": "2 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-time-format": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
|
||||
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-time": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-timer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
|
||||
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-transition": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
|
||||
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3",
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-ease": "1 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"d3-selection": "2 - 3"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-zoom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
|
||||
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-drag": "2 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-selection": "2 - 3",
|
||||
"d3-transition": "2 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/data-urls": {
|
||||
"version": "5.0.0",
|
||||
"dev": true,
|
||||
@@ -2901,6 +3181,46 @@
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/float-tooltip": {
|
||||
"version": "1.7.5",
|
||||
"resolved": "https://registry.npmjs.org/float-tooltip/-/float-tooltip-1.7.5.tgz",
|
||||
"integrity": "sha512-/kXzuDnnBqyyWyhDMH7+PfP8J/oXiAavGzcRxASOMRHFuReDtofizLLJsf7nnDLAfEaMW4pVWaXrAjtnglpEkg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"d3-selection": "2 - 3",
|
||||
"kapsule": "^1.16",
|
||||
"preact": "10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/force-graph": {
|
||||
"version": "1.51.0",
|
||||
"resolved": "https://registry.npmjs.org/force-graph/-/force-graph-1.51.0.tgz",
|
||||
"integrity": "sha512-aTnihCmiMA0ItLJLCbrQYS9mzriopW24goFPgUnKAAmAlPogTSmFWqoBPMXzIfPb7bs04Hur5zEI4WYgLW3Sig==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tweenjs/tween.js": "18 - 25",
|
||||
"accessor-fn": "1",
|
||||
"bezier-js": "3 - 6",
|
||||
"canvas-color-tracker": "^1.3",
|
||||
"d3-array": "1 - 3",
|
||||
"d3-drag": "2 - 3",
|
||||
"d3-force-3d": "2 - 3",
|
||||
"d3-scale": "1 - 4",
|
||||
"d3-scale-chromatic": "1 - 3",
|
||||
"d3-selection": "2 - 3",
|
||||
"d3-zoom": "2 - 3",
|
||||
"float-tooltip": "^1.7",
|
||||
"index-array-by": "1",
|
||||
"kapsule": "^1.16",
|
||||
"lodash-es": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.5",
|
||||
"dev": true,
|
||||
@@ -3152,6 +3472,24 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/index-array-by": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/index-array-by/-/index-array-by-1.4.2.tgz",
|
||||
"integrity": "sha512-SP23P27OUKzXWEC/TOyWlwLviofQkCSCKONnc62eItjp69yCZZPqDQtr3Pw5gJDnPeUMqExmKydNZaJO0FU9pw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/internmap": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
|
||||
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/is-binary-path": {
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
@@ -3211,6 +3549,15 @@
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/jerrypick": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/jerrypick/-/jerrypick-1.1.2.tgz",
|
||||
"integrity": "sha512-YKnxXEekXKzhpf7CLYA0A+oDP8V0OhICNCr5lv96FvSsDEmrb0GKM776JgQvHTMjr7DTTPEVv/1Ciaw0uEWzBA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "1.21.7",
|
||||
"license": "MIT",
|
||||
@@ -3317,6 +3664,18 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/kapsule": {
|
||||
"version": "1.16.3",
|
||||
"resolved": "https://registry.npmjs.org/kapsule/-/kapsule-1.16.3.tgz",
|
||||
"integrity": "sha512-4+5mNNf4vZDSwPhKprKwz3330iisPrb08JyMgbsdFrimBCKNHecua/WBwvVg3n7vwx0C1ARjfhwIpbrbd9n5wg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lodash-es": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/keyv": {
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||
@@ -3377,6 +3736,12 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash-es": {
|
||||
"version": "4.17.22",
|
||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.22.tgz",
|
||||
"integrity": "sha512-XEawp1t0gxSi9x01glktRZ5HDy0HXqrM0x5pXQM98EaI0NxO6jVM7omDOxsuEo5UIASAnm2bRp1Jt/e0a2XU8Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.merge": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||
@@ -3860,6 +4225,16 @@
|
||||
"version": "4.2.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/preact": {
|
||||
"version": "10.28.2",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.2.tgz",
|
||||
"integrity": "sha512-lbteaWGzGHdlIuiJ0l2Jq454m6kcpI1zNje6d8MlGAFlYvP2GO4ibnat7P74Esfz4sPTdM6UxtTwh/d3pwM9JA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/preact"
|
||||
}
|
||||
},
|
||||
"node_modules/prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
@@ -3900,6 +4275,23 @@
|
||||
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"dev": true,
|
||||
@@ -3947,12 +4339,44 @@
|
||||
"react": "^18.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-force-graph-2d": {
|
||||
"version": "1.29.0",
|
||||
"resolved": "https://registry.npmjs.org/react-force-graph-2d/-/react-force-graph-2d-1.29.0.tgz",
|
||||
"integrity": "sha512-Xv5IIk+hsZmB3F2ibja/t6j/b0/1T9dtFOQacTUoLpgzRHrO6wPu1GtQ2LfRqI/imgtaapnXUgQaE8g8enPo5w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"force-graph": "^1.51",
|
||||
"prop-types": "15",
|
||||
"react-kapsule": "^2.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/react-is": {
|
||||
"version": "17.0.2",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/react-kapsule": {
|
||||
"version": "2.5.7",
|
||||
"resolved": "https://registry.npmjs.org/react-kapsule/-/react-kapsule-2.5.7.tgz",
|
||||
"integrity": "sha512-kifAF4ZPD77qZKc4CKLmozq6GY1sBzPEJTIJb0wWFK6HsePJatK3jXplZn2eeAt3x67CDozgi7/rO8fNQ/AL7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jerrypick": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-leaflet": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-4.2.1.tgz",
|
||||
@@ -4397,6 +4821,12 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinycolor2": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz",
|
||||
"integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinyexec": {
|
||||
"version": "0.3.2",
|
||||
"dev": true,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"format:check": "prettier --check src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@michaelhart/meshcore-decoder": "^0.2.7",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-label": "^2.1.8",
|
||||
@@ -23,12 +24,14 @@
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"d3-force": "^3.0.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"lucide-react": "^0.562.0",
|
||||
"meshcore-hashtag-cracker": "^1.6.0",
|
||||
"nosleep.js": "^0.12.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-force-graph-2d": "^1.29.0",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"sonner": "^2.0.7",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
@@ -38,6 +41,7 @@
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@testing-library/jest-dom": "^6.6.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@types/d3-force": "^3.0.10",
|
||||
"@types/leaflet": "^1.9.21",
|
||||
"@types/node": "^25.0.3",
|
||||
"@types/react": "^18.3.12",
|
||||
|
||||
@@ -15,6 +15,7 @@ import { NewMessageModal } from './components/NewMessageModal';
|
||||
import { SettingsModal } from './components/SettingsModal';
|
||||
import { RawPacketList } from './components/RawPacketList';
|
||||
import { MapView } from './components/MapView';
|
||||
import { VisualizerView } from './components/VisualizerView';
|
||||
import { CrackerPanel } from './components/CrackerPanel';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from './components/ui/sheet';
|
||||
import { Toaster, toast } from './components/ui/sonner';
|
||||
@@ -370,6 +371,9 @@ export function App() {
|
||||
mapFocusKey: hashConv.mapFocusKey,
|
||||
};
|
||||
}
|
||||
if (hashConv.type === 'visualizer') {
|
||||
return { type: 'visualizer', id: 'visualizer', name: 'Mesh Visualizer' };
|
||||
}
|
||||
if (hashConv.type === 'channel') {
|
||||
const channel = channels.find(
|
||||
(c) => c.name === hashConv.name || c.name === `#${hashConv.name}`
|
||||
@@ -716,6 +720,13 @@ export function App() {
|
||||
<MapView contacts={contacts} focusedKey={activeConversation.mapFocusKey} />
|
||||
</div>
|
||||
</>
|
||||
) : activeConversation.type === 'visualizer' ? (
|
||||
<VisualizerView
|
||||
packets={rawPackets}
|
||||
contacts={contacts}
|
||||
channels={channels}
|
||||
config={config}
|
||||
/>
|
||||
) : activeConversation.type === 'raw' ? (
|
||||
<>
|
||||
<div className="flex justify-between items-center px-4 py-3 border-b border-border font-medium text-lg">
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useEffect, useRef, useMemo } from 'react';
|
||||
import { MeshCoreDecoder, PayloadType, Utils } from '@michaelhart/meshcore-decoder';
|
||||
import type { RawPacket } from '../types';
|
||||
|
||||
interface RawPacketListProps {
|
||||
@@ -10,30 +11,6 @@ function formatTime(timestamp: number): string {
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
||||
}
|
||||
|
||||
function formatPayloadType(type: string): string {
|
||||
// Convert SNAKE_CASE to Title Case
|
||||
return type
|
||||
.split('_')
|
||||
.map((word) => word.charAt(0) + word.slice(1).toLowerCase())
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
function getDecryptedLabel(packet: RawPacket): string {
|
||||
if (!packet.decrypted || !packet.decrypted_info) {
|
||||
return formatPayloadType(packet.payload_type);
|
||||
}
|
||||
|
||||
const info = packet.decrypted_info;
|
||||
if (packet.payload_type === 'GROUP_TEXT' && info.channel_name) {
|
||||
return `GroupText to ${info.channel_name}`;
|
||||
}
|
||||
if (packet.payload_type === 'TEXT_MESSAGE' && info.sender) {
|
||||
return `TextMessage from ${info.sender}`;
|
||||
}
|
||||
|
||||
return formatPayloadType(packet.payload_type);
|
||||
}
|
||||
|
||||
function formatSignalInfo(packet: RawPacket): string {
|
||||
const parts: string[] = [];
|
||||
if (packet.snr !== null && packet.snr !== undefined) {
|
||||
@@ -45,9 +22,170 @@ function formatSignalInfo(packet: RawPacket): string {
|
||||
return parts.join(' | ');
|
||||
}
|
||||
|
||||
// Decrypted info from the packet (validated by backend)
|
||||
interface DecryptedInfo {
|
||||
channel_name: string | null;
|
||||
sender: string | null;
|
||||
}
|
||||
|
||||
// Decode a packet and generate a human-readable summary
|
||||
// Uses backend's decrypted_info when available (validated), falls back to decoder
|
||||
function decodePacketSummary(
|
||||
hexData: string,
|
||||
decryptedInfo: DecryptedInfo | null
|
||||
): {
|
||||
summary: string;
|
||||
routeType: string;
|
||||
details?: string;
|
||||
} {
|
||||
try {
|
||||
const decoded = MeshCoreDecoder.decode(hexData);
|
||||
|
||||
if (!decoded.isValid) {
|
||||
return { summary: 'Invalid packet', routeType: 'Unknown' };
|
||||
}
|
||||
|
||||
const routeType = Utils.getRouteTypeName(decoded.routeType);
|
||||
const payloadTypeName = Utils.getPayloadTypeName(decoded.payloadType);
|
||||
|
||||
// Build path string if available
|
||||
const pathStr = decoded.path && decoded.path.length > 0 ? ` via ${decoded.path.join('-')}` : '';
|
||||
|
||||
// Generate summary based on payload type
|
||||
let summary = payloadTypeName;
|
||||
let details: string | undefined;
|
||||
|
||||
switch (decoded.payloadType) {
|
||||
case PayloadType.TextMessage: {
|
||||
const payload = decoded.payload.decoded as {
|
||||
destinationHash?: string;
|
||||
sourceHash?: string;
|
||||
} | null;
|
||||
if (payload?.sourceHash && payload?.destinationHash) {
|
||||
summary = `DM from ${payload.sourceHash} to ${payload.destinationHash}${pathStr}`;
|
||||
} else {
|
||||
summary = `DM${pathStr}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.GroupText: {
|
||||
const payload = decoded.payload.decoded as {
|
||||
channelHash?: string;
|
||||
} | null;
|
||||
// Use backend's validated decrypted_info when available
|
||||
if (decryptedInfo?.channel_name) {
|
||||
if (decryptedInfo.sender) {
|
||||
summary = `GT from ${decryptedInfo.sender} in ${decryptedInfo.channel_name}${pathStr}`;
|
||||
} else {
|
||||
summary = `GT in ${decryptedInfo.channel_name}${pathStr}`;
|
||||
}
|
||||
} else if (payload?.channelHash) {
|
||||
// Fallback to showing channel hash when not decrypted
|
||||
summary = `GT ch:${payload.channelHash}${pathStr}`;
|
||||
} else {
|
||||
summary = `GroupText${pathStr}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Advert: {
|
||||
const payload = decoded.payload.decoded as {
|
||||
publicKey?: string;
|
||||
appData?: { name?: string; deviceRole?: number };
|
||||
} | null;
|
||||
if (payload?.appData?.name) {
|
||||
const role =
|
||||
payload.appData.deviceRole !== undefined
|
||||
? Utils.getDeviceRoleName(payload.appData.deviceRole)
|
||||
: '';
|
||||
summary = `Advert: ${payload.appData.name}${role ? ` (${role})` : ''}${pathStr}`;
|
||||
} else if (payload?.publicKey) {
|
||||
summary = `Advert: ${payload.publicKey.slice(0, 8)}...${pathStr}`;
|
||||
} else {
|
||||
summary = `Advert${pathStr}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Ack: {
|
||||
summary = `ACK${pathStr}`;
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Request: {
|
||||
summary = `Request${pathStr}`;
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Response: {
|
||||
summary = `Response${pathStr}`;
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Trace: {
|
||||
summary = `Trace${pathStr}`;
|
||||
break;
|
||||
}
|
||||
|
||||
case PayloadType.Path: {
|
||||
summary = `Path${pathStr}`;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
summary = `${payloadTypeName}${pathStr}`;
|
||||
}
|
||||
|
||||
return { summary, routeType, details };
|
||||
} catch {
|
||||
return { summary: 'Decode error', routeType: 'Unknown' };
|
||||
}
|
||||
}
|
||||
|
||||
// Get route type badge color
|
||||
function getRouteTypeColor(routeType: string): string {
|
||||
switch (routeType) {
|
||||
case 'Flood':
|
||||
return 'bg-blue-500/20 text-blue-400';
|
||||
case 'Direct':
|
||||
return 'bg-green-500/20 text-green-400';
|
||||
case 'Transport Flood':
|
||||
return 'bg-purple-500/20 text-purple-400';
|
||||
case 'Transport Direct':
|
||||
return 'bg-orange-500/20 text-orange-400';
|
||||
default:
|
||||
return 'bg-gray-500/20 text-gray-400';
|
||||
}
|
||||
}
|
||||
|
||||
// Get short route type label
|
||||
function getRouteTypeLabel(routeType: string): string {
|
||||
switch (routeType) {
|
||||
case 'Flood':
|
||||
return 'F';
|
||||
case 'Direct':
|
||||
return 'D';
|
||||
case 'Transport Flood':
|
||||
return 'TF';
|
||||
case 'Transport Direct':
|
||||
return 'TD';
|
||||
default:
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
|
||||
export function RawPacketList({ packets }: RawPacketListProps) {
|
||||
const listRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Decode all packets (memoized to avoid re-decoding on every render)
|
||||
const decodedPackets = useMemo(() => {
|
||||
return packets.map((packet) => ({
|
||||
packet,
|
||||
decoded: decodePacketSummary(packet.data, packet.decrypted_info),
|
||||
}));
|
||||
}, [packets]);
|
||||
|
||||
useEffect(() => {
|
||||
if (listRef.current) {
|
||||
listRef.current.scrollTop = listRef.current.scrollHeight;
|
||||
@@ -63,24 +201,44 @@ export function RawPacketList({ packets }: RawPacketListProps) {
|
||||
}
|
||||
|
||||
// Sort packets by timestamp ascending (oldest first)
|
||||
const sortedPackets = [...packets].sort((a, b) => a.timestamp - b.timestamp);
|
||||
const sortedPackets = [...decodedPackets].sort((a, b) => a.packet.timestamp - b.packet.timestamp);
|
||||
|
||||
return (
|
||||
<div className="h-full overflow-y-auto p-4 flex flex-col gap-3" ref={listRef}>
|
||||
{sortedPackets.map((packet) => (
|
||||
{sortedPackets.map(({ packet, decoded }) => (
|
||||
<div key={packet.id} className="py-2 px-3 bg-muted rounded">
|
||||
<div className={packet.decrypted ? 'text-primary' : 'text-destructive'}>
|
||||
{!packet.decrypted && <span className="mr-1">🔒</span>}
|
||||
{getDecryptedLabel(packet)}
|
||||
{' • '}
|
||||
{formatTime(packet.timestamp)}
|
||||
<div className="flex items-center gap-2">
|
||||
{/* Route type badge */}
|
||||
<span
|
||||
className={`text-[10px] font-mono px-1.5 py-0.5 rounded ${getRouteTypeColor(decoded.routeType)}`}
|
||||
title={decoded.routeType}
|
||||
>
|
||||
{getRouteTypeLabel(decoded.routeType)}
|
||||
</span>
|
||||
|
||||
{/* Encryption status */}
|
||||
{!packet.decrypted && <span title="Encrypted">🔒</span>}
|
||||
|
||||
{/* Summary */}
|
||||
<span className={packet.decrypted ? 'text-primary' : 'text-foreground'}>
|
||||
{decoded.summary}
|
||||
</span>
|
||||
|
||||
{/* Time */}
|
||||
<span className="text-muted-foreground ml-auto text-sm">
|
||||
{formatTime(packet.timestamp)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Signal info */}
|
||||
{(packet.snr !== null || packet.rssi !== null) && (
|
||||
<div className="text-[11px] text-muted-foreground mt-0.5">
|
||||
{formatSignalInfo(packet)}
|
||||
</div>
|
||||
)}
|
||||
<div className="font-mono text-[11px] break-all text-muted-foreground/70 mt-1">
|
||||
|
||||
{/* Raw hex data (always visible) */}
|
||||
<div className="font-mono text-[10px] break-all text-muted-foreground/70 mt-1 p-1 bg-background/50 rounded">
|
||||
{packet.data.toUpperCase()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,7 +68,7 @@ export function Sidebar({
|
||||
onSelectConversation(conversation);
|
||||
};
|
||||
|
||||
const isActive = (type: 'contact' | 'channel' | 'raw' | 'map', id: string) =>
|
||||
const isActive = (type: 'contact' | 'channel' | 'raw' | 'map' | 'visualizer', id: string) =>
|
||||
activeConversation?.type === type && activeConversation?.id === id;
|
||||
|
||||
// Get unread count for a conversation
|
||||
@@ -288,6 +288,26 @@ export function Sidebar({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Mesh Visualizer */}
|
||||
{!query && (
|
||||
<div
|
||||
className={cn(
|
||||
'px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent',
|
||||
isActive('visualizer', 'visualizer') && 'bg-accent border-l-primary'
|
||||
)}
|
||||
onClick={() =>
|
||||
handleSelectConversation({
|
||||
type: 'visualizer',
|
||||
id: 'visualizer',
|
||||
name: 'Mesh Visualizer',
|
||||
})
|
||||
}
|
||||
>
|
||||
<span className="text-muted-foreground text-xs">✨</span>
|
||||
<span className="flex-1 truncate">Mesh Visualizer</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Cracker Toggle */}
|
||||
{!query && (
|
||||
<div
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import { useState } from 'react';
|
||||
import type { Contact, RawPacket, Channel, RadioConfig } from '../types';
|
||||
import { PacketVisualizer } from './PacketVisualizer';
|
||||
import { RawPacketList } from './RawPacketList';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs';
|
||||
import { Checkbox } from './ui/checkbox';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface VisualizerViewProps {
|
||||
packets: RawPacket[];
|
||||
contacts: Contact[];
|
||||
channels: Channel[];
|
||||
config: RadioConfig | null;
|
||||
}
|
||||
|
||||
export function VisualizerView({ packets, contacts, channels, config }: VisualizerViewProps) {
|
||||
const [fullScreen, setFullScreen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
{/* Header */}
|
||||
<div className="flex justify-between items-center px-4 py-3 border-b border-border font-medium text-lg">
|
||||
<span>Mesh Visualizer</span>
|
||||
{/* Full screen toggle - only show on larger screens */}
|
||||
<label className="hidden md:flex items-center gap-2 text-sm font-normal cursor-pointer">
|
||||
<Checkbox
|
||||
checked={fullScreen}
|
||||
onCheckedChange={(checked) => setFullScreen(checked === true)}
|
||||
/>
|
||||
<span>Full screen</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Mobile: Tabbed interface */}
|
||||
<div className="flex-1 overflow-hidden md:hidden">
|
||||
<Tabs defaultValue="visualizer" className="h-full flex flex-col">
|
||||
<TabsList className="mx-4 mt-2 grid grid-cols-2">
|
||||
<TabsTrigger value="visualizer">Visualizer</TabsTrigger>
|
||||
<TabsTrigger value="packets">Packet Feed</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="visualizer" className="flex-1 m-0 overflow-hidden">
|
||||
<PacketVisualizer
|
||||
packets={packets}
|
||||
contacts={contacts}
|
||||
channels={channels}
|
||||
config={config}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent value="packets" className="flex-1 m-0 overflow-hidden">
|
||||
<RawPacketList packets={packets} />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
{/* Desktop: Split screen (or full screen if toggled) */}
|
||||
<div className="hidden md:flex flex-1 overflow-hidden">
|
||||
{/* Visualizer panel */}
|
||||
<div
|
||||
className={cn(
|
||||
'overflow-hidden transition-all duration-200',
|
||||
fullScreen ? 'flex-1' : 'flex-1 border-r border-border'
|
||||
)}
|
||||
>
|
||||
<PacketVisualizer
|
||||
packets={packets}
|
||||
contacts={contacts}
|
||||
channels={channels}
|
||||
config={config}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Packet feed panel - hidden when full screen */}
|
||||
<div
|
||||
className={cn(
|
||||
'overflow-hidden transition-all duration-200',
|
||||
fullScreen ? 'w-0' : 'w-[45rem] lg:w-[54rem]'
|
||||
)}
|
||||
>
|
||||
<div className="h-full flex flex-col">
|
||||
<div className="px-3 py-2 border-b border-border text-sm font-medium text-muted-foreground">
|
||||
Packet Feed
|
||||
</div>
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<RawPacketList packets={packets} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export interface Message {
|
||||
acked: number;
|
||||
}
|
||||
|
||||
export type ConversationType = 'contact' | 'channel' | 'raw' | 'map';
|
||||
export type ConversationType = 'contact' | 'channel' | 'raw' | 'map' | 'visualizer';
|
||||
|
||||
export interface Conversation {
|
||||
type: ConversationType;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Conversation } from '../types';
|
||||
|
||||
export interface ParsedHashConversation {
|
||||
type: 'channel' | 'contact' | 'raw' | 'map';
|
||||
type: 'channel' | 'contact' | 'raw' | 'map' | 'visualizer';
|
||||
name: string;
|
||||
/** For map view: public key prefix to focus on */
|
||||
mapFocusKey?: string;
|
||||
@@ -20,6 +20,10 @@ export function parseHashConversation(): ParsedHashConversation | null {
|
||||
return { type: 'map', name: 'map' };
|
||||
}
|
||||
|
||||
if (hash === 'visualizer') {
|
||||
return { type: 'visualizer', name: 'visualizer' };
|
||||
}
|
||||
|
||||
// Check for map with focus: #map/focus/{pubkey_prefix}
|
||||
if (hash.startsWith('map/focus/')) {
|
||||
const focusKey = hash.slice('map/focus/'.length);
|
||||
@@ -54,6 +58,7 @@ export function getConversationHash(conv: Conversation | null): string {
|
||||
if (!conv) return '';
|
||||
if (conv.type === 'raw') return '#raw';
|
||||
if (conv.type === 'map') return '#map';
|
||||
if (conv.type === 'visualizer') return '#visualizer';
|
||||
// Strip leading # from channel names for cleaner URLs
|
||||
const name =
|
||||
conv.type === 'channel' && conv.name.startsWith('#') ? conv.name.slice(1) : conv.name;
|
||||
|
||||
Reference in new issue
Block a user