Always valodate fanout configs on save

This commit is contained in:
Jack Kingsman committed 2026-03-15 16:27:43 -07:00
1 parent 29368961fc
commit 4a7ea9eb29
32 files changed
+124 -84

No files matched your search

+24 -35
View File
@@ -78,6 +78,26 @@ class FanoutConfigUpdate(BaseModel):
enabled: bool | None = Field(default=None, description="Enable/disable toggle")
def _validate_and_normalize_config(config_type: str, config: dict) -> dict:
"""Validate a config blob and return the canonical persisted form."""
normalized = dict(config)
if config_type == "mqtt_private":
_validate_mqtt_private_config(normalized)
elif config_type == "mqtt_community":
_validate_mqtt_community_config(normalized)
elif config_type == "bot":
_validate_bot_config(normalized)
elif config_type == "webhook":
_validate_webhook_config(normalized)
elif config_type == "apprise":
_validate_apprise_config(normalized)
elif config_type == "sqs":
_validate_sqs_config(normalized)
return normalized
def _validate_mqtt_private_config(config: dict) -> None:
"""Validate mqtt_private config blob."""
if not config.get("broker_host"):
@@ -323,28 +343,13 @@ async def create_fanout_config(body: FanoutConfigCreate) -> dict:
if body.type == "bot" and server_settings.disable_bots:
raise HTTPException(status_code=403, detail="Bot system disabled by server configuration")
# Only validate config when creating as enabled — disabled configs
# are drafts the user hasn't finished configuring yet.
if body.enabled:
if body.type == "mqtt_private":
_validate_mqtt_private_config(body.config)
elif body.type == "mqtt_community":
_validate_mqtt_community_config(body.config)
elif body.type == "bot":
_validate_bot_config(body.config)
elif body.type == "webhook":
_validate_webhook_config(body.config)
elif body.type == "apprise":
_validate_apprise_config(body.config)
elif body.type == "sqs":
_validate_sqs_config(body.config)
normalized_config = _validate_and_normalize_config(body.type, body.config)
scope = _enforce_scope(body.type, body.scope)
cfg = await FanoutConfigRepository.create(
config_type=body.type,
name=body.name,
config=body.config,
config=normalized_config,
scope=scope,
enabled=body.enabled,
)
@@ -374,27 +379,11 @@ async def update_fanout_config(config_id: str, body: FanoutConfigUpdate) -> dict
kwargs["name"] = body.name
if body.enabled is not None:
kwargs["enabled"] = body.enabled
if body.config is not None:
kwargs["config"] = body.config
if body.scope is not None:
kwargs["scope"] = _enforce_scope(existing["type"], body.scope)
# Validate config when the result will be enabled
will_be_enabled = body.enabled if body.enabled is not None else existing["enabled"]
if will_be_enabled:
config_to_validate = body.config if body.config is not None else existing["config"]
if existing["type"] == "mqtt_private":
_validate_mqtt_private_config(config_to_validate)
elif existing["type"] == "mqtt_community":
_validate_mqtt_community_config(config_to_validate)
elif existing["type"] == "bot":
_validate_bot_config(config_to_validate)
elif existing["type"] == "webhook":
_validate_webhook_config(config_to_validate)
elif existing["type"] == "apprise":
_validate_apprise_config(config_to_validate)
elif existing["type"] == "sqs":
_validate_sqs_config(config_to_validate)
config_to_validate = body.config if body.config is not None else existing["config"]
kwargs["config"] = _validate_and_normalize_config(existing["type"], config_to_validate)
updated = await FanoutConfigRepository.update(config_id, **kwargs)
if updated is None:
@@ -1,4 +1,4 @@
import{r as be,j as vr}from"./index-Fnq3QmNw.js";function wr(){return wr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},wr.apply(null,arguments)}function Tu(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let Tr=[],ph=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,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.length;;){let i=e+t>>1;if(n<Tr[i])t=i;else if(n>=ph[i])e=i+1;else return!0;if(e==t)return!1}}function cl(n){return n>=127462&&n<=127487}const fl=8205;function Qu(n,e,t=!0,i=!0){return(t?mh:Au)(n,e,i)}function mh(n,e,t){if(e==n.length)return e;e&&gh(n.charCodeAt(e))&&Oh(n.charCodeAt(e-1))&&e--;let i=Ls(n,e);for(e+=ul(i);e<n.length;){let s=Ls(n,e);if(i==fl||s==fl||t&&Cu(s))e+=ul(s),i=s;else if(cl(s)){let r=0,o=e-2;for(;o>=0&&cl(Ls(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Au(n,e,t){for(;e>0;){let i=mh(n,e-2,t);if(i<e)return i;e--}return 0}function Ls(n,e){let t=n.charCodeAt(e);if(!Oh(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return gh(i)?(t-55296<<10)+(i-56320)+65536:t}function gh(n){return n>=56320&&n<57344}function Oh(n){return n>=55296&&n<56320}function ul(n){return n<65536?1:2}class V{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=ai(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ye.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ai(this,e,t);let i=[];return this.decompose(e,t,i,0),Ye.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ci(this),r=new Ci(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ci(this,e)}iterRange(e,t=this.length){return new yh(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?V.empty:e.length<=32?new J(e):Ye.from(J.split(e,[]))}}class J extends V{constructor(e,t=Pu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Mu(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new J(dl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$n(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new J(l,o.length+r.length));else{let a=l.length>>1;i.push(new J(l.slice(0,a)),new J(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof J))return super.replace(e,t,i);[e,t]=ai(this,e,t);let s=$n(this.text,$n(i.text,dl(this.text,0,e)),t),r=this.length+i.length-(t-e);return sLine truncated
import{r as be,j as vr}from"./index-CyRLXsJ_.js";function wr(){return wr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},wr.apply(null,arguments)}function Tu(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let Tr=[],ph=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3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2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ph:Tr).push(t=t+n[e])})();function Cu(n){if(n<768)return!1;for(let e=0,t=Tr.length;;){let i=e+t>>1;if(n<Tr[i])t=i;else if(n>=ph[i])e=i+1;else return!0;if(e==t)return!1}}function cl(n){return n>=127462&&n<=127487}const fl=8205;function Qu(n,e,t=!0,i=!0){return(t?mh:Au)(n,e,i)}function mh(n,e,t){if(e==n.length)return e;e&&gh(n.charCodeAt(e))&&Oh(n.charCodeAt(e-1))&&e--;let i=Ls(n,e);for(e+=ul(i);e<n.length;){let s=Ls(n,e);if(i==fl||s==fl||t&&Cu(s))e+=ul(s),i=s;else if(cl(s)){let r=0,o=e-2;for(;o>=0&&cl(Ls(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Au(n,e,t){for(;e>0;){let i=mh(n,e-2,t);if(i<e)return i;e--}return 0}function Ls(n,e){let t=n.charCodeAt(e);if(!Oh(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return gh(i)?(t-55296<<10)+(i-56320)+65536:t}function gh(n){return n>=56320&&n<57344}function Oh(n){return n>=55296&&n<56320}function ul(n){return n<65536?1:2}class V{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=ai(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ye.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ai(this,e,t);let i=[];return this.decompose(e,t,i,0),Ye.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ci(this),r=new Ci(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ci(this,e)}iterRange(e,t=this.length){return new yh(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?V.empty:e.length<=32?new J(e):Ye.from(J.split(e,[]))}}class J extends V{constructor(e,t=Pu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Mu(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new J(dl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$n(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new J(l,o.length+r.length));else{let a=l.length>>1;i.push(new J(l.slice(0,a)),new J(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof J))return super.replace(e,t,i);[e,t]=ai(this,e,t);let s=$n(this.text,$n(i.text,dl(this.text,0,e)),t),r=this.length+i.length-(t-e);return sLine truncated
`){[e,t]=ai(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new J(i,s)),i=[],s=-1);return s>-1&&t.push(new J(i,s)),t}}class Ye extends V{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=ai(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new Ye(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
`){[e,t]=ai(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ye))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new J(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ye)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof J&&a&&(p=c[c.length-1])instanceof J&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new J(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Ye.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ye(l,t)}}V.empty=new J([""],0);function Pu(n){let e=-1;for(let t of n)e+=t.length+1;return e}function $n(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function dl(n,e,t){return $n(n,[""],e,t)}class Ci{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof J?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof J?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(s instanceof J){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof J?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class yh{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Ci(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bh{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(V.prototype[Symbol.iterator]=function(){return this.iter()},Ci.prototype[Symbol.iterator]=yh.prototype[Symbol.iterator]=bh.prototype[Symbol.iterator]=function(){return this});class Mu{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function ai(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function le(n,e,t=!0,i=!0){return Qu(n,e,t,i)}function Ru(n){return n>=56320&&n<57344}function Du(n){return n>=55296&&n<56320}function ke(n,e){let t=n.charCodeAt(e);if(!Du(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Ru(i)?(t-55296<<10)+(i-56320)+65536:t}function xo(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Ke(n){return n<65536?1:2}const Cr=/\r\n?|\n/;var ue=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(ue||(ue={}));class st{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Qr(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new st(e)}composeDesc(e){return this.empty?e:e.empty?this:xh(this,e)}mapDesc(e,t=!1){return e.empty?this:Ar(this,e,t)}mapPos(e,t=-1,i=ue.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=ue.Simple&&h>=e&&(i==ue.TrackDel&&s<e&&h>e||i==ue.TrackBefore&&s<e||i==ue.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new st(e)}static create(e){return new st(e)}}class se extends st{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Qr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Ar(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(V.empty);i.push(o?e.slice(r,r+o):V.empty)}r+=o}return new se(t,i)}compose(e){return this.empty?e:e.empty?this:xh(this,e,!0)}map(e,t=!1){return e.empty?this:Ar(this,e,t,!0)}iterChanges(e,t=!1){Qr(this,e,t)}get desc(){return st.crea Line truncated
@@ -12,4 +12,4 @@ import{r as be,j as vr}from"./index-Fnq3QmNw.js";function wr(){return wr=Object.
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new S0(this):new y0(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Zt(this,s,t,i):Gt(this,s,t,i)}}class Hf{constructor(e){this.spec=e}}function g0(n,e,t){return(i,s,r,o)=>{if(t&&!t(i,s,r,o))return!1;let l=i>=o&&s<=o+r.length?r.slice(i-o,s-o):e.doc.sliceString(i,s);return n(l,e,i,s)}}function Gt(n,e,t,i){let s;return n.wholeWord&&(s=O0(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=g0(n.test,e,s)),new di(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),s)}function O0(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(ds(s,t-r))!=G.Word||e(ps(s,t-r))!=G.Word)&&(e(ps(s,i-r))!=G.Word||e(ds(s,i-r))!=G.Word))}class y0 extends Hf{constructor(e){super(e)}nextMatch(e,t,i){let s=Gt(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=Gt(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Gt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Gt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Gt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function b0(n,e,t){return(i,s,r)=>(!t||t(i,s,r))&&n(r[0],e,i,s)}function Zt(n,e,t,i){let s;return n.wholeWord&&(s=x0(e.charCategorizer(e.selection.main.head))),n.test&&(s=b0(n.test,e,s)),new Ff(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,i)}function ds(n,e){return n.slice(le(n,e,!1),e)}function ps(n,e){return n.slice(e,le(n,e))}function x0(n){return(e,t,i)=>!i[0].length||(n(ds(i.input,i.index))!=G.Word||n(ps(i.input,i.index))!=G.Word)&&(n(ps(i.input,i.index+i[0].length))!=G.Word||n(ds(i.input,i.index+i[0].length))!=G.Word)}class S0 extends Hf{nextMatch(e,t,i){let s=Zt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Zt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Zt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+i.slice(s)}return t})}matchAll(e,t){let i=Zt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Zt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ui=W.define(),Go=W.define(),kt=pe.define({create(n){return new cr(Oo(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ui)?n=new cr(t.value.create(),n.panel):t.is(Go)&&(n=new cr(n.query,t.value?Zo:null));return n},provide:n=>Vi.from(n,e=>e.panel)});class cr{constructor(e,t){this.query=e,this.panel=t}}const k0=R.mark({class:"cm-searchMatch"}),v0=R.mark({class:"cm-searchMatch cm-searchMatch-selected"}),w0=K.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(kt))}update(n){let e=n.state.field(kt);(e!=n.startState.field(kt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new mt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?v0:k0)})}return i.finish()}},{decorations:n=>n.decorations});function hn(n){return e=>{let t=e.state.field(kt,!1);return t&&t.query.spec.valid?n(e,t):Zf(e)}}const ms=hn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(gi);return n.dispatch({selection:s,effects:[Yo(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Gf(n),!0}),gs=hn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r= Line truncated
`,{label:"if",detail:"block",type:"keyword"}),lt("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),lt("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),lt("import ${module}",{label:"import",detail:"statement",type:"keyword"}),lt("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Rb=E0(wu,Jf(Pb.concat(Mb)));function xr(n){let{node:e,pos:t}=n,i=n.lineIndent(t,-1),s=null;for(;;){let r=e.childBefore(t);if(r)if(r.name=="Comment")t=r.from;else if(r.name=="Body"||r.name=="MatchBody")n.baseIndentFor(r)+n.unit<=i&&(s=r),e=r;else if(r.name=="MatchClause")e=r;else if(r.type.is("Statement"))e=r;else break;else break}return s}function Sr(n,e){let t=n.baseIndentFor(e),i=n.lineAt(n.pos,-1),s=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&n.node.to<s+100&&!/\S/.test(n.state.sliceDoc(s,n.node.to))&&n.lineIndent(n.pos,-1)<=t||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(n.textAfter)&&n.lineIndent(n.pos,-1)>t?null:t+n.unit}const kr=os.define({name:"python",parser:Cb.configure({props:[Hc.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&xr(n)||n.node;return(e=Sr(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=xr(n);return(e=Sr(n,t||n.node))!==null&&e!==void 0?e:n.continue()},IfStatement:n=>/^\s*(else:|elif )/.test(n.textAfter)?n.baseIndent:n.continue(),"ForStatement WhileStatement":n=>/^\s*else:/.test(n.textAfter)?n.baseIndent:n.continue(),TryStatement:n=>/^\s*(except[ :]|finally:|else:)/.test(n.textAfter)?n.baseIndent:n.continue(),MatchStatement:n=>/^\s*case /.test(n.textAfter)?n.baseIndent+n.unit:n.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":sr({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":sr({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":sr({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=xr(n);return(e=t&&Sr(n,t))!==null&&e!==void 0?e:n.continue()}}),Zc.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":pg,Body:(n,e)=>({from:n.from+1,to:n.to-(n.to==e.doc.length?0:1)}),"String FormatString":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Db(){return new ng(kr,[kr.data.of({autocomplete:Ab}),kr.data.of({autocomplete:Rb})])}function Bb({value:n,onChange:e,id:t,height:i="256px"}){return vr.jsx("div",{className:"w-full overflow-hidden rounded-md border border-input",children:vr.jsx(pu,{value:n,onChange:e,extensions:[Db()],theme:du,height:i,basicSetup:{lineNumbers:!0,foldGutter:!1,highlightActiveLine:!0},className:"text-sm",id:t,"aria-label":"Bot code editor"})})}export{Bb as BotCodeEditor};
//# sourceMappingURL=BotCodeEditor-C20Gx7-Q.js.map
//# sourceMappingURL=BotCodeEditor-D8HqJbrh.js.map
@@ -1 +1 @@
{"version":3,"file":"BotCodeEditor-C20Gx7-Q.js","sources":["../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@marijn/find-cluster-break/src/index.js","../../node_modules/@codemirror/state/dist/index.js","../../node_modules/style-mod/src/style-mod.js","../../node_modules/w3c-keyname/index.js","../../node_modules/crelt/index.js","../../node_modules/@codemirror/view/dist/index.js","../../node_modules/@lezer/common/dist/index.js","../../node_modules/@lezer/highlight/dist/index.js","../../node_modules/@codemirror/language/dist/index.js","../../node_modules/@codemirror/commands/dist/index.js","../../node_modules/@codemirror/search/dist/index.js","../../node_modules/@codemirror/autocomplete/dist/index.js","../../node_modules/@codemirror/lint/dist/index.js","../../node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js","../../node_modules/@codemirror/theme-one-dark/dist/index.js","../../node_modules/@uiw/react-codemirror/esm/theme/light.js","../../node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js","../../node_modules/@uiw/react-codemirror/esm/utils.js","../../node_modules/@uiw/react-codemirror/esm/timeoutLatch.js","../../node_modules/@uiw/react-codemirror/esm/useCodeMirror.js","../../node_modules/@uiw/react-codemirror/esm/index.js","../../node_modules/@lezer/lr/dist/index.js","../../node_modules/@lezer/python/dist/index.js","../../node_modules/@codemirror/lang-python/dist/index.js","../../src/components/BotCodeEditor.tsx"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","// These are filled with ranges (rangeFrom[i] up to but not including\n// rangeTo[i]) of code points that count as extending characters.\nlet rangeFrom = [], rangeTo = []\n\n;(() => {\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/16.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1.\n let numbers = \"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o\".split(\",\").map(s => s ? parseInt(s, 36) : 1)\n for (let i = 0, n = 0; i < numbers.length; i++)\n (i % 2 ? rangeTo : rangeFrom).push(n = n + numbers[i])\n})()\n\nexport function isExtendingChar(code) {\n if (code < 768) return false\n for (let from = 0, to = rangeFrom.length;;) {\n let mid = (from + to) >> 1\n if (code < rangeFrom[mid]) to = mid\n else if (code >= rangeTo[mid]) from = mid + 1\n else return true\n if (from == to) return false\n }\n}\n\nfunction isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF\n}\n\nfunction check(code) {\n for (let i = 0; i < rangeFrom.length; i++) {\n if (rangeTo[i] > code) return rangeFrom[i] <= code\n }\n return false\n}\n\nconst ZWJ = 0x200d\n\nexport function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(strLine truncated
{"version":3,"file":"BotCodeEditor-D8HqJbrh.js","sources":["../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@marijn/find-cluster-break/src/index.js","../../node_modules/@codemirror/state/dist/index.js","../../node_modules/style-mod/src/style-mod.js","../../node_modules/w3c-keyname/index.js","../../node_modules/crelt/index.js","../../node_modules/@codemirror/view/dist/index.js","../../node_modules/@lezer/common/dist/index.js","../../node_modules/@lezer/highlight/dist/index.js","../../node_modules/@codemirror/language/dist/index.js","../../node_modules/@codemirror/commands/dist/index.js","../../node_modules/@codemirror/search/dist/index.js","../../node_modules/@codemirror/autocomplete/dist/index.js","../../node_modules/@codemirror/lint/dist/index.js","../../node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js","../../node_modules/@codemirror/theme-one-dark/dist/index.js","../../node_modules/@uiw/react-codemirror/esm/theme/light.js","../../node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js","../../node_modules/@uiw/react-codemirror/esm/utils.js","../../node_modules/@uiw/react-codemirror/esm/timeoutLatch.js","../../node_modules/@uiw/react-codemirror/esm/useCodeMirror.js","../../node_modules/@uiw/react-codemirror/esm/index.js","../../node_modules/@lezer/lr/dist/index.js","../../node_modules/@lezer/python/dist/index.js","../../node_modules/@codemirror/lang-python/dist/index.js","../../src/components/BotCodeEditor.tsx"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","// These are filled with ranges (rangeFrom[i] up to but not including\n// rangeTo[i]) of code points that count as extending characters.\nlet rangeFrom = [], rangeTo = []\n\n;(() => {\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/16.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1.\n let numbers = \"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o\".split(\",\").map(s => s ? parseInt(s, 36) : 1)\n for (let i = 0, n = 0; i < numbers.length; i++)\n (i % 2 ? rangeTo : rangeFrom).push(n = n + numbers[i])\n})()\n\nexport function isExtendingChar(code) {\n if (code < 768) return false\n for (let from = 0, to = rangeFrom.length;;) {\n let mid = (from + to) >> 1\n if (code < rangeFrom[mid]) to = mid\n else if (code >= rangeTo[mid]) from = mid + 1\n else return true\n if (from == to) return false\n }\n}\n\nfunction isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF\n}\n\nfunction check(code) {\n for (let i = 0; i < rangeFrom.length; i++) {\n if (rangeTo[i] > code) return rangeFrom[i] <= code\n }\n return false\n}\n\nconst ZWJ = 0x200d\n\nexport function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(strLine truncated
@@ -1,4 +1,4 @@
import{o as tr,p as yt,q as lr,u as wt,v as nt,w as rr,x as ar,y as hr,r as H,_ as fr,t as dt,z as gr,k as Ct,j as M,l as mr}from"./index-Fnq3QmNw.js";var Se={},Fe={},ie={},St;function ve(){if(St)return ie;St=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.RequestType=ie.AdvertFlags=ie.DeviceRole=ie.PayloadVersion=ie.ControlSubType=ie.PayloadType=ie.RouteType=void 0;var t;(function(e){e[e.TransportFlood=0]="TransportFlood",e[e.Flood=1]="Flood",e[e.Direct=2]="Direct",e[e.TransportDirect=3]="TransportDirect"})(t||(ie.RouteType=t={}));var o;(function(e){e[e.Request=0]="Request",e[e.Response=1]="Response",e[e.TextMessage=2]="TextMessage",e[e.Ack=3]="Ack",e[e.Advert=4]="Advert",e[e.GroupText=5]="GroupText",e[e.GroupData=6]="GroupData",e[e.AnonRequest=7]="AnonRequest",e[e.Path=8]="Path",e[e.Trace=9]="Trace",e[e.Multipart=10]="Multipart",e[e.Control=11]="Control",e[e.RawCustom=15]="RawCustom"})(o||(ie.PayloadType=o={}));var c;(function(e){e[e.NodeDiscoverReq=128]="NodeDiscoverReq",e[e.NodeDiscoverResp=144]="NodeDiscoverResp"})(c||(ie.ControlSubType=c={}));var l;(function(e){e[e.Version1=0]="Version1",e[e.Version2=1]="Version2",e[e.Version3=2]="Version3",e[e.Version4=3]="Version4"})(l||(ie.PayloadVersion=l={}));var n;(function(e){e[e.Unknown=0]="Unknown",e[e.ChatNode=1]="ChatNode",e[e.Repeater=2]="Repeater",e[e.RoomServer=3]="RoomServer",e[e.Sensor=4]="Sensor"})(n||(ie.DeviceRole=n={}));var r;(function(e){e[e.HasLocation=16]="HasLocation",e[e.HasFeature1=32]="HasFeature1",e[e.HasFeature2=64]="HasFeature2",e[e.HasName=128]="HasName"})(r||(ie.AdvertFlags=r={}));var a;return(function(e){e[e.GetStats=1]="GetStats",e[e.Keepalive=2]="Keepalive",e[e.GetTelemetryData=3]="GetTelemetryData",e[e.GetMinMaxAvgData=4]="GetMinMaxAvgData",e[e.GetAccessList=5]="GetAccessList"})(a||(ie.RequestType=a={})),ie}var Ie={},kt;function oe(){if(kt)return Ie;kt=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.byteToHex=t,Ie.bytesToHex=o,Ie.numberToHex=c,Ie.hexToBytes=l;function t(n){return n.toString(16).padStart(2,"0").toUpperCase()}function o(n){return Array.from(n).map(t).join("")}function c(n,r=8){return(n>>>0).toString(16).padStart(r,"0").toUpperCase()}function l(n){const r=n.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(r))throw new Error("Invalid hex string: invalid characters at position 0");if(r.length%2!==0)throw new Error("Invalid hex string: odd length");const a=new Uint8Array(r.length/2);for(let e=0;e<r.length;e+=2)a[e/2]=parseInt(r.substr(e,2),16);return a}return Ie}var ke={},Tt;function $e(){if(Tt)return ke;Tt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRouteTypeName=o,ke.getPayloadTypeName=c,ke.getPayloadVersionName=l,ke.getDeviceRoleName=n,ke.getRequestTypeName=r,ke.getControlSubTypeName=a;const t=ve();function o(e){switch(e){case t.RouteType.Flood:return"Flood";case t.RouteType.Direct:return"Direct";case t.RouteType.TransportFlood:return"TransportFlood";case t.RouteType.TransportDirect:return"TransportDirect";default:return`Unknown (${e})`}}function c(e){switch(e){case t.PayloadType.RawCustom:return"RawCustom";case t.PayloadType.Trace:return"Trace";case t.PayloadType.Advert:return"Advert";case t.PayloadType.GroupText:return"GroupText";case t.PayloadType.GroupData:return"GroupData";case t.PayloadType.Request:return"Request";case t.PayloadType.Response:return"Response";case t.PayloadType.TextMessage:return"TextMessage";case t.PayloadType.AnonRequest:return"AnonRequest";case t.PayloadType.Ack:return"Ack";case t.PayloadType.Path:return"Path";case t.PayloadType.Multipart:return"Multipart";case t.PayloadType.Control:return"Control";default:return`Unknown (0x${e.toString(16)})`}}function l(e){switch(e){case t.PayloadVersion.Version1:return"Version 1";case t.PayloadVersion.Version2:return"Version 2";case t.PayloadVersion.Version3:return"Version 3";case t.PayloadVersion.Version4:return"Version 4";default:return`Unknown (${e})`}}function n(e){switch(e){case t.DeviceRole.Unknown:return"Unknown";case t.DeviceRole.ChatNode:return"Chat Node";case t.DeviceRole.Repeater:return"Repeater";case t.DeviceRole.RoomServer:return"Room Server";case t.DeviceRole.Sensor:return"Sensor";default:return`Unknown (${e})`}}function r(e){switch(e){case t.RequestType.GetStats:return"Get Stats";case t.RequestType.Keepalive:return"Keepalive (deprecated)";case t.RequestType.GetTelemetryData:return"Get Telemetry Data";case t.RequestType.GetMinMaxAvgData:return"Get Min/Max/Avg Data";case t.RequestType.GetAccessList:return"Get Access List";default:return`Unknown (${e})`}}function a(e){switch(e){case t.ControlSubType.NodeDiscoverReq:return"Node Discover Request";case t.ControlSubType.NodeDiscoverResp:return"Node Discover Response";default:return`Unknown (0x${e.toString(16)})`}}return ke}var Ue={},Ge={},Pt;function xt(){if(Pt)return Ge;Pt=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.ChannelCrypto=void 0;const t=tr(),o=oe();class c{static decryptGroupTextMessage(n,r,a){try{const e=(0,o.hexToBytes)(a),A=(0,o.hexToBytes)(r)Line truncated
import{o as tr,p as yt,q as lr,u as wt,v as nt,w as rr,x as ar,y as hr,r as H,_ as fr,t as dt,z as gr,k as Ct,j as M,l as mr}from"./index-CyRLXsJ_.js";var Se={},Fe={},ie={},St;function ve(){if(St)return ie;St=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.RequestType=ie.AdvertFlags=ie.DeviceRole=ie.PayloadVersion=ie.ControlSubType=ie.PayloadType=ie.RouteType=void 0;var t;(function(e){e[e.TransportFlood=0]="TransportFlood",e[e.Flood=1]="Flood",e[e.Direct=2]="Direct",e[e.TransportDirect=3]="TransportDirect"})(t||(ie.RouteType=t={}));var o;(function(e){e[e.Request=0]="Request",e[e.Response=1]="Response",e[e.TextMessage=2]="TextMessage",e[e.Ack=3]="Ack",e[e.Advert=4]="Advert",e[e.GroupText=5]="GroupText",e[e.GroupData=6]="GroupData",e[e.AnonRequest=7]="AnonRequest",e[e.Path=8]="Path",e[e.Trace=9]="Trace",e[e.Multipart=10]="Multipart",e[e.Control=11]="Control",e[e.RawCustom=15]="RawCustom"})(o||(ie.PayloadType=o={}));var c;(function(e){e[e.NodeDiscoverReq=128]="NodeDiscoverReq",e[e.NodeDiscoverResp=144]="NodeDiscoverResp"})(c||(ie.ControlSubType=c={}));var l;(function(e){e[e.Version1=0]="Version1",e[e.Version2=1]="Version2",e[e.Version3=2]="Version3",e[e.Version4=3]="Version4"})(l||(ie.PayloadVersion=l={}));var n;(function(e){e[e.Unknown=0]="Unknown",e[e.ChatNode=1]="ChatNode",e[e.Repeater=2]="Repeater",e[e.RoomServer=3]="RoomServer",e[e.Sensor=4]="Sensor"})(n||(ie.DeviceRole=n={}));var r;(function(e){e[e.HasLocation=16]="HasLocation",e[e.HasFeature1=32]="HasFeature1",e[e.HasFeature2=64]="HasFeature2",e[e.HasName=128]="HasName"})(r||(ie.AdvertFlags=r={}));var a;return(function(e){e[e.GetStats=1]="GetStats",e[e.Keepalive=2]="Keepalive",e[e.GetTelemetryData=3]="GetTelemetryData",e[e.GetMinMaxAvgData=4]="GetMinMaxAvgData",e[e.GetAccessList=5]="GetAccessList"})(a||(ie.RequestType=a={})),ie}var Ie={},kt;function oe(){if(kt)return Ie;kt=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.byteToHex=t,Ie.bytesToHex=o,Ie.numberToHex=c,Ie.hexToBytes=l;function t(n){return n.toString(16).padStart(2,"0").toUpperCase()}function o(n){return Array.from(n).map(t).join("")}function c(n,r=8){return(n>>>0).toString(16).padStart(r,"0").toUpperCase()}function l(n){const r=n.replace(/\s/g,"").toUpperCase();if(!/^[0-9A-F]*$/.test(r))throw new Error("Invalid hex string: invalid characters at position 0");if(r.length%2!==0)throw new Error("Invalid hex string: odd length");const a=new Uint8Array(r.length/2);for(let e=0;e<r.length;e+=2)a[e/2]=parseInt(r.substr(e,2),16);return a}return Ie}var ke={},Tt;function $e(){if(Tt)return ke;Tt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRouteTypeName=o,ke.getPayloadTypeName=c,ke.getPayloadVersionName=l,ke.getDeviceRoleName=n,ke.getRequestTypeName=r,ke.getControlSubTypeName=a;const t=ve();function o(e){switch(e){case t.RouteType.Flood:return"Flood";case t.RouteType.Direct:return"Direct";case t.RouteType.TransportFlood:return"TransportFlood";case t.RouteType.TransportDirect:return"TransportDirect";default:return`Unknown (${e})`}}function c(e){switch(e){case t.PayloadType.RawCustom:return"RawCustom";case t.PayloadType.Trace:return"Trace";case t.PayloadType.Advert:return"Advert";case t.PayloadType.GroupText:return"GroupText";case t.PayloadType.GroupData:return"GroupData";case t.PayloadType.Request:return"Request";case t.PayloadType.Response:return"Response";case t.PayloadType.TextMessage:return"TextMessage";case t.PayloadType.AnonRequest:return"AnonRequest";case t.PayloadType.Ack:return"Ack";case t.PayloadType.Path:return"Path";case t.PayloadType.Multipart:return"Multipart";case t.PayloadType.Control:return"Control";default:return`Unknown (0x${e.toString(16)})`}}function l(e){switch(e){case t.PayloadVersion.Version1:return"Version 1";case t.PayloadVersion.Version2:return"Version 2";case t.PayloadVersion.Version3:return"Version 3";case t.PayloadVersion.Version4:return"Version 4";default:return`Unknown (${e})`}}function n(e){switch(e){case t.DeviceRole.Unknown:return"Unknown";case t.DeviceRole.ChatNode:return"Chat Node";case t.DeviceRole.Repeater:return"Repeater";case t.DeviceRole.RoomServer:return"Room Server";case t.DeviceRole.Sensor:return"Sensor";default:return`Unknown (${e})`}}function r(e){switch(e){case t.RequestType.GetStats:return"Get Stats";case t.RequestType.Keepalive:return"Keepalive (deprecated)";case t.RequestType.GetTelemetryData:return"Get Telemetry Data";case t.RequestType.GetMinMaxAvgData:return"Get Min/Max/Avg Data";case t.RequestType.GetAccessList:return"Get Access List";default:return`Unknown (${e})`}}function a(e){switch(e){case t.ControlSubType.NodeDiscoverReq:return"Node Discover Request";case t.ControlSubType.NodeDiscoverResp:return"Node Discover Response";default:return`Unknown (0x${e.toString(16)})`}}return ke}var Ue={},Ge={},Pt;function xt(){if(Pt)return Ge;Pt=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.ChannelCrypto=void 0;const t=tr(),o=oe();class c{static decryptGroupTextMessage(n,r,a){try{const e=(0,o.hexToBytes)(a),A=(0,o.hexToBytes)(r)Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:e+A,endByte:e+n.length-1,value:f});const y={type:t.PayloadType.Request,version:t.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:t.RequestType.GetStats,requestData:"",destinationHash:s,sourceHash:i,cipherMac:u,ciphertext:f};return r!=null&&r.includeSegments&&(y.segments=a),y}catch(a){return{type:t.PayloadType.Request,version:t.PayloadVersion.Version1,isValid:!1,errors:[a instanceof Error?a.message:"Failed to decode request payload"],timestamp:0,requestType:t.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Le.RequestPayloadDecoder=c,Le}var je={},Ft;function Br(){if(Ft)return je;Ft=1,Object.defineProperty(je,"__esModule",{value:!0}),je.ResponsePayloadDecoder=void 0;const t=ve(),o=oe();class c{static decode(n,r){try{if(n.length<4){const b={type:t.PayloadType.Response,version:t.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return r!=null&&r.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:r.segmentOffset||0,endByte:(r.segmentOffset||0)+n.length-1,value:(0,o.bytesToHex)(n)}]),b}const a=[],e=(r==null?void 0:r.segmentOffset)||0;let A=0;const s=(0,o.byteToHex)(n[A]);r!=null&&r.includeSegments&&a.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:e+A,endByte:e+A,value:s}),A+=1;const i=(0,o.byteToHex)(n[A]);r!=null&&r.includeSegments&&a.push({name:"Source Hash",description:"First byte of source node public key",startByte:e+A,endByte:e+A,value:i}),A+=1;const u=(0,o.bytesToHex)(n.subarray(A,A+2));r!=null&&r.includeSegments&&a.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:e+A,endByte:e+A+1,value:u}),A+=2;const f=(0,o.bytesToHex)(n.subarray(A));r!=null&&r.includeSegments&&n.length>A&&a.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:e+A,endByte:e+n.length-1,value:f});const y={type:t.PayloadType.Response,version:t.PayloadVersion.Version1,isValid:!0,destinationHash:s,sourceHash:i,cipherMac:u,ciphertext:f,ciphertextLength:n.length-4};return r!=null&&r.includeSegments&&(y.segments=a),y}catch(a){return{type:t.PayloadType.Response,version:t.PayloadVersion.Version1,isValid:!1,errors:[a instanceof Error?a.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return je.ResponsePayloadDecoder=c,je}var We={},Ut;function _r(){if(Ut)return We;Ut=1,Object.defineProperty(We,"__esModule",{value:!0}),We.AnonRequestPayloadDecoder=void 0;const t=ve(),o=oe();class c{static decode(n,r){try{if(n.length<35){const b={type:t.PayloadType.AnonRequest,version:t.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return r!=null&&r.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:r.segmentOffset||0,endByte:(r.segmentOffset||0)+n.length-1,value:(0,o.bytesToHex)(n)}]),b}const a=[],e=(r==null?void 0:r.segmentOffset)||0;let A=0;const s=(0,o.byteToHex)(n[0]);r!=null&&r.includeSegments&&a.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${s}`,startByte:e+A,endByte:e+A,value:s}),A+=1;const i=(0,o.bytesToHex)(n.subarray(1,33));r!=null&&r.includeSegments&&a.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:e+A,endByte:e+A+31,value:i}),A+=32;const u=(0,o.bytesToHex)(n.subarray(33,35));r!=null&&r.includeSegments&&a.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:e+A,endByte:e+A+1,value:u}),A+=2;const f=(0,o.bytesToHex)(n.subarray(35));r!=null&&r.includeSegments&&n.length>35&&a.push({name:"Ciphertext",description:`Encrypted message data (${n.length-35} bytes). Contains encrypted plaintext with this structure:
@@ -709,4 +709,4 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
`),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(e=>(this.enabled=!0,e)).catch(e=>{throw this.enabled=!1,e})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):c()?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 mt=n,mt}var Kr=Zr();const Xr=nt(Kr);function Jr({packets:t,channels:o,onChannelCreate:c,onRunningChange:l,visible:n=!1}){const[r,a]=H.useState(!1),[e,A]=H.useState(6),[s,i]=H.useState(!1),[u,f]=H.useState(!0),[y,b]=H.useState(!1),[S,h]=H.useState(!1),[d,x]=H.useState(null),[g,w]=H.useState(new Map),[m,E]=H.useState([]),[T,C]=H.useState(!1),[I,F]=H.useState(null),[ce,D]=H.useState(null),[$,J]=H.useState(0),ae=H.useRef(null),le=H.useRef(null),Q=H.useRef(!1),he=H.useRef(!1),L=H.useRef(!1),Z=H.useRef(new Map),ye=H.useRef(!1),Be=H.useRef(6),Te=H.useRef(!0),v=H.useRef(!1),ee=H.useRef(!1),ge=H.useRef(new Set),R=H.useRef(new Set),P=H.useRef(new Set);H.useEffect(()=>{const _=new jr;ae.current=_,F(_.isGpuAvailable());const V=new Xr;return le.current=V,()=>{_.destroy(),ae.current=null,V.disable(),le.current=null}},[]),H.useEffect(()=>{!n||T||fr(async()=>{const{ENGLISH_WORDLIST:_}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:_}},[]).then(({ENGLISH_WORDLIST:_})=>{ae.current&&(ae.current.setWordlist(_),C(!0))}).catch(_=>{console.error("Failed to load wordlist:",_),dt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[n,T]),H.useEffect(()=>{const _=()=>{Ct.getUndecryptedPacketCount().then(({count:U})=>D(U)).catch(()=>D(null))};_();const V=setInterval(_,36e5);return()=>clearInterval(V)},[]);const O=H.useMemo(()=>new Set(o.map(_=>_.key.toUpperCase())),[o]);H.useEffect(()=>{P.current=O},[O]);const G=t.filter(_=>_.payload_type==="GROUP_TEXT"&&!_.decrypted);H.useEffect(()=>{let _=0;w(V=>{const U=new Map(V);let me=!1;for(const de of G)if(!U.has(de.id)){const se=gr(de.data);if(se&&R.current.has(se)){_++;continue}se&&R.current.add(se),U.set(de.id,{packet:de,attempts:0,lastAttemptLength:0,status:"pending"}),me=!0}return me?(Z.current=U,U):V}),_>0&&J(V=>V+_)},[G.length]),H.useEffect(()=>{Z.current=g},[g]),H.useEffect(()=>{ye.current=s},[s]),H.useEffect(()=>{Be.current=e},[e]),H.useEffect(()=>{Te.current=u},[u]),H.useEffect(()=>{v.current=y},[y]),H.useEffect(()=>{ee.current=S},[S]),H.useEffect(()=>{ge.current=new Set(G.map(_=>_.id))},[G]),H.useEffect(()=>{l==null||l(r)},[r,l]);const re=Array.from(g.values()).filter(_=>_.status==="pending").length,X=Array.from(g.values()).filter(_=>_.status==="cracked").length,pe=Array.from(g.values()).filter(_=>_.status==="failed").length,ue=H.useCallback(async()=>{if(L.current||!ae.current||!Q.current)return;const _=Z.current;let V=null,U=null;for(const[Y,j]of _.entries())if(j.status==="pending"){V=j,U=Y;break}if(!V&&ye.current){const Y=Array.from(_.entries()).filter(([,j])=>j.status==="failed"&&j.lastAttemptLength<10);Y.length>0&&(Y.sort((j,ne)=>j[1].lastAttemptLength-ne[1].lastAttemptLength),[U,V]=Y[0])}if(!V||U===null){Q.current&&setTimeout(()=>ue(),1e3);return}if(!ge.current.has(U)){w(Y=>{const j=new Map(Y);return j.delete(U),j}),Q.current&&setTimeout(()=>ue(),10);return}L.current=!0;const me=Be.current,de=V.lastAttemptLength>0,se=de?V.lastAttemptLength+1:me;try{const Y=await ae.current.crack(V.packet.data,{maxLength:se,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,useTwoWordCombinations:ee.current,...v.current&&{gpuDispatchMs:1e4},...de&&{useDictionary:!1,useTwoWordCombinations:!1,startingLength:se}},j=>{x(j)});if(he.current){he.current=!1,L.current=!1,x(null);return}if(Y.found&&Y.roomName&&Y.key){w(q=>{const we=new Map(q),Ce=we.get(U);return Ce&&we.set(U,{...Ce,status:"cracked",attempts:Ce.attempts+1,lastAttemptLength:se}),we});const j={roomName:Y.roomName,key:Y.key,packetId:U,message:Y.decryptedMessage||"",crackedAt:Date.now()};E(q=>[...q,j]);const ne=Y.key.toUpperCase();if(!P.current.has(ne))try{const q="#"+Y.roomName;await c(q,Y.key),Te.current&&await Ct.decryptHistoricalPackets({key_type:"channel",channel_name:q})}catch(q){console.error("Failed to create channel or decrypt historical:",q),dt.error("Failed to save cracked channel",{description:q instanceof Error?q.message:"Channel discovered but could not be saved"})}}else w(j=>{const ne=new Map(j),q=ne.get(U);return q&&ne.set(U,{...q,status:"failed",attempts:q.attempts+1,lastAttemptLength:se}),ne})}catch(Y){console.error("Cracking error:",Y),w(j=>{const ne=new Map(j),q=ne.get(U);return q&&ne.set(U,{...q,status:"failed",attempts:q.attempts+1,lastAttemptLength:se}),ne})}L.current=!1,x(null),Q.current&&setTimeout(()=>ue(),100)},[c]),Ae=()=>{var _;if(!I){dt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}a(!0),Q.current=!0,he.current=!1,(_=le.current)==null||_.enable(),ue()},fe=()=>{var _,V;a(!1),Q.current=!1,he.current=!0,(_=ae.current)==null||_.abort(),(V=le.current)==null||V.disable()};return M.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border overflow-auto",children:[M.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[M.jsxs("d Line truncated
//# sourceMappingURL=CrackerPanel-D45MeFE8.js.map
//# sourceMappingURL=CrackerPanel-CQP9hluh.js.map
@@ -1 +1 @@
{"version":3,"mappings":"mNAEA,OAAO,eAAeA,GAAS,aAAc,CAAE,MAAO,GAAM,EAC5DA,GAAA,YAAsBA,GAAA,YAAsBA,GAAA,WAAqBA,GAAA,eAAyBA,GAAA,eAAyBA,GAAA,YAAsBA,GAAA,UAAoB,OAC7J,IAAIC,GACH,SAAUA,EAAW,CAClBA,EAAUA,EAAU,eAAoB,CAAC,EAAI,iBAC7CA,EAAUA,EAAU,MAAW,CAAC,EAAI,QACpCA,EAAUA,EAAU,OAAY,CAAC,EAAI,SACrCA,EAAUA,EAAU,gBAAqB,CAAC,EAAI,iBAClD,GAAGA,IAAcD,GAAA,UAAoBC,EAAY,GAAG,EACpD,IAAIC,GACH,SAAUA,EAAa,CACpBA,EAAYA,EAAY,QAAa,CAAC,EAAI,UAC1CA,EAAYA,EAAY,SAAc,CAAC,EAAI,WAC3CA,EAAYA,EAAY,YAAiB,CAAC,EAAI,cAC9CA,EAAYA,EAAY,IAAS,CAAC,EAAI,MACtCA,EAAYA,EAAY,OAAY,CAAC,EAAI,SACzCA,EAAYA,EAAY,UAAe,CAAC,EAAI,YAC5CA,EAAYA,EAAY,UAAe,CAAC,EAAI,YAC5CA,EAAYA,EAAY,YAAiB,C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AAyB,EAG7D,MAAMI,EAAWZ,EAAY,IALine truncated
@@ -1,2 +1,2 @@
import{r as d,D as j,j as e,U as y,m as N}from"./index-Fnq3QmNw.js";import{M as w,T as _}from"./leaflet-ENrCR1B4.js";import{C as k,P as C}from"./Popup-C-Q9ygBf.js";import{u as M}from"./hooks-LL30L9PN.js";const i={recent:"#06b6d4",today:"#2563eb",stale:"#f59e0b",old:"#64748b"},R="#0f172a",p="#f8fafc";function E(a){if(a==null)return i.old;const r=Date.now()/1e3-a,n=3600,l=86400;return r<n?i.recent:r<l?i.today:r<3*l?i.stale:i.old}function v({contacts:a,focusedContact:t}){const r=M(),[n,l]=d.useState(!1);return d.useEffect(()=>{if(t&&t.lat!=null&&t.lon!=null){r.setView([t.lat,t.lon],12),l(!0);return}if(n)return;const c=()=>{if(a.length===0){r.setView([20,0],2),l(!0);return}if(a.length===1){r.setView([a[0].lat,a[0].lon],10),l(!0);return}const u=a.map(m=>[m.lat,m.lon]);r.fitBounds(u,{padding:[50,50],maxZoom:12}),l(!0)};"geolocation"in navigator?navigator.geolocation.getCurrentPosition(u=>{r.setView([u.coords.latitude,u.coords.longitude],8),l(!0)},()=>{c()},{timeout:5e3,maximumAge:3e5}):c()},[r,a,n,t]),null}function V({contacts:a,focusedKey:t}){const r=Date.now()/1e3-604800,n=d.useMemo(()=>a.filter(s=>j(s.lat,s.lon)&&(s.public_key===t||s.last_seen!=null&&s.last_seen>r)),[a,t,r]),l=d.useMemo(()=>t&&n.find(s=>s.public_key===t)||null,[t,n]),c=l!=null&&(l.last_seen==null||l.last_seen<=r),u=d.useRef({}),m=d.useCallback((s,o)=>{u.current[s]=o},[]);return d.useEffect(()=>{if(l&&u.current[l.public_key]){const s=setTimeout(()=>{var o;(o=u.current[l.public_key])==null||o.openPopup()},100);return()=>clearTimeout(s)}},[l]),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-4 py-2 bg-muted/50 text-xs text-muted-foreground flex items-center justify-between",children:[e.jsxs("span",{children:["Showing ",n.length," contact",n.length!==1?"s":""," heard in the last 7 days",c?" plus the focused contact":""]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.recent},"aria-hidden":"true"})," ","<1h"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.today},"aria-hidden":"true"})," ","<1d"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.stale},"aria-hidden":"true"})," ","<3d"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.old},"aria-hidden":"true"})," ","older"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full border-2",style:{borderColor:p,backgroundColor:i.today},"aria-hidden":"true"})," ","repeater"]})]})]}),e.jsx("div",{className:"flex-1 relative",style:{zIndex:0},role:"img","aria-label":"Map showing mesh node locations",children:e.jsxs(w,{center:[20,0],zoom:2,className:"h-full w-full",style:{background:"#1a1a2e"},children:[e.jsx(_,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),e.jsx(v,{contacts:n,focusedContact:l}),n.map(s=>{const o=s.type===y,x=E(s.last_seen),f=s.name||s.public_key.slice(0,12),h=s.last_seen!=null?N(s.last_seen):"Never heard by this server",g=o?10:7;return e.jsx(d.Fragment,{children:e.jsx(k,{ref:b=>m(s.public_key,b),center:[s.lat,s.lon],radius:g,pathOptions:{color:o?p:R,fillColor:x,fillOpacity:.9,weight:o?3:2},children:e.jsx(C,{children:e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"font-medium flex items-center gap-1",children:[o&&e.jsx("span",{title:"Repeater","aria-hidden":"true",children:"🛜"}),f]}),e.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last heard: ",h]}),e.jsxs("div",{className:"text-xs text-gray-400 mt-1 font-mono",children:[s.lat.toFixed(5),", ",s.lon.toFixed(5)]})]})})},s.public_key)},s.public_key)})]})})]})}export{V as MapView};
//# sourceMappingURL=MapView-D0gphXtL.js.map
import{r as d,D as j,j as e,U as y,m as N}from"./index-CyRLXsJ_.js";import{M as w,T as _}from"./leaflet-IXizDMbG.js";import{C as k,P as C}from"./Popup-A7yuH1dp.js";import{u as M}from"./hooks-BwtZ3ZXP.js";const i={recent:"#06b6d4",today:"#2563eb",stale:"#f59e0b",old:"#64748b"},R="#0f172a",p="#f8fafc";function E(a){if(a==null)return i.old;const r=Date.now()/1e3-a,n=3600,l=86400;return r<n?i.recent:r<l?i.today:r<3*l?i.stale:i.old}function v({contacts:a,focusedContact:t}){const r=M(),[n,l]=d.useState(!1);return d.useEffect(()=>{if(t&&t.lat!=null&&t.lon!=null){r.setView([t.lat,t.lon],12),l(!0);return}if(n)return;const c=()=>{if(a.length===0){r.setView([20,0],2),l(!0);return}if(a.length===1){r.setView([a[0].lat,a[0].lon],10),l(!0);return}const u=a.map(m=>[m.lat,m.lon]);r.fitBounds(u,{padding:[50,50],maxZoom:12}),l(!0)};"geolocation"in navigator?navigator.geolocation.getCurrentPosition(u=>{r.setView([u.coords.latitude,u.coords.longitude],8),l(!0)},()=>{c()},{timeout:5e3,maximumAge:3e5}):c()},[r,a,n,t]),null}function V({contacts:a,focusedKey:t}){const r=Date.now()/1e3-604800,n=d.useMemo(()=>a.filter(s=>j(s.lat,s.lon)&&(s.public_key===t||s.last_seen!=null&&s.last_seen>r)),[a,t,r]),l=d.useMemo(()=>t&&n.find(s=>s.public_key===t)||null,[t,n]),c=l!=null&&(l.last_seen==null||l.last_seen<=r),u=d.useRef({}),m=d.useCallback((s,o)=>{u.current[s]=o},[]);return d.useEffect(()=>{if(l&&u.current[l.public_key]){const s=setTimeout(()=>{var o;(o=u.current[l.public_key])==null||o.openPopup()},100);return()=>clearTimeout(s)}},[l]),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-4 py-2 bg-muted/50 text-xs text-muted-foreground flex items-center justify-between",children:[e.jsxs("span",{children:["Showing ",n.length," contact",n.length!==1?"s":""," heard in the last 7 days",c?" plus the focused contact":""]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.recent},"aria-hidden":"true"})," ","<1h"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.today},"aria-hidden":"true"})," ","<1d"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.stale},"aria-hidden":"true"})," ","<3d"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i.old},"aria-hidden":"true"})," ","older"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded-full border-2",style:{borderColor:p,backgroundColor:i.today},"aria-hidden":"true"})," ","repeater"]})]})]}),e.jsx("div",{className:"flex-1 relative",style:{zIndex:0},role:"img","aria-label":"Map showing mesh node locations",children:e.jsxs(w,{center:[20,0],zoom:2,className:"h-full w-full",style:{background:"#1a1a2e"},children:[e.jsx(_,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),e.jsx(v,{contacts:n,focusedContact:l}),n.map(s=>{const o=s.type===y,x=E(s.last_seen),f=s.name||s.public_key.slice(0,12),h=s.last_seen!=null?N(s.last_seen):"Never heard by this server",g=o?10:7;return e.jsx(d.Fragment,{children:e.jsx(k,{ref:b=>m(s.public_key,b),center:[s.lat,s.lon],radius:g,pathOptions:{color:o?p:R,fillColor:x,fillOpacity:.9,weight:o?3:2},children:e.jsx(C,{children:e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"font-medium flex items-center gap-1",children:[o&&e.jsx("span",{title:"Repeater","aria-hidden":"true",children:"🛜"}),f]}),e.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last heard: ",h]}),e.jsxs("div",{className:"text-xs text-gray-400 mt-1 font-mono",children:[s.lat.toFixed(5),", ",s.lon.toFixed(5)]})]})})},s.public_key)},s.public_key)})]})})]})}export{V as MapView};
//# sourceMappingURL=MapView-ClQphI6P.js.map
@@ -1 +1 @@
{"version":3,"file":"MapView-D0gphXtL.js","sources":["../../src/components/MapView.tsx"],"sourcesContent":["import { Fragment, useEffect, useState, useMemo, useRef, useCallback } from 'react';\nimport { MapContainer, TileLayer, CircleMarker, Popup, useMap } from 'react-leaflet';\nimport type { LatLngBoundsExpression, CircleMarker as LeafletCircleMarker } from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\nimport type { Contact } from '../types';\nimport { formatTime } from '../utils/messageParser';\nimport { isValidLocation } from '../utils/pathUtils';\nimport { CONTACT_TYPE_REPEATER } from '../types';\n\ninterface MapViewProps {\n contacts: Contact[];\n /** Public key of contact to focus on and open popup */\n focusedKey?: string | null;\n}\n\nconst MAP_RECENCY_COLORS = {\n recent: '#06b6d4',\n today: '#2563eb',\n stale: '#f59e0b',\n old: '#64748b',\n} as const;\nconst MAP_MARKER_STROKE = '#0f172a';\nconst MAP_REPEATER_RING = '#f8fafc';\n\n// Calculate marker color based on how recently the contact was heard\nfunction getMarkerColor(lastSeen: number | null | undefined): string {\n if (lastSeen == null) return MAP_RECENCY_COLORS.old;\n const now = Date.now() / 1000;\n const age = now - lastSeen;\n const hour = 3600;\n const day = 86400;\n\n if (age < hour) return MAP_RECENCY_COLORS.recent;\n if (age < day) return MAP_RECENCY_COLORS.today;\n if (age < 3 * day) return MAP_RECENCY_COLORS.stale;\n return MAP_RECENCY_COLORS.old;\n}\n\n// Component to handle map bounds fitting\nfunction MapBoundsHandler({\n contacts,\n focusedContact,\n}: {\n contacts: Contact[];\n focusedContact: Contact | null;\n}) {\n const map = useMap();\n const [hasInitialized, setHasInitialized] = useState(false);\n\n useEffect(() => {\n // If we have a focused contact, center on it immediately (even if already initialized)\n if (focusedContact && focusedContact.lat != null && focusedContact.lon != null) {\n map.setView([focusedContact.lat, focusedContact.lon], 12);\n setHasInitialized(true);\n return;\n }\n\n if (hasInitialized) return;\n\n const fitToContacts = () => {\n if (contacts.length === 0) {\n // No contacts with location - show world view\n map.setView([20, 0], 2);\n setHasInitialized(true);\n return;\n }\n\n if (contacts.length === 1) {\n // Single contact - center on it\n map.setView([contacts[0].lat!, contacts[0].lon!], 10);\n setHasInitialized(true);\n return;\n }\n\n // Multiple contacts - fit bounds\n const bounds: LatLngBoundsExpression = contacts.map(\n (c) => [c.lat!, c.lon!] as [number, number]\n );\n map.fitBounds(bounds, { padding: [50, 50], maxZoom: 12 });\n setHasInitialized(true);\n };\n\n // Try geolocation first\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n // Success - center on user location with reasonable zoom\n map.setView([position.coords.latitude, position.coords.longitude], 8);\n setHasInitialized(true);\n },\n () => {\n // Geolocation denied/failed - fit to contacts\n fitToContacts();\n },\n { timeout: 5000, maximumAge: 300000 }\n );\n } else {\n // No geolocation support - fit to contacts\n fitToContacts();\n }\n }, [map, contacts, hasInitialized, focusedContact]);\n\n return null;\n}\n\nexport function MapView({ contacts, focusedKey }: MapViewProps) {\n const sevenDaysAgo = Date.now() / 1000 - 7 * 24 * 60 * 60;\n\n // Filter to contacts with GPS coordinates, heard within the last 7 days.\n // Always include the focused contact so \"view on map\" links work for older nodes.\n const mappableContacts = useMemo(() => {\n return contacts.filter(\n (c) =>\n isValidLocation(c.lat, c.lon) &&\n (c.public_key === focusedKey || (c.last_seen != null && c.last_seen > sevenDaysAgo))\n );\n }, [contacts, focusedKey, sevenDaysAgo]);\n\n // Find the focused contact by key\n const focusedContact = useMemo(() => {\n if (!focusedKey) return null;\n return mappableContacts.find((c) => c.public_key === focusedKey) || null;\n }, [focusedKey, mappableContacts]);\n\n const includesFocusedOutsideWindow =\n focusedContact != null &&\n (focusedContact.last_seen == null || focusedContact.last_seen <= sevenDaysAgo);\n\n // Track marker refs to open popup programmatically\n const markerRefs = useRef<Record<string, LeafletCircleMarker | null>>({});\n\n // Store ref for a marker\n const setMarkerRef = useCallback((key: string, ref: LeafletCircleMarker | null) => {\n markerRefs.current[key] = ref;\n }, []);\n\n // Open popup for focused contact after map is ready\n useEffect(() => {\n if (focusedContact && markerRefs.current[focusedContact.public_key]) {\n // Small delay to ensure map has finished rendering\n const timer = setTimeout(() =>Line truncated
{"version":3,"file":"MapView-ClQphI6P.js","sources":["../../src/components/MapView.tsx"],"sourcesContent":["import { Fragment, useEffect, useState, useMemo, useRef, useCallback } from 'react';\nimport { MapContainer, TileLayer, CircleMarker, Popup, useMap } from 'react-leaflet';\nimport type { LatLngBoundsExpression, CircleMarker as LeafletCircleMarker } from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\nimport type { Contact } from '../types';\nimport { formatTime } from '../utils/messageParser';\nimport { isValidLocation } from '../utils/pathUtils';\nimport { CONTACT_TYPE_REPEATER } from '../types';\n\ninterface MapViewProps {\n contacts: Contact[];\n /** Public key of contact to focus on and open popup */\n focusedKey?: string | null;\n}\n\nconst MAP_RECENCY_COLORS = {\n recent: '#06b6d4',\n today: '#2563eb',\n stale: '#f59e0b',\n old: '#64748b',\n} as const;\nconst MAP_MARKER_STROKE = '#0f172a';\nconst MAP_REPEATER_RING = '#f8fafc';\n\n// Calculate marker color based on how recently the contact was heard\nfunction getMarkerColor(lastSeen: number | null | undefined): string {\n if (lastSeen == null) return MAP_RECENCY_COLORS.old;\n const now = Date.now() / 1000;\n const age = now - lastSeen;\n const hour = 3600;\n const day = 86400;\n\n if (age < hour) return MAP_RECENCY_COLORS.recent;\n if (age < day) return MAP_RECENCY_COLORS.today;\n if (age < 3 * day) return MAP_RECENCY_COLORS.stale;\n return MAP_RECENCY_COLORS.old;\n}\n\n// Component to handle map bounds fitting\nfunction MapBoundsHandler({\n contacts,\n focusedContact,\n}: {\n contacts: Contact[];\n focusedContact: Contact | null;\n}) {\n const map = useMap();\n const [hasInitialized, setHasInitialized] = useState(false);\n\n useEffect(() => {\n // If we have a focused contact, center on it immediately (even if already initialized)\n if (focusedContact && focusedContact.lat != null && focusedContact.lon != null) {\n map.setView([focusedContact.lat, focusedContact.lon], 12);\n setHasInitialized(true);\n return;\n }\n\n if (hasInitialized) return;\n\n const fitToContacts = () => {\n if (contacts.length === 0) {\n // No contacts with location - show world view\n map.setView([20, 0], 2);\n setHasInitialized(true);\n return;\n }\n\n if (contacts.length === 1) {\n // Single contact - center on it\n map.setView([contacts[0].lat!, contacts[0].lon!], 10);\n setHasInitialized(true);\n return;\n }\n\n // Multiple contacts - fit bounds\n const bounds: LatLngBoundsExpression = contacts.map(\n (c) => [c.lat!, c.lon!] as [number, number]\n );\n map.fitBounds(bounds, { padding: [50, 50], maxZoom: 12 });\n setHasInitialized(true);\n };\n\n // Try geolocation first\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n // Success - center on user location with reasonable zoom\n map.setView([position.coords.latitude, position.coords.longitude], 8);\n setHasInitialized(true);\n },\n () => {\n // Geolocation denied/failed - fit to contacts\n fitToContacts();\n },\n { timeout: 5000, maximumAge: 300000 }\n );\n } else {\n // No geolocation support - fit to contacts\n fitToContacts();\n }\n }, [map, contacts, hasInitialized, focusedContact]);\n\n return null;\n}\n\nexport function MapView({ contacts, focusedKey }: MapViewProps) {\n const sevenDaysAgo = Date.now() / 1000 - 7 * 24 * 60 * 60;\n\n // Filter to contacts with GPS coordinates, heard within the last 7 days.\n // Always include the focused contact so \"view on map\" links work for older nodes.\n const mappableContacts = useMemo(() => {\n return contacts.filter(\n (c) =>\n isValidLocation(c.lat, c.lon) &&\n (c.public_key === focusedKey || (c.last_seen != null && c.last_seen > sevenDaysAgo))\n );\n }, [contacts, focusedKey, sevenDaysAgo]);\n\n // Find the focused contact by key\n const focusedContact = useMemo(() => {\n if (!focusedKey) return null;\n return mappableContacts.find((c) => c.public_key === focusedKey) || null;\n }, [focusedKey, mappableContacts]);\n\n const includesFocusedOutsideWindow =\n focusedContact != null &&\n (focusedContact.last_seen == null || focusedContact.last_seen <= sevenDaysAgo);\n\n // Track marker refs to open popup programmatically\n const markerRefs = useRef<Record<string, LeafletCircleMarker | null>>({});\n\n // Store ref for a marker\n const setMarkerRef = useCallback((key: string, ref: LeafletCircleMarker | null) => {\n markerRefs.current[key] = ref;\n }, []);\n\n // Open popup for focused contact after map is ready\n useEffect(() => {\n if (focusedContact && markerRefs.current[focusedContact.public_key]) {\n // Small delay to ensure map has finished rendering\n const timer = setTimeout(() =>Line truncated
@@ -1,2 +1,2 @@
import{j as l}from"./index-Fnq3QmNw.js";import{d as m,l as u,a as f,e as d,M as x,T as y}from"./leaflet-ENrCR1B4.js";import{C as p,P as c}from"./Popup-C-Q9ygBf.js";const g=m(function({positions:n,...t},o){const s=new u.Polyline(n,t);return f(s,d(o,{overlayContainer:s}))},function(n,t,o){t.positions!==o.positions&&n.setLatLngs(t.positions)});function C({neighbors:i,radioLat:n,radioLon:t,radioName:o}){const s=i.filter(e=>e.lat!=null&&e.lon!=null),r=n!=null&&t!=null&&!(n===0&&t===0);if(s.length===0&&!r)return null;const h=r?[n,t]:[s[0].lat,s[0].lon];return l.jsx("div",{className:"min-h-48 flex-1 rounded border border-border overflow-hidden",role:"img","aria-label":"Map showing repeater neighbor locations",children:l.jsxs(x,{center:h,zoom:10,className:"h-full w-full",style:{background:"#1a1a2e"},children:[l.jsx(y,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),r&&s.map((e,a)=>l.jsx(g,{positions:[[n,t],[e.lat,e.lon]],pathOptions:{color:"#3b82f6",weight:1.5,opacity:.5,dashArray:"6 4"}},`line-${a}`)),r&&l.jsx(p,{center:[n,t],radius:8,pathOptions:{color:"#1d4ed8",fillColor:"#3b82f6",fillOpacity:1,weight:2},children:l.jsx(c,{children:l.jsx("span",{className:"text-sm font-medium",children:o||"Our Radio"})})}),s.map((e,a)=>l.jsx(p,{center:[e.lat,e.lon],radius:6,pathOptions:{color:"#000",fillColor:e.snr>=6?"#22c55e":e.snr>=0?"#eab308":"#ef4444",fillOpacity:.8,weight:1},children:l.jsx(c,{children:l.jsx("span",{className:"text-sm",children:e.name||e.pubkey_prefix})})},a))]})})}export{C as NeighborsMiniMap};
//# sourceMappingURL=NeighborsMiniMap-zqanKONo.js.map
import{j as l}from"./index-CyRLXsJ_.js";import{d as m,l as u,a as f,e as d,M as x,T as y}from"./leaflet-IXizDMbG.js";import{C as p,P as c}from"./Popup-A7yuH1dp.js";const g=m(function({positions:n,...t},o){const s=new u.Polyline(n,t);return f(s,d(o,{overlayContainer:s}))},function(n,t,o){t.positions!==o.positions&&n.setLatLngs(t.positions)});function C({neighbors:i,radioLat:n,radioLon:t,radioName:o}){const s=i.filter(e=>e.lat!=null&&e.lon!=null),r=n!=null&&t!=null&&!(n===0&&t===0);if(s.length===0&&!r)return null;const h=r?[n,t]:[s[0].lat,s[0].lon];return l.jsx("div",{className:"min-h-48 flex-1 rounded border border-border overflow-hidden",role:"img","aria-label":"Map showing repeater neighbor locations",children:l.jsxs(x,{center:h,zoom:10,className:"h-full w-full",style:{background:"#1a1a2e"},children:[l.jsx(y,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),r&&s.map((e,a)=>l.jsx(g,{positions:[[n,t],[e.lat,e.lon]],pathOptions:{color:"#3b82f6",weight:1.5,opacity:.5,dashArray:"6 4"}},`line-${a}`)),r&&l.jsx(p,{center:[n,t],radius:8,pathOptions:{color:"#1d4ed8",fillColor:"#3b82f6",fillOpacity:1,weight:2},children:l.jsx(c,{children:l.jsx("span",{className:"text-sm font-medium",children:o||"Our Radio"})})}),s.map((e,a)=>l.jsx(p,{center:[e.lat,e.lon],radius:6,pathOptions:{color:"#000",fillColor:e.snr>=6?"#22c55e":e.snr>=0?"#eab308":"#ef4444",fillOpacity:.8,weight:1},children:l.jsx(c,{children:l.jsx("span",{className:"text-sm",children:e.name||e.pubkey_prefix})})},a))]})})}export{C as NeighborsMiniMap};
//# sourceMappingURL=NeighborsMiniMap-Bi17OsoB.js.map
@@ -1 +1 @@
{"version":3,"file":"NeighborsMiniMap-zqanKONo.js","sources":["../../node_modules/react-leaflet/lib/Polyline.js","../../src/components/NeighborsMiniMap.tsx"],"sourcesContent":["import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core';\nimport { Polyline as LeafletPolyline } from 'leaflet';\nexport const Polyline = createPathComponent(function createPolyline({ positions , ...options }, ctx) {\n const polyline = new LeafletPolyline(positions, options);\n return createElementObject(polyline, extendContext(ctx, {\n overlayContainer: polyline\n }));\n}, function updatePolyline(layer, props, prevProps) {\n if (props.positions !== prevProps.positions) {\n layer.setLatLngs(props.positions);\n }\n});\n","import { MapContainer, TileLayer, CircleMarker, Popup, Polyline } from 'react-leaflet';\nimport 'leaflet/dist/leaflet.css';\n\ninterface Neighbor {\n lat: number | null;\n lon: number | null;\n name: string | null;\n pubkey_prefix: string;\n snr: number;\n}\n\ninterface Props {\n neighbors: Neighbor[];\n radioLat?: number | null;\n radioLon?: number | null;\n radioName?: string | null;\n}\n\nexport function NeighborsMiniMap({ neighbors, radioLat, radioLon, radioName }: Props) {\n const valid = neighbors.filter(\n (n): n is Neighbor & { lat: number; lon: number } => n.lat != null && n.lon != null\n );\n\n const hasRadio = radioLat != null && radioLon != null && !(radioLat === 0 && radioLon === 0);\n\n if (valid.length === 0 && !hasRadio) return null;\n\n // Center on radio if available, otherwise first neighbor\n const center: [number, number] = hasRadio ? [radioLat!, radioLon!] : [valid[0].lat, valid[0].lon];\n\n return (\n <div\n className=\"min-h-48 flex-1 rounded border border-border overflow-hidden\"\n role=\"img\"\n aria-label=\"Map showing repeater neighbor locations\"\n >\n <MapContainer\n center={center}\n zoom={10}\n className=\"h-full w-full\"\n style={{ background: '#1a1a2e' }}\n >\n <TileLayer\n attribution='&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n />\n {/* Dotted lines from radio to each neighbor */}\n {hasRadio &&\n valid.map((n, i) => (\n <Polyline\n key={`line-${i}`}\n positions={[\n [radioLat!, radioLon!],\n [n.lat, n.lon],\n ]}\n pathOptions={{\n color: '#3b82f6',\n weight: 1.5,\n opacity: 0.5,\n dashArray: '6 4',\n }}\n />\n ))}\n {/* Radio node (bright blue) */}\n {hasRadio && (\n <CircleMarker\n center={[radioLat!, radioLon!]}\n radius={8}\n pathOptions={{\n color: '#1d4ed8',\n fillColor: '#3b82f6',\n fillOpacity: 1,\n weight: 2,\n }}\n >\n <Popup>\n <span className=\"text-sm font-medium\">{radioName || 'Our Radio'}</span>\n </Popup>\n </CircleMarker>\n )}\n {/* Neighbor nodes (SNR-colored) */}\n {valid.map((n, i) => (\n <CircleMarker\n key={i}\n center={[n.lat, n.lon]}\n radius={6}\n pathOptions={{\n color: '#000',\n fillColor: n.snr >= 6 ? '#22c55e' : n.snr >= 0 ? '#eab308' : '#ef4444',\n fillOpacity: 0.8,\n weight: 1,\n }}\n >\n <Popup>\n <span className=\"text-sm\">{n.name || n.pubkey_prefix}</span>\n </Popup>\n </CircleMarker>\n ))}\n </MapContainer>\n </div>\n );\n}\n"],"names":["Polyline","createPathComponent","positions","options","ctx","polyline","LeafletPolyline","createElementObject","extendContext","layer","props","prevProps","NeighborsMiniMap","neighbors","radioLat","radioLon","radioName","valid","n","hasRadio","center","jsx","jsxs","MapContainer","TileLayer","i","CircleMarker","Popup"],"mappings":"oKAEO,MAAMA,EAAWC,EAAoB,SAAwB,CAAE,UAAAC,EAAY,GAAGC,CAAO,EAAIC,EAAK,CACjG,MAAMC,EAAW,IAAIC,WAAgBJ,EAAWC,CAAO,EACvD,OAAOI,EAAoBF,EAAUG,EAAcJ,EAAK,CACpD,iBAAkBC,CAC1B,CAAK,CAAC,CACN,EAAG,SAAwBI,EAAOC,EAAOC,EAAW,CAC5CD,EAAM,YAAcC,EAAU,WAC9BF,EAAM,WAAWC,EAAM,SAAS,CAExC,CAAC,ECOM,SAASE,EAAiB,CAAE,UAAAC,EAAW,SAAAC,EAAU,SAAAC,EAAU,UAAAC,GAAoB,CACpF,MAAMC,EAAQJ,EAAU,OACrBK,GAAoDA,EAAE,KAAO,MAAQA,EAAE,KAAO,IAAA,EAG3EC,EAAWL,GAAY,MAAQC,GAAY,MAAQ,EAAED,IAAa,GAAKC,IAAa,GAE1F,GAAIE,EAAM,SAAW,GAAK,CAACE,EAAU,OAAO,KAG5C,MAAMC,EAA2BD,EAAW,CAACL,EAAWC,CAAS,EAAI,CAACE,EAAM,CAAC,EAAE,IAAKA,EAAM,CAAC,EAAE,GAAG,EAEhG,OACEI,EAAAA,IAAC,MAAA,CACC,UAAU,+DACV,KAAK,MACL,aAAW,0CAEX,SAAAC,EAAAA,KAACC,EAAA,CACC,OAAAH,EACA,KAAM,GACN,UAAU,gBACV,MAAO,CAAE,WAAY,SAAA,EAErB,SALine truncated
{"version":3,"file":"NeighborsMiniMap-Bi17OsoB.js","sources":["../../node_modules/react-leaflet/lib/Polyline.js","../../src/components/NeighborsMiniMap.tsx"],"sourcesContent":["import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core';\nimport { Polyline as LeafletPolyline } from 'leaflet';\nexport const Polyline = createPathComponent(function createPolyline({ positions , ...options }, ctx) {\n const polyline = new LeafletPolyline(positions, options);\n return createElementObject(polyline, extendContext(ctx, {\n overlayContainer: polyline\n }));\n}, function updatePolyline(layer, props, prevProps) {\n if (props.positions !== prevProps.positions) {\n layer.setLatLngs(props.positions);\n }\n});\n","import { MapContainer, TileLayer, CircleMarker, Popup, Polyline } from 'react-leaflet';\nimport 'leaflet/dist/leaflet.css';\n\ninterface Neighbor {\n lat: number | null;\n lon: number | null;\n name: string | null;\n pubkey_prefix: string;\n snr: number;\n}\n\ninterface Props {\n neighbors: Neighbor[];\n radioLat?: number | null;\n radioLon?: number | null;\n radioName?: string | null;\n}\n\nexport function NeighborsMiniMap({ neighbors, radioLat, radioLon, radioName }: Props) {\n const valid = neighbors.filter(\n (n): n is Neighbor & { lat: number; lon: number } => n.lat != null && n.lon != null\n );\n\n const hasRadio = radioLat != null && radioLon != null && !(radioLat === 0 && radioLon === 0);\n\n if (valid.length === 0 && !hasRadio) return null;\n\n // Center on radio if available, otherwise first neighbor\n const center: [number, number] = hasRadio ? [radioLat!, radioLon!] : [valid[0].lat, valid[0].lon];\n\n return (\n <div\n className=\"min-h-48 flex-1 rounded border border-border overflow-hidden\"\n role=\"img\"\n aria-label=\"Map showing repeater neighbor locations\"\n >\n <MapContainer\n center={center}\n zoom={10}\n className=\"h-full w-full\"\n style={{ background: '#1a1a2e' }}\n >\n <TileLayer\n attribution='&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n />\n {/* Dotted lines from radio to each neighbor */}\n {hasRadio &&\n valid.map((n, i) => (\n <Polyline\n key={`line-${i}`}\n positions={[\n [radioLat!, radioLon!],\n [n.lat, n.lon],\n ]}\n pathOptions={{\n color: '#3b82f6',\n weight: 1.5,\n opacity: 0.5,\n dashArray: '6 4',\n }}\n />\n ))}\n {/* Radio node (bright blue) */}\n {hasRadio && (\n <CircleMarker\n center={[radioLat!, radioLon!]}\n radius={8}\n pathOptions={{\n color: '#1d4ed8',\n fillColor: '#3b82f6',\n fillOpacity: 1,\n weight: 2,\n }}\n >\n <Popup>\n <span className=\"text-sm font-medium\">{radioName || 'Our Radio'}</span>\n </Popup>\n </CircleMarker>\n )}\n {/* Neighbor nodes (SNR-colored) */}\n {valid.map((n, i) => (\n <CircleMarker\n key={i}\n center={[n.lat, n.lon]}\n radius={6}\n pathOptions={{\n color: '#000',\n fillColor: n.snr >= 6 ? '#22c55e' : n.snr >= 0 ? '#eab308' : '#ef4444',\n fillOpacity: 0.8,\n weight: 1,\n }}\n >\n <Popup>\n <span className=\"text-sm\">{n.name || n.pubkey_prefix}</span>\n </Popup>\n </CircleMarker>\n ))}\n </MapContainer>\n </div>\n );\n}\n"],"names":["Polyline","createPathComponent","positions","options","ctx","polyline","LeafletPolyline","createElementObject","extendContext","layer","props","prevProps","NeighborsMiniMap","neighbors","radioLat","radioLon","radioName","valid","n","hasRadio","center","jsx","jsxs","MapContainer","TileLayer","i","CircleMarker","Popup"],"mappings":"oKAEO,MAAMA,EAAWC,EAAoB,SAAwB,CAAE,UAAAC,EAAY,GAAGC,CAAO,EAAIC,EAAK,CACjG,MAAMC,EAAW,IAAIC,WAAgBJ,EAAWC,CAAO,EACvD,OAAOI,EAAoBF,EAAUG,EAAcJ,EAAK,CACpD,iBAAkBC,CAC1B,CAAK,CAAC,CACN,EAAG,SAAwBI,EAAOC,EAAOC,EAAW,CAC5CD,EAAM,YAAcC,EAAU,WAC9BF,EAAM,WAAWC,EAAM,SAAS,CAExC,CAAC,ECOM,SAASE,EAAiB,CAAE,UAAAC,EAAW,SAAAC,EAAU,SAAAC,EAAU,UAAAC,GAAoB,CACpF,MAAMC,EAAQJ,EAAU,OACrBK,GAAoDA,EAAE,KAAO,MAAQA,EAAE,KAAO,IAAA,EAG3EC,EAAWL,GAAY,MAAQC,GAAY,MAAQ,EAAED,IAAa,GAAKC,IAAa,GAE1F,GAAIE,EAAM,SAAW,GAAK,CAACE,EAAU,OAAO,KAG5C,MAAMC,EAA2BD,EAAW,CAACL,EAAWC,CAAS,EAAI,CAACE,EAAM,CAAC,EAAE,IAAKA,EAAM,CAAC,EAAE,GAAG,EAEhG,OACEI,EAAAA,IAAC,MAAA,CACC,UAAU,+DACV,KAAK,MACL,aAAW,0CAEX,SAAAC,EAAAA,KAACC,EAAA,CACC,OAAAH,EACA,KAAM,GACN,UAAU,gBACV,MAAO,CAAE,WAAY,SAAA,EAErB,SALine truncated
@@ -1,4 +1,4 @@
import{r as x,D as l,j as i}from"./index-Fnq3QmNw.js";import{c as O,l as b,a as y,e as w,b as C,M as L,T as M,L as R}from"./leaflet-ENrCR1B4.js";import{u as T}from"./hooks-LL30L9PN.js";const h=O(function({position:n,...t},o){const r=new b.Marker(n,t);return y(r,w(o,{overlayContainer:r}))},function(n,t,o){t.position!==o.position&&n.setLatLng(t.position),t.icon!=null&&t.icon!==o.icon&&n.setIcon(t.icon),t.zIndexOffset!=null&&t.zIndexOffset!==o.zIndexOffset&&n.setZIndexOffset(t.zIndexOffset),t.opacity!=null&&t.opacity!==o.opacity&&n.setOpacity(t.opacity),n.dragging!=null&&t.draggable!==o.draggable&&(t.draggable===!0?n.dragging.enable():n.dragging.disable())}),p=C(function(n,t){const o=new b.Tooltip(n,t.overlayContainer);return y(o,t)},function(n,t,{position:o},r){x.useEffect(function(){const s=t.overlayContainer;if(s==null)return;const{instance:u}=n,f=a=>{a.tooltip===u&&(o!=null&&u.setLatLng(o),u.update(),r(!0))},c=a=>{a.tooltip===u&&r(!1)};return s.on({tooltipopen:f,tooltipclose:c}),s.bindTooltip(u),function(){s.off({tooltipopen:f,tooltipclose:c}),s._map!=null&&s.unbindTooltip()}},[n,t,r,o])}),m=["#f97316","#eab308","#22c55e","#06b6d4","#ec4899","#f43f5e","#a855f7","#64748b"],E="#3b82f6",S="#8b5cf6";function g(e,n){return R.divIcon({className:"",iconSize:[24,24],iconAnchor:[12,12],html:`<div style="
import{r as x,D as l,j as i}from"./index-CyRLXsJ_.js";import{c as O,l as b,a as y,e as w,b as C,M as L,T as M,L as R}from"./leaflet-IXizDMbG.js";import{u as T}from"./hooks-BwtZ3ZXP.js";const h=O(function({position:n,...t},o){const r=new b.Marker(n,t);return y(r,w(o,{overlayContainer:r}))},function(n,t,o){t.position!==o.position&&n.setLatLng(t.position),t.icon!=null&&t.icon!==o.icon&&n.setIcon(t.icon),t.zIndexOffset!=null&&t.zIndexOffset!==o.zIndexOffset&&n.setZIndexOffset(t.zIndexOffset),t.opacity!=null&&t.opacity!==o.opacity&&n.setOpacity(t.opacity),n.dragging!=null&&t.draggable!==o.draggable&&(t.draggable===!0?n.dragging.enable():n.dragging.disable())}),p=C(function(n,t){const o=new b.Tooltip(n,t.overlayContainer);return y(o,t)},function(n,t,{position:o},r){x.useEffect(function(){const s=t.overlayContainer;if(s==null)return;const{instance:u}=n,f=a=>{a.tooltip===u&&(o!=null&&u.setLatLng(o),u.update(),r(!0))},c=a=>{a.tooltip===u&&r(!1)};return s.on({tooltipopen:f,tooltipclose:c}),s.bindTooltip(u),function(){s.off({tooltipopen:f,tooltipclose:c}),s._map!=null&&s.unbindTooltip()}},[n,t,r,o])}),m=["#f97316","#eab308","#22c55e","#06b6d4","#ec4899","#f43f5e","#a855f7","#64748b"],E="#3b82f6",S="#8b5cf6";function g(e,n){return R.divIcon({className:"",iconSize:[24,24],iconAnchor:[12,12],html:`<div style="
width:24px;height:24px;border-radius:50%;
background:${n};color:#fff;
display:flex;align-items:center;justify-content:center;
@@ -6,4 +6,4 @@ import{r as x,D as l,j as i}from"./index-Fnq3QmNw.js";import{c as O,l as b,a as
border:2px solid rgba(255,255,255,0.8);
box-shadow:0 1px 4px rgba(0,0,0,0.4);
">${e}</div>`})}function z(e){return m[e%m.length]}function N(e){const n=[];l(e.sender.lat,e.sender.lon)&&n.push([e.sender.lat,e.sender.lon]);for(const t of e.hops)for(const o of t.matches)l(o.lat,o.lon)&&n.push([o.lat,o.lon]);return l(e.receiver.lat,e.receiver.lon)&&n.push([e.receiver.lat,e.receiver.lon]),n}function I({points:e}){const n=T(),t=x.useRef(!1);return x.useEffect(()=>{t.current||e.length===0||(t.current=!0,e.length===1?n.setView(e[0],12):n.fitBounds(e,{padding:[30,30],maxZoom:14}))},[n,e]),null}function k({resolved:e,senderInfo:n}){const t=N(e),o=t.length>0;let r=2,d=0;l(e.sender.lat,e.sender.lon)&&d++,l(e.receiver.lat,e.receiver.lon)&&d++;for(const f of e.hops)f.matches.length===0?r++:(r+=f.matches.length,d+=f.matches.filter(c=>l(c.lat,c.lon)).length);const s=o&&d<r;if(!o)return i.jsx("div",{className:"h-14 rounded border border-border bg-muted/30 flex items-center justify-center text-sm text-muted-foreground",children:"No nodes in this route have GPS coordinates"});const u=t[0];return i.jsxs("div",{children:[i.jsx("div",{className:"rounded border border-border overflow-hidden",role:"img","aria-label":"Map showing message route between nodes",style:{height:220},children:i.jsxs(L,{center:u,zoom:10,className:"h-full w-full",style:{background:"#1a1a2e"},children:[i.jsx(M,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),i.jsx(I,{points:t}),l(e.sender.lat,e.sender.lon)&&i.jsx(h,{position:[e.sender.lat,e.sender.lon],icon:g("S",E),children:i.jsx(p,{direction:"top",offset:[0,-14],children:n.name||"Sender"})}),e.hops.map((f,c)=>f.matches.filter(a=>l(a.lat,a.lon)).map((a,j)=>i.jsx(h,{position:[a.lat,a.lon],icon:g(String(c+1),z(c)),children:i.jsx(p,{direction:"top",offset:[0,-14],children:a.name||a.public_key.slice(0,12)})},`hop-${c}-${j}`))),l(e.receiver.lat,e.receiver.lon)&&i.jsx(h,{position:[e.receiver.lat,e.receiver.lon],icon:g("R",S),children:i.jsx(p,{direction:"top",offset:[0,-14],children:e.receiver.name||"Receiver"})})]})}),s&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Some nodes in this route have no GPS and are not shown"})]})}export{k as PathRouteMap};
//# sourceMappingURL=PathRouteMap-kT7xfoMb.js.map
//# sourceMappingURL=PathRouteMap-C6PZ0wFI.js.map
@@ -1 +1 @@
{"version":3,"file":"PathRouteMap-kT7xfoMb.js","sources":["../../node_modules/react-leaflet/lib/Marker.js","../../node_modules/react-leaflet/lib/Tooltip.js","../../src/components/PathRouteMap.tsx"],"sourcesContent":["import { createElementObject, createLayerComponent, extendContext } from '@react-leaflet/core';\nimport { Marker as LeafletMarker } from 'leaflet';\nexport const Marker = createLayerComponent(function createMarker({ position , ...options }, ctx) {\n const marker = new LeafletMarker(position, options);\n return createElementObject(marker, extendContext(ctx, {\n overlayContainer: marker\n }));\n}, function updateMarker(marker, props, prevProps) {\n if (props.position !== prevProps.position) {\n marker.setLatLng(props.position);\n }\n if (props.icon != null && props.icon !== prevProps.icon) {\n marker.setIcon(props.icon);\n }\n if (props.zIndexOffset != null && props.zIndexOffset !== prevProps.zIndexOffset) {\n marker.setZIndexOffset(props.zIndexOffset);\n }\n if (props.opacity != null && props.opacity !== prevProps.opacity) {\n marker.setOpacity(props.opacity);\n }\n if (marker.dragging != null && props.draggable !== prevProps.draggable) {\n if (props.draggable === true) {\n marker.dragging.enable();\n } else {\n marker.dragging.disable();\n }\n }\n});\n","import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, { position }, setOpen) {\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n if (container == null) {\n return;\n }\n const { instance } = element;\n const onTooltipOpen = (event)=>{\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.update();\n setOpen(true);\n }\n };\n const onTooltipClose = (event)=>{\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n // @ts-ignore protected property\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n","import { useEffect, useRef } from 'react';\nimport { MapContainer, TileLayer, Marker, Tooltip, useMap } from 'react-leaflet';\nimport L from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\nimport { isValidLocation } from '../utils/pathUtils';\nimport type { ResolvedPath, SenderInfo } from '../utils/pathUtils';\n\ninterface PathRouteMapProps {\n resolved: ResolvedPath;\n senderInfo: SenderInfo;\n}\n\n// Colors for hop markers (indexed by hop number - 1)\nconst HOP_COLORS = [\n '#f97316', // Hop 1: orange\n '#eab308', // Hop 2: yellow\n '#22c55e', // Hop 3: green\n '#06b6d4', // Hop 4: cyan\n '#ec4899', // Hop 5: pink\n '#f43f5e', // Hop 6: rose\n '#a855f7', // Hop 7: purple\n '#64748b', // Hop 8: slate\n];\n\nconst SENDER_COLOR = '#3b82f6'; // blue\nconst RECEIVER_COLOR = '#8b5cf6'; // violet\n\nfunction makeIcon(label: string, color: string): L.DivIcon {\n return L.divIcon({\n className: '',\n iconSize: [24, 24],\n iconAnchor: [12, 12],\n html: `<div style=\"\n width:24px;height:24px;border-radius:50%;\n background:${color};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:11px;font-weight:700;\n border:2px solid rgba(255,255,255,0.8);\n box-shadow:0 1px 4px rgba(0,0,0,0.4);\n \">${label}</div>`,\n });\n}\n\nfunction getHopColor(hopIndex: number): string {\n return HOP_COLORS[hopIndex % HOP_COLORS.length];\n}\n\n/** Collect all valid [lat, lon] points for bounds fitting */\nfunction collectPoints(resolved: ResolvedPath): [number, number][] {\n const pts: [number, number][] = [];\n if (isValidLocation(resolved.sender.lat, resolved.sender.lon)) {\n pts.push([resolved.sender.lat!, resolved.sender.lon!]);\n }\n for (const hop of resolved.hops) {\n for (const m of hop.matches) {\n if (isValidLocation(m.lat, m.lon)) {\n pts.push([m.lat!, m.lon!]);\n Line truncated
{"version":3,"file":"PathRouteMap-C6PZ0wFI.js","sources":["../../node_modules/react-leaflet/lib/Marker.js","../../node_modules/react-leaflet/lib/Tooltip.js","../../src/components/PathRouteMap.tsx"],"sourcesContent":["import { createElementObject, createLayerComponent, extendContext } from '@react-leaflet/core';\nimport { Marker as LeafletMarker } from 'leaflet';\nexport const Marker = createLayerComponent(function createMarker({ position , ...options }, ctx) {\n const marker = new LeafletMarker(position, options);\n return createElementObject(marker, extendContext(ctx, {\n overlayContainer: marker\n }));\n}, function updateMarker(marker, props, prevProps) {\n if (props.position !== prevProps.position) {\n marker.setLatLng(props.position);\n }\n if (props.icon != null && props.icon !== prevProps.icon) {\n marker.setIcon(props.icon);\n }\n if (props.zIndexOffset != null && props.zIndexOffset !== prevProps.zIndexOffset) {\n marker.setZIndexOffset(props.zIndexOffset);\n }\n if (props.opacity != null && props.opacity !== prevProps.opacity) {\n marker.setOpacity(props.opacity);\n }\n if (marker.dragging != null && props.draggable !== prevProps.draggable) {\n if (props.draggable === true) {\n marker.dragging.enable();\n } else {\n marker.dragging.disable();\n }\n }\n});\n","import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, { position }, setOpen) {\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n if (container == null) {\n return;\n }\n const { instance } = element;\n const onTooltipOpen = (event)=>{\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.update();\n setOpen(true);\n }\n };\n const onTooltipClose = (event)=>{\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n // @ts-ignore protected property\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n","import { useEffect, useRef } from 'react';\nimport { MapContainer, TileLayer, Marker, Tooltip, useMap } from 'react-leaflet';\nimport L from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\nimport { isValidLocation } from '../utils/pathUtils';\nimport type { ResolvedPath, SenderInfo } from '../utils/pathUtils';\n\ninterface PathRouteMapProps {\n resolved: ResolvedPath;\n senderInfo: SenderInfo;\n}\n\n// Colors for hop markers (indexed by hop number - 1)\nconst HOP_COLORS = [\n '#f97316', // Hop 1: orange\n '#eab308', // Hop 2: yellow\n '#22c55e', // Hop 3: green\n '#06b6d4', // Hop 4: cyan\n '#ec4899', // Hop 5: pink\n '#f43f5e', // Hop 6: rose\n '#a855f7', // Hop 7: purple\n '#64748b', // Hop 8: slate\n];\n\nconst SENDER_COLOR = '#3b82f6'; // blue\nconst RECEIVER_COLOR = '#8b5cf6'; // violet\n\nfunction makeIcon(label: string, color: string): L.DivIcon {\n return L.divIcon({\n className: '',\n iconSize: [24, 24],\n iconAnchor: [12, 12],\n html: `<div style=\"\n width:24px;height:24px;border-radius:50%;\n background:${color};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:11px;font-weight:700;\n border:2px solid rgba(255,255,255,0.8);\n box-shadow:0 1px 4px rgba(0,0,0,0.4);\n \">${label}</div>`,\n });\n}\n\nfunction getHopColor(hopIndex: number): string {\n return HOP_COLORS[hopIndex % HOP_COLORS.length];\n}\n\n/** Collect all valid [lat, lon] points for bounds fitting */\nfunction collectPoints(resolved: ResolvedPath): [number, number][] {\n const pts: [number, number][] = [];\n if (isValidLocation(resolved.sender.lat, resolved.sender.lon)) {\n pts.push([resolved.sender.lat!, resolved.sender.lon!]);\n }\n for (const hop of resolved.hops) {\n for (const m of hop.matches) {\n if (isValidLocation(m.lat, m.lon)) {\n pts.push([m.lat!, m.lon!]);\n Line truncated
@@ -1,2 +1,2 @@
import{d,l as f,a as s,e as C,b as m}from"./leaflet-ENrCR1B4.js";import{r as P}from"./index-Fnq3QmNw.js";function v(o,n,e){n.center!==e.center&&o.setLatLng(n.center),n.radius!=null&&n.radius!==e.radius&&o.setRadius(n.radius)}const b=d(function({center:n,children:e,...r},p){const t=new f.CircleMarker(n,r);return s(t,C(p,{overlayContainer:t}))},v),k=m(function(n,e){const r=new f.Popup(n,e.overlayContainer);return s(r,e)},function(n,e,{position:r},p){P.useEffect(function(){const{instance:a}=n;function i(u){u.popup===a&&(a.update(),p(!0))}function c(u){u.popup===a&&p(!1)}return e.map.on({popupopen:i,popupclose:c}),e.overlayContainer==null?(r!=null&&a.setLatLng(r),a.openOn(e.map)):e.overlayContainer.bindPopup(a),function(){var l;e.map.off({popupopen:i,popupclose:c}),(l=e.overlayContainer)==null||l.unbindPopup(),e.map.removeLayer(a)}},[n,e,p,r])});export{b as C,k as P};
//# sourceMappingURL=Popup-C-Q9ygBf.js.map
import{d,l as f,a as s,e as C,b as m}from"./leaflet-IXizDMbG.js";import{r as P}from"./index-CyRLXsJ_.js";function v(o,n,e){n.center!==e.center&&o.setLatLng(n.center),n.radius!=null&&n.radius!==e.radius&&o.setRadius(n.radius)}const b=d(function({center:n,children:e,...r},p){const t=new f.CircleMarker(n,r);return s(t,C(p,{overlayContainer:t}))},v),k=m(function(n,e){const r=new f.Popup(n,e.overlayContainer);return s(r,e)},function(n,e,{position:r},p){P.useEffect(function(){const{instance:a}=n;function i(u){u.popup===a&&(a.update(),p(!0))}function c(u){u.popup===a&&p(!1)}return e.map.on({popupopen:i,popupclose:c}),e.overlayContainer==null?(r!=null&&a.setLatLng(r),a.openOn(e.map)):e.overlayContainer.bindPopup(a),function(){var l;e.map.off({popupopen:i,popupclose:c}),(l=e.overlayContainer)==null||l.unbindPopup(),e.map.removeLayer(a)}},[n,e,p,r])});export{b as C,k as P};
//# sourceMappingURL=Popup-A7yuH1dp.js.map
@@ -1 +1 @@
{"version":3,"file":"Popup-C-Q9ygBf.js","sources":["../../node_modules/@react-leaflet/core/lib/circle.js","../../node_modules/react-leaflet/lib/CircleMarker.js","../../node_modules/react-leaflet/lib/Popup.js"],"sourcesContent":["export function updateCircle(layer, props, prevProps) {\n if (props.center !== prevProps.center) {\n layer.setLatLng(props.center);\n }\n if (props.radius != null && props.radius !== prevProps.radius) {\n layer.setRadius(props.radius);\n }\n}\n","import { createElementObject, createPathComponent, extendContext, updateCircle } from '@react-leaflet/core';\nimport { CircleMarker as LeafletCircleMarker } from 'leaflet';\nexport const CircleMarker = createPathComponent(function createCircleMarker({ center , children: _c , ...options }, ctx) {\n const marker = new LeafletCircleMarker(center, options);\n return createElementObject(marker, extendContext(ctx, {\n overlayContainer: marker\n }));\n}, updateCircle);\n","import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Popup as LeafletPopup } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Popup = createOverlayComponent(function createPopup(props, context) {\n const popup = new LeafletPopup(props, context.overlayContainer);\n return createElementObject(popup, context);\n}, function usePopupLifecycle(element, context, { position }, setOpen) {\n useEffect(function addPopup() {\n const { instance } = element;\n function onPopupOpen(event) {\n if (event.popup === instance) {\n instance.update();\n setOpen(true);\n }\n }\n function onPopupClose(event) {\n if (event.popup === instance) {\n setOpen(false);\n }\n }\n context.map.on({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n if (context.overlayContainer == null) {\n // Attach to a Map\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.openOn(context.map);\n } else {\n // Attach to container component\n context.overlayContainer.bindPopup(instance);\n }\n return function removePopup() {\n context.map.off({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n context.overlayContainer?.unbindPopup();\n context.map.removeLayer(instance);\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n"],"names":["updateCircle","layer","props","prevProps","CircleMarker","createPathComponent","center","_c","options","ctx","marker","LeafletCircleMarker","createElementObject","extendContext","Popup","createOverlayComponent","context","popup","LeafletPopup","element","position","setOpen","useEffect","instance","onPopupOpen","event","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,IAAI,YAAYO,CAAQ,CACpC,CACJ,EAAG,CACCJ,EACAH,EACAK,EACAD,CACR,CAAK,CACL,CAAC","x_google_ignoreList":[0,1,2]}
{"version":3,"file":"Popup-A7yuH1dp.js","sources":["../../node_modules/@react-leaflet/core/lib/circle.js","../../node_modules/react-leaflet/lib/CircleMarker.js","../../node_modules/react-leaflet/lib/Popup.js"],"sourcesContent":["export function updateCircle(layer, props, prevProps) {\n if (props.center !== prevProps.center) {\n layer.setLatLng(props.center);\n }\n if (props.radius != null && props.radius !== prevProps.radius) {\n layer.setRadius(props.radius);\n }\n}\n","import { createElementObject, createPathComponent, extendContext, updateCircle } from '@react-leaflet/core';\nimport { CircleMarker as LeafletCircleMarker } from 'leaflet';\nexport const CircleMarker = createPathComponent(function createCircleMarker({ center , children: _c , ...options }, ctx) {\n const marker = new LeafletCircleMarker(center, options);\n return createElementObject(marker, extendContext(ctx, {\n overlayContainer: marker\n }));\n}, updateCircle);\n","import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Popup as LeafletPopup } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Popup = createOverlayComponent(function createPopup(props, context) {\n const popup = new LeafletPopup(props, context.overlayContainer);\n return createElementObject(popup, context);\n}, function usePopupLifecycle(element, context, { position }, setOpen) {\n useEffect(function addPopup() {\n const { instance } = element;\n function onPopupOpen(event) {\n if (event.popup === instance) {\n instance.update();\n setOpen(true);\n }\n }\n function onPopupClose(event) {\n if (event.popup === instance) {\n setOpen(false);\n }\n }\n context.map.on({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n if (context.overlayContainer == null) {\n // Attach to a Map\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.openOn(context.map);\n } else {\n // Attach to container component\n context.overlayContainer.bindPopup(instance);\n }\n return function removePopup() {\n context.map.off({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n context.overlayContainer?.unbindPopup();\n context.map.removeLayer(instance);\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n"],"names":["updateCircle","layer","props","prevProps","CircleMarker","createPathComponent","center","_c","options","ctx","marker","LeafletCircleMarker","createElementObject","extendContext","Popup","createOverlayComponent","context","popup","LeafletPopup","element","position","setOpen","useEffect","instance","onPopupOpen","event","onPopupClose","_a"],"mappings":"yGAAO,SAASA,EAAaC,EAAOC,EAAOC,EAAW,CAC9CD,EAAM,SAAWC,EAAU,QAC3BF,EAAM,UAAUC,EAAM,MAAM,EAE5BA,EAAM,QAAU,MAAQA,EAAM,SAAWC,EAAU,QACnDF,EAAM,UAAUC,EAAM,MAAM,CAEpC,CCLY,MAACE,EAAeC,EAAoB,SAA4B,CAAE,OAAAC,EAAS,SAAUC,EAAK,GAAGC,CAAO,EAAIC,EAAK,CACrH,MAAMC,EAAS,IAAIC,eAAoBL,EAAQE,CAAO,EACtD,OAAOI,EAAoBF,EAAQG,EAAcJ,EAAK,CAClD,iBAAkBC,CAC1B,CAAK,CAAC,CACN,EAAGV,CAAY,ECJFc,EAAQC,EAAuB,SAAqBb,EAAOc,EAAS,CAC7E,MAAMC,EAAQ,IAAIC,EAAAA,MAAahB,EAAOc,EAAQ,gBAAgB,EAC9D,OAAOJ,EAAoBK,EAAOD,CAAO,CAC7C,EAAG,SAA2BG,EAASH,EAAS,CAAE,SAAAI,CAAQ,EAAKC,EAAS,CACpEC,EAAAA,UAAU,UAAoB,CAC1B,KAAM,CAAE,SAAAC,CAAQ,EAAMJ,EACtB,SAASK,EAAYC,EAAO,CACpBA,EAAM,QAAUF,IAChBA,EAAS,OAAM,EACfF,EAAQ,EAAI,EAEpB,CACA,SAASK,EAAaD,EAAO,CACrBA,EAAM,QAAUF,GAChBF,EAAQ,EAAK,CAErB,CACA,OAAAL,EAAQ,IAAI,GAAG,CACX,UAAWQ,EACX,WAAYE,CACxB,CAAS,EACGV,EAAQ,kBAAoB,MAExBI,GAAY,MACZG,EAAS,UAAUH,CAAQ,EAE/BG,EAAS,OAAOP,EAAQ,GAAG,GAG3BA,EAAQ,iBAAiB,UAAUO,CAAQ,EAExC,UAAuB,OAC1BP,EAAQ,IAAI,IAAI,CACZ,UAAWQ,EACX,WAAYE,CAC5B,CAAa,GACDC,EAAAX,EAAQ,mBAAR,MAAAW,EAA0B,cAC1BX,EAAQ,IAAI,YAAYO,CAAQ,CACpC,CACJ,EAAG,CACCJ,EACAH,EACAK,EACAD,CACR,CAAK,CACL,CAAC","x_google_ignoreList":[0,1,2]}
@@ -1,3 +1,3 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NeighborsMiniMap-zqanKONo.js","assets/index-Fnq3QmNw.js","assets/index-Kkb-Bio9.css","assets/leaflet-ENrCR1B4.js","assets/leaflet-Dgihpmma.css","assets/Popup-C-Q9ygBf.js"])))=>i.map(i=>d[i]);
import{r as a,k as $,t as q,j as e,I as ne,B as z,l as F,D as K,E as de,F as ue,_ as me,G as fe,H as xe,J as he,R as pe,K as ge,M as be,N as Q,O as je,P as ve}from"./index-Fnq3QmNw.js";import{S as X}from"./separator-BwjFWJb_.js";const ee=3,Ne=2e3,ye=20,E={loading:!1,attempt:0,error:null,fetched_at:null};function te(){return{status:{...E},nodeInfo:{...E},neighbors:{...E},acl:{...E},radioSettings:{...E},advertIntervals:{...E},ownerInfo:{...E},lppTelemetry:{...E}}}function se(){return{status:null,nodeInfo:null,neighbors:null,acl:null,radioSettings:null,advertIntervals:null,ownerInfo:null,lppTelemetry:null}}const H=new Map;function we(t){switch(t){case"timeout":return"Login confirmation not heard";case"error":return"Login not confirmed";default:return"Repeater login not confirmed"}}function oe(t){return{...t}}function le(t){return{status:{...t.status,loading:!1},nodeInfo:{...t.nodeInfo,loading:!1},neighbors:{...t.neighbors,loading:!1},acl:{...t.acl,loading:!1},radioSettings:{...t.radioSettings,loading:!1},advertIntervals:{...t.advertIntervals,loading:!1},ownerInfo:{...t.ownerInfo,loading:!1},lppTelemetry:{...t.lppTelemetry,loading:!1}}}function ae(t){return t.map(s=>({...s}))}function _e(t){if(!t)return null;const s=H.get(t);return s?(H.delete(t),H.set(t,s),{loggedIn:s.loggedIn,loginError:s.loginError,paneData:oe(s.paneData),paneStates:le(s.paneStates),consoleHistory:ae(s.consoleHistory)}):null}function Ce(t,s){if(H.delete(t),H.set(t,{loggedIn:s.loggedIn,loginError:s.loginError,paneData:oe(s.paneData),paneStates:le(s.paneStates),consoleHistory:ae(s.consoleHistory)}),H.size>ye){const r=H.keys().next().value;r&&H.delete(r)}}function Re(t,s){switch(s){case"status":return $.repeaterStatus(t);case"nodeInfo":return $.repeaterNodeInfo(t);case"neighbors":return $.repeaterNeighbors(t);case"acl":return $.repeaterAcl(t);case"radioSettings":return $.repeaterRadioSettings(t);case"advertIntervals":return $.repeaterAdvertIntervals(t);case"ownerInfo":return $.repeaterOwnerInfo(t);case"lppTelemetry":return $.repeaterLppTelemetry(t)}}function Le(t){const s=t&&t.type==="contact"?t.id:null,r=_e(s),[o,l]=a.useState((r==null?void 0:r.loggedIn)??!1),[n,h]=a.useState(!1),[i,c]=a.useState((r==null?void 0:r.loginError)??null),[j,D]=a.useState((r==null?void 0:r.paneData)??se),[v,R]=a.useState((r==null?void 0:r.paneStates)??te),w=a.useRef((r==null?void 0:r.paneData)??se()),N=a.useRef((r==null?void 0:r.paneStates)??te()),[A,f]=a.useState((r==null?void 0:r.consoleHistory)??[]),[T,P]=a.useState(!1),u=a.useRef((t==null?void 0:t.id)??null),m=a.useRef(!0);a.useEffect(()=>{u.current=s},[s]),a.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]),a.useEffect(()=>{s&&Ce(s,{loggedIn:o,loginError:i,paneData:j,paneStates:v,consoleHistory:A})},[A,s,o,i,j,v]),a.useEffect(()=>{w.current=j},[j]),a.useEffect(()=>{N.current=v},[v]);const _=a.useCallback(()=>!t||t.type!=="contact"?null:t.id,[t]),L=a.useCallback(async p=>{const b=_();if(!b)return;const y=b;h(!0),c(null);try{const d=await $.repeaterLogin(b,p);if(u.current!==y)return;if(l(!0),!d.authenticated){const g=d.message??"Repeater login was not confirmed";c(g),q.error(we(d.status),{description:g})}}catch(d){if(u.current!==y)return;const g=d instanceof Error?d.message:"Login failed";l(!0),c(g),q.error("Login request failed",{description:`${g}. The dashboard is still available, but repeater operations may fail until a login succeeds.`})}finally{u.current===y&&h(!1)}},[_]),W=a.useCallback(async()=>{await L("")},[L]),S=a.useCallback(async p=>{const b=_();if(!b)return;const y=b;if(p==="neighbors"){const d=N.current.nodeInfo,g=w.current.nodeInfo;if((d.error!==null||d.fetched_at==null&&g==null)&&(await S("nodeInfo"),!m.current||u.current!==y))return}for(let d=1;d<=ee;d++){if(!m.current||u.current!==y)return;const g={loading:!0,attempt:d,error:null,fetched_at:N.current[p].fetched_at??null};N.current={...N.current,[p]:g},R(C=>({...C,[p]:g}));try{const C=await Re(b,p);if(!m.current||u.current!==y)return;w.current={...w.current,[p]:C};const O={loading:!1,attempt:d,error:null,fetched_at:Date.now()};N.current={...N.current,[p]:O},D(M=>({...M,[p]:C})),R(M=>({...M,[p]:O}));return}catch(C){if(!m.current||u.current!==y)return;const O=C instanceof Error?C.message:"Request failed";if(d===ee){const M={loading:!1,attempt:d,error:O,fetched_at:N.current[p].fetched_at??null};N.current={...N.current,[p]:M},R(ce=>({...ce,[p]:M})),q.error(`Failed to fetch ${p}`,{description:O})}else await new Promise(M=>setTimeout(M,Ne))}}},[_]),I=a.useCallback(async()=>{const p=["status","nodeInfo","neighbors","radioSettings","acl","advertIntervals","ownerInfo","lppTelemetry"];for(const b of p)await S(b)},[S]),k=a.useCallback(async p=>{const b=_();if(!b)return;const y=b,d=Math.floor(Date.now()/1e3);f(g=>[...g,{command:p,response:"",timestamp:d,outgoing:!0}]),P(!0);try{const g=await $.sendRepeaterCommand(b,p);if(u.current!==y)return;f(C=>[...C,{command:p,response:g.response,timestamp:g.sender_timestamp??d,outgoing:!1}])}catch(g){if(u.current!==y)Line truncated
//# sourceMappingURL=RepeaterDashboard-DtQKwbsT.js.map
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NeighborsMiniMap-Bi17OsoB.js","assets/index-CyRLXsJ_.js","assets/index-Kkb-Bio9.css","assets/leaflet-IXizDMbG.js","assets/leaflet-Dgihpmma.css","assets/Popup-A7yuH1dp.js"])))=>i.map(i=>d[i]);
import{r as a,k as $,t as q,j as e,I as ne,B as z,l as F,D as K,E as de,F as ue,_ as me,G as fe,H as xe,J as he,R as pe,K as ge,M as be,N as Q,O as je,P as ve}from"./index-CyRLXsJ_.js";import{S as X}from"./separator-CrdYjM_C.js";const ee=3,Ne=2e3,ye=20,E={loading:!1,attempt:0,error:null,fetched_at:null};function te(){return{status:{...E},nodeInfo:{...E},neighbors:{...E},acl:{...E},radioSettings:{...E},advertIntervals:{...E},ownerInfo:{...E},lppTelemetry:{...E}}}function se(){return{status:null,nodeInfo:null,neighbors:null,acl:null,radioSettings:null,advertIntervals:null,ownerInfo:null,lppTelemetry:null}}const H=new Map;function we(t){switch(t){case"timeout":return"Login confirmation not heard";case"error":return"Login not confirmed";default:return"Repeater login not confirmed"}}function oe(t){return{...t}}function le(t){return{status:{...t.status,loading:!1},nodeInfo:{...t.nodeInfo,loading:!1},neighbors:{...t.neighbors,loading:!1},acl:{...t.acl,loading:!1},radioSettings:{...t.radioSettings,loading:!1},advertIntervals:{...t.advertIntervals,loading:!1},ownerInfo:{...t.ownerInfo,loading:!1},lppTelemetry:{...t.lppTelemetry,loading:!1}}}function ae(t){return t.map(s=>({...s}))}function _e(t){if(!t)return null;const s=H.get(t);return s?(H.delete(t),H.set(t,s),{loggedIn:s.loggedIn,loginError:s.loginError,paneData:oe(s.paneData),paneStates:le(s.paneStates),consoleHistory:ae(s.consoleHistory)}):null}function Ce(t,s){if(H.delete(t),H.set(t,{loggedIn:s.loggedIn,loginError:s.loginError,paneData:oe(s.paneData),paneStates:le(s.paneStates),consoleHistory:ae(s.consoleHistory)}),H.size>ye){const r=H.keys().next().value;r&&H.delete(r)}}function Re(t,s){switch(s){case"status":return $.repeaterStatus(t);case"nodeInfo":return $.repeaterNodeInfo(t);case"neighbors":return $.repeaterNeighbors(t);case"acl":return $.repeaterAcl(t);case"radioSettings":return $.repeaterRadioSettings(t);case"advertIntervals":return $.repeaterAdvertIntervals(t);case"ownerInfo":return $.repeaterOwnerInfo(t);case"lppTelemetry":return $.repeaterLppTelemetry(t)}}function Le(t){const s=t&&t.type==="contact"?t.id:null,r=_e(s),[o,l]=a.useState((r==null?void 0:r.loggedIn)??!1),[n,h]=a.useState(!1),[i,c]=a.useState((r==null?void 0:r.loginError)??null),[j,D]=a.useState((r==null?void 0:r.paneData)??se),[v,R]=a.useState((r==null?void 0:r.paneStates)??te),w=a.useRef((r==null?void 0:r.paneData)??se()),N=a.useRef((r==null?void 0:r.paneStates)??te()),[A,f]=a.useState((r==null?void 0:r.consoleHistory)??[]),[T,P]=a.useState(!1),u=a.useRef((t==null?void 0:t.id)??null),m=a.useRef(!0);a.useEffect(()=>{u.current=s},[s]),a.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]),a.useEffect(()=>{s&&Ce(s,{loggedIn:o,loginError:i,paneData:j,paneStates:v,consoleHistory:A})},[A,s,o,i,j,v]),a.useEffect(()=>{w.current=j},[j]),a.useEffect(()=>{N.current=v},[v]);const _=a.useCallback(()=>!t||t.type!=="contact"?null:t.id,[t]),L=a.useCallback(async p=>{const b=_();if(!b)return;const y=b;h(!0),c(null);try{const d=await $.repeaterLogin(b,p);if(u.current!==y)return;if(l(!0),!d.authenticated){const g=d.message??"Repeater login was not confirmed";c(g),q.error(we(d.status),{description:g})}}catch(d){if(u.current!==y)return;const g=d instanceof Error?d.message:"Login failed";l(!0),c(g),q.error("Login request failed",{description:`${g}. The dashboard is still available, but repeater operations may fail until a login succeeds.`})}finally{u.current===y&&h(!1)}},[_]),W=a.useCallback(async()=>{await L("")},[L]),S=a.useCallback(async p=>{const b=_();if(!b)return;const y=b;if(p==="neighbors"){const d=N.current.nodeInfo,g=w.current.nodeInfo;if((d.error!==null||d.fetched_at==null&&g==null)&&(await S("nodeInfo"),!m.current||u.current!==y))return}for(let d=1;d<=ee;d++){if(!m.current||u.current!==y)return;const g={loading:!0,attempt:d,error:null,fetched_at:N.current[p].fetched_at??null};N.current={...N.current,[p]:g},R(C=>({...C,[p]:g}));try{const C=await Re(b,p);if(!m.current||u.current!==y)return;w.current={...w.current,[p]:C};const O={loading:!1,attempt:d,error:null,fetched_at:Date.now()};N.current={...N.current,[p]:O},D(M=>({...M,[p]:C})),R(M=>({...M,[p]:O}));return}catch(C){if(!m.current||u.current!==y)return;const O=C instanceof Error?C.message:"Request failed";if(d===ee){const M={loading:!1,attempt:d,error:O,fetched_at:N.current[p].fetched_at??null};N.current={...N.current,[p]:M},R(ce=>({...ce,[p]:M})),q.error(`Failed to fetch ${p}`,{description:O})}else await new Promise(M=>setTimeout(M,Ne))}}},[_]),I=a.useCallback(async()=>{const p=["status","nodeInfo","neighbors","radioSettings","acl","advertIntervals","ownerInfo","lppTelemetry"];for(const b of p)await S(b)},[S]),k=a.useCallback(async p=>{const b=_();if(!b)return;const y=b,d=Math.floor(Date.now()/1e3);f(g=>[...g,{command:p,response:"",timestamp:d,outgoing:!0}]),P(!0);try{const g=await $.sendRepeaterCommand(b,p);if(u.current!==y)return;f(C=>[...C,{command:p,response:g.response,timestamp:g.sender_timestamp??d,outgoing:!1}])}catch(g){if(u.current!==y)Line truncated
//# sourceMappingURL=RepeaterDashboard-Dj09PNsp.js.map
@@ -1 +1 @@
{"version":3,"mappings":";qOAkBA,MAAMA,GAAc,EACdC,GAAiB,IACjBC,GAAuB,GA4BvBC,EAAgC,CAAE,QAAS,GAAO,QAAS,EAAG,MAAO,KAAM,WAAY,MAE7F,SAASC,IAAuD,CAC9D,MAAO,CACL,OAAQ,CAAE,GAAGD,CAAA,EACb,SAAU,CAAE,GAAGA,CAAA,EACf,UAAW,CAAE,GAAGA,CAAA,EAChB,IAAK,CAAE,GAAGA,CAAA,EACV,cAAe,CAAE,GAAGA,CAAA,E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E,GAAGA,EAAM,CAACvC,CAAI,EAAGZ,CAAA,EAAO,EACjD2B,EAAewB,IAAU,CACvB,GAAGA,EACH,CAACvC,CAAI,EAAGwC,CAAA,EACR,EACF,MACF,OAASR,EAAK,CACZ,GALine truncated
@@ -1,2 +1,2 @@
import{r as n,k as _,A as w,j as t,I as H,l as I,m as Q,B}from"./index-Fnq3QmNw.js";const b=50,D=300,O=new RegExp('(?<!\\S)(user|channel):(?:"((?:[^"\\\\]|\\\\.)*)"|(\\S+))',"gi");function T(c,d){if(!d)return[c];const i=[],m=new RegExp(`(${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=c.split(m);for(let l=0;l<r.length;l++)m.test(r[l])?i.push(t.jsx("mark",{className:"bg-primary/30 text-foreground rounded-sm px-0.5",children:r[l]},l)):i.push(r[l]),m.lastIndex=0;return i}function L(c){const d=[];let i=0,m=!1;for(const r of c.matchAll(O))m=!0,d.push(c.slice(i,r.index)),i=(r.index??0)+r[0].length;return m?(d.push(c.slice(i)),d.map(r=>r.trim()).filter(Boolean).join(" ")):c}function $({contacts:c,channels:d,visibilityVersion:i=0,onNavigateToMessage:m,prefillRequest:r=null}){const[l,v]=n.useState(""),[a,k]=n.useState(""),[C,h]=n.useState([]),[f,p]=n.useState(!1),[A,g]=n.useState(!1),[E,y]=n.useState(0),x=n.useRef(null),j=n.useRef(null),R=L(a);n.useEffect(()=>{const e=setTimeout(()=>{k(l.trim())},D);return()=>clearTimeout(e)},[l]),n.useEffect(()=>{h([]),y(0),g(!1)},[a,i]),n.useEffect(()=>{var o;if(!r)return;const e=r.query.trim();v(e),k(e),(o=j.current)==null||o.focus()},[r]),n.useEffect(()=>()=>{var e;(e=x.current)==null||e.abort()},[]),n.useEffect(()=>{var o;if(!a){h([]),g(!1);return}(o=x.current)==null||o.abort();const e=new AbortController;return x.current=e,p(!0),_.getMessages({q:a,limit:b,offset:0},e.signal).then(s=>{h(s),g(s.length>=b),y(s.length)}).catch(s=>{w(s)||console.error("Search failed:",s)}).finally(()=>{p(!1)}),()=>e.abort()},[a,i]);const M=n.useCallback(()=>{var o;if(!a||f)return;(o=x.current)==null||o.abort();const e=new AbortController;x.current=e,p(!0),_.getMessages({q:a,limit:b,offset:E},e.signal).then(s=>{h(u=>[...u,...s]),g(s.length>=b),y(u=>u+s.length)}).catch(s=>{w(s)||console.error("Search load more failed:",s)}).finally(()=>{p(!1)})},[a,f,E]),N=n.useCallback(e=>{if(e.type==="CHAN"){const s=d.find(u=>u.key.toUpperCase()===e.conversation_key.toUpperCase());return(s==null?void 0:s.name)||e.conversation_key.slice(0,8)}const o=c.find(s=>s.public_key.toLowerCase()===e.conversation_key.toLowerCase());return(o==null?void 0:o.name)||e.conversation_key.slice(0,12)},[c,d]),S=n.useCallback(e=>{m({id:e.id,type:e.type,conversation_key:e.conversation_key,conversation_name:N(e)})},[m,N]);return n.useEffect(()=>{var e;(e=j.current)==null||e.focus()},[]),t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("h2",{className:"flex justify-between items-center px-4 py-2.5 border-b border-border font-semibold text-base",children:"Message Search"}),t.jsx("div",{className:"px-4 py-3 border-b border-border",children:t.jsx(H,{ref:j,type:"text",placeholder:"Search all messages...",value:l,onChange:e=>v(e.target.value),className:"h-9 text-sm","aria-label":"Search messages"})}),t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[!a&&t.jsxs("div",{className:"p-8 text-center text-muted-foreground text-sm",children:[t.jsx("p",{children:"Type to search across all messages"}),t.jsxs("p",{className:"mt-2 text-xs",children:["Tip: use ",t.jsx("code",{children:"user:"})," or ",t.jsx("code",{children:"channel:"})," for keys or names, and wrap names with spaces in them in quotes."]}),t.jsx("p",{className:"mt-2 text-xs",children:"Warning: User-key linkage for group messages is best-effort and based on correlation at advertise time. It does not account for multiple users with the same name, and should be considered unreliable."})]}),a&&C.length===0&&!f&&t.jsxs("div",{className:"p-8 text-center text-muted-foreground text-sm",children:["No messages found for “",a,"”"]}),C.map(e=>{const o=N(e),s=e.type==="CHAN"?"Channel":"DM";return t.jsxs("div",{className:"px-4 py-3 border-b border-border/50 cursor-pointer hover:bg-accent/50 transition-colors",role:"button",tabIndex:0,onClick:()=>S(e),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),S(e))},children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:I("text-[10px] font-medium px-1.5 py-0.5 rounded",e.type==="CHAN"?"bg-primary/20 text-primary":"bg-secondary text-secondary-foreground"),children:s}),t.jsx("span",{className:"text-[12px] font-medium text-foreground truncate",children:o}),t.jsx("span",{className:"text-[11px] text-muted-foreground ml-auto flex-shrink-0",children:Q(e.received_at)})]}),t.jsxs("div",{className:"text-[13px] text-foreground/80 line-clamp-2 break-words",children:[e.sender_name&&!e.outgoing&&t.jsxs("span",{className:"text-muted-foreground",children:[e.sender_name,": "]}),e.outgoing&&t.jsx("span",{className:"text-muted-foreground",children:"You: "}),T(e.sender_name&&e.text.startsWith(`${e.sender_name}: `)?e.text.slice(e.sender_name.length+2):e.text,R)]})]},e.id)}),f&&t.jsx("div",{className:"p-4 text-center text-muted-foreground text-sm",role:"status",children:"Searching..."}),A&&!f&&t.jsx("div",{className:"p-4 text-center",children:t.jsx(B,{variant:"outline",size:"sm",onClick:M,childLine truncated
//# sourceMappingURL=SearchView-DBqP6hD6.js.map
import{r as n,k as _,A as w,j as t,I as H,l as I,m as Q,B}from"./index-CyRLXsJ_.js";const b=50,D=300,O=new RegExp('(?<!\\S)(user|channel):(?:"((?:[^"\\\\]|\\\\.)*)"|(\\S+))',"gi");function T(c,d){if(!d)return[c];const i=[],m=new RegExp(`(${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=c.split(m);for(let l=0;l<r.length;l++)m.test(r[l])?i.push(t.jsx("mark",{className:"bg-primary/30 text-foreground rounded-sm px-0.5",children:r[l]},l)):i.push(r[l]),m.lastIndex=0;return i}function L(c){const d=[];let i=0,m=!1;for(const r of c.matchAll(O))m=!0,d.push(c.slice(i,r.index)),i=(r.index??0)+r[0].length;return m?(d.push(c.slice(i)),d.map(r=>r.trim()).filter(Boolean).join(" ")):c}function $({contacts:c,channels:d,visibilityVersion:i=0,onNavigateToMessage:m,prefillRequest:r=null}){const[l,v]=n.useState(""),[a,k]=n.useState(""),[C,h]=n.useState([]),[f,p]=n.useState(!1),[A,g]=n.useState(!1),[E,y]=n.useState(0),x=n.useRef(null),j=n.useRef(null),R=L(a);n.useEffect(()=>{const e=setTimeout(()=>{k(l.trim())},D);return()=>clearTimeout(e)},[l]),n.useEffect(()=>{h([]),y(0),g(!1)},[a,i]),n.useEffect(()=>{var o;if(!r)return;const e=r.query.trim();v(e),k(e),(o=j.current)==null||o.focus()},[r]),n.useEffect(()=>()=>{var e;(e=x.current)==null||e.abort()},[]),n.useEffect(()=>{var o;if(!a){h([]),g(!1);return}(o=x.current)==null||o.abort();const e=new AbortController;return x.current=e,p(!0),_.getMessages({q:a,limit:b,offset:0},e.signal).then(s=>{h(s),g(s.length>=b),y(s.length)}).catch(s=>{w(s)||console.error("Search failed:",s)}).finally(()=>{p(!1)}),()=>e.abort()},[a,i]);const M=n.useCallback(()=>{var o;if(!a||f)return;(o=x.current)==null||o.abort();const e=new AbortController;x.current=e,p(!0),_.getMessages({q:a,limit:b,offset:E},e.signal).then(s=>{h(u=>[...u,...s]),g(s.length>=b),y(u=>u+s.length)}).catch(s=>{w(s)||console.error("Search load more failed:",s)}).finally(()=>{p(!1)})},[a,f,E]),N=n.useCallback(e=>{if(e.type==="CHAN"){const s=d.find(u=>u.key.toUpperCase()===e.conversation_key.toUpperCase());return(s==null?void 0:s.name)||e.conversation_key.slice(0,8)}const o=c.find(s=>s.public_key.toLowerCase()===e.conversation_key.toLowerCase());return(o==null?void 0:o.name)||e.conversation_key.slice(0,12)},[c,d]),S=n.useCallback(e=>{m({id:e.id,type:e.type,conversation_key:e.conversation_key,conversation_name:N(e)})},[m,N]);return n.useEffect(()=>{var e;(e=j.current)==null||e.focus()},[]),t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("h2",{className:"flex justify-between items-center px-4 py-2.5 border-b border-border font-semibold text-base",children:"Message Search"}),t.jsx("div",{className:"px-4 py-3 border-b border-border",children:t.jsx(H,{ref:j,type:"text",placeholder:"Search all messages...",value:l,onChange:e=>v(e.target.value),className:"h-9 text-sm","aria-label":"Search messages"})}),t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[!a&&t.jsxs("div",{className:"p-8 text-center text-muted-foreground text-sm",children:[t.jsx("p",{children:"Type to search across all messages"}),t.jsxs("p",{className:"mt-2 text-xs",children:["Tip: use ",t.jsx("code",{children:"user:"})," or ",t.jsx("code",{children:"channel:"})," for keys or names, and wrap names with spaces in them in quotes."]}),t.jsx("p",{className:"mt-2 text-xs",children:"Warning: User-key linkage for group messages is best-effort and based on correlation at advertise time. It does not account for multiple users with the same name, and should be considered unreliable."})]}),a&&C.length===0&&!f&&t.jsxs("div",{className:"p-8 text-center text-muted-foreground text-sm",children:["No messages found for “",a,"”"]}),C.map(e=>{const o=N(e),s=e.type==="CHAN"?"Channel":"DM";return t.jsxs("div",{className:"px-4 py-3 border-b border-border/50 cursor-pointer hover:bg-accent/50 transition-colors",role:"button",tabIndex:0,onClick:()=>S(e),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),S(e))},children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:I("text-[10px] font-medium px-1.5 py-0.5 rounded",e.type==="CHAN"?"bg-primary/20 text-primary":"bg-secondary text-secondary-foreground"),children:s}),t.jsx("span",{className:"text-[12px] font-medium text-foreground truncate",children:o}),t.jsx("span",{className:"text-[11px] text-muted-foreground ml-auto flex-shrink-0",children:Q(e.received_at)})]}),t.jsxs("div",{className:"text-[13px] text-foreground/80 line-clamp-2 break-words",children:[e.sender_name&&!e.outgoing&&t.jsxs("span",{className:"text-muted-foreground",children:[e.sender_name,": "]}),e.outgoing&&t.jsx("span",{className:"text-muted-foreground",children:"You: "}),T(e.sender_name&&e.text.startsWith(`${e.sender_name}: `)?e.text.slice(e.sender_name.length+2):e.text,R)]})]},e.id)}),f&&t.jsx("div",{className:"p-4 text-center text-muted-foreground text-sm",role:"status",children:"Searching..."}),A&&!f&&t.jsx("div",{className:"p-4 text-center",children:t.jsx(B,{variant:"outline",size:"sm",onClick:M,childLine truncated
//# sourceMappingURL=SearchView-Dcvv4c8P.js.map
@@ -1 +1 @@
{"version":3,"file":"SearchView-DBqP6hD6.js","sources":["../../src/components/SearchView.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\nimport { api, isAbortError } from '../api';\nimport type { Contact, Channel } from '../types';\nimport { formatTime } from '../utils/messageParser';\nimport { Input } from './ui/input';\nimport { Button } from './ui/button';\nimport { cn } from '@/lib/utils';\n\nconst SEARCH_PAGE_SIZE = 50;\nconst DEBOUNCE_MS = 300;\n\ninterface SearchResult {\n id: number;\n type: 'PRIV' | 'CHAN';\n conversation_key: string;\n text: string;\n received_at: number;\n outgoing: boolean;\n sender_name: string | null;\n}\n\nconst SEARCH_OPERATOR_RE = /(?<!\\S)(user|channel):(?:\"((?:[^\"\\\\]|\\\\.)*)\"|(\\S+))/gi;\n\nexport interface SearchNavigateTarget {\n id: number;\n type: 'PRIV' | 'CHAN';\n conversation_key: string;\n conversation_name: string;\n}\n\nexport interface SearchViewProps {\n contacts: Contact[];\n channels: Channel[];\n visibilityVersion?: number;\n onNavigateToMessage: (target: SearchNavigateTarget) => void;\n prefillRequest?: {\n query: string;\n nonce: number;\n } | null;\n}\n\nfunction highlightMatch(text: string, query: string): React.ReactNode[] {\n if (!query) return [text];\n const parts: React.ReactNode[] = [];\n const regex = new RegExp(`(${query.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')})`, 'gi');\n const segments = text.split(regex);\n for (let i = 0; i < segments.length; i++) {\n if (regex.test(segments[i])) {\n parts.push(\n <mark key={i} className=\"bg-primary/30 text-foreground rounded-sm px-0.5\">\n {segments[i]}\n </mark>\n );\n } else {\n parts.push(segments[i]);\n }\n // Reset lastIndex since we're using test() in a loop\n regex.lastIndex = 0;\n }\n return parts;\n}\n\nfunction getHighlightQuery(query: string): string {\n const fragments: string[] = [];\n let lastIndex = 0;\n let foundOperator = false;\n\n for (const match of query.matchAll(SEARCH_OPERATOR_RE)) {\n foundOperator = true;\n fragments.push(query.slice(lastIndex, match.index));\n lastIndex = (match.index ?? 0) + match[0].length;\n }\n\n if (!foundOperator) {\n return query;\n }\n\n fragments.push(query.slice(lastIndex));\n return fragments\n .map((fragment) => fragment.trim())\n .filter(Boolean)\n .join(' ');\n}\n\nexport function SearchView({\n contacts,\n channels,\n visibilityVersion = 0,\n onNavigateToMessage,\n prefillRequest = null,\n}: SearchViewProps) {\n const [query, setQuery] = useState('');\n const [debouncedQuery, setDebouncedQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>([]);\n const [loading, setLoading] = useState(false);\n const [hasMore, setHasMore] = useState(false);\n const [offset, setOffset] = useState(0);\n const abortRef = useRef<AbortController | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const highlightQuery = getHighlightQuery(debouncedQuery);\n\n // Debounce query\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedQuery(query.trim());\n }, DEBOUNCE_MS);\n return () => clearTimeout(timer);\n }, [query]);\n\n // Reset results when query changes\n useEffect(() => {\n setResults([]);\n setOffset(0);\n setHasMore(false);\n }, [debouncedQuery, visibilityVersion]);\n\n useEffect(() => {\n if (!prefillRequest) {\n return;\n }\n\n const nextQuery = prefillRequest.query.trim();\n setQuery(nextQuery);\n setDebouncedQuery(nextQuery);\n inputRef.current?.focus();\n }, [prefillRequest]);\n\n useEffect(() => {\n return () => {\n abortRef.current?.abort();\n };\n }, []);\n\n // Fetch search results\n useEffect(() => {\n if (!debouncedQuery) {\n setResults([]);\n setHasMore(false);\n return;\n }\n\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n api\n .getMessages({ q: debouncedQuery, limit: SEARCH_PAGE_SIZE, offset: 0 }, controller.signal)\n .then((data) => {\n setResults(data as SearchResult[]);\n setHasMore(data.length >= SEARCH_PAGE_SIZE);\n setOffset(data.length);\n })\n .catch((err) => {\n if (!isAbortError(err)) {\n console.error('Search failed:', err);\n }\n })\n .finally(() => {\n setLoading(false);\n });\n\n return () => controller.abort();\n }, [debouncedQuery, visibilityVersion]);\n\n const loadMore = useCallback(() => {\n if (!debouncedQuery || loading) return;\n\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n api\n .getMessages({ q: debouncedQuery, limit: SEARCH_PAGE_SIZE, offset }, controller.signal)\n .then((data) => {\n setResults((preLine truncated
{"version":3,"file":"SearchView-Dcvv4c8P.js","sources":["../../src/components/SearchView.tsx"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\nimport { api, isAbortError } from '../api';\nimport type { Contact, Channel } from '../types';\nimport { formatTime } from '../utils/messageParser';\nimport { Input } from './ui/input';\nimport { Button } from './ui/button';\nimport { cn } from '@/lib/utils';\n\nconst SEARCH_PAGE_SIZE = 50;\nconst DEBOUNCE_MS = 300;\n\ninterface SearchResult {\n id: number;\n type: 'PRIV' | 'CHAN';\n conversation_key: string;\n text: string;\n received_at: number;\n outgoing: boolean;\n sender_name: string | null;\n}\n\nconst SEARCH_OPERATOR_RE = /(?<!\\S)(user|channel):(?:\"((?:[^\"\\\\]|\\\\.)*)\"|(\\S+))/gi;\n\nexport interface SearchNavigateTarget {\n id: number;\n type: 'PRIV' | 'CHAN';\n conversation_key: string;\n conversation_name: string;\n}\n\nexport interface SearchViewProps {\n contacts: Contact[];\n channels: Channel[];\n visibilityVersion?: number;\n onNavigateToMessage: (target: SearchNavigateTarget) => void;\n prefillRequest?: {\n query: string;\n nonce: number;\n } | null;\n}\n\nfunction highlightMatch(text: string, query: string): React.ReactNode[] {\n if (!query) return [text];\n const parts: React.ReactNode[] = [];\n const regex = new RegExp(`(${query.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')})`, 'gi');\n const segments = text.split(regex);\n for (let i = 0; i < segments.length; i++) {\n if (regex.test(segments[i])) {\n parts.push(\n <mark key={i} className=\"bg-primary/30 text-foreground rounded-sm px-0.5\">\n {segments[i]}\n </mark>\n );\n } else {\n parts.push(segments[i]);\n }\n // Reset lastIndex since we're using test() in a loop\n regex.lastIndex = 0;\n }\n return parts;\n}\n\nfunction getHighlightQuery(query: string): string {\n const fragments: string[] = [];\n let lastIndex = 0;\n let foundOperator = false;\n\n for (const match of query.matchAll(SEARCH_OPERATOR_RE)) {\n foundOperator = true;\n fragments.push(query.slice(lastIndex, match.index));\n lastIndex = (match.index ?? 0) + match[0].length;\n }\n\n if (!foundOperator) {\n return query;\n }\n\n fragments.push(query.slice(lastIndex));\n return fragments\n .map((fragment) => fragment.trim())\n .filter(Boolean)\n .join(' ');\n}\n\nexport function SearchView({\n contacts,\n channels,\n visibilityVersion = 0,\n onNavigateToMessage,\n prefillRequest = null,\n}: SearchViewProps) {\n const [query, setQuery] = useState('');\n const [debouncedQuery, setDebouncedQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>([]);\n const [loading, setLoading] = useState(false);\n const [hasMore, setHasMore] = useState(false);\n const [offset, setOffset] = useState(0);\n const abortRef = useRef<AbortController | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const highlightQuery = getHighlightQuery(debouncedQuery);\n\n // Debounce query\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedQuery(query.trim());\n }, DEBOUNCE_MS);\n return () => clearTimeout(timer);\n }, [query]);\n\n // Reset results when query changes\n useEffect(() => {\n setResults([]);\n setOffset(0);\n setHasMore(false);\n }, [debouncedQuery, visibilityVersion]);\n\n useEffect(() => {\n if (!prefillRequest) {\n return;\n }\n\n const nextQuery = prefillRequest.query.trim();\n setQuery(nextQuery);\n setDebouncedQuery(nextQuery);\n inputRef.current?.focus();\n }, [prefillRequest]);\n\n useEffect(() => {\n return () => {\n abortRef.current?.abort();\n };\n }, []);\n\n // Fetch search results\n useEffect(() => {\n if (!debouncedQuery) {\n setResults([]);\n setHasMore(false);\n return;\n }\n\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n api\n .getMessages({ q: debouncedQuery, limit: SEARCH_PAGE_SIZE, offset: 0 }, controller.signal)\n .then((data) => {\n setResults(data as SearchResult[]);\n setHasMore(data.length >= SEARCH_PAGE_SIZE);\n setOffset(data.length);\n })\n .catch((err) => {\n if (!isAbortError(err)) {\n console.error('Search failed:', err);\n }\n })\n .finally(() => {\n setLoading(false);\n });\n\n return () => controller.abort();\n }, [debouncedQuery, visibilityVersion]);\n\n const loadMore = useCallback(() => {\n if (!debouncedQuery || loading) return;\n\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n api\n .getMessages({ q: debouncedQuery, limit: SEARCH_PAGE_SIZE, offset }, controller.signal)\n .then((data) => {\n setResults((preLine truncated
@@ -1,5 +1,5 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BotCodeEditor-C20Gx7-Q.js","assets/index-Fnq3QmNw.js","assets/index-Kkb-Bio9.css"])))=>i.map(i=>d[i]);
import{c as Xe,r as o,s as ze,j as e,L as c,B as F,I as x,t as N,g as hs,T as gs,a as fs,b as js,d as $e,e as Ke,f as bs,C as We,h as vs,i as ys,k as V,l as xe,_ as Ns,m as ws,S as _s,n as ks}from"./index-Fnq3QmNw.js";import{S as b}from"./separator-BwjFWJb_.js";/**
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BotCodeEditor-D8HqJbrh.js","assets/index-CyRLXsJ_.js","assets/index-Kkb-Bio9.css"])))=>i.map(i=>d[i]);
import{c as Xe,r as o,s as ze,j as e,L as c,B as F,I as x,t as N,g as hs,T as gs,a as fs,b as js,d as $e,e as Ke,f as bs,C as We,h as vs,i as ys,k as V,l as xe,_ as Ns,m as ws,S as _s,n as ks}from"./index-CyRLXsJ_.js";import{S as b}from"./separator-CrdYjM_C.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -9,7 +9,7 @@ import{c as Xe,r as o,s as ze,j as e,L as c,B as F,I as x,t as N,g as hs,T as gs
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ts=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Es=Xe("message-square",Ts),pe=[{name:"USA/Canada",freq:910.525,bw:62.5,sf:7,cr:5},{name:"Australia",freq:915.8,bw:250,sf:10,cr:5},{name:"Australia (narrow)",freq:916.575,bw:62.5,sf:7,cr:8},{name:"Australia SA, WA",freq:923.125,bw:62.5,sf:8,cr:8},{name:"Australia QLD",freq:923.125,bw:62.5,sf:8,cr:5},{name:"New Zealand",freq:917.375,bw:250,sf:11,cr:5},{name:"New Zealand (narrow)",freq:917.375,bw:62.5,sf:7,cr:5},{name:"EU/UK/Switzerland Long Range",freq:869.525,bw:250,sf:11,cr:5},{name:"EU/UK/Switzerland Medium Range",freq:869.525,bw:250,sf:10,cr:5},{name:"EU/UK/Switzerland Narrow",freq:869.618,bw:62.5,sf:8,cr:8},{name:"Czech Republic (Narrow)",freq:869.432,bw:62.5,sf:7,cr:5},{name:"EU 433MHz Long Range",freq:433.65,bw:250,sf:11,cr:5},{name:"Portugal 433MHz",freq:433.375,bw:62.5,sf:9,cr:6},{name:"Portugal 868MHz",freq:869.618,bw:62.5,sf:7,cr:6},{name:"Vietnam",freq:920.25,bw:250,sf:11,cr:5}];function Fs({config:s,health:t,appSettings:n,pageMode:a,onSave:d,onSaveAppSettings:w,onSetPrivateKey:S,onReboot:j,onDisconnect:_,onReconnect:h,onAdvertise:p,meshDiscovery:v,meshDiscoveryLoadingTarget:C,onDiscoverMesh:M,onClose:I,className:K}){const[U,L]=o.useState(""),[R,q]=o.useState(""),[B,O]=o.useState(""),[W,G]=o.useState(""),[m,A]=o.useState(""),[X,u]=o.useState(""),[y,T]=o.useState(""),[H,se]=o.useState(""),[re,Y]=o.useState("0"),[Q,E]=o.useState("current"),[J,z]=o.useState(!1),[i,l]=o.useState(!1),[f,g]=o.useState(!1),[D,Z]=o.useState(null),[P,je]=o.useState(""),[be,ve]=o.useState(!1),[ye,Ne]=o.useState(!1),[we,le]=o.useState(null),[_e,ke]=o.useState("0"),[ue,Se]=o.useState(""),[Ce,Te]=o.useState(""),[Ee,Fe]=o.useState(!1),[Ae,Me]=o.useState(null),[Le,qe]=o.useState(!1),[Pe,Re]=o.useState(null),[De,Ie]=o.useState(!1);o.useEffect(()=>{L(s.name),q(String(s.lat)),O(String(s.lon)),G(String(s.tx_power)),A(String(s.radio.freq)),u(String(s.radio.bw)),T(String(s.radio.sf)),se(String(s.radio.cr)),Y(String(s.path_hash_mode)),E(s.advert_location_source??"current")},[s]),o.useEffect(()=>{ke(String(Math.round(n.advert_interval/3600))),Se(ze(n.flood_scope)),Te(String(n.max_radio_contacts))},[n]);const as=o.useMemo(()=>{const r=parseFloat(m),k=parseFloat(X),ee=parseInt(y,10),te=parseInt(H,10);for(const ae of pe)if(ae.freq===r&&ae.bw===k&&ae.sf===ee&&ae.cr===te)return ae.name;return"custom"},[m,X,y,H]),rs=r=>{if(r==="custom")return;const k=pe.find(ee=>ee.name===r);k&&(A(String(k.freq)),u(String(k.bw)),T(String(k.sf)),se(String(k.cr)))},ns=()=>{if(!navigator.geolocation){N.error("Geolocation not supported",{description:"Your browser does not support geolocation"});return}z(!0),navigator.geolocation.getCurrentPosition(r=>{q(r.coords.latitude.toFixed(6)),O(r.coords.longitude.toFixed(6)),z(!1),N.success("Location updated")},r=>{z(!1),N.error("Failed to get location",{description:r.message})},{enableHighAccuracy:!0,timeout:1e4})},Be=()=>{const r=parseFloat(R),k=parseFloat(B),ee=parseInt(W,10),te=parseFloat(m),ae=parseFloat(X),Ue=parseInt(y,10),He=parseInt(H,10);if([r,k,ee,te,ae,Ue,He].some(ps=>isNaN(ps)))return Z("All numeric fields must have valid values"),null;const me=parseInt(re,10);return{name:U,lat:r,lon:k,tx_power:ee,...Q!==(s.advert_location_source??"current")?{advert_location_source:Q}:{},radio:{freq:te,bw:ae,sf:Ue,cr:He},...s.path_hash_mode_supported&&!isNaN(me)&&me!==s.path_hash_mode?{path_hash_mode:me}:{}}},os=async()=>{Z(null);const r=Be();if(r){l(!0);try{await d(r),N.success("Radio config saved")}catch(k){Z(k instanceof Error?k.message:"Failed to save")}finally{l(!1)}}},is=async()=>{Z(null);const r=Be();if(r){l(!0);try{await d(r),N.success("Radio config saved, rebooting..."),g(!0),await j(),a||I()}catch(k){Z(k instanceof Error?k.message:"Failed to save")}finally{g(!1),l(!1)}}},cs=async()=>{if(!P.trim()){le("Private key is required");return}le(null),ve(!0);try{await S(P.trim()),je(""),N.success("Private key set, rebooting..."),Ne(!0),await j(),a||I()}catch(r){le(r instanceof Error?r.message:"Failed to set private key")}finally{Ne(!1),ve(!1)}},ds=async()=>{Me(null),Fe(!0);try{const r={},k=parseInt(_e,10),ee=isNaN(k)?0:k*3600;ee!==n.advert_interval&&(r.advert_interval=ee),ue!==ze(n.flood_scope)&&(r.flood_scope=ue);const te=parseInt(Ce,10);!isNaN(te)&&te!==n.max_radio_contacts&&(r.max_radio_contacts=te),Object.keys(r).length>0&&await w(r),N.success("Settings saved")}catch(r){Me(r instanceof Error?r.message:"Failed to save")}finally{Fe(!1)}},ls=async()=>{qe(!0);try{await p()}finally{qe(!1)}},us=async r=>{Re(null);try{await M(r)}catch(k){Re(k instanceof Error?k.message:"Failed to run mesh discovery")}},$=(t==null?void 0:t.radio_state)??(t!=null&&t.radio_initializing?"initializing":"disconnected"),Oe=$==="paused"?"Reconnect":$==="connected"||$==="initializing"?"Disconnect":"Stop Trying",ms=$==="connected"?(t==null?void 0:t.connection_info)||"Connected":$==="initializing"?`ILine truncated
*/const Ts=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Es=Xe("message-square",Ts),pe=[{name:"USA/Canada",freq:910.525,bw:62.5,sf:7,cr:5},{name:"Australia",freq:915.8,bw:250,sf:10,cr:5},{name:"Australia (narrow)",freq:916.575,bw:62.5,sf:7,cr:8},{name:"Australia SA, WA",freq:923.125,bw:62.5,sf:8,cr:8},{name:"Australia QLD",freq:923.125,bw:62.5,sf:8,cr:5},{name:"New Zealand",freq:917.375,bw:250,sf:11,cr:5},{name:"New Zealand (narrow)",freq:917.375,bw:62.5,sf:7,cr:5},{name:"EU/UK/Switzerland Long Range",freq:869.525,bw:250,sf:11,cr:5},{name:"EU/UK/Switzerland Medium Range",freq:869.525,bw:250,sf:10,cr:5},{name:"EU/UK/Switzerland Narrow",freq:869.618,bw:62.5,sf:8,cr:8},{name:"Czech Republic (Narrow)",freq:869.432,bw:62.5,sf:7,cr:5},{name:"EU 433MHz Long Range",freq:433.65,bw:250,sf:11,cr:5},{name:"Portugal 433MHz",freq:433.375,bw:62.5,sf:9,cr:6},{name:"Portugal 868MHz",freq:869.618,bw:62.5,sf:7,cr:6},{name:"Vietnam",freq:920.25,bw:250,sf:11,cr:5}];function Fs({config:s,health:t,appSettings:n,pageMode:a,onSave:d,onSaveAppSettings:w,onSetPrivateKey:S,onReboot:j,onDisconnect:_,onReconnect:h,onAdvertise:p,meshDiscovery:v,meshDiscoveryLoadingTarget:C,onDiscoverMesh:M,onClose:I,className:K}){const[U,L]=o.useState(""),[R,q]=o.useState(""),[B,O]=o.useState(""),[W,G]=o.useState(""),[m,A]=o.useState(""),[X,u]=o.useState(""),[y,T]=o.useState(""),[H,se]=o.useState(""),[re,Y]=o.useState("0"),[Q,E]=o.useState("current"),[J,z]=o.useState(!1),[i,l]=o.useState(!1),[f,g]=o.useState(!1),[D,Z]=o.useState(null),[P,je]=o.useState(""),[be,ve]=o.useState(!1),[ye,Ne]=o.useState(!1),[we,le]=o.useState(null),[_e,ke]=o.useState("0"),[ue,Se]=o.useState(""),[Ce,Te]=o.useState(""),[Ee,Fe]=o.useState(!1),[Ae,Me]=o.useState(null),[Le,qe]=o.useState(!1),[Pe,Re]=o.useState(null),[De,Ie]=o.useState(!1);o.useEffect(()=>{L(s.name),q(String(s.lat)),O(String(s.lon)),G(String(s.tx_power)),A(String(s.radio.freq)),u(String(s.radio.bw)),T(String(s.radio.sf)),se(String(s.radio.cr)),Y(String(s.path_hash_mode)),E(s.advert_location_source??"current")},[s]),o.useEffect(()=>{ke(String(Math.round(n.advert_interval/3600))),Se(ze(n.flood_scope)),Te(String(n.max_radio_contacts))},[n]);const as=o.useMemo(()=>{const r=parseFloat(m),k=parseFloat(X),ee=parseInt(y,10),te=parseInt(H,10);for(const ae of pe)if(ae.freq===r&&ae.bw===k&&ae.sf===ee&&ae.cr===te)return ae.name;return"custom"},[m,X,y,H]),rs=r=>{if(r==="custom")return;const k=pe.find(ee=>ee.name===r);k&&(A(String(k.freq)),u(String(k.bw)),T(String(k.sf)),se(String(k.cr)))},ns=()=>{if(!navigator.geolocation){N.error("Geolocation not supported",{description:"Your browser does not support geolocation"});return}z(!0),navigator.geolocation.getCurrentPosition(r=>{q(r.coords.latitude.toFixed(6)),O(r.coords.longitude.toFixed(6)),z(!1),N.success("Location updated")},r=>{z(!1),N.error("Failed to get location",{description:r.message})},{enableHighAccuracy:!0,timeout:1e4})},Be=()=>{const r=parseFloat(R),k=parseFloat(B),ee=parseInt(W,10),te=parseFloat(m),ae=parseFloat(X),Ue=parseInt(y,10),He=parseInt(H,10);if([r,k,ee,te,ae,Ue,He].some(ps=>isNaN(ps)))return Z("All numeric fields must have valid values"),null;const me=parseInt(re,10);return{name:U,lat:r,lon:k,tx_power:ee,...Q!==(s.advert_location_source??"current")?{advert_location_source:Q}:{},radio:{freq:te,bw:ae,sf:Ue,cr:He},...s.path_hash_mode_supported&&!isNaN(me)&&me!==s.path_hash_mode?{path_hash_mode:me}:{}}},os=async()=>{Z(null);const r=Be();if(r){l(!0);try{await d(r),N.success("Radio config saved")}catch(k){Z(k instanceof Error?k.message:"Failed to save")}finally{l(!1)}}},is=async()=>{Z(null);const r=Be();if(r){l(!0);try{await d(r),N.success("Radio config saved, rebooting..."),g(!0),await j(),a||I()}catch(k){Z(k instanceof Error?k.message:"Failed to save")}finally{g(!1),l(!1)}}},cs=async()=>{if(!P.trim()){le("Private key is required");return}le(null),ve(!0);try{await S(P.trim()),je(""),N.success("Private key set, rebooting..."),Ne(!0),await j(),a||I()}catch(r){le(r instanceof Error?r.message:"Failed to set private key")}finally{Ne(!1),ve(!1)}},ds=async()=>{Me(null),Fe(!0);try{const r={},k=parseInt(_e,10),ee=isNaN(k)?0:k*3600;ee!==n.advert_interval&&(r.advert_interval=ee),ue!==ze(n.flood_scope)&&(r.flood_scope=ue);const te=parseInt(Ce,10);!isNaN(te)&&te!==n.max_radio_contacts&&(r.max_radio_contacts=te),Object.keys(r).length>0&&await w(r),N.success("Settings saved")}catch(r){Me(r instanceof Error?r.message:"Failed to save")}finally{Fe(!1)}},ls=async()=>{qe(!0);try{await p()}finally{qe(!1)}},us=async r=>{Re(null);try{await M(r)}catch(k){Re(k instanceof Error?k.message:"Failed to run mesh discovery")}},$=(t==null?void 0:t.radio_state)??(t!=null&&t.radio_initializing?"initializing":"disconnected"),Oe=$==="paused"?"Reconnect":$==="connected"||$==="initializing"?"Disconnect":"Stop Trying",ms=$==="connected"?(t==null?void 0:t.connection_info)||"Connected":$==="initializing"?`ILine truncated
`).map(d=>d.trim()).filter(Boolean);if(n.length===0)return"No targets configured";const a=n.join(", ");return a.length<=t?a:`${a.slice(0,t-3)}...`}function Is(s){const t=(s.queue_url||"").trim();return t||"No queue configured"}function Bs(s,t){const n=Ze[s]||s,a=t.filter(d=>d.type===s).length+1;return`${n} #${a}`}const ts=`def bot(**kwargs) -> str | list[str] | None:
"""
Process messages and optionally return a reply.
@@ -46,5 +46,5 @@ import{c as Xe,r as o,s as ze,j as e,L as c,B as F,I as x,t as N,g as hs,T as gs
return "[BOT] Plong!"
return None`;function Je(s,t){return s==="connected"?t==="bot"||t==="webhook"||t==="apprise"?"Active":"Connected":s==="error"?"Error":s==="disconnected"?"Disconnected":"Inactive"}function Os(s,t){return t===!1?"bg-muted-foreground":s==="connected"?"bg-status-connected shadow-[0_0_6px_hsl(var(--status-connected)/0.5)]":s==="error"||s==="disconnected"?"bg-destructive shadow-[0_0_6px_hsl(var(--destructive)/0.5)]":"bg-muted-foreground"}function Us({config:s,scope:t,onChange:n,onScopeChange:a}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Forward mesh data to your own MQTT broker for home automation, logging, or alerting."}),e.jsx("div",{className:"rounded-md border border-warning/50 bg-warning/10 px-3 py-2 text-xs text-warning",children:"Outgoing messages (DMs and group messages) will be reported to private MQTT brokers in decrypted/plaintext form."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-mqtt-host",children:"Broker Host"}),e.jsx(x,{id:"fanout-mqtt-host",type:"text",placeholder:"e.g. 192.168.1.100",value:s.broker_host||"",onChange:d=>n({...s,broker_host:d.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-mqtt-port",children:"Broker Port"}),e.jsx(x,{id:"fanout-mqtt-port",type:"number",min:"1",max:"65535",value:s.broker_port||1883,onChange:d=>n({...s,broker_port:parseInt(d.target.value,10)||1883})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-mqtt-user",children:"Username"}),e.jsx(x,{id:"fanout-mqtt-user",type:"text",placeholder:"Optional",value:s.username||"",onChange:d=>n({...s,username:d.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-mqtt-pass",children:"Password"}),e.jsx(x,{id:"fanout-mqtt-pass",type:"password",placeholder:"Optional",value:s.password||"",onChange:d=>n({...s,password:d.target.value})})]})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:!!s.use_tls,onChange:d=>n({...s,use_tls:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsx("span",{className:"text-sm",children:"Use TLS"})]}),!!s.use_tls&&e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer ml-7",children:[e.jsx("input",{type:"checkbox",checked:!!s.tls_insecure,onChange:d=>n({...s,tls_insecure:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsx("span",{className:"text-sm",children:"Skip certificate verification"})]}),e.jsx(b,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-mqtt-prefix",children:"Topic Prefix"}),e.jsx(x,{id:"fanout-mqtt-prefix",type:"text",value:s.topic_prefix||"meshcore",onChange:d=>n({...s,topic_prefix:d.target.value})})]}),e.jsx(b,{}),e.jsx(de,{scope:t,onChange:a,showRawPackets:!0})]})}function Hs({config:s,onChange:t}){const n=s.auth_mode||ss;return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Share raw packet data with the MeshCore community for coverage mapping and network analysis. Only raw RF packets are shared — never decrypted messages."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-comm-host",children:"Broker Host"}),e.jsx(x,{id:"fanout-comm-host",type:"text",placeholder:oe,value:s.broker_host||oe,onChange:a=>t({...s,broker_host:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-comm-port",children:"Broker Port"}),e.jsx(x,{id:"fanout-comm-port",type:"number",min:"1",max:"65535",value:s.broker_port||ce,onChange:a=>t({...s,broker_port:parseInt(a.target.value,10)||ce})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-comm-transport",children:"Transport"}),e.jsxs("select",{id:"fanout-comm-transport",value:s.transport||es,onChange:a=>t({...s,transport:a.target.value}),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"websockets",children:"WebSockets"}),e.jsx("option",{value:"tcp",children:"TCP"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-comm-auth-mode",children:"Authentication"}),e.jsxs("select",{id:"fanout-comm-auth-mode",value:n,onChange:a=>t({...s,auth_mode:a.target.value}),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"token",children:"Token"}),e.jsx("option",{value:"none",children:"None"}),e.jsx("option",{value:"password",children:"Username / Password"})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["LetsMes Line truncated
slack://token_a/token_b/token_c
tgram://bot_token/chat_id`,value:s.urls||"",onChange:d=>n({...s,urls:d.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One URL per line. All URLs receive every matched notification."})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.preserve_identity!==!1,onChange:d=>n({...s,preserve_identity:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm",children:"Preserve identity on Discord"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"When enabled, Discord webhooks will use their configured name/avatar instead of overriding with MeshCore sender info."})]})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.include_path!==!1,onChange:d=>n({...s,include_path:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsx("span",{className:"text-sm",children:"Include routing path in notifications"})]}),e.jsx(b,{}),e.jsx(de,{scope:t,onChange:a})]})}function Ws({config:s,scope:t,onChange:n,onScopeChange:a}){const d=JSON.stringify(s.headers??{},null,2),[w,S]=o.useState(d),[j,_]=o.useState(null),h=p=>{S(p);try{const v=JSON.parse(p);if(typeof v!="object"||Array.isArray(v)){_("Must be a JSON object");return}_(null),n({...s,headers:v})}catch{_("Invalid JSON")}};return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Send message data as JSON to an HTTP endpoint when messages are received."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-url",children:"URL"}),e.jsx(x,{id:"fanout-webhook-url",type:"url",placeholder:"https://example.com/webhook",value:s.url||"",onChange:p=>n({...s,url:p.target.value})})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-method",children:"HTTP Method"}),e.jsxs("select",{id:"fanout-webhook-method",value:s.method||"POST",onChange:p=>n({...s,method:p.target.value}),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"POST",children:"POST"}),e.jsx("option",{value:"PUT",children:"PUT"}),e.jsx("option",{value:"PATCH",children:"PATCH"})]})]})}),e.jsx(b,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(c,{children:"HMAC Signing"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["When a secret is set, each request includes an HMAC-SHA256 signature of the JSON body in the specified header (e.g. ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"sha256=ab12cd..."}),")."]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-hmac-secret",children:"HMAC Secret"}),e.jsx(x,{id:"fanout-webhook-hmac-secret",type:"password",placeholder:"Leave empty to disable signing",value:s.hmac_secret||"",onChange:p=>n({...s,hmac_secret:p.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-hmac-header",children:"Signature Header Name"}),e.jsx(x,{id:"fanout-webhook-hmac-header",type:"text",placeholder:"X-Webhook-Signature",value:s.hmac_header||"",onChange:p=>n({...s,hmac_header:p.target.value})})]})]})]}),e.jsx(b,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-headers",children:"Extra Headers (JSON)"}),e.jsx("textarea",{id:"fanout-webhook-headers",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono min-h-[60px]",value:w,onChange:p=>h(p.target.value),placeholder:'{"Authorization": "Bearer ..."}'}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j})]}),e.jsx(b,{}),e.jsx(de,{scope:t,onChange:a})]})}function Gs({config:s,scope:t,onChange:n,onScopeChange:a}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Send matched mesh events to an Amazon SQS queue for durable processing by workers, Lambdas, or downstream automation."}),e.jsx("div",{className:"rounded-md border border-warning/50 bg-warning/10 px-3 py-2 text-xs text-warning",children:"Outgoing messages and any selected raw packets will be delivered exactly as forwarded by the fanout scope, including decrypted/plaintext message content."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-sqs-queue-url",children:"Queue URL"}),e.jsx(x,{id:"fanout-sqs-queue-url",type:"url",placeholder:"https://sqs.us-east-1.amazonaws.com/123456789012/mesh-events",value:s.queue_url||"",onChange:d=>n({...s,queue_url:d.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-sqs-region",children:"Region (optional)"}),e.jsx(x Line truncated
//# sourceMappingURL=SettingsModal-BPGiDC12.js.map
tgram://bot_token/chat_id`,value:s.urls||"",onChange:d=>n({...s,urls:d.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One URL per line. All URLs receive every matched notification."})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.preserve_identity!==!1,onChange:d=>n({...s,preserve_identity:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm",children:"Preserve identity on Discord"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"When enabled, Discord webhooks will use their configured name/avatar instead of overriding with MeshCore sender info."})]})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.include_path!==!1,onChange:d=>n({...s,include_path:d.target.checked}),className:"h-4 w-4 rounded border-border"}),e.jsx("span",{className:"text-sm",children:"Include routing path in notifications"})]}),e.jsx(b,{}),e.jsx(de,{scope:t,onChange:a})]})}function Ws({config:s,scope:t,onChange:n,onScopeChange:a}){const d=JSON.stringify(s.headers??{},null,2),[w,S]=o.useState(d),[j,_]=o.useState(null),h=p=>{S(p);try{const v=JSON.parse(p);if(typeof v!="object"||Array.isArray(v)){_("Must be a JSON object");return}_(null),n({...s,headers:v})}catch{_("Invalid JSON")}};return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Send message data as JSON to an HTTP endpoint when messages are received."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-url",children:"URL"}),e.jsx(x,{id:"fanout-webhook-url",type:"url",placeholder:"https://example.com/webhook",value:s.url||"",onChange:p=>n({...s,url:p.target.value})})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-method",children:"HTTP Method"}),e.jsxs("select",{id:"fanout-webhook-method",value:s.method||"POST",onChange:p=>n({...s,method:p.target.value}),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"POST",children:"POST"}),e.jsx("option",{value:"PUT",children:"PUT"}),e.jsx("option",{value:"PATCH",children:"PATCH"})]})]})}),e.jsx(b,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(c,{children:"HMAC Signing"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["When a secret is set, each request includes an HMAC-SHA256 signature of the JSON body in the specified header (e.g. ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"sha256=ab12cd..."}),")."]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-hmac-secret",children:"HMAC Secret"}),e.jsx(x,{id:"fanout-webhook-hmac-secret",type:"password",placeholder:"Leave empty to disable signing",value:s.hmac_secret||"",onChange:p=>n({...s,hmac_secret:p.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-hmac-header",children:"Signature Header Name"}),e.jsx(x,{id:"fanout-webhook-hmac-header",type:"text",placeholder:"X-Webhook-Signature",value:s.hmac_header||"",onChange:p=>n({...s,hmac_header:p.target.value})})]})]})]}),e.jsx(b,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-webhook-headers",children:"Extra Headers (JSON)"}),e.jsx("textarea",{id:"fanout-webhook-headers",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono min-h-[60px]",value:w,onChange:p=>h(p.target.value),placeholder:'{"Authorization": "Bearer ..."}'}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j})]}),e.jsx(b,{}),e.jsx(de,{scope:t,onChange:a})]})}function Gs({config:s,scope:t,onChange:n,onScopeChange:a}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Send matched mesh events to an Amazon SQS queue for durable processing by workers, Lambdas, or downstream automation."}),e.jsx("div",{className:"rounded-md border border-warning/50 bg-warning/10 px-3 py-2 text-xs text-warning",children:"Outgoing messages and any selected raw packets will be delivered exactly as forwarded by the fanout scope, including decrypted/plaintext message content."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-sqs-queue-url",children:"Queue URL"}),e.jsx(x,{id:"fanout-sqs-queue-url",type:"url",placeholder:"https://sqs.us-east-1.amazonaws.com/123456789012/mesh-events",value:s.queue_url||"",onChange:d=>n({...s,queue_url:d.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fanout-sqs-region",children:"Region (optional)"}),e.jsx(x Line truncated
//# sourceMappingURL=SettingsModal-kexfpcq5.js.map
@@ -1 +1 @@
{"version":3,"mappings":";sQAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,kGACH,IAAK,QACX,CACA,EACE,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,IAAK,EAAG,IAAK,IAAK,SAAU,EACvD,CACE,OACA,CACE,EAAG,qHACH,IAAK,QACX,CACA,CACA,EACMC,GAAYC,GAAiB,aAAcF,EAAU,EC1B3D;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,sHACH,IAAK,QACX,CACA,CACA,EACMG,GAAgBD,GAAiB,iBAAkBF,EAAU,ECTtDI,GAA+B,CAC1C,CAAE,KAAM,aAAc,KAAM,QAAS,GAAI,KAAM,GAAI,EAAG,GAAI,GAC1D,CAAE,KAAM,YAAa,KAAM,MAAO,GAAI,IAAK,GAAI,GAAI,GAAI,GACvD,CAAE,KAAM,qBAAsB,KAAM,QAAS,GAAI,KAAM,GAAI,EAAG,GAAI,GAClE,CAAE,KAAM,mBA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a0 as _o,a1 as xo,a2 as vo,l as Mo}from"./index-Fnq3QmNw.js";/**
import{c as ql,V as Qc,W as ft,U as Xs,j as J,X as an,r as he,Y as eu,k as tu,Z as nu,$ as iu,a0 as _o,a1 as xo,a2 as vo,l as Mo}from"./index-CyRLXsJ_.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -4027,4 +4027,4 @@ void main() {
}
}`;class f0{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new Oc(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new mn({vertexShader:u0,fragmentShader:h0,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new pn(new rs(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class d0 extends ni{constructor(e,t){super();const i=this;let r=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,f=null,d=null,m=null,g=null;const x=typeof XRWebGLBinding<"u",p=new f0,u={},y=t.getContextAttributes();let v=null,M=null;const b=[],w=[],R=new Ge;let I=null;const S=new Zt;S.viewport=new mt;const T=new Zt;T.viewport=new mt;const P=[S,T],B=new Sd;let z=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let Q=b[Y];return Q===void 0&&(Q=new Is,b[Y]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(Y){let Q=b[Y];return Q===void 0&&(Q=new Is,b[Y]=Q),Q.getGripSpace()},this.getHand=function(Y){let Q=b[Y];return Q===void 0&&(Q=new Is,b[Y]=Q),Q.getHandSpace()};function K(Y){const Q=w.indexOf(Y.inputSource);if(Q===-1)return;const ge=b[Q];ge!==void 0&&(ge.update(Y.inputSource,Y.frame,c||a),ge.dispatchEvent({type:Y.type,data:Y.inputSource}))}function L(){r.removeEventListener("select",K),r.removeEventListener("selectstart",K),r.removeEventListener("selectend",K),r.removeEventListener("squeeze",K),r.removeEventListener("squeezestart",K),r.removeEventListener("squeezeend",K),r.removeEventListener("end",L),r.removeEventListener("inputsourceschange",k);for(let Y=0;Y<b.length;Y++){const Q=w[Y];Q!==null&&(w[Y]=null,b[Y].disconnect(Q))}z=null,j=null,p.reset();for(const Y in u)delete u[Y];e.setRenderTarget(v),m=null,d=null,f=null,r=null,M=null,Se.stop(),i.isPresenting=!1,e.setPixelRatio(I),e.setSize(R.width,R.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,i.isPresenting===!0&&Be("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,i.isPresenting===!0&&Be("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return d!==null?d:m},this.getBinding=function(){return f===null&&x&&(f=new XRWebGLBinding(r,t)),f},this.getFrame=function(){return g},this.getSession=function(){return r},this.setSession=async function(Y){if(r=Y,r!==null){if(v=e.getRenderTarget(),r.addEventListener("select",K),r.addEventListener("selectstart",K),r.addEventListener("selectend",K),r.addEventListener("squeeze",K),r.addEventListener("squeezestart",K),r.addEventListener("squeezeend",K),r.addEventListener("end",L),r.addEventListener("inputsourceschange",k),y.xrCompatible!==!0&&await t.makeXRCompatible(),I=e.getPixelRatio(),e.getSize(R),x&&"createProjectionLayer"in XRWebGLBinding.prototype){let ge=null,Ce=null,le=null;y.depth&&(le=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ge=y.stencil?Jn:Cn,Ce=y.stencil?Ji:dn);const De={colorFormat:t.RGBA8,depthFormat:le,scaleFactor:s};f=this.getBinding(),d=f.createProjectionLayer(De),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),M=new fn(d.textureWidth,d.textureHeight,{format:rn,type:Jt,depthTexture:new er(d.textureWidth,d.textureHeight,Ce,void 0,void 0,void 0,void 0,void 0,void 0,ge),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ge={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,ge),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),M=new fn(m.framebufferWidth,m.framebufferHeight,{format:rn,type:Jt,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}M.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await r.requestReferenceSpace(o),Se.setContext(r),Se.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function k(Y){for(let Q=0;Q<Y.removed.length;Q++){const ge=Y.removed[Q],Ce=w.indexOf(ge);Ce>=0&&(w[Ce]=null,b[Ce].disconnect(ge))}for(let Q=0;Q<Y.added.length;Q++){const ge=Y.added[Q];let Ce=w.indexOf(ge);if(Ce===-1){for(let De=0;De<b.length;De++)if(De>=w.length){w.push(ge),Ce=De;break}else if(w[De]===null){w[De]=ge,Ce=De;break}if(Ce===-1)break}const l Line truncated
//# sourceMappingURL=VisualizerView-Cv9KCsSr.js.map
//# sourceMappingURL=VisualizerView-BLZNJTl2.js.map
@@ -1 +1 @@
{"version":3,"file":"VisualizerView-Cv9KCsSr.js","sources":["../../node_modules/lucide-react/dist/esm/icons/maximize-2.js","../../node_modules/lucide-react/dist/esm/icons/minimize-2.js","../../src/utils/visualizerSettings.ts","../../src/utils/visualizerUtils.ts","../../src/components/visualizer/shared.ts","../../src/components/visualizer/VisualizerControls.tsx","../../src/components/visualizer/VisualizerTooltip.tsx","../../node_modules/d3-force-3d/src/center.js","../../node_modules/d3-binarytree/src/add.js","../../node_modules/d3-binarytree/src/cover.js","../../node_modules/d3-binarytree/src/data.js","../../node_modules/d3-binarytree/src/extent.js","../../node_modules/d3-binarytree/src/half.js","../../node_modules/d3-binarytree/src/find.js","../../node_modules/d3-binarytree/src/remove.js","../../node_modules/d3-binarytree/src/root.js","../../node_modules/d3-binarytree/src/size.js","../../node_modules/d3-binarytree/src/visit.js","../../node_modules/d3-binarytree/src/visitAfter.js","../../node_modules/d3-binarytree/src/x.js","../../node_modules/d3-binarytree/src/binarytree.js","../../node_modules/d3-quadtree/src/add.js","../../node_modules/d3-quadtree/src/cover.js","../../node_modules/d3-quadtree/src/data.js","../../node_modules/d3-quadtree/src/extent.js","../../node_modules/d3-quadtree/src/quad.js","../../node_modules/d3-quadtree/src/find.js","../../node_modules/d3-quadtree/src/remove.js","../../node_modules/d3-quadtree/src/root.js","../../node_modules/d3-quadtree/src/size.js","../../node_modules/d3-quadtree/src/visit.js","../../node_modules/d3-quadtree/src/visitAfter.js","../../node_modules/d3-quadtree/src/x.js","../../node_modules/d3-quadtree/src/y.js","../../node_modules/d3-quadtree/src/quadtree.js","../../node_modules/d3-octree/src/add.js","../../node_modules/d3-octree/src/cover.js","../../node_modules/d3-octree/src/data.js","../../node_modules/d3-octree/src/extent.js","../../node_modules/d3-octree/src/octant.js","../../node_modules/d3-octree/src/find.js","../../node_modules/d3-octree/src/findAll.js","../../node_modules/d3-octree/src/remove.js","../../node_modules/d3-octree/src/root.js","../../node_modules/d3-octree/src/size.js","../../node_modules/d3-octree/src/visit.js","../../node_modules/d3-octree/src/visitAfter.js","../../node_modules/d3-octree/src/x.js","../../node_modules/d3-octree/src/y.js","../../node_modules/d3-octree/src/z.js","../../node_modules/d3-octree/src/octree.js","../../node_modules/d3-force-3d/src/constant.js","../../node_modules/d3-force-3d/src/jiggle.js","../../node_modules/d3-force-3d/src/link.js","../../node_modules/d3-dispatch/src/dispatch.js","../../node_modules/d3-timer/src/timer.js","../../node_modules/d3-force-3d/src/lcg.js","../../node_modules/d3-force-3d/src/simulation.js","../../node_modules/d3-force-3d/src/manyBody.js","../../node_modules/d3-force-3d/src/x.js","../../node_modules/d3-force-3d/src/y.js","../../node_modules/d3-force-3d/src/z.js","../../src/networkGraph/packetNetworkGraph.ts","../../src/components/visualizer/useVisualizerData3D.ts","../../node_modules/three/build/three.core.js","../../node_modules/three/build/three.module.js","../../node_modules/three/examples/jsm/controls/OrbitControls.js","../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../src/components/visualizer/useVisualizer3DScene.ts","../../src/components/PacketVisualizer3D.tsx","../../src/components/VisualizerView.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"m21 3-7 7\", key: \"1l2asr\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M9 21H3v-6\", key: \"wtvkvv\" }]\n];\nconst Maximize2 = createLucideIcon(\"maximize-2\", __iconNode);\n\nexport { __iconNode, Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m14 10 7-7\", key: \"oa77jy\" }],\n [\"path\", { d: \"M20 10h-6V4\", key: \"mjg0md\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M4 14h6v6\", key: \"rmj7iw\" }]\n];\nconst Minimize2 = createLucideIcon(\"minimize-2\", __iconNode);\n\nexport { __iconNode, Minimize2 as default };\n//# sourceMappingURL=minimize-2.js.map\n","const VISUALIZER_SETTINGS_KEY = 'remoteterm-visualizer-settings';\n\nexport interface VisualizerSettings {\n showAmbiguousPaths: boolean;\n showAmbiguousNodes: boolean;\n useAdvertPathHints: boolean;\n collapseLikelyKnownSiblingRepeaters: boolean;\n splitAmbiguousByTraffic: boolean;\n cLine truncated
{"version":3,"file":"VisualizerView-BLZNJTl2.js","sources":["../../node_modules/lucide-react/dist/esm/icons/maximize-2.js","../../node_modules/lucide-react/dist/esm/icons/minimize-2.js","../../src/utils/visualizerSettings.ts","../../src/utils/visualizerUtils.ts","../../src/components/visualizer/shared.ts","../../src/components/visualizer/VisualizerControls.tsx","../../src/components/visualizer/VisualizerTooltip.tsx","../../node_modules/d3-force-3d/src/center.js","../../node_modules/d3-binarytree/src/add.js","../../node_modules/d3-binarytree/src/cover.js","../../node_modules/d3-binarytree/src/data.js","../../node_modules/d3-binarytree/src/extent.js","../../node_modules/d3-binarytree/src/half.js","../../node_modules/d3-binarytree/src/find.js","../../node_modules/d3-binarytree/src/remove.js","../../node_modules/d3-binarytree/src/root.js","../../node_modules/d3-binarytree/src/size.js","../../node_modules/d3-binarytree/src/visit.js","../../node_modules/d3-binarytree/src/visitAfter.js","../../node_modules/d3-binarytree/src/x.js","../../node_modules/d3-binarytree/src/binarytree.js","../../node_modules/d3-quadtree/src/add.js","../../node_modules/d3-quadtree/src/cover.js","../../node_modules/d3-quadtree/src/data.js","../../node_modules/d3-quadtree/src/extent.js","../../node_modules/d3-quadtree/src/quad.js","../../node_modules/d3-quadtree/src/find.js","../../node_modules/d3-quadtree/src/remove.js","../../node_modules/d3-quadtree/src/root.js","../../node_modules/d3-quadtree/src/size.js","../../node_modules/d3-quadtree/src/visit.js","../../node_modules/d3-quadtree/src/visitAfter.js","../../node_modules/d3-quadtree/src/x.js","../../node_modules/d3-quadtree/src/y.js","../../node_modules/d3-quadtree/src/quadtree.js","../../node_modules/d3-octree/src/add.js","../../node_modules/d3-octree/src/cover.js","../../node_modules/d3-octree/src/data.js","../../node_modules/d3-octree/src/extent.js","../../node_modules/d3-octree/src/octant.js","../../node_modules/d3-octree/src/find.js","../../node_modules/d3-octree/src/findAll.js","../../node_modules/d3-octree/src/remove.js","../../node_modules/d3-octree/src/root.js","../../node_modules/d3-octree/src/size.js","../../node_modules/d3-octree/src/visit.js","../../node_modules/d3-octree/src/visitAfter.js","../../node_modules/d3-octree/src/x.js","../../node_modules/d3-octree/src/y.js","../../node_modules/d3-octree/src/z.js","../../node_modules/d3-octree/src/octree.js","../../node_modules/d3-force-3d/src/constant.js","../../node_modules/d3-force-3d/src/jiggle.js","../../node_modules/d3-force-3d/src/link.js","../../node_modules/d3-dispatch/src/dispatch.js","../../node_modules/d3-timer/src/timer.js","../../node_modules/d3-force-3d/src/lcg.js","../../node_modules/d3-force-3d/src/simulation.js","../../node_modules/d3-force-3d/src/manyBody.js","../../node_modules/d3-force-3d/src/x.js","../../node_modules/d3-force-3d/src/y.js","../../node_modules/d3-force-3d/src/z.js","../../src/networkGraph/packetNetworkGraph.ts","../../src/components/visualizer/useVisualizerData3D.ts","../../node_modules/three/build/three.core.js","../../node_modules/three/build/three.module.js","../../node_modules/three/examples/jsm/controls/OrbitControls.js","../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../src/components/visualizer/useVisualizer3DScene.ts","../../src/components/PacketVisualizer3D.tsx","../../src/components/VisualizerView.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"m21 3-7 7\", key: \"1l2asr\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M9 21H3v-6\", key: \"wtvkvv\" }]\n];\nconst Maximize2 = createLucideIcon(\"maximize-2\", __iconNode);\n\nexport { __iconNode, Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m14 10 7-7\", key: \"oa77jy\" }],\n [\"path\", { d: \"M20 10h-6V4\", key: \"mjg0md\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M4 14h6v6\", key: \"rmj7iw\" }]\n];\nconst Minimize2 = createLucideIcon(\"minimize-2\", __iconNode);\n\nexport { __iconNode, Minimize2 as default };\n//# sourceMappingURL=minimize-2.js.map\n","const VISUALIZER_SETTINGS_KEY = 'remoteterm-visualizer-settings';\n\nexport interface VisualizerSettings {\n showAmbiguousPaths: boolean;\n showAmbiguousNodes: boolean;\n useAdvertPathHints: boolean;\n collapseLikelyKnownSiblingRepeaters: boolean;\n splitAmbiguousByTraffic: boolean;\n cLine truncated
@@ -0,0 +1,2 @@
import"./index-CyRLXsJ_.js";import{u as t}from"./leaflet-IXizDMbG.js";function r(){return t().map}export{r as u};
//# sourceMappingURL=hooks-BwtZ3ZXP.js.map
@@ -1 +1 @@
{"version":3,"file":"hooks-LL30L9PN.js","sources":["../../node_modules/react-leaflet/lib/hooks.js"],"sourcesContent":["import { useLeafletContext } from '@react-leaflet/core';\nimport { useEffect } from 'react';\nexport function useMap() {\n return useLeafletContext().map;\n}\nexport function useMapEvent(type, handler) {\n const map = useMap();\n useEffect(function addMapEventHandler() {\n // @ts-ignore event type\n map.on(type, handler);\n return function removeMapEventHandler() {\n // @ts-ignore event type\n map.off(type, handler);\n };\n }, [\n map,\n type,\n handler\n ]);\n return map;\n}\nexport function useMapEvents(handlers) {\n const map = useMap();\n useEffect(function addMapEventHandlers() {\n map.on(handlers);\n return function removeMapEventHandlers() {\n map.off(handlers);\n };\n }, [\n map,\n handlers\n ]);\n return map;\n}\n"],"names":["useMap","useLeafletContext"],"mappings":"sEAEO,SAASA,GAAS,CACrB,OAAOC,EAAiB,EAAG,GAC/B","x_google_ignoreList":[0]}
{"version":3,"file":"hooks-BwtZ3ZXP.js","sources":["../../node_modules/react-leaflet/lib/hooks.js"],"sourcesContent":["import { useLeafletContext } from '@react-leaflet/core';\nimport { useEffect } from 'react';\nexport function useMap() {\n return useLeafletContext().map;\n}\nexport function useMapEvent(type, handler) {\n const map = useMap();\n useEffect(function addMapEventHandler() {\n // @ts-ignore event type\n map.on(type, handler);\n return function removeMapEventHandler() {\n // @ts-ignore event type\n map.off(type, handler);\n };\n }, [\n map,\n type,\n handler\n ]);\n return map;\n}\nexport function useMapEvents(handlers) {\n const map = useMap();\n useEffect(function addMapEventHandlers() {\n map.on(handlers);\n return function removeMapEventHandlers() {\n map.off(handlers);\n };\n }, [\n map,\n handlers\n ]);\n return map;\n}\n"],"names":["useMap","useLeafletContext"],"mappings":"sEAEO,SAASA,GAAS,CACrB,OAAOC,EAAiB,EAAG,GAC/B","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
import"./index-Fnq3QmNw.js";import{u as t}from"./leaflet-ENrCR1B4.js";function r(){return t().map}export{r as u};
//# sourceMappingURL=hooks-LL30L9PN.js.map
@@ -1,4 +1,4 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathRouteMap-kT7xfoMb.js","assets/leaflet-ENrCR1B4.js","assets/leaflet-Dgihpmma.css","assets/hooks-LL30L9PN.js","assets/RepeaterDashboard-DtQKwbsT.js","assets/separator-BwjFWJb_.js","assets/MapView-D0gphXtL.js","assets/Popup-C-Q9ygBf.js","assets/SettingsModal-BPGiDC12.js"])))=>i.map(i=>d[i]);
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathRouteMap-C6PZ0wFI.js","assets/leaflet-IXizDMbG.js","assets/leaflet-Dgihpmma.css","assets/hooks-BwtZ3ZXP.js","assets/RepeaterDashboard-Dj09PNsp.js","assets/separator-CrdYjM_C.js","assets/MapView-ClQphI6P.js","assets/Popup-A7yuH1dp.js","assets/SettingsModal-kexfpcq5.js"])))=>i.map(i=>d[i]);
var tg=Object.defineProperty;var ng=(t,r,s)=>r in t?tg(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var ho=(t,r,s)=>ng(t,typeof r!="symbol"?r+"":r,s);function rg(t,r){for(var s=0;s<r.length;s++){const a=r[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in t)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(t,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(i){if(i.ep)return;i.ep=!0;const l=s(i);fetch(i.href,l)}})();var Qu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ux(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var r=t.default;if(typeof r=="function"){var s=function a(){return this instanceof a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};s.prototype=r.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,i.get?i:{enumerable:!0,get:function(){return t[a]}})}),s}var Zu={exports:{}},la={},Ju={exports:{}},Ge={};/**
* @license React
* react.production.min.js
@@ -237,7 +237,7 @@ Error generating stack: `+g.message+`
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(s))},[s,t]),null},TC="DialogDescriptionWarning",PC=({contentRef:t,descriptionId:r})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${w1(TC).contentName}}.`;return E.useEffect(()=>{var l;const i=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");r&&i&&(document.getElementById(r)||console.warn(a))},[a,t,r]),null},C1=l1,k1=d1,Jl=f1,ec=h1,tc=m1,nc=v1,E1=g1;const Ta=C1,jC=k1,_1=E.forwardRef(({className:t,...r},s)=>h.jsx(Jl,{ref:s,className:Ve("fixed inset-0 z-50 bg-overlay/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));_1.displayName=Jl.displayName;const gs=E.forwardRef(({className:t,children:r,...s},a)=>h.jsxs(jC,{children:[h.jsx(_1,{}),h.jsxs(ec,{ref:a,className:Ve("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",t),...s,children:[r,h.jsxs(E1,{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:[h.jsx(G0,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gs.displayName=ec.displayName;const bs=({className:t,...r})=>h.jsx("div",{className:Ve("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});bs.displayName="DialogHeader";const Pa=({className:t,...r})=>h.jsx("div",{className:Ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Pa.displayName="DialogFooter";const ws=E.forwardRef(({className:t,...r},s)=>h.jsx(tc,{ref:s,className:Ve("text-lg font-semibold leading-none tracking-tight",t),...r}));ws.displayName=tc.displayName;const Cs=E.forwardRef(({className:t,...r},s)=>h.jsx(nc,{ref:s,className:Ve("text-sm text-muted-foreground",t),...r}));Cs.displayName=nc.displayName;function MC(t){return t===0?"1-byte hops":t===1?"2-byte hops":t===2?"3-byte hops":"Unknown hop width"}function Pp(t,r,s,a){if(t.path_len<=0||!t.path)return`${r} -> ${s}`;const i=Gr(t.path,t.path_len).map(l=>{const d=Wx(l,a,!0);return d.length===1?d[0].name||`${d[0].public_key.slice(0,l.length)}…`:d.length>1?`${l}…?`:`${l}…`});return[r,...i,s].join(" -> ")}function jp({label:t,route:r,chain:s}){const a=Gr(r.path,r.path_len).join(" -> ")||"direct";return h.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:t}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:In(r.path_len,!0)})]}),h.jsx("p",{className:"mt-2 text-sm",children:s}),h.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[h.jsxs("span",{children:["Raw: ",a]}),h.jsx("span",{children:MC(r.path_hash_mode)})]})]})}function zC({open:t,onClose:r,contact:s,contacts:a,radioName:i,onDiscover:l}){const[d,u]=E.useState(!1),[p,f]=E.useState(null),[v,m]=E.useState(null),y=E.useMemo(()=>Z0(s),[s]),w=Fa(s),C=E.useMemo(()=>{if(s.last_path_len===-1)return"Flood";const k=Gr(s.last_path,s.last_path_len);return k.length>0?`${In(s.last_path_len,!0)} (${k.join(" -> ")})`:In(s.last_path_len,!0)},[s.last_path,s.last_path_len]),_=E.useMemo(()=>{if(!w)return null;if(y.pathLen===-1)return"Flood";const k=Gr(y.path,y.pathLen);return k.length>0?`${In(y.pathLen,!0)} (${k.join(" -> ")})`:In(y.pathLen,!0)},[y,w]),b=v?Pp(v.forward_path,i||"Local radio",s.name||s.public_key.slice(0,12),a):null,N=v?Pp(v.return_path,s.name||s.public_key.slice(0,12),i||"Local radio",a):null,A=async()=>{u(!0),f(null);try{const k=await l(s.public_key);m(k)}catch(k){f(k instanceof Error?k.message:"Unknown error")}finally{u(!1)}};return h.jsx(Ta,{open:t,onOpenChange:k=>!k&&r(),children:h.jsxs(gs,{className:"sm:max-w-[560px]",children:[h.jsxs(bs,{children:[h.jsx(ws,{children:"Path Discovery"}),h.jsx(Cs,{children:"Send a routed probe to this contact and wait for the round-trip path response. The learned forward route will be saved back onto the contact if a response comes back."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3 text-sm",children:[h.jsx("div",{className:"font-medium",children:s.name Line truncated
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(s))},[s,t]),null},TC="DialogDescriptionWarning",PC=({contentRef:t,descriptionId:r})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${w1(TC).contentName}}.`;return E.useEffect(()=>{var l;const i=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");r&&i&&(document.getElementById(r)||console.warn(a))},[a,t,r]),null},C1=l1,k1=d1,Jl=f1,ec=h1,tc=m1,nc=v1,E1=g1;const Ta=C1,jC=k1,_1=E.forwardRef(({className:t,...r},s)=>h.jsx(Jl,{ref:s,className:Ve("fixed inset-0 z-50 bg-overlay/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));_1.displayName=Jl.displayName;const gs=E.forwardRef(({className:t,children:r,...s},a)=>h.jsxs(jC,{children:[h.jsx(_1,{}),h.jsxs(ec,{ref:a,className:Ve("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",t),...s,children:[r,h.jsxs(E1,{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:[h.jsx(G0,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gs.displayName=ec.displayName;const bs=({className:t,...r})=>h.jsx("div",{className:Ve("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});bs.displayName="DialogHeader";const Pa=({className:t,...r})=>h.jsx("div",{className:Ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Pa.displayName="DialogFooter";const ws=E.forwardRef(({className:t,...r},s)=>h.jsx(tc,{ref:s,className:Ve("text-lg font-semibold leading-none tracking-tight",t),...r}));ws.displayName=tc.displayName;const Cs=E.forwardRef(({className:t,...r},s)=>h.jsx(nc,{ref:s,className:Ve("text-sm text-muted-foreground",t),...r}));Cs.displayName=nc.displayName;function MC(t){return t===0?"1-byte hops":t===1?"2-byte hops":t===2?"3-byte hops":"Unknown hop width"}function Pp(t,r,s,a){if(t.path_len<=0||!t.path)return`${r} -> ${s}`;const i=Gr(t.path,t.path_len).map(l=>{const d=Wx(l,a,!0);return d.length===1?d[0].name||`${d[0].public_key.slice(0,l.length)}…`:d.length>1?`${l}…?`:`${l}…`});return[r,...i,s].join(" -> ")}function jp({label:t,route:r,chain:s}){const a=Gr(r.path,r.path_len).join(" -> ")||"direct";return h.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:t}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:In(r.path_len,!0)})]}),h.jsx("p",{className:"mt-2 text-sm",children:s}),h.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[h.jsxs("span",{children:["Raw: ",a]}),h.jsx("span",{children:MC(r.path_hash_mode)})]})]})}function zC({open:t,onClose:r,contact:s,contacts:a,radioName:i,onDiscover:l}){const[d,u]=E.useState(!1),[p,f]=E.useState(null),[v,m]=E.useState(null),y=E.useMemo(()=>Z0(s),[s]),w=Fa(s),C=E.useMemo(()=>{if(s.last_path_len===-1)return"Flood";const k=Gr(s.last_path,s.last_path_len);return k.length>0?`${In(s.last_path_len,!0)} (${k.join(" -> ")})`:In(s.last_path_len,!0)},[s.last_path,s.last_path_len]),_=E.useMemo(()=>{if(!w)return null;if(y.pathLen===-1)return"Flood";const k=Gr(y.path,y.pathLen);return k.length>0?`${In(y.pathLen,!0)} (${k.join(" -> ")})`:In(y.pathLen,!0)},[y,w]),b=v?Pp(v.forward_path,i||"Local radio",s.name||s.public_key.slice(0,12),a):null,N=v?Pp(v.return_path,s.name||s.public_key.slice(0,12),i||"Local radio",a):null,A=async()=>{u(!0),f(null);try{const k=await l(s.public_key);m(k)}catch(k){f(k instanceof Error?k.message:"Unknown error")}finally{u(!1)}};return h.jsx(Ta,{open:t,onOpenChange:k=>!k&&r(),children:h.jsxs(gs,{className:"sm:max-w-[560px]",children:[h.jsxs(bs,{children:[h.jsx(ws,{children:"Path Discovery"}),h.jsx(Cs,{children:"Send a routed probe to this contact and wait for the round-trip path response. The learned forward route will be saved back onto the contact if a response comes back."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3 text-sm",children:[h.jsx("div",{className:"font-medium",children:s.name Line truncated
`).map((Ie,rt,ut)=>h.jsxs("span",{children:[ak(Ie,v),rt<ut.length-1&&h.jsx("br",{})]},rt)),!ve&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-[10px] text-muted-foreground ml-2",children:Fn(Q.sender_timestamp||Q.received_at)}),!Q.outgoing&&Q.paths&&Q.paths.length>0&&h.jsx(Vp,{paths:Q.paths,variant:"inline",onClick:()=>L({paths:Q.paths,senderInfo:pt(Q,Te,$e)})})]}),Q.outgoing&&(Q.acked>0?Q.paths&&Q.paths.length>0?h.jsx("span",{className:"text-muted-foreground cursor-pointer hover:text-primary",role:"button",tabIndex:0,onKeyDown:rn,onClick:Ie=>{Ie.stopPropagation(),L({paths:Q.paths,senderInfo:Rt,messageId:Q.id,isOutgoingChan:Q.type==="CHAN"&&!!f})},title:"View echo paths","aria-label":`Acknowledged, ${Q.acked} echo${Q.acked!==1?"s":""} — view paths`,children:` ✓${Q.acked>1?Q.acked:""}`}):h.jsx("span",{className:"text-muted-foreground",children:` ✓${Q.acked>1?Q.acked:""}`}):f&&Q.type==="CHAN"?h.jsxs("span",{className:"text-muted-foreground cursor-pointer hover:text-primary",role:"button",tabIndex:0,onKeyDown:rn,onClick:Ie=>{Ie.stopPropagation(),L({paths:[],senderInfo:Rt,messageId:Q.id,isOutgoingChan:!0})},title:"Message status","aria-label":"No echoes yet — view message status",children:[" ","?"]}):h.jsxs("span",{className:"text-muted-foreground",title:"No repeats heard yet",children:[" ","?"]}))]})]})]})]},Q.id)}),b&&h.jsx("div",{className:"text-center py-2 text-muted-foreground text-sm",role:"status",children:"Loading newer messages..."}),!b&&_&&h.jsx("div",{className:"text-center py-2 text-muted-foreground text-xs",children:"Scroll down for newer messages"})]}),ie&&h.jsx("div",{className:"pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2",children:h.jsxs("div",{className:"pointer-events-auto flex h-9 items-center overflow-hidden rounded-full border border-border bg-card shadow-lg transition-all hover:scale-105",children:[h.jsx("button",{type:"button",onClick:()=>{var Q,xe;(xe=(Q=K.current)==null?void 0:Q.scrollIntoView)==null||xe.call(Q,{block:"center"}),oe(!0),re(!1)},className:"h-full px-3 text-sm font-medium hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Jump to unread"}),h.jsx("button",{type:"button",onClick:()=>{oe(!0),re(!1)},className:"flex h-full w-9 items-center justify-center border-l border-border text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss jump to unread",title:"Dismiss jump to unread",children:"×"})]})}),R&&h.jsx("button",{onClick:Ue,className:"absolute bottom-4 right-4 w-9 h-9 rounded-full bg-card hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-all hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:"Scroll to bottom","aria-label":"Scroll to bottom",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:h.jsx("polyline",{points:"6 9 12 15 18 9"})})}),D&&h.jsx(nk,{open:!0,onClose:()=>L(null),paths:D.paths,senderInfo:D.senderInfo,contacts:r,config:m??null,messageId:D.messageId,isOutgoingChan:D.isOutgoingChan,isResendable:Et,onResend:f})]})}var mr={},ua={},Kt={},Up;function En(){if(Up)return Kt;Up=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.RequestType=Kt.AdvertFlags=Kt.DeviceRole=Kt.PayloadVersion=Kt.ControlSubType=Kt.PayloadType=Kt.RouteType=void 0;var t;(function(u){u[u.TransportFlood=0]="TransportFlood",u[u.Flood=1]="Flood",u[u.Direct=2]="Direct",u[u.TransportDirect=3]="TransportDirect"})(t||(Kt.RouteType=t={}));var r;(function(u){u[u.Request=0]="Request",u[u.Response=1]="Response",u[u.TextMessage=2]="TextMessage",u[u.Ack=3]="Ack",u[u.Advert=4]="Advert",u[u.GroupText=5]="GroupText",u[u.GroupData=6]="GroupData",u[u.AnonRequest=7]="AnonRequest",u[u.Path=8]="Path",u[u.Trace=9]="Trace",u[u.Multipart=10]="Multipart",u[u.Control=11]="Control",u[u.RawCustom=15]="RawCustom"})(r||(Kt.PayloadType=r={}));var s;(function(u){u[u.NodeDiscoverReq=128]="NodeDiscoverReq",u[u.NodeDiscoverResp=144]="NodeDiscoverResp"})(s||(Kt.ControlSubType=s={}));var a;(function(u){u[u.Version1=0]="Version1",u[u.Version2=1]="Version2",u[u.Version3=2]="Version3",u[u.Version4=3]="Version4"})(a||(Kt.PayloadVersion=a={}));var i;(function(u){u[u.Unknown=0]="Unknown",u[u.ChatNode=1]="ChatNode",u[u.Repeater=2]="Repeater",u[u.RoomServer=3]="RoomServer",u[u.Sensor=4]="Sensor"})(i||(Kt.DeviceRole=i={}));var l;(function(u){u[u.HasLocation=16]="HasLocation",u[u.HasFeature1=32]="HasFeature1",u[u.HasFeature2=64]="HasFeature2",u[u.HasName=128]="HasName"})(l||(Kt.AdvertFlags=l={}));var d;return(function(u){u[u.GetStats=1]="GetStats",u[u.Keepalive=2]="Keepalive",u[u.GetTelemetryData=3]="GetTelemetryData",u[u.GetMinMaxAvgData=4]="GetMinMaxAvgData",u[u.GetAccessList=5]="GetAc Line truncated
(c) 2012 by Cédric Mesnil. All rights reserved.
@@ -257,5 +257,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${r.do
• Request Data (remaining bytes) - additional request-specific data`,startByte:u+p,endByte:u+i.length-1,value:y});const w={type:t.PayloadType.Request,version:t.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:t.RequestType.GetStats,requestData:"",destinationHash:f,sourceHash:v,cipherMac:m,ciphertext:y};return l!=null&&l.includeSegments&&(w.segments=d),w}catch(d){return{type:t.PayloadType.Request,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode request payload"],timestamp:0,requestType:t.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return xa.RequestPayloadDecoder=s,xa}var va={},Wm;function V8(){if(Wm)return va;Wm=1,Object.defineProperty(va,"__esModule",{value:!0}),va.ResponsePayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<4){const C={type:t.PayloadType.Response,version:t.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&&(C.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+i.length-1,value:(0,r.bytesToHex)(i)}]),C}const d=[],u=(l==null?void 0:l.segmentOffset)||0;let p=0;const f=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+p,endByte:u+p,value:f}),p+=1;const v=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+p,endByte:u+p,value:v}),p+=1;const m=(0,r.bytesToHex)(i.subarray(p,p+2));l!=null&&l.includeSegments&&d.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+p,endByte:u+p+1,value:m}),p+=2;const y=(0,r.bytesToHex)(i.subarray(p));l!=null&&l.includeSegments&&i.length>p&&d.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+p,endByte:u+i.length-1,value:y});const w={type:t.PayloadType.Response,version:t.PayloadVersion.Version1,isValid:!0,destinationHash:f,sourceHash:v,cipherMac:m,ciphertext:y,ciphertextLength:i.length-4};return l!=null&&l.includeSegments&&(w.segments=d),w}catch(d){return{type:t.PayloadType.Response,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return va.ResponsePayloadDecoder=s,va}var ya={},qm;function U8(){if(qm)return ya;qm=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.AnonRequestPayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<35){const C={type:t.PayloadType.AnonRequest,version:t.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&&(C.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)+i.length-1,value:(0,r.bytesToHex)(i)}]),C}const d=[],u=(l==null?void 0:l.segmentOffset)||0;let p=0;const f=(0,r.byteToHex)(i[0]);l!=null&&l.includeSegments&&d.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${f}`,startByte:u+p,endByte:u+p,value:f}),p+=1;const v=(0,r.bytesToHex)(i.subarray(1,33));l!=null&&l.includeSegments&&d.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+p,endByte:u+p+31,value:v}),p+=32;const m=(0,r.bytesToHex)(i.subarray(33,35));l!=null&&l.includeSegments&&d.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+p,endByte:u+p+1,value:m}),p+=2;const y=(0,r.bytesToHex)(i.subarray(35));l!=null&&l.includeSegments&&i.length>35&&d.push({name:"Ciphertext",description:`Encrypted message data (${i.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+p,endByte:u+i.length-1,value:y});const w={type:t.PayloadType.AnonRequest,version:t.PayloadVersion.Version1,isValid:!0,destinationHash:f,senderPublicKey:v,cipherMac:m,ciphertext:y,ciphertextLength:i.length-35};return l!=null&&l.includeSegments&&(w.segments=d),w}catch(d){return{type:t.PayloadType.AnonRequest,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return ya.AnonRequestPayloadDecoder=s,ya}var ga={},Km;function W8(){if(Km)return ga;Km=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.AckPayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<4){const v={type:t.PayloadType.Ack,version:t.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)+i.length-1,value:(0,r.bytesToHex)(i)}]),v}const d=[],u=(l==null?void 0:l.segmentOffset)||0,p=(0,r.bytesToHex)(i.subarray(0,4));l!=null&&l.includeSegments&&d.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${p}`,startByte:u,endByte:u+3,value:p}),l!=null&&l.includeSegments&&i.length>4&&d.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+i.length-1,value:(0,r.bytesToHex)(i.subarray(4))});const f={type:t.PayloadType.Ack,version:t.PayloadVersion.Version1,isValid:!0,checksum:p};return l!=null&&l.includeSegments&&(f.segments=d),f}catch(d){return{type:t.PayloadType.Ack,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode Ack payload"],checksum:""}}}}return ga.AckPayloadDecoder=s,ga}var ba={},Gm;function q8(){if(Gm)return ba;Gm=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.PathPayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i){try{if(i.length<2)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=i[0],d=(l>>6)+1,u=l&63,p=u*d;if(d===4)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:["Invalid path length byte: reserved hash size (bits 7:6 = 11)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};if(i.length<1+p+1)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+p+1} bytes for path length + path + extra type)`],pathLength:u,...d>1?{pathHashSize:d}:{},pathHashes:[],extraType:0,extraData:""};const f=[];for(let y=0;y<u;y++){const w=1+y*d,C=i.subarray(w,w+d);f.push((0,r.bytesToHex)(C))}const v=i[1+p];let m="";return i.length>1+p+1&&(m=(0,r.bytesToHex)(i.subarray(1+p+1))),{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!0,pathLength:u,...d>1?{pathHashSize:d}:{},pathHashes:f,extraType:v,extraData:m}}catch(l){return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return ba.PathPayloadDecoder=s,ba}var wa={},Ym;function K8(){if(Ym)return wa;Ym=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.TextMessagePayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<4){const C={type:t.PayloadType.TextMessage,version:t.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&&(C.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+i.length-1,value:(0,r.bytesToHex)(i)}]),C}const d=[],u=(l==null?void 0:l.segmentOffset)||0;let p=0;const f=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+p,endByte:u+p,value:f}),p+=1;const v=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+p,endByte:u+p,value:v}),p+=1;const m=(0,r.bytesToHex)(i.subarray(p,p+2));l!=null&&l.includeSegments&&d.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+p,endByte:u+p+1,value:m}),p+=2;const y=(0,r.bytesToHex)(i.subarray(p));l!=null&&l.includeSegments&&i.length>p&&d.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+p,endByte:u+i.leng Line truncated
//# sourceMappingURL=index-Fnq3QmNw.js.map
• Password (remaining bytes) - password for repeater/room`,startByte:u+p,endByte:u+i.length-1,value:y});const w={type:t.PayloadType.AnonRequest,version:t.PayloadVersion.Version1,isValid:!0,destinationHash:f,senderPublicKey:v,cipherMac:m,ciphertext:y,ciphertextLength:i.length-35};return l!=null&&l.includeSegments&&(w.segments=d),w}catch(d){return{type:t.PayloadType.AnonRequest,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return ya.AnonRequestPayloadDecoder=s,ya}var ga={},Km;function W8(){if(Km)return ga;Km=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.AckPayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<4){const v={type:t.PayloadType.Ack,version:t.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)+i.length-1,value:(0,r.bytesToHex)(i)}]),v}const d=[],u=(l==null?void 0:l.segmentOffset)||0,p=(0,r.bytesToHex)(i.subarray(0,4));l!=null&&l.includeSegments&&d.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${p}`,startByte:u,endByte:u+3,value:p}),l!=null&&l.includeSegments&&i.length>4&&d.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+i.length-1,value:(0,r.bytesToHex)(i.subarray(4))});const f={type:t.PayloadType.Ack,version:t.PayloadVersion.Version1,isValid:!0,checksum:p};return l!=null&&l.includeSegments&&(f.segments=d),f}catch(d){return{type:t.PayloadType.Ack,version:t.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode Ack payload"],checksum:""}}}}return ga.AckPayloadDecoder=s,ga}var ba={},Gm;function q8(){if(Gm)return ba;Gm=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.PathPayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i){try{if(i.length<2)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=i[0],d=(l>>6)+1,u=l&63,p=u*d;if(d===4)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:["Invalid path length byte: reserved hash size (bits 7:6 = 11)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};if(i.length<1+p+1)return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+p+1} bytes for path length + path + extra type)`],pathLength:u,...d>1?{pathHashSize:d}:{},pathHashes:[],extraType:0,extraData:""};const f=[];for(let y=0;y<u;y++){const w=1+y*d,C=i.subarray(w,w+d);f.push((0,r.bytesToHex)(C))}const v=i[1+p];let m="";return i.length>1+p+1&&(m=(0,r.bytesToHex)(i.subarray(1+p+1))),{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!0,pathLength:u,...d>1?{pathHashSize:d}:{},pathHashes:f,extraType:v,extraData:m}}catch(l){return{type:t.PayloadType.Path,version:t.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return ba.PathPayloadDecoder=s,ba}var wa={},Ym;function K8(){if(Ym)return wa;Ym=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.TextMessagePayloadDecoder=void 0;const t=En(),r=Gt();class s{static decode(i,l){try{if(i.length<4){const C={type:t.PayloadType.TextMessage,version:t.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&&(C.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+i.length-1,value:(0,r.bytesToHex)(i)}]),C}const d=[],u=(l==null?void 0:l.segmentOffset)||0;let p=0;const f=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+p,endByte:u+p,value:f}),p+=1;const v=(0,r.byteToHex)(i[p]);l!=null&&l.includeSegments&&d.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+p,endByte:u+p,value:v}),p+=1;const m=(0,r.bytesToHex)(i.subarray(p,p+2));l!=null&&l.includeSegments&&d.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+p,endByte:u+p+1,value:m}),p+=2;const y=(0,r.bytesToHex)(i.subarray(p));l!=null&&l.includeSegments&&i.length>p&&d.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+p,endByte:u+i.leng Line truncated
//# sourceMappingURL=index-CyRLXsJ_.js.map
@@ -1 +1 @@
{"version":3,"mappings":";;;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAE,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEH,EAAEI,EAAEC,EAAE,CAAC,KAAK,MAAML,EAAE,KAAK,QAAQI,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGJ,CAAC,CAACE,EA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4 as ss,v as rs}from"./index-Fnq3QmNw.js";function Mn(d,_){const h=O.useRef(_);O.useEffect(function(){_!==h.current&&d.attributionControl!=null&&(h.current!=null&&d.attributionControl.removeAttribution(h.current),_!=null&&d.attributionControl.addAttribution(_)),h.current=_},[d,_])}const as=1;function hs(d){return Object.freeze({__version:as,map:d})}function xs(d,_){return Object.freeze({...d,..._})}const Cn=O.createContext(null),Sn=Cn.Provider;function ai(){const d=O.useContext(Cn);if(d==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return d}function zn(d){function _(h,m){const{instance:f,context:E}=d(h).current;return O.useImperativeHandle(m,()=>f),h.children==null?null:si.createElement(Sn,{value:E},h.children)}return O.forwardRef(_)}function us(d){function _(h,m){const[f,E]=O.useState(!1),{instance:P}=d(h,E).current;O.useImperativeHandle(m,()=>P),O.useEffect(function(){f&&P.update()},[P,f,h.children]);const ot=P._contentNode;return ot?ss.createPortal(h.children,ot):null}return O.forwardRef(_)}function ls(d){function _(h,m){const{instance:f}=d(h).current;return O.useImperativeHandle(m,()=>f),null}return O.forwardRef(_)}function hi(d,_){const h=O.useRef();O.useEffect(function(){return _!=null&&d.instance.on(_),h.current=_,function(){h.current!=null&&d.instance.off(h.current),h.current=null}},[d,_])}function we(d,_){const h=d.pane??_.pane;return h?{...d,pane:h}:d}function cs(d,_){return function(m,f){const E=ai(),P=d(we(m,E),E);return Mn(E.map,m.attribution),hi(P.current,m.eventHandlers),_(P.current,E,m,f),P}}var Jt={exports:{}};/* @preserve
import{r as O,a3 as si,a4 as ss,v as rs}from"./index-CyRLXsJ_.js";function Mn(d,_){const h=O.useRef(_);O.useEffect(function(){_!==h.current&&d.attributionControl!=null&&(h.current!=null&&d.attributionControl.removeAttribution(h.current),_!=null&&d.attributionControl.addAttribution(_)),h.current=_},[d,_])}const as=1;function hs(d){return Object.freeze({__version:as,map:d})}function xs(d,_){return Object.freeze({...d,..._})}const Cn=O.createContext(null),Sn=Cn.Provider;function ai(){const d=O.useContext(Cn);if(d==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return d}function zn(d){function _(h,m){const{instance:f,context:E}=d(h).current;return O.useImperativeHandle(m,()=>f),h.children==null?null:si.createElement(Sn,{value:E},h.children)}return O.forwardRef(_)}function us(d){function _(h,m){const[f,E]=O.useState(!1),{instance:P}=d(h,E).current;O.useImperativeHandle(m,()=>P),O.useEffect(function(){f&&P.update()},[P,f,h.children]);const ot=P._contentNode;return ot?ss.createPortal(h.children,ot):null}return O.forwardRef(_)}function ls(d){function _(h,m){const{instance:f}=d(h).current;return O.useImperativeHandle(m,()=>f),null}return O.forwardRef(_)}function hi(d,_){const h=O.useRef();O.useEffect(function(){return _!=null&&d.instance.on(_),h.current=_,function(){h.current!=null&&d.instance.off(h.current),h.current=null}},[d,_])}function we(d,_){const h=d.pane??_.pane;return h?{...d,pane:h}:d}function cs(d,_){return function(m,f){const E=ai(),P=d(we(m,E),E);return Mn(E.map,m.attribution),hi(P.current,m.eventHandlers),_(P.current,E,m,f),P}}var Jt={exports:{}};/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var fs=Jt.exports,bn;function ds(){return bn||(bn=1,(function(d,_){(function(h,m){m(_)})(fs,(function(h){var m="1.9.4";function f(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++){o=arguments[i];for(e in o)t[e]=o[e]}return t}var E=Object.create||(function(){function t(){}return function(e){return t.prototype=e,new t}})();function P(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var ot=0;function b(t){return"_leaflet_id"in t||(t._leaflet_id=++ot),t._leaflet_id}function At(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function yt(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function I(){return!1}function X(t,e){if(e===!1)return t;var i=Math.pow(10,e===void 0?6:e);return Math.round(t*i)/i}function U(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ut(t){return U(t).split(/\s+/)}function k(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?E(t.options):{});for(var i in e)t.options[i]=e[i];return t.options}function Qt(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(!e||e.indexOf("?")===-1?"?":"&")+n.join("&")}var $t=/\{ *([\w_ -]+) *\}/g;function wt(t,e){return t.replace($t,function(i,n){var o=e[n];if(o===void 0)throw new Error("No value provided for variable "+i);return typeof o=="function"&&(o=o(e)),o})}var et=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function Pe(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var te="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Le(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var li=0;function ci(t){var e=+new Date,i=Math.max(0,16-(e-li));return li=e+i,window.setTimeout(t,i)}var Te=window.requestAnimationFrame||Le("RequestAnimationFrame")||ci,fi=window.cancelAnimationFrame||Le("CancelAnimationFrame")||Le("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function V(t,e,i){if(i&&Te===ci)t.call(e);else return Te.call(window,P(t,e))}function J(t){t&&fi.call(window,t)}var kn={__proto__:null,extend:f,create:E,bind:P,get lastId(){return ot},stamp:b,throttle:At,wrapNum:yt,falseFn:I,formatNum:X,trim:U,splitWords:ut,setOptions:k,getParamString:Qt,template:wt,isArray:et,indexOf:Pe,emptyImageUrl:te,requestFn:Te,cancelFn:fi,requestAnimFrame:V,cancelAnimFrame:J};function lt(){}lt.extend=function(t){var e=function(){k(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,n=E(i);n.constructor=e,e.prototype=n;for(var o in this)Object.prototype.hasOwnProperty.call(this,o)&&o!=="prototype"&&o!=="__super__"&&(e[o]=this[o]);return t.statics&&f(e,t.statics),t.includes&&(Zn(t.includes),f.apply(null,[n].concat(t.includes))),f(n,t),delete n.statics,delete n.includes,n.options&&(n.options=i.options?E(i.options):{},f(n.options,t.options)),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var s=0,r=n._initHooks.length;s<r;s++)n._initHooks[s].call(this)}},e},lt.include=function(t){var e=this.prototype.options;return f(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},lt.mergeOptions=function(t){return f(this.prototype.options,t),this},lt.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};function Zn(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=et(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(t,e,i){if(typeof t=="object")for(var n in t)this._on(n,t[n],e);else{t=ut(t);for(var o=0,s=t.length;o<s;o++)this._on(t[o],e,i)}return this},off:function(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var n in t)this._off(n,t[n],e);else{t=ut(t);for(var o=arguments.length===1,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}return this},_on:function(t,e,i,n){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,i)===!1){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t],!!n)){if(arguments.length===1){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=I;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listenLine truncated
//# sourceMappingURL=leaflet-ENrCR1B4.js.map
//# sourceMappingURL=leaflet-IXizDMbG.js.map
@@ -1 +1 @@
{"version":3,"file":"leaflet-ENrCR1B4.js","sources":["../../node_modules/@react-leaflet/core/lib/attribution.js","../../node_modules/@react-leaflet/core/lib/context.js","../../node_modules/@react-leaflet/core/lib/component.js","../../node_modules/@react-leaflet/core/lib/events.js","../../node_modules/@react-leaflet/core/lib/pane.js","../../node_modules/@react-leaflet/core/lib/div-overlay.js","../../node_modules/leaflet/dist/leaflet-src.js","../../node_modules/@react-leaflet/core/lib/element.js","../../node_modules/@react-leaflet/core/lib/layer.js","../../node_modules/@react-leaflet/core/lib/path.js","../../node_modules/@react-leaflet/core/lib/generic.js","../../node_modules/@react-leaflet/core/lib/grid-layer.js","../../node_modules/react-leaflet/lib/MapContainer.js","../../node_modules/react-leaflet/lib/TileLayer.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nexport function useAttribution(map, attribution) {\n const attributionRef = useRef(attribution);\n useEffect(function updateAttribution() {\n if (attribution !== attributionRef.current && map.attributionControl != null) {\n if (attributionRef.current != null) {\n map.attributionControl.removeAttribution(attributionRef.current);\n }\n if (attribution != null) {\n map.attributionControl.addAttribution(attribution);\n }\n }\n attributionRef.current = attribution;\n }, [\n map,\n attribution\n ]);\n}\n","import { createContext, useContext } from 'react';\nexport const CONTEXT_VERSION = 1;\nexport function createLeafletContext(map) {\n return Object.freeze({\n __version: CONTEXT_VERSION,\n map\n });\n}\nexport function extendContext(source, extra) {\n return Object.freeze({\n ...source,\n ...extra\n });\n}\nexport const LeafletContext = createContext(null);\nexport const LeafletProvider = LeafletContext.Provider;\nexport function useLeafletContext() {\n const context = useContext(LeafletContext);\n if (context == null) {\n throw new Error('No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>');\n }\n return context;\n}\n","import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { LeafletProvider } from './context.js';\nexport function createContainerComponent(useElement) {\n function ContainerComponent(props, forwardedRef) {\n const { instance , context } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n return props.children == null ? null : /*#__PURE__*/ React.createElement(LeafletProvider, {\n value: context\n }, props.children);\n }\n return /*#__PURE__*/ forwardRef(ContainerComponent);\n}\nexport function createDivOverlayComponent(useElement) {\n function OverlayComponent(props, forwardedRef) {\n const [isOpen, setOpen] = useState(false);\n const { instance } = useElement(props, setOpen).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n useEffect(function updateOverlay() {\n if (isOpen) {\n instance.update();\n }\n }, [\n instance,\n isOpen,\n props.children\n ]);\n // @ts-ignore _contentNode missing in type definition\n const contentNode = instance._contentNode;\n return contentNode ? /*#__PURE__*/ createPortal(props.children, contentNode) : null;\n }\n return /*#__PURE__*/ forwardRef(OverlayComponent);\n}\nexport function createLeafComponent(useElement) {\n function LeafComponent(props, forwardedRef) {\n const { instance } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n return null;\n }\n return /*#__PURE__*/ forwardRef(LeafComponent);\n}\n","import { useEffect, useRef } from 'react';\nexport function useEventHandlers(element, eventHandlers) {\n const eventHandlersRef = useRef();\n useEffect(function addEventHandlers() {\n if (eventHandlers != null) {\n element.instance.on(eventHandlers);\n }\n eventHandlersRef.current = eventHandlers;\n return function removeEventHandlers() {\n if (eventHandlersRef.current != null) {\n element.instance.off(eventHandlersRef.current);\n }\n eventHandlersRef.current = null;\n };\n }, [\n element,\n eventHandlers\n ]);\n}\n","export function withPane(props, context) {\n const pane = props.pane ?? context.pane;\n return pane ? {\n ...props,\n pane\n } : props;\n}\n","import { useAttribution } from './attribution.js';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { withPane } from './pane.js';\nexport function Line truncated
{"version":3,"file":"leaflet-IXizDMbG.js","sources":["../../node_modules/@react-leaflet/core/lib/attribution.js","../../node_modules/@react-leaflet/core/lib/context.js","../../node_modules/@react-leaflet/core/lib/component.js","../../node_modules/@react-leaflet/core/lib/events.js","../../node_modules/@react-leaflet/core/lib/pane.js","../../node_modules/@react-leaflet/core/lib/div-overlay.js","../../node_modules/leaflet/dist/leaflet-src.js","../../node_modules/@react-leaflet/core/lib/element.js","../../node_modules/@react-leaflet/core/lib/layer.js","../../node_modules/@react-leaflet/core/lib/path.js","../../node_modules/@react-leaflet/core/lib/generic.js","../../node_modules/@react-leaflet/core/lib/grid-layer.js","../../node_modules/react-leaflet/lib/MapContainer.js","../../node_modules/react-leaflet/lib/TileLayer.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nexport function useAttribution(map, attribution) {\n const attributionRef = useRef(attribution);\n useEffect(function updateAttribution() {\n if (attribution !== attributionRef.current && map.attributionControl != null) {\n if (attributionRef.current != null) {\n map.attributionControl.removeAttribution(attributionRef.current);\n }\n if (attribution != null) {\n map.attributionControl.addAttribution(attribution);\n }\n }\n attributionRef.current = attribution;\n }, [\n map,\n attribution\n ]);\n}\n","import { createContext, useContext } from 'react';\nexport const CONTEXT_VERSION = 1;\nexport function createLeafletContext(map) {\n return Object.freeze({\n __version: CONTEXT_VERSION,\n map\n });\n}\nexport function extendContext(source, extra) {\n return Object.freeze({\n ...source,\n ...extra\n });\n}\nexport const LeafletContext = createContext(null);\nexport const LeafletProvider = LeafletContext.Provider;\nexport function useLeafletContext() {\n const context = useContext(LeafletContext);\n if (context == null) {\n throw new Error('No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>');\n }\n return context;\n}\n","import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { LeafletProvider } from './context.js';\nexport function createContainerComponent(useElement) {\n function ContainerComponent(props, forwardedRef) {\n const { instance , context } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n return props.children == null ? null : /*#__PURE__*/ React.createElement(LeafletProvider, {\n value: context\n }, props.children);\n }\n return /*#__PURE__*/ forwardRef(ContainerComponent);\n}\nexport function createDivOverlayComponent(useElement) {\n function OverlayComponent(props, forwardedRef) {\n const [isOpen, setOpen] = useState(false);\n const { instance } = useElement(props, setOpen).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n useEffect(function updateOverlay() {\n if (isOpen) {\n instance.update();\n }\n }, [\n instance,\n isOpen,\n props.children\n ]);\n // @ts-ignore _contentNode missing in type definition\n const contentNode = instance._contentNode;\n return contentNode ? /*#__PURE__*/ createPortal(props.children, contentNode) : null;\n }\n return /*#__PURE__*/ forwardRef(OverlayComponent);\n}\nexport function createLeafComponent(useElement) {\n function LeafComponent(props, forwardedRef) {\n const { instance } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance);\n return null;\n }\n return /*#__PURE__*/ forwardRef(LeafComponent);\n}\n","import { useEffect, useRef } from 'react';\nexport function useEventHandlers(element, eventHandlers) {\n const eventHandlersRef = useRef();\n useEffect(function addEventHandlers() {\n if (eventHandlers != null) {\n element.instance.on(eventHandlers);\n }\n eventHandlersRef.current = eventHandlers;\n return function removeEventHandlers() {\n if (eventHandlersRef.current != null) {\n element.instance.off(eventHandlersRef.current);\n }\n eventHandlersRef.current = null;\n };\n }, [\n element,\n eventHandlers\n ]);\n}\n","export function withPane(props, context) {\n const pane = props.pane ?? context.pane;\n return pane ? {\n ...props,\n pane\n } : props;\n}\n","import { useAttribution } from './attribution.js';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { withPane } from './pane.js';\nexport function Line truncated
@@ -1,2 +1,2 @@
import{r as s,j as l,Q as f,l as u}from"./index-Fnq3QmNw.js";var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],h=N.reduce((a,r)=>{const t=f(`Primitive.${r}`),o=s.forwardRef((i,e)=>{const{asChild:p,...n}=i,m=p?t:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...n,ref:e})});return o.displayName=`Primitive.${r}`,{...a,[r]:o}},{}),x="Separator",c="horizontal",w=["horizontal","vertical"],d=s.forwardRef((a,r)=>{const{decorative:t,orientation:o=c,...i}=a,e=S(o)?o:c,n=t?{role:"none"}:{"aria-orientation":e==="vertical"?e:void 0,role:"separator"};return l.jsx(h.div,{"data-orientation":e,...n,...i,ref:r})});d.displayName=x;function S(a){return w.includes(a)}var v=d;const O=s.forwardRef(({className:a,orientation:r="horizontal",decorative:t=!0,...o},i)=>l.jsx(v,{ref:i,decorative:t,orientation:r,className:u("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",a),...o}));O.displayName=v.displayName;export{O as S};
//# sourceMappingURL=separator-BwjFWJb_.js.map
import{r as s,j as l,Q as f,l as u}from"./index-CyRLXsJ_.js";var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],h=N.reduce((a,r)=>{const t=f(`Primitive.${r}`),o=s.forwardRef((i,e)=>{const{asChild:p,...n}=i,m=p?t:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...n,ref:e})});return o.displayName=`Primitive.${r}`,{...a,[r]:o}},{}),x="Separator",c="horizontal",w=["horizontal","vertical"],d=s.forwardRef((a,r)=>{const{decorative:t,orientation:o=c,...i}=a,e=S(o)?o:c,n=t?{role:"none"}:{"aria-orientation":e==="vertical"?e:void 0,role:"separator"};return l.jsx(h.div,{"data-orientation":e,...n,...i,ref:r})});d.displayName=x;function S(a){return w.includes(a)}var v=d;const O=s.forwardRef(({className:a,orientation:r="horizontal",decorative:t=!0,...o},i)=>l.jsx(v,{ref:i,decorative:t,orientation:r,className:u("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",a),...o}));O.displayName=v.displayName;export{O as S};
//# sourceMappingURL=separator-CrdYjM_C.js.map
@@ -1 +1 @@
{"version":3,"file":"separator-BwjFWJb_.js","sources":["../../node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../node_modules/@radix-ui/react-separator/dist/index.mjs","../../src/components/ui/separator.tsx"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '@/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"],"names":["NODES","Primitive","primitive","node","Slot","createSlot","Node","React.forwardRef","props","forwardedRef","asChild","primitiveProps","Comp","jsx","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","Root","className","ref","SeparatorPrimitive.Root","cn"],"mappings":"6DAKA,IAAIA,EAAQ,CACV,IACA,SACA,MACA,OACA,KACA,KACA,MACA,QACA,QACA,KACA,MACA,KACA,IACA,SACA,OACA,MACA,IACF,EACIC,EAAYD,EAAM,OAAO,CAACE,EAAWC,IAAS,CAChD,MAAMC,EAAOC,EAAW,aAAaF,CAAI,EAAE,EACrCG,EAAOC,EAAAA,WAAiB,CAACC,EAAOC,IAAiB,CACrD,KAAM,CAAE,QAAAC,EAAS,GAAGC,CAAc,EAAKH,EACjCI,EAAOF,EAAUN,EAAOD,EAC9B,OAAI,OAAO,OAAW,MACpB,OAAO,OAAO,IAAI,UAAU,CAAC,EAAI,IAEZU,EAAAA,IAAID,EAAM,CAAE,GAAGD,EAAgB,IAAKF,EAAc,CAC3E,CAAC,EACD,OAAAH,EAAK,YAAc,aAAaH,CAAI,GAC7B,CAAE,GAAGD,EAAW,CAACC,CAAI,EAAGG,CAAI,CACrC,EAAG,EAAE,EChCDQ,EAAO,YACPC,EAAsB,aACtBC,EAAe,CAAC,aAAc,UAAU,EACxCC,EAAYV,EAAAA,WAAiB,CAACC,EAAOC,IAAiB,CACxD,KAAM,CAAE,WAAAS,EAAY,YAAaC,EAAkBJ,EAAqB,GAAGK,CAAQ,EAAKZ,EAClFa,EAAcC,EAAmBH,CAAe,EAAIA,EAAkBJ,EAEtEQ,EAAgBL,EAAa,CAAE,KAAM,QAAW,CAAE,mBADhCG,IAAgB,WAAaA,EAAc,OAC0B,KAAM,WAAW,EAC9G,OAAuBR,EAAAA,IACrBZ,EAAU,IACV,CACE,mBAAoBoB,EACpB,GAAGE,EACH,GAAGH,EACH,IAAKX,CACX,CACA,CACA,CAAC,EACDQ,EAAU,YAAcH,EACxB,SAASQ,EAAmBD,EAAa,CACvC,OAAOL,EAAa,SAASK,CAAW,CAC1C,CACA,IAAIG,EAAOP,ECnBX,MAAMA,EAAYV,EAAAA,WAGhB,CAAC,CAAE,UAAAkB,EAAW,YAAAJ,EAAc,aAAc,WAAAH,EAAa,GAAM,GAAGV,CAAA,EAASkB,IACzEb,EAAAA,IAACc,EAAA,CACC,IAAAD,EACA,WAAAR,EACA,YAAAG,EACA,UAAWO,EACT,qBACAP,IAAgB,aAAe,iBAAmB,iBAClDI,CAAA,EAED,GAAGjB,CAAA,CACLine truncated
{"version":3,"file":"separator-CrdYjM_C.js","sources":["../../node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../node_modules/@radix-ui/react-separator/dist/index.mjs","../../src/components/ui/separator.tsx"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '@/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"],"names":["NODES","Primitive","primitive","node","Slot","createSlot","Node","React.forwardRef","props","forwardedRef","asChild","primitiveProps","Comp","jsx","NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","Root","className","ref","SeparatorPrimitive.Root","cn"],"mappings":"6DAKA,IAAIA,EAAQ,CACV,IACA,SACA,MACA,OACA,KACA,KACA,MACA,QACA,QACA,KACA,MACA,KACA,IACA,SACA,OACA,MACA,IACF,EACIC,EAAYD,EAAM,OAAO,CAACE,EAAWC,IAAS,CAChD,MAAMC,EAAOC,EAAW,aAAaF,CAAI,EAAE,EACrCG,EAAOC,EAAAA,WAAiB,CAACC,EAAOC,IAAiB,CACrD,KAAM,CAAE,QAAAC,EAAS,GAAGC,CAAc,EAAKH,EACjCI,EAAOF,EAAUN,EAAOD,EAC9B,OAAI,OAAO,OAAW,MACpB,OAAO,OAAO,IAAI,UAAU,CAAC,EAAI,IAEZU,EAAAA,IAAID,EAAM,CAAE,GAAGD,EAAgB,IAAKF,EAAc,CAC3E,CAAC,EACD,OAAAH,EAAK,YAAc,aAAaH,CAAI,GAC7B,CAAE,GAAGD,EAAW,CAACC,CAAI,EAAGG,CAAI,CACrC,EAAG,EAAE,EChCDQ,EAAO,YACPC,EAAsB,aACtBC,EAAe,CAAC,aAAc,UAAU,EACxCC,EAAYV,EAAAA,WAAiB,CAACC,EAAOC,IAAiB,CACxD,KAAM,CAAE,WAAAS,EAAY,YAAaC,EAAkBJ,EAAqB,GAAGK,CAAQ,EAAKZ,EAClFa,EAAcC,EAAmBH,CAAe,EAAIA,EAAkBJ,EAEtEQ,EAAgBL,EAAa,CAAE,KAAM,QAAW,CAAE,mBADhCG,IAAgB,WAAaA,EAAc,OAC0B,KAAM,WAAW,EAC9G,OAAuBR,EAAAA,IACrBZ,EAAU,IACV,CACE,mBAAoBoB,EACpB,GAAGE,EACH,GAAGH,EACH,IAAKX,CACX,CACA,CACA,CAAC,EACDQ,EAAU,YAAcH,EACxB,SAASQ,EAAmBD,EAAa,CACvC,OAAOL,EAAa,SAASK,CAAW,CAC1C,CACA,IAAIG,EAAOP,ECnBX,MAAMA,EAAYV,EAAAA,WAGhB,CAAC,CAAE,UAAAkB,EAAW,YAAAJ,EAAc,aAAc,WAAAH,EAAa,GAAM,GAAGV,CAAA,EAASkB,IACzEb,EAAAA,IAACc,EAAA,CACC,IAAAD,EACA,WAAAR,EACA,YAAAG,EACA,UAAWO,EACT,qBACAP,IAAgB,aAAe,iBAAmB,iBAClDI,CAAA,EAED,GAAGjB,CAAA,CACLine truncated
+1 -1
View File
@@ -50,7 +50,7 @@
undecryptedCount: fetchJsonOrThrow('/api/packets/undecrypted/count'),
};
</script>
<script type="module" crossorigin src="/assets/index-Fnq3QmNw.js"></script>
<script type="module" crossorigin src="/assets/index-CyRLXsJ_.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Kkb-Bio9.css">
</head>
<body>
+51
View File
@@ -728,3 +728,54 @@ class TestCommunityMqttIataValidation:
_validate_mqtt_community_config({"iata": "PDX", "auth_mode": "password"})
assert exc_info.value.status_code == 400
assert "username and password" in exc_info.value.detail
class TestFanoutConfigMutationInvariant:
"""Persisted fanout rows should always be valid and canonical."""
@pytest.mark.asyncio
async def test_disabled_create_still_validates_config(self, test_db):
from app.routers.fanout import FanoutConfigCreate, create_fanout_config
with pytest.raises(HTTPException) as exc_info:
await create_fanout_config(
FanoutConfigCreate(
type="mqtt_community",
name="Invalid draft",
config={},
scope={},
enabled=False,
)
)
assert exc_info.value.status_code == 400
assert "IATA" in exc_info.value.detail
@pytest.mark.asyncio
async def test_enable_only_patch_persists_normalized_config(self, test_db):
from app.repository.fanout import FanoutConfigRepository
from app.routers.fanout import FanoutConfigUpdate, update_fanout_config
cfg = await FanoutConfigRepository.create(
config_type="mqtt_community",
name="Community MQTT",
config={
"iata": "PDX",
"broker_host": " mqtt.example.com ",
"topic_template": "mesh2mqtt/{iata}/node/{Public_Key}",
},
scope={"messages": "none", "raw_packets": "all"},
enabled=False,
)
with patch("app.fanout.manager.fanout_manager.reload_config", new_callable=AsyncMock):
updated = await update_fanout_config(
cfg["id"],
FanoutConfigUpdate(enabled=True),
)
assert updated["enabled"] is True
assert updated["config"]["broker_host"] == "mqtt.example.com"
assert updated["config"]["topic_template"] == "mesh2mqtt/{IATA}/node/{PUBLIC_KEY}"
assert updated["config"]["transport"] == "websockets"
assert updated["config"]["auth_mode"] == "token"