diff --git a/README.md b/README.md index b840d36..d40705e 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,20 @@ MESHCORE_SERIAL_PORT=/dev/ttyUSB0 uv run uvicorn app.main:app --host 0.0.0.0 --p Access the app at http://localhost:8000 (or your server's IP/hostname). +### HTTPS (Required for WebGPU Cracking) + +WebGPU requires a secure context. To use the channel key cracker, serve over HTTPS: + +```bash +# Generate self-signed cert +openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost' + +# Run with SSL +uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=key.pem --ssl-certfile=cert.pem +``` + +Accept the browser security warning on first visit. For locally-trusted certs without warnings, use [mkcert](https://github.com/FiloSottile/mkcert). + ### Systemd Service (Linux) To run as a system service: diff --git a/frontend/dist/assets/index-B-xot-vl.js b/frontend/dist/assets/index-B-xot-vl.js new file mode 100644 index 0000000..3fee089 --- /dev/null +++ b/frontend/dist/assets/index-B-xot-vl.js @@ -0,0 +1,542 @@ +function o1(r,o){for(var a=0;as[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&s(A)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function nu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Oe={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var eh;function a1(){if(eh)return Oe;eh=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=p&&k[p]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function y(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}y.prototype.isReactComponent={},y.prototype.setState=function(k,O){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,O,"setState")},y.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function x(){}x.prototype=y.prototype;function C(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}var w=C.prototype=new x;w.constructor=C,b(w,y.prototype),w.isPureReactComponent=!0;var T=Array.isArray,R=Object.prototype.hasOwnProperty,D={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function I(k,O,z){var V,re={},ue=null,de=null;if(O!=null)for(V in O.ref!==void 0&&(de=O.ref),O.key!==void 0&&(ue=""+O.key),O)R.call(O,V)&&!N.hasOwnProperty(V)&&(re[V]=O[V]);var oe=arguments.length-2;if(oe===1)re.children=z;else if(1>>1,O=W[k];if(0>>1;kc(re,Z))uec(de,re)?(W[k]=de,W[ue]=Z,k=ue):(W[k]=re,W[V]=Z,k=V);else if(uec(de,Z))W[k]=de,W[ue]=Z,k=ue;else break e}}return X}function c(W,X){var Z=W.sortIndex-X.sortIndex;return Z!==0?Z:W.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,u=A.now();r.unstable_now=function(){return A.now()-u}}var f=[],h=[],m=1,p=null,v=3,_=!1,b=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var X=a(h);X!==null;){if(X.callback===null)s(h);else if(X.startTime<=W)s(h),X.sortIndex=X.expirationTime,o(f,X);else break;X=a(h)}}function T(W){if(S=!1,w(W),!b)if(a(f)!==null)b=!0,J(R);else{var X=a(h);X!==null&&ne(T,X.startTime-W)}}function R(W,X){b=!1,S&&(S=!1,x(I),I=-1),_=!0;var Z=v;try{for(w(X),p=a(f);p!==null&&(!(p.expirationTime>X)||W&&!L());){var k=p.callback;if(typeof k=="function"){p.callback=null,v=p.priorityLevel;var O=k(p.expirationTime<=X);X=r.unstable_now(),typeof O=="function"?p.callback=O:p===a(f)&&s(f),w(X)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var V=a(h);V!==null&&ne(T,V.startTime-X),z=!1}return z}finally{p=null,v=Z,_=!1}}var D=!1,N=null,I=-1,F=5,j=-1;function L(){return!(r.unstable_now()-jW||125k?(W.sortIndex=Z,o(h,W),a(f)===null&&W===a(h)&&(S?(x(I),I=-1):S=!0,ne(T,Z-k))):(W.sortIndex=O,o(f,W),b||_||(b=!0,J(R))),W},r.unstable_shouldYield=L,r.unstable_wrapCallback=function(W){var X=v;return function(){var Z=v;v=X;try{return W.apply(this,arguments)}finally{v=Z}}}})(dc)),dc}var ah;function c1(){return ah||(ah=1,uc.exports=l1()),uc.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var sh;function u1(){if(sh)return rr;sh=1;var r=ou(),o=c1();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function v(e){return f.call(p,e)?!0:f.call(m,e)?!1:h.test(e)?p[e]=!0:(m[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,n,i,d,g,E){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=g,this.removeEmptyString=E}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];y[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){y[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function C(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function w(e,t,n,i){var d=y.hasOwnProperty(t)?y[t]:null;(d!==null?d.type!==0:i||!(2M||d[E]!==g[M]){var H=` +`+d[E].replace(" at new "," at ");return e.displayName&&H.includes("")&&(H=H.replace("",e.displayName)),H}while(1<=E&&0<=M);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function re(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function ue(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case D:return"Portal";case F:return"Profiler";case I:return"StrictMode";case K:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(t);case 8:return t===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,g=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(E){i=""+E,g.call(this,E)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){e._valueTracker||(e._valueTracker=ze(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Be(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ft(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Je(e,t){var n=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ar(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=oe(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ut(e,t){t=t.checked,t!=null&&w(e,"checked",t,!1)}function Et(e,t){Ut(e,t);var n=oe(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ht(e,t.type,n):t.hasOwnProperty("defaultValue")&&ht(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ht(e,t,n){(t!=="number"||ft(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var It=Array.isArray;function nt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d"+t.valueOf().toString()+"",t=Ee.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xe=["Webkit","ms","Moz","O"];Object.keys(Qe).forEach(function(e){Xe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qe[t]=Qe[e]})});function Yt(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qe.hasOwnProperty(e)&&Qe[e]?(""+t).trim():t+"px"}function Rt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,d=Yt(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,d):e[n]=d}}var te=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function le(e,t){if(t){if(te[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function me(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var De=null;function Pe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var je=null,Fe=null,Ue=null;function Qt(e){if(e=Zo(e)){if(typeof je!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Za(t),je(e.stateNode,e.type,t))}}function Se(e){Fe?Ue?Ue.push(e):Ue=[e]:Fe=e}function qe(){if(Fe){var e=Fe,t=Ue;if(Ue=Fe=null,Qt(e),t)for(e=0;e>>=0,e===0?32:31-(xp(e)/wp|0)|0}var Na=64,Da=4194304;function No(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ia(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,d=e.suspendedLanes,g=e.pingedLanes,E=n&268435455;if(E!==0){var M=E&~d;M!==0?i=No(M):(g&=E,g!==0&&(i=No(g)))}else E=n&~d,E!==0?i=No(E):g!==0&&(i=No(g));if(i===0)return 0;if(t!==0&&t!==i&&(t&d)===0&&(d=i&-i,g=t&-t,d>=g||d===16&&(g&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function Do(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-br(t),e[t]=n}function kp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=zo),Gu=" ",qu=!1;function Ku(e,t){switch(e){case"keyup":return $p.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function tm(e,t){switch(e){case"compositionend":return Yu(t);case"keypress":return t.which!==32?null:(qu=!0,Gu);case"textInput":return e=t.data,e===Gu&&qu?null:e;default:return null}}function rm(e,t){if(Kn)return e==="compositionend"||!zi&&Ku(e,t)?(e=Hu(),La=ji=nn=null,Kn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rd(n)}}function od(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?od(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ad(){for(var e=window,t=ft();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ft(e.document)}return t}function Wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dm(e){var t=ad(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&od(n.ownerDocument.documentElement,n)){if(i!==null&&Wi(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=n.textContent.length,g=Math.min(i.start,d);i=i.end===void 0?g:Math.min(i.end,d),!e.extend&&g>i&&(d=i,i=g,g=d),d=nd(n,g);var E=nd(n,i);d&&E&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),g>i?(e.addRange(t),e.extend(E.node,E.offset)):(t.setEnd(E.node,E.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yn=null,Qi=null,Qo=null,Gi=!1;function sd(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gi||Yn==null||Yn!==ft(i)||(i=Yn,"selectionStart"in i&&Wi(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Qo&&Wo(Qo,i)||(Qo=i,i=qa(Qi,"onSelect"),0eo||(e.current=ol[eo],ol[eo]=null,eo--)}function et(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Lt=sn(ln),Xt=sn(!1),En=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},g;for(g in n)d[g]=t[g];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Jt(e){return e=e.childContextTypes,e!=null}function Xa(){st(Xt),st(Lt)}function wd(e,t,n){if(Lt.current!==ln)throw Error(a(168));et(Lt,t),et(Xt,n)}function bd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,de(e)||"Unknown",d));return Z({},n,i)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,En=Lt.current,et(Lt,e),et(Xt,Xt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=bd(e,t,En),i.__reactInternalMemoizedMergedChildContext=e,st(Xt),st(Lt),et(Lt,e)):st(Xt),et(Xt,n)}var Wr=null,$a=!1,al=!1;function Cd(e){Wr===null?Wr=[e]:Wr.push(e)}function _m(e){$a=!0,Cd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e>=E,d-=E,Qr=1<<32-br(t)+d|n<Ne?(Pt=Te,Te=null):Pt=Te.sibling;var Ge=ae(Q,Te,q[Ne],fe);if(Ge===null){Te===null&&(Te=Pt);break}e&&Te&&Ge.alternate===null&&t(Q,Te),U=g(Ge,U,Ne),Re===null?Ce=Ge:Re.sibling=Ge,Re=Ge,Te=Pt}if(Ne===q.length)return n(Q,Te),lt&&Tn(Q,Ne),Ce;if(Te===null){for(;NeNe?(Pt=Te,Te=null):Pt=Te.sibling;var vn=ae(Q,Te,Ge.value,fe);if(vn===null){Te===null&&(Te=Pt);break}e&&Te&&vn.alternate===null&&t(Q,Te),U=g(vn,U,Ne),Re===null?Ce=vn:Re.sibling=vn,Re=vn,Te=Pt}if(Ge.done)return n(Q,Te),lt&&Tn(Q,Ne),Ce;if(Te===null){for(;!Ge.done;Ne++,Ge=q.next())Ge=ce(Q,Ge.value,fe),Ge!==null&&(U=g(Ge,U,Ne),Re===null?Ce=Ge:Re.sibling=Ge,Re=Ge);return lt&&Tn(Q,Ne),Ce}for(Te=i(Q,Te);!Ge.done;Ne++,Ge=q.next())Ge=pe(Te,Q,Ne,Ge.value,fe),Ge!==null&&(e&&Ge.alternate!==null&&Te.delete(Ge.key===null?Ne:Ge.key),U=g(Ge,U,Ne),Re===null?Ce=Ge:Re.sibling=Ge,Re=Ge);return e&&Te.forEach(function(n1){return t(Q,n1)}),lt&&Tn(Q,Ne),Ce}function yt(Q,U,q,fe){if(typeof q=="object"&&q!==null&&q.type===N&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case R:e:{for(var Ce=q.key,Re=U;Re!==null;){if(Re.key===Ce){if(Ce=q.type,Ce===N){if(Re.tag===7){n(Q,Re.sibling),U=d(Re,q.props.children),U.return=Q,Q=U;break e}}else if(Re.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===J&&Bd(Ce)===Re.type){n(Q,Re.sibling),U=d(Re,q.props),U.ref=Xo(Q,Re,q),U.return=Q,Q=U;break e}n(Q,Re);break}else t(Q,Re);Re=Re.sibling}q.type===N?(U=On(q.props.children,Q.mode,fe,q.key),U.return=Q,Q=U):(fe=Es(q.type,q.key,q.props,null,Q.mode,fe),fe.ref=Xo(Q,U,q),fe.return=Q,Q=fe)}return E(Q);case D:e:{for(Re=q.key;U!==null;){if(U.key===Re)if(U.tag===4&&U.stateNode.containerInfo===q.containerInfo&&U.stateNode.implementation===q.implementation){n(Q,U.sibling),U=d(U,q.children||[]),U.return=Q,Q=U;break e}else{n(Q,U);break}else t(Q,U);U=U.sibling}U=rc(q,Q.mode,fe),U.return=Q,Q=U}return E(Q);case J:return Re=q._init,yt(Q,U,Re(q._payload),fe)}if(It(q))return ye(Q,U,q,fe);if(X(q))return be(Q,U,q,fe);ns(Q,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,U!==null&&U.tag===6?(n(Q,U.sibling),U=d(U,q),U.return=Q,Q=U):(n(Q,U),U=tc(q,Q.mode,fe),U.return=Q,Q=U),E(Q)):n(Q,U)}return yt}var ao=Pd(!0),Nd=Pd(!1),os=sn(null),as=null,so=null,dl=null;function fl(){dl=so=as=null}function hl(e){var t=os.current;st(os),e._currentValue=t}function Al(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function io(e,t){as=e,dl=so=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&($t=!0),e.firstContext=null)}function pr(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},so===null){if(as===null)throw Error(a(308));so=e,as.dependencies={lanes:0,firstContext:e}}else so=so.next=e;return t}var Bn=null;function pl(e){Bn===null?Bn=[e]:Bn.push(e)}function Dd(e,t,n,i){var d=t.interleaved;return d===null?(n.next=n,pl(t)):(n.next=d.next,d.next=n),t.interleaved=n,qr(e,i)}function qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var un=!1;function ml(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Id(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(We&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,qr(e,n)}return d=i.interleaved,d===null?(t.next=t,pl(i)):(t.next=d.next,d.next=t),i.interleaved=t,qr(e,n)}function ss(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Bi(e,n)}}function jd(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var d=null,g=null;if(n=n.firstBaseUpdate,n!==null){do{var E={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};g===null?d=g=E:g=g.next=E,n=n.next}while(n!==null);g===null?d=g=t:g=g.next=t}else d=g=t;n={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:g,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function is(e,t,n,i){var d=e.updateQueue;un=!1;var g=d.firstBaseUpdate,E=d.lastBaseUpdate,M=d.shared.pending;if(M!==null){d.shared.pending=null;var H=M,Y=H.next;H.next=null,E===null?g=Y:E.next=Y,E=H;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==E&&(M===null?ie.firstBaseUpdate=Y:M.next=Y,ie.lastBaseUpdate=H))}if(g!==null){var ce=d.baseState;E=0,ie=Y=H=null,M=g;do{var ae=M.lane,pe=M.eventTime;if((i&ae)===ae){ie!==null&&(ie=ie.next={eventTime:pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var ye=e,be=M;switch(ae=t,pe=n,be.tag){case 1:if(ye=be.payload,typeof ye=="function"){ce=ye.call(pe,ce,ae);break e}ce=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=be.payload,ae=typeof ye=="function"?ye.call(pe,ce,ae):ye,ae==null)break e;ce=Z({},ce,ae);break e;case 2:un=!0}}M.callback!==null&&M.lane!==0&&(e.flags|=64,ae=d.effects,ae===null?d.effects=[M]:ae.push(M))}else pe={eventTime:pe,lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(Y=ie=pe,H=ce):ie=ie.next=pe,E|=ae;if(M=M.next,M===null){if(M=d.shared.pending,M===null)break;ae=M,M=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);if(ie===null&&(H=ce),d.baseState=H,d.firstBaseUpdate=Y,d.lastBaseUpdate=ie,t=d.shared.interleaved,t!==null){d=t;do E|=d.lane,d=d.next;while(d!==t)}else g===null&&(d.shared.lanes=0);Dn|=E,e.lanes=E,e.memoizedState=ce}}function Md(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var i=wl.transition;wl.transition={};try{e(!1),t()}finally{Ye=n,wl.transition=i}}function tf(){return mr().memoizedState}function Em(e,t,n){var i=pn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},rf(e))nf(t,n);else if(n=Dd(e,t,n,i),n!==null){var d=qt();Rr(n,e,i,d),of(n,t,i)}}function Rm(e,t,n){var i=pn(e),d={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(rf(e))nf(t,d);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var E=t.lastRenderedState,M=g(E,n);if(d.hasEagerState=!0,d.eagerState=M,_r(M,E)){var H=t.interleaved;H===null?(d.next=d,pl(t)):(d.next=H.next,H.next=d),t.interleaved=d;return}}catch{}finally{}n=Dd(e,t,d,i),n!==null&&(d=qt(),Rr(n,e,i,d),of(n,t,i))}}function rf(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function nf(e,t){ta=us=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function of(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Bi(e,n)}}var hs={readContext:pr,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},Tm={readContext:pr,useCallback:function(e,t){return jr().memoizedState=[e,t===void 0?null:t],e},useContext:pr,useEffect:qd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ds(4194308,4,Zd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){return ds(4,2,e,t)},useMemo:function(e,t){var n=jr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=jr();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Em.bind(null,ut,e),[i.memoizedState,e]},useRef:function(e){var t=jr();return e={current:e},t.memoizedState=e},useState:Qd,useDebugValue:Rl,useDeferredValue:function(e){return jr().memoizedState=e},useTransition:function(){var e=Qd(!1),t=e[0];return e=Sm.bind(null,e[1]),jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ut,d=jr();if(lt){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Bt===null)throw Error(a(349));(Nn&30)!==0||Hd(i,t,n)}d.memoizedState=n;var g={value:n,getSnapshot:t};return d.queue=g,qd(Vd.bind(null,i,g,e),[e]),i.flags|=2048,oa(9,zd.bind(null,i,g,n,t),void 0,null),n},useId:function(){var e=jr(),t=Bt.identifierPrefix;if(lt){var n=Gr,i=Qr;n=(i&~(1<<32-br(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ra++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=E.createElement(n,{is:i.is}):(e=E.createElement(n),n==="select"&&(E=e,i.multiple?E.multiple=!0:i.size&&(E.size=i.size))):e=E.createElementNS(e,n),e[Dr]=t,e[Yo]=i,kf(e,t,!1,!1),t.stateNode=e;e:{switch(E=me(n,i),n){case"dialog":at("cancel",e),at("close",e),d=i;break;case"iframe":case"object":case"embed":at("load",e),d=i;break;case"video":case"audio":for(d=0;dho&&(t.flags|=128,i=!0,aa(g,!1),t.lanes=4194304)}else{if(!i)if(e=ls(E),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),aa(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!lt)return zt(t),null}else 2*vt()-g.renderingStartTime>ho&&n!==1073741824&&(t.flags|=128,i=!0,aa(g,!1),t.lanes=4194304);g.isBackwards?(E.sibling=t.child,t.child=E):(n=g.last,n!==null?n.sibling=E:t.child=E,g.last=E)}return g.tail!==null?(t=g.tail,g.rendering=t,g.tail=t.sibling,g.renderingStartTime=vt(),t.sibling=null,n=ct.current,et(ct,i?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return Jl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(cr&1073741824)!==0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Om(e,t){switch(il(t),t.tag){case 1:return Jt(t.type)&&Xa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),st(Xt),st(Lt),xl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return vl(t),null;case 13:if(st(ct),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));oo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(ct),null;case 4:return lo(),null;case 10:return hl(t.type._context),null;case 22:case 23:return Jl(),null;case 24:return null;default:return null}}var gs=!1,Vt=!1,Fm=typeof WeakSet=="function"?WeakSet:Set,ge=null;function uo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){gt(e,t,i)}else n.current=null}function Hl(e,t,n){try{n()}catch(i){gt(e,t,i)}}var Rf=!1;function Lm(e,t){if(Ji=Oa,e=ad(),Wi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var d=i.anchorOffset,g=i.focusNode;i=i.focusOffset;try{n.nodeType,g.nodeType}catch{n=null;break e}var E=0,M=-1,H=-1,Y=0,ie=0,ce=e,ae=null;t:for(;;){for(var pe;ce!==n||d!==0&&ce.nodeType!==3||(M=E+d),ce!==g||i!==0&&ce.nodeType!==3||(H=E+i),ce.nodeType===3&&(E+=ce.nodeValue.length),(pe=ce.firstChild)!==null;)ae=ce,ce=pe;for(;;){if(ce===e)break t;if(ae===n&&++Y===d&&(M=E),ae===g&&++ie===i&&(H=E),(pe=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=pe}n=M===-1||H===-1?null:{start:M,end:H}}else n=null}n=n||{start:0,end:0}}else n=null;for($i={focusedElem:e,selectionRange:n},Oa=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;try{var ye=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var be=ye.memoizedProps,yt=ye.memoizedState,Q=t.stateNode,U=Q.getSnapshotBeforeUpdate(t.elementType===t.type?be:kr(t.type,be),yt);Q.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var q=t.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(fe){gt(t,t.return,fe)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return ye=Rf,Rf=!1,ye}function sa(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var g=d.destroy;d.destroy=void 0,g!==void 0&&Hl(t,n,g)}d=d.next}while(d!==i)}}function vs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function zl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Tf(e){var t=e.alternate;t!==null&&(e.alternate=null,Tf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dr],delete t[Yo],delete t[nl],delete t[wm],delete t[bm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bf(e){return e.tag===5||e.tag===3||e.tag===4}function Pf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vl(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ya));else if(i!==4&&(e=e.child,e!==null))for(Vl(e,t,n),e=e.sibling;e!==null;)Vl(e,t,n),e=e.sibling}function Ul(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ul(e,t,n),e=e.sibling;e!==null;)Ul(e,t,n),e=e.sibling}var jt=null,Sr=!1;function fn(e,t,n){for(n=n.child;n!==null;)Nf(e,t,n),n=n.sibling}function Nf(e,t,n){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(Pa,n)}catch{}switch(n.tag){case 5:Vt||uo(n,t);case 6:var i=jt,d=Sr;jt=null,fn(e,t,n),jt=i,Sr=d,jt!==null&&(Sr?(e=jt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):jt.removeChild(n.stateNode));break;case 18:jt!==null&&(Sr?(e=jt,n=n.stateNode,e.nodeType===8?rl(e.parentNode,n):e.nodeType===1&&rl(e,n),Fo(e)):rl(jt,n.stateNode));break;case 4:i=jt,d=Sr,jt=n.stateNode.containerInfo,Sr=!0,fn(e,t,n),jt=i,Sr=d;break;case 0:case 11:case 14:case 15:if(!Vt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var g=d,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Hl(n,t,E),d=d.next}while(d!==i)}fn(e,t,n);break;case 1:if(!Vt&&(uo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(M){gt(n,t,M)}fn(e,t,n);break;case 21:fn(e,t,n);break;case 22:n.mode&1?(Vt=(i=Vt)||n.memoizedState!==null,fn(e,t,n),Vt=i):fn(e,t,n);break;default:fn(e,t,n)}}function Df(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fm),t.forEach(function(i){var d=Km.bind(null,e,i);n.has(i)||(n.add(i),i.then(d,d))})}}function Er(e,t){var n=t.deletions;if(n!==null)for(var i=0;id&&(d=E),i&=~g}if(i=d,i=vt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*zm(i/1960))-i,10e?16:e,An===null)var i=!1;else{if(e=An,An=null,_s=0,(We&6)!==0)throw Error(a(331));var d=We;for(We|=4,ge=e.current;ge!==null;){var g=ge,E=g.child;if((ge.flags&16)!==0){var M=g.deletions;if(M!==null){for(var H=0;Hvt()-Gl?jn(e,0):Ql|=n),tr(e,t)}function Gf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Da,Da<<=1,(Da&130023424)===0&&(Da=4194304)));var n=qt();e=qr(e,t),e!==null&&(Do(e,t,n),tr(e,n))}function qm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gf(e,n)}function Km(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(n=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(a(314))}i!==null&&i.delete(t),Gf(e,n)}var qf;qf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xt.current)$t=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return $t=!1,jm(e,t,n);$t=(e.flags&131072)!==0}else $t=!1,lt&&(t.flags&1048576)!==0&&kd(t,ts,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ms(e,t),e=t.pendingProps;var d=to(t,Lt.current);io(t,n),d=_l(null,t,i,e,d,n);var g=Cl();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(i)?(g=!0,Ja(t)):g=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,ml(t),d.updater=As,t.stateNode=d,d._reactInternals=t,Bl(t,i,e,n),t=Il(null,t,i,!0,g,n)):(t.tag=0,lt&&g&&sl(t),Gt(null,t,d,n),t=t.child),t;case 16:i=t.elementType;e:{switch(ms(e,t),e=t.pendingProps,d=i._init,i=d(i._payload),t.type=i,d=t.tag=Zm(i),e=kr(i,e),d){case 0:t=Dl(null,t,i,e,n);break e;case 1:t=yf(null,t,i,e,n);break e;case 11:t=Af(null,t,i,e,n);break e;case 14:t=pf(null,t,i,kr(i.type,e),n);break e}throw Error(a(306,i,""))}return t;case 0:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:kr(i,d),Dl(e,t,i,d,n);case 1:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:kr(i,d),yf(e,t,i,d,n);case 3:e:{if(xf(t),e===null)throw Error(a(387));i=t.pendingProps,g=t.memoizedState,d=g.element,Id(e,t),is(t,i,null,n);var E=t.memoizedState;if(i=E.element,g.isDehydrated)if(g={element:i,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){d=co(Error(a(423)),t),t=wf(e,t,i,n,d);break e}else if(i!==d){d=co(Error(a(424)),t),t=wf(e,t,i,n,d);break e}else for(lr=an(t.stateNode.containerInfo.firstChild),ir=t,lt=!0,Cr=null,n=Nd(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oo(),i===d){t=Yr(e,t,n);break e}Gt(e,t,i,n)}t=t.child}return t;case 5:return Od(t),e===null&&cl(t),i=t.type,d=t.pendingProps,g=e!==null?e.memoizedProps:null,E=d.children,el(i,d)?E=null:g!==null&&el(i,g)&&(t.flags|=32),vf(e,t),Gt(e,t,E,n),t.child;case 6:return e===null&&cl(t),null;case 13:return bf(e,t,n);case 4:return gl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ao(t,null,i,n):Gt(e,t,i,n),t.child;case 11:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:kr(i,d),Af(e,t,i,d,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,d=t.pendingProps,g=t.memoizedProps,E=d.value,et(os,i._currentValue),i._currentValue=E,g!==null)if(_r(g.value,E)){if(g.children===d.children&&!Xt.current){t=Yr(e,t,n);break e}}else for(g=t.child,g!==null&&(g.return=t);g!==null;){var M=g.dependencies;if(M!==null){E=g.child;for(var H=M.firstContext;H!==null;){if(H.context===i){if(g.tag===1){H=Kr(-1,n&-n),H.tag=2;var Y=g.updateQueue;if(Y!==null){Y=Y.shared;var ie=Y.pending;ie===null?H.next=H:(H.next=ie.next,ie.next=H),Y.pending=H}}g.lanes|=n,H=g.alternate,H!==null&&(H.lanes|=n),Al(g.return,n,t),M.lanes|=n;break}H=H.next}}else if(g.tag===10)E=g.type===t.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(a(341));E.lanes|=n,M=E.alternate,M!==null&&(M.lanes|=n),Al(E,n,t),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===t){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Gt(e,t,d.children,n),t=t.child}return t;case 9:return d=t.type,i=t.pendingProps.children,io(t,n),d=pr(d),i=i(d),t.flags|=1,Gt(e,t,i,n),t.child;case 14:return i=t.type,d=kr(i,t.pendingProps),d=kr(i.type,d),pf(e,t,i,d,n);case 15:return mf(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:kr(i,d),ms(e,t),t.tag=1,Jt(i)?(e=!0,Ja(t)):e=!1,io(t,n),sf(t,i,d),Bl(t,i,d,n),Il(null,t,i,!0,e,n);case 19:return Cf(e,t,n);case 22:return gf(e,t,n)}throw Error(a(156,t.tag))};function Kf(e,t){return Su(e,t)}function Ym(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(e,t,n,i){return new Ym(e,t,n,i)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zm(e){if(typeof e=="function")return ec(e)?1:0;if(e!=null){if(e=e.$$typeof,e===G)return 11;if(e===se)return 14}return 2}function gn(e,t){var n=e.alternate;return n===null?(n=vr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Es(e,t,n,i,d,g){var E=2;if(i=e,typeof e=="function")ec(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case N:return On(n.children,d,g,t);case I:E=8,d|=8;break;case F:return e=vr(12,n,t,d|2),e.elementType=F,e.lanes=g,e;case K:return e=vr(13,n,t,d),e.elementType=K,e.lanes=g,e;case ee:return e=vr(19,n,t,d),e.elementType=ee,e.lanes=g,e;case ne:return Rs(n,d,g,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:E=10;break e;case L:E=9;break e;case G:E=11;break e;case se:E=14;break e;case J:E=16,i=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=vr(E,n,t,d),t.elementType=e,t.type=i,t.lanes=g,t}function On(e,t,n,i){return e=vr(7,e,i,t),e.lanes=n,e}function Rs(e,t,n,i){return e=vr(22,e,i,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function tc(e,t,n){return e=vr(6,e,null,t),e.lanes=n,e}function rc(e,t,n){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xm(e,t,n,i,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function nc(e,t,n,i,d,g,E,M,H){return e=new Xm(e,t,n,M,H),t===1?(t=1,g===!0&&(t|=8)):t=0,g=vr(3,null,null,t),e.current=g,g.stateNode=e,g.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ml(g),e}function Jm(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),cc.exports=u1(),cc.exports}var lh;function d1(){if(lh)return js;lh=1;var r=nA();return js.createRoot=r.createRoot,js.hydrateRoot=r.hydrateRoot,js}var f1=d1();const h1="/api";async function tt(r,o){const a=await fetch(`${h1}${r}`,{...o,headers:{"Content-Type":"application/json",...o==null?void 0:o.headers}});if(!a.ok){const s=await a.text();throw new Error(s||a.statusText)}return a.json()}const rt={getHealth:()=>tt("/health"),getRadioConfig:()=>tt("/radio/config"),updateRadioConfig:r=>tt("/radio/config",{method:"PATCH",body:JSON.stringify(r)}),setPrivateKey:r=>tt("/radio/private-key",{method:"PUT",body:JSON.stringify({private_key:r})}),sendAdvertisement:(r=!0)=>tt(`/radio/advertise?flood=${r}`,{method:"POST"}),rebootRadio:()=>tt("/radio/reboot",{method:"POST"}),reconnectRadio:()=>tt("/radio/reconnect",{method:"POST"}),getContacts:(r=100,o=0)=>tt(`/contacts?limit=${r}&offset=${o}`),getContact:r=>tt(`/contacts/${r}`),syncContacts:()=>tt("/contacts/sync",{method:"POST"}),addContactToRadio:r=>tt(`/contacts/${r}/add-to-radio`,{method:"POST"}),removeContactFromRadio:r=>tt(`/contacts/${r}/remove-from-radio`,{method:"POST"}),deleteContact:r=>tt(`/contacts/${r}`,{method:"DELETE"}),getChannels:()=>tt("/channels"),getChannel:r=>tt(`/channels/${r}`),createChannel:(r,o)=>tt("/channels",{method:"POST",body:JSON.stringify({name:r,key:o})}),syncChannels:()=>tt("/channels/sync",{method:"POST"}),deleteChannel:r=>tt(`/channels/${r}`,{method:"DELETE"}),getMessages:r=>{const o=new URLSearchParams;r!=null&&r.limit&&o.set("limit",r.limit.toString()),r!=null&&r.offset&&o.set("offset",r.offset.toString()),r!=null&&r.type&&o.set("type",r.type),r!=null&&r.conversation_key&&o.set("conversation_key",r.conversation_key);const a=o.toString();return tt(`/messages${a?`?${a}`:""}`)},getMessagesBulk:(r,o=100)=>tt(`/messages/bulk?limit_per_conversation=${o}`,{method:"POST",body:JSON.stringify(r)}),sendDirectMessage:(r,o)=>tt("/messages/direct",{method:"POST",body:JSON.stringify({destination:r,text:o})}),sendChannelMessage:(r,o)=>tt("/messages/channel",{method:"POST",body:JSON.stringify({channel_key:r,text:o})}),getUndecryptedPacketCount:()=>tt("/packets/undecrypted/count"),decryptHistoricalPackets:r=>tt("/packets/decrypt/historical",{method:"POST",body:JSON.stringify(r)}),getSettings:()=>tt("/settings"),updateSettings:r=>tt("/settings",{method:"PATCH",body:JSON.stringify(r)})};function A1(r){const o=B.useRef(null),a=B.useRef(null),[s,c]=B.useState(!1),l=B.useCallback(()=>{const A=window.location.protocol==="https:"?"wss:":"ws:",f=window.location.port==="5173"?"ws://localhost:8000/api/ws":`${A}//${window.location.host}/api/ws`,h=new WebSocket(f);h.onopen=()=>{console.log("WebSocket connected"),c(!0)},h.onclose=()=>{console.log("WebSocket disconnected"),c(!1),o.current=null,a.current=window.setTimeout(()=>{console.log("Attempting WebSocket reconnect..."),l()},3e3)},h.onerror=m=>{console.error("WebSocket error:",m)},h.onmessage=m=>{var p,v,_,b,S,y,x,C;try{const w=JSON.parse(m.data);switch(w.type){case"health":(p=r.onHealth)==null||p.call(r,w.data);break;case"contacts":(v=r.onContacts)==null||v.call(r,w.data);break;case"channels":(_=r.onChannels)==null||_.call(r,w.data);break;case"message":(b=r.onMessage)==null||b.call(r,w.data);break;case"contact":(S=r.onContact)==null||S.call(r,w.data);break;case"raw_packet":(y=r.onRawPacket)==null||y.call(r,w.data);break;case"message_acked":(x=r.onMessageAcked)==null||x.call(r,w.data.message_id);break;case"error":(C=r.onError)==null||C.call(r,w.data);break;case"pong":break;default:console.log("Unknown WebSocket message type:",w.type)}}catch(w){console.error("Failed to parse WebSocket message:",w)}},o.current=h},[r]);return B.useEffect(()=>{l();const A=setInterval(()=>{var u;((u=o.current)==null?void 0:u.readyState)===WebSocket.OPEN&&o.current.send("ping")},3e4);return()=>{clearInterval(A),a.current&&clearTimeout(a.current),o.current&&o.current.close()}},[l]),{connected:s}}/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),ch=r=>{const o=m1(r);return o.charAt(0).toUpperCase()+o.slice(1)},oA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),g1=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var v1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y1=B.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:A,...u},f)=>B.createElement("svg",{ref:f,...v1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:oA("lucide",c),...!l&&!g1(u)&&{"aria-hidden":"true"},...u},[...A.map(([h,m])=>B.createElement(h,m)),...Array.isArray(l)?l:[l]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const su=(r,o)=>{const a=B.forwardRef(({className:s,...c},l)=>B.createElement(y1,{ref:l,iconNode:o,className:oA(`lucide-${p1(ch(r))}`,`lucide-${r}`,s),...c}));return a.displayName=ch(r),a};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const x1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],w1=su("check",x1);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const b1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_1=su("menu",b1);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aA=su("x",C1);var sA=nA();const iA=nu(sA);function k1(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const S1=r=>{switch(r){case"success":return T1;case"info":return P1;case"warning":return B1;case"error":return N1;default:return null}},E1=Array(12).fill(0),R1=({visible:r,className:o})=>he.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},E1.map((a,s)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),T1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),B1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),P1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),D1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I1=()=>{const[r,o]=he.useState(document.hidden);return he.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Qc=1;class j1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Qc++,A=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,A;const u=c.then(async h=>{if(A=["resolve",h],he.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(O1(h)&&!h.ok){l=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,b=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...b})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,v=typeof a.description=="function"?await a.description(h):a.description,b=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...b})}else if(a.success!==void 0){l=!1;const p=typeof a.success=="function"?await a.success(h):a.success,v=typeof a.description=="function"?await a.description(h):a.description,b=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:v,...b})}}).catch(async h=>{if(A=["reject",h],a.error!==void 0){l=!1;const m=typeof a.error=="function"?await a.error(h):a.error,p=typeof a.description=="function"?await a.description(h):a.description,_=typeof m=="object"&&!he.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:p,..._})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),f=()=>new Promise((h,m)=>u.then(()=>A[0]==="reject"?m(A[1]):h(A[1])).catch(m));return typeof s!="string"&&typeof s!="number"?{unwrap:f}:Object.assign(s,{unwrap:f})},this.custom=(o,a)=>{const s=(a==null?void 0:a.id)||Qc++;return this.create({jsx:o(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const or=new j1,M1=(r,o)=>{const a=(o==null?void 0:o.id)||Qc++;return or.addToast({title:r,...o,id:a}),a},O1=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",F1=M1,L1=()=>or.toasts,H1=()=>or.getActiveToasts(),wa=Object.assign(F1,{success:or.success,info:or.info,warning:or.warning,error:or.error,custom:or.custom,message:or.message,promise:or.promise,dismiss:or.dismiss,loading:or.loading},{getHistory:L1,getToasts:H1});k1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ms(r){return r.label!==void 0}const z1=3,V1="24px",U1="16px",uh=4e3,W1=356,Q1=14,G1=45,q1=200;function Or(...r){return r.filter(Boolean).join(" ")}function K1(r){const[o,a]=r.split("-"),s=[];return o&&s.push(o),a&&s.push(a),s}const Y1=r=>{var o,a,s,c,l,A,u,f,h;const{invert:m,toast:p,unstyled:v,interacting:_,setHeights:b,visibleToasts:S,heights:y,index:x,toasts:C,expanded:w,removeToast:T,defaultRichColors:R,closeButton:D,style:N,cancelButtonStyle:I,actionButtonStyle:F,className:j="",descriptionClassName:L="",duration:G,position:K,gap:ee,expandByDefault:se,classNames:J,icons:ne,closeButtonAriaLabel:W="Close toast"}=r,[X,Z]=he.useState(null),[k,O]=he.useState(null),[z,V]=he.useState(!1),[re,ue]=he.useState(!1),[de,oe]=he.useState(!1),[Be,ze]=he.useState(!1),[dt,it]=he.useState(!1),[ft,Je]=he.useState(0),[ar,Ut]=he.useState(0),Et=he.useRef(p.duration||G||uh),Wt=he.useRef(null),ht=he.useRef(null),It=x===0,nt=x+1<=S,Ve=p.type,At=p.dismissible!==!1,Kt=p.className||"",dr=p.descriptionClassName||"",$=he.useMemo(()=>y.findIndex(Se=>Se.toastId===p.id)||0,[y,p.id]),Ae=he.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:D},[p.closeButton,D]),Ee=he.useMemo(()=>p.duration||G||uh,[p.duration,G]),ke=he.useRef(0),Ie=he.useRef(0),Qe=he.useRef(0),Xe=he.useRef(null),[Yt,Rt]=K.split("-"),te=he.useMemo(()=>y.reduce((Se,qe,ot)=>ot>=$?Se:Se+qe.height,0),[y,$]),le=I1(),me=p.invert||m,De=Ve==="loading";Ie.current=he.useMemo(()=>$*ee+te,[$,te]),he.useEffect(()=>{Et.current=Ee},[Ee]),he.useEffect(()=>{V(!0)},[]),he.useEffect(()=>{const Se=ht.current;if(Se){const qe=Se.getBoundingClientRect().height;return Ut(qe),b(ot=>[{toastId:p.id,height:qe,position:p.position},...ot]),()=>b(ot=>ot.filter(pt=>pt.toastId!==p.id))}},[b,p.id]),he.useLayoutEffect(()=>{if(!z)return;const Se=ht.current,qe=Se.style.height;Se.style.height="auto";const ot=Se.getBoundingClientRect().height;Se.style.height=qe,Ut(ot),b(pt=>pt.find(Le=>Le.toastId===p.id)?pt.map(Le=>Le.toastId===p.id?{...Le,height:ot}:Le):[{toastId:p.id,height:ot,position:p.position},...pt])},[z,p.title,p.description,b,p.id,p.jsx,p.action,p.cancel]);const Pe=he.useCallback(()=>{ue(!0),Je(Ie.current),b(Se=>Se.filter(qe=>qe.toastId!==p.id)),setTimeout(()=>{T(p)},q1)},[p,T,b,Ie]);he.useEffect(()=>{if(p.promise&&Ve==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||_||le?(()=>{if(Qe.current{Et.current!==1/0&&(ke.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Pe()},Et.current))})(),()=>clearTimeout(Se)},[w,_,p,Ve,le,Pe]),he.useEffect(()=>{p.delete&&(Pe(),p.onDismiss==null||p.onDismiss.call(p,p))},[Pe,p.delete]);function je(){var Se;if(ne!=null&&ne.loading){var qe;return he.createElement("div",{className:Or(J==null?void 0:J.loader,p==null||(qe=p.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":Ve==="loading"},ne.loading)}return he.createElement(R1,{className:Or(J==null?void 0:J.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:Ve==="loading"})}const Fe=p.icon||(ne==null?void 0:ne[Ve])||S1(Ve);var Ue,Qt;return he.createElement("li",{tabIndex:0,ref:ht,className:Or(j,Kt,J==null?void 0:J.toast,p==null||(o=p.classNames)==null?void 0:o.toast,J==null?void 0:J.default,J==null?void 0:J[Ve],p==null||(a=p.classNames)==null?void 0:a[Ve]),"data-sonner-toast":"","data-rich-colors":(Ue=p.richColors)!=null?Ue:R,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":z,"data-promise":!!p.promise,"data-swiped":dt,"data-removed":re,"data-visible":nt,"data-y-position":Yt,"data-x-position":Rt,"data-index":x,"data-front":It,"data-swiping":de,"data-dismissible":At,"data-type":Ve,"data-invert":me,"data-swipe-out":Be,"data-swipe-direction":k,"data-expanded":!!(w||se&&z),"data-testid":p.testId,style:{"--index":x,"--toasts-before":x,"--z-index":C.length-x,"--offset":`${re?ft:Ie.current}px`,"--initial-height":se?"auto":`${ar}px`,...N,...p.style},onDragEnd:()=>{oe(!1),Z(null),Xe.current=null},onPointerDown:Se=>{Se.button!==2&&(De||!At||(Wt.current=new Date,Je(Ie.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(oe(!0),Xe.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,qe,ot;if(Be||!At)return;Xe.current=null;const pt=Number(((Se=ht.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fr=Number(((qe=ht.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Le=new Date().getTime()-((ot=Wt.current)==null?void 0:ot.getTime()),$e=X==="x"?pt:fr,xr=Math.abs($e)/Le;if(Math.abs($e)>=G1||xr>.11){Je(Ie.current),p.onDismiss==null||p.onDismiss.call(p,p),O(X==="x"?pt>0?"right":"left":fr>0?"down":"up"),Pe(),ze(!0);return}else{var Ke,mt;(Ke=ht.current)==null||Ke.style.setProperty("--swipe-amount-x","0px"),(mt=ht.current)==null||mt.style.setProperty("--swipe-amount-y","0px")}it(!1),oe(!1),Z(null)},onPointerMove:Se=>{var qe,ot,pt;if(!Xe.current||!At||((qe=window.getSelection())==null?void 0:qe.toString().length)>0)return;const Le=Se.clientY-Xe.current.y,$e=Se.clientX-Xe.current.x;var xr;const Ke=(xr=r.swipeDirections)!=null?xr:K1(K);!X&&(Math.abs($e)>1||Math.abs(Le)>1)&&Z(Math.abs($e)>Math.abs(Le)?"x":"y");let mt={x:0,y:0};const wr=Zt=>1/(1.5+Math.abs(Zt)/20);if(X==="y"){if(Ke.includes("top")||Ke.includes("bottom"))if(Ke.includes("top")&&Le<0||Ke.includes("bottom")&&Le>0)mt.y=Le;else{const Zt=Le*wr(Le);mt.y=Math.abs(Zt)0)mt.x=$e;else{const Zt=$e*wr($e);mt.x=Math.abs(Zt)0||Math.abs(mt.y)>0)&&it(!0),(ot=ht.current)==null||ot.style.setProperty("--swipe-amount-x",`${mt.x}px`),(pt=ht.current)==null||pt.style.setProperty("--swipe-amount-y",`${mt.y}px`)}},Ae&&!p.jsx&&Ve!=="loading"?he.createElement("button",{"aria-label":W,"data-disabled":De,"data-close-button":!0,onClick:De||!At?()=>{}:()=>{Pe(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Or(J==null?void 0:J.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},(Qt=ne==null?void 0:ne.close)!=null?Qt:D1):null,(Ve||p.icon||p.promise)&&p.icon!==null&&((ne==null?void 0:ne[Ve])!==null||p.icon)?he.createElement("div",{"data-icon":"",className:Or(J==null?void 0:J.icon,p==null||(c=p.classNames)==null?void 0:c.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||je():null,p.type!=="loading"?Fe:null):null,he.createElement("div",{"data-content":"",className:Or(J==null?void 0:J.content,p==null||(l=p.classNames)==null?void 0:l.content)},he.createElement("div",{"data-title":"",className:Or(J==null?void 0:J.title,p==null||(A=p.classNames)==null?void 0:A.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?he.createElement("div",{"data-description":"",className:Or(L,dr,J==null?void 0:J.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),he.isValidElement(p.cancel)?p.cancel:p.cancel&&Ms(p.cancel)?he.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||I,onClick:Se=>{Ms(p.cancel)&&At&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),Pe())},className:Or(J==null?void 0:J.cancelButton,p==null||(f=p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,he.isValidElement(p.action)?p.action:p.action&&Ms(p.action)?he.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:Se=>{Ms(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&Pe())},className:Or(J==null?void 0:J.actionButton,p==null||(h=p.classNames)==null?void 0:h.actionButton)},p.action.label):null)};function dh(){if(typeof window>"u"||typeof document>"u")return"ltr";const r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function Z1(r,o){const a={};return[r,o].forEach((s,c)=>{const l=c===1,A=l?"--mobile-offset":"--offset",u=l?U1:V1;function f(h){["top","right","bottom","left"].forEach(m=>{a[`${A}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof s=="number"||typeof s=="string"?f(s):typeof s=="object"?["top","right","bottom","left"].forEach(h=>{s[h]===void 0?a[`${A}-${h}`]=u:a[`${A}-${h}`]=typeof s[h]=="number"?`${s[h]}px`:s[h]}):f(u)}),a}const X1=he.forwardRef(function(o,a){const{id:s,invert:c,position:l="bottom-right",hotkey:A=["altKey","KeyT"],expand:u,closeButton:f,className:h,offset:m,mobileOffset:p,theme:v="light",richColors:_,duration:b,style:S,visibleToasts:y=z1,toastOptions:x,dir:C=dh(),gap:w=Q1,icons:T,containerAriaLabel:R="Notifications"}=o,[D,N]=he.useState([]),I=he.useMemo(()=>s?D.filter(z=>z.toasterId===s):D.filter(z=>!z.toasterId),[D,s]),F=he.useMemo(()=>Array.from(new Set([l].concat(I.filter(z=>z.position).map(z=>z.position)))),[I,l]),[j,L]=he.useState([]),[G,K]=he.useState(!1),[ee,se]=he.useState(!1),[J,ne]=he.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=he.useRef(null),X=A.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=he.useRef(null),k=he.useRef(!1),O=he.useCallback(z=>{N(V=>{var re;return(re=V.find(ue=>ue.id===z.id))!=null&&re.delete||or.dismiss(z.id),V.filter(({id:ue})=>ue!==z.id)})},[]);return he.useEffect(()=>or.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{N(V=>V.map(re=>re.id===z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{iA.flushSync(()=>{N(V=>{const re=V.findIndex(ue=>ue.id===z.id);return re!==-1?[...V.slice(0,re),{...V[re],...z},...V.slice(re+1)]:[z,...V]})})})}),[D]),he.useEffect(()=>{if(v!=="system"){ne(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:V})=>{ne(V?"dark":"light")})}catch{z.addListener(({matches:re})=>{try{ne(re?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),he.useEffect(()=>{D.length<=1&&K(!1)},[D]),he.useEffect(()=>{const z=V=>{var re;if(A.every(oe=>V[oe]||V.code===oe)){var de;K(!0),(de=W.current)==null||de.focus()}V.code==="Escape"&&(document.activeElement===W.current||(re=W.current)!=null&&re.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[A]),he.useEffect(()=>{if(W.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,k.current=!1)}},[W.current]),he.createElement("section",{ref:a,"aria-label":`${R} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((z,V)=>{var re;const[ue,de]=z.split("-");return I.length?he.createElement("ol",{key:z,dir:C==="auto"?dh():C,tabIndex:-1,ref:W,className:h,"data-sonner-toaster":!0,"data-sonner-theme":J,"data-y-position":ue,"data-x-position":de,style:{"--front-toast-height":`${((re=j[0])==null?void 0:re.height)||0}px`,"--width":`${W1}px`,"--gap":`${w}px`,...S,...Z1(m,p)},onBlur:oe=>{k.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(k.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||k.current||(k.current=!0,Z.current=oe.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{ee||K(!1)},onDragEnd:()=>K(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},I.filter(oe=>!oe.position&&V===0||oe.position===z).map((oe,Be)=>{var ze,dt;return he.createElement(Y1,{key:oe.id,icons:T,index:Be,toast:oe,defaultRichColors:_,duration:(ze=x==null?void 0:x.duration)!=null?ze:b,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:c,visibleToasts:y,closeButton:(dt=x==null?void 0:x.closeButton)!=null?dt:f,interacting:ee,position:z,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:O,toasts:I.filter(it=>it.position==oe.position),heights:j.filter(it=>it.position==oe.position),setHeights:L,expandByDefault:u,gap:w,expanded:G,swipeDirections:o.swipeDirections})})):null}))}),J1=({...r})=>P.jsx(X1,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",error:"group-[.toaster]:bg-[#2a1a1a] group-[.toaster]:text-[#e8a0a0] group-[.toaster]:border-[#4a2a2a] [&_[data-description]]:text-[#b08080]"}},...r});function $1({health:r,config:o,onConfigClick:a,onAdvertise:s,onMenuClick:c}){const l=(r==null?void 0:r.radio_connected)??!1,[A,u]=B.useState(!1),f=async()=>{u(!0);try{const h=await rt.reconnectRadio();h.connected&&wa.success("Reconnected",{description:h.message})}catch(h){wa.error("Reconnection failed",{description:h instanceof Error?h.message:"Check radio connection and power"})}finally{u(!1)}};return P.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[c&&P.jsx("button",{onClick:c,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:P.jsx(_1,{className:"h-5 w-5"})}),P.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),P.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[P.jsx("div",{className:`w-2 h-2 rounded-full ${l?"bg-[#4caf50]":"bg-[#666]"}`}),P.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:l?"Connected":"Disconnected"})]}),(r==null?void 0:r.serial_port)&&P.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",P.jsx("span",{className:"text-[#e0e0e0]",children:r.serial_port})]}),o&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:["Name: ",P.jsx("span",{className:"text-[#e0e0e0]",children:o.name||"Unnamed"})]}),P.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Freq: ",P.jsxs("span",{className:"text-[#e0e0e0]",children:[o.radio.freq," MHz"]})]}),P.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["SF",o.radio.sf,"/CR",o.radio.cr]}),P.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["TX: ",P.jsxs("span",{className:"text-[#e0e0e0]",children:[o.tx_power," dBm"]})]})]}),P.jsx("div",{className:"flex-1 lg:hidden"}),!l&&P.jsx("button",{onClick:f,disabled:A,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:A?"Reconnecting...":"Reconnect"}),P.jsx("button",{onClick:s,disabled:!l,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),P.jsx("button",{onClick:a,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:"Config"})]})}const eg=12;function ko(r){return r.slice(0,eg)}function lA(r,o){return!r||!o?!1:ko(r)===ko(o)}function _a(r,o){return r||ko(o)}const Gc="remoteterm-lastMessageTime",qc="remoteterm-lastReadTime";function fi(r){try{const o=localStorage.getItem(r);return o?JSON.parse(o):{}}catch{return{}}}function cA(r,o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}}function fh(){return fi(Gc)}function tg(){return fi(qc)}function fc(r,o){const a=fi(Gc);return(!a[r]||o>a[r])&&(a[r]=o,cA(Gc,a)),a}function rg(r,o){const a=fi(qc);return a[r]=o,cA(qc,a),a}function Vn(r,o){return r==="channel"?`channel-${o}`:`contact-${ko(o)}`}const Kc=2,ng={text:"🛜",background:"#444444",textColor:"#ffffff"};function og(r){let o=0;for(let a=0;a>8)%30,c=35+(o>>16)%20,l=`hsl(${a}, ${s}%, ${c}%)`,A=c<45?"#ffffff":"#000000";return{background:l,text:A}}function lg(r,o,a){if(a===Kc)return ng;const s=sg(r,o),c=ig(o);return{text:s,background:c.background,textColor:c.text}}function uA({name:r,publicKey:o,size:a=28,contactType:s}){const c=lg(r,o,s);return P.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:a,height:a,fontSize:a*.45},children:c.text})}function dA(r){var o,a,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(o=0;o{const a=new Array(r.length+o.length);for(let s=0;s({classGroupId:r,validator:o}),hA=(r=new Map,o=null,a)=>({nextPart:r,validators:o,classGroupId:a}),ci="-",hh=[],dg="arbitrary..",fg=r=>{const o=Ag(r),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:A=>{if(A.startsWith("[")&&A.endsWith("]"))return hg(A);const u=A.split(ci),f=u[0]===""&&u.length>1?1:0;return AA(u,f,o)},getConflictingClassGroupIds:(A,u)=>{if(u){const f=s[A],h=a[A];return f?h?cg(h,f):f:h||hh}return a[A]||hh}}},AA=(r,o,a)=>{if(r.length-o===0)return a.classGroupId;const c=r[o],l=a.nextPart.get(c);if(l){const h=AA(r,o+1,l);if(h)return h}const A=a.validators;if(A===null)return;const u=o===0?r.join(ci):r.slice(o).join(ci),f=A.length;for(let h=0;hr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=r.slice(1,-1),a=o.indexOf(":"),s=o.slice(0,a);return s?dg+s:void 0})(),Ag=r=>{const{theme:o,classGroups:a}=r;return pg(a,o)},pg=(r,o)=>{const a=hA();for(const s in r){const c=r[s];iu(c,a,s,o)}return a},iu=(r,o,a,s)=>{const c=r.length;for(let l=0;l{if(typeof r=="string"){gg(r,o,a);return}if(typeof r=="function"){vg(r,o,a,s);return}yg(r,o,a,s)},gg=(r,o,a)=>{const s=r===""?o:pA(o,r);s.classGroupId=a},vg=(r,o,a,s)=>{if(xg(r)){iu(r(s),o,a,s);return}o.validators===null&&(o.validators=[]),o.validators.push(ug(a,r))},yg=(r,o,a,s)=>{const c=Object.entries(r),l=c.length;for(let A=0;A{let a=r;const s=o.split(ci),c=s.length;for(let l=0;l"isThemeGetter"in r&&r.isThemeGetter===!0,wg=r=>{if(r<1)return{get:()=>{},set:()=>{}};let o=0,a=Object.create(null),s=Object.create(null);const c=(l,A)=>{a[l]=A,o++,o>r&&(o=0,s=a,a=Object.create(null))};return{get(l){let A=a[l];if(A!==void 0)return A;if((A=s[l])!==void 0)return c(l,A),A},set(l,A){l in a?a[l]=A:c(l,A)}}},Yc="!",Ah=":",bg=[],ph=(r,o,a,s,c)=>({modifiers:r,hasImportantModifier:o,baseClassName:a,maybePostfixModifierPosition:s,isExternal:c}),_g=r=>{const{prefix:o,experimentalParseClassName:a}=r;let s=c=>{const l=[];let A=0,u=0,f=0,h;const m=c.length;for(let S=0;Sf?h-f:void 0;return ph(l,_,v,b)};if(o){const c=o+Ah,l=s;s=A=>A.startsWith(c)?l(A.slice(c.length)):ph(bg,!1,A,void 0,!0)}if(a){const c=s;s=l=>a({className:l,parseClassName:c})}return s},Cg=r=>{const o=new Map;return r.orderSensitiveModifiers.forEach((a,s)=>{o.set(a,1e6+s)}),a=>{const s=[];let c=[];for(let l=0;l0&&(c.sort(),s.push(...c),c=[]),s.push(A)):c.push(A)}return c.length>0&&(c.sort(),s.push(...c)),s}},kg=r=>({cache:wg(r.cacheSize),parseClassName:_g(r),sortModifiers:Cg(r),...fg(r)}),Sg=/\s+/,Eg=(r,o)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:c,sortModifiers:l}=o,A=[],u=r.trim().split(Sg);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:p,modifiers:v,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:S}=a(m);if(p){f=m+(f.length>0?" "+f:f);continue}let y=!!S,x=s(y?b.substring(0,S):b);if(!x){if(!y){f=m+(f.length>0?" "+f:f);continue}if(x=s(b),!x){f=m+(f.length>0?" "+f:f);continue}y=!1}const C=v.length===0?"":v.length===1?v[0]:l(v).join(":"),w=_?C+Yc:C,T=w+x;if(A.indexOf(T)>-1)continue;A.push(T);const R=c(x,y);for(let D=0;D0?" "+f:f)}return f},Rg=(...r)=>{let o=0,a,s,c="";for(;o{if(typeof r=="string")return r;let o,a="";for(let s=0;s{let a,s,c,l;const A=f=>{const h=o.reduce((m,p)=>p(m),r());return a=kg(h),s=a.cache.get,c=a.cache.set,l=u,u(f)},u=f=>{const h=s(f);if(h)return h;const m=Eg(f,a);return c(f,m),m};return l=A,(...f)=>l(Rg(...f))},Bg=[],kt=r=>{const o=a=>a[r]||Bg;return o.isThemeGetter=!0,o},gA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pg=/^\d+\/\d+$/,Ng=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ig=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,po=r=>Pg.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),yn=r=>!!r&&Number.isInteger(Number(r)),hc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Xr=r=>Ng.test(r),Og=()=>!0,Fg=r=>Dg.test(r)&&!Ig.test(r),yA=()=>!1,Lg=r=>jg.test(r),Hg=r=>Mg.test(r),zg=r=>!xe(r)&&!we(r),Vg=r=>Ro(r,bA,yA),xe=r=>gA.test(r),Fn=r=>Ro(r,_A,Fg),Ac=r=>Ro(r,qg,Me),mh=r=>Ro(r,xA,yA),Ug=r=>Ro(r,wA,Hg),Os=r=>Ro(r,CA,Lg),we=r=>vA.test(r),fa=r=>To(r,_A),Wg=r=>To(r,Kg),gh=r=>To(r,xA),Qg=r=>To(r,bA),Gg=r=>To(r,wA),Fs=r=>To(r,CA,!0),Ro=(r,o,a)=>{const s=gA.exec(r);return s?s[1]?o(s[1]):a(s[2]):!1},To=(r,o,a=!1)=>{const s=vA.exec(r);return s?s[1]?o(s[1]):a:!1},xA=r=>r==="position"||r==="percentage",wA=r=>r==="image"||r==="url",bA=r=>r==="length"||r==="size"||r==="bg-size",_A=r=>r==="length",qg=r=>r==="number",Kg=r=>r==="family-name",CA=r=>r==="shadow",Yg=()=>{const r=kt("color"),o=kt("font"),a=kt("text"),s=kt("font-weight"),c=kt("tracking"),l=kt("leading"),A=kt("breakpoint"),u=kt("container"),f=kt("spacing"),h=kt("radius"),m=kt("shadow"),p=kt("inset-shadow"),v=kt("text-shadow"),_=kt("drop-shadow"),b=kt("blur"),S=kt("perspective"),y=kt("aspect"),x=kt("ease"),C=kt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...T(),we,xe],D=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],I=()=>[we,xe,f],F=()=>[po,"full","auto",...I()],j=()=>[yn,"none","subgrid",we,xe],L=()=>["auto",{span:["full",yn,we,xe]},yn,we,xe],G=()=>[yn,"auto",we,xe],K=()=>["auto","min","max","fr",we,xe],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...I()],ne=()=>[po,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],W=()=>[r,we,xe],X=()=>[...T(),gh,mh,{position:[we,xe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],k=()=>["auto","cover","contain",Qg,Vg,{size:[we,xe]}],O=()=>[hc,fa,Fn],z=()=>["","none","full",h,we,xe],V=()=>["",Me,fa,Fn],re=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Me,hc,gh,mh],oe=()=>["","none",b,we,xe],Be=()=>["none",Me,we,xe],ze=()=>["none",Me,we,xe],dt=()=>[Me,we,xe],it=()=>[po,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xr],breakpoint:[Xr],color:[Og],container:[Xr],"drop-shadow":[Xr],ease:["in","out","in-out"],font:[zg],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xr],shadow:[Xr],spacing:["px",Me],text:[Xr],"text-shadow":[Xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",po,xe,we,y]}],container:["container"],columns:[{columns:[Me,xe,we,u]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[yn,"auto",we,xe]}],basis:[{basis:[po,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,po,"auto","initial","none",xe]}],grow:[{grow:["",Me,we,xe]}],shrink:[{shrink:["",Me,we,xe]}],order:[{order:[yn,"first","last","none",we,xe]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[u,"screen",...ne()]}],"min-w":[{"min-w":[u,"screen","none",...ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[A]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh",...ne()]}],"font-size":[{text:["base",a,fa,Fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,we,Ac]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hc,xe]}],"font-family":[{font:[Wg,xe,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,we,xe]}],"line-clamp":[{"line-clamp":[Me,"none",we,Ac]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",we,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",we,Fn]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Me,"auto",we,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:k()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yn,we,xe],radial:["",we,xe],conic:[yn,we,xe]},Gg,Ug]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,we,xe]}],"outline-w":[{outline:["",Me,fa,Fn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",m,Fs,Os]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",p,Fs,Os]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Me,Fn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",v,Fs,Os]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Me,we,xe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[we,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:k()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,xe]}],filter:[{filter:["","none",we,xe]}],blur:[{blur:oe()}],brightness:[{brightness:[Me,we,xe]}],contrast:[{contrast:[Me,we,xe]}],"drop-shadow":[{"drop-shadow":["","none",_,Fs,Os]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Me,we,xe]}],"hue-rotate":[{"hue-rotate":[Me,we,xe]}],invert:[{invert:["",Me,we,xe]}],saturate:[{saturate:[Me,we,xe]}],sepia:[{sepia:["",Me,we,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",we,xe]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Me,we,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Me,we,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,we,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,we,xe]}],"backdrop-invert":[{"backdrop-invert":["",Me,we,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Me,we,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Me,we,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,we,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",we,xe]}],ease:[{ease:["linear","initial",x,we,xe]}],delay:[{delay:[Me,we,xe]}],animate:[{animate:["none",C,we,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,we,xe]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Be()}],"rotate-x":[{"rotate-x":Be()}],"rotate-y":[{"rotate-y":Be()}],"rotate-z":[{"rotate-z":Be()}],scale:[{scale:ze()}],"scale-x":[{"scale-x":ze()}],"scale-y":[{"scale-y":ze()}],"scale-z":[{"scale-z":ze()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[we,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,xe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Me,fa,Fn,Ac]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Zg=Tg(Yg);function Ze(...r){return Zg(fA(r))}const bt=B.forwardRef(({className:r,type:o,...a},s)=>P.jsx("input",{type:o,className:Ze("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:s,...a}));bt.displayName="Input";function vh(r,o){if(typeof r=="function")return r(o);r!=null&&(r.current=o)}function ka(...r){return o=>{let a=!1;const s=r.map(c=>{const l=vh(c,o);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let c=0;c{let{children:l,...A}=s;kA(l)&&typeof ui=="function"&&(l=ui(l._payload));const u=B.Children.toArray(l),f=u.find(rv);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}var $g=lu("Slot");function ev(r){const o=B.forwardRef((a,s)=>{let{children:c,...l}=a;if(kA(c)&&typeof ui=="function"&&(c=ui(c._payload)),B.isValidElement(c)){const A=ov(c),u=nv(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var tv=Symbol("radix.slottable");function rv(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===tv}function nv(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ov(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}const yh=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,xh=fA,hi=(r,o)=>a=>{var s;if((o==null?void 0:o.variants)==null)return xh(r,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:c,defaultVariants:l}=o,A=Object.keys(c).map(h=>{const m=a==null?void 0:a[h],p=l==null?void 0:l[h];if(m===null)return null;const v=yh(m)||yh(p);return c[h][v]}),u=a&&Object.entries(a).reduce((h,m)=>{let[p,v]=m;return v===void 0||(h[p]=v),h},{}),f=o==null||(s=o.compoundVariants)===null||s===void 0?void 0:s.reduce((h,m)=>{let{class:p,className:v,..._}=m;return Object.entries(_).every(b=>{let[S,y]=b;return Array.isArray(y)?y.includes({...l,...u}[S]):{...l,...u}[S]===y})?[...h,p,v]:h},[]);return xh(r,A,f,a==null?void 0:a.class,a==null?void 0:a.className)},av=hi("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Vr=B.forwardRef(({className:r,variant:o,size:a,asChild:s=!1,...c},l)=>{const A=s?$g:"button";return P.jsx(A,{className:Ze(av({variant:o,size:a,className:r})),ref:l,...c})});Vr.displayName="Button";function sv(){try{return localStorage.getItem("remoteterm-sortOrder")==="recent"?"recent":"alpha"}catch{return"alpha"}}function iv(r){try{localStorage.setItem("remoteterm-sortOrder",r)}catch{}}function lv({contacts:r,channels:o,activeConversation:a,onSelectConversation:s,onNewMessage:c,lastMessageTimes:l,unreadCounts:A}){const[u,f]=B.useState(sv),[h,m]=B.useState(""),p=()=>{const N=u==="alpha"?"recent":"alpha";f(N),iv(N)},v=N=>{m(""),s(N)},_=(N,I)=>(a==null?void 0:a.type)===N&&(a==null?void 0:a.id)===I,b=(N,I)=>{const F=Vn(N,I);return A[F]||0},S=(N,I)=>{const F=Vn(N,I);return l[F]||0},y=o.reduce((N,I)=>(N.some(F=>F.name===I.name)||N.push(I),N),[]),x=r.filter(N=>N.public_key&&N.public_key.length>0).sort((N,I)=>N.name&&!I.name?-1:!N.name&&I.name?1:(N.name||"").localeCompare(I.name||"")).reduce((N,I)=>{const F=ko(I.public_key);return N.some(j=>ko(j.public_key)===F)||N.push(I),N},[]),C=[...y].sort((N,I)=>{if(N.name==="Public")return-1;if(I.name==="Public")return 1;if(u==="recent"){const F=S("channel",N.key),j=S("channel",I.key);if(F&&j)return j-F;if(F&&!j)return-1;if(!F&&j)return 1}return N.name.localeCompare(I.name)}),w=[...x].sort((N,I)=>{const F=N.type===Kc,j=I.type===Kc;if(F&&!j)return 1;if(!F&&j)return-1;if(F&&j)return(N.name||N.public_key).localeCompare(I.name||I.public_key);if(u==="recent"){const L=S("contact",N.public_key),G=S("contact",I.public_key);if(L&&G)return G-L;if(L&&!G)return-1;if(!L&&G)return 1}return(N.name||N.public_key).localeCompare(I.name||I.public_key)}),T=h.toLowerCase().trim(),R=T?C.filter(N=>N.name.toLowerCase().includes(T)):C,D=T?w.filter(N=>{var I;return((I=N.name)==null?void 0:I.toLowerCase().includes(T))||N.public_key.toLowerCase().includes(T)}):w;return P.jsxs("div",{className:"sidebar w-60 h-full min-h-0 bg-card border-r border-border flex flex-col",children:[P.jsxs("div",{className:"flex justify-between items-center px-3 py-3 border-b border-border",children:[P.jsx("h2",{className:"text-xs uppercase text-muted-foreground font-medium",children:"Conversations"}),P.jsx(Vr,{variant:"ghost",size:"sm",onClick:c,title:"New Message",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:"+"})]}),P.jsxs("div",{className:"relative px-3 py-2 border-b border-border",children:[P.jsx(bt,{type:"text",placeholder:"Search...",value:h,onChange:N=>m(N.target.value),className:"h-8 text-sm pr-8"}),h&&P.jsx("button",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground text-lg leading-none",onClick:()=>m(""),title:"Clear search",children:"×"})]}),P.jsxs("div",{className:"flex-1 overflow-y-auto",children:[!T&&P.jsxs("div",{className:Ze("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",_("raw","raw")&&"bg-accent border-l-primary"),onClick:()=>v({type:"raw",id:"raw",name:"Raw Packet Feed"}),children:[P.jsx("span",{className:"text-muted-foreground text-xs",children:"📡"}),P.jsx("span",{className:"flex-1 truncate",children:"Packet Feed"})]}),R.length>0&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex justify-between items-center px-3 py-2 pt-3",children:[P.jsx("span",{className:"text-[11px] uppercase text-muted-foreground",children:"Channels"}),P.jsx("button",{className:"bg-transparent border border-border text-muted-foreground px-1.5 py-0.5 text-[10px] rounded hover:bg-accent hover:text-foreground",onClick:p,title:u==="alpha"?"Sort by recent":"Sort alphabetically",children:u==="alpha"?"A-Z":"⏱"})]}),R.map(N=>{const I=b("channel",N.key);return P.jsxs("div",{className:Ze("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",_("channel",N.key)&&"bg-accent border-l-primary",I>0&&"[&_.name]:font-bold [&_.name]:text-foreground"),onClick:()=>v({type:"channel",id:N.key,name:N.name}),children:[P.jsx("span",{className:"text-muted-foreground text-xs",children:"#"}),P.jsx("span",{className:"name flex-1 truncate",children:N.name}),I>0&&P.jsx("span",{className:"bg-primary text-primary-foreground text-[10px] font-semibold px-1.5 py-0.5 rounded-full min-w-[18px] text-center",children:I})]},`chan-${N.key}`)})]}),D.length>0&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex justify-between items-center px-3 py-2 pt-3",children:[P.jsx("span",{className:"text-[11px] uppercase text-muted-foreground",children:"Contacts"}),R.length===0&&P.jsx("button",{className:"bg-transparent border border-border text-muted-foreground px-1.5 py-0.5 text-[10px] rounded hover:bg-accent hover:text-foreground",onClick:p,title:u==="alpha"?"Sort by recent":"Sort alphabetically",children:u==="alpha"?"A-Z":"⏱"})]}),D.map(N=>{const I=b("contact",N.public_key);return P.jsxs("div",{className:Ze("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",_("contact",N.public_key)&&"bg-accent border-l-primary",I>0&&"[&_.name]:font-bold [&_.name]:text-foreground"),onClick:()=>v({type:"contact",id:N.public_key,name:_a(N.name,N.public_key)}),children:[P.jsx(uA,{name:N.name,publicKey:N.public_key,size:24,contactType:N.type}),P.jsx("span",{className:"name flex-1 truncate",children:_a(N.name,N.public_key)}),I>0&&P.jsx("span",{className:"bg-primary text-primary-foreground text-[10px] font-semibold px-1.5 py-0.5 rounded-full min-w-[18px] text-center",children:I})]},N.public_key)})]}),D.length===0&&R.length===0&&P.jsx("div",{className:"p-5 text-center text-muted-foreground",children:T?"No matches found":"No conversations yet"})]})]})}function wh(r){const o=r.indexOf(": ");if(o>0&&o<50){const a=r.substring(0,o);if(!/[:\[\]]/.test(a))return{sender:a,content:r.substring(o+2)}}return{sender:null,content:r}}function bh(r){const o=new Date(r*1e3),a=new Date,s=o.toDateString()===a.toDateString(),c=o.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s?c:`${o.toLocaleDateString([],{month:"short",day:"numeric"})} ${c}`}function cv({messages:r,contacts:o,loading:a,loadingOlder:s=!1,hasOlderMessages:c=!1,onSenderClick:l,onLoadOlder:A}){const u=B.useRef(null),f=B.useRef(0),h=B.useRef(!0),m=B.useRef({scrollTop:0,scrollHeight:0,wasNearTop:!1});B.useLayoutEffect(()=>{if(!u.current)return;const x=u.current,C=r.length-f.current;if(h.current&&r.length>0)x.scrollTop=x.scrollHeight,h.current=!1;else if(C>0&&f.current>0){const w=x.scrollHeight-m.current.scrollHeight;m.current.wasNearTop&&w>0?x.scrollTop=m.current.scrollTop+w:m.current.wasNearTop||(x.scrollTop=x.scrollHeight)}f.current=r.length},[r]),B.useEffect(()=>{r.length===0&&(h.current=!0,f.current=0,m.current={scrollTop:0,scrollHeight:0,wasNearTop:!1})},[r.length]);const p=B.useCallback(()=>{if(!u.current)return;const{scrollTop:x,scrollHeight:C}=u.current;m.current={scrollTop:x,scrollHeight:C,wasNearTop:x<150},!(!A||s||!c)&&x<100&&A()},[A,s,c]),v=x=>x&&o.find(C=>lA(C.public_key,x))||null,_=x=>o.find(C=>C.name===x)||null;if(a)return P.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-center text-muted-foreground",children:"Loading messages..."});if(r.length===0)return P.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-center text-muted-foreground",children:"No messages yet"});const S=[...r.reduce((x,C)=>{const w=`${C.type}-${C.conversation_key}-${C.text}-${C.sender_timestamp}`;return x.find(R=>`${R.type}-${R.conversation_key}-${R.text}-${R.sender_timestamp}`===w)||x.push(C),x},[])].sort((x,C)=>x.received_at-C.received_at),y=(x,C)=>x.outgoing?"__outgoing__":x.type==="PRIV"&&x.conversation_key?x.conversation_key:C||"__unknown__";return P.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-0.5",ref:u,onScroll:p,children:[s&&P.jsx("div",{className:"text-center py-2 text-muted-foreground text-sm",children:"Loading older messages..."}),!s&&c&&P.jsx("div",{className:"text-center py-2 text-muted-foreground text-xs",children:"Scroll up for older messages"}),S.map((x,C)=>{var se;const{sender:w,content:T}=wh(x.text),R=x.type==="PRIV"?v(x.conversation_key):null,D=x.outgoing?"You":(R==null?void 0:R.name)||w||((se=x.conversation_key)==null?void 0:se.slice(0,8))||"Unknown",N=!x.outgoing&&l&&D!=="Unknown",I=y(x,w),F=S[C-1],j=F?y(F,wh(F.text).sender):null,L=!x.outgoing&&I!==j,G=C===0;let K=null,ee="";if(!x.outgoing){if(x.type==="PRIV"&&x.conversation_key)K=(R==null?void 0:R.name)||null,ee=x.conversation_key;else if(w){const J=_(w);K=w,ee=(J==null?void 0:J.public_key)||`name:${w}`}}return P.jsxs("div",{className:Ze("flex items-start max-w-[85%]",x.outgoing&&"flex-row-reverse self-end",L&&!G&&"mt-3"),children:[!x.outgoing&&P.jsx("div",{className:"w-10 flex-shrink-0 flex items-start pt-0.5",children:L&&ee&&P.jsx(uA,{name:K,publicKey:ee,size:32})}),P.jsxs("div",{className:Ze("py-1.5 px-3 rounded-lg min-w-0",x.outgoing?"bg-[#1e3a29]":"bg-muted"),children:[L&&P.jsxs("div",{className:"text-[13px] font-semibold text-muted-foreground mb-0.5",children:[N?P.jsx("span",{className:"cursor-pointer hover:text-primary hover:underline",onClick:()=>l(D),title:`Mention ${D}`,children:D}):D,P.jsx("span",{className:"font-normal text-muted-foreground/70 ml-2 text-[11px]",children:bh(x.sender_timestamp||x.received_at)})]}),P.jsxs("div",{className:"break-words whitespace-pre-wrap",children:[T.split(` +`).map((J,ne,W)=>P.jsxs("span",{children:[J,ne({appendText:v=>{var _;A(b=>b+v),(_=h.current)==null||_.focus()}}));const m=B.useCallback(async v=>{v.preventDefault();const _=l.trim();if(!(!_||u||a)){f(!0);try{await o(_),A("")}catch(b){console.error("Failed to send message:",b)}finally{f(!1)}}},[l,u,a,o]),p=B.useCallback(v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),m(v))},[m]);return P.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:m,children:[P.jsx(bt,{ref:h,type:"text",value:l,onChange:v=>A(v.target.value),onKeyDown:p,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),P.jsx(Vr,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function St(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function dv(r,o){const a=B.createContext(o),s=l=>{const{children:A,...u}=l,f=B.useMemo(()=>u,Object.values(u));return P.jsx(a.Provider,{value:f,children:A})};s.displayName=r+"Provider";function c(l){const A=B.useContext(a);if(A)return A;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Sa(r,o=[]){let a=[];function s(l,A){const u=B.createContext(A),f=a.length;a=[...a,A];const h=p=>{var x;const{scope:v,children:_,...b}=p,S=((x=v==null?void 0:v[r])==null?void 0:x[f])||u,y=B.useMemo(()=>b,Object.values(b));return P.jsx(S.Provider,{value:y,children:_})};h.displayName=l+"Provider";function m(p,v){var S;const _=((S=v==null?void 0:v[r])==null?void 0:S[f])||u,b=B.useContext(_);if(b)return b;if(A!==void 0)return A;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[h,m]}const c=()=>{const l=a.map(A=>B.createContext(A));return function(u){const f=(u==null?void 0:u[r])||l;return B.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,fv(c,...o)]}function fv(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const A=s.reduce((u,{useScope:f,scopeName:h})=>{const p=f(l)[`__scope${h}`];return{...u,...p}},{});return B.useMemo(()=>({[`__scope${o.scopeName}`]:A}),[A])}};return a.scopeName=o.scopeName,a}var So=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},hv=au[" useId ".trim().toString()]||(()=>{}),Av=0;function ba(r){const[o,a]=B.useState(hv());return So(()=>{a(s=>s??String(Av++))},[r]),o?`radix-${o}`:""}var pv=au[" useInsertionEffect ".trim().toString()]||So;function Ai({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,A]=mv({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const m=B.useRef(r!==void 0);B.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,s])}const h=B.useCallback(m=>{var p;if(u){const v=gv(m)?m(r):m;v!==r&&((p=A.current)==null||p.call(A,v))}else l(m)},[u,r,l,A]);return[f,h]}function mv({defaultProp:r,onChange:o}){const[a,s]=B.useState(r),c=B.useRef(a),l=B.useRef(o);return pv(()=>{l.current=o},[o]),B.useEffect(()=>{var A;c.current!==a&&((A=l.current)==null||A.call(l,a),c.current=a)},[a,c]),[a,s,l]}function gv(r){return typeof r=="function"}function vv(r){const o=yv(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(wv);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function yv(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=_v(c),u=bv(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var xv=Symbol("radix.slottable");function wv(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===xv}function bv(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function _v(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var Cv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nt=Cv.reduce((r,o)=>{const a=vv(`Primitive.${o}`),s=B.forwardRef((c,l)=>{const{asChild:A,...u}=c,f=A?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{});function kv(r,o){r&&sA.flushSync(()=>r.dispatchEvent(o))}function Eo(r){const o=B.useRef(r);return B.useEffect(()=>{o.current=r}),B.useMemo(()=>(...a)=>{var s;return(s=o.current)==null?void 0:s.call(o,...a)},[])}function Sv(r,o=globalThis==null?void 0:globalThis.document){const a=Eo(r);B.useEffect(()=>{const s=c=>{c.key==="Escape"&&a(c)};return o.addEventListener("keydown",s,{capture:!0}),()=>o.removeEventListener("keydown",s,{capture:!0})},[a,o])}var Ev="DismissableLayer",Zc="dismissableLayer.update",Rv="dismissableLayer.pointerDownOutside",Tv="dismissableLayer.focusOutside",_h,SA=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),EA=B.forwardRef((r,o)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:A,onDismiss:u,...f}=r,h=B.useContext(SA),[m,p]=B.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=B.useState({}),b=yr(o,N=>p(N)),S=Array.from(h.layers),[y]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),x=S.indexOf(y),C=m?S.indexOf(m):-1,w=h.layersWithOutsidePointerEventsDisabled.size>0,T=C>=x,R=Nv(N=>{const I=N.target,F=[...h.branches].some(j=>j.contains(I));!T||F||(c==null||c(N),A==null||A(N),N.defaultPrevented||u==null||u())},v),D=Dv(N=>{const I=N.target;[...h.branches].some(j=>j.contains(I))||(l==null||l(N),A==null||A(N),N.defaultPrevented||u==null||u())},v);return Sv(N=>{C===h.layers.size-1&&(s==null||s(N),!N.defaultPrevented&&u&&(N.preventDefault(),u()))},v),B.useEffect(()=>{if(m)return a&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(_h=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),Ch(),()=>{a&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_h)}},[m,v,a,h]),B.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),Ch())},[m,h]),B.useEffect(()=>{const N=()=>_({});return document.addEventListener(Zc,N),()=>document.removeEventListener(Zc,N)},[]),P.jsx(Nt.div,{...f,ref:b,style:{pointerEvents:w?T?"auto":"none":void 0,...r.style},onFocusCapture:St(r.onFocusCapture,D.onFocusCapture),onBlurCapture:St(r.onBlurCapture,D.onBlurCapture),onPointerDownCapture:St(r.onPointerDownCapture,R.onPointerDownCapture)})});EA.displayName=Ev;var Bv="DismissableLayerBranch",Pv=B.forwardRef((r,o)=>{const a=B.useContext(SA),s=B.useRef(null),c=yr(o,s);return B.useEffect(()=>{const l=s.current;if(l)return a.branches.add(l),()=>{a.branches.delete(l)}},[a.branches]),P.jsx(Nt.div,{...r,ref:c})});Pv.displayName=Bv;function Nv(r,o=globalThis==null?void 0:globalThis.document){const a=Eo(r),s=B.useRef(!1),c=B.useRef(()=>{});return B.useEffect(()=>{const l=u=>{if(u.target&&!s.current){let f=function(){RA(Rv,a,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(o.removeEventListener("click",c.current),c.current=f,o.addEventListener("click",c.current,{once:!0})):f()}else o.removeEventListener("click",c.current);s.current=!1},A=window.setTimeout(()=>{o.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(A),o.removeEventListener("pointerdown",l),o.removeEventListener("click",c.current)}},[o,a]),{onPointerDownCapture:()=>s.current=!0}}function Dv(r,o=globalThis==null?void 0:globalThis.document){const a=Eo(r),s=B.useRef(!1);return B.useEffect(()=>{const c=l=>{l.target&&!s.current&&RA(Tv,a,{originalEvent:l},{discrete:!1})};return o.addEventListener("focusin",c),()=>o.removeEventListener("focusin",c)},[o,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Ch(){const r=new CustomEvent(Zc);document.dispatchEvent(r)}function RA(r,o,a,{discrete:s}){const c=a.originalEvent.target,l=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:a});o&&c.addEventListener(r,o,{once:!0}),s?kv(c,l):c.dispatchEvent(l)}var pc="focusScope.autoFocusOnMount",mc="focusScope.autoFocusOnUnmount",kh={bubbles:!1,cancelable:!0},Iv="FocusScope",TA=B.forwardRef((r,o)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:l,...A}=r,[u,f]=B.useState(null),h=Eo(c),m=Eo(l),p=B.useRef(null),v=yr(o,S=>f(S)),_=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(s){let S=function(w){if(_.paused||!u)return;const T=w.target;u.contains(T)?p.current=T:bn(p.current,{select:!0})},y=function(w){if(_.paused||!u)return;const T=w.relatedTarget;T!==null&&(u.contains(T)||bn(p.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&bn(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",y);const C=new MutationObserver(x);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",y),C.disconnect()}}},[s,u,_.paused]),B.useEffect(()=>{if(u){Eh.add(_);const S=document.activeElement;if(!u.contains(S)){const x=new CustomEvent(pc,kh);u.addEventListener(pc,h),u.dispatchEvent(x),x.defaultPrevented||(jv(Hv(BA(u)),{select:!0}),document.activeElement===S&&bn(u))}return()=>{u.removeEventListener(pc,h),setTimeout(()=>{const x=new CustomEvent(mc,kh);u.addEventListener(mc,m),u.dispatchEvent(x),x.defaultPrevented||bn(S??document.body,{select:!0}),u.removeEventListener(mc,m),Eh.remove(_)},0)}}},[u,h,m,_]);const b=B.useCallback(S=>{if(!a&&!s||_.paused)return;const y=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,x=document.activeElement;if(y&&x){const C=S.currentTarget,[w,T]=Mv(C);w&&T?!S.shiftKey&&x===T?(S.preventDefault(),a&&bn(w,{select:!0})):S.shiftKey&&x===w&&(S.preventDefault(),a&&bn(T,{select:!0})):x===C&&S.preventDefault()}},[a,s,_.paused]);return P.jsx(Nt.div,{tabIndex:-1,...A,ref:v,onKeyDown:b})});TA.displayName=Iv;function jv(r,{select:o=!1}={}){const a=document.activeElement;for(const s of r)if(bn(s,{select:o}),document.activeElement!==a)return}function Mv(r){const o=BA(r),a=Sh(o,r),s=Sh(o.reverse(),r);return[a,s]}function BA(r){const o=[],a=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const c=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||c?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)o.push(a.currentNode);return o}function Sh(r,o){for(const a of r)if(!Ov(a,{upTo:o}))return a}function Ov(r,{upTo:o}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(o!==void 0&&r===o)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function Fv(r){return r instanceof HTMLInputElement&&"select"in r}function bn(r,{select:o=!1}={}){if(r&&r.focus){const a=document.activeElement;r.focus({preventScroll:!0}),r!==a&&Fv(r)&&o&&r.select()}}var Eh=Lv();function Lv(){let r=[];return{add(o){const a=r[0];o!==a&&(a==null||a.pause()),r=Rh(r,o),r.unshift(o)},remove(o){var a;r=Rh(r,o),(a=r[0])==null||a.resume()}}}function Rh(r,o){const a=[...r],s=a.indexOf(o);return s!==-1&&a.splice(s,1),a}function Hv(r){return r.filter(o=>o.tagName!=="A")}var zv="Portal",PA=B.forwardRef((r,o)=>{var u;const{container:a,...s}=r,[c,l]=B.useState(!1);So(()=>l(!0),[]);const A=a||c&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return A?iA.createPortal(P.jsx(Nt.div,{...s,ref:o}),A):null});PA.displayName=zv;function Vv(r,o){return B.useReducer((a,s)=>o[a][s]??a,r)}var Bo=r=>{const{present:o,children:a}=r,s=Uv(o),c=typeof a=="function"?a({present:s.isPresent}):B.Children.only(a),l=yr(s.ref,Wv(c));return typeof a=="function"||s.isPresent?B.cloneElement(c,{ref:l}):null};Bo.displayName="Presence";function Uv(r){const[o,a]=B.useState(),s=B.useRef(null),c=B.useRef(r),l=B.useRef("none"),A=r?"mounted":"unmounted",[u,f]=Vv(A,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B.useEffect(()=>{const h=Ls(s.current);l.current=u==="mounted"?h:"none"},[u]),So(()=>{const h=s.current,m=c.current;if(m!==r){const v=l.current,_=Ls(h);r?f("MOUNT"):_==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&v!==_?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,f]),So(()=>{if(o){let h;const m=o.ownerDocument.defaultView??window,p=_=>{const S=Ls(s.current).includes(CSS.escape(_.animationName));if(_.target===o&&S&&(f("ANIMATION_END"),!c.current)){const y=o.style.animationFillMode;o.style.animationFillMode="forwards",h=m.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=y)})}},v=_=>{_.target===o&&(l.current=Ls(s.current))};return o.addEventListener("animationstart",v),o.addEventListener("animationcancel",p),o.addEventListener("animationend",p),()=>{m.clearTimeout(h),o.removeEventListener("animationstart",v),o.removeEventListener("animationcancel",p),o.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[o,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:B.useCallback(h=>{s.current=h?getComputedStyle(h):null,a(h)},[])}}function Ls(r){return(r==null?void 0:r.animationName)||"none"}function Wv(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var gc=0;function Qv(){B.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??Th()),document.body.insertAdjacentElement("beforeend",r[1]??Th()),gc++,()=>{gc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),gc--}},[])}function Th(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var zr=function(){return zr=Object.assign||function(o){for(var a,s=1,c=arguments.length;s"u")return l2;var o=c2(r),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,s-a+o[2]-o[0])}},d2=jA(),_o="data-scroll-locked",f2=function(r,o,a,s){var c=r.left,l=r.top,A=r.right,u=r.gap;return a===void 0&&(a="margin"),` + .`.concat(qv,` { + overflow: hidden `).concat(s,`; + padding-right: `).concat(u,"px ").concat(s,`; + } + body[`).concat(_o,`] { + overflow: hidden `).concat(s,`; + overscroll-behavior: contain; + `).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(l,`px; + padding-right: `).concat(A,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(s,`; + `),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),` + } + + .`).concat(oi,` { + right: `).concat(u,"px ").concat(s,`; + } + + .`).concat(ai,` { + margin-right: `).concat(u,"px ").concat(s,`; + } + + .`).concat(oi," .").concat(oi,` { + right: 0 `).concat(s,`; + } + + .`).concat(ai," .").concat(ai,` { + margin-right: 0 `).concat(s,`; + } + + body[`).concat(_o,`] { + `).concat(Kv,": ").concat(u,`px; + } +`)},Ph=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},h2=function(){B.useEffect(function(){return document.body.setAttribute(_o,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},A2=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;h2();var l=B.useMemo(function(){return u2(c)},[c]);return B.createElement(d2,{styles:f2(l,!o,c,a?"":"!important")})},Xc=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Xc=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Xc=!1}var mo=Xc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},MA=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!p2(r)&&a[o]==="visible")},m2=function(r){return MA(r,"overflowY")},g2=function(r){return MA(r,"overflowX")},Nh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=OA(r,s);if(c){var l=FA(r,s),A=l[1],u=l[2];if(A>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},v2=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},y2=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},OA=function(r,o){return r==="v"?m2(o):g2(o)},FA=function(r,o){return r==="v"?v2(o):y2(o)},x2=function(r,o){return r==="h"&&o==="rtl"?-1:1},w2=function(r,o,a,s,c){var l=x2(r,window.getComputedStyle(o).direction),A=l*s,u=a.target,f=o.contains(u),h=!1,m=A>0,p=0,v=0;do{if(!u)break;var _=FA(r,u),b=_[0],S=_[1],y=_[2],x=S-y-l*b;(b||x)&&OA(r,u)&&(p+=x,v+=b);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dh=function(r){return[r.deltaX,r.deltaY]},Ih=function(r){return r&&"current"in r?r.current:r},b2=function(r,o){return r[0]===o[0]&&r[1]===o[1]},_2=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},C2=0,go=[];function k2(r){var o=B.useRef([]),a=B.useRef([0,0]),s=B.useRef(),c=B.useState(C2++)[0],l=B.useState(jA)[0],A=B.useRef(r);B.useEffect(function(){A.current=r},[r]),B.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Gv([r.lockRef.current],(r.shards||[]).map(Ih),!0).filter(Boolean);return S.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=B.useCallback(function(S,y){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!A.current.allowPinchZoom;var x=zs(S),C=a.current,w="deltaX"in S?S.deltaX:C[0]-x[0],T="deltaY"in S?S.deltaY:C[1]-x[1],R,D=S.target,N=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in S&&N==="h"&&D.type==="range")return!1;var I=window.getSelection(),F=I&&I.anchorNode,j=F?F===D||F.contains(D):!1;if(j)return!1;var L=Nh(N,D);if(!L)return!0;if(L?R=N:(R=N==="v"?"h":"v",L=Nh(N,D)),!L)return!1;if(!s.current&&"changedTouches"in S&&(w||T)&&(s.current=R),!R)return!0;var G=s.current||R;return w2(G,y,S,G==="h"?w:T)},[]),f=B.useCallback(function(S){var y=S;if(!(!go.length||go[go.length-1]!==l)){var x="deltaY"in y?Dh(y):zs(y),C=o.current.filter(function(R){return R.name===y.type&&(R.target===y.target||y.target===R.shadowParent)&&b2(R.delta,x)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var w=(A.current.shards||[]).map(Ih).filter(Boolean).filter(function(R){return R.contains(y.target)}),T=w.length>0?u(y,w[0]):!A.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),h=B.useCallback(function(S,y,x,C){var w={name:S,delta:y,target:x,should:C,shadowParent:S2(x)};o.current.push(w),setTimeout(function(){o.current=o.current.filter(function(T){return T!==w})},1)},[]),m=B.useCallback(function(S){a.current=zs(S),s.current=void 0},[]),p=B.useCallback(function(S){h(S.type,Dh(S),S.target,u(S,r.lockRef.current))},[]),v=B.useCallback(function(S){h(S.type,zs(S),S.target,u(S,r.lockRef.current))},[]);B.useEffect(function(){return go.push(l),r.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,mo),document.addEventListener("touchmove",f,mo),document.addEventListener("touchstart",m,mo),function(){go=go.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,mo),document.removeEventListener("touchmove",f,mo),document.removeEventListener("touchstart",m,mo)}},[]);var _=r.removeScrollBar,b=r.inert;return B.createElement(B.Fragment,null,b?B.createElement(l,{styles:_2(c)}):null,_?B.createElement(A2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function S2(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const E2=t2(IA,k2);var LA=B.forwardRef(function(r,o){return B.createElement(pi,zr({},r,{ref:o,sideCar:E2}))});LA.classNames=pi.classNames;var R2=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},vo=new WeakMap,Vs=new WeakMap,Us={},wc=0,HA=function(r){return r&&(r.host||HA(r.parentNode))},T2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=HA(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},B2=function(r,o,a,s){var c=T2(o,Array.isArray(r)?r:[r]);Us[a]||(Us[a]=new WeakMap);var l=Us[a],A=[],u=new Set,f=new Set(c),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};c.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var _=v.getAttribute(s),b=_!==null&&_!=="false",S=(vo.get(v)||0)+1,y=(l.get(v)||0)+1;vo.set(v,S),l.set(v,y),A.push(v),S===1&&b&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),b||v.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return m(o),u.clear(),wc++,function(){A.forEach(function(p){var v=vo.get(p)-1,_=l.get(p)-1;vo.set(p,v),l.set(p,_),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),_||p.removeAttribute(a)}),wc--,wc||(vo=new WeakMap,vo=new WeakMap,Vs=new WeakMap,Us={})}},P2=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=R2(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),B2(s,c,a,"aria-hidden")):function(){return null}};function N2(r){const o=D2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(j2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function D2(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=O2(c),u=M2(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var I2=Symbol("radix.slottable");function j2(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===I2}function M2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function O2(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var mi="Dialog",[zA]=Sa(mi),[F2,Pr]=zA(mi),VA=r=>{const{__scopeDialog:o,children:a,open:s,defaultOpen:c,onOpenChange:l,modal:A=!0}=r,u=B.useRef(null),f=B.useRef(null),[h,m]=Ai({prop:s,defaultProp:c??!1,onChange:l,caller:mi});return P.jsx(F2,{scope:o,triggerRef:u,contentRef:f,contentId:ba(),titleId:ba(),descriptionId:ba(),open:h,onOpenChange:m,onOpenToggle:B.useCallback(()=>m(p=>!p),[m]),modal:A,children:a})};VA.displayName=mi;var UA="DialogTrigger",L2=B.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Pr(UA,a),l=yr(o,c.triggerRef);return P.jsx(Nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":du(c.open),...s,ref:l,onClick:St(r.onClick,c.onOpenToggle)})});L2.displayName=UA;var cu="DialogPortal",[H2,WA]=zA(cu,{forceMount:void 0}),QA=r=>{const{__scopeDialog:o,forceMount:a,children:s,container:c}=r,l=Pr(cu,o);return P.jsx(H2,{scope:o,forceMount:a,children:B.Children.map(s,A=>P.jsx(Bo,{present:a||l.open,children:P.jsx(PA,{asChild:!0,container:c,children:A})}))})};QA.displayName=cu;var di="DialogOverlay",GA=B.forwardRef((r,o)=>{const a=WA(di,r.__scopeDialog),{forceMount:s=a.forceMount,...c}=r,l=Pr(di,r.__scopeDialog);return l.modal?P.jsx(Bo,{present:s||l.open,children:P.jsx(V2,{...c,ref:o})}):null});GA.displayName=di;var z2=N2("DialogOverlay.RemoveScroll"),V2=B.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Pr(di,a);return P.jsx(LA,{as:z2,allowPinchZoom:!0,shards:[c.contentRef],children:P.jsx(Nt.div,{"data-state":du(c.open),...s,ref:o,style:{pointerEvents:"auto",...s.style}})})}),Un="DialogContent",qA=B.forwardRef((r,o)=>{const a=WA(Un,r.__scopeDialog),{forceMount:s=a.forceMount,...c}=r,l=Pr(Un,r.__scopeDialog);return P.jsx(Bo,{present:s||l.open,children:l.modal?P.jsx(U2,{...c,ref:o}):P.jsx(W2,{...c,ref:o})})});qA.displayName=Un;var U2=B.forwardRef((r,o)=>{const a=Pr(Un,r.__scopeDialog),s=B.useRef(null),c=yr(o,a.contentRef,s);return B.useEffect(()=>{const l=s.current;if(l)return P2(l)},[]),P.jsx(KA,{...r,ref:c,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:St(r.onCloseAutoFocus,l=>{var A;l.preventDefault(),(A=a.triggerRef.current)==null||A.focus()}),onPointerDownOutside:St(r.onPointerDownOutside,l=>{const A=l.detail.originalEvent,u=A.button===0&&A.ctrlKey===!0;(A.button===2||u)&&l.preventDefault()}),onFocusOutside:St(r.onFocusOutside,l=>l.preventDefault())})}),W2=B.forwardRef((r,o)=>{const a=Pr(Un,r.__scopeDialog),s=B.useRef(!1),c=B.useRef(!1);return P.jsx(KA,{...r,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var A,u;(A=r.onCloseAutoFocus)==null||A.call(r,l),l.defaultPrevented||(s.current||(u=a.triggerRef.current)==null||u.focus(),l.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:l=>{var f,h;(f=r.onInteractOutside)==null||f.call(r,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const A=l.target;((h=a.triggerRef.current)==null?void 0:h.contains(A))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&c.current&&l.preventDefault()}})}),KA=B.forwardRef((r,o)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:l,...A}=r,u=Pr(Un,a),f=B.useRef(null),h=yr(o,f);return Qv(),P.jsxs(P.Fragment,{children:[P.jsx(TA,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:l,children:P.jsx(EA,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":du(u.open),...A,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(Q2,{titleId:u.titleId}),P.jsx(q2,{contentRef:f,descriptionId:u.descriptionId})]})]})}),uu="DialogTitle",YA=B.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Pr(uu,a);return P.jsx(Nt.h2,{id:c.titleId,...s,ref:o})});YA.displayName=uu;var ZA="DialogDescription",XA=B.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Pr(ZA,a);return P.jsx(Nt.p,{id:c.descriptionId,...s,ref:o})});XA.displayName=ZA;var JA="DialogClose",$A=B.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Pr(JA,a);return P.jsx(Nt.button,{type:"button",...s,ref:o,onClick:St(r.onClick,()=>c.onOpenChange(!1))})});$A.displayName=JA;function du(r){return r?"open":"closed"}var e0="DialogTitleWarning",[a3,t0]=dv(e0,{contentName:Un,titleName:uu,docsSlug:"dialog"}),Q2=({titleId:r})=>{const o=t0(e0),a=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return B.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},G2="DialogDescriptionWarning",q2=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t0(G2).contentName}}.`;return B.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},r0=VA,n0=QA,gi=GA,vi=qA,yi=YA,xi=XA,o0=$A;const a0=r0,K2=n0,s0=B.forwardRef(({className:r,...o},a)=>P.jsx(gi,{ref:a,className:Ze("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));s0.displayName=gi.displayName;const fu=B.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(s0,{}),P.jsxs(vi,{ref:s,className:Ze("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,P.jsxs(o0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[P.jsx(aA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fu.displayName=vi.displayName;const hu=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});hu.displayName="DialogHeader";const Au=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});Au.displayName="DialogFooter";const pu=B.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ze("text-lg font-semibold leading-none tracking-tight",r),...o}));pu.displayName=yi.displayName;const Y2=B.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ze("text-sm text-muted-foreground",r),...o}));Y2.displayName=xi.displayName;function jh(r){const o=Z2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(J2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Z2(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=ey(c),u=$2(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var X2=Symbol("radix.slottable");function J2(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X2}function $2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ey(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function ty(r){const o=r+"CollectionProvider",[a,s]=Sa(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),A=S=>{const{scope:y,children:x}=S,C=he.useRef(null),w=he.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:w,collectionRef:C,children:x})};A.displayName=o;const u=r+"CollectionSlot",f=jh(u),h=he.forwardRef((S,y)=>{const{scope:x,children:C}=S,w=l(u,x),T=yr(y,w.collectionRef);return P.jsx(f,{ref:T,children:C})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=jh(m),_=he.forwardRef((S,y)=>{const{scope:x,children:C,...w}=S,T=he.useRef(null),R=yr(y,T),D=l(m,x);return he.useEffect(()=>(D.itemMap.set(T,{ref:T,...w}),()=>void D.itemMap.delete(T))),P.jsx(v,{[p]:"",ref:R,children:C})});_.displayName=m;function b(S){const y=l(r+"CollectionConsumer",S);return he.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const w=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((D,N)=>w.indexOf(D.ref.current)-w.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:A,Slot:h,ItemSlot:_},b,s]}var ry=B.createContext(void 0);function i0(r){const o=B.useContext(ry);return r||o||"ltr"}var bc="rovingFocusGroup.onEntryFocus",ny={bubbles:!1,cancelable:!0},Ea="RovingFocusGroup",[Jc,l0,oy]=ty(Ea),[ay,c0]=Sa(Ea,[oy]),[sy,iy]=ay(Ea),u0=B.forwardRef((r,o)=>P.jsx(Jc.Provider,{scope:r.__scopeRovingFocusGroup,children:P.jsx(Jc.Slot,{scope:r.__scopeRovingFocusGroup,children:P.jsx(ly,{...r,ref:o})})}));u0.displayName=Ea;var ly=B.forwardRef((r,o)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:c=!1,dir:l,currentTabStopId:A,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=r,v=B.useRef(null),_=yr(o,v),b=i0(l),[S,y]=Ai({prop:A,defaultProp:u??null,onChange:f,caller:Ea}),[x,C]=B.useState(!1),w=Eo(h),T=l0(a),R=B.useRef(!1),[D,N]=B.useState(0);return B.useEffect(()=>{const I=v.current;if(I)return I.addEventListener(bc,w),()=>I.removeEventListener(bc,w)},[w]),P.jsx(sy,{scope:a,orientation:s,dir:b,loop:c,currentTabStopId:S,onItemFocus:B.useCallback(I=>y(I),[y]),onItemShiftTab:B.useCallback(()=>C(!0),[]),onFocusableItemAdd:B.useCallback(()=>N(I=>I+1),[]),onFocusableItemRemove:B.useCallback(()=>N(I=>I-1),[]),children:P.jsx(Nt.div,{tabIndex:x||D===0?-1:0,"data-orientation":s,...p,ref:_,style:{outline:"none",...r.style},onMouseDown:St(r.onMouseDown,()=>{R.current=!0}),onFocus:St(r.onFocus,I=>{const F=!R.current;if(I.target===I.currentTarget&&F&&!x){const j=new CustomEvent(bc,ny);if(I.currentTarget.dispatchEvent(j),!j.defaultPrevented){const L=T().filter(J=>J.focusable),G=L.find(J=>J.active),K=L.find(J=>J.id===S),se=[G,K,...L].filter(Boolean).map(J=>J.ref.current);h0(se,m)}}R.current=!1}),onBlur:St(r.onBlur,()=>C(!1))})})}),d0="RovingFocusGroupItem",f0=B.forwardRef((r,o)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:c=!1,tabStopId:l,children:A,...u}=r,f=ba(),h=l||f,m=iy(d0,a),p=m.currentTabStopId===h,v=l0(a),{onFocusableItemAdd:_,onFocusableItemRemove:b,currentTabStopId:S}=m;return B.useEffect(()=>{if(s)return _(),()=>b()},[s,_,b]),P.jsx(Jc.ItemSlot,{scope:a,id:h,focusable:s,active:c,children:P.jsx(Nt.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:o,onMouseDown:St(r.onMouseDown,y=>{s?m.onItemFocus(h):y.preventDefault()}),onFocus:St(r.onFocus,()=>m.onItemFocus(h)),onKeyDown:St(r.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=dy(y,m.orientation,m.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=v().filter(T=>T.focusable).map(T=>T.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const T=w.indexOf(y.currentTarget);w=m.loop?fy(w,T+1):w.slice(T+1)}setTimeout(()=>h0(w))}}),children:typeof A=="function"?A({isCurrentTabStop:p,hasTabStop:S!=null}):A})})});f0.displayName=d0;var cy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uy(r,o){return o!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function dy(r,o,a){const s=uy(r.key,a);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return cy[s]}function h0(r,o=!1){const a=document.activeElement;for(const s of r)if(s===a||(s.focus({preventScroll:o}),document.activeElement!==a))return}function fy(r,o){return r.map((a,s)=>r[(o+s)%r.length])}var hy=u0,Ay=f0,wi="Tabs",[py]=Sa(wi,[c0]),A0=c0(),[my,mu]=py(wi),p0=B.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,onValueChange:c,defaultValue:l,orientation:A="horizontal",dir:u,activationMode:f="automatic",...h}=r,m=i0(u),[p,v]=Ai({prop:s,onChange:c,defaultProp:l??"",caller:wi});return P.jsx(my,{scope:a,baseId:ba(),value:p,onValueChange:v,orientation:A,dir:m,activationMode:f,children:P.jsx(Nt.div,{dir:m,"data-orientation":A,...h,ref:o})})});p0.displayName=wi;var m0="TabsList",g0=B.forwardRef((r,o)=>{const{__scopeTabs:a,loop:s=!0,...c}=r,l=mu(m0,a),A=A0(a);return P.jsx(hy,{asChild:!0,...A,orientation:l.orientation,dir:l.dir,loop:s,children:P.jsx(Nt.div,{role:"tablist","aria-orientation":l.orientation,...c,ref:o})})});g0.displayName=m0;var v0="TabsTrigger",y0=B.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,disabled:c=!1,...l}=r,A=mu(v0,a),u=A0(a),f=b0(A.baseId,s),h=_0(A.baseId,s),m=s===A.value;return P.jsx(Ay,{asChild:!0,...u,focusable:!c,active:m,children:P.jsx(Nt.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:f,...l,ref:o,onMouseDown:St(r.onMouseDown,p=>{!c&&p.button===0&&p.ctrlKey===!1?A.onValueChange(s):p.preventDefault()}),onKeyDown:St(r.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&A.onValueChange(s)}),onFocus:St(r.onFocus,()=>{const p=A.activationMode!=="manual";!m&&!c&&p&&A.onValueChange(s)})})})});y0.displayName=v0;var x0="TabsContent",w0=B.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,forceMount:c,children:l,...A}=r,u=mu(x0,a),f=b0(u.baseId,s),h=_0(u.baseId,s),m=s===u.value,p=B.useRef(m);return B.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),P.jsx(Bo,{present:c||m,children:({present:v})=>P.jsx(Nt.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:h,tabIndex:0,...A,ref:o,style:{...r.style,animationDuration:p.current?"0s":void 0},children:v&&l})})});w0.displayName=x0;function b0(r,o){return`${r}-trigger-${o}`}function _0(r,o){return`${r}-content-${o}`}var gy=p0,C0=g0,k0=y0,S0=w0;const vy=gy,E0=B.forwardRef(({className:r,...o},a)=>P.jsx(C0,{ref:a,className:Ze("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),...o}));E0.displayName=C0.displayName;const va=B.forwardRef(({className:r,...o},a)=>P.jsx(k0,{ref:a,className:Ze("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r),...o}));va.displayName=k0.displayName;const ya=B.forwardRef(({className:r,...o},a)=>P.jsx(S0,{ref:a,className:Ze("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...o}));ya.displayName=S0.displayName;var yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xy=yy.reduce((r,o)=>{const a=lu(`Primitive.${o}`),s=B.forwardRef((c,l)=>{const{asChild:A,...u}=c,f=A?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{}),wy="Label",R0=B.forwardRef((r,o)=>P.jsx(xy.label,{...r,ref:o,onMouseDown:a=>{var c;a.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));R0.displayName=wy;var T0=R0;const by=hi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wt=B.forwardRef(({className:r,...o},a)=>P.jsx(T0,{ref:a,className:Ze(by(),r),...o}));wt.displayName=T0.displayName;function _y(r){const o=B.useRef({value:r,previous:r});return B.useMemo(()=>(o.current.value!==r&&(o.current.previous=o.current.value,o.current.value=r),o.current.previous),[r])}function Cy(r){const[o,a]=B.useState(void 0);return So(()=>{if(r){a({width:r.offsetWidth,height:r.offsetHeight});const s=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const l=c[0];let A,u;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;A=h.inlineSize,u=h.blockSize}else A=r.offsetWidth,u=r.offsetHeight;a({width:A,height:u})});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else a(void 0)},[r]),o}var bi="Checkbox",[ky]=Sa(bi),[Sy,gu]=ky(bi);function Ey(r){const{__scopeCheckbox:o,checked:a,children:s,defaultChecked:c,disabled:l,form:A,name:u,onCheckedChange:f,required:h,value:m="on",internal_do_not_use_render:p}=r,[v,_]=Ai({prop:a,defaultProp:c??!1,onChange:f,caller:bi}),[b,S]=B.useState(null),[y,x]=B.useState(null),C=B.useRef(!1),w=b?!!A||!!b.closest("form"):!0,T={checked:v,disabled:l,setChecked:_,control:b,setControl:S,name:u,form:A,value:m,hasConsumerStoppedPropagationRef:C,required:h,defaultChecked:_n(c)?!1:c,isFormControl:w,bubbleInput:y,setBubbleInput:x};return P.jsx(Sy,{scope:o,...T,children:Ry(p)?p(T):s})}var B0="CheckboxTrigger",P0=B.forwardRef(({__scopeCheckbox:r,onKeyDown:o,onClick:a,...s},c)=>{const{control:l,value:A,disabled:u,checked:f,required:h,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:v,isFormControl:_,bubbleInput:b}=gu(B0,r),S=yr(c,m),y=B.useRef(f);return B.useEffect(()=>{const x=l==null?void 0:l.form;if(x){const C=()=>p(y.current);return x.addEventListener("reset",C),()=>x.removeEventListener("reset",C)}},[l,p]),P.jsx(Nt.button,{type:"button",role:"checkbox","aria-checked":_n(f)?"mixed":f,"aria-required":h,"data-state":M0(f),"data-disabled":u?"":void 0,disabled:u,value:A,...s,ref:S,onKeyDown:St(o,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:St(a,x=>{p(C=>_n(C)?!0:!C),b&&_&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})})});P0.displayName=B0;var vu=B.forwardRef((r,o)=>{const{__scopeCheckbox:a,name:s,checked:c,defaultChecked:l,required:A,disabled:u,value:f,onCheckedChange:h,form:m,...p}=r;return P.jsx(Ey,{__scopeCheckbox:a,checked:c,defaultChecked:l,disabled:u,required:A,onCheckedChange:h,name:s,form:m,value:f,internal_do_not_use_render:({isFormControl:v})=>P.jsxs(P.Fragment,{children:[P.jsx(P0,{...p,ref:o,__scopeCheckbox:a}),v&&P.jsx(j0,{__scopeCheckbox:a})]})})});vu.displayName=bi;var N0="CheckboxIndicator",D0=B.forwardRef((r,o)=>{const{__scopeCheckbox:a,forceMount:s,...c}=r,l=gu(N0,a);return P.jsx(Bo,{present:s||_n(l.checked)||l.checked===!0,children:P.jsx(Nt.span,{"data-state":M0(l.checked),"data-disabled":l.disabled?"":void 0,...c,ref:o,style:{pointerEvents:"none",...r.style}})})});D0.displayName=N0;var I0="CheckboxBubbleInput",j0=B.forwardRef(({__scopeCheckbox:r,...o},a)=>{const{control:s,hasConsumerStoppedPropagationRef:c,checked:l,defaultChecked:A,required:u,disabled:f,name:h,value:m,form:p,bubbleInput:v,setBubbleInput:_}=gu(I0,r),b=yr(a,_),S=_y(l),y=Cy(s);B.useEffect(()=>{const C=v;if(!C)return;const w=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(w,"checked").set,D=!c.current;if(S!==l&&R){const N=new Event("click",{bubbles:D});C.indeterminate=_n(l),R.call(C,_n(l)?!1:l),C.dispatchEvent(N)}},[v,S,l,c]);const x=B.useRef(_n(l)?!1:l);return P.jsx(Nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:A??x.current,required:u,disabled:f,name:h,value:m,form:p,...o,tabIndex:-1,ref:b,style:{...o.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});j0.displayName=I0;function Ry(r){return typeof r=="function"}function _n(r){return r==="indeterminate"}function M0(r){return _n(r)?"indeterminate":r?"checked":"unchecked"}const O0=B.forwardRef(({className:r,...o},a)=>P.jsx(vu,{ref:a,className:Ze("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r),...o,children:P.jsx(D0,{className:Ze("flex items-center justify-center text-current"),children:P.jsx(w1,{className:"h-4 w-4"})})}));O0.displayName=vu.displayName;function Ty({open:r,contacts:o,undecryptedCount:a,onClose:s,onSelectConversation:c,onCreateContact:l,onCreateChannel:A,onCreateHashtagChannel:u}){const[f,h]=B.useState("existing"),[m,p]=B.useState(""),[v,_]=B.useState(""),[b,S]=B.useState(!1),[y,x]=B.useState(""),[C,w]=B.useState(!1),T=B.useRef(null),R=async()=>{x(""),w(!0);try{if(f==="new-contact"){if(!m.trim()||!v.trim()){x("Name and public key are required");return}await l(m.trim(),v.trim(),b),c({type:"contact",id:v.trim(),name:m.trim()})}else if(f==="new-room"){if(!m.trim()||!v.trim()){x("Room name and key are required");return}await A(m.trim(),v.trim(),b)}else if(f==="hashtag"){const F=m.trim(),j=D(F);if(j){x(j);return}await u(`#${F}`,b)}s()}catch(F){x(F instanceof Error?F.message:"Failed to create")}finally{w(!1)}},D=F=>F?/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(F)?null:"Use letters, numbers, and single dashes (no leading/trailing dashes)":"Channel name is required",N=async()=>{var L;x("");const F=m.trim(),j=D(F);if(j){x(j);return}w(!0);try{await u(`#${F}`,b),p(""),(L=T.current)==null||L.focus()}catch(G){x(G instanceof Error?G.message:"Failed to create")}finally{w(!1)}},I=f!=="existing"&&a>0;return P.jsx(a0,{open:r,onOpenChange:F=>!F&&s(),children:P.jsxs(fu,{className:"sm:max-w-[500px]",children:[P.jsx(hu,{children:P.jsx(pu,{children:"New Conversation"})}),P.jsxs(vy,{value:f,onValueChange:F=>h(F),className:"w-full",children:[P.jsxs(E0,{className:"grid w-full grid-cols-4",children:[P.jsx(va,{value:"existing",children:"Existing"}),P.jsx(va,{value:"new-contact",children:"Contact"}),P.jsx(va,{value:"new-room",children:"Room"}),P.jsx(va,{value:"hashtag",children:"Hashtag"})]}),P.jsx(ya,{value:"existing",className:"mt-4",children:P.jsx("div",{className:"max-h-[300px] overflow-y-auto rounded-md border",children:o.length===0?P.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No contacts available"}):o.map(F=>P.jsx("div",{className:"cursor-pointer px-4 py-2 hover:bg-accent",onClick:()=>{c({type:"contact",id:F.public_key,name:_a(F.name,F.public_key)}),s()},children:_a(F.name,F.public_key)},F.public_key))})}),P.jsxs(ya,{value:"new-contact",className:"mt-4 space-y-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"contact-name",children:"Name"}),P.jsx(bt,{id:"contact-name",value:m,onChange:F=>p(F.target.value),placeholder:"Contact name"})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"contact-key",children:"Public Key"}),P.jsx(bt,{id:"contact-key",value:v,onChange:F=>_(F.target.value),placeholder:"64-character hex public key"})]})]}),P.jsxs(ya,{value:"new-room",className:"mt-4 space-y-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"room-name",children:"Room Name"}),P.jsx(bt,{id:"room-name",value:m,onChange:F=>p(F.target.value),placeholder:"Room name"})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"room-key",children:"Room Key"}),P.jsx(bt,{id:"room-key",value:v,onChange:F=>_(F.target.value),placeholder:"Pre-shared key (hex)"})]})]}),P.jsx(ya,{value:"hashtag",className:"mt-4",children:P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"hashtag-name",children:"Hashtag Channel"}),P.jsxs("div",{className:"flex items-center gap-1",children:[P.jsx("span",{className:"text-sm text-muted-foreground",children:"#"}),P.jsx(bt,{ref:T,id:"hashtag-name",value:m,onChange:F=>p(F.target.value),placeholder:"channel-name",className:"flex-1"})]})]})})]}),I&&P.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[P.jsxs(wt,{htmlFor:"try-historical",className:"text-sm text-muted-foreground cursor-pointer",children:["Try decrypting ",a.toLocaleString()," stored packet",a!==1?"s":""]}),P.jsx(O0,{id:"try-historical",checked:b,onCheckedChange:F=>S(F===!0)})]}),y&&P.jsx("div",{className:"text-sm text-destructive",children:y}),P.jsxs(Au,{children:[P.jsx(Vr,{variant:"outline",onClick:s,children:"Cancel"}),f==="hashtag"&&P.jsx(Vr,{variant:"secondary",onClick:N,disabled:C,children:C?"Creating...":"Create & Add Another"}),f!=="existing"&&P.jsx(Vr,{onClick:R,disabled:C,children:C?"Creating...":"Create"})]})]})})}var By=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Py=By.reduce((r,o)=>{const a=lu(`Primitive.${o}`),s=B.forwardRef((c,l)=>{const{asChild:A,...u}=c,f=A?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{}),Ny="Separator",Mh="horizontal",Dy=["horizontal","vertical"],F0=B.forwardRef((r,o)=>{const{decorative:a,orientation:s=Mh,...c}=r,l=Iy(s)?s:Mh,u=a?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return P.jsx(Py.div,{"data-orientation":l,...u,...c,ref:o})});F0.displayName=Ny;function Iy(r){return Dy.includes(r)}var L0=F0;const si=B.forwardRef(({className:r,orientation:o="horizontal",decorative:a=!0,...s},c)=>P.jsx(L0,{ref:c,decorative:a,orientation:o,className:Ze("shrink-0 bg-border",o==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",r),...s}));si.displayName=L0.displayName;const jy=hi("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"}}),H0=B.forwardRef(({className:r,variant:o,...a},s)=>P.jsx("div",{ref:s,role:"alert",className:Ze(jy({variant:o}),r),...a}));H0.displayName="Alert";const My=B.forwardRef(({className:r,...o},a)=>P.jsx("h5",{ref:a,className:Ze("mb-1 font-medium leading-none tracking-tight",r),...o}));My.displayName="AlertTitle";const z0=B.forwardRef(({className:r,...o},a)=>P.jsx("div",{ref:a,className:Ze("text-sm [&_p]:leading-relaxed",r),...o}));z0.displayName="AlertDescription";function Oy({open:r,config:o,appSettings:a,onClose:s,onSave:c,onSaveAppSettings:l,onSetPrivateKey:A,onReboot:u}){const[f,h]=B.useState(""),[m,p]=B.useState(""),[v,_]=B.useState(""),[b,S]=B.useState(""),[y,x]=B.useState(""),[C,w]=B.useState(""),[T,R]=B.useState(""),[D,N]=B.useState(""),[I,F]=B.useState(""),[j,L]=B.useState(""),[G,K]=B.useState(!1),[ee,se]=B.useState(!1),[J,ne]=B.useState("");B.useEffect(()=>{o&&(h(o.name),p(String(o.lat)),_(String(o.lon)),S(String(o.tx_power)),x(String(o.radio.freq)),w(String(o.radio.bw)),R(String(o.radio.sf)),N(String(o.radio.cr)))},[o]),B.useEffect(()=>{a&&L(String(a.max_radio_contacts))},[a]);const W=async()=>{ne(""),K(!0);try{const k={name:f,lat:parseFloat(m),lon:parseFloat(v),tx_power:parseInt(b,10),radio:{freq:parseFloat(y),bw:parseFloat(C),sf:parseInt(T,10),cr:parseInt(D,10)}};await c(k);const O=parseInt(j,10);!isNaN(O)&&O!==(a==null?void 0:a.max_radio_contacts)&&await l({max_radio_contacts:O}),s()}catch(k){ne(k instanceof Error?k.message:"Failed to save")}finally{K(!1)}},X=async()=>{if(!I.trim()){ne("Private key is required");return}ne(""),K(!0);try{await A(I.trim()),F(""),s()}catch(k){ne(k instanceof Error?k.message:"Failed to set private key")}finally{K(!1)}},Z=async()=>{if(confirm("Are you sure you want to reboot the radio? The connection will drop temporarily.")){ne(""),se(!0);try{await u(),s()}catch(k){ne(k instanceof Error?k.message:"Failed to reboot radio")}finally{se(!1)}}};return P.jsx(a0,{open:r,onOpenChange:k=>!k&&s(),children:P.jsxs(fu,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[P.jsx(hu,{children:P.jsx(pu,{children:"Radio Configuration"})}),o?P.jsxs("div",{className:"space-y-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"public-key",children:"Public Key"}),P.jsx(bt,{id:"public-key",value:o.public_key,disabled:!0})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"name",children:"Name"}),P.jsx(bt,{id:"name",value:f,onChange:k=>h(k.target.value)})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"lat",children:"Latitude"}),P.jsx(bt,{id:"lat",type:"number",step:"any",value:m,onChange:k=>p(k.target.value)})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"lon",children:"Longitude"}),P.jsx(bt,{id:"lon",type:"number",step:"any",value:v,onChange:k=>_(k.target.value)})]})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"freq",children:"Frequency (MHz)"}),P.jsx(bt,{id:"freq",type:"number",step:"any",value:y,onChange:k=>x(k.target.value)})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"bw",children:"Bandwidth (kHz)"}),P.jsx(bt,{id:"bw",type:"number",step:"any",value:C,onChange:k=>w(k.target.value)})]})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"sf",children:"Spreading Factor"}),P.jsx(bt,{id:"sf",type:"number",min:"7",max:"12",value:T,onChange:k=>R(k.target.value)})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"cr",children:"Coding Rate"}),P.jsx(bt,{id:"cr",type:"number",min:"1",max:"4",value:D,onChange:k=>N(k.target.value)})]})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"tx-power",children:"TX Power (dBm)"}),P.jsx(bt,{id:"tx-power",type:"number",value:b,onChange:k=>S(k.target.value)})]}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"max-tx",children:"Max TX Power"}),P.jsx(bt,{id:"max-tx",type:"number",value:o.max_tx_power,disabled:!0})]})]}),P.jsx(si,{className:"my-4"}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"max-contacts",children:"Max Contacts on Radio"}),P.jsx(bt,{id:"max-contacts",type:"number",min:"1",max:"1000",value:j,onChange:k=>L(k.target.value)}),P.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent non-repeater contacts loaded to radio for DM auto-ACK (1-1000)"})]}),P.jsx(si,{className:"my-4"}),P.jsxs("div",{className:"space-y-2",children:[P.jsx(wt,{htmlFor:"private-key",children:"Set Private Key (write-only)"}),P.jsxs("div",{className:"flex gap-2",children:[P.jsx(bt,{id:"private-key",type:"password",value:I,onChange:k=>F(k.target.value),placeholder:"64-character hex private key",className:"flex-1"}),P.jsx(Vr,{onClick:X,disabled:G||!I.trim(),children:"Set"})]})]}),P.jsx(si,{className:"my-4"}),P.jsxs("div",{className:"space-y-3",children:[P.jsx(wt,{children:"Reboot Radio"}),P.jsx(H0,{variant:"warning",children:P.jsx(z0,{children:"Some configuration changes (like name) require a radio reboot to take effect. The connection will temporarily drop and automatically reconnect."})}),P.jsx(Vr,{variant:"outline",onClick:Z,disabled:ee||G,className:"border-yellow-500/50 text-yellow-200 hover:bg-yellow-500/10",children:ee?"Rebooting...":"Reboot Radio"})]}),J&&P.jsx("div",{className:"text-sm text-destructive",children:J})]}):P.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"Loading configuration..."}),P.jsxs(Au,{children:[P.jsx(Vr,{variant:"outline",onClick:s,children:"Cancel"}),P.jsx(Vr,{onClick:W,disabled:G||!o,children:G?"Saving...":"Save Config"})]})]})})}function Fy(r){return new Date(r*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Oh(r){return r.split("_").map(o=>o.charAt(0)+o.slice(1).toLowerCase()).join(" ")}function Ly(r){if(!r.decrypted||!r.decrypted_info)return Oh(r.payload_type);const o=r.decrypted_info;return r.payload_type==="GROUP_TEXT"&&o.channel_name?`GroupText to ${o.channel_name}`:r.payload_type==="TEXT_MESSAGE"&&o.sender?`TextMessage from ${o.sender}`:Oh(r.payload_type)}function Hy(r){const o=[];return r.snr!==null&&r.snr!==void 0&&o.push(`SNR: ${r.snr.toFixed(1)} dB`),r.rssi!==null&&r.rssi!==void 0&&o.push(`RSSI: ${r.rssi} dBm`),o.join(" | ")}function zy({packets:r}){const o=B.useRef(null);if(B.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),r.length===0)return P.jsx("div",{className:"h-full overflow-y-auto p-5 text-center text-muted-foreground",children:"No packets received yet. Packets will appear here in real-time."});const a=[...r].sort((s,c)=>s.timestamp-c.timestamp);return P.jsx("div",{className:"h-full overflow-y-auto p-4 flex flex-col gap-3",ref:o,children:a.map(s=>P.jsxs("div",{className:"py-2 px-3 bg-muted rounded",children:[P.jsxs("div",{className:s.decrypted?"text-primary":"text-destructive",children:[!s.decrypted&&P.jsx("span",{className:"mr-1",children:"🔒"}),Ly(s)," • ",Fy(s.timestamp)]}),(s.snr!==null||s.rssi!==null)&&P.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:Hy(s)}),P.jsx("div",{className:"font-mono text-[11px] break-all text-muted-foreground/70 mt-1",children:s.data.toUpperCase()})]},s.id))})}var Vy=Object.create,Ra=Object.defineProperty,Uy=Object.getOwnPropertyDescriptor,yu=Object.getOwnPropertyNames,Wy=Object.getPrototypeOf,Qy=Object.prototype.hasOwnProperty,Gy=(r,o,a)=>o in r?Ra(r,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[o]=a,$c=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(o,a)=>(typeof require<"u"?require:o)[a]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),qy=(r,o)=>function(){return r&&(o=(0,r[yu(r)[0]])(r=0)),o},_e=(r,o)=>function(){return o||(0,r[yu(r)[0]])((o={exports:{}}).exports,o),o.exports},Ky=(r,o)=>{for(var a in o)Ra(r,a,{get:o[a],enumerable:!0})},V0=(r,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of yu(o))!Qy.call(r,c)&&c!==a&&Ra(r,c,{get:()=>o[c],enumerable:!(s=Uy(o,c))||s.enumerable});return r},_i=(r,o,a)=>(a=r!=null?Vy(Wy(r)):{},V0(Ra(a,"default",{value:r,enumerable:!0}),r)),Yy=r=>V0(Ra({},"__esModule",{value:!0}),r),yo=(r,o,a)=>Gy(r,typeof o!="symbol"?o+"":o,a),ur=_e({"node_modules/@michaelhart/meshcore-decoder/dist/types/enums.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.RequestType=r.AdvertFlags=r.DeviceRole=r.PayloadVersion=r.ControlSubType=r.PayloadType=r.RouteType=void 0;var o;(function(f){f[f.TransportFlood=0]="TransportFlood",f[f.Flood=1]="Flood",f[f.Direct=2]="Direct",f[f.TransportDirect=3]="TransportDirect"})(o||(r.RouteType=o={}));var a;(function(f){f[f.Request=0]="Request",f[f.Response=1]="Response",f[f.TextMessage=2]="TextMessage",f[f.Ack=3]="Ack",f[f.Advert=4]="Advert",f[f.GroupText=5]="GroupText",f[f.GroupData=6]="GroupData",f[f.AnonRequest=7]="AnonRequest",f[f.Path=8]="Path",f[f.Trace=9]="Trace",f[f.Multipart=10]="Multipart",f[f.Control=11]="Control",f[f.RawCustom=15]="RawCustom"})(a||(r.PayloadType=a={}));var s;(function(f){f[f.NodeDiscoverReq=128]="NodeDiscoverReq",f[f.NodeDiscoverResp=144]="NodeDiscoverResp"})(s||(r.ControlSubType=s={}));var c;(function(f){f[f.Version1=0]="Version1",f[f.Version2=1]="Version2",f[f.Version3=2]="Version3",f[f.Version4=3]="Version4"})(c||(r.PayloadVersion=c={}));var l;(function(f){f[f.Unknown=0]="Unknown",f[f.ChatNode=1]="ChatNode",f[f.Repeater=2]="Repeater",f[f.RoomServer=3]="RoomServer",f[f.Sensor=4]="Sensor"})(l||(r.DeviceRole=l={}));var A;(function(f){f[f.HasLocation=16]="HasLocation",f[f.HasFeature1=32]="HasFeature1",f[f.HasFeature2=64]="HasFeature2",f[f.HasName=128]="HasName"})(A||(r.AdvertFlags=A={}));var u;(function(f){f[f.GetStats=1]="GetStats",f[f.Keepalive=2]="Keepalive",f[f.GetTelemetryData=3]="GetTelemetryData",f[f.GetMinMaxAvgData=4]="GetMinMaxAvgData",f[f.GetAccessList=5]="GetAccessList"})(u||(r.RequestType=u={}))}}),Ft=_e({"node_modules/@michaelhart/meshcore-decoder/dist/utils/hex.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.byteToHex=o,r.bytesToHex=a,r.numberToHex=s,r.hexToBytes=c;function o(l){return l.toString(16).padStart(2,"0").toUpperCase()}function a(l){return Array.from(l).map(o).join("")}function s(l,A=8){return(l>>>0).toString(16).padStart(A,"0").toUpperCase()}function c(l){const A=l.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(A))throw new Error("Invalid hex string: invalid characters at position 0");if(A.length%2!==0)throw new Error("Invalid hex string: odd length");const u=new Uint8Array(A.length/2);for(let f=0;f>>2]>>>24-N%4*8&255;w[R+N>>>2]|=I<<24-(R+N)%4*8}else for(var F=0;F>>2]=T[F>>>2];return this.sigBytes+=D,this},clamp:function(){var C=this.words,w=this.sigBytes;C[w>>>2]&=4294967295<<32-w%4*8,C.length=s.ceil(w/4)},clone:function(){var C=m.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var w=[],T=0;T>>2]>>>24-D%4*8&255;R.push((N>>>4).toString(16)),R.push((N&15).toString(16))}return R.join("")},parse:function(C){for(var w=C.length,T=[],R=0;R>>3]|=parseInt(C.substr(R,2),16)<<24-R%8*4;return new p.init(T,w/2)}},b=v.Latin1={stringify:function(C){for(var w=C.words,T=C.sigBytes,R=[],D=0;D>>2]>>>24-D%4*8&255;R.push(String.fromCharCode(N))}return R.join("")},parse:function(C){for(var w=C.length,T=[],R=0;R>>2]|=(C.charCodeAt(R)&255)<<24-R%4*8;return new p.init(T,w)}},S=v.Utf8={stringify:function(C){try{return decodeURIComponent(escape(b.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return b.parse(unescape(encodeURIComponent(C)))}},y=h.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=S.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var w,T=this._data,R=T.words,D=T.sigBytes,N=this.blockSize,I=N*4,F=D/I;C?F=s.ceil(F):F=s.max((F|0)-this._minBufferSize,0);var j=F*N,L=s.min(j*4,D);if(j){for(var G=0;G>>2]|=f[p]<<24-p%4*8;A.call(this,m,h)}else A.apply(this,arguments)};u.prototype=l}})(),a.lib.WordArray})}}),Xy=_e({"node_modules/crypto-js/enc-utf16.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=s.enc;A.Utf16=A.Utf16BE={stringify:function(f){for(var h=f.words,m=f.sigBytes,p=[],v=0;v>>2]>>>16-v%4*8&65535;p.push(String.fromCharCode(_))}return p.join("")},parse:function(f){for(var h=f.length,m=[],p=0;p>>1]|=f.charCodeAt(p)<<16-p%2*16;return l.create(m,h*2)}},A.Utf16LE={stringify:function(f){for(var h=f.words,m=f.sigBytes,p=[],v=0;v>>2]>>>16-v%4*8&65535);p.push(String.fromCharCode(_))}return p.join("")},parse:function(f){for(var h=f.length,m=[],p=0;p>>1]|=u(f.charCodeAt(p)<<16-p%2*16);return l.create(m,h*2)}};function u(f){return f<<8&4278255360|f>>>8&16711935}})(),a.enc.Utf16})}}),Wn=_e({"node_modules/crypto-js/enc-base64.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=s.enc;A.Base64={stringify:function(f){var h=f.words,m=f.sigBytes,p=this._map;f.clamp();for(var v=[],_=0;_>>2]>>>24-_%4*8&255,S=h[_+1>>>2]>>>24-(_+1)%4*8&255,y=h[_+2>>>2]>>>24-(_+2)%4*8&255,x=b<<16|S<<8|y,C=0;C<4&&_+C*.75>>6*(3-C)&63));var w=p.charAt(64);if(w)for(;v.length%4;)v.push(w);return v.join("")},parse:function(f){var h=f.length,m=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v>>6-_%4*2,y=b|S;p[v>>>2]|=y<<24-v%4*8,v++}return l.create(p,v)}})(),a.enc.Base64})}}),Jy=_e({"node_modules/crypto-js/enc-base64url.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=s.enc;A.Base64url={stringify:function(f,h){h===void 0&&(h=!0);var m=f.words,p=f.sigBytes,v=h?this._safe_map:this._map;f.clamp();for(var _=[],b=0;b>>2]>>>24-b%4*8&255,y=m[b+1>>>2]>>>24-(b+1)%4*8&255,x=m[b+2>>>2]>>>24-(b+2)%4*8&255,C=S<<16|y<<8|x,w=0;w<4&&b+w*.75>>6*(3-w)&63));var T=v.charAt(64);if(T)for(;_.length%4;)_.push(T);return _.join("")},parse:function(f,h){h===void 0&&(h=!0);var m=f.length,p=h?this._safe_map:this._map,v=this._reverseMap;if(!v){v=this._reverseMap=[];for(var _=0;_>>6-_%4*2,y=b|S;p[v>>>2]|=y<<24-v%4*8,v++}return l.create(p,v)}})(),a.enc.Base64url})}}),Qn=_e({"node_modules/crypto-js/md5.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,A=l.WordArray,u=l.Hasher,f=c.algo,h=[];(function(){for(var S=0;S<64;S++)h[S]=s.abs(s.sin(S+1))*4294967296|0})();var m=f.MD5=u.extend({_doReset:function(){this._hash=new A.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(S,y){for(var x=0;x<16;x++){var C=y+x,w=S[C];S[C]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var T=this._hash.words,R=S[y+0],D=S[y+1],N=S[y+2],I=S[y+3],F=S[y+4],j=S[y+5],L=S[y+6],G=S[y+7],K=S[y+8],ee=S[y+9],se=S[y+10],J=S[y+11],ne=S[y+12],W=S[y+13],X=S[y+14],Z=S[y+15],k=T[0],O=T[1],z=T[2],V=T[3];k=p(k,O,z,V,R,7,h[0]),V=p(V,k,O,z,D,12,h[1]),z=p(z,V,k,O,N,17,h[2]),O=p(O,z,V,k,I,22,h[3]),k=p(k,O,z,V,F,7,h[4]),V=p(V,k,O,z,j,12,h[5]),z=p(z,V,k,O,L,17,h[6]),O=p(O,z,V,k,G,22,h[7]),k=p(k,O,z,V,K,7,h[8]),V=p(V,k,O,z,ee,12,h[9]),z=p(z,V,k,O,se,17,h[10]),O=p(O,z,V,k,J,22,h[11]),k=p(k,O,z,V,ne,7,h[12]),V=p(V,k,O,z,W,12,h[13]),z=p(z,V,k,O,X,17,h[14]),O=p(O,z,V,k,Z,22,h[15]),k=v(k,O,z,V,D,5,h[16]),V=v(V,k,O,z,L,9,h[17]),z=v(z,V,k,O,J,14,h[18]),O=v(O,z,V,k,R,20,h[19]),k=v(k,O,z,V,j,5,h[20]),V=v(V,k,O,z,se,9,h[21]),z=v(z,V,k,O,Z,14,h[22]),O=v(O,z,V,k,F,20,h[23]),k=v(k,O,z,V,ee,5,h[24]),V=v(V,k,O,z,X,9,h[25]),z=v(z,V,k,O,I,14,h[26]),O=v(O,z,V,k,K,20,h[27]),k=v(k,O,z,V,W,5,h[28]),V=v(V,k,O,z,N,9,h[29]),z=v(z,V,k,O,G,14,h[30]),O=v(O,z,V,k,ne,20,h[31]),k=_(k,O,z,V,j,4,h[32]),V=_(V,k,O,z,K,11,h[33]),z=_(z,V,k,O,J,16,h[34]),O=_(O,z,V,k,X,23,h[35]),k=_(k,O,z,V,D,4,h[36]),V=_(V,k,O,z,F,11,h[37]),z=_(z,V,k,O,G,16,h[38]),O=_(O,z,V,k,se,23,h[39]),k=_(k,O,z,V,W,4,h[40]),V=_(V,k,O,z,R,11,h[41]),z=_(z,V,k,O,I,16,h[42]),O=_(O,z,V,k,L,23,h[43]),k=_(k,O,z,V,ee,4,h[44]),V=_(V,k,O,z,ne,11,h[45]),z=_(z,V,k,O,Z,16,h[46]),O=_(O,z,V,k,N,23,h[47]),k=b(k,O,z,V,R,6,h[48]),V=b(V,k,O,z,G,10,h[49]),z=b(z,V,k,O,X,15,h[50]),O=b(O,z,V,k,j,21,h[51]),k=b(k,O,z,V,ne,6,h[52]),V=b(V,k,O,z,I,10,h[53]),z=b(z,V,k,O,se,15,h[54]),O=b(O,z,V,k,D,21,h[55]),k=b(k,O,z,V,K,6,h[56]),V=b(V,k,O,z,Z,10,h[57]),z=b(z,V,k,O,L,15,h[58]),O=b(O,z,V,k,W,21,h[59]),k=b(k,O,z,V,F,6,h[60]),V=b(V,k,O,z,J,10,h[61]),z=b(z,V,k,O,N,15,h[62]),O=b(O,z,V,k,ee,21,h[63]),T[0]=T[0]+k|0,T[1]=T[1]+O|0,T[2]=T[2]+z|0,T[3]=T[3]+V|0},_doFinalize:function(){var S=this._data,y=S.words,x=this._nDataBytes*8,C=S.sigBytes*8;y[C>>>5]|=128<<24-C%32;var w=s.floor(x/4294967296),T=x;y[(C+64>>>9<<4)+15]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,y[(C+64>>>9<<4)+14]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360,S.sigBytes=(y.length+1)*4,this._process();for(var R=this._hash,D=R.words,N=0;N<4;N++){var I=D[N];D[N]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360}return R},clone:function(){var S=u.clone.call(this);return S._hash=this._hash.clone(),S}});function p(S,y,x,C,w,T,R){var D=S+(y&x|~y&C)+w+R;return(D<>>32-T)+y}function v(S,y,x,C,w,T,R){var D=S+(y&C|x&~C)+w+R;return(D<>>32-T)+y}function _(S,y,x,C,w,T,R){var D=S+(y^x^C)+w+R;return(D<>>32-T)+y}function b(S,y,x,C,w,T,R){var D=S+(x^(y|~C))+w+R;return(D<>>32-T)+y}c.MD5=u._createHelper(m),c.HmacMD5=u._createHmacHelper(m)})(Math),a.MD5})}}),U0=_e({"node_modules/crypto-js/sha1.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=c.Hasher,u=s.algo,f=[],h=u.SHA1=A.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(m,p){for(var v=this._hash.words,_=v[0],b=v[1],S=v[2],y=v[3],x=v[4],C=0;C<80;C++){if(C<16)f[C]=m[p+C]|0;else{var w=f[C-3]^f[C-8]^f[C-14]^f[C-16];f[C]=w<<1|w>>>31}var T=(_<<5|_>>>27)+x+f[C];C<20?T+=(b&S|~b&y)+1518500249:C<40?T+=(b^S^y)+1859775393:C<60?T+=(b&S|b&y|S&y)-1894007588:T+=(b^S^y)-899497514,x=y,y=S,S=b<<30|b>>>2,b=_,_=T}v[0]=v[0]+_|0,v[1]=v[1]+b|0,v[2]=v[2]+S|0,v[3]=v[3]+y|0,v[4]=v[4]+x|0},_doFinalize:function(){var m=this._data,p=m.words,v=this._nDataBytes*8,_=m.sigBytes*8;return p[_>>>5]|=128<<24-_%32,p[(_+64>>>9<<4)+14]=Math.floor(v/4294967296),p[(_+64>>>9<<4)+15]=v,m.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var m=A.clone.call(this);return m._hash=this._hash.clone(),m}});s.SHA1=A._createHelper(h),s.HmacSHA1=A._createHmacHelper(h)})(),a.SHA1})}}),Ta=_e({"node_modules/crypto-js/sha256.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,A=l.WordArray,u=l.Hasher,f=c.algo,h=[],m=[];(function(){function _(x){for(var C=s.sqrt(x),w=2;w<=C;w++)if(!(x%w))return!1;return!0}function b(x){return(x-(x|0))*4294967296|0}for(var S=2,y=0;y<64;)_(S)&&(y<8&&(h[y]=b(s.pow(S,1/2))),m[y]=b(s.pow(S,1/3)),y++),S++})();var p=[],v=f.SHA256=u.extend({_doReset:function(){this._hash=new A.init(h.slice(0))},_doProcessBlock:function(_,b){for(var S=this._hash.words,y=S[0],x=S[1],C=S[2],w=S[3],T=S[4],R=S[5],D=S[6],N=S[7],I=0;I<64;I++){if(I<16)p[I]=_[b+I]|0;else{var F=p[I-15],j=(F<<25|F>>>7)^(F<<14|F>>>18)^F>>>3,L=p[I-2],G=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;p[I]=j+p[I-7]+G+p[I-16]}var K=T&R^~T&D,ee=y&x^y&C^x&C,se=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),J=(T<<26|T>>>6)^(T<<21|T>>>11)^(T<<7|T>>>25),ne=N+J+K+m[I]+p[I],W=se+ee;N=D,D=R,R=T,T=w+ne|0,w=C,C=x,x=y,y=ne+W|0}S[0]=S[0]+y|0,S[1]=S[1]+x|0,S[2]=S[2]+C|0,S[3]=S[3]+w|0,S[4]=S[4]+T|0,S[5]=S[5]+R|0,S[6]=S[6]+D|0,S[7]=S[7]+N|0},_doFinalize:function(){var _=this._data,b=_.words,S=this._nDataBytes*8,y=_.sigBytes*8;return b[y>>>5]|=128<<24-y%32,b[(y+64>>>9<<4)+14]=s.floor(S/4294967296),b[(y+64>>>9<<4)+15]=S,_.sigBytes=b.length*4,this._process(),this._hash},clone:function(){var _=u.clone.call(this);return _._hash=this._hash.clone(),_}});c.SHA256=u._createHelper(v),c.HmacSHA256=u._createHmacHelper(v)})(Math),a.SHA256})}}),$y=_e({"node_modules/crypto-js/sha224.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Ta()):typeof define=="function"&&define.amd?define(["./core","./sha256"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=s.algo,u=A.SHA256,f=A.SHA224=u.extend({_doReset:function(){this._hash=new l.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var h=u._doFinalize.call(this);return h.sigBytes-=4,h}});s.SHA224=u._createHelper(f),s.HmacSHA224=u._createHmacHelper(f)})(),a.SHA224})}}),W0=_e({"node_modules/crypto-js/sha512.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Ci()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.Hasher,A=s.x64,u=A.Word,f=A.WordArray,h=s.algo;function m(){return u.create.apply(u,arguments)}var p=[m(1116352408,3609767458),m(1899447441,602891725),m(3049323471,3964484399),m(3921009573,2173295548),m(961987163,4081628472),m(1508970993,3053834265),m(2453635748,2937671579),m(2870763221,3664609560),m(3624381080,2734883394),m(310598401,1164996542),m(607225278,1323610764),m(1426881987,3590304994),m(1925078388,4068182383),m(2162078206,991336113),m(2614888103,633803317),m(3248222580,3479774868),m(3835390401,2666613458),m(4022224774,944711139),m(264347078,2341262773),m(604807628,2007800933),m(770255983,1495990901),m(1249150122,1856431235),m(1555081692,3175218132),m(1996064986,2198950837),m(2554220882,3999719339),m(2821834349,766784016),m(2952996808,2566594879),m(3210313671,3203337956),m(3336571891,1034457026),m(3584528711,2466948901),m(113926993,3758326383),m(338241895,168717936),m(666307205,1188179964),m(773529912,1546045734),m(1294757372,1522805485),m(1396182291,2643833823),m(1695183700,2343527390),m(1986661051,1014477480),m(2177026350,1206759142),m(2456956037,344077627),m(2730485921,1290863460),m(2820302411,3158454273),m(3259730800,3505952657),m(3345764771,106217008),m(3516065817,3606008344),m(3600352804,1432725776),m(4094571909,1467031594),m(275423344,851169720),m(430227734,3100823752),m(506948616,1363258195),m(659060556,3750685593),m(883997877,3785050280),m(958139571,3318307427),m(1322822218,3812723403),m(1537002063,2003034995),m(1747873779,3602036899),m(1955562222,1575990012),m(2024104815,1125592928),m(2227730452,2716904306),m(2361852424,442776044),m(2428436474,593698344),m(2756734187,3733110249),m(3204031479,2999351573),m(3329325298,3815920427),m(3391569614,3928383900),m(3515267271,566280711),m(3940187606,3454069534),m(4118630271,4000239992),m(116418474,1914138554),m(174292421,2731055270),m(289380356,3203993006),m(460393269,320620315),m(685471733,587496836),m(852142971,1086792851),m(1017036298,365543100),m(1126000580,2618297676),m(1288033470,3409855158),m(1501505948,4234509866),m(1607167915,987167468),m(1816402316,1246189591)],v=[];(function(){for(var b=0;b<80;b++)v[b]=m()})();var _=h.SHA512=l.extend({_doReset:function(){this._hash=new f.init([new u.init(1779033703,4089235720),new u.init(3144134277,2227873595),new u.init(1013904242,4271175723),new u.init(2773480762,1595750129),new u.init(1359893119,2917565137),new u.init(2600822924,725511199),new u.init(528734635,4215389547),new u.init(1541459225,327033209)])},_doProcessBlock:function(b,S){for(var y=this._hash.words,x=y[0],C=y[1],w=y[2],T=y[3],R=y[4],D=y[5],N=y[6],I=y[7],F=x.high,j=x.low,L=C.high,G=C.low,K=w.high,ee=w.low,se=T.high,J=T.low,ne=R.high,W=R.low,X=D.high,Z=D.low,k=N.high,O=N.low,z=I.high,V=I.low,re=F,ue=j,de=L,oe=G,Be=K,ze=ee,dt=se,it=J,ft=ne,Je=W,ar=X,Ut=Z,Et=k,Wt=O,ht=z,It=V,nt=0;nt<80;nt++){var Ve,At,Kt=v[nt];if(nt<16)At=Kt.high=b[S+nt*2]|0,Ve=Kt.low=b[S+nt*2+1]|0;else{var dr=v[nt-15],$=dr.high,Ae=dr.low,Ee=($>>>1|Ae<<31)^($>>>8|Ae<<24)^$>>>7,ke=(Ae>>>1|$<<31)^(Ae>>>8|$<<24)^(Ae>>>7|$<<25),Ie=v[nt-2],Qe=Ie.high,Xe=Ie.low,Yt=(Qe>>>19|Xe<<13)^(Qe<<3|Xe>>>29)^Qe>>>6,Rt=(Xe>>>19|Qe<<13)^(Xe<<3|Qe>>>29)^(Xe>>>6|Qe<<26),te=v[nt-7],le=te.high,me=te.low,De=v[nt-16],Pe=De.high,je=De.low;Ve=ke+me,At=Ee+le+(Ve>>>0>>0?1:0),Ve=Ve+Rt,At=At+Yt+(Ve>>>0>>0?1:0),Ve=Ve+je,At=At+Pe+(Ve>>>0>>0?1:0),Kt.high=At,Kt.low=Ve}var Fe=ft&ar^~ft&Et,Ue=Je&Ut^~Je&Wt,Qt=re&de^re&Be^de&Be,Se=ue&oe^ue&ze^oe&ze,qe=(re>>>28|ue<<4)^(re<<30|ue>>>2)^(re<<25|ue>>>7),ot=(ue>>>28|re<<4)^(ue<<30|re>>>2)^(ue<<25|re>>>7),pt=(ft>>>14|Je<<18)^(ft>>>18|Je<<14)^(ft<<23|Je>>>9),fr=(Je>>>14|ft<<18)^(Je>>>18|ft<<14)^(Je<<23|ft>>>9),Le=p[nt],$e=Le.high,xr=Le.low,Ke=It+fr,mt=ht+pt+(Ke>>>0>>0?1:0),Ke=Ke+Ue,mt=mt+Fe+(Ke>>>0>>0?1:0),Ke=Ke+xr,mt=mt+$e+(Ke>>>0>>0?1:0),Ke=Ke+Ve,mt=mt+At+(Ke>>>0>>0?1:0),wr=ot+Se,Zt=qe+Qt+(wr>>>0>>0?1:0);ht=Et,It=Wt,Et=ar,Wt=Ut,ar=ft,Ut=Je,Je=it+Ke|0,ft=dt+mt+(Je>>>0>>0?1:0)|0,dt=Be,it=ze,Be=de,ze=oe,de=re,oe=ue,ue=Ke+wr|0,re=mt+Zt+(ue>>>0>>0?1:0)|0}j=x.low=j+ue,x.high=F+re+(j>>>0>>0?1:0),G=C.low=G+oe,C.high=L+de+(G>>>0>>0?1:0),ee=w.low=ee+ze,w.high=K+Be+(ee>>>0>>0?1:0),J=T.low=J+it,T.high=se+dt+(J>>>0>>0?1:0),W=R.low=W+Je,R.high=ne+ft+(W>>>0>>0?1:0),Z=D.low=Z+Ut,D.high=X+ar+(Z>>>0>>0?1:0),O=N.low=O+Wt,N.high=k+Et+(O>>>0>>0?1:0),V=I.low=V+It,I.high=z+ht+(V>>>0>>0?1:0)},_doFinalize:function(){var b=this._data,S=b.words,y=this._nDataBytes*8,x=b.sigBytes*8;S[x>>>5]|=128<<24-x%32,S[(x+128>>>10<<5)+30]=Math.floor(y/4294967296),S[(x+128>>>10<<5)+31]=y,b.sigBytes=S.length*4,this._process();var C=this._hash.toX32();return C},clone:function(){var b=l.clone.call(this);return b._hash=this._hash.clone(),b},blockSize:1024/32});s.SHA512=l._createHelper(_),s.HmacSHA512=l._createHmacHelper(_)})(),a.SHA512})}}),e4=_e({"node_modules/crypto-js/sha384.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Ci(),W0()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.x64,l=c.Word,A=c.WordArray,u=s.algo,f=u.SHA512,h=u.SHA384=f.extend({_doReset:function(){this._hash=new A.init([new l.init(3418070365,3238371032),new l.init(1654270250,914150663),new l.init(2438529370,812702999),new l.init(355462360,4144912697),new l.init(1731405415,4290775857),new l.init(2394180231,1750603025),new l.init(3675008525,1694076839),new l.init(1203062813,3204075428)])},_doFinalize:function(){var m=f._doFinalize.call(this);return m.sigBytes-=16,m}});s.SHA384=f._createHelper(h),s.HmacSHA384=f._createHmacHelper(h)})(),a.SHA384})}}),t4=_e({"node_modules/crypto-js/sha3.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Ci()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,A=l.WordArray,u=l.Hasher,f=c.x64,h=f.Word,m=c.algo,p=[],v=[],_=[];(function(){for(var y=1,x=0,C=0;C<24;C++){p[y+5*x]=(C+1)*(C+2)/2%64;var w=x%5,T=(2*y+3*x)%5;y=w,x=T}for(var y=0;y<5;y++)for(var x=0;x<5;x++)v[y+5*x]=x+(2*y+3*x)%5*5;for(var R=1,D=0;D<24;D++){for(var N=0,I=0,F=0;F<7;F++){if(R&1){var j=(1<>>24)&16711935|(R<<24|R>>>8)&4278255360,D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360;var N=C[T];N.high^=D,N.low^=R}for(var I=0;I<24;I++){for(var F=0;F<5;F++){for(var j=0,L=0,G=0;G<5;G++){var N=C[F+5*G];j^=N.high,L^=N.low}var K=b[F];K.high=j,K.low=L}for(var F=0;F<5;F++)for(var ee=b[(F+4)%5],se=b[(F+1)%5],J=se.high,ne=se.low,j=ee.high^(J<<1|ne>>>31),L=ee.low^(ne<<1|J>>>31),G=0;G<5;G++){var N=C[F+5*G];N.high^=j,N.low^=L}for(var W=1;W<25;W++){var j,L,N=C[W],X=N.high,Z=N.low,k=p[W];k<32?(j=X<>>32-k,L=Z<>>32-k):(j=Z<>>64-k,L=X<>>64-k);var O=b[v[W]];O.high=j,O.low=L}var z=b[0],V=C[0];z.high=V.high,z.low=V.low;for(var F=0;F<5;F++)for(var G=0;G<5;G++){var W=F+5*G,N=C[W],re=b[W],ue=b[(F+1)%5+5*G],de=b[(F+2)%5+5*G];N.high=re.high^~ue.high&de.high,N.low=re.low^~ue.low&de.low}var N=C[0],oe=_[I];N.high^=oe.high,N.low^=oe.low}},_doFinalize:function(){var y=this._data,x=y.words;this._nDataBytes*8;var C=y.sigBytes*8,w=this.blockSize*32;x[C>>>5]|=1<<24-C%32,x[(s.ceil((C+1)/w)*w>>>5)-1]|=128,y.sigBytes=x.length*4,this._process();for(var T=this._state,R=this.cfg.outputLength/8,D=R/8,N=[],I=0;I>>24)&16711935|(j<<24|j>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,N.push(L),N.push(j)}return new A.init(N,R)},clone:function(){for(var y=u.clone.call(this),x=y._state=this._state.slice(0),C=0;C<25;C++)x[C]=x[C].clone();return y}});c.SHA3=u._createHelper(S),c.HmacSHA3=u._createHmacHelper(S)})(Math),a.SHA3})}}),r4=_e({"node_modules/crypto-js/ripemd160.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,A=l.WordArray,u=l.Hasher,f=c.algo,h=A.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]),m=A.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]),p=A.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]),v=A.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]),_=A.create([0,1518500249,1859775393,2400959708,2840853838]),b=A.create([1352829926,1548603684,1836072691,2053994217,0]),S=f.RIPEMD160=u.extend({_doReset:function(){this._hash=A.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,N){for(var I=0;I<16;I++){var F=N+I,j=D[F];D[F]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360}var L=this._hash.words,G=_.words,K=b.words,ee=h.words,se=m.words,J=p.words,ne=v.words,W,X,Z,k,O,z,V,re,ue,de;z=W=L[0],V=X=L[1],re=Z=L[2],ue=k=L[3],de=O=L[4];for(var oe,I=0;I<80;I+=1)oe=W+D[N+ee[I]]|0,I<16?oe+=y(X,Z,k)+G[0]:I<32?oe+=x(X,Z,k)+G[1]:I<48?oe+=C(X,Z,k)+G[2]:I<64?oe+=w(X,Z,k)+G[3]:oe+=T(X,Z,k)+G[4],oe=oe|0,oe=R(oe,J[I]),oe=oe+O|0,W=O,O=k,k=R(Z,10),Z=X,X=oe,oe=z+D[N+se[I]]|0,I<16?oe+=T(V,re,ue)+K[0]:I<32?oe+=w(V,re,ue)+K[1]:I<48?oe+=C(V,re,ue)+K[2]:I<64?oe+=x(V,re,ue)+K[3]:oe+=y(V,re,ue)+K[4],oe=oe|0,oe=R(oe,ne[I]),oe=oe+de|0,z=de,de=ue,ue=R(re,10),re=V,V=oe;oe=L[1]+Z+ue|0,L[1]=L[2]+k+de|0,L[2]=L[3]+O+z|0,L[3]=L[4]+W+V|0,L[4]=L[0]+X+re|0,L[0]=oe},_doFinalize:function(){var D=this._data,N=D.words,I=this._nDataBytes*8,F=D.sigBytes*8;N[F>>>5]|=128<<24-F%32,N[(F+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,D.sigBytes=(N.length+1)*4,this._process();for(var j=this._hash,L=j.words,G=0;G<5;G++){var K=L[G];L[G]=(K<<8|K>>>24)&16711935|(K<<24|K>>>8)&4278255360}return j},clone:function(){var D=u.clone.call(this);return D._hash=this._hash.clone(),D}});function y(D,N,I){return D^N^I}function x(D,N,I){return D&N|~D&I}function C(D,N,I){return(D|~N)^I}function w(D,N,I){return D&I|N&~I}function T(D,N,I){return D^(N|~I)}function R(D,N){return D<>>32-N}c.RIPEMD160=u._createHelper(S),c.HmacRIPEMD160=u._createHmacHelper(S)})(),a.RIPEMD160})}}),ki=_e({"node_modules/crypto-js/hmac.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(He()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){(function(){var s=a,c=s.lib,l=c.Base,A=s.enc,u=A.Utf8,f=s.algo;f.HMAC=l.extend({init:function(h,m){h=this._hasher=new h.init,typeof m=="string"&&(m=u.parse(m));var p=h.blockSize,v=p*4;m.sigBytes>v&&(m=h.finalize(m)),m.clamp();for(var _=this._oKey=m.clone(),b=this._iKey=m.clone(),S=_.words,y=b.words,x=0;x>>2]&255;j.sigBytes-=L}};l.BlockCipher=_.extend({cfg:_.cfg.extend({mode:y,padding:C}),reset:function(){var j;_.reset.call(this);var L=this.cfg,G=L.iv,K=L.mode;this._xformMode==this._ENC_XFORM_MODE?j=K.createEncryptor:(j=K.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==j?this._mode.init(this,G&&G.words):(this._mode=j.call(K,this,G&&G.words),this._mode.__creator=j)},_doProcessBlock:function(j,L){this._mode.processBlock(j,L)},_doFinalize:function(){var j,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),j=this._process(!0)):(j=this._process(!0),L.unpad(j)),j},blockSize:128/32});var w=l.CipherParams=A.extend({init:function(j){this.mixIn(j)},toString:function(j){return(j||this.formatter).stringify(this)}}),T=c.format={},R=T.OpenSSL={stringify:function(j){var L,G=j.ciphertext,K=j.salt;return K?L=u.create([1398893684,1701076831]).concat(K).concat(G):L=G,L.toString(m)},parse:function(j){var L,G=m.parse(j),K=G.words;return K[0]==1398893684&&K[1]==1701076831&&(L=u.create(K.slice(2,4)),K.splice(0,4),G.sigBytes-=16),w.create({ciphertext:G,salt:L})}},D=l.SerializableCipher=A.extend({cfg:A.extend({format:R}),encrypt:function(j,L,G,K){K=this.cfg.extend(K);var ee=j.createEncryptor(G,K),se=ee.finalize(L),J=ee.cfg;return w.create({ciphertext:se,key:G,iv:J.iv,algorithm:j,mode:J.mode,padding:J.padding,blockSize:j.blockSize,formatter:K.format})},decrypt:function(j,L,G,K){K=this.cfg.extend(K),L=this._parse(L,K.format);var ee=j.createDecryptor(G,K).finalize(L.ciphertext);return ee},_parse:function(j,L){return typeof j=="string"?L.parse(j,this):j}}),N=c.kdf={},I=N.OpenSSL={execute:function(j,L,G,K,ee){if(K||(K=u.random(64/8)),ee)var se=v.create({keySize:L+G,hasher:ee}).compute(j,K);else var se=v.create({keySize:L+G}).compute(j,K);var J=u.create(se.words.slice(L),G*4);return se.sigBytes=L*4,w.create({key:se,iv:J,salt:K})}},F=l.PasswordBasedCipher=D.extend({cfg:D.cfg.extend({kdf:I}),encrypt:function(j,L,G,K){K=this.cfg.extend(K);var ee=K.kdf.execute(G,j.keySize,j.ivSize,K.salt,K.hasher);K.iv=ee.iv;var se=D.encrypt.call(this,j,L,ee.key,K);return se.mixIn(ee),se},decrypt:function(j,L,G,K){K=this.cfg.extend(K),L=this._parse(L,K.format);var ee=K.kdf.execute(G,j.keySize,j.ivSize,L.salt,K.hasher);K.iv=ee.iv;var se=D.decrypt.call(this,j,L,ee.key,K);return se}})})()})}}),o4=_e({"node_modules/crypto-js/mode-cfb.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.mode.CFB=(function(){var s=a.lib.BlockCipherMode.extend();s.Encryptor=s.extend({processBlock:function(l,A){var u=this._cipher,f=u.blockSize;c.call(this,l,A,f,u),this._prevBlock=l.slice(A,A+f)}}),s.Decryptor=s.extend({processBlock:function(l,A){var u=this._cipher,f=u.blockSize,h=l.slice(A,A+f);c.call(this,l,A,f,u),this._prevBlock=h}});function c(l,A,u,f){var h,m=this._iv;m?(h=m.slice(0),this._iv=void 0):h=this._prevBlock,f.encryptBlock(h,0);for(var p=0;p>24&255)===255){var f=u>>16&255,h=u>>8&255,m=u&255;f===255?(f=0,h===255?(h=0,m===255?m=0:++m):++h):++f,u=0,u+=f<<16,u+=h<<8,u+=m}else u+=1<<24;return u}function l(u){return(u[0]=c(u[0]))===0&&(u[1]=c(u[1])),u}var A=s.Encryptor=s.extend({processBlock:function(u,f){var h=this._cipher,m=h.blockSize,p=this._iv,v=this._counter;p&&(v=this._counter=p.slice(0),this._iv=void 0),l(v);var _=v.slice(0);h.encryptBlock(_,0);for(var b=0;b>>2]|=u<<24-f%4*8,s.sigBytes+=u},unpad:function(s){var c=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=c}},a.pad.Ansix923})}}),u4=_e({"node_modules/crypto-js/pad-iso10126.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.Iso10126={pad:function(s,c){var l=c*4,A=l-s.sigBytes%l;s.concat(a.lib.WordArray.random(A-1)).concat(a.lib.WordArray.create([A<<24],1))},unpad:function(s){var c=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=c}},a.pad.Iso10126})}}),d4=_e({"node_modules/crypto-js/pad-iso97971.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.Iso97971={pad:function(s,c){s.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(s,c)},unpad:function(s){a.pad.ZeroPadding.unpad(s),s.sigBytes--}},a.pad.Iso97971})}}),f4=_e({"node_modules/crypto-js/pad-zeropadding.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.ZeroPadding={pad:function(s,c){var l=c*4;s.clamp(),s.sigBytes+=l-(s.sigBytes%l||l)},unpad:function(s){for(var c=s.words,l=s.sigBytes-1,l=s.sigBytes-1;l>=0;l--)if(c[l>>>2]>>>24-l%4*8&255){s.sigBytes=l+1;break}}},a.pad.ZeroPadding})}}),h4=_e({"node_modules/crypto-js/pad-nopadding.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})}}),A4=_e({"node_modules/crypto-js/format-hex.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Dt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,A=l.CipherParams,u=c.enc,f=u.Hex,h=c.format;h.Hex={stringify:function(m){return m.ciphertext.toString(f)},parse:function(m){var p=f.parse(m);return A.create({ciphertext:p})}}})(),a.format.Hex})}}),p4=_e({"node_modules/crypto-js/aes.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.BlockCipher,A=s.algo,u=[],f=[],h=[],m=[],p=[],v=[],_=[],b=[],S=[],y=[];(function(){for(var w=[],T=0;T<256;T++)T<128?w[T]=T<<1:w[T]=T<<1^283;for(var R=0,D=0,T=0;T<256;T++){var N=D^D<<1^D<<2^D<<3^D<<4;N=N>>>8^N&255^99,u[R]=N,f[N]=R;var I=w[R],F=w[I],j=w[F],L=w[N]*257^N*16843008;h[R]=L<<24|L>>>8,m[R]=L<<16|L>>>16,p[R]=L<<8|L>>>24,v[R]=L;var L=j*16843009^F*65537^I*257^R*16843008;_[N]=L<<24|L>>>8,b[N]=L<<16|L>>>16,S[N]=L<<8|L>>>24,y[N]=L,R?(R=I^w[w[w[j^I]]],D^=w[w[D]]):R=D=1}})();var x=[0,1,2,4,8,16,32,64,128,27,54],C=A.AES=l.extend({_doReset:function(){var w;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var T=this._keyPriorReset=this._key,R=T.words,D=T.sigBytes/4,N=this._nRounds=D+6,I=(N+1)*4,F=this._keySchedule=[],j=0;j6&&j%D==4&&(w=u[w>>>24]<<24|u[w>>>16&255]<<16|u[w>>>8&255]<<8|u[w&255]):(w=w<<8|w>>>24,w=u[w>>>24]<<24|u[w>>>16&255]<<16|u[w>>>8&255]<<8|u[w&255],w^=x[j/D|0]<<24),F[j]=F[j-D]^w);for(var L=this._invKeySchedule=[],G=0;G>>24]]^b[u[w>>>16&255]]^S[u[w>>>8&255]]^y[u[w&255]]}}},encryptBlock:function(w,T){this._doCryptBlock(w,T,this._keySchedule,h,m,p,v,u)},decryptBlock:function(w,T){var R=w[T+1];w[T+1]=w[T+3],w[T+3]=R,this._doCryptBlock(w,T,this._invKeySchedule,_,b,S,y,f);var R=w[T+1];w[T+1]=w[T+3],w[T+3]=R},_doCryptBlock:function(w,T,R,D,N,I,F,j){for(var L=this._nRounds,G=w[T]^R[0],K=w[T+1]^R[1],ee=w[T+2]^R[2],se=w[T+3]^R[3],J=4,ne=1;ne>>24]^N[K>>>16&255]^I[ee>>>8&255]^F[se&255]^R[J++],X=D[K>>>24]^N[ee>>>16&255]^I[se>>>8&255]^F[G&255]^R[J++],Z=D[ee>>>24]^N[se>>>16&255]^I[G>>>8&255]^F[K&255]^R[J++],k=D[se>>>24]^N[G>>>16&255]^I[K>>>8&255]^F[ee&255]^R[J++];G=W,K=X,ee=Z,se=k}var W=(j[G>>>24]<<24|j[K>>>16&255]<<16|j[ee>>>8&255]<<8|j[se&255])^R[J++],X=(j[K>>>24]<<24|j[ee>>>16&255]<<16|j[se>>>8&255]<<8|j[G&255])^R[J++],Z=(j[ee>>>24]<<24|j[se>>>16&255]<<16|j[G>>>8&255]<<8|j[K&255])^R[J++],k=(j[se>>>24]<<24|j[G>>>16&255]<<16|j[K>>>8&255]<<8|j[ee&255])^R[J++];w[T]=W,w[T+1]=X,w[T+2]=Z,w[T+3]=k},keySize:256/32});s.AES=l._createHelper(C)})(),a.AES})}}),m4=_e({"node_modules/crypto-js/tripledes.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,A=c.BlockCipher,u=s.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],h=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],m=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],p=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],v=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],_=u.DES=A.extend({_doReset:function(){for(var x=this._key,C=x.words,w=[],T=0;T<56;T++){var R=f[T]-1;w[T]=C[R>>>5]>>>31-R%32&1}for(var D=this._subKeys=[],N=0;N<16;N++){for(var I=D[N]=[],F=m[N],T=0;T<24;T++)I[T/6|0]|=w[(h[T]-1+F)%28]<<31-T%6,I[4+(T/6|0)]|=w[28+(h[T+24]-1+F)%28]<<31-T%6;I[0]=I[0]<<1|I[0]>>>31;for(var T=1;T<7;T++)I[T]=I[T]>>>(T-1)*4+3;I[7]=I[7]<<5|I[7]>>>27}for(var j=this._invSubKeys=[],T=0;T<16;T++)j[T]=D[15-T]},encryptBlock:function(x,C){this._doCryptBlock(x,C,this._subKeys)},decryptBlock:function(x,C){this._doCryptBlock(x,C,this._invSubKeys)},_doCryptBlock:function(x,C,w){this._lBlock=x[C],this._rBlock=x[C+1],b.call(this,4,252645135),b.call(this,16,65535),S.call(this,2,858993459),S.call(this,8,16711935),b.call(this,1,1431655765);for(var T=0;T<16;T++){for(var R=w[T],D=this._lBlock,N=this._rBlock,I=0,F=0;F<8;F++)I|=p[F][((N^R[F])&v[F])>>>0];this._lBlock=N,this._rBlock=D^I}var j=this._lBlock;this._lBlock=this._rBlock,this._rBlock=j,b.call(this,1,1431655765),S.call(this,8,16711935),S.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),x[C]=this._lBlock,x[C+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function b(x,C){var w=(this._lBlock>>>x^this._rBlock)&C;this._rBlock^=w,this._lBlock^=w<>>x^this._lBlock)&C;this._lBlock^=w,this._rBlock^=w<192.");var w=C.slice(0,2),T=C.length<4?C.slice(0,2):C.slice(2,4),R=C.length<6?C.slice(0,2):C.slice(4,6);this._des1=_.createEncryptor(l.create(w)),this._des2=_.createEncryptor(l.create(T)),this._des3=_.createEncryptor(l.create(R))},encryptBlock:function(x,C){this._des1.encryptBlock(x,C),this._des2.decryptBlock(x,C),this._des3.encryptBlock(x,C)},decryptBlock:function(x,C){this._des3.decryptBlock(x,C),this._des2.encryptBlock(x,C),this._des1.decryptBlock(x,C)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=A._createHelper(y)})(),a.TripleDES})}}),g4=_e({"node_modules/crypto-js/rc4.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,A=s.algo,u=A.RC4=l.extend({_doReset:function(){for(var m=this._key,p=m.words,v=m.sigBytes,_=this._S=[],b=0;b<256;b++)_[b]=b;for(var b=0,S=0;b<256;b++){var y=b%v,x=p[y>>>2]>>>24-y%4*8&255;S=(S+_[b]+x)%256;var C=_[b];_[b]=_[S],_[S]=C}this._i=this._j=0},_doProcessBlock:function(m,p){m[p]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var m=this._S,p=this._i,v=this._j,_=0,b=0;b<4;b++){p=(p+1)%256,v=(v+m[p])%256;var S=m[p];m[p]=m[v],m[v]=S,_|=m[(m[p]+m[v])%256]<<24-b*8}return this._i=p,this._j=v,_}s.RC4=l._createHelper(u);var h=A.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var m=this.cfg.drop;m>0;m--)f.call(this)}});s.RC4Drop=l._createHelper(h)})(),a.RC4})}}),v4=_e({"node_modules/crypto-js/rabbit.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,A=s.algo,u=[],f=[],h=[],m=A.Rabbit=l.extend({_doReset:function(){for(var v=this._key.words,_=this.cfg.iv,b=0;b<4;b++)v[b]=(v[b]<<8|v[b]>>>24)&16711935|(v[b]<<24|v[b]>>>8)&4278255360;var S=this._X=[v[0],v[3]<<16|v[2]>>>16,v[1],v[0]<<16|v[3]>>>16,v[2],v[1]<<16|v[0]>>>16,v[3],v[2]<<16|v[1]>>>16],y=this._C=[v[2]<<16|v[2]>>>16,v[0]&4294901760|v[1]&65535,v[3]<<16|v[3]>>>16,v[1]&4294901760|v[2]&65535,v[0]<<16|v[0]>>>16,v[2]&4294901760|v[3]&65535,v[1]<<16|v[1]>>>16,v[3]&4294901760|v[0]&65535];this._b=0;for(var b=0;b<4;b++)p.call(this);for(var b=0;b<8;b++)y[b]^=S[b+4&7];if(_){var x=_.words,C=x[0],w=x[1],T=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,R=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,D=T>>>16|R&4294901760,N=R<<16|T&65535;y[0]^=T,y[1]^=D,y[2]^=R,y[3]^=N,y[4]^=T,y[5]^=D,y[6]^=R,y[7]^=N;for(var b=0;b<4;b++)p.call(this)}},_doProcessBlock:function(v,_){var b=this._X;p.call(this),u[0]=b[0]^b[5]>>>16^b[3]<<16,u[1]=b[2]^b[7]>>>16^b[5]<<16,u[2]=b[4]^b[1]>>>16^b[7]<<16,u[3]=b[6]^b[3]>>>16^b[1]<<16;for(var S=0;S<4;S++)u[S]=(u[S]<<8|u[S]>>>24)&16711935|(u[S]<<24|u[S]>>>8)&4278255360,v[_+S]^=u[S]},blockSize:128/32,ivSize:64/32});function p(){for(var v=this._X,_=this._C,b=0;b<8;b++)f[b]=_[b];_[0]=_[0]+1295307597+this._b|0,_[1]=_[1]+3545052371+(_[0]>>>0>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0>>0?1:0)|0,this._b=_[7]>>>0>>0?1:0;for(var b=0;b<8;b++){var S=v[b]+_[b],y=S&65535,x=S>>>16,C=((y*y>>>17)+y*x>>>15)+x*x,w=((S&4294901760)*S|0)+((S&65535)*S|0);h[b]=C^w}v[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,v[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,v[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,v[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,v[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,v[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,v[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,v[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}s.Rabbit=l._createHelper(m)})(),a.Rabbit})}}),y4=_e({"node_modules/crypto-js/rabbit-legacy.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,A=s.algo,u=[],f=[],h=[],m=A.RabbitLegacy=l.extend({_doReset:function(){var v=this._key.words,_=this.cfg.iv,b=this._X=[v[0],v[3]<<16|v[2]>>>16,v[1],v[0]<<16|v[3]>>>16,v[2],v[1]<<16|v[0]>>>16,v[3],v[2]<<16|v[1]>>>16],S=this._C=[v[2]<<16|v[2]>>>16,v[0]&4294901760|v[1]&65535,v[3]<<16|v[3]>>>16,v[1]&4294901760|v[2]&65535,v[0]<<16|v[0]>>>16,v[2]&4294901760|v[3]&65535,v[1]<<16|v[1]>>>16,v[3]&4294901760|v[0]&65535];this._b=0;for(var y=0;y<4;y++)p.call(this);for(var y=0;y<8;y++)S[y]^=b[y+4&7];if(_){var x=_.words,C=x[0],w=x[1],T=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,R=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,D=T>>>16|R&4294901760,N=R<<16|T&65535;S[0]^=T,S[1]^=D,S[2]^=R,S[3]^=N,S[4]^=T,S[5]^=D,S[6]^=R,S[7]^=N;for(var y=0;y<4;y++)p.call(this)}},_doProcessBlock:function(v,_){var b=this._X;p.call(this),u[0]=b[0]^b[5]>>>16^b[3]<<16,u[1]=b[2]^b[7]>>>16^b[5]<<16,u[2]=b[4]^b[1]>>>16^b[7]<<16,u[3]=b[6]^b[3]>>>16^b[1]<<16;for(var S=0;S<4;S++)u[S]=(u[S]<<8|u[S]>>>24)&16711935|(u[S]<<24|u[S]>>>8)&4278255360,v[_+S]^=u[S]},blockSize:128/32,ivSize:64/32});function p(){for(var v=this._X,_=this._C,b=0;b<8;b++)f[b]=_[b];_[0]=_[0]+1295307597+this._b|0,_[1]=_[1]+3545052371+(_[0]>>>0>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0>>0?1:0)|0,this._b=_[7]>>>0>>0?1:0;for(var b=0;b<8;b++){var S=v[b]+_[b],y=S&65535,x=S>>>16,C=((y*y>>>17)+y*x>>>15)+x*x,w=((S&4294901760)*S|0)+((S&65535)*S|0);h[b]=C^w}v[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,v[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,v[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,v[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,v[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,v[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,v[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,v[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}s.RabbitLegacy=l._createHelper(m)})(),a.RabbitLegacy})}}),x4=_e({"node_modules/crypto-js/blowfish.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(He(),Wn(),Qn(),Cn(),Dt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.BlockCipher,A=s.algo;const u=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],h=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var m={pbox:[],sbox:[]};function p(y,x){let C=x>>24&255,w=x>>16&255,T=x>>8&255,R=x&255,D=y.sbox[0][C]+y.sbox[1][w];return D=D^y.sbox[2][T],D=D+y.sbox[3][R],D}function v(y,x,C){let w=x,T=C,R;for(let D=0;D1;--D)w=w^y.pbox[D],T=p(y,w)^T,R=w,w=T,T=R;return R=w,w=T,T=R,T=T^y.pbox[1],w=w^y.pbox[0],{left:w,right:T}}function b(y,x,C){for(let N=0;N<4;N++){y.sbox[N]=[];for(let I=0;I<256;I++)y.sbox[N][I]=h[N][I]}let w=0;for(let N=0;N=C&&(w=0);let T=0,R=0,D=0;for(let N=0;N=0&&(R=R.substring(0,D));const N=R.indexOf(": ");let I,F;if(N>0&&N<50){const j=R.substring(0,N);/[:\[\]]/.test(j)?F=R:(I=j,F=R.substring(N+2))}else F=R;return{success:!0,data:{timestamp:x,flags:C,sender:I,message:F}}}catch(u){return{success:!1,error:u instanceof Error?u.message:"Decryption failed"}}}static calculateChannelHash(c){const l=(0,o.SHA256)(o.enc.Hex.parse(c));return(0,a.hexToBytes)(l.toString(o.enc.Hex))[0].toString(16).padStart(2,"0")}};r.ChannelCrypto=s}}),G0=_e({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/key-manager.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.MeshCoreKeyStore=void 0;var o=xu(),a=class{constructor(s){this.nodeKeys=new Map,this.channelHashToKeys=new Map,s!=null&&s.channelSecrets&&this.addChannelSecrets(s.channelSecrets),s!=null&&s.nodeKeys&&Object.entries(s.nodeKeys).forEach(([c,l])=>{this.addNodeKey(c,l)})}addNodeKey(s,c){const l=s.toUpperCase();this.nodeKeys.set(l,c)}hasChannelKey(s){const c=s.toLowerCase();return this.channelHashToKeys.has(c)}hasNodeKey(s){const c=s.toUpperCase();return this.nodeKeys.has(c)}getChannelKeys(s){const c=s.toLowerCase();return this.channelHashToKeys.get(c)||[]}getNodeKey(s){const c=s.toUpperCase();return this.nodeKeys.get(c)}addChannelSecrets(s){for(const c of s){const l=o.ChannelCrypto.calculateChannelHash(c).toLowerCase();this.channelHashToKeys.has(l)||this.channelHashToKeys.set(l,[]),this.channelHashToKeys.get(l).push(c)}}};r.MeshCoreKeyStore=a}}),q0={};Ky(q0,{CURVE:()=>tu,ExtendedPoint:()=>Hr,Point:()=>Hr,etc:()=>ii,getPublicKey:()=>Y0,getPublicKeyAsync:()=>K0,sign:()=>X0,signAsync:()=>Z0,utils:()=>ep,verify:()=>$0,verifyAsync:()=>J0});var tu,Ot,ha,_c,Cc,Ws,Qs,Fh,Tr,xo,nr,Lh,kc,Hh,xn,Aa,Gs,Sc,qs,Fr,Ec,Ks,Jr,Rc,zh,wo,Tc,pa,wn,ve,Bc,Pc,Vh,Nc,Ys,Zs,Hr,Lr,Ln,Dc,Xs,Br,Uh,Ic,Wh,ma,Js,$s,jc,ei,ti,K0,Y0,Mc,Oc,Fc,Z0,X0,ri,Lc,J0,$0,ii,ep,ga,Qh,Hc,ni,Gh,zc,Vc,qh,w4=qy({"node_modules/@noble/ed25519/index.js"(){tu={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:Ot,n:ha,Gx:_c,Gy:Cc,a:Ws,d:Qs}=tu,Fh=8n,Tr=32,xo=64,nr=(r="")=>{throw new Error(r)},Lh=r=>typeof r=="bigint",kc=r=>typeof r=="string",Hh=r=>r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array",xn=(r,o)=>!Hh(r)||typeof o=="number"&&o>0&&r.length!==o?nr("Uint8Array expected"):r,Aa=r=>new Uint8Array(r),Gs=r=>Uint8Array.from(r),Sc=(r,o)=>r.toString(16).padStart(o,"0"),qs=r=>Array.from(xn(r)).map(o=>Sc(o,2)).join(""),Fr={_0:48,_9:57,A:65,F:70,a:97,f:102},Ec=r=>{if(r>=Fr._0&&r<=Fr._9)return r-Fr._0;if(r>=Fr.A&&r<=Fr.F)return r-(Fr.A-10);if(r>=Fr.a&&r<=Fr.f)return r-(Fr.a-10)},Ks=r=>{const o="hex invalid";if(!kc(r))return nr(o);const a=r.length,s=a/2;if(a%2)return nr(o);const c=Aa(s);for(let l=0,A=0;lxn(kc(r)?Ks(r):Gs(xn(r)),o),Rc=()=>globalThis==null?void 0:globalThis.crypto,zh=()=>{var r;return((r=Rc())==null?void 0:r.subtle)??nr("crypto.subtle must be defined")},wo=(...r)=>{const o=Aa(r.reduce((s,c)=>s+xn(c).length,0));let a=0;return r.forEach(s=>{o.set(s,a),a+=s.length}),o},Tc=(r=Tr)=>Rc().getRandomValues(Aa(r)),pa=BigInt,wn=(r,o,a,s="bad number: out of range")=>Lh(r)&&o<=r&&r{const a=r%o;return a>=0n?a:o+a},Bc=r=>ve(r,ha),Pc=(r,o)=>{(r===0n||o<=0n)&&nr("no inverse n="+r+" mod="+o);let a=ve(r,o),s=o,c=0n,l=1n;for(;a!==0n;){const A=s/a,u=s%a,f=c-l*A;s=a,a=u,c=l,l=f}return s===1n?ve(c,o):nr("no inverse")},Vh=r=>{const o=ii[r];return typeof o!="function"&&nr("hashes."+r+" not set"),o},Nc=r=>r instanceof Hr?r:nr("Point expected"),Ys=2n**256n,Zs=class zn{constructor(o,a,s,c){yo(this,"ex"),yo(this,"ey"),yo(this,"ez"),yo(this,"et");const l=Ys;this.ex=wn(o,0n,l),this.ey=wn(a,0n,l),this.ez=wn(s,1n,l),this.et=wn(c,0n,l),Object.freeze(this)}static fromAffine(o){return new zn(o.x,o.y,1n,ve(o.x*o.y))}static fromBytes(o,a=!1){const s=Qs,c=Gs(xn(o,Tr)),l=o[31];c[31]=l&-129;const A=Xs(c);wn(A,0n,a?Ys:Ot);const f=ve(A*A),h=ve(f-1n),m=ve(s*f+1n);let{isValid:p,value:v}=Wh(h,m);p||nr("bad point: y not sqrt");const _=(v&1n)===1n,b=(l&128)!==0;return!a&&v===0n&&b&&nr("bad point: x==0, isLastByteOdd"),b!==_&&(v=ve(-v)),new zn(v,A,1n,ve(v*A))}assertValidity(){const o=Ws,a=Qs,s=this;if(s.is0())throw new Error("bad point: ZERO");const{ex:c,ey:l,ez:A,et:u}=s,f=ve(c*c),h=ve(l*l),m=ve(A*A),p=ve(m*m),v=ve(f*o),_=ve(m*ve(v+h)),b=ve(p+ve(a*ve(f*h)));if(_!==b)throw new Error("bad point: equation left != right (1)");const S=ve(c*l),y=ve(A*u);if(S!==y)throw new Error("bad point: equation left != right (2)");return this}equals(o){const{ex:a,ey:s,ez:c}=this,{ex:l,ey:A,ez:u}=Nc(o),f=ve(a*u),h=ve(l*c),m=ve(s*u),p=ve(A*c);return f===h&&m===p}is0(){return this.equals(Ln)}negate(){return new zn(ve(-this.ex),this.ey,this.ez,ve(-this.et))}double(){const{ex:o,ey:a,ez:s}=this,c=Ws,l=ve(o*o),A=ve(a*a),u=ve(2n*ve(s*s)),f=ve(c*l),h=o+a,m=ve(ve(h*h)-l-A),p=f+A,v=p-u,_=f-A,b=ve(m*v),S=ve(p*_),y=ve(m*_),x=ve(v*p);return new zn(b,S,x,y)}add(o){const{ex:a,ey:s,ez:c,et:l}=this,{ex:A,ey:u,ez:f,et:h}=Nc(o),m=Ws,p=Qs,v=ve(a*A),_=ve(s*u),b=ve(l*p*h),S=ve(c*f),y=ve((a+s)*(A+u)-v-_),x=ve(S-b),C=ve(S+b),w=ve(_-m*v),T=ve(y*x),R=ve(C*w),D=ve(y*w),N=ve(x*C);return new zn(T,R,N,D)}multiply(o,a=!0){if(!a&&(o===0n||this.is0()))return Ln;if(wn(o,1n,ha),o===1n)return this;if(this.equals(Lr))return qh(o).p;let s=Ln,c=Lr;for(let l=this;o>0n;l=l.double(),o>>=1n)o&1n?s=s.add(l):a&&(c=c.add(l));return s}toAffine(){const{ex:o,ey:a,ez:s}=this;if(this.equals(Ln))return{x:0n,y:1n};const c=Pc(s,Ot);return ve(s*c)!==1n&&nr("invalid inverse"),{x:ve(o*c),y:ve(a*c)}}toBytes(){const{x:o,y:a}=this.assertValidity().toAffine(),s=Dc(a);return s[31]|=o&1n?128:0,s}toHex(){return qs(this.toBytes())}clearCofactor(){return this.multiply(pa(Fh),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let o=this.multiply(ha/2n,!1).double();return ha%2n&&(o=o.add(this)),o.is0()}static fromHex(o,a){return zn.fromBytes(Jr(o),a)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(){return this.toBytes()}},yo(Zs,"BASE"),yo(Zs,"ZERO"),Hr=Zs,Lr=new Hr(_c,Cc,1n,ve(_c*Cc)),Ln=new Hr(0n,1n,1n,0n),Hr.BASE=Lr,Hr.ZERO=Ln,Dc=r=>Ks(Sc(wn(r,0n,Ys),xo)).reverse(),Xs=r=>pa("0x"+qs(Gs(xn(r)).reverse())),Br=(r,o)=>{let a=r;for(;o-- >0n;)a*=a,a%=Ot;return a},Uh=r=>{const a=r*r%Ot*r%Ot,s=Br(a,2n)*a%Ot,c=Br(s,1n)*r%Ot,l=Br(c,5n)*c%Ot,A=Br(l,10n)*l%Ot,u=Br(A,20n)*A%Ot,f=Br(u,40n)*u%Ot,h=Br(f,80n)*f%Ot,m=Br(h,80n)*f%Ot,p=Br(m,10n)*l%Ot;return{pow_p_5_8:Br(p,2n)*r%Ot,b2:a}},Ic=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,Wh=(r,o)=>{const a=ve(o*o*o),s=ve(a*a*o),c=Uh(r*s).pow_p_5_8;let l=ve(r*a*c);const A=ve(o*l*l),u=l,f=ve(l*Ic),h=A===r,m=A===ve(-r),p=A===ve(-r*Ic);return h&&(l=u),(m||p)&&(l=f),(ve(l)&1n)===1n&&(l=ve(-l)),{isValid:h||m,value:l}},ma=r=>Bc(Xs(r)),Js=(...r)=>ii.sha512Async(...r),$s=(...r)=>Vh("sha512Sync")(...r),jc=r=>{const o=r.slice(0,Tr);o[0]&=248,o[31]&=127,o[31]|=64;const a=r.slice(Tr,xo),s=ma(o),c=Lr.multiply(s),l=c.toBytes();return{head:o,prefix:a,scalar:s,point:c,pointBytes:l}},ei=r=>Js(Jr(r,Tr)).then(jc),ti=r=>jc($s(Jr(r,Tr))),K0=r=>ei(r).then(o=>o.pointBytes),Y0=r=>ti(r).pointBytes,Mc=r=>Js(r.hashable).then(r.finish),Oc=r=>r.finish($s(r.hashable)),Fc=(r,o,a)=>{const{pointBytes:s,scalar:c}=r,l=ma(o),A=Lr.multiply(l).toBytes();return{hashable:wo(A,s,a),finish:h=>{const m=Bc(l+ma(h)*c);return xn(wo(A,Dc(m)),xo)}}},Z0=async(r,o)=>{const a=Jr(r),s=await ei(o),c=await Js(s.prefix,a);return Mc(Fc(s,c,a))},X0=(r,o)=>{const a=Jr(r),s=ti(o),c=$s(s.prefix,a);return Oc(Fc(s,c,a))},ri={zip215:!0},Lc=(r,o,a,s=ri)=>{r=Jr(r,xo),o=Jr(o),a=Jr(a,Tr);const{zip215:c}=s;let l,A,u,f,h=Uint8Array.of();try{l=Hr.fromHex(a,c),A=Hr.fromHex(r.slice(0,Tr),c),u=Xs(r.slice(Tr,xo)),f=Lr.multiply(u,!1),h=wo(A.toBytes(),l.toBytes(),o)}catch{}return{hashable:h,finish:p=>{if(f==null||!c&&l.isSmallOrder())return!1;const v=ma(p);return A.add(l.multiply(v,!1)).add(f.negate()).clearCofactor().is0()}}},J0=async(r,o,a,s=ri)=>Mc(Lc(r,o,a,s)),$0=(r,o,a,s=ri)=>Oc(Lc(r,o,a,s)),ii={sha512Async:async(...r)=>{const o=zh(),a=wo(...r);return Aa(await o.digest("SHA-512",a.buffer))},sha512Sync:void 0,bytesToHex:qs,hexToBytes:Ks,concatBytes:wo,mod:ve,invert:Pc,randomBytes:Tc},ep={getExtendedPublicKeyAsync:ei,getExtendedPublicKey:ti,randomPrivateKey:()=>Tc(Tr),precompute:(r=8,o=Lr)=>(o.multiply(3n),o)},ga=8,Qh=256,Hc=Math.ceil(Qh/ga)+1,ni=2**(ga-1),Gh=()=>{const r=[];let o=Lr,a=o;for(let s=0;s{const a=o.negate();return r?a:o},qh=r=>{const o=zc||(zc=Gh());let a=Ln,s=Lr;const c=2**ga,l=c,A=pa(c-1),u=pa(ga);for(let f=0;f>=u,h>ni&&(h-=l,r+=1n);const m=f*ni,p=m,v=m+Math.abs(h)-1,_=f%2!==0,b=h<0;h===0?s=s.add(Vc(_,o[p])):a=a.add(Vc(b,o[v]))}return{p:a,f:s}}}}),b4=_e({"(disabled):fs"(){}}),_4=_e({"node_modules/@michaelhart/meshcore-decoder/lib/orlp-ed25519.js"(r,o){var a=(()=>{var c;var s=typeof document<"u"?(c=document.currentScript)==null?void 0:c.src:void 0;return async function(l={}){var Rt;var A,u=l,f=typeof window=="object",h=typeof WorkerGlobalScope<"u",m=typeof process=="object"&&((Rt=process.versions)==null?void 0:Rt.node)&&process.type!="renderer";typeof __filename<"u"?s=__filename:h&&(s=self.location.href);var p="";function v(te){return u.locateFile?u.locateFile(te,p):p+te}var _,b;if(m){var S=b4();p=__dirname+"/",b=te=>{te=w(te)?new URL(te):te;var le=S.readFileSync(te);return le},_=async(te,le=!0)=>{te=w(te)?new URL(te):te;var me=S.readFileSync(te,le?void 0:"utf8");return me},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else if(f||h){try{p=new URL(".",s).href}catch{}h&&(b=te=>{var le=new XMLHttpRequest;return le.open("GET",te,!1),le.responseType="arraybuffer",le.send(null),new Uint8Array(le.response)}),_=async te=>{if(w(te))return new Promise((me,De)=>{var Pe=new XMLHttpRequest;Pe.open("GET",te,!0),Pe.responseType="arraybuffer",Pe.onload=()=>{if(Pe.status==200||Pe.status==0&&Pe.response){me(Pe.response);return}De(Pe.status)},Pe.onerror=De,Pe.send(null)});var le=await fetch(te,{credentials:"same-origin"});if(le.ok)return le.arrayBuffer();throw new Error(le.status+" : "+le.url)}}console.log.bind(console);var y=console.error.bind(console),x,C=!1,w=te=>te.startsWith("file://"),T,R,D,N,I,F=!1;function j(){var te=D.buffer;u.HEAP8=N=new Int8Array(te),u.HEAPU8=I=new Uint8Array(te),u.HEAP32=new Int32Array(te),u.HEAPU32=new Uint32Array(te),new BigInt64Array(te),new BigUint64Array(te)}function L(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)dt(u.preRun.shift());de(ze)}function G(){F=!0,Qe.b()}function K(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Be(u.postRun.shift());de(oe)}var ee=0,se=null;function J(te){var le;ee++,(le=u.monitorRunDependencies)==null||le.call(u,ee)}function ne(te){var me;if(ee--,(me=u.monitorRunDependencies)==null||me.call(u,ee),ee==0&&se){var le=se;se=null,le()}}function W(te){var me;(me=u.onAbort)==null||me.call(u,te),te="Aborted("+te+")",y(te),C=!0,te+=". Build with -sASSERTIONS for more info.";var le=new WebAssembly.RuntimeError(te);throw R==null||R(le),le}var X;function Z(){return v("orlp-ed25519.wasm")}function k(te){if(te==X&&x)return new Uint8Array(x);if(b)return b(te);throw"both async and sync fetching of the wasm failed"}async function O(te){if(!x)try{var le=await _(te);return new Uint8Array(le)}catch{}return k(te)}async function z(te,le){try{var me=await O(te),De=await WebAssembly.instantiate(me,le);return De}catch(Pe){y(`failed to asynchronously prepare wasm: ${Pe}`),W(Pe)}}async function V(te,le,me){if(!te&&typeof WebAssembly.instantiateStreaming=="function"&&!w(le)&&!m)try{var De=fetch(le,{credentials:"same-origin"}),Pe=await WebAssembly.instantiateStreaming(De,me);return Pe}catch(je){y(`wasm streaming compile failed: ${je}`),y("falling back to ArrayBuffer instantiation")}return z(le,me)}function re(){return{a:Ie}}async function ue(){function te(je,Fe){return Qe=je.exports,D=Qe.a,j(),ke(Qe),ne(),Qe}J();function le(je){return te(je.instance)}var me=re();if(u.instantiateWasm)return new Promise((je,Fe)=>{u.instantiateWasm(me,(Ue,Qt)=>{je(te(Ue))})});X??(X=Z());var De=await V(x,X,me),Pe=le(De);return Pe}var de=te=>{for(;te.length>0;)te.shift()(u)},oe=[],Be=te=>oe.push(te),ze=[],dt=te=>ze.push(te),it=te=>$(te),ft=()=>Ee(),Je=te=>{var le=u["_"+te];return le},ar=(te,le)=>{N.set(te,le)},Ut=te=>{for(var le=0,me=0;me=55296&&De<=57343?(le+=4,++me):le+=3}return le},Et=(te,le,me,De)=>{if(!(De>0))return 0;for(var Pe=me,je=me+De-1,Fe=0;Fe=je)break;le[me++]=Ue}else if(Ue<=2047){if(me+1>=je)break;le[me++]=192|Ue>>6,le[me++]=128|Ue&63}else if(Ue<=65535){if(me+2>=je)break;le[me++]=224|Ue>>12,le[me++]=128|Ue>>6&63,le[me++]=128|Ue&63}else{if(me+3>=je)break;le[me++]=240|Ue>>18,le[me++]=128|Ue>>12&63,le[me++]=128|Ue>>6&63,le[me++]=128|Ue&63,Fe++}}return le[me]=0,me-Pe},Wt=(te,le,me)=>Et(te,I,le,me),ht=te=>Ae(te),It=te=>{var le=Ut(te)+1,me=ht(le);return Wt(te,me,le),me},nt=typeof TextDecoder<"u"?new TextDecoder:void 0,Ve=(te,le=0,me=NaN)=>{for(var De=le+me,Pe=le;te[Pe]&&!(Pe>=De);)++Pe;if(Pe-le>16&&te.buffer&&nt)return nt.decode(te.subarray(le,Pe));for(var je="";le>10,56320|Se&1023)}}return je},At=(te,le)=>te?Ve(I,te,le):"",Kt=(te,le,me,De,Pe)=>{var je={string:Le=>{var $e=0;return Le!=null&&Le!==0&&($e=It(Le)),$e},array:Le=>{var $e=ht(Le.length);return ar(Le,$e),$e}};function Fe(Le){return le==="string"?At(Le):le==="boolean"?!!Le:Le}var Ue=Je(te),Qt=[],Se=0;if(De)for(var qe=0;qe{var Pe=!me||me.every(Fe=>Fe==="number"||Fe==="boolean"),je=le!=="string";return je&&Pe&&!De?Je(te):(...Fe)=>Kt(te,le,me,Fe)};u.noExitRuntime&&u.noExitRuntime,u.print&&u.print,u.printErr&&(y=u.printErr),u.wasmBinary&&(x=u.wasmBinary),u.arguments&&u.arguments,u.thisProgram&&u.thisProgram,u.ccall=Kt,u.cwrap=dr;var $,Ae,Ee;function ke(te){u._orlp_derive_public_key=te.c,u._orlp_validate_keypair=te.d,u._orlp_sign=te.e,u._orlp_verify=te.f,$=te.g,Ae=te.h,Ee=te.i}var Ie={},Qe=await ue();function Xe(){if(ee>0){se=Xe;return}if(L(),ee>0){se=Xe;return}function te(){var le;u.calledRun=!0,!C&&(G(),T==null||T(u),(le=u.onRuntimeInitialized)==null||le.call(u),K())}u.setStatus?(u.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>u.setStatus(""),1),te()},1)):te()}function Yt(){if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.shift()()}return Yt(),Xe(),F?A=u:A=new Promise((te,le)=>{T=te,R=le}),A}})();typeof r=="object"&&typeof o=="object"?(o.exports=a,o.exports.default=a):typeof define=="function"&&define.amd&&define([],()=>a)}}),wu=_e({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/orlp-ed25519-wasm.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.derivePublicKey=c,r.validateKeyPair=l,r.sign=A,r.verify=u;var o=Ft(),a=_4();async function s(){return await a()}async function c(f){const h=await s(),m=(0,o.hexToBytes)(f);if(m.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${m.length}`);const p=1024,v=1088;if(h.HEAPU8.set(m,p),h.ccall("orlp_derive_public_key","number",["number","number"],[v,p])!==0)throw new Error("orlp key derivation failed: invalid private key");const b=new Uint8Array(32);return b.set(h.HEAPU8.subarray(v,v+32)),(0,o.bytesToHex)(b)}async function l(f,h){try{const m=await s(),p=(0,o.hexToBytes)(f),v=(0,o.hexToBytes)(h);if(p.length!==64||v.length!==32)return!1;const _=2048,b=2112;return m.HEAPU8.set(p,_),m.HEAPU8.set(v,b),m.ccall("orlp_validate_keypair","number",["number","number"],[b,_])===1}catch{return!1}}async function A(f,h,m){const p=await s(),v=(0,o.hexToBytes)(f),_=(0,o.hexToBytes)(h),b=(0,o.hexToBytes)(m);if(_.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${_.length}`);if(b.length!==32)throw new Error(`Invalid public key length: expected 32 bytes, got ${b.length}`);const S=1e5,y=2e5,x=3e5,C=4e5;p.HEAPU8.set(v,S),p.HEAPU8.set(_,y),p.HEAPU8.set(b,x),p.ccall("orlp_sign","void",["number","number","number","number","number"],[C,S,v.length,x,y]);const w=new Uint8Array(64);return w.set(p.HEAPU8.subarray(C,C+64)),(0,o.bytesToHex)(w)}async function u(f,h,m){try{const p=await s(),v=(0,o.hexToBytes)(f),_=(0,o.hexToBytes)(h),b=(0,o.hexToBytes)(m);if(v.length!==64||b.length!==32)return!1;const S=5e5,y=6e5,x=7e5;return p.HEAPU8.set(v,y),p.HEAPU8.set(_,S),p.HEAPU8.set(b,x),p.ccall("orlp_verify","number",["number","number","number","number"],[y,S,_.length,x])===1}catch{return!1}}}}),tp=_e({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/ed25519-verifier.js"(r){var o=r&&r.__createBinding||(Object.create?function(m,p,v,_){_===void 0&&(_=v);var b=Object.getOwnPropertyDescriptor(p,v);(!b||("get"in b?!p.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return p[v]}}),Object.defineProperty(m,_,b)}:function(m,p,v,_){_===void 0&&(_=v),m[_]=p[v]}),a=r&&r.__setModuleDefault||(Object.create?function(m,p){Object.defineProperty(m,"default",{enumerable:!0,value:p})}:function(m,p){m.default=p}),s=r&&r.__importStar||(function(){var m=function(p){return m=Object.getOwnPropertyNames||function(v){var _=[];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(_[_.length]=b);return _},m(p)};return function(p){if(p&&p.__esModule)return p;var v={};if(p!=null)for(var _=m(p),b=0;b<_.length;b++)_[b]!=="default"&&o(v,p,_[b]);return a(v,p),v}})();Object.defineProperty(r,"__esModule",{value:!0}),r.Ed25519SignatureVerifier=void 0;var c=s((w4(),Yy(q0))),l=Ft(),A=wu();async function u(m){if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle){const p=await globalThis.crypto.subtle.digest("SHA-512",m);return new Uint8Array(p)}if(typeof $c<"u")try{const{createHash:p}=eu();return p("sha512").update(m).digest()}catch{}throw new Error("No SHA-512 implementation available")}function f(m){if(typeof $c<"u")try{const{createHash:p}=eu();return p("sha512").update(m).digest()}catch{}try{const p=Q0(),v=p.lib.WordArray.create(m),_=p.SHA512(v),b=new Uint8Array(64);for(let S=0;S<16;S++){const y=_.words[S]||0;b[S*4]=y>>>24&255,b[S*4+1]=y>>>16&255,b[S*4+2]=y>>>8&255,b[S*4+3]=y&255}return b}catch{throw new Error("No SHA-512 implementation available for synchronous operation")}}c.etc.sha512Async=u;try{c.etc.sha512Sync=f}catch(m){console.debug("Could not set up synchronous SHA-512:",m)}var h=class{static async verifyAdvertisementSignature(m,p,v,_){try{const b=(0,l.hexToBytes)(m),S=(0,l.hexToBytes)(p),y=(0,l.hexToBytes)(_),x=this.constructAdvertSignedMessage(m,v,y);return await c.verify(S,x,b)}catch(b){return console.error("Ed25519 signature verification failed:",b),!1}}static constructAdvertSignedMessage(m,p,v){const _=(0,l.hexToBytes)(m),b=new Uint8Array(4);b[0]=p&255,b[1]=p>>8&255,b[2]=p>>16&255,b[3]=p>>24&255;const S=new Uint8Array(36+v.length);return S.set(_,0),S.set(b,32),S.set(v,36),S}static getSignedMessageDescription(m,p,v){return`Public Key: ${m} + Timestamp: ${p} (${new Date(p*1e3).toISOString()}) + App Data: ${v}`}static getSignedMessageHex(m,p,v){const _=(0,l.hexToBytes)(v),b=this.constructAdvertSignedMessage(m,p,_);return(0,l.bytesToHex)(b)}static async derivePublicKey(m){try{const p=(0,l.hexToBytes)(m);if(p.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${p.length}`);return await(0,A.derivePublicKey)(m)}catch(p){throw new Error(`Failed to derive public key: ${p instanceof Error?p.message:"Unknown error"}`)}}static derivePublicKeySync(m){try{const p=(0,l.hexToBytes)(m);throw p.length!==64?new Error(`Invalid private key length: expected 64 bytes, got ${p.length}`):new Error("Synchronous key derivation not supported with WASM. Use derivePublicKey() instead.")}catch(p){throw new Error(`Failed to derive public key: ${p instanceof Error?p.message:"Unknown error"}`)}}static async validateKeyPair(m,p){try{return await(0,A.validateKeyPair)(m,p)}catch{return!1}}};r.Ed25519SignatureVerifier=h}}),C4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/advert.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AdvertPayloadDecoder=void 0;var o=ur(),a=Ft(),s=Ca(),c=tp(),l=class{static decode(A,u){try{if(A.length<101){const x={type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!1,errors:["Advertisement payload too short"],publicKey:"",timestamp:0,signature:"",appData:{flags:0,deviceRole:o.DeviceRole.ChatNode,hasLocation:!1,hasName:!1}};return u!=null&&u.includeSegments&&(x.segments=[{name:"Invalid Advert Data",description:"Advert payload too short (minimum 101 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+A.length-1,value:(0,a.bytesToHex)(A)}]),x}const f=[],h=(u==null?void 0:u.segmentOffset)||0;let m=0;const p=(0,a.bytesToHex)(A.subarray(m,m+32));u!=null&&u.includeSegments&&f.push({name:"Public Key",description:"Ed25519 public key",startByte:h+m,endByte:h+m+31,value:p}),m+=32;const v=this.readUint32LE(A,m);if(u!=null&&u.includeSegments){const x=new Date(v*1e3);f.push({name:"Timestamp",description:`${v} (${x.toISOString().slice(0,19)}Z)`,startByte:h+m,endByte:h+m+3,value:(0,a.bytesToHex)(A.subarray(m,m+4))})}m+=4;const _=(0,a.bytesToHex)(A.subarray(m,m+64));u!=null&&u.includeSegments&&f.push({name:"Signature",description:"Ed25519 signature",startByte:h+m,endByte:h+m+63,value:_}),m+=64;const b=A[m];if(u!=null&&u.includeSegments){const x=b.toString(2).padStart(8,"0"),C=this.parseDeviceRole(b),T=` | Bits 0-3 (Role): ${(0,s.getDeviceRoleName)(C)} | Bit 4 (Location): ${b&o.AdvertFlags.HasLocation?"Yes":"No"} | Bit 7 (Name): ${b&o.AdvertFlags.HasName?"Yes":"No"}`;f.push({name:"App Flags",description:`Binary: ${x}${T}`,startByte:h+m,endByte:h+m,value:b.toString(16).padStart(2,"0").toUpperCase()})}m+=1;const S={type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!0,publicKey:p,timestamp:v,signature:_,appData:{flags:b,deviceRole:this.parseDeviceRole(b),hasLocation:!!(b&o.AdvertFlags.HasLocation),hasName:!!(b&o.AdvertFlags.HasName)}};let y=m;if(b&o.AdvertFlags.HasLocation&&A.length>=y+8){const x=this.readInt32LE(A,y)/1e6,C=this.readInt32LE(A,y+4)/1e6;S.appData.location={latitude:Math.round(x*1e6)/1e6,longitude:Math.round(C*1e6)/1e6},u!=null&&u.includeSegments&&(f.push({name:"Latitude",description:`${x}° (${x})`,startByte:h+y,endByte:h+y+3,value:(0,a.bytesToHex)(A.subarray(y,y+4))}),f.push({name:"Longitude",description:`${C}° (${C})`,startByte:h+y+4,endByte:h+y+7,value:(0,a.bytesToHex)(A.subarray(y+4,y+8))})),y+=8}if(b&o.AdvertFlags.HasFeature1&&(y+=2),b&o.AdvertFlags.HasFeature2&&(y+=2),b&o.AdvertFlags.HasName&&A.length>y){const x=A.subarray(y),C=new TextDecoder("utf-8").decode(x).replace(/\0.*$/,"");S.appData.name=this.sanitizeControlCharacters(C)||C,u!=null&&u.includeSegments&&f.push({name:"Node Name",description:`Node name: "${S.appData.name}"`,startByte:h+y,endByte:h+A.length-1,value:(0,a.bytesToHex)(x)})}return u!=null&&u.includeSegments&&(S.segments=f),S}catch(f){return{type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!1,errors:[f instanceof Error?f.message:"Failed to decode advertisement payload"],publicKey:"",timestamp:0,signature:"",appData:{flags:0,deviceRole:o.DeviceRole.ChatNode,hasLocation:!1,hasName:!1}}}}static async decodeWithVerification(A,u){const f=this.decode(A,u);if(!f||!f.isValid)return f;try{const m=A.subarray(100),p=(0,a.bytesToHex)(m),v=await c.Ed25519SignatureVerifier.verifyAdvertisementSignature(f.publicKey,f.signature,f.timestamp,p);f.signatureValid=v,v||(f.signatureError="Ed25519 signature verification failed",f.isValid=!1,f.errors||(f.errors=[]),f.errors.push("Invalid Ed25519 signature"))}catch(h){f.signatureValid=!1,f.signatureError=h instanceof Error?h.message:"Signature verification error",f.isValid=!1,f.errors||(f.errors=[]),f.errors.push("Signature verification failed: "+(h instanceof Error?h.message:"Unknown error"))}return f}static parseDeviceRole(A){switch(A&15){case 1:return o.DeviceRole.ChatNode;case 2:return o.DeviceRole.Repeater;case 3:return o.DeviceRole.RoomServer;case 4:return o.DeviceRole.Sensor;default:return o.DeviceRole.ChatNode}}static readUint32LE(A,u){return A[u]|A[u+1]<<8|A[u+2]<<16|A[u+3]<<24}static readInt32LE(A,u){const f=this.readUint32LE(A,u);return f>2147483647?f-4294967296:f}static sanitizeControlCharacters(A){return A&&A.trim().replace(/[\x00-\x1F\x7F]/g,"")||null}};r.AdvertPayloadDecoder=l}}),k4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/trace.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TracePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l,A){try{if(c.length<9){const C={type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!1,errors:["Trace payload too short (need at least tag(4) + auth(4) + flags(1))"],traceTag:"00000000",authCode:0,flags:0,pathHashes:[]};return A!=null&&A.includeSegments&&(C.segments=[{name:"Invalid Trace Data",description:"Trace payload too short (minimum 9 bytes required)",startByte:A.segmentOffset||0,endByte:(A.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),C}let u=0;const f=[],h=(A==null?void 0:A.segmentOffset)||0,m=this.readUint32LE(c,u),p=(0,a.numberToHex)(m,8);A!=null&&A.includeSegments&&f.push({name:"Trace Tag",description:`Unique identifier for this trace: 0x${m.toString(16).padStart(8,"0")}`,startByte:h+u,endByte:h+u+3,value:(0,a.bytesToHex)(c.slice(u,u+4))}),u+=4;const v=this.readUint32LE(c,u);A!=null&&A.includeSegments&&f.push({name:"Auth Code",description:`Authentication/verification code: ${v}`,startByte:h+u,endByte:h+u+3,value:(0,a.bytesToHex)(c.slice(u,u+4))}),u+=4;const _=c[u];A!=null&&A.includeSegments&&f.push({name:"Flags",description:`Application-defined control flags: 0x${_.toString(16).padStart(2,"0")} (${_.toString(2).padStart(8,"0")}b)`,startByte:h+u,endByte:h+u,value:_.toString(16).padStart(2,"0").toUpperCase()}),u+=1;const b=[],S=u;for(;u0){const C=b.join(" ");f.push({name:"Path Hashes",description:`Node hashes in trace path: ${C}`,startByte:h+S,endByte:h+c.length-1,value:(0,a.bytesToHex)(c.slice(S))})}let y;l&&l.length>0&&(y=l.map(C=>{const w=parseInt(C,16);return(w>127?w-256:w)/4}));const x={type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!0,traceTag:p,authCode:v,flags:_,pathHashes:b,snrValues:y};return A!=null&&A.includeSegments&&(x.segments=f),x}catch(u){return{type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode trace payload"],traceTag:"00000000",authCode:0,flags:0,pathHashes:[]}}}static readUint32LE(c,l){return c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24}};r.TracePayloadDecoder=s}}),S4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/group-text.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.GroupTextPayloadDecoder=void 0;var o=ur(),a=xu(),s=Ft(),c=class{static decode(l,A){try{if(l.length<3){const b={type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!1,errors:["GroupText payload too short (need at least channel_hash(1) + MAC(2))"],channelHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return A!=null&&A.includeSegments&&(b.segments=[{name:"Invalid GroupText Data",description:"GroupText payload too short (minimum 3 bytes required)",startByte:A.segmentOffset||0,endByte:(A.segmentOffset||0)+l.length-1,value:(0,s.bytesToHex)(l)}]),b}const u=[],f=(A==null?void 0:A.segmentOffset)||0;let h=0;const m=(0,s.byteToHex)(l[h]);A!=null&&A.includeSegments&&u.push({name:"Channel Hash",description:"First byte of SHA256 of channel's shared key",startByte:f+h,endByte:f+h,value:m}),h+=1;const p=(0,s.bytesToHex)(l.subarray(h,h+2));A!=null&&A.includeSegments&&u.push({name:"Cipher MAC",description:"MAC for encrypted data",startByte:f+h,endByte:f+h+1,value:p}),h+=2;const v=(0,s.bytesToHex)(l.subarray(h));A!=null&&A.includeSegments&&l.length>h&&u.push({name:"Ciphertext",description:"Encrypted message content (timestamp + flags + message)",startByte:f+h,endByte:f+l.length-1,value:v});const _={type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!0,channelHash:m,cipherMac:p,ciphertext:v,ciphertextLength:l.length-3};if(A!=null&&A.keyStore&&A.keyStore.hasChannelKey(m)){const b=A.keyStore.getChannelKeys(m);for(const S of b){const y=a.ChannelCrypto.decryptGroupTextMessage(v,p,S);if(y.success&&y.data){_.decrypted={timestamp:y.data.timestamp,flags:y.data.flags,sender:y.data.sender,message:y.data.message};break}}}return A!=null&&A.includeSegments&&(_.segments=u),_}catch(u){return{type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode GroupText payload"],channelHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.GroupTextPayloadDecoder=c}}),E4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.RequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:["Request payload too short (minimum 4 bytes: dest hash + source hash + MAC)"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Request Data",description:"Request payload too short (minimum 4 bytes required: 1 for dest hash + 1 for source hash + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.bytesToHex)(c.subarray(f,f+1));l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+1));l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:`First byte of source node public key: 0x${m}`,startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:`Encrypted message data (${c.length-f} bytes). Contains encrypted plaintext with this structure: +• Timestamp (4 bytes) - send time as unix timestamp +• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.) +• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),R4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),T4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<35){const b={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:m}),f+=32;const p=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&A.push({name:"Ciphertext",description:`Encrypted message data (${c.length-35} bytes). Contains encrypted plaintext with this structure: +• Timestamp (4 bytes) - send time as unix timestamp +• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp +• Password (remaining bytes) - password for repeater/room`,startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),B4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const m={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(m.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),m}const A=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=A),h}catch(A){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),P4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let h=0;h1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),N4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode TextMessage payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.TextMessagePayloadDecoder=s}}),D4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/control.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ControlPayloadDecoder=void 0;var o=ur(),a=Ft(),s=Ca(),c=class{static decode(l,A){try{if(l.length<1)return this.createErrorPayload("Control payload too short (minimum 1 byte required)",l,A);const f=l[0]&240;switch(f){case o.ControlSubType.NodeDiscoverReq:return this.decodeDiscoverReq(l,A);case o.ControlSubType.NodeDiscoverResp:return this.decodeDiscoverResp(l,A);default:return this.createErrorPayload(`Unknown control sub-type: 0x${f.toString(16).padStart(2,"0")}`,l,A)}}catch(u){return this.createErrorPayload(u instanceof Error?u.message:"Failed to decode control payload",l,A)}}static decodeDiscoverReq(l,A){const u=[],f=(A==null?void 0:A.segmentOffset)??0;if(l.length<6){const x={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!1,errors:["DISCOVER_REQ payload too short (minimum 6 bytes required)"],subType:o.ControlSubType.NodeDiscoverReq,rawFlags:l[0],prefixOnly:!1,typeFilter:0,typeFilterNames:[],tag:0,since:0};return A!=null&&A.includeSegments&&(x.segments=[{name:"Invalid DISCOVER_REQ Data",description:"DISCOVER_REQ payload too short (minimum 6 bytes required)",startByte:f,endByte:f+l.length-1,value:(0,a.bytesToHex)(l)}]),x}let h=0;const m=l[h],p=(m&1)!==0;A!=null&&A.includeSegments&&u.push({name:"Flags",description:`Sub-type: DISCOVER_REQ (0x8) | Prefix Only: ${p}`,startByte:f+h,endByte:f+h,value:m.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const v=l[h],_=this.parseTypeFilter(v);A!=null&&A.includeSegments&&u.push({name:"Type Filter",description:`Filter mask: 0b${v.toString(2).padStart(8,"0")} | Types: ${_.length>0?_.join(", "):"None"}`,startByte:f+h,endByte:f+h,value:v.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const b=this.readUint32LE(l,h);A!=null&&A.includeSegments&&u.push({name:"Tag",description:`Random tag for response matching: 0x${b.toString(16).padStart(8,"0")}`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))}),h+=4;let S=0;if(l.length>=h+4&&(S=this.readUint32LE(l,h),A!=null&&A.includeSegments)){const x=S>0?new Date(S*1e3).toISOString().slice(0,19)+"Z":"N/A";u.push({name:"Since",description:`Filter timestamp: ${S} (${x})`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))})}const y={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!0,subType:o.ControlSubType.NodeDiscoverReq,rawFlags:m,prefixOnly:p,typeFilter:v,typeFilterNames:_,tag:b,since:S};return A!=null&&A.includeSegments&&(y.segments=u),y}static decodeDiscoverResp(l,A){const u=[],f=(A==null?void 0:A.segmentOffset)??0;if(l.length<14){const D={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!1,errors:["DISCOVER_RESP payload too short (minimum 14 bytes required)"],subType:o.ControlSubType.NodeDiscoverResp,rawFlags:l.length>0?l[0]:0,nodeType:o.DeviceRole.Unknown,nodeTypeName:"Unknown",snr:0,tag:0,publicKey:"",publicKeyLength:0};return A!=null&&A.includeSegments&&(D.segments=[{name:"Invalid DISCOVER_RESP Data",description:"DISCOVER_RESP payload too short (minimum 14 bytes required)",startByte:f,endByte:f+l.length-1,value:(0,a.bytesToHex)(l)}]),D}let h=0;const m=l[h],p=m&15,v=(0,s.getDeviceRoleName)(p);A!=null&&A.includeSegments&&u.push({name:"Flags",description:`Sub-type: DISCOVER_RESP (0x9) | Node Type: ${v}`,startByte:f+h,endByte:f+h,value:m.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const _=l[h],b=_>127?_-256:_,S=b/4;A!=null&&A.includeSegments&&u.push({name:"SNR",description:`Inbound SNR: ${S.toFixed(2)} dB (raw: ${_}, signed: ${b})`,startByte:f+h,endByte:f+h,value:_.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const y=this.readUint32LE(l,h);A!=null&&A.includeSegments&&u.push({name:"Tag",description:`Reflected tag from request: 0x${y.toString(16).padStart(8,"0")}`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))}),h+=4;const C=l.length-h,w=l.slice(h,h+C),T=(0,a.bytesToHex)(w);if(A!=null&&A.includeSegments){const D=C===32?"Full Public Key":"Public Key Prefix";u.push({name:D,description:`${D} (${C} bytes)`,startByte:f+h,endByte:f+h+C-1,value:T})}const R={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!0,subType:o.ControlSubType.NodeDiscoverResp,rawFlags:m,nodeType:p,nodeTypeName:v,snr:S,tag:y,publicKey:T,publicKeyLength:C};return A!=null&&A.includeSegments&&(R.segments=u),R}static parseTypeFilter(l){const A=[];return l&1<0?A[0]:0,prefixOnly:!1,typeFilter:0,typeFilterNames:[],tag:0,since:0};return u!=null&&u.includeSegments&&(f.segments=[{name:"Invalid Control Data",description:l,startByte:u.segmentOffset??0,endByte:(u.segmentOffset??0)+A.length-1,value:(0,a.bytesToHex)(A)}]),f}static readUint32LE(l,A){return(l[A]|l[A+1]<<8|l[A+2]<<16|l[A+3]<<24)>>>0}};r.ControlPayloadDecoder=c}}),Kh=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/packet-decoder.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.MeshCorePacketDecoder=void 0;var o=ur(),a=Ft(),s=Ca(),c=G0(),l=C4(),A=k4(),u=S4(),f=E4(),h=R4(),m=T4(),p=B4(),v=P4(),_=N4(),b=D4(),S=class{static decode(y,x){return this.parseInternal(y,!1,x).packet}static async decodeWithVerification(y,x){return(await this.parseInternalAsync(y,!1,x)).packet}static analyzeStructure(y,x){return this.parseInternal(y,!0,x).structure}static async analyzeStructureWithVerification(y,x){return(await this.parseInternalAsync(y,!0,x)).structure}static parseInternal(y,x,C){const w=(0,a.hexToBytes)(y),T=[];if(w.length<2){const R={messageHash:"",routeType:o.RouteType.Flood,payloadType:o.PayloadType.RawCustom,payloadVersion:o.PayloadVersion.Version1,pathLength:0,path:null,payload:{raw:"",decoded:null},totalBytes:w.length,isValid:!1,errors:["Packet too short (minimum 2 bytes required)"]},D={segments:[],totalBytes:w.length,rawHex:y.toUpperCase(),messageHash:"",payload:{segments:[],hex:"",startByte:0,type:"Unknown"}};return{packet:R,structure:D}}try{let R=0;const D=w[0],N=D&3,I=D>>2&15,F=D>>6&3;x&&T.push({name:"Header",description:"Header byte breakdown",startByte:0,endByte:0,value:`0x${D.toString(16).padStart(2,"0")}`,headerBreakdown:{fullBinary:D.toString(2).padStart(8,"0"),fields:[{bits:"0-1",field:"Route Type",value:(0,s.getRouteTypeName)(N),binary:(D&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:(0,s.getPayloadTypeName)(I),binary:(D>>2&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:F.toString(),binary:(D>>6&3).toString(2).padStart(2,"0")}]}}),R=1;let j;if(N===o.RouteType.TransportFlood||N===o.RouteType.TransportDirect){if(w.length0?Array.from(G).map(a.byteToHex):null;if(x&&L>0)if(I===o.PayloadType.Trace){const k=[];for(let O=0;O127?z-256:z)/4;k.push(`${re.toFixed(2)}dB (0x${z.toString(16).padStart(2,"0")})`)}T.push({name:"Path SNR Data",description:`SNR values collected during trace: ${k.join(", ")}`,startByte:R,endByte:R+L-1,value:(0,a.bytesToHex)(w.slice(R,R+L))})}else{let k="Routing path information";N===o.RouteType.Direct||N===o.RouteType.TransportDirect?k="Routing instructions (bytes are stripped at each hop as packet travels to destination)":(N===o.RouteType.Flood||N===o.RouteType.TransportFlood)&&(k="Historical route taken (bytes are added as packet floods through network)"),T.push({name:"Path Data",description:k,startByte:R,endByte:R+L-1,value:(0,a.bytesToHex)(w.slice(R,R+L))})}R+=L;const ee=w.subarray(R),se=(0,a.bytesToHex)(ee);x&&w.length>R&&T.push({name:"Payload",description:`${(0,s.getPayloadTypeName)(I)} payload data`,startByte:R,endByte:w.length-1,value:(0,a.bytesToHex)(w.slice(R))});let J=null;const ne=[];if(I===o.PayloadType.Advert){const k=l.AdvertPayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Trace){const k=A.TracePayloadDecoder.decode(ee,K,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.GroupText){const k=u.GroupTextPayloadDecoder.decode(ee,{...C,includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Request){const k=f.RequestPayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Response){const k=h.ResponsePayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.AnonRequest){const k=m.AnonRequestPayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Ack){const k=p.AckPayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Path)J=v.PathPayloadDecoder.decode(ee);else if(I===o.PayloadType.TextMessage){const k=_.TextMessagePayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}else if(I===o.PayloadType.Control){const k=b.ControlPayloadDecoder.decode(ee,{includeSegments:x,segmentOffset:0});J=k,k!=null&&k.segments&&(ne.push(...k.segments),delete k.segments)}x&&ne.length===0&&w.length>R&&ne.push({name:`${(0,s.getPayloadTypeName)(I)} Payload`,description:`Raw ${(0,s.getPayloadTypeName)(I)} payload data (${ee.length} bytes)`,startByte:0,endByte:ee.length-1,value:(0,a.bytesToHex)(ee)});const W=this.calculateMessageHash(w,N,I,F),X={messageHash:W,routeType:N,payloadType:I,payloadVersion:F,transportCodes:j,pathLength:L,path:K,payload:{raw:se,decoded:J},totalBytes:w.length,isValid:!0},Z={segments:T,totalBytes:w.length,rawHex:y.toUpperCase(),messageHash:W,payload:{segments:ne,hex:se,startByte:R,type:(0,s.getPayloadTypeName)(I)}};return{packet:X,structure:Z}}catch(R){const D={messageHash:"",routeType:o.RouteType.Flood,payloadType:o.PayloadType.RawCustom,payloadVersion:o.PayloadVersion.Version1,pathLength:0,path:null,payload:{raw:"",decoded:null},totalBytes:w.length,isValid:!1,errors:[R instanceof Error?R.message:"Unknown decoding error"]},N={segments:[],totalBytes:w.length,rawHex:y.toUpperCase(),messageHash:"",payload:{segments:[],hex:"",startByte:0,type:"Unknown"}};return{packet:D,structure:N}}}static async parseInternalAsync(y,x,C){const w=this.parseInternal(y,x,C);if(w.packet.payloadType===o.PayloadType.Advert&&w.packet.payload.decoded)try{const T=w.packet.payload.decoded,R=await l.AdvertPayloadDecoder.decodeWithVerification((0,a.hexToBytes)(w.packet.payload.raw),{includeSegments:x,segmentOffset:0});R&&(w.packet.payload.decoded=R,R.isValid||(w.packet.isValid=!1,w.packet.errors=R.errors||["Invalid advertisement signature"]),x&&R.segments&&(w.structure.payload.segments=R.segments,delete R.segments))}catch(T){console.error("Signature verification failed:",T)}return w}static validate(y){const x=(0,a.hexToBytes)(y),C=[];if(x.length<2)return C.push("Packet too short (minimum 2 bytes required)"),{isValid:!1,errors:C};try{let w=1;const R=x[0]&3;if((R===o.RouteType.TransportFlood||R===o.RouteType.TransportDirect)&&(x.length=x.length&&C.push("No payload data found")}catch(w){C.push(w instanceof Error?w.message:"Validation error")}return{isValid:C.length===0,errors:C.length>0?C:void 0}}static calculateMessageHash(y,x,C,w){if(C===o.PayloadType.Trace&&y.length>=13){let F=1;if((x===o.RouteType.TransportFlood||x===o.RouteType.TransportDirect)&&(F+=4),y.length>F){const j=y[F];F+=1+j}if(y.length>=F+4){const j=y[F]|y[F+1]<<8|y[F+2]<<16|y[F+3]<<24;return(0,a.numberToHex)(j,8)}}const T=C<<2|w<<6;let R=1;if((x===o.RouteType.TransportFlood||x===o.RouteType.TransportDirect)&&(R+=4),y.length>R){const F=y[R];R+=1+F}const D=y.slice(R),N=[T,...Array.from(D)];let I=0;for(let F=0;FT.exp)return null;const R=`${v}.${_}`,D=new TextEncoder().encode(R),N=(0,a.bytesToHex)(D);return await(0,o.verify)(b,N,T.publicKey)?T:null}catch{return null}}function u(h){try{const m=h.split(".");return m.length!==3?null:{header:m[0],payload:m[1],signature:m[2]}}catch{return null}}function f(h){try{const m=h.split(".");if(m.length!==3)return null;const p=c(m[1]),v=new TextDecoder().decode(p);return JSON.parse(v)}catch{return null}}}}),I4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/index.js"(r){var o=r&&r.__createBinding||(Object.create?function(x,C,w,T){T===void 0&&(T=w);var R=Object.getOwnPropertyDescriptor(C,w);(!R||("get"in R?!C.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return C[w]}}),Object.defineProperty(x,T,R)}:function(x,C,w,T){T===void 0&&(T=w),x[T]=C[w]}),a=r&&r.__setModuleDefault||(Object.create?function(x,C){Object.defineProperty(x,"default",{enumerable:!0,value:C})}:function(x,C){x.default=C}),s=r&&r.__importStar||(function(){var x=function(C){return x=Object.getOwnPropertyNames||function(w){var T=[];for(var R in w)Object.prototype.hasOwnProperty.call(w,R)&&(T[T.length]=R);return T},x(C)};return function(C){if(C&&C.__esModule)return C;var w={};if(C!=null)for(var T=x(C),R=0;R2?o+a:1;return Hn*s*Hn}function H4(r,o){const s=Math.floor(Date.now()/1e3);return r<=s&&r>=s-2592e3}function z4(r){return!r.includes("�")}var ap=class sp{constructor(){this.device=null,this.pipeline=null,this.bindGroupLayout=null,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.shaderCode=` +// SHA256 round constants +const K: array = array( + 0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u, + 0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u, + 0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau, + 0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u, + 0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u, + 0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u, + 0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u, + 0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u +); + +// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36) +const CHARS: array = array( + 0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j + 0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t + 0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z + 0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9 + 0x2du // dash +); + +struct Params { + target_channel_hash: u32, + batch_offset: u32, + name_length: u32, + batch_size: u32, + target_mac: u32, // First 2 bytes of target MAC (in high 16 bits) + ciphertext_words: u32, // Number of 32-bit words in ciphertext + ciphertext_len_bits: u32, // Length of ciphertext in bits + verify_mac: u32, // 1 to verify MAC, 0 to skip +} + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var match_count: atomic; +@group(0) @binding(2) var match_indices: array; +@group(0) @binding(3) var ciphertext: array; // Ciphertext data + +fn rotr(x: u32, n: u32) -> u32 { + return (x >> n) | (x << (32u - n)); +} + +fn ch(x: u32, y: u32, z: u32) -> u32 { + return (x & y) ^ (~x & z); +} + +fn maj(x: u32, y: u32, z: u32) -> u32 { + return (x & y) ^ (x & z) ^ (y & z); +} + +fn sigma0(x: u32) -> u32 { + return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u); +} + +fn sigma1(x: u32) -> u32 { + return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u); +} + +fn gamma0(x: u32) -> u32 { + return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u); +} + +fn gamma1(x: u32) -> u32 { + return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u); +} + +// Convert index to room name bytes, returns the hash as a u32 for the first byte check +fn index_to_room_name(idx: u32, length: u32, msg: ptr>) -> bool { + // Message starts with '#' (0x23) + var byte_pos = 0u; + var word_idx = 0u; + var current_word = 0x23000000u; // '#' in big-endian position 0 + byte_pos = 1u; + + var remaining = idx; + var prev_was_dash = false; + + // Generate room name from index + for (var i = 0u; i < length; i++) { + let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end + var char_idx = remaining % char_count; + remaining = remaining / char_count; + + // Check for consecutive dashes (invalid) + let is_dash = char_idx == 36u && i > 0u && i < length - 1u; + if (is_dash && prev_was_dash) { + return false; // Invalid: consecutive dashes + } + prev_was_dash = is_dash; + + // Map char index to actual character + let c = CHARS[char_idx]; + + // Pack byte into current word (big-endian) + let shift = (3u - byte_pos % 4u) * 8u; + if (byte_pos % 4u == 0u && byte_pos > 0u) { + (*msg)[word_idx] = current_word; + word_idx = word_idx + 1u; + current_word = 0u; + } + current_word = current_word | (c << shift); + byte_pos = byte_pos + 1u; + } + + // Add padding: 0x80 followed by zeros, then length in bits + let msg_len_bits = (length + 1u) * 8u; // +1 for '#' + + // Add 0x80 padding byte + let shift = (3u - byte_pos % 4u) * 8u; + if (byte_pos % 4u == 0u) { + (*msg)[word_idx] = current_word; + word_idx = word_idx + 1u; + current_word = 0x80000000u; + } else { + current_word = current_word | (0x80u << shift); + } + byte_pos = byte_pos + 1u; + + // Store current word + if (byte_pos % 4u == 0u || word_idx < 14u) { + (*msg)[word_idx] = current_word; + word_idx = word_idx + 1u; + } + + // Zero-fill until word 14 + for (var i = word_idx; i < 14u; i++) { + (*msg)[i] = 0u; + } + + // Length in bits (64-bit, but we only use lower 32 bits for short messages) + (*msg)[14u] = 0u; + (*msg)[15u] = msg_len_bits; + + return true; +} + +fn sha256_block(msg: ptr>) -> array { + // Initialize hash values + var h: array = array( + 0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au, + 0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u + ); + + // Message schedule + var w: array; + for (var i = 0u; i < 16u; i++) { + w[i] = (*msg)[i]; + } + for (var i = 16u; i < 64u; i++) { + w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u]; + } + + // Compression + var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3]; + var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7]; + + for (var i = 0u; i < 64u; i++) { + let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i]; + let t2 = sigma0(a) + maj(a, b, c); + hh = g; g = f; f = e; e = d + t1; + d = c; c = b; b = a; a = t1 + t2; + } + + h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d; + h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh; + + return h; +} + +// Compute SHA256 of the key (16 bytes) to get channel hash +fn sha256_key(key: array) -> u32 { + var msg: array; + + // Key bytes (16 bytes = 4 words) + msg[0] = key[0]; + msg[1] = key[1]; + msg[2] = key[2]; + msg[3] = key[3]; + + // Padding: 0x80 followed by zeros + msg[4] = 0x80000000u; + for (var i = 5u; i < 14u; i++) { + msg[i] = 0u; + } + + // Length: 128 bits + msg[14] = 0u; + msg[15] = 128u; + + let hash = sha256_block(&msg); + + // Return first byte of hash (big-endian) + return hash[0] >> 24u; +} + +// HMAC-SHA256 for MAC verification +// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore +// Returns first 2 bytes of HMAC (as u32 in high 16 bits) +fn hmac_sha256_mac(key: array, ciphertext_len: u32) -> u32 { + // HMAC: H((K' ^ opad) || H((K' ^ ipad) || message)) + // K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64) + // ipad = 0x36 repeated, opad = 0x5c repeated + + // Build padded key (64 bytes = 16 words) + // MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes + var k_pad: array; + k_pad[0] = key[0]; + k_pad[1] = key[1]; + k_pad[2] = key[2]; + k_pad[3] = key[3]; + for (var i = 4u; i < 16u; i++) { + k_pad[i] = 0u; + } + + // Inner hash: SHA256((K' ^ ipad) || message) + // First block: K' ^ ipad (64 bytes) + var inner_block: array; + for (var i = 0u; i < 16u; i++) { + inner_block[i] = k_pad[i] ^ 0x36363636u; + } + + // Initialize hash state with first block + var h: array = sha256_block(&inner_block); + + // Process ciphertext blocks (continuing from h state) + let ciphertext_words = params.ciphertext_words; + var word_idx = 0u; + + // Process full 64-byte blocks of ciphertext + while (word_idx + 16u <= ciphertext_words) { + var block: array; + for (var i = 0u; i < 16u; i++) { + block[i] = ciphertext[word_idx + i]; + } + h = sha256_block_continue(&block, h); + word_idx = word_idx + 16u; + } + + // Final block with remaining ciphertext + padding + var final_block: array; + var remaining = ciphertext_words - word_idx; + for (var i = 0u; i < 16u; i++) { + if (i < remaining) { + final_block[i] = ciphertext[word_idx + i]; + } else if (i == remaining) { + // Add 0x80 padding + final_block[i] = 0x80000000u; + } else { + final_block[i] = 0u; + } + } + + // Add length (64 bytes of ipad + ciphertext length) + let total_bits = 512u + params.ciphertext_len_bits; + if (remaining < 14u) { + final_block[14] = 0u; + final_block[15] = total_bits; + h = sha256_block_continue(&final_block, h); + } else { + // Need extra block for length + h = sha256_block_continue(&final_block, h); + var len_block: array; + for (var i = 0u; i < 14u; i++) { + len_block[i] = 0u; + } + len_block[14] = 0u; + len_block[15] = total_bits; + h = sha256_block_continue(&len_block, h); + } + + let inner_hash = h; + + // Outer hash: SHA256((K' ^ opad) || inner_hash) + var outer_block: array; + for (var i = 0u; i < 16u; i++) { + outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu; + } + h = sha256_block(&outer_block); + + // Second block: inner_hash (32 bytes) + padding + var hash_block: array; + for (var i = 0u; i < 8u; i++) { + hash_block[i] = inner_hash[i]; + } + hash_block[8] = 0x80000000u; + for (var i = 9u; i < 14u; i++) { + hash_block[i] = 0u; + } + hash_block[14] = 0u; + hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash + + h = sha256_block_continue(&hash_block, h); + + // Return first 2 bytes (high 16 bits of first word) + return h[0] & 0xFFFF0000u; +} + +// SHA256 block computation continuing from existing state +fn sha256_block_continue(msg: ptr>, h_in: array) -> array { + var h = h_in; + + // Message schedule + var w: array; + for (var i = 0u; i < 16u; i++) { + w[i] = (*msg)[i]; + } + for (var i = 16u; i < 64u; i++) { + w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u]; + } + + // Compression + var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3]; + var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7]; + + for (var i = 0u; i < 64u; i++) { + let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i]; + let t2 = sigma0(a) + maj(a, b, c); + hh = g; g = f; f = e; e = d + t1; + d = c; c = b; b = a; a = t1 + t2; + } + + h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d; + h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh; + + return h; +} + +// Process a single candidate and record match if found +fn process_candidate(name_idx: u32) { + // Generate message for this room name + var msg: array; + let valid = index_to_room_name(name_idx, params.name_length, &msg); + + if (!valid) { + return; + } + + // Compute SHA256("#roomname") - this gives us the key + let key_hash = sha256_block(&msg); + + // Take first 16 bytes (4 words) as the key + var key: array; + key[0] = key_hash[0]; + key[1] = key_hash[1]; + key[2] = key_hash[2]; + key[3] = key_hash[3]; + + // Compute SHA256(key) to get channel hash + let channel_hash = sha256_key(key); + + // Check if channel hash matches target + if (channel_hash != params.target_channel_hash) { + return; + } + + // Channel hash matches - verify MAC if enabled + if (params.verify_mac == 1u) { + let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits); + if (computed_mac != params.target_mac) { + return; + } + } + + // Found a match - record the index + let match_idx = atomicAdd(&match_count, 1u); + if (match_idx < 1024u) { // Limit stored matches + match_indices[match_idx] = name_idx; + } +} + +// Each thread processes 16 candidates to amortize thread overhead +const CANDIDATES_PER_THREAD: u32 = 16u; + +@compute @workgroup_size(256) +fn main(@builtin(global_invocation_id) global_id: vec3) { + let base_idx = global_id.x * CANDIDATES_PER_THREAD; + + for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) { + let idx = base_idx + i; + if (idx >= params.batch_size) { + return; + } + let name_idx = params.batch_offset + idx; + process_candidate(name_idx); + } +} +`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return bo(a,o)}countNamesForLength(o){return xa(o)}async runBatch(o,a,s,c,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],m=l&&A?1:0;let p,v=0,_=0;if(m){const R=new Uint8Array(l.length/2);for(let j=0;j0){await h.mapAsync(GPUMapMode.READ);const R=new Uint32Array(h.getMappedRange());for(let D=0;D1&&!Q4.test(r)||G4.test(r))}var q4=class{constructor(){this.gpuInstance=null,this.wordlist=[],this.abortFlag=!1,this.useTimestampFilter=!0,this.useUtf8Filter=!0}async loadWordlist(r){const o=await fetch(r);if(!o.ok)throw new Error(`Failed to load wordlist: ${o.status} ${o.statusText}`);const s=(await o.text()).split(` +`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter($h)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter($h)}abort(){this.abortFlag=!0}isGpuAvailable(){return U4()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await Zh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:A,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new V4,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let m=0,p=performance.now(),v=1,_=0;if(o!=null&&o.startFrom){const D=F4(o.startFrom);D&&(v=D.length,_=D.index+1,_>=xa(v)&&(v++,_=0))}let b=0;for(let D=v;D<=s;D++)b+=xa(D);b-=_;const S=(D,N,I)=>{if(!a)return;const j=(performance.now()-h)/1e3,L=j>0?Math.round(m/j):0,G=b-m,K=L>0?G/L:0;a({checked:m,total:b,percent:b>0?Math.min(100,m/b*100):0,rateKeysPerSec:L,etaSeconds:K,elapsedSeconds:j,currentLength:N,currentPosition:I,phase:D})},y=D=>{if(!L4(A,u,D))return{valid:!1};const N=Zh.ChannelCrypto.decryptGroupTextMessage(A,u,D);return!N.success||!N.data?{valid:!1}:this.useTimestampFilter&&!H4(N.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!z4(N.data.message)?{valid:!1}:{valid:!0,message:N.data.message}};if(v===1&&_===0){S("public-key",0,ru);const D=Jh(li);if(l===D){const N=y(li);if(N.valid)return{found:!0,roomName:ru,key:li,decryptedMessage:N.message}}}if(this.wordlist.length>0&&v===1&&_===0)for(let D=0;D=200&&(S("wordlist",N.length,N),p=j,await new Promise(L=>setTimeout(L,0)))}const x=32768,C=1e3;let w=x,T=!1;for(let D=v;D<=s;D++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(D,0)||void 0};const N=xa(D);let I=D===v?_:0;for(;I=x&&G>0){const ee=C/G,se=Math.round(F*ee),J=Math.pow(2,Math.round(Math.log2(Math.max(x,se))));w=Math.max(x,J),T=!0}for(const ee of L){const se=bo(D,ee);if(!se)continue;const J=Xh("#"+se),ne=y(J);if(ne.valid)return{found:!0,roomName:se,key:J,decryptedMessage:ne.message}}I+=F;const K=performance.now();if(K-p>=200){const ee=bo(D,Math.min(I,N-1))||"";S("bruteforce",D,ee),p=K,await new Promise(se=>setTimeout(se,0))}}}return{found:!1,resumeFrom:bo(s,xa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information: + +crypto-js/ripemd160.js: + (** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *) + +crypto-js/mode-ctr-gladman.js: + (** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + *) + +@noble/ed25519/index.js: + (*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *) +*/var Uc,eA;function K4(){return eA||(eA=1,Uc={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}),Uc}var Wc,tA;function Y4(){if(tA)return Wc;tA=1;const{webm:r,mp4:o}=K4(),a=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,s=()=>"wakeLock"in navigator;class c{constructor(){if(this.enabled=!1,s()){this._wakeLock=null;const A=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",A),document.addEventListener("fullscreenchange",A)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",o),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(A,u,f){var h=document.createElement("source");h.src=f,h.type=`video/${u}`,A.appendChild(h)}get isEnabled(){return this.enabled}enable(){return s()?navigator.wakeLock.request("screen").then(A=>{this._wakeLock=A,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(A=>{throw this.enabled=!1,console.error(`${A.name}, ${A.message}`),A}):a()?(this.disable(),console.warn(` + NoSleep enabled for older iOS devices. This can interrupt + active or long-running network requests from completing successfully. + See https://github.com/richtr/NoSleep.js/issues/15 for more details. + `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(u=>(this.enabled=!0,u)).catch(u=>{throw this.enabled=!1,u})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` + NoSleep now disabled for older iOS devices. + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return Wc=c,Wc}var Z4=Y4();const X4=nu(Z4);function J4({packets:r,channels:o,onChannelCreate:a}){const[s,c]=B.useState(!1),[l,A]=B.useState(6),[u,f]=B.useState(!1),[h,m]=B.useState(null),[p,v]=B.useState(new Map),[_,b]=B.useState([]),[S,y]=B.useState(!1),[x,C]=B.useState(null),w=B.useRef(null),T=B.useRef(null),R=B.useRef(!1),D=B.useRef(!1),N=B.useRef(!1),I=B.useRef(new Map),F=B.useRef(!1),j=B.useRef(6);B.useEffect(()=>{const X=new q4;w.current=X,C(X.isGpuAvailable());const Z=new X4;return T.current=Z,X.loadWordlist("/words_alpha.txt").then(()=>y(!0)).catch(k=>console.error("Failed to load wordlist:",k)),()=>{X.destroy(),w.current=null,Z.disable(),T.current=null}},[]);const L=new Set(o.map(X=>X.key.toUpperCase())),G=r.filter(X=>X.payload_type==="GROUP_TEXT"&&!X.decrypted);B.useEffect(()=>{v(X=>{const Z=new Map(X);let k=!1;for(const O of G)Z.has(O.id)||(Z.set(O.id,{packet:O,attempts:0,lastAttemptLength:0,status:"pending"}),k=!0);return k?(I.current=Z,Z):X})},[G.length]),B.useEffect(()=>{I.current=p},[p]),B.useEffect(()=>{F.current=u},[u]),B.useEffect(()=>{j.current=l},[l]);const K=Array.from(p.values()).filter(X=>X.status==="pending").length,ee=Array.from(p.values()).filter(X=>X.status==="cracked").length,se=Array.from(p.values()).filter(X=>X.status==="failed").length,J=B.useCallback(async()=>{if(N.current||!w.current||!R.current)return;const X=I.current;let Z=null,k=null;for(const[V,re]of X.entries())if(re.status==="pending"){Z=re,k=V;break}if(!Z&&F.current){const V=Array.from(X.entries()).filter(([,re])=>re.status==="failed"&&re.lastAttemptLength<10);V.length>0&&(V.sort((re,ue)=>re[1].lastAttemptLength-ue[1].lastAttemptLength),[k,Z]=V[0])}if(!Z||k===null){R.current&&setTimeout(()=>J(),1e3);return}N.current=!0;const O=j.current,z=Z.lastAttemptLength>0?Z.lastAttemptLength+1:O;try{const V=await w.current.crack(Z.packet.data,{maxLength:z,useTimestampFilter:!0,useUtf8Filter:!0},re=>{m(re)});if(D.current){D.current=!1,N.current=!1,m(null);return}if(V.found&&V.roomName&&V.key){v(de=>{const oe=new Map(de),Be=oe.get(k);return Be&&oe.set(k,{...Be,status:"cracked",attempts:Be.attempts+1,lastAttemptLength:z}),oe});const re={roomName:V.roomName,key:V.key,packetId:k,message:V.decryptedMessage||"",crackedAt:Date.now()};b(de=>[...de,re]);const ue=V.key.toUpperCase();if(!L.has(ue))try{await a("#"+V.roomName,V.key)}catch(de){console.error("Failed to create channel:",de)}}else v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}catch(V){console.error("Cracking error:",V),v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}N.current=!1,m(null),R.current&&setTimeout(()=>J(),100)},[L,a]),ne=()=>{var X;if(!x){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}c(!0),R.current=!0,D.current=!1,(X=T.current)==null||X.enable(),J()},W=()=>{var X,Z;c(!1),R.current=!1,D.current=!0,(X=w.current)==null||X.abort(),(Z=T.current)==null||Z.disable()};return P.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[P.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[P.jsx("button",{onClick:s?W:ne,disabled:!S||x===!1,className:Ze("px-4 py-1.5 rounded text-sm font-medium",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:s?"Stop":"Start Cracking"}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),P.jsx("input",{type:"number",min:1,max:10,value:l,onChange:X=>A(Math.min(10,Math.max(1,parseInt(X.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),P.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[P.jsx("input",{type:"checkbox",checked:u,onChange:X=>f(X.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),P.jsxs("div",{className:"flex gap-4 text-sm",children:[P.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",P.jsx("span",{className:"text-foreground font-medium",children:K})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",P.jsx("span",{className:"text-green-500 font-medium",children:ee})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",P.jsx("span",{className:"text-destructive font-medium",children:se})]})]}),h&&P.jsxs("div",{className:"space-y-1",children:[P.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[P.jsxs("span",{children:[h.phase==="wordlist"?"Dictionary":h.phase==="bruteforce"?"Bruteforce":"Public Key",h.phase==="bruteforce"&&` - Length ${h.currentLength}`,": ",h.currentPosition]}),P.jsxs("span",{children:[h.rateKeysPerSec>=1e9?`${(h.rateKeysPerSec/1e9).toFixed(2)} Gkeys/s`:`${(h.rateKeysPerSec/1e6).toFixed(1)} Mkeys/s`," ","• ETA: ",h.etaSeconds<60?`${Math.round(h.etaSeconds)}s`:`${Math.round(h.etaSeconds/60)}m`]})]}),P.jsx("div",{className:"h-2 bg-muted rounded overflow-hidden",children:P.jsx("div",{className:"h-full bg-primary transition-all duration-200",style:{width:`${h.percent}%`}})})]}),x===!1&&P.jsx("div",{className:"text-sm text-destructive",children:"WebGPU not available. Cracking requires Chrome 113+ or Edge 113+."}),!S&&x!==!1&&P.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading wordlist..."}),_.length>0&&P.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[P.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Cracked Rooms:"}),P.jsx("div",{className:"space-y-1",children:_.map((X,Z)=>P.jsxs("div",{className:"text-sm bg-green-950/30 border border-green-900/50 rounded px-2 py-1",children:[P.jsxs("span",{className:"text-green-400 font-medium",children:["#",X.roomName]}),P.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:['"',X.message.slice(0,50),X.message.length>50?"...":"",'"']})]},Z))})]})]})}const $4=r0,e3=n0,ip=B.forwardRef(({className:r,...o},a)=>P.jsx(gi,{className:Ze("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o,ref:a}));ip.displayName=gi.displayName;const t3=hi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),lp=B.forwardRef(({side:r="right",className:o,children:a,hideCloseButton:s=!1,...c},l)=>P.jsxs(e3,{children:[P.jsx(ip,{}),P.jsxs(vi,{ref:l,className:Ze(t3({side:r}),o),...c,children:[!s&&P.jsxs(o0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[P.jsx(aA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));lp.displayName=vi.displayName;const cp=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col space-y-2 text-center sm:text-left",r),...o});cp.displayName="SheetHeader";const up=B.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ze("text-lg font-semibold text-foreground",r),...o}));up.displayName=yi.displayName;const r3=B.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ze("text-sm text-muted-foreground",r),...o}));r3.displayName=xi.displayName;const rA=500;function n3(r){return`${r.type}-${r.conversation_key}-${r.text}-${r.sender_timestamp}`}function o3(){const r=B.useRef(null),o=B.useRef(null),a=B.useRef(new Set),[s,c]=B.useState(null),[l,A]=B.useState(null),[u,f]=B.useState(null),[h,m]=B.useState([]),[p,v]=B.useState([]),[_,b]=B.useState([]),[S,y]=B.useState(!1),[x,C]=B.useState(!1),[w,T]=B.useState([]),[R,D]=B.useState(null),[N,I]=B.useState(!1),[F,j]=B.useState(!1),[L,G]=B.useState(!1),[K,ee]=B.useState(!1),[se,J]=B.useState(0),[ne,W]=B.useState(fh),[X,Z]=B.useState({}),k=B.useRef(null),O=B.useMemo(()=>({onHealth:$=>{const Ae=k.current;k.current=$,c($),Ae!==null&&Ae.radio_connected!==$.radio_connected&&($.radio_connected?wa.success("Radio connected",{description:$.serial_port?`Connected to ${$.serial_port}`:void 0}):wa.error("Radio disconnected",{description:"Check radio connection and power"}))},onError:$=>{wa.error($.message,{description:$.details})},onContacts:$=>m($),onChannels:$=>v($),onMessage:$=>{const Ae=o.current,Ee=n3($);if(a.current.has(Ee)){console.debug("Duplicate message content ignored:",Ee.slice(0,50));return}if(a.current.add(Ee),a.current.size>1e3){const Qe=Array.from(a.current);a.current=new Set(Qe.slice(-500))}let ke=null;$.type==="CHAN"&&$.conversation_key?ke=Vn("channel",$.conversation_key):$.type==="PRIV"&&$.conversation_key&&(ke=Vn("contact",$.conversation_key));const Ie=Ae?$.type==="CHAN"&&Ae.type==="channel"?$.conversation_key===Ae.id:$.type==="PRIV"&&Ae.type==="contact"?$.conversation_key&&lA(Ae.id,$.conversation_key):!1:!1;if(Ie&&b(Qe=>Qe.some(Xe=>Xe.id===$.id)?Qe:[...Qe,$]),ke){const Qe=$.received_at||Math.floor(Date.now()/1e3),Xe=fc(ke,Qe);W(Xe),!$.outgoing&&!Ie&&Z(Yt=>({...Yt,[ke]:(Yt[ke]||0)+1}))}},onContact:$=>{m(Ae=>{const Ee=Ae.findIndex(ke=>ke.public_key===$.public_key);if(Ee>=0){const ke=[...Ae],Ie=Ae[Ee];return ke[Ee]={...Ie,...$,name:$.name??Ie.name,last_path:$.last_path??Ie.last_path,lat:$.lat??Ie.lat,lon:$.lon??Ie.lon},ke}return[...Ae,$]})},onRawPacket:$=>{T(Ae=>{if(Ae.some(ke=>ke.id===$.id))return Ae;const Ee=[...Ae,$];return Ee.length>rA?Ee.slice(-rA):Ee})},onMessageAcked:$=>{b(Ae=>{const Ee=Ae.findIndex(ke=>ke.id===$);if(Ee>=0){const ke=[...Ae];return ke[Ee]={...Ae[Ee],acked:!0},ke}return Ae})}}),[]);A1(O);const z=B.useCallback(async()=>{try{const $=await rt.getRadioConfig();A($)}catch($){console.error("Failed to fetch config:",$)}},[]),V=B.useCallback(async()=>{try{const $=await rt.getSettings();f($)}catch($){console.error("Failed to fetch app settings:",$)}},[]),re=B.useCallback(async()=>{try{const $=await rt.getUndecryptedPacketCount();J($.count)}catch($){console.error("Failed to fetch undecrypted count:",$)}},[]),ue=200,de=B.useCallback(async($=!1)=>{if(!R){b([]),y(!1);return}$&&I(!0);try{const Ae=await rt.getMessages({type:R.type==="channel"?"CHAN":"PRIV",conversation_key:R.id,limit:ue});b(Ae),y(Ae.length>=ue)}catch(Ae){console.error("Failed to fetch messages:",Ae)}finally{$&&I(!1)}},[R]),oe=B.useCallback(async()=>{if(!(!R||x||!S)){C(!0);try{const $=await rt.getMessages({type:R.type==="channel"?"CHAN":"PRIV",conversation_key:R.id,limit:ue,offset:_.length});$.length>0&&b(Ae=>[...Ae,...$]),y($.length>=ue)}catch($){console.error("Failed to fetch older messages:",$)}finally{C(!1)}}},[R,x,S,_.length]);B.useEffect(()=>{z(),V(),re()},[z,V,re]);const Be=B.useRef(!1);B.useEffect(()=>{if(Be.current||p.length===0||R)return;const $=p.find(Ae=>Ae.name==="Public");$&&(D({type:"channel",id:$.key,name:$.name}),Be.current=!0)},[p,R]);const ze=B.useRef(new Set),dt=B.useRef(new Set);B.useEffect(()=>{const $=p.filter(ke=>!ze.current.has(ke.key)),Ae=h.filter(ke=>ke.public_key&&!dt.current.has(ke.public_key));if($.length===0&&Ae.length===0)return;$.forEach(ke=>ze.current.add(ke.key)),Ae.forEach(ke=>dt.current.add(ke.public_key)),(async()=>{const ke=[...$.map(Ie=>({type:"CHAN",conversation_key:Ie.key})),...Ae.map(Ie=>({type:"PRIV",conversation_key:Ie.public_key}))];if(ke.length!==0)try{const Ie=await rt.getMessagesBulk(ke,100),Qe=tg(),Xe={},Yt={};for(const Rt of $){const te=Ie[`CHAN:${Rt.key}`]||[];if(te.length>0){const le=Vn("channel",Rt.key),me=Qe[le]||0,De=te.filter(je=>!je.outgoing&&je.received_at>me).length;De>0&&(Xe[le]=De);const Pe=Math.max(...te.map(je=>je.received_at));Yt[le]=Pe,fc(le,Pe)}}for(const Rt of Ae){const te=Ie[`PRIV:${Rt.public_key}`]||[];if(te.length>0){const le=Vn("contact",Rt.public_key),me=Qe[le]||0,De=te.filter(je=>!je.outgoing&&je.received_at>me).length;De>0&&(Xe[le]=De);const Pe=Math.max(...te.map(je=>je.received_at));Yt[le]=Pe,fc(le,Pe)}}Object.keys(Xe).length>0&&Z(Rt=>({...Rt,...Xe})),W(fh())}catch(Ie){console.error("Failed to fetch messages bulk:",Ie)}})()},[p,h]),B.useEffect(()=>{if(o.current=R,R&&R.type!=="raw"){const $=Vn(R.type,R.id),Ae=Math.floor(Date.now()/1e3);rg($,Ae),Z(Ee=>{if(Ee[$]){const ke={...Ee};return delete ke[$],ke}return Ee})}},[R]),B.useEffect(()=>{de(!0)},[de]);const it=B.useCallback(async $=>{R&&(R.type==="channel"?await rt.sendChannelMessage(R.id,$):await rt.sendDirectMessage(R.id,$),await de())},[R,de]),ft=B.useCallback(async $=>{await rt.updateRadioConfig($),await z()},[z]),Je=B.useCallback(async $=>{await rt.updateSettings($),await V()},[V]),ar=B.useCallback(async $=>{await rt.setPrivateKey($),await z()},[z]),Ut=B.useCallback(async()=>{await rt.rebootRadio(),c(Ae=>Ae&&{...Ae,radio_connected:!1}),(async()=>{for(let Ae=0;Ae<30;Ae++){await new Promise(Ee=>setTimeout(Ee,1e3));try{const Ee=await rt.getHealth();if(c(Ee),Ee.radio_connected){z();return}}catch{}}})()},[z]),Et=B.useCallback(async()=>{try{await rt.sendAdvertisement(!0)}catch($){console.error("Failed to send advertisement:",$)}},[]),Wt=B.useCallback($=>{var Ae;(Ae=r.current)==null||Ae.appendText(`@[${$}] `)},[]),ht=B.useCallback($=>{D($),ee(!1)},[]),It=B.useCallback(async $=>{if(confirm("Delete this channel? Message history will be preserved."))try{await rt.deleteChannel($),v(Ae=>Ae.filter(Ee=>Ee.key!==$)),D(null)}catch(Ae){console.error("Failed to delete channel:",Ae)}},[]),nt=B.useCallback(async $=>{if(confirm("Delete this contact? Message history will be preserved."))try{await rt.deleteContact($),m(Ae=>Ae.filter(Ee=>Ee.public_key!==$)),D(null)}catch(Ae){console.error("Failed to delete contact:",Ae)}},[]),Ve=B.useCallback(async($,Ae,Ee)=>{const ke={public_key:Ae,name:$,type:0,flags:0,last_path:null,last_path_len:-1,last_advert:null,lat:null,lon:null,last_seen:null,on_radio:!1};m(Ie=>[...Ie,ke]),D({type:"contact",id:Ae,name:_a($,Ae)}),Ee&&console.log("Contact historical decryption not yet supported")},[]),At=B.useCallback(async($,Ae,Ee)=>{const ke=await rt.createChannel($,Ae),Ie=await rt.getChannels();v(Ie),D({type:"channel",id:ke.key,name:$}),Ee&&(await rt.decryptHistoricalPackets({key_type:"channel",channel_key:ke.key}),re())},[re]),Kt=B.useCallback(async($,Ae)=>{const Ee=$.startsWith("#")?$:`#${$}`,ke=await rt.createChannel(Ee),Ie=await rt.getChannels();v(Ie),D({type:"channel",id:ke.key,name:Ee}),Ae&&(await rt.decryptHistoricalPackets({key_type:"channel",channel_name:Ee}),re())},[re]),dr=P.jsx(lv,{contacts:h,channels:p,activeConversation:R,onSelectConversation:ht,onNewMessage:()=>{j(!0),ee(!1)},lastMessageTimes:ne,unreadCounts:X});return P.jsxs("div",{className:"flex flex-col h-screen",children:[P.jsx($1,{health:s,config:l,onConfigClick:()=>G(!0),onAdvertise:Et,onMenuClick:()=>ee(!0)}),P.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[P.jsx("div",{className:"hidden md:block",children:dr}),P.jsx($4,{open:K,onOpenChange:ee,children:P.jsxs(lp,{side:"left",className:"w-[280px] p-0 flex flex-col",hideCloseButton:!0,children:[P.jsx(cp,{className:"sr-only",children:P.jsx(up,{children:"Navigation"})}),P.jsx("div",{className:"flex-1 overflow-hidden",children:dr})]})}),P.jsx("div",{className:"flex-1 flex flex-col bg-background",children:R?R.type==="raw"?P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"flex justify-between items-center px-4 py-3 border-b border-border font-medium",children:"Raw Packet Feed"}),P.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[P.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:P.jsx(zy,{packets:w})}),P.jsx("div",{className:"h-[280px] flex-shrink-0 border-t border-border overflow-hidden",children:P.jsx(J4,{packets:w,channels:p,onChannelCreate:async($,Ae)=>{const Ee=await rt.createChannel($,Ae),ke=await rt.getChannels();v(ke),await rt.decryptHistoricalPackets({key_type:"channel",channel_key:Ee.key}),re()}})})]})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex justify-between items-center px-4 py-3 border-b border-border font-medium",children:[P.jsxs("span",{className:"flex flex-col sm:flex-row sm:items-center sm:gap-2",children:[P.jsxs("span",{children:[R.type==="channel"&&!R.name.startsWith("#")?"#":"",R.name]}),P.jsx("span",{className:"font-normal text-xs text-muted-foreground font-mono",children:R.id})]}),!(R.type==="channel"&&R.name==="Public")&&P.jsx("button",{className:"py-1 px-3 bg-destructive/20 border border-destructive/30 text-destructive rounded text-xs cursor-pointer hover:bg-destructive/30",onClick:()=>{R.type==="channel"?It(R.id):nt(R.id)},children:"Delete"})]}),P.jsx(cv,{messages:_,contacts:h,loading:N,loadingOlder:x,hasOlderMessages:S,onSenderClick:R.type==="channel"?Wt:void 0,onLoadOlder:oe}),P.jsx(uv,{ref:r,onSend:it,disabled:!(s!=null&&s.radio_connected),placeholder:s!=null&&s.radio_connected?`Message ${R.name}...`:"Radio not connected"})]}):P.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a conversation or start a new one"})})]}),P.jsx(Ty,{open:F,contacts:h,undecryptedCount:se,onClose:()=>j(!1),onSelectConversation:$=>{D($),j(!1)},onCreateContact:Ve,onCreateChannel:At,onCreateHashtagChannel:Kt}),P.jsx(Oy,{open:L,config:l,appSettings:u,onClose:()=>G(!1),onSave:ft,onSaveAppSettings:Je,onSetPrivateKey:ar,onReboot:Ut}),P.jsx(J1,{position:"top-right"})]})}f1.createRoot(document.getElementById("root")).render(P.jsx(B.StrictMode,{children:P.jsx(o3,{})})); diff --git a/frontend/dist/assets/index-DeS_VBWV.js b/frontend/dist/assets/index-DeS_VBWV.js deleted file mode 100644 index 5594e18..0000000 --- a/frontend/dist/assets/index-DeS_VBWV.js +++ /dev/null @@ -1,536 +0,0 @@ -function ev(r,o){for(var a=0;as[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const p of l.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function Zh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Ie={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Qf;function tv(){if(Qf)return Ie;Qf=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),p=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.iterator;function g(E){return E===null||typeof E!="object"?null:(E=m&&E[m]||E["@@iterator"],typeof E=="function"?E:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,C={};function x(E,I,H){this.props=E,this.context=I,this.refs=C,this.updater=H||S}x.prototype.isReactComponent={},x.prototype.setState=function(E,I){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,I,"setState")},x.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function w(){}w.prototype=x.prototype;function k(E,I,H){this.props=E,this.context=I,this.refs=C,this.updater=H||S}var b=k.prototype=new w;b.constructor=k,_(b,x.prototype),b.isPureReactComponent=!0;var R=Array.isArray,P=Object.prototype.hasOwnProperty,j={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function D(E,I,H){var V,re={},ce=null,pe=null;if(I!=null)for(V in I.ref!==void 0&&(pe=I.ref),I.key!==void 0&&(ce=""+I.key),I)P.call(I,V)&&!B.hasOwnProperty(V)&&(re[V]=I[V]);var oe=arguments.length-2;if(oe===1)re.children=H;else if(1>>1,I=U[E];if(0>>1;Ec(re,X))cec(pe,re)?(U[E]=pe,U[ce]=X,E=ce):(U[E]=re,U[V]=X,E=V);else if(cec(pe,X))U[E]=pe,U[ce]=X,E=ce;else break e}}return te}function c(U,te){var X=U.sortIndex-te.sortIndex;return X!==0?X:U.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var p=Date,u=p.now();r.unstable_now=function(){return p.now()-u}}var f=[],h=[],v=1,m=null,g=3,S=!1,_=!1,C=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(U){for(var te=a(h);te!==null;){if(te.callback===null)s(h);else if(te.startTime<=U)s(h),te.sortIndex=te.expirationTime,o(f,te);else break;te=a(h)}}function R(U){if(C=!1,b(U),!_)if(a(f)!==null)_=!0,Q(P);else{var te=a(h);te!==null&&ne(R,te.startTime-U)}}function P(U,te){_=!1,C&&(C=!1,w(D),D=-1),S=!0;var X=g;try{for(b(te),m=a(f);m!==null&&(!(m.expirationTime>te)||U&&!L());){var E=m.callback;if(typeof E=="function"){m.callback=null,g=m.priorityLevel;var I=E(m.expirationTime<=te);te=r.unstable_now(),typeof I=="function"?m.callback=I:m===a(f)&&s(f),b(te)}else s(f);m=a(f)}if(m!==null)var H=!0;else{var V=a(h);V!==null&&ne(R,V.startTime-te),H=!1}return H}finally{m=null,g=X,S=!1}}var j=!1,B=null,D=-1,F=5,O=-1;function L(){return!(r.unstable_now()-OU||125E?(U.sortIndex=X,o(h,U),a(f)===null&&U===a(h)&&(C?(w(D),D=-1):C=!0,ne(R,X-E))):(U.sortIndex=I,o(f,U),_||S||(_=!0,Q(P))),U},r.unstable_shouldYield=L,r.unstable_wrapCallback=function(U){var te=g;return function(){var X=g;g=te;try{return U.apply(this,arguments)}finally{g=X}}}})(dc)),dc}var rh;function av(){return rh||(rh=1,uc.exports=ov()),uc.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var nh;function sv(){if(nh)return rr;nh=1;var r=tu(),o=av();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},m={};function g(e){return f.call(m,e)?!0:f.call(v,e)?!1:h.test(e)?m[e]=!0:(v[e]=!0,!1)}function S(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _(e,t,n,i){if(t===null||typeof t>"u"||S(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,n,i,d,y,T){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=y,this.removeEmptyString=T}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){x[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];x[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){x[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){x[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){x[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){x[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){x[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){x[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){x[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function k(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(w,k);x[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){x[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),x.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){x[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,i){var d=x.hasOwnProperty(t)?x[t]:null;(d!==null?d.type!==0:i||!(2M||d[T]!==y[M]){var z=` -`+d[T].replace(" at new "," at ");return e.displayName&&z.includes("")&&(z=z.replace("",e.displayName)),z}while(1<=T&&0<=M);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function re(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function ce(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case j:return"Portal";case F:return"Profiler";case D:return"StrictMode";case $:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(t);case 8:return t===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Ae(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,y=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(T){i=""+T,y.call(this,T)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){e._valueTracker||(e._valueTracker=ze(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Ae(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ft(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ze(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ar(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=oe(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vt(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Tt(e,t){Vt(e,t);var n=oe(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ht(e,t.type,n):t.hasOwnProperty("defaultValue")&&ht(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ht(e,t,n){(t!=="number"||ft(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dt=Array.isArray;function nt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d"+t.valueOf().toString()+"",t=Te.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function De(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ke={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qe=["Webkit","ms","Moz","O"];Object.keys(Ke).forEach(function(e){Qe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ke[t]=Ke[e]})});function Yt(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ke.hasOwnProperty(e)&&Ke[e]?(""+t).trim():t+"px"}function Pt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,d=Yt(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,d):e[n]=d}}var ee=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function le(e,t){if(t){if(ee[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function ve(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var je=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oe=null,Fe=null,Ve=null;function Kt(e){if(e=Xo(e)){if(typeof Oe!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Xa(t),Oe(e.stateNode,e.type,t))}}function Ee(e){Fe?Ve?Ve.push(e):Ve=[e]:Fe=e}function qe(){if(Fe){var e=Fe,t=Ve;if(Ve=Fe=null,Kt(e),t)for(e=0;e>>=0,e===0?32:31-(v1(e)/y1|0)|0}var Ba=64,ja=4194304;function Bo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Da(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,d=e.suspendedLanes,y=e.pingedLanes,T=n&268435455;if(T!==0){var M=T&~d;M!==0?i=Bo(M):(y&=T,y!==0&&(i=Bo(y)))}else T=n&~d,T!==0?i=Bo(T):y!==0&&(i=Bo(y));if(i===0)return 0;if(t!==0&&t!==i&&(t&d)===0&&(d=i&-i,y=t&-t,d>=y||d===16&&(y&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_r(t),e[t]=n}function b1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=zo),Vu=" ",Wu=!1;function Ku(e,t){switch(e){case"keyup":return Y1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function Q1(e,t){switch(e){case"compositionend":return Gu(t);case"keypress":return t.which!==32?null:(Wu=!0,Vu);case"textInput":return e=t.data,e===Vu&&Wu?null:e;default:return null}}function Z1(e,t){if($n)return e==="compositionend"||!zi&&Ku(e,t)?(e=Iu(),Ha=Oi=nn=null,$n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ju(n)}}function td(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?td(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rd(){for(var e=window,t=ft();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ft(e.document)}return t}function Wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function im(e){var t=rd(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&td(n.ownerDocument.documentElement,n)){if(i!==null&&Wi(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=n.textContent.length,y=Math.min(i.start,d);i=i.end===void 0?y:Math.min(i.end,d),!e.extend&&y>i&&(d=i,i=y,y=d),d=ed(n,y);var T=ed(n,i);d&&T&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==T.node||e.focusOffset!==T.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),y>i?(e.addRange(t),e.extend(T.node,T.offset)):(t.setEnd(T.node,T.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yn=null,Ki=null,Ko=null,Gi=!1;function nd(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gi||Yn==null||Yn!==ft(i)||(i=Yn,"selectionStart"in i&&Wi(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ko&&Wo(Ko,i)||(Ko=i,i=qa(Ki,"onSelect"),0eo||(e.current=ol[eo],ol[eo]=null,eo--)}function et(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Ht=sn(ln),Qt=sn(!1),Tn=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},y;for(y in n)d[y]=t[y];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Zt(e){return e=e.childContextTypes,e!=null}function Qa(){st(Qt),st(Ht)}function gd(e,t,n){if(Ht.current!==ln)throw Error(a(168));et(Ht,t),et(Qt,n)}function xd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,pe(e)||"Unknown",d));return X({},n,i)}function Za(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,Tn=Ht.current,et(Ht,e),et(Qt,Qt.current),!0}function wd(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=xd(e,t,Tn),i.__reactInternalMemoizedMergedChildContext=e,st(Qt),st(Ht),et(Ht,e)):st(Qt),et(Qt,n)}var Wr=null,Ja=!1,al=!1;function bd(e){Wr===null?Wr=[e]:Wr.push(e)}function xm(e){Ja=!0,bd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e>=T,d-=T,Kr=1<<32-_r(t)+d|n<Be?(At=Re,Re=null):At=Re.sibling;var Ge=se(K,Re,q[Be],de);if(Ge===null){Re===null&&(Re=At);break}e&&Re&&Ge.alternate===null&&t(K,Re),W=y(Ge,W,Be),Pe===null?ke=Ge:Pe.sibling=Ge,Pe=Ge,Re=At}if(Be===q.length)return n(K,Re),lt&&Rn(K,Be),ke;if(Re===null){for(;BeBe?(At=Re,Re=null):At=Re.sibling;var gn=se(K,Re,Ge.value,de);if(gn===null){Re===null&&(Re=At);break}e&&Re&&gn.alternate===null&&t(K,Re),W=y(gn,W,Be),Pe===null?ke=gn:Pe.sibling=gn,Pe=gn,Re=At}if(Ge.done)return n(K,Re),lt&&Rn(K,Be),ke;if(Re===null){for(;!Ge.done;Be++,Ge=q.next())Ge=ue(K,Ge.value,de),Ge!==null&&(W=y(Ge,W,Be),Pe===null?ke=Ge:Pe.sibling=Ge,Pe=Ge);return lt&&Rn(K,Be),ke}for(Re=i(K,Re);!Ge.done;Be++,Ge=q.next())Ge=me(Re,K,Be,Ge.value,de),Ge!==null&&(e&&Ge.alternate!==null&&Re.delete(Ge.key===null?Be:Ge.key),W=y(Ge,W,Be),Pe===null?ke=Ge:Pe.sibling=Ge,Pe=Ge);return e&&Re.forEach(function(Jm){return t(K,Jm)}),lt&&Rn(K,Be),ke}function xt(K,W,q,de){if(typeof q=="object"&&q!==null&&q.type===B&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case P:e:{for(var ke=q.key,Pe=W;Pe!==null;){if(Pe.key===ke){if(ke=q.type,ke===B){if(Pe.tag===7){n(K,Pe.sibling),W=d(Pe,q.props.children),W.return=K,K=W;break e}}else if(Pe.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===Q&&Td(ke)===Pe.type){n(K,Pe.sibling),W=d(Pe,q.props),W.ref=Qo(K,Pe,q),W.return=K,K=W;break e}n(K,Pe);break}else t(K,Pe);Pe=Pe.sibling}q.type===B?(W=In(q.props.children,K.mode,de,q.key),W.return=K,K=W):(de=Ts(q.type,q.key,q.props,null,K.mode,de),de.ref=Qo(K,W,q),de.return=K,K=de)}return T(K);case j:e:{for(Pe=q.key;W!==null;){if(W.key===Pe)if(W.tag===4&&W.stateNode.containerInfo===q.containerInfo&&W.stateNode.implementation===q.implementation){n(K,W.sibling),W=d(W,q.children||[]),W.return=K,K=W;break e}else{n(K,W);break}else t(K,W);W=W.sibling}W=rc(q,K.mode,de),W.return=K,K=W}return T(K);case Q:return Pe=q._init,xt(K,W,Pe(q._payload),de)}if(Dt(q))return xe(K,W,q,de);if(te(q))return _e(K,W,q,de);ns(K,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,W!==null&&W.tag===6?(n(K,W.sibling),W=d(W,q),W.return=K,K=W):(n(K,W),W=tc(q,K.mode,de),W.return=K,K=W),T(K)):n(K,W)}return xt}var ao=Pd(!0),Rd=Pd(!1),os=sn(null),as=null,so=null,dl=null;function fl(){dl=so=as=null}function hl(e){var t=os.current;st(os),e._currentValue=t}function pl(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function io(e,t){as=e,dl=so=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Jt=!0),e.firstContext=null)}function mr(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},so===null){if(as===null)throw Error(a(308));so=e,as.dependencies={lanes:0,firstContext:e}}else so=so.next=e;return t}var Nn=null;function ml(e){Nn===null?Nn=[e]:Nn.push(e)}function Nd(e,t,n,i){var d=t.interleaved;return d===null?(n.next=n,ml(t)):(n.next=d.next,d.next=n),t.interleaved=n,qr(e,i)}function qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var un=!1;function vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ad(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(We&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,qr(e,n)}return d=i.interleaved,d===null?(t.next=t,ml(i)):(t.next=d.next,d.next=t),i.interleaved=t,qr(e,n)}function ss(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ni(e,n)}}function Bd(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var d=null,y=null;if(n=n.firstBaseUpdate,n!==null){do{var T={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};y===null?d=y=T:y=y.next=T,n=n.next}while(n!==null);y===null?d=y=t:y=y.next=t}else d=y=t;n={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:y,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function is(e,t,n,i){var d=e.updateQueue;un=!1;var y=d.firstBaseUpdate,T=d.lastBaseUpdate,M=d.shared.pending;if(M!==null){d.shared.pending=null;var z=M,Y=z.next;z.next=null,T===null?y=Y:T.next=Y,T=z;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==T&&(M===null?ie.firstBaseUpdate=Y:M.next=Y,ie.lastBaseUpdate=z))}if(y!==null){var ue=d.baseState;T=0,ie=Y=z=null,M=y;do{var se=M.lane,me=M.eventTime;if((i&se)===se){ie!==null&&(ie=ie.next={eventTime:me,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var xe=e,_e=M;switch(se=t,me=n,_e.tag){case 1:if(xe=_e.payload,typeof xe=="function"){ue=xe.call(me,ue,se);break e}ue=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=_e.payload,se=typeof xe=="function"?xe.call(me,ue,se):xe,se==null)break e;ue=X({},ue,se);break e;case 2:un=!0}}M.callback!==null&&M.lane!==0&&(e.flags|=64,se=d.effects,se===null?d.effects=[M]:se.push(M))}else me={eventTime:me,lane:se,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(Y=ie=me,z=ue):ie=ie.next=me,T|=se;if(M=M.next,M===null){if(M=d.shared.pending,M===null)break;se=M,M=se.next,se.next=null,d.lastBaseUpdate=se,d.shared.pending=null}}while(!0);if(ie===null&&(z=ue),d.baseState=z,d.firstBaseUpdate=Y,d.lastBaseUpdate=ie,t=d.shared.interleaved,t!==null){d=t;do T|=d.lane,d=d.next;while(d!==t)}else y===null&&(d.shared.lanes=0);jn|=T,e.lanes=T,e.memoizedState=ue}}function jd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var i=bl.transition;bl.transition={};try{e(!1),t()}finally{Ye=n,bl.transition=i}}function Zd(){return vr().memoizedState}function Sm(e,t,n){var i=mn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Jd(e))ef(t,n);else if(n=Nd(e,t,n,i),n!==null){var d=qt();Pr(n,e,i,d),tf(n,t,i)}}function km(e,t,n){var i=mn(e),d={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jd(e))ef(t,d);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=t.lastRenderedReducer,y!==null))try{var T=t.lastRenderedState,M=y(T,n);if(d.hasEagerState=!0,d.eagerState=M,Sr(M,T)){var z=t.interleaved;z===null?(d.next=d,ml(t)):(d.next=z.next,z.next=d),t.interleaved=d;return}}catch{}finally{}n=Nd(e,t,d,i),n!==null&&(d=qt(),Pr(n,e,i,d),tf(n,t,i))}}function Jd(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function ef(e,t){ta=us=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tf(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ni(e,n)}}var hs={readContext:mr,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},Cm={readContext:mr,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:mr,useEffect:Wd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ds(4194308,4,qd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){return ds(4,2,e,t)},useMemo:function(e,t){var n=Or();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Or();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Sm.bind(null,ut,e),[i.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:Ud,useDebugValue:Pl,useDeferredValue:function(e){return Or().memoizedState=e},useTransition:function(){var e=Ud(!1),t=e[0];return e=_m.bind(null,e[1]),Or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ut,d=Or();if(lt){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Nt===null)throw Error(a(349));(Bn&30)!==0||Id(i,t,n)}d.memoizedState=n;var y={value:n,getSnapshot:t};return d.queue=y,Wd(Hd.bind(null,i,y,e),[e]),i.flags|=2048,oa(9,Fd.bind(null,i,y,n,t),void 0,null),n},useId:function(){var e=Or(),t=Nt.identifierPrefix;if(lt){var n=Gr,i=Kr;n=(i&~(1<<32-_r(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ra++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=T.createElement(n,{is:i.is}):(e=T.createElement(n),n==="select"&&(T=e,i.multiple?T.multiple=!0:i.size&&(T.size=i.size))):e=T.createElementNS(e,n),e[jr]=t,e[Yo]=i,_f(e,t,!1,!1),t.stateNode=e;e:{switch(T=ve(n,i),n){case"dialog":at("cancel",e),at("close",e),d=i;break;case"iframe":case"object":case"embed":at("load",e),d=i;break;case"video":case"audio":for(d=0;dho&&(t.flags|=128,i=!0,aa(y,!1),t.lanes=4194304)}else{if(!i)if(e=ls(T),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),aa(y,!0),y.tail===null&&y.tailMode==="hidden"&&!T.alternate&&!lt)return zt(t),null}else 2*gt()-y.renderingStartTime>ho&&n!==1073741824&&(t.flags|=128,i=!0,aa(y,!1),t.lanes=4194304);y.isBackwards?(T.sibling=t.child,t.child=T):(n=y.last,n!==null?n.sibling=T:t.child=T,y.last=T)}return y.tail!==null?(t=y.tail,y.rendering=t,y.tail=t.sibling,y.renderingStartTime=gt(),t.sibling=null,n=ct.current,et(ct,i?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return Zl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(cr&1073741824)!==0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function jm(e,t){switch(il(t),t.tag){case 1:return Zt(t.type)&&Qa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),st(Qt),st(Ht),wl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return gl(t),null;case 13:if(st(ct),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));oo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(ct),null;case 4:return lo(),null;case 10:return hl(t.type._context),null;case 22:case 23:return Zl(),null;case 24:return null;default:return null}}var ys=!1,Ut=!1,Dm=typeof WeakSet=="function"?WeakSet:Set,ye=null;function uo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){yt(e,t,i)}else n.current=null}function Ll(e,t,n){try{n()}catch(i){yt(e,t,i)}}var Cf=!1;function Om(e,t){if(Zi=Ia,e=rd(),Wi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var d=i.anchorOffset,y=i.focusNode;i=i.focusOffset;try{n.nodeType,y.nodeType}catch{n=null;break e}var T=0,M=-1,z=-1,Y=0,ie=0,ue=e,se=null;t:for(;;){for(var me;ue!==n||d!==0&&ue.nodeType!==3||(M=T+d),ue!==y||i!==0&&ue.nodeType!==3||(z=T+i),ue.nodeType===3&&(T+=ue.nodeValue.length),(me=ue.firstChild)!==null;)se=ue,ue=me;for(;;){if(ue===e)break t;if(se===n&&++Y===d&&(M=T),se===y&&++ie===i&&(z=T),(me=ue.nextSibling)!==null)break;ue=se,se=ue.parentNode}ue=me}n=M===-1||z===-1?null:{start:M,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},Ia=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var _e=xe.memoizedProps,xt=xe.memoizedState,K=t.stateNode,W=K.getSnapshotBeforeUpdate(t.elementType===t.type?_e:Cr(t.type,_e),xt);K.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var q=t.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(de){yt(t,t.return,de)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return xe=Cf,Cf=!1,xe}function sa(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var y=d.destroy;d.destroy=void 0,y!==void 0&&Ll(t,n,y)}d=d.next}while(d!==i)}}function gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function zl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ef(e){var t=e.alternate;t!==null&&(e.alternate=null,Ef(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jr],delete t[Yo],delete t[nl],delete t[ym],delete t[gm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tf(e){return e.tag===5||e.tag===3||e.tag===4}function Pf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ul(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ya));else if(i!==4&&(e=e.child,e!==null))for(Ul(e,t,n),e=e.sibling;e!==null;)Ul(e,t,n),e=e.sibling}function Vl(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Vl(e,t,n),e=e.sibling;e!==null;)Vl(e,t,n),e=e.sibling}var Ot=null,Er=!1;function fn(e,t,n){for(n=n.child;n!==null;)Rf(e,t,n),n=n.sibling}function Rf(e,t,n){if(Br&&typeof Br.onCommitFiberUnmount=="function")try{Br.onCommitFiberUnmount(Aa,n)}catch{}switch(n.tag){case 5:Ut||uo(n,t);case 6:var i=Ot,d=Er;Ot=null,fn(e,t,n),Ot=i,Er=d,Ot!==null&&(Er?(e=Ot,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ot.removeChild(n.stateNode));break;case 18:Ot!==null&&(Er?(e=Ot,n=n.stateNode,e.nodeType===8?rl(e.parentNode,n):e.nodeType===1&&rl(e,n),Fo(e)):rl(Ot,n.stateNode));break;case 4:i=Ot,d=Er,Ot=n.stateNode.containerInfo,Er=!0,fn(e,t,n),Ot=i,Er=d;break;case 0:case 11:case 14:case 15:if(!Ut&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var y=d,T=y.destroy;y=y.tag,T!==void 0&&((y&2)!==0||(y&4)!==0)&&Ll(n,t,T),d=d.next}while(d!==i)}fn(e,t,n);break;case 1:if(!Ut&&(uo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(M){yt(n,t,M)}fn(e,t,n);break;case 21:fn(e,t,n);break;case 22:n.mode&1?(Ut=(i=Ut)||n.memoizedState!==null,fn(e,t,n),Ut=i):fn(e,t,n);break;default:fn(e,t,n)}}function Nf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Dm),t.forEach(function(i){var d=Wm.bind(null,e,i);n.has(i)||(n.add(i),i.then(d,d))})}}function Tr(e,t){var n=t.deletions;if(n!==null)for(var i=0;id&&(d=T),i&=~y}if(i=d,i=gt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Im(i/1960))-i,10e?16:e,pn===null)var i=!1;else{if(e=pn,pn=null,Ss=0,(We&6)!==0)throw Error(a(331));var d=We;for(We|=4,ye=e.current;ye!==null;){var y=ye,T=y.child;if((ye.flags&16)!==0){var M=y.deletions;if(M!==null){for(var z=0;zgt()-Gl?On(e,0):Kl|=n),tr(e,t)}function Vf(e,t){t===0&&((e.mode&1)===0?t=1:(t=ja,ja<<=1,(ja&130023424)===0&&(ja=4194304)));var n=qt();e=qr(e,t),e!==null&&(jo(e,t,n),tr(e,n))}function Vm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vf(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(n=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(a(314))}i!==null&&i.delete(t),Vf(e,n)}var Wf;Wf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)Jt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Jt=!1,Am(e,t,n);Jt=(e.flags&131072)!==0}else Jt=!1,lt&&(t.flags&1048576)!==0&&_d(t,ts,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;vs(e,t),e=t.pendingProps;var d=to(t,Ht.current);io(t,n),d=Sl(null,t,i,e,d,n);var y=kl();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zt(i)?(y=!0,Za(t)):y=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,vl(t),d.updater=ps,t.stateNode=d,d._reactInternals=t,Nl(t,i,e,n),t=Dl(null,t,i,!0,y,n)):(t.tag=0,lt&&y&&sl(t),Gt(null,t,d,n),t=t.child),t;case 16:i=t.elementType;e:{switch(vs(e,t),e=t.pendingProps,d=i._init,i=d(i._payload),t.type=i,d=t.tag=Gm(i),e=Cr(i,e),d){case 0:t=jl(null,t,i,e,n);break e;case 1:t=vf(null,t,i,e,n);break e;case 11:t=df(null,t,i,e,n);break e;case 14:t=ff(null,t,i,Cr(i.type,e),n);break e}throw Error(a(306,i,""))}return t;case 0:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Cr(i,d),jl(e,t,i,d,n);case 1:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Cr(i,d),vf(e,t,i,d,n);case 3:e:{if(yf(t),e===null)throw Error(a(387));i=t.pendingProps,y=t.memoizedState,d=y.element,Ad(e,t),is(t,i,null,n);var T=t.memoizedState;if(i=T.element,y.isDehydrated)if(y={element:i,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},t.updateQueue.baseState=y,t.memoizedState=y,t.flags&256){d=co(Error(a(423)),t),t=gf(e,t,i,n,d);break e}else if(i!==d){d=co(Error(a(424)),t),t=gf(e,t,i,n,d);break e}else for(lr=an(t.stateNode.containerInfo.firstChild),ir=t,lt=!0,kr=null,n=Rd(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oo(),i===d){t=Yr(e,t,n);break e}Gt(e,t,i,n)}t=t.child}return t;case 5:return Dd(t),e===null&&cl(t),i=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,T=d.children,el(i,d)?T=null:y!==null&&el(i,y)&&(t.flags|=32),mf(e,t),Gt(e,t,T,n),t.child;case 6:return e===null&&cl(t),null;case 13:return xf(e,t,n);case 4:return yl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ao(t,null,i,n):Gt(e,t,i,n),t.child;case 11:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Cr(i,d),df(e,t,i,d,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,d=t.pendingProps,y=t.memoizedProps,T=d.value,et(os,i._currentValue),i._currentValue=T,y!==null)if(Sr(y.value,T)){if(y.children===d.children&&!Qt.current){t=Yr(e,t,n);break e}}else for(y=t.child,y!==null&&(y.return=t);y!==null;){var M=y.dependencies;if(M!==null){T=y.child;for(var z=M.firstContext;z!==null;){if(z.context===i){if(y.tag===1){z=$r(-1,n&-n),z.tag=2;var Y=y.updateQueue;if(Y!==null){Y=Y.shared;var ie=Y.pending;ie===null?z.next=z:(z.next=ie.next,ie.next=z),Y.pending=z}}y.lanes|=n,z=y.alternate,z!==null&&(z.lanes|=n),pl(y.return,n,t),M.lanes|=n;break}z=z.next}}else if(y.tag===10)T=y.type===t.type?null:y.child;else if(y.tag===18){if(T=y.return,T===null)throw Error(a(341));T.lanes|=n,M=T.alternate,M!==null&&(M.lanes|=n),pl(T,n,t),T=y.sibling}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===t){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}Gt(e,t,d.children,n),t=t.child}return t;case 9:return d=t.type,i=t.pendingProps.children,io(t,n),d=mr(d),i=i(d),t.flags|=1,Gt(e,t,i,n),t.child;case 14:return i=t.type,d=Cr(i,t.pendingProps),d=Cr(i.type,d),ff(e,t,i,d,n);case 15:return hf(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Cr(i,d),vs(e,t),t.tag=1,Zt(i)?(e=!0,Za(t)):e=!1,io(t,n),nf(t,i,d),Nl(t,i,d,n),Dl(null,t,i,!0,e,n);case 19:return bf(e,t,n);case 22:return pf(e,t,n)}throw Error(a(156,t.tag))};function Kf(e,t){return Su(e,t)}function Km(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gr(e,t,n,i){return new Km(e,t,n,i)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gm(e){if(typeof e=="function")return ec(e)?1:0;if(e!=null){if(e=e.$$typeof,e===G)return 11;if(e===ae)return 14}return 2}function yn(e,t){var n=e.alternate;return n===null?(n=gr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ts(e,t,n,i,d,y){var T=2;if(i=e,typeof e=="function")ec(e)&&(T=1);else if(typeof e=="string")T=5;else e:switch(e){case B:return In(n.children,d,y,t);case D:T=8,d|=8;break;case F:return e=gr(12,n,t,d|2),e.elementType=F,e.lanes=y,e;case $:return e=gr(13,n,t,d),e.elementType=$,e.lanes=y,e;case J:return e=gr(19,n,t,d),e.elementType=J,e.lanes=y,e;case ne:return Ps(n,d,y,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:T=10;break e;case L:T=9;break e;case G:T=11;break e;case ae:T=14;break e;case Q:T=16,i=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=gr(T,n,t,d),t.elementType=e,t.type=i,t.lanes=y,t}function In(e,t,n,i){return e=gr(7,e,i,t),e.lanes=n,e}function Ps(e,t,n,i){return e=gr(22,e,i,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function tc(e,t,n){return e=gr(6,e,null,t),e.lanes=n,e}function rc(e,t,n){return t=gr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qm(e,t,n,i,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ri(0),this.expirationTimes=Ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ri(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function nc(e,t,n,i,d,y,T,M,z){return e=new qm(e,t,n,M,z),t===1?(t=1,y===!0&&(t|=8)):t=0,y=gr(3,null,null,t),e.current=y,y.stateNode=e,y.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vl(y),e}function $m(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),cc.exports=sv(),cc.exports}var ah;function iv(){if(ah)return Os;ah=1;var r=Jh();return Os.createRoot=r.createRoot,Os.hydrateRoot=r.hydrateRoot,Os}var lv=iv();const cv="/api";async function tt(r,o){const a=await fetch(`${cv}${r}`,{...o,headers:{"Content-Type":"application/json",...o==null?void 0:o.headers}});if(!a.ok){const s=await a.text();throw new Error(s||a.statusText)}return a.json()}const rt={getHealth:()=>tt("/health"),getRadioConfig:()=>tt("/radio/config"),updateRadioConfig:r=>tt("/radio/config",{method:"PATCH",body:JSON.stringify(r)}),setPrivateKey:r=>tt("/radio/private-key",{method:"PUT",body:JSON.stringify({private_key:r})}),sendAdvertisement:(r=!0)=>tt(`/radio/advertise?flood=${r}`,{method:"POST"}),rebootRadio:()=>tt("/radio/reboot",{method:"POST"}),reconnectRadio:()=>tt("/radio/reconnect",{method:"POST"}),getContacts:(r=100,o=0)=>tt(`/contacts?limit=${r}&offset=${o}`),getContact:r=>tt(`/contacts/${r}`),syncContacts:()=>tt("/contacts/sync",{method:"POST"}),addContactToRadio:r=>tt(`/contacts/${r}/add-to-radio`,{method:"POST"}),removeContactFromRadio:r=>tt(`/contacts/${r}/remove-from-radio`,{method:"POST"}),deleteContact:r=>tt(`/contacts/${r}`,{method:"DELETE"}),getChannels:()=>tt("/channels"),getChannel:r=>tt(`/channels/${r}`),createChannel:(r,o)=>tt("/channels",{method:"POST",body:JSON.stringify({name:r,key:o})}),syncChannels:()=>tt("/channels/sync",{method:"POST"}),deleteChannel:r=>tt(`/channels/${r}`,{method:"DELETE"}),getMessages:r=>{const o=new URLSearchParams;r!=null&&r.limit&&o.set("limit",r.limit.toString()),r!=null&&r.offset&&o.set("offset",r.offset.toString()),r!=null&&r.type&&o.set("type",r.type),r!=null&&r.conversation_key&&o.set("conversation_key",r.conversation_key);const a=o.toString();return tt(`/messages${a?`?${a}`:""}`)},getMessagesBulk:(r,o=100)=>tt(`/messages/bulk?limit_per_conversation=${o}`,{method:"POST",body:JSON.stringify(r)}),sendDirectMessage:(r,o)=>tt("/messages/direct",{method:"POST",body:JSON.stringify({destination:r,text:o})}),sendChannelMessage:(r,o)=>tt("/messages/channel",{method:"POST",body:JSON.stringify({channel_key:r,text:o})}),getUndecryptedPacketCount:()=>tt("/packets/undecrypted/count"),decryptHistoricalPackets:r=>tt("/packets/decrypt/historical",{method:"POST",body:JSON.stringify(r)}),getSettings:()=>tt("/settings"),updateSettings:r=>tt("/settings",{method:"PATCH",body:JSON.stringify(r)})};function uv(r){const o=N.useRef(null),a=N.useRef(null),[s,c]=N.useState(!1),l=N.useCallback(()=>{const p=window.location.protocol==="https:"?"wss:":"ws:",f=window.location.port==="5173"?"ws://localhost:8000/api/ws":`${p}//${window.location.host}/api/ws`,h=new WebSocket(f);h.onopen=()=>{console.log("WebSocket connected"),c(!0)},h.onclose=()=>{console.log("WebSocket disconnected"),c(!1),o.current=null,a.current=window.setTimeout(()=>{console.log("Attempting WebSocket reconnect..."),l()},3e3)},h.onerror=v=>{console.error("WebSocket error:",v)},h.onmessage=v=>{var m,g,S,_,C,x,w,k;try{const b=JSON.parse(v.data);switch(b.type){case"health":(m=r.onHealth)==null||m.call(r,b.data);break;case"contacts":(g=r.onContacts)==null||g.call(r,b.data);break;case"channels":(S=r.onChannels)==null||S.call(r,b.data);break;case"message":(_=r.onMessage)==null||_.call(r,b.data);break;case"contact":(C=r.onContact)==null||C.call(r,b.data);break;case"raw_packet":(x=r.onRawPacket)==null||x.call(r,b.data);break;case"message_acked":(w=r.onMessageAcked)==null||w.call(r,b.data.message_id);break;case"error":(k=r.onError)==null||k.call(r,b.data);break;case"pong":break;default:console.log("Unknown WebSocket message type:",b.type)}}catch(b){console.error("Failed to parse WebSocket message:",b)}},o.current=h},[r]);return N.useEffect(()=>{l();const p=setInterval(()=>{var u;((u=o.current)==null?void 0:u.readyState)===WebSocket.OPEN&&o.current.send("ping")},3e4);return()=>{clearInterval(p),a.current&&clearTimeout(a.current),o.current&&o.current.close()}},[l]),{connected:s}}/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dv=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fv=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),sh=r=>{const o=fv(r);return o.charAt(0).toUpperCase()+o.slice(1)},e0=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),hv=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var pv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mv=N.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:p,...u},f)=>N.createElement("svg",{ref:f,...pv,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:e0("lucide",c),...!l&&!hv(u)&&{"aria-hidden":"true"},...u},[...p.map(([h,v])=>N.createElement(h,v)),...Array.isArray(l)?l:[l]]));/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nu=(r,o)=>{const a=N.forwardRef(({className:s,...c},l)=>N.createElement(mv,{ref:l,iconNode:o,className:e0(`lucide-${dv(sh(r))}`,`lucide-${r}`,s),...c}));return a.displayName=sh(r),a};/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yv=nu("check",vv);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gv=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xv=nu("menu",gv);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],t0=nu("x",wv);var r0=Jh();const n0=Zh(r0);function bv(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const _v=r=>{switch(r){case"success":return Cv;case"info":return Tv;case"warning":return Ev;case"error":return Pv;default:return null}},Sv=Array(12).fill(0),kv=({visible:r,className:o})=>fe.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},fe.createElement("div",{className:"sonner-spinner"},Sv.map((a,s)=>fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Cv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ev=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Tv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Pv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Rv=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Nv=()=>{const[r,o]=fe.useState(document.hidden);return fe.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Vc=1;class Av{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Vc++,p=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),p?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,p;const u=c.then(async h=>{if(p=["resolve",h],fe.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(jv(h)&&!h.ok){l=!1;const m=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,g=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,_=typeof m=="object"&&!fe.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:g,..._})}else if(h instanceof Error){l=!1;const m=typeof a.error=="function"?await a.error(h):a.error,g=typeof a.description=="function"?await a.description(h):a.description,_=typeof m=="object"&&!fe.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:g,..._})}else if(a.success!==void 0){l=!1;const m=typeof a.success=="function"?await a.success(h):a.success,g=typeof a.description=="function"?await a.description(h):a.description,_=typeof m=="object"&&!fe.isValidElement(m)?m:{message:m};this.create({id:s,type:"success",description:g,..._})}}).catch(async h=>{if(p=["reject",h],a.error!==void 0){l=!1;const v=typeof a.error=="function"?await a.error(h):a.error,m=typeof a.description=="function"?await a.description(h):a.description,S=typeof v=="object"&&!fe.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:m,...S})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),f=()=>new Promise((h,v)=>u.then(()=>p[0]==="reject"?v(p[1]):h(p[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:f}:Object.assign(s,{unwrap:f})},this.custom=(o,a)=>{const s=(a==null?void 0:a.id)||Vc++;return this.create({jsx:o(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const or=new Av,Bv=(r,o)=>{const a=(o==null?void 0:o.id)||Vc++;return or.addToast({title:r,...o,id:a}),a},jv=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",Dv=Bv,Ov=()=>or.toasts,Mv=()=>or.getActiveToasts(),ba=Object.assign(Dv,{success:or.success,info:or.info,warning:or.warning,error:or.error,custom:or.custom,message:or.message,promise:or.promise,dismiss:or.dismiss,loading:or.loading},{getHistory:Ov,getToasts:Mv});bv("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ms(r){return r.label!==void 0}const Iv=3,Fv="24px",Hv="16px",ih=4e3,Lv=356,zv=14,Uv=45,Vv=200;function Ir(...r){return r.filter(Boolean).join(" ")}function Wv(r){const[o,a]=r.split("-"),s=[];return o&&s.push(o),a&&s.push(a),s}const Kv=r=>{var o,a,s,c,l,p,u,f,h;const{invert:v,toast:m,unstyled:g,interacting:S,setHeights:_,visibleToasts:C,heights:x,index:w,toasts:k,expanded:b,removeToast:R,defaultRichColors:P,closeButton:j,style:B,cancelButtonStyle:D,actionButtonStyle:F,className:O="",descriptionClassName:L="",duration:G,position:$,gap:J,expandByDefault:ae,classNames:Q,icons:ne,closeButtonAriaLabel:U="Close toast"}=r,[te,X]=fe.useState(null),[E,I]=fe.useState(null),[H,V]=fe.useState(!1),[re,ce]=fe.useState(!1),[pe,oe]=fe.useState(!1),[Ae,ze]=fe.useState(!1),[dt,it]=fe.useState(!1),[ft,Ze]=fe.useState(0),[ar,Vt]=fe.useState(0),Tt=fe.useRef(m.duration||G||ih),Wt=fe.useRef(null),ht=fe.useRef(null),Dt=w===0,nt=w+1<=C,Ue=m.type,pt=m.dismissible!==!1,$t=m.className||"",dr=m.descriptionClassName||"",Z=fe.useMemo(()=>x.findIndex(Ee=>Ee.toastId===m.id)||0,[x,m.id]),he=fe.useMemo(()=>{var Ee;return(Ee=m.closeButton)!=null?Ee:j},[m.closeButton,j]),Te=fe.useMemo(()=>m.duration||G||ih,[m.duration,G]),Ce=fe.useRef(0),De=fe.useRef(0),Ke=fe.useRef(0),Qe=fe.useRef(null),[Yt,Pt]=$.split("-"),ee=fe.useMemo(()=>x.reduce((Ee,qe,ot)=>ot>=Z?Ee:Ee+qe.height,0),[x,Z]),le=Nv(),ve=m.invert||v,je=Ue==="loading";De.current=fe.useMemo(()=>Z*J+ee,[Z,ee]),fe.useEffect(()=>{Tt.current=Te},[Te]),fe.useEffect(()=>{V(!0)},[]),fe.useEffect(()=>{const Ee=ht.current;if(Ee){const qe=Ee.getBoundingClientRect().height;return Vt(qe),_(ot=>[{toastId:m.id,height:qe,position:m.position},...ot]),()=>_(ot=>ot.filter(mt=>mt.toastId!==m.id))}},[_,m.id]),fe.useLayoutEffect(()=>{if(!H)return;const Ee=ht.current,qe=Ee.style.height;Ee.style.height="auto";const ot=Ee.getBoundingClientRect().height;Ee.style.height=qe,Vt(ot),_(mt=>mt.find(He=>He.toastId===m.id)?mt.map(He=>He.toastId===m.id?{...He,height:ot}:He):[{toastId:m.id,height:ot,position:m.position},...mt])},[H,m.title,m.description,_,m.id,m.jsx,m.action,m.cancel]);const Ne=fe.useCallback(()=>{ce(!0),Ze(De.current),_(Ee=>Ee.filter(qe=>qe.toastId!==m.id)),setTimeout(()=>{R(m)},Vv)},[m,R,_,De]);fe.useEffect(()=>{if(m.promise&&Ue==="loading"||m.duration===1/0||m.type==="loading")return;let Ee;return b||S||le?(()=>{if(Ke.current{Tt.current!==1/0&&(Ce.current=new Date().getTime(),Ee=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ne()},Tt.current))})(),()=>clearTimeout(Ee)},[b,S,m,Ue,le,Ne]),fe.useEffect(()=>{m.delete&&(Ne(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ne,m.delete]);function Oe(){var Ee;if(ne!=null&&ne.loading){var qe;return fe.createElement("div",{className:Ir(Q==null?void 0:Q.loader,m==null||(qe=m.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":Ue==="loading"},ne.loading)}return fe.createElement(kv,{className:Ir(Q==null?void 0:Q.loader,m==null||(Ee=m.classNames)==null?void 0:Ee.loader),visible:Ue==="loading"})}const Fe=m.icon||(ne==null?void 0:ne[Ue])||_v(Ue);var Ve,Kt;return fe.createElement("li",{tabIndex:0,ref:ht,className:Ir(O,$t,Q==null?void 0:Q.toast,m==null||(o=m.classNames)==null?void 0:o.toast,Q==null?void 0:Q.default,Q==null?void 0:Q[Ue],m==null||(a=m.classNames)==null?void 0:a[Ue]),"data-sonner-toast":"","data-rich-colors":(Ve=m.richColors)!=null?Ve:P,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":H,"data-promise":!!m.promise,"data-swiped":dt,"data-removed":re,"data-visible":nt,"data-y-position":Yt,"data-x-position":Pt,"data-index":w,"data-front":Dt,"data-swiping":pe,"data-dismissible":pt,"data-type":Ue,"data-invert":ve,"data-swipe-out":Ae,"data-swipe-direction":E,"data-expanded":!!(b||ae&&H),"data-testid":m.testId,style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${re?ft:De.current}px`,"--initial-height":ae?"auto":`${ar}px`,...B,...m.style},onDragEnd:()=>{oe(!1),X(null),Qe.current=null},onPointerDown:Ee=>{Ee.button!==2&&(je||!pt||(Wt.current=new Date,Ze(De.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(oe(!0),Qe.current={x:Ee.clientX,y:Ee.clientY})))},onPointerUp:()=>{var Ee,qe,ot;if(Ae||!pt)return;Qe.current=null;const mt=Number(((Ee=ht.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fr=Number(((qe=ht.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),He=new Date().getTime()-((ot=Wt.current)==null?void 0:ot.getTime()),Je=te==="x"?mt:fr,wr=Math.abs(Je)/He;if(Math.abs(Je)>=Uv||wr>.11){Ze(De.current),m.onDismiss==null||m.onDismiss.call(m,m),I(te==="x"?mt>0?"right":"left":fr>0?"down":"up"),Ne(),ze(!0);return}else{var $e,vt;($e=ht.current)==null||$e.style.setProperty("--swipe-amount-x","0px"),(vt=ht.current)==null||vt.style.setProperty("--swipe-amount-y","0px")}it(!1),oe(!1),X(null)},onPointerMove:Ee=>{var qe,ot,mt;if(!Qe.current||!pt||((qe=window.getSelection())==null?void 0:qe.toString().length)>0)return;const He=Ee.clientY-Qe.current.y,Je=Ee.clientX-Qe.current.x;var wr;const $e=(wr=r.swipeDirections)!=null?wr:Wv($);!te&&(Math.abs(Je)>1||Math.abs(He)>1)&&X(Math.abs(Je)>Math.abs(He)?"x":"y");let vt={x:0,y:0};const br=Xt=>1/(1.5+Math.abs(Xt)/20);if(te==="y"){if($e.includes("top")||$e.includes("bottom"))if($e.includes("top")&&He<0||$e.includes("bottom")&&He>0)vt.y=He;else{const Xt=He*br(He);vt.y=Math.abs(Xt)0)vt.x=Je;else{const Xt=Je*br(Je);vt.x=Math.abs(Xt)0||Math.abs(vt.y)>0)&&it(!0),(ot=ht.current)==null||ot.style.setProperty("--swipe-amount-x",`${vt.x}px`),(mt=ht.current)==null||mt.style.setProperty("--swipe-amount-y",`${vt.y}px`)}},he&&!m.jsx&&Ue!=="loading"?fe.createElement("button",{"aria-label":U,"data-disabled":je,"data-close-button":!0,onClick:je||!pt?()=>{}:()=>{Ne(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Ir(Q==null?void 0:Q.closeButton,m==null||(s=m.classNames)==null?void 0:s.closeButton)},(Kt=ne==null?void 0:ne.close)!=null?Kt:Rv):null,(Ue||m.icon||m.promise)&&m.icon!==null&&((ne==null?void 0:ne[Ue])!==null||m.icon)?fe.createElement("div",{"data-icon":"",className:Ir(Q==null?void 0:Q.icon,m==null||(c=m.classNames)==null?void 0:c.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Oe():null,m.type!=="loading"?Fe:null):null,fe.createElement("div",{"data-content":"",className:Ir(Q==null?void 0:Q.content,m==null||(l=m.classNames)==null?void 0:l.content)},fe.createElement("div",{"data-title":"",className:Ir(Q==null?void 0:Q.title,m==null||(p=m.classNames)==null?void 0:p.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?fe.createElement("div",{"data-description":"",className:Ir(L,dr,Q==null?void 0:Q.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),fe.isValidElement(m.cancel)?m.cancel:m.cancel&&Ms(m.cancel)?fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Ee=>{Ms(m.cancel)&&pt&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ee),Ne())},className:Ir(Q==null?void 0:Q.cancelButton,m==null||(f=m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,fe.isValidElement(m.action)?m.action:m.action&&Ms(m.action)?fe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||F,onClick:Ee=>{Ms(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ee),!Ee.defaultPrevented&&Ne())},className:Ir(Q==null?void 0:Q.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function lh(){if(typeof window>"u"||typeof document>"u")return"ltr";const r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function Gv(r,o){const a={};return[r,o].forEach((s,c)=>{const l=c===1,p=l?"--mobile-offset":"--offset",u=l?Hv:Fv;function f(h){["top","right","bottom","left"].forEach(v=>{a[`${p}-${v}`]=typeof h=="number"?`${h}px`:h})}typeof s=="number"||typeof s=="string"?f(s):typeof s=="object"?["top","right","bottom","left"].forEach(h=>{s[h]===void 0?a[`${p}-${h}`]=u:a[`${p}-${h}`]=typeof s[h]=="number"?`${s[h]}px`:s[h]}):f(u)}),a}const qv=fe.forwardRef(function(o,a){const{id:s,invert:c,position:l="bottom-right",hotkey:p=["altKey","KeyT"],expand:u,closeButton:f,className:h,offset:v,mobileOffset:m,theme:g="light",richColors:S,duration:_,style:C,visibleToasts:x=Iv,toastOptions:w,dir:k=lh(),gap:b=zv,icons:R,containerAriaLabel:P="Notifications"}=o,[j,B]=fe.useState([]),D=fe.useMemo(()=>s?j.filter(H=>H.toasterId===s):j.filter(H=>!H.toasterId),[j,s]),F=fe.useMemo(()=>Array.from(new Set([l].concat(D.filter(H=>H.position).map(H=>H.position)))),[D,l]),[O,L]=fe.useState([]),[G,$]=fe.useState(!1),[J,ae]=fe.useState(!1),[Q,ne]=fe.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=fe.useRef(null),te=p.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=fe.useRef(null),E=fe.useRef(!1),I=fe.useCallback(H=>{B(V=>{var re;return(re=V.find(ce=>ce.id===H.id))!=null&&re.delete||or.dismiss(H.id),V.filter(({id:ce})=>ce!==H.id)})},[]);return fe.useEffect(()=>or.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{B(V=>V.map(re=>re.id===H.id?{...re,delete:!0}:re))});return}setTimeout(()=>{n0.flushSync(()=>{B(V=>{const re=V.findIndex(ce=>ce.id===H.id);return re!==-1?[...V.slice(0,re),{...V[re],...H},...V.slice(re+1)]:[H,...V]})})})}),[j]),fe.useEffect(()=>{if(g!=="system"){ne(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:V})=>{ne(V?"dark":"light")})}catch{H.addListener(({matches:re})=>{try{ne(re?"dark":"light")}catch(ce){console.error(ce)}})}},[g]),fe.useEffect(()=>{j.length<=1&&$(!1)},[j]),fe.useEffect(()=>{const H=V=>{var re;if(p.every(oe=>V[oe]||V.code===oe)){var pe;$(!0),(pe=U.current)==null||pe.focus()}V.code==="Escape"&&(document.activeElement===U.current||(re=U.current)!=null&&re.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[p]),fe.useEffect(()=>{if(U.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,E.current=!1)}},[U.current]),fe.createElement("section",{ref:a,"aria-label":`${P} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((H,V)=>{var re;const[ce,pe]=H.split("-");return D.length?fe.createElement("ol",{key:H,dir:k==="auto"?lh():k,tabIndex:-1,ref:U,className:h,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":ce,"data-x-position":pe,style:{"--front-toast-height":`${((re=O[0])==null?void 0:re.height)||0}px`,"--width":`${Lv}px`,"--gap":`${b}px`,...C,...Gv(v,m)},onBlur:oe=>{E.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(E.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||E.current||(E.current=!0,X.current=oe.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{J||$(!1)},onDragEnd:()=>$(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ae(!0)},onPointerUp:()=>ae(!1)},D.filter(oe=>!oe.position&&V===0||oe.position===H).map((oe,Ae)=>{var ze,dt;return fe.createElement(Kv,{key:oe.id,icons:R,index:Ae,toast:oe,defaultRichColors:S,duration:(ze=w==null?void 0:w.duration)!=null?ze:_,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:c,visibleToasts:x,closeButton:(dt=w==null?void 0:w.closeButton)!=null?dt:f,interacting:J,position:H,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:I,toasts:D.filter(it=>it.position==oe.position),heights:O.filter(it=>it.position==oe.position),setHeights:L,expandByDefault:u,gap:b,expanded:G,swipeDirections:o.swipeDirections})})):null}))}),$v=({...r})=>A.jsx(qv,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",error:"group-[.toaster]:bg-[#2a1a1a] group-[.toaster]:text-[#e8a0a0] group-[.toaster]:border-[#4a2a2a] [&_[data-description]]:text-[#b08080]"}},...r});function Yv({health:r,config:o,onConfigClick:a,onAdvertise:s,onMenuClick:c}){const l=(r==null?void 0:r.radio_connected)??!1,[p,u]=N.useState(!1),f=async()=>{u(!0);try{const h=await rt.reconnectRadio();h.connected&&ba.success("Reconnected",{description:h.message})}catch(h){ba.error("Reconnection failed",{description:h instanceof Error?h.message:"Check radio connection and power"})}finally{u(!1)}};return A.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[c&&A.jsx("button",{onClick:c,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:A.jsx(xv,{className:"h-5 w-5"})}),A.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),A.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[A.jsx("div",{className:`w-2 h-2 rounded-full ${l?"bg-[#4caf50]":"bg-[#666]"}`}),A.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:l?"Connected":"Disconnected"})]}),(r==null?void 0:r.serial_port)&&A.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",A.jsx("span",{className:"text-[#e0e0e0]",children:r.serial_port})]}),o&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:["Name: ",A.jsx("span",{className:"text-[#e0e0e0]",children:o.name||"Unnamed"})]}),A.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Freq: ",A.jsxs("span",{className:"text-[#e0e0e0]",children:[o.radio.freq," MHz"]})]}),A.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["SF",o.radio.sf,"/CR",o.radio.cr]}),A.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["TX: ",A.jsxs("span",{className:"text-[#e0e0e0]",children:[o.tx_power," dBm"]})]})]}),A.jsx("div",{className:"flex-1 lg:hidden"}),!l&&A.jsx("button",{onClick:f,disabled:p,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:p?"Reconnecting...":"Reconnect"}),A.jsx("button",{onClick:s,disabled:!l,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),A.jsx("button",{onClick:a,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:"Config"})]})}const Xv=12;function Co(r){return r.slice(0,Xv)}function o0(r,o){return!r||!o?!1:Co(r)===Co(o)}function Sa(r,o){return r||Co(o)}const Wc="remoteterm-lastMessageTime",Kc="remoteterm-lastReadTime";function fi(r){try{const o=localStorage.getItem(r);return o?JSON.parse(o):{}}catch{return{}}}function a0(r,o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}}function ch(){return fi(Wc)}function Qv(){return fi(Kc)}function fc(r,o){const a=fi(Wc);return(!a[r]||o>a[r])&&(a[r]=o,a0(Wc,a)),a}function Zv(r,o){const a=fi(Kc);return a[r]=o,a0(Kc,a),a}function Un(r,o){return r==="channel"?`channel-${o}`:`contact-${Co(o)}`}const Gc=2,Jv={text:"🛜",background:"#444444",textColor:"#ffffff"};function e2(r){let o=0;for(let a=0;a>8)%30,c=35+(o>>16)%20,l=`hsl(${a}, ${s}%, ${c}%)`,p=c<45?"#ffffff":"#000000";return{background:l,text:p}}function o2(r,o,a){if(a===Gc)return Jv;const s=r2(r,o),c=n2(o);return{text:s,background:c.background,textColor:c.text}}function s0({name:r,publicKey:o,size:a=28,contactType:s}){const c=o2(r,o,s);return A.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:a,height:a,fontSize:a*.45},children:c.text})}function i0(r){var o,a,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(o=0;o{const a=new Array(r.length+o.length);for(let s=0;s({classGroupId:r,validator:o}),c0=(r=new Map,o=null,a)=>({nextPart:r,validators:o,classGroupId:a}),ci="-",uh=[],i2="arbitrary..",l2=r=>{const o=u2(r),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return c2(p);const u=p.split(ci),f=u[0]===""&&u.length>1?1:0;return u0(u,f,o)},getConflictingClassGroupIds:(p,u)=>{if(u){const f=s[p],h=a[p];return f?h?a2(h,f):f:h||uh}return a[p]||uh}}},u0=(r,o,a)=>{if(r.length-o===0)return a.classGroupId;const c=r[o],l=a.nextPart.get(c);if(l){const h=u0(r,o+1,l);if(h)return h}const p=a.validators;if(p===null)return;const u=o===0?r.join(ci):r.slice(o).join(ci),f=p.length;for(let h=0;hr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=r.slice(1,-1),a=o.indexOf(":"),s=o.slice(0,a);return s?i2+s:void 0})(),u2=r=>{const{theme:o,classGroups:a}=r;return d2(a,o)},d2=(r,o)=>{const a=c0();for(const s in r){const c=r[s];ou(c,a,s,o)}return a},ou=(r,o,a,s)=>{const c=r.length;for(let l=0;l{if(typeof r=="string"){h2(r,o,a);return}if(typeof r=="function"){p2(r,o,a,s);return}m2(r,o,a,s)},h2=(r,o,a)=>{const s=r===""?o:d0(o,r);s.classGroupId=a},p2=(r,o,a,s)=>{if(v2(r)){ou(r(s),o,a,s);return}o.validators===null&&(o.validators=[]),o.validators.push(s2(a,r))},m2=(r,o,a,s)=>{const c=Object.entries(r),l=c.length;for(let p=0;p{let a=r;const s=o.split(ci),c=s.length;for(let l=0;l"isThemeGetter"in r&&r.isThemeGetter===!0,y2=r=>{if(r<1)return{get:()=>{},set:()=>{}};let o=0,a=Object.create(null),s=Object.create(null);const c=(l,p)=>{a[l]=p,o++,o>r&&(o=0,s=a,a=Object.create(null))};return{get(l){let p=a[l];if(p!==void 0)return p;if((p=s[l])!==void 0)return c(l,p),p},set(l,p){l in a?a[l]=p:c(l,p)}}},qc="!",dh=":",g2=[],fh=(r,o,a,s,c)=>({modifiers:r,hasImportantModifier:o,baseClassName:a,maybePostfixModifierPosition:s,isExternal:c}),x2=r=>{const{prefix:o,experimentalParseClassName:a}=r;let s=c=>{const l=[];let p=0,u=0,f=0,h;const v=c.length;for(let C=0;Cf?h-f:void 0;return fh(l,S,g,_)};if(o){const c=o+dh,l=s;s=p=>p.startsWith(c)?l(p.slice(c.length)):fh(g2,!1,p,void 0,!0)}if(a){const c=s;s=l=>a({className:l,parseClassName:c})}return s},w2=r=>{const o=new Map;return r.orderSensitiveModifiers.forEach((a,s)=>{o.set(a,1e6+s)}),a=>{const s=[];let c=[];for(let l=0;l0&&(c.sort(),s.push(...c),c=[]),s.push(p)):c.push(p)}return c.length>0&&(c.sort(),s.push(...c)),s}},b2=r=>({cache:y2(r.cacheSize),parseClassName:x2(r),sortModifiers:w2(r),...l2(r)}),_2=/\s+/,S2=(r,o)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:c,sortModifiers:l}=o,p=[],u=r.trim().split(_2);let f="";for(let h=u.length-1;h>=0;h-=1){const v=u[h],{isExternal:m,modifiers:g,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:C}=a(v);if(m){f=v+(f.length>0?" "+f:f);continue}let x=!!C,w=s(x?_.substring(0,C):_);if(!w){if(!x){f=v+(f.length>0?" "+f:f);continue}if(w=s(_),!w){f=v+(f.length>0?" "+f:f);continue}x=!1}const k=g.length===0?"":g.length===1?g[0]:l(g).join(":"),b=S?k+qc:k,R=b+w;if(p.indexOf(R)>-1)continue;p.push(R);const P=c(w,x);for(let j=0;j0?" "+f:f)}return f},k2=(...r)=>{let o=0,a,s,c="";for(;o{if(typeof r=="string")return r;let o,a="";for(let s=0;s{let a,s,c,l;const p=f=>{const h=o.reduce((v,m)=>m(v),r());return a=b2(h),s=a.cache.get,c=a.cache.set,l=u,u(f)},u=f=>{const h=s(f);if(h)return h;const v=S2(f,a);return c(f,v),v};return l=p,(...f)=>l(k2(...f))},E2=[],Ct=r=>{const o=a=>a[r]||E2;return o.isThemeGetter=!0,o},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T2=/^\d+\/\d+$/,P2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,N2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mo=r=>T2.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),xn=r=>!!r&&Number.isInteger(Number(r)),hc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Qr=r=>P2.test(r),j2=()=>!0,D2=r=>R2.test(r)&&!N2.test(r),m0=()=>!1,O2=r=>A2.test(r),M2=r=>B2.test(r),I2=r=>!we(r)&&!be(r),F2=r=>Po(r,g0,m0),we=r=>h0.test(r),Fn=r=>Po(r,x0,D2),pc=r=>Po(r,V2,Me),hh=r=>Po(r,v0,m0),H2=r=>Po(r,y0,M2),Is=r=>Po(r,w0,O2),be=r=>p0.test(r),fa=r=>Ro(r,x0),L2=r=>Ro(r,W2),ph=r=>Ro(r,v0),z2=r=>Ro(r,g0),U2=r=>Ro(r,y0),Fs=r=>Ro(r,w0,!0),Po=(r,o,a)=>{const s=h0.exec(r);return s?s[1]?o(s[1]):a(s[2]):!1},Ro=(r,o,a=!1)=>{const s=p0.exec(r);return s?s[1]?o(s[1]):a:!1},v0=r=>r==="position"||r==="percentage",y0=r=>r==="image"||r==="url",g0=r=>r==="length"||r==="size"||r==="bg-size",x0=r=>r==="length",V2=r=>r==="number",W2=r=>r==="family-name",w0=r=>r==="shadow",K2=()=>{const r=Ct("color"),o=Ct("font"),a=Ct("text"),s=Ct("font-weight"),c=Ct("tracking"),l=Ct("leading"),p=Ct("breakpoint"),u=Ct("container"),f=Ct("spacing"),h=Ct("radius"),v=Ct("shadow"),m=Ct("inset-shadow"),g=Ct("text-shadow"),S=Ct("drop-shadow"),_=Ct("blur"),C=Ct("perspective"),x=Ct("aspect"),w=Ct("ease"),k=Ct("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...R(),be,we],j=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],D=()=>[be,we,f],F=()=>[mo,"full","auto",...D()],O=()=>[xn,"none","subgrid",be,we],L=()=>["auto",{span:["full",xn,be,we]},xn,be,we],G=()=>[xn,"auto",be,we],$=()=>["auto","min","max","fr",be,we],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...D()],ne=()=>[mo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],U=()=>[r,be,we],te=()=>[...R(),ph,hh,{position:[be,we]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",z2,F2,{size:[be,we]}],I=()=>[hc,fa,Fn],H=()=>["","none","full",h,be,we],V=()=>["",Me,fa,Fn],re=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Me,hc,ph,hh],oe=()=>["","none",_,be,we],Ae=()=>["none",Me,be,we],ze=()=>["none",Me,be,we],dt=()=>[Me,be,we],it=()=>[mo,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qr],breakpoint:[Qr],color:[j2],container:[Qr],"drop-shadow":[Qr],ease:["in","out","in-out"],font:[I2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qr],shadow:[Qr],spacing:["px",Me],text:[Qr],"text-shadow":[Qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mo,we,be,x]}],container:["container"],columns:[{columns:[Me,we,be,u]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[xn,"auto",be,we]}],basis:[{basis:[mo,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,mo,"auto","initial","none",we]}],grow:[{grow:["",Me,be,we]}],shrink:[{shrink:["",Me,be,we]}],order:[{order:[xn,"first","last","none",be,we]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[u,"screen",...ne()]}],"min-w":[{"min-w":[u,"screen","none",...ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[p]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh",...ne()]}],"font-size":[{text:["base",a,fa,Fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,be,pc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hc,we]}],"font-family":[{font:[L2,we,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,be,we]}],"line-clamp":[{"line-clamp":[Me,"none",be,pc]}],leading:[{leading:[l,...D()]}],"list-image":[{"list-image":["none",be,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",be,Fn]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Me,"auto",be,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xn,be,we],radial:["",be,we],conic:[xn,be,we]},U2,H2]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,be,we]}],"outline-w":[{outline:["",Me,fa,Fn]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",v,Fs,Is]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",m,Fs,Is]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Me,Fn]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,Fs,Is]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Me,be,we]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[be,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,we]}],filter:[{filter:["","none",be,we]}],blur:[{blur:oe()}],brightness:[{brightness:[Me,be,we]}],contrast:[{contrast:[Me,be,we]}],"drop-shadow":[{"drop-shadow":["","none",S,Fs,Is]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Me,be,we]}],"hue-rotate":[{"hue-rotate":[Me,be,we]}],invert:[{invert:["",Me,be,we]}],saturate:[{saturate:[Me,be,we]}],sepia:[{sepia:["",Me,be,we]}],"backdrop-filter":[{"backdrop-filter":["","none",be,we]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Me,be,we]}],"backdrop-contrast":[{"backdrop-contrast":[Me,be,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,be,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,be,we]}],"backdrop-invert":[{"backdrop-invert":["",Me,be,we]}],"backdrop-opacity":[{"backdrop-opacity":[Me,be,we]}],"backdrop-saturate":[{"backdrop-saturate":[Me,be,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,be,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",be,we]}],ease:[{ease:["linear","initial",w,be,we]}],delay:[{delay:[Me,be,we]}],animate:[{animate:["none",k,be,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,we]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:ze()}],"scale-x":[{"scale-x":ze()}],"scale-y":[{"scale-y":ze()}],"scale-z":[{"scale-z":ze()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[be,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,we]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Me,fa,Fn,pc]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},G2=C2(K2);function Xe(...r){return G2(l0(r))}const _t=N.forwardRef(({className:r,type:o,...a},s)=>A.jsx("input",{type:o,className:Xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:s,...a}));_t.displayName="Input";function mh(r,o){if(typeof r=="function")return r(o);r!=null&&(r.current=o)}function Ca(...r){return o=>{let a=!1;const s=r.map(c=>{const l=mh(c,o);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let c=0;c{let{children:l,...p}=s;b0(l)&&typeof ui=="function"&&(l=ui(l._payload));const u=N.Children.toArray(l),f=u.find(Z2);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}var Y2=au("Slot");function X2(r){const o=N.forwardRef((a,s)=>{let{children:c,...l}=a;if(b0(c)&&typeof ui=="function"&&(c=ui(c._payload)),N.isValidElement(c)){const p=ey(c),u=J2(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var Q2=Symbol("radix.slottable");function Z2(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Q2}function J2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ey(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}const vh=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,yh=l0,hi=(r,o)=>a=>{var s;if((o==null?void 0:o.variants)==null)return yh(r,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:c,defaultVariants:l}=o,p=Object.keys(c).map(h=>{const v=a==null?void 0:a[h],m=l==null?void 0:l[h];if(v===null)return null;const g=vh(v)||vh(m);return c[h][g]}),u=a&&Object.entries(a).reduce((h,v)=>{let[m,g]=v;return g===void 0||(h[m]=g),h},{}),f=o==null||(s=o.compoundVariants)===null||s===void 0?void 0:s.reduce((h,v)=>{let{class:m,className:g,...S}=v;return Object.entries(S).every(_=>{let[C,x]=_;return Array.isArray(x)?x.includes({...l,...u}[C]):{...l,...u}[C]===x})?[...h,m,g]:h},[]);return yh(r,p,f,a==null?void 0:a.class,a==null?void 0:a.className)},ty=hi("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ur=N.forwardRef(({className:r,variant:o,size:a,asChild:s=!1,...c},l)=>{const p=s?Y2:"button";return A.jsx(p,{className:Xe(ty({variant:o,size:a,className:r})),ref:l,...c})});Ur.displayName="Button";function ry(){try{return localStorage.getItem("remoteterm-sortOrder")==="recent"?"recent":"alpha"}catch{return"alpha"}}function ny(r){try{localStorage.setItem("remoteterm-sortOrder",r)}catch{}}function oy({contacts:r,channels:o,activeConversation:a,onSelectConversation:s,onNewMessage:c,lastMessageTimes:l,unreadCounts:p}){const[u,f]=N.useState(ry),[h,v]=N.useState(""),m=()=>{const B=u==="alpha"?"recent":"alpha";f(B),ny(B)},g=B=>{v(""),s(B)},S=(B,D)=>(a==null?void 0:a.type)===B&&(a==null?void 0:a.id)===D,_=(B,D)=>{const F=Un(B,D);return p[F]||0},C=(B,D)=>{const F=Un(B,D);return l[F]||0},x=o.reduce((B,D)=>(B.some(F=>F.name===D.name)||B.push(D),B),[]),w=r.filter(B=>B.public_key&&B.public_key.length>0).sort((B,D)=>B.name&&!D.name?-1:!B.name&&D.name?1:(B.name||"").localeCompare(D.name||"")).reduce((B,D)=>{const F=Co(D.public_key);return B.some(O=>Co(O.public_key)===F)||B.push(D),B},[]),k=[...x].sort((B,D)=>{if(B.name==="Public")return-1;if(D.name==="Public")return 1;if(u==="recent"){const F=C("channel",B.key),O=C("channel",D.key);if(F&&O)return O-F;if(F&&!O)return-1;if(!F&&O)return 1}return B.name.localeCompare(D.name)}),b=[...w].sort((B,D)=>{const F=B.type===Gc,O=D.type===Gc;if(F&&!O)return 1;if(!F&&O)return-1;if(F&&O)return(B.name||B.public_key).localeCompare(D.name||D.public_key);if(u==="recent"){const L=C("contact",B.public_key),G=C("contact",D.public_key);if(L&&G)return G-L;if(L&&!G)return-1;if(!L&&G)return 1}return(B.name||B.public_key).localeCompare(D.name||D.public_key)}),R=h.toLowerCase().trim(),P=R?k.filter(B=>B.name.toLowerCase().includes(R)):k,j=R?b.filter(B=>{var D;return((D=B.name)==null?void 0:D.toLowerCase().includes(R))||B.public_key.toLowerCase().includes(R)}):b;return A.jsxs("div",{className:"sidebar w-60 h-full min-h-0 bg-card border-r border-border flex flex-col",children:[A.jsxs("div",{className:"flex justify-between items-center px-3 py-3 border-b border-border",children:[A.jsx("h2",{className:"text-xs uppercase text-muted-foreground font-medium",children:"Conversations"}),A.jsx(Ur,{variant:"ghost",size:"sm",onClick:c,title:"New Message",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:"+"})]}),A.jsxs("div",{className:"relative px-3 py-2 border-b border-border",children:[A.jsx(_t,{type:"text",placeholder:"Search...",value:h,onChange:B=>v(B.target.value),className:"h-8 text-sm pr-8"}),h&&A.jsx("button",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground text-lg leading-none",onClick:()=>v(""),title:"Clear search",children:"×"})]}),A.jsxs("div",{className:"flex-1 overflow-y-auto",children:[!R&&A.jsxs("div",{className:Xe("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",S("raw","raw")&&"bg-accent border-l-primary"),onClick:()=>g({type:"raw",id:"raw",name:"Raw Packet Feed"}),children:[A.jsx("span",{className:"text-muted-foreground text-xs",children:"📡"}),A.jsx("span",{className:"flex-1 truncate",children:"Packet Feed"})]}),P.length>0&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex justify-between items-center px-3 py-2 pt-3",children:[A.jsx("span",{className:"text-[11px] uppercase text-muted-foreground",children:"Channels"}),A.jsx("button",{className:"bg-transparent border border-border text-muted-foreground px-1.5 py-0.5 text-[10px] rounded hover:bg-accent hover:text-foreground",onClick:m,title:u==="alpha"?"Sort by recent":"Sort alphabetically",children:u==="alpha"?"A-Z":"⏱"})]}),P.map(B=>{const D=_("channel",B.key);return A.jsxs("div",{className:Xe("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",S("channel",B.key)&&"bg-accent border-l-primary",D>0&&"[&_.name]:font-bold [&_.name]:text-foreground"),onClick:()=>g({type:"channel",id:B.key,name:B.name}),children:[A.jsx("span",{className:"text-muted-foreground text-xs",children:"#"}),A.jsx("span",{className:"name flex-1 truncate",children:B.name}),D>0&&A.jsx("span",{className:"bg-primary text-primary-foreground text-[10px] font-semibold px-1.5 py-0.5 rounded-full min-w-[18px] text-center",children:D})]},`chan-${B.key}`)})]}),j.length>0&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex justify-between items-center px-3 py-2 pt-3",children:[A.jsx("span",{className:"text-[11px] uppercase text-muted-foreground",children:"Contacts"}),P.length===0&&A.jsx("button",{className:"bg-transparent border border-border text-muted-foreground px-1.5 py-0.5 text-[10px] rounded hover:bg-accent hover:text-foreground",onClick:m,title:u==="alpha"?"Sort by recent":"Sort alphabetically",children:u==="alpha"?"A-Z":"⏱"})]}),j.map(B=>{const D=_("contact",B.public_key);return A.jsxs("div",{className:Xe("px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",S("contact",B.public_key)&&"bg-accent border-l-primary",D>0&&"[&_.name]:font-bold [&_.name]:text-foreground"),onClick:()=>g({type:"contact",id:B.public_key,name:Sa(B.name,B.public_key)}),children:[A.jsx(s0,{name:B.name,publicKey:B.public_key,size:24,contactType:B.type}),A.jsx("span",{className:"name flex-1 truncate",children:Sa(B.name,B.public_key)}),D>0&&A.jsx("span",{className:"bg-primary text-primary-foreground text-[10px] font-semibold px-1.5 py-0.5 rounded-full min-w-[18px] text-center",children:D})]},B.public_key)})]}),j.length===0&&P.length===0&&A.jsx("div",{className:"p-5 text-center text-muted-foreground",children:R?"No matches found":"No conversations yet"})]})]})}function gh(r){const o=r.indexOf(": ");if(o>0&&o<50){const a=r.substring(0,o);if(!/[:\[\]]/.test(a))return{sender:a,content:r.substring(o+2)}}return{sender:null,content:r}}function xh(r){const o=new Date(r*1e3),a=new Date,s=o.toDateString()===a.toDateString(),c=o.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s?c:`${o.toLocaleDateString([],{month:"short",day:"numeric"})} ${c}`}function ay({messages:r,contacts:o,loading:a,loadingOlder:s=!1,hasOlderMessages:c=!1,onSenderClick:l,onLoadOlder:p}){const u=N.useRef(null),f=N.useRef(0),h=N.useRef(!0),v=N.useRef({scrollTop:0,scrollHeight:0,wasNearTop:!1});N.useLayoutEffect(()=>{if(!u.current)return;const w=u.current,k=r.length-f.current;if(h.current&&r.length>0)w.scrollTop=w.scrollHeight,h.current=!1;else if(k>0&&f.current>0){const b=w.scrollHeight-v.current.scrollHeight;v.current.wasNearTop&&b>0?w.scrollTop=v.current.scrollTop+b:v.current.wasNearTop||(w.scrollTop=w.scrollHeight)}f.current=r.length},[r]),N.useEffect(()=>{r.length===0&&(h.current=!0,f.current=0,v.current={scrollTop:0,scrollHeight:0,wasNearTop:!1})},[r.length]);const m=N.useCallback(()=>{if(!u.current)return;const{scrollTop:w,scrollHeight:k}=u.current;v.current={scrollTop:w,scrollHeight:k,wasNearTop:w<150},!(!p||s||!c)&&w<100&&p()},[p,s,c]),g=w=>w&&o.find(k=>o0(k.public_key,w))||null,S=w=>o.find(k=>k.name===w)||null;if(a)return A.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-center text-muted-foreground",children:"Loading messages..."});if(r.length===0)return A.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-center text-muted-foreground",children:"No messages yet"});const C=[...r.reduce((w,k)=>{const b=`${k.type}-${k.conversation_key}-${k.text}-${k.sender_timestamp}`;return w.find(P=>`${P.type}-${P.conversation_key}-${P.text}-${P.sender_timestamp}`===b)||w.push(k),w},[])].sort((w,k)=>w.received_at-k.received_at),x=(w,k)=>w.outgoing?"__outgoing__":w.type==="PRIV"&&w.conversation_key?w.conversation_key:k||"__unknown__";return A.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-0.5",ref:u,onScroll:m,children:[s&&A.jsx("div",{className:"text-center py-2 text-muted-foreground text-sm",children:"Loading older messages..."}),!s&&c&&A.jsx("div",{className:"text-center py-2 text-muted-foreground text-xs",children:"Scroll up for older messages"}),C.map((w,k)=>{var ae;const{sender:b,content:R}=gh(w.text),P=w.type==="PRIV"?g(w.conversation_key):null,j=w.outgoing?"You":(P==null?void 0:P.name)||b||((ae=w.conversation_key)==null?void 0:ae.slice(0,8))||"Unknown",B=!w.outgoing&&l&&j!=="Unknown",D=x(w,b),F=C[k-1],O=F?x(F,gh(F.text).sender):null,L=!w.outgoing&&D!==O,G=k===0;let $=null,J="";if(!w.outgoing){if(w.type==="PRIV"&&w.conversation_key)$=(P==null?void 0:P.name)||null,J=w.conversation_key;else if(b){const Q=S(b);$=b,J=(Q==null?void 0:Q.public_key)||`name:${b}`}}return A.jsxs("div",{className:Xe("flex items-start max-w-[85%]",w.outgoing&&"flex-row-reverse self-end",L&&!G&&"mt-3"),children:[!w.outgoing&&A.jsx("div",{className:"w-10 flex-shrink-0 flex items-start pt-0.5",children:L&&J&&A.jsx(s0,{name:$,publicKey:J,size:32})}),A.jsxs("div",{className:Xe("py-1.5 px-3 rounded-lg min-w-0",w.outgoing?"bg-[#1e3a29]":"bg-muted"),children:[L&&A.jsxs("div",{className:"text-[13px] font-semibold text-muted-foreground mb-0.5",children:[B?A.jsx("span",{className:"cursor-pointer hover:text-primary hover:underline",onClick:()=>l(j),title:`Mention ${j}`,children:j}):j,A.jsx("span",{className:"font-normal text-muted-foreground/70 ml-2 text-[11px]",children:xh(w.sender_timestamp||w.received_at)})]}),A.jsxs("div",{className:"break-words whitespace-pre-wrap",children:[R.split(` -`).map((Q,ne,U)=>A.jsxs("span",{children:[Q,ne({appendText:g=>{var S;p(_=>_+g),(S=h.current)==null||S.focus()}}));const v=N.useCallback(async g=>{g.preventDefault();const S=l.trim();if(!(!S||u||a)){f(!0);try{await o(S),p("")}catch(_){console.error("Failed to send message:",_)}finally{f(!1)}}},[l,u,a,o]),m=N.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),v(g))},[v]);return A.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:v,children:[A.jsx(_t,{ref:h,type:"text",value:l,onChange:g=>p(g.target.value),onKeyDown:m,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),A.jsx(Ur,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function Et(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function iy(r,o){const a=N.createContext(o),s=l=>{const{children:p,...u}=l,f=N.useMemo(()=>u,Object.values(u));return A.jsx(a.Provider,{value:f,children:p})};s.displayName=r+"Provider";function c(l){const p=N.useContext(a);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Ea(r,o=[]){let a=[];function s(l,p){const u=N.createContext(p),f=a.length;a=[...a,p];const h=m=>{var w;const{scope:g,children:S,..._}=m,C=((w=g==null?void 0:g[r])==null?void 0:w[f])||u,x=N.useMemo(()=>_,Object.values(_));return A.jsx(C.Provider,{value:x,children:S})};h.displayName=l+"Provider";function v(m,g){var C;const S=((C=g==null?void 0:g[r])==null?void 0:C[f])||u,_=N.useContext(S);if(_)return _;if(p!==void 0)return p;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[h,v]}const c=()=>{const l=a.map(p=>N.createContext(p));return function(u){const f=(u==null?void 0:u[r])||l;return N.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,ly(c,...o)]}function ly(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const p=s.reduce((u,{useScope:f,scopeName:h})=>{const m=f(l)[`__scope${h}`];return{...u,...m}},{});return N.useMemo(()=>({[`__scope${o.scopeName}`]:p}),[p])}};return a.scopeName=o.scopeName,a}var Eo=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},cy=ru[" useId ".trim().toString()]||(()=>{}),uy=0;function _a(r){const[o,a]=N.useState(cy());return Eo(()=>{a(s=>s??String(uy++))},[r]),o?`radix-${o}`:""}var dy=ru[" useInsertionEffect ".trim().toString()]||Eo;function pi({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,p]=fy({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const v=N.useRef(r!==void 0);N.useEffect(()=>{const m=v.current;m!==u&&console.warn(`${s} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=u},[u,s])}const h=N.useCallback(v=>{var m;if(u){const g=hy(v)?v(r):v;g!==r&&((m=p.current)==null||m.call(p,g))}else l(v)},[u,r,l,p]);return[f,h]}function fy({defaultProp:r,onChange:o}){const[a,s]=N.useState(r),c=N.useRef(a),l=N.useRef(o);return dy(()=>{l.current=o},[o]),N.useEffect(()=>{var p;c.current!==a&&((p=l.current)==null||p.call(l,a),c.current=a)},[a,c]),[a,s,l]}function hy(r){return typeof r=="function"}function py(r){const o=my(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find(yy);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function my(r){const o=N.forwardRef((a,s)=>{const{children:c,...l}=a;if(N.isValidElement(c)){const p=xy(c),u=gy(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var vy=Symbol("radix.slottable");function yy(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===vy}function gy(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function xy(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bt=wy.reduce((r,o)=>{const a=py(`Primitive.${o}`),s=N.forwardRef((c,l)=>{const{asChild:p,...u}=c,f=p?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{});function by(r,o){r&&r0.flushSync(()=>r.dispatchEvent(o))}function To(r){const o=N.useRef(r);return N.useEffect(()=>{o.current=r}),N.useMemo(()=>(...a)=>{var s;return(s=o.current)==null?void 0:s.call(o,...a)},[])}function _y(r,o=globalThis==null?void 0:globalThis.document){const a=To(r);N.useEffect(()=>{const s=c=>{c.key==="Escape"&&a(c)};return o.addEventListener("keydown",s,{capture:!0}),()=>o.removeEventListener("keydown",s,{capture:!0})},[a,o])}var Sy="DismissableLayer",$c="dismissableLayer.update",ky="dismissableLayer.pointerDownOutside",Cy="dismissableLayer.focusOutside",wh,_0=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S0=N.forwardRef((r,o)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:p,onDismiss:u,...f}=r,h=N.useContext(_0),[v,m]=N.useState(null),g=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=N.useState({}),_=xr(o,B=>m(B)),C=Array.from(h.layers),[x]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),w=C.indexOf(x),k=v?C.indexOf(v):-1,b=h.layersWithOutsidePointerEventsDisabled.size>0,R=k>=w,P=Py(B=>{const D=B.target,F=[...h.branches].some(O=>O.contains(D));!R||F||(c==null||c(B),p==null||p(B),B.defaultPrevented||u==null||u())},g),j=Ry(B=>{const D=B.target;[...h.branches].some(O=>O.contains(D))||(l==null||l(B),p==null||p(B),B.defaultPrevented||u==null||u())},g);return _y(B=>{k===h.layers.size-1&&(s==null||s(B),!B.defaultPrevented&&u&&(B.preventDefault(),u()))},g),N.useEffect(()=>{if(v)return a&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(wh=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(v)),h.layers.add(v),bh(),()=>{a&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=wh)}},[v,g,a,h]),N.useEffect(()=>()=>{v&&(h.layers.delete(v),h.layersWithOutsidePointerEventsDisabled.delete(v),bh())},[v,h]),N.useEffect(()=>{const B=()=>S({});return document.addEventListener($c,B),()=>document.removeEventListener($c,B)},[]),A.jsx(Bt.div,{...f,ref:_,style:{pointerEvents:b?R?"auto":"none":void 0,...r.style},onFocusCapture:Et(r.onFocusCapture,j.onFocusCapture),onBlurCapture:Et(r.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Et(r.onPointerDownCapture,P.onPointerDownCapture)})});S0.displayName=Sy;var Ey="DismissableLayerBranch",Ty=N.forwardRef((r,o)=>{const a=N.useContext(_0),s=N.useRef(null),c=xr(o,s);return N.useEffect(()=>{const l=s.current;if(l)return a.branches.add(l),()=>{a.branches.delete(l)}},[a.branches]),A.jsx(Bt.div,{...r,ref:c})});Ty.displayName=Ey;function Py(r,o=globalThis==null?void 0:globalThis.document){const a=To(r),s=N.useRef(!1),c=N.useRef(()=>{});return N.useEffect(()=>{const l=u=>{if(u.target&&!s.current){let f=function(){k0(ky,a,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(o.removeEventListener("click",c.current),c.current=f,o.addEventListener("click",c.current,{once:!0})):f()}else o.removeEventListener("click",c.current);s.current=!1},p=window.setTimeout(()=>{o.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(p),o.removeEventListener("pointerdown",l),o.removeEventListener("click",c.current)}},[o,a]),{onPointerDownCapture:()=>s.current=!0}}function Ry(r,o=globalThis==null?void 0:globalThis.document){const a=To(r),s=N.useRef(!1);return N.useEffect(()=>{const c=l=>{l.target&&!s.current&&k0(Cy,a,{originalEvent:l},{discrete:!1})};return o.addEventListener("focusin",c),()=>o.removeEventListener("focusin",c)},[o,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function bh(){const r=new CustomEvent($c);document.dispatchEvent(r)}function k0(r,o,a,{discrete:s}){const c=a.originalEvent.target,l=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:a});o&&c.addEventListener(r,o,{once:!0}),s?by(c,l):c.dispatchEvent(l)}var mc="focusScope.autoFocusOnMount",vc="focusScope.autoFocusOnUnmount",_h={bubbles:!1,cancelable:!0},Ny="FocusScope",C0=N.forwardRef((r,o)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:l,...p}=r,[u,f]=N.useState(null),h=To(c),v=To(l),m=N.useRef(null),g=xr(o,C=>f(C)),S=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(s){let C=function(b){if(S.paused||!u)return;const R=b.target;u.contains(R)?m.current=R:_n(m.current,{select:!0})},x=function(b){if(S.paused||!u)return;const R=b.relatedTarget;R!==null&&(u.contains(R)||_n(m.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const P of b)P.removedNodes.length>0&&_n(u)};document.addEventListener("focusin",C),document.addEventListener("focusout",x);const k=new MutationObserver(w);return u&&k.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",x),k.disconnect()}}},[s,u,S.paused]),N.useEffect(()=>{if(u){kh.add(S);const C=document.activeElement;if(!u.contains(C)){const w=new CustomEvent(mc,_h);u.addEventListener(mc,h),u.dispatchEvent(w),w.defaultPrevented||(Ay(My(E0(u)),{select:!0}),document.activeElement===C&&_n(u))}return()=>{u.removeEventListener(mc,h),setTimeout(()=>{const w=new CustomEvent(vc,_h);u.addEventListener(vc,v),u.dispatchEvent(w),w.defaultPrevented||_n(C??document.body,{select:!0}),u.removeEventListener(vc,v),kh.remove(S)},0)}}},[u,h,v,S]);const _=N.useCallback(C=>{if(!a&&!s||S.paused)return;const x=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,w=document.activeElement;if(x&&w){const k=C.currentTarget,[b,R]=By(k);b&&R?!C.shiftKey&&w===R?(C.preventDefault(),a&&_n(b,{select:!0})):C.shiftKey&&w===b&&(C.preventDefault(),a&&_n(R,{select:!0})):w===k&&C.preventDefault()}},[a,s,S.paused]);return A.jsx(Bt.div,{tabIndex:-1,...p,ref:g,onKeyDown:_})});C0.displayName=Ny;function Ay(r,{select:o=!1}={}){const a=document.activeElement;for(const s of r)if(_n(s,{select:o}),document.activeElement!==a)return}function By(r){const o=E0(r),a=Sh(o,r),s=Sh(o.reverse(),r);return[a,s]}function E0(r){const o=[],a=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const c=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||c?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)o.push(a.currentNode);return o}function Sh(r,o){for(const a of r)if(!jy(a,{upTo:o}))return a}function jy(r,{upTo:o}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(o!==void 0&&r===o)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function Dy(r){return r instanceof HTMLInputElement&&"select"in r}function _n(r,{select:o=!1}={}){if(r&&r.focus){const a=document.activeElement;r.focus({preventScroll:!0}),r!==a&&Dy(r)&&o&&r.select()}}var kh=Oy();function Oy(){let r=[];return{add(o){const a=r[0];o!==a&&(a==null||a.pause()),r=Ch(r,o),r.unshift(o)},remove(o){var a;r=Ch(r,o),(a=r[0])==null||a.resume()}}}function Ch(r,o){const a=[...r],s=a.indexOf(o);return s!==-1&&a.splice(s,1),a}function My(r){return r.filter(o=>o.tagName!=="A")}var Iy="Portal",T0=N.forwardRef((r,o)=>{var u;const{container:a,...s}=r,[c,l]=N.useState(!1);Eo(()=>l(!0),[]);const p=a||c&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return p?n0.createPortal(A.jsx(Bt.div,{...s,ref:o}),p):null});T0.displayName=Iy;function Fy(r,o){return N.useReducer((a,s)=>o[a][s]??a,r)}var No=r=>{const{present:o,children:a}=r,s=Hy(o),c=typeof a=="function"?a({present:s.isPresent}):N.Children.only(a),l=xr(s.ref,Ly(c));return typeof a=="function"||s.isPresent?N.cloneElement(c,{ref:l}):null};No.displayName="Presence";function Hy(r){const[o,a]=N.useState(),s=N.useRef(null),c=N.useRef(r),l=N.useRef("none"),p=r?"mounted":"unmounted",[u,f]=Fy(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const h=Hs(s.current);l.current=u==="mounted"?h:"none"},[u]),Eo(()=>{const h=s.current,v=c.current;if(v!==r){const g=l.current,S=Hs(h);r?f("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(v&&g!==S?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,f]),Eo(()=>{if(o){let h;const v=o.ownerDocument.defaultView??window,m=S=>{const C=Hs(s.current).includes(CSS.escape(S.animationName));if(S.target===o&&C&&(f("ANIMATION_END"),!c.current)){const x=o.style.animationFillMode;o.style.animationFillMode="forwards",h=v.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=x)})}},g=S=>{S.target===o&&(l.current=Hs(s.current))};return o.addEventListener("animationstart",g),o.addEventListener("animationcancel",m),o.addEventListener("animationend",m),()=>{v.clearTimeout(h),o.removeEventListener("animationstart",g),o.removeEventListener("animationcancel",m),o.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[o,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:N.useCallback(h=>{s.current=h?getComputedStyle(h):null,a(h)},[])}}function Hs(r){return(r==null?void 0:r.animationName)||"none"}function Ly(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var yc=0;function zy(){N.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??Eh()),document.body.insertAdjacentElement("beforeend",r[1]??Eh()),yc++,()=>{yc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),yc--}},[])}function Eh(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var zr=function(){return zr=Object.assign||function(o){for(var a,s=1,c=arguments.length;s"u")return og;var o=ag(r),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,s-a+o[2]-o[0])}},ig=A0(),So="data-scroll-locked",lg=function(r,o,a,s){var c=r.left,l=r.top,p=r.right,u=r.gap;return a===void 0&&(a="margin"),` - .`.concat(Vy,` { - overflow: hidden `).concat(s,`; - padding-right: `).concat(u,"px ").concat(s,`; - } - body[`).concat(So,`] { - overflow: hidden `).concat(s,`; - overscroll-behavior: contain; - `).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&` - padding-left: `.concat(c,`px; - padding-top: `).concat(l,`px; - padding-right: `).concat(p,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(s,`; - `),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),` - } - - .`).concat(oi,` { - right: `).concat(u,"px ").concat(s,`; - } - - .`).concat(ai,` { - margin-right: `).concat(u,"px ").concat(s,`; - } - - .`).concat(oi," .").concat(oi,` { - right: 0 `).concat(s,`; - } - - .`).concat(ai," .").concat(ai,` { - margin-right: 0 `).concat(s,`; - } - - body[`).concat(So,`] { - `).concat(Wy,": ").concat(u,`px; - } -`)},Ph=function(){var r=parseInt(document.body.getAttribute(So)||"0",10);return isFinite(r)?r:0},cg=function(){N.useEffect(function(){return document.body.setAttribute(So,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(So):document.body.setAttribute(So,r.toString())}},[])},ug=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;cg();var l=N.useMemo(function(){return sg(c)},[c]);return N.createElement(ig,{styles:lg(l,!o,c,a?"":"!important")})},Yc=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return Yc=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Yc=!1}var vo=Yc?{passive:!1}:!1,dg=function(r){return r.tagName==="TEXTAREA"},B0=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!dg(r)&&a[o]==="visible")},fg=function(r){return B0(r,"overflowY")},hg=function(r){return B0(r,"overflowX")},Rh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=j0(r,s);if(c){var l=D0(r,s),p=l[1],u=l[2];if(p>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},pg=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},mg=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},j0=function(r,o){return r==="v"?fg(o):hg(o)},D0=function(r,o){return r==="v"?pg(o):mg(o)},vg=function(r,o){return r==="h"&&o==="rtl"?-1:1},yg=function(r,o,a,s,c){var l=vg(r,window.getComputedStyle(o).direction),p=l*s,u=a.target,f=o.contains(u),h=!1,v=p>0,m=0,g=0;do{if(!u)break;var S=D0(r,u),_=S[0],C=S[1],x=S[2],w=C-x-l*_;(_||w)&&j0(r,u)&&(m+=w,g+=_);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(v&&Math.abs(m)<1||!v&&Math.abs(g)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Nh=function(r){return[r.deltaX,r.deltaY]},Ah=function(r){return r&&"current"in r?r.current:r},gg=function(r,o){return r[0]===o[0]&&r[1]===o[1]},xg=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},wg=0,yo=[];function bg(r){var o=N.useRef([]),a=N.useRef([0,0]),s=N.useRef(),c=N.useState(wg++)[0],l=N.useState(A0)[0],p=N.useRef(r);N.useEffect(function(){p.current=r},[r]),N.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var C=Uy([r.lockRef.current],(r.shards||[]).map(Ah),!0).filter(Boolean);return C.forEach(function(x){return x.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=N.useCallback(function(C,x){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!p.current.allowPinchZoom;var w=zs(C),k=a.current,b="deltaX"in C?C.deltaX:k[0]-w[0],R="deltaY"in C?C.deltaY:k[1]-w[1],P,j=C.target,B=Math.abs(b)>Math.abs(R)?"h":"v";if("touches"in C&&B==="h"&&j.type==="range")return!1;var D=window.getSelection(),F=D&&D.anchorNode,O=F?F===j||F.contains(j):!1;if(O)return!1;var L=Rh(B,j);if(!L)return!0;if(L?P=B:(P=B==="v"?"h":"v",L=Rh(B,j)),!L)return!1;if(!s.current&&"changedTouches"in C&&(b||R)&&(s.current=P),!P)return!0;var G=s.current||P;return yg(G,x,C,G==="h"?b:R)},[]),f=N.useCallback(function(C){var x=C;if(!(!yo.length||yo[yo.length-1]!==l)){var w="deltaY"in x?Nh(x):zs(x),k=o.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&gg(P.delta,w)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var b=(p.current.shards||[]).map(Ah).filter(Boolean).filter(function(P){return P.contains(x.target)}),R=b.length>0?u(x,b[0]):!p.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),h=N.useCallback(function(C,x,w,k){var b={name:C,delta:x,target:w,should:k,shadowParent:_g(w)};o.current.push(b),setTimeout(function(){o.current=o.current.filter(function(R){return R!==b})},1)},[]),v=N.useCallback(function(C){a.current=zs(C),s.current=void 0},[]),m=N.useCallback(function(C){h(C.type,Nh(C),C.target,u(C,r.lockRef.current))},[]),g=N.useCallback(function(C){h(C.type,zs(C),C.target,u(C,r.lockRef.current))},[]);N.useEffect(function(){return yo.push(l),r.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",f,vo),document.addEventListener("touchmove",f,vo),document.addEventListener("touchstart",v,vo),function(){yo=yo.filter(function(C){return C!==l}),document.removeEventListener("wheel",f,vo),document.removeEventListener("touchmove",f,vo),document.removeEventListener("touchstart",v,vo)}},[]);var S=r.removeScrollBar,_=r.inert;return N.createElement(N.Fragment,null,_?N.createElement(l,{styles:xg(c)}):null,S?N.createElement(ug,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function _g(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const Sg=Qy(N0,bg);var O0=N.forwardRef(function(r,o){return N.createElement(mi,zr({},r,{ref:o,sideCar:Sg}))});O0.classNames=mi.classNames;var kg=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},go=new WeakMap,Us=new WeakMap,Vs={},bc=0,M0=function(r){return r&&(r.host||M0(r.parentNode))},Cg=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=M0(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},Eg=function(r,o,a,s){var c=Cg(o,Array.isArray(r)?r:[r]);Vs[a]||(Vs[a]=new WeakMap);var l=Vs[a],p=[],u=new Set,f=new Set(c),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};c.forEach(h);var v=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))v(g);else try{var S=g.getAttribute(s),_=S!==null&&S!=="false",C=(go.get(g)||0)+1,x=(l.get(g)||0)+1;go.set(g,C),l.set(g,x),p.push(g),C===1&&_&&Us.set(g,!0),x===1&&g.setAttribute(a,"true"),_||g.setAttribute(s,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return v(o),u.clear(),bc++,function(){p.forEach(function(m){var g=go.get(m)-1,S=l.get(m)-1;go.set(m,g),l.set(m,S),g||(Us.has(m)||m.removeAttribute(s),Us.delete(m)),S||m.removeAttribute(a)}),bc--,bc||(go=new WeakMap,go=new WeakMap,Us=new WeakMap,Vs={})}},Tg=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=kg(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),Eg(s,c,a,"aria-hidden")):function(){return null}};function Pg(r){const o=Rg(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find(Ag);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Rg(r){const o=N.forwardRef((a,s)=>{const{children:c,...l}=a;if(N.isValidElement(c)){const p=jg(c),u=Bg(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var Ng=Symbol("radix.slottable");function Ag(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Ng}function Bg(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function jg(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}var vi="Dialog",[I0]=Ea(vi),[Dg,Ar]=I0(vi),F0=r=>{const{__scopeDialog:o,children:a,open:s,defaultOpen:c,onOpenChange:l,modal:p=!0}=r,u=N.useRef(null),f=N.useRef(null),[h,v]=pi({prop:s,defaultProp:c??!1,onChange:l,caller:vi});return A.jsx(Dg,{scope:o,triggerRef:u,contentRef:f,contentId:_a(),titleId:_a(),descriptionId:_a(),open:h,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(m=>!m),[v]),modal:p,children:a})};F0.displayName=vi;var H0="DialogTrigger",Og=N.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Ar(H0,a),l=xr(o,c.triggerRef);return A.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":lu(c.open),...s,ref:l,onClick:Et(r.onClick,c.onOpenToggle)})});Og.displayName=H0;var su="DialogPortal",[Mg,L0]=I0(su,{forceMount:void 0}),z0=r=>{const{__scopeDialog:o,forceMount:a,children:s,container:c}=r,l=Ar(su,o);return A.jsx(Mg,{scope:o,forceMount:a,children:N.Children.map(s,p=>A.jsx(No,{present:a||l.open,children:A.jsx(T0,{asChild:!0,container:c,children:p})}))})};z0.displayName=su;var di="DialogOverlay",U0=N.forwardRef((r,o)=>{const a=L0(di,r.__scopeDialog),{forceMount:s=a.forceMount,...c}=r,l=Ar(di,r.__scopeDialog);return l.modal?A.jsx(No,{present:s||l.open,children:A.jsx(Fg,{...c,ref:o})}):null});U0.displayName=di;var Ig=Pg("DialogOverlay.RemoveScroll"),Fg=N.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Ar(di,a);return A.jsx(O0,{as:Ig,allowPinchZoom:!0,shards:[c.contentRef],children:A.jsx(Bt.div,{"data-state":lu(c.open),...s,ref:o,style:{pointerEvents:"auto",...s.style}})})}),Vn="DialogContent",V0=N.forwardRef((r,o)=>{const a=L0(Vn,r.__scopeDialog),{forceMount:s=a.forceMount,...c}=r,l=Ar(Vn,r.__scopeDialog);return A.jsx(No,{present:s||l.open,children:l.modal?A.jsx(Hg,{...c,ref:o}):A.jsx(Lg,{...c,ref:o})})});V0.displayName=Vn;var Hg=N.forwardRef((r,o)=>{const a=Ar(Vn,r.__scopeDialog),s=N.useRef(null),c=xr(o,a.contentRef,s);return N.useEffect(()=>{const l=s.current;if(l)return Tg(l)},[]),A.jsx(W0,{...r,ref:c,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(r.onCloseAutoFocus,l=>{var p;l.preventDefault(),(p=a.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Et(r.onPointerDownOutside,l=>{const p=l.detail.originalEvent,u=p.button===0&&p.ctrlKey===!0;(p.button===2||u)&&l.preventDefault()}),onFocusOutside:Et(r.onFocusOutside,l=>l.preventDefault())})}),Lg=N.forwardRef((r,o)=>{const a=Ar(Vn,r.__scopeDialog),s=N.useRef(!1),c=N.useRef(!1);return A.jsx(W0,{...r,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var p,u;(p=r.onCloseAutoFocus)==null||p.call(r,l),l.defaultPrevented||(s.current||(u=a.triggerRef.current)==null||u.focus(),l.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:l=>{var f,h;(f=r.onInteractOutside)==null||f.call(r,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const p=l.target;((h=a.triggerRef.current)==null?void 0:h.contains(p))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&c.current&&l.preventDefault()}})}),W0=N.forwardRef((r,o)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:l,...p}=r,u=Ar(Vn,a),f=N.useRef(null),h=xr(o,f);return zy(),A.jsxs(A.Fragment,{children:[A.jsx(C0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:l,children:A.jsx(S0,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":lu(u.open),...p,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),A.jsxs(A.Fragment,{children:[A.jsx(zg,{titleId:u.titleId}),A.jsx(Vg,{contentRef:f,descriptionId:u.descriptionId})]})]})}),iu="DialogTitle",K0=N.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Ar(iu,a);return A.jsx(Bt.h2,{id:c.titleId,...s,ref:o})});K0.displayName=iu;var G0="DialogDescription",q0=N.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Ar(G0,a);return A.jsx(Bt.p,{id:c.descriptionId,...s,ref:o})});q0.displayName=G0;var $0="DialogClose",Y0=N.forwardRef((r,o)=>{const{__scopeDialog:a,...s}=r,c=Ar($0,a);return A.jsx(Bt.button,{type:"button",...s,ref:o,onClick:Et(r.onClick,()=>c.onOpenChange(!1))})});Y0.displayName=$0;function lu(r){return r?"open":"closed"}var X0="DialogTitleWarning",[Q3,Q0]=iy(X0,{contentName:Vn,titleName:iu,docsSlug:"dialog"}),zg=({titleId:r})=>{const o=Q0(X0),a=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return N.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},Ug="DialogDescriptionWarning",Vg=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q0(Ug).contentName}}.`;return N.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},Z0=F0,J0=z0,yi=U0,gi=V0,xi=K0,wi=q0,ep=Y0;const tp=Z0,Wg=J0,rp=N.forwardRef(({className:r,...o},a)=>A.jsx(yi,{ref:a,className:Xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));rp.displayName=yi.displayName;const cu=N.forwardRef(({className:r,children:o,...a},s)=>A.jsxs(Wg,{children:[A.jsx(rp,{}),A.jsxs(gi,{ref:s,className:Xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,A.jsxs(ep,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[A.jsx(t0,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cu.displayName=gi.displayName;const uu=({className:r,...o})=>A.jsx("div",{className:Xe("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});uu.displayName="DialogHeader";const du=({className:r,...o})=>A.jsx("div",{className:Xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});du.displayName="DialogFooter";const fu=N.forwardRef(({className:r,...o},a)=>A.jsx(xi,{ref:a,className:Xe("text-lg font-semibold leading-none tracking-tight",r),...o}));fu.displayName=xi.displayName;const Kg=N.forwardRef(({className:r,...o},a)=>A.jsx(wi,{ref:a,className:Xe("text-sm text-muted-foreground",r),...o}));Kg.displayName=wi.displayName;function Bh(r){const o=Gg(r),a=N.forwardRef((s,c)=>{const{children:l,...p}=s,u=N.Children.toArray(l),f=u.find($g);if(f){const h=f.props.children,v=u.map(m=>m===f?N.Children.count(h)>1?N.Children.only(null):N.isValidElement(h)?h.props.children:null:m);return A.jsx(o,{...p,ref:c,children:N.isValidElement(h)?N.cloneElement(h,void 0,v):null})}return A.jsx(o,{...p,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Gg(r){const o=N.forwardRef((a,s)=>{const{children:c,...l}=a;if(N.isValidElement(c)){const p=Xg(c),u=Yg(l,c.props);return c.type!==N.Fragment&&(u.ref=s?Ca(s,p):p),N.cloneElement(c,u)}return N.Children.count(c)>1?N.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var qg=Symbol("radix.slottable");function $g(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===qg}function Yg(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function Xg(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function Qg(r){const o=r+"CollectionProvider",[a,s]=Ea(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),p=C=>{const{scope:x,children:w}=C,k=fe.useRef(null),b=fe.useRef(new Map).current;return A.jsx(c,{scope:x,itemMap:b,collectionRef:k,children:w})};p.displayName=o;const u=r+"CollectionSlot",f=Bh(u),h=fe.forwardRef((C,x)=>{const{scope:w,children:k}=C,b=l(u,w),R=xr(x,b.collectionRef);return A.jsx(f,{ref:R,children:k})});h.displayName=u;const v=r+"CollectionItemSlot",m="data-radix-collection-item",g=Bh(v),S=fe.forwardRef((C,x)=>{const{scope:w,children:k,...b}=C,R=fe.useRef(null),P=xr(x,R),j=l(v,w);return fe.useEffect(()=>(j.itemMap.set(R,{ref:R,...b}),()=>void j.itemMap.delete(R))),A.jsx(g,{[m]:"",ref:P,children:k})});S.displayName=v;function _(C){const x=l(r+"CollectionConsumer",C);return fe.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const b=Array.from(k.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((j,B)=>b.indexOf(j.ref.current)-b.indexOf(B.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:p,Slot:h,ItemSlot:S},_,s]}var Zg=N.createContext(void 0);function np(r){const o=N.useContext(Zg);return r||o||"ltr"}var _c="rovingFocusGroup.onEntryFocus",Jg={bubbles:!1,cancelable:!0},Ta="RovingFocusGroup",[Xc,op,e4]=Qg(Ta),[t4,ap]=Ea(Ta,[e4]),[r4,n4]=t4(Ta),sp=N.forwardRef((r,o)=>A.jsx(Xc.Provider,{scope:r.__scopeRovingFocusGroup,children:A.jsx(Xc.Slot,{scope:r.__scopeRovingFocusGroup,children:A.jsx(o4,{...r,ref:o})})}));sp.displayName=Ta;var o4=N.forwardRef((r,o)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:c=!1,dir:l,currentTabStopId:p,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:v=!1,...m}=r,g=N.useRef(null),S=xr(o,g),_=np(l),[C,x]=pi({prop:p,defaultProp:u??null,onChange:f,caller:Ta}),[w,k]=N.useState(!1),b=To(h),R=op(a),P=N.useRef(!1),[j,B]=N.useState(0);return N.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(_c,b),()=>D.removeEventListener(_c,b)},[b]),A.jsx(r4,{scope:a,orientation:s,dir:_,loop:c,currentTabStopId:C,onItemFocus:N.useCallback(D=>x(D),[x]),onItemShiftTab:N.useCallback(()=>k(!0),[]),onFocusableItemAdd:N.useCallback(()=>B(D=>D+1),[]),onFocusableItemRemove:N.useCallback(()=>B(D=>D-1),[]),children:A.jsx(Bt.div,{tabIndex:w||j===0?-1:0,"data-orientation":s,...m,ref:S,style:{outline:"none",...r.style},onMouseDown:Et(r.onMouseDown,()=>{P.current=!0}),onFocus:Et(r.onFocus,D=>{const F=!P.current;if(D.target===D.currentTarget&&F&&!w){const O=new CustomEvent(_c,Jg);if(D.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=R().filter(Q=>Q.focusable),G=L.find(Q=>Q.active),$=L.find(Q=>Q.id===C),ae=[G,$,...L].filter(Boolean).map(Q=>Q.ref.current);cp(ae,v)}}P.current=!1}),onBlur:Et(r.onBlur,()=>k(!1))})})}),ip="RovingFocusGroupItem",lp=N.forwardRef((r,o)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:c=!1,tabStopId:l,children:p,...u}=r,f=_a(),h=l||f,v=n4(ip,a),m=v.currentTabStopId===h,g=op(a),{onFocusableItemAdd:S,onFocusableItemRemove:_,currentTabStopId:C}=v;return N.useEffect(()=>{if(s)return S(),()=>_()},[s,S,_]),A.jsx(Xc.ItemSlot,{scope:a,id:h,focusable:s,active:c,children:A.jsx(Bt.span,{tabIndex:m?0:-1,"data-orientation":v.orientation,...u,ref:o,onMouseDown:Et(r.onMouseDown,x=>{s?v.onItemFocus(h):x.preventDefault()}),onFocus:Et(r.onFocus,()=>v.onItemFocus(h)),onKeyDown:Et(r.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){v.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=i4(x,v.orientation,v.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=g().filter(R=>R.focusable).map(R=>R.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const R=b.indexOf(x.currentTarget);b=v.loop?l4(b,R+1):b.slice(R+1)}setTimeout(()=>cp(b))}}),children:typeof p=="function"?p({isCurrentTabStop:m,hasTabStop:C!=null}):p})})});lp.displayName=ip;var a4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s4(r,o){return o!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function i4(r,o,a){const s=s4(r.key,a);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return a4[s]}function cp(r,o=!1){const a=document.activeElement;for(const s of r)if(s===a||(s.focus({preventScroll:o}),document.activeElement!==a))return}function l4(r,o){return r.map((a,s)=>r[(o+s)%r.length])}var c4=sp,u4=lp,bi="Tabs",[d4]=Ea(bi,[ap]),up=ap(),[f4,hu]=d4(bi),dp=N.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,onValueChange:c,defaultValue:l,orientation:p="horizontal",dir:u,activationMode:f="automatic",...h}=r,v=np(u),[m,g]=pi({prop:s,onChange:c,defaultProp:l??"",caller:bi});return A.jsx(f4,{scope:a,baseId:_a(),value:m,onValueChange:g,orientation:p,dir:v,activationMode:f,children:A.jsx(Bt.div,{dir:v,"data-orientation":p,...h,ref:o})})});dp.displayName=bi;var fp="TabsList",hp=N.forwardRef((r,o)=>{const{__scopeTabs:a,loop:s=!0,...c}=r,l=hu(fp,a),p=up(a);return A.jsx(c4,{asChild:!0,...p,orientation:l.orientation,dir:l.dir,loop:s,children:A.jsx(Bt.div,{role:"tablist","aria-orientation":l.orientation,...c,ref:o})})});hp.displayName=fp;var pp="TabsTrigger",mp=N.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,disabled:c=!1,...l}=r,p=hu(pp,a),u=up(a),f=gp(p.baseId,s),h=xp(p.baseId,s),v=s===p.value;return A.jsx(u4,{asChild:!0,...u,focusable:!c,active:v,children:A.jsx(Bt.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":h,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:f,...l,ref:o,onMouseDown:Et(r.onMouseDown,m=>{!c&&m.button===0&&m.ctrlKey===!1?p.onValueChange(s):m.preventDefault()}),onKeyDown:Et(r.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&p.onValueChange(s)}),onFocus:Et(r.onFocus,()=>{const m=p.activationMode!=="manual";!v&&!c&&m&&p.onValueChange(s)})})})});mp.displayName=pp;var vp="TabsContent",yp=N.forwardRef((r,o)=>{const{__scopeTabs:a,value:s,forceMount:c,children:l,...p}=r,u=hu(vp,a),f=gp(u.baseId,s),h=xp(u.baseId,s),v=s===u.value,m=N.useRef(v);return N.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),A.jsx(No,{present:c||v,children:({present:g})=>A.jsx(Bt.div,{"data-state":v?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!g,id:h,tabIndex:0,...p,ref:o,style:{...r.style,animationDuration:m.current?"0s":void 0},children:g&&l})})});yp.displayName=vp;function gp(r,o){return`${r}-trigger-${o}`}function xp(r,o){return`${r}-content-${o}`}var h4=dp,wp=hp,bp=mp,_p=yp;const p4=h4,Sp=N.forwardRef(({className:r,...o},a)=>A.jsx(wp,{ref:a,className:Xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),...o}));Sp.displayName=wp.displayName;const ga=N.forwardRef(({className:r,...o},a)=>A.jsx(bp,{ref:a,className:Xe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r),...o}));ga.displayName=bp.displayName;const xa=N.forwardRef(({className:r,...o},a)=>A.jsx(_p,{ref:a,className:Xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...o}));xa.displayName=_p.displayName;var m4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],v4=m4.reduce((r,o)=>{const a=au(`Primitive.${o}`),s=N.forwardRef((c,l)=>{const{asChild:p,...u}=c,f=p?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{}),y4="Label",kp=N.forwardRef((r,o)=>A.jsx(v4.label,{...r,ref:o,onMouseDown:a=>{var c;a.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));kp.displayName=y4;var Cp=kp;const g4=hi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),bt=N.forwardRef(({className:r,...o},a)=>A.jsx(Cp,{ref:a,className:Xe(g4(),r),...o}));bt.displayName=Cp.displayName;function x4(r){const o=N.useRef({value:r,previous:r});return N.useMemo(()=>(o.current.value!==r&&(o.current.previous=o.current.value,o.current.value=r),o.current.previous),[r])}function w4(r){const[o,a]=N.useState(void 0);return Eo(()=>{if(r){a({width:r.offsetWidth,height:r.offsetHeight});const s=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const l=c[0];let p,u;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;p=h.inlineSize,u=h.blockSize}else p=r.offsetWidth,u=r.offsetHeight;a({width:p,height:u})});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else a(void 0)},[r]),o}var _i="Checkbox",[b4]=Ea(_i),[_4,pu]=b4(_i);function S4(r){const{__scopeCheckbox:o,checked:a,children:s,defaultChecked:c,disabled:l,form:p,name:u,onCheckedChange:f,required:h,value:v="on",internal_do_not_use_render:m}=r,[g,S]=pi({prop:a,defaultProp:c??!1,onChange:f,caller:_i}),[_,C]=N.useState(null),[x,w]=N.useState(null),k=N.useRef(!1),b=_?!!p||!!_.closest("form"):!0,R={checked:g,disabled:l,setChecked:S,control:_,setControl:C,name:u,form:p,value:v,hasConsumerStoppedPropagationRef:k,required:h,defaultChecked:Sn(c)?!1:c,isFormControl:b,bubbleInput:x,setBubbleInput:w};return A.jsx(_4,{scope:o,...R,children:k4(m)?m(R):s})}var Ep="CheckboxTrigger",Tp=N.forwardRef(({__scopeCheckbox:r,onKeyDown:o,onClick:a,...s},c)=>{const{control:l,value:p,disabled:u,checked:f,required:h,setControl:v,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:S,bubbleInput:_}=pu(Ep,r),C=xr(c,v),x=N.useRef(f);return N.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const k=()=>m(x.current);return w.addEventListener("reset",k),()=>w.removeEventListener("reset",k)}},[l,m]),A.jsx(Bt.button,{type:"button",role:"checkbox","aria-checked":Sn(f)?"mixed":f,"aria-required":h,"data-state":Bp(f),"data-disabled":u?"":void 0,disabled:u,value:p,...s,ref:C,onKeyDown:Et(o,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:Et(a,w=>{m(k=>Sn(k)?!0:!k),_&&S&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})});Tp.displayName=Ep;var mu=N.forwardRef((r,o)=>{const{__scopeCheckbox:a,name:s,checked:c,defaultChecked:l,required:p,disabled:u,value:f,onCheckedChange:h,form:v,...m}=r;return A.jsx(S4,{__scopeCheckbox:a,checked:c,defaultChecked:l,disabled:u,required:p,onCheckedChange:h,name:s,form:v,value:f,internal_do_not_use_render:({isFormControl:g})=>A.jsxs(A.Fragment,{children:[A.jsx(Tp,{...m,ref:o,__scopeCheckbox:a}),g&&A.jsx(Ap,{__scopeCheckbox:a})]})})});mu.displayName=_i;var Pp="CheckboxIndicator",Rp=N.forwardRef((r,o)=>{const{__scopeCheckbox:a,forceMount:s,...c}=r,l=pu(Pp,a);return A.jsx(No,{present:s||Sn(l.checked)||l.checked===!0,children:A.jsx(Bt.span,{"data-state":Bp(l.checked),"data-disabled":l.disabled?"":void 0,...c,ref:o,style:{pointerEvents:"none",...r.style}})})});Rp.displayName=Pp;var Np="CheckboxBubbleInput",Ap=N.forwardRef(({__scopeCheckbox:r,...o},a)=>{const{control:s,hasConsumerStoppedPropagationRef:c,checked:l,defaultChecked:p,required:u,disabled:f,name:h,value:v,form:m,bubbleInput:g,setBubbleInput:S}=pu(Np,r),_=xr(a,S),C=x4(l),x=w4(s);N.useEffect(()=>{const k=g;if(!k)return;const b=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(b,"checked").set,j=!c.current;if(C!==l&&P){const B=new Event("click",{bubbles:j});k.indeterminate=Sn(l),P.call(k,Sn(l)?!1:l),k.dispatchEvent(B)}},[g,C,l,c]);const w=N.useRef(Sn(l)?!1:l);return A.jsx(Bt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??w.current,required:u,disabled:f,name:h,value:v,form:m,...o,tabIndex:-1,ref:_,style:{...o.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ap.displayName=Np;function k4(r){return typeof r=="function"}function Sn(r){return r==="indeterminate"}function Bp(r){return Sn(r)?"indeterminate":r?"checked":"unchecked"}const jp=N.forwardRef(({className:r,...o},a)=>A.jsx(mu,{ref:a,className:Xe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r),...o,children:A.jsx(Rp,{className:Xe("flex items-center justify-center text-current"),children:A.jsx(yv,{className:"h-4 w-4"})})}));jp.displayName=mu.displayName;function C4({open:r,contacts:o,undecryptedCount:a,onClose:s,onSelectConversation:c,onCreateContact:l,onCreateChannel:p,onCreateHashtagChannel:u}){const[f,h]=N.useState("existing"),[v,m]=N.useState(""),[g,S]=N.useState(""),[_,C]=N.useState(!1),[x,w]=N.useState(""),[k,b]=N.useState(!1),R=N.useRef(null),P=async()=>{w(""),b(!0);try{if(f==="new-contact"){if(!v.trim()||!g.trim()){w("Name and public key are required");return}await l(v.trim(),g.trim(),_),c({type:"contact",id:g.trim(),name:v.trim()})}else if(f==="new-room"){if(!v.trim()||!g.trim()){w("Room name and key are required");return}await p(v.trim(),g.trim(),_)}else if(f==="hashtag"){const F=v.trim(),O=j(F);if(O){w(O);return}await u(`#${F}`,_)}s()}catch(F){w(F instanceof Error?F.message:"Failed to create")}finally{b(!1)}},j=F=>F?/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(F)?null:"Use letters, numbers, and single dashes (no leading/trailing dashes)":"Channel name is required",B=async()=>{var L;w("");const F=v.trim(),O=j(F);if(O){w(O);return}b(!0);try{await u(`#${F}`,_),m(""),(L=R.current)==null||L.focus()}catch(G){w(G instanceof Error?G.message:"Failed to create")}finally{b(!1)}},D=f!=="existing"&&a>0;return A.jsx(tp,{open:r,onOpenChange:F=>!F&&s(),children:A.jsxs(cu,{className:"sm:max-w-[500px]",children:[A.jsx(uu,{children:A.jsx(fu,{children:"New Conversation"})}),A.jsxs(p4,{value:f,onValueChange:F=>h(F),className:"w-full",children:[A.jsxs(Sp,{className:"grid w-full grid-cols-4",children:[A.jsx(ga,{value:"existing",children:"Existing"}),A.jsx(ga,{value:"new-contact",children:"Contact"}),A.jsx(ga,{value:"new-room",children:"Room"}),A.jsx(ga,{value:"hashtag",children:"Hashtag"})]}),A.jsx(xa,{value:"existing",className:"mt-4",children:A.jsx("div",{className:"max-h-[300px] overflow-y-auto rounded-md border",children:o.length===0?A.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No contacts available"}):o.map(F=>A.jsx("div",{className:"cursor-pointer px-4 py-2 hover:bg-accent",onClick:()=>{c({type:"contact",id:F.public_key,name:Sa(F.name,F.public_key)}),s()},children:Sa(F.name,F.public_key)},F.public_key))})}),A.jsxs(xa,{value:"new-contact",className:"mt-4 space-y-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"contact-name",children:"Name"}),A.jsx(_t,{id:"contact-name",value:v,onChange:F=>m(F.target.value),placeholder:"Contact name"})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"contact-key",children:"Public Key"}),A.jsx(_t,{id:"contact-key",value:g,onChange:F=>S(F.target.value),placeholder:"64-character hex public key"})]})]}),A.jsxs(xa,{value:"new-room",className:"mt-4 space-y-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"room-name",children:"Room Name"}),A.jsx(_t,{id:"room-name",value:v,onChange:F=>m(F.target.value),placeholder:"Room name"})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"room-key",children:"Room Key"}),A.jsx(_t,{id:"room-key",value:g,onChange:F=>S(F.target.value),placeholder:"Pre-shared key (hex)"})]})]}),A.jsx(xa,{value:"hashtag",className:"mt-4",children:A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"hashtag-name",children:"Hashtag Channel"}),A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx("span",{className:"text-sm text-muted-foreground",children:"#"}),A.jsx(_t,{ref:R,id:"hashtag-name",value:v,onChange:F=>m(F.target.value),placeholder:"channel-name",className:"flex-1"})]})]})})]}),D&&A.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[A.jsxs(bt,{htmlFor:"try-historical",className:"text-sm text-muted-foreground cursor-pointer",children:["Try decrypting ",a.toLocaleString()," stored packet",a!==1?"s":""]}),A.jsx(jp,{id:"try-historical",checked:_,onCheckedChange:F=>C(F===!0)})]}),x&&A.jsx("div",{className:"text-sm text-destructive",children:x}),A.jsxs(du,{children:[A.jsx(Ur,{variant:"outline",onClick:s,children:"Cancel"}),f==="hashtag"&&A.jsx(Ur,{variant:"secondary",onClick:B,disabled:k,children:k?"Creating...":"Create & Add Another"}),f!=="existing"&&A.jsx(Ur,{onClick:P,disabled:k,children:k?"Creating...":"Create"})]})]})})}var E4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],T4=E4.reduce((r,o)=>{const a=au(`Primitive.${o}`),s=N.forwardRef((c,l)=>{const{asChild:p,...u}=c,f=p?a:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...u,ref:l})});return s.displayName=`Primitive.${o}`,{...r,[o]:s}},{}),P4="Separator",jh="horizontal",R4=["horizontal","vertical"],Dp=N.forwardRef((r,o)=>{const{decorative:a,orientation:s=jh,...c}=r,l=N4(s)?s:jh,u=a?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return A.jsx(T4.div,{"data-orientation":l,...u,...c,ref:o})});Dp.displayName=P4;function N4(r){return R4.includes(r)}var Op=Dp;const si=N.forwardRef(({className:r,orientation:o="horizontal",decorative:a=!0,...s},c)=>A.jsx(Op,{ref:c,decorative:a,orientation:o,className:Xe("shrink-0 bg-border",o==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",r),...s}));si.displayName=Op.displayName;const A4=hi("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"}}),Mp=N.forwardRef(({className:r,variant:o,...a},s)=>A.jsx("div",{ref:s,role:"alert",className:Xe(A4({variant:o}),r),...a}));Mp.displayName="Alert";const B4=N.forwardRef(({className:r,...o},a)=>A.jsx("h5",{ref:a,className:Xe("mb-1 font-medium leading-none tracking-tight",r),...o}));B4.displayName="AlertTitle";const Ip=N.forwardRef(({className:r,...o},a)=>A.jsx("div",{ref:a,className:Xe("text-sm [&_p]:leading-relaxed",r),...o}));Ip.displayName="AlertDescription";function j4({open:r,config:o,appSettings:a,onClose:s,onSave:c,onSaveAppSettings:l,onSetPrivateKey:p,onReboot:u}){const[f,h]=N.useState(""),[v,m]=N.useState(""),[g,S]=N.useState(""),[_,C]=N.useState(""),[x,w]=N.useState(""),[k,b]=N.useState(""),[R,P]=N.useState(""),[j,B]=N.useState(""),[D,F]=N.useState(""),[O,L]=N.useState(""),[G,$]=N.useState(!1),[J,ae]=N.useState(!1),[Q,ne]=N.useState("");N.useEffect(()=>{o&&(h(o.name),m(String(o.lat)),S(String(o.lon)),C(String(o.tx_power)),w(String(o.radio.freq)),b(String(o.radio.bw)),P(String(o.radio.sf)),B(String(o.radio.cr)))},[o]),N.useEffect(()=>{a&&L(String(a.max_radio_contacts))},[a]);const U=async()=>{ne(""),$(!0);try{const E={name:f,lat:parseFloat(v),lon:parseFloat(g),tx_power:parseInt(_,10),radio:{freq:parseFloat(x),bw:parseFloat(k),sf:parseInt(R,10),cr:parseInt(j,10)}};await c(E);const I=parseInt(O,10);!isNaN(I)&&I!==(a==null?void 0:a.max_radio_contacts)&&await l({max_radio_contacts:I}),s()}catch(E){ne(E instanceof Error?E.message:"Failed to save")}finally{$(!1)}},te=async()=>{if(!D.trim()){ne("Private key is required");return}ne(""),$(!0);try{await p(D.trim()),F(""),s()}catch(E){ne(E instanceof Error?E.message:"Failed to set private key")}finally{$(!1)}},X=async()=>{if(confirm("Are you sure you want to reboot the radio? The connection will drop temporarily.")){ne(""),ae(!0);try{await u(),s()}catch(E){ne(E instanceof Error?E.message:"Failed to reboot radio")}finally{ae(!1)}}};return A.jsx(tp,{open:r,onOpenChange:E=>!E&&s(),children:A.jsxs(cu,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[A.jsx(uu,{children:A.jsx(fu,{children:"Radio Configuration"})}),o?A.jsxs("div",{className:"space-y-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"public-key",children:"Public Key"}),A.jsx(_t,{id:"public-key",value:o.public_key,disabled:!0})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"name",children:"Name"}),A.jsx(_t,{id:"name",value:f,onChange:E=>h(E.target.value)})]}),A.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"lat",children:"Latitude"}),A.jsx(_t,{id:"lat",type:"number",step:"any",value:v,onChange:E=>m(E.target.value)})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"lon",children:"Longitude"}),A.jsx(_t,{id:"lon",type:"number",step:"any",value:g,onChange:E=>S(E.target.value)})]})]}),A.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"freq",children:"Frequency (MHz)"}),A.jsx(_t,{id:"freq",type:"number",step:"any",value:x,onChange:E=>w(E.target.value)})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"bw",children:"Bandwidth (kHz)"}),A.jsx(_t,{id:"bw",type:"number",step:"any",value:k,onChange:E=>b(E.target.value)})]})]}),A.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"sf",children:"Spreading Factor"}),A.jsx(_t,{id:"sf",type:"number",min:"7",max:"12",value:R,onChange:E=>P(E.target.value)})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"cr",children:"Coding Rate"}),A.jsx(_t,{id:"cr",type:"number",min:"1",max:"4",value:j,onChange:E=>B(E.target.value)})]})]}),A.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"tx-power",children:"TX Power (dBm)"}),A.jsx(_t,{id:"tx-power",type:"number",value:_,onChange:E=>C(E.target.value)})]}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"max-tx",children:"Max TX Power"}),A.jsx(_t,{id:"max-tx",type:"number",value:o.max_tx_power,disabled:!0})]})]}),A.jsx(si,{className:"my-4"}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"max-contacts",children:"Max Contacts on Radio"}),A.jsx(_t,{id:"max-contacts",type:"number",min:"1",max:"1000",value:O,onChange:E=>L(E.target.value)}),A.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent non-repeater contacts loaded to radio for DM auto-ACK (1-1000)"})]}),A.jsx(si,{className:"my-4"}),A.jsxs("div",{className:"space-y-2",children:[A.jsx(bt,{htmlFor:"private-key",children:"Set Private Key (write-only)"}),A.jsxs("div",{className:"flex gap-2",children:[A.jsx(_t,{id:"private-key",type:"password",value:D,onChange:E=>F(E.target.value),placeholder:"64-character hex private key",className:"flex-1"}),A.jsx(Ur,{onClick:te,disabled:G||!D.trim(),children:"Set"})]})]}),A.jsx(si,{className:"my-4"}),A.jsxs("div",{className:"space-y-3",children:[A.jsx(bt,{children:"Reboot Radio"}),A.jsx(Mp,{variant:"warning",children:A.jsx(Ip,{children:"Some configuration changes (like name) require a radio reboot to take effect. The connection will temporarily drop and automatically reconnect."})}),A.jsx(Ur,{variant:"outline",onClick:X,disabled:J||G,className:"border-yellow-500/50 text-yellow-200 hover:bg-yellow-500/10",children:J?"Rebooting...":"Reboot Radio"})]}),Q&&A.jsx("div",{className:"text-sm text-destructive",children:Q})]}):A.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"Loading configuration..."}),A.jsxs(du,{children:[A.jsx(Ur,{variant:"outline",onClick:s,children:"Cancel"}),A.jsx(Ur,{onClick:U,disabled:G||!o,children:G?"Saving...":"Save Config"})]})]})})}function D4(r){return new Date(r*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Dh(r){return r.split("_").map(o=>o.charAt(0)+o.slice(1).toLowerCase()).join(" ")}function O4(r){if(!r.decrypted||!r.decrypted_info)return Dh(r.payload_type);const o=r.decrypted_info;return r.payload_type==="GROUP_TEXT"&&o.channel_name?`GroupText to ${o.channel_name}`:r.payload_type==="TEXT_MESSAGE"&&o.sender?`TextMessage from ${o.sender}`:Dh(r.payload_type)}function M4(r){const o=[];return r.snr!==null&&r.snr!==void 0&&o.push(`SNR: ${r.snr.toFixed(1)} dB`),r.rssi!==null&&r.rssi!==void 0&&o.push(`RSSI: ${r.rssi} dBm`),o.join(" | ")}function I4({packets:r}){const o=N.useRef(null);if(N.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),r.length===0)return A.jsx("div",{className:"h-full overflow-y-auto p-5 text-center text-muted-foreground",children:"No packets received yet. Packets will appear here in real-time."});const a=[...r].sort((s,c)=>s.timestamp-c.timestamp);return A.jsx("div",{className:"h-full overflow-y-auto p-4 flex flex-col gap-3",ref:o,children:a.map(s=>A.jsxs("div",{className:"py-2 px-3 bg-muted rounded",children:[A.jsxs("div",{className:s.decrypted?"text-primary":"text-destructive",children:[!s.decrypted&&A.jsx("span",{className:"mr-1",children:"🔒"}),O4(s)," • ",D4(s.timestamp)]}),(s.snr!==null||s.rssi!==null)&&A.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:M4(s)}),A.jsx("div",{className:"font-mono text-[11px] break-all text-muted-foreground/70 mt-1",children:s.data.toUpperCase()})]},s.id))})}var F4=Object.create,Pa=Object.defineProperty,H4=Object.getOwnPropertyDescriptor,vu=Object.getOwnPropertyNames,L4=Object.getPrototypeOf,z4=Object.prototype.hasOwnProperty,U4=(r,o,a)=>o in r?Pa(r,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[o]=a,Qc=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(o,a)=>(typeof require<"u"?require:o)[a]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),V4=(r,o)=>function(){return r&&(o=(0,r[vu(r)[0]])(r=0)),o},Se=(r,o)=>function(){return o||(0,r[vu(r)[0]])((o={exports:{}}).exports,o),o.exports},W4=(r,o)=>{for(var a in o)Pa(r,a,{get:o[a],enumerable:!0})},Fp=(r,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of vu(o))!z4.call(r,c)&&c!==a&&Pa(r,c,{get:()=>o[c],enumerable:!(s=H4(o,c))||s.enumerable});return r},Si=(r,o,a)=>(a=r!=null?F4(L4(r)):{},Fp(Pa(a,"default",{value:r,enumerable:!0}),r)),K4=r=>Fp(Pa({},"__esModule",{value:!0}),r),xo=(r,o,a)=>U4(r,typeof o!="symbol"?o+"":o,a),ur=Se({"node_modules/@michaelhart/meshcore-decoder/dist/types/enums.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.RequestType=r.AdvertFlags=r.DeviceRole=r.PayloadVersion=r.ControlSubType=r.PayloadType=r.RouteType=void 0;var o;(function(f){f[f.TransportFlood=0]="TransportFlood",f[f.Flood=1]="Flood",f[f.Direct=2]="Direct",f[f.TransportDirect=3]="TransportDirect"})(o||(r.RouteType=o={}));var a;(function(f){f[f.Request=0]="Request",f[f.Response=1]="Response",f[f.TextMessage=2]="TextMessage",f[f.Ack=3]="Ack",f[f.Advert=4]="Advert",f[f.GroupText=5]="GroupText",f[f.GroupData=6]="GroupData",f[f.AnonRequest=7]="AnonRequest",f[f.Path=8]="Path",f[f.Trace=9]="Trace",f[f.Multipart=10]="Multipart",f[f.Control=11]="Control",f[f.RawCustom=15]="RawCustom"})(a||(r.PayloadType=a={}));var s;(function(f){f[f.NodeDiscoverReq=128]="NodeDiscoverReq",f[f.NodeDiscoverResp=144]="NodeDiscoverResp"})(s||(r.ControlSubType=s={}));var c;(function(f){f[f.Version1=0]="Version1",f[f.Version2=1]="Version2",f[f.Version3=2]="Version3",f[f.Version4=3]="Version4"})(c||(r.PayloadVersion=c={}));var l;(function(f){f[f.Unknown=0]="Unknown",f[f.ChatNode=1]="ChatNode",f[f.Repeater=2]="Repeater",f[f.RoomServer=3]="RoomServer",f[f.Sensor=4]="Sensor"})(l||(r.DeviceRole=l={}));var p;(function(f){f[f.HasLocation=16]="HasLocation",f[f.HasFeature1=32]="HasFeature1",f[f.HasFeature2=64]="HasFeature2",f[f.HasName=128]="HasName"})(p||(r.AdvertFlags=p={}));var u;(function(f){f[f.GetStats=1]="GetStats",f[f.Keepalive=2]="Keepalive",f[f.GetTelemetryData=3]="GetTelemetryData",f[f.GetMinMaxAvgData=4]="GetMinMaxAvgData",f[f.GetAccessList=5]="GetAccessList"})(u||(r.RequestType=u={}))}}),Ft=Se({"node_modules/@michaelhart/meshcore-decoder/dist/utils/hex.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.byteToHex=o,r.bytesToHex=a,r.numberToHex=s,r.hexToBytes=c;function o(l){return l.toString(16).padStart(2,"0").toUpperCase()}function a(l){return Array.from(l).map(o).join("")}function s(l,p=8){return(l>>>0).toString(16).padStart(p,"0").toUpperCase()}function c(l){const p=l.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(p))throw new Error("Invalid hex string: invalid characters at position 0");if(p.length%2!==0)throw new Error("Invalid hex string: odd length");const u=new Uint8Array(p.length/2);for(let f=0;f>>2]>>>24-B%4*8&255;b[P+B>>>2]|=D<<24-(P+B)%4*8}else for(var F=0;F>>2]=R[F>>>2];return this.sigBytes+=j,this},clamp:function(){var k=this.words,b=this.sigBytes;k[b>>>2]&=4294967295<<32-b%4*8,k.length=s.ceil(b/4)},clone:function(){var k=v.clone.call(this);return k.words=this.words.slice(0),k},random:function(k){for(var b=[],R=0;R>>2]>>>24-j%4*8&255;P.push((B>>>4).toString(16)),P.push((B&15).toString(16))}return P.join("")},parse:function(k){for(var b=k.length,R=[],P=0;P>>3]|=parseInt(k.substr(P,2),16)<<24-P%8*4;return new m.init(R,b/2)}},_=g.Latin1={stringify:function(k){for(var b=k.words,R=k.sigBytes,P=[],j=0;j>>2]>>>24-j%4*8&255;P.push(String.fromCharCode(B))}return P.join("")},parse:function(k){for(var b=k.length,R=[],P=0;P>>2]|=(k.charCodeAt(P)&255)<<24-P%4*8;return new m.init(R,b)}},C=g.Utf8={stringify:function(k){try{return decodeURIComponent(escape(_.stringify(k)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(k){return _.parse(unescape(encodeURIComponent(k)))}},x=h.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new m.init,this._nDataBytes=0},_append:function(k){typeof k=="string"&&(k=C.parse(k)),this._data.concat(k),this._nDataBytes+=k.sigBytes},_process:function(k){var b,R=this._data,P=R.words,j=R.sigBytes,B=this.blockSize,D=B*4,F=j/D;k?F=s.ceil(F):F=s.max((F|0)-this._minBufferSize,0);var O=F*B,L=s.min(O*4,j);if(O){for(var G=0;G>>2]|=f[m]<<24-m%4*8;p.call(this,v,h)}else p.apply(this,arguments)};u.prototype=l}})(),a.lib.WordArray})}}),q4=Se({"node_modules/crypto-js/enc-utf16.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=s.enc;p.Utf16=p.Utf16BE={stringify:function(f){for(var h=f.words,v=f.sigBytes,m=[],g=0;g>>2]>>>16-g%4*8&65535;m.push(String.fromCharCode(S))}return m.join("")},parse:function(f){for(var h=f.length,v=[],m=0;m>>1]|=f.charCodeAt(m)<<16-m%2*16;return l.create(v,h*2)}},p.Utf16LE={stringify:function(f){for(var h=f.words,v=f.sigBytes,m=[],g=0;g>>2]>>>16-g%4*8&65535);m.push(String.fromCharCode(S))}return m.join("")},parse:function(f){for(var h=f.length,v=[],m=0;m>>1]|=u(f.charCodeAt(m)<<16-m%2*16);return l.create(v,h*2)}};function u(f){return f<<8&4278255360|f>>>8&16711935}})(),a.enc.Utf16})}}),Wn=Se({"node_modules/crypto-js/enc-base64.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=s.enc;p.Base64={stringify:function(f){var h=f.words,v=f.sigBytes,m=this._map;f.clamp();for(var g=[],S=0;S>>2]>>>24-S%4*8&255,C=h[S+1>>>2]>>>24-(S+1)%4*8&255,x=h[S+2>>>2]>>>24-(S+2)%4*8&255,w=_<<16|C<<8|x,k=0;k<4&&S+k*.75>>6*(3-k)&63));var b=m.charAt(64);if(b)for(;g.length%4;)g.push(b);return g.join("")},parse:function(f){var h=f.length,v=this._map,m=this._reverseMap;if(!m){m=this._reverseMap=[];for(var g=0;g>>6-S%4*2,x=_|C;m[g>>>2]|=x<<24-g%4*8,g++}return l.create(m,g)}})(),a.enc.Base64})}}),$4=Se({"node_modules/crypto-js/enc-base64url.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=s.enc;p.Base64url={stringify:function(f,h){h===void 0&&(h=!0);var v=f.words,m=f.sigBytes,g=h?this._safe_map:this._map;f.clamp();for(var S=[],_=0;_>>2]>>>24-_%4*8&255,x=v[_+1>>>2]>>>24-(_+1)%4*8&255,w=v[_+2>>>2]>>>24-(_+2)%4*8&255,k=C<<16|x<<8|w,b=0;b<4&&_+b*.75>>6*(3-b)&63));var R=g.charAt(64);if(R)for(;S.length%4;)S.push(R);return S.join("")},parse:function(f,h){h===void 0&&(h=!0);var v=f.length,m=h?this._safe_map:this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var S=0;S>>6-S%4*2,x=_|C;m[g>>>2]|=x<<24-g%4*8,g++}return l.create(m,g)}})(),a.enc.Base64url})}}),Kn=Se({"node_modules/crypto-js/md5.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,p=l.WordArray,u=l.Hasher,f=c.algo,h=[];(function(){for(var C=0;C<64;C++)h[C]=s.abs(s.sin(C+1))*4294967296|0})();var v=f.MD5=u.extend({_doReset:function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(C,x){for(var w=0;w<16;w++){var k=x+w,b=C[k];C[k]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}var R=this._hash.words,P=C[x+0],j=C[x+1],B=C[x+2],D=C[x+3],F=C[x+4],O=C[x+5],L=C[x+6],G=C[x+7],$=C[x+8],J=C[x+9],ae=C[x+10],Q=C[x+11],ne=C[x+12],U=C[x+13],te=C[x+14],X=C[x+15],E=R[0],I=R[1],H=R[2],V=R[3];E=m(E,I,H,V,P,7,h[0]),V=m(V,E,I,H,j,12,h[1]),H=m(H,V,E,I,B,17,h[2]),I=m(I,H,V,E,D,22,h[3]),E=m(E,I,H,V,F,7,h[4]),V=m(V,E,I,H,O,12,h[5]),H=m(H,V,E,I,L,17,h[6]),I=m(I,H,V,E,G,22,h[7]),E=m(E,I,H,V,$,7,h[8]),V=m(V,E,I,H,J,12,h[9]),H=m(H,V,E,I,ae,17,h[10]),I=m(I,H,V,E,Q,22,h[11]),E=m(E,I,H,V,ne,7,h[12]),V=m(V,E,I,H,U,12,h[13]),H=m(H,V,E,I,te,17,h[14]),I=m(I,H,V,E,X,22,h[15]),E=g(E,I,H,V,j,5,h[16]),V=g(V,E,I,H,L,9,h[17]),H=g(H,V,E,I,Q,14,h[18]),I=g(I,H,V,E,P,20,h[19]),E=g(E,I,H,V,O,5,h[20]),V=g(V,E,I,H,ae,9,h[21]),H=g(H,V,E,I,X,14,h[22]),I=g(I,H,V,E,F,20,h[23]),E=g(E,I,H,V,J,5,h[24]),V=g(V,E,I,H,te,9,h[25]),H=g(H,V,E,I,D,14,h[26]),I=g(I,H,V,E,$,20,h[27]),E=g(E,I,H,V,U,5,h[28]),V=g(V,E,I,H,B,9,h[29]),H=g(H,V,E,I,G,14,h[30]),I=g(I,H,V,E,ne,20,h[31]),E=S(E,I,H,V,O,4,h[32]),V=S(V,E,I,H,$,11,h[33]),H=S(H,V,E,I,Q,16,h[34]),I=S(I,H,V,E,te,23,h[35]),E=S(E,I,H,V,j,4,h[36]),V=S(V,E,I,H,F,11,h[37]),H=S(H,V,E,I,G,16,h[38]),I=S(I,H,V,E,ae,23,h[39]),E=S(E,I,H,V,U,4,h[40]),V=S(V,E,I,H,P,11,h[41]),H=S(H,V,E,I,D,16,h[42]),I=S(I,H,V,E,L,23,h[43]),E=S(E,I,H,V,J,4,h[44]),V=S(V,E,I,H,ne,11,h[45]),H=S(H,V,E,I,X,16,h[46]),I=S(I,H,V,E,B,23,h[47]),E=_(E,I,H,V,P,6,h[48]),V=_(V,E,I,H,G,10,h[49]),H=_(H,V,E,I,te,15,h[50]),I=_(I,H,V,E,O,21,h[51]),E=_(E,I,H,V,ne,6,h[52]),V=_(V,E,I,H,D,10,h[53]),H=_(H,V,E,I,ae,15,h[54]),I=_(I,H,V,E,j,21,h[55]),E=_(E,I,H,V,$,6,h[56]),V=_(V,E,I,H,X,10,h[57]),H=_(H,V,E,I,L,15,h[58]),I=_(I,H,V,E,U,21,h[59]),E=_(E,I,H,V,F,6,h[60]),V=_(V,E,I,H,Q,10,h[61]),H=_(H,V,E,I,B,15,h[62]),I=_(I,H,V,E,J,21,h[63]),R[0]=R[0]+E|0,R[1]=R[1]+I|0,R[2]=R[2]+H|0,R[3]=R[3]+V|0},_doFinalize:function(){var C=this._data,x=C.words,w=this._nDataBytes*8,k=C.sigBytes*8;x[k>>>5]|=128<<24-k%32;var b=s.floor(w/4294967296),R=w;x[(k+64>>>9<<4)+15]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,x[(k+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,C.sigBytes=(x.length+1)*4,this._process();for(var P=this._hash,j=P.words,B=0;B<4;B++){var D=j[B];j[B]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return P},clone:function(){var C=u.clone.call(this);return C._hash=this._hash.clone(),C}});function m(C,x,w,k,b,R,P){var j=C+(x&w|~x&k)+b+P;return(j<>>32-R)+x}function g(C,x,w,k,b,R,P){var j=C+(x&k|w&~k)+b+P;return(j<>>32-R)+x}function S(C,x,w,k,b,R,P){var j=C+(x^w^k)+b+P;return(j<>>32-R)+x}function _(C,x,w,k,b,R,P){var j=C+(w^(x|~k))+b+P;return(j<>>32-R)+x}c.MD5=u._createHelper(v),c.HmacMD5=u._createHmacHelper(v)})(Math),a.MD5})}}),Hp=Se({"node_modules/crypto-js/sha1.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=c.Hasher,u=s.algo,f=[],h=u.SHA1=p.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,m){for(var g=this._hash.words,S=g[0],_=g[1],C=g[2],x=g[3],w=g[4],k=0;k<80;k++){if(k<16)f[k]=v[m+k]|0;else{var b=f[k-3]^f[k-8]^f[k-14]^f[k-16];f[k]=b<<1|b>>>31}var R=(S<<5|S>>>27)+w+f[k];k<20?R+=(_&C|~_&x)+1518500249:k<40?R+=(_^C^x)+1859775393:k<60?R+=(_&C|_&x|C&x)-1894007588:R+=(_^C^x)-899497514,w=x,x=C,C=_<<30|_>>>2,_=S,S=R}g[0]=g[0]+S|0,g[1]=g[1]+_|0,g[2]=g[2]+C|0,g[3]=g[3]+x|0,g[4]=g[4]+w|0},_doFinalize:function(){var v=this._data,m=v.words,g=this._nDataBytes*8,S=v.sigBytes*8;return m[S>>>5]|=128<<24-S%32,m[(S+64>>>9<<4)+14]=Math.floor(g/4294967296),m[(S+64>>>9<<4)+15]=g,v.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var v=p.clone.call(this);return v._hash=this._hash.clone(),v}});s.SHA1=p._createHelper(h),s.HmacSHA1=p._createHmacHelper(h)})(),a.SHA1})}}),Ra=Se({"node_modules/crypto-js/sha256.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,p=l.WordArray,u=l.Hasher,f=c.algo,h=[],v=[];(function(){function S(w){for(var k=s.sqrt(w),b=2;b<=k;b++)if(!(w%b))return!1;return!0}function _(w){return(w-(w|0))*4294967296|0}for(var C=2,x=0;x<64;)S(C)&&(x<8&&(h[x]=_(s.pow(C,1/2))),v[x]=_(s.pow(C,1/3)),x++),C++})();var m=[],g=f.SHA256=u.extend({_doReset:function(){this._hash=new p.init(h.slice(0))},_doProcessBlock:function(S,_){for(var C=this._hash.words,x=C[0],w=C[1],k=C[2],b=C[3],R=C[4],P=C[5],j=C[6],B=C[7],D=0;D<64;D++){if(D<16)m[D]=S[_+D]|0;else{var F=m[D-15],O=(F<<25|F>>>7)^(F<<14|F>>>18)^F>>>3,L=m[D-2],G=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;m[D]=O+m[D-7]+G+m[D-16]}var $=R&P^~R&j,J=x&w^x&k^w&k,ae=(x<<30|x>>>2)^(x<<19|x>>>13)^(x<<10|x>>>22),Q=(R<<26|R>>>6)^(R<<21|R>>>11)^(R<<7|R>>>25),ne=B+Q+$+v[D]+m[D],U=ae+J;B=j,j=P,P=R,R=b+ne|0,b=k,k=w,w=x,x=ne+U|0}C[0]=C[0]+x|0,C[1]=C[1]+w|0,C[2]=C[2]+k|0,C[3]=C[3]+b|0,C[4]=C[4]+R|0,C[5]=C[5]+P|0,C[6]=C[6]+j|0,C[7]=C[7]+B|0},_doFinalize:function(){var S=this._data,_=S.words,C=this._nDataBytes*8,x=S.sigBytes*8;return _[x>>>5]|=128<<24-x%32,_[(x+64>>>9<<4)+14]=s.floor(C/4294967296),_[(x+64>>>9<<4)+15]=C,S.sigBytes=_.length*4,this._process(),this._hash},clone:function(){var S=u.clone.call(this);return S._hash=this._hash.clone(),S}});c.SHA256=u._createHelper(g),c.HmacSHA256=u._createHmacHelper(g)})(Math),a.SHA256})}}),Y4=Se({"node_modules/crypto-js/sha224.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Ra()):typeof define=="function"&&define.amd?define(["./core","./sha256"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=s.algo,u=p.SHA256,f=p.SHA224=u.extend({_doReset:function(){this._hash=new l.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var h=u._doFinalize.call(this);return h.sigBytes-=4,h}});s.SHA224=u._createHelper(f),s.HmacSHA224=u._createHmacHelper(f)})(),a.SHA224})}}),Lp=Se({"node_modules/crypto-js/sha512.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),ki()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.Hasher,p=s.x64,u=p.Word,f=p.WordArray,h=s.algo;function v(){return u.create.apply(u,arguments)}var m=[v(1116352408,3609767458),v(1899447441,602891725),v(3049323471,3964484399),v(3921009573,2173295548),v(961987163,4081628472),v(1508970993,3053834265),v(2453635748,2937671579),v(2870763221,3664609560),v(3624381080,2734883394),v(310598401,1164996542),v(607225278,1323610764),v(1426881987,3590304994),v(1925078388,4068182383),v(2162078206,991336113),v(2614888103,633803317),v(3248222580,3479774868),v(3835390401,2666613458),v(4022224774,944711139),v(264347078,2341262773),v(604807628,2007800933),v(770255983,1495990901),v(1249150122,1856431235),v(1555081692,3175218132),v(1996064986,2198950837),v(2554220882,3999719339),v(2821834349,766784016),v(2952996808,2566594879),v(3210313671,3203337956),v(3336571891,1034457026),v(3584528711,2466948901),v(113926993,3758326383),v(338241895,168717936),v(666307205,1188179964),v(773529912,1546045734),v(1294757372,1522805485),v(1396182291,2643833823),v(1695183700,2343527390),v(1986661051,1014477480),v(2177026350,1206759142),v(2456956037,344077627),v(2730485921,1290863460),v(2820302411,3158454273),v(3259730800,3505952657),v(3345764771,106217008),v(3516065817,3606008344),v(3600352804,1432725776),v(4094571909,1467031594),v(275423344,851169720),v(430227734,3100823752),v(506948616,1363258195),v(659060556,3750685593),v(883997877,3785050280),v(958139571,3318307427),v(1322822218,3812723403),v(1537002063,2003034995),v(1747873779,3602036899),v(1955562222,1575990012),v(2024104815,1125592928),v(2227730452,2716904306),v(2361852424,442776044),v(2428436474,593698344),v(2756734187,3733110249),v(3204031479,2999351573),v(3329325298,3815920427),v(3391569614,3928383900),v(3515267271,566280711),v(3940187606,3454069534),v(4118630271,4000239992),v(116418474,1914138554),v(174292421,2731055270),v(289380356,3203993006),v(460393269,320620315),v(685471733,587496836),v(852142971,1086792851),v(1017036298,365543100),v(1126000580,2618297676),v(1288033470,3409855158),v(1501505948,4234509866),v(1607167915,987167468),v(1816402316,1246189591)],g=[];(function(){for(var _=0;_<80;_++)g[_]=v()})();var S=h.SHA512=l.extend({_doReset:function(){this._hash=new f.init([new u.init(1779033703,4089235720),new u.init(3144134277,2227873595),new u.init(1013904242,4271175723),new u.init(2773480762,1595750129),new u.init(1359893119,2917565137),new u.init(2600822924,725511199),new u.init(528734635,4215389547),new u.init(1541459225,327033209)])},_doProcessBlock:function(_,C){for(var x=this._hash.words,w=x[0],k=x[1],b=x[2],R=x[3],P=x[4],j=x[5],B=x[6],D=x[7],F=w.high,O=w.low,L=k.high,G=k.low,$=b.high,J=b.low,ae=R.high,Q=R.low,ne=P.high,U=P.low,te=j.high,X=j.low,E=B.high,I=B.low,H=D.high,V=D.low,re=F,ce=O,pe=L,oe=G,Ae=$,ze=J,dt=ae,it=Q,ft=ne,Ze=U,ar=te,Vt=X,Tt=E,Wt=I,ht=H,Dt=V,nt=0;nt<80;nt++){var Ue,pt,$t=g[nt];if(nt<16)pt=$t.high=_[C+nt*2]|0,Ue=$t.low=_[C+nt*2+1]|0;else{var dr=g[nt-15],Z=dr.high,he=dr.low,Te=(Z>>>1|he<<31)^(Z>>>8|he<<24)^Z>>>7,Ce=(he>>>1|Z<<31)^(he>>>8|Z<<24)^(he>>>7|Z<<25),De=g[nt-2],Ke=De.high,Qe=De.low,Yt=(Ke>>>19|Qe<<13)^(Ke<<3|Qe>>>29)^Ke>>>6,Pt=(Qe>>>19|Ke<<13)^(Qe<<3|Ke>>>29)^(Qe>>>6|Ke<<26),ee=g[nt-7],le=ee.high,ve=ee.low,je=g[nt-16],Ne=je.high,Oe=je.low;Ue=Ce+ve,pt=Te+le+(Ue>>>0>>0?1:0),Ue=Ue+Pt,pt=pt+Yt+(Ue>>>0>>0?1:0),Ue=Ue+Oe,pt=pt+Ne+(Ue>>>0>>0?1:0),$t.high=pt,$t.low=Ue}var Fe=ft&ar^~ft&Tt,Ve=Ze&Vt^~Ze&Wt,Kt=re&pe^re&Ae^pe&Ae,Ee=ce&oe^ce&ze^oe&ze,qe=(re>>>28|ce<<4)^(re<<30|ce>>>2)^(re<<25|ce>>>7),ot=(ce>>>28|re<<4)^(ce<<30|re>>>2)^(ce<<25|re>>>7),mt=(ft>>>14|Ze<<18)^(ft>>>18|Ze<<14)^(ft<<23|Ze>>>9),fr=(Ze>>>14|ft<<18)^(Ze>>>18|ft<<14)^(Ze<<23|ft>>>9),He=m[nt],Je=He.high,wr=He.low,$e=Dt+fr,vt=ht+mt+($e>>>0
>>0?1:0),$e=$e+Ve,vt=vt+Fe+($e>>>0>>0?1:0),$e=$e+wr,vt=vt+Je+($e>>>0>>0?1:0),$e=$e+Ue,vt=vt+pt+($e>>>0>>0?1:0),br=ot+Ee,Xt=qe+Kt+(br>>>0>>0?1:0);ht=Tt,Dt=Wt,Tt=ar,Wt=Vt,ar=ft,Vt=Ze,Ze=it+$e|0,ft=dt+vt+(Ze>>>0>>0?1:0)|0,dt=Ae,it=ze,Ae=pe,ze=oe,pe=re,oe=ce,ce=$e+br|0,re=vt+Xt+(ce>>>0<$e>>>0?1:0)|0}O=w.low=O+ce,w.high=F+re+(O>>>0>>0?1:0),G=k.low=G+oe,k.high=L+pe+(G>>>0>>0?1:0),J=b.low=J+ze,b.high=$+Ae+(J>>>0>>0?1:0),Q=R.low=Q+it,R.high=ae+dt+(Q>>>0>>0?1:0),U=P.low=U+Ze,P.high=ne+ft+(U>>>0>>0?1:0),X=j.low=X+Vt,j.high=te+ar+(X>>>0>>0?1:0),I=B.low=I+Wt,B.high=E+Tt+(I>>>0>>0?1:0),V=D.low=V+Dt,D.high=H+ht+(V>>>0
>>0?1:0)},_doFinalize:function(){var _=this._data,C=_.words,x=this._nDataBytes*8,w=_.sigBytes*8;C[w>>>5]|=128<<24-w%32,C[(w+128>>>10<<5)+30]=Math.floor(x/4294967296),C[(w+128>>>10<<5)+31]=x,_.sigBytes=C.length*4,this._process();var k=this._hash.toX32();return k},clone:function(){var _=l.clone.call(this);return _._hash=this._hash.clone(),_},blockSize:1024/32});s.SHA512=l._createHelper(S),s.HmacSHA512=l._createHmacHelper(S)})(),a.SHA512})}}),X4=Se({"node_modules/crypto-js/sha384.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),ki(),Lp()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.x64,l=c.Word,p=c.WordArray,u=s.algo,f=u.SHA512,h=u.SHA384=f.extend({_doReset:function(){this._hash=new p.init([new l.init(3418070365,3238371032),new l.init(1654270250,914150663),new l.init(2438529370,812702999),new l.init(355462360,4144912697),new l.init(1731405415,4290775857),new l.init(2394180231,1750603025),new l.init(3675008525,1694076839),new l.init(1203062813,3204075428)])},_doFinalize:function(){var v=f._doFinalize.call(this);return v.sigBytes-=16,v}});s.SHA384=f._createHelper(h),s.HmacSHA384=f._createHmacHelper(h)})(),a.SHA384})}}),Q4=Se({"node_modules/crypto-js/sha3.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),ki()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,p=l.WordArray,u=l.Hasher,f=c.x64,h=f.Word,v=c.algo,m=[],g=[],S=[];(function(){for(var x=1,w=0,k=0;k<24;k++){m[x+5*w]=(k+1)*(k+2)/2%64;var b=w%5,R=(2*x+3*w)%5;x=b,w=R}for(var x=0;x<5;x++)for(var w=0;w<5;w++)g[x+5*w]=w+(2*x+3*w)%5*5;for(var P=1,j=0;j<24;j++){for(var B=0,D=0,F=0;F<7;F++){if(P&1){var O=(1<>>24)&16711935|(P<<24|P>>>8)&4278255360,j=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;var B=k[R];B.high^=j,B.low^=P}for(var D=0;D<24;D++){for(var F=0;F<5;F++){for(var O=0,L=0,G=0;G<5;G++){var B=k[F+5*G];O^=B.high,L^=B.low}var $=_[F];$.high=O,$.low=L}for(var F=0;F<5;F++)for(var J=_[(F+4)%5],ae=_[(F+1)%5],Q=ae.high,ne=ae.low,O=J.high^(Q<<1|ne>>>31),L=J.low^(ne<<1|Q>>>31),G=0;G<5;G++){var B=k[F+5*G];B.high^=O,B.low^=L}for(var U=1;U<25;U++){var O,L,B=k[U],te=B.high,X=B.low,E=m[U];E<32?(O=te<>>32-E,L=X<>>32-E):(O=X<>>64-E,L=te<>>64-E);var I=_[g[U]];I.high=O,I.low=L}var H=_[0],V=k[0];H.high=V.high,H.low=V.low;for(var F=0;F<5;F++)for(var G=0;G<5;G++){var U=F+5*G,B=k[U],re=_[U],ce=_[(F+1)%5+5*G],pe=_[(F+2)%5+5*G];B.high=re.high^~ce.high&pe.high,B.low=re.low^~ce.low&pe.low}var B=k[0],oe=S[D];B.high^=oe.high,B.low^=oe.low}},_doFinalize:function(){var x=this._data,w=x.words;this._nDataBytes*8;var k=x.sigBytes*8,b=this.blockSize*32;w[k>>>5]|=1<<24-k%32,w[(s.ceil((k+1)/b)*b>>>5)-1]|=128,x.sigBytes=w.length*4,this._process();for(var R=this._state,P=this.cfg.outputLength/8,j=P/8,B=[],D=0;D>>24)&16711935|(O<<24|O>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,B.push(L),B.push(O)}return new p.init(B,P)},clone:function(){for(var x=u.clone.call(this),w=x._state=this._state.slice(0),k=0;k<25;k++)w[k]=w[k].clone();return x}});c.SHA3=u._createHelper(C),c.HmacSHA3=u._createHmacHelper(C)})(Math),a.SHA3})}}),Z4=Se({"node_modules/crypto-js/ripemd160.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,p=l.WordArray,u=l.Hasher,f=c.algo,h=p.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),v=p.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),m=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]),g=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]),S=p.create([0,1518500249,1859775393,2400959708,2840853838]),_=p.create([1352829926,1548603684,1836072691,2053994217,0]),C=f.RIPEMD160=u.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(j,B){for(var D=0;D<16;D++){var F=B+D,O=j[F];j[F]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var L=this._hash.words,G=S.words,$=_.words,J=h.words,ae=v.words,Q=m.words,ne=g.words,U,te,X,E,I,H,V,re,ce,pe;H=U=L[0],V=te=L[1],re=X=L[2],ce=E=L[3],pe=I=L[4];for(var oe,D=0;D<80;D+=1)oe=U+j[B+J[D]]|0,D<16?oe+=x(te,X,E)+G[0]:D<32?oe+=w(te,X,E)+G[1]:D<48?oe+=k(te,X,E)+G[2]:D<64?oe+=b(te,X,E)+G[3]:oe+=R(te,X,E)+G[4],oe=oe|0,oe=P(oe,Q[D]),oe=oe+I|0,U=I,I=E,E=P(X,10),X=te,te=oe,oe=H+j[B+ae[D]]|0,D<16?oe+=R(V,re,ce)+$[0]:D<32?oe+=b(V,re,ce)+$[1]:D<48?oe+=k(V,re,ce)+$[2]:D<64?oe+=w(V,re,ce)+$[3]:oe+=x(V,re,ce)+$[4],oe=oe|0,oe=P(oe,ne[D]),oe=oe+pe|0,H=pe,pe=ce,ce=P(re,10),re=V,V=oe;oe=L[1]+X+ce|0,L[1]=L[2]+E+pe|0,L[2]=L[3]+I+H|0,L[3]=L[4]+U+V|0,L[4]=L[0]+te+re|0,L[0]=oe},_doFinalize:function(){var j=this._data,B=j.words,D=this._nDataBytes*8,F=j.sigBytes*8;B[F>>>5]|=128<<24-F%32,B[(F+64>>>9<<4)+14]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,j.sigBytes=(B.length+1)*4,this._process();for(var O=this._hash,L=O.words,G=0;G<5;G++){var $=L[G];L[G]=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360}return O},clone:function(){var j=u.clone.call(this);return j._hash=this._hash.clone(),j}});function x(j,B,D){return j^B^D}function w(j,B,D){return j&B|~j&D}function k(j,B,D){return(j|~B)^D}function b(j,B,D){return j&D|B&~D}function R(j,B,D){return j^(B|~D)}function P(j,B){return j<>>32-B}c.RIPEMD160=u._createHelper(C),c.HmacRIPEMD160=u._createHmacHelper(C)})(),a.RIPEMD160})}}),Ci=Se({"node_modules/crypto-js/hmac.js"(r,o){(function(a,s){typeof r=="object"?o.exports=r=s(Le()):typeof define=="function"&&define.amd?define(["./core"],s):s(a.CryptoJS)})(r,function(a){(function(){var s=a,c=s.lib,l=c.Base,p=s.enc,u=p.Utf8,f=s.algo;f.HMAC=l.extend({init:function(h,v){h=this._hasher=new h.init,typeof v=="string"&&(v=u.parse(v));var m=h.blockSize,g=m*4;v.sigBytes>g&&(v=h.finalize(v)),v.clamp();for(var S=this._oKey=v.clone(),_=this._iKey=v.clone(),C=S.words,x=_.words,w=0;w>>2]&255;O.sigBytes-=L}};l.BlockCipher=S.extend({cfg:S.cfg.extend({mode:x,padding:k}),reset:function(){var O;S.reset.call(this);var L=this.cfg,G=L.iv,$=L.mode;this._xformMode==this._ENC_XFORM_MODE?O=$.createEncryptor:(O=$.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==O?this._mode.init(this,G&&G.words):(this._mode=O.call($,this,G&&G.words),this._mode.__creator=O)},_doProcessBlock:function(O,L){this._mode.processBlock(O,L)},_doFinalize:function(){var O,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),O=this._process(!0)):(O=this._process(!0),L.unpad(O)),O},blockSize:128/32});var b=l.CipherParams=p.extend({init:function(O){this.mixIn(O)},toString:function(O){return(O||this.formatter).stringify(this)}}),R=c.format={},P=R.OpenSSL={stringify:function(O){var L,G=O.ciphertext,$=O.salt;return $?L=u.create([1398893684,1701076831]).concat($).concat(G):L=G,L.toString(v)},parse:function(O){var L,G=v.parse(O),$=G.words;return $[0]==1398893684&&$[1]==1701076831&&(L=u.create($.slice(2,4)),$.splice(0,4),G.sigBytes-=16),b.create({ciphertext:G,salt:L})}},j=l.SerializableCipher=p.extend({cfg:p.extend({format:P}),encrypt:function(O,L,G,$){$=this.cfg.extend($);var J=O.createEncryptor(G,$),ae=J.finalize(L),Q=J.cfg;return b.create({ciphertext:ae,key:G,iv:Q.iv,algorithm:O,mode:Q.mode,padding:Q.padding,blockSize:O.blockSize,formatter:$.format})},decrypt:function(O,L,G,$){$=this.cfg.extend($),L=this._parse(L,$.format);var J=O.createDecryptor(G,$).finalize(L.ciphertext);return J},_parse:function(O,L){return typeof O=="string"?L.parse(O,this):O}}),B=c.kdf={},D=B.OpenSSL={execute:function(O,L,G,$,J){if($||($=u.random(64/8)),J)var ae=g.create({keySize:L+G,hasher:J}).compute(O,$);else var ae=g.create({keySize:L+G}).compute(O,$);var Q=u.create(ae.words.slice(L),G*4);return ae.sigBytes=L*4,b.create({key:ae,iv:Q,salt:$})}},F=l.PasswordBasedCipher=j.extend({cfg:j.cfg.extend({kdf:D}),encrypt:function(O,L,G,$){$=this.cfg.extend($);var J=$.kdf.execute(G,O.keySize,O.ivSize,$.salt,$.hasher);$.iv=J.iv;var ae=j.encrypt.call(this,O,L,J.key,$);return ae.mixIn(J),ae},decrypt:function(O,L,G,$){$=this.cfg.extend($),L=this._parse(L,$.format);var J=$.kdf.execute(G,O.keySize,O.ivSize,L.salt,$.hasher);$.iv=J.iv;var ae=j.decrypt.call(this,O,L,J.key,$);return ae}})})()})}}),e3=Se({"node_modules/crypto-js/mode-cfb.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.mode.CFB=(function(){var s=a.lib.BlockCipherMode.extend();s.Encryptor=s.extend({processBlock:function(l,p){var u=this._cipher,f=u.blockSize;c.call(this,l,p,f,u),this._prevBlock=l.slice(p,p+f)}}),s.Decryptor=s.extend({processBlock:function(l,p){var u=this._cipher,f=u.blockSize,h=l.slice(p,p+f);c.call(this,l,p,f,u),this._prevBlock=h}});function c(l,p,u,f){var h,v=this._iv;v?(h=v.slice(0),this._iv=void 0):h=this._prevBlock,f.encryptBlock(h,0);for(var m=0;m>24&255)===255){var f=u>>16&255,h=u>>8&255,v=u&255;f===255?(f=0,h===255?(h=0,v===255?v=0:++v):++h):++f,u=0,u+=f<<16,u+=h<<8,u+=v}else u+=1<<24;return u}function l(u){return(u[0]=c(u[0]))===0&&(u[1]=c(u[1])),u}var p=s.Encryptor=s.extend({processBlock:function(u,f){var h=this._cipher,v=h.blockSize,m=this._iv,g=this._counter;m&&(g=this._counter=m.slice(0),this._iv=void 0),l(g);var S=g.slice(0);h.encryptBlock(S,0);for(var _=0;_>>2]|=u<<24-f%4*8,s.sigBytes+=u},unpad:function(s){var c=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=c}},a.pad.Ansix923})}}),s3=Se({"node_modules/crypto-js/pad-iso10126.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.Iso10126={pad:function(s,c){var l=c*4,p=l-s.sigBytes%l;s.concat(a.lib.WordArray.random(p-1)).concat(a.lib.WordArray.create([p<<24],1))},unpad:function(s){var c=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=c}},a.pad.Iso10126})}}),i3=Se({"node_modules/crypto-js/pad-iso97971.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.Iso97971={pad:function(s,c){s.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(s,c)},unpad:function(s){a.pad.ZeroPadding.unpad(s),s.sigBytes--}},a.pad.Iso97971})}}),l3=Se({"node_modules/crypto-js/pad-zeropadding.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.ZeroPadding={pad:function(s,c){var l=c*4;s.clamp(),s.sigBytes+=l-(s.sigBytes%l||l)},unpad:function(s){for(var c=s.words,l=s.sigBytes-1,l=s.sigBytes-1;l>=0;l--)if(c[l>>>2]>>>24-l%4*8&255){s.sigBytes=l+1;break}}},a.pad.ZeroPadding})}}),c3=Se({"node_modules/crypto-js/pad-nopadding.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})}}),u3=Se({"node_modules/crypto-js/format-hex.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),jt()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(s){var c=a,l=c.lib,p=l.CipherParams,u=c.enc,f=u.Hex,h=c.format;h.Hex={stringify:function(v){return v.ciphertext.toString(f)},parse:function(v){var m=f.parse(v);return p.create({ciphertext:m})}}})(),a.format.Hex})}}),d3=Se({"node_modules/crypto-js/aes.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.BlockCipher,p=s.algo,u=[],f=[],h=[],v=[],m=[],g=[],S=[],_=[],C=[],x=[];(function(){for(var b=[],R=0;R<256;R++)R<128?b[R]=R<<1:b[R]=R<<1^283;for(var P=0,j=0,R=0;R<256;R++){var B=j^j<<1^j<<2^j<<3^j<<4;B=B>>>8^B&255^99,u[P]=B,f[B]=P;var D=b[P],F=b[D],O=b[F],L=b[B]*257^B*16843008;h[P]=L<<24|L>>>8,v[P]=L<<16|L>>>16,m[P]=L<<8|L>>>24,g[P]=L;var L=O*16843009^F*65537^D*257^P*16843008;S[B]=L<<24|L>>>8,_[B]=L<<16|L>>>16,C[B]=L<<8|L>>>24,x[B]=L,P?(P=D^b[b[b[O^D]]],j^=b[b[j]]):P=j=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],k=p.AES=l.extend({_doReset:function(){var b;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var R=this._keyPriorReset=this._key,P=R.words,j=R.sigBytes/4,B=this._nRounds=j+6,D=(B+1)*4,F=this._keySchedule=[],O=0;O6&&O%j==4&&(b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255]):(b=b<<8|b>>>24,b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255],b^=w[O/j|0]<<24),F[O]=F[O-j]^b);for(var L=this._invKeySchedule=[],G=0;G>>24]]^_[u[b>>>16&255]]^C[u[b>>>8&255]]^x[u[b&255]]}}},encryptBlock:function(b,R){this._doCryptBlock(b,R,this._keySchedule,h,v,m,g,u)},decryptBlock:function(b,R){var P=b[R+1];b[R+1]=b[R+3],b[R+3]=P,this._doCryptBlock(b,R,this._invKeySchedule,S,_,C,x,f);var P=b[R+1];b[R+1]=b[R+3],b[R+3]=P},_doCryptBlock:function(b,R,P,j,B,D,F,O){for(var L=this._nRounds,G=b[R]^P[0],$=b[R+1]^P[1],J=b[R+2]^P[2],ae=b[R+3]^P[3],Q=4,ne=1;ne>>24]^B[$>>>16&255]^D[J>>>8&255]^F[ae&255]^P[Q++],te=j[$>>>24]^B[J>>>16&255]^D[ae>>>8&255]^F[G&255]^P[Q++],X=j[J>>>24]^B[ae>>>16&255]^D[G>>>8&255]^F[$&255]^P[Q++],E=j[ae>>>24]^B[G>>>16&255]^D[$>>>8&255]^F[J&255]^P[Q++];G=U,$=te,J=X,ae=E}var U=(O[G>>>24]<<24|O[$>>>16&255]<<16|O[J>>>8&255]<<8|O[ae&255])^P[Q++],te=(O[$>>>24]<<24|O[J>>>16&255]<<16|O[ae>>>8&255]<<8|O[G&255])^P[Q++],X=(O[J>>>24]<<24|O[ae>>>16&255]<<16|O[G>>>8&255]<<8|O[$&255])^P[Q++],E=(O[ae>>>24]<<24|O[G>>>16&255]<<16|O[$>>>8&255]<<8|O[J&255])^P[Q++];b[R]=U,b[R+1]=te,b[R+2]=X,b[R+3]=E},keySize:256/32});s.AES=l._createHelper(k)})(),a.AES})}}),f3=Se({"node_modules/crypto-js/tripledes.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.WordArray,p=c.BlockCipher,u=s.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],h=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],v=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],m=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],g=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],S=u.DES=p.extend({_doReset:function(){for(var w=this._key,k=w.words,b=[],R=0;R<56;R++){var P=f[R]-1;b[R]=k[P>>>5]>>>31-P%32&1}for(var j=this._subKeys=[],B=0;B<16;B++){for(var D=j[B]=[],F=v[B],R=0;R<24;R++)D[R/6|0]|=b[(h[R]-1+F)%28]<<31-R%6,D[4+(R/6|0)]|=b[28+(h[R+24]-1+F)%28]<<31-R%6;D[0]=D[0]<<1|D[0]>>>31;for(var R=1;R<7;R++)D[R]=D[R]>>>(R-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var O=this._invSubKeys=[],R=0;R<16;R++)O[R]=j[15-R]},encryptBlock:function(w,k){this._doCryptBlock(w,k,this._subKeys)},decryptBlock:function(w,k){this._doCryptBlock(w,k,this._invSubKeys)},_doCryptBlock:function(w,k,b){this._lBlock=w[k],this._rBlock=w[k+1],_.call(this,4,252645135),_.call(this,16,65535),C.call(this,2,858993459),C.call(this,8,16711935),_.call(this,1,1431655765);for(var R=0;R<16;R++){for(var P=b[R],j=this._lBlock,B=this._rBlock,D=0,F=0;F<8;F++)D|=m[F][((B^P[F])&g[F])>>>0];this._lBlock=B,this._rBlock=j^D}var O=this._lBlock;this._lBlock=this._rBlock,this._rBlock=O,_.call(this,1,1431655765),C.call(this,8,16711935),C.call(this,2,858993459),_.call(this,16,65535),_.call(this,4,252645135),w[k]=this._lBlock,w[k+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function _(w,k){var b=(this._lBlock>>>w^this._rBlock)&k;this._rBlock^=b,this._lBlock^=b<>>w^this._lBlock)&k;this._lBlock^=b,this._rBlock^=b<192.");var b=k.slice(0,2),R=k.length<4?k.slice(0,2):k.slice(2,4),P=k.length<6?k.slice(0,2):k.slice(4,6);this._des1=S.createEncryptor(l.create(b)),this._des2=S.createEncryptor(l.create(R)),this._des3=S.createEncryptor(l.create(P))},encryptBlock:function(w,k){this._des1.encryptBlock(w,k),this._des2.decryptBlock(w,k),this._des3.encryptBlock(w,k)},decryptBlock:function(w,k){this._des3.decryptBlock(w,k),this._des2.encryptBlock(w,k),this._des1.decryptBlock(w,k)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=p._createHelper(x)})(),a.TripleDES})}}),h3=Se({"node_modules/crypto-js/rc4.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,p=s.algo,u=p.RC4=l.extend({_doReset:function(){for(var v=this._key,m=v.words,g=v.sigBytes,S=this._S=[],_=0;_<256;_++)S[_]=_;for(var _=0,C=0;_<256;_++){var x=_%g,w=m[x>>>2]>>>24-x%4*8&255;C=(C+S[_]+w)%256;var k=S[_];S[_]=S[C],S[C]=k}this._i=this._j=0},_doProcessBlock:function(v,m){v[m]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var v=this._S,m=this._i,g=this._j,S=0,_=0;_<4;_++){m=(m+1)%256,g=(g+v[m])%256;var C=v[m];v[m]=v[g],v[g]=C,S|=v[(v[m]+v[g])%256]<<24-_*8}return this._i=m,this._j=g,S}s.RC4=l._createHelper(u);var h=p.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var v=this.cfg.drop;v>0;v--)f.call(this)}});s.RC4Drop=l._createHelper(h)})(),a.RC4})}}),p3=Se({"node_modules/crypto-js/rabbit.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,p=s.algo,u=[],f=[],h=[],v=p.Rabbit=l.extend({_doReset:function(){for(var g=this._key.words,S=this.cfg.iv,_=0;_<4;_++)g[_]=(g[_]<<8|g[_]>>>24)&16711935|(g[_]<<24|g[_]>>>8)&4278255360;var C=this._X=[g[0],g[3]<<16|g[2]>>>16,g[1],g[0]<<16|g[3]>>>16,g[2],g[1]<<16|g[0]>>>16,g[3],g[2]<<16|g[1]>>>16],x=this._C=[g[2]<<16|g[2]>>>16,g[0]&4294901760|g[1]&65535,g[3]<<16|g[3]>>>16,g[1]&4294901760|g[2]&65535,g[0]<<16|g[0]>>>16,g[2]&4294901760|g[3]&65535,g[1]<<16|g[1]>>>16,g[3]&4294901760|g[0]&65535];this._b=0;for(var _=0;_<4;_++)m.call(this);for(var _=0;_<8;_++)x[_]^=C[_+4&7];if(S){var w=S.words,k=w[0],b=w[1],R=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,P=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,j=R>>>16|P&4294901760,B=P<<16|R&65535;x[0]^=R,x[1]^=j,x[2]^=P,x[3]^=B,x[4]^=R,x[5]^=j,x[6]^=P,x[7]^=B;for(var _=0;_<4;_++)m.call(this)}},_doProcessBlock:function(g,S){var _=this._X;m.call(this),u[0]=_[0]^_[5]>>>16^_[3]<<16,u[1]=_[2]^_[7]>>>16^_[5]<<16,u[2]=_[4]^_[1]>>>16^_[7]<<16,u[3]=_[6]^_[3]>>>16^_[1]<<16;for(var C=0;C<4;C++)u[C]=(u[C]<<8|u[C]>>>24)&16711935|(u[C]<<24|u[C]>>>8)&4278255360,g[S+C]^=u[C]},blockSize:128/32,ivSize:64/32});function m(){for(var g=this._X,S=this._C,_=0;_<8;_++)f[_]=S[_];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0>>0?1:0)|0,this._b=S[7]>>>0>>0?1:0;for(var _=0;_<8;_++){var C=g[_]+S[_],x=C&65535,w=C>>>16,k=((x*x>>>17)+x*w>>>15)+w*w,b=((C&4294901760)*C|0)+((C&65535)*C|0);h[_]=k^b}g[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,g[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,g[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,g[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,g[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,g[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,g[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,g[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}s.Rabbit=l._createHelper(v)})(),a.Rabbit})}}),m3=Se({"node_modules/crypto-js/rabbit-legacy.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.StreamCipher,p=s.algo,u=[],f=[],h=[],v=p.RabbitLegacy=l.extend({_doReset:function(){var g=this._key.words,S=this.cfg.iv,_=this._X=[g[0],g[3]<<16|g[2]>>>16,g[1],g[0]<<16|g[3]>>>16,g[2],g[1]<<16|g[0]>>>16,g[3],g[2]<<16|g[1]>>>16],C=this._C=[g[2]<<16|g[2]>>>16,g[0]&4294901760|g[1]&65535,g[3]<<16|g[3]>>>16,g[1]&4294901760|g[2]&65535,g[0]<<16|g[0]>>>16,g[2]&4294901760|g[3]&65535,g[1]<<16|g[1]>>>16,g[3]&4294901760|g[0]&65535];this._b=0;for(var x=0;x<4;x++)m.call(this);for(var x=0;x<8;x++)C[x]^=_[x+4&7];if(S){var w=S.words,k=w[0],b=w[1],R=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,P=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,j=R>>>16|P&4294901760,B=P<<16|R&65535;C[0]^=R,C[1]^=j,C[2]^=P,C[3]^=B,C[4]^=R,C[5]^=j,C[6]^=P,C[7]^=B;for(var x=0;x<4;x++)m.call(this)}},_doProcessBlock:function(g,S){var _=this._X;m.call(this),u[0]=_[0]^_[5]>>>16^_[3]<<16,u[1]=_[2]^_[7]>>>16^_[5]<<16,u[2]=_[4]^_[1]>>>16^_[7]<<16,u[3]=_[6]^_[3]>>>16^_[1]<<16;for(var C=0;C<4;C++)u[C]=(u[C]<<8|u[C]>>>24)&16711935|(u[C]<<24|u[C]>>>8)&4278255360,g[S+C]^=u[C]},blockSize:128/32,ivSize:64/32});function m(){for(var g=this._X,S=this._C,_=0;_<8;_++)f[_]=S[_];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0>>0?1:0)|0,this._b=S[7]>>>0>>0?1:0;for(var _=0;_<8;_++){var C=g[_]+S[_],x=C&65535,w=C>>>16,k=((x*x>>>17)+x*w>>>15)+w*w,b=((C&4294901760)*C|0)+((C&65535)*C|0);h[_]=k^b}g[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,g[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,g[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,g[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,g[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,g[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,g[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,g[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}s.RabbitLegacy=l._createHelper(v)})(),a.RabbitLegacy})}}),v3=Se({"node_modules/crypto-js/blowfish.js"(r,o){(function(a,s,c){typeof r=="object"?o.exports=r=s(Le(),Wn(),Kn(),kn(),jt()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],s):s(a.CryptoJS)})(r,function(a){return(function(){var s=a,c=s.lib,l=c.BlockCipher,p=s.algo;const u=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],h=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var v={pbox:[],sbox:[]};function m(x,w){let k=w>>24&255,b=w>>16&255,R=w>>8&255,P=w&255,j=x.sbox[0][k]+x.sbox[1][b];return j=j^x.sbox[2][R],j=j+x.sbox[3][P],j}function g(x,w,k){let b=w,R=k,P;for(let j=0;j1;--j)b=b^x.pbox[j],R=m(x,b)^R,P=b,b=R,R=P;return P=b,b=R,R=P,R=R^x.pbox[1],b=b^x.pbox[0],{left:b,right:R}}function _(x,w,k){for(let B=0;B<4;B++){x.sbox[B]=[];for(let D=0;D<256;D++)x.sbox[B][D]=h[B][D]}let b=0;for(let B=0;B=k&&(b=0);let R=0,P=0,j=0;for(let B=0;B=0&&(P=P.substring(0,j));const B=P.indexOf(": ");let D,F;if(B>0&&B<50){const O=P.substring(0,B);/[:\[\]]/.test(O)?F=P:(D=O,F=P.substring(B+2))}else F=P;return{success:!0,data:{timestamp:w,flags:k,sender:D,message:F}}}catch(u){return{success:!1,error:u instanceof Error?u.message:"Decryption failed"}}}static calculateChannelHash(c){const l=(0,o.SHA256)(o.enc.Hex.parse(c));return(0,a.hexToBytes)(l.toString(o.enc.Hex))[0].toString(16).padStart(2,"0")}};r.ChannelCrypto=s}}),Up=Se({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/key-manager.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.MeshCoreKeyStore=void 0;var o=yu(),a=class{constructor(s){this.nodeKeys=new Map,this.channelHashToKeys=new Map,s!=null&&s.channelSecrets&&this.addChannelSecrets(s.channelSecrets),s!=null&&s.nodeKeys&&Object.entries(s.nodeKeys).forEach(([c,l])=>{this.addNodeKey(c,l)})}addNodeKey(s,c){const l=s.toUpperCase();this.nodeKeys.set(l,c)}hasChannelKey(s){const c=s.toLowerCase();return this.channelHashToKeys.has(c)}hasNodeKey(s){const c=s.toUpperCase();return this.nodeKeys.has(c)}getChannelKeys(s){const c=s.toLowerCase();return this.channelHashToKeys.get(c)||[]}getNodeKey(s){const c=s.toUpperCase();return this.nodeKeys.get(c)}addChannelSecrets(s){for(const c of s){const l=o.ChannelCrypto.calculateChannelHash(c).toLowerCase();this.channelHashToKeys.has(l)||this.channelHashToKeys.set(l,[]),this.channelHashToKeys.get(l).push(c)}}};r.MeshCoreKeyStore=a}}),Vp={};W4(Vp,{CURVE:()=>Jc,ExtendedPoint:()=>Lr,Point:()=>Lr,etc:()=>ii,getPublicKey:()=>Kp,getPublicKeyAsync:()=>Wp,sign:()=>qp,signAsync:()=>Gp,utils:()=>Xp,verify:()=>Yp,verifyAsync:()=>$p});var Jc,It,ha,Sc,kc,Ws,Ks,Oh,Rr,wo,nr,Mh,Cc,Ih,wn,pa,Gs,Ec,qs,Fr,Tc,$s,Zr,Pc,Fh,bo,Rc,ma,bn,ge,Nc,Ac,Hh,Bc,Ys,Xs,Lr,Hr,Hn,jc,Qs,Nr,Lh,Dc,zh,va,Zs,Js,Oc,ei,ti,Wp,Kp,Mc,Ic,Fc,Gp,qp,ri,Hc,$p,Yp,ii,Xp,ya,Uh,Lc,ni,Vh,zc,Uc,Wh,y3=V4({"node_modules/@noble/ed25519/index.js"(){Jc={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:It,n:ha,Gx:Sc,Gy:kc,a:Ws,d:Ks}=Jc,Oh=8n,Rr=32,wo=64,nr=(r="")=>{throw new Error(r)},Mh=r=>typeof r=="bigint",Cc=r=>typeof r=="string",Ih=r=>r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array",wn=(r,o)=>!Ih(r)||typeof o=="number"&&o>0&&r.length!==o?nr("Uint8Array expected"):r,pa=r=>new Uint8Array(r),Gs=r=>Uint8Array.from(r),Ec=(r,o)=>r.toString(16).padStart(o,"0"),qs=r=>Array.from(wn(r)).map(o=>Ec(o,2)).join(""),Fr={_0:48,_9:57,A:65,F:70,a:97,f:102},Tc=r=>{if(r>=Fr._0&&r<=Fr._9)return r-Fr._0;if(r>=Fr.A&&r<=Fr.F)return r-(Fr.A-10);if(r>=Fr.a&&r<=Fr.f)return r-(Fr.a-10)},$s=r=>{const o="hex invalid";if(!Cc(r))return nr(o);const a=r.length,s=a/2;if(a%2)return nr(o);const c=pa(s);for(let l=0,p=0;lwn(Cc(r)?$s(r):Gs(wn(r)),o),Pc=()=>globalThis==null?void 0:globalThis.crypto,Fh=()=>{var r;return((r=Pc())==null?void 0:r.subtle)??nr("crypto.subtle must be defined")},bo=(...r)=>{const o=pa(r.reduce((s,c)=>s+wn(c).length,0));let a=0;return r.forEach(s=>{o.set(s,a),a+=s.length}),o},Rc=(r=Rr)=>Pc().getRandomValues(pa(r)),ma=BigInt,bn=(r,o,a,s="bad number: out of range")=>Mh(r)&&o<=r&&r{const a=r%o;return a>=0n?a:o+a},Nc=r=>ge(r,ha),Ac=(r,o)=>{(r===0n||o<=0n)&&nr("no inverse n="+r+" mod="+o);let a=ge(r,o),s=o,c=0n,l=1n;for(;a!==0n;){const p=s/a,u=s%a,f=c-l*p;s=a,a=u,c=l,l=f}return s===1n?ge(c,o):nr("no inverse")},Hh=r=>{const o=ii[r];return typeof o!="function"&&nr("hashes."+r+" not set"),o},Bc=r=>r instanceof Lr?r:nr("Point expected"),Ys=2n**256n,Xs=class zn{constructor(o,a,s,c){xo(this,"ex"),xo(this,"ey"),xo(this,"ez"),xo(this,"et");const l=Ys;this.ex=bn(o,0n,l),this.ey=bn(a,0n,l),this.ez=bn(s,1n,l),this.et=bn(c,0n,l),Object.freeze(this)}static fromAffine(o){return new zn(o.x,o.y,1n,ge(o.x*o.y))}static fromBytes(o,a=!1){const s=Ks,c=Gs(wn(o,Rr)),l=o[31];c[31]=l&-129;const p=Qs(c);bn(p,0n,a?Ys:It);const f=ge(p*p),h=ge(f-1n),v=ge(s*f+1n);let{isValid:m,value:g}=zh(h,v);m||nr("bad point: y not sqrt");const S=(g&1n)===1n,_=(l&128)!==0;return!a&&g===0n&&_&&nr("bad point: x==0, isLastByteOdd"),_!==S&&(g=ge(-g)),new zn(g,p,1n,ge(g*p))}assertValidity(){const o=Ws,a=Ks,s=this;if(s.is0())throw new Error("bad point: ZERO");const{ex:c,ey:l,ez:p,et:u}=s,f=ge(c*c),h=ge(l*l),v=ge(p*p),m=ge(v*v),g=ge(f*o),S=ge(v*ge(g+h)),_=ge(m+ge(a*ge(f*h)));if(S!==_)throw new Error("bad point: equation left != right (1)");const C=ge(c*l),x=ge(p*u);if(C!==x)throw new Error("bad point: equation left != right (2)");return this}equals(o){const{ex:a,ey:s,ez:c}=this,{ex:l,ey:p,ez:u}=Bc(o),f=ge(a*u),h=ge(l*c),v=ge(s*u),m=ge(p*c);return f===h&&v===m}is0(){return this.equals(Hn)}negate(){return new zn(ge(-this.ex),this.ey,this.ez,ge(-this.et))}double(){const{ex:o,ey:a,ez:s}=this,c=Ws,l=ge(o*o),p=ge(a*a),u=ge(2n*ge(s*s)),f=ge(c*l),h=o+a,v=ge(ge(h*h)-l-p),m=f+p,g=m-u,S=f-p,_=ge(v*g),C=ge(m*S),x=ge(v*S),w=ge(g*m);return new zn(_,C,w,x)}add(o){const{ex:a,ey:s,ez:c,et:l}=this,{ex:p,ey:u,ez:f,et:h}=Bc(o),v=Ws,m=Ks,g=ge(a*p),S=ge(s*u),_=ge(l*m*h),C=ge(c*f),x=ge((a+s)*(p+u)-g-S),w=ge(C-_),k=ge(C+_),b=ge(S-v*g),R=ge(x*w),P=ge(k*b),j=ge(x*b),B=ge(w*k);return new zn(R,P,B,j)}multiply(o,a=!0){if(!a&&(o===0n||this.is0()))return Hn;if(bn(o,1n,ha),o===1n)return this;if(this.equals(Hr))return Wh(o).p;let s=Hn,c=Hr;for(let l=this;o>0n;l=l.double(),o>>=1n)o&1n?s=s.add(l):a&&(c=c.add(l));return s}toAffine(){const{ex:o,ey:a,ez:s}=this;if(this.equals(Hn))return{x:0n,y:1n};const c=Ac(s,It);return ge(s*c)!==1n&&nr("invalid inverse"),{x:ge(o*c),y:ge(a*c)}}toBytes(){const{x:o,y:a}=this.assertValidity().toAffine(),s=jc(a);return s[31]|=o&1n?128:0,s}toHex(){return qs(this.toBytes())}clearCofactor(){return this.multiply(ma(Oh),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let o=this.multiply(ha/2n,!1).double();return ha%2n&&(o=o.add(this)),o.is0()}static fromHex(o,a){return zn.fromBytes(Zr(o),a)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(){return this.toBytes()}},xo(Xs,"BASE"),xo(Xs,"ZERO"),Lr=Xs,Hr=new Lr(Sc,kc,1n,ge(Sc*kc)),Hn=new Lr(0n,1n,1n,0n),Lr.BASE=Hr,Lr.ZERO=Hn,jc=r=>$s(Ec(bn(r,0n,Ys),wo)).reverse(),Qs=r=>ma("0x"+qs(Gs(wn(r)).reverse())),Nr=(r,o)=>{let a=r;for(;o-- >0n;)a*=a,a%=It;return a},Lh=r=>{const a=r*r%It*r%It,s=Nr(a,2n)*a%It,c=Nr(s,1n)*r%It,l=Nr(c,5n)*c%It,p=Nr(l,10n)*l%It,u=Nr(p,20n)*p%It,f=Nr(u,40n)*u%It,h=Nr(f,80n)*f%It,v=Nr(h,80n)*f%It,m=Nr(v,10n)*l%It;return{pow_p_5_8:Nr(m,2n)*r%It,b2:a}},Dc=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,zh=(r,o)=>{const a=ge(o*o*o),s=ge(a*a*o),c=Lh(r*s).pow_p_5_8;let l=ge(r*a*c);const p=ge(o*l*l),u=l,f=ge(l*Dc),h=p===r,v=p===ge(-r),m=p===ge(-r*Dc);return h&&(l=u),(v||m)&&(l=f),(ge(l)&1n)===1n&&(l=ge(-l)),{isValid:h||v,value:l}},va=r=>Nc(Qs(r)),Zs=(...r)=>ii.sha512Async(...r),Js=(...r)=>Hh("sha512Sync")(...r),Oc=r=>{const o=r.slice(0,Rr);o[0]&=248,o[31]&=127,o[31]|=64;const a=r.slice(Rr,wo),s=va(o),c=Hr.multiply(s),l=c.toBytes();return{head:o,prefix:a,scalar:s,point:c,pointBytes:l}},ei=r=>Zs(Zr(r,Rr)).then(Oc),ti=r=>Oc(Js(Zr(r,Rr))),Wp=r=>ei(r).then(o=>o.pointBytes),Kp=r=>ti(r).pointBytes,Mc=r=>Zs(r.hashable).then(r.finish),Ic=r=>r.finish(Js(r.hashable)),Fc=(r,o,a)=>{const{pointBytes:s,scalar:c}=r,l=va(o),p=Hr.multiply(l).toBytes();return{hashable:bo(p,s,a),finish:h=>{const v=Nc(l+va(h)*c);return wn(bo(p,jc(v)),wo)}}},Gp=async(r,o)=>{const a=Zr(r),s=await ei(o),c=await Zs(s.prefix,a);return Mc(Fc(s,c,a))},qp=(r,o)=>{const a=Zr(r),s=ti(o),c=Js(s.prefix,a);return Ic(Fc(s,c,a))},ri={zip215:!0},Hc=(r,o,a,s=ri)=>{r=Zr(r,wo),o=Zr(o),a=Zr(a,Rr);const{zip215:c}=s;let l,p,u,f,h=Uint8Array.of();try{l=Lr.fromHex(a,c),p=Lr.fromHex(r.slice(0,Rr),c),u=Qs(r.slice(Rr,wo)),f=Hr.multiply(u,!1),h=bo(p.toBytes(),l.toBytes(),o)}catch{}return{hashable:h,finish:m=>{if(f==null||!c&&l.isSmallOrder())return!1;const g=va(m);return p.add(l.multiply(g,!1)).add(f.negate()).clearCofactor().is0()}}},$p=async(r,o,a,s=ri)=>Mc(Hc(r,o,a,s)),Yp=(r,o,a,s=ri)=>Ic(Hc(r,o,a,s)),ii={sha512Async:async(...r)=>{const o=Fh(),a=bo(...r);return pa(await o.digest("SHA-512",a.buffer))},sha512Sync:void 0,bytesToHex:qs,hexToBytes:$s,concatBytes:bo,mod:ge,invert:Ac,randomBytes:Rc},Xp={getExtendedPublicKeyAsync:ei,getExtendedPublicKey:ti,randomPrivateKey:()=>Rc(Rr),precompute:(r=8,o=Hr)=>(o.multiply(3n),o)},ya=8,Uh=256,Lc=Math.ceil(Uh/ya)+1,ni=2**(ya-1),Vh=()=>{const r=[];let o=Hr,a=o;for(let s=0;s{const a=o.negate();return r?a:o},Wh=r=>{const o=zc||(zc=Vh());let a=Hn,s=Hr;const c=2**ya,l=c,p=ma(c-1),u=ma(ya);for(let f=0;f>=u,h>ni&&(h-=l,r+=1n);const v=f*ni,m=v,g=v+Math.abs(h)-1,S=f%2!==0,_=h<0;h===0?s=s.add(Uc(S,o[m])):a=a.add(Uc(_,o[g]))}return{p:a,f:s}}}}),g3=Se({"(disabled):fs"(){}}),x3=Se({"node_modules/@michaelhart/meshcore-decoder/lib/orlp-ed25519.js"(r,o){var a=(()=>{var c;var s=typeof document<"u"?(c=document.currentScript)==null?void 0:c.src:void 0;return async function(l={}){var Pt;var p,u=l,f=typeof window=="object",h=typeof WorkerGlobalScope<"u",v=typeof process=="object"&&((Pt=process.versions)==null?void 0:Pt.node)&&process.type!="renderer";typeof __filename<"u"?s=__filename:h&&(s=self.location.href);var m="";function g(ee){return u.locateFile?u.locateFile(ee,m):m+ee}var S,_;if(v){var C=g3();m=__dirname+"/",_=ee=>{ee=b(ee)?new URL(ee):ee;var le=C.readFileSync(ee);return le},S=async(ee,le=!0)=>{ee=b(ee)?new URL(ee):ee;var ve=C.readFileSync(ee,le?void 0:"utf8");return ve},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else if(f||h){try{m=new URL(".",s).href}catch{}h&&(_=ee=>{var le=new XMLHttpRequest;return le.open("GET",ee,!1),le.responseType="arraybuffer",le.send(null),new Uint8Array(le.response)}),S=async ee=>{if(b(ee))return new Promise((ve,je)=>{var Ne=new XMLHttpRequest;Ne.open("GET",ee,!0),Ne.responseType="arraybuffer",Ne.onload=()=>{if(Ne.status==200||Ne.status==0&&Ne.response){ve(Ne.response);return}je(Ne.status)},Ne.onerror=je,Ne.send(null)});var le=await fetch(ee,{credentials:"same-origin"});if(le.ok)return le.arrayBuffer();throw new Error(le.status+" : "+le.url)}}console.log.bind(console);var x=console.error.bind(console),w,k=!1,b=ee=>ee.startsWith("file://"),R,P,j,B,D,F=!1;function O(){var ee=j.buffer;u.HEAP8=B=new Int8Array(ee),u.HEAPU8=D=new Uint8Array(ee),u.HEAP32=new Int32Array(ee),u.HEAPU32=new Uint32Array(ee),new BigInt64Array(ee),new BigUint64Array(ee)}function L(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)dt(u.preRun.shift());pe(ze)}function G(){F=!0,Ke.b()}function $(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Ae(u.postRun.shift());pe(oe)}var J=0,ae=null;function Q(ee){var le;J++,(le=u.monitorRunDependencies)==null||le.call(u,J)}function ne(ee){var ve;if(J--,(ve=u.monitorRunDependencies)==null||ve.call(u,J),J==0&&ae){var le=ae;ae=null,le()}}function U(ee){var ve;(ve=u.onAbort)==null||ve.call(u,ee),ee="Aborted("+ee+")",x(ee),k=!0,ee+=". Build with -sASSERTIONS for more info.";var le=new WebAssembly.RuntimeError(ee);throw P==null||P(le),le}var te;function X(){return g("orlp-ed25519.wasm")}function E(ee){if(ee==te&&w)return new Uint8Array(w);if(_)return _(ee);throw"both async and sync fetching of the wasm failed"}async function I(ee){if(!w)try{var le=await S(ee);return new Uint8Array(le)}catch{}return E(ee)}async function H(ee,le){try{var ve=await I(ee),je=await WebAssembly.instantiate(ve,le);return je}catch(Ne){x(`failed to asynchronously prepare wasm: ${Ne}`),U(Ne)}}async function V(ee,le,ve){if(!ee&&typeof WebAssembly.instantiateStreaming=="function"&&!b(le)&&!v)try{var je=fetch(le,{credentials:"same-origin"}),Ne=await WebAssembly.instantiateStreaming(je,ve);return Ne}catch(Oe){x(`wasm streaming compile failed: ${Oe}`),x("falling back to ArrayBuffer instantiation")}return H(le,ve)}function re(){return{a:De}}async function ce(){function ee(Oe,Fe){return Ke=Oe.exports,j=Ke.a,O(),Ce(Ke),ne(),Ke}Q();function le(Oe){return ee(Oe.instance)}var ve=re();if(u.instantiateWasm)return new Promise((Oe,Fe)=>{u.instantiateWasm(ve,(Ve,Kt)=>{Oe(ee(Ve))})});te??(te=X());var je=await V(w,te,ve),Ne=le(je);return Ne}var pe=ee=>{for(;ee.length>0;)ee.shift()(u)},oe=[],Ae=ee=>oe.push(ee),ze=[],dt=ee=>ze.push(ee),it=ee=>Z(ee),ft=()=>Te(),Ze=ee=>{var le=u["_"+ee];return le},ar=(ee,le)=>{B.set(ee,le)},Vt=ee=>{for(var le=0,ve=0;ve=55296&&je<=57343?(le+=4,++ve):le+=3}return le},Tt=(ee,le,ve,je)=>{if(!(je>0))return 0;for(var Ne=ve,Oe=ve+je-1,Fe=0;Fe=Oe)break;le[ve++]=Ve}else if(Ve<=2047){if(ve+1>=Oe)break;le[ve++]=192|Ve>>6,le[ve++]=128|Ve&63}else if(Ve<=65535){if(ve+2>=Oe)break;le[ve++]=224|Ve>>12,le[ve++]=128|Ve>>6&63,le[ve++]=128|Ve&63}else{if(ve+3>=Oe)break;le[ve++]=240|Ve>>18,le[ve++]=128|Ve>>12&63,le[ve++]=128|Ve>>6&63,le[ve++]=128|Ve&63,Fe++}}return le[ve]=0,ve-Ne},Wt=(ee,le,ve)=>Tt(ee,D,le,ve),ht=ee=>he(ee),Dt=ee=>{var le=Vt(ee)+1,ve=ht(le);return Wt(ee,ve,le),ve},nt=typeof TextDecoder<"u"?new TextDecoder:void 0,Ue=(ee,le=0,ve=NaN)=>{for(var je=le+ve,Ne=le;ee[Ne]&&!(Ne>=je);)++Ne;if(Ne-le>16&&ee.buffer&&nt)return nt.decode(ee.subarray(le,Ne));for(var Oe="";le>10,56320|Ee&1023)}}return Oe},pt=(ee,le)=>ee?Ue(D,ee,le):"",$t=(ee,le,ve,je,Ne)=>{var Oe={string:He=>{var Je=0;return He!=null&&He!==0&&(Je=Dt(He)),Je},array:He=>{var Je=ht(He.length);return ar(He,Je),Je}};function Fe(He){return le==="string"?pt(He):le==="boolean"?!!He:He}var Ve=Ze(ee),Kt=[],Ee=0;if(je)for(var qe=0;qe{var Ne=!ve||ve.every(Fe=>Fe==="number"||Fe==="boolean"),Oe=le!=="string";return Oe&&Ne&&!je?Ze(ee):(...Fe)=>$t(ee,le,ve,Fe)};u.noExitRuntime&&u.noExitRuntime,u.print&&u.print,u.printErr&&(x=u.printErr),u.wasmBinary&&(w=u.wasmBinary),u.arguments&&u.arguments,u.thisProgram&&u.thisProgram,u.ccall=$t,u.cwrap=dr;var Z,he,Te;function Ce(ee){u._orlp_derive_public_key=ee.c,u._orlp_validate_keypair=ee.d,u._orlp_sign=ee.e,u._orlp_verify=ee.f,Z=ee.g,he=ee.h,Te=ee.i}var De={},Ke=await ce();function Qe(){if(J>0){ae=Qe;return}if(L(),J>0){ae=Qe;return}function ee(){var le;u.calledRun=!0,!k&&(G(),R==null||R(u),(le=u.onRuntimeInitialized)==null||le.call(u),$())}u.setStatus?(u.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>u.setStatus(""),1),ee()},1)):ee()}function Yt(){if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.shift()()}return Yt(),Qe(),F?p=u:p=new Promise((ee,le)=>{R=ee,P=le}),p}})();typeof r=="object"&&typeof o=="object"?(o.exports=a,o.exports.default=a):typeof define=="function"&&define.amd&&define([],()=>a)}}),gu=Se({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/orlp-ed25519-wasm.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.derivePublicKey=c,r.validateKeyPair=l,r.sign=p,r.verify=u;var o=Ft(),a=x3();async function s(){return await a()}async function c(f){const h=await s(),v=(0,o.hexToBytes)(f);if(v.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${v.length}`);const m=1024,g=1088;if(h.HEAPU8.set(v,m),h.ccall("orlp_derive_public_key","number",["number","number"],[g,m])!==0)throw new Error("orlp key derivation failed: invalid private key");const _=new Uint8Array(32);return _.set(h.HEAPU8.subarray(g,g+32)),(0,o.bytesToHex)(_)}async function l(f,h){try{const v=await s(),m=(0,o.hexToBytes)(f),g=(0,o.hexToBytes)(h);if(m.length!==64||g.length!==32)return!1;const S=2048,_=2112;return v.HEAPU8.set(m,S),v.HEAPU8.set(g,_),v.ccall("orlp_validate_keypair","number",["number","number"],[_,S])===1}catch{return!1}}async function p(f,h,v){const m=await s(),g=(0,o.hexToBytes)(f),S=(0,o.hexToBytes)(h),_=(0,o.hexToBytes)(v);if(S.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${S.length}`);if(_.length!==32)throw new Error(`Invalid public key length: expected 32 bytes, got ${_.length}`);const C=1e5,x=2e5,w=3e5,k=4e5;m.HEAPU8.set(g,C),m.HEAPU8.set(S,x),m.HEAPU8.set(_,w),m.ccall("orlp_sign","void",["number","number","number","number","number"],[k,C,g.length,w,x]);const b=new Uint8Array(64);return b.set(m.HEAPU8.subarray(k,k+64)),(0,o.bytesToHex)(b)}async function u(f,h,v){try{const m=await s(),g=(0,o.hexToBytes)(f),S=(0,o.hexToBytes)(h),_=(0,o.hexToBytes)(v);if(g.length!==64||_.length!==32)return!1;const C=5e5,x=6e5,w=7e5;return m.HEAPU8.set(g,x),m.HEAPU8.set(S,C),m.HEAPU8.set(_,w),m.ccall("orlp_verify","number",["number","number","number","number"],[x,C,S.length,w])===1}catch{return!1}}}}),Qp=Se({"node_modules/@michaelhart/meshcore-decoder/dist/crypto/ed25519-verifier.js"(r){var o=r&&r.__createBinding||(Object.create?function(v,m,g,S){S===void 0&&(S=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(v,S,_)}:function(v,m,g,S){S===void 0&&(S=g),v[S]=m[g]}),a=r&&r.__setModuleDefault||(Object.create?function(v,m){Object.defineProperty(v,"default",{enumerable:!0,value:m})}:function(v,m){v.default=m}),s=r&&r.__importStar||(function(){var v=function(m){return v=Object.getOwnPropertyNames||function(g){var S=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(S[S.length]=_);return S},v(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var S=v(m),_=0;_>>24&255,_[C*4+1]=x>>>16&255,_[C*4+2]=x>>>8&255,_[C*4+3]=x&255}return _}catch{throw new Error("No SHA-512 implementation available for synchronous operation")}}c.etc.sha512Async=u;try{c.etc.sha512Sync=f}catch(v){console.debug("Could not set up synchronous SHA-512:",v)}var h=class{static async verifyAdvertisementSignature(v,m,g,S){try{const _=(0,l.hexToBytes)(v),C=(0,l.hexToBytes)(m),x=(0,l.hexToBytes)(S),w=this.constructAdvertSignedMessage(v,g,x);return await c.verify(C,w,_)}catch(_){return console.error("Ed25519 signature verification failed:",_),!1}}static constructAdvertSignedMessage(v,m,g){const S=(0,l.hexToBytes)(v),_=new Uint8Array(4);_[0]=m&255,_[1]=m>>8&255,_[2]=m>>16&255,_[3]=m>>24&255;const C=new Uint8Array(36+g.length);return C.set(S,0),C.set(_,32),C.set(g,36),C}static getSignedMessageDescription(v,m,g){return`Public Key: ${v} + Timestamp: ${m} (${new Date(m*1e3).toISOString()}) + App Data: ${g}`}static getSignedMessageHex(v,m,g){const S=(0,l.hexToBytes)(g),_=this.constructAdvertSignedMessage(v,m,S);return(0,l.bytesToHex)(_)}static async derivePublicKey(v){try{const m=(0,l.hexToBytes)(v);if(m.length!==64)throw new Error(`Invalid private key length: expected 64 bytes, got ${m.length}`);return await(0,p.derivePublicKey)(v)}catch(m){throw new Error(`Failed to derive public key: ${m instanceof Error?m.message:"Unknown error"}`)}}static derivePublicKeySync(v){try{const m=(0,l.hexToBytes)(v);throw m.length!==64?new Error(`Invalid private key length: expected 64 bytes, got ${m.length}`):new Error("Synchronous key derivation not supported with WASM. Use derivePublicKey() instead.")}catch(m){throw new Error(`Failed to derive public key: ${m instanceof Error?m.message:"Unknown error"}`)}}static async validateKeyPair(v,m){try{return await(0,p.validateKeyPair)(v,m)}catch{return!1}}};r.Ed25519SignatureVerifier=h}}),w3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/advert.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AdvertPayloadDecoder=void 0;var o=ur(),a=Ft(),s=ka(),c=Qp(),l=class{static decode(p,u){try{if(p.length<101){const w={type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!1,errors:["Advertisement payload too short"],publicKey:"",timestamp:0,signature:"",appData:{flags:0,deviceRole:o.DeviceRole.ChatNode,hasLocation:!1,hasName:!1}};return u!=null&&u.includeSegments&&(w.segments=[{name:"Invalid Advert Data",description:"Advert payload too short (minimum 101 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+p.length-1,value:(0,a.bytesToHex)(p)}]),w}const f=[],h=(u==null?void 0:u.segmentOffset)||0;let v=0;const m=(0,a.bytesToHex)(p.subarray(v,v+32));u!=null&&u.includeSegments&&f.push({name:"Public Key",description:"Ed25519 public key",startByte:h+v,endByte:h+v+31,value:m}),v+=32;const g=this.readUint32LE(p,v);if(u!=null&&u.includeSegments){const w=new Date(g*1e3);f.push({name:"Timestamp",description:`${g} (${w.toISOString().slice(0,19)}Z)`,startByte:h+v,endByte:h+v+3,value:(0,a.bytesToHex)(p.subarray(v,v+4))})}v+=4;const S=(0,a.bytesToHex)(p.subarray(v,v+64));u!=null&&u.includeSegments&&f.push({name:"Signature",description:"Ed25519 signature",startByte:h+v,endByte:h+v+63,value:S}),v+=64;const _=p[v];if(u!=null&&u.includeSegments){const w=_.toString(2).padStart(8,"0"),k=this.parseDeviceRole(_),R=` | Bits 0-3 (Role): ${(0,s.getDeviceRoleName)(k)} | Bit 4 (Location): ${_&o.AdvertFlags.HasLocation?"Yes":"No"} | Bit 7 (Name): ${_&o.AdvertFlags.HasName?"Yes":"No"}`;f.push({name:"App Flags",description:`Binary: ${w}${R}`,startByte:h+v,endByte:h+v,value:_.toString(16).padStart(2,"0").toUpperCase()})}v+=1;const C={type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!0,publicKey:m,timestamp:g,signature:S,appData:{flags:_,deviceRole:this.parseDeviceRole(_),hasLocation:!!(_&o.AdvertFlags.HasLocation),hasName:!!(_&o.AdvertFlags.HasName)}};let x=v;if(_&o.AdvertFlags.HasLocation&&p.length>=x+8){const w=this.readInt32LE(p,x)/1e6,k=this.readInt32LE(p,x+4)/1e6;C.appData.location={latitude:Math.round(w*1e6)/1e6,longitude:Math.round(k*1e6)/1e6},u!=null&&u.includeSegments&&(f.push({name:"Latitude",description:`${w}° (${w})`,startByte:h+x,endByte:h+x+3,value:(0,a.bytesToHex)(p.subarray(x,x+4))}),f.push({name:"Longitude",description:`${k}° (${k})`,startByte:h+x+4,endByte:h+x+7,value:(0,a.bytesToHex)(p.subarray(x+4,x+8))})),x+=8}if(_&o.AdvertFlags.HasFeature1&&(x+=2),_&o.AdvertFlags.HasFeature2&&(x+=2),_&o.AdvertFlags.HasName&&p.length>x){const w=p.subarray(x),k=new TextDecoder("utf-8").decode(w).replace(/\0.*$/,"");C.appData.name=this.sanitizeControlCharacters(k)||k,u!=null&&u.includeSegments&&f.push({name:"Node Name",description:`Node name: "${C.appData.name}"`,startByte:h+x,endByte:h+p.length-1,value:(0,a.bytesToHex)(w)})}return u!=null&&u.includeSegments&&(C.segments=f),C}catch(f){return{type:o.PayloadType.Advert,version:o.PayloadVersion.Version1,isValid:!1,errors:[f instanceof Error?f.message:"Failed to decode advertisement payload"],publicKey:"",timestamp:0,signature:"",appData:{flags:0,deviceRole:o.DeviceRole.ChatNode,hasLocation:!1,hasName:!1}}}}static async decodeWithVerification(p,u){const f=this.decode(p,u);if(!f||!f.isValid)return f;try{const v=p.subarray(100),m=(0,a.bytesToHex)(v),g=await c.Ed25519SignatureVerifier.verifyAdvertisementSignature(f.publicKey,f.signature,f.timestamp,m);f.signatureValid=g,g||(f.signatureError="Ed25519 signature verification failed",f.isValid=!1,f.errors||(f.errors=[]),f.errors.push("Invalid Ed25519 signature"))}catch(h){f.signatureValid=!1,f.signatureError=h instanceof Error?h.message:"Signature verification error",f.isValid=!1,f.errors||(f.errors=[]),f.errors.push("Signature verification failed: "+(h instanceof Error?h.message:"Unknown error"))}return f}static parseDeviceRole(p){switch(p&15){case 1:return o.DeviceRole.ChatNode;case 2:return o.DeviceRole.Repeater;case 3:return o.DeviceRole.RoomServer;case 4:return o.DeviceRole.Sensor;default:return o.DeviceRole.ChatNode}}static readUint32LE(p,u){return p[u]|p[u+1]<<8|p[u+2]<<16|p[u+3]<<24}static readInt32LE(p,u){const f=this.readUint32LE(p,u);return f>2147483647?f-4294967296:f}static sanitizeControlCharacters(p){return p&&p.trim().replace(/[\x00-\x1F\x7F]/g,"")||null}};r.AdvertPayloadDecoder=l}}),b3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/trace.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TracePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l,p){try{if(c.length<9){const k={type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!1,errors:["Trace payload too short (need at least tag(4) + auth(4) + flags(1))"],traceTag:"00000000",authCode:0,flags:0,pathHashes:[]};return p!=null&&p.includeSegments&&(k.segments=[{name:"Invalid Trace Data",description:"Trace payload too short (minimum 9 bytes required)",startByte:p.segmentOffset||0,endByte:(p.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),k}let u=0;const f=[],h=(p==null?void 0:p.segmentOffset)||0,v=this.readUint32LE(c,u),m=(0,a.numberToHex)(v,8);p!=null&&p.includeSegments&&f.push({name:"Trace Tag",description:`Unique identifier for this trace: 0x${v.toString(16).padStart(8,"0")}`,startByte:h+u,endByte:h+u+3,value:(0,a.bytesToHex)(c.slice(u,u+4))}),u+=4;const g=this.readUint32LE(c,u);p!=null&&p.includeSegments&&f.push({name:"Auth Code",description:`Authentication/verification code: ${g}`,startByte:h+u,endByte:h+u+3,value:(0,a.bytesToHex)(c.slice(u,u+4))}),u+=4;const S=c[u];p!=null&&p.includeSegments&&f.push({name:"Flags",description:`Application-defined control flags: 0x${S.toString(16).padStart(2,"0")} (${S.toString(2).padStart(8,"0")}b)`,startByte:h+u,endByte:h+u,value:S.toString(16).padStart(2,"0").toUpperCase()}),u+=1;const _=[],C=u;for(;u0){const k=_.join(" ");f.push({name:"Path Hashes",description:`Node hashes in trace path: ${k}`,startByte:h+C,endByte:h+c.length-1,value:(0,a.bytesToHex)(c.slice(C))})}let x;l&&l.length>0&&(x=l.map(k=>{const b=parseInt(k,16);return(b>127?b-256:b)/4}));const w={type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!0,traceTag:m,authCode:g,flags:S,pathHashes:_,snrValues:x};return p!=null&&p.includeSegments&&(w.segments=f),w}catch(u){return{type:o.PayloadType.Trace,version:o.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode trace payload"],traceTag:"00000000",authCode:0,flags:0,pathHashes:[]}}}static readUint32LE(c,l){return c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24}};r.TracePayloadDecoder=s}}),_3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/group-text.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.GroupTextPayloadDecoder=void 0;var o=ur(),a=yu(),s=Ft(),c=class{static decode(l,p){try{if(l.length<3){const _={type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!1,errors:["GroupText payload too short (need at least channel_hash(1) + MAC(2))"],channelHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return p!=null&&p.includeSegments&&(_.segments=[{name:"Invalid GroupText Data",description:"GroupText payload too short (minimum 3 bytes required)",startByte:p.segmentOffset||0,endByte:(p.segmentOffset||0)+l.length-1,value:(0,s.bytesToHex)(l)}]),_}const u=[],f=(p==null?void 0:p.segmentOffset)||0;let h=0;const v=(0,s.byteToHex)(l[h]);p!=null&&p.includeSegments&&u.push({name:"Channel Hash",description:"First byte of SHA256 of channel's shared key",startByte:f+h,endByte:f+h,value:v}),h+=1;const m=(0,s.bytesToHex)(l.subarray(h,h+2));p!=null&&p.includeSegments&&u.push({name:"Cipher MAC",description:"MAC for encrypted data",startByte:f+h,endByte:f+h+1,value:m}),h+=2;const g=(0,s.bytesToHex)(l.subarray(h));p!=null&&p.includeSegments&&l.length>h&&u.push({name:"Ciphertext",description:"Encrypted message content (timestamp + flags + message)",startByte:f+h,endByte:f+l.length-1,value:g});const S={type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!0,channelHash:v,cipherMac:m,ciphertext:g,ciphertextLength:l.length-3};if(p!=null&&p.keyStore&&p.keyStore.hasChannelKey(v)){const _=p.keyStore.getChannelKeys(v);for(const C of _){const x=a.ChannelCrypto.decryptGroupTextMessage(g,m,C);if(x.success&&x.data){S.decrypted={timestamp:x.data.timestamp,flags:x.data.flags,sender:x.data.sender,message:x.data.message};break}}}return p!=null&&p.includeSegments&&(S.segments=u),S}catch(u){return{type:o.PayloadType.GroupText,version:o.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode GroupText payload"],channelHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.GroupTextPayloadDecoder=c}}),S3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.RequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const _={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:["Request payload too short (minimum 4 bytes: dest hash + source hash + MAC)"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid Request Data",description:"Request payload too short (minimum 4 bytes required: 1 for dest hash + 1 for source hash + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.bytesToHex)(c.subarray(f,f+1));l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.bytesToHex)(c.subarray(f,f+1));l!=null&&l.includeSegments&&p.push({name:"Source Hash",description:`First byte of source node public key: 0x${v}`,startByte:u+f,endByte:u+f,value:v}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&p.push({name:"Ciphertext",description:`Encrypted message data (${c.length-f} bytes). Contains encrypted plaintext with this structure: -• Timestamp (4 bytes) - send time as unix timestamp -• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.) -• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),k3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const _={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:v}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),C3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<35){const _={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:v}),f+=32;const m=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&p.push({name:"Ciphertext",description:`Encrypted message data (${c.length-35} bytes). Contains encrypted plaintext with this structure: -• Timestamp (4 bytes) - send time as unix timestamp -• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp -• Password (remaining bytes) - password for repeater/room`,startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),E3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const v={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(v.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),v}const p=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=p),h}catch(p){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),T3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const p=[];for(let h=0;h1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:p,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),P3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const _={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(_.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),_}const p=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const v=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:v}),f+=1;const m=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:m}),f+=2;const g=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:g});const S={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:v,cipherMac:m,ciphertext:g,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(S.segments=p),S}catch(p){return{type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode TextMessage payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.TextMessagePayloadDecoder=s}}),R3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/control.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ControlPayloadDecoder=void 0;var o=ur(),a=Ft(),s=ka(),c=class{static decode(l,p){try{if(l.length<1)return this.createErrorPayload("Control payload too short (minimum 1 byte required)",l,p);const f=l[0]&240;switch(f){case o.ControlSubType.NodeDiscoverReq:return this.decodeDiscoverReq(l,p);case o.ControlSubType.NodeDiscoverResp:return this.decodeDiscoverResp(l,p);default:return this.createErrorPayload(`Unknown control sub-type: 0x${f.toString(16).padStart(2,"0")}`,l,p)}}catch(u){return this.createErrorPayload(u instanceof Error?u.message:"Failed to decode control payload",l,p)}}static decodeDiscoverReq(l,p){const u=[],f=(p==null?void 0:p.segmentOffset)??0;if(l.length<6){const w={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!1,errors:["DISCOVER_REQ payload too short (minimum 6 bytes required)"],subType:o.ControlSubType.NodeDiscoverReq,rawFlags:l[0],prefixOnly:!1,typeFilter:0,typeFilterNames:[],tag:0,since:0};return p!=null&&p.includeSegments&&(w.segments=[{name:"Invalid DISCOVER_REQ Data",description:"DISCOVER_REQ payload too short (minimum 6 bytes required)",startByte:f,endByte:f+l.length-1,value:(0,a.bytesToHex)(l)}]),w}let h=0;const v=l[h],m=(v&1)!==0;p!=null&&p.includeSegments&&u.push({name:"Flags",description:`Sub-type: DISCOVER_REQ (0x8) | Prefix Only: ${m}`,startByte:f+h,endByte:f+h,value:v.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const g=l[h],S=this.parseTypeFilter(g);p!=null&&p.includeSegments&&u.push({name:"Type Filter",description:`Filter mask: 0b${g.toString(2).padStart(8,"0")} | Types: ${S.length>0?S.join(", "):"None"}`,startByte:f+h,endByte:f+h,value:g.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const _=this.readUint32LE(l,h);p!=null&&p.includeSegments&&u.push({name:"Tag",description:`Random tag for response matching: 0x${_.toString(16).padStart(8,"0")}`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))}),h+=4;let C=0;if(l.length>=h+4&&(C=this.readUint32LE(l,h),p!=null&&p.includeSegments)){const w=C>0?new Date(C*1e3).toISOString().slice(0,19)+"Z":"N/A";u.push({name:"Since",description:`Filter timestamp: ${C} (${w})`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))})}const x={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!0,subType:o.ControlSubType.NodeDiscoverReq,rawFlags:v,prefixOnly:m,typeFilter:g,typeFilterNames:S,tag:_,since:C};return p!=null&&p.includeSegments&&(x.segments=u),x}static decodeDiscoverResp(l,p){const u=[],f=(p==null?void 0:p.segmentOffset)??0;if(l.length<14){const j={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!1,errors:["DISCOVER_RESP payload too short (minimum 14 bytes required)"],subType:o.ControlSubType.NodeDiscoverResp,rawFlags:l.length>0?l[0]:0,nodeType:o.DeviceRole.Unknown,nodeTypeName:"Unknown",snr:0,tag:0,publicKey:"",publicKeyLength:0};return p!=null&&p.includeSegments&&(j.segments=[{name:"Invalid DISCOVER_RESP Data",description:"DISCOVER_RESP payload too short (minimum 14 bytes required)",startByte:f,endByte:f+l.length-1,value:(0,a.bytesToHex)(l)}]),j}let h=0;const v=l[h],m=v&15,g=(0,s.getDeviceRoleName)(m);p!=null&&p.includeSegments&&u.push({name:"Flags",description:`Sub-type: DISCOVER_RESP (0x9) | Node Type: ${g}`,startByte:f+h,endByte:f+h,value:v.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const S=l[h],_=S>127?S-256:S,C=_/4;p!=null&&p.includeSegments&&u.push({name:"SNR",description:`Inbound SNR: ${C.toFixed(2)} dB (raw: ${S}, signed: ${_})`,startByte:f+h,endByte:f+h,value:S.toString(16).padStart(2,"0").toUpperCase()}),h+=1;const x=this.readUint32LE(l,h);p!=null&&p.includeSegments&&u.push({name:"Tag",description:`Reflected tag from request: 0x${x.toString(16).padStart(8,"0")}`,startByte:f+h,endByte:f+h+3,value:(0,a.bytesToHex)(l.slice(h,h+4))}),h+=4;const k=l.length-h,b=l.slice(h,h+k),R=(0,a.bytesToHex)(b);if(p!=null&&p.includeSegments){const j=k===32?"Full Public Key":"Public Key Prefix";u.push({name:j,description:`${j} (${k} bytes)`,startByte:f+h,endByte:f+h+k-1,value:R})}const P={type:o.PayloadType.Control,version:o.PayloadVersion.Version1,isValid:!0,subType:o.ControlSubType.NodeDiscoverResp,rawFlags:v,nodeType:m,nodeTypeName:g,snr:C,tag:x,publicKey:R,publicKeyLength:k};return p!=null&&p.includeSegments&&(P.segments=u),P}static parseTypeFilter(l){const p=[];return l&1<0?p[0]:0,prefixOnly:!1,typeFilter:0,typeFilterNames:[],tag:0,since:0};return u!=null&&u.includeSegments&&(f.segments=[{name:"Invalid Control Data",description:l,startByte:u.segmentOffset??0,endByte:(u.segmentOffset??0)+p.length-1,value:(0,a.bytesToHex)(p)}]),f}static readUint32LE(l,p){return(l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24)>>>0}};r.ControlPayloadDecoder=c}}),Kh=Se({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/packet-decoder.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.MeshCorePacketDecoder=void 0;var o=ur(),a=Ft(),s=ka(),c=Up(),l=w3(),p=b3(),u=_3(),f=S3(),h=k3(),v=C3(),m=E3(),g=T3(),S=P3(),_=R3(),C=class{static decode(x,w){return this.parseInternal(x,!1,w).packet}static async decodeWithVerification(x,w){return(await this.parseInternalAsync(x,!1,w)).packet}static analyzeStructure(x,w){return this.parseInternal(x,!0,w).structure}static async analyzeStructureWithVerification(x,w){return(await this.parseInternalAsync(x,!0,w)).structure}static parseInternal(x,w,k){const b=(0,a.hexToBytes)(x),R=[];if(b.length<2){const P={messageHash:"",routeType:o.RouteType.Flood,payloadType:o.PayloadType.RawCustom,payloadVersion:o.PayloadVersion.Version1,pathLength:0,path:null,payload:{raw:"",decoded:null},totalBytes:b.length,isValid:!1,errors:["Packet too short (minimum 2 bytes required)"]},j={segments:[],totalBytes:b.length,rawHex:x.toUpperCase(),messageHash:"",payload:{segments:[],hex:"",startByte:0,type:"Unknown"}};return{packet:P,structure:j}}try{let P=0;const j=b[0],B=j&3,D=j>>2&15,F=j>>6&3;w&&R.push({name:"Header",description:"Header byte breakdown",startByte:0,endByte:0,value:`0x${j.toString(16).padStart(2,"0")}`,headerBreakdown:{fullBinary:j.toString(2).padStart(8,"0"),fields:[{bits:"0-1",field:"Route Type",value:(0,s.getRouteTypeName)(B),binary:(j&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:(0,s.getPayloadTypeName)(D),binary:(j>>2&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:F.toString(),binary:(j>>6&3).toString(2).padStart(2,"0")}]}}),P=1;let O;if(B===o.RouteType.TransportFlood||B===o.RouteType.TransportDirect){if(b.length0?Array.from(G).map(a.byteToHex):null;if(w&&L>0)if(D===o.PayloadType.Trace){const E=[];for(let I=0;I127?H-256:H)/4;E.push(`${re.toFixed(2)}dB (0x${H.toString(16).padStart(2,"0")})`)}R.push({name:"Path SNR Data",description:`SNR values collected during trace: ${E.join(", ")}`,startByte:P,endByte:P+L-1,value:(0,a.bytesToHex)(b.slice(P,P+L))})}else{let E="Routing path information";B===o.RouteType.Direct||B===o.RouteType.TransportDirect?E="Routing instructions (bytes are stripped at each hop as packet travels to destination)":(B===o.RouteType.Flood||B===o.RouteType.TransportFlood)&&(E="Historical route taken (bytes are added as packet floods through network)"),R.push({name:"Path Data",description:E,startByte:P,endByte:P+L-1,value:(0,a.bytesToHex)(b.slice(P,P+L))})}P+=L;const J=b.subarray(P),ae=(0,a.bytesToHex)(J);w&&b.length>P&&R.push({name:"Payload",description:`${(0,s.getPayloadTypeName)(D)} payload data`,startByte:P,endByte:b.length-1,value:(0,a.bytesToHex)(b.slice(P))});let Q=null;const ne=[];if(D===o.PayloadType.Advert){const E=l.AdvertPayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Trace){const E=p.TracePayloadDecoder.decode(J,$,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.GroupText){const E=u.GroupTextPayloadDecoder.decode(J,{...k,includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Request){const E=f.RequestPayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Response){const E=h.ResponsePayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.AnonRequest){const E=v.AnonRequestPayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Ack){const E=m.AckPayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Path)Q=g.PathPayloadDecoder.decode(J);else if(D===o.PayloadType.TextMessage){const E=S.TextMessagePayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}else if(D===o.PayloadType.Control){const E=_.ControlPayloadDecoder.decode(J,{includeSegments:w,segmentOffset:0});Q=E,E!=null&&E.segments&&(ne.push(...E.segments),delete E.segments)}w&&ne.length===0&&b.length>P&&ne.push({name:`${(0,s.getPayloadTypeName)(D)} Payload`,description:`Raw ${(0,s.getPayloadTypeName)(D)} payload data (${J.length} bytes)`,startByte:0,endByte:J.length-1,value:(0,a.bytesToHex)(J)});const U=this.calculateMessageHash(b,B,D,F),te={messageHash:U,routeType:B,payloadType:D,payloadVersion:F,transportCodes:O,pathLength:L,path:$,payload:{raw:ae,decoded:Q},totalBytes:b.length,isValid:!0},X={segments:R,totalBytes:b.length,rawHex:x.toUpperCase(),messageHash:U,payload:{segments:ne,hex:ae,startByte:P,type:(0,s.getPayloadTypeName)(D)}};return{packet:te,structure:X}}catch(P){const j={messageHash:"",routeType:o.RouteType.Flood,payloadType:o.PayloadType.RawCustom,payloadVersion:o.PayloadVersion.Version1,pathLength:0,path:null,payload:{raw:"",decoded:null},totalBytes:b.length,isValid:!1,errors:[P instanceof Error?P.message:"Unknown decoding error"]},B={segments:[],totalBytes:b.length,rawHex:x.toUpperCase(),messageHash:"",payload:{segments:[],hex:"",startByte:0,type:"Unknown"}};return{packet:j,structure:B}}}static async parseInternalAsync(x,w,k){const b=this.parseInternal(x,w,k);if(b.packet.payloadType===o.PayloadType.Advert&&b.packet.payload.decoded)try{const R=b.packet.payload.decoded,P=await l.AdvertPayloadDecoder.decodeWithVerification((0,a.hexToBytes)(b.packet.payload.raw),{includeSegments:w,segmentOffset:0});P&&(b.packet.payload.decoded=P,P.isValid||(b.packet.isValid=!1,b.packet.errors=P.errors||["Invalid advertisement signature"]),w&&P.segments&&(b.structure.payload.segments=P.segments,delete P.segments))}catch(R){console.error("Signature verification failed:",R)}return b}static validate(x){const w=(0,a.hexToBytes)(x),k=[];if(w.length<2)return k.push("Packet too short (minimum 2 bytes required)"),{isValid:!1,errors:k};try{let b=1;const P=w[0]&3;if((P===o.RouteType.TransportFlood||P===o.RouteType.TransportDirect)&&(w.length=w.length&&k.push("No payload data found")}catch(b){k.push(b instanceof Error?b.message:"Validation error")}return{isValid:k.length===0,errors:k.length>0?k:void 0}}static calculateMessageHash(x,w,k,b){if(k===o.PayloadType.Trace&&x.length>=13){let F=1;if((w===o.RouteType.TransportFlood||w===o.RouteType.TransportDirect)&&(F+=4),x.length>F){const O=x[F];F+=1+O}if(x.length>=F+4){const O=x[F]|x[F+1]<<8|x[F+2]<<16|x[F+3]<<24;return(0,a.numberToHex)(O,8)}}const R=k<<2|b<<6;let P=1;if((w===o.RouteType.TransportFlood||w===o.RouteType.TransportDirect)&&(P+=4),x.length>P){const F=x[P];P+=1+F}const j=x.slice(P),B=[R,...Array.from(j)];let D=0;for(let F=0;FR.exp)return null;const P=`${g}.${S}`,j=new TextEncoder().encode(P),B=(0,a.bytesToHex)(j);return await(0,o.verify)(_,B,R.publicKey)?R:null}catch{return null}}function u(h){try{const v=h.split(".");return v.length!==3?null:{header:v[0],payload:v[1],signature:v[2]}}catch{return null}}function f(h){try{const v=h.split(".");if(v.length!==3)return null;const m=c(v[1]),g=new TextDecoder().decode(m);return JSON.parse(g)}catch{return null}}}}),N3=Se({"node_modules/@michaelhart/meshcore-decoder/dist/index.js"(r){var o=r&&r.__createBinding||(Object.create?function(w,k,b,R){R===void 0&&(R=b);var P=Object.getOwnPropertyDescriptor(k,b);(!P||("get"in P?!k.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return k[b]}}),Object.defineProperty(w,R,P)}:function(w,k,b,R){R===void 0&&(R=b),w[R]=k[b]}),a=r&&r.__setModuleDefault||(Object.create?function(w,k){Object.defineProperty(w,"default",{enumerable:!0,value:k})}:function(w,k){w.default=k}),s=r&&r.__importStar||(function(){var w=function(k){return w=Object.getOwnPropertyNames||function(b){var R=[];for(var P in b)Object.prototype.hasOwnProperty.call(b,P)&&(R[R.length]=P);return R},w(k)};return function(k){if(k&&k.__esModule)return k;var b={};if(k!=null)for(var R=w(k),P=0;P2?o+a:1;return Ln*s*Ln}function M3(r,o){const s=Math.floor(Date.now()/1e3);return r<=s&&r>=s-2592e3}function I3(r){return!r.includes("�")}var t1=class r1{constructor(){this.device=null,this.pipeline=null,this.bindGroupLayout=null,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.shaderCode=` -// SHA256 round constants -const K: array = array( - 0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u, - 0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u, - 0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau, - 0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u, - 0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u, - 0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u, - 0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u, - 0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u -); - -// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36) -const CHARS: array = array( - 0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j - 0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t - 0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z - 0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9 - 0x2du // dash -); - -struct Params { - target_channel_hash: u32, - batch_offset: u32, - name_length: u32, - batch_size: u32, - target_mac: u32, // First 2 bytes of target MAC (in high 16 bits) - ciphertext_words: u32, // Number of 32-bit words in ciphertext - ciphertext_len_bits: u32, // Length of ciphertext in bits - verify_mac: u32, // 1 to verify MAC, 0 to skip -} - -@group(0) @binding(0) var params: Params; -@group(0) @binding(1) var match_count: atomic; -@group(0) @binding(2) var match_indices: array; -@group(0) @binding(3) var ciphertext: array; // Ciphertext data - -fn rotr(x: u32, n: u32) -> u32 { - return (x >> n) | (x << (32u - n)); -} - -fn ch(x: u32, y: u32, z: u32) -> u32 { - return (x & y) ^ (~x & z); -} - -fn maj(x: u32, y: u32, z: u32) -> u32 { - return (x & y) ^ (x & z) ^ (y & z); -} - -fn sigma0(x: u32) -> u32 { - return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u); -} - -fn sigma1(x: u32) -> u32 { - return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u); -} - -fn gamma0(x: u32) -> u32 { - return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u); -} - -fn gamma1(x: u32) -> u32 { - return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u); -} - -// Convert index to room name bytes, returns the hash as a u32 for the first byte check -fn index_to_room_name(idx: u32, length: u32, msg: ptr>) -> bool { - // Message starts with '#' (0x23) - var byte_pos = 0u; - var word_idx = 0u; - var current_word = 0x23000000u; // '#' in big-endian position 0 - byte_pos = 1u; - - var remaining = idx; - var prev_was_dash = false; - - // Generate room name from index - for (var i = 0u; i < length; i++) { - let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end - var char_idx = remaining % char_count; - remaining = remaining / char_count; - - // Check for consecutive dashes (invalid) - let is_dash = char_idx == 36u && i > 0u && i < length - 1u; - if (is_dash && prev_was_dash) { - return false; // Invalid: consecutive dashes - } - prev_was_dash = is_dash; - - // Map char index to actual character - let c = CHARS[char_idx]; - - // Pack byte into current word (big-endian) - let shift = (3u - byte_pos % 4u) * 8u; - if (byte_pos % 4u == 0u && byte_pos > 0u) { - (*msg)[word_idx] = current_word; - word_idx = word_idx + 1u; - current_word = 0u; - } - current_word = current_word | (c << shift); - byte_pos = byte_pos + 1u; - } - - // Add padding: 0x80 followed by zeros, then length in bits - let msg_len_bits = (length + 1u) * 8u; // +1 for '#' - - // Add 0x80 padding byte - let shift = (3u - byte_pos % 4u) * 8u; - if (byte_pos % 4u == 0u) { - (*msg)[word_idx] = current_word; - word_idx = word_idx + 1u; - current_word = 0x80000000u; - } else { - current_word = current_word | (0x80u << shift); - } - byte_pos = byte_pos + 1u; - - // Store current word - if (byte_pos % 4u == 0u || word_idx < 14u) { - (*msg)[word_idx] = current_word; - word_idx = word_idx + 1u; - } - - // Zero-fill until word 14 - for (var i = word_idx; i < 14u; i++) { - (*msg)[i] = 0u; - } - - // Length in bits (64-bit, but we only use lower 32 bits for short messages) - (*msg)[14u] = 0u; - (*msg)[15u] = msg_len_bits; - - return true; -} - -fn sha256_block(msg: ptr>) -> array { - // Initialize hash values - var h: array = array( - 0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au, - 0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u - ); - - // Message schedule - var w: array; - for (var i = 0u; i < 16u; i++) { - w[i] = (*msg)[i]; - } - for (var i = 16u; i < 64u; i++) { - w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u]; - } - - // Compression - var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3]; - var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7]; - - for (var i = 0u; i < 64u; i++) { - let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i]; - let t2 = sigma0(a) + maj(a, b, c); - hh = g; g = f; f = e; e = d + t1; - d = c; c = b; b = a; a = t1 + t2; - } - - h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d; - h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh; - - return h; -} - -// Compute SHA256 of the key (16 bytes) to get channel hash -fn sha256_key(key: array) -> u32 { - var msg: array; - - // Key bytes (16 bytes = 4 words) - msg[0] = key[0]; - msg[1] = key[1]; - msg[2] = key[2]; - msg[3] = key[3]; - - // Padding: 0x80 followed by zeros - msg[4] = 0x80000000u; - for (var i = 5u; i < 14u; i++) { - msg[i] = 0u; - } - - // Length: 128 bits - msg[14] = 0u; - msg[15] = 128u; - - let hash = sha256_block(&msg); - - // Return first byte of hash (big-endian) - return hash[0] >> 24u; -} - -// HMAC-SHA256 for MAC verification -// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore -// Returns first 2 bytes of HMAC (as u32 in high 16 bits) -fn hmac_sha256_mac(key: array, ciphertext_len: u32) -> u32 { - // HMAC: H((K' ^ opad) || H((K' ^ ipad) || message)) - // K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64) - // ipad = 0x36 repeated, opad = 0x5c repeated - - // Build padded key (64 bytes = 16 words) - // MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes - var k_pad: array; - k_pad[0] = key[0]; - k_pad[1] = key[1]; - k_pad[2] = key[2]; - k_pad[3] = key[3]; - for (var i = 4u; i < 16u; i++) { - k_pad[i] = 0u; - } - - // Inner hash: SHA256((K' ^ ipad) || message) - // First block: K' ^ ipad (64 bytes) - var inner_block: array; - for (var i = 0u; i < 16u; i++) { - inner_block[i] = k_pad[i] ^ 0x36363636u; - } - - // Initialize hash state with first block - var h: array = sha256_block(&inner_block); - - // Process ciphertext blocks (continuing from h state) - let ciphertext_words = params.ciphertext_words; - var word_idx = 0u; - - // Process full 64-byte blocks of ciphertext - while (word_idx + 16u <= ciphertext_words) { - var block: array; - for (var i = 0u; i < 16u; i++) { - block[i] = ciphertext[word_idx + i]; - } - h = sha256_block_continue(&block, h); - word_idx = word_idx + 16u; - } - - // Final block with remaining ciphertext + padding - var final_block: array; - var remaining = ciphertext_words - word_idx; - for (var i = 0u; i < 16u; i++) { - if (i < remaining) { - final_block[i] = ciphertext[word_idx + i]; - } else if (i == remaining) { - // Add 0x80 padding - final_block[i] = 0x80000000u; - } else { - final_block[i] = 0u; - } - } - - // Add length (64 bytes of ipad + ciphertext length) - let total_bits = 512u + params.ciphertext_len_bits; - if (remaining < 14u) { - final_block[14] = 0u; - final_block[15] = total_bits; - h = sha256_block_continue(&final_block, h); - } else { - // Need extra block for length - h = sha256_block_continue(&final_block, h); - var len_block: array; - for (var i = 0u; i < 14u; i++) { - len_block[i] = 0u; - } - len_block[14] = 0u; - len_block[15] = total_bits; - h = sha256_block_continue(&len_block, h); - } - - let inner_hash = h; - - // Outer hash: SHA256((K' ^ opad) || inner_hash) - var outer_block: array; - for (var i = 0u; i < 16u; i++) { - outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu; - } - h = sha256_block(&outer_block); - - // Second block: inner_hash (32 bytes) + padding - var hash_block: array; - for (var i = 0u; i < 8u; i++) { - hash_block[i] = inner_hash[i]; - } - hash_block[8] = 0x80000000u; - for (var i = 9u; i < 14u; i++) { - hash_block[i] = 0u; - } - hash_block[14] = 0u; - hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash - - h = sha256_block_continue(&hash_block, h); - - // Return first 2 bytes (high 16 bits of first word) - return h[0] & 0xFFFF0000u; -} - -// SHA256 block computation continuing from existing state -fn sha256_block_continue(msg: ptr>, h_in: array) -> array { - var h = h_in; - - // Message schedule - var w: array; - for (var i = 0u; i < 16u; i++) { - w[i] = (*msg)[i]; - } - for (var i = 16u; i < 64u; i++) { - w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u]; - } - - // Compression - var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3]; - var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7]; - - for (var i = 0u; i < 64u; i++) { - let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i]; - let t2 = sigma0(a) + maj(a, b, c); - hh = g; g = f; f = e; e = d + t1; - d = c; c = b; b = a; a = t1 + t2; - } - - h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d; - h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh; - - return h; -} - -// Process a single candidate and record match if found -fn process_candidate(name_idx: u32) { - // Generate message for this room name - var msg: array; - let valid = index_to_room_name(name_idx, params.name_length, &msg); - - if (!valid) { - return; - } - - // Compute SHA256("#roomname") - this gives us the key - let key_hash = sha256_block(&msg); - - // Take first 16 bytes (4 words) as the key - var key: array; - key[0] = key_hash[0]; - key[1] = key_hash[1]; - key[2] = key_hash[2]; - key[3] = key_hash[3]; - - // Compute SHA256(key) to get channel hash - let channel_hash = sha256_key(key); - - // Check if channel hash matches target - if (channel_hash != params.target_channel_hash) { - return; - } - - // Channel hash matches - verify MAC if enabled - if (params.verify_mac == 1u) { - let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits); - if (computed_mac != params.target_mac) { - return; - } - } - - // Found a match - record the index - let match_idx = atomicAdd(&match_count, 1u); - if (match_idx < 1024u) { // Limit stored matches - match_indices[match_idx] = name_idx; - } -} - -// Each thread processes 16 candidates to amortize thread overhead -const CANDIDATES_PER_THREAD: u32 = 16u; - -@compute @workgroup_size(256) -fn main(@builtin(global_invocation_id) global_id: vec3) { - let base_idx = global_id.x * CANDIDATES_PER_THREAD; - - for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) { - let idx = base_idx + i; - if (idx >= params.batch_size) { - return; - } - let name_idx = params.batch_offset + idx; - process_candidate(name_idx); - } -} -`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return _o(a,o)}countNamesForLength(o){return wa(o)}async runBatch(o,a,s,c,l,p){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],v=l&&p?1:0;let m,g=0,S=0;if(v){const P=new Uint8Array(l.length/2);for(let O=0;O0){await h.mapAsync(GPUMapMode.READ);const P=new Uint32Array(h.getMappedRange());for(let j=0;j1&&!z3.test(r)||U3.test(r))}var V3=class{constructor(){this.gpuInstance=null,this.wordlist=[],this.abortFlag=!1,this.useTimestampFilter=!0,this.useUtf8Filter=!0}async loadWordlist(r){const o=await fetch(r);if(!o.ok)throw new Error(`Failed to load wordlist: ${o.status} ${o.statusText}`);const s=(await o.text()).split(` -`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter(Xh)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(Xh)}abort(){this.abortFlag=!0}isGpuAvailable(){return H3()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await qh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:p,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new F3,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let v=0,m=performance.now(),g=1,S=0;if(o!=null&&o.startFrom){const j=D3(o.startFrom);j&&(g=j.length,S=j.index+1,S>=wa(g)&&(g++,S=0))}let _=0;for(let j=g;j<=s;j++)_+=wa(j);_-=S;const C=(j,B,D)=>{if(!a)return;const O=(performance.now()-h)/1e3,L=O>0?Math.round(v/O):0,G=_-v,$=L>0?G/L:0;a({checked:v,total:_,percent:_>0?Math.min(100,v/_*100):0,rateKeysPerSec:L,etaSeconds:$,elapsedSeconds:O,currentLength:B,currentPosition:D,phase:j})},x=j=>{if(!O3(p,u,j))return{valid:!1};const B=qh.ChannelCrypto.decryptGroupTextMessage(p,u,j);return!B.success||!B.data?{valid:!1}:this.useTimestampFilter&&!M3(B.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!I3(B.data.message)?{valid:!1}:{valid:!0,message:B.data.message}};if(g===1&&S===0){C("public-key",0,eu);const j=Yh(li);if(l===j){const B=x(li);if(B.valid)return{found:!0,roomName:eu,key:li,decryptedMessage:B.message}}}if(this.wordlist.length>0&&g===1&&S===0)for(let j=0;j=200&&(C("wordlist",B.length,B),m=O,await new Promise(L=>setTimeout(L,0)))}const w=32768,k=1e3;let b=w,R=!1;for(let j=g;j<=s;j++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:_o(j,0)||void 0};const B=wa(j);let D=j===g?S:0;for(;D=w&&G>0){const J=k/G,ae=Math.round(F*J),Q=Math.pow(2,Math.round(Math.log2(Math.max(w,ae))));b=Math.max(w,Q),R=!0}for(const J of L){const ae=_o(j,J);if(!ae)continue;const Q=$h("#"+ae),ne=x(Q);if(ne.valid)return{found:!0,roomName:ae,key:Q,decryptedMessage:ne.message}}D+=F;const $=performance.now();if($-m>=200){const J=_o(j,Math.min(D,B-1))||"";C("bruteforce",j,J),m=$,await new Promise(ae=>setTimeout(ae,0))}}}return{found:!1,resumeFrom:_o(s,wa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information: - -crypto-js/ripemd160.js: - (** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *) - -crypto-js/mode-ctr-gladman.js: - (** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - *) - -@noble/ed25519/index.js: - (*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *) -*/function W3({packets:r,channels:o,onChannelCreate:a}){const[s,c]=N.useState(!1),[l,p]=N.useState(6),[u,f]=N.useState(!1),[h,v]=N.useState(null),[m,g]=N.useState(new Map),[S,_]=N.useState([]),[C,x]=N.useState(!1),[w,k]=N.useState(null),b=N.useRef(null),R=N.useRef(!1),P=N.useRef(!1),j=N.useRef(!1),B=N.useRef(new Map),D=N.useRef(!1),F=N.useRef(6);N.useEffect(()=>{const U=new V3;return b.current=U,k(U.isGpuAvailable()),U.loadWordlist("/words_alpha.txt").then(()=>x(!0)).catch(te=>console.error("Failed to load wordlist:",te)),()=>{U.destroy(),b.current=null}},[]);const O=new Set(o.map(U=>U.key.toUpperCase())),L=r.filter(U=>U.payload_type==="GROUP_TEXT"&&!U.decrypted);N.useEffect(()=>{g(U=>{const te=new Map(U);let X=!1;for(const E of L)te.has(E.id)||(te.set(E.id,{packet:E,attempts:0,lastAttemptLength:0,status:"pending"}),X=!0);return X?(B.current=te,te):U})},[L.length]),N.useEffect(()=>{B.current=m},[m]),N.useEffect(()=>{D.current=u},[u]),N.useEffect(()=>{F.current=l},[l]);const G=Array.from(m.values()).filter(U=>U.status==="pending").length,$=Array.from(m.values()).filter(U=>U.status==="cracked").length,J=Array.from(m.values()).filter(U=>U.status==="failed").length,ae=N.useCallback(async()=>{if(j.current||!b.current||!R.current)return;const U=B.current;let te=null,X=null;for(const[H,V]of U.entries())if(V.status==="pending"){te=V,X=H;break}if(!te&&D.current){const H=Array.from(U.entries()).filter(([,V])=>V.status==="failed"&&V.lastAttemptLength<10);H.length>0&&(H.sort((V,re)=>V[1].lastAttemptLength-re[1].lastAttemptLength),[X,te]=H[0])}if(!te||X===null){R.current&&setTimeout(()=>ae(),1e3);return}j.current=!0;const E=F.current,I=te.lastAttemptLength>0?te.lastAttemptLength+1:E;try{const H=await b.current.crack(te.packet.data,{maxLength:I,useTimestampFilter:!0,useUtf8Filter:!0},V=>{v(V)});if(P.current){P.current=!1,j.current=!1,v(null);return}if(H.found&&H.roomName&&H.key){g(ce=>{const pe=new Map(ce),oe=pe.get(X);return oe&&pe.set(X,{...oe,status:"cracked",attempts:oe.attempts+1,lastAttemptLength:I}),pe});const V={roomName:H.roomName,key:H.key,packetId:X,message:H.decryptedMessage||"",crackedAt:Date.now()};_(ce=>[...ce,V]);const re=H.key.toUpperCase();if(!O.has(re))try{await a("#"+H.roomName,H.key)}catch(ce){console.error("Failed to create channel:",ce)}}else g(V=>{const re=new Map(V),ce=re.get(X);return ce&&re.set(X,{...ce,status:"failed",attempts:ce.attempts+1,lastAttemptLength:I}),re})}catch(H){console.error("Cracking error:",H),g(V=>{const re=new Map(V),ce=re.get(X);return ce&&re.set(X,{...ce,status:"failed",attempts:ce.attempts+1,lastAttemptLength:I}),re})}j.current=!1,v(null),R.current&&setTimeout(()=>ae(),100)},[O,a]),Q=()=>{if(!w){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}c(!0),R.current=!0,P.current=!1,ae()},ne=()=>{var U;c(!1),R.current=!1,P.current=!0,(U=b.current)==null||U.abort()};return A.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[A.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[A.jsx("button",{onClick:s?ne:Q,disabled:!C||w===!1,className:Xe("px-4 py-1.5 rounded text-sm font-medium",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:s?"Stop":"Start Cracking"}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),A.jsx("input",{type:"number",min:1,max:10,value:l,onChange:U=>p(Math.min(10,Math.max(1,parseInt(U.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),A.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[A.jsx("input",{type:"checkbox",checked:u,onChange:U=>f(U.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),A.jsxs("div",{className:"flex gap-4 text-sm",children:[A.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",A.jsx("span",{className:"text-foreground font-medium",children:G})]}),A.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",A.jsx("span",{className:"text-green-500 font-medium",children:$})]}),A.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",A.jsx("span",{className:"text-destructive font-medium",children:J})]})]}),h&&A.jsxs("div",{className:"space-y-1",children:[A.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[A.jsxs("span",{children:[h.phase==="wordlist"?"Dictionary":h.phase==="bruteforce"?"Bruteforce":"Public Key",h.phase==="bruteforce"&&` - Length ${h.currentLength}`,": ",h.currentPosition]}),A.jsxs("span",{children:[h.rateKeysPerSec>=1e9?`${(h.rateKeysPerSec/1e9).toFixed(2)} Gkeys/s`:`${(h.rateKeysPerSec/1e6).toFixed(1)} Mkeys/s`," ","• ETA: ",h.etaSeconds<60?`${Math.round(h.etaSeconds)}s`:`${Math.round(h.etaSeconds/60)}m`]})]}),A.jsx("div",{className:"h-2 bg-muted rounded overflow-hidden",children:A.jsx("div",{className:"h-full bg-primary transition-all duration-200",style:{width:`${h.percent}%`}})})]}),w===!1&&A.jsx("div",{className:"text-sm text-destructive",children:"WebGPU not available. Cracking requires Chrome 113+ or Edge 113+."}),!C&&w!==!1&&A.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading wordlist..."}),S.length>0&&A.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[A.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Cracked Rooms:"}),A.jsx("div",{className:"space-y-1",children:S.map((U,te)=>A.jsxs("div",{className:"text-sm bg-green-950/30 border border-green-900/50 rounded px-2 py-1",children:[A.jsxs("span",{className:"text-green-400 font-medium",children:["#",U.roomName]}),A.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:['"',U.message.slice(0,50),U.message.length>50?"...":"",'"']})]},te))})]})]})}const K3=Z0,G3=J0,n1=N.forwardRef(({className:r,...o},a)=>A.jsx(yi,{className:Xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o,ref:a}));n1.displayName=yi.displayName;const q3=hi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),o1=N.forwardRef(({side:r="right",className:o,children:a,hideCloseButton:s=!1,...c},l)=>A.jsxs(G3,{children:[A.jsx(n1,{}),A.jsxs(gi,{ref:l,className:Xe(q3({side:r}),o),...c,children:[!s&&A.jsxs(ep,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[A.jsx(t0,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));o1.displayName=gi.displayName;const a1=({className:r,...o})=>A.jsx("div",{className:Xe("flex flex-col space-y-2 text-center sm:text-left",r),...o});a1.displayName="SheetHeader";const s1=N.forwardRef(({className:r,...o},a)=>A.jsx(xi,{ref:a,className:Xe("text-lg font-semibold text-foreground",r),...o}));s1.displayName=xi.displayName;const $3=N.forwardRef(({className:r,...o},a)=>A.jsx(wi,{ref:a,className:Xe("text-sm text-muted-foreground",r),...o}));$3.displayName=wi.displayName;const Qh=500;function Y3(r){return`${r.type}-${r.conversation_key}-${r.text}-${r.sender_timestamp}`}function X3(){const r=N.useRef(null),o=N.useRef(null),a=N.useRef(new Set),[s,c]=N.useState(null),[l,p]=N.useState(null),[u,f]=N.useState(null),[h,v]=N.useState([]),[m,g]=N.useState([]),[S,_]=N.useState([]),[C,x]=N.useState(!1),[w,k]=N.useState(!1),[b,R]=N.useState([]),[P,j]=N.useState(null),[B,D]=N.useState(!1),[F,O]=N.useState(!1),[L,G]=N.useState(!1),[$,J]=N.useState(!1),[ae,Q]=N.useState(0),[ne,U]=N.useState(ch),[te,X]=N.useState({}),E=N.useRef(null),I=N.useMemo(()=>({onHealth:Z=>{const he=E.current;E.current=Z,c(Z),he!==null&&he.radio_connected!==Z.radio_connected&&(Z.radio_connected?ba.success("Radio connected",{description:Z.serial_port?`Connected to ${Z.serial_port}`:void 0}):ba.error("Radio disconnected",{description:"Check radio connection and power"}))},onError:Z=>{ba.error(Z.message,{description:Z.details})},onContacts:Z=>v(Z),onChannels:Z=>g(Z),onMessage:Z=>{const he=o.current,Te=Y3(Z);if(a.current.has(Te)){console.debug("Duplicate message content ignored:",Te.slice(0,50));return}if(a.current.add(Te),a.current.size>1e3){const Ke=Array.from(a.current);a.current=new Set(Ke.slice(-500))}let Ce=null;Z.type==="CHAN"&&Z.conversation_key?Ce=Un("channel",Z.conversation_key):Z.type==="PRIV"&&Z.conversation_key&&(Ce=Un("contact",Z.conversation_key));const De=he?Z.type==="CHAN"&&he.type==="channel"?Z.conversation_key===he.id:Z.type==="PRIV"&&he.type==="contact"?Z.conversation_key&&o0(he.id,Z.conversation_key):!1:!1;if(De&&_(Ke=>Ke.some(Qe=>Qe.id===Z.id)?Ke:[...Ke,Z]),Ce){const Ke=Z.received_at||Math.floor(Date.now()/1e3),Qe=fc(Ce,Ke);U(Qe),!Z.outgoing&&!De&&X(Yt=>({...Yt,[Ce]:(Yt[Ce]||0)+1}))}},onContact:Z=>{v(he=>{const Te=he.findIndex(Ce=>Ce.public_key===Z.public_key);if(Te>=0){const Ce=[...he],De=he[Te];return Ce[Te]={...De,...Z,name:Z.name??De.name,last_path:Z.last_path??De.last_path,lat:Z.lat??De.lat,lon:Z.lon??De.lon},Ce}return[...he,Z]})},onRawPacket:Z=>{R(he=>{if(he.some(Ce=>Ce.id===Z.id))return he;const Te=[...he,Z];return Te.length>Qh?Te.slice(-Qh):Te})},onMessageAcked:Z=>{_(he=>{const Te=he.findIndex(Ce=>Ce.id===Z);if(Te>=0){const Ce=[...he];return Ce[Te]={...he[Te],acked:!0},Ce}return he})}}),[]);uv(I);const H=N.useCallback(async()=>{try{const Z=await rt.getRadioConfig();p(Z)}catch(Z){console.error("Failed to fetch config:",Z)}},[]),V=N.useCallback(async()=>{try{const Z=await rt.getSettings();f(Z)}catch(Z){console.error("Failed to fetch app settings:",Z)}},[]),re=N.useCallback(async()=>{try{const Z=await rt.getUndecryptedPacketCount();Q(Z.count)}catch(Z){console.error("Failed to fetch undecrypted count:",Z)}},[]),ce=200,pe=N.useCallback(async(Z=!1)=>{if(!P){_([]),x(!1);return}Z&&D(!0);try{const he=await rt.getMessages({type:P.type==="channel"?"CHAN":"PRIV",conversation_key:P.id,limit:ce});_(he),x(he.length>=ce)}catch(he){console.error("Failed to fetch messages:",he)}finally{Z&&D(!1)}},[P]),oe=N.useCallback(async()=>{if(!(!P||w||!C)){k(!0);try{const Z=await rt.getMessages({type:P.type==="channel"?"CHAN":"PRIV",conversation_key:P.id,limit:ce,offset:S.length});Z.length>0&&_(he=>[...he,...Z]),x(Z.length>=ce)}catch(Z){console.error("Failed to fetch older messages:",Z)}finally{k(!1)}}},[P,w,C,S.length]);N.useEffect(()=>{H(),V(),re()},[H,V,re]);const Ae=N.useRef(!1);N.useEffect(()=>{if(Ae.current||m.length===0||P)return;const Z=m.find(he=>he.name==="Public");Z&&(j({type:"channel",id:Z.key,name:Z.name}),Ae.current=!0)},[m,P]);const ze=N.useRef(new Set),dt=N.useRef(new Set);N.useEffect(()=>{const Z=m.filter(Ce=>!ze.current.has(Ce.key)),he=h.filter(Ce=>Ce.public_key&&!dt.current.has(Ce.public_key));if(Z.length===0&&he.length===0)return;Z.forEach(Ce=>ze.current.add(Ce.key)),he.forEach(Ce=>dt.current.add(Ce.public_key)),(async()=>{const Ce=[...Z.map(De=>({type:"CHAN",conversation_key:De.key})),...he.map(De=>({type:"PRIV",conversation_key:De.public_key}))];if(Ce.length!==0)try{const De=await rt.getMessagesBulk(Ce,100),Ke=Qv(),Qe={},Yt={};for(const Pt of Z){const ee=De[`CHAN:${Pt.key}`]||[];if(ee.length>0){const le=Un("channel",Pt.key),ve=Ke[le]||0,je=ee.filter(Oe=>!Oe.outgoing&&Oe.received_at>ve).length;je>0&&(Qe[le]=je);const Ne=Math.max(...ee.map(Oe=>Oe.received_at));Yt[le]=Ne,fc(le,Ne)}}for(const Pt of he){const ee=De[`PRIV:${Pt.public_key}`]||[];if(ee.length>0){const le=Un("contact",Pt.public_key),ve=Ke[le]||0,je=ee.filter(Oe=>!Oe.outgoing&&Oe.received_at>ve).length;je>0&&(Qe[le]=je);const Ne=Math.max(...ee.map(Oe=>Oe.received_at));Yt[le]=Ne,fc(le,Ne)}}Object.keys(Qe).length>0&&X(Pt=>({...Pt,...Qe})),U(ch())}catch(De){console.error("Failed to fetch messages bulk:",De)}})()},[m,h]),N.useEffect(()=>{if(o.current=P,P&&P.type!=="raw"){const Z=Un(P.type,P.id),he=Math.floor(Date.now()/1e3);Zv(Z,he),X(Te=>{if(Te[Z]){const Ce={...Te};return delete Ce[Z],Ce}return Te})}},[P]),N.useEffect(()=>{pe(!0)},[pe]);const it=N.useCallback(async Z=>{P&&(P.type==="channel"?await rt.sendChannelMessage(P.id,Z):await rt.sendDirectMessage(P.id,Z),await pe())},[P,pe]),ft=N.useCallback(async Z=>{await rt.updateRadioConfig(Z),await H()},[H]),Ze=N.useCallback(async Z=>{await rt.updateSettings(Z),await V()},[V]),ar=N.useCallback(async Z=>{await rt.setPrivateKey(Z),await H()},[H]),Vt=N.useCallback(async()=>{await rt.rebootRadio(),c(he=>he&&{...he,radio_connected:!1}),(async()=>{for(let he=0;he<30;he++){await new Promise(Te=>setTimeout(Te,1e3));try{const Te=await rt.getHealth();if(c(Te),Te.radio_connected){H();return}}catch{}}})()},[H]),Tt=N.useCallback(async()=>{try{await rt.sendAdvertisement(!0)}catch(Z){console.error("Failed to send advertisement:",Z)}},[]),Wt=N.useCallback(Z=>{var he;(he=r.current)==null||he.appendText(`@[${Z}] `)},[]),ht=N.useCallback(Z=>{j(Z),J(!1)},[]),Dt=N.useCallback(async Z=>{if(confirm("Delete this channel? Message history will be preserved."))try{await rt.deleteChannel(Z),g(he=>he.filter(Te=>Te.key!==Z)),j(null)}catch(he){console.error("Failed to delete channel:",he)}},[]),nt=N.useCallback(async Z=>{if(confirm("Delete this contact? Message history will be preserved."))try{await rt.deleteContact(Z),v(he=>he.filter(Te=>Te.public_key!==Z)),j(null)}catch(he){console.error("Failed to delete contact:",he)}},[]),Ue=N.useCallback(async(Z,he,Te)=>{const Ce={public_key:he,name:Z,type:0,flags:0,last_path:null,last_path_len:-1,last_advert:null,lat:null,lon:null,last_seen:null,on_radio:!1};v(De=>[...De,Ce]),j({type:"contact",id:he,name:Sa(Z,he)}),Te&&console.log("Contact historical decryption not yet supported")},[]),pt=N.useCallback(async(Z,he,Te)=>{const Ce=await rt.createChannel(Z,he),De=await rt.getChannels();g(De),j({type:"channel",id:Ce.key,name:Z}),Te&&(await rt.decryptHistoricalPackets({key_type:"channel",channel_key:Ce.key}),re())},[re]),$t=N.useCallback(async(Z,he)=>{const Te=Z.startsWith("#")?Z:`#${Z}`,Ce=await rt.createChannel(Te),De=await rt.getChannels();g(De),j({type:"channel",id:Ce.key,name:Te}),he&&(await rt.decryptHistoricalPackets({key_type:"channel",channel_name:Te}),re())},[re]),dr=A.jsx(oy,{contacts:h,channels:m,activeConversation:P,onSelectConversation:ht,onNewMessage:()=>{O(!0),J(!1)},lastMessageTimes:ne,unreadCounts:te});return A.jsxs("div",{className:"flex flex-col h-screen",children:[A.jsx(Yv,{health:s,config:l,onConfigClick:()=>G(!0),onAdvertise:Tt,onMenuClick:()=>J(!0)}),A.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[A.jsx("div",{className:"hidden md:block",children:dr}),A.jsx(K3,{open:$,onOpenChange:J,children:A.jsxs(o1,{side:"left",className:"w-[280px] p-0 flex flex-col",hideCloseButton:!0,children:[A.jsx(a1,{className:"sr-only",children:A.jsx(s1,{children:"Navigation"})}),A.jsx("div",{className:"flex-1 overflow-hidden",children:dr})]})}),A.jsx("div",{className:"flex-1 flex flex-col bg-background",children:P?P.type==="raw"?A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"flex justify-between items-center px-4 py-3 border-b border-border font-medium",children:"Raw Packet Feed"}),A.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[A.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:A.jsx(I4,{packets:b})}),A.jsx("div",{className:"h-[280px] flex-shrink-0 border-t border-border overflow-hidden",children:A.jsx(W3,{packets:b,channels:m,onChannelCreate:async(Z,he)=>{const Te=await rt.createChannel(Z,he),Ce=await rt.getChannels();g(Ce),await rt.decryptHistoricalPackets({key_type:"channel",channel_key:Te.key}),re()}})})]})]}):A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex justify-between items-center px-4 py-3 border-b border-border font-medium",children:[A.jsxs("span",{className:"flex flex-col sm:flex-row sm:items-center sm:gap-2",children:[A.jsxs("span",{children:[P.type==="channel"&&!P.name.startsWith("#")?"#":"",P.name]}),A.jsx("span",{className:"font-normal text-xs text-muted-foreground font-mono",children:P.id})]}),!(P.type==="channel"&&P.name==="Public")&&A.jsx("button",{className:"py-1 px-3 bg-destructive/20 border border-destructive/30 text-destructive rounded text-xs cursor-pointer hover:bg-destructive/30",onClick:()=>{P.type==="channel"?Dt(P.id):nt(P.id)},children:"Delete"})]}),A.jsx(ay,{messages:S,contacts:h,loading:B,loadingOlder:w,hasOlderMessages:C,onSenderClick:P.type==="channel"?Wt:void 0,onLoadOlder:oe}),A.jsx(sy,{ref:r,onSend:it,disabled:!(s!=null&&s.radio_connected),placeholder:s!=null&&s.radio_connected?`Message ${P.name}...`:"Radio not connected"})]}):A.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a conversation or start a new one"})})]}),A.jsx(C4,{open:F,contacts:h,undecryptedCount:ae,onClose:()=>O(!1),onSelectConversation:Z=>{j(Z),O(!1)},onCreateContact:Ue,onCreateChannel:pt,onCreateHashtagChannel:$t}),A.jsx(j4,{open:L,config:l,appSettings:u,onClose:()=>G(!1),onSave:ft,onSaveAppSettings:Ze,onSetPrivateKey:ar,onReboot:Vt}),A.jsx($v,{position:"top-right"})]})}lv.createRoot(document.getElementById("root")).render(A.jsx(N.StrictMode,{children:A.jsx(X3,{})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index b55a16a..90a049c 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -4,7 +4,7 @@ RemoteTerm for MeshCore - + diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 9caefd0..a57257e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -18,6 +18,7 @@ "clsx": "^2.1.1", "lucide-react": "^0.562.0", "meshcore-cracker": "file:../references/standalone_cracker", + "nosleep.js": "^0.12.0", "react": "^18.3.1", "react-dom": "^18.3.1", "sonner": "^2.0.7", @@ -3616,6 +3617,12 @@ "node": ">=0.10.0" } }, + "node_modules/nosleep.js": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz", + "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==", + "license": "MIT" + }, "node_modules/nwsapi": { "version": "2.2.23", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", diff --git a/frontend/package.json b/frontend/package.json index dd88f35..ce2dd8e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,6 @@ "test:run": "vitest run" }, "dependencies": { - "meshcore-cracker": "file:../references/standalone_cracker", "@radix-ui/react-checkbox": "^1.3.3", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-label": "^2.1.8", @@ -21,6 +20,8 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.562.0", + "meshcore-cracker": "file:../references/standalone_cracker", + "nosleep.js": "^0.12.0", "react": "^18.3.1", "react-dom": "^18.3.1", "sonner": "^2.0.7", diff --git a/frontend/src/components/CrackerPanel.tsx b/frontend/src/components/CrackerPanel.tsx index 5e7f9cf..c3c0db2 100644 --- a/frontend/src/components/CrackerPanel.tsx +++ b/frontend/src/components/CrackerPanel.tsx @@ -1,5 +1,6 @@ import { useState, useEffect, useRef, useCallback } from 'react'; import { GroupTextCracker, type ProgressReport } from 'meshcore-cracker'; +import NoSleep from 'nosleep.js'; import type { RawPacket, Channel } from '../types'; import { cn } from '@/lib/utils'; @@ -35,6 +36,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane const [gpuAvailable, setGpuAvailable] = useState(null); const crackerRef = useRef(null); + const noSleepRef = useRef(null); const isRunningRef = useRef(false); const abortedRef = useRef(false); const isProcessingRef = useRef(false); @@ -42,12 +44,15 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane const retryFailedRef = useRef(false); const maxLengthRef = useRef(6); - // Initialize cracker + // Initialize cracker and NoSleep useEffect(() => { const cracker = new GroupTextCracker(); crackerRef.current = cracker; setGpuAvailable(cracker.isGpuAvailable()); + const noSleep = new NoSleep(); + noSleepRef.current = noSleep; + // Load wordlist cracker.loadWordlist('/words_alpha.txt') .then(() => setWordlistLoaded(true)) @@ -56,6 +61,8 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane return () => { cracker.destroy(); crackerRef.current = null; + noSleep.disable(); + noSleepRef.current = null; }; }, []); @@ -265,6 +272,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane setIsRunning(true); isRunningRef.current = true; abortedRef.current = false; + noSleepRef.current?.enable(); processNext(); }; @@ -273,6 +281,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane isRunningRef.current = false; abortedRef.current = true; crackerRef.current?.abort(); + noSleepRef.current?.disable(); };