mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-10-23 01:41:15 +00:00
Remove some unneeded code
This commit is contained in:
1 parent
22eb828b3c
commit
4382f4ab74
12 files changed
+19
-178
No files matched your search
@@ -119,7 +119,6 @@ A web interface for MeshCore mesh radio networks. The backend connects to a Mesh
|
||||
├── references/meshcore_py/ # MeshCore Python library
|
||||
├── tests/ # Backend tests (pytest)
|
||||
├── data/ # SQLite database (runtime)
|
||||
├── integration_test.html # Browser-based API tests
|
||||
└── pyproject.toml # Python dependencies
|
||||
```
|
||||
|
||||
@@ -184,10 +183,6 @@ cd frontend
|
||||
npm run test:run
|
||||
```
|
||||
|
||||
### Integration Tests
|
||||
|
||||
Open `integration_test.html` in a browser with the backend running.
|
||||
|
||||
### Before Completing Changes
|
||||
|
||||
**Always run both backend and frontend validation before finishing any changes:**
|
||||
|
||||
@@ -159,24 +159,6 @@ class ContactRepository:
|
||||
)
|
||||
await db.conn.commit()
|
||||
|
||||
@staticmethod
|
||||
async def clear_all_on_radio() -> None:
|
||||
"""Clear the on_radio flag for all contacts."""
|
||||
await db.conn.execute("UPDATE contacts SET on_radio = 0")
|
||||
await db.conn.commit()
|
||||
|
||||
@staticmethod
|
||||
async def set_multiple_on_radio(public_keys: list[str], on_radio: bool = True) -> None:
|
||||
"""Set on_radio flag for multiple contacts."""
|
||||
if not public_keys:
|
||||
return
|
||||
placeholders = ",".join("?" * len(public_keys))
|
||||
await db.conn.execute(
|
||||
f"UPDATE contacts SET on_radio = ? WHERE public_key IN ({placeholders})",
|
||||
[on_radio] + public_keys,
|
||||
)
|
||||
await db.conn.commit()
|
||||
|
||||
@staticmethod
|
||||
async def update_last_read_at(public_key: str, timestamp: int | None = None) -> bool:
|
||||
"""Update the last_read_at timestamp for a contact.
|
||||
@@ -244,24 +226,6 @@ class ChannelRepository:
|
||||
for row in rows
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
async def get_by_name(name: str) -> Channel | None:
|
||||
"""Get a channel by name."""
|
||||
cursor = await db.conn.execute(
|
||||
"SELECT key, name, is_hashtag, on_radio, last_read_at FROM channels WHERE name = ?",
|
||||
(name,),
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
if row:
|
||||
return Channel(
|
||||
key=row["key"],
|
||||
name=row["name"],
|
||||
is_hashtag=bool(row["is_hashtag"]),
|
||||
on_radio=bool(row["on_radio"]),
|
||||
last_read_at=row["last_read_at"],
|
||||
)
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
async def delete(key: str) -> None:
|
||||
"""Delete a channel by key."""
|
||||
|
||||
+1
-1
@@ -1 +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
|
||||
.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
|
||||
+13
-13
@@ -34,16 +34,16 @@ var Ay=Object.defineProperty;var vy=(n,s,i)=>s in n?Ay(n,s,{enumerable:!0,config
|
||||
`+D+e}var q=!1;function K(e,r){if(!e||q)return"";q=!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(fe){var h=fe}Reflect.construct(e,[],r)}else{try{r.call()}catch(fe){h=fe}e.call(r.prototype)}else{try{throw Error()}catch(fe){h=fe}e()}}catch(fe){if(fe&&h&&typeof fe.stack=="string"){for(var y=fe.stack.split(`
|
||||
`),E=h.stack.split(`
|
||||
`),I=y.length-1,Y=E.length-1;1<=I&&0<=Y&&y[I]!==E[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(y[I]!==E[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||y[I]!==E[Y]){var te=`
|
||||
`+y[I].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=I&&0<=Y);break}}}finally{q=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?z(e):""}function ce(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=K(e.type,!1),e;case 11:return e=K(e.type.render,!1),e;case 1:return e=K(e.type,!0),e;default:return""}}function he(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 V:return"Fragment";case H:return"Portal";case ee:return"Profiler";case j:return"StrictMode";case $:return"Suspense";case oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case J:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case me:return r=e.displayName||null,r!==null?r:he(e.type)||"Memo";case G:r=e._payload,e=e._init;try{return he(e(r))}catch{}}return null}function xe(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 he(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 pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ge(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Be(e){var r=ge(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 We(e){e._valueTracker||(e._valueTracker=Be(e))}function $e(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),h="";return e&&(h=ge(e)?e.checked?"true":"false":e.value),e=h,e!==a?(r.setValue(e),!0):!1}function Ce(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 Ve(e,r){var a=r.checked;return U({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function ot(e,r){var a=r.defaultValue==null?"":r.defaultValue,h=r.checked!=null?r.checked:r.defaultChecked;a=pe(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 gt(e,r){r=r.checked,r!=null&&T(e,"checked",r,!1)}function ct(e,r){gt(e,r);var a=pe(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")?Ke(e,r.type,a):r.hasOwnProperty("defaultValue")&&Ke(e,r.type,pe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function ht(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 Ke(e,r,a){(r!=="number"||Ce(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Ge=Array.isArray;function Je(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=""+pe(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 Ue(e,r){if(r.dangerouslySetInner
Line truncated
|
||||
`).replace(X,"")}function de(e,r,a){if(r=ae(r),ae(e)!==r&&a)throw Error(i(425))}function ye(){}var De=null,Qe=null;function at(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 an=typeof setTimeout=="function"?setTimeout:void 0,nn=typeof clearTimeout=="function"?clearTimeout:void 0,Ln=typeof Promise=="function"?Promise:void 0,kn=typeof queueMicrotask=="function"?queueMicrotask:typeof Ln<"u"?function(e){return Ln.resolve(null).then(e).catch(Xi)}:an;function Xi(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),nr(r);return}h--}else a!=="$"&&a!=="$?"&&a!=="$!"||h++;a=y}while(a);nr(r)}function Yr(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),xr="__reactFiber$"+mi,Ji="__reactProps$"+mi,Pt="__reactContainer$"+mi,eo="__reactEvents$"+mi,Zd="__reactListeners$"+mi,Wd="__reactHandles$"+mi;function gi(e){var r=e[xr];if(r)return r;for(var a=e.parentNode;a;){if(r=a[Pt]||a[xr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rc(e);e!==null;){if(a=e[xr])return a;e=rc(e)}return r}e=a,a=e.parentNode}return null}function xi(e){return e=e[xr]||e[Pt],!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[Ji]||null}var qd=[],Fs=-1;function to(e){return{current:e}}function zt(e){0>Fs||(e.current=qd[Fs],qd[Fs]=null,Fs--)}function Mt(e,r){Fs++,qd[Fs]=e.current,e.current=r}var no={},Sn=to(no),Zn=to(!1),Fo=no;function Ls(e,r){var a=e.type.contextTypes;if(!a)return no;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(){zt(Zn),zt(Sn)}function xh(e,r,a){if(Sn.current!==no)throw Error(i(168));Mt(Sn,r),Mt(Zn,a)}function Ah(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,xe(e)||"Unknown",y));return U({},a,h)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||no,Fo=Sn.current,Mt(Sn,e),Mt(Zn,Zn.current),!0}function vh(e,r,a){var h=e.stateNode;if(!h)throw Error(i(169));a?(e=Ah(e,r,Fo),h.__reactInternalMemoizedMergedChildContext=e,zt(Zn),zt(Sn),Mt(Sn,e)):zt(Zn),Mt(Zn,a)}var vi=null,sc=!1,Gd=!1;function yh(e){vi===null?vi=[e]:vi.push(e)}function Iv(e){sc=!0,yh(e)}function ro(){if(!Gd&&vi!==null){Gd=!0;var e=0,r=wt;try{var a=vi;for(wt=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,ro),y}finally{wt=r,Gd=!1}}return null}var Ms=[],Is=0,ac=null,lc=0,Ar=[],vr=0,Lo=null,yi=1,_i="";function Mo(e,r){Ms[Is++]=lc,Ms[Is++]=ac,ac=e,lc=r}function _h(e,r,a){Ar[vr++]=yi,Ar[vr++]=_i,Ar[vr++]=Lo,Lo=e;var h=yi;e=_i;var y=32-st(h)-1;h&=~(1<<y),a+=1;var E=32-st(r)+y;if(30<E){var I=y-y%5;E=(h&(1<<I)-1).toString(32),h>>=I,y-=I,yi=1<<32-st(r)+y|a<<y|h,_i=E+e}else yi=1<<E|a<<y|h,_i=e}function $d(e){e.return!==null&&(Mo(e,1),_h(e,1,0))}function Kd(e){for(;e===ac;)ac=Ms[--Is],Ms[Is]=null,lc=Ms[--Is],Ms[Is]=null;for(;e===Lo;)Lo=Ar[--vr],Ar[vr]=null,_i=Ar[--vr],Ar[vr]=null,yi=Ar[--vr],Ar[vr]=null}var ar=null,lr=null,Zt=!1,Nr=null;function wh(e,r){var a=br(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 bh(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,ar=e,lr=Yr(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,ar=e,lr=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=br(18,null,null,0),a.stateNode=r,a.return=e,e.child=a,ar=e,lr=null,!0):!1;default:return!1}}function Qd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yd(e){if(Zt){var r=lr;if(r){var a=r;if(!bh(e,r)){if(Qd(e))throw Error(i(418));r=Yr(a.nextSibling);var h=ar;r&&bh(e,r)?wh(h,a):(e.flags=e.flags&-4097|2,Zt=!1,ar=e)}}else{if(Qd(e))throw Error(i(418));e.flags=e.flags&-4097|2,Zt=!1,ar=e}}}function Ch(e){for(e=e.r
Line truncated
|
||||
`+y[I].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=I&&0<=Y);break}}}finally{q=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?z(e):""}function ce(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=K(e.type,!1),e;case 11:return e=K(e.type.render,!1),e;case 1:return e=K(e.type,!0),e;default:return""}}function he(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 V:return"Fragment";case H:return"Portal";case ee:return"Profiler";case j:return"StrictMode";case $:return"Suspense";case oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case J:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case me:return r=e.displayName||null,r!==null?r:he(e.type)||"Memo";case G:r=e._payload,e=e._init;try{return he(e(r))}catch{}}return null}function xe(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 he(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 pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ge(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Be(e){var r=ge(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 We(e){e._valueTracker||(e._valueTracker=Be(e))}function $e(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),h="";return e&&(h=ge(e)?e.checked?"true":"false":e.value),e=h,e!==a?(r.setValue(e),!0):!1}function Ce(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 Ve(e,r){var a=r.checked;return U({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function ot(e,r){var a=r.defaultValue==null?"":r.defaultValue,h=r.checked!=null?r.checked:r.defaultChecked;a=pe(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 mt(e,r){r=r.checked,r!=null&&T(e,"checked",r,!1)}function ct(e,r){mt(e,r);var a=pe(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")?Ke(e,r.type,a):r.hasOwnProperty("defaultValue")&&Ke(e,r.type,pe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function ht(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 Ke(e,r,a){(r!=="number"||Ce(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Ge=Array.isArray;function Je(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=""+pe(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 Ue(e,r){if(r.dangerouslySetInner
Line truncated
|
||||
`).replace(X,"")}function de(e,r,a){if(r=ae(r),ae(e)!==r&&a)throw Error(i(425))}function ye(){}var De=null,Qe=null;function at(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 an=typeof setTimeout=="function"?setTimeout:void 0,nn=typeof clearTimeout=="function"?clearTimeout:void 0,Ln=typeof Promise=="function"?Promise:void 0,kn=typeof queueMicrotask=="function"?queueMicrotask:typeof Ln<"u"?function(e){return Ln.resolve(null).then(e).catch(Xi)}:an;function Xi(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),nr(r);return}h--}else a!=="$"&&a!=="$?"&&a!=="$!"||h++;a=y}while(a);nr(r)}function Yr(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),xr="__reactFiber$"+mi,Ji="__reactProps$"+mi,Bt="__reactContainer$"+mi,eo="__reactEvents$"+mi,Zd="__reactListeners$"+mi,Wd="__reactHandles$"+mi;function gi(e){var r=e[xr];if(r)return r;for(var a=e.parentNode;a;){if(r=a[Bt]||a[xr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rc(e);e!==null;){if(a=e[xr])return a;e=rc(e)}return r}e=a,a=e.parentNode}return null}function xi(e){return e=e[xr]||e[Bt],!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[Ji]||null}var qd=[],Fs=-1;function to(e){return{current:e}}function zt(e){0>Fs||(e.current=qd[Fs],qd[Fs]=null,Fs--)}function Mt(e,r){Fs++,qd[Fs]=e.current,e.current=r}var no={},Sn=to(no),Zn=to(!1),Fo=no;function Ls(e,r){var a=e.type.contextTypes;if(!a)return no;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(){zt(Zn),zt(Sn)}function xh(e,r,a){if(Sn.current!==no)throw Error(i(168));Mt(Sn,r),Mt(Zn,a)}function Ah(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,xe(e)||"Unknown",y));return U({},a,h)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||no,Fo=Sn.current,Mt(Sn,e),Mt(Zn,Zn.current),!0}function vh(e,r,a){var h=e.stateNode;if(!h)throw Error(i(169));a?(e=Ah(e,r,Fo),h.__reactInternalMemoizedMergedChildContext=e,zt(Zn),zt(Sn),Mt(Sn,e)):zt(Zn),Mt(Zn,a)}var vi=null,sc=!1,Gd=!1;function yh(e){vi===null?vi=[e]:vi.push(e)}function Iv(e){sc=!0,yh(e)}function ro(){if(!Gd&&vi!==null){Gd=!0;var e=0,r=_t;try{var a=vi;for(_t=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,ro),y}finally{_t=r,Gd=!1}}return null}var Ms=[],Is=0,ac=null,lc=0,Ar=[],vr=0,Lo=null,yi=1,_i="";function Mo(e,r){Ms[Is++]=lc,Ms[Is++]=ac,ac=e,lc=r}function _h(e,r,a){Ar[vr++]=yi,Ar[vr++]=_i,Ar[vr++]=Lo,Lo=e;var h=yi;e=_i;var y=32-st(h)-1;h&=~(1<<y),a+=1;var E=32-st(r)+y;if(30<E){var I=y-y%5;E=(h&(1<<I)-1).toString(32),h>>=I,y-=I,yi=1<<32-st(r)+y|a<<y|h,_i=E+e}else yi=1<<E|a<<y|h,_i=e}function $d(e){e.return!==null&&(Mo(e,1),_h(e,1,0))}function Kd(e){for(;e===ac;)ac=Ms[--Is],Ms[Is]=null,lc=Ms[--Is],Ms[Is]=null;for(;e===Lo;)Lo=Ar[--vr],Ar[vr]=null,_i=Ar[--vr],Ar[vr]=null,yi=Ar[--vr],Ar[vr]=null}var ar=null,lr=null,Zt=!1,Nr=null;function wh(e,r){var a=br(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 bh(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,ar=e,lr=Yr(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,ar=e,lr=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=br(18,null,null,0),a.stateNode=r,a.return=e,e.child=a,ar=e,lr=null,!0):!1;default:return!1}}function Qd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yd(e){if(Zt){var r=lr;if(r){var a=r;if(!bh(e,r)){if(Qd(e))throw Error(i(418));r=Yr(a.nextSibling);var h=ar;r&&bh(e,r)?wh(h,a):(e.flags=e.flags&-4097|2,Zt=!1,ar=e)}}else{if(Qd(e))throw Error(i(418));e.flags=e.flags&-4097|2,Zt=!1,ar=e}}}function Ch(e){for(e=e.r
Line truncated
|
||||
Error generating stack: `+E.message+`
|
||||
`+E.stack}return{value:e,source:r,stack:y,digest:null}}function yf(e,r,a){return{value:e,source:null,stack:a??null,digest:r??null}}function _f(e,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var qv=typeof WeakMap=="function"?WeakMap:Map;function ip(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,Mf=h),_f(e,r)},a}function op(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(){_f(e,r)}}var E=e.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){_f(e,r),typeof h!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var I=r.stack;this.componentDidCatch(r.value,{componentStack:I!==null?I:""})}),a}function sp(e,r,a){var h=e.pingCache;if(h===null){h=e.pingCache=new qv;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=sy.bind(null,e,r,a),r.then(e,e))}function ap(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 lp(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,oo(a,r,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=y,e)}var Gv=F.ReactCurrentOwner,qn=!1;function Mn(e,r,a,h){r.child=e===null?Bh(r,null,a,h):js(r,e.child,a,h)}function cp(e,r,a,h,y){a=a.render;var E=r.ref;return Hs(r,y),h=ff(e,r,a,h,E,y),a=hf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Zt&&a&&$d(r),r.flags|=1,Mn(e,r,h,y),r.child)}function up(e,r,a,h,y){if(e===null){var E=a.type;return typeof E=="function"&&!Uf(E)&&E.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=E,dp(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:$r,a(I,h)&&e.ref===r.ref)return Ci(e,r,y)}return r.flags|=1,e=fo(E,h),e.ref=r.ref,e.return=r,r.child=e}function dp(e,r,a,h,y){if(e!==null){var E=e.memoizedProps;if($r(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 wf(e,r,a,h,y)}function fp(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},Mt(Ws,cr),cr|=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,Mt(Ws,cr),cr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=E!==null?E.baseLanes:a,Mt(Ws,cr),cr|=h}else E!==null?(h=E.baseLanes|a,r.memoizedState=null):h=a,Mt(Ws,cr),cr|=h;return Mn(e,r,y,a),r.child}function hp(e,r){var a=r.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function wf(e,r,a,h,y){var E=Wn(a)?Fo:Sn.current;return E=Ls(r,E),Hs(r,y),a=ff(e,r,a,h,E,y),h=hf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Zt&&h&&$d(r),r.flags|=1,Mn(e,r,a,y),r.child)}function pp(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),np(r,a,h),vf(r,a,h,y),h=!0;else if(e===null){var I=r.stateNode,Y=r.memoizedProps;I.props=Y;var te=I.context,fe=a.contextType;typeof fe=="object"&&fe!==null?fe=yr(fe):(fe=Wn(a)?Fo:Sn.current,fe=Ls(r,fe));var be=a.getDerivedStateFromProps,Ee=typeof be=="function"||typeof I.getSnapshotBeforeUpdate=="function";Ee||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==h||te!==fe)&&rp(r,I,h,fe),io=!1;var _e=r.memoizedState;I.state=_e,pc(r,h,I,y),te=r.memoizedState,Y!==h||_e!==te||Zn.current||io?(typeof be=="function"&&(Af(r,a,be,h),te=r.memoizedState),(Y=io||tp(r,a,Y,h,_e,te,fe))?(Ee||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=te),I.props=h,I.state=te,I.context=fe,h=Y):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{I=r.stateNode,Th(e,r),Y=r.memoizedProps,fe=r.type===r.elementType?Y:Fr(r.type,Y),I.props=fe,Ee=r.pendingProps,_e=I.context,te=a.contextType,typeof te=="object"&&te!==null?te=yr(te):(te=Wn(a)?Fo:Sn.current,te=Ls(r,te));var Me=a.getDerivedStateFromProps;(be=typeof Me=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==Ee||_e!==te)&&rp(r,I,
Line truncated
|
||||
`+E.stack}return{value:e,source:r,stack:y,digest:null}}function yf(e,r,a){return{value:e,source:null,stack:a??null,digest:r??null}}function _f(e,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var qv=typeof WeakMap=="function"?WeakMap:Map;function ip(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,Mf=h),_f(e,r)},a}function op(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(){_f(e,r)}}var E=e.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){_f(e,r),typeof h!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var I=r.stack;this.componentDidCatch(r.value,{componentStack:I!==null?I:""})}),a}function sp(e,r,a){var h=e.pingCache;if(h===null){h=e.pingCache=new qv;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=sy.bind(null,e,r,a),r.then(e,e))}function ap(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 lp(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,oo(a,r,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=y,e)}var Gv=F.ReactCurrentOwner,qn=!1;function Mn(e,r,a,h){r.child=e===null?Bh(r,null,a,h):js(r,e.child,a,h)}function cp(e,r,a,h,y){a=a.render;var E=r.ref;return Hs(r,y),h=ff(e,r,a,h,E,y),a=hf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Zt&&a&&$d(r),r.flags|=1,Mn(e,r,h,y),r.child)}function up(e,r,a,h,y){if(e===null){var E=a.type;return typeof E=="function"&&!Uf(E)&&E.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=E,dp(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:$r,a(I,h)&&e.ref===r.ref)return Ci(e,r,y)}return r.flags|=1,e=fo(E,h),e.ref=r.ref,e.return=r,r.child=e}function dp(e,r,a,h,y){if(e!==null){var E=e.memoizedProps;if($r(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 wf(e,r,a,h,y)}function fp(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},Mt(Ws,cr),cr|=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,Mt(Ws,cr),cr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=E!==null?E.baseLanes:a,Mt(Ws,cr),cr|=h}else E!==null?(h=E.baseLanes|a,r.memoizedState=null):h=a,Mt(Ws,cr),cr|=h;return Mn(e,r,y,a),r.child}function hp(e,r){var a=r.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function wf(e,r,a,h,y){var E=Wn(a)?Fo:Sn.current;return E=Ls(r,E),Hs(r,y),a=ff(e,r,a,h,E,y),h=hf(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Zt&&h&&$d(r),r.flags|=1,Mn(e,r,a,y),r.child)}function pp(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),np(r,a,h),vf(r,a,h,y),h=!0;else if(e===null){var I=r.stateNode,Y=r.memoizedProps;I.props=Y;var te=I.context,fe=a.contextType;typeof fe=="object"&&fe!==null?fe=yr(fe):(fe=Wn(a)?Fo:Sn.current,fe=Ls(r,fe));var be=a.getDerivedStateFromProps,Ee=typeof be=="function"||typeof I.getSnapshotBeforeUpdate=="function";Ee||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==h||te!==fe)&&rp(r,I,h,fe),io=!1;var _e=r.memoizedState;I.state=_e,pc(r,h,I,y),te=r.memoizedState,Y!==h||_e!==te||Zn.current||io?(typeof be=="function"&&(Af(r,a,be,h),te=r.memoizedState),(Y=io||tp(r,a,Y,h,_e,te,fe))?(Ee||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=te),I.props=h,I.state=te,I.context=fe,h=Y):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{I=r.stateNode,Th(e,r),Y=r.memoizedProps,fe=r.type===r.elementType?Y:Fr(r.type,Y),I.props=fe,Ee=r.pendingProps,_e=I.context,te=a.contextType,typeof te=="object"&&te!==null?te=yr(te):(te=Wn(a)?Fo:Sn.current,te=Ls(r,te));var Me=a.getDerivedStateFromProps;(be=typeof Me=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==Ee||_e!==te)&&rp(r,I,
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 Ly(n){const s=R.useRef(null),i=R.useRef(null),l=R.useCallback(()=>{i.current!==null&&(clearInterval(i.current),i.current=null),s.current=null},[]),c=R.useCallback(async()=>{const p=s.current;if(!p)return;let d=null,g=null;for(let m=0;m<2;m++)try{d=await it.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,Fy(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=R.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 it.requestTelemetry(d,"");break}catch(N){x=N instanceof Error?N: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(N=>[...N,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 w=$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,w]),i.current=window.setInterval(c,Ry),!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 R.useEffect(()=>()=>{i.current!==null&&clearInterval(i.current)},[]),{handleAirtimeCommand:u,stopTracking:l}}function ru(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 My(n){return["Telemetry",`Battery Voltage: ${n.battery_volts.toFixed(3)}V`,`Uptime: ${ru(n.uptime_seconds)}`,`TX Airtime: ${ru(n.airtime_seconds)}`,`RX Airtime: ${ru(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 Iy(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 [${ru(l.last_heard_seconds)} ago]`)}return i.join(`
|
||||
`)}function Oy(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 jy(n,s,i){const[l,c]=R.useState(!1),{handleAirtimeCommand:u,stopTracking:p}=Ly(i);R.useEffect(()=>{c(!1),p()},[n==null?void 0:n.id,p]);const d=R.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)===id},[n,s]),g=R.useCallback(async x=>{if(!(!n||n.type!=="contact")&&d)try{const A=await it.requestTelemetry(n.id,x),w=qo(n.id,My(A),!1,0),k=qo(n.id,Iy(A.neighbors),!1,1),N=qo(n.id,Oy(A.acl),!1,2);i(C=>[...C,w,k,N]),c(!0)}catch(A){const w=qo(n.id,`Telemetry request failed: ${A instanceof Error?A.message:"Unknown error"}`,!1,0);i(k=>[...k,w])}},[n,d,i]),m=R.useCallback(async x=>{if(!n||n.type!=="contact"||!d||!l||await u(x,n.id))return;const w=qo(n.id,`> ${x}`,!0,0);i(k=>[...k,w]);try{const k=await it.sendRepeaterCommand(n.id,x),N=qo(n.id,k.response,!1,1);k.sender_timestamp&&(N.sender_timestamp=k.sender_timestamp),i(C=>[...C,N])}catch(k){const N=qo(n.id,`Command failed: ${k instanceof Error?k.message:"Unknown error"}`,!1,1);i(C=>[...C,N])}},[n,d,l,i,u]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:g,handleRepeaterCommand:m}}const vx="remoteterm-lastMessageTime",yx="remoteterm-sortOrder";let $u={};function om(n){$u={...n}}function sm(){return{...$u}}function n0(n,s){return $u[n]=s,{...$u}}function jr(n,s){return`${n}-${s}`}function zy(){try{const n=localStorage.getItem(vx);return n?JSON.parse(n):{}}catch{return{}}}function Hy(){try{return localStorage.getItem(yx)==="alpha"?"alpha":"recent"}catch{return"recent"}}function am(){try{localStorage.removeItem(vx),localStorage.removeItem(yx)}catch{}}function lm(n,s){if(!s)return!1;const i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${i}\\]`,"i").test(n)}function Vy(n,s,i,l=null){const[c,u]=R.useState({}),[p,d]=R.useState({}),[g,m]=R.useState(sm),x=R.useRef(l);R.useEffect(()=>{x.current=l},[l]);const A=R.useRef(new Set),w=R.useRef(new Set);R.useEffect(()=>{const B=n.filter(F=>!A.current.has(F.key)),S=s.filter(F=>F.public_key&&!w.current.has(F.public_key));if(B.length===0&&S.length===0)return;B.forEach(F=>A.current.add(F.key)),S.forEach(F=>w.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 H={};for(let Z=0;Z<F.length;Z+=200){const Q=F.slice(Z,Z+200),J=await it.getMessagesBulk(Q,j0);Object.assign(H,J)}const V={},j={},ee={};for(const Z of B){const Q=H[`CHAN:${Z.key}`]||[];if(Q.length>0){const J=jr("channel",Z.key),$=Z.last_read_at||0,oe=Q.filter(G=>!G.outgoing&&G.received_at>$);oe.length>0&&(V[J]=oe.length,oe.some(G=>lm(G.text,x.current))&&(j[J]=!0));const me=Math.max(...Q.map(G=>G.received_at));ee[J]=me,n0(J,me)}}for(const Z of S){const Q=H[`PRIV:${Z.public_key}`]||[];if(Q.length>0){const J=jr("contact",Z.public_key),$=Z.last_read_at||0,oe=Q.filter(G=>!G.outgoing&&G.received_at>$);oe.length>0&&(V[J]=oe.length,oe.some(G=>lm(G.text,x.current))&&(j[J]=!0));const me=Math.max(...Q.map(G=>G.received_at));ee[J]=me,n0(J,me)}}Object.keys(V).length>0&&u(Z=>({...Z,...V})),Object.keys(j).length>0&&d(Z=>({...Z,...j})),m(sm())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[n,s]),R.useEffect(()=>{if(i&&i.type!=="raw"&&i.type!=="map"){const B=jr(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"?it.markChannelRead(i.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):i.type==="contact"&&it.markContactRead(i.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})}},[i]);const k=R.useCallback((B,S)=>{u(T=>({...T,[B]:(T[B]||0)+1})),S&&d(T=>({...T,[B]:!0}))},[]),N=R.useCallback(()=>{u({}),d({}),it.markAllRead().catch(B=>{console.error("Failed to mark all as read on server:",B)})},[]),C=R.useCallback(B=>{if(B.type==="raw"||B.type==="map")return;const S=jr(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"?it.markChannelRead(B.id).catch(T=>{console.error("Failed to mark channel as read on server:",T)}):B.type==="contact"&&it.markContactRead(B.id).catch(T=>{console.error("Failed to mark contact as read on server:",T)})},[]),b=R.useCallback(B=>{let S=null;if(B.type==="CHAN"&&B.conversation_key?S=jr("channel",B.conversation_key):B.type==="PRIV"&&B.conversation_key&&(S=jr("contact",B.conversation_key)),S){const T=B.received_at||Math.floor(Date.now()/1e3),F=n0(S,T);m(F)}},[]);return{unreadCounts:c,mentions:p,lastMessageTimes:g,incrementUnread:k,markAllRead:N,markConversationRead:C,trackNewMessage:b}}var z0=Ax();const _x=aa(z0);function Uy(n){if(typeof document>"u")retur
Line truncated
|
||||
`)}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 jy(n,s,i){const[l,c]=R.useState(!1),{handleAirtimeCommand:u,stopTracking:p}=Ly(i);R.useEffect(()=>{c(!1),p()},[n==null?void 0:n.id,p]);const d=R.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)===id},[n,s]),g=R.useCallback(async x=>{if(!(!n||n.type!=="contact")&&d)try{const A=await it.requestTelemetry(n.id,x),w=qo(n.id,My(A),!1,0),k=qo(n.id,Iy(A.neighbors),!1,1),N=qo(n.id,Oy(A.acl),!1,2);i(C=>[...C,w,k,N]),c(!0)}catch(A){const w=qo(n.id,`Telemetry request failed: ${A instanceof Error?A.message:"Unknown error"}`,!1,0);i(k=>[...k,w])}},[n,d,i]),m=R.useCallback(async x=>{if(!n||n.type!=="contact"||!d||!l||await u(x,n.id))return;const w=qo(n.id,`> ${x}`,!0,0);i(k=>[...k,w]);try{const k=await it.sendRepeaterCommand(n.id,x),N=qo(n.id,k.response,!1,1);k.sender_timestamp&&(N.sender_timestamp=k.sender_timestamp),i(C=>[...C,N])}catch(k){const N=qo(n.id,`Command failed: ${k instanceof Error?k.message:"Unknown error"}`,!1,1);i(C=>[...C,N])}},[n,d,l,i,u]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:g,handleRepeaterCommand:m}}const vx="remoteterm-lastMessageTime",yx="remoteterm-sortOrder";let $u={};function om(n){$u={...n}}function sm(){return{...$u}}function n0(n,s){return $u[n]=s,{...$u}}function jr(n,s){return`${n}-${s}`}function zy(){try{const n=localStorage.getItem(vx);return n?JSON.parse(n):{}}catch{return{}}}function Hy(){try{return localStorage.getItem(yx)==="alpha"?"alpha":"recent"}catch{return"recent"}}function am(){try{localStorage.removeItem(vx),localStorage.removeItem(yx)}catch{}}function lm(n,s){if(!s)return!1;const i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${i}\\]`,"i").test(n)}function Vy(n,s,i,l=null){const[c,u]=R.useState({}),[p,d]=R.useState({}),[g,m]=R.useState(sm),x=R.useRef(l);R.useEffect(()=>{x.current=l},[l]);const A=R.useRef(new Set),w=R.useRef(new Set);R.useEffect(()=>{const B=n.filter(F=>!A.current.has(F.key)),S=s.filter(F=>F.public_key&&!w.current.has(F.public_key));if(B.length===0&&S.length===0)return;B.forEach(F=>A.current.add(F.key)),S.forEach(F=>w.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 H={};for(let Z=0;Z<F.length;Z+=200){const Q=F.slice(Z,Z+200),J=await it.getMessagesBulk(Q,j0);Object.assign(H,J)}const V={},j={},ee={};for(const Z of B){const Q=H[`CHAN:${Z.key}`]||[];if(Q.length>0){const J=jr("channel",Z.key),$=Z.last_read_at||0,oe=Q.filter(G=>!G.outgoing&&G.received_at>$);oe.length>0&&(V[J]=oe.length,oe.some(G=>lm(G.text,x.current))&&(j[J]=!0));const me=Math.max(...Q.map(G=>G.received_at));ee[J]=me,n0(J,me)}}for(const Z of S){const Q=H[`PRIV:${Z.public_key}`]||[];if(Q.length>0){const J=jr("contact",Z.public_key),$=Z.last_read_at||0,oe=Q.filter(G=>!G.outgoing&&G.received_at>$);oe.length>0&&(V[J]=oe.length,oe.some(G=>lm(G.text,x.current))&&(j[J]=!0));const me=Math.max(...Q.map(G=>G.received_at));ee[J]=me,n0(J,me)}}Object.keys(V).length>0&&u(Z=>({...Z,...V})),Object.keys(j).length>0&&d(Z=>({...Z,...j})),m(sm())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[n,s]),R.useEffect(()=>{if(i&&i.type!=="raw"&&i.type!=="map"){const B=jr(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"?it.markChannelRead(i.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):i.type==="contact"&&it.markContactRead(i.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})}},[i]);const k=R.useCallback((B,S)=>{u(T=>({...T,[B]:(T[B]||0)+1})),S&&d(T=>({...T,[B]:!0}))},[]),N=R.useCallback(()=>{u({}),d({}),it.markAllRead().catch(B=>{console.error("Failed to mark all as read on server:",B)})},[]),C=R.useCallback(B=>{if(B.type==="raw"||B.type==="map")return;const S=jr(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"?it.markChannelRead(B.id).catch(T=>{console.error("Failed to mark channel as read on server:",T)}):B.type==="contact"&&it.markContactRead(B.id).catch(T=>{console.error("Failed to mark contact as read on server:",T)})},[]),b=R.useCallback(B=>{let S=null;if(B.type==="CHAN"&&B.conversation_key?S=jr("channel",B.conversation_key):B.type==="PRIV"&&B.conversation_key&&(S=jr("contact",B.conversation_key)),S){const T=B.received_at||Math.floor(Date.now()/1e3),F=n0(S,T);m(F)}},[]);return{unreadCounts:c,mentions:p,lastMessageTimes:g,incrementUnread:k,markAllRead:N,markConversationRead:C,trackNewMessage:b}}var z0=Ax();const _x=aa(z0);function Uy(n){if(typeof document>"u")retur
Line truncated
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
@@ -78,7 +78,7 @@ No ACL entries`;const s=[`ACL (${n.length})`];for(const i of n){const l=i.name||
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const S_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bx=H0("x",S_);function B_({health:n,config:s,onSettingsClick:i,onMenuClick:l}){const c=(n==null?void 0:n.radio_connected)??!1,[u,p]=R.useState(!1),d=async()=>{p(!0);try{const g=await it.reconnectRadio();g.connected&&yt.success("Reconnected",{description:g.message})}catch(g){yt.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return _.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&_.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:_.jsx(k_,{className:"h-5 w-5"})}),_.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),_.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-[#4caf50]":"bg-[#666]"}`}),_.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:c?"Connected":"Disconnected"})]}),s&&_.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[_.jsx("span",{className:"text-[#e0e0e0]",children:s.name||"Unnamed"}),_.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(s.public_key),yt.success("Public key copied!")},title:"Click to copy public key",children:s.public_key.toLowerCase()})]}),!c&&_.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"}),_.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:[_.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const P_=12;function T_(n){return n.slice(0,P_)}function Di(n,s){return n||T_(s)}const na=2,D_={text:"🛜",background:"#444444",textColor:"#ffffff"};function R_(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 N_=/[\u{1F1E0}-\u{1F1FF}]{2}|[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]/u;function F_(n,s){if(!n)return s.slice(0,2).toUpperCase();const i=n.match(N_);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 L_(n){const s=R_(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 M_(n,s,i){if(i===na)return D_;const l=F_(n,s),c=L_(s);return{text:l,background:c.background,textColor:c.text}}function y0({name:n,publicKey:s,size:i=28,contactType:l}){const c=M_(n,s,l);return _.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 Cx="remoteterm-favorites";function ts(n,s,i){return n.some(l=>l.type===s&&l.id===i)}function I_(){try{const n=localStorage.getItem(Cx);return n?JSON.parse(n):[]}catch{return[]}}function fm(){try{localStorage.removeItem(Cx)}catch{}}function Ex(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=Ex(n[s]))&&(l&&(l+=" "),l+=i)}else for(i in n)n[i]&&(l&&(l+=" "),l+=i);return l}function kx(){for(var n,s,i=0,l="",c=arguments.length;i<c;i++)(n=arguments[i])&&(s=Ex(n))&&(l&&(l+=" "),l+=s);return l}const O_=(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},j_=(n,s)=>({classGroupId:n,validator:s}),Sx=(n=new Map,s=null,i)=>({nextPart:n,validators:s,classGroupId:i}),Ku="-",hm=[],z_="arbitrary..",H_=n=>{const s=U_(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return V_(p);const d=p.split(Ku),g=d[0]===""&&d.length>1?1:0;return Bx(d,g,s)},getConflictingClassGroupIds:(p,d)=>{if(d){const g=l[p],m=i[p];return g?m?O_(m,g):g:m||hm}return i[p]||hm}}},Bx=(n,s,i)=>{if(n.length-s===0)return i.classGroupId;const c=n[s],u=i.nextPart.get(c);if(u){const m=Bx(n,s+1,u);if(m)return m}const p=i.validators;if(p===null)return;const d=s===0?n.join(Ku):n.slice(s).join(Ku),g=p.length;for(let m=0;m<g;m++){const x=p[m];if(x.validator(d))return x.classGroupId}},V_=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?z_+l:void 0})(),U_=n=>{const{theme:s,classLine truncated
|
||||
*/const S_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bx=H0("x",S_);function B_({health:n,config:s,onSettingsClick:i,onMenuClick:l}){const c=(n==null?void 0:n.radio_connected)??!1,[u,p]=R.useState(!1),d=async()=>{p(!0);try{const g=await it.reconnectRadio();g.connected&&vt.success("Reconnected",{description:g.message})}catch(g){vt.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return _.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&_.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:_.jsx(k_,{className:"h-5 w-5"})}),_.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),_.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-[#4caf50]":"bg-[#666]"}`}),_.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:c?"Connected":"Disconnected"})]}),s&&_.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[_.jsx("span",{className:"text-[#e0e0e0]",children:s.name||"Unnamed"}),_.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(s.public_key),vt.success("Public key copied!")},title:"Click to copy public key",children:s.public_key.toLowerCase()})]}),!c&&_.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"}),_.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:[_.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const P_=12;function T_(n){return n.slice(0,P_)}function Di(n,s){return n||T_(s)}const na=2,D_={text:"🛜",background:"#444444",textColor:"#ffffff"};function R_(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 N_=/[\u{1F1E0}-\u{1F1FF}]{2}|[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]/u;function F_(n,s){if(!n)return s.slice(0,2).toUpperCase();const i=n.match(N_);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 L_(n){const s=R_(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 M_(n,s,i){if(i===na)return D_;const l=F_(n,s),c=L_(s);return{text:l,background:c.background,textColor:c.text}}function y0({name:n,publicKey:s,size:i=28,contactType:l}){const c=M_(n,s,l);return _.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 Cx="remoteterm-favorites";function ts(n,s,i){return n.some(l=>l.type===s&&l.id===i)}function I_(){try{const n=localStorage.getItem(Cx);return n?JSON.parse(n):[]}catch{return[]}}function fm(){try{localStorage.removeItem(Cx)}catch{}}function Ex(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=Ex(n[s]))&&(l&&(l+=" "),l+=i)}else for(i in n)n[i]&&(l&&(l+=" "),l+=i);return l}function kx(){for(var n,s,i=0,l="",c=arguments.length;i<c;i++)(n=arguments[i])&&(s=Ex(n))&&(l&&(l+=" "),l+=s);return l}const O_=(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},j_=(n,s)=>({classGroupId:n,validator:s}),Sx=(n=new Map,s=null,i)=>({nextPart:n,validators:s,classGroupId:i}),Ku="-",hm=[],z_="arbitrary..",H_=n=>{const s=U_(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return V_(p);const d=p.split(Ku),g=d[0]===""&&d.length>1?1:0;return Bx(d,g,s)},getConflictingClassGroupIds:(p,d)=>{if(d){const g=l[p],m=i[p];return g?m?O_(m,g):g:m||hm}return i[p]||hm}}},Bx=(n,s,i)=>{if(n.length-s===0)return i.classGroupId;const c=n[s],u=i.nextPart.get(c);if(u){const m=Bx(n,s+1,u);if(m)return m}const p=i.validators;if(p===null)return;const d=s===0?n.join(Ku):n.slice(s).join(Ku),g=p.length;for(let m=0;m<g;m++){const x=p[m];if(x.validator(d))return x.classGroupId}},V_=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?z_+l:void 0})(),U_=n=>{const{theme:s,classLine truncated
|
||||
.`.concat(Ew,` {
|
||||
overflow: hidden `).concat(l,`;
|
||||
padding-right: `).concat(d,"px ").concat(l,`;
|
||||
@@ -123,7 +123,7 @@ No ACL entries`;const s=[`ACL (${n.length})`];for(const i of n){const l=i.name||
|
||||
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 R.useEffect(()=>{n&&(document.getElementById(n)||console.error(i))},[i,n]),null},C2="DialogDescriptionWarning",E2=({contentRef:n,descriptionId:s})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${mA(C2).contentName}}.`;return R.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},gA=nA,xA=oA,ld=sA,cd=aA,ud=cA,dd=dA,AA=hA;const $0=gA,k2=xA,vA=R.forwardRef(({className:n,...s},i)=>_.jsx(ld,{ref:i,className:lt("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}));vA.displayName=ld.displayName;const fd=R.forwardRef(({className:n,children:s,...i},l)=>_.jsxs(k2,{children:[_.jsx(vA,{}),_.jsxs(cd,{ref:l,className:lt("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,_.jsxs(AA,{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:[_.jsx(bx,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fd.displayName=cd.displayName;const hd=({className:n,...s})=>_.jsx("div",{className:lt("flex flex-col space-y-1.5 text-center sm:text-left",n),...s});hd.displayName="DialogHeader";const K0=({className:n,...s})=>_.jsx("div",{className:lt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...s});K0.displayName="DialogFooter";const pd=R.forwardRef(({className:n,...s},i)=>_.jsx(ud,{ref:i,className:lt("text-lg font-semibold leading-none tracking-tight",n),...s}));pd.displayName=ud.displayName;const md=R.forwardRef(({className:n,...s},i)=>_.jsx(dd,{ref:i,className:lt("text-sm text-muted-foreground",n),...s}));md.displayName=dd.displayName;function S2(){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 yA(n){return`#map/focus/${encodeURIComponent(n)}`}function B2(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 P2(n){const s=B2(n);s!==window.location.hash&&window.history.replaceState(null,"",s||window.location.pathname)}function T2({open:n,onClose:s,paths:i,senderInfo:l,contacts:c,config:u}){const p=i.map(g=>({...g,resolved:H1(g.path,l,c,u)})),d=i.length===1;return _.jsx($0,{open:n,onOpenChange:g=>!g&&s(),children:_.jsxs(fd,{className:"max-w-md max-h-[80vh] flex flex-col",children:[_.jsxs(hd,{children:[_.jsxs(pd,{children:["Message Path",!d&&`s (${i.length})`]}),_.jsx(md,{children:d?_.jsxs(_.Fragment,{children:["This shows ",_.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."]}):_.jsxs(_.Fragment,{children:["This message was received via ",_.jsxs("strong",{children:[i.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[p.map((g,m)=>_.jsxs("div",{children:[!d&&_.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)]}),_.jsx(D2,{resolved:g.resolved,senderInfo:l,hideStraightLine:!d})]},m)),!d&&p.length>0&&(()=>{const g=p[0].resolved;return Tt(g.sender.lat,g.sender.lon)&&Tt(g.receiver.lat,g.receiver.lon)?_.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[_.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),_.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((K,ce,he)=>_.jsxs("span",{children:[F2(K,d),ce<he.length-1&&_.jsx("br",{})]},ce)),!ne&&_.jsxs(_.Fragment,{children:[_.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&&_.jsx(Lm,{paths:j.paths,variant:"inline",onClick:()=>C({paths:j.paths,senderInfo:M(j,Z,J)})})]}),j.outgoing&&(j.acked>0?` ✓${j.acked>1?j.acked:""}`:" ?")]})]})]},j.id)})]}),w&&_.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:_.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:_.jsx("polyline",{points:"6 9 12 15 18 9"})})}),N&&_.jsx(T2,{open:!0,onClose:()=>C(null),paths:N.paths,senderInfo:N.senderInfo,contacts:s,config:g??null})]})}const Mm=156,M2=140,I2=156,O2=120,j2=8,z2=R.forwardRef(function({onSend:s,disabled:i,placeholder:l,isRepeaterMode:c,conversationType:u,senderName:p},d){const[g,m]=R.useState(""),[x,A]=R.useState(!1),w=R.useRef(null);R.useImperativeHandle(d,()=>({appendText:M=>{var H;m(V=>V+M),(H=w.current)==null||H.focus()}}));const k=R.useMemo(()=>{if(u==="contact")return{warningAt:M2,dangerAt:Mm,hardLimit:Mm};if(u==="channel"){const M=(p==null?void 0:p.length)??10,H=Math.max(1,I2-M-2);return{warningAt:O2,dangerAt:Math.max(1,H-j2),hardLimit:H}}return null},[u,p]),{limitState:N,warningMessage:C}=R.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]),b=k?k.hardLimit-g.length:0,B=R.useCallback(async M=>{M.preventDefault();const H=g.trim();if(c){if(x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to request telemetry:",V),yt.error("Failed to request telemetry",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=w.current)==null?void 0:V.focus()},0)}else{if(!H||x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to send message:",V),yt.error("Failed to send message",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=w.current)==null?void 0:V.focus()},0)}},[g,x,i,s,c]),S=R.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),B(M))},[B]),T=c?!0:g.trim().length>0,F=!c&&k!==null;return _.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:B,children:[_.jsxs("div",{className:"flex gap-2",children:[_.jsx(en,{ref:w,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"}),_.jsx(_n,{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&&_.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[_.jsxs("span",{className:lt("tabular-nums",N==="error"||N==="danger"?"text-red-500 font-medium":N==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",k.hardLimit,b<0&&` (${b})`]}),C&&_.jsxs("span",{className:lt(N==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function Im(n){const s=H2(n),i=R.forwardRef((l,c)=>{const{children:u,...p}=l,d=R.Children.toArray(u),g=d.find(U2);if(g){const m=g.props.children,x=d.map(A=>A===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:A);return _.jsx(s,{...p,ref:c,children:R.isValidElement(m)?R.cloneElement(m,void 0,x):null})}return _.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function H2(n){const s=R.forwardRef((i,l)=>{const{children:c,...u}=i;if(R.isValidElement(c)){const p=W2(c),d=Z2(u,c.props);return c.type!==R.Fragment&&(d.ref=l?El(l,p):p),R.cloneElement(c,d)}return R.Children.count(c)>1?R.Children.only(null):null});return s.displayName=`${n}.SlotClone`,s}var V2=Symbol("radix.slottable");function U2(n){return R.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===V2}function Z2(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}}function
Line truncated
|
||||
`).map((K,ce,he)=>_.jsxs("span",{children:[F2(K,d),ce<he.length-1&&_.jsx("br",{})]},ce)),!ne&&_.jsxs(_.Fragment,{children:[_.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&&_.jsx(Lm,{paths:j.paths,variant:"inline",onClick:()=>C({paths:j.paths,senderInfo:M(j,Z,J)})})]}),j.outgoing&&(j.acked>0?` ✓${j.acked>1?j.acked:""}`:" ?")]})]})]},j.id)})]}),w&&_.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:_.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:_.jsx("polyline",{points:"6 9 12 15 18 9"})})}),N&&_.jsx(T2,{open:!0,onClose:()=>C(null),paths:N.paths,senderInfo:N.senderInfo,contacts:s,config:g??null})]})}const Mm=156,M2=140,I2=156,O2=120,j2=8,z2=R.forwardRef(function({onSend:s,disabled:i,placeholder:l,isRepeaterMode:c,conversationType:u,senderName:p},d){const[g,m]=R.useState(""),[x,A]=R.useState(!1),w=R.useRef(null);R.useImperativeHandle(d,()=>({appendText:M=>{var H;m(V=>V+M),(H=w.current)==null||H.focus()}}));const k=R.useMemo(()=>{if(u==="contact")return{warningAt:M2,dangerAt:Mm,hardLimit:Mm};if(u==="channel"){const M=(p==null?void 0:p.length)??10,H=Math.max(1,I2-M-2);return{warningAt:O2,dangerAt:Math.max(1,H-j2),hardLimit:H}}return null},[u,p]),{limitState:N,warningMessage:C}=R.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]),b=k?k.hardLimit-g.length:0,B=R.useCallback(async M=>{M.preventDefault();const H=g.trim();if(c){if(x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to request telemetry:",V),vt.error("Failed to request telemetry",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=w.current)==null?void 0:V.focus()},0)}else{if(!H||x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to send message:",V),vt.error("Failed to send message",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=w.current)==null?void 0:V.focus()},0)}},[g,x,i,s,c]),S=R.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),B(M))},[B]),T=c?!0:g.trim().length>0,F=!c&&k!==null;return _.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:B,children:[_.jsxs("div",{className:"flex gap-2",children:[_.jsx(en,{ref:w,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"}),_.jsx(_n,{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&&_.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[_.jsxs("span",{className:lt("tabular-nums",N==="error"||N==="danger"?"text-red-500 font-medium":N==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",k.hardLimit,b<0&&` (${b})`]}),C&&_.jsxs("span",{className:lt(N==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function Im(n){const s=H2(n),i=R.forwardRef((l,c)=>{const{children:u,...p}=l,d=R.Children.toArray(u),g=d.find(U2);if(g){const m=g.props.children,x=d.map(A=>A===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:A);return _.jsx(s,{...p,ref:c,children:R.isValidElement(m)?R.cloneElement(m,void 0,x):null})}return _.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function H2(n){const s=R.forwardRef((i,l)=>{const{children:c,...u}=i;if(R.isValidElement(c)){const p=W2(c),d=Z2(u,c.props);return c.type!==R.Fragment&&(d.ref=l?El(l,p):p),R.cloneElement(c,d)}return R.Children.count(c)>1?R.Children.only(null):null});return s.displayName=`${n}.SlotClone`,s}var V2=Symbol("radix.slottable");function U2(n){return R.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===V2}function Z2(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}}function
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:
|
||||
@@ -132,20 +132,20 @@ For more information, see https://radix-ui.com/primitives/docs/components/${s.do
|
||||
- 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]),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]),k=p.create([0,1518500249,1859775393,2400959708,2840853838]),N=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(H,V){for(var j=0;j<16;j++){var ee=V+j,Z=H[ee];H[ee]=(Z<<8|Z>>>24)&16711935|(Z<<24|Z>>>8)&4278255360}var Q=this._hash.words,J=k.words,$=N.words,oe=m.words,me=x.words,G=A.words,se=w.words,W,ne,U,D,z,q,K,ce,he,xe;q=W=Q[0],K=ne=Q[1],ce=U=Q[2],he=D=Q[3],xe=z=Q[4];for(var pe,j=0;j<80;j+=1)pe=W+H[V+oe[j]]|0,j<16?pe+=b(ne,U,D)+J[0]:j<32?pe+=B(ne,U,D)+J[1]:j<48?pe+=S(ne,U,D)+J[2]:j<64?pe+=T(ne,U,D)+J[3]:pe+=F(ne,U,D)+J[4],pe=pe|0,pe=M(pe,G[j]),pe=pe+z|0,W=z,z=D,D=M(U,10),U=ne,ne=pe,pe=q+H[V+me[j]]|0,j<16?pe+=F(K,ce,he)+$[0]:j<32?pe+=T(K,ce,he)+$[1]:j<48?pe+=S(K,ce,he)+$[2]:j<64?pe+=B(K,ce,he)+$[3]:pe+=b(K,ce,he)+$[4],pe=pe|0,pe=M(pe,se[j]),pe=pe+xe|0,q=xe,xe=he,he=M(ce,10),ce=K,K=pe;pe=Q[1]+U+he|0,Q[1]=Q[2]+D+xe|0,Q[2]=Q[3]+z+q|0,Q[3]=Q[4]+W+K|0,Q[4]=Q[0]+ne+ce|0,Q[0]=pe},_doFinalize:function(){var H=this._data,V=H.words,j=this._nDataBytes*8,ee=H.sigBytes*8;V[ee>>>5]|=128<<24-ee%32,V[(ee+64>>>9<<4)+14]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360,H.sigBytes=(V.length+1)*4,this._process();for(var Z=this._hash,Q=Z.words,J=0;J<5;J++){var $=Q[J];Q[J]=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360}return Z},clone:function(){var H=d.clone.call(this);return H._hash=this._hash.clone(),H}});function b(H,V,j){return H^V^j}function B(H,V,j){return H&V|~H&j}function S(H,V,j){return(H|~V)^j}function T(H,V,j){return H&j|V&~j}function F(H,V,j){return H^(V|~j)}function M(H,V){return H<<V|H>>>32-V}c.RIPEMD160=d._createHelper(C),c.HmacRIPEMD160=d._createHmacHelper(C)})(),i.RIPEMD160})})(_u)),_u.exports}var wu={exports:{}},Kb=wu.exports,ng;function yd(){return ng||(ng=1,(function(n,s){(function(i,l){n.exports=l(At())})(Kb,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,w=A*4;x.sigBytes>w&&(x=m.finalize(x)),x.clamp();for(var k=this._oKey=x.clone(),N=this._iKey=x.clone(),C=k.words,b=N.words,B=0;B<A;B++)C[B]^=1549556828,b[B]^=909522486;k.sigBytes=N.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 x=this._hasher,A=x.finalize(m);x.reset();var w=x.finalize(this._oKey.clone().concat(A));return w}})})()})})(wu)),wu.exports}var bu={exports:{}},Qb=bu.exports,rg;function Yb(){return rg||(rg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),Bl(),yd())})(Qb,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,w){for(var k=this.cfg,N=m.create(k.hasher,A),C=p.create(),b=p.create([1]),B=C.words,S=b.words,T=k.keySize,F=k.iterations;B.length<T;){var M=N.update(w).finalize(b);N.reset();for(var H=M.words,V=H.length,j=M,ee=1;ee<F;ee++){j=N.finalize(j),N.reset();for(var Z=j.words,Q=0;Q<V;Q++)H[Q]^=Z[Q]}C.concat(M),S[0]++}return C.sigBytes=T*4,C}});l.PBKDF2=function(A,w,k){return x.create(k).compute(A,w)}})(),i.PBKDF2})})(bu)),bu.exports}var Cu={exports:{}},Xb=Cu.exports,ig;function vo(){return ig||(ig=1,(function(n,s){(function(i,l,c){n.exports=l(At(),XA(),yd())})(Xb,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 w,k=this.cfg,N=k.hasher.create(),C=p.create(),b=C.words,B=k.keySize,S=k.iterations;b.length<B;){w&&N.update(w),w=N.update(x).finalize(A),N.reset();for(var T=1;T<S;T++)w=N.finalize(w),N.reset();C.concat(w)}return C.sigBytes=B*4,C}});l.EvpKDF=function(x,A,w){return m.create(w).compute(x,A)}})(),i.EvpKDF})})(Cu)),Cu.exports}var Eu={exports:{}},Jb=Eu.exports,og;Line truncated
|
||||
*/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]),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]),k=p.create([0,1518500249,1859775393,2400959708,2840853838]),N=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(H,V){for(var j=0;j<16;j++){var ee=V+j,Z=H[ee];H[ee]=(Z<<8|Z>>>24)&16711935|(Z<<24|Z>>>8)&4278255360}var Q=this._hash.words,J=k.words,$=N.words,oe=m.words,me=x.words,G=A.words,se=w.words,W,ne,U,D,z,q,K,ce,he,xe;q=W=Q[0],K=ne=Q[1],ce=U=Q[2],he=D=Q[3],xe=z=Q[4];for(var pe,j=0;j<80;j+=1)pe=W+H[V+oe[j]]|0,j<16?pe+=b(ne,U,D)+J[0]:j<32?pe+=B(ne,U,D)+J[1]:j<48?pe+=S(ne,U,D)+J[2]:j<64?pe+=T(ne,U,D)+J[3]:pe+=F(ne,U,D)+J[4],pe=pe|0,pe=M(pe,G[j]),pe=pe+z|0,W=z,z=D,D=M(U,10),U=ne,ne=pe,pe=q+H[V+me[j]]|0,j<16?pe+=F(K,ce,he)+$[0]:j<32?pe+=T(K,ce,he)+$[1]:j<48?pe+=S(K,ce,he)+$[2]:j<64?pe+=B(K,ce,he)+$[3]:pe+=b(K,ce,he)+$[4],pe=pe|0,pe=M(pe,se[j]),pe=pe+xe|0,q=xe,xe=he,he=M(ce,10),ce=K,K=pe;pe=Q[1]+U+he|0,Q[1]=Q[2]+D+xe|0,Q[2]=Q[3]+z+q|0,Q[3]=Q[4]+W+K|0,Q[4]=Q[0]+ne+ce|0,Q[0]=pe},_doFinalize:function(){var H=this._data,V=H.words,j=this._nDataBytes*8,ee=H.sigBytes*8;V[ee>>>5]|=128<<24-ee%32,V[(ee+64>>>9<<4)+14]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360,H.sigBytes=(V.length+1)*4,this._process();for(var Z=this._hash,Q=Z.words,J=0;J<5;J++){var $=Q[J];Q[J]=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360}return Z},clone:function(){var H=d.clone.call(this);return H._hash=this._hash.clone(),H}});function b(H,V,j){return H^V^j}function B(H,V,j){return H&V|~H&j}function S(H,V,j){return(H|~V)^j}function T(H,V,j){return H&j|V&~j}function F(H,V,j){return H^(V|~j)}function M(H,V){return H<<V|H>>>32-V}c.RIPEMD160=d._createHelper(C),c.HmacRIPEMD160=d._createHmacHelper(C)})(),i.RIPEMD160})})(_u)),_u.exports}var wu={exports:{}},Kb=wu.exports,ng;function yd(){return ng||(ng=1,(function(n,s){(function(i,l){n.exports=l(xt())})(Kb,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,w=A*4;x.sigBytes>w&&(x=m.finalize(x)),x.clamp();for(var k=this._oKey=x.clone(),N=this._iKey=x.clone(),C=k.words,b=N.words,B=0;B<A;B++)C[B]^=1549556828,b[B]^=909522486;k.sigBytes=N.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 x=this._hasher,A=x.finalize(m);x.reset();var w=x.finalize(this._oKey.clone().concat(A));return w}})})()})})(wu)),wu.exports}var bu={exports:{}},Qb=bu.exports,rg;function Yb(){return rg||(rg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),Bl(),yd())})(Qb,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,w){for(var k=this.cfg,N=m.create(k.hasher,A),C=p.create(),b=p.create([1]),B=C.words,S=b.words,T=k.keySize,F=k.iterations;B.length<T;){var M=N.update(w).finalize(b);N.reset();for(var H=M.words,V=H.length,j=M,ee=1;ee<F;ee++){j=N.finalize(j),N.reset();for(var Z=j.words,Q=0;Q<V;Q++)H[Q]^=Z[Q]}C.concat(M),S[0]++}return C.sigBytes=T*4,C}});l.PBKDF2=function(A,w,k){return x.create(k).compute(A,w)}})(),i.PBKDF2})})(bu)),bu.exports}var Cu={exports:{}},Xb=Cu.exports,ig;function vo(){return ig||(ig=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),XA(),yd())})(Xb,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 w,k=this.cfg,N=k.hasher.create(),C=p.create(),b=C.words,B=k.keySize,S=k.iterations;b.length<B;){w&&N.update(w),w=N.update(x).finalize(A),N.reset();for(var T=1;T<S;T++)w=N.finalize(w),N.reset();C.concat(w)}return C.sigBytes=B*4,C}});l.EvpKDF=function(x,A,w){return m.create(w).compute(x,A)}})(),i.EvpKDF})})(Cu)),Cu.exports}var Eu={exports:{}},Jb=Eu.exports,og;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,w=this._counter;A&&(w=this._counter=A.slice(0),this._iv=void 0),u(w);var k=w.slice(0);m.encryptBlock(k,0);for(var N=0;N<x;N++)d[g+N]^=k[N]}});return l.Decryptor=p,l})(),i.mode.CTRGladman})})(Bu)),Bu.exports}var Pu={exports:{}},sC=Pu.exports,cg;function aC(){return cg||(cg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(sC,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})})(Pu)),Pu.exports}var Tu={exports:{}},lC=Tu.exports,ug;function cC(){return ug||(ug=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(lC,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})})(Tu)),Tu.exports}var Du={exports:{}},uC=Du.exports,dg;function dC(){return dg||(dg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(uC,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})})(Du)),Du.exports}var Ru={exports:{}},fC=Ru.exports,fg;function hC(){return fg||(fg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(fC,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})})(Ru)),Ru.exports}var Nu={exports:{}},pC=Nu.exports,hg;function mC(){return hg||(hg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(pC,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})})(Nu)),Nu.exports}var Fu={exports:{}},gC=Fu.exports,pg;function xC(){return pg||(pg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(gC,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})})(Fu)),Fu.exports}var Lu={exports:{}},AC=Lu.exports,mg;function vC(){return mg||(mg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(AC,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding})})(Lu)),Lu.exports}var Mu={exports:{}},yC=Mu.exports,gg;function _C(){return gg||(gg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),xn())})(yC,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})})(Mu)),Mu.exports}var Iu={exports:{}},wC=Iu.exports,xg;function bC(){return xg||(xg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),ss(),as(),vo(),xn())})(wC,function(i){return(function(){var l=i,c=l.lib,u=c.BlockCipher,p=l.algo,d=[],g=[],m=[],x=[],A=[],w=[],k=[],N=[],C=[],b=[];(function(){for(var T=[],F=0;F<256;F++)F<128?T[F]=F<<1:T[F]=F<<1^283;for(var M=0,H=0,F=0;F<256;F++){var V=H^H<<1^H<<2^H<<3^H<<4;V=V>>>8^V&255^99,d[M]=V,g[V]=M;var j=T[M],ee=T[j],Z=T[ee],Q=T[V]*257^V*16843008;m[M]=Q<<24|Q>>>8,x[M]=Q<<16|Q>>>16,A[M]=Q<<8|Q>>>24,w[M]=Q;var Q=Z*16843009^ee*65537^j*257^M*16843008;k[V]=Q<<24|Q>>>8,N[V]=Q<<16|Q>>>16,C[V]=Q<<8|Q>>>24,b[V]=Q,M?(M=j^T[T[T[Z^j]]],H^=T[T[H]]):M=H=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,H=F.sigBytes/4,V=this._nRounds=H+6,j=(V+1)*4,ee=this._keySchedule=[],Z=0;Z<j;Z++)Z<H?ee[Z]=M[Z]:(T=ee[Z-1],Z%H?H>6&&Z%H==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[Z/H|0]<<24),ee[Z]=ee[Z-H]^T);for(var Q=this._invKeySchedule=[],J=0;J<j;J++){var Z=j-J;if(J%4)var T=ee[Z];else var T=ee[Z-4];J<4||Z<=4?Q[J]=T:Q[J]=k[d[T>>>24]]^N[d[T>>>16&255]]^C[d[T>>>8&255]]^b[d[T&255]]}}},encLine truncated
|
||||
*/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,w=this._counter;A&&(w=this._counter=A.slice(0),this._iv=void 0),u(w);var k=w.slice(0);m.encryptBlock(k,0);for(var N=0;N<x;N++)d[g+N]^=k[N]}});return l.Decryptor=p,l})(),i.mode.CTRGladman})})(Bu)),Bu.exports}var Pu={exports:{}},sC=Pu.exports,cg;function aC(){return cg||(cg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(sC,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})})(Pu)),Pu.exports}var Tu={exports:{}},lC=Tu.exports,ug;function cC(){return ug||(ug=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(lC,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})})(Tu)),Tu.exports}var Du={exports:{}},uC=Du.exports,dg;function dC(){return dg||(dg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(uC,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})})(Du)),Du.exports}var Ru={exports:{}},fC=Ru.exports,fg;function hC(){return fg||(fg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(fC,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})})(Ru)),Ru.exports}var Nu={exports:{}},pC=Nu.exports,hg;function mC(){return hg||(hg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(pC,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})})(Nu)),Nu.exports}var Fu={exports:{}},gC=Fu.exports,pg;function xC(){return pg||(pg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(gC,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})})(Fu)),Fu.exports}var Lu={exports:{}},AC=Lu.exports,mg;function vC(){return mg||(mg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(AC,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding})})(Lu)),Lu.exports}var Mu={exports:{}},yC=Mu.exports,gg;function _C(){return gg||(gg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),xn())})(yC,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})})(Mu)),Mu.exports}var Iu={exports:{}},wC=Iu.exports,xg;function bC(){return xg||(xg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),ss(),as(),vo(),xn())})(wC,function(i){return(function(){var l=i,c=l.lib,u=c.BlockCipher,p=l.algo,d=[],g=[],m=[],x=[],A=[],w=[],k=[],N=[],C=[],b=[];(function(){for(var T=[],F=0;F<256;F++)F<128?T[F]=F<<1:T[F]=F<<1^283;for(var M=0,H=0,F=0;F<256;F++){var V=H^H<<1^H<<2^H<<3^H<<4;V=V>>>8^V&255^99,d[M]=V,g[V]=M;var j=T[M],ee=T[j],Z=T[ee],Q=T[V]*257^V*16843008;m[M]=Q<<24|Q>>>8,x[M]=Q<<16|Q>>>16,A[M]=Q<<8|Q>>>24,w[M]=Q;var Q=Z*16843009^ee*65537^j*257^M*16843008;k[V]=Q<<24|Q>>>8,N[V]=Q<<16|Q>>>16,C[V]=Q<<8|Q>>>24,b[V]=Q,M?(M=j^T[T[T[Z^j]]],H^=T[T[H]]):M=H=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,H=F.sigBytes/4,V=this._nRounds=H+6,j=(V+1)*4,ee=this._keySchedule=[],Z=0;Z<j;Z++)Z<H?ee[Z]=M[Z]:(T=ee[Z-1],Z%H?H>6&&Z%H==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[Z/H|0]<<24),ee[Z]=ee[Z-H]^T);for(var Q=this._invKeySchedule=[],J=0;J<j;J++){var Z=j-J;if(J%4)var T=ee[Z];else var T=ee[Z-4];J<4||Z<=4?Q[J]=T:Q[J]=k[d[T>>>24]]^N[d[T>>>16&255]]^C[d[T>>>8&255]]^b[d[T&255]]}}},encLine 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:w});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:w};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={},zg;function oE(){if(zg)return cl;zg=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.ResponsePayloadDecoder=void 0;const n=dr(),s=wn();class i{static decode(c,u){try{if(c.length<4){const N={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&&(N.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)}]),N}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 w=(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:w});const k={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:w,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={},Hg;function sE(){if(Hg)return ul;Hg=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.AnonRequestPayloadDecoder=void 0;const n=dr(),s=wn();class i{static decode(c,u){try{if(c.length<35){const N={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&&(N.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)}]),N}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 w=(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:w});const k={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:x,cipherMac:A,ciphertext:w,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={},Vg;function aE(){if(Vg)return dl;Vg=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.AckPayloadDecoder=void 0;const n=dr(),s=wn();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={},Ug;function lE(){if(Ug)return fl;Ug=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.PathPayloadDecoder=void 0;const n=dr(),s=wn();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={},Zg;function cE(){if(Zg)return hl;Zg=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.TextMessagePayloadDecoder=void 0;const n=dr(),s=wn();class i{static decode(c,u){try{if(c.length<4){const N={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&&(N.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)}]),N}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 w=(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:w});const k={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:w,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
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:d+g,endByte:d+c.length-1,value:w});const k={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:x,cipherMac:A,ciphertext:w,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={},Vg;function aE(){if(Vg)return dl;Vg=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.AckPayloadDecoder=void 0;const n=dr(),s=wn();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={},Ug;function lE(){if(Ug)return fl;Ug=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.PathPayloadDecoder=void 0;const n=dr(),s=wn();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={},Zg;function cE(){if(Zg)return hl;Zg=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.TextMessagePayloadDecoder=void 0;const n=dr(),s=wn();class i{static decode(c,u){try{if(c.length<4){const N={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&&(N.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)}]),N}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 w=(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:w});const k={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:w,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 EE=gl.exports,Yg;function kE(){return Yg||(Yg=1,(function(n,s){(function(i,l){l(s)})(EE,(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,X;return X=function(){v=!1,P&&(O.apply(f,P),P=!1)},O=function(){v?P=arguments:(t.apply(f,arguments),setTimeout(X,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 w(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 N(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 b(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 H(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var V=0;function j(t){var o=+new Date,f=Math.max(0,16-(o-V));return V=o+f,window.setTimeout(t,f)}var ee=window.requestAnimationFrame||H("RequestAnimationFrame")||j,Z=window.cancelAnimationFrame||H("CancelAnimationFrame")||H("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function Q(t,o,f){if(f&&ee===j)t.call(o);else return ee.call(window,p(t,o))}function J(t){t&&Z.call(window,t)}var $={__proto__:null,extend:c,create:u,bind:p,get lastId(){return d},stamp:g,throttle:m,wrapNum:x,falseFn:A,formatNum:w,trim:k,splitWords:N,setOptions:C,getParamString:b,template:S,isArray:T,indexOf:F,emptyImageUrl:M,requestFn:ee,cancelFn:Z,requestAnimFrame:Q,cancelAnimFrame:J};function oe(){}oe.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&&(me(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,X=v._initHooks.length;O<X;O++)v._initHooks[O].call(this)}},o},oe.include=function(t){var o=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=o,this.mergeOptions(t.options)),this},oe.mergeOptions=function(t){return c(this.prototype.options,t),this},oe.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 me(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 G={on:function(t,o,f){if(typeof t=="object")for(var v in t)this._on(v,t[v],o);else{t=N(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=N(t);for(var P=arguments.length===1,O=0,X=t.length;O<X;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 X=thisLine truncated
|
||||
*/var EE=gl.exports,Yg;function kE(){return Yg||(Yg=1,(function(n,s){(function(i,l){l(s)})(EE,(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,X;return X=function(){v=!1,P&&(O.apply(f,P),P=!1)},O=function(){v?P=arguments:(t.apply(f,arguments),setTimeout(X,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 w(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 N(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 b(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 H(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var V=0;function j(t){var o=+new Date,f=Math.max(0,16-(o-V));return V=o+f,window.setTimeout(t,f)}var ee=window.requestAnimationFrame||H("RequestAnimationFrame")||j,Z=window.cancelAnimationFrame||H("CancelAnimationFrame")||H("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function Q(t,o,f){if(f&&ee===j)t.call(o);else return ee.call(window,p(t,o))}function J(t){t&&Z.call(window,t)}var $={__proto__:null,extend:c,create:u,bind:p,get lastId(){return d},stamp:g,throttle:m,wrapNum:x,falseFn:A,formatNum:w,trim:k,splitWords:N,setOptions:C,getParamString:b,template:S,isArray:T,indexOf:F,emptyImageUrl:M,requestFn:ee,cancelFn:Z,requestAnimFrame:Q,cancelAnimFrame:J};function oe(){}oe.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&&(me(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,X=v._initHooks.length;O<X;O++)v._initHooks[O].call(this)}},o},oe.include=function(t){var o=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=o,this.mergeOptions(t.options)),this},oe.mergeOptions=function(t){return c(this.prototype.options,t),this},oe.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 me(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 G={on:function(t,o,f){if(typeof t=="object")for(var v in t)this._on(v,t[v],o);else{t=N(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=N(t);for(var P=arguments.length===1,O=0,X=t.length;O<X;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 X=thisLine truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
@@ -532,11 +532,11 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
}
|
||||
}
|
||||
`}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,w=0,k=0;if(x){const M=new Uint8Array(u.length/2);for(let Z=0;Z<M.length;Z++)M[Z]=parseInt(u.substr(Z*2,2),16);w=M.length*8;const H=Math.ceil(M.length/4)*4,V=new Uint8Array(H);V.set(M),A=new Uint32Array(H/4);for(let Z=0;Z<A.length;Z++)A[Z]=V[Z*4]<<24|V[Z*4+1]<<16|V[Z*4+2]<<8|V[Z*4+3];const j=parseInt(p.substr(0,2),16),ee=parseInt(p.substr(2,2),16);k=j<<24|ee<<16}else A=new Uint32Array([0]);const N=Math.max(A.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<N)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:N,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=N,this.bindGroupDirty=!0);const C=new Uint32Array([s,l,i,c,k,A.length,w,x]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,A),this.device.queue.writeBuffer(this.matchCountBuffer,0,kd.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 b=this.device.createCommandEncoder(),B=b.beginComputePass();B.setPipeline(this.pipeline),B.setBindGroup(0,this.bindGroup),B.dispatchWorkgroups(Math.ceil(c/(256*32))),B.end(),b.copyBufferToBuffer(this.matchCountBuffer,0,g,0,4),b.copyBufferToBuffer(this.matchIndicesBuffer,0,m,0,1024*4),this.device.queue.submit([b.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 H=0;H<Math.min(T,1024);H++)F.push(M[H]);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}}kd.ZERO_DATA=new Uint32Array([0]);function oS(){return typeof navigator<"u"&&"gpu"in navigator}class fx{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(hx)}setWordlist(s){this.wordlist=s.map(i=>i.trim().toLowerCase()).filter(hx)}abort(){this.abortFlag=!0}isGpuAvailable(){return oS()}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 _t.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)??F0,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:w}=m,k=parseInt(x,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new fx):this.gpuInstance||(this.gpuInstance=new kd,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new fx));const N=performance.now();let C=0,b=performance.now(),B=u,S=0,T=0,F=!1;if(i!=null&&i.startFrom){const $=i.startFrom.toLowerCase();if(d==="dictionary"){const oe=this.wordlist.indexOf($);oe>=0&&(T=oe+1)}else{F=!0;const oe=nS($);oe&&(B=Math.max(u,oe.length),S=oe.index+1,S>=vl(B)&&(B++,S=0))}}let M=0;p&&!F&&this.wordlist.length>0&&(M+=this.wordlist.length-T);for(let $=B;$<=c;$++)M+=vl($);M-=S;const H=($,oe,me)=>{if(!l)return;const se=(performance.now()-N)/1e3,W=se>0?Math.round(C/se):0,ne=M-C,U=W>0?ne/W:0;l({checked:C,total:M,percent:M>0?Math.min(100,C/M*100):0,rateKeysPerSec:W,etaSeconds:U,elapsedSeconds:se,currentLength:oe,currentPosition:me,phase:$})},V=$=>{if(!Rv(A,w,$))return{valid:!1};const oe=_t.ChannelCrypto.decryptGroupTextMessage(A,w,$);return!oe.success||!oe.data?{valid:!1}:this.useTimestampFilter&&!rS(oe.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!iS(oe.data.message)?{valid:!1}:this.useSenderFilter&&!oe.data.sender?{valid:!1}:{valid:!0,message:oe.data.sender?`${oe.data.sender}: ${oe.data.message}`:oe.data.message}};if(!F&&T===0&&B===u&&S===0){H("public-key",0,N0);const $=M0(Gu);if(x===$){const oe=V(Gu);if(oe.valid)return{found:!0,roomName:N0,key:Gu,decryptedMessage:oe.message}}}if(p&&!F&&this.wordlist.length>0)for(let $=T;$<this.wordlist.length;$++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[$],resumeType:"dictionary"};const oe=this.wordlist[$],me=L0("#"+oe),G=M0(me);if(parseInt(G,16)===k){const W=V(me);if(W.valid)return{found:!0,roomName:oe,key:me,decryptedMessage:W.message,resumeFrom:oe,resumeType:"dictionary"}}C++;const se=performance.now();se-b>=200&&(H("wordlist",oe.length,oe),b=se,await new Promise(W=>setTimeout(W,0)))}const j=this.useCpu?1024:32768,ee=(i==null?void 0:i.gpuDispatchMs)??1e3;let Z=j,Q=!1;for(let $=B;$<=c;$++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es($,0)||void 0,resumeType:"bruteforce"};const oe=vl($);let me=$===B?S:0;for(;me<oe;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es($,me)||void 0,resumeType:"bruteforce"};const G=Math.min(Z,oe-me),se=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(k,$,me,G,A,w):W=await this.gpuInstance.runBatch(k,$,me,G,A,w);const ne=performance.now()-se;if(C+=G,!this.useCpu&&!Q&&G>=j&&ne>0){const D=ee/ne,z=Math.round(G*D),q=Math.pow(2,Math.round(Math.log2(Math.max(j,z))));Z=Math.max(j,q),Q=!0}for(const D of W){const z=es($,D);if(!z)continue;const q=L0("#"+z),K=V(q);if(K.valid)return{found:!0,roomName:z,key:q,decryptedMessage:K.message,resumeFrom:z,resumeType:"bruteforce"}}me+=G;const U=performance.now();if(U-b>=200){const D=es($,Math.min(me,oe-1))||"";H("bruteforce",$,D),b=U,await new Promise(z=>setTimeout(z,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 x0,px;function uS(){return px||(px=1,x0={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADL
Line truncated
|
||||
`).map(u=>u.trim().toLowerCase()).filter(u=>u.length>0);this.wordlist=c.filter(hx)}setWordlist(s){this.wordlist=s.map(i=>i.trim().toLowerCase()).filter(hx)}abort(){this.abortFlag=!0}isGpuAvailable(){return oS()}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 yt.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)??F0,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:w}=m,k=parseInt(x,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new fx):this.gpuInstance||(this.gpuInstance=new kd,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new fx));const N=performance.now();let C=0,b=performance.now(),B=u,S=0,T=0,F=!1;if(i!=null&&i.startFrom){const $=i.startFrom.toLowerCase();if(d==="dictionary"){const oe=this.wordlist.indexOf($);oe>=0&&(T=oe+1)}else{F=!0;const oe=nS($);oe&&(B=Math.max(u,oe.length),S=oe.index+1,S>=vl(B)&&(B++,S=0))}}let M=0;p&&!F&&this.wordlist.length>0&&(M+=this.wordlist.length-T);for(let $=B;$<=c;$++)M+=vl($);M-=S;const H=($,oe,me)=>{if(!l)return;const se=(performance.now()-N)/1e3,W=se>0?Math.round(C/se):0,ne=M-C,U=W>0?ne/W:0;l({checked:C,total:M,percent:M>0?Math.min(100,C/M*100):0,rateKeysPerSec:W,etaSeconds:U,elapsedSeconds:se,currentLength:oe,currentPosition:me,phase:$})},V=$=>{if(!Rv(A,w,$))return{valid:!1};const oe=yt.ChannelCrypto.decryptGroupTextMessage(A,w,$);return!oe.success||!oe.data?{valid:!1}:this.useTimestampFilter&&!rS(oe.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!iS(oe.data.message)?{valid:!1}:this.useSenderFilter&&!oe.data.sender?{valid:!1}:{valid:!0,message:oe.data.sender?`${oe.data.sender}: ${oe.data.message}`:oe.data.message}};if(!F&&T===0&&B===u&&S===0){H("public-key",0,N0);const $=M0(Gu);if(x===$){const oe=V(Gu);if(oe.valid)return{found:!0,roomName:N0,key:Gu,decryptedMessage:oe.message}}}if(p&&!F&&this.wordlist.length>0)for(let $=T;$<this.wordlist.length;$++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[$],resumeType:"dictionary"};const oe=this.wordlist[$],me=L0("#"+oe),G=M0(me);if(parseInt(G,16)===k){const W=V(me);if(W.valid)return{found:!0,roomName:oe,key:me,decryptedMessage:W.message,resumeFrom:oe,resumeType:"dictionary"}}C++;const se=performance.now();se-b>=200&&(H("wordlist",oe.length,oe),b=se,await new Promise(W=>setTimeout(W,0)))}const j=this.useCpu?1024:32768,ee=(i==null?void 0:i.gpuDispatchMs)??1e3;let Z=j,Q=!1;for(let $=B;$<=c;$++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es($,0)||void 0,resumeType:"bruteforce"};const oe=vl($);let me=$===B?S:0;for(;me<oe;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es($,me)||void 0,resumeType:"bruteforce"};const G=Math.min(Z,oe-me),se=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(k,$,me,G,A,w):W=await this.gpuInstance.runBatch(k,$,me,G,A,w);const ne=performance.now()-se;if(C+=G,!this.useCpu&&!Q&&G>=j&&ne>0){const D=ee/ne,z=Math.round(G*D),q=Math.pow(2,Math.round(Math.log2(Math.max(j,z))));Z=Math.max(j,q),Q=!0}for(const D of W){const z=es($,D);if(!z)continue;const q=L0("#"+z),K=V(q);if(K.valid)return{found:!0,roomName:z,key:q,decryptedMessage:K.message,resumeFrom:z,resumeType:"bruteforce"}}me+=G;const U=performance.now();if(U-b>=200){const D=es($,Math.min(me,oe-1))||"";H("bruteforce",$,D),b=U,await new Promise(z=>setTimeout(z,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 x0,px;function uS(){return px||(px=1,x0={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADL
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 A0=c,A0}var fS=dS();const hS=aa(fS);function pS(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 mS({packets:n,channels:s,onChannelCreate:i,onRunningChange:l,visible:c=!1}){const[u,p]=R.useState(!1),[d,g]=R.useState(6),[m,x]=R.useState(!1),[A,w]=R.useState(!0),[k,N]=R.useState(!1),[C,b]=R.useState(null),[B,S]=R.useState(new Map),[T,F]=R.useState([]),[M,H]=R.useState(!1),[V,j]=R.useState(null),[ee,Z]=R.useState(null),[Q,J]=R.useState(0),$=R.useRef(null),oe=R.useRef(null),me=R.useRef(!1),G=R.useRef(!1),se=R.useRef(!1),W=R.useRef(new Map),ne=R.useRef(!1),U=R.useRef(6),D=R.useRef(!0),z=R.useRef(!1),q=R.useRef(new Set),K=R.useRef(new Set);R.useEffect(()=>{const Ce=new cS;$.current=Ce,j(Ce.isGpuAvailable());const Ve=new hS;return oe.current=Ve,()=>{Ce.destroy(),$.current=null,Ve.disable(),oe.current=null}},[]),R.useEffect(()=>{!c||M||Gk(async()=>{const{ENGLISH_WORDLIST:Ce}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Ce}},[]).then(({ENGLISH_WORDLIST:Ce})=>{$.current&&($.current.setWordlist(Ce),H(!0))}).catch(Ce=>{console.error("Failed to load wordlist:",Ce),yt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[c,M]),R.useEffect(()=>{const Ce=()=>{it.getUndecryptedPacketCount().then(({count:ot})=>Z(ot)).catch(()=>Z(null))};Ce();const Ve=setInterval(Ce,36e5);return()=>clearInterval(Ve)},[]);const ce=R.useMemo(()=>new Set(s.map(Ce=>Ce.key.toUpperCase())),[s]),he=n.filter(Ce=>Ce.payload_type==="GROUP_TEXT"&&!Ce.decrypted);R.useEffect(()=>{let Ce=0;S(Ve=>{const ot=new Map(Ve);let gt=!1;for(const ct of he)if(!ot.has(ct.id)){const ht=pS(ct.data);if(ht&&K.current.has(ht)){Ce++;continue}ht&&K.current.add(ht),ot.set(ct.id,{packet:ct,attempts:0,lastAttemptLength:0,status:"pending"}),gt=!0}return gt?(W.current=ot,ot):Ve}),Ce>0&&J(Ve=>Ve+Ce)},[he.length]),R.useEffect(()=>{W.current=B},[B]),R.useEffect(()=>{ne.current=m},[m]),R.useEffect(()=>{U.current=d},[d]),R.useEffect(()=>{D.current=A},[A]),R.useEffect(()=>{z.current=k},[k]),R.useEffect(()=>{q.current=new Set(he.map(Ce=>Ce.id))},[he]),R.useEffect(()=>{l==null||l(u)},[u,l]);const xe=Array.from(B.values()).filter(Ce=>Ce.status==="pending").length,pe=Array.from(B.values()).filter(Ce=>Ce.status==="cracked").length,ge=Array.from(B.values()).filter(Ce=>Ce.status==="failed").length,Be=R.useCallback(async()=>{if(se.current||!$.current||!me.current)return;const Ce=W.current;let Ve=null,ot=null;for(const[Ke,Ge]of Ce.entries())if(Ge.status==="pending"){Ve=Ge,ot=Ke;break}if(!Ve&&ne.current){const Ke=Array.from(Ce.entries()).filter(([,Ge])=>Ge.status==="failed"&&Ge.lastAttemptLength<10);Ke.length>0&&(Ke.sort((Ge,Je)=>Ge[1].lastAttemptLength-Je[1].lastAttemptLength),[ot,Ve]=Ke[0])}if(!Ve||ot===null){me.current&&setTimeout(()=>Be(),1e3);return}if(!q.current.has(ot)){S(Ke=>{const Ge=new Map(Ke);return Ge.delete(ot),Ge}),me.current&&setTimeout(()=>Be(),10);return}se.current=!0;const gt=U.current,ct=Ve.lastAttemptLength>0,ht=ct?Ve.lastAttemptLength+1:gt;try{const Ke=await $.current.crack(Ve.packet.data,{maxLength:ht,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...z.current&&{gpuDispatchMs:1e4},...ct&&{useDictionary:!1,startingLength:ht}},Ge=>{b(Ge)});if(G.current){G.current=!1,se.current=!1,b(null);return}if(Ke.found&&Ke.roomName&&Ke.key){S(Ue=>{const Bt=new Map(Ue),Kt=Bt.get(ot);return Kt&&Bt.set(ot,{...Kt,status:"cracked",attempts:Kt.attempts+1,lastAttemptLength:ht}),Bt});const Ge={roomName:Ke.roomName,key:Ke.key,packetId:ot,message:Ke.decryptedMessage||"",crackedAt:Date.now()};F(Ue=>[...Ue,Ge]);const Je=Ke.key.toUpperCase();if(!ce.has(Je))try{const Ue="#"+Ke.roomName;await i(Ue,Ke.key),D.current&&await it.decryptHistoricalPackets({key_type:"channel",channel_name:Ue})}catch(Ue){console.error("Failed to create channel or decrypt historical:",Ue),yt.error("Failed to save cracked channel",{description:Ue instanceof Error?Ue.message:"Channel discovered but could not be saved"})}}else S(Ge=>{const Je=new Map(Ge),Ue=Je.get(ot);return Ue&&Je.set(ot,{...Ue,status:"failed",attempts:Ue.attempts+1,lastAttemptLength:ht}),Je})}catch(Ke){console.error("Cracking error:",Ke),S(Ge=>{const Je=new Map(Ge),Ue=Je.get(ot);return Ue&&Je.set(ot,{...Ue,status:"failed",attempts:Ue.attempts+1,lastAttemptLength:ht}),Je})}se.current=!1,b(null),me.current&&setTimeout(()=>Be(),100)},[ce,i]),We=()=>{var Ce;if(!V){yt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),me.current=!0,G.current=!1,(Ce=oe.current)==null||Ce.enable(),Be()},$e=()=>{var Ce,Ve;p(!1),me.current=!1,G.current=!0,(Ce=$.current)==null||Ce.abort(),(Ve=oe.current)==null|
Line truncated
|
||||
//# sourceMappingURL=index-sgUM1Nqn.js.map
|
||||
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return A0=c,A0}var fS=dS();const hS=aa(fS);function pS(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 mS({packets:n,channels:s,onChannelCreate:i,onRunningChange:l,visible:c=!1}){const[u,p]=R.useState(!1),[d,g]=R.useState(6),[m,x]=R.useState(!1),[A,w]=R.useState(!0),[k,N]=R.useState(!1),[C,b]=R.useState(null),[B,S]=R.useState(new Map),[T,F]=R.useState([]),[M,H]=R.useState(!1),[V,j]=R.useState(null),[ee,Z]=R.useState(null),[Q,J]=R.useState(0),$=R.useRef(null),oe=R.useRef(null),me=R.useRef(!1),G=R.useRef(!1),se=R.useRef(!1),W=R.useRef(new Map),ne=R.useRef(!1),U=R.useRef(6),D=R.useRef(!0),z=R.useRef(!1),q=R.useRef(new Set),K=R.useRef(new Set);R.useEffect(()=>{const Ce=new cS;$.current=Ce,j(Ce.isGpuAvailable());const Ve=new hS;return oe.current=Ve,()=>{Ce.destroy(),$.current=null,Ve.disable(),oe.current=null}},[]),R.useEffect(()=>{!c||M||Gk(async()=>{const{ENGLISH_WORDLIST:Ce}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Ce}},[]).then(({ENGLISH_WORDLIST:Ce})=>{$.current&&($.current.setWordlist(Ce),H(!0))}).catch(Ce=>{console.error("Failed to load wordlist:",Ce),vt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[c,M]),R.useEffect(()=>{const Ce=()=>{it.getUndecryptedPacketCount().then(({count:ot})=>Z(ot)).catch(()=>Z(null))};Ce();const Ve=setInterval(Ce,36e5);return()=>clearInterval(Ve)},[]);const ce=R.useMemo(()=>new Set(s.map(Ce=>Ce.key.toUpperCase())),[s]),he=n.filter(Ce=>Ce.payload_type==="GROUP_TEXT"&&!Ce.decrypted);R.useEffect(()=>{let Ce=0;S(Ve=>{const ot=new Map(Ve);let mt=!1;for(const ct of he)if(!ot.has(ct.id)){const ht=pS(ct.data);if(ht&&K.current.has(ht)){Ce++;continue}ht&&K.current.add(ht),ot.set(ct.id,{packet:ct,attempts:0,lastAttemptLength:0,status:"pending"}),mt=!0}return mt?(W.current=ot,ot):Ve}),Ce>0&&J(Ve=>Ve+Ce)},[he.length]),R.useEffect(()=>{W.current=B},[B]),R.useEffect(()=>{ne.current=m},[m]),R.useEffect(()=>{U.current=d},[d]),R.useEffect(()=>{D.current=A},[A]),R.useEffect(()=>{z.current=k},[k]),R.useEffect(()=>{q.current=new Set(he.map(Ce=>Ce.id))},[he]),R.useEffect(()=>{l==null||l(u)},[u,l]);const xe=Array.from(B.values()).filter(Ce=>Ce.status==="pending").length,pe=Array.from(B.values()).filter(Ce=>Ce.status==="cracked").length,ge=Array.from(B.values()).filter(Ce=>Ce.status==="failed").length,Be=R.useCallback(async()=>{if(se.current||!$.current||!me.current)return;const Ce=W.current;let Ve=null,ot=null;for(const[Ke,Ge]of Ce.entries())if(Ge.status==="pending"){Ve=Ge,ot=Ke;break}if(!Ve&&ne.current){const Ke=Array.from(Ce.entries()).filter(([,Ge])=>Ge.status==="failed"&&Ge.lastAttemptLength<10);Ke.length>0&&(Ke.sort((Ge,Je)=>Ge[1].lastAttemptLength-Je[1].lastAttemptLength),[ot,Ve]=Ke[0])}if(!Ve||ot===null){me.current&&setTimeout(()=>Be(),1e3);return}if(!q.current.has(ot)){S(Ke=>{const Ge=new Map(Ke);return Ge.delete(ot),Ge}),me.current&&setTimeout(()=>Be(),10);return}se.current=!0;const mt=U.current,ct=Ve.lastAttemptLength>0,ht=ct?Ve.lastAttemptLength+1:mt;try{const Ke=await $.current.crack(Ve.packet.data,{maxLength:ht,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...z.current&&{gpuDispatchMs:1e4},...ct&&{useDictionary:!1,startingLength:ht}},Ge=>{b(Ge)});if(G.current){G.current=!1,se.current=!1,b(null);return}if(Ke.found&&Ke.roomName&&Ke.key){S(Ue=>{const St=new Map(Ue),Kt=St.get(ot);return Kt&&St.set(ot,{...Kt,status:"cracked",attempts:Kt.attempts+1,lastAttemptLength:ht}),St});const Ge={roomName:Ke.roomName,key:Ke.key,packetId:ot,message:Ke.decryptedMessage||"",crackedAt:Date.now()};F(Ue=>[...Ue,Ge]);const Je=Ke.key.toUpperCase();if(!ce.has(Je))try{const Ue="#"+Ke.roomName;await i(Ue,Ke.key),D.current&&await it.decryptHistoricalPackets({key_type:"channel",channel_name:Ue})}catch(Ue){console.error("Failed to create channel or decrypt historical:",Ue),vt.error("Failed to save cracked channel",{description:Ue instanceof Error?Ue.message:"Channel discovered but could not be saved"})}}else S(Ge=>{const Je=new Map(Ge),Ue=Je.get(ot);return Ue&&Je.set(ot,{...Ue,status:"failed",attempts:Ue.attempts+1,lastAttemptLength:ht}),Je})}catch(Ke){console.error("Cracking error:",Ke),S(Ge=>{const Je=new Map(Ge),Ue=Je.get(ot);return Ue&&Je.set(ot,{...Ue,status:"failed",attempts:Ue.attempts+1,lastAttemptLength:ht}),Je})}se.current=!1,b(null),me.current&&setTimeout(()=>Be(),100)},[ce,i]),We=()=>{var Ce;if(!V){vt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),me.current=!0,G.current=!1,(Ce=oe.current)==null||Ce.enable(),Be()},$e=()=>{var Ce,Ve;p(!1),me.current=!1,G.current=!0,(Ce=$.current)==null||Ce.abort(),(Ve=oe.current)==null|
Line truncated
|
||||
//# sourceMappingURL=index-DsqXtGVx.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"mappings":"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 truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"mappings":"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 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-sgUM1Nqn.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BsZWFlnF.css">
|
||||
<script type="module" crossorigin src="/assets/index-DsqXtGVx.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Cxcg9Mr6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -93,16 +93,6 @@ export const api = {
|
||||
// Contacts
|
||||
getContacts: (limit = 100, offset = 0) =>
|
||||
fetchJson<Contact[]>(`/contacts?limit=${limit}&offset=${offset}`),
|
||||
getContact: (publicKey: string) => fetchJson<Contact>(`/contacts/${publicKey}`),
|
||||
syncContacts: () => fetchJson<{ synced: number }>('/contacts/sync', { method: 'POST' }),
|
||||
addContactToRadio: (publicKey: string) =>
|
||||
fetchJson<{ status: string }>(`/contacts/${publicKey}/add-to-radio`, {
|
||||
method: 'POST',
|
||||
}),
|
||||
removeContactFromRadio: (publicKey: string) =>
|
||||
fetchJson<{ status: string }>(`/contacts/${publicKey}/remove-from-radio`, {
|
||||
method: 'POST',
|
||||
}),
|
||||
deleteContact: (publicKey: string) =>
|
||||
fetchJson<{ status: string }>(`/contacts/${publicKey}`, {
|
||||
method: 'DELETE',
|
||||
@@ -129,13 +119,11 @@ export const api = {
|
||||
|
||||
// Channels
|
||||
getChannels: () => fetchJson<Channel[]>('/channels'),
|
||||
getChannel: (key: string) => fetchJson<Channel>(`/channels/${key}`),
|
||||
createChannel: (name: string, key?: string) =>
|
||||
fetchJson<Channel>('/channels', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ name, key }),
|
||||
}),
|
||||
syncChannels: () => fetchJson<{ synced: number }>('/channels/sync', { method: 'POST' }),
|
||||
deleteChannel: (key: string) =>
|
||||
fetchJson<{ status: string }>(`/channels/${key}`, { method: 'DELETE' }),
|
||||
markChannelRead: (key: string) =>
|
||||
@@ -215,16 +203,6 @@ export const api = {
|
||||
}),
|
||||
|
||||
// Favorites
|
||||
addFavorite: (type: Favorite['type'], id: string) =>
|
||||
fetchJson<AppSettings>('/settings/favorites', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ type, id }),
|
||||
}),
|
||||
removeFavorite: (type: Favorite['type'], id: string) =>
|
||||
fetchJson<AppSettings>('/settings/favorites', {
|
||||
method: 'DELETE',
|
||||
body: JSON.stringify({ type, id }),
|
||||
}),
|
||||
toggleFavorite: (type: Favorite['type'], id: string) =>
|
||||
fetchJson<AppSettings>('/settings/favorites/toggle', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const alertVariants = cva(
|
||||
'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-background text-foreground',
|
||||
destructive:
|
||||
'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
||||
warning: 'border-yellow-500/50 bg-yellow-500/10 text-yellow-200 [&>svg]:text-yellow-500',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const Alert = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
||||
>(({ className, variant, ...props }, ref) => (
|
||||
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
|
||||
));
|
||||
Alert.displayName = 'Alert';
|
||||
|
||||
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
||||
({ className, ...props }, ref) => (
|
||||
<h5
|
||||
ref={ref}
|
||||
className={cn('mb-1 font-medium leading-none tracking-tight', className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
);
|
||||
AlertTitle.displayName = 'AlertTitle';
|
||||
|
||||
const AlertDescription = React.forwardRef<
|
||||
HTMLParagraphElement,
|
||||
React.HTMLAttributes<HTMLParagraphElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
||||
));
|
||||
AlertDescription.displayName = 'AlertDescription';
|
||||
|
||||
export { Alert, AlertTitle, AlertDescription };
|
||||
@@ -1,11 +1,4 @@
|
||||
export {
|
||||
useRepeaterMode,
|
||||
type UseRepeaterModeResult,
|
||||
formatDuration,
|
||||
formatTelemetry,
|
||||
formatNeighbors,
|
||||
formatAcl,
|
||||
} from './useRepeaterMode';
|
||||
export { useRepeaterMode, type UseRepeaterModeResult } from './useRepeaterMode';
|
||||
export { useUnreadCounts, type UseUnreadCountsResult } from './useUnreadCounts';
|
||||
export {
|
||||
useConversationMessages,
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
/** 64-character hex string identifying a contact/node */
|
||||
export type PublicKey = string;
|
||||
|
||||
/** 12-character hex prefix of a public key (used in message routing) */
|
||||
export type PubkeyPrefix = string;
|
||||
|
||||
/** 32-character hex string identifying a channel */
|
||||
export type ChannelKey = string;
|
||||
|
||||
|
||||
@@ -7,11 +7,8 @@
|
||||
* module provides utilities for working with both formats consistently.
|
||||
*/
|
||||
|
||||
/** Length of a full public key in hex characters */
|
||||
export const PUBKEY_FULL_LENGTH = 64;
|
||||
|
||||
/** Length of a public key prefix in hex characters */
|
||||
export const PUBKEY_PREFIX_LENGTH = 12;
|
||||
const PUBKEY_PREFIX_LENGTH = 12;
|
||||
|
||||
/**
|
||||
* Extract the 12-character prefix from a public key.
|
||||
@@ -21,42 +18,9 @@ export function getPubkeyPrefix(key: string): string {
|
||||
return key.slice(0, PUBKEY_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if two public keys match by comparing their prefixes.
|
||||
* This handles the case where one key is full (64 chars) and
|
||||
* the other is a prefix (12 chars).
|
||||
*/
|
||||
export function pubkeysMatch(a: string, b: string): boolean {
|
||||
if (!a || !b) return false;
|
||||
return getPubkeyPrefix(a) === getPubkeyPrefix(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a public key starts with the given prefix.
|
||||
* More explicit than using .startsWith() directly.
|
||||
*/
|
||||
export function pubkeyMatchesPrefix(fullKey: string, prefix: string): boolean {
|
||||
if (!fullKey || !prefix) return false;
|
||||
return fullKey.startsWith(prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a display name for a contact, falling back to pubkey prefix.
|
||||
*/
|
||||
export function getContactDisplayName(name: string | null | undefined, pubkey: string): string {
|
||||
return name || getPubkeyPrefix(pubkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a key is a full 64-character public key.
|
||||
*/
|
||||
export function isFullPubkey(key: string): boolean {
|
||||
return key.length === PUBKEY_FULL_LENGTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a key is a 12-character prefix.
|
||||
*/
|
||||
export function isPubkeyPrefix(key: string): boolean {
|
||||
return key.length === PUBKEY_PREFIX_LENGTH;
|
||||
}
|
||||
Reference in new issue
Block a user