mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-11-08 18:42:22 +01:00
Move advertise to identity tab
This commit is contained in:
1 parent
530179fde1
commit
d6e5130f49
7 files changed
+32
-54
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAACG,EAAE,UAAU,iBAAiB,GACnQA,EAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,GAAG,EAAEA,EAAE,UAAUH,EAAE,UAAU,SAASI,EAAER,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAAC,IAAIQ,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEN,EAAEO,EAAEL,EAAE,SAAS,EAAEK,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEd,EAAEK,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGpB,GAAGA,EAAE,aAAa,IAAIe,KAAKI,GAAEnB,EAAE,aAAamB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS5B,EAAE,KAAKa,EAAE,IAAIiB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,EAAEtB,EAAEK,EAAE,CAAC,MAAM,CAAC,SAASlB,EAAE,KAAKa,EAAE,KAAK,IAAIK,EAAE,IAAIL,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASuB,EAAEvB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASqC,EAAOxB,EAAE,CAAC,IAAIK,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIL,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOK,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIyB,EAAE,OAAO,SAASC,EAAE1B,EAAEK,EAAE,CAAC,OAAiB,OAAOL,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYwB,EAAO,GAAGxB,EAAE,GAAG,EAAEK,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,GAAE3B,EAAEK,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOjB,GAAmBiB,KAAd,aAA6BA,KAAZ,aAAcjB,EAAE,MAAK,IAAIkB,GAAE,GAAG,GAAUlB,IAAP,KAASkB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOlB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE8B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAElB,EAAEgB,GAAEA,GAAEE,EAAC,EAAElB,EAAOe,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASN,GAAN,OAAUM,EAAEN,EAAE,QAAQyB,EAAE,KAAK,EAAE,KAAKE,GAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASN,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASgB,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,EAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,EAAE,KAAK,EAAE,KAAKzB,CAAC,GAAGK,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAEV,CAAC,EAAE,QAAQmB,GAAE,EAAEA,GAAEnB,EAAE,OAAOmB,KAAI,CAACF,GACrfjB,EAAEmB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAErB,EAAEC,CAAC,EAAe,OAAOoB,IAApB,WAAsB,IAAIpB,EAAEoB,GAAE,KAAKpB,CAAC,EAAEmB,GAAE,EAAE,EAAEF,GAAEjB,EAAE,KAAI,GAAI,MAAMiB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOL,CAAC,EAAE,MAAM,mDAAuEK,IAApB,kBAAsB,qBAAqB,OAAO,KAAKL,CAAC,EAAE,KAAK,IAAI,EAAE,IAAIK,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE5B,EAAEK,EAAEC,EAAE,CAAC,GAASN,GAAN,KAAQ,OAAOA,EAAE,IAAIe,EAAE,GAAGC,GAAE,EAAE,OAAAW,GAAE3B,EAAEe,EAAE,GAAG,GAAG,SAASf,GAAE,CAAC,OAAOK,EAAE,KAAKC,EAAEN,GAAEgB,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,EAAE7B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAIK,EAAEL,EAAE,QAAQK,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,EAAE,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,CAAC,EAAOL,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAE,CAAC,GAAOL,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI8B,GAAE,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBD,GAAE,wBAAwB,EAAE,kBAAkBlB,CAAC,EAAE,SAASoB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIL,GAAE,QAAQ,SAAS5B,EAAEK,EAAEC,EAAE,CAACsB,GAAE5B,EAAE,UAAU,CAACK,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASN,EAAE,CAAC,IAAIK,EAAE,EAAE,OAAAuB,GAAE5B,EAAE,UAAU,CAACK,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASL,EAAE,CAAC,OAAO4B,GAAE5B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACuB,EAAEvB,CAAC,EAAE,MALine truncated
|
||||
+26
-26
@@ -34,10 +34,10 @@ var ZP=Object.defineProperty;var GP=(n,e,t)=>e in n?ZP(n,e,{enumerable:!0,config
|
||||
`+B+l}var G=!1;function Y(l,h){if(!l||G)return"";G=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(ge){var v=ge}Reflect.construct(l,[],h)}else{try{h.call()}catch(ge){v=ge}l.call(h.prototype)}else{try{throw Error()}catch(ge){v=ge}l()}}catch(ge){if(ge&&v&&typeof ge.stack=="string"){for(var k=ge.stack.split(`
|
||||
`),P=v.stack.split(`
|
||||
`),j=k.length-1,J=P.length-1;1<=j&&0<=J&&k[j]!==P[J];)J--;for(;1<=j&&0<=J;j--,J--)if(k[j]!==P[J]){if(j!==1||J!==1)do if(j--,J--,0>J||k[j]!==P[J]){var re=`
|
||||
`+k[j].replace(" at new "," at ");return l.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",l.displayName)),re}while(1<=j&&0<=J);break}}}finally{G=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?Q(l):""}function ue(l){switch(l.tag){case 5:return Q(l.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return l=Y(l.type,!1),l;case 11:return l=Y(l.type.render,!1),l;case 1:return l=Y(l.type,!0),l;default:return""}}function pe(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case z:return"Fragment";case F:return"Portal";case K:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case ee:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case U:return(l.displayName||"Context")+".Consumer";case W:return(l._context.displayName||"Context")+".Provider";case X:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case le:return h=l.displayName||null,h!==null?h:pe(l.type)||"Memo";case Z:h=l._payload,l=l._init;try{return pe(l(h))}catch{}}return null}function ve(l){var h=l.type;switch(l.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=h.render,l=l.displayName||l.name||"",h.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(h);case 8:return h===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function xe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ye(l){var h=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function Pe(l){var h=ye(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,h),v=""+l[h];if(!l.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var k=m.get,P=m.set;return Object.defineProperty(l,h,{configurable:!0,get:function(){return k.call(this)},set:function(j){v=""+j,P.call(this,j)}}),Object.defineProperty(l,h,{enumerable:m.enumerable}),{getValue:function(){return v},setValue:function(j){v=""+j},stopTracking:function(){l._valueTracker=null,delete l[h]}}}}function Ke(l){l._valueTracker||(l._valueTracker=Pe(l))}function nt(l){if(!l)return!1;var h=l._valueTracker;if(!h)return!0;var m=h.getValue(),v="";return l&&(v=ye(l)?l.checked?"true":"false":l.value),l=v,l!==m?(h.setValue(l),!0):!1}function Ce(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ge(l,h){var m=h.checked;return q({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function pt(l,h){var m=h.defaultValue==null?"":h.defaultValue,v=h.checked!=null?h.checked:h.defaultChecked;m=xe(h.value!=null?h.value:m),l._wrapperState={initialChecked:v,initialValue:m,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function bt(l,h){h=h.checked,h!=null&&E(l,"checked",h,!1)}function ot(l,h){bt(l,h);var m=xe(h.value),v=h.type;if(m!=null)v==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(v==="submit"||v==="reset"){l.removeAttribute("value");return}h.hasOwnProperty("value")?et(l,h.type,m):h.hasOwnProperty("defaultValue")&&et(l,h.type,xe(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(l.defaultChecked=!!h.defaultChecked)}function mt(l,h,m){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var v=h.type;if(!(v!=="submit"&&v!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+l._wrapperState.initialValue,m||h===l.value||(l.value=h),l.defaultValue=h}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function et(l,h,m){(h!=="number"||Ce(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var tt=Array.isArray;function at(l,h,m,v){if(l=l.options,h){h={};for(var k=0;k<m.length;k++)h["$"+m[k]]=!0;for(m=0;m<l.length;m++)k=h.hasOwnProperty("$"+l[m].value),l[m].selected!==k&&(l[m].selected=k),k&&v&&(l[m].defaultSelected=!0)}else{for(m=""+xe(m),h=null,k=0;k<l.length;k++){if(l[k].value===m){l[k].selected=!0,v&&(l[k].defaultSelected=!0);return}h!==null||l[k].disabled||(h=l[k])}h!==null&&(h.selected=!0)}}function qe(l,h){if(h.dangerouslySetInnerH
Line truncated
|
||||
`).replace(te,"")}function me(l,h,m){if(h=ce(h),ce(l)!==h&&m)throw Error(t(425))}function _e(){}var Fe=null,rt=null;function yt(l,h){return l==="textarea"||l==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Bn=typeof setTimeout=="function"?setTimeout:void 0,kn=typeof clearTimeout=="function"?clearTimeout:void 0,xr=typeof Promise=="function"?Promise:void 0,sr=typeof queueMicrotask=="function"?queueMicrotask:typeof xr<"u"?function(l){return xr.resolve(null).then(l).catch(Eo)}:Bn;function Eo(l){setTimeout(function(){throw l})}function pu(l,h){var m=h,v=0;do{var k=m.nextSibling;if(l.removeChild(m),k&&k.nodeType===8)if(m=k.data,m==="/$"){if(v===0){l.removeChild(k),Vr(h);return}v--}else m!=="$"&&m!=="$?"&&m!=="$!"||v++;m=k}while(m);Vr(h)}function rs(l){for(;l!=null;l=l.nextSibling){var h=l.nodeType;if(h===1||h===3)break;if(h===8){if(h=l.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return l}function kf(l){l=l.previousSibling;for(var h=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(h===0)return l;h--}else m==="/$"&&h++}l=l.previousSibling}return null}var Ms=Math.random().toString(36).slice(2),fi="__reactFiber$"+Ms,Po="__reactProps$"+Ms,It="__reactContainer$"+Ms,Bo="__reactEvents$"+Ms,Im="__reactListeners$"+Ms,zm="__reactHandles$"+Ms;function Ns(l){var h=l[fi];if(h)return h;for(var m=l.parentNode;m;){if(h=m[It]||m[fi]){if(m=h.alternate,h.child!==null||m!==null&&m.child!==null)for(l=kf(l);l!==null;){if(m=l[fi])return m;l=kf(l)}return h}l=m,m=l.parentNode}return null}function Ls(l){return l=l[fi]||l[It],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Fs(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function Fl(l){return l[Po]||null}var jm=[],Il=-1;function Ro(l){return{current:l}}function nn(l){0>Il||(l.current=jm[Il],jm[Il]=null,Il--)}function Kt(l,h){Il++,jm[Il]=l.current,l.current=h}var Do={},or=Ro(Do),Cr=Ro(!1),ka=Do;function zl(l,h){var m=l.type.contextTypes;if(!m)return Do;var v=l.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===h)return v.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in m)k[P]=h[P];return v&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=h,l.__reactInternalMemoizedMaskedChildContext=k),k}function Tr(l){return l=l.childContextTypes,l!=null}function Sf(){nn(Cr),nn(or)}function RA(l,h,m){if(or.current!==Do)throw Error(t(168));Kt(or,h),Kt(Cr,m)}function DA(l,h,m){var v=l.stateNode;if(h=h.childContextTypes,typeof v.getChildContext!="function")return m;v=v.getChildContext();for(var k in v)if(!(k in h))throw Error(t(108,ve(l)||"Unknown",k));return q({},m,v)}function Cf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Do,ka=or.current,Kt(or,l),Kt(Cr,Cr.current),!0}function MA(l,h,m){var v=l.stateNode;if(!v)throw Error(t(169));m?(l=DA(l,h,ka),v.__reactInternalMemoizedMergedChildContext=l,nn(Cr),nn(or),Kt(or,l)):nn(Cr),Kt(Cr,m)}var Is=null,Tf=!1,Qm=!1;function NA(l){Is===null?Is=[l]:Is.push(l)}function dP(l){Tf=!0,NA(l)}function Mo(){if(!Qm&&Is!==null){Qm=!0;var l=0,h=Bt;try{var m=Is;for(Bt=1;l<m.length;l++){var v=m[l];do v=v(!0);while(v!==null)}Is=null,Tf=!1}catch(k){throw Is!==null&&(Is=Is.slice(l+1)),ef(Wc,Mo),k}finally{Bt=h,Qm=!1}}return null}var jl=[],Ql=0,Ef=null,Pf=0,di=[],pi=0,Sa=null,zs=1,js="";function Ca(l,h){jl[Ql++]=Pf,jl[Ql++]=Ef,Ef=l,Pf=h}function LA(l,h,m){di[pi++]=zs,di[pi++]=js,di[pi++]=Sa,Sa=l;var v=zs;l=js;var k=32-gt(v)-1;v&=~(1<<k),m+=1;var P=32-gt(h)+k;if(30<P){var j=k-k%5;P=(v&(1<<j)-1).toString(32),v>>=j,k-=j,zs=1<<32-gt(h)+k|m<<k|v,js=P+l}else zs=1<<P|m<<k|v,js=l}function Hm(l){l.return!==null&&(Ca(l,1),LA(l,1,0))}function Wm(l){for(;l===Ef;)Ef=jl[--Ql],jl[Ql]=null,Pf=jl[--Ql],jl[Ql]=null;for(;l===Sa;)Sa=di[--pi],di[pi]=null,js=di[--pi],di[pi]=null,zs=di[--pi],di[pi]=null}var Xr=null,Kr=null,an=!1,Ri=null;function FA(l,h){var m=yi(5,null,null,0);m.elementType="DELETED",m.stateNode=h,m.return=l,h=l.deletions,h===null?(l.deletions=[m],l.flags|=16):h.push(m)}function IA(l,h){switch(l.tag){case 5:var m=l.type;return h=h.nodeType!==1||m.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(l.stateNode=h,Xr=l,Kr=rs(h.firstChild),!0):!1;case 6:return h=l.pendingProps===""||h.nodeType!==3?null:h,h!==null?(l.stateNode=h,Xr=l,Kr=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(m=Sa!==null?{id:zs,overflow:js}:null,l.memoizedState={dehydrated:h,treeContext:m,retryLane:1073741824},m=yi(18,null,null,0),m.stateNode=h,m.return=l,l.child=m,Xr=l,Kr=null,!0):!1;default:return!1}}function qm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Vm(l){if(an){var h=Kr;if(h){var m=h;if(!IA(l,h)){if(qm(l))throw Error(t(418));h=rs(m.nextSibling);var v=Xr;h&&IA(l,h)?FA(v,m):(l.flags=l.flags&-4097|2,an=!1,Xr=l)}}else{if(qm(l))throw Error(t(418));l.flags=l.flags&-4097|2,an=!1,Xr=l}}}function zA(l){for(l=l.
Line truncated
|
||||
`+k[j].replace(" at new "," at ");return l.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",l.displayName)),re}while(1<=j&&0<=J);break}}}finally{G=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?Q(l):""}function ue(l){switch(l.tag){case 5:return Q(l.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return l=Y(l.type,!1),l;case 11:return l=Y(l.type.render,!1),l;case 1:return l=Y(l.type,!0),l;default:return""}}function pe(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case z:return"Fragment";case F:return"Portal";case K:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case ee:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case U:return(l.displayName||"Context")+".Consumer";case W:return(l._context.displayName||"Context")+".Provider";case X:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case le:return h=l.displayName||null,h!==null?h:pe(l.type)||"Memo";case Z:h=l._payload,l=l._init;try{return pe(l(h))}catch{}}return null}function ve(l){var h=l.type;switch(l.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=h.render,l=l.displayName||l.name||"",h.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(h);case 8:return h===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function xe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ye(l){var h=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function Pe(l){var h=ye(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,h),v=""+l[h];if(!l.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var k=m.get,P=m.set;return Object.defineProperty(l,h,{configurable:!0,get:function(){return k.call(this)},set:function(j){v=""+j,P.call(this,j)}}),Object.defineProperty(l,h,{enumerable:m.enumerable}),{getValue:function(){return v},setValue:function(j){v=""+j},stopTracking:function(){l._valueTracker=null,delete l[h]}}}}function Ke(l){l._valueTracker||(l._valueTracker=Pe(l))}function nt(l){if(!l)return!1;var h=l._valueTracker;if(!h)return!0;var m=h.getValue(),v="";return l&&(v=ye(l)?l.checked?"true":"false":l.value),l=v,l!==m?(h.setValue(l),!0):!1}function Ce(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ge(l,h){var m=h.checked;return q({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function pt(l,h){var m=h.defaultValue==null?"":h.defaultValue,v=h.checked!=null?h.checked:h.defaultChecked;m=xe(h.value!=null?h.value:m),l._wrapperState={initialChecked:v,initialValue:m,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function bt(l,h){h=h.checked,h!=null&&E(l,"checked",h,!1)}function ot(l,h){bt(l,h);var m=xe(h.value),v=h.type;if(m!=null)v==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(v==="submit"||v==="reset"){l.removeAttribute("value");return}h.hasOwnProperty("value")?et(l,h.type,m):h.hasOwnProperty("defaultValue")&&et(l,h.type,xe(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(l.defaultChecked=!!h.defaultChecked)}function mt(l,h,m){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var v=h.type;if(!(v!=="submit"&&v!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+l._wrapperState.initialValue,m||h===l.value||(l.value=h),l.defaultValue=h}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function et(l,h,m){(h!=="number"||Ce(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var tt=Array.isArray;function at(l,h,m,v){if(l=l.options,h){h={};for(var k=0;k<m.length;k++)h["$"+m[k]]=!0;for(m=0;m<l.length;m++)k=h.hasOwnProperty("$"+l[m].value),l[m].selected!==k&&(l[m].selected=k),k&&v&&(l[m].defaultSelected=!0)}else{for(m=""+xe(m),h=null,k=0;k<l.length;k++){if(l[k].value===m){l[k].selected=!0,v&&(l[k].defaultSelected=!0);return}h!==null||l[k].disabled||(h=l[k])}h!==null&&(h.selected=!0)}}function qe(l,h){if(h.dangerouslySetInnerH
Line truncated
|
||||
`).replace(te,"")}function me(l,h,m){if(h=ce(h),ce(l)!==h&&m)throw Error(t(425))}function _e(){}var Fe=null,rt=null;function yt(l,h){return l==="textarea"||l==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Bn=typeof setTimeout=="function"?setTimeout:void 0,kn=typeof clearTimeout=="function"?clearTimeout:void 0,xr=typeof Promise=="function"?Promise:void 0,sr=typeof queueMicrotask=="function"?queueMicrotask:typeof xr<"u"?function(l){return xr.resolve(null).then(l).catch(Po)}:Bn;function Po(l){setTimeout(function(){throw l})}function pu(l,h){var m=h,v=0;do{var k=m.nextSibling;if(l.removeChild(m),k&&k.nodeType===8)if(m=k.data,m==="/$"){if(v===0){l.removeChild(k),Vr(h);return}v--}else m!=="$"&&m!=="$?"&&m!=="$!"||v++;m=k}while(m);Vr(h)}function rs(l){for(;l!=null;l=l.nextSibling){var h=l.nodeType;if(h===1||h===3)break;if(h===8){if(h=l.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return l}function kf(l){l=l.previousSibling;for(var h=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(h===0)return l;h--}else m==="/$"&&h++}l=l.previousSibling}return null}var Ms=Math.random().toString(36).slice(2),ui="__reactFiber$"+Ms,Bo="__reactProps$"+Ms,It="__reactContainer$"+Ms,Ro="__reactEvents$"+Ms,Im="__reactListeners$"+Ms,zm="__reactHandles$"+Ms;function Ns(l){var h=l[ui];if(h)return h;for(var m=l.parentNode;m;){if(h=m[It]||m[ui]){if(m=h.alternate,h.child!==null||m!==null&&m.child!==null)for(l=kf(l);l!==null;){if(m=l[ui])return m;l=kf(l)}return h}l=m,m=l.parentNode}return null}function Ls(l){return l=l[ui]||l[It],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Fs(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function Fl(l){return l[Bo]||null}var jm=[],Il=-1;function Do(l){return{current:l}}function nn(l){0>Il||(l.current=jm[Il],jm[Il]=null,Il--)}function Kt(l,h){Il++,jm[Il]=l.current,l.current=h}var Mo={},or=Do(Mo),Cr=Do(!1),ka=Mo;function zl(l,h){var m=l.type.contextTypes;if(!m)return Mo;var v=l.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===h)return v.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in m)k[P]=h[P];return v&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=h,l.__reactInternalMemoizedMaskedChildContext=k),k}function Tr(l){return l=l.childContextTypes,l!=null}function Sf(){nn(Cr),nn(or)}function RA(l,h,m){if(or.current!==Mo)throw Error(t(168));Kt(or,h),Kt(Cr,m)}function DA(l,h,m){var v=l.stateNode;if(h=h.childContextTypes,typeof v.getChildContext!="function")return m;v=v.getChildContext();for(var k in v)if(!(k in h))throw Error(t(108,ve(l)||"Unknown",k));return q({},m,v)}function Cf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Mo,ka=or.current,Kt(or,l),Kt(Cr,Cr.current),!0}function MA(l,h,m){var v=l.stateNode;if(!v)throw Error(t(169));m?(l=DA(l,h,ka),v.__reactInternalMemoizedMergedChildContext=l,nn(Cr),nn(or),Kt(or,l)):nn(Cr),Kt(Cr,m)}var Is=null,Tf=!1,Qm=!1;function NA(l){Is===null?Is=[l]:Is.push(l)}function dP(l){Tf=!0,NA(l)}function No(){if(!Qm&&Is!==null){Qm=!0;var l=0,h=Bt;try{var m=Is;for(Bt=1;l<m.length;l++){var v=m[l];do v=v(!0);while(v!==null)}Is=null,Tf=!1}catch(k){throw Is!==null&&(Is=Is.slice(l+1)),ef(Wc,No),k}finally{Bt=h,Qm=!1}}return null}var jl=[],Ql=0,Ef=null,Pf=0,hi=[],fi=0,Sa=null,zs=1,js="";function Ca(l,h){jl[Ql++]=Pf,jl[Ql++]=Ef,Ef=l,Pf=h}function LA(l,h,m){hi[fi++]=zs,hi[fi++]=js,hi[fi++]=Sa,Sa=l;var v=zs;l=js;var k=32-gt(v)-1;v&=~(1<<k),m+=1;var P=32-gt(h)+k;if(30<P){var j=k-k%5;P=(v&(1<<j)-1).toString(32),v>>=j,k-=j,zs=1<<32-gt(h)+k|m<<k|v,js=P+l}else zs=1<<P|m<<k|v,js=l}function Hm(l){l.return!==null&&(Ca(l,1),LA(l,1,0))}function Wm(l){for(;l===Ef;)Ef=jl[--Ql],jl[Ql]=null,Pf=jl[--Ql],jl[Ql]=null;for(;l===Sa;)Sa=hi[--fi],hi[fi]=null,js=hi[--fi],hi[fi]=null,zs=hi[--fi],hi[fi]=null}var Xr=null,Kr=null,an=!1,Ri=null;function FA(l,h){var m=gi(5,null,null,0);m.elementType="DELETED",m.stateNode=h,m.return=l,h=l.deletions,h===null?(l.deletions=[m],l.flags|=16):h.push(m)}function IA(l,h){switch(l.tag){case 5:var m=l.type;return h=h.nodeType!==1||m.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(l.stateNode=h,Xr=l,Kr=rs(h.firstChild),!0):!1;case 6:return h=l.pendingProps===""||h.nodeType!==3?null:h,h!==null?(l.stateNode=h,Xr=l,Kr=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(m=Sa!==null?{id:zs,overflow:js}:null,l.memoizedState={dehydrated:h,treeContext:m,retryLane:1073741824},m=gi(18,null,null,0),m.stateNode=h,m.return=l,l.child=m,Xr=l,Kr=null,!0):!1;default:return!1}}function qm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Vm(l){if(an){var h=Kr;if(h){var m=h;if(!IA(l,h)){if(qm(l))throw Error(t(418));h=rs(m.nextSibling);var v=Xr;h&&IA(l,h)?FA(v,m):(l.flags=l.flags&-4097|2,an=!1,Xr=l)}}else{if(qm(l))throw Error(t(418));l.flags=l.flags&-4097|2,an=!1,Xr=l}}}function zA(l){for(l=l.
Line truncated
|
||||
Error generating stack: `+P.message+`
|
||||
`+P.stack}return{value:l,source:h,stack:k,digest:null}}function dg(l,h,m){return{value:l,source:null,stack:m??null,digest:h??null}}function pg(l,h){try{console.error(h.value)}catch(m){setTimeout(function(){throw m})}}var wP=typeof WeakMap=="function"?WeakMap:Map;function v1(l,h,m){m=Hs(-1,m),m.tag=3,m.payload={element:null};var v=h.value;return m.callback=function(){Xf||(Xf=!0,Eg=v),pg(l,h)},m}function A1(l,h,m){m=Hs(-1,m),m.tag=3;var v=l.type.getDerivedStateFromError;if(typeof v=="function"){var k=h.value;m.payload=function(){return v(k)},m.callback=function(){pg(l,h)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(m.callback=function(){pg(l,h),typeof v!="function"&&(Io===null?Io=new Set([this]):Io.add(this));var j=h.stack;this.componentDidCatch(h.value,{componentStack:j!==null?j:""})}),m}function b1(l,h,m){var v=l.pingCache;if(v===null){v=l.pingCache=new wP;var k=new Set;v.set(h,k)}else k=v.get(h),k===void 0&&(k=new Set,v.set(h,k));k.has(m)||(k.add(m),l=LP.bind(null,l,h,m),h.then(l,l))}function w1(l){do{var h;if((h=l.tag===13)&&(h=l.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return l;l=l.return}while(l!==null);return null}function _1(l,h,m,v,k){return(l.mode&1)===0?(l===h?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(h=Hs(-1,1),h.tag=2,Lo(m,h,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=k,l)}var _P=D.ReactCurrentOwner,Er=!1;function yr(l,h,m,v){h.child=l===null?WA(h,null,m,v):Wl(h,l.child,m,v)}function O1(l,h,m,v,k){m=m.render;var P=h.ref;return Vl(h,k),v=sg(l,h,m,v,P,k),m=og(),l!==null&&!Er?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~k,Ws(l,h,k)):(an&&m&&Hm(h),h.flags|=1,yr(l,h,v,k),h.child)}function k1(l,h,m,v,k){if(l===null){var P=m.type;return typeof P=="function"&&!Lg(P)&&P.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(h.tag=15,h.type=P,S1(l,h,P,v,k)):(l=nd(m.type,null,v,h,h.mode,k),l.ref=h.ref,l.return=h,h.child=l)}if(P=l.child,(l.lanes&k)===0){var j=P.memoizedProps;if(m=m.compare,m=m!==null?m:es,m(j,v)&&l.ref===h.ref)return Ws(l,h,k)}return h.flags|=1,l=Ho(P,v),l.ref=h.ref,l.return=h,h.child=l}function S1(l,h,m,v,k){if(l!==null){var P=l.memoizedProps;if(es(P,v)&&l.ref===h.ref)if(Er=!1,h.pendingProps=v=P,(l.lanes&k)!==0)(l.flags&131072)!==0&&(Er=!0);else return h.lanes=l.lanes,Ws(l,h,k)}return mg(l,h,m,v,k)}function C1(l,h,m){var v=h.pendingProps,k=v.children,P=l!==null?l.memoizedState:null;if(v.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},Kt(Gl,Yr),Yr|=m;else{if((m&1073741824)===0)return l=P!==null?P.baseLanes|m:m,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:l,cachePool:null,transitions:null},h.updateQueue=null,Kt(Gl,Yr),Yr|=l,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=P!==null?P.baseLanes:m,Kt(Gl,Yr),Yr|=v}else P!==null?(v=P.baseLanes|m,h.memoizedState=null):v=m,Kt(Gl,Yr),Yr|=v;return yr(l,h,k,m),h.child}function T1(l,h){var m=h.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(h.flags|=512,h.flags|=2097152)}function mg(l,h,m,v,k){var P=Tr(m)?ka:or.current;return P=zl(h,P),Vl(h,k),m=sg(l,h,m,v,P,k),v=og(),l!==null&&!Er?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~k,Ws(l,h,k)):(an&&v&&Hm(h),h.flags|=1,yr(l,h,m,k),h.child)}function E1(l,h,m,v,k){if(Tr(m)){var P=!0;Cf(h)}else P=!1;if(Vl(h,k),h.stateNode===null)Vf(l,h),x1(h,m,v),fg(h,m,v,k),v=!0;else if(l===null){var j=h.stateNode,J=h.memoizedProps;j.props=J;var re=j.context,ge=m.contextType;typeof ge=="object"&&ge!==null?ge=mi(ge):(ge=Tr(m)?ka:or.current,ge=zl(h,ge));var Se=m.getDerivedStateFromProps,Ee=typeof Se=="function"||typeof j.getSnapshotBeforeUpdate=="function";Ee||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(J!==v||re!==ge)&&y1(h,j,v,ge),No=!1;var ke=h.memoizedState;j.state=ke,Lf(h,v,j,k),re=h.memoizedState,J!==v||ke!==re||Cr.current||No?(typeof Se=="function"&&(hg(h,m,Se,v),re=h.memoizedState),(J=No||g1(h,m,J,v,ke,re,ge))?(Ee||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(h.flags|=4194308)):(typeof j.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=v,h.memoizedState=re),j.props=v,j.state=re,j.context=ge,v=J):(typeof j.componentDidMount=="function"&&(h.flags|=4194308),v=!1)}else{j=h.stateNode,VA(l,h),J=h.memoizedProps,ge=h.type===h.elementType?J:Di(h.type,J),j.props=ge,Ee=h.pendingProps,ke=j.context,re=m.contextType,typeof re=="object"&&re!==null?re=mi(re):(re=Tr(m)?ka:or.current,re=zl(h,re));var Qe=m.getDerivedStateFromProps;(Se=typeof Qe=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(J!==Ee||ke!==re)&&y1(h,j,
Line truncated
|
||||
`+P.stack}return{value:l,source:h,stack:k,digest:null}}function dg(l,h,m){return{value:l,source:null,stack:m??null,digest:h??null}}function pg(l,h){try{console.error(h.value)}catch(m){setTimeout(function(){throw m})}}var wP=typeof WeakMap=="function"?WeakMap:Map;function v1(l,h,m){m=Hs(-1,m),m.tag=3,m.payload={element:null};var v=h.value;return m.callback=function(){Xf||(Xf=!0,Eg=v),pg(l,h)},m}function A1(l,h,m){m=Hs(-1,m),m.tag=3;var v=l.type.getDerivedStateFromError;if(typeof v=="function"){var k=h.value;m.payload=function(){return v(k)},m.callback=function(){pg(l,h)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(m.callback=function(){pg(l,h),typeof v!="function"&&(zo===null?zo=new Set([this]):zo.add(this));var j=h.stack;this.componentDidCatch(h.value,{componentStack:j!==null?j:""})}),m}function b1(l,h,m){var v=l.pingCache;if(v===null){v=l.pingCache=new wP;var k=new Set;v.set(h,k)}else k=v.get(h),k===void 0&&(k=new Set,v.set(h,k));k.has(m)||(k.add(m),l=LP.bind(null,l,h,m),h.then(l,l))}function w1(l){do{var h;if((h=l.tag===13)&&(h=l.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return l;l=l.return}while(l!==null);return null}function _1(l,h,m,v,k){return(l.mode&1)===0?(l===h?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(h=Hs(-1,1),h.tag=2,Fo(m,h,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=k,l)}var _P=D.ReactCurrentOwner,Er=!1;function yr(l,h,m,v){h.child=l===null?WA(h,null,m,v):Wl(h,l.child,m,v)}function O1(l,h,m,v,k){m=m.render;var P=h.ref;return Vl(h,k),v=sg(l,h,m,v,P,k),m=og(),l!==null&&!Er?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~k,Ws(l,h,k)):(an&&m&&Hm(h),h.flags|=1,yr(l,h,v,k),h.child)}function k1(l,h,m,v,k){if(l===null){var P=m.type;return typeof P=="function"&&!Lg(P)&&P.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(h.tag=15,h.type=P,S1(l,h,P,v,k)):(l=nd(m.type,null,v,h,h.mode,k),l.ref=h.ref,l.return=h,h.child=l)}if(P=l.child,(l.lanes&k)===0){var j=P.memoizedProps;if(m=m.compare,m=m!==null?m:es,m(j,v)&&l.ref===h.ref)return Ws(l,h,k)}return h.flags|=1,l=Wo(P,v),l.ref=h.ref,l.return=h,h.child=l}function S1(l,h,m,v,k){if(l!==null){var P=l.memoizedProps;if(es(P,v)&&l.ref===h.ref)if(Er=!1,h.pendingProps=v=P,(l.lanes&k)!==0)(l.flags&131072)!==0&&(Er=!0);else return h.lanes=l.lanes,Ws(l,h,k)}return mg(l,h,m,v,k)}function C1(l,h,m){var v=h.pendingProps,k=v.children,P=l!==null?l.memoizedState:null;if(v.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},Kt(Gl,Yr),Yr|=m;else{if((m&1073741824)===0)return l=P!==null?P.baseLanes|m:m,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:l,cachePool:null,transitions:null},h.updateQueue=null,Kt(Gl,Yr),Yr|=l,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=P!==null?P.baseLanes:m,Kt(Gl,Yr),Yr|=v}else P!==null?(v=P.baseLanes|m,h.memoizedState=null):v=m,Kt(Gl,Yr),Yr|=v;return yr(l,h,k,m),h.child}function T1(l,h){var m=h.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(h.flags|=512,h.flags|=2097152)}function mg(l,h,m,v,k){var P=Tr(m)?ka:or.current;return P=zl(h,P),Vl(h,k),m=sg(l,h,m,v,P,k),v=og(),l!==null&&!Er?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~k,Ws(l,h,k)):(an&&v&&Hm(h),h.flags|=1,yr(l,h,m,k),h.child)}function E1(l,h,m,v,k){if(Tr(m)){var P=!0;Cf(h)}else P=!1;if(Vl(h,k),h.stateNode===null)Vf(l,h),x1(h,m,v),fg(h,m,v,k),v=!0;else if(l===null){var j=h.stateNode,J=h.memoizedProps;j.props=J;var re=j.context,ge=m.contextType;typeof ge=="object"&&ge!==null?ge=di(ge):(ge=Tr(m)?ka:or.current,ge=zl(h,ge));var Se=m.getDerivedStateFromProps,Ee=typeof Se=="function"||typeof j.getSnapshotBeforeUpdate=="function";Ee||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(J!==v||re!==ge)&&y1(h,j,v,ge),Lo=!1;var ke=h.memoizedState;j.state=ke,Lf(h,v,j,k),re=h.memoizedState,J!==v||ke!==re||Cr.current||Lo?(typeof Se=="function"&&(hg(h,m,Se,v),re=h.memoizedState),(J=Lo||g1(h,m,J,v,ke,re,ge))?(Ee||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(h.flags|=4194308)):(typeof j.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=v,h.memoizedState=re),j.props=v,j.state=re,j.context=ge,v=J):(typeof j.componentDidMount=="function"&&(h.flags|=4194308),v=!1)}else{j=h.stateNode,VA(l,h),J=h.memoizedProps,ge=h.type===h.elementType?J:Di(h.type,J),j.props=ge,Ee=h.pendingProps,ke=j.context,re=m.contextType,typeof re=="object"&&re!==null?re=di(re):(re=Tr(m)?ka:or.current,re=zl(h,re));var Qe=m.getDerivedStateFromProps;(Se=typeof Qe=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(J!==Ee||ke!==re)&&y1(h,j,
Line truncated
|
||||
`)}function Yl(n,e,t){const r=Math.floor(Date.now()/1e3);return{id:-Date.now(),type:"PRIV",conversation_key:n,text:e,sender_timestamp:r,received_at:r,paths:null,txt_type:0,signature:null,outgoing:t,acked:1}}function hB(n){const e=R.useRef(null),t=R.useRef(null),r=R.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null),e.current=null},[]),i=R.useCallback(async()=>{const o=e.current;if(!o)return;let a=null,u=null;for(let f=0;f<2;f++)try{a=await dt.requestTelemetry(o.conversationId,"");break}catch(p){u=p instanceof Error?p:new Error("Unknown error"),f===0&&await new Promise(g=>setTimeout(g,2e3))}if(a){const f=Yl(o.conversationId,uB(o,a),!1);n(p=>[...p,f])}else{const f=Yl(o.conversationId,`Duty cycle poll failed after retry: ${(u==null?void 0:u.message)??"Unknown error"}`,!1);n(p=>[...p,f])}},[n]),s=R.useCallback(async(o,a)=>{const u=o.trim().toLowerCase();if(u==="dutycycle_start"){r();let f=null,p=null;for(let A=0;A<2;A++)try{f=await dt.requestTelemetry(a,"");break}catch(_){p=_ instanceof Error?_:new Error("Unknown error"),A===0&&await new Promise(b=>setTimeout(b,2e3))}if(!f){const A=Yl(a,`Failed to start duty cycle tracking after retry: ${(p==null?void 0:p.message)??"Unknown error"}`,!1);return n(_=>[..._,A]),!0}const g=Math.floor(Date.now()/1e3);e.current={startTime:g,uptime:f.uptime_seconds,txAirtime:f.airtime_seconds,rxAirtime:f.rx_airtime_seconds,sentFlood:f.sent_flood,sentDirect:f.sent_direct,recvFlood:f.recv_flood,recvDirect:f.recv_direct,conversationId:a};const x=Yl(a,`Airtime/duty cycle statistics gathering begins at ${g}. Logs will follow every 5 minutes. To stop, run dutycycle_stop or navigate away from this conversation.`,!1);return n(A=>[...A,x]),t.current=window.setInterval(i,lB),!0}if(u==="dutycycle_stop"){if(e.current&&e.current.conversationId===a){await i(),r();const f=Yl(a,"Airtime/duty cycle statistics gathering stopped.",!1);n(p=>[...p,f])}else{const f=Yl(a,"Duty cycle tracking is not active.",!1);n(p=>[...p,f])}return!0}return!1},[n,r,i]);return R.useEffect(()=>()=>{t.current!==null&&clearInterval(t.current)},[]),{handleAirtimeCommand:s,stopTracking:r}}function Xd(n){if(n<60)return`${n}s`;const e=Math.floor(n/86400),t=Math.floor(n%86400/3600),r=Math.floor(n%3600/60);return e>0?t>0&&r>0?`${e}d${t}h${r}m`:t>0?`${e}d${t}h`:r>0?`${e}d${r}m`:`${e}d`:t>0?r>0?`${t}h${r}m`:`${t}h`:`${r}m`}function fB(n){return["Telemetry",`Battery Voltage: ${n.battery_volts.toFixed(3)}V`,`Uptime: ${Xd(n.uptime_seconds)}`,...n.clock_output?[`Clock: ${n.clock_output}`]:[],`TX Airtime: ${Xd(n.airtime_seconds)}`,`RX Airtime: ${Xd(n.rx_airtime_seconds)}`,"",`Noise Floor: ${n.noise_floor_dbm} dBm`,`Last RSSI: ${n.last_rssi_dbm} dBm`,`Last SNR: ${n.last_snr_db.toFixed(1)} dB`,"",`Packets: ${n.packets_received.toLocaleString()} rx / ${n.packets_sent.toLocaleString()} tx`,`Flood: ${n.recv_flood.toLocaleString()} rx / ${n.sent_flood.toLocaleString()} tx`,`Direct: ${n.recv_direct.toLocaleString()} rx / ${n.sent_direct.toLocaleString()} tx`,`Duplicates: ${n.flood_dups.toLocaleString()} flood / ${n.direct_dups.toLocaleString()} direct`,"",`TX Queue: ${n.tx_queue_len}`,`Debug Flags: ${n.full_events}`].join(`
|
||||
`)}function dB(n){if(n.length===0)return`Neighbors
|
||||
No neighbors reported`;const e=[...n].sort((r,i)=>i.snr-r.snr),t=[`Neighbors (${e.length})`];for(const r of e){const i=r.name||r.pubkey_prefix,s=r.snr>=0?`+${r.snr.toFixed(1)}`:r.snr.toFixed(1);t.push(`${i}, ${s} dB [${Xd(r.last_heard_seconds)} ago]`)}return t.join(`
|
||||
@@ -78,8 +78,8 @@ No ACL entries`;const e=[`ACL (${n.length})`];for(const t of n){const r=t.name||
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const r4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hk=pv("x",r4);function i4({health:n,config:e,onSettingsClick:t,onMenuClick:r}){const i=(n==null?void 0:n.radio_connected)??!1,[s,o]=R.useState(!1),a=async()=>{o(!0);try{const u=await dt.reconnectRadio();u.connected&&kt.success("Reconnected",{description:u.message})}catch(u){kt.error("Reconnection failed",{description:u instanceof Error?u.message:"Check radio connection and power"})}finally{o(!1)}};return S.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[r&&S.jsx("button",{onClick:r,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:S.jsx(n4,{className:"h-5 w-5"})}),S.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),S.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[S.jsx("div",{className:`w-2 h-2 rounded-full ${i?"bg-[#4caf50]":"bg-[#666]"}`}),S.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:i?"Connected":"Disconnected"})]}),e&&S.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[S.jsx("span",{className:"text-[#e0e0e0]",children:e.name||"Unnamed"}),S.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(e.public_key),kt.success("Public key copied!")},title:"Click to copy public key",children:e.public_key.toLowerCase()})]}),!i&&S.jsx("button",{onClick:a,disabled:s,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:s?"Reconnecting...":"Reconnect"}),S.jsxs("button",{onClick:t,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[S.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const s4=12;function o4(n){return n.slice(0,s4)}function ro(n,e){return n||o4(e)}const vc=2,a4={text:"🛜",background:"#444444",textColor:"#ffffff"};function l4(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e)}const c4=/[\u{1F1E0}-\u{1F1FF}]{2}|[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]/u;function u4(n,e){if(!n)return e.slice(0,2).toUpperCase();const t=n.match(c4);if(t)return t[0];const r=n.match(/[a-zA-Z]/g);if(!r||r.length===0)return e.slice(0,2).toUpperCase();const i=n.indexOf(" ");if(i!==-1){const s=r[0],o=n.slice(i+1).match(/[a-zA-Z]/);if(o)return(s+o[0]).toUpperCase()}return r[0].toUpperCase()}function h4(n){const e=l4(n),t=e%360,r=50+(e>>8)%30,i=35+(e>>16)%20,s=`hsl(${t}, ${r}%, ${i}%)`,o=i<45?"#ffffff":"#000000";return{background:s,text:o}}function f4(n,e,t){if(t===vc)return a4;const r=u4(n,e),i=h4(e);return{text:r,background:i.background,textColor:i.text}}function Yx({name:n,publicKey:e,size:t=28,contactType:r}){const i=f4(n,e,r);return S.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:i.background,color:i.textColor,width:t,height:t,fontSize:t*.45},children:i.text})}const Wk="remoteterm-favorites";function Ga(n,e,t){return n.some(r=>r.type===e&&r.id===t)}function d4(){try{const n=localStorage.getItem(Wk);return n?JSON.parse(n):[]}catch{return[]}}function Cb(){try{localStorage.removeItem(Wk)}catch{}}function qk(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=qk(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Vk(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=qk(n))&&(r&&(r+=" "),r+=e);return r}const p4=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},m4=(n,e)=>({classGroupId:n,validator:e}),$k=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),J0="-",Tb=[],g4="arbitrary..",x4=n=>{const e=v4(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return y4(o);const a=o.split(J0),u=a[0]===""&&a.length>1?1:0;return Uk(a,u,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const u=r[o],f=t[o];return u?f?p4(f,u):u:f||Tb}return t[o]||Tb}}},Uk=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const i=n[e],s=t.nextPart.get(i);if(s){const f=Uk(n,e+1,s);if(f)return f}const o=t.validators;if(o===null)return;const a=e===0?n.join(J0):n.slice(e).join(J0),u=o.length;for(let f=0;f<u;f++){const p=o[f];if(p.validator(a))return p.classGroupId}},y4=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?g4+r:void 0})(),v4=n=>{const{theme:e,classLine truncated
|
||||
.`.concat(tD,` {
|
||||
*/const r4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hk=pv("x",r4);function i4({health:n,config:e,onSettingsClick:t,onMenuClick:r}){const i=(n==null?void 0:n.radio_connected)??!1,[s,o]=R.useState(!1),a=async()=>{o(!0);try{const u=await dt.reconnectRadio();u.connected&&kt.success("Reconnected",{description:u.message})}catch(u){kt.error("Reconnection failed",{description:u instanceof Error?u.message:"Check radio connection and power"})}finally{o(!1)}};return S.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[r&&S.jsx("button",{onClick:r,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:S.jsx(n4,{className:"h-5 w-5"})}),S.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),S.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[S.jsx("div",{className:`w-2 h-2 rounded-full ${i?"bg-[#4caf50]":"bg-[#666]"}`}),S.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:i?"Connected":"Disconnected"})]}),e&&S.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[S.jsx("span",{className:"text-[#e0e0e0]",children:e.name||"Unnamed"}),S.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(e.public_key),kt.success("Public key copied!")},title:"Click to copy public key",children:e.public_key.toLowerCase()})]}),!i&&S.jsx("button",{onClick:a,disabled:s,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:s?"Reconnecting...":"Reconnect"}),S.jsxs("button",{onClick:t,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[S.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const s4=12;function o4(n){return n.slice(0,s4)}function io(n,e){return n||o4(e)}const vc=2,a4={text:"🛜",background:"#444444",textColor:"#ffffff"};function l4(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e)}const c4=/[\u{1F1E0}-\u{1F1FF}]{2}|[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]/u;function u4(n,e){if(!n)return e.slice(0,2).toUpperCase();const t=n.match(c4);if(t)return t[0];const r=n.match(/[a-zA-Z]/g);if(!r||r.length===0)return e.slice(0,2).toUpperCase();const i=n.indexOf(" ");if(i!==-1){const s=r[0],o=n.slice(i+1).match(/[a-zA-Z]/);if(o)return(s+o[0]).toUpperCase()}return r[0].toUpperCase()}function h4(n){const e=l4(n),t=e%360,r=50+(e>>8)%30,i=35+(e>>16)%20,s=`hsl(${t}, ${r}%, ${i}%)`,o=i<45?"#ffffff":"#000000";return{background:s,text:o}}function f4(n,e,t){if(t===vc)return a4;const r=u4(n,e),i=h4(e);return{text:r,background:i.background,textColor:i.text}}function Yx({name:n,publicKey:e,size:t=28,contactType:r}){const i=f4(n,e,r);return S.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:i.background,color:i.textColor,width:t,height:t,fontSize:t*.45},children:i.text})}const Wk="remoteterm-favorites";function Ga(n,e,t){return n.some(r=>r.type===e&&r.id===t)}function d4(){try{const n=localStorage.getItem(Wk);return n?JSON.parse(n):[]}catch{return[]}}function Cb(){try{localStorage.removeItem(Wk)}catch{}}function qk(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=qk(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Vk(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=qk(n))&&(r&&(r+=" "),r+=e);return r}const p4=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},m4=(n,e)=>({classGroupId:n,validator:e}),$k=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),J0="-",Tb=[],g4="arbitrary..",x4=n=>{const e=v4(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return y4(o);const a=o.split(J0),u=a[0]===""&&a.length>1?1:0;return Uk(a,u,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const u=r[o],f=t[o];return u?f?p4(f,u):u:f||Tb}return t[o]||Tb}}},Uk=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const i=n[e],s=t.nextPart.get(i);if(s){const f=Uk(n,e+1,s);if(f)return f}const o=t.validators;if(o===null)return;const a=e===0?n.join(J0):n.slice(e).join(J0),u=o.length;for(let f=0;f<u;f++){const p=o[f];if(p.validator(a))return p.classGroupId}},y4=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?g4+r:void 0})(),v4=n=>{const{theme:e,classLine truncated
|
||||
.`.concat(t5,` {
|
||||
overflow: hidden `).concat(r,`;
|
||||
padding-right: `).concat(a,"px ").concat(r,`;
|
||||
}
|
||||
@@ -113,30 +113,30 @@ No ACL entries`;const e=[`ACL (${n.length})`];for(const t of n){const r=t.name||
|
||||
}
|
||||
|
||||
body[`).concat(uc,`] {
|
||||
`).concat(nD,": ").concat(a,`px;
|
||||
`).concat(n5,": ").concat(a,`px;
|
||||
}
|
||||
`)},Vb=function(){var n=parseInt(document.body.getAttribute(uc)||"0",10);return isFinite(n)?n:0},bD=function(){R.useEffect(function(){return document.body.setAttribute(uc,(Vb()+1).toString()),function(){var n=Vb()-1;n<=0?document.body.removeAttribute(uc):document.body.setAttribute(uc,n.toString())}},[])},wD=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r;bD();var s=R.useMemo(function(){return yD(i)},[i]);return R.createElement(vD,{styles:AD(s,!e,i,t?"":"!important")})},ty=!1;if(typeof window<"u")try{var yd=Object.defineProperty({},"passive",{get:function(){return ty=!0,!0}});window.addEventListener("test",yd,yd),window.removeEventListener("test",yd,yd)}catch{ty=!1}var ec=ty?{passive:!1}:!1,_D=function(n){return n.tagName==="TEXTAREA"},mS=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!_D(n)&&t[e]==="visible")},OD=function(n){return mS(n,"overflowY")},kD=function(n){return mS(n,"overflowX")},$b=function(n,e){var t=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gS(n,r);if(i){var s=xS(n,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},SD=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},CD=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},gS=function(n,e){return n==="v"?OD(e):kD(e)},xS=function(n,e){return n==="v"?SD(e):CD(e)},TD=function(n,e){return n==="h"&&e==="rtl"?-1:1},ED=function(n,e,t,r,i){var s=TD(n,window.getComputedStyle(e).direction),o=s*r,a=t.target,u=e.contains(a),f=!1,p=o>0,g=0,x=0;do{if(!a)break;var A=xS(n,a),_=A[0],b=A[1],w=A[2],C=b-w-s*_;(_||C)&&gS(n,a)&&(g+=C,x+=_);var T=a.parentNode;a=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(p&&Math.abs(g)<1||!p&&Math.abs(x)<1)&&(f=!0),f},vd=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Ub=function(n){return[n.deltaX,n.deltaY]},Zb=function(n){return n&&"current"in n?n.current:n},PD=function(n,e){return n[0]===e[0]&&n[1]===e[1]},BD=function(n){return`
|
||||
`)},Vb=function(){var n=parseInt(document.body.getAttribute(uc)||"0",10);return isFinite(n)?n:0},b5=function(){R.useEffect(function(){return document.body.setAttribute(uc,(Vb()+1).toString()),function(){var n=Vb()-1;n<=0?document.body.removeAttribute(uc):document.body.setAttribute(uc,n.toString())}},[])},w5=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r;b5();var s=R.useMemo(function(){return y5(i)},[i]);return R.createElement(v5,{styles:A5(s,!e,i,t?"":"!important")})},ty=!1;if(typeof window<"u")try{var yd=Object.defineProperty({},"passive",{get:function(){return ty=!0,!0}});window.addEventListener("test",yd,yd),window.removeEventListener("test",yd,yd)}catch{ty=!1}var ec=ty?{passive:!1}:!1,_5=function(n){return n.tagName==="TEXTAREA"},mS=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!_5(n)&&t[e]==="visible")},O5=function(n){return mS(n,"overflowY")},k5=function(n){return mS(n,"overflowX")},$b=function(n,e){var t=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gS(n,r);if(i){var s=xS(n,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},S5=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},C5=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},gS=function(n,e){return n==="v"?O5(e):k5(e)},xS=function(n,e){return n==="v"?S5(e):C5(e)},T5=function(n,e){return n==="h"&&e==="rtl"?-1:1},E5=function(n,e,t,r,i){var s=T5(n,window.getComputedStyle(e).direction),o=s*r,a=t.target,u=e.contains(a),f=!1,p=o>0,g=0,x=0;do{if(!a)break;var A=xS(n,a),_=A[0],b=A[1],w=A[2],C=b-w-s*_;(_||C)&&gS(n,a)&&(g+=C,x+=_);var T=a.parentNode;a=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(p&&Math.abs(g)<1||!p&&Math.abs(x)<1)&&(f=!0),f},vd=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Ub=function(n){return[n.deltaX,n.deltaY]},Zb=function(n){return n&&"current"in n?n.current:n},P5=function(n,e){return n[0]===e[0]&&n[1]===e[1]},B5=function(n){return`
|
||||
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
||||
`)},RD=0,tc=[];function DD(n){var e=R.useRef([]),t=R.useRef([0,0]),r=R.useRef(),i=R.useState(RD++)[0],s=R.useState(pS)[0],o=R.useRef(n);R.useEffect(function(){o.current=n},[n]),R.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var b=eD([n.lockRef.current],(n.shards||[]).map(Zb),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=R.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var C=vd(b),T=t.current,E="deltaX"in b?b.deltaX:T[0]-C[0],D="deltaY"in b?b.deltaY:T[1]-C[1],N,F=b.target,z=Math.abs(E)>Math.abs(D)?"h":"v";if("touches"in b&&z==="h"&&F.type==="range")return!1;var I=window.getSelection(),K=I&&I.anchorNode,W=K?K===F||K.contains(F):!1;if(W)return!1;var U=$b(z,F);if(!U)return!0;if(U?N=z:(N=z==="v"?"h":"v",U=$b(z,F)),!U)return!1;if(!r.current&&"changedTouches"in b&&(E||D)&&(r.current=N),!N)return!0;var X=r.current||N;return ED(X,w,b,X==="h"?E:D)},[]),u=R.useCallback(function(b){var w=b;if(!(!tc.length||tc[tc.length-1]!==s)){var C="deltaY"in w?Ub(w):vd(w),T=e.current.filter(function(N){return N.name===w.type&&(N.target===w.target||w.target===N.shadowParent)&&PD(N.delta,C)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var E=(o.current.shards||[]).map(Zb).filter(Boolean).filter(function(N){return N.contains(w.target)}),D=E.length>0?a(w,E[0]):!o.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),f=R.useCallback(function(b,w,C,T){var E={name:b,delta:w,target:C,should:T,shadowParent:MD(C)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(D){return D!==E})},1)},[]),p=R.useCallback(function(b){t.current=vd(b),r.current=void 0},[]),g=R.useCallback(function(b){f(b.type,Ub(b),b.target,a(b,n.lockRef.current))},[]),x=R.useCallback(function(b){f(b.type,vd(b),b.target,a(b,n.lockRef.current))},[]);R.useEffect(function(){return tc.push(s),n.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",u,ec),document.addEventListener("touchmove",u,ec),document.addEventListener("touchstart",p,ec),function(){tc=tc.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,ec),document.removeEventListener("touchmove",u,ec),document.removeEventListener("touchstart",p,ec)}},[]);var A=n.removeScrollBar,_=n.inert;return R.createElement(R.Fragment,null,_?R.createElement(s,{styles:BD(i)}):null,A?R.createElement(wD,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function MD(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const ND=cD(dS,DD);var yS=R.forwardRef(function(n,e){return R.createElement(Ip,ps({},n,{ref:e,sideCar:ND}))});yS.classNames=Ip.classNames;var LD=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},nc=new WeakMap,Ad=new WeakMap,bd={},ix=0,vS=function(n){return n&&(n.host||vS(n.parentNode))},FD=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=vS(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},ID=function(n,e,t,r){var i=FD(e,Array.isArray(n)?n:[n]);bd[t]||(bd[t]=new WeakMap);var s=bd[t],o=[],a=new Set,u=new Set(i),f=function(g){!g||a.has(g)||(a.add(g),f(g.parentNode))};i.forEach(f);var p=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(x){if(a.has(x))p(x);else try{var A=x.getAttribute(r),_=A!==null&&A!=="false",b=(nc.get(x)||0)+1,w=(s.get(x)||0)+1;nc.set(x,b),s.set(x,w),o.push(x),b===1&&_&&Ad.set(x,!0),w===1&&x.setAttribute(t,"true"),_||x.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",x,C)}})};return p(e),a.clear(),ix++,function(){o.forEach(function(g){var x=nc.get(g)-1,A=s.get(g)-1;nc.set(g,x),s.set(g,A),x||(Ad.has(g)||g.removeAttribute(r),Ad.delete(g)),A||g.removeAttribute(t)}),ix--,ix||(nc=new WeakMap,nc=new WeakMap,Ad=new WeakMap,bd={})}},zD=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=LD(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ID(r,i,t,"aria-hidden")):function(){return null}};function jD(n){const e=QD(n),t=R.forwardRef((r,i)=>{const{children:s,...o}=r,a=R.Children.toArray(s),u=a.find(WD);if(u){const f=u.props.children,p=a.map(g=>g===u?R.Children.count(f)>1?R.Children.only(null):R.isValidElement(f)?f.props.children:null:g);return S.jsx(e,{...o,ref:i,children:R.isValidElement(f)?R.cloneElement(f,void 0,p):null})}return S.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}function QD(n){const e=R.forwardRef((t,r)=>{const{children:i
Line truncated
|
||||
`)},R5=0,tc=[];function D5(n){var e=R.useRef([]),t=R.useRef([0,0]),r=R.useRef(),i=R.useState(R5++)[0],s=R.useState(pS)[0],o=R.useRef(n);R.useEffect(function(){o.current=n},[n]),R.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var b=e5([n.lockRef.current],(n.shards||[]).map(Zb),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=R.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var C=vd(b),T=t.current,E="deltaX"in b?b.deltaX:T[0]-C[0],D="deltaY"in b?b.deltaY:T[1]-C[1],N,F=b.target,z=Math.abs(E)>Math.abs(D)?"h":"v";if("touches"in b&&z==="h"&&F.type==="range")return!1;var I=window.getSelection(),K=I&&I.anchorNode,W=K?K===F||K.contains(F):!1;if(W)return!1;var U=$b(z,F);if(!U)return!0;if(U?N=z:(N=z==="v"?"h":"v",U=$b(z,F)),!U)return!1;if(!r.current&&"changedTouches"in b&&(E||D)&&(r.current=N),!N)return!0;var X=r.current||N;return E5(X,w,b,X==="h"?E:D)},[]),u=R.useCallback(function(b){var w=b;if(!(!tc.length||tc[tc.length-1]!==s)){var C="deltaY"in w?Ub(w):vd(w),T=e.current.filter(function(N){return N.name===w.type&&(N.target===w.target||w.target===N.shadowParent)&&P5(N.delta,C)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var E=(o.current.shards||[]).map(Zb).filter(Boolean).filter(function(N){return N.contains(w.target)}),D=E.length>0?a(w,E[0]):!o.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),f=R.useCallback(function(b,w,C,T){var E={name:b,delta:w,target:C,should:T,shadowParent:M5(C)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(D){return D!==E})},1)},[]),p=R.useCallback(function(b){t.current=vd(b),r.current=void 0},[]),g=R.useCallback(function(b){f(b.type,Ub(b),b.target,a(b,n.lockRef.current))},[]),x=R.useCallback(function(b){f(b.type,vd(b),b.target,a(b,n.lockRef.current))},[]);R.useEffect(function(){return tc.push(s),n.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",u,ec),document.addEventListener("touchmove",u,ec),document.addEventListener("touchstart",p,ec),function(){tc=tc.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,ec),document.removeEventListener("touchmove",u,ec),document.removeEventListener("touchstart",p,ec)}},[]);var A=n.removeScrollBar,_=n.inert;return R.createElement(R.Fragment,null,_?R.createElement(s,{styles:B5(i)}):null,A?R.createElement(w5,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function M5(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const N5=c5(dS,D5);var yS=R.forwardRef(function(n,e){return R.createElement(Ip,ps({},n,{ref:e,sideCar:N5}))});yS.classNames=Ip.classNames;var L5=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},nc=new WeakMap,Ad=new WeakMap,bd={},ix=0,vS=function(n){return n&&(n.host||vS(n.parentNode))},F5=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=vS(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},I5=function(n,e,t,r){var i=F5(e,Array.isArray(n)?n:[n]);bd[t]||(bd[t]=new WeakMap);var s=bd[t],o=[],a=new Set,u=new Set(i),f=function(g){!g||a.has(g)||(a.add(g),f(g.parentNode))};i.forEach(f);var p=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(x){if(a.has(x))p(x);else try{var A=x.getAttribute(r),_=A!==null&&A!=="false",b=(nc.get(x)||0)+1,w=(s.get(x)||0)+1;nc.set(x,b),s.set(x,w),o.push(x),b===1&&_&&Ad.set(x,!0),w===1&&x.setAttribute(t,"true"),_||x.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",x,C)}})};return p(e),a.clear(),ix++,function(){o.forEach(function(g){var x=nc.get(g)-1,A=s.get(g)-1;nc.set(g,x),s.set(g,A),x||(Ad.has(g)||g.removeAttribute(r),Ad.delete(g)),A||g.removeAttribute(t)}),ix--,ix||(nc=new WeakMap,nc=new WeakMap,Ad=new WeakMap,bd={})}},z5=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=L5(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),I5(r,i,t,"aria-hidden")):function(){return null}};function j5(n){const e=Q5(n),t=R.forwardRef((r,i)=>{const{children:s,...o}=r,a=R.Children.toArray(s),u=a.find(W5);if(u){const f=u.props.children,p=a.map(g=>g===u?R.Children.count(f)>1?R.Children.only(null):R.isValidElement(f)?f.props.children:null:g);return S.jsx(e,{...o,ref:i,children:R.isValidElement(f)?R.cloneElement(f,void 0,p):null})}return S.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}function Q5(n){const e=R.forwardRef((t,r)=>{const{children:i
Line truncated
|
||||
|
||||
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return R.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},e5="DialogDescriptionWarning",t5=({contentRef:n,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MS(e5).contentName}}.`;return R.useEffect(()=>{var s;const i=(s=n.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,n,e]),null},NS=bS,LS=OS,jp=kS,Qp=SS,Hp=TS,Wp=PS,FS=RS;const bv=NS,n5=LS,IS=R.forwardRef(({className:n,...e},t)=>S.jsx(jp,{ref:t,className:vt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e}));IS.displayName=jp.displayName;const qp=R.forwardRef(({className:n,children:e,...t},r)=>S.jsxs(n5,{children:[S.jsx(IS,{}),S.jsxs(Qp,{ref:r,className:vt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...t,children:[e,S.jsxs(FS,{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:[S.jsx(Hk,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qp.displayName=Qp.displayName;const Vp=({className:n,...e})=>S.jsx("div",{className:vt("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});Vp.displayName="DialogHeader";const wv=({className:n,...e})=>S.jsx("div",{className:vt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});wv.displayName="DialogFooter";const $p=R.forwardRef(({className:n,...e},t)=>S.jsx(Hp,{ref:t,className:vt("text-lg font-semibold leading-none tracking-tight",n),...e}));$p.displayName=Hp.displayName;const Up=R.forwardRef(({className:n,...e},t)=>S.jsx(Wp,{ref:t,className:vt("text-sm text-muted-foreground",n),...e}));Up.displayName=Wp.displayName;function r5(){const n=window.location.hash.slice(1);if(!n)return null;if(n==="raw")return{type:"raw",name:"raw"};if(n==="map")return{type:"map",name:"map"};if(n==="visualizer")return{type:"visualizer",name:"visualizer"};if(n.startsWith("map/focus/")){const i=n.slice(10);return i?{type:"map",name:"map",mapFocusKey:decodeURIComponent(i)}:{type:"map",name:"map"}}const e=n.indexOf("/");if(e===-1)return null;const t=n.slice(0,e),r=decodeURIComponent(n.slice(e+1));return(t==="channel"||t==="contact")&&r?{type:t,name:r}:null}function zS(n){return`#map/focus/${encodeURIComponent(n)}`}function i5(n){if(!n)return"";if(n.type==="raw")return"#raw";if(n.type==="map")return"#map";if(n.type==="visualizer")return"#visualizer";const e=n.type==="channel"&&n.name.startsWith("#")?n.name.slice(1):n.name;return`#${n.type}/${encodeURIComponent(e)}`}function s5(n){const e=i5(n);e!==window.location.hash&&window.history.replaceState(null,"",e||window.location.pathname)}function o5({open:n,onClose:e,paths:t,senderInfo:r,contacts:i,config:s}){const o=t.map(u=>({...u,resolved:xR(u.path,r,i,s)})),a=t.length===1;return S.jsx(bv,{open:n,onOpenChange:u=>!u&&e(),children:S.jsxs(qp,{className:"max-w-md max-h-[80vh] flex flex-col",children:[S.jsxs(Vp,{children:[S.jsxs($p,{children:["Message Path",!a&&`s (${t.length})`]}),S.jsx(Up,{children:a?S.jsxs(S.Fragment,{children:["This shows ",S.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):S.jsxs(S.Fragment,{children:["This message was received via ",S.jsxs("strong",{children:[t.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[o.map((u,f)=>S.jsxs("div",{children:[!a&&S.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",f+1," — received ",Ac(u.received_at)]}),S.jsx(a5,{resolved:u.resolved,senderInfo:r,hideStraightLine:!a})]},f)),!a&&o.length>0&&(()=>{const u=o[0].resolved;return jt(u.sender.lat,u.sender.lon)&&jt(u.receiver.lat,u.receiver.lon)?S.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[S.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),S.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((Y,ue,pe)=>S.jsxs("span",{children:[u5(Y,a),ue<pe.length-1&&S.jsx("br",{})]},ue)),!ne&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Ac(I.sender_timestamp||I.received_at)}),!I.outgoing&&I.paths&&I.paths.length>0&&S.jsx(Xb,{paths:I.paths,variant:"inline",onClick:()=>b({paths:I.paths,senderInfo:N(I,W,X)})})]}),I.outgoing&&(I.acked>0?` ✓${I.acked>1?I.acked:""}`:" ?")]})]})]},I.id)})]}),x&&S.jsx("button",{onClick:T,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:S.jsx("polyline",{points:"6 9 12 15 18 9"})})}),_&&S.jsx(o5,{open:!0,onClose:()=>b(null),paths:_.paths,senderInfo:_.senderInfo,contacts:e,config:u??null})]})}const Kb=156,f5=140,d5=156,p5=120,m5=8,g5=R.forwardRef(function({onSend:e,disabled:t,placeholder:r,isRepeaterMode:i,conversationType:s,senderName:o},a){const[u,f]=R.useState(""),[p,g]=R.useState(!1),x=R.useRef(null);R.useImperativeHandle(a,()=>({appendText:N=>{var F;f(z=>z+N),(F=x.current)==null||F.focus()}}));const A=R.useMemo(()=>{if(s==="contact")return{warningAt:f5,dangerAt:Kb,hardLimit:Kb};if(s==="channel"){const N=(o==null?void 0:o.length)??10,F=Math.max(1,d5-N-2);return{warningAt:p5,dangerAt:Math.max(1,F-m5),hardLimit:F}}return null},[s,o]),{limitState:_,warningMessage:b}=R.useMemo(()=>{if(!A)return{limitState:"normal",warningMessage:null};const N=u.length;return N>=A.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:N>=A.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:N>=A.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[u.length,A]),w=A?A.hardLimit-u.length:0,C=R.useCallback(async N=>{N.preventDefault();const F=u.trim();if(i){if(p||t)return;g(!0);try{await e(F),f("")}catch(z){console.error("Failed to request telemetry:",z),kt.error("Failed to request telemetry",{description:z instanceof Error?z.message:"Check radio connection"});return}finally{g(!1)}setTimeout(()=>{var z;return(z=x.current)==null?void 0:z.focus()},0)}else{if(!F||p||t)return;g(!0);try{await e(F),f("")}catch(z){console.error("Failed to send message:",z),kt.error("Failed to send message",{description:z instanceof Error?z.message:"Check radio connection"});return}finally{g(!1)}setTimeout(()=>{var z;return(z=x.current)==null?void 0:z.focus()},0)}},[u,p,t,e,i]),T=R.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),C(N))},[C]),E=i?!0:u.trim().length>0,D=!i&&A!==null;return S.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:C,children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsx(xn,{ref:x,type:i?"password":"text",autoComplete:i?"off":void 0,value:u,onChange:N=>f(N.target.value),onKeyDown:T,placeholder:r||(i?"Enter password for admin login...":"Type a message..."),disabled:t||p,className:"flex-1 min-w-0"}),S.jsx(yn,{type:"submit",disabled:t||p||!E,className:"flex-shrink-0",children:p?i?"Logging in...":"Sending...":i?u.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),D&&S.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[S.jsxs("span",{className:vt("tabular-nums",_==="error"||_==="danger"?"text-red-500 font-medium":_==="warning"?"text-yellow-500":"text-muted-foreground"),children:[u.length,"/",A.hardLimit,w<0&&` (${w})`]}),b&&S.jsxs("span",{className:vt(_==="error"?"text-red-500":"text-yellow-500"),children:["— ",b]})]})]})});function Yb(n){const e=x5(n),t=R.forwardRef((r,i)=>{const{children:s,...o}=r,a=R.Children.toArray(s),u=a.find(v5);if(u){const f=u.props.children,p=a.map(g=>g===u?R.Children.count(f)>1?R.Children.only(null):R.isValidElement(f)?f.props.children:null:g);return S.jsx(e,{...o,ref:i,children:R.isValidElement(f)?R.cloneElement(f,void 0,p):null})}return S.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}function x5(n){const e=R.forwardRef((t,r)=>{const{children:i,...s}=t;if(R.isValidElement(i)){const o=b5(i),a=A5(s,i.props);return i.type!==R.Fragment&&(a.ref=r?Nh(r,o):o),R.cloneElement(i,a)}return R.Children.count(i)>1?R.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var y5=Symbol("radix.slottable");function v5(n){return R.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===y5}function A5(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{const u=s(...a);return i(...a),u}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}function
Line truncated
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return R.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},eD="DialogDescriptionWarning",tD=({contentRef:n,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MS(eD).contentName}}.`;return R.useEffect(()=>{var s;const i=(s=n.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,n,e]),null},NS=bS,LS=OS,jp=kS,Qp=SS,Hp=TS,Wp=PS,FS=RS;const bv=NS,nD=LS,IS=R.forwardRef(({className:n,...e},t)=>S.jsx(jp,{ref:t,className:vt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e}));IS.displayName=jp.displayName;const qp=R.forwardRef(({className:n,children:e,...t},r)=>S.jsxs(nD,{children:[S.jsx(IS,{}),S.jsxs(Qp,{ref:r,className:vt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...t,children:[e,S.jsxs(FS,{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:[S.jsx(Hk,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qp.displayName=Qp.displayName;const Vp=({className:n,...e})=>S.jsx("div",{className:vt("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});Vp.displayName="DialogHeader";const wv=({className:n,...e})=>S.jsx("div",{className:vt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});wv.displayName="DialogFooter";const $p=R.forwardRef(({className:n,...e},t)=>S.jsx(Hp,{ref:t,className:vt("text-lg font-semibold leading-none tracking-tight",n),...e}));$p.displayName=Hp.displayName;const Up=R.forwardRef(({className:n,...e},t)=>S.jsx(Wp,{ref:t,className:vt("text-sm text-muted-foreground",n),...e}));Up.displayName=Wp.displayName;function rD(){const n=window.location.hash.slice(1);if(!n)return null;if(n==="raw")return{type:"raw",name:"raw"};if(n==="map")return{type:"map",name:"map"};if(n==="visualizer")return{type:"visualizer",name:"visualizer"};if(n.startsWith("map/focus/")){const i=n.slice(10);return i?{type:"map",name:"map",mapFocusKey:decodeURIComponent(i)}:{type:"map",name:"map"}}const e=n.indexOf("/");if(e===-1)return null;const t=n.slice(0,e),r=decodeURIComponent(n.slice(e+1));return(t==="channel"||t==="contact")&&r?{type:t,name:r}:null}function zS(n){return`#map/focus/${encodeURIComponent(n)}`}function iD(n){if(!n)return"";if(n.type==="raw")return"#raw";if(n.type==="map")return"#map";if(n.type==="visualizer")return"#visualizer";const e=n.type==="channel"&&n.name.startsWith("#")?n.name.slice(1):n.name;return`#${n.type}/${encodeURIComponent(e)}`}function sD(n){const e=iD(n);e!==window.location.hash&&window.history.replaceState(null,"",e||window.location.pathname)}function oD({open:n,onClose:e,paths:t,senderInfo:r,contacts:i,config:s}){const o=t.map(u=>({...u,resolved:xR(u.path,r,i,s)})),a=t.length===1;return S.jsx(bv,{open:n,onOpenChange:u=>!u&&e(),children:S.jsxs(qp,{className:"max-w-md max-h-[80vh] flex flex-col",children:[S.jsxs(Vp,{children:[S.jsxs($p,{children:["Message Path",!a&&`s (${t.length})`]}),S.jsx(Up,{children:a?S.jsxs(S.Fragment,{children:["This shows ",S.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):S.jsxs(S.Fragment,{children:["This message was received via ",S.jsxs("strong",{children:[t.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[o.map((u,f)=>S.jsxs("div",{children:[!a&&S.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",f+1," — received ",Ac(u.received_at)]}),S.jsx(aD,{resolved:u.resolved,senderInfo:r,hideStraightLine:!a})]},f)),!a&&o.length>0&&(()=>{const u=o[0].resolved;return jt(u.sender.lat,u.sender.lon)&&jt(u.receiver.lat,u.receiver.lon)?S.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[S.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),S.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((Y,ue,pe)=>S.jsxs("span",{children:[uD(Y,a),ue<pe.length-1&&S.jsx("br",{})]},ue)),!ne&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Ac(I.sender_timestamp||I.received_at)}),!I.outgoing&&I.paths&&I.paths.length>0&&S.jsx(Xb,{paths:I.paths,variant:"inline",onClick:()=>b({paths:I.paths,senderInfo:N(I,W,X)})})]}),I.outgoing&&(I.acked>0?` ✓${I.acked>1?I.acked:""}`:" ?")]})]})]},I.id)})]}),x&&S.jsx("button",{onClick:T,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:S.jsx("polyline",{points:"6 9 12 15 18 9"})})}),_&&S.jsx(oD,{open:!0,onClose:()=>b(null),paths:_.paths,senderInfo:_.senderInfo,contacts:e,config:u??null})]})}const Kb=156,fD=140,dD=156,pD=120,mD=8,gD=R.forwardRef(function({onSend:e,disabled:t,placeholder:r,isRepeaterMode:i,conversationType:s,senderName:o},a){const[u,f]=R.useState(""),[p,g]=R.useState(!1),x=R.useRef(null);R.useImperativeHandle(a,()=>({appendText:N=>{var F;f(z=>z+N),(F=x.current)==null||F.focus()}}));const A=R.useMemo(()=>{if(s==="contact")return{warningAt:fD,dangerAt:Kb,hardLimit:Kb};if(s==="channel"){const N=(o==null?void 0:o.length)??10,F=Math.max(1,dD-N-2);return{warningAt:pD,dangerAt:Math.max(1,F-mD),hardLimit:F}}return null},[s,o]),{limitState:_,warningMessage:b}=R.useMemo(()=>{if(!A)return{limitState:"normal",warningMessage:null};const N=u.length;return N>=A.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:N>=A.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:N>=A.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[u.length,A]),w=A?A.hardLimit-u.length:0,C=R.useCallback(async N=>{N.preventDefault();const F=u.trim();if(i){if(p||t)return;g(!0);try{await e(F),f("")}catch(z){console.error("Failed to request telemetry:",z),kt.error("Failed to request telemetry",{description:z instanceof Error?z.message:"Check radio connection"});return}finally{g(!1)}setTimeout(()=>{var z;return(z=x.current)==null?void 0:z.focus()},0)}else{if(!F||p||t)return;g(!0);try{await e(F),f("")}catch(z){console.error("Failed to send message:",z),kt.error("Failed to send message",{description:z instanceof Error?z.message:"Check radio connection"});return}finally{g(!1)}setTimeout(()=>{var z;return(z=x.current)==null?void 0:z.focus()},0)}},[u,p,t,e,i]),T=R.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),C(N))},[C]),E=i?!0:u.trim().length>0,D=!i&&A!==null;return S.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:C,children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsx(xn,{ref:x,type:i?"password":"text",autoComplete:i?"off":void 0,value:u,onChange:N=>f(N.target.value),onKeyDown:T,placeholder:r||(i?"Enter password for admin login...":"Type a message..."),disabled:t||p,className:"flex-1 min-w-0"}),S.jsx(yn,{type:"submit",disabled:t||p||!E,className:"flex-shrink-0",children:p?i?"Logging in...":"Sending...":i?u.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),D&&S.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[S.jsxs("span",{className:vt("tabular-nums",_==="error"||_==="danger"?"text-red-500 font-medium":_==="warning"?"text-yellow-500":"text-muted-foreground"),children:[u.length,"/",A.hardLimit,w<0&&` (${w})`]}),b&&S.jsxs("span",{className:vt(_==="error"?"text-red-500":"text-yellow-500"),children:["— ",b]})]})]})});function Yb(n){const e=xD(n),t=R.forwardRef((r,i)=>{const{children:s,...o}=r,a=R.Children.toArray(s),u=a.find(vD);if(u){const f=u.props.children,p=a.map(g=>g===u?R.Children.count(f)>1?R.Children.only(null):R.isValidElement(f)?f.props.children:null:g);return S.jsx(e,{...o,ref:i,children:R.isValidElement(f)?R.cloneElement(f,void 0,p):null})}return S.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}function xD(n){const e=R.forwardRef((t,r)=>{const{children:i,...s}=t;if(R.isValidElement(i)){const o=bD(i),a=AD(s,i.props);return i.type!==R.Fragment&&(a.ref=r?Nh(r,o):o),R.cloneElement(i,a)}return R.Children.count(i)>1?R.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var yD=Symbol("radix.slottable");function vD(n){return R.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===yD}function AD(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{const u=s(...a);return i(...a),u}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}function
Line truncated
|
||||
`){[e,t]=_c(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],u=s+a.length;s>e&&o&&(i+=r),e<u&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=u+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new bn(r,i)),r=[],i=-1);return i>-1&&t.push(new bn(r,i)),t}}class ms extends Lt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,u=r+o.lines-1;if((t?u:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=u+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],u=o+a.length;if(e<=u&&t>=o){let f=i&((o<=e?1:0)|(u>=t?2:0));o>=e&&u<=t&&!f?r.push(a):a.decompose(e-o,t-o,r,f)}o=u+1}}replace(e,t,r){if([e,t]=_c(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let u=o.replace(e-s,t-s,r),f=this.lines-o.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let p=this.children.slice();return p[i]=u,new ms(p,this.length-(t-e)+r.length)}return super.replace(s,a,u)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
||||
`){[e,t]=_c(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],u=o+a.length;o>e&&s&&(i+=r),e<u&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=u+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ms))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let u=this.children[i],f=e.children[s];if(u!=f)return r+u.scanIdentical(f,t);r+=u.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let A of e)r+=A.lines;if(r<32){let A=[];for(let _ of e)_.flatten(A);return new bn(A,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],u=0,f=-1,p=[];function g(A){let _;if(A.lines>s&&A instanceof ms)for(let b of A.children)g(b);else A.lines>o&&(u>o||!u)?(x(),a.push(A)):A instanceof bn&&u&&(_=p[p.length-1])instanceof bn&&A.lines+_.lines<=32?(u+=A.lines,f+=A.length+1,p[p.length-1]=new bn(_.text.concat(A.text),_.length+1+A.length)):(u+A.lines>i&&x(),u+=A.lines,f+=A.length+1,p.push(A))}function x(){u!=0&&(a.push(p.length==1?p[0]:ms.from(p,f)),f=-1,u=p.length=0)}for(let A of e)g(A);return x(),a.length==1?a[0]:new ms(a,t)}}Lt.empty=new bn([""],0);function e3(n){let e=-1;for(let t of n)e+=t.length+1;return e}function e0(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],u=i+a.length;u>=t&&(u>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=u+1}return e}function nw(n,e,t){return e0(n,[""],e,t)}class sh{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 bn?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof bn?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(i instanceof bn){let u=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof bn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class v2{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new sh(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}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 r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),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 A2{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Lt.prototype[Symbol.iterator]=function(){return this.iter()},sh.prototype[Symbol.iterator]=v2.prototype[Symbol.iterator]=A2.prototype[Symbol.iterator]=function(){return this});class t3{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function _c(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Fn(n,e,t=!0,r=!0){return Y5(n,e,t,r)}function n3(n){return n>=56320&&n<57344}function r3(n){return n>=55296&&n<56320}function Mr(n,e){let t=n.charCodeAt(e);if(!r3(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return n3(r)?(t-55296<<10)+(r-56320)+65536:t}function Cv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function gs(n){return n<65536?1:2}const oy=/\r\n?|\n/;var er=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(er||(er={}));class bs{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 r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){ay(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new bs(e)}composeDesc(e){return this.empty?e:e.empty?this:b2(this,e)}mapDesc(e,t=!1){return e.empty?this:ly(this,e,t)}mapPos(e,t=-1,r=er.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],u=this.sections[o++],f=i+a;if(u<0){if(f>e)return s+(e-i);s+=a}else{if(r!=er.Simple&&f>=e&&(r==er.TrackDel&&i<e&&f>e||r==er.TrackBefore&&i<e||r==er.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!a)return e==i||t<0?s:s+u;s+=u}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}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 bs(e)}static create(e){return new bs(e)}}class Ln extends bs{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 ay(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return ly(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let u=i>>1;for(;r.length<u;)r.push(Lt.empty);r.push(o?e.slice(s,s+o):Lt.empty)}s+=o}return new Ln(t,r)}compose(e){return this.empty?e:e.empty?this:b2(this,e,!0)}map(e,t=!1){return e.empty?this:ly(this,e,t,!0)}iterChanges(e,t=!1){ay(this,e,t)}get desc(){return bs
Line truncated
|
||||
`}get readOnly(){return this.facet(E2)}phrase(e,...t){for(let r of this.facet(Rt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(O2))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return p3(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let u=Fn(t,o,!1);if(s(t.slice(u,o))!=ln.Word)break;o=u}for(;a<i;){let u=Fn(t,a);if(s(t.slice(a,u))!=ln.Word)break;a=u}return o==a?null:we.range(o+r,a+r)}}Rt.allowMultipleSelections=hy;Rt.tabSize=je.define({combine:n=>n.length?n[0]:4});Rt.lineSeparator=k2;Rt.readOnly=E2;Rt.phrases=je.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Rt.languageData=O2;Rt.changeFilter=S2;Rt.transactionFilter=C2;Rt.transactionExtender=T2;Kp.reconfigure=ft.define();function Os(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class na{eq(e){return this==e}range(e,t=e){return py.create(e,t,this)}}na.prototype.startSide=na.prototype.endSide=0;na.prototype.point=!1;na.prototype.mapMode=er.TrackDel;function Pv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let py=class R2{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new R2(e,t,r)}};function my(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Bv{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let u=o+a>>1,f=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==o)return f>=0?o:a;f>=0?a=u:o=u+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let u=0;u<this.value.length;u++){let f=this.value[u],p=this.from[u]+e,g=this.to[u]+e,x,A;if(p==g){let _=t.mapPos(p,f.startSide,f.mapMode);if(_==null||(x=A=_,f.startSide!=f.endSide&&(A=t.mapPos(p,f.endSide),A<x)))continue}else if(x=t.mapPos(p,f.startSide),A=t.mapPos(g,f.endSide),x>A||x==A&&f.startSide>0&&f.endSide<=0)continue;(A-x||f.endSide-f.startSide)<0||(o<0&&(o=x),f.point&&(a=Math.max(a,A-x)),r.push(f),i.push(x-o),s.push(A-o))}return{mapped:r.length?new Bv(i,s,r,a):null,pos:o}}}class Tt{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new Tt(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(my)),this.isEmpty)return t.length?Tt.of(t):this;let a=new D2(this,null,-1).goto(0),u=0,f=[],p=new so;for(;a.value||u<t.length;)if(u<t.length&&(a.from-t[u].from||a.startSide-t[u].value.startSide)>=0){let g=t[u++];p.addInner(g.from,g.to,g.value)||f.push(g)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(a.chunkIndex)<t[u].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&p.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(p.addInner(a.from,a.to,a.value)||f.push(py.create(a.from,a.to,a.value))),a.next());return p.finishInner(this.nextLayer.isEmpty&&!f.length?Tt.empty:this.nextLayer.update({add:f,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],u=this.chunk[o],f=e.touchesRange(a,a+u.length);if(f===!1)i=Math.max(i,u.maxPoint),t.push(u),r.push(e.mapPos(a));else if(f===!0){let{mapped:p,pos:g}=u.map(a,e);p&&(i=Math.max(i,p.maxPoint),t.push(p),r.push(g))}}let s=this.nextLayer.map(e);return t.length==0?s:new Tt(r,t,s||Tt.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return ph.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ph.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(g=>g.maxPoint>0||!g.isEmpty
Line truncated
|
||||
`,this;e--}else if(i instanceof bn){let u=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof bn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class v2{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new sh(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}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 r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),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 A2{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Lt.prototype[Symbol.iterator]=function(){return this.iter()},sh.prototype[Symbol.iterator]=v2.prototype[Symbol.iterator]=A2.prototype[Symbol.iterator]=function(){return this});class t3{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function _c(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Fn(n,e,t=!0,r=!0){return YD(n,e,t,r)}function n3(n){return n>=56320&&n<57344}function r3(n){return n>=55296&&n<56320}function Mr(n,e){let t=n.charCodeAt(e);if(!r3(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return n3(r)?(t-55296<<10)+(r-56320)+65536:t}function Cv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function gs(n){return n<65536?1:2}const oy=/\r\n?|\n/;var er=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(er||(er={}));class bs{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 r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){ay(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new bs(e)}composeDesc(e){return this.empty?e:e.empty?this:b2(this,e)}mapDesc(e,t=!1){return e.empty?this:ly(this,e,t)}mapPos(e,t=-1,r=er.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],u=this.sections[o++],f=i+a;if(u<0){if(f>e)return s+(e-i);s+=a}else{if(r!=er.Simple&&f>=e&&(r==er.TrackDel&&i<e&&f>e||r==er.TrackBefore&&i<e||r==er.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!a)return e==i||t<0?s:s+u;s+=u}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}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 bs(e)}static create(e){return new bs(e)}}class Ln extends bs{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 ay(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return ly(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let u=i>>1;for(;r.length<u;)r.push(Lt.empty);r.push(o?e.slice(s,s+o):Lt.empty)}s+=o}return new Ln(t,r)}compose(e){return this.empty?e:e.empty?this:b2(this,e,!0)}map(e,t=!1){return e.empty?this:ly(this,e,t,!0)}iterChanges(e,t=!1){ay(this,e,t)}get desc(){return bs
Line truncated
|
||||
`}get readOnly(){return this.facet(E2)}phrase(e,...t){for(let r of this.facet(Rt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(O2))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return p3(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let u=Fn(t,o,!1);if(s(t.slice(u,o))!=ln.Word)break;o=u}for(;a<i;){let u=Fn(t,a);if(s(t.slice(a,u))!=ln.Word)break;a=u}return o==a?null:we.range(o+r,a+r)}}Rt.allowMultipleSelections=hy;Rt.tabSize=je.define({combine:n=>n.length?n[0]:4});Rt.lineSeparator=k2;Rt.readOnly=E2;Rt.phrases=je.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Rt.languageData=O2;Rt.changeFilter=S2;Rt.transactionFilter=C2;Rt.transactionExtender=T2;Kp.reconfigure=ft.define();function Os(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class na{eq(e){return this==e}range(e,t=e){return py.create(e,t,this)}}na.prototype.startSide=na.prototype.endSide=0;na.prototype.point=!1;na.prototype.mapMode=er.TrackDel;function Pv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let py=class R2{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new R2(e,t,r)}};function my(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Bv{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let u=o+a>>1,f=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==o)return f>=0?o:a;f>=0?a=u:o=u+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let u=0;u<this.value.length;u++){let f=this.value[u],p=this.from[u]+e,g=this.to[u]+e,x,A;if(p==g){let _=t.mapPos(p,f.startSide,f.mapMode);if(_==null||(x=A=_,f.startSide!=f.endSide&&(A=t.mapPos(p,f.endSide),A<x)))continue}else if(x=t.mapPos(p,f.startSide),A=t.mapPos(g,f.endSide),x>A||x==A&&f.startSide>0&&f.endSide<=0)continue;(A-x||f.endSide-f.startSide)<0||(o<0&&(o=x),f.point&&(a=Math.max(a,A-x)),r.push(f),i.push(x-o),s.push(A-o))}return{mapped:r.length?new Bv(i,s,r,a):null,pos:o}}}class Tt{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new Tt(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(my)),this.isEmpty)return t.length?Tt.of(t):this;let a=new D2(this,null,-1).goto(0),u=0,f=[],p=new oo;for(;a.value||u<t.length;)if(u<t.length&&(a.from-t[u].from||a.startSide-t[u].value.startSide)>=0){let g=t[u++];p.addInner(g.from,g.to,g.value)||f.push(g)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(a.chunkIndex)<t[u].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&p.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(p.addInner(a.from,a.to,a.value)||f.push(py.create(a.from,a.to,a.value))),a.next());return p.finishInner(this.nextLayer.isEmpty&&!f.length?Tt.empty:this.nextLayer.update({add:f,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],u=this.chunk[o],f=e.touchesRange(a,a+u.length);if(f===!1)i=Math.max(i,u.maxPoint),t.push(u),r.push(e.mapPos(a));else if(f===!0){let{mapped:p,pos:g}=u.map(a,e);p&&(i=Math.max(i,p.maxPoint),t.push(p),r.push(g))}}let s=this.nextLayer.map(e);return t.length==0?s:new Tt(r,t,s||Tt.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return ph.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ph.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(g=>g.maxPoint>0||!g.isEmpty
Line truncated
|
||||
`)}static newName(){let e=lw[aw]||1;return lw[aw]=e+1,yy+e.toString(36)}static mount(e,t,r){let i=e[vy],s=r&&r.nonce;i?s&&i.setNonce(s):i=new g3(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let cw=new Map;class g3{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=cw.get(r);if(s)return e[vy]=s;this.sheet=new i.CSSStyleSheet,cw.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[vy]=this}mount(e,t){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],u=this.modules.indexOf(a);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,a),r)for(let f=0;f<a.rules.length;f++)r.insertRule(a.rules[f],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let u=0;u<this.modules.length;u++)o+=this.modules[u].getRules()+`
|
||||
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ia={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},x3=typeof navigator<"u"&&/Mac/.test(navigator.platform),y3=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Jn=0;Jn<10;Jn++)ia[48+Jn]=ia[96+Jn]=String(Jn);for(var Jn=1;Jn<=24;Jn++)ia[Jn+111]="F"+Jn;for(var Jn=65;Jn<=90;Jn++)ia[Jn]=String.fromCharCode(Jn+32),mh[Jn]=String.fromCharCode(Jn);for(var lx in ia)mh.hasOwnProperty(lx)||(mh[lx]=ia[lx]);function v3(n){var e=x3&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||y3&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?mh:ia)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Vt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)M2(n,arguments[e]);return n}function M2(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)M2(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Ar=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ay=typeof document<"u"?document:{documentElement:{style:{}}};const by=/Edge\/(\d+)/.exec(Ar.userAgent),N2=/MSIE \d/.test(Ar.userAgent),wy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ar.userAgent),Yp=!!(N2||wy||by),uw=!Yp&&/gecko\/(\d+)/i.test(Ar.userAgent),cx=!Yp&&/Chrome\/(\d+)/.exec(Ar.userAgent),A3="webkitFontSmoothing"in Ay.documentElement.style,_y=!Yp&&/Apple Computer/.test(Ar.vendor),hw=_y&&(/Mobile\/\w+/.test(Ar.userAgent)||Ar.maxTouchPoints>2);var He={mac:hw||/Mac/.test(Ar.platform),windows:/Win/.test(Ar.platform),linux:/Linux|X11/.test(Ar.platform),ie:Yp,ie_version:N2?Ay.documentMode||6:wy?+wy[1]:by?+by[1]:0,gecko:uw,gecko_version:uw?+(/Firefox\/(\d+)/.exec(Ar.userAgent)||[0,0])[1]:0,chrome:!!cx,chrome_version:cx?+cx[1]:0,ios:hw,android:/Android\b/.test(Ar.userAgent),webkit_version:A3?+(/\bAppleWebKit\/(\d+)/.exec(Ar.userAgent)||[0,0])[1]:0,safari:_y,safari_version:_y?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ar.userAgent)||[0,0])[1]:0,tabSize:Ay.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Rv(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const ip=Object.create(null);function Dv(n,e,t){if(n==e)return!0;n||(n=ip),e||(e=ip);let r=Object.keys(n),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function b3(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function fw(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function w3(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class $i{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var tr=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(tr||(tr={}));class Je extends na{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Ih(e)}Line truncated
|
||||
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),f=n.visualLineSide(i,!t)}if(u){if(!u(p))return a}else{if(!r)return f;u=r(p)}a=f}}function u8(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==ln.Space&&(i=o),i==o}}function h8(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return we.cursor(i,e.assoc);let o=e.goalColumn,a,u=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(i,e.assoc||-1),p=n.documentTop;if(f)o==null&&(o=f.left-u.left),a=s<0?f.top:f.bottom;else{let _=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(u.right-u.left,n.defaultCharacterWidth*(i-_.from))),a=(s<0?_.top:_.bottom)+p}let g=u.left+o,x=r??n.viewState.heightOracle.textHeight>>1,A=By(n,{x:g,y:a+x*s},!1,s);return we.cursor(A.pos,A.assoc,void 0,o)}function uh(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let u=r||t||(e-s<o-e?-1:1);e=u<0?s:o,r=u}});if(!r)return e}}function cC(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=uh(n,i.from,0);o!=i.from&&(s=we.cursor(o,-1))}else{let o=uh(n,i.from,-1),a=uh(n,i.to,1);(o!=i.from||a!=i.to)&&(s=we.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?we.create(t,e.mainIndex):e}function px(n,e,t){let r=uh(n.state.facet(jh).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:we.cursor(r,r<t.from?1:-1)}class xs{constructor(e,t){this.pos=e,this.assoc=t}}function By(n,e,t,r){let i=n.contentDOM.getBoundingClientRect(),s=i.top+n.viewState.paddingTop,{x:o,y:a}=e,u=a-s,f;for(;;){if(u<0)return new xs(0,1);if(u>n.viewState.docHeight)return new xs(n.state.doc.length,-1);if(f=n.elementAtHeight(u),r==null)break;if(f.type==tr.Text){let x=n.docView.coordsAt(r<0?f.from:f.to,r);if(x&&(r<0?x.top<=u+s:x.bottom>=u+s))break}let g=n.viewState.heightOracle.textHeight/2;u=r>0?f.bottom+g:f.top-g}if(n.viewport.from>=f.to||n.viewport.to<=f.from){if(t)return null;if(f.type==tr.Text){let g=l8(n,i,f,o,a);return new xs(g,g==f.from?1:-1)}}if(f.type!=tr.Text)return u<(f.top+f.bottom)/2?new xs(f.from,1):new xs(f.to,-1);let p=n.docView.lineAt(f.from,2);return(!p||p.length!=f.length)&&(p=n.docView.lineAt(f.from,-2)),uC(n,p,f.from,o,a)}function uC(n,e,t,r,i){let s=-1,o=null,a=1e9,u=1e9,f=i,p=i,g=(x,A)=>{for(let _=0;_<x.length;_++){let b=x[_];if(b.top==b.bottom)continue;let w=b.left>r?b.left-r:b.right<r?r-b.right:0,C=b.top>i?b.top-i:b.bottom<i?i-b.bottom:0;b.top<=p&&b.bottom>=f&&(f=Math.min(b.top,f),p=Math.max(b.bottom,p),C=0),(s<0||(C-u||w-a)<0)&&(s>=0&&u&&a<w&&o.top<=p-2&&o.bottom>=f+2?u=0:(s=A,a=w,u=C,o=b))}};if(e.isText()){for(let A=0;A<e.length;){let _=Fn(e.text,A);if(g(yh(e.dom,A,_).getClientRects(),A),!a&&!u)break;A=_}return r>(o.left+o.right)/2==(Aw(n,s+t)==Zt.LTR)?new xs(t+Fn(e.text,s),-1):new xs(t+s,1)}else{if(!e.length)return new xs(t,1);for(let b=0;b<e.children.length;b++){let w=e.children[b];if(w.flags&48)continue;let C=(w.dom.nodeType==1?w.dom:yh(w.dom,0,w.length)).getClientRects();if(g(C,b),!a&&!u)break}let x=e.children[s],A=e.posBefore(x,t);return x.isComposite()||x.isText()?uC(n,x,A,Math.max(o.left,Math.min(o.right,r)),i):r>(o.left+o.right)/2==(Aw(n,s+t)==Zt.LTR)?new xs(A+x.length,-1):new xs(A,1)}}function Aw(n,e){let t=n.state.doc.lineAt(e);return n.bidiSpans(t)[io.find(n.bidiSpans(t),e-t.from,-1,1)].dir}const Ku="";class f8{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Rt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ku}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=Tn.get(i),a=i.nextSibling;if(a==t){o!=null&&o.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Tn.get(a);(o&&u?o.breakAfter:(o?o.breakAfter:sp(i))||sp(a)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!p8(a,t)&&this.lineBreak(),i=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);r=s+o}}readNode(e){let t=Tn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(d8(e,r.node,r.offset)?t:0))}}fun
Line truncated
|
||||
`&&n.lineWrapping&&(r&&(r=we.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Lt.of([" "])}),t)return jv(n,t,r,s);if(r&&!cp(r,i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=cC(n.state.facet(jh).map(u=>u(n)),r))),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function jv(n,e,t,r=-1){if(He.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(He.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&dc(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&dc(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&dc(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=g8(n,e,t));return n.state.facet(K2).some(u=>u(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function g8(n,e,t){let r,i=n.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,f=u<0?s.from:s.to,p=uh(i.facet(jh).map(g=>g(n)),f,u);e.from==p&&(o=p)}if(o>-1)r={changes:e,selection:we.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",f=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(u+e.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let u=i.changes(e),f=t&&t.main.to<=u.newLength?t.main:void 0;if(i.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let p=n.state.sliceDoc(e.from,e.to),g,x=t&&lC(n,t.main.head);if(x){let _=e.insert.length-(e.to-e.from);g={from:x.from,to:x.to-_}}else g=n.state.doc.lineAt(s.head);let A=s.to-e.to;r=i.changeByRange(_=>{if(_.from==s.from&&_.to==s.to)return{changes:u,range:f||_.map(u)};let b=_.to-A,w=b-p.length;if(n.state.sliceDoc(w,b)!=p||b>=g.from&&w<=g.to)return{range:_};let C=i.changes({from:w,to:b,insert:e.insert}),T=_.to-s.to;return{changes:C,range:f?we.range(Math.max(0,f.anchor+T),Math.max(0,f.head+T)):_.map(C)}})}else r={changes:u,selection:f&&i.selection.replaceRange(f)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function dC(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let u=Math.max(0,s-Math.min(o,a));t-=o+u-s}if(o<s&&n.length<e.length){let u=t<=s&&t>=o?s-t:0;s-=u,a=s+(a-o),o=s}else if(a<s){let u=t<=s&&t>=a?s-t:0;s-=u,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function x8(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new bw(t,r)),(i!=t||s!=r)&&e.push(new bw(i,s))),e}function y8(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?we.single(t+e,r+e):null}function cp(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class v8{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,He.safari&&e.contentDOM.addEventListener("input",()=>null),He.gecko&&M8(e.contentDOM.ownerDocument)}handleEvent(e){!C8(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=A8(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].
Line truncated
|
||||
`))};if((He.mac||He.android)&&g.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(g={from:a,to:u,insert:Lt.of([r.text.replace("."," ")])}),this.pendingContextChange=g,!e.state.readOnly){let x=this.to-this.from+(g.to-g.from+g.insert.length);jv(e,g,we.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),g.from<g.to&&!g.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let u=this.toEditorPos(s.rangeStart),f=this.toEditorPos(s.rangeEnd);if(u<f){let p=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(Je.mark({attributes:{style:p}}).range(u,f))}}}e.dispatch({effects:nC.of(Je.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Oc(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,u,f)=>{if(r)return;let p=f.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(f)){i=this.pendingContextChange=null,t+=p,this.to+=p;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=p,this.to+=p;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),f.toString()),this.to+=p}t+=p}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ne{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measu
Line truncated
|
||||
--\u2028\u2029\uFEFF-]`,Fy),yM={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let xx=null;function vM(){var n;if(xx==null&&typeof document<"u"&&document.body){let e=document.body.style;xx=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return xx||!1}const i0=je.define({combine(n){let e=Os(n,{render:null,specialChars:xM,addSpecialChars:null});return(e.replaceTabs=!vM())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Fy)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Fy)),e}});function AM(n={}){return[i0.of(n),bM()]}let Ww=null;function bM(){return Ww||(Ww=_n.fromClass(class{constructor(n){this.view=n,this.decorations=Je.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(i0)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new gM({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=Mr(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,u=Lc(o.text,a,r-o.from);return Je.replace({widget:new kM((a-u%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Je.replace({widget:new OM(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(i0);n.startState.facet(i0)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const wM="•";function _M(n){return n>=32?wM:n==10?"":String.fromCharCode(9216+n)}class OM extends $i{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=_M(this.code),r=e.state.phrase("Control character")+" "+(yM[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class kM extends $i{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function SM(){return TM}const CM=Je.line({class:"cm-activeLine"}),TM=_n.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(CM.range(i.from)),e=i.from)}return Je.set(t)}},{decorations:n=>n.decorations});class EM extends $i{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?lh(e.firstChild):[];if(!t.length)return null;let r=window.getComputedStyle(e.parentNode),i=xh(t[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function PM(n){let e=_n.fromClass(class{constructor(t){this.view=t,this.placeholder=n?Je.set([Je.widget({widget:new EM(n),side:1}).range(0)]):Je.none}get decorations(){return this.view.state.doc.length?Je.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,Ne.contentAttributes.of({"aria-placeholder":n})]:e}const Iy=2e3;function BM(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>Iy||t.off>Iy||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let u=r;u<=i;u++){let f=n.doc.line(u);f.length<=a&&s.push(we.range(f.from+o,f.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let u=r;u<=i;u++){let f=n.doc.line(u),p=xy(f.text,o,n.tabSize,!0);if(p<0)s.push(we.cursor(f.to));else{let g=xy(f.text,a,n.tabSize);s.push(we.range(f.from+p,f.from+g))}}}return s}function RM(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function qw(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>Iy?-1:i==r.length?RM(n,e.clientX):Lc(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function DM(n,e){let t
Line truncated
|
||||
`:r=="r"?"\r":r=="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 $L(this):new WL(this)}getCursor(e,t=0,r){let i=e.doc?e:Rt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?ic(this,i,t,r):rc(this,i,t,r)}}class UT{constructor(e){this.spec=e}}function QL(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(a,e,r,i)}}function rc(n,e,t,r){let i;return n.wholeWord&&(i=HL(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=QL(n.test,e,i)),new Ec(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function HL(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(bp(i,t-s))!=ln.Word||e(wp(i,t-s))!=ln.Word)&&(e(wp(i,r-s))!=ln.Word||e(bp(i,r-s))!=ln.Word))}class WL extends UT{constructor(e){super(e)}nextMatch(e,t,r){let i=rc(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=rc(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=rc(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=rc(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=rc(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function qL(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function ic(n,e,t,r){let i;return n.wholeWord&&(i=VL(e.charCategorizer(e.selection.main.head))),n.test&&(i=qL(n.test,e,i)),new qT(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function bp(n,e){return n.slice(Fn(n,e,!1),e)}function wp(n,e){return n.slice(e,Fn(n,e))}function VL(n){return(e,t,r)=>!r[0].length||(n(bp(r.input,r.index))!=ln.Word||n(wp(r.input,r.index))!=ln.Word)&&(n(wp(r.input,r.index+r[0].length))!=ln.Word||n(bp(r.input,r.index+r[0].length))!=ln.Word)}class $L extends UT{nextMatch(e,t,r){let i=ic(this.spec,e,r,e.doc.length).next();return i.done&&(i=ic(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=ic(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=ic(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ic(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Oh=ft.define(),nA=ft.define(),ea=$n.define({create(n){return new Rx(Xy(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Oh)?n=new Rx(t.value.create(),n.panel):t.is(nA)&&(n=new Rx(n.query,t.value?rA:null));return n},provide:n=>Ah.from(n,e=>e.panel)});class Rx{constructor(e,t){this.query=e,this.panel=t}}const UL=Je.mark({class:"cm-searchMatch"}),ZL=Je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),GL=_n.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ea))}update(n){let e=n.state.field(ea);(e!=n.startState.field(ea)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Je.none;let{view:t}=this,r=new so;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:u}=s[i];for(;i<o-1&&u>s[i+1].from-500;)u=s[++i].to;n.highlight(t.state,a,u,(f,p)=>{let g=t.state.selection.ranges.some(x=>x.from==f&&x.to==p);r.add(f,p,g?ZL:UL)})}return r.finish()}},{decorations:n=>n.decorations});function Uh(n){return e=>{let t=e.state.field(ea,!1);return t&&t.query.spec.valid?n(e,t):XT(e)}}const _p=Uh((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=we.single(r.from,r.to),s=n.state.facet(Ic);return n.dispatch({selection:i,effects:[iA(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),GT(n),!0}),Op=Uh((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i
Line truncated
|
||||
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ia={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},x3=typeof navigator<"u"&&/Mac/.test(navigator.platform),y3=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Jn=0;Jn<10;Jn++)ia[48+Jn]=ia[96+Jn]=String(Jn);for(var Jn=1;Jn<=24;Jn++)ia[Jn+111]="F"+Jn;for(var Jn=65;Jn<=90;Jn++)ia[Jn]=String.fromCharCode(Jn+32),mh[Jn]=String.fromCharCode(Jn);for(var lx in ia)mh.hasOwnProperty(lx)||(mh[lx]=ia[lx]);function v3(n){var e=x3&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||y3&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?mh:ia)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function $t(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)M2(n,arguments[e]);return n}function M2(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)M2(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Ar=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ay=typeof document<"u"?document:{documentElement:{style:{}}};const by=/Edge\/(\d+)/.exec(Ar.userAgent),N2=/MSIE \d/.test(Ar.userAgent),wy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ar.userAgent),Yp=!!(N2||wy||by),uw=!Yp&&/gecko\/(\d+)/i.test(Ar.userAgent),cx=!Yp&&/Chrome\/(\d+)/.exec(Ar.userAgent),A3="webkitFontSmoothing"in Ay.documentElement.style,_y=!Yp&&/Apple Computer/.test(Ar.vendor),hw=_y&&(/Mobile\/\w+/.test(Ar.userAgent)||Ar.maxTouchPoints>2);var He={mac:hw||/Mac/.test(Ar.platform),windows:/Win/.test(Ar.platform),linux:/Linux|X11/.test(Ar.platform),ie:Yp,ie_version:N2?Ay.documentMode||6:wy?+wy[1]:by?+by[1]:0,gecko:uw,gecko_version:uw?+(/Firefox\/(\d+)/.exec(Ar.userAgent)||[0,0])[1]:0,chrome:!!cx,chrome_version:cx?+cx[1]:0,ios:hw,android:/Android\b/.test(Ar.userAgent),webkit_version:A3?+(/\bAppleWebKit\/(\d+)/.exec(Ar.userAgent)||[0,0])[1]:0,safari:_y,safari_version:_y?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ar.userAgent)||[0,0])[1]:0,tabSize:Ay.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Rv(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const ip=Object.create(null);function Dv(n,e,t){if(n==e)return!0;n||(n=ip),e||(e=ip);let r=Object.keys(n),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function b3(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function fw(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function w3(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class $i{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var tr=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(tr||(tr={}));class Je extends na{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Ih(e)}Line truncated
|
||||
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),f=n.visualLineSide(i,!t)}if(u){if(!u(p))return a}else{if(!r)return f;u=r(p)}a=f}}function u8(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==ln.Space&&(i=o),i==o}}function h8(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return we.cursor(i,e.assoc);let o=e.goalColumn,a,u=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(i,e.assoc||-1),p=n.documentTop;if(f)o==null&&(o=f.left-u.left),a=s<0?f.top:f.bottom;else{let _=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(u.right-u.left,n.defaultCharacterWidth*(i-_.from))),a=(s<0?_.top:_.bottom)+p}let g=u.left+o,x=r??n.viewState.heightOracle.textHeight>>1,A=By(n,{x:g,y:a+x*s},!1,s);return we.cursor(A.pos,A.assoc,void 0,o)}function uh(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let u=r||t||(e-s<o-e?-1:1);e=u<0?s:o,r=u}});if(!r)return e}}function cC(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=uh(n,i.from,0);o!=i.from&&(s=we.cursor(o,-1))}else{let o=uh(n,i.from,-1),a=uh(n,i.to,1);(o!=i.from||a!=i.to)&&(s=we.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?we.create(t,e.mainIndex):e}function px(n,e,t){let r=uh(n.state.facet(jh).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:we.cursor(r,r<t.from?1:-1)}class xs{constructor(e,t){this.pos=e,this.assoc=t}}function By(n,e,t,r){let i=n.contentDOM.getBoundingClientRect(),s=i.top+n.viewState.paddingTop,{x:o,y:a}=e,u=a-s,f;for(;;){if(u<0)return new xs(0,1);if(u>n.viewState.docHeight)return new xs(n.state.doc.length,-1);if(f=n.elementAtHeight(u),r==null)break;if(f.type==tr.Text){let x=n.docView.coordsAt(r<0?f.from:f.to,r);if(x&&(r<0?x.top<=u+s:x.bottom>=u+s))break}let g=n.viewState.heightOracle.textHeight/2;u=r>0?f.bottom+g:f.top-g}if(n.viewport.from>=f.to||n.viewport.to<=f.from){if(t)return null;if(f.type==tr.Text){let g=l8(n,i,f,o,a);return new xs(g,g==f.from?1:-1)}}if(f.type!=tr.Text)return u<(f.top+f.bottom)/2?new xs(f.from,1):new xs(f.to,-1);let p=n.docView.lineAt(f.from,2);return(!p||p.length!=f.length)&&(p=n.docView.lineAt(f.from,-2)),uC(n,p,f.from,o,a)}function uC(n,e,t,r,i){let s=-1,o=null,a=1e9,u=1e9,f=i,p=i,g=(x,A)=>{for(let _=0;_<x.length;_++){let b=x[_];if(b.top==b.bottom)continue;let w=b.left>r?b.left-r:b.right<r?r-b.right:0,C=b.top>i?b.top-i:b.bottom<i?i-b.bottom:0;b.top<=p&&b.bottom>=f&&(f=Math.min(b.top,f),p=Math.max(b.bottom,p),C=0),(s<0||(C-u||w-a)<0)&&(s>=0&&u&&a<w&&o.top<=p-2&&o.bottom>=f+2?u=0:(s=A,a=w,u=C,o=b))}};if(e.isText()){for(let A=0;A<e.length;){let _=Fn(e.text,A);if(g(yh(e.dom,A,_).getClientRects(),A),!a&&!u)break;A=_}return r>(o.left+o.right)/2==(Aw(n,s+t)==Zt.LTR)?new xs(t+Fn(e.text,s),-1):new xs(t+s,1)}else{if(!e.length)return new xs(t,1);for(let b=0;b<e.children.length;b++){let w=e.children[b];if(w.flags&48)continue;let C=(w.dom.nodeType==1?w.dom:yh(w.dom,0,w.length)).getClientRects();if(g(C,b),!a&&!u)break}let x=e.children[s],A=e.posBefore(x,t);return x.isComposite()||x.isText()?uC(n,x,A,Math.max(o.left,Math.min(o.right,r)),i):r>(o.left+o.right)/2==(Aw(n,s+t)==Zt.LTR)?new xs(A+x.length,-1):new xs(A,1)}}function Aw(n,e){let t=n.state.doc.lineAt(e);return n.bidiSpans(t)[so.find(n.bidiSpans(t),e-t.from,-1,1)].dir}const Ku="";class f8{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Rt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ku}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=Tn.get(i),a=i.nextSibling;if(a==t){o!=null&&o.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Tn.get(a);(o&&u?o.breakAfter:(o?o.breakAfter:sp(i))||sp(a)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!p8(a,t)&&this.lineBreak(),i=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);r=s+o}}readNode(e){let t=Tn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(d8(e,r.node,r.offset)?t:0))}}fun
Line truncated
|
||||
`&&n.lineWrapping&&(r&&(r=we.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Lt.of([" "])}),t)return jv(n,t,r,s);if(r&&!cp(r,i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=cC(n.state.facet(jh).map(u=>u(n)),r))),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function jv(n,e,t,r=-1){if(He.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(He.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&dc(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&dc(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&dc(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=g8(n,e,t));return n.state.facet(K2).some(u=>u(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function g8(n,e,t){let r,i=n.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,f=u<0?s.from:s.to,p=uh(i.facet(jh).map(g=>g(n)),f,u);e.from==p&&(o=p)}if(o>-1)r={changes:e,selection:we.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",f=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(u+e.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let u=i.changes(e),f=t&&t.main.to<=u.newLength?t.main:void 0;if(i.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let p=n.state.sliceDoc(e.from,e.to),g,x=t&&lC(n,t.main.head);if(x){let _=e.insert.length-(e.to-e.from);g={from:x.from,to:x.to-_}}else g=n.state.doc.lineAt(s.head);let A=s.to-e.to;r=i.changeByRange(_=>{if(_.from==s.from&&_.to==s.to)return{changes:u,range:f||_.map(u)};let b=_.to-A,w=b-p.length;if(n.state.sliceDoc(w,b)!=p||b>=g.from&&w<=g.to)return{range:_};let C=i.changes({from:w,to:b,insert:e.insert}),T=_.to-s.to;return{changes:C,range:f?we.range(Math.max(0,f.anchor+T),Math.max(0,f.head+T)):_.map(C)}})}else r={changes:u,selection:f&&i.selection.replaceRange(f)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function dC(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let u=Math.max(0,s-Math.min(o,a));t-=o+u-s}if(o<s&&n.length<e.length){let u=t<=s&&t>=o?s-t:0;s-=u,a=s+(a-o),o=s}else if(a<s){let u=t<=s&&t>=a?s-t:0;s-=u,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function x8(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new bw(t,r)),(i!=t||s!=r)&&e.push(new bw(i,s))),e}function y8(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?we.single(t+e,r+e):null}function cp(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class v8{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,He.safari&&e.contentDOM.addEventListener("input",()=>null),He.gecko&&M8(e.contentDOM.ownerDocument)}handleEvent(e){!C8(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=A8(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].
Line truncated
|
||||
`))};if((He.mac||He.android)&&g.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(g={from:a,to:u,insert:Lt.of([r.text.replace("."," ")])}),this.pendingContextChange=g,!e.state.readOnly){let x=this.to-this.from+(g.to-g.from+g.insert.length);jv(e,g,we.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),g.from<g.to&&!g.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let u=this.toEditorPos(s.rangeStart),f=this.toEditorPos(s.rangeEnd);if(u<f){let p=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(Je.mark({attributes:{style:p}}).range(u,f))}}}e.dispatch({effects:nC.of(Je.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Oc(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,u,f)=>{if(r)return;let p=f.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(f)){i=this.pendingContextChange=null,t+=p,this.to+=p;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=p,this.to+=p;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),f.toString()),this.to+=p}t+=p}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ne{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measu
Line truncated
|
||||
--\u2028\u2029\uFEFF-]`,Fy),yM={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let xx=null;function vM(){var n;if(xx==null&&typeof document<"u"&&document.body){let e=document.body.style;xx=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return xx||!1}const i0=je.define({combine(n){let e=Os(n,{render:null,specialChars:xM,addSpecialChars:null});return(e.replaceTabs=!vM())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Fy)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Fy)),e}});function AM(n={}){return[i0.of(n),bM()]}let Ww=null;function bM(){return Ww||(Ww=_n.fromClass(class{constructor(n){this.view=n,this.decorations=Je.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(i0)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new gM({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=Mr(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,u=Lc(o.text,a,r-o.from);return Je.replace({widget:new kM((a-u%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Je.replace({widget:new OM(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(i0);n.startState.facet(i0)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const wM="•";function _M(n){return n>=32?wM:n==10?"":String.fromCharCode(9216+n)}class OM extends $i{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=_M(this.code),r=e.state.phrase("Control character")+" "+(yM[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class kM extends $i{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function SM(){return TM}const CM=Je.line({class:"cm-activeLine"}),TM=_n.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(CM.range(i.from)),e=i.from)}return Je.set(t)}},{decorations:n=>n.decorations});class EM extends $i{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?lh(e.firstChild):[];if(!t.length)return null;let r=window.getComputedStyle(e.parentNode),i=xh(t[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function PM(n){let e=_n.fromClass(class{constructor(t){this.view=t,this.placeholder=n?Je.set([Je.widget({widget:new EM(n),side:1}).range(0)]):Je.none}get decorations(){return this.view.state.doc.length?Je.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,Ne.contentAttributes.of({"aria-placeholder":n})]:e}const Iy=2e3;function BM(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>Iy||t.off>Iy||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let u=r;u<=i;u++){let f=n.doc.line(u);f.length<=a&&s.push(we.range(f.from+o,f.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let u=r;u<=i;u++){let f=n.doc.line(u),p=xy(f.text,o,n.tabSize,!0);if(p<0)s.push(we.cursor(f.to));else{let g=xy(f.text,a,n.tabSize);s.push(we.range(f.from+p,f.from+g))}}}return s}function RM(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function qw(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>Iy?-1:i==r.length?RM(n,e.clientX):Lc(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function DM(n,e){let t
Line truncated
|
||||
`:r=="r"?"\r":r=="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 $L(this):new WL(this)}getCursor(e,t=0,r){let i=e.doc?e:Rt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?ic(this,i,t,r):rc(this,i,t,r)}}class UT{constructor(e){this.spec=e}}function QL(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(a,e,r,i)}}function rc(n,e,t,r){let i;return n.wholeWord&&(i=HL(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=QL(n.test,e,i)),new Ec(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function HL(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(bp(i,t-s))!=ln.Word||e(wp(i,t-s))!=ln.Word)&&(e(wp(i,r-s))!=ln.Word||e(bp(i,r-s))!=ln.Word))}class WL extends UT{constructor(e){super(e)}nextMatch(e,t,r){let i=rc(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=rc(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=rc(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=rc(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=rc(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function qL(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function ic(n,e,t,r){let i;return n.wholeWord&&(i=VL(e.charCategorizer(e.selection.main.head))),n.test&&(i=qL(n.test,e,i)),new qT(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function bp(n,e){return n.slice(Fn(n,e,!1),e)}function wp(n,e){return n.slice(e,Fn(n,e))}function VL(n){return(e,t,r)=>!r[0].length||(n(bp(r.input,r.index))!=ln.Word||n(wp(r.input,r.index))!=ln.Word)&&(n(wp(r.input,r.index+r[0].length))!=ln.Word||n(bp(r.input,r.index+r[0].length))!=ln.Word)}class $L extends UT{nextMatch(e,t,r){let i=ic(this.spec,e,r,e.doc.length).next();return i.done&&(i=ic(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=ic(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=ic(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ic(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Oh=ft.define(),nA=ft.define(),ea=$n.define({create(n){return new Rx(Xy(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Oh)?n=new Rx(t.value.create(),n.panel):t.is(nA)&&(n=new Rx(n.query,t.value?rA:null));return n},provide:n=>Ah.from(n,e=>e.panel)});class Rx{constructor(e,t){this.query=e,this.panel=t}}const UL=Je.mark({class:"cm-searchMatch"}),ZL=Je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),GL=_n.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ea))}update(n){let e=n.state.field(ea);(e!=n.startState.field(ea)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Je.none;let{view:t}=this,r=new oo;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:u}=s[i];for(;i<o-1&&u>s[i+1].from-500;)u=s[++i].to;n.highlight(t.state,a,u,(f,p)=>{let g=t.state.selection.ranges.some(x=>x.from==f&&x.to==p);r.add(f,p,g?ZL:UL)})}return r.finish()}},{decorations:n=>n.decorations});function Uh(n){return e=>{let t=e.state.field(ea,!1);return t&&t.query.spec.valid?n(e,t):XT(e)}}const _p=Uh((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=we.single(r.from,r.to),s=n.state.facet(Ic);return n.dispatch({selection:i,effects:[iA(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),GT(n),!0}),Op=Uh((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i
Line truncated
|
||||
|
||||
`,{label:"if",detail:"block",type:"keyword"}),$s("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),$s("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),$s("import ${module}",{label:"import",detail:"statement",type:"keyword"}),$s("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],n9=iF(kE,JT(e9.concat(t9)));function Hx(n){let{node:e,pos:t}=n,r=n.lineIndent(t,-1),i=null;for(;;){let s=e.childBefore(t);if(s)if(s.name=="Comment")t=s.from;else if(s.name=="Body"||s.name=="MatchBody")n.baseIndentFor(s)+n.unit<=r&&(i=s),e=s;else if(s.name=="MatchClause")e=s;else if(s.type.is("Statement"))e=s;else break;else break}return i}function Wx(n,e){let t=n.baseIndentFor(e),r=n.lineAt(n.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&n.node.to<i+100&&!/\S/.test(n.state.sliceDoc(i,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 qx=pp.define({name:"python",parser:Kz.configure({props:[ZC.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&Hx(n)||n.node;return(e=Wx(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=Hx(n);return(e=Wx(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":Sx({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Sx({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Sx({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=Hx(n);return(e=t&&Wx(n,t))!==null&&e!==void 0?e:n.continue()}}),KC.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":zN,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 r9(){return new TN(qx,[qx.data.of({autocomplete:Jz}),qx.data.of({autocomplete:n9})])}var i9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],s9=i9.reduce((n,e)=>{const t=gv(`Primitive.${e}`),r=R.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{}),o9="Separator",rO="horizontal",a9=["horizontal","vertical"],SE=R.forwardRef((n,e)=>{const{decorative:t,orientation:r=rO,...i}=n,s=l9(r)?r:rO,a=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return S.jsx(s9.div,{"data-orientation":s,...a,...i,ref:e})});SE.displayName=o9;function l9(n){return a9.includes(n)}var CE=SE;const $o=R.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},i)=>S.jsx(CE,{ref:i,decorative:t,orientation:e,className:vt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));$o.displayName=CE.displayName;const Vx=[{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 c9({open:n,config:e,health:t,appSettings:r,onClose:i,onSave:s,onSaveAppSettings:o,onSetPrivateKey:a,onReboot:u,onAdvertise:f,onHealthRefresh:p,onRefreshAppSettings:g}){const[x,A]=R.useState("radio"),[_,b]=R.useState(""),[w,C]=R.useState(""),[T,E]=R.useState(""),[D,N]=R.useState(""),[F,z]=R.useState(""),[I,K]=R.useState(""),[W,U]=R.useState(""),[X,$]=R.useState(""),[ee,le]=R.useState(""),[Z,ie]=R.useState(""),[V,ne]=R.useState(!1),[q,B]=R.
Line truncated
|
||||
`,{label:"if",detail:"block",type:"keyword"}),$s("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),$s("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),$s("import ${module}",{label:"import",detail:"statement",type:"keyword"}),$s("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],n9=iF(kE,JT(e9.concat(t9)));function Hx(n){let{node:e,pos:t}=n,r=n.lineIndent(t,-1),i=null;for(;;){let s=e.childBefore(t);if(s)if(s.name=="Comment")t=s.from;else if(s.name=="Body"||s.name=="MatchBody")n.baseIndentFor(s)+n.unit<=r&&(i=s),e=s;else if(s.name=="MatchClause")e=s;else if(s.type.is("Statement"))e=s;else break;else break}return i}function Wx(n,e){let t=n.baseIndentFor(e),r=n.lineAt(n.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&n.node.to<i+100&&!/\S/.test(n.state.sliceDoc(i,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 qx=pp.define({name:"python",parser:Kz.configure({props:[ZC.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&Hx(n)||n.node;return(e=Wx(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=Hx(n);return(e=Wx(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":Sx({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Sx({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Sx({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=Hx(n);return(e=t&&Wx(n,t))!==null&&e!==void 0?e:n.continue()}}),KC.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":zN,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 r9(){return new TN(qx,[qx.data.of({autocomplete:Jz}),qx.data.of({autocomplete:n9})])}var i9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],s9=i9.reduce((n,e)=>{const t=gv(`Primitive.${e}`),r=R.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{}),o9="Separator",rO="horizontal",a9=["horizontal","vertical"],SE=R.forwardRef((n,e)=>{const{decorative:t,orientation:r=rO,...i}=n,s=l9(r)?r:rO,a=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return S.jsx(s9.div,{"data-orientation":s,...a,...i,ref:e})});SE.displayName=o9;function l9(n){return a9.includes(n)}var CE=SE;const eo=R.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},i)=>S.jsx(CE,{ref:i,decorative:t,orientation:e,className:vt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));eo.displayName=CE.displayName;const Vx=[{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 c9({open:n,config:e,health:t,appSettings:r,onClose:i,onSave:s,onSaveAppSettings:o,onSetPrivateKey:a,onReboot:u,onAdvertise:f,onHealthRefresh:p,onRefreshAppSettings:g}){const[x,A]=R.useState("radio"),[_,b]=R.useState(""),[w,C]=R.useState(""),[T,E]=R.useState(""),[D,N]=R.useState(""),[F,z]=R.useState(""),[I,K]=R.useState(""),[W,U]=R.useState(""),[X,$]=R.useState(""),[ee,le]=R.useState(""),[Z,ie]=R.useState(""),[V,ne]=R.useState(!1),[q,B]=R.
Line truncated
|
||||
sender_name: str | None,
|
||||
sender_key: str | None,
|
||||
message_text: str,
|
||||
@@ -166,7 +166,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
||||
# Example: Only respond in #bot channel to "!pling" command
|
||||
if channel_name == "#bot" and "!pling" in message_text.lower():
|
||||
return "[BOT] Plong!"
|
||||
return None`,[ot,mt]=R.useState([]),[et,tt]=R.useState(null),[at,qe]=R.useState(null),[Dt,Jt]=R.useState("");R.useEffect(()=>{e&&(b(e.name),C(String(e.lat)),E(String(e.lon)),N(String(e.tx_power)),z(String(e.radio.freq)),K(String(e.radio.bw)),U(String(e.radio.sf)),$(String(e.radio.cr)))},[e]),R.useEffect(()=>{r&&(ie(String(r.max_radio_contacts)),Ce(r.auto_decrypt_dm_on_advert),pt(String(r.advert_interval)),mt(r.bots||[]))},[r]),R.useEffect(()=>{n&&g()},[n,g]);const dr=R.useMemo(()=>{const ae=parseFloat(F),De=parseFloat(I),wt=parseInt(W,10),Gt=parseInt(X,10);for(const On of Vx)if(On.freq===ae&&On.bw===De&&On.sf===wt&&On.cr===Gt)return On.name;return"custom"},[F,I,W,X]),en=ae=>{if(ae==="custom")return;const De=Vx.find(wt=>wt.name===ae);De&&(z(String(De.freq)),K(String(De.bw)),U(String(De.sf)),$(String(De.cr)))},vn=()=>{if(!navigator.geolocation){kt.error("Geolocation not supported",{description:"Your browser does not support geolocation"});return}ue(!0),navigator.geolocation.getCurrentPosition(ae=>{C(ae.coords.latitude.toFixed(6)),E(ae.coords.longitude.toFixed(6)),ue(!1),kt.success("Location updated")},ae=>{ue(!1),kt.error("Failed to get location",{description:ae.message})},{enableHighAccuracy:!0,timeout:1e4})},En=async()=>{ve(""),ne(!0);try{const ae={lat:parseFloat(w),lon:parseFloat(T),tx_power:parseInt(D,10),radio:{freq:parseFloat(F),bw:parseFloat(I),sf:parseInt(W,10),cr:parseInt(X,10)}};await s(ae),kt.success("Radio config saved, rebooting..."),ne(!1),B(!0),await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save"),ne(!1)}finally{B(!1)}},Zn=async()=>{ve(""),ne(!0);try{await s({name:_});const De=parseInt(Ge,10);!isNaN(De)&&De!==(r==null?void 0:r.advert_interval)&&await o({advert_interval:De}),kt.success("Identity settings saved")}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save")}finally{ne(!1)}},rn=async()=>{ve(""),ne(!0);try{const ae=parseInt(Z,10);!isNaN(ae)&&ae!==(r==null?void 0:r.max_radio_contacts)&&await o({max_radio_contacts:ae}),kt.success("Serial settings saved")}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save")}finally{ne(!1)}},Qt=async()=>{if(!ee.trim()){ve("Private key is required");return}ve(""),ne(!0);try{await a(ee.trim()),le(""),kt.success("Private key set, rebooting..."),ne(!1),B(!0),await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to set private key"),ne(!1)}finally{B(!1)}},sn=async()=>{if(confirm("Are you sure you want to reboot the radio? The connection will drop temporarily.")){ve(""),B(!0);try{await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to reboot radio")}finally{B(!1)}}},pr=async()=>{G(!0);try{await f()}finally{G(!1)}},zn=async()=>{const ae=parseInt(xe,10);if(isNaN(ae)||ae<1){kt.error("Invalid retention days",{description:"Retention days must be at least 1"});return}Ke(!0);try{const De=await dt.runMaintenance(ae);kt.success("Database cleanup complete",{description:`Deleted ${De.packets_deleted} old packet${De.packets_deleted===1?"":"s"}`}),await p()}catch(De){console.error("Failed to run maintenance:",De),kt.error("Database cleanup failed",{description:De instanceof Error?De.message:"Unknown error"})}finally{Ke(!1)}},Ae=async()=>{ne(!0),ve("");try{await o({auto_decrypt_dm_on_advert:nt}),kt.success("Database settings saved")}catch(ae){console.error("Failed to save database settings:",ae),ve(ae instanceof Error?ae.message:"Failed to save"),kt.error("Failed to save settings")}finally{ne(!1)}},Te=async()=>{ne(!0),ve("");try{await o({bots:ot}),kt.success("Bot settings saved")}catch(ae){console.error("Failed to save bot settings:",ae);const De=ae instanceof Error?ae.message:"Failed to save";ve(De),kt.error(De)}finally{ne(!1)}},Ie=()=>{const ae={id:crypto.randomUUID(),name:`Bot ${ot.length+1}`,enabled:!1,code:bt};mt([...ot,ae]),tt(ae.id)},xt=ae=>{const De=ot.find(wt=>wt.id===ae);De&&De.code.trim()&&De.code!==bt&&!confirm(`Delete "${De.name}"? This will remove all its code.`)||(mt(ot.filter(wt=>wt.id!==ae)),et===ae&&tt(null))},se=ae=>{mt(ot.map(De=>De.id===ae?{...De,enabled:!De.enabled}:De))},be=(ae,De)=>{mt(ot.map(wt=>wt.id===ae?{...wt,code:De}:wt))},Oe=ae=>{qe(ae.id),Jt(ae.name)},Le=()=>{at&&Dt.trim()&&mt(ot.map(ae=>ae.id===at?{...ae,name:Dt.trim()}:ae)),qe(null),Jt("")},lt=ae=>{mt(ot.map(De=>De.id===ae?{...De,code:bt}:De))};return S.jsx(bv,{open:n,onOpenChange:ae=>!ae&&i(),children:S.jsxs(qp,{className:"sm:max-w-[50vw] sm:min-w-[500px] max-h-[90vh] overflow-y-auto",children:[S.jsxs(Vp,{children:[S.jsx($p,{children:"Radio & Settings"}),S.jsxs(Up,{className:"sr-only",children:[x==="radio"&&"Configure radio frequency, power, and location settings",x==="identity"&&"Manage radio name, public key, private key, and advertising settings",x==="serial"&&"View serial port connection and configure contact sync",x==="database"&&"View database statistics and clean up old packets",x==="advertise"&&"Send a flood advertisement to announce your presence",x==="bot"&&"Configure automatic message bot with Python code"]})]}),e?S.
Line truncated
|
||||
return None`,[ot,mt]=R.useState([]),[et,tt]=R.useState(null),[at,qe]=R.useState(null),[Dt,Jt]=R.useState("");R.useEffect(()=>{e&&(b(e.name),C(String(e.lat)),E(String(e.lon)),N(String(e.tx_power)),z(String(e.radio.freq)),K(String(e.radio.bw)),U(String(e.radio.sf)),$(String(e.radio.cr)))},[e]),R.useEffect(()=>{r&&(ie(String(r.max_radio_contacts)),Ce(r.auto_decrypt_dm_on_advert),pt(String(r.advert_interval)),mt(r.bots||[]))},[r]),R.useEffect(()=>{n&&g()},[n,g]);const dr=R.useMemo(()=>{const ae=parseFloat(F),De=parseFloat(I),wt=parseInt(W,10),Gt=parseInt(X,10);for(const On of Vx)if(On.freq===ae&&On.bw===De&&On.sf===wt&&On.cr===Gt)return On.name;return"custom"},[F,I,W,X]),en=ae=>{if(ae==="custom")return;const De=Vx.find(wt=>wt.name===ae);De&&(z(String(De.freq)),K(String(De.bw)),U(String(De.sf)),$(String(De.cr)))},vn=()=>{if(!navigator.geolocation){kt.error("Geolocation not supported",{description:"Your browser does not support geolocation"});return}ue(!0),navigator.geolocation.getCurrentPosition(ae=>{C(ae.coords.latitude.toFixed(6)),E(ae.coords.longitude.toFixed(6)),ue(!1),kt.success("Location updated")},ae=>{ue(!1),kt.error("Failed to get location",{description:ae.message})},{enableHighAccuracy:!0,timeout:1e4})},En=async()=>{ve(""),ne(!0);try{const ae={lat:parseFloat(w),lon:parseFloat(T),tx_power:parseInt(D,10),radio:{freq:parseFloat(F),bw:parseFloat(I),sf:parseInt(W,10),cr:parseInt(X,10)}};await s(ae),kt.success("Radio config saved, rebooting..."),ne(!1),B(!0),await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save"),ne(!1)}finally{B(!1)}},Zn=async()=>{ve(""),ne(!0);try{await s({name:_});const De=parseInt(Ge,10);!isNaN(De)&&De!==(r==null?void 0:r.advert_interval)&&await o({advert_interval:De}),kt.success("Identity settings saved")}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save")}finally{ne(!1)}},rn=async()=>{ve(""),ne(!0);try{const ae=parseInt(Z,10);!isNaN(ae)&&ae!==(r==null?void 0:r.max_radio_contacts)&&await o({max_radio_contacts:ae}),kt.success("Serial settings saved")}catch(ae){ve(ae instanceof Error?ae.message:"Failed to save")}finally{ne(!1)}},Qt=async()=>{if(!ee.trim()){ve("Private key is required");return}ve(""),ne(!0);try{await a(ee.trim()),le(""),kt.success("Private key set, rebooting..."),ne(!1),B(!0),await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to set private key"),ne(!1)}finally{B(!1)}},sn=async()=>{if(confirm("Are you sure you want to reboot the radio? The connection will drop temporarily.")){ve(""),B(!0);try{await u(),i()}catch(ae){ve(ae instanceof Error?ae.message:"Failed to reboot radio")}finally{B(!1)}}},pr=async()=>{G(!0);try{await f()}finally{G(!1)}},zn=async()=>{const ae=parseInt(xe,10);if(isNaN(ae)||ae<1){kt.error("Invalid retention days",{description:"Retention days must be at least 1"});return}Ke(!0);try{const De=await dt.runMaintenance(ae);kt.success("Database cleanup complete",{description:`Deleted ${De.packets_deleted} old packet${De.packets_deleted===1?"":"s"}`}),await p()}catch(De){console.error("Failed to run maintenance:",De),kt.error("Database cleanup failed",{description:De instanceof Error?De.message:"Unknown error"})}finally{Ke(!1)}},Ae=async()=>{ne(!0),ve("");try{await o({auto_decrypt_dm_on_advert:nt}),kt.success("Database settings saved")}catch(ae){console.error("Failed to save database settings:",ae),ve(ae instanceof Error?ae.message:"Failed to save"),kt.error("Failed to save settings")}finally{ne(!1)}},Te=async()=>{ne(!0),ve("");try{await o({bots:ot}),kt.success("Bot settings saved")}catch(ae){console.error("Failed to save bot settings:",ae);const De=ae instanceof Error?ae.message:"Failed to save";ve(De),kt.error(De)}finally{ne(!1)}},Ie=()=>{const ae={id:crypto.randomUUID(),name:`Bot ${ot.length+1}`,enabled:!1,code:bt};mt([...ot,ae]),tt(ae.id)},xt=ae=>{const De=ot.find(wt=>wt.id===ae);De&&De.code.trim()&&De.code!==bt&&!confirm(`Delete "${De.name}"? This will remove all its code.`)||(mt(ot.filter(wt=>wt.id!==ae)),et===ae&&tt(null))},se=ae=>{mt(ot.map(De=>De.id===ae?{...De,enabled:!De.enabled}:De))},be=(ae,De)=>{mt(ot.map(wt=>wt.id===ae?{...wt,code:De}:wt))},Oe=ae=>{qe(ae.id),Jt(ae.name)},Le=()=>{at&&Dt.trim()&&mt(ot.map(ae=>ae.id===at?{...ae,name:Dt.trim()}:ae)),qe(null),Jt("")},lt=ae=>{mt(ot.map(De=>De.id===ae?{...De,code:bt}:De))};return S.jsx(bv,{open:n,onOpenChange:ae=>!ae&&i(),children:S.jsxs(qp,{className:"sm:max-w-[50vw] sm:min-w-[500px] max-h-[90vh] overflow-y-auto",children:[S.jsxs(Vp,{children:[S.jsx($p,{children:"Radio & Settings"}),S.jsxs(Up,{className:"sr-only",children:[x==="radio"&&"Configure radio frequency, power, and location settings",x==="identity"&&"Manage radio name, public key, private key, and advertising settings",x==="serial"&&"View serial port connection and configure contact sync",x==="database"&&"View database statistics and clean up old packets",x==="bot"&&"Configure automatic message bot with Python code"]})]}),e?S.jsxs(Ov,{value:x,onValueChange:ae=>A(ae),className:"w-full",children:[S.
Line truncated
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
@@ -179,16 +179,16 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return t.mode.CTRGladman=(function(){var r=t.lib.BlockCipherMode.extend();function i(a){if((a>>24&255)===255){var u=a>>16&255,f=a>>8&255,p=a&255;u===255?(u=0,f===255?(f=0,p===255?p=0:++p):++f):++u,a=0,a+=u<<16,a+=f<<8,a+=p}else a+=1<<24;return a}function s(a){return(a[0]=i(a[0]))===0&&(a[1]=i(a[1])),a}var o=r.Encryptor=r.extend({processBlock:function(a,u){var f=this._cipher,p=f.blockSize,g=this._iv,x=this._counter;g&&(x=this._counter=g.slice(0),this._iv=void 0),s(x);var A=x.slice(0);f.encryptBlock(A,0);for(var _=0;_<p;_++)a[u+_]^=A[_]}});return r.Decryptor=o,r})(),t.mode.CTRGladman})})(R0)),R0.exports}var D0={exports:{}},q9=D0.exports,TO;function V9(){return TO||(TO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(q9,function(t){return t.mode.OFB=(function(){var r=t.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(s,o){var a=this._cipher,u=a.blockSize,f=this._iv,p=this._keystream;f&&(p=this._keystream=f.slice(0),this._iv=void 0),a.encryptBlock(p,0);for(var g=0;g<u;g++)s[o+g]^=p[g]}});return r.Decryptor=i,r})(),t.mode.OFB})})(D0)),D0.exports}var M0={exports:{}},$9=M0.exports,EO;function U9(){return EO||(EO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})($9,function(t){return t.mode.ECB=(function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),r.Decryptor=r.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),r})(),t.mode.ECB})})(M0)),M0.exports}var N0={exports:{}},Z9=N0.exports,PO;function G9(){return PO||(PO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(Z9,function(t){return t.pad.AnsiX923={pad:function(r,i){var s=r.sigBytes,o=i*4,a=o-s%o,u=s+a-1;r.clamp(),r.words[u>>>2]|=a<<24-u%4*8,r.sigBytes+=a},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},t.pad.Ansix923})})(N0)),N0.exports}var L0={exports:{}},X9=L0.exports,BO;function K9(){return BO||(BO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(X9,function(t){return t.pad.Iso10126={pad:function(r,i){var s=i*4,o=s-r.sigBytes%s;r.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},t.pad.Iso10126})})(L0)),L0.exports}var F0={exports:{}},Y9=F0.exports,RO;function J9(){return RO||(RO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(Y9,function(t){return t.pad.Iso97971={pad:function(r,i){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,i)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})})(F0)),F0.exports}var I0={exports:{}},ej=I0.exports,DO;function tj(){return DO||(DO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(ej,function(t){return t.pad.ZeroPadding={pad:function(r,i){var s=i*4;r.clamp(),r.sigBytes+=s-(r.sigBytes%s||s)},unpad:function(r){for(var i=r.words,s=r.sigBytes-1,s=r.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){r.sigBytes=s+1;break}}},t.pad.ZeroPadding})})(I0)),I0.exports}var z0={exports:{}},nj=z0.exports,MO;function rj(){return MO||(MO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(nj,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(z0)),z0.exports}var j0={exports:{}},ij=j0.exports,NO;function sj(){return NO||(NO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(ij,function(t){return(function(r){var i=t,s=i.lib,o=s.CipherParams,a=i.enc,u=a.Hex,f=i.format;f.Hex={stringify:function(p){return p.ciphertext.toString(u)},parse:function(p){var g=u.parse(p);return o.create({ciphertext:g})}}})(),t.format.Hex})})(j0)),j0.exports}var Q0={exports:{}},oj=Q0.exports,LO;function aj(){return LO||(LO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),ul(),hl(),ua(),Un())})(oj,function(t){return(function(){var r=t,i=r.lib,s=i.BlockCipher,o=r.algo,a=[],u=[],f=[],p=[],g=[],x=[],A=[],_=[],b=[],w=[];(function(){for(var E=[],D=0;D<256;D++)D<128?E[D]=D<<1:E[D]=D<<1^283;for(var N=0,F=0,D=0;D<256;D++){var z=F^F<<1^F<<2^F<<3^F<<4;z=z>>>8^z&255^99,a[N]=z,u[z]=N;var I=E[N],K=E[I],W=E[K],U=E[z]*257^z*16843008;f[N]=U<<24|U>>>8,p[N]=U<<16|U>>>16,g[N]=U<<8|U>>>24,x[N]=U;var U=W*16843009^K*65537^I*257^N*16843008;A[z]=U<<24|U>>>8,_[z]=U<<16|U>>>16,b[z]=U<<8|U>>>24,w[z]=U,N?(N=I^E[E[E[W^I]]],F^=E[E[F]]):N=F=1}})();var C=[0,1,2,4,8,16,32,64,128,27,54],T=o.AES=s.extend({_doReset:function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var D=this._keyPriorReset=this._key,N=D.words,F=D.sigBytes/4,z=this._nRounds=F+6,I=(z+1)*4,K=this._keySchedule=[],W=0;W<I;W++)W<F?K[W]=N[W]:(E=K[W-1],W%F?F>6&&W%F==4&&(E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255]):(E=E<<8|E>>>24,E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255],E^=C[W/F|0]<<24),K[W]=K[W-F]^E);for(var U=this._invKeySchedule=[],X=0;X<I;X++){var W=I-X;if(X%4)var E=K[W];else var E=K[W-4];X<4||W<=4?U[X]=E:U[X]=A[a[E>>>24]]^_[a[E>>>16&255]]^b[a[E>>>8&255]]^w[a[E&255]]}}},encryptBlock:Line truncated
|
||||
*/return t.mode.CTRGladman=(function(){var r=t.lib.BlockCipherMode.extend();function i(a){if((a>>24&255)===255){var u=a>>16&255,f=a>>8&255,p=a&255;u===255?(u=0,f===255?(f=0,p===255?p=0:++p):++f):++u,a=0,a+=u<<16,a+=f<<8,a+=p}else a+=1<<24;return a}function s(a){return(a[0]=i(a[0]))===0&&(a[1]=i(a[1])),a}var o=r.Encryptor=r.extend({processBlock:function(a,u){var f=this._cipher,p=f.blockSize,g=this._iv,x=this._counter;g&&(x=this._counter=g.slice(0),this._iv=void 0),s(x);var A=x.slice(0);f.encryptBlock(A,0);for(var _=0;_<p;_++)a[u+_]^=A[_]}});return r.Decryptor=o,r})(),t.mode.CTRGladman})})(R0)),R0.exports}var D0={exports:{}},q9=D0.exports,TO;function V9(){return TO||(TO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(q9,function(t){return t.mode.OFB=(function(){var r=t.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(s,o){var a=this._cipher,u=a.blockSize,f=this._iv,p=this._keystream;f&&(p=this._keystream=f.slice(0),this._iv=void 0),a.encryptBlock(p,0);for(var g=0;g<u;g++)s[o+g]^=p[g]}});return r.Decryptor=i,r})(),t.mode.OFB})})(D0)),D0.exports}var M0={exports:{}},$9=M0.exports,EO;function U9(){return EO||(EO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})($9,function(t){return t.mode.ECB=(function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),r.Decryptor=r.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),r})(),t.mode.ECB})})(M0)),M0.exports}var N0={exports:{}},Z9=N0.exports,PO;function G9(){return PO||(PO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(Z9,function(t){return t.pad.AnsiX923={pad:function(r,i){var s=r.sigBytes,o=i*4,a=o-s%o,u=s+a-1;r.clamp(),r.words[u>>>2]|=a<<24-u%4*8,r.sigBytes+=a},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},t.pad.Ansix923})})(N0)),N0.exports}var L0={exports:{}},X9=L0.exports,BO;function K9(){return BO||(BO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(X9,function(t){return t.pad.Iso10126={pad:function(r,i){var s=i*4,o=s-r.sigBytes%s;r.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},t.pad.Iso10126})})(L0)),L0.exports}var F0={exports:{}},Y9=F0.exports,RO;function J9(){return RO||(RO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(Y9,function(t){return t.pad.Iso97971={pad:function(r,i){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,i)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})})(F0)),F0.exports}var I0={exports:{}},ej=I0.exports,DO;function tj(){return DO||(DO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(ej,function(t){return t.pad.ZeroPadding={pad:function(r,i){var s=i*4;r.clamp(),r.sigBytes+=s-(r.sigBytes%s||s)},unpad:function(r){for(var i=r.words,s=r.sigBytes-1,s=r.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){r.sigBytes=s+1;break}}},t.pad.ZeroPadding})})(I0)),I0.exports}var z0={exports:{}},nj=z0.exports,MO;function rj(){return MO||(MO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(nj,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(z0)),z0.exports}var j0={exports:{}},ij=j0.exports,NO;function sj(){return NO||(NO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),Un())})(ij,function(t){return(function(r){var i=t,s=i.lib,o=s.CipherParams,a=i.enc,u=a.Hex,f=i.format;f.Hex={stringify:function(p){return p.ciphertext.toString(u)},parse:function(p){var g=u.parse(p);return o.create({ciphertext:g})}}})(),t.format.Hex})})(j0)),j0.exports}var Q0={exports:{}},oj=Q0.exports,LO;function aj(){return LO||(LO=1,(function(n,e){(function(t,r,i){n.exports=r(Et(),ul(),hl(),ua(),Un())})(oj,function(t){return(function(){var r=t,i=r.lib,s=i.BlockCipher,o=r.algo,a=[],u=[],f=[],p=[],g=[],x=[],A=[],_=[],b=[],w=[];(function(){for(var E=[],D=0;D<256;D++)D<128?E[D]=D<<1:E[D]=D<<1^283;for(var N=0,F=0,D=0;D<256;D++){var z=F^F<<1^F<<2^F<<3^F<<4;z=z>>>8^z&255^99,a[N]=z,u[z]=N;var I=E[N],K=E[I],W=E[K],U=E[z]*257^z*16843008;f[N]=U<<24|U>>>8,p[N]=U<<16|U>>>16,g[N]=U<<8|U>>>24,x[N]=U;var U=W*16843009^K*65537^I*257^N*16843008;A[z]=U<<24|U>>>8,_[z]=U<<16|U>>>16,b[z]=U<<8|U>>>24,w[z]=U,N?(N=I^E[E[E[W^I]]],F^=E[E[F]]):N=F=1}})();var C=[0,1,2,4,8,16,32,64,128,27,54],T=o.AES=s.extend({_doReset:function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var D=this._keyPriorReset=this._key,N=D.words,F=D.sigBytes/4,z=this._nRounds=F+6,I=(z+1)*4,K=this._keySchedule=[],W=0;W<I;W++)W<F?K[W]=N[W]:(E=K[W-1],W%F?F>6&&W%F==4&&(E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255]):(E=E<<8|E>>>24,E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255],E^=C[W/F|0]<<24),K[W]=K[W-F]^E);for(var U=this._invKeySchedule=[],X=0;X<I;X++){var W=I-X;if(X%4)var E=K[W];else var E=K[W-4];X<4||W<=4?U[X]=E:U[X]=A[a[E>>>24]]^_[a[E>>>16&255]]^b[a[E>>>8&255]]^w[a[E&255]]}}},encryptBlock: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:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode request payload"],timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Hu.RequestPayloadDecoder=t,Hu}var Wu={},sk;function Wj(){if(sk)return Wu;sk=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.ResponsePayloadDecoder=void 0;const n=oi(),e=nr();class t{static decode(i,s){try{if(i.length<4){const _={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Source Hash",description:"First byte of source node public key",startByte:a+u,endByte:a+u,value:p}),u+=1;const g=(0,e.bytesToHex)(i.subarray(u,u+2));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(u));s!=null&&s.includeSegments&&i.length>u&&o.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-4};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Wu.ResponsePayloadDecoder=t,Wu}var qu={},ok;function qj(){if(ok)return qu;ok=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.AnonRequestPayloadDecoder=void 0;const n=oi(),e=nr();class t{static decode(i,s){try{if(i.length<35){const _={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[0]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${f}`,startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.bytesToHex)(i.subarray(1,33));s!=null&&s.includeSegments&&o.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:a+u,endByte:a+u+31,value:p}),u+=32;const g=(0,e.bytesToHex)(i.subarray(33,35));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(35));s!=null&&s.includeSegments&&i.length>35&&o.push({name:"Ciphertext",description:`Encrypted message data (${i.length-35} bytes). Contains encrypted plaintext with this structure:
|
||||
• Request Data (remaining bytes) - additional request-specific data`,startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode request payload"],timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Hu.RequestPayloadDecoder=t,Hu}var Wu={},sk;function Wj(){if(sk)return Wu;sk=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.ResponsePayloadDecoder=void 0;const n=ii(),e=nr();class t{static decode(i,s){try{if(i.length<4){const _={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Source Hash",description:"First byte of source node public key",startByte:a+u,endByte:a+u,value:p}),u+=1;const g=(0,e.bytesToHex)(i.subarray(u,u+2));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(u));s!=null&&s.includeSegments&&i.length>u&&o.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-4};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Wu.ResponsePayloadDecoder=t,Wu}var qu={},ok;function qj(){if(ok)return qu;ok=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.AnonRequestPayloadDecoder=void 0;const n=ii(),e=nr();class t{static decode(i,s){try{if(i.length<35){const _={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[0]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${f}`,startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.bytesToHex)(i.subarray(1,33));s!=null&&s.includeSegments&&o.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:a+u,endByte:a+u+31,value:p}),u+=32;const g=(0,e.bytesToHex)(i.subarray(33,35));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(35));s!=null&&s.includeSegments&&i.length>35&&o.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:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,senderPublicKey:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-35};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return qu.AnonRequestPayloadDecoder=t,qu}var Vu={},ak;function Vj(){if(ak)return Vu;ak=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.AckPayloadDecoder=void 0;const n=oi(),e=nr();class t{static decode(i,s){try{if(i.length<4){const p={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return s!=null&&s.includeSegments&&(p.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),p}const o=[],a=(s==null?void 0:s.segmentOffset)||0,u=(0,e.bytesToHex)(i.subarray(0,4));s!=null&&s.includeSegments&&o.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${u}`,startByte:a,endByte:a+3,value:u}),s!=null&&s.includeSegments&&i.length>4&&o.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:a+4,endByte:a+i.length-1,value:(0,e.bytesToHex)(i.subarray(4))});const f={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!0,checksum:u};return s!=null&&s.includeSegments&&(f.segments=o),f}catch(o){return{type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode Ack payload"],checksum:""}}}}return Vu.AckPayloadDecoder=t,Vu}var $u={},lk;function $j(){if(lk)return $u;lk=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.PathPayloadDecoder=void 0;const n=oi(),e=nr();class t{static decode(i){try{if(i.length<2)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const s=i[0];if(i.length<1+s+1)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+s+1} bytes for path length + path + extra type)`],pathLength:s,pathHashes:[],extraType:0,extraData:""};const o=[];for(let f=0;f<s;f++)o.push((0,e.byteToHex)(i[1+f]));const a=i[1+s];let u="";return i.length>1+s+1&&(u=(0,e.bytesToHex)(i.subarray(1+s+1))),{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!0,pathLength:s,pathHashes:o,extraType:a,extraData:u}}catch(s){return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[s instanceof Error?s.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return $u.PathPayloadDecoder=t,$u}var Uu={},ck;function Uj(){if(ck)return Uu;ck=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.TextMessagePayloadDecoder=void 0;const n=oi(),e=nr();class t{static decode(i,s){try{if(i.length<4){const _={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Source Hash",description:"First byte of source node public key",startByte:a+u,endByte:a+u,value:p}),u+=1;const g=(0,e.bytesToHex)(i.subarray(u,u+2));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(u));s!=null&&s.includeSegments&&i.length>u&&o.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-4};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,i
Line truncated
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,senderPublicKey:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-35};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return qu.AnonRequestPayloadDecoder=t,qu}var Vu={},ak;function Vj(){if(ak)return Vu;ak=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.AckPayloadDecoder=void 0;const n=ii(),e=nr();class t{static decode(i,s){try{if(i.length<4){const p={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return s!=null&&s.includeSegments&&(p.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),p}const o=[],a=(s==null?void 0:s.segmentOffset)||0,u=(0,e.bytesToHex)(i.subarray(0,4));s!=null&&s.includeSegments&&o.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${u}`,startByte:a,endByte:a+3,value:u}),s!=null&&s.includeSegments&&i.length>4&&o.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:a+4,endByte:a+i.length-1,value:(0,e.bytesToHex)(i.subarray(4))});const f={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!0,checksum:u};return s!=null&&s.includeSegments&&(f.segments=o),f}catch(o){return{type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:[o instanceof Error?o.message:"Failed to decode Ack payload"],checksum:""}}}}return Vu.AckPayloadDecoder=t,Vu}var $u={},lk;function $j(){if(lk)return $u;lk=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.PathPayloadDecoder=void 0;const n=ii(),e=nr();class t{static decode(i){try{if(i.length<2)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const s=i[0];if(i.length<1+s+1)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+s+1} bytes for path length + path + extra type)`],pathLength:s,pathHashes:[],extraType:0,extraData:""};const o=[];for(let f=0;f<s;f++)o.push((0,e.byteToHex)(i[1+f]));const a=i[1+s];let u="";return i.length>1+s+1&&(u=(0,e.bytesToHex)(i.subarray(1+s+1))),{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!0,pathLength:s,pathHashes:o,extraType:a,extraData:u}}catch(s){return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[s instanceof Error?s.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return $u.PathPayloadDecoder=t,$u}var Uu={},ck;function Uj(){if(ck)return Uu;ck=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.TextMessagePayloadDecoder=void 0;const n=ii(),e=nr();class t{static decode(i,s){try{if(i.length<4){const _={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return s!=null&&s.includeSegments&&(_.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:s.segmentOffset||0,endByte:(s.segmentOffset||0)+i.length-1,value:(0,e.bytesToHex)(i)}]),_}const o=[],a=(s==null?void 0:s.segmentOffset)||0;let u=0;const f=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:a+u,endByte:a+u,value:f}),u+=1;const p=(0,e.byteToHex)(i[u]);s!=null&&s.includeSegments&&o.push({name:"Source Hash",description:"First byte of source node public key",startByte:a+u,endByte:a+u,value:p}),u+=1;const g=(0,e.bytesToHex)(i.subarray(u,u+2));s!=null&&s.includeSegments&&o.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:a+u,endByte:a+u+1,value:g}),u+=2;const x=(0,e.bytesToHex)(i.subarray(u));s!=null&&s.includeSegments&&i.length>u&&o.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:a+u,endByte:a+i.length-1,value:x});const A={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:f,sourceHash:p,cipherMac:g,ciphertext:x,ciphertextLength:i.length-4};return s!=null&&s.includeSegments&&(A.segments=o),A}catch(o){return{type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,i
Line truncated
|
||||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/var cQ=eh.exports,gk;function uQ(){return gk||(gk=1,(function(n,e){(function(t,r){r(e)})(cQ,(function(t){var r="1.9.4";function i(c){var d,y,O,M;for(y=1,O=arguments.length;y<O;y++){M=arguments[y];for(d in M)c[d]=M[d]}return c}var s=Object.create||(function(){function c(){}return function(d){return c.prototype=d,new c}})();function o(c,d){var y=Array.prototype.slice;if(c.bind)return c.bind.apply(c,y.call(arguments,1));var O=y.call(arguments,2);return function(){return c.apply(d,O.length?O.concat(y.call(arguments)):arguments)}}var a=0;function u(c){return"_leaflet_id"in c||(c._leaflet_id=++a),c._leaflet_id}function f(c,d,y){var O,M,H,te;return te=function(){O=!1,M&&(H.apply(y,M),M=!1)},H=function(){O?M=arguments:(c.apply(y,arguments),setTimeout(te,d),O=!0)},H}function p(c,d,y){var O=d[1],M=d[0],H=O-M;return c===O&&y?c:((c-M)%H+H)%H+M}function g(){return!1}function x(c,d){if(d===!1)return c;var y=Math.pow(10,d===void 0?6:d);return Math.round(c*y)/y}function A(c){return c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")}function _(c){return A(c).split(/\s+/)}function b(c,d){Object.prototype.hasOwnProperty.call(c,"options")||(c.options=c.options?s(c.options):{});for(var y in d)c.options[y]=d[y];return c.options}function w(c,d,y){var O=[];for(var M in c)O.push(encodeURIComponent(y?M.toUpperCase():M)+"="+encodeURIComponent(c[M]));return(!d||d.indexOf("?")===-1?"?":"&")+O.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function T(c,d){return c.replace(C,function(y,O){var M=d[O];if(M===void 0)throw new Error("No value provided for variable "+y);return typeof M=="function"&&(M=M(d)),M})}var E=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function D(c,d){for(var y=0;y<c.length;y++)if(c[y]===d)return y;return-1}var N="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function F(c){return window["webkit"+c]||window["moz"+c]||window["ms"+c]}var z=0;function I(c){var d=+new Date,y=Math.max(0,16-(d-z));return z=d+y,window.setTimeout(c,y)}var K=window.requestAnimationFrame||F("RequestAnimationFrame")||I,W=window.cancelAnimationFrame||F("CancelAnimationFrame")||F("CancelRequestAnimationFrame")||function(c){window.clearTimeout(c)};function U(c,d,y){if(y&&K===I)c.call(d);else return K.call(window,o(c,d))}function X(c){c&&W.call(window,c)}var $={__proto__:null,extend:i,create:s,bind:o,get lastId(){return a},stamp:u,throttle:f,wrapNum:p,falseFn:g,formatNum:x,trim:A,splitWords:_,setOptions:b,getParamString:w,template:T,isArray:E,indexOf:D,emptyImageUrl:N,requestFn:K,cancelFn:W,requestAnimFrame:U,cancelAnimFrame:X};function ee(){}ee.extend=function(c){var d=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},y=d.__super__=this.prototype,O=s(y);O.constructor=d,d.prototype=O;for(var M in this)Object.prototype.hasOwnProperty.call(this,M)&&M!=="prototype"&&M!=="__super__"&&(d[M]=this[M]);return c.statics&&i(d,c.statics),c.includes&&(le(c.includes),i.apply(null,[O].concat(c.includes))),i(O,c),delete O.statics,delete O.includes,O.options&&(O.options=y.options?s(y.options):{},i(O.options,c.options)),O._initHooks=[],O.callInitHooks=function(){if(!this._initHooksCalled){y.callInitHooks&&y.callInitHooks.call(this),this._initHooksCalled=!0;for(var H=0,te=O._initHooks.length;H<te;H++)O._initHooks[H].call(this)}},d},ee.include=function(c){var d=this.prototype.options;return i(this.prototype,c),c.options&&(this.prototype.options=d,this.mergeOptions(c.options)),this},ee.mergeOptions=function(c){return i(this.prototype.options,c),this},ee.addInitHook=function(c){var d=Array.prototype.slice.call(arguments,1),y=typeof c=="function"?c:function(){this[c].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(y),this};function le(c){if(!(typeof L>"u"||!L||!L.Mixin)){c=E(c)?c:[c];for(var d=0;d<c.length;d++)c[d]===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 Z={on:function(c,d,y){if(typeof c=="object")for(var O in c)this._on(O,c[O],d);else{c=_(c);for(var M=0,H=c.length;M<H;M++)this._on(c[M],d,y)}return this},off:function(c,d,y){if(!arguments.length)delete this._events;else if(typeof c=="object")for(var O in c)this._off(O,c[O],d);else{c=_(c);for(var M=arguments.length===1,H=0,te=c.length;H<te;H++)M?this._off(c[H]):this._off(c[H],d,y)}return this},_on:function(c,d,y,O){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(c,d,y)===!1){y===this&&(y=void 0);var M={fn:d,ctx:y};O&&(M.once=!0),this._events=this._events||{},this._events[c]=this._events[c]||[],this._events[c].push(M)}},_off:function(c,d,y){var O,M,H;if(this._events&&(O=this._events[c],!!O)){if(arguments.length===1){if(this._firingCount)for(M=0,H=O.length;M<H;M++)O[M].fn=g;delete this._events[c];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var te=Line truncated
|
||||
*/var cQ=eh.exports,gk;function uQ(){return gk||(gk=1,(function(n,e){(function(t,r){r(e)})(cQ,(function(t){var r="1.9.4";function i(c){var d,y,O,M;for(y=1,O=arguments.length;y<O;y++){M=arguments[y];for(d in M)c[d]=M[d]}return c}var s=Object.create||(function(){function c(){}return function(d){return c.prototype=d,new c}})();function o(c,d){var y=Array.prototype.slice;if(c.bind)return c.bind.apply(c,y.call(arguments,1));var O=y.call(arguments,2);return function(){return c.apply(d,O.length?O.concat(y.call(arguments)):arguments)}}var a=0;function u(c){return"_leaflet_id"in c||(c._leaflet_id=++a),c._leaflet_id}function f(c,d,y){var O,M,H,te;return te=function(){O=!1,M&&(H.apply(y,M),M=!1)},H=function(){O?M=arguments:(c.apply(y,arguments),setTimeout(te,d),O=!0)},H}function p(c,d,y){var O=d[1],M=d[0],H=O-M;return c===O&&y?c:((c-M)%H+H)%H+M}function g(){return!1}function x(c,d){if(d===!1)return c;var y=Math.pow(10,d===void 0?6:d);return Math.round(c*y)/y}function A(c){return c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")}function _(c){return A(c).split(/\s+/)}function b(c,d){Object.prototype.hasOwnProperty.call(c,"options")||(c.options=c.options?s(c.options):{});for(var y in d)c.options[y]=d[y];return c.options}function w(c,d,y){var O=[];for(var M in c)O.push(encodeURIComponent(y?M.toUpperCase():M)+"="+encodeURIComponent(c[M]));return(!d||d.indexOf("?")===-1?"?":"&")+O.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function T(c,d){return c.replace(C,function(y,O){var M=d[O];if(M===void 0)throw new Error("No value provided for variable "+y);return typeof M=="function"&&(M=M(d)),M})}var E=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function D(c,d){for(var y=0;y<c.length;y++)if(c[y]===d)return y;return-1}var N="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function F(c){return window["webkit"+c]||window["moz"+c]||window["ms"+c]}var z=0;function I(c){var d=+new Date,y=Math.max(0,16-(d-z));return z=d+y,window.setTimeout(c,y)}var K=window.requestAnimationFrame||F("RequestAnimationFrame")||I,W=window.cancelAnimationFrame||F("CancelAnimationFrame")||F("CancelRequestAnimationFrame")||function(c){window.clearTimeout(c)};function U(c,d,y){if(y&&K===I)c.call(d);else return K.call(window,o(c,d))}function X(c){c&&W.call(window,c)}var $={__proto__:null,extend:i,create:s,bind:o,get lastId(){return a},stamp:u,throttle:f,wrapNum:p,falseFn:g,formatNum:x,trim:A,splitWords:_,setOptions:b,getParamString:w,template:T,isArray:E,indexOf:D,emptyImageUrl:N,requestFn:K,cancelFn:W,requestAnimFrame:U,cancelAnimFrame:X};function ee(){}ee.extend=function(c){var d=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},y=d.__super__=this.prototype,O=s(y);O.constructor=d,d.prototype=O;for(var M in this)Object.prototype.hasOwnProperty.call(this,M)&&M!=="prototype"&&M!=="__super__"&&(d[M]=this[M]);return c.statics&&i(d,c.statics),c.includes&&(le(c.includes),i.apply(null,[O].concat(c.includes))),i(O,c),delete O.statics,delete O.includes,O.options&&(O.options=y.options?s(y.options):{},i(O.options,c.options)),O._initHooks=[],O.callInitHooks=function(){if(!this._initHooksCalled){y.callInitHooks&&y.callInitHooks.call(this),this._initHooksCalled=!0;for(var H=0,te=O._initHooks.length;H<te;H++)O._initHooks[H].call(this)}},d},ee.include=function(c){var d=this.prototype.options;return i(this.prototype,c),c.options&&(this.prototype.options=d,this.mergeOptions(c.options)),this},ee.mergeOptions=function(c){return i(this.prototype.options,c),this},ee.addInitHook=function(c){var d=Array.prototype.slice.call(arguments,1),y=typeof c=="function"?c:function(){this[c].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(y),this};function le(c){if(!(typeof L>"u"||!L||!L.Mixin)){c=E(c)?c:[c];for(var d=0;d<c.length;d++)c[d]===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 Z={on:function(c,d,y){if(typeof c=="object")for(var O in c)this._on(O,c[O],d);else{c=_(c);for(var M=0,H=c.length;M<H;M++)this._on(c[M],d,y)}return this},off:function(c,d,y){if(!arguments.length)delete this._events;else if(typeof c=="object")for(var O in c)this._off(O,c[O],d);else{c=_(c);for(var M=arguments.length===1,H=0,te=c.length;H<te;H++)M?this._off(c[H]):this._off(c[H],d,y)}return this},_on:function(c,d,y,O){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(c,d,y)===!1){y===this&&(y=void 0);var M={fn:d,ctx:y};O&&(M.once=!0),this._events=this._events||{},this._events[c]=this._events[c]||[],this._events[c].push(M)}},_off:function(c,d,y){var O,M,H;if(this._events&&(O=this._events[c],!!O)){if(arguments.length===1){if(this._firingCount)for(M=0,H=O.length;M<H;M++)O[M].fn=g;delete this._events[c];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var te=Line truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
@@ -581,5 +581,5 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
|
||||
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(a=>(this.enabled=!0,a)).catch(a=>{throw this.enabled=!1,a})}disable(){r()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):t()?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 Xx=i,Xx}var X7=G7();const K7=Rc(X7);function Y7(n){if(n.length<4)return null;try{const t=parseInt(n.slice(0,2),16)&3;let r=2;if(t===0||t===3){if(n.length<r+8)return null;r+=8}if(n.length<r+2)return null;const i=parseInt(n.slice(r,r+2),16);r+=2;const s=i*2;return n.length<r+s?null:(r+=s,n.slice(r))}catch{return null}}function J7({packets:n,channels:e,onChannelCreate:t,onRunningChange:r,visible:i=!1}){const[s,o]=R.useState(!1),[a,u]=R.useState(6),[f,p]=R.useState(!1),[g,x]=R.useState(!0),[A,_]=R.useState(!1),[b,w]=R.useState(null),[C,T]=R.useState(new Map),[E,D]=R.useState([]),[N,F]=R.useState(!1),[z,I]=R.useState(null),[K,W]=R.useState(null),[U,X]=R.useState(0),$=R.useRef(null),ee=R.useRef(null),le=R.useRef(!1),Z=R.useRef(!1),ie=R.useRef(!1),V=R.useRef(new Map),ne=R.useRef(!1),q=R.useRef(6),B=R.useRef(!0),Q=R.useRef(!1),G=R.useRef(new Set),Y=R.useRef(new Set);R.useEffect(()=>{const Ce=new U7;$.current=Ce,I(Ce.isGpuAvailable());const Ge=new K7;return ee.current=Ge,()=>{Ce.destroy(),$.current=null,Ge.disable(),ee.current=null}},[]),R.useEffect(()=>{!i||N||B7(async()=>{const{ENGLISH_WORDLIST:Ce}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Ce}},[]).then(({ENGLISH_WORDLIST:Ce})=>{$.current&&($.current.setWordlist(Ce),F(!0))}).catch(Ce=>{console.error("Failed to load wordlist:",Ce),kt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[i,N]),R.useEffect(()=>{const Ce=()=>{dt.getUndecryptedPacketCount().then(({count:pt})=>W(pt)).catch(()=>W(null))};Ce();const Ge=setInterval(Ce,36e5);return()=>clearInterval(Ge)},[]);const ue=R.useMemo(()=>new Set(e.map(Ce=>Ce.key.toUpperCase())),[e]),pe=n.filter(Ce=>Ce.payload_type==="GROUP_TEXT"&&!Ce.decrypted);R.useEffect(()=>{let Ce=0;T(Ge=>{const pt=new Map(Ge);let bt=!1;for(const ot of pe)if(!pt.has(ot.id)){const mt=Y7(ot.data);if(mt&&Y.current.has(mt)){Ce++;continue}mt&&Y.current.add(mt),pt.set(ot.id,{packet:ot,attempts:0,lastAttemptLength:0,status:"pending"}),bt=!0}return bt?(V.current=pt,pt):Ge}),Ce>0&&X(Ge=>Ge+Ce)},[pe.length]),R.useEffect(()=>{V.current=C},[C]),R.useEffect(()=>{ne.current=f},[f]),R.useEffect(()=>{q.current=a},[a]),R.useEffect(()=>{B.current=g},[g]),R.useEffect(()=>{Q.current=A},[A]),R.useEffect(()=>{G.current=new Set(pe.map(Ce=>Ce.id))},[pe]),R.useEffect(()=>{r==null||r(s)},[s,r]);const ve=Array.from(C.values()).filter(Ce=>Ce.status==="pending").length,xe=Array.from(C.values()).filter(Ce=>Ce.status==="cracked").length,ye=Array.from(C.values()).filter(Ce=>Ce.status==="failed").length,Pe=R.useCallback(async()=>{if(ie.current||!$.current||!le.current)return;const Ce=V.current;let Ge=null,pt=null;for(const[et,tt]of Ce.entries())if(tt.status==="pending"){Ge=tt,pt=et;break}if(!Ge&&ne.current){const et=Array.from(Ce.entries()).filter(([,tt])=>tt.status==="failed"&&tt.lastAttemptLength<10);et.length>0&&(et.sort((tt,at)=>tt[1].lastAttemptLength-at[1].lastAttemptLength),[pt,Ge]=et[0])}if(!Ge||pt===null){le.current&&setTimeout(()=>Pe(),1e3);return}if(!G.current.has(pt)){T(et=>{const tt=new Map(et);return tt.delete(pt),tt}),le.current&&setTimeout(()=>Pe(),10);return}ie.current=!0;const bt=q.current,ot=Ge.lastAttemptLength>0,mt=ot?Ge.lastAttemptLength+1:bt;try{const et=await $.current.crack(Ge.packet.data,{maxLength:mt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...Q.current&&{gpuDispatchMs:1e4},...ot&&{useDictionary:!1,startingLength:mt}},tt=>{w(tt)});if(Z.current){Z.current=!1,ie.current=!1,w(null);return}if(et.found&&et.roomName&&et.key){T(qe=>{const Dt=new Map(qe),Jt=Dt.get(pt);return Jt&&Dt.set(pt,{...Jt,status:"cracked",attempts:Jt.attempts+1,lastAttemptLength:mt}),Dt});const tt={roomName:et.roomName,key:et.key,packetId:pt,message:et.decryptedMessage||"",crackedAt:Date.now()};D(qe=>[...qe,tt]);const at=et.key.toUpperCase();if(!ue.has(at))try{const qe="#"+et.roomName;await t(qe,et.key),B.current&&await dt.decryptHistoricalPackets({key_type:"channel",channel_name:qe})}catch(qe){console.error("Failed to create channel or decrypt historical:",qe),kt.error("Failed to save cracked channel",{description:qe instanceof Error?qe.message:"Channel discovered but could not be saved"})}}else T(tt=>{const at=new Map(tt),qe=at.get(pt);return qe&&at.set(pt,{...qe,status:"failed",attempts:qe.attempts+1,lastAttemptLength:mt}),at})}catch(et){console.error("Cracking error:",et),T(tt=>{const at=new Map(tt),qe=at.get(pt);return qe&&at.set(pt,{...qe,status:"failed",attempts:qe.attempts+1,lastAttemptLength:mt}),at})}ie.current=!1,w(null),le.current&&setTimeout(()=>Pe(),100)},[ue,t]),Ke=()=>{var Ce;if(!z){kt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}o(!0),le.current=!0,Z.current=!1,(Ce=ee.current)==null||Ce.enable(),Pe()},nt=()=>{var Ce,Ge;o(!1),le.current=!1,Z.current=!0,(Ce=$.current)==null||Ce.abort(),(Ge=ee.current)==null||
Line truncated
|
||||
//# sourceMappingURL=index-DEJuRmNA.js.map
|
||||
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return Xx=i,Xx}var X7=G7();const K7=Rc(X7);function Y7(n){if(n.length<4)return null;try{const t=parseInt(n.slice(0,2),16)&3;let r=2;if(t===0||t===3){if(n.length<r+8)return null;r+=8}if(n.length<r+2)return null;const i=parseInt(n.slice(r,r+2),16);r+=2;const s=i*2;return n.length<r+s?null:(r+=s,n.slice(r))}catch{return null}}function J7({packets:n,channels:e,onChannelCreate:t,onRunningChange:r,visible:i=!1}){const[s,o]=R.useState(!1),[a,u]=R.useState(6),[f,p]=R.useState(!1),[g,x]=R.useState(!0),[A,_]=R.useState(!1),[b,w]=R.useState(null),[C,T]=R.useState(new Map),[E,D]=R.useState([]),[N,F]=R.useState(!1),[z,I]=R.useState(null),[K,W]=R.useState(null),[U,X]=R.useState(0),$=R.useRef(null),ee=R.useRef(null),le=R.useRef(!1),Z=R.useRef(!1),ie=R.useRef(!1),V=R.useRef(new Map),ne=R.useRef(!1),q=R.useRef(6),B=R.useRef(!0),Q=R.useRef(!1),G=R.useRef(new Set),Y=R.useRef(new Set);R.useEffect(()=>{const Ce=new U7;$.current=Ce,I(Ce.isGpuAvailable());const Ge=new K7;return ee.current=Ge,()=>{Ce.destroy(),$.current=null,Ge.disable(),ee.current=null}},[]),R.useEffect(()=>{!i||N||B7(async()=>{const{ENGLISH_WORDLIST:Ce}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Ce}},[]).then(({ENGLISH_WORDLIST:Ce})=>{$.current&&($.current.setWordlist(Ce),F(!0))}).catch(Ce=>{console.error("Failed to load wordlist:",Ce),kt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[i,N]),R.useEffect(()=>{const Ce=()=>{dt.getUndecryptedPacketCount().then(({count:pt})=>W(pt)).catch(()=>W(null))};Ce();const Ge=setInterval(Ce,36e5);return()=>clearInterval(Ge)},[]);const ue=R.useMemo(()=>new Set(e.map(Ce=>Ce.key.toUpperCase())),[e]),pe=n.filter(Ce=>Ce.payload_type==="GROUP_TEXT"&&!Ce.decrypted);R.useEffect(()=>{let Ce=0;T(Ge=>{const pt=new Map(Ge);let bt=!1;for(const ot of pe)if(!pt.has(ot.id)){const mt=Y7(ot.data);if(mt&&Y.current.has(mt)){Ce++;continue}mt&&Y.current.add(mt),pt.set(ot.id,{packet:ot,attempts:0,lastAttemptLength:0,status:"pending"}),bt=!0}return bt?(V.current=pt,pt):Ge}),Ce>0&&X(Ge=>Ge+Ce)},[pe.length]),R.useEffect(()=>{V.current=C},[C]),R.useEffect(()=>{ne.current=f},[f]),R.useEffect(()=>{q.current=a},[a]),R.useEffect(()=>{B.current=g},[g]),R.useEffect(()=>{Q.current=A},[A]),R.useEffect(()=>{G.current=new Set(pe.map(Ce=>Ce.id))},[pe]),R.useEffect(()=>{r==null||r(s)},[s,r]);const ve=Array.from(C.values()).filter(Ce=>Ce.status==="pending").length,xe=Array.from(C.values()).filter(Ce=>Ce.status==="cracked").length,ye=Array.from(C.values()).filter(Ce=>Ce.status==="failed").length,Pe=R.useCallback(async()=>{if(ie.current||!$.current||!le.current)return;const Ce=V.current;let Ge=null,pt=null;for(const[et,tt]of Ce.entries())if(tt.status==="pending"){Ge=tt,pt=et;break}if(!Ge&&ne.current){const et=Array.from(Ce.entries()).filter(([,tt])=>tt.status==="failed"&&tt.lastAttemptLength<10);et.length>0&&(et.sort((tt,at)=>tt[1].lastAttemptLength-at[1].lastAttemptLength),[pt,Ge]=et[0])}if(!Ge||pt===null){le.current&&setTimeout(()=>Pe(),1e3);return}if(!G.current.has(pt)){T(et=>{const tt=new Map(et);return tt.delete(pt),tt}),le.current&&setTimeout(()=>Pe(),10);return}ie.current=!0;const bt=q.current,ot=Ge.lastAttemptLength>0,mt=ot?Ge.lastAttemptLength+1:bt;try{const et=await $.current.crack(Ge.packet.data,{maxLength:mt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...Q.current&&{gpuDispatchMs:1e4},...ot&&{useDictionary:!1,startingLength:mt}},tt=>{w(tt)});if(Z.current){Z.current=!1,ie.current=!1,w(null);return}if(et.found&&et.roomName&&et.key){T(qe=>{const Dt=new Map(qe),Jt=Dt.get(pt);return Jt&&Dt.set(pt,{...Jt,status:"cracked",attempts:Jt.attempts+1,lastAttemptLength:mt}),Dt});const tt={roomName:et.roomName,key:et.key,packetId:pt,message:et.decryptedMessage||"",crackedAt:Date.now()};D(qe=>[...qe,tt]);const at=et.key.toUpperCase();if(!ue.has(at))try{const qe="#"+et.roomName;await t(qe,et.key),B.current&&await dt.decryptHistoricalPackets({key_type:"channel",channel_name:qe})}catch(qe){console.error("Failed to create channel or decrypt historical:",qe),kt.error("Failed to save cracked channel",{description:qe instanceof Error?qe.message:"Channel discovered but could not be saved"})}}else T(tt=>{const at=new Map(tt),qe=at.get(pt);return qe&&at.set(pt,{...qe,status:"failed",attempts:qe.attempts+1,lastAttemptLength:mt}),at})}catch(et){console.error("Cracking error:",et),T(tt=>{const at=new Map(tt),qe=at.get(pt);return qe&&at.set(pt,{...qe,status:"failed",attempts:qe.attempts+1,lastAttemptLength:mt}),at})}ie.current=!1,w(null),le.current&&setTimeout(()=>Pe(),100)},[ue,t]),Ke=()=>{var Ce;if(!z){kt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}o(!0),le.current=!0,Z.current=!1,(Ce=ee.current)==null||Ce.enable(),Pe()},nt=()=>{var Ce,Ge;o(!1),le.current=!1,Z.current=!0,(Ce=$.current)==null||Ce.abort(),(Ge=ee.current)==null||
Line truncated
|
||||
//# sourceMappingURL=index-DGSv1YM9.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAACG,EAAE,UAAU,iBAAiB,GACnQA,EAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,GAAG,EAAEA,EAAE,UAAUH,EAAE,UAAU,SAASI,EAAER,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAAC,IAAIQ,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEN,EAAEO,EAAEL,EAAE,SAAS,EAAEK,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEd,EAAEK,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGpB,GAAGA,EAAE,aAAa,IAAIe,KAAKI,GAAEnB,EAAE,aAAamB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS5B,EAAE,KAAKa,EAAE,IAAIiB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,EAAEtB,EAAEK,EAAE,CAAC,MAAM,CAAC,SAASlB,EAAE,KAAKa,EAAE,KAAK,IAAIK,EAAE,IAAIL,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASuB,EAAEvB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASqC,EAAOxB,EAAE,CAAC,IAAIK,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIL,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOK,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIyB,EAAE,OAAO,SAASC,EAAE1B,EAAEK,EAAE,CAAC,OAAiB,OAAOL,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYwB,EAAO,GAAGxB,EAAE,GAAG,EAAEK,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,GAAE3B,EAAEK,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOjB,GAAmBiB,KAAd,aAA6BA,KAAZ,aAAcjB,EAAE,MAAK,IAAIkB,GAAE,GAAG,GAAUlB,IAAP,KAASkB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOlB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE8B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAElB,EAAEgB,GAAEA,GAAEE,EAAC,EAAElB,EAAOe,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASN,GAAN,OAAUM,EAAEN,EAAE,QAAQyB,EAAE,KAAK,EAAE,KAAKE,GAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASN,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASgB,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,EAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,EAAE,KAAK,EAAE,KAAKzB,CAAC,GAAGK,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAEV,CAAC,EAAE,QAAQmB,GAAE,EAAEA,GAAEnB,EAAE,OAAOmB,KAAI,CAACF,GACrfjB,EAAEmB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAErB,EAAEC,CAAC,EAAe,OAAOoB,IAApB,WAAsB,IAAIpB,EAAEoB,GAAE,KAAKpB,CAAC,EAAEmB,GAAE,EAAE,EAAEF,GAAEjB,EAAE,KAAI,GAAI,MAAMiB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,GAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOL,CAAC,EAAE,MAAM,mDAAuEK,IAApB,kBAAsB,qBAAqB,OAAO,KAAKL,CAAC,EAAE,KAAK,IAAI,EAAE,IAAIK,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE5B,EAAEK,EAAEC,EAAE,CAAC,GAASN,GAAN,KAAQ,OAAOA,EAAE,IAAIe,EAAE,GAAGC,GAAE,EAAE,OAAAW,GAAE3B,EAAEe,EAAE,GAAG,GAAG,SAASf,GAAE,CAAC,OAAOK,EAAE,KAAKC,EAAEN,GAAEgB,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,EAAE7B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAIK,EAAEL,EAAE,QAAQK,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,EAAE,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,CAAC,EAAOL,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAE,CAAC,GAAOL,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI8B,GAAE,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBD,GAAE,wBAAwB,EAAE,kBAAkBlB,CAAC,EAAE,SAASoB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIL,GAAE,QAAQ,SAAS5B,EAAEK,EAAEC,EAAE,CAACsB,GAAE5B,EAAE,UAAU,CAACK,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASN,EAAE,CAAC,IAAIK,EAAE,EAAE,OAAAuB,GAAE5B,EAAE,UAAU,CAACK,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASL,EAAE,CAAC,OAAO4B,GAAE5B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACuB,EAAEvB,CAAC,EAAE,MALine truncated
|
||||
Vendored
+2
-2
@@ -13,8 +13,8 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<script type="module" crossorigin src="/assets/index-DEJuRmNA.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CgLxtL22.css">
|
||||
<script type="module" crossorigin src="/assets/index-DGSv1YM9.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C2JfQbTz.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -77,7 +77,7 @@ export function SettingsModal({
|
||||
onRefreshAppSettings,
|
||||
}: SettingsModalProps) {
|
||||
// Tab state
|
||||
type SettingsTab = 'radio' | 'identity' | 'serial' | 'database' | 'advertise' | 'bot';
|
||||
type SettingsTab = 'radio' | 'identity' | 'serial' | 'database' | 'bot';
|
||||
const [activeTab, setActiveTab] = useState<SettingsTab>('radio');
|
||||
|
||||
// Radio config state
|
||||
@@ -475,7 +475,6 @@ export function SettingsModal({
|
||||
'Manage radio name, public key, private key, and advertising settings'}
|
||||
{activeTab === 'serial' && 'View serial port connection and configure contact sync'}
|
||||
{activeTab === 'database' && 'View database statistics and clean up old packets'}
|
||||
{activeTab === 'advertise' && 'Send a flood advertisement to announce your presence'}
|
||||
{activeTab === 'bot' && 'Configure automatic message bot with Python code'}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
@@ -488,12 +487,11 @@ export function SettingsModal({
|
||||
onValueChange={(v) => setActiveTab(v as SettingsTab)}
|
||||
className="w-full"
|
||||
>
|
||||
<TabsList className="grid w-full grid-cols-6">
|
||||
<TabsList className="grid w-full grid-cols-5">
|
||||
<TabsTrigger value="radio">Radio</TabsTrigger>
|
||||
<TabsTrigger value="identity">Identity</TabsTrigger>
|
||||
<TabsTrigger value="serial">Serial</TabsTrigger>
|
||||
<TabsTrigger value="database">Database</TabsTrigger>
|
||||
<TabsTrigger value="advertise">Advertise</TabsTrigger>
|
||||
<TabsTrigger value="bot">Bot</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
@@ -859,26 +857,6 @@ export function SettingsModal({
|
||||
</Button>
|
||||
</TabsContent>
|
||||
|
||||
{/* Advertise Tab */}
|
||||
<TabsContent value="advertise" className="space-y-4 mt-4">
|
||||
<div className="text-center py-8">
|
||||
<p className="text-muted-foreground mb-6">
|
||||
Send a flood advertisement to announce your presence on the mesh network.
|
||||
</p>
|
||||
<Button
|
||||
size="lg"
|
||||
onClick={handleAdvertise}
|
||||
disabled={advertising || !health?.radio_connected}
|
||||
className="bg-green-600 hover:bg-green-700 text-white px-12 py-6 text-lg"
|
||||
>
|
||||
{advertising ? 'Sending...' : 'Send Advertisement'}
|
||||
</Button>
|
||||
{!health?.radio_connected && (
|
||||
<p className="text-sm text-destructive mt-4">Radio not connected</p>
|
||||
)}
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Bot Tab */}
|
||||
<TabsContent value="bot" className="space-y-4 mt-4">
|
||||
<div className="p-3 bg-red-500/10 border border-red-500/30 rounded-md">
|
||||
|
||||
Reference in new issue
Block a user