@mmmbuto/nexuscrew 0.8.52-rc.7 → 0.8.52-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
`+g[L].replace(" at new "," at ");return i.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",i.displayName)),J}while(1<=L&&0<=Y);break}}}finally{K=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?M(i):""}function le(i){switch(i.tag){case 5:return M(i.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return i=ne(i.type,!1),i;case 11:return i=ne(i.type.render,!1),i;case 1:return i=ne(i.type,!0),i;default:return""}}function fe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case z:return"Fragment";case G:return"Portal";case X:return"Profiler";case Z:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case Q:return(i._context.displayName||"Context")+".Provider";case I:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return r=i.displayName||null,r!==null?r:fe(i.type)||"Memo";case $:r=i._payload,i=i._init;try{return fe(i(r))}catch{}}return null}function ge(i){var r=i.type;switch(i.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=r.render,i=i.displayName||i.name||"",r.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(r);case 8:return r===Z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function pe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function we(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function He(i){var r=we(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),d=""+i[r];if(!i.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,_=l.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return g.call(this)},set:function(L){d=""+L,_.call(this,L)}}),Object.defineProperty(i,r,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(L){d=""+L},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function ht(i){i._valueTracker||(i._valueTracker=He(i))}function Ye(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return i&&(d=we(i)?i.checked?"true":"false":i.value),i=d,i!==l?(r.setValue(i),!0):!1}function Ae(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ne(i,r){var l=r.checked;return B({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function ut(i,r){var l=r.defaultValue==null?"":r.defaultValue,d=r.checked!=null?r.checked:r.defaultChecked;l=pe(r.value!=null?r.value:l),i._wrapperState={initialChecked:d,initialValue:l,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Pe(i,r){r=r.checked,r!=null&&F(i,"checked",r,!1)}function Ut(i,r){Pe(i,r);var l=pe(r.value),d=r.type;if(l!=null)d==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(d==="submit"||d==="reset"){i.removeAttribute("value");return}r.hasOwnProperty("value")?Dt(i,r.type,l):r.hasOwnProperty("defaultValue")&&Dt(i,r.type,pe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(i.defaultChecked=!!r.defaultChecked)}function Rt(i,r,l){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var d=r.type;if(!(d!=="submit"&&d!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+i._wrapperState.initialValue,l||r===i.value||(i.value=r),i.defaultValue=r}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function Dt(i,r,l){(r!=="number"||Ae(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var vt=Array.isArray;function ft(i,r,l,d){if(i=i.options,r){r={};for(var g=0;g<l.length;g++)r["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=r.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&d&&(i[l].defaultSelected=!0)}else{for(l=""+pe(l),r=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,d&&(i[g].defaultSelected=!0);return}r!==null||i[g].disabled||(r=i[g])}r!==null&&(r.selected=!0)}}function dt(i,r){if(r.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},r,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function re(i,r){var l=r.value;if(l==null){if(l=r.children,r=r.defaultValue,l!=null){if(r!=null)throw Error(n(92));if(vt(l)){if(1<l.length)throw Error(n(93));l=l[0]}r=l}r==null&&(r=""),l=r}i._wrapperState={initialValue:pe(l)}}function xe(i,r){var l=pe(r.value),d=pe(r.defaultValue);l!=null&&(l=""+l,l!==i.value&&(i.value=l),r.defaultValue==null&&i.defaultValue!==l&&(i.defaultValue=l)),d!=null&&(i.defaultValue=""+d)}function Oe(i){var r=i.textContent;r===i._wrapperState.initialValue&&r!==""&&r!==null&&(i.value=r)}function Fe(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function de(i,r){return i==null||i==="http://www.w3.org/1999/xhtml"?Fe(r):i==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var ze,q=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,l,d,g){MSApp.execUnsafeLocalFunction(function(){return i(r,l,d,g)})}:i})(function(i,r){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=r;else{for(ze=ze||document.createElement("div"),ze.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=ze.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;r.firstChild;)i.appendChild(r.firstChild)}});function te(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var H={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ae=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(i){ae.forEach(function(r){r=r+i.charAt(0).toUpperCase()+i.substring(1),H[r]=H[i]})});function ce(i,r,l){return r==null||typeof r=="boolean"||r===""?"":l||typeof r!="number"||r===0||H.hasOwnProperty(i)&&H[i]?(""+r).trim():r+"px"}function me(i,r){i=i.style;for(var l in r)if(r.hasOwnProperty(l)){var d=l.indexOf("--")===0,g=ce(l,r[l],d);l==="float"&&(l="cssFloat"),d?i.setProperty(l,g):i[l]=g}}var Te=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _e(i,r){if(r){if(Te[i]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(n(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(n(61))}if(r.style!=null&&typeof r.style!="object")throw Error(n(62))}}function Ce(i,r){if(i.indexOf("-")===-1)return typeof r.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nt=null;function ot(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Je=null,Mt=null,lt=null;function et(i){if(i=po(i)){if(typeof Je!="function")throw Error(n(280));var r=i.stateNode;r&&(r=ja(r),Je(i.stateNode,i.type,r))}}function Zt(i){Mt?lt?lt.push(i):lt=[i]:Mt=i}function ni(){if(Mt){var i=Mt,r=lt;if(lt=Mt=null,et(i),r)for(i=0;i<r.length;i++)et(r[i])}}function Wn(i,r){return i(r)}function ui(){}var ue=!1;function je(i,r,l){if(ue)return i(r,l);ue=!0;try{return Wn(i,r,l)}finally{ue=!1,(Mt!==null||lt!==null)&&(ui(),ni())}}function qe(i,r){var l=i.stateNode;if(l===null)return null;var d=ja(l);if(d===null)return null;l=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(n(231,r,typeof l));return l}var pt=!1;if(h)try{var _t={};Object.defineProperty(_t,"passive",{get:function(){pt=!0}}),window.addEventListener("test",_t,_t),window.removeEventListener("test",_t,_t)}catch{pt=!1}function bs(i,r,l,d,g,_,L,Y,J){var oe=Array.prototype.slice.call(arguments,3);try{r.apply(l,oe)}catch(be){this.onError(be)}}var Ui=!1,Ss=null,xs=!1,di=null,Kn={onError:function(i){Ui=!0,Ss=i}};function Wr(i,r,l,d,g,_,L,Y,J){Ui=!1,Ss=null,bs.apply(Kn,arguments)}function la(i,r,l,d,g,_,L,Y,J){if(Wr.apply(this,arguments),Ui){if(Ui){var oe=Ss;Ui=!1,Ss=null}else throw Error(n(198));xs||(xs=!0,di=oe)}}function zt(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function Kr(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function ks(i){if(zt(i)!==i)throw Error(n(188))}function Cs(i){var r=i.alternate;if(!r){if(r=zt(i),r===null)throw Error(n(188));return r!==i?null:i}for(var l=i,d=r;;){var g=l.return;if(g===null)break;var _=g.alternate;if(_===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===_.child){for(_=g.child;_;){if(_===l)return ks(g),i;if(_===d)return ks(g),r;_=_.sibling}throw Error(n(188))}if(l.return!==d.return)l=g,d=_;else{for(var L=!1,Y=g.child;Y;){if(Y===l){L=!0,l=g,d=_;break}if(Y===d){L=!0,d=g,l=_;break}Y=Y.sibling}if(!L){for(Y=_.child;Y;){if(Y===l){L=!0,l=_,d=g;break}if(Y===d){L=!0,d=_,l=g;break}Y=Y.sibling}if(!L)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?i:r}function Es(i){return i=Cs(i),i!==null?qr(i):null}function qr(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var r=qr(i);if(r!==null)return r;i=i.sibling}return null}var Ns=t.unstable_scheduleCallback,Vr=t.unstable_cancelCallback,tr=t.unstable_shouldYield,ca=t.unstable_requestPaint,Et=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,yt=t.unstable_LowPriority,St=t.unstable_IdlePriority,Wt=null,en=null;function uc(i){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(Wt,i,void 0,(i.current.flags&128)===128)}catch{}}var Nn=Math.clz32?Math.clz32:Sb,Yr=Math.log,bb=Math.LN2;function Sb(i){return i>>>=0,i===0?32:31-(Yr(i)/bb|0)|0}var ua=64,da=4194304;function Gr(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ha(i,r){var l=i.pendingLanes;if(l===0)return 0;var d=0,g=i.suspendedLanes,_=i.pingedLanes,L=l&268435455;if(L!==0){var Y=L&~g;Y!==0?d=Gr(Y):(_&=L,_!==0&&(d=Gr(_)))}else L=l&~g,L!==0?d=Gr(L):_!==0&&(d=Gr(_));if(d===0)return 0;if(r!==0&&r!==d&&(r&g)===0&&(g=d&-d,_=r&-r,g>=_||g===16&&(_&4194240)!==0))return r;if((d&4)!==0&&(d|=l&16),r=i.entangledLanes,r!==0)for(i=i.entanglements,r&=d;0<r;)l=31-Nn(r),g=1<<l,d|=i[l],r&=~g;return d}function xb(i,r){switch(i){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kb(i,r){for(var l=i.suspendedLanes,d=i.pingedLanes,g=i.expirationTimes,_=i.pendingLanes;0<_;){var L=31-Nn(_),Y=1<<L,J=g[L];J===-1?((Y&l)===0||(Y&d)!==0)&&(g[L]=xb(Y,r)):J<=r&&(i.expiredLanes|=Y),_&=~Y}}function dc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function $f(){var i=ua;return ua<<=1,(ua&4194240)===0&&(ua=64),i}function hc(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Xr(i,r,l){i.pendingLanes|=r,r!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,r=31-Nn(r),i[r]=l}function Cb(i,r){var l=i.pendingLanes&~r;i.pendingLanes=r,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=r,i.mutableReadLanes&=r,i.entangledLanes&=r,r=i.entanglements;var d=i.eventTimes;for(i=i.expirationTimes;0<l;){var g=31-Nn(l),_=1<<g;r[g]=0,d[g]=-1,i[g]=-1,l&=~_}}function fc(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var d=31-Nn(l),g=1<<d;g&r|i[d]&r&&(i[d]|=r),l&=~g}}var mt=0;function Hf(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Uf,pc,Wf,Kf,qf,mc=!1,fa=[],Wi=null,Ki=null,qi=null,Qr=new Map,Jr=new Map,Vi=[],Eb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Vf(i,r){switch(i){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":Qr.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jr.delete(r.pointerId)}}function Zr(i,r,l,d,g,_){return i===null||i.nativeEvent!==_?(i={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:_,targetContainers:[g]},r!==null&&(r=po(r),r!==null&&pc(r)),i):(i.eventSystemFlags|=d,r=i.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),i)}function Nb(i,r,l,d,g){switch(r){case"focusin":return Wi=Zr(Wi,i,r,l,d,g),!0;case"dragenter":return Ki=Zr(Ki,i,r,l,d,g),!0;case"mouseover":return qi=Zr(qi,i,r,l,d,g),!0;case"pointerover":var _=g.pointerId;return Qr.set(_,Zr(Qr.get(_)||null,i,r,l,d,g)),!0;case"gotpointercapture":return _=g.pointerId,Jr.set(_,Zr(Jr.get(_)||null,i,r,l,d,g)),!0}return!1}function Yf(i){var r=js(i.target);if(r!==null){var l=zt(r);if(l!==null){if(r=l.tag,r===13){if(r=Kr(l),r!==null){i.blockedOn=r,qf(i.priority,function(){Wf(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function pa(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=vc(i.domEventName,i.eventSystemFlags,r[0],i.nativeEvent);if(l===null){l=i.nativeEvent;var d=new l.constructor(l.type,l);nt=d,l.target.dispatchEvent(d),nt=null}else return r=po(l),r!==null&&pc(r),i.blockedOn=l,!1;r.shift()}return!0}function Gf(i,r,l){pa(i)&&l.delete(r)}function jb(){mc=!1,Wi!==null&&pa(Wi)&&(Wi=null),Ki!==null&&pa(Ki)&&(Ki=null),qi!==null&&pa(qi)&&(qi=null),Qr.forEach(Gf),Jr.forEach(Gf)}function eo(i,r){i.blockedOn===r&&(i.blockedOn=null,mc||(mc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jb)))}function to(i){function r(g){return eo(g,i)}if(0<fa.length){eo(fa[0],i);for(var l=1;l<fa.length;l++){var d=fa[l];d.blockedOn===i&&(d.blockedOn=null)}}for(Wi!==null&&eo(Wi,i),Ki!==null&&eo(Ki,i),qi!==null&&eo(qi,i),Qr.forEach(r),Jr.forEach(r),l=0;l<Vi.length;l++)d=Vi[l],d.blockedOn===i&&(d.blockedOn=null);for(;0<Vi.length&&(l=Vi[0],l.blockedOn===null);)Yf(l),l.blockedOn===null&&Vi.shift()}var nr=D.ReactCurrentBatchConfig,ma=!0;function Rb(i,r,l,d){var g=mt,_=nr.transition;nr.transition=null;try{mt=1,gc(i,r,l,d)}finally{mt=g,nr.transition=_}}function Pb(i,r,l,d){var g=mt,_=nr.transition;nr.transition=null;try{mt=4,gc(i,r,l,d)}finally{mt=g,nr.transition=_}}function gc(i,r,l,d){if(ma){var g=vc(i,r,l,d);if(g===null)Dc(i,r,d,ga,l),Vf(i,d);else if(Nb(g,i,r,l,d))d.stopPropagation();else if(Vf(i,d),r&4&&-1<Eb.indexOf(i)){for(;g!==null;){var _=po(g);if(_!==null&&Uf(_),_=vc(i,r,l,d),_===null&&Dc(i,r,d,ga,l),_===g)break;g=_}g!==null&&d.stopPropagation()}else Dc(i,r,d,null,l)}}var ga=null;function vc(i,r,l,d){if(ga=null,i=ot(d),i=js(i),i!==null)if(r=zt(i),r===null)i=null;else if(l=r.tag,l===13){if(i=Kr(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null);return ga=i,null}function Xf(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(he()){case Ue:return 1;case Ge:return 4;case Ve:case yt:return 16;case St:return 536870912;default:return 16}default:return 16}}var Yi=null,_c=null,va=null;function Qf(){if(va)return va;var i,r=_c,l=r.length,d,g="value"in Yi?Yi.value:Yi.textContent,_=g.length;for(i=0;i<l&&r[i]===g[i];i++);var L=l-i;for(d=1;d<=L&&r[l-d]===g[_-d];d++);return va=g.slice(i,1<d?1-d:void 0)}function _a(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function ya(){return!0}function Jf(){return!1}function Mn(i){function r(l,d,g,_,L){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=_,this.target=L,this.currentTarget=null;for(var Y in i)i.hasOwnProperty(Y)&&(l=i[Y],this[Y]=l?l(_):_[Y]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ya:Jf,this.isPropagationStopped=Jf,this}return B(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ya)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),r}var ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yc=Mn(ir),no=B({},ir,{view:0,detail:0}),Lb=Mn(no),wc,bc,io,wa=B({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==io&&(io&&i.type==="mousemove"?(wc=i.screenX-io.screenX,bc=i.screenY-io.screenY):bc=wc=0,io=i),wc)},movementY:function(i){return"movementY"in i?i.movementY:bc}}),Zf=Mn(wa),Ab=B({},wa,{dataTransfer:0}),Tb=Mn(Ab),Db=B({},no,{relatedTarget:0}),Sc=Mn(Db),Mb=B({},ir,{animationName:0,elapsedTime:0,pseudoElement:0}),Ib=Mn(Mb),Ob=B({},ir,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Bb=Mn(Ob),zb=B({},ir,{data:0}),ep=Mn(zb),Fb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$b={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ub(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Hb[i])?!!r[i]:!1}function xc(){return Ub}var Wb=B({},no,{key:function(i){if(i.key){var r=Fb[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=_a(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?$b[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xc,charCode:function(i){return i.type==="keypress"?_a(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?_a(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Kb=Mn(Wb),qb=B({},wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tp=Mn(qb),Vb=B({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xc}),Yb=Mn(Vb),Gb=B({},ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xb=Mn(Gb),Qb=B({},wa,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Jb=Mn(Qb),Zb=[9,13,27,32],kc=h&&"CompositionEvent"in window,so=null;h&&"documentMode"in document&&(so=document.documentMode);var eS=h&&"TextEvent"in window&&!so,np=h&&(!kc||so&&8<so&&11>=so),ip=" ",sp=!1;function rp(i,r){switch(i){case"keyup":return Zb.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function op(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var sr=!1;function tS(i,r){switch(i){case"compositionend":return op(r);case"keypress":return r.which!==32?null:(sp=!0,ip);case"textInput":return i=r.data,i===ip&&sp?null:i;default:return null}}function nS(i,r){if(sr)return i==="compositionend"||!kc&&rp(i,r)?(i=Qf(),va=_c=Yi=null,sr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return np&&r.locale!=="ko"?null:r.data;default:return null}}var iS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ap(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!iS[i.type]:r==="textarea"}function lp(i,r,l,d){Zt(d),r=Ca(r,"onChange"),0<r.length&&(l=new yc("onChange","change",null,l,d),i.push({event:l,listeners:r}))}var ro=null,oo=null;function sS(i){Ep(i,0)}function ba(i){var r=cr(i);if(Ye(r))return i}function rS(i,r){if(i==="change")return r}var cp=!1;if(h){var Cc;if(h){var Ec="oninput"in document;if(!Ec){var up=document.createElement("div");up.setAttribute("oninput","return;"),Ec=typeof up.oninput=="function"}Cc=Ec}else Cc=!1;cp=Cc&&(!document.documentMode||9<document.documentMode)}function dp(){ro&&(ro.detachEvent("onpropertychange",hp),oo=ro=null)}function hp(i){if(i.propertyName==="value"&&ba(oo)){var r=[];lp(r,oo,i,ot(i)),je(sS,r)}}function oS(i,r,l){i==="focusin"?(dp(),ro=r,oo=l,ro.attachEvent("onpropertychange",hp)):i==="focusout"&&dp()}function aS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ba(oo)}function lS(i,r){if(i==="click")return ba(r)}function cS(i,r){if(i==="input"||i==="change")return ba(r)}function uS(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ii=typeof Object.is=="function"?Object.is:uS;function ao(i,r){if(ii(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!f.call(r,g)||!ii(i[g],r[g]))return!1}return!0}function fp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function pp(i,r){var l=fp(i);i=0;for(var d;l;){if(l.nodeType===3){if(d=i+l.textContent.length,i<=r&&d>=r)return{node:l,offset:r-i};i=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=fp(l)}}function mp(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?mp(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function gp(){for(var i=window,r=Ae();r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Ae(i.document)}return r}function Nc(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}function dS(i){var r=gp(),l=i.focusedElem,d=i.selectionRange;if(r!==l&&l&&l.ownerDocument&&mp(l.ownerDocument.documentElement,l)){if(d!==null&&Nc(l)){if(r=d.start,i=d.end,i===void 0&&(i=r),"selectionStart"in l)l.selectionStart=r,l.selectionEnd=Math.min(i,l.value.length);else if(i=(r=l.ownerDocument||document)&&r.defaultView||window,i.getSelection){i=i.getSelection();var g=l.textContent.length,_=Math.min(d.start,g);d=d.end===void 0?_:Math.min(d.end,g),!i.extend&&_>d&&(g=d,d=_,_=g),g=pp(l,_);var L=pp(l,d);g&&L&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==L.node||i.focusOffset!==L.offset)&&(r=r.createRange(),r.setStart(g.node,g.offset),i.removeAllRanges(),_>d?(i.addRange(r),i.extend(L.node,L.offset)):(r.setEnd(L.node,L.offset),i.addRange(r)))}}for(r=[],i=l;i=i.parentNode;)i.nodeType===1&&r.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<r.length;l++)i=r[l],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hS=h&&"documentMode"in document&&11>=document.documentMode,rr=null,jc=null,lo=null,Rc=!1;function vp(i,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Rc||rr==null||rr!==Ae(d)||(d=rr,"selectionStart"in d&&Nc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),lo&&ao(lo,d)||(lo=d,d=Ca(jc,"onSelect"),0<d.length&&(r=new yc("onSelect","select",null,r,l),i.push({event:r,listeners:d}),r.target=rr)))}function Sa(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var or={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},Pc={},_p={};h&&(_p=document.createElement("div").style,"AnimationEvent"in window||(delete or.animationend.animation,delete or.animationiteration.animation,delete or.animationstart.animation),"TransitionEvent"in window||delete or.transitionend.transition);function xa(i){if(Pc[i])return Pc[i];if(!or[i])return i;var r=or[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in _p)return Pc[i]=r[l];return i}var yp=xa("animationend"),wp=xa("animationiteration"),bp=xa("animationstart"),Sp=xa("transitionend"),xp=new Map,kp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Gi(i,r){xp.set(i,r),a(r,[i])}for(var Lc=0;Lc<kp.length;Lc++){var Ac=kp[Lc],fS=Ac.toLowerCase(),pS=Ac[0].toUpperCase()+Ac.slice(1);Gi(fS,"on"+pS)}Gi(yp,"onAnimationEnd"),Gi(wp,"onAnimationIteration"),Gi(bp,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(Sp,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mS=new Set("cancel close invalid load scroll toggle".split(" ").concat(co));function Cp(i,r,l){var d=i.type||"unknown-event";i.currentTarget=l,la(d,r,void 0,i),i.currentTarget=null}function Ep(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var d=i[l],g=d.event;d=d.listeners;e:{var _=void 0;if(r)for(var L=d.length-1;0<=L;L--){var Y=d[L],J=Y.instance,oe=Y.currentTarget;if(Y=Y.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,Y,oe),_=J}else for(L=0;L<d.length;L++){if(Y=d[L],J=Y.instance,oe=Y.currentTarget,Y=Y.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,Y,oe),_=J}}}if(xs)throw i=di,xs=!1,di=null,i}function xt(i,r){var l=r[Fc];l===void 0&&(l=r[Fc]=new Set);var d=i+"__bubble";l.has(d)||(Np(r,i,2,!1),l.add(d))}function Tc(i,r,l){var d=0;r&&(d|=4),Np(l,i,d,r)}var ka="_reactListening"+Math.random().toString(36).slice(2);function uo(i){if(!i[ka]){i[ka]=!0,s.forEach(function(l){l!=="selectionchange"&&(mS.has(l)||Tc(l,!1,i),Tc(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[ka]||(r[ka]=!0,Tc("selectionchange",!1,r))}}function Np(i,r,l,d){switch(Xf(r)){case 1:var g=Rb;break;case 4:g=Pb;break;default:g=gc}l=g.bind(null,r,l,i),g=void 0,!pt||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?i.addEventListener(r,l,{capture:!0,passive:g}):i.addEventListener(r,l,!0):g!==void 0?i.addEventListener(r,l,{passive:g}):i.addEventListener(r,l,!1)}function Dc(i,r,l,d,g){var _=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var L=d.tag;if(L===3||L===4){var Y=d.stateNode.containerInfo;if(Y===g||Y.nodeType===8&&Y.parentNode===g)break;if(L===4)for(L=d.return;L!==null;){var J=L.tag;if((J===3||J===4)&&(J=L.stateNode.containerInfo,J===g||J.nodeType===8&&J.parentNode===g))return;L=L.return}for(;Y!==null;){if(L=js(Y),L===null)return;if(J=L.tag,J===5||J===6){d=_=L;continue e}Y=Y.parentNode}}d=d.return}je(function(){var oe=_,be=ot(l),Se=[];e:{var ye=xp.get(i);if(ye!==void 0){var Le=yc,Ie=i;switch(i){case"keypress":if(_a(l)===0)break e;case"keydown":case"keyup":Le=Kb;break;case"focusin":Ie="focus",Le=Sc;break;case"focusout":Ie="blur",Le=Sc;break;case"beforeblur":case"afterblur":Le=Sc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Le=Zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Le=Tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Le=Yb;break;case yp:case wp:case bp:Le=Ib;break;case Sp:Le=Xb;break;case"scroll":Le=Lb;break;case"wheel":Le=Jb;break;case"copy":case"cut":case"paste":Le=Bb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Le=tp}var Be=(r&4)!==0,Ft=!Be&&i==="scroll",ie=Be?ye!==null?ye+"Capture":null:ye;Be=[];for(var ee=oe,se;ee!==null;){se=ee;var ke=se.stateNode;if(se.tag===5&&ke!==null&&(se=ke,ie!==null&&(ke=qe(ee,ie),ke!=null&&Be.push(ho(ee,ke,se)))),Ft)break;ee=ee.return}0<Be.length&&(ye=new Le(ye,Ie,null,l,be),Se.push({event:ye,listeners:Be}))}}if((r&7)===0){e:{if(ye=i==="mouseover"||i==="pointerover",Le=i==="mouseout"||i==="pointerout",ye&&l!==nt&&(Ie=l.relatedTarget||l.fromElement)&&(js(Ie)||Ie[ji]))break e;if((Le||ye)&&(ye=be.window===be?be:(ye=be.ownerDocument)?ye.defaultView||ye.parentWindow:window,Le?(Ie=l.relatedTarget||l.toElement,Le=oe,Ie=Ie?js(Ie):null,Ie!==null&&(Ft=zt(Ie),Ie!==Ft||Ie.tag!==5&&Ie.tag!==6)&&(Ie=null)):(Le=null,Ie=oe),Le!==Ie)){if(Be=Zf,ke="onMouseLeave",ie="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(Be=tp,ke="onPointerLeave",ie="onPointerEnter",ee="pointer"),Ft=Le==null?ye:cr(Le),se=Ie==null?ye:cr(Ie),ye=new Be(ke,ee+"leave",Le,l,be),ye.target=Ft,ye.relatedTarget=se,ke=null,js(be)===oe&&(Be=new Be(ie,ee+"enter",Ie,l,be),Be.target=se,Be.relatedTarget=Ft,ke=Be),Ft=ke,Le&&Ie)t:{for(Be=Le,ie=Ie,ee=0,se=Be;se;se=ar(se))ee++;for(se=0,ke=ie;ke;ke=ar(ke))se++;for(;0<ee-se;)Be=ar(Be),ee--;for(;0<se-ee;)ie=ar(ie),se--;for(;ee--;){if(Be===ie||ie!==null&&Be===ie.alternate)break t;Be=ar(Be),ie=ar(ie)}Be=null}else Be=null;Le!==null&&jp(Se,ye,Le,Be,!1),Ie!==null&&Ft!==null&&jp(Se,Ft,Ie,Be,!0)}}e:{if(ye=oe?cr(oe):window,Le=ye.nodeName&&ye.nodeName.toLowerCase(),Le==="select"||Le==="input"&&ye.type==="file")var $e=rS;else if(ap(ye))if(cp)$e=cS;else{$e=aS;var We=oS}else(Le=ye.nodeName)&&Le.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&($e=lS);if($e&&($e=$e(i,oe))){lp(Se,$e,l,be);break e}We&&We(i,ye,oe),i==="focusout"&&(We=ye._wrapperState)&&We.controlled&&ye.type==="number"&&Dt(ye,"number",ye.value)}switch(We=oe?cr(oe):window,i){case"focusin":(ap(We)||We.contentEditable==="true")&&(rr=We,jc=oe,lo=null);break;case"focusout":lo=jc=rr=null;break;case"mousedown":Rc=!0;break;case"contextmenu":case"mouseup":case"dragend":Rc=!1,vp(Se,l,be);break;case"selectionchange":if(hS)break;case"keydown":case"keyup":vp(Se,l,be)}var Ke;if(kc)e:{switch(i){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else sr?rp(i,l)&&(Xe="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Xe="onCompositionStart");Xe&&(np&&l.locale!=="ko"&&(sr||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&sr&&(Ke=Qf()):(Yi=be,_c="value"in Yi?Yi.value:Yi.textContent,sr=!0)),We=Ca(oe,Xe),0<We.length&&(Xe=new ep(Xe,i,null,l,be),Se.push({event:Xe,listeners:We}),Ke?Xe.data=Ke:(Ke=op(l),Ke!==null&&(Xe.data=Ke)))),(Ke=eS?tS(i,l):nS(i,l))&&(oe=Ca(oe,"onBeforeInput"),0<oe.length&&(be=new ep("onBeforeInput","beforeinput",null,l,be),Se.push({event:be,listeners:oe}),be.data=Ke))}Ep(Se,r)})}function ho(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Ca(i,r){for(var l=r+"Capture",d=[];i!==null;){var g=i,_=g.stateNode;g.tag===5&&_!==null&&(g=_,_=qe(i,l),_!=null&&d.unshift(ho(i,_,g)),_=qe(i,r),_!=null&&d.push(ho(i,_,g))),i=i.return}return d}function ar(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function jp(i,r,l,d,g){for(var _=r._reactName,L=[];l!==null&&l!==d;){var Y=l,J=Y.alternate,oe=Y.stateNode;if(J!==null&&J===d)break;Y.tag===5&&oe!==null&&(Y=oe,g?(J=qe(l,_),J!=null&&L.unshift(ho(l,J,Y))):g||(J=qe(l,_),J!=null&&L.push(ho(l,J,Y)))),l=l.return}L.length!==0&&i.push({event:r,listeners:L})}var gS=/\r\n?/g,vS=/\u0000|\uFFFD/g;function Rp(i){return(typeof i=="string"?i:""+i).replace(gS,`
|
|
38
38
|
`).replace(vS,"")}function Ea(i,r,l){if(r=Rp(r),Rp(i)!==r&&l)throw Error(n(425))}function Na(){}var Mc=null,Ic=null;function Oc(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Bc=typeof setTimeout=="function"?setTimeout:void 0,_S=typeof clearTimeout=="function"?clearTimeout:void 0,Pp=typeof Promise=="function"?Promise:void 0,yS=typeof queueMicrotask=="function"?queueMicrotask:typeof Pp<"u"?function(i){return Pp.resolve(null).then(i).catch(wS)}:Bc;function wS(i){setTimeout(function(){throw i})}function zc(i,r){var l=r,d=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"){if(d===0){i.removeChild(g),to(r);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=g}while(l);to(r)}function Xi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return i}function Lp(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"){if(r===0)return i;r--}else l==="/$"&&r++}i=i.previousSibling}return null}var lr=Math.random().toString(36).slice(2),hi="__reactFiber$"+lr,fo="__reactProps$"+lr,ji="__reactContainer$"+lr,Fc="__reactEvents$"+lr,bS="__reactListeners$"+lr,SS="__reactHandles$"+lr;function js(i){var r=i[hi];if(r)return r;for(var l=i.parentNode;l;){if(r=l[ji]||l[hi]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Lp(i);i!==null;){if(l=i[hi])return l;i=Lp(i)}return r}i=l,l=i.parentNode}return null}function po(i){return i=i[hi]||i[ji],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function cr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function ja(i){return i[fo]||null}var $c=[],ur=-1;function Qi(i){return{current:i}}function kt(i){0>ur||(i.current=$c[ur],$c[ur]=null,ur--)}function wt(i,r){ur++,$c[ur]=i.current,i.current=r}var Ji={},gn=Qi(Ji),jn=Qi(!1),Rs=Ji;function dr(i,r){var l=i.type.contextTypes;if(!l)return Ji;var d=i.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===r)return d.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in l)g[_]=r[_];return d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=r,i.__reactInternalMemoizedMaskedChildContext=g),g}function Rn(i){return i=i.childContextTypes,i!=null}function Ra(){kt(jn),kt(gn)}function Ap(i,r,l){if(gn.current!==Ji)throw Error(n(168));wt(gn,r),wt(jn,l)}function Tp(i,r,l){var d=i.stateNode;if(r=r.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var g in d)if(!(g in r))throw Error(n(108,ge(i)||"Unknown",g));return B({},l,d)}function Pa(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ji,Rs=gn.current,wt(gn,i),wt(jn,jn.current),!0}function Dp(i,r,l){var d=i.stateNode;if(!d)throw Error(n(169));l?(i=Tp(i,r,Rs),d.__reactInternalMemoizedMergedChildContext=i,kt(jn),kt(gn),wt(gn,i)):kt(jn),wt(jn,l)}var Ri=null,La=!1,Hc=!1;function Mp(i){Ri===null?Ri=[i]:Ri.push(i)}function xS(i){La=!0,Mp(i)}function Zi(){if(!Hc&&Ri!==null){Hc=!0;var i=0,r=mt;try{var l=Ri;for(mt=1;i<l.length;i++){var d=l[i];do d=d(!0);while(d!==null)}Ri=null,La=!1}catch(g){throw Ri!==null&&(Ri=Ri.slice(i+1)),Ns(Ue,Zi),g}finally{mt=r,Hc=!1}}return null}var hr=[],fr=0,Aa=null,Ta=0,qn=[],Vn=0,Ps=null,Pi=1,Li="";function Ls(i,r){hr[fr++]=Ta,hr[fr++]=Aa,Aa=i,Ta=r}function Ip(i,r,l){qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Ps=i;var d=Pi;i=Li;var g=32-Nn(d)-1;d&=~(1<<g),l+=1;var _=32-Nn(r)+g;if(30<_){var L=g-g%5;_=(d&(1<<L)-1).toString(32),d>>=L,g-=L,Pi=1<<32-Nn(r)+g|l<<g|d,Li=_+i}else Pi=1<<_|l<<g|d,Li=i}function Uc(i){i.return!==null&&(Ls(i,1),Ip(i,1,0))}function Wc(i){for(;i===Aa;)Aa=hr[--fr],hr[fr]=null,Ta=hr[--fr],hr[fr]=null;for(;i===Ps;)Ps=qn[--Vn],qn[Vn]=null,Li=qn[--Vn],qn[Vn]=null,Pi=qn[--Vn],qn[Vn]=null}var In=null,On=null,Nt=!1,si=null;function Op(i,r){var l=Qn(5,null,null,0);l.elementType="DELETED",l.stateNode=r,l.return=i,r=i.deletions,r===null?(i.deletions=[l],i.flags|=16):r.push(l)}function Bp(i,r){switch(i.tag){case 5:var l=i.type;return r=r.nodeType!==1||l.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(i.stateNode=r,In=i,On=Xi(r.firstChild),!0):!1;case 6:return r=i.pendingProps===""||r.nodeType!==3?null:r,r!==null?(i.stateNode=r,In=i,On=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(l=Ps!==null?{id:Pi,overflow:Li}:null,i.memoizedState={dehydrated:r,treeContext:l,retryLane:1073741824},l=Qn(18,null,null,0),l.stateNode=r,l.return=i,i.child=l,In=i,On=null,!0):!1;default:return!1}}function Kc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function qc(i){if(Nt){var r=On;if(r){var l=r;if(!Bp(i,r)){if(Kc(i))throw Error(n(418));r=Xi(l.nextSibling);var d=In;r&&Bp(i,r)?Op(d,l):(i.flags=i.flags&-4097|2,Nt=!1,In=i)}}else{if(Kc(i))throw Error(n(418));i.flags=i.flags&-4097|2,Nt=!1,In=i}}}function zp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;In=i}function Da(i){if(i!==In)return!1;if(!Nt)return zp(i),Nt=!0,!1;var r;if((r=i.tag!==3)&&!(r=i.tag!==5)&&(r=i.type,r=r!=="head"&&r!=="body"&&!Oc(i.type,i.memoizedProps)),r&&(r=On)){if(Kc(i))throw Fp(),Error(n(418));for(;r;)Op(i,r),r=Xi(r.nextSibling)}if(zp(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"){if(r===0){On=Xi(i.nextSibling);break e}r--}else l!=="$"&&l!=="$!"&&l!=="$?"||r++}i=i.nextSibling}On=null}}else On=In?Xi(i.stateNode.nextSibling):null;return!0}function Fp(){for(var i=On;i;)i=Xi(i.nextSibling)}function pr(){On=In=null,Nt=!1}function Vc(i){si===null?si=[i]:si.push(i)}var kS=D.ReactCurrentBatchConfig;function mo(i,r,l){if(i=l.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,i));var g=d,_=""+i;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===_?r.ref:(r=function(L){var Y=g.refs;L===null?delete Y[_]:Y[_]=L},r._stringRef=_,r)}if(typeof i!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,i))}return i}function Ma(i,r){throw i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i))}function $p(i){var r=i._init;return r(i._payload)}function Hp(i){function r(ie,ee){if(i){var se=ie.deletions;se===null?(ie.deletions=[ee],ie.flags|=16):se.push(ee)}}function l(ie,ee){if(!i)return null;for(;ee!==null;)r(ie,ee),ee=ee.sibling;return null}function d(ie,ee){for(ie=new Map;ee!==null;)ee.key!==null?ie.set(ee.key,ee):ie.set(ee.index,ee),ee=ee.sibling;return ie}function g(ie,ee){return ie=as(ie,ee),ie.index=0,ie.sibling=null,ie}function _(ie,ee,se){return ie.index=se,i?(se=ie.alternate,se!==null?(se=se.index,se<ee?(ie.flags|=2,ee):se):(ie.flags|=2,ee)):(ie.flags|=1048576,ee)}function L(ie){return i&&ie.alternate===null&&(ie.flags|=2),ie}function Y(ie,ee,se,ke){return ee===null||ee.tag!==6?(ee=Bu(se,ie.mode,ke),ee.return=ie,ee):(ee=g(ee,se),ee.return=ie,ee)}function J(ie,ee,se,ke){var $e=se.type;return $e===z?be(ie,ee,se.props.children,ke,se.key):ee!==null&&(ee.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===$&&$p($e)===ee.type)?(ke=g(ee,se.props),ke.ref=mo(ie,ee,se),ke.return=ie,ke):(ke=rl(se.type,se.key,se.props,null,ie.mode,ke),ke.ref=mo(ie,ee,se),ke.return=ie,ke)}function oe(ie,ee,se,ke){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=zu(se,ie.mode,ke),ee.return=ie,ee):(ee=g(ee,se.children||[]),ee.return=ie,ee)}function be(ie,ee,se,ke,$e){return ee===null||ee.tag!==7?(ee=zs(se,ie.mode,ke,$e),ee.return=ie,ee):(ee=g(ee,se),ee.return=ie,ee)}function Se(ie,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Bu(""+ee,ie.mode,se),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case V:return se=rl(ee.type,ee.key,ee.props,null,ie.mode,se),se.ref=mo(ie,null,ee),se.return=ie,se;case G:return ee=zu(ee,ie.mode,se),ee.return=ie,ee;case $:var ke=ee._init;return Se(ie,ke(ee._payload),se)}if(vt(ee)||W(ee))return ee=zs(ee,ie.mode,se,null),ee.return=ie,ee;Ma(ie,ee)}return null}function ye(ie,ee,se,ke){var $e=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return $e!==null?null:Y(ie,ee,""+se,ke);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case V:return se.key===$e?J(ie,ee,se,ke):null;case G:return se.key===$e?oe(ie,ee,se,ke):null;case $:return $e=se._init,ye(ie,ee,$e(se._payload),ke)}if(vt(se)||W(se))return $e!==null?null:be(ie,ee,se,ke,null);Ma(ie,se)}return null}function Le(ie,ee,se,ke,$e){if(typeof ke=="string"&&ke!==""||typeof ke=="number")return ie=ie.get(se)||null,Y(ee,ie,""+ke,$e);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case V:return ie=ie.get(ke.key===null?se:ke.key)||null,J(ee,ie,ke,$e);case G:return ie=ie.get(ke.key===null?se:ke.key)||null,oe(ee,ie,ke,$e);case $:var We=ke._init;return Le(ie,ee,se,We(ke._payload),$e)}if(vt(ke)||W(ke))return ie=ie.get(se)||null,be(ee,ie,ke,$e,null);Ma(ee,ke)}return null}function Ie(ie,ee,se,ke){for(var $e=null,We=null,Ke=ee,Xe=ee=0,sn=null;Ke!==null&&Xe<se.length;Xe++){Ke.index>Xe?(sn=Ke,Ke=null):sn=Ke.sibling;var ct=ye(ie,Ke,se[Xe],ke);if(ct===null){Ke===null&&(Ke=sn);break}i&&Ke&&ct.alternate===null&&r(ie,Ke),ee=_(ct,ee,Xe),We===null?$e=ct:We.sibling=ct,We=ct,Ke=sn}if(Xe===se.length)return l(ie,Ke),Nt&&Ls(ie,Xe),$e;if(Ke===null){for(;Xe<se.length;Xe++)Ke=Se(ie,se[Xe],ke),Ke!==null&&(ee=_(Ke,ee,Xe),We===null?$e=Ke:We.sibling=Ke,We=Ke);return Nt&&Ls(ie,Xe),$e}for(Ke=d(ie,Ke);Xe<se.length;Xe++)sn=Le(Ke,ie,Xe,se[Xe],ke),sn!==null&&(i&&sn.alternate!==null&&Ke.delete(sn.key===null?Xe:sn.key),ee=_(sn,ee,Xe),We===null?$e=sn:We.sibling=sn,We=sn);return i&&Ke.forEach(function(ls){return r(ie,ls)}),Nt&&Ls(ie,Xe),$e}function Be(ie,ee,se,ke){var $e=W(se);if(typeof $e!="function")throw Error(n(150));if(se=$e.call(se),se==null)throw Error(n(151));for(var We=$e=null,Ke=ee,Xe=ee=0,sn=null,ct=se.next();Ke!==null&&!ct.done;Xe++,ct=se.next()){Ke.index>Xe?(sn=Ke,Ke=null):sn=Ke.sibling;var ls=ye(ie,Ke,ct.value,ke);if(ls===null){Ke===null&&(Ke=sn);break}i&&Ke&&ls.alternate===null&&r(ie,Ke),ee=_(ls,ee,Xe),We===null?$e=ls:We.sibling=ls,We=ls,Ke=sn}if(ct.done)return l(ie,Ke),Nt&&Ls(ie,Xe),$e;if(Ke===null){for(;!ct.done;Xe++,ct=se.next())ct=Se(ie,ct.value,ke),ct!==null&&(ee=_(ct,ee,Xe),We===null?$e=ct:We.sibling=ct,We=ct);return Nt&&Ls(ie,Xe),$e}for(Ke=d(ie,Ke);!ct.done;Xe++,ct=se.next())ct=Le(Ke,ie,Xe,ct.value,ke),ct!==null&&(i&&ct.alternate!==null&&Ke.delete(ct.key===null?Xe:ct.key),ee=_(ct,ee,Xe),We===null?$e=ct:We.sibling=ct,We=ct);return i&&Ke.forEach(function(i0){return r(ie,i0)}),Nt&&Ls(ie,Xe),$e}function Ft(ie,ee,se,ke){if(typeof se=="object"&&se!==null&&se.type===z&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case V:e:{for(var $e=se.key,We=ee;We!==null;){if(We.key===$e){if($e=se.type,$e===z){if(We.tag===7){l(ie,We.sibling),ee=g(We,se.props.children),ee.return=ie,ie=ee;break e}}else if(We.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===$&&$p($e)===We.type){l(ie,We.sibling),ee=g(We,se.props),ee.ref=mo(ie,We,se),ee.return=ie,ie=ee;break e}l(ie,We);break}else r(ie,We);We=We.sibling}se.type===z?(ee=zs(se.props.children,ie.mode,ke,se.key),ee.return=ie,ie=ee):(ke=rl(se.type,se.key,se.props,null,ie.mode,ke),ke.ref=mo(ie,ee,se),ke.return=ie,ie=ke)}return L(ie);case G:e:{for(We=se.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){l(ie,ee.sibling),ee=g(ee,se.children||[]),ee.return=ie,ie=ee;break e}else{l(ie,ee);break}else r(ie,ee);ee=ee.sibling}ee=zu(se,ie.mode,ke),ee.return=ie,ie=ee}return L(ie);case $:return We=se._init,Ft(ie,ee,We(se._payload),ke)}if(vt(se))return Ie(ie,ee,se,ke);if(W(se))return Be(ie,ee,se,ke);Ma(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(l(ie,ee.sibling),ee=g(ee,se),ee.return=ie,ie=ee):(l(ie,ee),ee=Bu(se,ie.mode,ke),ee.return=ie,ie=ee),L(ie)):l(ie,ee)}return Ft}var mr=Hp(!0),Up=Hp(!1),Ia=Qi(null),Oa=null,gr=null,Yc=null;function Gc(){Yc=gr=Oa=null}function Xc(i){var r=Ia.current;kt(Ia),i._currentValue=r}function Qc(i,r,l){for(;i!==null;){var d=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),i===l)break;i=i.return}}function vr(i,r){Oa=i,Yc=gr=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&r)!==0&&(Pn=!0),i.firstContext=null)}function Yn(i){var r=i._currentValue;if(Yc!==i)if(i={context:i,memoizedValue:r,next:null},gr===null){if(Oa===null)throw Error(n(308));gr=i,Oa.dependencies={lanes:0,firstContext:i}}else gr=gr.next=i;return r}var As=null;function Jc(i){As===null?As=[i]:As.push(i)}function Wp(i,r,l,d){var g=r.interleaved;return g===null?(l.next=l,Jc(r)):(l.next=g.next,g.next=l),r.interleaved=l,Ai(i,d)}function Ai(i,r){i.lanes|=r;var l=i.alternate;for(l!==null&&(l.lanes|=r),l=i,i=i.return;i!==null;)i.childLanes|=r,l=i.alternate,l!==null&&(l.childLanes|=r),l=i,i=i.return;return l.tag===3?l.stateNode:null}var es=!1;function Zc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kp(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Ti(i,r){return{eventTime:i,lane:r,tag:0,payload:null,callback:null,next:null}}function ts(i,r,l){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(at&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,Ai(i,l)}return g=d.interleaved,g===null?(r.next=r,Jc(d)):(r.next=g.next,g.next=r),d.interleaved=r,Ai(i,l)}function Ba(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194240)!==0)){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,fc(i,l)}}function qp(i,r){var l=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var L={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};_===null?g=_=L:_=_.next=L,l=l.next}while(l!==null);_===null?g=_=r:_=_.next=r}else g=_=r;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:_,shared:d.shared,effects:d.effects},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}function za(i,r,l,d){var g=i.updateQueue;es=!1;var _=g.firstBaseUpdate,L=g.lastBaseUpdate,Y=g.shared.pending;if(Y!==null){g.shared.pending=null;var J=Y,oe=J.next;J.next=null,L===null?_=oe:L.next=oe,L=J;var be=i.alternate;be!==null&&(be=be.updateQueue,Y=be.lastBaseUpdate,Y!==L&&(Y===null?be.firstBaseUpdate=oe:Y.next=oe,be.lastBaseUpdate=J))}if(_!==null){var Se=g.baseState;L=0,be=oe=J=null,Y=_;do{var ye=Y.lane,Le=Y.eventTime;if((d&ye)===ye){be!==null&&(be=be.next={eventTime:Le,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ie=i,Be=Y;switch(ye=r,Le=l,Be.tag){case 1:if(Ie=Be.payload,typeof Ie=="function"){Se=Ie.call(Le,Se,ye);break e}Se=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Be.payload,ye=typeof Ie=="function"?Ie.call(Le,Se,ye):Ie,ye==null)break e;Se=B({},Se,ye);break e;case 2:es=!0}}Y.callback!==null&&Y.lane!==0&&(i.flags|=64,ye=g.effects,ye===null?g.effects=[Y]:ye.push(Y))}else Le={eventTime:Le,lane:ye,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},be===null?(oe=be=Le,J=Se):be=be.next=Le,L|=ye;if(Y=Y.next,Y===null){if(Y=g.shared.pending,Y===null)break;ye=Y,Y=ye.next,ye.next=null,g.lastBaseUpdate=ye,g.shared.pending=null}}while(!0);if(be===null&&(J=Se),g.baseState=J,g.firstBaseUpdate=oe,g.lastBaseUpdate=be,r=g.shared.interleaved,r!==null){g=r;do L|=g.lane,g=g.next;while(g!==r)}else _===null&&(g.shared.lanes=0);Ms|=L,i.lanes=L,i.memoizedState=Se}}function Vp(i,r,l){if(i=r.effects,r.effects=null,i!==null)for(r=0;r<i.length;r++){var d=i[r],g=d.callback;if(g!==null){if(d.callback=null,d=l,typeof g!="function")throw Error(n(191,g));g.call(d)}}}var go={},fi=Qi(go),vo=Qi(go),_o=Qi(go);function Ts(i){if(i===go)throw Error(n(174));return i}function eu(i,r){switch(wt(_o,r),wt(vo,i),wt(fi,go),i=r.nodeType,i){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:de(null,"");break;default:i=i===8?r.parentNode:r,r=i.namespaceURI||null,i=i.tagName,r=de(r,i)}kt(fi),wt(fi,r)}function _r(){kt(fi),kt(vo),kt(_o)}function Yp(i){Ts(_o.current);var r=Ts(fi.current),l=de(r,i.type);r!==l&&(wt(vo,i),wt(fi,l))}function tu(i){vo.current===i&&(kt(fi),kt(vo))}var Pt=Qi(0);function Fa(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var nu=[];function iu(){for(var i=0;i<nu.length;i++)nu[i]._workInProgressVersionPrimary=null;nu.length=0}var $a=D.ReactCurrentDispatcher,su=D.ReactCurrentBatchConfig,Ds=0,Lt=null,Yt=null,tn=null,Ha=!1,yo=!1,wo=0,CS=0;function vn(){throw Error(n(321))}function ru(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!ii(i[l],r[l]))return!1;return!0}function ou(i,r,l,d,g,_){if(Ds=_,Lt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,$a.current=i===null||i.memoizedState===null?RS:PS,i=l(d,g),yo){_=0;do{if(yo=!1,wo=0,25<=_)throw Error(n(301));_+=1,tn=Yt=null,r.updateQueue=null,$a.current=LS,i=l(d,g)}while(yo)}if($a.current=Ka,r=Yt!==null&&Yt.next!==null,Ds=0,tn=Yt=Lt=null,Ha=!1,r)throw Error(n(300));return i}function au(){var i=wo!==0;return wo=0,i}function pi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Lt.memoizedState=tn=i:tn=tn.next=i,tn}function Gn(){if(Yt===null){var i=Lt.alternate;i=i!==null?i.memoizedState:null}else i=Yt.next;var r=tn===null?Lt.memoizedState:tn.next;if(r!==null)tn=r,Yt=i;else{if(i===null)throw Error(n(310));Yt=i,i={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},tn===null?Lt.memoizedState=tn=i:tn=tn.next=i}return tn}function bo(i,r){return typeof r=="function"?r(i):r}function lu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=Yt,g=d.baseQueue,_=l.pending;if(_!==null){if(g!==null){var L=g.next;g.next=_.next,_.next=L}d.baseQueue=g=_,l.pending=null}if(g!==null){_=g.next,d=d.baseState;var Y=L=null,J=null,oe=_;do{var be=oe.lane;if((Ds&be)===be)J!==null&&(J=J.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),d=oe.hasEagerState?oe.eagerState:i(d,oe.action);else{var Se={lane:be,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};J===null?(Y=J=Se,L=d):J=J.next=Se,Lt.lanes|=be,Ms|=be}oe=oe.next}while(oe!==null&&oe!==_);J===null?L=d:J.next=Y,ii(d,r.memoizedState)||(Pn=!0),r.memoizedState=d,r.baseState=L,r.baseQueue=J,l.lastRenderedState=d}if(i=l.interleaved,i!==null){g=i;do _=g.lane,Lt.lanes|=_,Ms|=_,g=g.next;while(g!==i)}else g===null&&(l.lanes=0);return[r.memoizedState,l.dispatch]}function cu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=l.dispatch,g=l.pending,_=r.memoizedState;if(g!==null){l.pending=null;var L=g=g.next;do _=i(_,L.action),L=L.next;while(L!==g);ii(_,r.memoizedState)||(Pn=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),l.lastRenderedState=_}return[_,d]}function Gp(){}function Xp(i,r){var l=Lt,d=Gn(),g=r(),_=!ii(d.memoizedState,g);if(_&&(d.memoizedState=g,Pn=!0),d=d.queue,uu(Zp.bind(null,l,d,i),[i]),d.getSnapshot!==r||_||tn!==null&&tn.memoizedState.tag&1){if(l.flags|=2048,So(9,Jp.bind(null,l,d,g,r),void 0,null),nn===null)throw Error(n(349));(Ds&30)!==0||Qp(l,r,g)}return g}function Qp(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Lt.updateQueue,r===null?(r={lastEffect:null,stores:null},Lt.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function Jp(i,r,l,d){r.value=l,r.getSnapshot=d,em(r)&&tm(i)}function Zp(i,r,l){return l(function(){em(r)&&tm(i)})}function em(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!ii(i,l)}catch{return!0}}function tm(i){var r=Ai(i,1);r!==null&&li(r,i,1,-1)}function nm(i){var r=pi();return typeof i=="function"&&(i=i()),r.memoizedState=r.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:i},r.queue=i,i=i.dispatch=jS.bind(null,Lt,i),[r.memoizedState,i]}function So(i,r,l,d){return i={tag:i,create:r,destroy:l,deps:d,next:null},r=Lt.updateQueue,r===null?(r={lastEffect:null,stores:null},Lt.updateQueue=r,r.lastEffect=i.next=i):(l=r.lastEffect,l===null?r.lastEffect=i.next=i:(d=l.next,l.next=i,i.next=d,r.lastEffect=i)),i}function im(){return Gn().memoizedState}function Ua(i,r,l,d){var g=pi();Lt.flags|=i,g.memoizedState=So(1|r,l,void 0,d===void 0?null:d)}function Wa(i,r,l,d){var g=Gn();d=d===void 0?null:d;var _=void 0;if(Yt!==null){var L=Yt.memoizedState;if(_=L.destroy,d!==null&&ru(d,L.deps)){g.memoizedState=So(r,l,_,d);return}}Lt.flags|=i,g.memoizedState=So(1|r,l,_,d)}function sm(i,r){return Ua(8390656,8,i,r)}function uu(i,r){return Wa(2048,8,i,r)}function rm(i,r){return Wa(4,2,i,r)}function om(i,r){return Wa(4,4,i,r)}function am(i,r){if(typeof r=="function")return i=i(),r(i),function(){r(null)};if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function lm(i,r,l){return l=l!=null?l.concat([i]):null,Wa(4,4,am.bind(null,r,i),l)}function du(){}function cm(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ru(r,d[1])?d[0]:(l.memoizedState=[i,r],i)}function um(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ru(r,d[1])?d[0]:(i=i(),l.memoizedState=[i,r],i)}function dm(i,r,l){return(Ds&21)===0?(i.baseState&&(i.baseState=!1,Pn=!0),i.memoizedState=l):(ii(l,r)||(l=$f(),Lt.lanes|=l,Ms|=l,i.baseState=!0),r)}function ES(i,r){var l=mt;mt=l!==0&&4>l?l:4,i(!0);var d=su.transition;su.transition={};try{i(!1),r()}finally{mt=l,su.transition=d}}function hm(){return Gn().memoizedState}function NS(i,r,l){var d=rs(i);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},fm(i))pm(r,l);else if(l=Wp(i,r,l,d),l!==null){var g=Sn();li(l,i,d,g),mm(l,r,d)}}function jS(i,r,l){var d=rs(i),g={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(fm(i))pm(r,g);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var L=r.lastRenderedState,Y=_(L,l);if(g.hasEagerState=!0,g.eagerState=Y,ii(Y,L)){var J=r.interleaved;J===null?(g.next=g,Jc(r)):(g.next=J.next,J.next=g),r.interleaved=g;return}}catch{}finally{}l=Wp(i,r,g,d),l!==null&&(g=Sn(),li(l,i,d,g),mm(l,r,d))}}function fm(i){var r=i.alternate;return i===Lt||r!==null&&r===Lt}function pm(i,r){yo=Ha=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function mm(i,r,l){if((l&4194240)!==0){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,fc(i,l)}}var Ka={readContext:Yn,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},RS={readContext:Yn,useCallback:function(i,r){return pi().memoizedState=[i,r===void 0?null:r],i},useContext:Yn,useEffect:sm,useImperativeHandle:function(i,r,l){return l=l!=null?l.concat([i]):null,Ua(4194308,4,am.bind(null,r,i),l)},useLayoutEffect:function(i,r){return Ua(4194308,4,i,r)},useInsertionEffect:function(i,r){return Ua(4,2,i,r)},useMemo:function(i,r){var l=pi();return r=r===void 0?null:r,i=i(),l.memoizedState=[i,r],i},useReducer:function(i,r,l){var d=pi();return r=l!==void 0?l(r):r,d.memoizedState=d.baseState=r,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:r},d.queue=i,i=i.dispatch=NS.bind(null,Lt,i),[d.memoizedState,i]},useRef:function(i){var r=pi();return i={current:i},r.memoizedState=i},useState:nm,useDebugValue:du,useDeferredValue:function(i){return pi().memoizedState=i},useTransition:function(){var i=nm(!1),r=i[0];return i=ES.bind(null,i[1]),pi().memoizedState=i,[r,i]},useMutableSource:function(){},useSyncExternalStore:function(i,r,l){var d=Lt,g=pi();if(Nt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=r(),nn===null)throw Error(n(349));(Ds&30)!==0||Qp(d,r,l)}g.memoizedState=l;var _={value:l,getSnapshot:r};return g.queue=_,sm(Zp.bind(null,d,_,i),[i]),d.flags|=2048,So(9,Jp.bind(null,d,_,l,r),void 0,null),l},useId:function(){var i=pi(),r=nn.identifierPrefix;if(Nt){var l=Li,d=Pi;l=(d&~(1<<32-Nn(d)-1)).toString(32)+l,r=":"+r+"R"+l,l=wo++,0<l&&(r+="H"+l.toString(32)),r+=":"}else l=CS++,r=":"+r+"r"+l.toString(32)+":";return i.memoizedState=r},unstable_isNewReconciler:!1},PS={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:uu,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:lu,useRef:im,useState:function(){return lu(bo)},useDebugValue:du,useDeferredValue:function(i){var r=Gn();return dm(r,Yt.memoizedState,i)},useTransition:function(){var i=lu(bo)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1},LS={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:uu,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:cu,useRef:im,useState:function(){return cu(bo)},useDebugValue:du,useDeferredValue:function(i){var r=Gn();return Yt===null?r.memoizedState=i:dm(r,Yt.memoizedState,i)},useTransition:function(){var i=cu(bo)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1};function ri(i,r){if(i&&i.defaultProps){r=B({},r),i=i.defaultProps;for(var l in i)r[l]===void 0&&(r[l]=i[l]);return r}return r}function hu(i,r,l,d){r=i.memoizedState,l=l(d,r),l=l==null?r:B({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var qa={isMounted:function(i){return(i=i._reactInternals)?zt(i)===i:!1},enqueueSetState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.tag=1,_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=Sn(),d=rs(i),g=Ti(l,d);g.tag=2,r!=null&&(g.callback=r),r=ts(i,g,d),r!==null&&(li(r,i,d,l),Ba(r,i,d))}};function gm(i,r,l,d,g,_,L){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,_,L):r.prototype&&r.prototype.isPureReactComponent?!ao(l,d)||!ao(g,_):!0}function vm(i,r,l){var d=!1,g=Ji,_=r.contextType;return typeof _=="object"&&_!==null?_=Yn(_):(g=Rn(r)?Rs:gn.current,d=r.contextTypes,_=(d=d!=null)?dr(i,g):Ji),r=new r(l,_),i.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=qa,i.stateNode=r,r._reactInternals=i,d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=_),r}function _m(i,r,l,d){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==i&&qa.enqueueReplaceState(r,r.state,null)}function fu(i,r,l,d){var g=i.stateNode;g.props=l,g.state=i.memoizedState,g.refs={},Zc(i);var _=r.contextType;typeof _=="object"&&_!==null?g.context=Yn(_):(_=Rn(r)?Rs:gn.current,g.context=dr(i,_)),g.state=i.memoizedState,_=r.getDerivedStateFromProps,typeof _=="function"&&(hu(i,r,_,l),g.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(r=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),r!==g.state&&qa.enqueueReplaceState(g,g.state,null),za(i,l,g,d),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function yr(i,r){try{var l="",d=r;do l+=le(d),d=d.return;while(d);var g=l}catch(_){g=`
|
|
39
39
|
Error generating stack: `+_.message+`
|
|
40
|
-
`+_.stack}return{value:i,source:r,stack:g,digest:null}}function pu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function mu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Pu=d),mu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){mu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){mu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var L=r.stack;this.componentDidCatch(r.value,{componentStack:L!==null?L:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new AS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=qS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var TS=D.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=ou(i,r,l,d,_,g),l=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Nt&&l&&Uc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Ou(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var L=_.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(L,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(ao(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return gu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,wt(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,wt(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,wt(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function gu(i,r,l,d,g){var _=Rn(l)?Rs:gn.current;return _=dr(r,_),vr(r,g),l=ou(i,r,l,d,_,g),d=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Nt&&d&&Uc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),fu(r,l,d,g),d=!0;else if(i===null){var L=r.stateNode,Y=r.memoizedProps;L.props=Y;var J=L.context,oe=l.contextType;typeof oe=="object"&&oe!==null?oe=Yn(oe):(oe=Rn(l)?Rs:gn.current,oe=dr(r,oe));var be=l.getDerivedStateFromProps,Se=typeof be=="function"||typeof L.getSnapshotBeforeUpdate=="function";Se||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==d||J!==oe)&&_m(r,L,d,oe),es=!1;var ye=r.memoizedState;L.state=ye,za(r,d,L,g),J=r.memoizedState,Y!==d||ye!==J||jn.current||es?(typeof be=="function"&&(hu(r,l,be,d),J=r.memoizedState),(Y=es||gm(r,l,Y,d,ye,J,oe))?(Se||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(r.flags|=4194308)):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),L.props=d,L.state=J,L.context=oe,d=Y):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{L=r.stateNode,Kp(i,r),Y=r.memoizedProps,oe=r.type===r.elementType?Y:ri(r.type,Y),L.props=oe,Se=r.pendingProps,ye=L.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:gn.current,J=dr(r,J));var Le=l.getDerivedStateFromProps;(be=typeof Le=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==Se||ye!==J)&&_m(r,L,d,J),es=!1,ye=r.memoizedState,L.state=ye,za(r,d,L,g);var Ie=r.memoizedState;Y!==Se||ye!==Ie||jn.current||es?(typeof Le=="function"&&(hu(r,l,Le,d),Ie=r.memoizedState),(oe=es||gm(r,l,oe,d,ye,Ie,J)||!1)?(be||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(d,Ie,J),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(d,Ie,J)),typeof L.componentDidUpdate=="function"&&(r.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=Ie),L.props=d,L.state=Ie,L.context=J,d=oe):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),d=!1)}return vu(i,r,l,d,_,g)}function vu(i,r,l,d,g,_){jm(i,r);var L=(r.flags&128)!==0;if(!d&&!L)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,TS.current=r;var Y=L&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&L?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,Y,_)):bn(i,r,Y,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),eu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Vc(g),r.flags|=256,bn(i,r,l,d),r.child}var _u={dehydrated:null,treeContext:null,retryLane:0};function yu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=Pt.current,_=!1,L=(r.flags&128)!==0,Y;if((Y=L)||(Y=i!==null&&i.memoizedState===null?!1:(g&2)!==0),Y?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),wt(Pt,g&1),i===null)return qc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(L=d.children,i=d.fallback,_?(d=r.mode,_=r.child,L={mode:"hidden",children:L},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=L):_=ol(L,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=yu(l),r.memoizedState=_u,i):wu(r,L));if(g=i.memoizedState,g!==null&&(Y=g.dehydrated,Y!==null))return DS(i,r,L,d,Y,g,l);if(_){_=d.fallback,L=r.mode,g=i.child,Y=g.sibling;var J={mode:"hidden",children:d.children};return(L&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),Y!==null?_=as(Y,_):(_=zs(_,L,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,L=i.child.memoizedState,L=L===null?yu(l):{baseLanes:L.baseLanes|l,cachePool:null,transitions:L.transitions},_.memoizedState=L,_.childLanes=i.childLanes&~l,r.memoizedState=_u,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function wu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Vc(d),mr(r,i.child,null,l),i=wu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function DS(i,r,l,d,g,_,L){if(l)return r.flags&256?(r.flags&=-257,d=pu(Error(n(422))),Va(i,r,L,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,L,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,L),r.child.memoizedState=yu(L),r.memoizedState=_u,_);if((r.mode&1)===0)return Va(i,r,L,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var Y=d.dgst;return d=Y,_=Error(n(419)),d=pu(_,d,void 0),Va(i,r,L,d)}if(Y=(L&i.childLanes)!==0,Pn||Y){if(d=nn,d!==null){switch(L&-L){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|L))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Iu(),d=pu(Error(n(421))),Va(i,r,L,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=VS.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,Nt=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=wu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Qc(i.return,r,l)}function bu(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=Pt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(wt(Pt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),bu(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}bu(r,!0,l,null,_);break;case"together":bu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function MS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:eu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;wt(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(wt(Pt,Pt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(wt(Pt,Pt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);wt(Pt,Pt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),wt(Pt,Pt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,Su,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Su=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=Ne(i,g),d=Ne(i,d),_=[];break;case"select":g=B({},g,{value:void 0}),d=B({},d,{value:void 0}),_=[];break;case"textarea":g=dt(i,g),d=dt(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var L;l=null;for(oe in g)if(!d.hasOwnProperty(oe)&&g.hasOwnProperty(oe)&&g[oe]!=null)if(oe==="style"){var Y=g[oe];for(L in Y)Y.hasOwnProperty(L)&&(l||(l={}),l[L]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?_||(_=[]):(_=_||[]).push(oe,null));for(oe in d){var J=d[oe];if(Y=g!=null?g[oe]:void 0,d.hasOwnProperty(oe)&&J!==Y&&(J!=null||Y!=null))if(oe==="style")if(Y){for(L in Y)!Y.hasOwnProperty(L)||J&&J.hasOwnProperty(L)||(l||(l={}),l[L]="");for(L in J)J.hasOwnProperty(L)&&Y[L]!==J[L]&&(l||(l={}),l[L]=J[L])}else l||(_||(_=[]),_.push(oe,l)),l=J;else oe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,Y=Y?Y.__html:void 0,J!=null&&Y!==J&&(_=_||[]).push(oe,J)):oe==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(oe,""+J):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(J!=null&&oe==="onScroll"&&xt("scroll",i),_||Y===J||(_=[])):(_=_||[]).push(oe,J))}l&&(_=_||[]).push("style",l);var oe=_;(r.updateQueue=oe)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function xo(i,r){if(!Nt)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function _n(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function IS(i,r,l){var d=r.pendingProps;switch(Wc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _n(r),null;case 1:return Rn(r.type)&&Ra(),_n(r),null;case 3:return d=r.stateNode,_r(),kt(jn),kt(gn),iu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Tu(si),si=null))),Su(i,r),_n(r),null;case 5:tu(r);var g=Ts(_o.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return _n(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[fo]=_,i=(r.mode&1)!==0,l){case"dialog":xt("cancel",d),xt("close",d);break;case"iframe":case"object":case"embed":xt("load",d);break;case"video":case"audio":for(g=0;g<co.length;g++)xt(co[g],d);break;case"source":xt("error",d);break;case"img":case"image":case"link":xt("error",d),xt("load",d);break;case"details":xt("toggle",d);break;case"input":ut(d,_),xt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},xt("invalid",d);break;case"textarea":re(d,_),xt("invalid",d)}_e(l,_),g=null;for(var L in _)if(_.hasOwnProperty(L)){var Y=_[L];L==="children"?typeof Y=="string"?d.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",Y]):typeof Y=="number"&&d.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",""+Y]):o.hasOwnProperty(L)&&Y!=null&&L==="onScroll"&&xt("scroll",d)}switch(l){case"input":ht(d),Rt(d,_,!0);break;case"textarea":ht(d),Oe(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{L=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Fe(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=L.createElement(l,{is:d.is}):(i=L.createElement(l),l==="select"&&(L=i,d.multiple?L.multiple=!0:d.size&&(L.size=d.size))):i=L.createElementNS(i,l),i[hi]=r,i[fo]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(L=Ce(l,d),l){case"dialog":xt("cancel",i),xt("close",i),g=d;break;case"iframe":case"object":case"embed":xt("load",i),g=d;break;case"video":case"audio":for(g=0;g<co.length;g++)xt(co[g],i);g=d;break;case"source":xt("error",i),g=d;break;case"img":case"image":case"link":xt("error",i),xt("load",i),g=d;break;case"details":xt("toggle",i),g=d;break;case"input":ut(i,d),g=Ne(i,d),xt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=B({},d,{value:void 0}),xt("invalid",i);break;case"textarea":re(i,d),g=dt(i,d),xt("invalid",i);break;default:g=d}_e(l,g),Y=g;for(_ in Y)if(Y.hasOwnProperty(_)){var J=Y[_];_==="style"?me(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&q(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&xt("scroll",i):J!=null&&F(i,_,J,L))}switch(l){case"input":ht(i),Rt(i,d,!1);break;case"textarea":ht(i),Oe(i);break;case"option":d.value!=null&&i.setAttribute("value",""+pe(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?ft(i,!!d.multiple,_,!1):d.defaultValue!=null&&ft(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return _n(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(_o.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return _n(r),null;case 13:if(kt(Pt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Nt&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;_n(r),_=!1}else si!==null&&(Tu(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(Pt.current&1)!==0?Gt===0&&(Gt=3):Iu())),r.updateQueue!==null&&(r.flags|=4),_n(r),null);case 4:return _r(),Su(i,r),i===null&&uo(r.stateNode.containerInfo),_n(r),null;case 10:return Xc(r.type._context),_n(r),null;case 17:return Rn(r.type)&&Ra(),_n(r),null;case 19:if(kt(Pt),_=r.memoizedState,_===null)return _n(r),null;if(d=(r.flags&128)!==0,L=_.rendering,L===null)if(d)xo(_,!1);else{if(Gt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(L=Fa(i),L!==null){for(r.flags|=128,xo(_,!1),d=L.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,L=_.alternate,L===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=L.childLanes,_.lanes=L.lanes,_.child=L.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=L.memoizedProps,_.memoizedState=L.memoizedState,_.updateQueue=L.updateQueue,_.type=L.type,i=L.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return wt(Pt,Pt.current&1|2),r.child}i=i.sibling}_.tail!==null&&Et()>Sr&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(L),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),xo(_,!0),_.tail===null&&_.tailMode==="hidden"&&!L.alternate&&!Nt)return _n(r),null}else 2*Et()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304);_.isBackwards?(L.sibling=r.child,r.child=L):(l=_.last,l!==null?l.sibling=L:r.child=L,_.last=L)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=Et(),r.sibling=null,l=Pt.current,wt(Pt,d?l&1|2:l&1),r):(_n(r),null);case 22:case 23:return Mu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(_n(r),r.subtreeFlags&6&&(r.flags|=8192)):_n(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function OS(i,r){switch(Wc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),kt(jn),kt(gn),iu(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return tu(r),null;case 13:if(kt(Pt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return kt(Pt),null;case 4:return _r(),null;case 10:return Xc(r.type._context),null;case 22:case 23:return Mu(),null;case 24:return null;default:return null}}var Ga=!1,yn=!1,BS=typeof WeakSet=="function"?WeakSet:Set,De=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){It(i,r,d)}else l.current=null}function xu(i,r,l){try{l()}catch(d){It(i,r,d)}}var Bm=!1;function zS(i,r){if(Mc=ma,i=gp(),Nc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var L=0,Y=-1,J=-1,oe=0,be=0,Se=i,ye=null;t:for(;;){for(var Le;Se!==l||g!==0&&Se.nodeType!==3||(Y=L+g),Se!==_||d!==0&&Se.nodeType!==3||(J=L+d),Se.nodeType===3&&(L+=Se.nodeValue.length),(Le=Se.firstChild)!==null;)ye=Se,Se=Le;for(;;){if(Se===i)break t;if(ye===l&&++oe===g&&(Y=L),ye===_&&++be===d&&(J=L),(Le=Se.nextSibling)!==null)break;Se=ye,ye=Se.parentNode}Se=Le}l=Y===-1||J===-1?null:{start:Y,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ic={focusedElem:i,selectionRange:l},ma=!1,De=r;De!==null;)if(r=De,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,De=i;else for(;De!==null;){r=De;try{var Ie=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Be=Ie.memoizedProps,Ft=Ie.memoizedState,ie=r.stateNode,ee=ie.getSnapshotBeforeUpdate(r.elementType===r.type?Be:ri(r.type,Be),Ft);ie.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=r.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ke){It(r,r.return,ke)}if(i=r.sibling,i!==null){i.return=r.return,De=i;break}De=r.return}return Ie=Bm,Bm=!1,Ie}function ko(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&xu(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function ku(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[fo],delete r[Fc],delete r[bS],delete r[SS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Cu(i,r,l),i=i.sibling;i!==null;)Cu(i,r,l),i=i.sibling}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}var hn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Wt,l)}catch{}switch(l.tag){case 5:yn||wr(l,r);case 6:var d=hn,g=oi;hn=null,ns(i,r,l),hn=d,oi=g,hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):hn.removeChild(l.stateNode));break;case 18:hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?zc(i.parentNode,l):i.nodeType===1&&zc(i,l),to(i)):zc(hn,l.stateNode));break;case 4:d=hn,g=oi,hn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),hn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!yn&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,L=_.destroy;_=_.tag,L!==void 0&&((_&2)!==0||(_&4)!==0)&&xu(l,r,L),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!yn&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(Y){It(l,r,Y)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(yn=(d=yn)||l.memoizedState!==null,ns(i,r,l),yn=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new BS),r.forEach(function(d){var g=YS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 5:hn=Y.stateNode,oi=!1;break e;case 3:hn=Y.stateNode.containerInfo,oi=!0;break e;case 4:hn=Y.stateNode.containerInfo,oi=!0;break e}Y=Y.return}if(hn===null)throw Error(n(160));Hm(_,L,g),hn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(oe){It(g,r,oe)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{ko(3,i,i.return),Xa(3,i)}catch(Be){It(i,i.return,Be)}try{ko(5,i,i.return)}catch(Be){It(i,i.return,Be)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(Be){It(i,i.return,Be)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,L=l!==null?l.memoizedProps:_,Y=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&Pe(g,_),Ce(Y,L);var oe=Ce(Y,_);for(L=0;L<J.length;L+=2){var be=J[L],Se=J[L+1];be==="style"?me(g,Se):be==="dangerouslySetInnerHTML"?q(g,Se):be==="children"?te(g,Se):F(g,be,Se,oe)}switch(Y){case"input":Ut(g,_);break;case"textarea":xe(g,_);break;case"select":var ye=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Le=_.value;Le!=null?ft(g,!!_.multiple,Le,!1):ye!==!!_.multiple&&(_.defaultValue!=null?ft(g,!!_.multiple,_.defaultValue,!0):ft(g,!!_.multiple,_.multiple?[]:"",!1))}g[fo]=_}catch(Be){It(i,i.return,Be)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(Be){It(i,i.return,Be)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{to(r.containerInfo)}catch(Be){It(i,i.return,Be)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Ru=Et())),d&4&&Um(i);break;case 22:if(be=l!==null&&l.memoizedState!==null,i.mode&1?(yn=(oe=yn)||be,ai(r,i),yn=oe):ai(r,i),mi(i),d&8192){if(oe=i.memoizedState!==null,(i.stateNode.isHidden=oe)&&!be&&(i.mode&1)!==0)for(De=i,be=i.child;be!==null;){for(Se=De=be;De!==null;){switch(ye=De,Le=ye.child,ye.tag){case 0:case 11:case 14:case 15:ko(4,ye,ye.return);break;case 1:wr(ye,ye.return);var Ie=ye.stateNode;if(typeof Ie.componentWillUnmount=="function"){d=ye,l=ye.return;try{r=d,Ie.props=r.memoizedProps,Ie.state=r.memoizedState,Ie.componentWillUnmount()}catch(Be){It(d,l,Be)}}break;case 5:wr(ye,ye.return);break;case 22:if(ye.memoizedState!==null){Vm(Se);continue}}Le!==null?(Le.return=ye,De=Le):Vm(Se)}be=be.sibling}e:for(be=null,Se=i;;){if(Se.tag===5){if(be===null){be=Se;try{g=Se.stateNode,oe?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=Se.stateNode,J=Se.memoizedProps.style,L=J!=null&&J.hasOwnProperty("display")?J.display:null,Y.style.display=ce("display",L))}catch(Be){It(i,i.return,Be)}}}else if(Se.tag===6){if(be===null)try{Se.stateNode.nodeValue=oe?"":Se.memoizedProps}catch(Be){It(i,i.return,Be)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===i)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===i)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===i)break e;be===Se&&(be=null),Se=Se.return}be===Se&&(be=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Eu(i,_,g);break;case 3:case 4:var L=d.stateNode.containerInfo,Y=$m(i);Cu(i,Y,L);break;default:throw Error(n(161))}}catch(J){It(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function FS(i,r,l){De=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;De!==null;){var g=De,_=g.child;if(g.tag===22&&d){var L=g.memoizedState!==null||Ga;if(!L){var Y=g.alternate,J=Y!==null&&Y.memoizedState!==null||yn;Y=Ga;var oe=yn;if(Ga=L,(yn=J)&&!oe)for(De=g;De!==null;)L=De,J=L.child,L.tag===22&&L.memoizedState!==null?Ym(g):J!==null?(J.return=L,De=J):Ym(g);for(;_!==null;)De=_,Km(_),_=_.sibling;De=g,Ga=Y,yn=oe}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,De=_):qm(i)}}function qm(i){for(;De!==null;){var r=De;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:yn||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!yn)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var L=r.updateQueue;if(L!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,L,l)}break;case 5:var Y=r.stateNode;if(l===null&&r.flags&4){l=Y;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var oe=r.alternate;if(oe!==null){var be=oe.memoizedState;if(be!==null){var Se=be.dehydrated;Se!==null&&to(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||r.flags&512&&ku(r)}catch(ye){It(r,r.return,ye)}}if(r===i){De=null;break}if(l=r.sibling,l!==null){l.return=r.return,De=l;break}De=r.return}}function Vm(i){for(;De!==null;){var r=De;if(r===i){De=null;break}var l=r.sibling;if(l!==null){l.return=r.return,De=l;break}De=r.return}}function Ym(i){for(;De!==null;){var r=De;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){It(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){It(r,g,J)}}var _=r.return;try{ku(r)}catch(J){It(r,_,J)}break;case 5:var L=r.return;try{ku(r)}catch(J){It(r,L,J)}}}catch(J){It(r,r.return,J)}if(r===i){De=null;break}var Y=r.sibling;if(Y!==null){Y.return=r.return,De=Y;break}De=r.return}}var $S=Math.ceil,Qa=D.ReactCurrentDispatcher,Nu=D.ReactCurrentOwner,Xn=D.ReactCurrentBatchConfig,at=0,nn=null,Kt=null,fn=0,Bn=0,br=Qi(0),Gt=0,Co=null,Ms=0,Ja=0,ju=0,Eo=null,Ln=null,Ru=0,Sr=1/0,Mi=null,Za=!1,Pu=null,is=null,el=!1,ss=null,tl=0,No=0,Lu=null,nl=-1,il=0;function Sn(){return(at&6)!==0?Et():nl!==-1?nl:nl=Et()}function rs(i){return(i.mode&1)===0?1:(at&2)!==0&&fn!==0?fn&-fn:kS.transition!==null?(il===0&&(il=$f()),il):(i=mt,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<No)throw No=0,Lu=null,Error(n(185));Xr(i,l,d),((at&2)===0||i!==nn)&&(i===nn&&((at&2)===0&&(Ja|=l),Gt===4&&os(i,fn)),An(i,d),l===1&&at===0&&(r.mode&1)===0&&(Sr=Et()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;kb(i,r);var d=ha(i,i===nn?fn:0);if(d===0)l!==null&&Vr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Vr(l),r===1)i.tag===0?xS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),yS(function(){(at&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=Ue;break;case 4:l=Ge;break;case 16:l=Ve;break;case 536870912:l=St;break;default:l=Ve}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(at&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===nn?fn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=at;at|=2;var _=Jm();(nn!==i||fn!==r)&&(Mi=null,Sr=Et()+500,Os(i,r));do try{WS();break}catch(Y){Qm(i,Y)}while(!0);Gc(),Qa.current=_,at=g,Kt!==null?r=0:(nn=null,fn=0,r=Gt)}if(r!==0){if(r===2&&(g=dc(i),g!==0&&(d=g,r=Au(i,g))),r===1)throw l=Co,Os(i,0),os(i,d),An(i,Et()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!HS(g)&&(r=sl(i,d),r===2&&(_=dc(i),_!==0&&(d=_,r=Au(i,_))),r===1))throw l=Co,Os(i,0),os(i,d),An(i,Et()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Ru+500-Et(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var L=31-Nn(d);_=1<<L,L=r[L],L>g&&(g=L),d&=~_}if(d=g,d=Et()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*$S(d/1960))-d,10<d){i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,Et()),i.callbackNode===l?Gm.bind(null,i):null}function Au(i,r){var l=Eo;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Tu(r)),i}function Tu(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function HS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~ju,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((at&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,Et()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=dc(i);d!==0&&(r=d,l=Au(i,d))}if(l===1)throw l=Co,Os(i,0),os(i,r),An(i,Et()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,Et()),null}function Du(i,r){var l=at;at|=1;try{return i(r)}finally{at=l,at===0&&(Sr=Et()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(at&6)===0&&xr();var r=at;at|=1;var l=Xn.transition,d=mt;try{if(Xn.transition=null,mt=1,i)return i()}finally{mt=d,Xn.transition=l,at=r,(at&6)===0&&Zi()}}function Mu(){Bn=br.current,kt(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,_S(l)),Kt!==null)for(l=Kt.return;l!==null;){var d=l;switch(Wc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),kt(jn),kt(gn),iu();break;case 5:tu(d);break;case 4:_r();break;case 13:kt(Pt);break;case 19:kt(Pt);break;case 10:Xc(d.type._context);break;case 22:case 23:Mu()}l=l.return}if(nn=i,Kt=i=as(i.current,null),fn=Bn=r,Gt=0,Co=null,ju=Ja=Ms=0,Ln=Eo=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var L=_.next;_.next=g,d.next=L}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Kt;try{if(Gc(),$a.current=Ka,Ha){for(var d=Lt.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,tn=Yt=Lt=null,yo=!1,wo=0,Nu.current=null,l===null||l.return===null){Gt=1,Co=r,Kt=null;break}e:{var _=i,L=l.return,Y=l,J=r;if(r=fn,Y.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var oe=J,be=Y,Se=be.tag;if((be.mode&1)===0&&(Se===0||Se===11||Se===15)){var ye=be.alternate;ye?(be.updateQueue=ye.updateQueue,be.memoizedState=ye.memoizedState,be.lanes=ye.lanes):(be.updateQueue=null,be.memoizedState=null)}var Le=Sm(L);if(Le!==null){Le.flags&=-257,xm(Le,L,Y,_,r),Le.mode&1&&bm(_,oe,r),r=Le,J=oe;var Ie=r.updateQueue;if(Ie===null){var Be=new Set;Be.add(J),r.updateQueue=Be}else Ie.add(J);break e}else{if((r&1)===0){bm(_,oe,r),Iu();break e}J=Error(n(426))}}else if(Nt&&Y.mode&1){var Ft=Sm(L);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),xm(Ft,L,Y,_,r),Vc(yr(J,Y));break e}}_=J=yr(J,Y),Gt!==4&&(Gt=2),Eo===null?Eo=[_]:Eo.push(_),_=L;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ie=ym(_,J,r);qp(_,ie);break e;case 1:Y=J;var ee=_.type,se=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(is===null||!is.has(se)))){_.flags|=65536,r&=-r,_.lanes|=r;var ke=wm(_,Y,r);qp(_,ke);break e}}_=_.return}while(_!==null)}eg(l)}catch($e){r=$e,Kt===l&&l!==null&&(Kt=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Iu(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),nn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(nn,fn)}function sl(i,r){var l=at;at|=2;var d=Jm();(nn!==i||fn!==r)&&(Mi=null,Os(i,r));do try{US();break}catch(g){Qm(i,g)}while(!0);if(Gc(),at=l,Qa.current=d,Kt!==null)throw Error(n(261));return nn=null,fn=0,Gt}function US(){for(;Kt!==null;)Zm(Kt)}function WS(){for(;Kt!==null&&!tr();)Zm(Kt)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Kt=r,Nu.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=IS(l,r,Bn),l!==null){Kt=l;return}}else{if(l=OS(l,r),l!==null){l.flags&=32767,Kt=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Gt=6,Kt=null;return}}if(r=r.sibling,r!==null){Kt=r;return}Kt=r=i}while(r!==null);Gt===0&&(Gt=5)}function Bs(i,r,l){var d=mt,g=Xn.transition;try{Xn.transition=null,mt=1,KS(i,r,l,d)}finally{Xn.transition=g,mt=d}return null}function KS(i,r,l,d){do xr();while(ss!==null);if((at&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(Cb(i,_),i===nn&&(Kt=nn=null,fn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(Ve,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var L=mt;mt=1;var Y=at;at|=4,Nu.current=null,zS(i,l),Wm(l,i),dS(Ic),ma=!!Mc,Ic=Mc=null,i.current=l,FS(l),ca(),at=Y,mt=L,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),uc(l.stateNode),An(i,Et()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Pu,Pu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Lu?No++:(No=0,Lu=i):No=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=mt;try{if(Xn.transition=null,mt=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(at&6)!==0)throw Error(n(331));var g=at;for(at|=4,De=i.current;De!==null;){var _=De,L=_.child;if((De.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var J=0;J<Y.length;J++){var oe=Y[J];for(De=oe;De!==null;){var be=De;switch(be.tag){case 0:case 11:case 15:ko(8,be,_)}var Se=be.child;if(Se!==null)Se.return=be,De=Se;else for(;De!==null;){be=De;var ye=be.sibling,Le=be.return;if(zm(be),be===oe){De=null;break}if(ye!==null){ye.return=Le,De=ye;break}De=Le}}}var Ie=_.alternate;if(Ie!==null){var Be=Ie.child;if(Be!==null){Ie.child=null;do{var Ft=Be.sibling;Be.sibling=null,Be=Ft}while(Be!==null)}}De=_}}if((_.subtreeFlags&2064)!==0&&L!==null)L.return=_,De=L;else e:for(;De!==null;){if(_=De,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:ko(9,_,_.return)}var ie=_.sibling;if(ie!==null){ie.return=_.return,De=ie;break e}De=_.return}}var ee=i.current;for(De=ee;De!==null;){L=De;var se=L.child;if((L.subtreeFlags&2064)!==0&&se!==null)se.return=L,De=se;else e:for(L=ee;De!==null;){if(Y=De,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Xa(9,Y)}}catch($e){It(Y,Y.return,$e)}if(Y===L){De=null;break e}var ke=Y.sibling;if(ke!==null){ke.return=Y.return,De=ke;break e}De=Y.return}}if(at=g,Zi(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Wt,i)}catch{}d=!0}return d}finally{mt=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Xr(i,1,r),An(i,r))}function It(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Xr(r,1,i),An(r,i));break}}r=r.return}}function qS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,nn===i&&(fn&l)===l&&(Gt===4||Gt===3&&(fn&130023424)===fn&&500>Et()-Ru?Os(i,0):ju|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Xr(i,r,l),An(i,l))}function VS(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function YS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,MS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,Nt&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,gn.current);vr(r,l),g=ou(null,r,d,i,g,l);var _=au();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,fu(r,d,i,l),r=vu(null,r,d,!0,_,l)):(r.tag=0,Nt&&_&&Uc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=XS(d),i=ri(d,i),g){case 0:r=gu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),gu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var L=r.memoizedState;if(d=L.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,Nt=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&qc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,L=g.children,Oc(d,g)?L=null:_!==null&&Oc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,L,l),r.child;case 6:return i===null&&qc(r),null;case 13:return Am(i,r,l);case 4:return eu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,L=g.value,wt(Ia,d._currentValue),d._currentValue=L,_!==null)if(ii(_.value,L)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var Y=_.dependencies;if(Y!==null){L=_.child;for(var J=Y.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var oe=_.updateQueue;if(oe!==null){oe=oe.shared;var be=oe.pending;be===null?J.next=J:(J.next=be.next,be.next=J),oe.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Qc(_.return,l,r),Y.lanes|=l;break}J=J.next}}else if(_.tag===10)L=_.type===r.type?null:_.child;else if(_.tag===18){if(L=_.return,L===null)throw Error(n(341));L.lanes|=l,Y=L.alternate,Y!==null&&(Y.lanes|=l),Qc(L,l,r),L=_.sibling}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===r){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),fu(r,d,g,l),vu(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function GS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new GS(i,r,l,d)}function Ou(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XS(i){if(typeof i=="function")return Ou(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===A)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var L=2;if(d=i,typeof i=="function")Ou(i)&&(L=1);else if(typeof i=="string")L=5;else e:switch(i){case z:return zs(l.children,g,_,r);case Z:L=8,g|=8;break;case X:return i=Qn(12,l,r,g|2),i.elementType=X,i.lanes=_,i;case C:return i=Qn(13,l,r,g),i.elementType=C,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case U:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:L=10;break e;case O:L=9;break e;case I:L=11;break e;case A:L=14;break e;case $:L=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(L,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=U,i.lanes=l,i.stateNode={isHidden:!1},i}function Bu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function zu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function QS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hc(0),this.expirationTimes=hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Fu(i,r,l,d,g,_,L,Y,J){return i=new QS(i,r,l,Y,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(_),i}function JS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(zt(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,L,Y,J){return i=Fu(l,d,!0,i,g,_,L,Y,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Xr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),L=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,L),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,L),i!==null&&(li(i,g,L,_),Ba(i,g,L)),L}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function $u(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function ZS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Hu(i){this._internalRoot=i}cl.prototype.render=Hu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Hu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Uu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function e0(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var oe=ll(L);_.call(oe)}}var L=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=L,i[ji]=L.current,uo(i.nodeType===8?i.parentNode:i),Is(),L}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var Y=d;d=function(){var oe=ll(J);Y.call(oe)}}var J=Fu(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,uo(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var L=_;if(typeof g=="function"){var Y=g;g=function(){var J=ll(L);Y.call(J)}}al(r,L,i,g)}else L=e0(l,r,i,g,d);return ll(L)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Gr(r.pendingLanes);l!==0&&(fc(r,l|1),An(r,Et()),(at&6)===0&&(Sr=Et()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),$u(i,1)}},pc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}$u(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}$u(i,r)}},Kf=function(){return mt},qf=function(i,r){var l=mt;try{return mt=i,r()}finally{mt=l}},Je=function(i,r,l){switch(r){case"input":if(Ut(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Ye(d),Ut(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&ft(i,!!l.multiple,r,!1)}},Wn=Du,ui=Is;var t0={usingClientEntryPoint:!1,Events:[po,cr,ja,Zt,ni,Du]},jo={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n0={bundleType:jo.bundleType,version:jo.version,rendererPackageName:jo.rendererPackageName,rendererConfig:jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:jo.findFiberByHostInstance||ZS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Wt=hl.inject(n0),en=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t0,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uu(r))throw Error(n(200));return JS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Uu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Fu(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,uo(i.nodeType===8?i.parentNode:i),new Hu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Uu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",L=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(L=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,L),i[ji]=r.current,uo(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Du,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function d0(){if(vg)return qu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qu.exports=u0(),qu.exports}var _g;function h0(){if(_g)return fl;_g=1;var e=d0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var f0=h0();const p0=qh(f0);function Ht(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const Q_=e=>`nc_seen_${e}`;async function Me(e,t,n={}){const s=await Ht(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const cn=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",un=(e,t)=>`${cn(e)}/fleet/${t}`,ws=(e,t)=>Me(un(t,"status"),e),Yh=(e,t,n)=>Me(un(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Me(un(n,"down"),e,{method:"POST",body:t}),J_=(e,t,n)=>Me(un(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Me(un(n,"restart"),e,{method:"POST",body:{cell:t}}),Gh=(e,t)=>Me(un(t,"definitions"),e),m0=(e,t)=>Me(un(t,"credentials/status"),e),yg=(e,t,n,s)=>Me(un(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),g0=(e,t,n)=>Me(un(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),v0=(e,t,n)=>Me(un(n,"define-engine"),e,{method:"POST",body:{def:t}}),_0=(e,t,n,s,o)=>Me(un(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),y0=(e,t,n)=>Me(un(n,"remove-engine"),e,{method:"POST",body:{id:t}}),w0=(e,t,n)=>Me(un(n,"define-cell"),e,{method:"POST",body:{def:t}}),Z_=(e,t,n,s)=>Me(un(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),ey=(e,t,n=!1,s)=>Me(un(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),b0=(e,t,n)=>Me(un(n,"import-cell"),e,{method:"POST",body:t}),S0=(e,t,n)=>Me(un(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),x0=(e,t,n,s)=>Me(un(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Me(`${cn(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ty=(e,t,n,s)=>Me(`${cn(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Me(`${cn(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),ny=e=>Me("/api/settings",e),k0=e=>Me("/api/nodes",e),C0=e=>Me("/api/peers",e),iy=(e,t=[])=>Me(`${cn(t)}/vl-nodes`,e),wg=(e,t,n,s={},o=[])=>Me(`${cn(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),E0=(e,t,n=0,s=[])=>Me(`${cn(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),sy=e=>Me("/api/topology",e),Jh=(e,t)=>Me(`${cn(t)}/sessions`,e),Zh=(e,t)=>Me(`${cn(t)}/config`,e),bg=(e,t)=>Me(`${cn(t)}/topology`,e),Ud=(e,t)=>Me("/api/settings/config",e,{method:"POST",body:t}),N0=e=>Me("/api/settings/token/rotate",e,{method:"POST"}),j0=(e,t)=>Me("/api/settings/nodes/pair",e,{method:"POST",body:t}),Sg=(e,t,n=[])=>Me(`${cn(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),ry=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),R0=e=>Me("/api/settings/node-aliases",e),P0=(e,t,n)=>Me(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),xg=(e,t)=>Me(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),L0=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),A0=(e,t)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),T0=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),D0=(e,t,n,s=[])=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),M0=e=>Me("/api/settings/audio",e),I0=(e,t)=>Me("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),O0=e=>Me("/api/settings/audio/test",e,{method:"POST",body:{}}),B0=e=>Me("/api/settings/audio/stop",e,{method:"POST",body:{}}),z0=e=>Me("/api/settings/audio/groups",e),F0=(e,t,n)=>Me(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),$0=(e,t)=>Me(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),H0=e=>Me("/api/settings/service/regenerate",e,{method:"POST"}),U0=e=>Me("/api/settings/update/check",e,{method:"POST"}),W0=e=>Me("/api/settings/update/apply",e,{method:"POST"}),Jl=(e,t)=>`${cn(e)}/diagnostics/${t}`,K0=(e,t=[])=>Me(Jl(t,"status"),e),q0=(e,{after:t=0,limit:n=200}={},s=[])=>Me(`${Jl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),kg=(e,t,n,s=[])=>Me(Jl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),V0=(e,t=[])=>Me(Jl(t,"logs"),e,{method:"DELETE"}),Y0=(e,t=!0)=>Me(`/api/asks${t?"?open=1":""}`,e),G0=(e,t,n)=>Me(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),X0=(e,t)=>Me(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Me(`${cn(t)}/decks`,e),Cg=(e,t,n=[])=>Me(`${cn(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Me(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Q0=(e,t,n,s,o=[])=>Me(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),J0=(e,t,n,s=[])=>Me(`${cn(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),Z0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Ze({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Z0[e]||null})}const ex=["all","pinned","active","off","technical"],oy="nc_sidebar_views_v1",ay="nc_sidebar_order_v1";function ly(e){return ex.includes(e)?e:"all"}function tx(e,t=[],n="all"){const s=ly(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function nx(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,f=s.indexOf(e.key),m=s.indexOf(t.key),v=f===-1?Number.MAX_SAFE_INTEGER:f,b=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-b||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ay));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function sx(e,t=globalThis.localStorage){try{t.setItem(ay,JSON.stringify(e))}catch{}return e}function rx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],f=h.indexOf(n),m=h.indexOf(s);h.splice(f,1);const v=h.indexOf(s),b=f<m?v+1:v;return h.splice(b,0,n),{...e,[t]:h}}function ox(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(oy));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Eg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:ly((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function ax(e,t=globalThis.localStorage){try{t.setItem(oy,JSON.stringify(e))}catch{}return e}function Ng(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>tx(o,t,n)).sort((o,a)=>nx(o,a,t,s))}const tf=["it","en","es"];function lx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=lx(),cy="nc_lang",Wd="nc-lang";function uy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max-preview è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"I poteri per-nodo non esistono ancora: qui non c’è niente da concedere o togliere.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— sessione conclusa —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"scrivi il prompt per la sessione del device…","vl-prompt-send":"invia prompt","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso completo. Se sei già collegato a un hub, viene usato automaticamente; altrimenti serve solo il suo indirizzo SSH raggiungibile.","invite-network-hint":"Crea un invito per la rete a cui sei già collegato. Il nuovo dispositivo entrerà attraverso l’hub, non si collegherà direttamente a questo dispositivo.","invite-network-label":"Rete di destinazione","invite-network-via":"Hub","invite-network-route":"Un solo collegamento verso l’hub; nodi, celle e deck vengono smistati internamente.","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max-preview is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"Per-node powers do not exist yet: there is nothing to grant or withdraw here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— session finished —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"write the prompt for the device session…","vl-prompt-send":"send prompt","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one complete one-time invitation. If this device already joined a hub, that hub is used automatically; otherwise only its reachable SSH address is required.","invite-network-hint":"Create an invitation for the network you already joined. The new device enters through the hub instead of connecting directly to this device.","invite-network-label":"Destination network","invite-network-via":"Hub","invite-network-route":"One connection to the hub; nodes, cells and decks are routed internally.","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max-preview es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"Los poderes por nodo aún no existen: aquí no hay nada que conceder ni retirar.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— sesión terminada —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"escribe el prompt para la sesión del dispositivo…","vl-prompt-send":"enviar prompt","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación completa de un solo uso. Si este dispositivo ya está unido a un hub, se usa automáticamente; si no, solo hace falta su dirección SSH alcanzable.","invite-network-hint":"Crea una invitación para la red a la que ya estás conectado. El nuevo dispositivo entra por el hub y no se conecta directamente a este dispositivo.","invite-network-label":"Red de destino","invite-network-via":"Hub","invite-network-route":"Una sola conexión al hub; nodos, celdas y decks se enrutan internamente.","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=uy(),t=e?e.getItem(cy):null;return tf.includes(t)?t:jl}function cx(e){const t=uy();if(t)try{t.setItem(cy,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Wd))}function p(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ux(e){return typeof window>"u"?()=>{}:(window.addEventListener(Wd,e),()=>window.removeEventListener(Wd,e))}const dy=tf;function kn(){return[N.useSyncExternalStore(ux,Ol,Ol),cx]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,U;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,f]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let R=!0;return(async()=>{if(t)try{const W=await ws(t,u?u.split("/"):[]);if(!R)return;if(v(W.provider==="builtin"&&(W.capabilities||[]).includes("edit")),W.provider==="builtin"&&(W.capabilities||[]).includes("definitions")){const B=await Gh(t,u?u.split("/"):[]);if(!R)return;const j=new Map((W.engines||[]).map(M=>[M.id,M]));f((B.engines||[]).map(M=>{var K,ne,le,fe,ge,pe,we;return{id:M.id,label:M.label||M.id,client:((K=M.managed)==null?void 0:K.client)||"",models:[...new Set([...((ne=j.get(M.id))==null?void 0:ne.models)||[],...((le=M.managedInfo)==null?void 0:le.models)||[]])].filter(Boolean),defaultModel:((fe=M.managed)==null?void 0:fe.model)||((ge=M.managedInfo)==null?void 0:ge.defaultModel)||"",policyDefault:((pe=M.managed)==null?void 0:pe.permissionPolicy)||((we=M.managed)!=null&&we.client&&M.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{R=!1}},[t,u]);const b=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=R=>(e==null?void 0:e.models)&&e.models[R]||"",S=R=>{const W=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[R];if(W==="standard"||W==="unsafe")return W;const B=h.find(j=>j.id===R);return B?B.policyDefault:"standard"},[w,x]=N.useState(b),[k,P]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((U=e==null?void 0:e.permissionPolicies)==null?void 0:U[e==null?void 0:e.engine])||"",[F,D]=N.useState(E),[V,G]=N.useState((e==null?void 0:e.boot)??!0),[z,Z]=N.useState(!1),[X,Q]=N.useState(null);N.useEffect(()=>{h.length&&(x(R=>R||b),P(R=>R||y((e==null?void 0:e.engine)||b)||""),D(R=>R==="standard"||R==="unsafe"?R:S((e==null?void 0:e.engine)||b)))},[h.length]);const O=N.useMemo(()=>h.find(R=>R.id===w)||null,[h,w]),I=!!(O&&["claude","codex","codex-vl","agy","kimi"].includes(O.client)),C=(O==null?void 0:O.client)==="shell";function T(R){x(R);const W=h.find(B=>B.id===R);P(y(R)||(W==null?void 0:W.defaultModel)||""),D(S(R))}async function A(R){R.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:V});else{const W=F==="standard"||F==="unsafe"?F:(O==null?void 0:O.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:k||"",...I?{permissionPolicy:W}:(O==null?void 0:O.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:V})}o()}catch(W){Q(String(W&&W.message||W)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:R=>R.stopPropagation(),onSubmit:A,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:p(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[p("engine"),c.jsx("select",{value:w,onChange:R=>T(R.target.value),children:h.map(R=>c.jsx("option",{value:R.id,children:R.label},R.id))})]}),!C&&c.jsxs("label",{className:"nc-field",children:[p("model"),c.jsx("input",{value:k,list:"nc-launch-models",placeholder:p("model-default"),onChange:R=>P(R.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((O==null?void 0:O.models)||[]).map(R=>c.jsx("option",{value:R},R))})]}),I?c.jsxs("label",{className:"nc-field",children:[p("permissions"),c.jsxs("select",{value:F,onChange:R=>D(R.target.value),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:p("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:p(C?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("boot-persist")]})]}),X&&c.jsx("div",{className:"nc-err",children:X}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:z,children:p("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:z,children:p(a?"power-off":"save-and-start")})]})]})})}const jg=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function dx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",f=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!f&&(s[u]=e&&e[u]||n)}return s}function Rg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Pg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,b,y;const u=[],h=new Set,f=new Set;for(const S of Array.isArray(e)?e:[]){if(!S||typeof S.name!="string"||!jg.test(S.name)||S.direction==="inbound"&&S.shared!==!0)continue;const w=[S.name],x=S.name;h.add(x);const k=((m=S.tunnel)==null?void 0:m.status)||"unknown",P=k==="up",E={name:S.name,label:S.label||S.name,originalLabel:S.label||S.name,alias:null,route:w,direct:!0,instanceId:S.nodeId||null,shared:S.shared===!0,tunnelStatus:k,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,direction:S.direction||"outbound",roles:S.roles||null,rolesKnown:S.rolesKnown===!0};if(S.nodeId&&f.add(S.nodeId),!S.nodeId&&S.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(((v=S.health)==null?void 0:v.auth)==="failed"||k==="degraded"&&((b=S.health)==null?void 0:b.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(k==="passive"||((y=S.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!P){u.push({...E,status:"down",downSince:s&&s[x]||null});continue}const F=n&&(n[x]||n[S.name])||null,D=o&&(o[x]||o[S.name]),V=!!(F&&!F.error&&Array.isArray(F.sessions)),G=!!(D&&D.available===!0&&Array.isArray(D.cells));if(!V&&!G){u.push({...E,status:"unreachable"});continue}const z=(V?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:x,route:w,key:`${x}:${Q.name}`})),Z=Rg(D,w,x),X=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:z,cells:Z,unmanaged:z.filter(Q=>!X.has(Q.name)),fleetAvailable:!!(D&&D.available),capabilities:D&&D.capabilities||[],engines:D&&D.engines||[],fleetProvider:D&&D.provider||null,sessionsAvailable:V,inventoryPartial:!V})}for(const S of Array.isArray(t)?t:[]){if(!S||!Array.isArray(S.route)||S.route.length<1||S.route.some(X=>!jg.test(X)))continue;const w=S.route.join("/");if(h.has(w)||S.instanceId&&f.has(S.instanceId))continue;S.instanceId&&f.add(S.instanceId);const x=S.label||S.route.join(" › "),k=S.instanceId&&a&&typeof a[S.instanceId]=="string"?a[S.instanceId]:null,P={name:S.name,label:k||x,originalLabel:x,alias:k,route:[...S.route],direct:!1,instanceId:S.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,lastSeen:S.lastSeen||null};if(S.stale){u.push({...P,status:"offline",downSince:s&&s[w]||S.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],D=!!(E&&!E.error&&Array.isArray(E.sessions)),V=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!D&&!V){u.push({...P,status:"unreachable",downSince:s&&s[w]||null});continue}const G=(D?E.sessions:[]).filter(X=>X&&typeof X.name=="string"&&X.name).map(X=>({...X,node:w,route:S.route,key:`${w}:${X.name}`})),z=Rg(F,S.route,w),Z=new Set(z.map(X=>X.tmuxSession).filter(Boolean));u.push({...P,status:"up",sessions:G,cells:z,unmanaged:G.filter(X=>!Z.has(X.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:S.lastSeen||null,sessionsAvailable:D,inventoryPartial:!D})}return u.sort((S,w)=>S.label.localeCompare(w.label))}function hy(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function hx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function fy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const fx=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var D;let m=[],v=[],b={},y="";if(await Promise.all([k0(e).then(V=>{m=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),sy(e).then(V=>{v=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),R0(e).then(V=>{b=V&&typeof V.aliasesByInstanceId=="object"?V.aliasesByInstanceId:{}}).catch(()=>{}),Ht("/api/config",e).then(V=>V.json()).then(V=>{y=V&&typeof V.instanceId=="string"?V.instanceId:""}).catch(()=>{})]),!u)return;const S=[{instanceId:y||null,route:[],label:null},...fy({nodes:v},y)],w=[];if(await Promise.all(S.map(async V=>{try{const G=await iy(e,V.route);for(const z of G.nodes||[]){const Z=hy(z,V);Z&&w.push(Z)}}catch{}})),!u)return;const x={},k={},P=new Set(m.map(V=>V.name)),E=[];for(const V of m)((D=V.tunnel)==null?void 0:D.status)==="up"&&(V.nodeId||V.paired!==!1)&&(V.direction!=="inbound"||V.shared===!0)&&E.push([V.name]);for(const V of v)!V.stale&&Array.isArray(V.route)&&!(V.route.length===1&&P.has(V.route[0]))&&E.push(V.route);if(await Promise.all(E.map(async V=>{const G=V.join("/");try{x[G]=await Jh(e,V)}catch{x[G]={error:"unreachable"}}try{k[G]=await ws(e,V)}catch{k[G]={available:!1}}})),!u)return;const F=Pg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current});a.current=dx(a.current,F,Math.floor(Date.now()/1e3)),o([...Pg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current}),...hx(w)])}h();const f=setInterval(h,fx);return()=>{u=!1,clearInterval(f)}},[e,t,n]),s}const Lg=52,Ag=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),f=N.useRef(0),[m,v]=N.useState(!1),b=()=>{var P,E,F,D;const k=h.current;(E=(P=k==null?void 0:k.over)==null?void 0:P.classList)==null||E.remove("nc-roster-over"),(D=(F=k==null?void 0:k.source)==null?void 0:F.classList)==null||D.remove("nc-roster-dragging"),f.current&&cancelAnimationFrame(f.current),f.current=0},y=(k=!1)=>{const P=h.current;if(!P)return;const E=P.target;b(),h.current=null,v(!1);try{P.handle.releasePointerCapture(P.pointerId)}catch{}k&&E&&E!==t&&a(t,E)&&s(t,E)},S=(k,P)=>{var Z,X,Q,O,I,C,T,A,$;const E=h.current;if(!E)return;E.x=k,E.y=P;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",D=(X=(Z=document.elementFromPoint(k,P))==null?void 0:Z.closest)==null?void 0:X.call(Z,F),V=u==="node"?(Q=D==null?void 0:D.dataset)==null?void 0:Q.nodeOrderKey:(O=D==null?void 0:D.dataset)==null?void 0:O.rosterKey,z=(u==="node"||((I=D==null?void 0:D.dataset)==null?void 0:I.position)===e)&&V&&V!==t&&a(t,V);E.over!==(z?D:null)&&((T=(C=E.over)==null?void 0:C.classList)==null||T.remove("nc-roster-over"),E.over=z?D:null,($=(A=E.over)==null?void 0:A.classList)==null||$.add("nc-roster-over")),E.target=z?V:null},w=()=>{const k=h.current;if(!k){f.current=0;return}const P=k.container;if(P){const E=P.getBoundingClientRect(),F=k.y<E.top+Lg?-Ag:k.y>E.bottom-Lg?Ag:0;F&&(P.scrollTop+=F,S(k.x,k.y))}f.current=requestAnimationFrame(w)};N.useEffect(()=>{const k=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},P=()=>y(!1);return window.addEventListener("keydown",k),window.addEventListener("blur",P),()=>{window.removeEventListener("keydown",k),window.removeEventListener("blur",P),b(),h.current=null}},[t,e,u]);const x=k=>{var D;if(k.pointerType==="mouse"&&k.button!==0)return;k.preventDefault(),k.stopPropagation(),k.currentTarget.focus({preventScroll:!0});const P=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=k.currentTarget.closest(P),F=k.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:k.pointerId,handle:k.currentTarget,source:E,container:F,target:null,over:null,x:k.clientX,y:k.clientY},(D=E==null?void 0:E.classList)==null||D.add("nc-roster-dragging");try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}v(!0),f.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${p("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:p("reorder-help"),onClick:k=>{k.preventDefault(),k.stopPropagation()},onDragStart:k=>k.preventDefault(),onKeyDown:k=>{k.key!=="ArrowUp"&&k.key!=="ArrowDown"||(k.preventDefault(),k.stopPropagation(),o(k.key==="ArrowUp"?-1:1))},onPointerDown:x,onPointerMove:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),S(k.clientX,k.clientY))},onPointerUp:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function px(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function mx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function gx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function vx(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function _x(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(px),[n,s]=N.useState(ox),[o,a]=N.useState(ix),u=y=>t(S=>mx(S,y)),h=y=>Eg(n,y),f=(y,S)=>s(w=>{const x={...w,[y]:{...Eg(w,y),...S}};return ax(x)}),m=(y,S)=>e.includes(y)===e.includes(S);function v(y,S,w,x){const k=e.includes(S),P=e.includes(w);if(k===P){if(k){t(E=>gx(E,S,w));return}a(E=>{var V;const F=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,D=gs(x,e,F?"technical":"all",Fi(E,y)).map(G=>G.key);return sx(rx(E,y,S,w,D))})}}function b(y,S,w,x){var V;const k=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,P=e.includes(S),E=gs(x,e,k?"technical":"all",Fi(o,y)).map(G=>G.key).filter(G=>e.includes(G)===P),F=E.indexOf(S),D=E[F+w];F>=0&&D&&v(y,S,D,x)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:f,canMoveRoster:m,moveRoster:v,stepRoster:b}}const py="nc_node_order_v1",yx=/^[a-f0-9]{16,64}$/;function qs(e){if(yx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Tg(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(py));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function wx(e,t=globalThis.localStorage){try{t.setItem(py,JSON.stringify(e))}catch{}return e}function Dg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function bx(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const f=a.indexOf(n);return a.splice(u<h?f+1:f,0,t),a}const Kd="nexuscrew-node-preferences";function Sx(){try{window.dispatchEvent(new Event(Kd))}catch{}}function my(){const[e,t]=N.useState(Tg);N.useEffect(()=>{const a=()=>t(Tg());return window.addEventListener("storage",a),window.addEventListener(Kd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(Kd,a)}},[]);const n=a=>Dg(a,e),s=(a,u,h)=>t(f=>{const m=bx(f,a,u,h);return wx(m),Sx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const f=Dg(h,e).map(qs),m=f.indexOf(a),v=f[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Tr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?p("node-passive"):e.status==="down"?e.downSince?p("tunnel-down-since").replace("{t}",Tr(e.downSince)):p("tunnel-down"):e.status==="unreachable"?p("node-unreachable"):e.status==="offline"?e.lastSeen?p("node-offline-seen").replace("{t}",Tr(e.lastSeen)):p("node-offline"):e.status==="needs-repair"?p("node-needs-repair"):""}function gy(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(Q_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||p("cell-off")).trim()}}if(t.working===!0){const s=p("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:p("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||p("cell-on")).trim()}}function vy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:vy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},f=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:f,label:u.cell,live:!!u.tmux,fresh:zl(h,f,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:vy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,xx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Dr=/^[a-f0-9]{16,64}$/,qd=e=>xx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!qd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Dr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&qd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const _y=9,yy=24,ta=11,kx=e=>{const t=Number(e);return t>=_y&&t<=yy?t:ta};function Pr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Cx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const zr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=zr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function wy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let b=1;b<e.columns.length;b+=1)e.columns[b].tiles.length<e.columns[v].tiles.length&&(v=b);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Cx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(b=>[$n(b),b]))),h=ys(t),f=e.columns.length?e.columns.reduce((v,b)=>v+(Number(b.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,b)=>{var y;return{width:((y=e.columns[b])==null?void 0:y.width)||f,tiles:[]}});return a.forEach((v,b)=>{const y=ys(v);if(!y)return;const S=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:S.height||1,fontSize:S.fontSize||ta};y.node&&(w.node=y.node),S.ownerId&&(w.ownerId=S.ownerId),S.unavailable===!0&&(w.unavailable=!0),m[b%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=zr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function Ex(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function Nx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=zr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function jx(e,t,n){const s=zr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Rx(e,t,n,s){const o=zr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Px(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=zr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(_y,Math.min(yy,h+(Number(s)||0))),a}function Lx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Mg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Pr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&qd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Dr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:kx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const by=/^[a-z0-9-]{1,32}$/,Ax=/^[A-Za-z0-9._-]{1,32}$/,Tx=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Dx=320;function Vd(e){return typeof e=="string"&&by.test(e)}const Mx=64;function Mr(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Mx&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function Sy(e){if(typeof e!="string"||!e||e.length>Dx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Ax.test(e.slice(0,t))&&Tx.test(e.slice(t+1))}function Ig(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Og({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Vd(o))return{ok:!1,error:"err-node-name"};if(!Sy(a))return{ok:!1,error:"err-ssh"};const u=Ig(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Ig(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const f={name:o,ssh:a};return u!==null&&(f.sshPort=u),h!==null&&(f.remotePort=h),{ok:!0,value:f}}function Ix(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Yd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Ix(e.since,t):null}}const Ox=new Set(["v","instanceId","port","label","invite"]),Bx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function zx(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function Fx(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(zx(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Ox:n.v===2?Bx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!by.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!Sy(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function $x(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const Hx=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Ux=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!Hx.includes(t.code)||!Ux.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:p(`fleet-recovery-${t.recovery}`)}}let Gd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Bg(){return Gd}function xy(e={}){return Gd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Gd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function Wx({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(""),[S,w]=N.useState(""),[x,k]=N.useState({bind:"127.0.0.1",port:""}),[P,E]=N.useState(""),[F,D]=N.useState([]),[V,G]=N.useState([]),[z,Z]=N.useState({}),[X,Q]=N.useState(new Set),[O,I]=N.useState(null),[C,T]=N.useState(null),{pins:A,orders:$,togglePin:U,viewFor:R,updateView:W,canMoveRoster:B,moveRoster:j,stepRoster:M}=rf(),{groupsFor:K,moveNode:ne,stepNode:le,nodeKey:fe}=my(),ge=K(u);N.useEffect(()=>{xy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:P})},[h,F,u,P]),N.useEffect(()=>{const H=new Map;for(const ae of F)H.set(kr(ae.cell),!!ae.boot);for(const ae of u){const ce=ae.route||[ae.name];for(const me of ae.cells||[])H.set(kr(me.cell,ce),!!me.boot)}Z(ae=>{let ce=!1;const me={...ae};for(const[Te,_e]of Object.entries(ae))H.has(Te)&&H.get(Te)===_e&&(delete me[Te],ce=!0);return ce?me:ae})},[F,u]);async function pe(){try{const ae=await(await Ht("/api/sessions",t)).json();ae.error?(v(ae.error),f([])):(v(null),f(ae.sessions||[]))}catch(H){v(String(H)),f([])}try{const H=await ws(t);D(H.available?H.cells||[]:[]),G(H.available?H.capabilities||[]:[])}catch{D([]),G([])}}N.useEffect(()=>{pe(),Ht("/api/config",t).then(ae=>ae.json()).then(ae=>{w(ae.version||""),k({bind:ae.bind||"127.0.0.1",port:ae.port||""}),E(Dr.test(String(ae.instanceId||""))?ae.instanceId:"")}).catch(()=>{});const H=setInterval(pe,4e3);return()=>clearInterval(H)},[]);async function we(){if(!x.port)return;const H=`http://${x.bind}:${x.port}/#token=${t}`;try{await navigator.clipboard.writeText(H)}catch{}}function He(H,ae,ce){const me=kr(H,ae);Z(Te=>({...Te,[me]:!!ce}))}function ht(H,ae=[]){const ce=kr(H.cell,ae);return Object.prototype.hasOwnProperty.call(z,ce)?z[ce]:!!H.boot}async function Ye(H,ae,ce=[]){H.stopPropagation();const me=kr(ae.cell,ce),Te=!ht(ae,ce);He(ae.cell,ce,Te),Q(_e=>new Set(_e).add(me));try{await J_(t,{cell:ae.cell,enabled:Te},ce),ce.length||D(_e=>_e.map(Ce=>Ce.cell===ae.cell?{...Ce,boot:Te}:Ce))}catch(_e){Z(Ce=>{const nt={...Ce};return delete nt[me],nt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ce=new Set(_e);return Ce.delete(me),Ce})}}async function Ae(H){if(!O)return;const{cell:ae}=O,ce=Array.isArray(O.route)?O.route:[];if(H.action==="up"){const me=await Yh(t,{cell:ae,boot:!!H.boot,...H.engine?{engine:H.engine}:{},...H.model!==void 0?{model:H.model}:{},...H.permissionPolicy?{permissionPolicy:H.permissionPolicy}:{}},ce),Te=uf(me);Te&&v(Te.text),He(ae,ce,!!H.boot)}else await Il(t,{cell:ae,boot:!!H.boot},ce),H.boot&&He(ae,ce,!1);pe()}async function Ne(H,ae=[]){try{await Xh(t,H,ae)}catch{return}pe()}async function ut(H,ae,ce=[]){try{await ty(t,H,ae,ce)}catch{return}pe()}async function Pe(H){if(!(!(H!=null&&H.direct)||C)){T(H.name);try{await ef(t,H.name,H.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function Ut(H){if(!(H!=null&&H.direct))return;const ae=window.prompt(p("rename-node-prompt"),H.label||H.name);if(ae===null)return;const ce=String(ae).trim();if(!Mr(ce)){window.alert(p("rename-node-invalid"));return}try{await ry(t,H.name,ce)}catch(me){window.alert(String((me==null?void 0:me.message)||me))}}const Rt=N.useMemo(()=>new Map((h||[]).map(H=>[H.name,H])),[h]),Dt=N.useMemo(()=>new Set(F.map(H=>H.tmuxSession)),[F]),vt=N.useMemo(()=>(h||[]).filter(H=>!Dt.has(H.name)),[h,Dt]),ft=N.useMemo(()=>af(F,vt,Rt),[F,vt,Rt]),dt=R("local"),re=N.useMemo(()=>gs(ft,A,dt.filter,Fi($,"local")).filter(H=>Ng(H,b)),[ft,A,dt.filter,b,$]),xe=ge.reduce((H,ae)=>H+(ae.cells||[]).length+(ae.unmanaged||[]).filter(ce=>!ce.technical).length,0),Oe=gs(ft,A,"all",Fi($,"local")).length+xe,Fe=ft.filter(H=>H.live).length+ge.reduce((H,ae)=>H+Fl(ae).rawItems.filter(ce=>ce.live).length,0),de=(h||[]).filter(H=>H.attached).length+ge.reduce((H,ae)=>H+(ae.sessions||[]).filter(ce=>ce.attached).length,0),ze=Math.min(de,Fe),q=x.port?`${x.bind}:${x.port}`:x.bind;function te(H,ae=null,ce=ft){var Mt,lt;const me=Array.isArray(ae==null?void 0:ae.route)?ae.route:[],Te=me.join("/"),_e=Te||"local",Ce=me.length?ae==null?void 0:ae.instanceId:P,nt=(et,Zt)=>e({session:et,...Te?{node:Te}:{},...Dr.test(String(Ce||""))?{ownerId:Ce}:{},...typeof Zt=="string"&&Zt?{cellName:Zt}:{}}),ot=B;if(H.type==="cell"){const et=H.value,Zt=me.length?((ae==null?void 0:ae.sessions)||[]).find(pt=>pt.name===et.tmuxSession):Rt.get(et.tmuxSession),ni=et.degraded?p("cell-degraded"):H.working?H.subtitle:et.tmux?p("cell-idle"):p("cell-off"),Wn=me.length===0||((ae==null?void 0:ae.capabilities)||[]).includes(et.active?"down":"up"),ui=me.length===0?V.includes("boot"):((ae==null?void 0:ae.capabilities)||[]).includes("boot"),ue=ht(et,me),je=kr(et.cell,me),qe=`${p(ue?"boot-disable":"boot-enable")} ${et.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:et.cell,canMove:ot,onMove:(pt,_t)=>j(_e,pt,_t,ce),onStep:pt=>M(_e,H.key,pt,ce)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>et.tmux&&nt(et.tmuxSession,et.cell),title:ni,"aria-label":`${et.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${et.degraded?"warn":et.tmux?`on${H.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:et.cell}),c.jsx("small",{title:H.subtitle,children:H.subtitle})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((Mt=Zt==null?void 0:Zt.outbox)==null?void 0:Mt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Zt.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${et.cell}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${ue?" on":""}`,disabled:X.has(je),onClick:pt=>Ye(pt,et,me),title:qe,"aria-label":qe,children:c.jsx(Ze,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${et.tmux?" on":""}${et.degraded?" warn":""}`,onClick:()=>I(me.length?{...et,boot:ue,route:me,availableEngines:(ae==null?void 0:ae.engines)||[]}:{...et,boot:ue}),title:et.active?p("power-off"):p("power-on"),"aria-label":`${et.active?p("power-off"):p("power-on")} ${et.cell}`,children:c.jsx(Ze,{name:"power",size:16})})]},H.key)}const Je=H.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Je.name,canMove:ot,onMove:(et,Zt)=>j(_e,et,Zt,ce),onStep:et=>M(_e,H.key,et,ce)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>nt(Je.name),children:[c.jsx("span",{className:Je.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Je.name}),c.jsx("small",{children:Je.preview?Je.preview:Je.cmd?Je.cmd:p("windows").replace("{n}",String(Je.windows||0))})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((lt=Je.outbox)==null?void 0:lt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Je.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Je.name}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Je.technical?" on":""}`,title:Je.technical?p("mark-normal"):p("mark-technical"),"aria-label":`${Je.technical?p("mark-normal"):p("mark-technical")} ${Je.name}`,onClick:()=>ut(Je.name,!Je.technical,me),children:"T"}),c.jsx("button",{className:"nc-menu",title:p("terminate"),"aria-label":`${p("terminate")} ${Je.name}`,onClick:()=>{window.confirm(p("terminate-confirm").replace("{name}",Je.name))&&Ne(Je.name,me)},children:"⋯"})]},H.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[p("fleet-tmux")," · ",Fe," ",p("sessions"),ze>0&&` · ${ze} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:p("settings"),children:c.jsx(Ze,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:pe,title:p("refresh"),children:c.jsx(Ze,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Oe>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:p("filter-placeholder"),"aria-label":p("filter-placeholder"),value:b,onChange:H=>y(H.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Gu,{label:p("position-local"),count:re.length,state:dt,dotClass:"on",onToggle:()=>W("local",{open:!dt.open}),onFilter:H=>W("local",{filter:H})}),dt.open&&re.map(H=>te(H,null,ft)),dt.open&&h===null&&c.jsx("div",{className:"nc-empty",children:p("loading-fleet")}),dt.open&&h!==null&&re.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]}),ge.map(H=>{const ce=gy(H.health,{passive:"warn"})||(H.status==="up"?"on":H.status==="passive"?"":"warn"),me=H.health?qo(H.health):H.status==="up"?"":Bi(H),_e=(H.route&&H.route.length?H.route:[H.name]).join("/"),Ce=R(_e);if(H.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:H.sessions.length,state:Ce,dotClass:ce,dotTitle:me,detail:H.status==="up"?"":Bi(H),onToggle:()=>W(_e,{open:!Ce.open}),onFilter:lt=>W(_e,{filter:lt})}),H.status==="up"&&Ce.open&&H.sessions.map(lt=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(H.peer),"aria-label":`${H.label||H.name}: ${lt.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:lt.name}),c.jsx("small",{children:p("vl-events-title")})]})]})},lt.key)),H.status==="up"&&Ce.open&&H.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:p("no-sessions-short")})]},`nodo-vl-${_e}-${H.name}`);const{rawItems:nt}=Fl(H),ot=gs(nt,A,Ce.filter,Fi($,_e)).filter(lt=>Ng(lt,b)),Je=H.direct&&H.health&&H.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${H.tunnelStatus==="up"?" on":""}`,disabled:C===H.name,title:H.tunnelStatus==="up"?p("power-off"):p("power-on"),"aria-label":`${H.tunnelStatus==="up"?p("power-off"):p("power-on")} ${H.label||H.name}`,onClick:()=>Pe(H),children:c.jsx(Ze,{name:"power",size:15})}):null,Mt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:fe(H),label:H.label||H.name,onMove:(lt,et)=>ne(lt,et,u),onStep:lt=>le(fe(H),lt,u)}),H.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:p("rename-node"),"aria-label":`${p("rename-node")} ${H.label||H.name}`,onClick:()=>Ut(H),children:"✎"}),Je]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:ot.length,state:Ce,dotClass:ce,dotTitle:me,detail:H.status==="up"?"":H.health&&qo(H.health)||Bi(H),onToggle:()=>W(_e,{open:!Ce.open}),onFilter:lt=>W(_e,{filter:lt}),onRename:H.direct?()=>Ut(H):null,action:Mt}),H.status==="up"&&Ce.open&&ot.map(lt=>te(lt,H,nt)),H.status==="up"&&Ce.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:we,title:p("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[S&&c.jsxs("span",{className:"nc-home-version",children:["v",S]}),c.jsxs("span",{className:"nc-home-endpoint",children:[q," · ",p("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:H=>H.stopPropagation(),children:dy.map((H,ae)=>c.jsxs("span",{children:[ae>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===H?" on":""}`,onClick:()=>a(H),title:H,children:H.toUpperCase()})]},H))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:p("fleet-new-cell"),"aria-label":p("fleet-new-cell"),children:"+"}),O&&c.jsx(Bl,{cell:O,token:t,route:Array.isArray(O.route)?O.route:[],onConfirm:Ae,onClose:()=>I(null)})]})}function Gu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:f=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:f?v=>{v.preventDefault(),f()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${p("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||p("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${p("filter-placeholder")}`,title:p(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:p("view-all")}),c.jsx("option",{value:"pinned",children:p("view-pinned")}),c.jsx("option",{value:"active",children:p("view-active")}),c.jsx("option",{value:"off",children:p("view-off")}),c.jsx("option",{value:"technical",children:p("view-technical")})]}),m]})}/**
|
|
40
|
+
`+_.stack}return{value:i,source:r,stack:g,digest:null}}function pu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function mu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Pu=d),mu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){mu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){mu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var L=r.stack;this.componentDidCatch(r.value,{componentStack:L!==null?L:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new AS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=qS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var TS=D.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=ou(i,r,l,d,_,g),l=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Nt&&l&&Uc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Ou(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var L=_.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(L,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(ao(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return gu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,wt(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,wt(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,wt(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function gu(i,r,l,d,g){var _=Rn(l)?Rs:gn.current;return _=dr(r,_),vr(r,g),l=ou(i,r,l,d,_,g),d=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Nt&&d&&Uc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),fu(r,l,d,g),d=!0;else if(i===null){var L=r.stateNode,Y=r.memoizedProps;L.props=Y;var J=L.context,oe=l.contextType;typeof oe=="object"&&oe!==null?oe=Yn(oe):(oe=Rn(l)?Rs:gn.current,oe=dr(r,oe));var be=l.getDerivedStateFromProps,Se=typeof be=="function"||typeof L.getSnapshotBeforeUpdate=="function";Se||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==d||J!==oe)&&_m(r,L,d,oe),es=!1;var ye=r.memoizedState;L.state=ye,za(r,d,L,g),J=r.memoizedState,Y!==d||ye!==J||jn.current||es?(typeof be=="function"&&(hu(r,l,be,d),J=r.memoizedState),(Y=es||gm(r,l,Y,d,ye,J,oe))?(Se||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(r.flags|=4194308)):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),L.props=d,L.state=J,L.context=oe,d=Y):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{L=r.stateNode,Kp(i,r),Y=r.memoizedProps,oe=r.type===r.elementType?Y:ri(r.type,Y),L.props=oe,Se=r.pendingProps,ye=L.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:gn.current,J=dr(r,J));var Le=l.getDerivedStateFromProps;(be=typeof Le=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==Se||ye!==J)&&_m(r,L,d,J),es=!1,ye=r.memoizedState,L.state=ye,za(r,d,L,g);var Ie=r.memoizedState;Y!==Se||ye!==Ie||jn.current||es?(typeof Le=="function"&&(hu(r,l,Le,d),Ie=r.memoizedState),(oe=es||gm(r,l,oe,d,ye,Ie,J)||!1)?(be||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(d,Ie,J),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(d,Ie,J)),typeof L.componentDidUpdate=="function"&&(r.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=Ie),L.props=d,L.state=Ie,L.context=J,d=oe):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),d=!1)}return vu(i,r,l,d,_,g)}function vu(i,r,l,d,g,_){jm(i,r);var L=(r.flags&128)!==0;if(!d&&!L)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,TS.current=r;var Y=L&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&L?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,Y,_)):bn(i,r,Y,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),eu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Vc(g),r.flags|=256,bn(i,r,l,d),r.child}var _u={dehydrated:null,treeContext:null,retryLane:0};function yu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=Pt.current,_=!1,L=(r.flags&128)!==0,Y;if((Y=L)||(Y=i!==null&&i.memoizedState===null?!1:(g&2)!==0),Y?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),wt(Pt,g&1),i===null)return qc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(L=d.children,i=d.fallback,_?(d=r.mode,_=r.child,L={mode:"hidden",children:L},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=L):_=ol(L,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=yu(l),r.memoizedState=_u,i):wu(r,L));if(g=i.memoizedState,g!==null&&(Y=g.dehydrated,Y!==null))return DS(i,r,L,d,Y,g,l);if(_){_=d.fallback,L=r.mode,g=i.child,Y=g.sibling;var J={mode:"hidden",children:d.children};return(L&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),Y!==null?_=as(Y,_):(_=zs(_,L,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,L=i.child.memoizedState,L=L===null?yu(l):{baseLanes:L.baseLanes|l,cachePool:null,transitions:L.transitions},_.memoizedState=L,_.childLanes=i.childLanes&~l,r.memoizedState=_u,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function wu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Vc(d),mr(r,i.child,null,l),i=wu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function DS(i,r,l,d,g,_,L){if(l)return r.flags&256?(r.flags&=-257,d=pu(Error(n(422))),Va(i,r,L,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,L,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,L),r.child.memoizedState=yu(L),r.memoizedState=_u,_);if((r.mode&1)===0)return Va(i,r,L,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var Y=d.dgst;return d=Y,_=Error(n(419)),d=pu(_,d,void 0),Va(i,r,L,d)}if(Y=(L&i.childLanes)!==0,Pn||Y){if(d=nn,d!==null){switch(L&-L){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|L))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Iu(),d=pu(Error(n(421))),Va(i,r,L,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=VS.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,Nt=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=wu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Qc(i.return,r,l)}function bu(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=Pt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(wt(Pt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),bu(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}bu(r,!0,l,null,_);break;case"together":bu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function MS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:eu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;wt(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(wt(Pt,Pt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(wt(Pt,Pt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);wt(Pt,Pt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),wt(Pt,Pt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,Su,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Su=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=Ne(i,g),d=Ne(i,d),_=[];break;case"select":g=B({},g,{value:void 0}),d=B({},d,{value:void 0}),_=[];break;case"textarea":g=dt(i,g),d=dt(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var L;l=null;for(oe in g)if(!d.hasOwnProperty(oe)&&g.hasOwnProperty(oe)&&g[oe]!=null)if(oe==="style"){var Y=g[oe];for(L in Y)Y.hasOwnProperty(L)&&(l||(l={}),l[L]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?_||(_=[]):(_=_||[]).push(oe,null));for(oe in d){var J=d[oe];if(Y=g!=null?g[oe]:void 0,d.hasOwnProperty(oe)&&J!==Y&&(J!=null||Y!=null))if(oe==="style")if(Y){for(L in Y)!Y.hasOwnProperty(L)||J&&J.hasOwnProperty(L)||(l||(l={}),l[L]="");for(L in J)J.hasOwnProperty(L)&&Y[L]!==J[L]&&(l||(l={}),l[L]=J[L])}else l||(_||(_=[]),_.push(oe,l)),l=J;else oe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,Y=Y?Y.__html:void 0,J!=null&&Y!==J&&(_=_||[]).push(oe,J)):oe==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(oe,""+J):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(J!=null&&oe==="onScroll"&&xt("scroll",i),_||Y===J||(_=[])):(_=_||[]).push(oe,J))}l&&(_=_||[]).push("style",l);var oe=_;(r.updateQueue=oe)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function xo(i,r){if(!Nt)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function _n(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function IS(i,r,l){var d=r.pendingProps;switch(Wc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _n(r),null;case 1:return Rn(r.type)&&Ra(),_n(r),null;case 3:return d=r.stateNode,_r(),kt(jn),kt(gn),iu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Tu(si),si=null))),Su(i,r),_n(r),null;case 5:tu(r);var g=Ts(_o.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return _n(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[fo]=_,i=(r.mode&1)!==0,l){case"dialog":xt("cancel",d),xt("close",d);break;case"iframe":case"object":case"embed":xt("load",d);break;case"video":case"audio":for(g=0;g<co.length;g++)xt(co[g],d);break;case"source":xt("error",d);break;case"img":case"image":case"link":xt("error",d),xt("load",d);break;case"details":xt("toggle",d);break;case"input":ut(d,_),xt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},xt("invalid",d);break;case"textarea":re(d,_),xt("invalid",d)}_e(l,_),g=null;for(var L in _)if(_.hasOwnProperty(L)){var Y=_[L];L==="children"?typeof Y=="string"?d.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",Y]):typeof Y=="number"&&d.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",""+Y]):o.hasOwnProperty(L)&&Y!=null&&L==="onScroll"&&xt("scroll",d)}switch(l){case"input":ht(d),Rt(d,_,!0);break;case"textarea":ht(d),Oe(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{L=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Fe(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=L.createElement(l,{is:d.is}):(i=L.createElement(l),l==="select"&&(L=i,d.multiple?L.multiple=!0:d.size&&(L.size=d.size))):i=L.createElementNS(i,l),i[hi]=r,i[fo]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(L=Ce(l,d),l){case"dialog":xt("cancel",i),xt("close",i),g=d;break;case"iframe":case"object":case"embed":xt("load",i),g=d;break;case"video":case"audio":for(g=0;g<co.length;g++)xt(co[g],i);g=d;break;case"source":xt("error",i),g=d;break;case"img":case"image":case"link":xt("error",i),xt("load",i),g=d;break;case"details":xt("toggle",i),g=d;break;case"input":ut(i,d),g=Ne(i,d),xt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=B({},d,{value:void 0}),xt("invalid",i);break;case"textarea":re(i,d),g=dt(i,d),xt("invalid",i);break;default:g=d}_e(l,g),Y=g;for(_ in Y)if(Y.hasOwnProperty(_)){var J=Y[_];_==="style"?me(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&q(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&xt("scroll",i):J!=null&&F(i,_,J,L))}switch(l){case"input":ht(i),Rt(i,d,!1);break;case"textarea":ht(i),Oe(i);break;case"option":d.value!=null&&i.setAttribute("value",""+pe(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?ft(i,!!d.multiple,_,!1):d.defaultValue!=null&&ft(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return _n(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(_o.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return _n(r),null;case 13:if(kt(Pt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Nt&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;_n(r),_=!1}else si!==null&&(Tu(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(Pt.current&1)!==0?Gt===0&&(Gt=3):Iu())),r.updateQueue!==null&&(r.flags|=4),_n(r),null);case 4:return _r(),Su(i,r),i===null&&uo(r.stateNode.containerInfo),_n(r),null;case 10:return Xc(r.type._context),_n(r),null;case 17:return Rn(r.type)&&Ra(),_n(r),null;case 19:if(kt(Pt),_=r.memoizedState,_===null)return _n(r),null;if(d=(r.flags&128)!==0,L=_.rendering,L===null)if(d)xo(_,!1);else{if(Gt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(L=Fa(i),L!==null){for(r.flags|=128,xo(_,!1),d=L.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,L=_.alternate,L===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=L.childLanes,_.lanes=L.lanes,_.child=L.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=L.memoizedProps,_.memoizedState=L.memoizedState,_.updateQueue=L.updateQueue,_.type=L.type,i=L.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return wt(Pt,Pt.current&1|2),r.child}i=i.sibling}_.tail!==null&&Et()>Sr&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(L),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),xo(_,!0),_.tail===null&&_.tailMode==="hidden"&&!L.alternate&&!Nt)return _n(r),null}else 2*Et()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304);_.isBackwards?(L.sibling=r.child,r.child=L):(l=_.last,l!==null?l.sibling=L:r.child=L,_.last=L)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=Et(),r.sibling=null,l=Pt.current,wt(Pt,d?l&1|2:l&1),r):(_n(r),null);case 22:case 23:return Mu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(_n(r),r.subtreeFlags&6&&(r.flags|=8192)):_n(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function OS(i,r){switch(Wc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),kt(jn),kt(gn),iu(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return tu(r),null;case 13:if(kt(Pt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return kt(Pt),null;case 4:return _r(),null;case 10:return Xc(r.type._context),null;case 22:case 23:return Mu(),null;case 24:return null;default:return null}}var Ga=!1,yn=!1,BS=typeof WeakSet=="function"?WeakSet:Set,De=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){It(i,r,d)}else l.current=null}function xu(i,r,l){try{l()}catch(d){It(i,r,d)}}var Bm=!1;function zS(i,r){if(Mc=ma,i=gp(),Nc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var L=0,Y=-1,J=-1,oe=0,be=0,Se=i,ye=null;t:for(;;){for(var Le;Se!==l||g!==0&&Se.nodeType!==3||(Y=L+g),Se!==_||d!==0&&Se.nodeType!==3||(J=L+d),Se.nodeType===3&&(L+=Se.nodeValue.length),(Le=Se.firstChild)!==null;)ye=Se,Se=Le;for(;;){if(Se===i)break t;if(ye===l&&++oe===g&&(Y=L),ye===_&&++be===d&&(J=L),(Le=Se.nextSibling)!==null)break;Se=ye,ye=Se.parentNode}Se=Le}l=Y===-1||J===-1?null:{start:Y,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ic={focusedElem:i,selectionRange:l},ma=!1,De=r;De!==null;)if(r=De,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,De=i;else for(;De!==null;){r=De;try{var Ie=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Be=Ie.memoizedProps,Ft=Ie.memoizedState,ie=r.stateNode,ee=ie.getSnapshotBeforeUpdate(r.elementType===r.type?Be:ri(r.type,Be),Ft);ie.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=r.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ke){It(r,r.return,ke)}if(i=r.sibling,i!==null){i.return=r.return,De=i;break}De=r.return}return Ie=Bm,Bm=!1,Ie}function ko(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&xu(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function ku(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[fo],delete r[Fc],delete r[bS],delete r[SS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Cu(i,r,l),i=i.sibling;i!==null;)Cu(i,r,l),i=i.sibling}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}var hn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Wt,l)}catch{}switch(l.tag){case 5:yn||wr(l,r);case 6:var d=hn,g=oi;hn=null,ns(i,r,l),hn=d,oi=g,hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):hn.removeChild(l.stateNode));break;case 18:hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?zc(i.parentNode,l):i.nodeType===1&&zc(i,l),to(i)):zc(hn,l.stateNode));break;case 4:d=hn,g=oi,hn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),hn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!yn&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,L=_.destroy;_=_.tag,L!==void 0&&((_&2)!==0||(_&4)!==0)&&xu(l,r,L),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!yn&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(Y){It(l,r,Y)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(yn=(d=yn)||l.memoizedState!==null,ns(i,r,l),yn=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new BS),r.forEach(function(d){var g=YS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 5:hn=Y.stateNode,oi=!1;break e;case 3:hn=Y.stateNode.containerInfo,oi=!0;break e;case 4:hn=Y.stateNode.containerInfo,oi=!0;break e}Y=Y.return}if(hn===null)throw Error(n(160));Hm(_,L,g),hn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(oe){It(g,r,oe)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{ko(3,i,i.return),Xa(3,i)}catch(Be){It(i,i.return,Be)}try{ko(5,i,i.return)}catch(Be){It(i,i.return,Be)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(Be){It(i,i.return,Be)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,L=l!==null?l.memoizedProps:_,Y=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&Pe(g,_),Ce(Y,L);var oe=Ce(Y,_);for(L=0;L<J.length;L+=2){var be=J[L],Se=J[L+1];be==="style"?me(g,Se):be==="dangerouslySetInnerHTML"?q(g,Se):be==="children"?te(g,Se):F(g,be,Se,oe)}switch(Y){case"input":Ut(g,_);break;case"textarea":xe(g,_);break;case"select":var ye=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Le=_.value;Le!=null?ft(g,!!_.multiple,Le,!1):ye!==!!_.multiple&&(_.defaultValue!=null?ft(g,!!_.multiple,_.defaultValue,!0):ft(g,!!_.multiple,_.multiple?[]:"",!1))}g[fo]=_}catch(Be){It(i,i.return,Be)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(Be){It(i,i.return,Be)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{to(r.containerInfo)}catch(Be){It(i,i.return,Be)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Ru=Et())),d&4&&Um(i);break;case 22:if(be=l!==null&&l.memoizedState!==null,i.mode&1?(yn=(oe=yn)||be,ai(r,i),yn=oe):ai(r,i),mi(i),d&8192){if(oe=i.memoizedState!==null,(i.stateNode.isHidden=oe)&&!be&&(i.mode&1)!==0)for(De=i,be=i.child;be!==null;){for(Se=De=be;De!==null;){switch(ye=De,Le=ye.child,ye.tag){case 0:case 11:case 14:case 15:ko(4,ye,ye.return);break;case 1:wr(ye,ye.return);var Ie=ye.stateNode;if(typeof Ie.componentWillUnmount=="function"){d=ye,l=ye.return;try{r=d,Ie.props=r.memoizedProps,Ie.state=r.memoizedState,Ie.componentWillUnmount()}catch(Be){It(d,l,Be)}}break;case 5:wr(ye,ye.return);break;case 22:if(ye.memoizedState!==null){Vm(Se);continue}}Le!==null?(Le.return=ye,De=Le):Vm(Se)}be=be.sibling}e:for(be=null,Se=i;;){if(Se.tag===5){if(be===null){be=Se;try{g=Se.stateNode,oe?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=Se.stateNode,J=Se.memoizedProps.style,L=J!=null&&J.hasOwnProperty("display")?J.display:null,Y.style.display=ce("display",L))}catch(Be){It(i,i.return,Be)}}}else if(Se.tag===6){if(be===null)try{Se.stateNode.nodeValue=oe?"":Se.memoizedProps}catch(Be){It(i,i.return,Be)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===i)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===i)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===i)break e;be===Se&&(be=null),Se=Se.return}be===Se&&(be=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Eu(i,_,g);break;case 3:case 4:var L=d.stateNode.containerInfo,Y=$m(i);Cu(i,Y,L);break;default:throw Error(n(161))}}catch(J){It(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function FS(i,r,l){De=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;De!==null;){var g=De,_=g.child;if(g.tag===22&&d){var L=g.memoizedState!==null||Ga;if(!L){var Y=g.alternate,J=Y!==null&&Y.memoizedState!==null||yn;Y=Ga;var oe=yn;if(Ga=L,(yn=J)&&!oe)for(De=g;De!==null;)L=De,J=L.child,L.tag===22&&L.memoizedState!==null?Ym(g):J!==null?(J.return=L,De=J):Ym(g);for(;_!==null;)De=_,Km(_),_=_.sibling;De=g,Ga=Y,yn=oe}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,De=_):qm(i)}}function qm(i){for(;De!==null;){var r=De;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:yn||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!yn)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var L=r.updateQueue;if(L!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,L,l)}break;case 5:var Y=r.stateNode;if(l===null&&r.flags&4){l=Y;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var oe=r.alternate;if(oe!==null){var be=oe.memoizedState;if(be!==null){var Se=be.dehydrated;Se!==null&&to(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||r.flags&512&&ku(r)}catch(ye){It(r,r.return,ye)}}if(r===i){De=null;break}if(l=r.sibling,l!==null){l.return=r.return,De=l;break}De=r.return}}function Vm(i){for(;De!==null;){var r=De;if(r===i){De=null;break}var l=r.sibling;if(l!==null){l.return=r.return,De=l;break}De=r.return}}function Ym(i){for(;De!==null;){var r=De;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){It(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){It(r,g,J)}}var _=r.return;try{ku(r)}catch(J){It(r,_,J)}break;case 5:var L=r.return;try{ku(r)}catch(J){It(r,L,J)}}}catch(J){It(r,r.return,J)}if(r===i){De=null;break}var Y=r.sibling;if(Y!==null){Y.return=r.return,De=Y;break}De=r.return}}var $S=Math.ceil,Qa=D.ReactCurrentDispatcher,Nu=D.ReactCurrentOwner,Xn=D.ReactCurrentBatchConfig,at=0,nn=null,Kt=null,fn=0,Bn=0,br=Qi(0),Gt=0,Co=null,Ms=0,Ja=0,ju=0,Eo=null,Ln=null,Ru=0,Sr=1/0,Mi=null,Za=!1,Pu=null,is=null,el=!1,ss=null,tl=0,No=0,Lu=null,nl=-1,il=0;function Sn(){return(at&6)!==0?Et():nl!==-1?nl:nl=Et()}function rs(i){return(i.mode&1)===0?1:(at&2)!==0&&fn!==0?fn&-fn:kS.transition!==null?(il===0&&(il=$f()),il):(i=mt,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<No)throw No=0,Lu=null,Error(n(185));Xr(i,l,d),((at&2)===0||i!==nn)&&(i===nn&&((at&2)===0&&(Ja|=l),Gt===4&&os(i,fn)),An(i,d),l===1&&at===0&&(r.mode&1)===0&&(Sr=Et()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;kb(i,r);var d=ha(i,i===nn?fn:0);if(d===0)l!==null&&Vr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Vr(l),r===1)i.tag===0?xS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),yS(function(){(at&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=Ue;break;case 4:l=Ge;break;case 16:l=Ve;break;case 536870912:l=St;break;default:l=Ve}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(at&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===nn?fn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=at;at|=2;var _=Jm();(nn!==i||fn!==r)&&(Mi=null,Sr=Et()+500,Os(i,r));do try{WS();break}catch(Y){Qm(i,Y)}while(!0);Gc(),Qa.current=_,at=g,Kt!==null?r=0:(nn=null,fn=0,r=Gt)}if(r!==0){if(r===2&&(g=dc(i),g!==0&&(d=g,r=Au(i,g))),r===1)throw l=Co,Os(i,0),os(i,d),An(i,Et()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!HS(g)&&(r=sl(i,d),r===2&&(_=dc(i),_!==0&&(d=_,r=Au(i,_))),r===1))throw l=Co,Os(i,0),os(i,d),An(i,Et()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Ru+500-Et(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var L=31-Nn(d);_=1<<L,L=r[L],L>g&&(g=L),d&=~_}if(d=g,d=Et()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*$S(d/1960))-d,10<d){i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,Et()),i.callbackNode===l?Gm.bind(null,i):null}function Au(i,r){var l=Eo;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Tu(r)),i}function Tu(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function HS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~ju,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((at&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,Et()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=dc(i);d!==0&&(r=d,l=Au(i,d))}if(l===1)throw l=Co,Os(i,0),os(i,r),An(i,Et()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,Et()),null}function Du(i,r){var l=at;at|=1;try{return i(r)}finally{at=l,at===0&&(Sr=Et()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(at&6)===0&&xr();var r=at;at|=1;var l=Xn.transition,d=mt;try{if(Xn.transition=null,mt=1,i)return i()}finally{mt=d,Xn.transition=l,at=r,(at&6)===0&&Zi()}}function Mu(){Bn=br.current,kt(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,_S(l)),Kt!==null)for(l=Kt.return;l!==null;){var d=l;switch(Wc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),kt(jn),kt(gn),iu();break;case 5:tu(d);break;case 4:_r();break;case 13:kt(Pt);break;case 19:kt(Pt);break;case 10:Xc(d.type._context);break;case 22:case 23:Mu()}l=l.return}if(nn=i,Kt=i=as(i.current,null),fn=Bn=r,Gt=0,Co=null,ju=Ja=Ms=0,Ln=Eo=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var L=_.next;_.next=g,d.next=L}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Kt;try{if(Gc(),$a.current=Ka,Ha){for(var d=Lt.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,tn=Yt=Lt=null,yo=!1,wo=0,Nu.current=null,l===null||l.return===null){Gt=1,Co=r,Kt=null;break}e:{var _=i,L=l.return,Y=l,J=r;if(r=fn,Y.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var oe=J,be=Y,Se=be.tag;if((be.mode&1)===0&&(Se===0||Se===11||Se===15)){var ye=be.alternate;ye?(be.updateQueue=ye.updateQueue,be.memoizedState=ye.memoizedState,be.lanes=ye.lanes):(be.updateQueue=null,be.memoizedState=null)}var Le=Sm(L);if(Le!==null){Le.flags&=-257,xm(Le,L,Y,_,r),Le.mode&1&&bm(_,oe,r),r=Le,J=oe;var Ie=r.updateQueue;if(Ie===null){var Be=new Set;Be.add(J),r.updateQueue=Be}else Ie.add(J);break e}else{if((r&1)===0){bm(_,oe,r),Iu();break e}J=Error(n(426))}}else if(Nt&&Y.mode&1){var Ft=Sm(L);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),xm(Ft,L,Y,_,r),Vc(yr(J,Y));break e}}_=J=yr(J,Y),Gt!==4&&(Gt=2),Eo===null?Eo=[_]:Eo.push(_),_=L;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ie=ym(_,J,r);qp(_,ie);break e;case 1:Y=J;var ee=_.type,se=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(is===null||!is.has(se)))){_.flags|=65536,r&=-r,_.lanes|=r;var ke=wm(_,Y,r);qp(_,ke);break e}}_=_.return}while(_!==null)}eg(l)}catch($e){r=$e,Kt===l&&l!==null&&(Kt=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Iu(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),nn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(nn,fn)}function sl(i,r){var l=at;at|=2;var d=Jm();(nn!==i||fn!==r)&&(Mi=null,Os(i,r));do try{US();break}catch(g){Qm(i,g)}while(!0);if(Gc(),at=l,Qa.current=d,Kt!==null)throw Error(n(261));return nn=null,fn=0,Gt}function US(){for(;Kt!==null;)Zm(Kt)}function WS(){for(;Kt!==null&&!tr();)Zm(Kt)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Kt=r,Nu.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=IS(l,r,Bn),l!==null){Kt=l;return}}else{if(l=OS(l,r),l!==null){l.flags&=32767,Kt=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Gt=6,Kt=null;return}}if(r=r.sibling,r!==null){Kt=r;return}Kt=r=i}while(r!==null);Gt===0&&(Gt=5)}function Bs(i,r,l){var d=mt,g=Xn.transition;try{Xn.transition=null,mt=1,KS(i,r,l,d)}finally{Xn.transition=g,mt=d}return null}function KS(i,r,l,d){do xr();while(ss!==null);if((at&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(Cb(i,_),i===nn&&(Kt=nn=null,fn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(Ve,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var L=mt;mt=1;var Y=at;at|=4,Nu.current=null,zS(i,l),Wm(l,i),dS(Ic),ma=!!Mc,Ic=Mc=null,i.current=l,FS(l),ca(),at=Y,mt=L,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),uc(l.stateNode),An(i,Et()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Pu,Pu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Lu?No++:(No=0,Lu=i):No=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=mt;try{if(Xn.transition=null,mt=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(at&6)!==0)throw Error(n(331));var g=at;for(at|=4,De=i.current;De!==null;){var _=De,L=_.child;if((De.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var J=0;J<Y.length;J++){var oe=Y[J];for(De=oe;De!==null;){var be=De;switch(be.tag){case 0:case 11:case 15:ko(8,be,_)}var Se=be.child;if(Se!==null)Se.return=be,De=Se;else for(;De!==null;){be=De;var ye=be.sibling,Le=be.return;if(zm(be),be===oe){De=null;break}if(ye!==null){ye.return=Le,De=ye;break}De=Le}}}var Ie=_.alternate;if(Ie!==null){var Be=Ie.child;if(Be!==null){Ie.child=null;do{var Ft=Be.sibling;Be.sibling=null,Be=Ft}while(Be!==null)}}De=_}}if((_.subtreeFlags&2064)!==0&&L!==null)L.return=_,De=L;else e:for(;De!==null;){if(_=De,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:ko(9,_,_.return)}var ie=_.sibling;if(ie!==null){ie.return=_.return,De=ie;break e}De=_.return}}var ee=i.current;for(De=ee;De!==null;){L=De;var se=L.child;if((L.subtreeFlags&2064)!==0&&se!==null)se.return=L,De=se;else e:for(L=ee;De!==null;){if(Y=De,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Xa(9,Y)}}catch($e){It(Y,Y.return,$e)}if(Y===L){De=null;break e}var ke=Y.sibling;if(ke!==null){ke.return=Y.return,De=ke;break e}De=Y.return}}if(at=g,Zi(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Wt,i)}catch{}d=!0}return d}finally{mt=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Xr(i,1,r),An(i,r))}function It(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Xr(r,1,i),An(r,i));break}}r=r.return}}function qS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,nn===i&&(fn&l)===l&&(Gt===4||Gt===3&&(fn&130023424)===fn&&500>Et()-Ru?Os(i,0):ju|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Xr(i,r,l),An(i,l))}function VS(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function YS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,MS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,Nt&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,gn.current);vr(r,l),g=ou(null,r,d,i,g,l);var _=au();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,fu(r,d,i,l),r=vu(null,r,d,!0,_,l)):(r.tag=0,Nt&&_&&Uc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=XS(d),i=ri(d,i),g){case 0:r=gu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),gu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var L=r.memoizedState;if(d=L.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,Nt=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&qc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,L=g.children,Oc(d,g)?L=null:_!==null&&Oc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,L,l),r.child;case 6:return i===null&&qc(r),null;case 13:return Am(i,r,l);case 4:return eu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,L=g.value,wt(Ia,d._currentValue),d._currentValue=L,_!==null)if(ii(_.value,L)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var Y=_.dependencies;if(Y!==null){L=_.child;for(var J=Y.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var oe=_.updateQueue;if(oe!==null){oe=oe.shared;var be=oe.pending;be===null?J.next=J:(J.next=be.next,be.next=J),oe.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Qc(_.return,l,r),Y.lanes|=l;break}J=J.next}}else if(_.tag===10)L=_.type===r.type?null:_.child;else if(_.tag===18){if(L=_.return,L===null)throw Error(n(341));L.lanes|=l,Y=L.alternate,Y!==null&&(Y.lanes|=l),Qc(L,l,r),L=_.sibling}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===r){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),fu(r,d,g,l),vu(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function GS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new GS(i,r,l,d)}function Ou(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XS(i){if(typeof i=="function")return Ou(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===A)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var L=2;if(d=i,typeof i=="function")Ou(i)&&(L=1);else if(typeof i=="string")L=5;else e:switch(i){case z:return zs(l.children,g,_,r);case Z:L=8,g|=8;break;case X:return i=Qn(12,l,r,g|2),i.elementType=X,i.lanes=_,i;case C:return i=Qn(13,l,r,g),i.elementType=C,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case U:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:L=10;break e;case O:L=9;break e;case I:L=11;break e;case A:L=14;break e;case $:L=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(L,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=U,i.lanes=l,i.stateNode={isHidden:!1},i}function Bu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function zu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function QS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hc(0),this.expirationTimes=hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Fu(i,r,l,d,g,_,L,Y,J){return i=new QS(i,r,l,Y,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(_),i}function JS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(zt(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,L,Y,J){return i=Fu(l,d,!0,i,g,_,L,Y,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Xr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),L=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,L),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,L),i!==null&&(li(i,g,L,_),Ba(i,g,L)),L}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function $u(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function ZS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Hu(i){this._internalRoot=i}cl.prototype.render=Hu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Hu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Uu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function e0(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var oe=ll(L);_.call(oe)}}var L=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=L,i[ji]=L.current,uo(i.nodeType===8?i.parentNode:i),Is(),L}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var Y=d;d=function(){var oe=ll(J);Y.call(oe)}}var J=Fu(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,uo(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var L=_;if(typeof g=="function"){var Y=g;g=function(){var J=ll(L);Y.call(J)}}al(r,L,i,g)}else L=e0(l,r,i,g,d);return ll(L)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Gr(r.pendingLanes);l!==0&&(fc(r,l|1),An(r,Et()),(at&6)===0&&(Sr=Et()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),$u(i,1)}},pc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}$u(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}$u(i,r)}},Kf=function(){return mt},qf=function(i,r){var l=mt;try{return mt=i,r()}finally{mt=l}},Je=function(i,r,l){switch(r){case"input":if(Ut(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Ye(d),Ut(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&ft(i,!!l.multiple,r,!1)}},Wn=Du,ui=Is;var t0={usingClientEntryPoint:!1,Events:[po,cr,ja,Zt,ni,Du]},jo={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n0={bundleType:jo.bundleType,version:jo.version,rendererPackageName:jo.rendererPackageName,rendererConfig:jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:jo.findFiberByHostInstance||ZS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Wt=hl.inject(n0),en=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t0,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uu(r))throw Error(n(200));return JS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Uu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Fu(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,uo(i.nodeType===8?i.parentNode:i),new Hu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Uu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",L=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(L=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,L),i[ji]=r.current,uo(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Du,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function d0(){if(vg)return qu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qu.exports=u0(),qu.exports}var _g;function h0(){if(_g)return fl;_g=1;var e=d0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var f0=h0();const p0=qh(f0);function Ht(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const Q_=e=>`nc_seen_${e}`;async function Me(e,t,n={}){const s=await Ht(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const cn=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",un=(e,t)=>`${cn(e)}/fleet/${t}`,ws=(e,t)=>Me(un(t,"status"),e),Yh=(e,t,n)=>Me(un(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Me(un(n,"down"),e,{method:"POST",body:t}),J_=(e,t,n)=>Me(un(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Me(un(n,"restart"),e,{method:"POST",body:{cell:t}}),Gh=(e,t)=>Me(un(t,"definitions"),e),m0=(e,t)=>Me(un(t,"credentials/status"),e),yg=(e,t,n,s)=>Me(un(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),g0=(e,t,n)=>Me(un(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),v0=(e,t,n)=>Me(un(n,"define-engine"),e,{method:"POST",body:{def:t}}),_0=(e,t,n,s,o)=>Me(un(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),y0=(e,t,n)=>Me(un(n,"remove-engine"),e,{method:"POST",body:{id:t}}),w0=(e,t,n)=>Me(un(n,"define-cell"),e,{method:"POST",body:{def:t}}),Z_=(e,t,n,s)=>Me(un(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),ey=(e,t,n=!1,s)=>Me(un(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),b0=(e,t,n)=>Me(un(n,"import-cell"),e,{method:"POST",body:t}),S0=(e,t,n)=>Me(un(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),x0=(e,t,n,s)=>Me(un(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Me(`${cn(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ty=(e,t,n,s)=>Me(`${cn(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Me(`${cn(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),ny=e=>Me("/api/settings",e),k0=e=>Me("/api/nodes",e),C0=e=>Me("/api/peers",e),iy=(e,t=[])=>Me(`${cn(t)}/vl-nodes`,e),wg=(e,t,n,s={},o=[])=>Me(`${cn(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),E0=(e,t,n=0,s=[])=>Me(`${cn(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),sy=e=>Me("/api/topology",e),Jh=(e,t)=>Me(`${cn(t)}/sessions`,e),Zh=(e,t)=>Me(`${cn(t)}/config`,e),bg=(e,t)=>Me(`${cn(t)}/topology`,e),Ud=(e,t)=>Me("/api/settings/config",e,{method:"POST",body:t}),N0=e=>Me("/api/settings/token/rotate",e,{method:"POST"}),j0=(e,t)=>Me("/api/settings/nodes/pair",e,{method:"POST",body:t}),Sg=(e,t,n=[])=>Me(`${cn(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),ry=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),R0=e=>Me("/api/settings/node-aliases",e),P0=(e,t,n)=>Me(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),xg=(e,t)=>Me(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),L0=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),A0=(e,t)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),T0=(e,t,n)=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),D0=(e,t,n,s=[])=>Me(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),M0=e=>Me("/api/settings/audio",e),I0=(e,t)=>Me("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),O0=e=>Me("/api/settings/audio/test",e,{method:"POST",body:{}}),B0=e=>Me("/api/settings/audio/stop",e,{method:"POST",body:{}}),z0=e=>Me("/api/settings/audio/groups",e),F0=(e,t,n)=>Me(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),$0=(e,t)=>Me(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),H0=e=>Me("/api/settings/service/regenerate",e,{method:"POST"}),U0=e=>Me("/api/settings/update/check",e,{method:"POST"}),W0=e=>Me("/api/settings/update/apply",e,{method:"POST"}),Jl=(e,t)=>`${cn(e)}/diagnostics/${t}`,K0=(e,t=[])=>Me(Jl(t,"status"),e),q0=(e,{after:t=0,limit:n=200}={},s=[])=>Me(`${Jl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),kg=(e,t,n,s=[])=>Me(Jl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),V0=(e,t=[])=>Me(Jl(t,"logs"),e,{method:"DELETE"}),Y0=(e,t=!0)=>Me(`/api/asks${t?"?open=1":""}`,e),G0=(e,t,n)=>Me(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),X0=(e,t)=>Me(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Me(`${cn(t)}/decks`,e),Cg=(e,t,n=[])=>Me(`${cn(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Me(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Q0=(e,t,n,s,o=[])=>Me(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),J0=(e,t,n,s=[])=>Me(`${cn(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),Z0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Ze({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Z0[e]||null})}const ex=["all","pinned","active","off","technical"],oy="nc_sidebar_views_v1",ay="nc_sidebar_order_v1";function ly(e){return ex.includes(e)?e:"all"}function tx(e,t=[],n="all"){const s=ly(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function nx(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,f=s.indexOf(e.key),m=s.indexOf(t.key),v=f===-1?Number.MAX_SAFE_INTEGER:f,b=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-b||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ay));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function sx(e,t=globalThis.localStorage){try{t.setItem(ay,JSON.stringify(e))}catch{}return e}function rx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],f=h.indexOf(n),m=h.indexOf(s);h.splice(f,1);const v=h.indexOf(s),b=f<m?v+1:v;return h.splice(b,0,n),{...e,[t]:h}}function ox(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(oy));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Eg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:ly((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function ax(e,t=globalThis.localStorage){try{t.setItem(oy,JSON.stringify(e))}catch{}return e}function Ng(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>tx(o,t,n)).sort((o,a)=>nx(o,a,t,s))}const tf=["it","en","es"];function lx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=lx(),cy="nc_lang",Wd="nc-lang";function uy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max-preview è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"I poteri per-nodo non esistono ancora: qui non c’è niente da concedere o togliere.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— fine risposta —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"scrivi il prompt per la sessione del device…","vl-prompt-send":"invia prompt","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso completo. Se sei già collegato a un hub, viene usato automaticamente; altrimenti serve solo il suo indirizzo SSH raggiungibile.","invite-network-hint":"Crea un invito per la rete a cui sei già collegato. Il nuovo dispositivo entrerà attraverso l’hub, non si collegherà direttamente a questo dispositivo.","invite-network-label":"Rete di destinazione","invite-network-via":"Hub","invite-network-route":"Un solo collegamento verso l’hub; nodi, celle e deck vengono smistati internamente.","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max-preview is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"Per-node powers do not exist yet: there is nothing to grant or withdraw here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— turn complete —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"write the prompt for the device session…","vl-prompt-send":"send prompt","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one complete one-time invitation. If this device already joined a hub, that hub is used automatically; otherwise only its reachable SSH address is required.","invite-network-hint":"Create an invitation for the network you already joined. The new device enters through the hub instead of connecting directly to this device.","invite-network-label":"Destination network","invite-network-via":"Hub","invite-network-route":"One connection to the hub; nodes, cells and decks are routed internally.","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max-preview es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"Los poderes por nodo aún no existen: aquí no hay nada que conceder ni retirar.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— fin de la respuesta —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"escribe el prompt para la sesión del dispositivo…","vl-prompt-send":"enviar prompt","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación completa de un solo uso. Si este dispositivo ya está unido a un hub, se usa automáticamente; si no, solo hace falta su dirección SSH alcanzable.","invite-network-hint":"Crea una invitación para la red a la que ya estás conectado. El nuevo dispositivo entra por el hub y no se conecta directamente a este dispositivo.","invite-network-label":"Red de destino","invite-network-via":"Hub","invite-network-route":"Una sola conexión al hub; nodos, celdas y decks se enrutan internamente.","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=uy(),t=e?e.getItem(cy):null;return tf.includes(t)?t:jl}function cx(e){const t=uy();if(t)try{t.setItem(cy,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Wd))}function p(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ux(e){return typeof window>"u"?()=>{}:(window.addEventListener(Wd,e),()=>window.removeEventListener(Wd,e))}const dy=tf;function kn(){return[N.useSyncExternalStore(ux,Ol,Ol),cx]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,U;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,f]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let R=!0;return(async()=>{if(t)try{const W=await ws(t,u?u.split("/"):[]);if(!R)return;if(v(W.provider==="builtin"&&(W.capabilities||[]).includes("edit")),W.provider==="builtin"&&(W.capabilities||[]).includes("definitions")){const B=await Gh(t,u?u.split("/"):[]);if(!R)return;const j=new Map((W.engines||[]).map(M=>[M.id,M]));f((B.engines||[]).map(M=>{var K,ne,le,fe,ge,pe,we;return{id:M.id,label:M.label||M.id,client:((K=M.managed)==null?void 0:K.client)||"",models:[...new Set([...((ne=j.get(M.id))==null?void 0:ne.models)||[],...((le=M.managedInfo)==null?void 0:le.models)||[]])].filter(Boolean),defaultModel:((fe=M.managed)==null?void 0:fe.model)||((ge=M.managedInfo)==null?void 0:ge.defaultModel)||"",policyDefault:((pe=M.managed)==null?void 0:pe.permissionPolicy)||((we=M.managed)!=null&&we.client&&M.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{R=!1}},[t,u]);const b=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=R=>(e==null?void 0:e.models)&&e.models[R]||"",S=R=>{const W=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[R];if(W==="standard"||W==="unsafe")return W;const B=h.find(j=>j.id===R);return B?B.policyDefault:"standard"},[w,x]=N.useState(b),[k,P]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((U=e==null?void 0:e.permissionPolicies)==null?void 0:U[e==null?void 0:e.engine])||"",[F,D]=N.useState(E),[V,G]=N.useState((e==null?void 0:e.boot)??!0),[z,Z]=N.useState(!1),[X,Q]=N.useState(null);N.useEffect(()=>{h.length&&(x(R=>R||b),P(R=>R||y((e==null?void 0:e.engine)||b)||""),D(R=>R==="standard"||R==="unsafe"?R:S((e==null?void 0:e.engine)||b)))},[h.length]);const O=N.useMemo(()=>h.find(R=>R.id===w)||null,[h,w]),I=!!(O&&["claude","codex","codex-vl","agy","kimi"].includes(O.client)),C=(O==null?void 0:O.client)==="shell";function T(R){x(R);const W=h.find(B=>B.id===R);P(y(R)||(W==null?void 0:W.defaultModel)||""),D(S(R))}async function A(R){R.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:V});else{const W=F==="standard"||F==="unsafe"?F:(O==null?void 0:O.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:k||"",...I?{permissionPolicy:W}:(O==null?void 0:O.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:V})}o()}catch(W){Q(String(W&&W.message||W)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:R=>R.stopPropagation(),onSubmit:A,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:p(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[p("engine"),c.jsx("select",{value:w,onChange:R=>T(R.target.value),children:h.map(R=>c.jsx("option",{value:R.id,children:R.label},R.id))})]}),!C&&c.jsxs("label",{className:"nc-field",children:[p("model"),c.jsx("input",{value:k,list:"nc-launch-models",placeholder:p("model-default"),onChange:R=>P(R.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((O==null?void 0:O.models)||[]).map(R=>c.jsx("option",{value:R},R))})]}),I?c.jsxs("label",{className:"nc-field",children:[p("permissions"),c.jsxs("select",{value:F,onChange:R=>D(R.target.value),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:p("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:p(C?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("boot-persist")]})]}),X&&c.jsx("div",{className:"nc-err",children:X}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:z,children:p("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:z,children:p(a?"power-off":"save-and-start")})]})]})})}const jg=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function dx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",f=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!f&&(s[u]=e&&e[u]||n)}return s}function Rg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Pg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,b,y;const u=[],h=new Set,f=new Set;for(const S of Array.isArray(e)?e:[]){if(!S||typeof S.name!="string"||!jg.test(S.name)||S.direction==="inbound"&&S.shared!==!0)continue;const w=[S.name],x=S.name;h.add(x);const k=((m=S.tunnel)==null?void 0:m.status)||"unknown",P=k==="up",E={name:S.name,label:S.label||S.name,originalLabel:S.label||S.name,alias:null,route:w,direct:!0,instanceId:S.nodeId||null,shared:S.shared===!0,tunnelStatus:k,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,direction:S.direction||"outbound",roles:S.roles||null,rolesKnown:S.rolesKnown===!0};if(S.nodeId&&f.add(S.nodeId),!S.nodeId&&S.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(((v=S.health)==null?void 0:v.auth)==="failed"||k==="degraded"&&((b=S.health)==null?void 0:b.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(k==="passive"||((y=S.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!P){u.push({...E,status:"down",downSince:s&&s[x]||null});continue}const F=n&&(n[x]||n[S.name])||null,D=o&&(o[x]||o[S.name]),V=!!(F&&!F.error&&Array.isArray(F.sessions)),G=!!(D&&D.available===!0&&Array.isArray(D.cells));if(!V&&!G){u.push({...E,status:"unreachable"});continue}const z=(V?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:x,route:w,key:`${x}:${Q.name}`})),Z=Rg(D,w,x),X=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:z,cells:Z,unmanaged:z.filter(Q=>!X.has(Q.name)),fleetAvailable:!!(D&&D.available),capabilities:D&&D.capabilities||[],engines:D&&D.engines||[],fleetProvider:D&&D.provider||null,sessionsAvailable:V,inventoryPartial:!V})}for(const S of Array.isArray(t)?t:[]){if(!S||!Array.isArray(S.route)||S.route.length<1||S.route.some(X=>!jg.test(X)))continue;const w=S.route.join("/");if(h.has(w)||S.instanceId&&f.has(S.instanceId))continue;S.instanceId&&f.add(S.instanceId);const x=S.label||S.route.join(" › "),k=S.instanceId&&a&&typeof a[S.instanceId]=="string"?a[S.instanceId]:null,P={name:S.name,label:k||x,originalLabel:x,alias:k,route:[...S.route],direct:!1,instanceId:S.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,lastSeen:S.lastSeen||null};if(S.stale){u.push({...P,status:"offline",downSince:s&&s[w]||S.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],D=!!(E&&!E.error&&Array.isArray(E.sessions)),V=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!D&&!V){u.push({...P,status:"unreachable",downSince:s&&s[w]||null});continue}const G=(D?E.sessions:[]).filter(X=>X&&typeof X.name=="string"&&X.name).map(X=>({...X,node:w,route:S.route,key:`${w}:${X.name}`})),z=Rg(F,S.route,w),Z=new Set(z.map(X=>X.tmuxSession).filter(Boolean));u.push({...P,status:"up",sessions:G,cells:z,unmanaged:G.filter(X=>!Z.has(X.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:S.lastSeen||null,sessionsAvailable:D,inventoryPartial:!D})}return u.sort((S,w)=>S.label.localeCompare(w.label))}function hy(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function hx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function fy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const fx=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var D;let m=[],v=[],b={},y="";if(await Promise.all([k0(e).then(V=>{m=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),sy(e).then(V=>{v=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),R0(e).then(V=>{b=V&&typeof V.aliasesByInstanceId=="object"?V.aliasesByInstanceId:{}}).catch(()=>{}),Ht("/api/config",e).then(V=>V.json()).then(V=>{y=V&&typeof V.instanceId=="string"?V.instanceId:""}).catch(()=>{})]),!u)return;const S=[{instanceId:y||null,route:[],label:null},...fy({nodes:v},y)],w=[];if(await Promise.all(S.map(async V=>{try{const G=await iy(e,V.route);for(const z of G.nodes||[]){const Z=hy(z,V);Z&&w.push(Z)}}catch{}})),!u)return;const x={},k={},P=new Set(m.map(V=>V.name)),E=[];for(const V of m)((D=V.tunnel)==null?void 0:D.status)==="up"&&(V.nodeId||V.paired!==!1)&&(V.direction!=="inbound"||V.shared===!0)&&E.push([V.name]);for(const V of v)!V.stale&&Array.isArray(V.route)&&!(V.route.length===1&&P.has(V.route[0]))&&E.push(V.route);if(await Promise.all(E.map(async V=>{const G=V.join("/");try{x[G]=await Jh(e,V)}catch{x[G]={error:"unreachable"}}try{k[G]=await ws(e,V)}catch{k[G]={available:!1}}})),!u)return;const F=Pg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current});a.current=dx(a.current,F,Math.floor(Date.now()/1e3)),o([...Pg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current}),...hx(w)])}h();const f=setInterval(h,fx);return()=>{u=!1,clearInterval(f)}},[e,t,n]),s}const Lg=52,Ag=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),f=N.useRef(0),[m,v]=N.useState(!1),b=()=>{var P,E,F,D;const k=h.current;(E=(P=k==null?void 0:k.over)==null?void 0:P.classList)==null||E.remove("nc-roster-over"),(D=(F=k==null?void 0:k.source)==null?void 0:F.classList)==null||D.remove("nc-roster-dragging"),f.current&&cancelAnimationFrame(f.current),f.current=0},y=(k=!1)=>{const P=h.current;if(!P)return;const E=P.target;b(),h.current=null,v(!1);try{P.handle.releasePointerCapture(P.pointerId)}catch{}k&&E&&E!==t&&a(t,E)&&s(t,E)},S=(k,P)=>{var Z,X,Q,O,I,C,T,A,$;const E=h.current;if(!E)return;E.x=k,E.y=P;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",D=(X=(Z=document.elementFromPoint(k,P))==null?void 0:Z.closest)==null?void 0:X.call(Z,F),V=u==="node"?(Q=D==null?void 0:D.dataset)==null?void 0:Q.nodeOrderKey:(O=D==null?void 0:D.dataset)==null?void 0:O.rosterKey,z=(u==="node"||((I=D==null?void 0:D.dataset)==null?void 0:I.position)===e)&&V&&V!==t&&a(t,V);E.over!==(z?D:null)&&((T=(C=E.over)==null?void 0:C.classList)==null||T.remove("nc-roster-over"),E.over=z?D:null,($=(A=E.over)==null?void 0:A.classList)==null||$.add("nc-roster-over")),E.target=z?V:null},w=()=>{const k=h.current;if(!k){f.current=0;return}const P=k.container;if(P){const E=P.getBoundingClientRect(),F=k.y<E.top+Lg?-Ag:k.y>E.bottom-Lg?Ag:0;F&&(P.scrollTop+=F,S(k.x,k.y))}f.current=requestAnimationFrame(w)};N.useEffect(()=>{const k=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},P=()=>y(!1);return window.addEventListener("keydown",k),window.addEventListener("blur",P),()=>{window.removeEventListener("keydown",k),window.removeEventListener("blur",P),b(),h.current=null}},[t,e,u]);const x=k=>{var D;if(k.pointerType==="mouse"&&k.button!==0)return;k.preventDefault(),k.stopPropagation(),k.currentTarget.focus({preventScroll:!0});const P=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=k.currentTarget.closest(P),F=k.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:k.pointerId,handle:k.currentTarget,source:E,container:F,target:null,over:null,x:k.clientX,y:k.clientY},(D=E==null?void 0:E.classList)==null||D.add("nc-roster-dragging");try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}v(!0),f.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${p("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:p("reorder-help"),onClick:k=>{k.preventDefault(),k.stopPropagation()},onDragStart:k=>k.preventDefault(),onKeyDown:k=>{k.key!=="ArrowUp"&&k.key!=="ArrowDown"||(k.preventDefault(),k.stopPropagation(),o(k.key==="ArrowUp"?-1:1))},onPointerDown:x,onPointerMove:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),S(k.clientX,k.clientY))},onPointerUp:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function px(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function mx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function gx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function vx(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function _x(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(px),[n,s]=N.useState(ox),[o,a]=N.useState(ix),u=y=>t(S=>mx(S,y)),h=y=>Eg(n,y),f=(y,S)=>s(w=>{const x={...w,[y]:{...Eg(w,y),...S}};return ax(x)}),m=(y,S)=>e.includes(y)===e.includes(S);function v(y,S,w,x){const k=e.includes(S),P=e.includes(w);if(k===P){if(k){t(E=>gx(E,S,w));return}a(E=>{var V;const F=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,D=gs(x,e,F?"technical":"all",Fi(E,y)).map(G=>G.key);return sx(rx(E,y,S,w,D))})}}function b(y,S,w,x){var V;const k=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,P=e.includes(S),E=gs(x,e,k?"technical":"all",Fi(o,y)).map(G=>G.key).filter(G=>e.includes(G)===P),F=E.indexOf(S),D=E[F+w];F>=0&&D&&v(y,S,D,x)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:f,canMoveRoster:m,moveRoster:v,stepRoster:b}}const py="nc_node_order_v1",yx=/^[a-f0-9]{16,64}$/;function qs(e){if(yx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Tg(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(py));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function wx(e,t=globalThis.localStorage){try{t.setItem(py,JSON.stringify(e))}catch{}return e}function Dg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function bx(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const f=a.indexOf(n);return a.splice(u<h?f+1:f,0,t),a}const Kd="nexuscrew-node-preferences";function Sx(){try{window.dispatchEvent(new Event(Kd))}catch{}}function my(){const[e,t]=N.useState(Tg);N.useEffect(()=>{const a=()=>t(Tg());return window.addEventListener("storage",a),window.addEventListener(Kd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(Kd,a)}},[]);const n=a=>Dg(a,e),s=(a,u,h)=>t(f=>{const m=bx(f,a,u,h);return wx(m),Sx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const f=Dg(h,e).map(qs),m=f.indexOf(a),v=f[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Tr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?p("node-passive"):e.status==="down"?e.downSince?p("tunnel-down-since").replace("{t}",Tr(e.downSince)):p("tunnel-down"):e.status==="unreachable"?p("node-unreachable"):e.status==="offline"?e.lastSeen?p("node-offline-seen").replace("{t}",Tr(e.lastSeen)):p("node-offline"):e.status==="needs-repair"?p("node-needs-repair"):""}function gy(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(Q_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||p("cell-off")).trim()}}if(t.working===!0){const s=p("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:p("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||p("cell-on")).trim()}}function vy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:vy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},f=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:f,label:u.cell,live:!!u.tmux,fresh:zl(h,f,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:vy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,xx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Dr=/^[a-f0-9]{16,64}$/,qd=e=>xx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!qd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Dr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&qd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const _y=9,yy=24,ta=11,kx=e=>{const t=Number(e);return t>=_y&&t<=yy?t:ta};function Pr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Cx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const zr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=zr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function wy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let b=1;b<e.columns.length;b+=1)e.columns[b].tiles.length<e.columns[v].tiles.length&&(v=b);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Cx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(b=>[$n(b),b]))),h=ys(t),f=e.columns.length?e.columns.reduce((v,b)=>v+(Number(b.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,b)=>{var y;return{width:((y=e.columns[b])==null?void 0:y.width)||f,tiles:[]}});return a.forEach((v,b)=>{const y=ys(v);if(!y)return;const S=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:S.height||1,fontSize:S.fontSize||ta};y.node&&(w.node=y.node),S.ownerId&&(w.ownerId=S.ownerId),S.unavailable===!0&&(w.unavailable=!0),m[b%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=zr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function Ex(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function Nx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=zr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function jx(e,t,n){const s=zr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Rx(e,t,n,s){const o=zr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Px(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=zr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(_y,Math.min(yy,h+(Number(s)||0))),a}function Lx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Mg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Pr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&qd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Dr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:kx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const by=/^[a-z0-9-]{1,32}$/,Ax=/^[A-Za-z0-9._-]{1,32}$/,Tx=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Dx=320;function Vd(e){return typeof e=="string"&&by.test(e)}const Mx=64;function Mr(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Mx&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function Sy(e){if(typeof e!="string"||!e||e.length>Dx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Ax.test(e.slice(0,t))&&Tx.test(e.slice(t+1))}function Ig(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Og({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Vd(o))return{ok:!1,error:"err-node-name"};if(!Sy(a))return{ok:!1,error:"err-ssh"};const u=Ig(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Ig(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const f={name:o,ssh:a};return u!==null&&(f.sshPort=u),h!==null&&(f.remotePort=h),{ok:!0,value:f}}function Ix(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Yd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Ix(e.since,t):null}}const Ox=new Set(["v","instanceId","port","label","invite"]),Bx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function zx(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function Fx(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(zx(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Ox:n.v===2?Bx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!by.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!Sy(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function $x(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const Hx=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Ux=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!Hx.includes(t.code)||!Ux.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:p(`fleet-recovery-${t.recovery}`)}}let Gd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Bg(){return Gd}function xy(e={}){return Gd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Gd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function Wx({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(""),[S,w]=N.useState(""),[x,k]=N.useState({bind:"127.0.0.1",port:""}),[P,E]=N.useState(""),[F,D]=N.useState([]),[V,G]=N.useState([]),[z,Z]=N.useState({}),[X,Q]=N.useState(new Set),[O,I]=N.useState(null),[C,T]=N.useState(null),{pins:A,orders:$,togglePin:U,viewFor:R,updateView:W,canMoveRoster:B,moveRoster:j,stepRoster:M}=rf(),{groupsFor:K,moveNode:ne,stepNode:le,nodeKey:fe}=my(),ge=K(u);N.useEffect(()=>{xy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:P})},[h,F,u,P]),N.useEffect(()=>{const H=new Map;for(const ae of F)H.set(kr(ae.cell),!!ae.boot);for(const ae of u){const ce=ae.route||[ae.name];for(const me of ae.cells||[])H.set(kr(me.cell,ce),!!me.boot)}Z(ae=>{let ce=!1;const me={...ae};for(const[Te,_e]of Object.entries(ae))H.has(Te)&&H.get(Te)===_e&&(delete me[Te],ce=!0);return ce?me:ae})},[F,u]);async function pe(){try{const ae=await(await Ht("/api/sessions",t)).json();ae.error?(v(ae.error),f([])):(v(null),f(ae.sessions||[]))}catch(H){v(String(H)),f([])}try{const H=await ws(t);D(H.available?H.cells||[]:[]),G(H.available?H.capabilities||[]:[])}catch{D([]),G([])}}N.useEffect(()=>{pe(),Ht("/api/config",t).then(ae=>ae.json()).then(ae=>{w(ae.version||""),k({bind:ae.bind||"127.0.0.1",port:ae.port||""}),E(Dr.test(String(ae.instanceId||""))?ae.instanceId:"")}).catch(()=>{});const H=setInterval(pe,4e3);return()=>clearInterval(H)},[]);async function we(){if(!x.port)return;const H=`http://${x.bind}:${x.port}/#token=${t}`;try{await navigator.clipboard.writeText(H)}catch{}}function He(H,ae,ce){const me=kr(H,ae);Z(Te=>({...Te,[me]:!!ce}))}function ht(H,ae=[]){const ce=kr(H.cell,ae);return Object.prototype.hasOwnProperty.call(z,ce)?z[ce]:!!H.boot}async function Ye(H,ae,ce=[]){H.stopPropagation();const me=kr(ae.cell,ce),Te=!ht(ae,ce);He(ae.cell,ce,Te),Q(_e=>new Set(_e).add(me));try{await J_(t,{cell:ae.cell,enabled:Te},ce),ce.length||D(_e=>_e.map(Ce=>Ce.cell===ae.cell?{...Ce,boot:Te}:Ce))}catch(_e){Z(Ce=>{const nt={...Ce};return delete nt[me],nt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ce=new Set(_e);return Ce.delete(me),Ce})}}async function Ae(H){if(!O)return;const{cell:ae}=O,ce=Array.isArray(O.route)?O.route:[];if(H.action==="up"){const me=await Yh(t,{cell:ae,boot:!!H.boot,...H.engine?{engine:H.engine}:{},...H.model!==void 0?{model:H.model}:{},...H.permissionPolicy?{permissionPolicy:H.permissionPolicy}:{}},ce),Te=uf(me);Te&&v(Te.text),He(ae,ce,!!H.boot)}else await Il(t,{cell:ae,boot:!!H.boot},ce),H.boot&&He(ae,ce,!1);pe()}async function Ne(H,ae=[]){try{await Xh(t,H,ae)}catch{return}pe()}async function ut(H,ae,ce=[]){try{await ty(t,H,ae,ce)}catch{return}pe()}async function Pe(H){if(!(!(H!=null&&H.direct)||C)){T(H.name);try{await ef(t,H.name,H.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function Ut(H){if(!(H!=null&&H.direct))return;const ae=window.prompt(p("rename-node-prompt"),H.label||H.name);if(ae===null)return;const ce=String(ae).trim();if(!Mr(ce)){window.alert(p("rename-node-invalid"));return}try{await ry(t,H.name,ce)}catch(me){window.alert(String((me==null?void 0:me.message)||me))}}const Rt=N.useMemo(()=>new Map((h||[]).map(H=>[H.name,H])),[h]),Dt=N.useMemo(()=>new Set(F.map(H=>H.tmuxSession)),[F]),vt=N.useMemo(()=>(h||[]).filter(H=>!Dt.has(H.name)),[h,Dt]),ft=N.useMemo(()=>af(F,vt,Rt),[F,vt,Rt]),dt=R("local"),re=N.useMemo(()=>gs(ft,A,dt.filter,Fi($,"local")).filter(H=>Ng(H,b)),[ft,A,dt.filter,b,$]),xe=ge.reduce((H,ae)=>H+(ae.cells||[]).length+(ae.unmanaged||[]).filter(ce=>!ce.technical).length,0),Oe=gs(ft,A,"all",Fi($,"local")).length+xe,Fe=ft.filter(H=>H.live).length+ge.reduce((H,ae)=>H+Fl(ae).rawItems.filter(ce=>ce.live).length,0),de=(h||[]).filter(H=>H.attached).length+ge.reduce((H,ae)=>H+(ae.sessions||[]).filter(ce=>ce.attached).length,0),ze=Math.min(de,Fe),q=x.port?`${x.bind}:${x.port}`:x.bind;function te(H,ae=null,ce=ft){var Mt,lt;const me=Array.isArray(ae==null?void 0:ae.route)?ae.route:[],Te=me.join("/"),_e=Te||"local",Ce=me.length?ae==null?void 0:ae.instanceId:P,nt=(et,Zt)=>e({session:et,...Te?{node:Te}:{},...Dr.test(String(Ce||""))?{ownerId:Ce}:{},...typeof Zt=="string"&&Zt?{cellName:Zt}:{}}),ot=B;if(H.type==="cell"){const et=H.value,Zt=me.length?((ae==null?void 0:ae.sessions)||[]).find(pt=>pt.name===et.tmuxSession):Rt.get(et.tmuxSession),ni=et.degraded?p("cell-degraded"):H.working?H.subtitle:et.tmux?p("cell-idle"):p("cell-off"),Wn=me.length===0||((ae==null?void 0:ae.capabilities)||[]).includes(et.active?"down":"up"),ui=me.length===0?V.includes("boot"):((ae==null?void 0:ae.capabilities)||[]).includes("boot"),ue=ht(et,me),je=kr(et.cell,me),qe=`${p(ue?"boot-disable":"boot-enable")} ${et.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:et.cell,canMove:ot,onMove:(pt,_t)=>j(_e,pt,_t,ce),onStep:pt=>M(_e,H.key,pt,ce)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>et.tmux&&nt(et.tmuxSession,et.cell),title:ni,"aria-label":`${et.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${et.degraded?"warn":et.tmux?`on${H.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:et.cell}),c.jsx("small",{title:H.subtitle,children:H.subtitle})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((Mt=Zt==null?void 0:Zt.outbox)==null?void 0:Mt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Zt.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${et.cell}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${ue?" on":""}`,disabled:X.has(je),onClick:pt=>Ye(pt,et,me),title:qe,"aria-label":qe,children:c.jsx(Ze,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${et.tmux?" on":""}${et.degraded?" warn":""}`,onClick:()=>I(me.length?{...et,boot:ue,route:me,availableEngines:(ae==null?void 0:ae.engines)||[]}:{...et,boot:ue}),title:et.active?p("power-off"):p("power-on"),"aria-label":`${et.active?p("power-off"):p("power-on")} ${et.cell}`,children:c.jsx(Ze,{name:"power",size:16})})]},H.key)}const Je=H.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Je.name,canMove:ot,onMove:(et,Zt)=>j(_e,et,Zt,ce),onStep:et=>M(_e,H.key,et,ce)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>nt(Je.name),children:[c.jsx("span",{className:Je.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Je.name}),c.jsx("small",{children:Je.preview?Je.preview:Je.cmd?Je.cmd:p("windows").replace("{n}",String(Je.windows||0))})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((lt=Je.outbox)==null?void 0:lt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Je.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Je.name}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Je.technical?" on":""}`,title:Je.technical?p("mark-normal"):p("mark-technical"),"aria-label":`${Je.technical?p("mark-normal"):p("mark-technical")} ${Je.name}`,onClick:()=>ut(Je.name,!Je.technical,me),children:"T"}),c.jsx("button",{className:"nc-menu",title:p("terminate"),"aria-label":`${p("terminate")} ${Je.name}`,onClick:()=>{window.confirm(p("terminate-confirm").replace("{name}",Je.name))&&Ne(Je.name,me)},children:"⋯"})]},H.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[p("fleet-tmux")," · ",Fe," ",p("sessions"),ze>0&&` · ${ze} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:p("settings"),children:c.jsx(Ze,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:pe,title:p("refresh"),children:c.jsx(Ze,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Oe>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:p("filter-placeholder"),"aria-label":p("filter-placeholder"),value:b,onChange:H=>y(H.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Gu,{label:p("position-local"),count:re.length,state:dt,dotClass:"on",onToggle:()=>W("local",{open:!dt.open}),onFilter:H=>W("local",{filter:H})}),dt.open&&re.map(H=>te(H,null,ft)),dt.open&&h===null&&c.jsx("div",{className:"nc-empty",children:p("loading-fleet")}),dt.open&&h!==null&&re.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]}),ge.map(H=>{const ce=gy(H.health,{passive:"warn"})||(H.status==="up"?"on":H.status==="passive"?"":"warn"),me=H.health?qo(H.health):H.status==="up"?"":Bi(H),_e=(H.route&&H.route.length?H.route:[H.name]).join("/"),Ce=R(_e);if(H.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:H.sessions.length,state:Ce,dotClass:ce,dotTitle:me,detail:H.status==="up"?"":Bi(H),onToggle:()=>W(_e,{open:!Ce.open}),onFilter:lt=>W(_e,{filter:lt})}),H.status==="up"&&Ce.open&&H.sessions.map(lt=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(H.peer),"aria-label":`${H.label||H.name}: ${lt.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:lt.name}),c.jsx("small",{children:p("vl-events-title")})]})]})},lt.key)),H.status==="up"&&Ce.open&&H.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:p("no-sessions-short")})]},`nodo-vl-${_e}-${H.name}`);const{rawItems:nt}=Fl(H),ot=gs(nt,A,Ce.filter,Fi($,_e)).filter(lt=>Ng(lt,b)),Je=H.direct&&H.health&&H.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${H.tunnelStatus==="up"?" on":""}`,disabled:C===H.name,title:H.tunnelStatus==="up"?p("power-off"):p("power-on"),"aria-label":`${H.tunnelStatus==="up"?p("power-off"):p("power-on")} ${H.label||H.name}`,onClick:()=>Pe(H),children:c.jsx(Ze,{name:"power",size:15})}):null,Mt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:fe(H),label:H.label||H.name,onMove:(lt,et)=>ne(lt,et,u),onStep:lt=>le(fe(H),lt,u)}),H.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:p("rename-node"),"aria-label":`${p("rename-node")} ${H.label||H.name}`,onClick:()=>Ut(H),children:"✎"}),Je]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:ot.length,state:Ce,dotClass:ce,dotTitle:me,detail:H.status==="up"?"":H.health&&qo(H.health)||Bi(H),onToggle:()=>W(_e,{open:!Ce.open}),onFilter:lt=>W(_e,{filter:lt}),onRename:H.direct?()=>Ut(H):null,action:Mt}),H.status==="up"&&Ce.open&&ot.map(lt=>te(lt,H,nt)),H.status==="up"&&Ce.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:we,title:p("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[S&&c.jsxs("span",{className:"nc-home-version",children:["v",S]}),c.jsxs("span",{className:"nc-home-endpoint",children:[q," · ",p("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:H=>H.stopPropagation(),children:dy.map((H,ae)=>c.jsxs("span",{children:[ae>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===H?" on":""}`,onClick:()=>a(H),title:H,children:H.toUpperCase()})]},H))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:p("fleet-new-cell"),"aria-label":p("fleet-new-cell"),children:"+"}),O&&c.jsx(Bl,{cell:O,token:t,route:Array.isArray(O.route)?O.route:[],onConfirm:Ae,onClose:()=>I(null)})]})}function Gu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:f=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:f?v=>{v.preventDefault(),f()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${p("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||p("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${p("filter-placeholder")}`,title:p(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:p("view-all")}),c.jsx("option",{value:"pinned",children:p("view-pinned")}),c.jsx("option",{value:"active",children:p("view-active")}),c.jsx("option",{value:"off",children:p("view-off")}),c.jsx("option",{value:"technical",children:p("view-technical")})]}),m]})}/**
|
|
41
41
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
42
42
|
* @license MIT
|
|
43
43
|
*
|
|
@@ -85,9 +85,9 @@ Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),s.put(a,13)}},Dd=n,D
|
|
|
85
85
|
The chosen QR Code version cannot contain this amount of data.
|
|
86
86
|
Minimum version required to store current data is: `+O+`.
|
|
87
87
|
`);const I=F(z,Z,Q),C=e.getSymbolSize(z),T=new s(C);return S(T,z),w(T),x(T,z),P(T,Z,0),z>=7&&k(T,z),E(T,I),isNaN(X)&&(X=u.getBestMask(T,P.bind(null,T,Z))),u.applyMask(X,T),P(T,Z,X),{modules:T,version:z,errorCorrectionLevel:Z,maskPattern:X,segments:Q}}return vd.create=function(z,Z){if(typeof z>"u"||z==="")throw new Error("No input text");let X=t.M,Q,O;return typeof Z<"u"&&(X=t.from(Z.errorCorrectionLevel,t.M),Q=m.from(Z.version),O=u.from(Z.maskPattern),Z.toSJISFunc&&e.setToSJISFunction(Z.toSJISFunc)),V(z,Q,X,O)},vd}var Id={},Od={},E_;function Gw(){return E_||(E_=1,(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let s=n.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+n);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(a){return[a,a]}))),s.length===6&&s.push("F","F");const o=parseInt(s.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const o=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,a=s.width&&s.width>=21?s.width:void 0,u=s.scale||4;return{width:a,scale:a?4:u,margin:o,color:{dark:t(s.color.dark||"#000000ff"),light:t(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,o){return o.width&&o.width>=s+o.margin*2?o.width/(s+o.margin*2):o.scale},e.getImageWidth=function(s,o){const a=e.getScale(s,o);return Math.floor((s+o.margin*2)*a)},e.qrToImageData=function(s,o,a){const u=o.modules.size,h=o.modules.data,f=e.getScale(u,a),m=Math.floor((u+a.margin*2)*f),v=a.margin*f,b=[a.color.light,a.color.dark];for(let y=0;y<m;y++)for(let S=0;S<m;S++){let w=(y*m+S)*4,x=a.color.light;if(y>=v&&S>=v&&y<m-v&&S<m-v){const k=Math.floor((y-v)/f),P=Math.floor((S-v)/f);x=b[h[k*u+P]?1:0]}s[w++]=x.r,s[w++]=x.g,s[w++]=x.b,s[w]=x.a}}})(Od)),Od}var N_;function QN(){return N_||(N_=1,(function(e){const t=Gw();function n(o,a,u){o.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=u,a.width=u,a.style.height=u+"px",a.style.width=u+"px"}function s(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,u,h){let f=h,m=u;typeof f>"u"&&(!u||!u.getContext)&&(f=u,u=void 0),u||(m=s()),f=t.getOptions(f);const v=t.getImageWidth(a.modules.size,f),b=m.getContext("2d"),y=b.createImageData(v,v);return t.qrToImageData(y.data,a,f),n(b,m,v),b.putImageData(y,0,0),m},e.renderToDataURL=function(a,u,h){let f=h;typeof f>"u"&&(!u||!u.getContext)&&(f=u,u=void 0),f||(f={});const m=e.render(a,u,f),v=f.type||"image/png",b=f.rendererOpts||{};return m.toDataURL(v,b.quality)}})(Id)),Id}var Bd={},j_;function JN(){if(j_)return Bd;j_=1;const e=Gw();function t(o,a){const u=o.a/255,h=a+'="'+o.hex+'"';return u<1?h+" "+a+'-opacity="'+u.toFixed(2).slice(1)+'"':h}function n(o,a,u){let h=o+a;return typeof u<"u"&&(h+=" "+u),h}function s(o,a,u){let h="",f=0,m=!1,v=0;for(let b=0;b<o.length;b++){const y=Math.floor(b%a),S=Math.floor(b/a);!y&&!m&&(m=!0),o[b]?(v++,b>0&&y>0&&o[b-1]||(h+=m?n("M",y+u,.5+S+u):n("m",f,0),f=0,m=!1),y+1<a&&o[b+1]||(h+=n("h",v),v=0)):f++}return h}return Bd.render=function(a,u,h){const f=e.getOptions(u),m=a.modules.size,v=a.modules.data,b=m+f.margin*2,y=f.color.light.a?"<path "+t(f.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",S="<path "+t(f.color.dark,"stroke")+' d="'+s(v,m,f.margin)+'"/>',w='viewBox="0 0 '+b+" "+b+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(f.width?'width="'+f.width+'" height="'+f.width+'" ':"")+w+' shape-rendering="crispEdges">'+y+S+`</svg>
|
|
88
|
-
`;return typeof h=="function"&&h(null,k),k},Bd}var R_;function ZN(){if(R_)return jr;R_=1;const e=TN(),t=XN(),n=QN(),s=JN();function o(a,u,h,f,m){const v=[].slice.call(arguments,1),b=v.length,y=typeof v[b-1]=="function";if(!y&&!e())throw new Error("Callback required as last argument");if(y){if(b<2)throw new Error("Too few arguments provided");b===2?(m=h,h=u,u=f=void 0):b===3&&(u.getContext&&typeof m>"u"?(m=f,f=void 0):(m=f,f=h,h=u,u=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(h=u,u=f=void 0):b===2&&!u.getContext&&(f=h,h=u,u=void 0),new Promise(function(S,w){try{const x=t.create(h,f);S(a(x,u,f))}catch(x){w(x)}})}try{const S=t.create(h,f);m(null,a(S,u,f))}catch(S){m(S)}}return jr.create=t.create,jr.toCanvas=o.bind(null,n.render),jr.toDataURL=o.bind(null,n.renderToDataURL),jr.toString=o.bind(null,function(a,u,h){return s.render(a,h)}),jr}var e2=ZN();const t2=qh(e2);function P_(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.data=="string"?e.data.trim():""}function n2(e){const t=String(e||"").trim();if(!t)return{kind:"empty"};const n=Fx(t);if(!n||!n.ok)return{kind:"invalid"};const s=[];return n.ssh||s.push("ssh"),n.name||s.push("name"),s.length?{kind:"partial",decoded:n,missing:s}:{kind:"complete",decoded:n}}function i2(e,t,n=new Set,s=!1){if(!t||!t.ok)return e;const o=$x(e,t,n);return t.version===2&&t.name&&!n.has("name")&&!s&&(o.name=t.name),!n.has("label")&&!o.label&&t.label&&(o.label=t.label),o}function L_(e,t,n=new Set,s=!1){const o=String(t||"").trim(),a=n2(o);let u={...e,pairingUrl:o};return(a.kind==="complete"||a.kind==="partial")&&(u={...i2(u,a.decoded,n,s),pairingUrl:o}),{classification:a,form:u}}function Ml(e,t){const n=String(t||"").toLowerCase();if(!/^[a-f0-9]{16,64}$/.test(n))return"";const s=String(e||"NexusCrew").replace(/([a-z0-9])([A-Z])/g,"$1 $2");let o=vs(s);(o==="localhost"||o==="node")&&(o="nexuscrew");const a=n.slice(0,4),u=Math.max(1,32-a.length-1);return`${o.slice(0,u).replace(/-+$/g,"")||"n"}-${a}`}function s2(e,{deviceDefault:t="",localNodeId:n="",localNameDefault:s=""}={}){const o={name:e.name,ssh:e.ssh,pairingUrl:e.pairingUrl,...e.label?{label:e.label}:{},...e.sshPort?{sshPort:Number(e.sshPort)}:{}},a=e.localLabel||t;a&&(o.localLabel=a);const u=String(e.localName||Ml(a,n)||s||"").trim();return u&&(o.localName=u),o}function r2(){const e=new Set;let t=!1;return{canAuto(n){return!t&&!e.has(String(n||""))},start(n){return t?!1:(t=!0,e.add(String(n||"")),!0)},finish(){t=!1},reset(n){e.delete(String(n||""))},isBusy(){return t}}}const o2=["validation","conflict","ssh-start","ssh-ready","join","tunnel-final","confirm","health"];function a2(e){const t=e&&e.data||{},n=typeof t.stage=="string"&&t.stage?t.stage:"",s=typeof t.detail=="string"&&t.detail?t.detail:"";return{stage:n,code:typeof t.code=="string"?t.code:"",detail:s,hint:typeof t.hint=="string"?t.hint:"",suggestedName:typeof t.suggestedName=="string"?t.suggestedName:"",retryable:typeof t.retryable=="boolean"?t.retryable:!n,message:s||String(e&&e.message||e)}}const l2="modulepreload",c2=function(e){return"/"+e},A_={},u2=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let u=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),f=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));o=u(n.map(m=>{if(m=c2(m),m in A_)return;A_[m]=!0;const v=m.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${b}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":l2,v||(y.as="script"),y.crossOrigin="",y.href=m,f&&y.setAttribute("nonce",f),document.head.appendChild(y),v)return new Promise((S,w)=>{y.addEventListener("load",S),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${m}`)))})}))}function a(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&a(h.reason);return t().catch(a)})};class tt{constructor(t,n,s,o,a){this._legacyCanvasSize=tt.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),s&&typeof s=="object"?this._onDecode=n:(console.warn(s||o||a?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof s=="object"?s:{},this._onDecodeError=n.onDecodeError||(typeof s=="function"?s:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof s=="number"?s:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let u=!1;if(t.hidden&&(t.hidden=!1,u=!0),document.body.contains(t)||(document.body.appendChild(t),u=!0),s=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),a=this.$overlay.style,a.position="absolute",a.display="none",a.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}s.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let h=window.getComputedStyle(t);h.display==="none"&&(t.style.setProperty("display","block","important"),u=!0),h.visibility!=="visible"&&(t.style.setProperty("visibility","visible","important"),u=!0),u&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=tt.createQrEngine()}static set WORKER_PATH(t){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await tt.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),s;try{t&&(await n()).every(o=>!o.label)&&(s=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,a)=>({id:o.deviceId,label:o.label||(a===0?"Default Camera":`Camera ${a+1}`)}))}finally{s&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),tt._stopVideoStream(s))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),tt._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(t){throw this._flashOn=!1,t}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),tt._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?tt._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(t){if(!this._paused)throw this._active=!1,t}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(tt._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(s=>setTimeout(s,300)),this._paused?(n(),!0):!1)}async setCamera(t){t!==this._preferredCamera&&(this._preferredCamera=t,await this._restartVideoStream())}static async scanImage(t,n,s,o,a=!1,u=!1){let h,f=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(h=n.scanRegion,s=n.qrEngine,o=n.canvas,a=n.disallowCanvasResizing||!1,u=n.alsoTryWithoutScanRegion||!1,f=!0):console.warn(n||s||o||a||u?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!s;try{let m,v;[s,m]=await Promise.all([s||tt.createQrEngine(),tt._loadImage(t)]),[o,v]=tt._drawToCanvas(m,h,o,a);let b;if(s instanceof Worker){let y=s;n||tt._postWorkerMessageSync(y,"inversionMode","both"),b=await new Promise((S,w)=>{let x,k,P,E=-1;k=D=>{D.data.id===E&&(y.removeEventListener("message",k),y.removeEventListener("error",P),clearTimeout(x),D.data.data!==null?S({data:D.data.data,cornerPoints:tt._convertPoints(D.data.cornerPoints,h)}):w(tt.NO_QR_CODE_FOUND))},P=D=>{y.removeEventListener("message",k),y.removeEventListener("error",P),clearTimeout(x),w("Scanner error: "+(D?D.message||D:"Unknown Error"))},y.addEventListener("message",k),y.addEventListener("error",P),x=setTimeout(()=>P("timeout"),1e4);let F=v.getImageData(0,0,o.width,o.height);E=tt._postWorkerMessageSync(y,"decode",F,[F.data.buffer])})}else b=await Promise.race([new Promise((y,S)=>window.setTimeout(()=>S("Scanner error: timeout"),1e4)),(async()=>{try{var[y]=await s.detect(o);if(!y)throw tt.NO_QR_CODE_FOUND;return{data:y.rawValue,cornerPoints:tt._convertPoints(y.cornerPoints,h)}}catch(S){if(y=S.message||S,/not implemented|service unavailable/.test(y))return tt._disableBarcodeDetector=!0,tt.scanImage(t,{scanRegion:h,canvas:o,disallowCanvasResizing:a,alsoTryWithoutScanRegion:u});throw`Scanner error: ${y}`}})()]);return f?b:b.data}catch(m){if(!h||!u)throw m;let v=await tt.scanImage(t,{qrEngine:s,canvas:o,disallowCanvasResizing:a});return f?v:v.data}finally{n||tt._postWorkerMessage(s,"close")}}setGrayscaleWeights(t,n,s,o=!0){tt._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:n,blue:s,useIntegerApproximation:o})}setInversionMode(t){tt._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>u2(()=>import("./qr-scanner-worker.min-D85Z9gVD.js"),[]).then(s=>s.createWorker()),!(!tt._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:s})=>/Chromium/i.test(s))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:s,platformVersion:o})=>/arm/i.test(s||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?t():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(t){let n=Math.round(.6666666666666666*Math.min(t.videoWidth,t.videoHeight));return{x:Math.round((t.videoWidth-n)/2),y:Math.round((t.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var t=this.$video,n=t.videoWidth,s=t.videoHeight,o=t.offsetWidth,a=t.offsetHeight,u=t.offsetLeft,h=t.offsetTop,f=window.getComputedStyle(t),m=f.objectFit,v=n/s,b=o/a;switch(m){case"none":var y=n,S=s;break;case"fill":y=o,S=a;break;default:(m==="cover"?v>b:v<b)?(S=a,y=S*v):(y=o,S=y/v),m==="scale-down"&&(y=Math.min(y,n),S=Math.min(S,s))}var[w,x]=f.objectPosition.split(" ").map((P,E)=>{const F=parseFloat(P);return P.endsWith("%")?(E?a-S:o-y)*F/100:F});f=this._scanRegion.width||n,b=this._scanRegion.height||s,m=this._scanRegion.x||0;var k=this._scanRegion.y||0;v=this.$overlay.style,v.width=`${f/n*y}px`,v.height=`${b/s*S}px`,v.top=`${h+x+k/s*S}px`,s=/scaleX\(-1\)/.test(t.style.transform),v.left=`${u+(s?o-w-y:w)+(s?n-m-f:m)/n*y}px`,v.transform=t.style.transform}})}static _convertPoints(t,n){if(!n)return t;let s=n.x||0,o=n.y||0,a=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let u of t)u.x=u.x*a+s,u.y=u.y*n+o;return t}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(o=>setTimeout(o,n-t)),this._lastScanTimestamp=Date.now();try{var s=await tt.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!tt._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=tt.createQrEngine()),s?(this._onDecode?this._onDecode(s):this._legacyOnDecode&&this._legacyOnDecode(s.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",s.cornerPoints.map(({x:o,y:a})=>`${o},${a}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(t){t!==tt.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let t=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],s=n.map(o=>Object.assign({},o,{[t]:{exact:this._preferredCamera}}));for(let o of[...s,...n])try{let a=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),u=this._getFacingMode(a)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:a,facingMode:u}}catch{}throw"Camera not found."}async _restartVideoStream(){let t=this._paused;await this.pause(!0)&&!t&&this._active&&await this.start()}static _stopVideoStream(t){for(let n of t.getTracks())n.stop(),t.removeTrack(n)}_setVideoMirror(t){this.$video.style.transform="scaleX("+(t==="user"?-1:1)+")"}_getFacingMode(t){return(t=t.getVideoTracks()[0])?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(t,n,s,o=!1){s=s||document.createElement("canvas");let a=n&&n.x?n.x:0,u=n&&n.y?n.y:0,h=n&&n.width?n.width:t.videoWidth||t.width,f=n&&n.height?n.height:t.videoHeight||t.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:h,n=n&&n.downScaledHeight?n.downScaledHeight:f,s.width!==o&&(s.width=o),s.height!==n&&(s.height=n)),n=s.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(t,a,u,h,f,0,0,s.width,s.height),[s,n]}static async _loadImage(t){if(t instanceof Image)return await tt._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t=="string"){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await tt._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(t){t.complete&&t.naturalWidth!==0||await new Promise((n,s)=>{let o=a=>{t.removeEventListener("load",o),t.removeEventListener("error",o),a instanceof ErrorEvent?s("Image load error"):n()};t.addEventListener("load",o),t.addEventListener("error",o)})}static async _postWorkerMessage(t,n,s,o){return tt._postWorkerMessageSync(await t,n,s,o)}static _postWorkerMessageSync(t,n,s,o){if(!(t instanceof Worker))return-1;let a=tt._workerMessageId++;return t.postMessage({id:a,type:n,data:s},o),a}}tt.DEFAULT_CANVAS_SIZE=400;tt.NO_QR_CODE_FOUND="No QR code found";tt._disableBarcodeDetector=!1;tt._workerMessageId=0;function d2({onResult:e,onClose:t}){const n=N.useRef(null),s=N.useRef(null),o=N.useRef(!1),[a,u]=N.useState("");N.useEffect(()=>{let f=!1;const m=n.current,v=b=>{f||o.current||(o.current=!0,e(b))};return(async()=>{if(typeof navigator>"u"||!navigator.mediaDevices||typeof navigator.mediaDevices.getUserMedia!="function"){u(p("qr-unsupported"));return}let b=!1;try{b=await tt.hasCamera()}catch{b=!1}if(!b){u(p("qr-no-camera"));return}if(f||!m)return;const y=new tt(m,S=>{const w=P_(S);w&&v(w)},{returnDetailedScanResult:!0,preferredCamera:"environment",calculateScanRegion:S=>{const w=S.videoWidth||640,x=S.videoHeight||480,k=Math.max(1,Math.round(Math.min(w,x)*.92));return{x:Math.round((w-k)/2),y:Math.round((x-k)/2),width:k,height:k,downScaledWidth:600,downScaledHeight:600}},highlightScanRegion:!0,highlightCodeOutline:!0});s.current=y;try{await y.start()}catch(S){if(f)return;const w=S&&S.name||"";u(p(w==="NotAllowedError"||w==="SecurityError"?"qr-permission":w==="NotFoundError"||w==="OverconstrainedError"||w==="NotReadableError"?"qr-no-camera":"qr-unsupported"))}})(),()=>{f=!0;const b=s.current;if(b){try{b.stop()}catch{}try{b.destroy()}catch{}s.current=null}const y=m,S=y&&y.srcObject;if(S&&typeof S.getTracks=="function"){for(const w of S.getTracks())try{w.stop()}catch{}try{y.srcObject=null}catch{}}}},[]);const h=async f=>{const m=f.target.files&&f.target.files[0];if(f.target.value="",!!m)try{const v=await tt.scanImage(m,{returnDetailedScanResult:!0}),b=P_(v);if(!b)throw new Error("empty");o.current||(o.current=!0,e(b))}catch{u(p("pairing-qr-invalid"))}};return c.jsx("div",{className:"nc-sheet-overlay nc-qr-overlay",onClick:t,children:c.jsxs("div",{className:"nc-sheet nc-qr-modal",onClick:f=>f.stopPropagation(),children:[c.jsx("div",{className:"nc-sheet-head",children:c.jsx("b",{children:p("scan-qr")})}),c.jsx("video",{ref:n,className:"nc-qr-video",playsInline:!0,muted:!0}),a&&c.jsx("div",{className:"nc-err",role:"alert",children:a}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsxs("label",{className:"nc-btn ghost nc-qr-upload",children:[p("qr-upload"),c.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:h})]}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:t,children:p("cancel")})]})]})})}const T_=()=>({name:"",label:"",ssh:"",sshPort:"",pairingUrl:"",localLabel:"",localName:""});function Xw({token:e,initial:t="",autoStart:n=!1,deviceDefault:s="",localNodeId:o="",localNameDefault:a="",readonly:u=!1,onSuccess:h,onBusyChange:f}){const[m,v]=N.useState(T_),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState("idle"),[P,E]=N.useState(null),[F,D]=N.useState(""),[V,G]=N.useState(!1),[z,Z]=N.useState(!1),X=N.useRef(r2()),Q=N.useRef(new Set),O=x==="busy",I=Ml(m.localLabel||s,o)||a,C=z?m.localName:I;N.useEffect(()=>(f&&f(O),()=>{f&&f(!1)}),[O,f]);const T=async B=>{const j=String(B.pairingUrl||"").trim();if(X.current.start(j)){k("busy"),E(null),D("");try{await j0(e,s2({...B,localName:z?B.localName:Ml(B.localLabel||s,o)||a},{deviceDefault:s,localNodeId:o,localNameDefault:a})),k("ok"),y(!1),v(T_()),Q.current=new Set,G(!1),Z(!1),X.current.finish(),h&&await h()}catch(M){const K=a2(M);E(K),k("idle"),X.current.finish(),K.code==="peer-name-conflict"&&Vd(K.suggestedName)&&(Z(!0),Q.current.add("localName"),v(ne=>({...ne,localName:K.suggestedName}))),(K.stage==="validation"||K.stage==="conflict"||K.stage==="ssh-start"||K.stage==="ssh-ready"||String(K.code||"").startsWith("ssh-"))&&y(!0)}}},A=(B,j=!0)=>{const{classification:M,form:K}=L_(m,B,Q.current,V),ne=K.pairingUrl;if(E(null),D(""),x==="ok"&&k("idle"),v(K),M.kind==="invalid"){E({stage:"validation",code:"bad-link",message:p("pair-invalid-link"),hint:p("pair-invalid-hint"),retryable:!0});return}if(M.kind==="partial"){y(!0),D(M.missing.includes("ssh")?p("pair-missing-ssh"):p("pair-missing-name"));return}M.kind==="complete"&&j&&!u&&X.current.canAuto(ne)&&T(K)};N.useEffect(()=>{t&&A(t,n)},[]);const $=()=>{const B=String(m.pairingUrl||"").trim(),{classification:j,form:M}=L_(m,B,Q.current,V);if(v(M),D(""),E(null),j.kind==="empty"){E({stage:"validation",message:p("pairing-required"),retryable:!0});return}if(j.kind==="invalid"){E({stage:"validation",code:"bad-link",message:p("pair-invalid-link"),hint:p("pair-invalid-hint"),retryable:!0});return}if(!M.ssh||!M.name){y(!0),D(M.ssh?p("pair-missing-name"):p("pair-missing-ssh"));return}if(M.label&&!Mr(M.label)){E({stage:"validation",message:p("err-label"),retryable:!0});return}if(M.localLabel&&!Mr(M.localLabel)){E({stage:"validation",message:p("err-label"),retryable:!0});return}const K=z?M.localName:Ml(M.localLabel||s,o)||a;if(!Vd(K)||K==="localhost"){y(!0),E({stage:"validation",code:"bad-local-name",message:p("err-local-name"),retryable:!0});return}X.current.reset(B),T(M)},U=async()=>{try{if(!navigator.clipboard||typeof navigator.clipboard.readText!="function")throw new Error("unsupported");const B=await navigator.clipboard.readText();B&&B.trim()?A(B):D(p("pair-clipboard-empty"))}catch{D(p("pair-clipboard-denied"))}},R=(B,j)=>{Q.current.add(B),v(M=>({...M,[B]:j}))},W=P&&P.stage&&(o2.includes(P.stage)||P.stage==="internal")?p(`pair-stage-${P.stage}`):p("pair-stage-generic");return c.jsxs("div",{className:"nc-set-form nc-pair-card",children:[c.jsx("div",{className:"nc-sheet-label",children:p("pair-card-title")}),c.jsx("div",{className:"nc-set-info",children:p("pair-card-help")}),c.jsx("input",{className:"nc-pair-input",placeholder:p("pair-paste-ph"),value:m.pairingUrl,disabled:u||O,onChange:B=>{v({...m,pairingUrl:B.target.value}),E(null),D("")},onPaste:B=>{const j=B.clipboardData&&B.clipboardData.getData("text")||"";j.trim()&&(B.preventDefault(),A(j))},onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),$())}}),c.jsxs("div",{className:"nc-pair-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:U,children:p("pair-paste-btn")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:()=>w(!0),children:p("scan-qr")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||O,title:u?p("settings-readonly"):"",onClick:$,children:p("test-and-connect")})]}),c.jsxs("div",{className:"nc-pair-status","aria-live":"polite",children:[O&&c.jsx("div",{className:"nc-pair-progress",children:p("pair-progress")}),x==="ok"&&c.jsx("div",{className:"nc-set-test ok",children:p("node-connected")}),F&&c.jsx("div",{className:"nc-set-hint nc-pair-notice",children:F}),P&&c.jsxs("div",{className:"nc-err",role:"alert",children:[c.jsx("b",{children:W})," — ",P.message,P.hint&&c.jsx("div",{className:"nc-pair-hint",children:P.hint}),P.retryable&&c.jsx("div",{children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:$,children:p("pair-retry")})})]})]}),c.jsxs("button",{type:"button",className:"nc-btn ghost nc-pair-advanced-toggle",disabled:O,onClick:()=>y(B=>!B),children:[b?"▾":"▸"," ",p("pair-advanced")]}),b&&c.jsxs("div",{className:"nc-pair-advanced",children:[c.jsxs("label",{className:"nc-field",children:[p("node-display-label"),c.jsx("input",{placeholder:"Home Relay",value:m.label,disabled:u||O,onChange:B=>{Q.current.add("label"),v(j=>({...j,label:B.target.value,name:V?j.name:vs(B.target.value)}))}})]}),c.jsxs("label",{className:"nc-field",children:[p("node-name-label"),c.jsx("input",{placeholder:p("node-name-ph"),value:m.name,disabled:u||O,onChange:B=>{G(!0),Q.current.add("name"),v(j=>({...j,name:B.target.value?vs(B.target.value):""}))}})]}),c.jsx("small",{className:"nc-set-hint",children:p("node-slug-hint").replace("{slug}",m.name||"home-relay")}),c.jsxs("label",{className:"nc-field",children:[p("pair-ssh-local-label"),c.jsx("input",{placeholder:"my-relay",value:m.ssh,disabled:u||O,onChange:B=>{Q.current.add("ssh"),R("ssh",B.target.value)}}),c.jsx("small",{className:"nc-set-hint",children:p("node-ssh-local-help")})]}),c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",placeholder:p("node-ssh-port-help"),value:m.sshPort,disabled:u||O,onChange:B=>R("sshPort",B.target.value.replace(/[^0-9]/g,"").slice(0,5))})]}),c.jsxs("label",{className:"nc-field",children:[p("device-name-label"),c.jsx("input",{placeholder:s||"NexusCrew",value:m.localLabel,disabled:u||O,onChange:B=>R("localLabel",B.target.value)}),c.jsx("small",{className:"nc-set-hint",children:p("device-name-hint")})]}),c.jsxs("label",{className:"nc-field",children:[p("local-route-name-label"),c.jsx("input",{placeholder:I||"nexuscrew-5bd6",value:C,disabled:u||O,onChange:B=>{Z(!0),Q.current.add("localName"),v(j=>({...j,localName:B.target.value?vs(B.target.value):""}))}}),c.jsx("small",{className:"nc-set-hint",children:p("local-route-name-hint")})]})]}),S&&c.jsx(d2,{onResult:B=>{w(!1),A(B)},onClose:()=>w(!1)})]})}const wi={routed:"peer-routed",routedStale:"peer-routed-stale",up:"tunnel-up",down:"tunnel-down",passive:"node-connected-client",vlOnline:"vl-poll-online",vlOffline:"vl-poll-offline"};function Df(e){if(!e||typeof e!="object")return{key:wi.down,up:!1};if(e.kind==="vl")return e.online?{key:wi.vlOnline,up:!0}:{key:wi.vlOffline,up:!1};if(e.kind==="transitive"){const n=e.stale===!0;return{key:n?wi.routedStale:wi.routed,up:!n,routed:!0}}const t=e.tunnel&&e.tunnel.status;return t==="up"?{key:wi.up,up:!0}:t==="passive"?{key:wi.passive,up:!1,passive:!0}:{key:wi.down,up:!1}}function Qw(e){if(!e||typeof e!="object")return{key:"peer-private",shortKey:"row-private",shared:!1};if(e.kind==="vl")return{key:"peer-vl-federated",shortKey:"row-vl-federated",shared:!0};if(e.shared!==!0)return{key:"peer-private",shortKey:"row-private",shared:!1};const t=e.visibility||"network";if(t==="relay-only")return{key:"visibility-relay",shortKey:"visibility-relay",shared:!0,visibility:t};if(t==="selected"){const n=Array.isArray(e.selected)?e.selected.length:0;return{key:"visibility-selected",shortKey:"visibility-selected",shared:!0,visibility:t,count:n}}return{key:"visibility-network",shortKey:"visibility-network",shared:!0,visibility:t}}function h2(e){const n=e.health&&typeof e.health.detail=="string"&&e.health.detail.trim()||p(e.online?wi.vlOnline:wi.vlOffline);return e.ownerLabel?`${e.ownerLabel} · ${n}`:n}function f2(e){if(!e||typeof e!="object")return null;const t=typeof e.name=="string"?e.name:"";if(!t)return null;const n=e.kind==="transitive";return{name:t,title:typeof e.label=="string"&&e.label.trim()||t,subtitle:e.kind==="vl"?h2(e):t,reach:Df(e),exposure:Qw(e),routed:n,routeLabel:n&&Array.isArray(e.route)?e.route.join(" › "):null}}function p2(e){if(!e||typeof e!="object"||typeof e.name!="string"||!e.name)return null;const t=e.kind==="transitive";return{name:e.name,title:typeof e.label=="string"&&e.label.trim()||e.name,routed:t,route:t&&Array.isArray(e.route)?[...e.route]:null,ssh:!t&&e.direction==="outbound"&&e.ssh?String(e.ssh):null,inbound:!t&&e.direction==="inbound",transport:e.tunnel&&typeof e.tunnel.transport=="string"&&e.tunnel.transport||null}}function m2(e){return!e||typeof e!="object"?null:e.kind==="transitive"?{key:"authority-routed",ownerEquivalent:!1,grants:[],model:"none"}:{key:"authority-owner-equivalent",ownerEquivalent:!0,grants:[],model:"none"}}function g2(e,t){if(!e||e.visibility!=="selected")return[];const n=[...new Set(Array.isArray(e.selected)?e.selected:[])],s=new Map;for(const o of Array.isArray(t)?t:[])o&&o.nodeId&&!s.has(o.nodeId)&&s.set(o.nodeId,o);return n.map(o=>{const a=s.get(o);return{id:o,label:a?typeof a.label=="string"&&a.label.trim()||a.name:o,known:!!a}})}function v2(e,t,n=""){if(!e)return[];const s=new Set(Array.isArray(e.selected)?e.selected:[]),o=String(n||"").trim().toLowerCase(),a=new Set,u=[],h=f=>e.nodeId?f.nodeId===e.nodeId:f.name===e.name;for(const f of Array.isArray(t)?t:[]){if(!f||!f.nodeId||h(f)||s.has(f.nodeId)||a.has(f.nodeId))continue;const m=typeof f.label=="string"&&f.label.trim()||f.name;o&&!`${m} ${f.name}`.toLowerCase().includes(o)||(a.add(f.nodeId),u.push({id:f.nodeId,label:m,name:f.name}))}return u.sort((f,m)=>f.label.localeCompare(m.label))}function _2(e,{readonly:t=!1,busy:n=!1}={}){if(!e||typeof e!="object")return[];const s=e.actions&&typeof e.actions=="object"?e.actions:{},o=Df(e).up,a=[],u=(h,f,{mutating:m=!0,danger:v=!1}={})=>{a.push({key:h,action:f,danger:v,disabled:n||m&&t})};return s.edit&&u("edit","edit"),s.test&&u("node-test","test",{mutating:!1}),s.disconnect&&o&&u("tunnel-stop","down"),s.connect&&!o&&u("tunnel-start","up"),s.restart&&u("tunnel-restart","restart"),s.remove&&u("delete","remove",{danger:!0}),a}function y2(e,t,{readonly:n=!1,busy:s=!1}={}){const o=p2(e);return o?{identity:o,reach:Df(e),authority:m2(e),exposure:Qw(e),grants:g2(e,t),actions:_2(e,{readonly:n,busy:s}),canEditVisibility:!!(e.actions&&e.actions.visibility)&&e.shared===!0&&e.kind!=="transitive"}:null}const w2=new Set(["update_candidate"]),D_=4096,b2=new Set(["prompt"]),M_={logs:{limit:50}};function S2(e){if(!e||e.kind!=="vl")return[];const t=Array.isArray(e.capabilities)?e.capabilities:[],n=new Set,s=[];for(const o of t)typeof o!="string"||!o||w2.has(o)||b2.has(o)||n.has(o)||(n.add(o),s.push(o));return s}function I_(e){return!!(e&&e.kind==="vl"&&Array.isArray(e.capabilities)&&e.capabilities.includes("prompt"))}function x2(e){return M_[e]?{...M_[e]}:{}}function k2(e,t){return e?e.inflight&&typeof e.inflight=="object"?{phase:"inflight",kind:e.inflight.kind}:t?e.lastAck&&e.lastAck.id===t.id?{phase:"done",kind:t.kind,status:e.lastAck.status,result:e.lastAck.result,at:e.lastAck.at}:{phase:"submitted",kind:t.kind}:e.lastAck&&typeof e.lastAck=="object"?{phase:"done",kind:null,status:e.lastAck.status,result:e.lastAck.result,at:e.lastAck.at}:null:null}function C2({title:e,subtitle:t,status:n,footer:s,onClose:o,plain:a=!1,children:u}){const h=N.useRef(null),f=N.useRef(null);return N.useEffect(()=>{f.current=document.activeElement,h.current&&h.current.focus();const m=v=>{v.key==="Escape"&&(v.stopPropagation(),o&&o())};return document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("keydown",m,!0);const v=f.current;v&&typeof v.focus=="function"&&document.contains(v)&&v.focus()}},[o]),c.jsx("div",{className:"nc-detail-overlay",onMouseDown:m=>{m.target===m.currentTarget&&o&&o()},children:c.jsxs("div",{className:"nc-detail-sheet",ref:h,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":typeof e=="string"?e:void 0,children:[c.jsxs("div",{className:"nc-detail-head",children:[c.jsxs("div",{className:"nc-detail-title",children:[c.jsx("b",{children:e}),t&&c.jsx("small",{children:t})]}),n,c.jsx("button",{type:"button",className:"nc-btn ghost nc-detail-close",onClick:o,"aria-label":p("close"),children:c.jsx(Ze,{name:"x",size:14})})]}),c.jsx("div",{className:`nc-detail-body${a?" plain":""}`,children:u}),s&&c.jsx("div",{className:"nc-detail-foot",children:s})]})})}function Bo({title:e,hint:t,children:n}){return n==null||n===!1?null:c.jsxs("section",{className:"nc-detail-section",children:[e&&c.jsx("div",{className:"nc-sheet-label",children:e}),t&&c.jsx("small",{className:"nc-set-hint",children:t}),n]})}function E2({node:e,nodes:t,token:n,readonly:s,refresh:o,onClose:a}){var Ye,Ae;kn();const[u,h]=N.useState(null),[f,m]=N.useState(null),[v,b]=N.useState(null),[y,S]=N.useState(null),[w,x]=N.useState(!1),[k,P]=N.useState(""),[E,F]=N.useState(!1),[D,V]=N.useState(null),[G,z]=N.useState(!1),[Z,X]=N.useState(""),Q=N.useMemo(()=>y2(e,t,{readonly:s,busy:!!u}),[e,t,s,u]);if(!Q)return null;const{identity:O,reach:I,authority:C,exposure:T,grants:A,actions:$,canEditVisibility:U}=Q,R=O.routed?{up:I.up,since:null}:Yd(e.tunnel,Date.now()),W=async(Ne,ut)=>{m(null),h(Ne);try{await ut()}catch(Pe){m(String(Pe&&Pe.message||Pe))}h(null)},B=Ne=>{if(Ne==="edit"){S({label:e.label||e.name,ssh:e.ssh||"",sshPort:e.sshPort?String(e.sshPort):"",autostart:e.autostart===!0,visibility:e.visibility||"network"});return}if(Ne==="remove"){x(!0);return}W(`${e.name}:${Ne}`,async()=>{const ut=await ef(n,e.name,Ne);Ne==="test"&&b(ut),await o()})},j=(Ne,ut=x2(Ne))=>W(`${e.nodeId}:${Ne}`,async()=>{const Pe=await wg(n,e.nodeId,Ne,ut,e.route||[]);V({id:Pe.id,kind:Ne,submittedAt:Date.now()}),await o()}),M=()=>{const Ne=Z.trim().slice(0,D_);Ne&&W(`${e.nodeId}:prompt`,async()=>{const ut=await wg(n,e.nodeId,"prompt",{text:Ne},e.route||[]);V({id:ut.id,kind:"prompt",submittedAt:Date.now()}),X(""),z(!1),await o()})},K=()=>{if(!Mr(y.label)){m(p("err-label"));return}const Ne=O.inbound?{label:y.label,visibility:y.visibility,selected:y.visibility==="selected"?[...e.selected||[]]:[]}:{label:y.label,ssh:y.ssh,autostart:y.autostart,...y.sshPort?{sshPort:Number(y.sshPort)}:{}};return W(`${e.name}:edit`,async()=>{await L0(n,e.name,Ne),S(null),await o()})},ne=(Ne,ut)=>W(`${e.name}:visibility`,async()=>{await D0(n,e.name,Ne,ut),await o()}),le=U&&e.visibility==="selected"?v2(e,t,k):[],fe=c.jsxs("span",{className:`nc-set-tunnel${I.up?" up":""}`,children:[p(I.key),R.since?` · ${R.since}`:""]}),ge=e.kind==="vl",pe=ge?S2(e):[],we=ge?k2(e,D):null,He=Ne=>{const ut=`vl-cmd-${Ne}`,Pe=p(ut);return Pe===ut?Ne:Pe},ht=ge?[...pe.map(Ne=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u||s,title:s?p("settings-readonly"):void 0,onClick:()=>j(Ne),children:He(Ne)},Ne)),...I_(e)?[c.jsx("button",{type:"button",className:`nc-btn ghost${G?" on":""}`,disabled:!!u||s,title:s?p("settings-readonly"):void 0,onClick:()=>z(Ne=>!Ne),children:He("prompt")},"prompt")]:[]]:$.map(Ne=>c.jsx("button",{type:"button",className:`nc-btn ${Ne.danger?"danger":"ghost"}`,disabled:Ne.disabled,title:Ne.disabled&&s?p("settings-readonly"):void 0,onClick:()=>B(Ne.action),children:Ne.action==="remove"?c.jsxs(c.Fragment,{children:[c.jsx(Ze,{name:"trash",size:14})," ",p(Ne.key)]}):p(Ne.key)},Ne.action));return c.jsxs(C2,{title:O.title,subtitle:O.name,status:fe,footer:ht,onClose:a,children:[c.jsxs(Bo,{title:p("node-detail-reach"),children:[c.jsxs("dl",{className:"nc-detail-facts",children:[O.route&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-route")}),c.jsx("dd",{children:O.route.join(" › ")})]}),O.ssh&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-ssh")}),c.jsxs("dd",{children:[O.ssh,e.sshPort?`:${e.sshPort}`:""]})]}),O.transport&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-transport")}),c.jsx("dd",{children:O.transport})]}),ge&&e.ownerLabel&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-owner")}),c.jsx("dd",{children:e.ownerLabel})]})]}),((Ye=e.health)==null?void 0:Ye.detail)&&c.jsx("div",{className:`nc-set-test${ge?e.health.state==="running"?" ok":e.health.state==="starting"?"":" ko":e.health.status==="healthy"?" ok":e.health.status==="passive"?"":" ko"}`,children:e.health.detail}),v&&c.jsxs("div",{className:`nc-set-test${v.ok?" ok":" ko"}`,children:[v.result,v.detail?` — ${v.detail}`:""]})]}),ge&&c.jsxs(Bo,{title:p("node-detail-command"),children:[pe.length===0&&!I_(e)&&c.jsx("small",{className:"nc-set-hint",children:p("vl-no-commands")}),G&&c.jsxs("div",{className:"nc-vl-prompt",children:[c.jsx("textarea",{value:Z,maxLength:D_,placeholder:p("vl-prompt-placeholder"),"aria-label":p("vl-prompt-placeholder"),disabled:!!u||s,onChange:Ne=>X(Ne.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!!u||s||!Z.trim(),onClick:M,children:p("vl-prompt-send")})]}),we&&c.jsxs("div",{className:`nc-set-test${we.phase==="done"?we.status==="ok"?" ok":" ko":""}`,children:[we.kind&&`${He(we.kind)}: `,we.phase==="submitted"&&p("vl-cmd-phase-submitted"),we.phase==="inflight"&&p("vl-cmd-phase-inflight"),we.phase==="done"&&p(we.status==="ok"?"vl-cmd-phase-done-ok":"vl-cmd-phase-done-error"),we.phase==="done"&&((Ae=we.result)!=null&&Ae.detail)?` — ${we.result.detail}`:""]})]}),c.jsxs(Bo,{title:p("node-detail-authority"),children:[c.jsx("div",{className:"nc-set-info",children:p(C.key)}),C.grants.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("authority-no-grants")})]}),c.jsxs(Bo,{title:p("node-detail-network-view"),children:[c.jsx("div",{className:"nc-set-info",children:p(ge?T.key:T.shared?"peer-shared":"peer-private")}),U&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-field",children:[p("peer-visibility"),c.jsxs("select",{value:e.visibility||"network",disabled:s||!!u,onChange:Ne=>ne(Ne.target.value),children:[c.jsx("option",{value:"network",children:p("visibility-network")}),c.jsx("option",{value:"relay-only",children:p("visibility-relay")}),c.jsx("option",{value:"selected",children:p("visibility-selected")})]})]}),e.visibility==="selected"&&c.jsxs("div",{className:"nc-detail-grants",children:[A.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("node-grant-none")}),A.map(Ne=>c.jsxs("div",{className:`nc-detail-grant${Ne.known?"":" unknown"}`,children:[c.jsxs("span",{children:[Ne.label,Ne.known?"":` — ${p("node-grant-unknown")}`]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:()=>ne("selected",(e.selected||[]).filter(ut=>ut!==Ne.id)),children:p("node-grant-remove")})]},Ne.id)),!E&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:()=>{F(!0),P("")},children:p("node-grant-add")}),E&&c.jsxs("div",{className:"nc-detail-picker",children:[c.jsx("input",{value:k,placeholder:p("node-grant-search"),disabled:s||!!u,onChange:Ne=>P(Ne.target.value)}),c.jsxs("div",{className:"nc-detail-picker-list",children:[le.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("node-grant-no-candidates")}),le.map(Ne=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:async()=>{await ne("selected",[...e.selected||[],Ne.id]),F(!1),P("")},children:Ne.label},Ne.id))]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>{F(!1),P("")},children:p("cancel")})]})]})]})]}),y&&c.jsxs(Bo,{title:p("edit"),children:[c.jsxs("label",{className:"nc-field",children:[p("node-display-label"),c.jsx("input",{value:y.label,disabled:!!u,onChange:Ne=>S({...y,label:Ne.target.value})})]}),O.inbound?c.jsxs("label",{className:"nc-field",children:[p("peer-visibility"),c.jsxs("select",{value:y.visibility,disabled:!!u,onChange:Ne=>S({...y,visibility:Ne.target.value}),children:[c.jsx("option",{value:"network",children:p("visibility-network")}),c.jsx("option",{value:"relay-only",children:p("visibility-relay")}),c.jsx("option",{value:"selected",children:p("visibility-selected")})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-field",children:[p("node-ssh-label"),c.jsx("input",{value:y.ssh,disabled:!!u,onChange:Ne=>S({...y,ssh:Ne.target.value})})]}),c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",value:y.sshPort,disabled:!!u,onChange:Ne=>S({...y,sshPort:Ne.target.value.replace(/[^0-9]/g,"").slice(0,5)})})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:y.autostart,disabled:!!u,onChange:Ne=>S({...y,autostart:Ne.target.checked})})," ",p("boot-persist")]})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!!u,onClick:K,children:p("save")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>S(null),children:p("cancel")})]})]}),w&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("b",{children:p("node-remove-confirm").replace("{name}",O.title)}),c.jsx("small",{children:p("node-remove-warning")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn danger",disabled:!!u,onClick:()=>W(`${e.name}:remove`,async()=>{await A0(n,e.name),x(!1),await o(),a&&a()}),children:p("delete")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>x(!1),children:p("cancel")})]})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Mf(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window&&typeof Notification<"u"}function N2(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=atob(n),o=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)o[a]=s.charCodeAt(a);return o}async function j2(){if(!Mf())return"unsupported";if(Notification.permission==="denied")return"denied";try{return await(await navigator.serviceWorker.ready).pushManager.getSubscription()?"subscribed":"idle"}catch{return"idle"}}async function R2(e){if(!Mf())throw new Error("push-unsupported");if(await Notification.requestPermission()!=="granted")throw new Error("push-denied");const n=await Ht("/api/push/vapid",e),{publicKey:s}=await n.json();if(!s)throw new Error("vapid non disponibile");const a=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:N2(s)}),u=await Ht("/api/push/subscribe",e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({subscription:a.toJSON()})});if(!u.ok){try{await a.unsubscribe()}catch{}const h=await u.json().catch(()=>({}));throw new Error(h.error||`HTTP ${u.status}`)}return!0}async function P2(e){if(!Mf())return!1;const n=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!n)return!1;const s=n.endpoint;try{await n.unsubscribe()}catch{}try{await Ht("/api/push/subscribe",e,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({endpoint:s})})}catch{}return!0}const zh="nexuscrew.fleet",Jw=3,L2="nexuscrew.cells",Zw=/^[A-Za-z0-9._-]{1,32}$/,lc=/^[a-z0-9._-]{1,32}$/,eb=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,tb=new Set(["standard","unsafe"]),A2=4096,T2=4096,Ql=256,nb=8192,D2=4096,M2=32,I2=64,O2=24,B2=new Set(["format","version","exportedAt","cells","engines"]),z2=new Set(["id","cwdRel","engine","boot","model","models","permissionPolicies","commands","systemPrompt","prompt","label"]),F2=new Set(["id","cwd","engine","boot","model","models","permissionPolicies","systemPrompt","prompt"]);function Ks(e){if(typeof e!="string"||e.length>T2)return null;for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);if(s<=31||s===127||s===92)return null}if(e==="")return"";if(e.charAt(0)==="/"||/^[A-Za-z]:/.test(e))return null;const t=[];for(const n of e.split("/"))if(!(n===""||n===".")){if(n==="..")return null;t.push(n)}return t.join("/")}const $2=new Set(["id","label","rc","managed","command","args","envKeys","model","promptMode","promptFlag"]),H2=new Set(["client","provider","credentialProfile","model","permissionPolicy","displayName","protocol","baseUrl","envKey","providerId"]);function Oi(e,t){return typeof e=="string"&&e.length<=t&&!/[\x00-\x1f\x7f]/.test(e)}function If(e){const t=String(e||"");return/(?:bearer\s+|authorization\s*[:=]|(?:api[_-]?key|secret|token)\s*[:=])/i.test(t)||/^-{1,2}(?:api[-_]?key|access[-_]?key|auth(?:orization)?[-_]?token|token|secret|password|credential)(?:$|=)/i.test(t)||/\b(?:sk|fw|fpk|hf|zai)[-_][A-Za-z0-9._-]{8,}\b/i.test(t)||/https?:\/\/[^\s/@:]+:[^\s/@]+@/i.test(t)}function Yo(e,t){if(e===void 0)return{};if(!e||typeof e!="object"||Array.isArray(e))return null;const n=Object.entries(e);if(n.length>128)return null;const s={};for(const[o,a]of n){if(!lc.test(o)||!t(a))return null;s[o]=a}return s}function ib(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(h=>!z2.has(h))||!Zw.test(String(e.id||""))||typeof e.cwdRel!="string")return null;const t=Ks(e.cwdRel);if(t===null||!lc.test(String(e.engine||""))||e.boot!==void 0&&typeof e.boot!="boolean"||e.model!==void 0&&(typeof e.model!="string"||e.model.length>Ql)||e.systemPrompt!==void 0&&e.prompt!==void 0&&e.systemPrompt!==e.prompt)return null;const n=e.systemPrompt===void 0?e.prompt===void 0?"":e.prompt:e.systemPrompt;if(typeof n!="string"||n.length>nb)return null;const s=Yo(e.models,h=>typeof h=="string"&&!!h&&h.length<=Ql),o=Yo(e.permissionPolicies,h=>tb.has(h)),a=Yo(e.commands,h=>Oi(h,D2)&&!If(h));if(s===null||o===null||a===null)return null;const u={id:e.id,cwdRel:t,engine:e.engine,boot:e.boot===!0,systemPrompt:n};if(e.model&&(u.model=e.model),e.label!==void 0){if(!Oi(e.label,I2)||!String(e.label).trim())return null;u.label=String(e.label).trim()}return Object.keys(s).length&&(u.models=s),Object.keys(o).length&&(u.permissionPolicies=o),Object.keys(a).length&&(u.commands=a),u}function U2(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(a=>!F2.has(a))||!Zw.test(String(e.id||""))||typeof e.cwd!="string"||!e.cwd||e.cwd.length>A2||!lc.test(String(e.engine||""))||e.boot!==void 0&&typeof e.boot!="boolean"||e.model!==void 0&&(typeof e.model!="string"||e.model.length>Ql)||e.systemPrompt!==void 0&&e.prompt!==void 0&&e.systemPrompt!==e.prompt)return null;const t=e.systemPrompt===void 0?e.prompt===void 0?"":e.prompt:e.systemPrompt;if(typeof t!="string"||t.length>nb)return null;const n=Yo(e.models,a=>typeof a=="string"&&!!a&&a.length<=Ql),s=Yo(e.permissionPolicies,a=>tb.has(a));if(n===null||s===null)return null;const o={id:e.id,cwd:e.cwd,engine:e.engine,boot:e.boot===!0,systemPrompt:t};return e.model&&(o.model=e.model),Object.keys(n).length&&(o.models=n),Object.keys(s).length&&(o.permissionPolicies=s),o}function W2(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>!H2.has(n)))return null;const t={};for(const[n,s]of Object.entries(e)){if(typeof s!="string"||!Oi(s,n==="baseUrl"?512:128)||If(s))return null;t[n]=s}return!t.client||!t.provider||t.envKey&&!eb.test(t.envKey)?null:t}function sb(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(s=>!$2.has(s))||!lc.test(String(e.id||""))||!Oi(e.label||e.id,64)||e.rc!==void 0&&typeof e.rc!="boolean")return null;const t={id:e.id,label:e.label||e.id,rc:e.rc===!0};if(e.managed!==void 0){const s=W2(e.managed);return!s||["command","args","envKeys","model","promptMode","promptFlag"].some(o=>e[o]!==void 0)?null:(t.managed=s,t)}if(!Oi(e.command,512)||!e.command.startsWith("/")||!Array.isArray(e.args)||e.args.length>32||e.args.some(s=>!Oi(s,1024)||If(s))||e.promptMode!=="flag"&&e.promptMode!=="send-keys"||e.promptMode==="flag"&&(!Oi(e.promptFlag,32)||/\s/.test(e.promptFlag)))return null;if(e.model!==void 0){if(!e.model||typeof e.model!="object"||Array.isArray(e.model)||Object.keys(e.model).some(s=>s!=="flag"&&s!=="value")||!Oi(e.model.flag,32)||/\s/.test(e.model.flag)||!Oi(e.model.value||"",128))return null;t.model={flag:e.model.flag,value:e.model.value||""}}const n=e.envKeys===void 0?[]:e.envKeys;return!Array.isArray(n)||n.length>32||n.some(s=>!eb.test(s))?null:(Object.assign(t,{command:e.command,args:[...e.args],envKeys:[...new Set(n)].sort(),promptMode:e.promptMode}),e.promptMode==="flag"&&(t.promptFlag=e.promptFlag),t)}function rb(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.managed?{id:e.id,label:e.label,rc:e.rc,managed:e.managed}:{id:e.id,label:e.label,rc:e.rc,command:e.command,args:e.args,envKeys:e.envKeys,model:e.model,promptMode:e.promptMode,promptFlag:e.promptFlag},n=sb(t);return n||null}function K2(e,t,n=[],s=[],o=new Date){n instanceof Date&&(o=n,n=[],s=[]);const a=t instanceof Set?t:new Set(t||[]),u=s instanceof Set?s:new Set(s||[]),h=[];for(const m of Array.isArray(e)?e:[]){if(!a.has(m.id))continue;const v=ib({id:m.id,cwdRel:m.cwdRel,engine:m.engine,boot:m.boot===!0,...m.label?{label:m.label}:{},...m.model?{model:m.model}:{},...m.models?{models:m.models}:{},...m.permissionPolicies?{permissionPolicies:m.permissionPolicies}:{},systemPrompt:m.prompt||"",...m.commands?{commands:m.commands}:{}});if(!v)return{ok:!1,error:"invalid-cell",invalidCellIds:[m.id]};h.push(v)}const f=[];for(const m of Array.isArray(n)?n:[]){if(!u.has(m.id))continue;const v=rb(m);v&&f.push(v)}return{format:zh,version:Jw,exportedAt:o.toISOString(),cells:h,engines:f}}function q2(e){let t;try{t=JSON.parse(String(e||""))}catch{return{ok:!1,error:"invalid-json",cells:[],engines:[]}}const n=(t==null?void 0:t.format)===L2&&(t==null?void 0:t.version)===1,s=(t==null?void 0:t.format)===zh&&(t==null?void 0:t.version)===2,o=(t==null?void 0:t.format)===zh&&(t==null?void 0:t.version)===Jw,a=n||s,u=s||o;if(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(b=>!B2.has(b))||!n&&!s&&!o||!Array.isArray(t.cells)||t.cells.length>M2||u&&(!Array.isArray(t.engines)||t.engines.length>O2))return{ok:!1,error:"invalid-format",cells:[],engines:[]};const h=[],f=new Set;for(const b of t.cells){const y=a?U2(b):ib(b);if(!y)return{ok:!1,error:"invalid-cell",cells:[],engines:[]};if(f.has(y.id))return{ok:!1,error:"duplicate-cell",cells:[],engines:[]};f.add(y.id),h.push(y)}const m=[],v=new Set;for(const b of u?t.engines:[]){const y=sb(b);if(!y)return{ok:!1,error:"invalid-engine",cells:[],engines:[]};if(v.has(y.id))return{ok:!1,error:"duplicate-engine",cells:[],engines:[]};v.add(y.id),m.push(y)}return{ok:!0,cells:h,engines:m,legacy:a,exportedAt:typeof t.exportedAt=="string"?t.exportedAt:""}}function V2(e,t,n){const s=new Set(n||[]);if(!s.has(t))return null;const o=m=>Object.fromEntries(Object.entries(m||{}).filter(([v])=>s.has(v))),a={id:e.id,engine:t,boot:e.boot===!0,prompt:e.systemPrompt||""};typeof e.label=="string"&&e.label&&(a.label=e.label),typeof e.cwdRel=="string"?a.cwdRel=e.cwdRel:typeof e.cwd=="string"&&e.cwd&&(a.cwd=e.cwd),t===e.engine&&e.model?a.model=e.model:e.models&&e.models[t]&&(a.model=e.models[t]);const u=o(e.models),h=o(e.permissionPolicies),f=o(e.commands);return Object.keys(u).length&&(a.models=u),Object.keys(h).length&&(a.permissionPolicies=h),Object.keys(f).length&&(a.commands=f),a}const Y2=()=>({kind:"managed",id:"claude.native",label:"",client:"claude",provider:"native",credentialProfile:"",managedModel:"",permissionPolicy:"unsafe",credentialSourcePolicy:"auto",displayName:"",protocol:"anthropic_messages",baseUrl:"",envKey:"",providerId:"nexuscrew-custom",command:"",argsText:"",rc:!0,promptMode:"send-keys",promptFlag:"",modelFlag:"",modelValue:"",envRows:[],credentialValue:"",credentialReveal:!1,allowMissingCredential:!1}),O_=(e="")=>({id:"",cwd:"",engine:e,boot:!1,label:"",model:"",prompt:"",commands:{},command:""}),ob=e=>e==="claude"?"unsafe":"standard",Zo=(e,t)=>e.find(n=>n.client===t.client&&n.provider===t.provider&&(n.credentialProfile||"")===(t.credentialProfile||"")),G2=(e,t)=>{var n;return((n=Zo(e,t))==null?void 0:n.label)||`${t.client} · ${t.provider}`};function X2(e){var t,n,s,o,a,u,h,f,m,v,b,y,S,w,x;return{kind:e.managed?"managed":"custom",id:e.id,label:e.label||"",command:e.command||"",argsText:(e.args||[]).join(`
|
|
88
|
+
`;return typeof h=="function"&&h(null,k),k},Bd}var R_;function ZN(){if(R_)return jr;R_=1;const e=TN(),t=XN(),n=QN(),s=JN();function o(a,u,h,f,m){const v=[].slice.call(arguments,1),b=v.length,y=typeof v[b-1]=="function";if(!y&&!e())throw new Error("Callback required as last argument");if(y){if(b<2)throw new Error("Too few arguments provided");b===2?(m=h,h=u,u=f=void 0):b===3&&(u.getContext&&typeof m>"u"?(m=f,f=void 0):(m=f,f=h,h=u,u=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(h=u,u=f=void 0):b===2&&!u.getContext&&(f=h,h=u,u=void 0),new Promise(function(S,w){try{const x=t.create(h,f);S(a(x,u,f))}catch(x){w(x)}})}try{const S=t.create(h,f);m(null,a(S,u,f))}catch(S){m(S)}}return jr.create=t.create,jr.toCanvas=o.bind(null,n.render),jr.toDataURL=o.bind(null,n.renderToDataURL),jr.toString=o.bind(null,function(a,u,h){return s.render(a,h)}),jr}var e2=ZN();const t2=qh(e2);function P_(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.data=="string"?e.data.trim():""}function n2(e){const t=String(e||"").trim();if(!t)return{kind:"empty"};const n=Fx(t);if(!n||!n.ok)return{kind:"invalid"};const s=[];return n.ssh||s.push("ssh"),n.name||s.push("name"),s.length?{kind:"partial",decoded:n,missing:s}:{kind:"complete",decoded:n}}function i2(e,t,n=new Set,s=!1){if(!t||!t.ok)return e;const o=$x(e,t,n);return t.version===2&&t.name&&!n.has("name")&&!s&&(o.name=t.name),!n.has("label")&&!o.label&&t.label&&(o.label=t.label),o}function L_(e,t,n=new Set,s=!1){const o=String(t||"").trim(),a=n2(o);let u={...e,pairingUrl:o};return(a.kind==="complete"||a.kind==="partial")&&(u={...i2(u,a.decoded,n,s),pairingUrl:o}),{classification:a,form:u}}function Ml(e,t){const n=String(t||"").toLowerCase();if(!/^[a-f0-9]{16,64}$/.test(n))return"";const s=String(e||"NexusCrew").replace(/([a-z0-9])([A-Z])/g,"$1 $2");let o=vs(s);(o==="localhost"||o==="node")&&(o="nexuscrew");const a=n.slice(0,4),u=Math.max(1,32-a.length-1);return`${o.slice(0,u).replace(/-+$/g,"")||"n"}-${a}`}function s2(e,{deviceDefault:t="",localNodeId:n="",localNameDefault:s=""}={}){const o={name:e.name,ssh:e.ssh,pairingUrl:e.pairingUrl,...e.label?{label:e.label}:{},...e.sshPort?{sshPort:Number(e.sshPort)}:{}},a=e.localLabel||t;a&&(o.localLabel=a);const u=String(e.localName||Ml(a,n)||s||"").trim();return u&&(o.localName=u),o}function r2(){const e=new Set;let t=!1;return{canAuto(n){return!t&&!e.has(String(n||""))},start(n){return t?!1:(t=!0,e.add(String(n||"")),!0)},finish(){t=!1},reset(n){e.delete(String(n||""))},isBusy(){return t}}}const o2=["validation","conflict","ssh-start","ssh-ready","join","tunnel-final","confirm","health"];function a2(e){const t=e&&e.data||{},n=typeof t.stage=="string"&&t.stage?t.stage:"",s=typeof t.detail=="string"&&t.detail?t.detail:"";return{stage:n,code:typeof t.code=="string"?t.code:"",detail:s,hint:typeof t.hint=="string"?t.hint:"",suggestedName:typeof t.suggestedName=="string"?t.suggestedName:"",retryable:typeof t.retryable=="boolean"?t.retryable:!n,message:s||String(e&&e.message||e)}}const l2="modulepreload",c2=function(e){return"/"+e},A_={},u2=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let u=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),f=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));o=u(n.map(m=>{if(m=c2(m),m in A_)return;A_[m]=!0;const v=m.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${b}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":l2,v||(y.as="script"),y.crossOrigin="",y.href=m,f&&y.setAttribute("nonce",f),document.head.appendChild(y),v)return new Promise((S,w)=>{y.addEventListener("load",S),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${m}`)))})}))}function a(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&a(h.reason);return t().catch(a)})};class tt{constructor(t,n,s,o,a){this._legacyCanvasSize=tt.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),s&&typeof s=="object"?this._onDecode=n:(console.warn(s||o||a?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof s=="object"?s:{},this._onDecodeError=n.onDecodeError||(typeof s=="function"?s:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof s=="number"?s:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let u=!1;if(t.hidden&&(t.hidden=!1,u=!0),document.body.contains(t)||(document.body.appendChild(t),u=!0),s=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),a=this.$overlay.style,a.position="absolute",a.display="none",a.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}s.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let h=window.getComputedStyle(t);h.display==="none"&&(t.style.setProperty("display","block","important"),u=!0),h.visibility!=="visible"&&(t.style.setProperty("visibility","visible","important"),u=!0),u&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=tt.createQrEngine()}static set WORKER_PATH(t){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await tt.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),s;try{t&&(await n()).every(o=>!o.label)&&(s=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,a)=>({id:o.deviceId,label:o.label||(a===0?"Default Camera":`Camera ${a+1}`)}))}finally{s&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),tt._stopVideoStream(s))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),tt._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(t){throw this._flashOn=!1,t}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),tt._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?tt._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(t){if(!this._paused)throw this._active=!1,t}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(tt._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(s=>setTimeout(s,300)),this._paused?(n(),!0):!1)}async setCamera(t){t!==this._preferredCamera&&(this._preferredCamera=t,await this._restartVideoStream())}static async scanImage(t,n,s,o,a=!1,u=!1){let h,f=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(h=n.scanRegion,s=n.qrEngine,o=n.canvas,a=n.disallowCanvasResizing||!1,u=n.alsoTryWithoutScanRegion||!1,f=!0):console.warn(n||s||o||a||u?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!s;try{let m,v;[s,m]=await Promise.all([s||tt.createQrEngine(),tt._loadImage(t)]),[o,v]=tt._drawToCanvas(m,h,o,a);let b;if(s instanceof Worker){let y=s;n||tt._postWorkerMessageSync(y,"inversionMode","both"),b=await new Promise((S,w)=>{let x,k,P,E=-1;k=D=>{D.data.id===E&&(y.removeEventListener("message",k),y.removeEventListener("error",P),clearTimeout(x),D.data.data!==null?S({data:D.data.data,cornerPoints:tt._convertPoints(D.data.cornerPoints,h)}):w(tt.NO_QR_CODE_FOUND))},P=D=>{y.removeEventListener("message",k),y.removeEventListener("error",P),clearTimeout(x),w("Scanner error: "+(D?D.message||D:"Unknown Error"))},y.addEventListener("message",k),y.addEventListener("error",P),x=setTimeout(()=>P("timeout"),1e4);let F=v.getImageData(0,0,o.width,o.height);E=tt._postWorkerMessageSync(y,"decode",F,[F.data.buffer])})}else b=await Promise.race([new Promise((y,S)=>window.setTimeout(()=>S("Scanner error: timeout"),1e4)),(async()=>{try{var[y]=await s.detect(o);if(!y)throw tt.NO_QR_CODE_FOUND;return{data:y.rawValue,cornerPoints:tt._convertPoints(y.cornerPoints,h)}}catch(S){if(y=S.message||S,/not implemented|service unavailable/.test(y))return tt._disableBarcodeDetector=!0,tt.scanImage(t,{scanRegion:h,canvas:o,disallowCanvasResizing:a,alsoTryWithoutScanRegion:u});throw`Scanner error: ${y}`}})()]);return f?b:b.data}catch(m){if(!h||!u)throw m;let v=await tt.scanImage(t,{qrEngine:s,canvas:o,disallowCanvasResizing:a});return f?v:v.data}finally{n||tt._postWorkerMessage(s,"close")}}setGrayscaleWeights(t,n,s,o=!0){tt._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:n,blue:s,useIntegerApproximation:o})}setInversionMode(t){tt._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>u2(()=>import("./qr-scanner-worker.min-D85Z9gVD.js"),[]).then(s=>s.createWorker()),!(!tt._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:s})=>/Chromium/i.test(s))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:s,platformVersion:o})=>/arm/i.test(s||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?t():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(t){let n=Math.round(.6666666666666666*Math.min(t.videoWidth,t.videoHeight));return{x:Math.round((t.videoWidth-n)/2),y:Math.round((t.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var t=this.$video,n=t.videoWidth,s=t.videoHeight,o=t.offsetWidth,a=t.offsetHeight,u=t.offsetLeft,h=t.offsetTop,f=window.getComputedStyle(t),m=f.objectFit,v=n/s,b=o/a;switch(m){case"none":var y=n,S=s;break;case"fill":y=o,S=a;break;default:(m==="cover"?v>b:v<b)?(S=a,y=S*v):(y=o,S=y/v),m==="scale-down"&&(y=Math.min(y,n),S=Math.min(S,s))}var[w,x]=f.objectPosition.split(" ").map((P,E)=>{const F=parseFloat(P);return P.endsWith("%")?(E?a-S:o-y)*F/100:F});f=this._scanRegion.width||n,b=this._scanRegion.height||s,m=this._scanRegion.x||0;var k=this._scanRegion.y||0;v=this.$overlay.style,v.width=`${f/n*y}px`,v.height=`${b/s*S}px`,v.top=`${h+x+k/s*S}px`,s=/scaleX\(-1\)/.test(t.style.transform),v.left=`${u+(s?o-w-y:w)+(s?n-m-f:m)/n*y}px`,v.transform=t.style.transform}})}static _convertPoints(t,n){if(!n)return t;let s=n.x||0,o=n.y||0,a=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let u of t)u.x=u.x*a+s,u.y=u.y*n+o;return t}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(o=>setTimeout(o,n-t)),this._lastScanTimestamp=Date.now();try{var s=await tt.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!tt._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=tt.createQrEngine()),s?(this._onDecode?this._onDecode(s):this._legacyOnDecode&&this._legacyOnDecode(s.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",s.cornerPoints.map(({x:o,y:a})=>`${o},${a}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(t){t!==tt.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let t=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],s=n.map(o=>Object.assign({},o,{[t]:{exact:this._preferredCamera}}));for(let o of[...s,...n])try{let a=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),u=this._getFacingMode(a)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:a,facingMode:u}}catch{}throw"Camera not found."}async _restartVideoStream(){let t=this._paused;await this.pause(!0)&&!t&&this._active&&await this.start()}static _stopVideoStream(t){for(let n of t.getTracks())n.stop(),t.removeTrack(n)}_setVideoMirror(t){this.$video.style.transform="scaleX("+(t==="user"?-1:1)+")"}_getFacingMode(t){return(t=t.getVideoTracks()[0])?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(t,n,s,o=!1){s=s||document.createElement("canvas");let a=n&&n.x?n.x:0,u=n&&n.y?n.y:0,h=n&&n.width?n.width:t.videoWidth||t.width,f=n&&n.height?n.height:t.videoHeight||t.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:h,n=n&&n.downScaledHeight?n.downScaledHeight:f,s.width!==o&&(s.width=o),s.height!==n&&(s.height=n)),n=s.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(t,a,u,h,f,0,0,s.width,s.height),[s,n]}static async _loadImage(t){if(t instanceof Image)return await tt._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t=="string"){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await tt._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(t){t.complete&&t.naturalWidth!==0||await new Promise((n,s)=>{let o=a=>{t.removeEventListener("load",o),t.removeEventListener("error",o),a instanceof ErrorEvent?s("Image load error"):n()};t.addEventListener("load",o),t.addEventListener("error",o)})}static async _postWorkerMessage(t,n,s,o){return tt._postWorkerMessageSync(await t,n,s,o)}static _postWorkerMessageSync(t,n,s,o){if(!(t instanceof Worker))return-1;let a=tt._workerMessageId++;return t.postMessage({id:a,type:n,data:s},o),a}}tt.DEFAULT_CANVAS_SIZE=400;tt.NO_QR_CODE_FOUND="No QR code found";tt._disableBarcodeDetector=!1;tt._workerMessageId=0;function d2({onResult:e,onClose:t}){const n=N.useRef(null),s=N.useRef(null),o=N.useRef(!1),[a,u]=N.useState("");N.useEffect(()=>{let f=!1;const m=n.current,v=b=>{f||o.current||(o.current=!0,e(b))};return(async()=>{if(typeof navigator>"u"||!navigator.mediaDevices||typeof navigator.mediaDevices.getUserMedia!="function"){u(p("qr-unsupported"));return}let b=!1;try{b=await tt.hasCamera()}catch{b=!1}if(!b){u(p("qr-no-camera"));return}if(f||!m)return;const y=new tt(m,S=>{const w=P_(S);w&&v(w)},{returnDetailedScanResult:!0,preferredCamera:"environment",calculateScanRegion:S=>{const w=S.videoWidth||640,x=S.videoHeight||480,k=Math.max(1,Math.round(Math.min(w,x)*.92));return{x:Math.round((w-k)/2),y:Math.round((x-k)/2),width:k,height:k,downScaledWidth:600,downScaledHeight:600}},highlightScanRegion:!0,highlightCodeOutline:!0});s.current=y;try{await y.start()}catch(S){if(f)return;const w=S&&S.name||"";u(p(w==="NotAllowedError"||w==="SecurityError"?"qr-permission":w==="NotFoundError"||w==="OverconstrainedError"||w==="NotReadableError"?"qr-no-camera":"qr-unsupported"))}})(),()=>{f=!0;const b=s.current;if(b){try{b.stop()}catch{}try{b.destroy()}catch{}s.current=null}const y=m,S=y&&y.srcObject;if(S&&typeof S.getTracks=="function"){for(const w of S.getTracks())try{w.stop()}catch{}try{y.srcObject=null}catch{}}}},[]);const h=async f=>{const m=f.target.files&&f.target.files[0];if(f.target.value="",!!m)try{const v=await tt.scanImage(m,{returnDetailedScanResult:!0}),b=P_(v);if(!b)throw new Error("empty");o.current||(o.current=!0,e(b))}catch{u(p("pairing-qr-invalid"))}};return c.jsx("div",{className:"nc-sheet-overlay nc-qr-overlay",onClick:t,children:c.jsxs("div",{className:"nc-sheet nc-qr-modal",onClick:f=>f.stopPropagation(),children:[c.jsx("div",{className:"nc-sheet-head",children:c.jsx("b",{children:p("scan-qr")})}),c.jsx("video",{ref:n,className:"nc-qr-video",playsInline:!0,muted:!0}),a&&c.jsx("div",{className:"nc-err",role:"alert",children:a}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsxs("label",{className:"nc-btn ghost nc-qr-upload",children:[p("qr-upload"),c.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:h})]}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:t,children:p("cancel")})]})]})})}const T_=()=>({name:"",label:"",ssh:"",sshPort:"",pairingUrl:"",localLabel:"",localName:""});function Xw({token:e,initial:t="",autoStart:n=!1,deviceDefault:s="",localNodeId:o="",localNameDefault:a="",readonly:u=!1,onSuccess:h,onBusyChange:f}){const[m,v]=N.useState(T_),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState("idle"),[P,E]=N.useState(null),[F,D]=N.useState(""),[V,G]=N.useState(!1),[z,Z]=N.useState(!1),X=N.useRef(r2()),Q=N.useRef(new Set),O=x==="busy",I=Ml(m.localLabel||s,o)||a,C=z?m.localName:I;N.useEffect(()=>(f&&f(O),()=>{f&&f(!1)}),[O,f]);const T=async B=>{const j=String(B.pairingUrl||"").trim();if(X.current.start(j)){k("busy"),E(null),D("");try{await j0(e,s2({...B,localName:z?B.localName:Ml(B.localLabel||s,o)||a},{deviceDefault:s,localNodeId:o,localNameDefault:a})),k("ok"),y(!1),v(T_()),Q.current=new Set,G(!1),Z(!1),X.current.finish(),h&&await h()}catch(M){const K=a2(M);E(K),k("idle"),X.current.finish(),K.code==="peer-name-conflict"&&Vd(K.suggestedName)&&(Z(!0),Q.current.add("localName"),v(ne=>({...ne,localName:K.suggestedName}))),(K.stage==="validation"||K.stage==="conflict"||K.stage==="ssh-start"||K.stage==="ssh-ready"||String(K.code||"").startsWith("ssh-"))&&y(!0)}}},A=(B,j=!0)=>{const{classification:M,form:K}=L_(m,B,Q.current,V),ne=K.pairingUrl;if(E(null),D(""),x==="ok"&&k("idle"),v(K),M.kind==="invalid"){E({stage:"validation",code:"bad-link",message:p("pair-invalid-link"),hint:p("pair-invalid-hint"),retryable:!0});return}if(M.kind==="partial"){y(!0),D(M.missing.includes("ssh")?p("pair-missing-ssh"):p("pair-missing-name"));return}M.kind==="complete"&&j&&!u&&X.current.canAuto(ne)&&T(K)};N.useEffect(()=>{t&&A(t,n)},[]);const $=()=>{const B=String(m.pairingUrl||"").trim(),{classification:j,form:M}=L_(m,B,Q.current,V);if(v(M),D(""),E(null),j.kind==="empty"){E({stage:"validation",message:p("pairing-required"),retryable:!0});return}if(j.kind==="invalid"){E({stage:"validation",code:"bad-link",message:p("pair-invalid-link"),hint:p("pair-invalid-hint"),retryable:!0});return}if(!M.ssh||!M.name){y(!0),D(M.ssh?p("pair-missing-name"):p("pair-missing-ssh"));return}if(M.label&&!Mr(M.label)){E({stage:"validation",message:p("err-label"),retryable:!0});return}if(M.localLabel&&!Mr(M.localLabel)){E({stage:"validation",message:p("err-label"),retryable:!0});return}const K=z?M.localName:Ml(M.localLabel||s,o)||a;if(!Vd(K)||K==="localhost"){y(!0),E({stage:"validation",code:"bad-local-name",message:p("err-local-name"),retryable:!0});return}X.current.reset(B),T(M)},U=async()=>{try{if(!navigator.clipboard||typeof navigator.clipboard.readText!="function")throw new Error("unsupported");const B=await navigator.clipboard.readText();B&&B.trim()?A(B):D(p("pair-clipboard-empty"))}catch{D(p("pair-clipboard-denied"))}},R=(B,j)=>{Q.current.add(B),v(M=>({...M,[B]:j}))},W=P&&P.stage&&(o2.includes(P.stage)||P.stage==="internal")?p(`pair-stage-${P.stage}`):p("pair-stage-generic");return c.jsxs("div",{className:"nc-set-form nc-pair-card",children:[c.jsx("div",{className:"nc-sheet-label",children:p("pair-card-title")}),c.jsx("div",{className:"nc-set-info",children:p("pair-card-help")}),c.jsx("input",{className:"nc-pair-input",placeholder:p("pair-paste-ph"),value:m.pairingUrl,disabled:u||O,onChange:B=>{v({...m,pairingUrl:B.target.value}),E(null),D("")},onPaste:B=>{const j=B.clipboardData&&B.clipboardData.getData("text")||"";j.trim()&&(B.preventDefault(),A(j))},onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),$())}}),c.jsxs("div",{className:"nc-pair-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:U,children:p("pair-paste-btn")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:()=>w(!0),children:p("scan-qr")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||O,title:u?p("settings-readonly"):"",onClick:$,children:p("test-and-connect")})]}),c.jsxs("div",{className:"nc-pair-status","aria-live":"polite",children:[O&&c.jsx("div",{className:"nc-pair-progress",children:p("pair-progress")}),x==="ok"&&c.jsx("div",{className:"nc-set-test ok",children:p("node-connected")}),F&&c.jsx("div",{className:"nc-set-hint nc-pair-notice",children:F}),P&&c.jsxs("div",{className:"nc-err",role:"alert",children:[c.jsx("b",{children:W})," — ",P.message,P.hint&&c.jsx("div",{className:"nc-pair-hint",children:P.hint}),P.retryable&&c.jsx("div",{children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u||O,onClick:$,children:p("pair-retry")})})]})]}),c.jsxs("button",{type:"button",className:"nc-btn ghost nc-pair-advanced-toggle",disabled:O,onClick:()=>y(B=>!B),children:[b?"▾":"▸"," ",p("pair-advanced")]}),b&&c.jsxs("div",{className:"nc-pair-advanced",children:[c.jsxs("label",{className:"nc-field",children:[p("node-display-label"),c.jsx("input",{placeholder:"Home Relay",value:m.label,disabled:u||O,onChange:B=>{Q.current.add("label"),v(j=>({...j,label:B.target.value,name:V?j.name:vs(B.target.value)}))}})]}),c.jsxs("label",{className:"nc-field",children:[p("node-name-label"),c.jsx("input",{placeholder:p("node-name-ph"),value:m.name,disabled:u||O,onChange:B=>{G(!0),Q.current.add("name"),v(j=>({...j,name:B.target.value?vs(B.target.value):""}))}})]}),c.jsx("small",{className:"nc-set-hint",children:p("node-slug-hint").replace("{slug}",m.name||"home-relay")}),c.jsxs("label",{className:"nc-field",children:[p("pair-ssh-local-label"),c.jsx("input",{placeholder:"my-relay",value:m.ssh,disabled:u||O,onChange:B=>{Q.current.add("ssh"),R("ssh",B.target.value)}}),c.jsx("small",{className:"nc-set-hint",children:p("node-ssh-local-help")})]}),c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",placeholder:p("node-ssh-port-help"),value:m.sshPort,disabled:u||O,onChange:B=>R("sshPort",B.target.value.replace(/[^0-9]/g,"").slice(0,5))})]}),c.jsxs("label",{className:"nc-field",children:[p("device-name-label"),c.jsx("input",{placeholder:s||"NexusCrew",value:m.localLabel,disabled:u||O,onChange:B=>R("localLabel",B.target.value)}),c.jsx("small",{className:"nc-set-hint",children:p("device-name-hint")})]}),c.jsxs("label",{className:"nc-field",children:[p("local-route-name-label"),c.jsx("input",{placeholder:I||"nexuscrew-5bd6",value:C,disabled:u||O,onChange:B=>{Z(!0),Q.current.add("localName"),v(j=>({...j,localName:B.target.value?vs(B.target.value):""}))}}),c.jsx("small",{className:"nc-set-hint",children:p("local-route-name-hint")})]})]}),S&&c.jsx(d2,{onResult:B=>{w(!1),A(B)},onClose:()=>w(!1)})]})}const wi={routed:"peer-routed",routedStale:"peer-routed-stale",up:"tunnel-up",down:"tunnel-down",passive:"node-connected-client",vlOnline:"vl-poll-online",vlOffline:"vl-poll-offline"};function Df(e){if(!e||typeof e!="object")return{key:wi.down,up:!1};if(e.kind==="vl")return e.online?{key:wi.vlOnline,up:!0}:{key:wi.vlOffline,up:!1};if(e.kind==="transitive"){const n=e.stale===!0;return{key:n?wi.routedStale:wi.routed,up:!n,routed:!0}}const t=e.tunnel&&e.tunnel.status;return t==="up"?{key:wi.up,up:!0}:t==="passive"?{key:wi.passive,up:!1,passive:!0}:{key:wi.down,up:!1}}function Qw(e){if(!e||typeof e!="object")return{key:"peer-private",shortKey:"row-private",shared:!1};if(e.kind==="vl")return{key:"peer-vl-federated",shortKey:"row-vl-federated",shared:!0};if(e.shared!==!0)return{key:"peer-private",shortKey:"row-private",shared:!1};const t=e.visibility||"network";if(t==="relay-only")return{key:"visibility-relay",shortKey:"visibility-relay",shared:!0,visibility:t};if(t==="selected"){const n=Array.isArray(e.selected)?e.selected.length:0;return{key:"visibility-selected",shortKey:"visibility-selected",shared:!0,visibility:t,count:n}}return{key:"visibility-network",shortKey:"visibility-network",shared:!0,visibility:t}}function h2(e){const n=e.health&&typeof e.health.detail=="string"&&e.health.detail.trim()||p(e.online?wi.vlOnline:wi.vlOffline);return e.ownerLabel?`${e.ownerLabel} · ${n}`:n}function f2(e){if(!e||typeof e!="object")return null;const t=typeof e.name=="string"?e.name:"";if(!t)return null;const n=e.kind==="transitive";return{name:t,title:typeof e.label=="string"&&e.label.trim()||t,subtitle:e.kind==="vl"?h2(e):t,reach:Df(e),exposure:Qw(e),routed:n,routeLabel:n&&Array.isArray(e.route)?e.route.join(" › "):null}}function p2(e){if(!e||typeof e!="object"||typeof e.name!="string"||!e.name)return null;const t=e.kind==="transitive";return{name:e.name,title:typeof e.label=="string"&&e.label.trim()||e.name,routed:t,route:t&&Array.isArray(e.route)?[...e.route]:null,ssh:!t&&e.direction==="outbound"&&e.ssh?String(e.ssh):null,inbound:!t&&e.direction==="inbound",transport:e.tunnel&&typeof e.tunnel.transport=="string"&&e.tunnel.transport||null}}function m2(e){return!e||typeof e!="object"?null:e.kind==="transitive"?{key:"authority-routed",ownerEquivalent:!1,grants:[],model:"none"}:{key:"authority-owner-equivalent",ownerEquivalent:!0,grants:[],model:"none"}}function g2(e,t){if(!e||e.visibility!=="selected")return[];const n=[...new Set(Array.isArray(e.selected)?e.selected:[])],s=new Map;for(const o of Array.isArray(t)?t:[])o&&o.nodeId&&!s.has(o.nodeId)&&s.set(o.nodeId,o);return n.map(o=>{const a=s.get(o);return{id:o,label:a?typeof a.label=="string"&&a.label.trim()||a.name:o,known:!!a}})}function v2(e,t,n=""){if(!e)return[];const s=new Set(Array.isArray(e.selected)?e.selected:[]),o=String(n||"").trim().toLowerCase(),a=new Set,u=[],h=f=>e.nodeId?f.nodeId===e.nodeId:f.name===e.name;for(const f of Array.isArray(t)?t:[]){if(!f||!f.nodeId||h(f)||s.has(f.nodeId)||a.has(f.nodeId))continue;const m=typeof f.label=="string"&&f.label.trim()||f.name;o&&!`${m} ${f.name}`.toLowerCase().includes(o)||(a.add(f.nodeId),u.push({id:f.nodeId,label:m,name:f.name}))}return u.sort((f,m)=>f.label.localeCompare(m.label))}function _2(e,{readonly:t=!1,busy:n=!1}={}){if(!e||typeof e!="object")return[];const s=e.actions&&typeof e.actions=="object"?e.actions:{},o=Df(e).up,a=[],u=(h,f,{mutating:m=!0,danger:v=!1}={})=>{a.push({key:h,action:f,danger:v,disabled:n||m&&t})};return s.edit&&u("edit","edit"),s.test&&u("node-test","test",{mutating:!1}),s.disconnect&&o&&u("tunnel-stop","down"),s.connect&&!o&&u("tunnel-start","up"),s.restart&&u("tunnel-restart","restart"),s.remove&&u("delete","remove",{danger:!0}),a}function y2(e,t,{readonly:n=!1,busy:s=!1}={}){const o=p2(e);return o?{identity:o,reach:Df(e),authority:m2(e),exposure:Qw(e),grants:g2(e,t),actions:_2(e,{readonly:n,busy:s}),canEditVisibility:!!(e.actions&&e.actions.visibility)&&e.shared===!0&&e.kind!=="transitive"}:null}const w2=new Set(["update_candidate"]),D_=4096,b2=new Set(["prompt"]),M_={logs:{limit:50}};function S2(e){if(!e||e.kind!=="vl")return[];const t=Array.isArray(e.capabilities)?e.capabilities:[],n=new Set,s=[];for(const o of t)typeof o!="string"||!o||w2.has(o)||b2.has(o)||n.has(o)||(n.add(o),s.push(o));return s}function I_(e){return!!(e&&e.kind==="vl"&&Array.isArray(e.capabilities)&&e.capabilities.includes("prompt"))}function x2(e){return M_[e]?{...M_[e]}:{}}function k2(e,t){return e?e.inflight&&typeof e.inflight=="object"?{phase:"inflight",kind:e.inflight.kind}:t?e.lastAck&&e.lastAck.id===t.id?{phase:"done",kind:t.kind,status:e.lastAck.status,result:e.lastAck.result,at:e.lastAck.at}:{phase:"submitted",kind:t.kind}:e.lastAck&&typeof e.lastAck=="object"?{phase:"done",kind:null,status:e.lastAck.status,result:e.lastAck.result,at:e.lastAck.at}:null:null}function C2({title:e,subtitle:t,status:n,footer:s,onClose:o,plain:a=!1,children:u}){const h=N.useRef(null),f=N.useRef(null);return N.useEffect(()=>(f.current=document.activeElement,h.current&&h.current.focus(),()=>{const m=f.current;m&&typeof m.focus=="function"&&document.contains(m)&&m.focus()}),[]),N.useEffect(()=>{const m=v=>{v.key==="Escape"&&(v.stopPropagation(),o&&o())};return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[o]),c.jsx("div",{className:"nc-detail-overlay",onMouseDown:m=>{m.target===m.currentTarget&&o&&o()},children:c.jsxs("div",{className:"nc-detail-sheet",ref:h,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":typeof e=="string"?e:void 0,children:[c.jsxs("div",{className:"nc-detail-head",children:[c.jsxs("div",{className:"nc-detail-title",children:[c.jsx("b",{children:e}),t&&c.jsx("small",{children:t})]}),n,c.jsx("button",{type:"button",className:"nc-btn ghost nc-detail-close",onClick:o,"aria-label":p("close"),children:c.jsx(Ze,{name:"x",size:14})})]}),c.jsx("div",{className:`nc-detail-body${a?" plain":""}`,children:u}),s&&c.jsx("div",{className:"nc-detail-foot",children:s})]})})}function Bo({title:e,hint:t,children:n}){return n==null||n===!1?null:c.jsxs("section",{className:"nc-detail-section",children:[e&&c.jsx("div",{className:"nc-sheet-label",children:e}),t&&c.jsx("small",{className:"nc-set-hint",children:t}),n]})}function E2({node:e,nodes:t,token:n,readonly:s,refresh:o,onClose:a}){var Ye,Ae;kn();const[u,h]=N.useState(null),[f,m]=N.useState(null),[v,b]=N.useState(null),[y,S]=N.useState(null),[w,x]=N.useState(!1),[k,P]=N.useState(""),[E,F]=N.useState(!1),[D,V]=N.useState(null),[G,z]=N.useState(!1),[Z,X]=N.useState(""),Q=N.useMemo(()=>y2(e,t,{readonly:s,busy:!!u}),[e,t,s,u]);if(!Q)return null;const{identity:O,reach:I,authority:C,exposure:T,grants:A,actions:$,canEditVisibility:U}=Q,R=O.routed?{up:I.up,since:null}:Yd(e.tunnel,Date.now()),W=async(Ne,ut)=>{m(null),h(Ne);try{await ut()}catch(Pe){m(String(Pe&&Pe.message||Pe))}h(null)},B=Ne=>{if(Ne==="edit"){S({label:e.label||e.name,ssh:e.ssh||"",sshPort:e.sshPort?String(e.sshPort):"",autostart:e.autostart===!0,visibility:e.visibility||"network"});return}if(Ne==="remove"){x(!0);return}W(`${e.name}:${Ne}`,async()=>{const ut=await ef(n,e.name,Ne);Ne==="test"&&b(ut),await o()})},j=(Ne,ut=x2(Ne))=>W(`${e.nodeId}:${Ne}`,async()=>{const Pe=await wg(n,e.nodeId,Ne,ut,e.route||[]);V({id:Pe.id,kind:Ne,submittedAt:Date.now()}),await o()}),M=()=>{const Ne=Z.trim().slice(0,D_);Ne&&W(`${e.nodeId}:prompt`,async()=>{const ut=await wg(n,e.nodeId,"prompt",{text:Ne},e.route||[]);V({id:ut.id,kind:"prompt",submittedAt:Date.now()}),X(""),z(!1),await o()})},K=()=>{if(!Mr(y.label)){m(p("err-label"));return}const Ne=O.inbound?{label:y.label,visibility:y.visibility,selected:y.visibility==="selected"?[...e.selected||[]]:[]}:{label:y.label,ssh:y.ssh,autostart:y.autostart,...y.sshPort?{sshPort:Number(y.sshPort)}:{}};return W(`${e.name}:edit`,async()=>{await L0(n,e.name,Ne),S(null),await o()})},ne=(Ne,ut)=>W(`${e.name}:visibility`,async()=>{await D0(n,e.name,Ne,ut),await o()}),le=U&&e.visibility==="selected"?v2(e,t,k):[],fe=c.jsxs("span",{className:`nc-set-tunnel${I.up?" up":""}`,children:[p(I.key),R.since?` · ${R.since}`:""]}),ge=e.kind==="vl",pe=ge?S2(e):[],we=ge?k2(e,D):null,He=Ne=>{const ut=`vl-cmd-${Ne}`,Pe=p(ut);return Pe===ut?Ne:Pe},ht=ge?[...pe.map(Ne=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u||s,title:s?p("settings-readonly"):void 0,onClick:()=>j(Ne),children:He(Ne)},Ne)),...I_(e)?[c.jsx("button",{type:"button",className:`nc-btn ghost${G?" on":""}`,disabled:!!u||s,title:s?p("settings-readonly"):void 0,onClick:()=>z(Ne=>!Ne),children:He("prompt")},"prompt")]:[]]:$.map(Ne=>c.jsx("button",{type:"button",className:`nc-btn ${Ne.danger?"danger":"ghost"}`,disabled:Ne.disabled,title:Ne.disabled&&s?p("settings-readonly"):void 0,onClick:()=>B(Ne.action),children:Ne.action==="remove"?c.jsxs(c.Fragment,{children:[c.jsx(Ze,{name:"trash",size:14})," ",p(Ne.key)]}):p(Ne.key)},Ne.action));return c.jsxs(C2,{title:O.title,subtitle:O.name,status:fe,footer:ht,onClose:a,children:[c.jsxs(Bo,{title:p("node-detail-reach"),children:[c.jsxs("dl",{className:"nc-detail-facts",children:[O.route&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-route")}),c.jsx("dd",{children:O.route.join(" › ")})]}),O.ssh&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-ssh")}),c.jsxs("dd",{children:[O.ssh,e.sshPort?`:${e.sshPort}`:""]})]}),O.transport&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-transport")}),c.jsx("dd",{children:O.transport})]}),ge&&e.ownerLabel&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:p("node-detail-owner")}),c.jsx("dd",{children:e.ownerLabel})]})]}),((Ye=e.health)==null?void 0:Ye.detail)&&c.jsx("div",{className:`nc-set-test${ge?e.health.state==="running"?" ok":e.health.state==="starting"?"":" ko":e.health.status==="healthy"?" ok":e.health.status==="passive"?"":" ko"}`,children:e.health.detail}),v&&c.jsxs("div",{className:`nc-set-test${v.ok?" ok":" ko"}`,children:[v.result,v.detail?` — ${v.detail}`:""]})]}),ge&&c.jsxs(Bo,{title:p("node-detail-command"),children:[pe.length===0&&!I_(e)&&c.jsx("small",{className:"nc-set-hint",children:p("vl-no-commands")}),G&&c.jsxs("div",{className:"nc-vl-prompt",children:[c.jsx("textarea",{value:Z,maxLength:D_,placeholder:p("vl-prompt-placeholder"),"aria-label":p("vl-prompt-placeholder"),disabled:!!u||s,onChange:Ne=>X(Ne.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!!u||s||!Z.trim(),onClick:M,children:p("vl-prompt-send")})]}),we&&c.jsxs("div",{className:`nc-set-test${we.phase==="done"?we.status==="ok"?" ok":" ko":""}`,children:[we.kind&&`${He(we.kind)}: `,we.phase==="submitted"&&p("vl-cmd-phase-submitted"),we.phase==="inflight"&&p("vl-cmd-phase-inflight"),we.phase==="done"&&p(we.status==="ok"?"vl-cmd-phase-done-ok":"vl-cmd-phase-done-error"),we.phase==="done"&&((Ae=we.result)!=null&&Ae.detail)?` — ${we.result.detail}`:""]})]}),c.jsxs(Bo,{title:p("node-detail-authority"),children:[c.jsx("div",{className:"nc-set-info",children:p(C.key)}),C.grants.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("authority-no-grants")})]}),c.jsxs(Bo,{title:p("node-detail-network-view"),children:[c.jsx("div",{className:"nc-set-info",children:p(ge?T.key:T.shared?"peer-shared":"peer-private")}),U&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-field",children:[p("peer-visibility"),c.jsxs("select",{value:e.visibility||"network",disabled:s||!!u,onChange:Ne=>ne(Ne.target.value),children:[c.jsx("option",{value:"network",children:p("visibility-network")}),c.jsx("option",{value:"relay-only",children:p("visibility-relay")}),c.jsx("option",{value:"selected",children:p("visibility-selected")})]})]}),e.visibility==="selected"&&c.jsxs("div",{className:"nc-detail-grants",children:[A.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("node-grant-none")}),A.map(Ne=>c.jsxs("div",{className:`nc-detail-grant${Ne.known?"":" unknown"}`,children:[c.jsxs("span",{children:[Ne.label,Ne.known?"":` — ${p("node-grant-unknown")}`]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:()=>ne("selected",(e.selected||[]).filter(ut=>ut!==Ne.id)),children:p("node-grant-remove")})]},Ne.id)),!E&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:()=>{F(!0),P("")},children:p("node-grant-add")}),E&&c.jsxs("div",{className:"nc-detail-picker",children:[c.jsx("input",{value:k,placeholder:p("node-grant-search"),disabled:s||!!u,onChange:Ne=>P(Ne.target.value)}),c.jsxs("div",{className:"nc-detail-picker-list",children:[le.length===0&&c.jsx("small",{className:"nc-set-hint",children:p("node-grant-no-candidates")}),le.map(Ne=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:s||!!u,onClick:async()=>{await ne("selected",[...e.selected||[],Ne.id]),F(!1),P("")},children:Ne.label},Ne.id))]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>{F(!1),P("")},children:p("cancel")})]})]})]})]}),y&&c.jsxs(Bo,{title:p("edit"),children:[c.jsxs("label",{className:"nc-field",children:[p("node-display-label"),c.jsx("input",{value:y.label,disabled:!!u,onChange:Ne=>S({...y,label:Ne.target.value})})]}),O.inbound?c.jsxs("label",{className:"nc-field",children:[p("peer-visibility"),c.jsxs("select",{value:y.visibility,disabled:!!u,onChange:Ne=>S({...y,visibility:Ne.target.value}),children:[c.jsx("option",{value:"network",children:p("visibility-network")}),c.jsx("option",{value:"relay-only",children:p("visibility-relay")}),c.jsx("option",{value:"selected",children:p("visibility-selected")})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-field",children:[p("node-ssh-label"),c.jsx("input",{value:y.ssh,disabled:!!u,onChange:Ne=>S({...y,ssh:Ne.target.value})})]}),c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",value:y.sshPort,disabled:!!u,onChange:Ne=>S({...y,sshPort:Ne.target.value.replace(/[^0-9]/g,"").slice(0,5)})})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:y.autostart,disabled:!!u,onChange:Ne=>S({...y,autostart:Ne.target.checked})})," ",p("boot-persist")]})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!!u,onClick:K,children:p("save")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>S(null),children:p("cancel")})]})]}),w&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("b",{children:p("node-remove-confirm").replace("{name}",O.title)}),c.jsx("small",{children:p("node-remove-warning")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn danger",disabled:!!u,onClick:()=>W(`${e.name}:remove`,async()=>{await A0(n,e.name),x(!1),await o(),a&&a()}),children:p("delete")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!!u,onClick:()=>x(!1),children:p("cancel")})]})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Mf(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window&&typeof Notification<"u"}function N2(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=atob(n),o=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)o[a]=s.charCodeAt(a);return o}async function j2(){if(!Mf())return"unsupported";if(Notification.permission==="denied")return"denied";try{return await(await navigator.serviceWorker.ready).pushManager.getSubscription()?"subscribed":"idle"}catch{return"idle"}}async function R2(e){if(!Mf())throw new Error("push-unsupported");if(await Notification.requestPermission()!=="granted")throw new Error("push-denied");const n=await Ht("/api/push/vapid",e),{publicKey:s}=await n.json();if(!s)throw new Error("vapid non disponibile");const a=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:N2(s)}),u=await Ht("/api/push/subscribe",e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({subscription:a.toJSON()})});if(!u.ok){try{await a.unsubscribe()}catch{}const h=await u.json().catch(()=>({}));throw new Error(h.error||`HTTP ${u.status}`)}return!0}async function P2(e){if(!Mf())return!1;const n=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!n)return!1;const s=n.endpoint;try{await n.unsubscribe()}catch{}try{await Ht("/api/push/subscribe",e,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({endpoint:s})})}catch{}return!0}const zh="nexuscrew.fleet",Jw=3,L2="nexuscrew.cells",Zw=/^[A-Za-z0-9._-]{1,32}$/,lc=/^[a-z0-9._-]{1,32}$/,eb=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,tb=new Set(["standard","unsafe"]),A2=4096,T2=4096,Ql=256,nb=8192,D2=4096,M2=32,I2=64,O2=24,B2=new Set(["format","version","exportedAt","cells","engines"]),z2=new Set(["id","cwdRel","engine","boot","model","models","permissionPolicies","commands","systemPrompt","prompt","label"]),F2=new Set(["id","cwd","engine","boot","model","models","permissionPolicies","systemPrompt","prompt"]);function Ks(e){if(typeof e!="string"||e.length>T2)return null;for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);if(s<=31||s===127||s===92)return null}if(e==="")return"";if(e.charAt(0)==="/"||/^[A-Za-z]:/.test(e))return null;const t=[];for(const n of e.split("/"))if(!(n===""||n===".")){if(n==="..")return null;t.push(n)}return t.join("/")}const $2=new Set(["id","label","rc","managed","command","args","envKeys","model","promptMode","promptFlag"]),H2=new Set(["client","provider","credentialProfile","model","permissionPolicy","displayName","protocol","baseUrl","envKey","providerId"]);function Oi(e,t){return typeof e=="string"&&e.length<=t&&!/[\x00-\x1f\x7f]/.test(e)}function If(e){const t=String(e||"");return/(?:bearer\s+|authorization\s*[:=]|(?:api[_-]?key|secret|token)\s*[:=])/i.test(t)||/^-{1,2}(?:api[-_]?key|access[-_]?key|auth(?:orization)?[-_]?token|token|secret|password|credential)(?:$|=)/i.test(t)||/\b(?:sk|fw|fpk|hf|zai)[-_][A-Za-z0-9._-]{8,}\b/i.test(t)||/https?:\/\/[^\s/@:]+:[^\s/@]+@/i.test(t)}function Yo(e,t){if(e===void 0)return{};if(!e||typeof e!="object"||Array.isArray(e))return null;const n=Object.entries(e);if(n.length>128)return null;const s={};for(const[o,a]of n){if(!lc.test(o)||!t(a))return null;s[o]=a}return s}function ib(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(h=>!z2.has(h))||!Zw.test(String(e.id||""))||typeof e.cwdRel!="string")return null;const t=Ks(e.cwdRel);if(t===null||!lc.test(String(e.engine||""))||e.boot!==void 0&&typeof e.boot!="boolean"||e.model!==void 0&&(typeof e.model!="string"||e.model.length>Ql)||e.systemPrompt!==void 0&&e.prompt!==void 0&&e.systemPrompt!==e.prompt)return null;const n=e.systemPrompt===void 0?e.prompt===void 0?"":e.prompt:e.systemPrompt;if(typeof n!="string"||n.length>nb)return null;const s=Yo(e.models,h=>typeof h=="string"&&!!h&&h.length<=Ql),o=Yo(e.permissionPolicies,h=>tb.has(h)),a=Yo(e.commands,h=>Oi(h,D2)&&!If(h));if(s===null||o===null||a===null)return null;const u={id:e.id,cwdRel:t,engine:e.engine,boot:e.boot===!0,systemPrompt:n};if(e.model&&(u.model=e.model),e.label!==void 0){if(!Oi(e.label,I2)||!String(e.label).trim())return null;u.label=String(e.label).trim()}return Object.keys(s).length&&(u.models=s),Object.keys(o).length&&(u.permissionPolicies=o),Object.keys(a).length&&(u.commands=a),u}function U2(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(a=>!F2.has(a))||!Zw.test(String(e.id||""))||typeof e.cwd!="string"||!e.cwd||e.cwd.length>A2||!lc.test(String(e.engine||""))||e.boot!==void 0&&typeof e.boot!="boolean"||e.model!==void 0&&(typeof e.model!="string"||e.model.length>Ql)||e.systemPrompt!==void 0&&e.prompt!==void 0&&e.systemPrompt!==e.prompt)return null;const t=e.systemPrompt===void 0?e.prompt===void 0?"":e.prompt:e.systemPrompt;if(typeof t!="string"||t.length>nb)return null;const n=Yo(e.models,a=>typeof a=="string"&&!!a&&a.length<=Ql),s=Yo(e.permissionPolicies,a=>tb.has(a));if(n===null||s===null)return null;const o={id:e.id,cwd:e.cwd,engine:e.engine,boot:e.boot===!0,systemPrompt:t};return e.model&&(o.model=e.model),Object.keys(n).length&&(o.models=n),Object.keys(s).length&&(o.permissionPolicies=s),o}function W2(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>!H2.has(n)))return null;const t={};for(const[n,s]of Object.entries(e)){if(typeof s!="string"||!Oi(s,n==="baseUrl"?512:128)||If(s))return null;t[n]=s}return!t.client||!t.provider||t.envKey&&!eb.test(t.envKey)?null:t}function sb(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(s=>!$2.has(s))||!lc.test(String(e.id||""))||!Oi(e.label||e.id,64)||e.rc!==void 0&&typeof e.rc!="boolean")return null;const t={id:e.id,label:e.label||e.id,rc:e.rc===!0};if(e.managed!==void 0){const s=W2(e.managed);return!s||["command","args","envKeys","model","promptMode","promptFlag"].some(o=>e[o]!==void 0)?null:(t.managed=s,t)}if(!Oi(e.command,512)||!e.command.startsWith("/")||!Array.isArray(e.args)||e.args.length>32||e.args.some(s=>!Oi(s,1024)||If(s))||e.promptMode!=="flag"&&e.promptMode!=="send-keys"||e.promptMode==="flag"&&(!Oi(e.promptFlag,32)||/\s/.test(e.promptFlag)))return null;if(e.model!==void 0){if(!e.model||typeof e.model!="object"||Array.isArray(e.model)||Object.keys(e.model).some(s=>s!=="flag"&&s!=="value")||!Oi(e.model.flag,32)||/\s/.test(e.model.flag)||!Oi(e.model.value||"",128))return null;t.model={flag:e.model.flag,value:e.model.value||""}}const n=e.envKeys===void 0?[]:e.envKeys;return!Array.isArray(n)||n.length>32||n.some(s=>!eb.test(s))?null:(Object.assign(t,{command:e.command,args:[...e.args],envKeys:[...new Set(n)].sort(),promptMode:e.promptMode}),e.promptMode==="flag"&&(t.promptFlag=e.promptFlag),t)}function rb(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.managed?{id:e.id,label:e.label,rc:e.rc,managed:e.managed}:{id:e.id,label:e.label,rc:e.rc,command:e.command,args:e.args,envKeys:e.envKeys,model:e.model,promptMode:e.promptMode,promptFlag:e.promptFlag},n=sb(t);return n||null}function K2(e,t,n=[],s=[],o=new Date){n instanceof Date&&(o=n,n=[],s=[]);const a=t instanceof Set?t:new Set(t||[]),u=s instanceof Set?s:new Set(s||[]),h=[];for(const m of Array.isArray(e)?e:[]){if(!a.has(m.id))continue;const v=ib({id:m.id,cwdRel:m.cwdRel,engine:m.engine,boot:m.boot===!0,...m.label?{label:m.label}:{},...m.model?{model:m.model}:{},...m.models?{models:m.models}:{},...m.permissionPolicies?{permissionPolicies:m.permissionPolicies}:{},systemPrompt:m.prompt||"",...m.commands?{commands:m.commands}:{}});if(!v)return{ok:!1,error:"invalid-cell",invalidCellIds:[m.id]};h.push(v)}const f=[];for(const m of Array.isArray(n)?n:[]){if(!u.has(m.id))continue;const v=rb(m);v&&f.push(v)}return{format:zh,version:Jw,exportedAt:o.toISOString(),cells:h,engines:f}}function q2(e){let t;try{t=JSON.parse(String(e||""))}catch{return{ok:!1,error:"invalid-json",cells:[],engines:[]}}const n=(t==null?void 0:t.format)===L2&&(t==null?void 0:t.version)===1,s=(t==null?void 0:t.format)===zh&&(t==null?void 0:t.version)===2,o=(t==null?void 0:t.format)===zh&&(t==null?void 0:t.version)===Jw,a=n||s,u=s||o;if(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(b=>!B2.has(b))||!n&&!s&&!o||!Array.isArray(t.cells)||t.cells.length>M2||u&&(!Array.isArray(t.engines)||t.engines.length>O2))return{ok:!1,error:"invalid-format",cells:[],engines:[]};const h=[],f=new Set;for(const b of t.cells){const y=a?U2(b):ib(b);if(!y)return{ok:!1,error:"invalid-cell",cells:[],engines:[]};if(f.has(y.id))return{ok:!1,error:"duplicate-cell",cells:[],engines:[]};f.add(y.id),h.push(y)}const m=[],v=new Set;for(const b of u?t.engines:[]){const y=sb(b);if(!y)return{ok:!1,error:"invalid-engine",cells:[],engines:[]};if(v.has(y.id))return{ok:!1,error:"duplicate-engine",cells:[],engines:[]};v.add(y.id),m.push(y)}return{ok:!0,cells:h,engines:m,legacy:a,exportedAt:typeof t.exportedAt=="string"?t.exportedAt:""}}function V2(e,t,n){const s=new Set(n||[]);if(!s.has(t))return null;const o=m=>Object.fromEntries(Object.entries(m||{}).filter(([v])=>s.has(v))),a={id:e.id,engine:t,boot:e.boot===!0,prompt:e.systemPrompt||""};typeof e.label=="string"&&e.label&&(a.label=e.label),typeof e.cwdRel=="string"?a.cwdRel=e.cwdRel:typeof e.cwd=="string"&&e.cwd&&(a.cwd=e.cwd),t===e.engine&&e.model?a.model=e.model:e.models&&e.models[t]&&(a.model=e.models[t]);const u=o(e.models),h=o(e.permissionPolicies),f=o(e.commands);return Object.keys(u).length&&(a.models=u),Object.keys(h).length&&(a.permissionPolicies=h),Object.keys(f).length&&(a.commands=f),a}const Y2=()=>({kind:"managed",id:"claude.native",label:"",client:"claude",provider:"native",credentialProfile:"",managedModel:"",permissionPolicy:"unsafe",credentialSourcePolicy:"auto",displayName:"",protocol:"anthropic_messages",baseUrl:"",envKey:"",providerId:"nexuscrew-custom",command:"",argsText:"",rc:!0,promptMode:"send-keys",promptFlag:"",modelFlag:"",modelValue:"",envRows:[],credentialValue:"",credentialReveal:!1,allowMissingCredential:!1}),O_=(e="")=>({id:"",cwd:"",engine:e,boot:!1,label:"",model:"",prompt:"",commands:{},command:""}),ob=e=>e==="claude"?"unsafe":"standard",Zo=(e,t)=>e.find(n=>n.client===t.client&&n.provider===t.provider&&(n.credentialProfile||"")===(t.credentialProfile||"")),G2=(e,t)=>{var n;return((n=Zo(e,t))==null?void 0:n.label)||`${t.client} · ${t.provider}`};function X2(e){var t,n,s,o,a,u,h,f,m,v,b,y,S,w,x;return{kind:e.managed?"managed":"custom",id:e.id,label:e.label||"",command:e.command||"",argsText:(e.args||[]).join(`
|
|
89
89
|
`),rc:!!e.rc,client:((t=e.managed)==null?void 0:t.client)||"claude",provider:((n=e.managed)==null?void 0:n.provider)||"native",credentialProfile:((s=e.managed)==null?void 0:s.credentialProfile)||"",managedModel:((o=e.managed)==null?void 0:o.model)||"",permissionPolicy:((a=e.managed)==null?void 0:a.permissionPolicy)||ob((u=e.managed)==null?void 0:u.client),credentialSourcePolicy:((h=e.managed)==null?void 0:h.credentialSourcePolicy)||"auto",displayName:((f=e.managed)==null?void 0:f.displayName)||"",protocol:((m=e.managed)==null?void 0:m.protocol)||"",baseUrl:((v=e.managed)==null?void 0:v.baseUrl)||"",envKey:((b=e.managed)==null?void 0:b.envKey)||"",providerId:((y=e.managed)==null?void 0:y.providerId)||"nexuscrew-custom",modelOptions:e.availableModels||((S=e.managedInfo)==null?void 0:S.models)||[],promptMode:e.promptMode||"send-keys",promptFlag:e.promptFlag||"",modelFlag:((w=e.model)==null?void 0:w.flag)||"",modelValue:((x=e.model)==null?void 0:x.value)||"",envRows:(e.envKeys||[]).map(k=>({key:k,value:"",configured:!0,remove:!1})),credentialValue:"",credentialReveal:!1,allowMissingCredential:!1}}function Q2(e,t,n=[]){if(e.kind==="managed"){const o={client:e.client,provider:e.provider,model:e.client==="shell"?"":e.managedModel||"",permissionPolicy:e.client==="shell"?"standard":e.permissionPolicy||ob(e.client)};e.credentialProfile&&(o.credentialProfile=e.credentialProfile),e.credentialSourcePolicy&&e.credentialSourcePolicy!=="auto"&&(o.credentialSourcePolicy=e.credentialSourcePolicy);const a=Zo(n,e);return(a==null?void 0:a.credentialEnv)===!0&&(o.envKey=e.envKey),e.provider==="custom"&&Object.assign(o,{displayName:e.displayName,protocol:e.protocol,baseUrl:e.baseUrl,envKey:e.envKey,providerId:e.providerId}),{...t?{id:e.id}:{},label:e.label||G2(n,e),rc:!!e.rc,managed:o}}const s={...t?{id:e.id}:{},label:e.label||e.id,rc:!!e.rc,command:e.command,args:e.argsText.split(`
|
|
90
90
|
`).filter(o=>o!==""),promptMode:e.promptMode};return e.modelFlag&&(s.model={flag:e.modelFlag,value:e.modelValue||""}),e.promptMode==="flag"&&(s.promptFlag=e.promptFlag),t&&(s.env=Object.fromEntries(e.envRows.filter(o=>!o.remove&&o.key).map(o=>[o.key,o.value]))),s}function $s({children:e,onClose:t,label:n,error:s=""}){const o=N.useRef(null),a=N.useRef(null),u=N.useRef(t);return u.current=t,N.useEffect(()=>{const h=document.activeElement,f=o.current,m=()=>Array.from((f==null?void 0:f.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))||[]).filter(y=>y.offsetParent!==null),v=requestAnimationFrame(()=>{var y;return(y=m()[0]||f)==null?void 0:y.focus({preventScroll:!0})}),b=y=>{var k;if(y.key==="Escape"){y.preventDefault(),(k=u.current)==null||k.call(u);return}if(y.key!=="Tab")return;const S=m();if(!S.length){y.preventDefault(),f==null||f.focus();return}const w=S[0],x=S[S.length-1];y.shiftKey&&document.activeElement===w?(y.preventDefault(),x.focus()):!y.shiftKey&&document.activeElement===x&&(y.preventDefault(),w.focus())};return document.addEventListener("keydown",b),()=>{cancelAnimationFrame(v),document.removeEventListener("keydown",b),h&&h.isConnected&&typeof h.focus=="function"&&h.focus({preventScroll:!0})}},[]),N.useEffect(()=>{s&&requestAnimationFrame(()=>{var h;return(h=a.current)==null?void 0:h.scrollIntoView({block:"nearest"})})},[s]),c.jsx("div",{className:"nc-fleet-modal",role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&t()},children:c.jsxs("div",{ref:o,className:"nc-fleet-modal-dialog",role:"dialog","aria-modal":"true","aria-label":n||p("settings"),tabIndex:-1,children:[e,s&&c.jsx("div",{ref:a,className:"nc-err nc-fleet-modal-error",role:"alert","aria-live":"assertive",children:s})]})})}function zd({token:e,targets:t=[],readonly:n=!1,onPower:s,onImport:o}){const[a,u]=N.useState([]),[h,f]=N.useState(0);N.useEffect(()=>{let k=!0;async function P(){const F=[{route:[],label:p("local")}].concat((t||[]).map(V=>({route:Array.isArray(V.route)?V.route:[],label:V.label||(V.route||[]).join(" › ")}))),D=await Promise.all(F.map(async V=>{const G={...V,available:!1,readonly:!1,capabilities:[],provider:null,cells:[],unmanaged:[],err:""};try{const z=await ws(e,V.route);G.available=!!z.available,G.capabilities=z.capabilities||[],G.provider=z.provider||null,G.cells=(z.cells||[]).map(Z=>({...Z,route:V.route}));try{G.readonly=!!(await Zh(e,V.route)).readonlyDefault}catch{}try{const Z=await Jh(e,V.route),X=new Set(G.cells.map(Q=>Q.tmuxSession).filter(Boolean));G.unmanaged=(Z.sessions||[]).filter(Q=>Q&&!X.has(Q.name))}catch{}}catch(z){G.err=String(z&&z.message||z)}return G}));k&&u(D)}P();const E=setInterval(P,6e3);return()=>{k=!1,clearInterval(E)}},[e,t,h]);const m=(k,P)=>Array.isArray(k.capabilities)&&k.capabilities.includes(P)&&!n&&!k.readonly,v=()=>f(k=>k+1),b=(k,P)=>{s&&s({...k,route:P})},y=(k,P)=>{s&&s({...k,route:P})},S=async(k,P)=>{try{await Fo(e,k.cell,P)}catch{}v()},w=async(k,P)=>{if(window.confirm(p("fleet-remove-cell").replace("{id}",k.cell))){try{await ey(e,k.cell,!0,P)}catch{}v()}},x=async(k,P)=>{if(window.confirm(p("terminate-confirm").replace("{name}",k.name))){try{await Xh(e,k.name,P)}catch{}v()}};return c.jsxs("div",{className:"nc-fleet-inventory",children:[c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-inventory")}),c.jsx("small",{children:p("fleet-inventory-help")})]}),a.map(k=>{const P=k.route.length?k.route.join("/"):"local";return c.jsxs("div",{className:"nc-fleet-pos",children:[c.jsxs("div",{className:"nc-fleet-pos-title",children:[c.jsx("span",{className:`dot ${k.available?"on":"warn"}`}),c.jsx("b",{children:k.label}),c.jsx("small",{children:k.available?`${k.cells.length} ${p("fleet-cells")} · ${k.unmanaged.length} ${p("fleet-tmux")}`:k.err||p("fleet-not-available")})]}),k.cells.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-cell",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.cell}),c.jsx("small",{children:`${E.engine||""}${E.key?`·${E.key}`:""}${E.active?"":` · ${p("cell-off")}`}`})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[E.active&&m(k,"down")&&c.jsx("button",{className:"nc-btn ghost",title:p("power-off"),onClick:()=>y(E,k.route),children:p("stop")}),!E.active&&m(k,"up")&&c.jsx("button",{className:"nc-btn ghost",title:p("power-on"),onClick:()=>b(E,k.route),children:p("start")}),m(k,"restart")&&E.active&&c.jsx("button",{className:"nc-btn ghost",title:p("restart"),onClick:()=>S(E,k.route),children:p("restart")}),m(k,"remove")&&c.jsx("button",{className:"nc-btn danger",title:p("delete"),onClick:()=>w(E,k.route),children:"×"})]})]},`${P}:${E.cell}`)),k.unmanaged.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-unmanaged",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.name}),c.jsx("small",{children:p("fleet-tmux")})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[m(k,"import")&&o&&c.jsx("button",{className:"nc-btn ghost",title:p("import-as-cell"),onClick:()=>o(E,k.route),children:p("import-as-cell")}),c.jsx("button",{className:"nc-btn danger",title:p("terminate"),onClick:()=>x(E,k.route),children:"×"})]})]},`${P}:u:${E.name}`)),k.available&&k.cells.length===0&&k.unmanaged.length===0&&c.jsx("div",{className:"nc-empty",children:p("fleet-inventory-empty")})]},P)})]})}function J2({cells:e=[],engines:t=[],busy:n,canRestore:s=!1,onRestore:o,onClose:a}){const[u,h]=N.useState("export"),[f,m]=N.useState(()=>new Set(e.map(C=>C.id))),[v,b]=N.useState(()=>new Set(t.map(C=>C.id))),[y,S]=N.useState([]),[w,x]=N.useState([]),[k,P]=N.useState(""),E=new Set(t.map(C=>C.id)),F=new Set(e.map(C=>C.id)),D=(C,T)=>C(A=>{const $=new Set(A);return $.has(T)?$.delete(T):$.add(T),$}),V=()=>{const C=K2(e,f,t,v);if(C.ok===!1){P(p(`fleet-backup-${C.error}`));return}const T=e.filter(W=>f.has(W.id)).length,A=t.filter(W=>v.has(W.id)).length;if(C.cells.length!==T){P(p("fleet-backup-invalid-cell"));return}if(C.engines.length!==A){P(p("fleet-backup-invalid-engine"));return}if(!C.cells.length&&!C.engines.length){P(p("fleet-backup-select-one"));return}const $=new Blob([`${JSON.stringify(C,null,2)}
|
|
91
91
|
`],{type:"application/json"}),U=URL.createObjectURL($),R=document.createElement("a");R.href=U,R.download=`nexuscrew-fleet-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(R),R.click(),R.remove(),setTimeout(()=>URL.revokeObjectURL(U),0),P("")},G=async C=>{if(P(""),S([]),x([]),!!C){if(C.size>1024*1024){P(p("fleet-backup-too-large"));return}try{const T=q2(await C.text());if(!T.ok){P(p(`fleet-backup-${T.error}`));return}const A=new Set(T.engines.map($=>$.id));x(T.engines.map($=>({engine:$,exists:E.has($.id),selected:!E.has($.id)}))),S(T.cells.map($=>{const U=E.has($.engine)||A.has($.engine),R=F.has($.id);return{cell:$,engine:U?$.engine:"",selected:U&&!R,exists:R}}))}catch(T){P(String(T.message||T))}}},z=(C,T)=>S(A=>A.map(($,U)=>U===C?{...$,...T}:$)),Z=(C,T)=>x(A=>A.map(($,U)=>U===C?{...$,...T}:$)),X=new Set([...E,...w.filter(C=>C.selected).map(C=>C.engine.id)]),Q=y.filter(C=>C.selected&&C.engine&&X.has(C.engine)),O=w.filter(C=>C.selected),I=[...new Map([...t.map(C=>[C.id,C.label||C.id]),...w.filter(C=>C.selected).map(C=>[C.engine.id,C.engine.label||C.engine.id])]).entries()];return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-backup-dialog",children:[c.jsx("b",{children:p("fleet-backup")}),c.jsx("small",{children:p("fleet-backup-help")}),c.jsxs("div",{className:"nc-set-tabs nc-backup-tabs",children:[c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="export"?" on":""}`,onClick:()=>{h("export"),P("")},children:p("fleet-backup-export")}),c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="import"?" on":""}`,disabled:!s,title:s?"":p("fleet-backup-restore-unavailable"),onClick:()=>{h("import"),P("")},children:p("fleet-backup-import")})]}),u==="export"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set(e.map(C=>C.id))),b(new Set(t.map(C=>C.id)))},children:p("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set),b(new Set)},children:p("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[c.jsx("b",{children:p("fleet-engines")}),t.map(C=>{var T;return c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:v.has(C.id),onChange:()=>D(b,C.id)}),c.jsxs("span",{children:[c.jsx("b",{children:C.label||C.id}),c.jsxs("small",{children:[C.id,(T=C.envKeys)!=null&&T.length?` · ${C.envKeys.length} ${p("fleet-backup-env-names")}`:""]})]})]},C.id)}),c.jsx("b",{children:p("fleet-cells")}),e.map(C=>c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:f.has(C.id),onChange:()=>D(m,C.id)}),c.jsxs("span",{children:[c.jsx("b",{children:C.id}),c.jsxs("small",{children:[C.engine," · ",p("fleet-system-prompt")," ",(C.prompt||"").length," ",p("characters")]})]})]},C.id)),!e.length&&!t.length&&c.jsx("div",{className:"nc-empty",children:p("fleet-backup-empty")})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!f.size&&!v.size,onClick:V,children:p("fleet-backup-download")})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"file",accept:"application/json,.json",disabled:n,onChange:C=>G(C.target.files&&C.target.files[0])}),c.jsx("small",{children:p("fleet-backup-import-help")}),!!(y.length||w.length)&&c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{x(C=>C.map(T=>({...T,selected:!0}))),S(C=>C.map(T=>({...T,selected:!!T.engine})))},children:p("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{x(C=>C.map(T=>({...T,selected:!1}))),S(C=>C.map(T=>({...T,selected:!1})))},children:p("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[!!w.length&&c.jsx("b",{children:p("fleet-engines")}),w.map((C,T)=>{var A;return c.jsx("div",{className:"nc-backup-import-row",children:c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:C.selected,onChange:$=>Z(T,{selected:$.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:C.engine.label||C.engine.id}),c.jsxs("small",{children:[C.engine.id," · ",C.exists?p("fleet-backup-overwrite"):p("fleet-backup-new"),(A=C.engine.envKeys)!=null&&A.length?` · ${p("fleet-backup-env-values-required")}`:""]})]})]})},C.engine.id)}),!!y.length&&c.jsx("b",{children:p("fleet-cells")}),y.map((C,T)=>c.jsxs("div",{className:"nc-backup-import-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:C.selected,disabled:!C.engine||!X.has(C.engine),onChange:A=>z(T,{selected:A.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:C.cell.id}),c.jsxs("small",{children:[C.exists?p("fleet-backup-overwrite"):p("fleet-backup-new")," · ",p("fleet-system-prompt")," ",C.cell.systemPrompt.length," ",p("characters")]})]})]}),c.jsxs("select",{value:C.engine,onChange:A=>z(T,{engine:A.target.value,selected:!!A.target.value}),children:[c.jsx("option",{value:"",children:p("fleet-backup-engine-missing")}),I.map(([A,$])=>c.jsx("option",{value:A,children:$},A))]})]},C.cell.id))]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||!Q.length&&!O.length,onClick:()=>o({engineRows:w,cellRows:y}),children:p("fleet-backup-restore")})]})]}),k&&c.jsx("div",{className:"nc-err",children:k})]})}function Z2({state:e,setState:t,busy:n,onSave:s,catalog:o}){var P;const a=e.form,u=E=>t({...e,form:{...a,...E}}),h=a.envRows||[],f=[...new Map(o.map(E=>[E.client,E.clientLabel||E.client])).entries()],m=o.filter(E=>E.client===a.client),v=Zo(o,a),b=typeof(v==null?void 0:v.credentialEnv)=="string"?v.credentialEnv:"",y=Array.isArray(v==null?void 0:v.credentialUsedBy)?v.credentialUsedBy:[],S=(v==null?void 0:v.credentialSource)||"missing",w=!!(v!=null&&v.credentialEnv)||a.credentialProfile==="a"||a.credentialProfile==="p",x=!!b&&e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&!a.allowMissingCredential,k=E=>{E&&u({client:E.client,provider:E.provider,credentialProfile:E.credentialProfile||"",managedModel:E.model||"",protocol:E.protocol||"",permissionPolicy:E.permissionPolicyDefault||"standard",credentialSourcePolicy:"auto",rc:!!E.rc,displayName:E.custom?p("fleet-custom-provider-default"):"",baseUrl:E.custom?"":E.endpoint||"",envKey:E.defaultEnvKey||"",providerId:"nexuscrew-custom",credentialValue:"",credentialReveal:!1,allowMissingCredential:!1,...e.mode==="new"?{id:E.id,label:""}:{}})};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:e.mode==="new"?p("fleet-new-engine"):`${p("edit")} ${a.id}`}),c.jsx("input",{value:a.id,disabled:e.mode!=="new",placeholder:"id",onChange:E=>u({id:E.target.value})}),c.jsx("input",{value:a.label,placeholder:p("label"),onChange:E=>u({label:E.target.value})}),c.jsxs("select",{value:a.kind,disabled:e.mode!=="new",onChange:E=>u({kind:E.target.value}),children:[c.jsx("option",{value:"managed",children:p("fleet-managed")}),c.jsx("option",{value:"custom",children:p("fleet-custom")})]}),a.kind==="managed"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("select",{value:a.client,disabled:e.mode!=="new",onChange:E=>k(o.find(F=>F.client===E.target.value&&F.default)||o.find(F=>F.client===E.target.value)),children:f.map(([E,F])=>c.jsx("option",{value:E,children:F},E))}),c.jsx("select",{value:((P=Zo(o,a))==null?void 0:P.id)||"",disabled:e.mode!=="new",onChange:E=>k(o.find(F=>F.id===E.target.value)),children:m.map(E=>c.jsx("option",{value:E.id,children:E.label},E.id))})]}),a.client!=="shell"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.managedModel,list:"nc-managed-models",placeholder:p(v!=null&&v.requiresModel?"fleet-model-required":"fleet-model-default"),onChange:E=>u({managedModel:E.target.value})}),c.jsx("datalist",{id:"nc-managed-models",children:[...(v==null?void 0:v.models)||[],...a.modelOptions||[]].filter((E,F,D)=>E&&D.indexOf(E)===F).map(E=>c.jsx("option",{value:E},E))})]}),v!=null&&v.supportsUnsafe?c.jsxs("select",{value:a.permissionPolicy,onChange:E=>u({permissionPolicy:E.target.value}),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]}):c.jsx("small",{children:p("fleet-standard-permissions")}),(v==null?void 0:v.supportsUnsafe)&&a.permissionPolicy==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),w&&c.jsxs("select",{"aria-label":p("fleet-credential-source-policy"),value:a.credentialSourcePolicy||"auto",onChange:E=>u({credentialSourcePolicy:E.target.value}),children:[c.jsx("option",{value:"auto",children:p("fleet-credential-source-policy-auto")}),c.jsx("option",{value:"nexuscrew-store",children:p("fleet-credential-source-policy-nexuscrew-store")}),c.jsx("option",{value:"environment",children:p("fleet-credential-source-policy-environment")})]}),(v==null?void 0:v.credentialEnv)===!0&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.envKey,placeholder:p("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("small",{children:p("fleet-custom-secret-help")})]}),b&&c.jsxs("section",{className:"nc-fleet-key","aria-label":p("fleet-key-section"),children:[c.jsxs("div",{className:"nc-fleet-key-head",children:[c.jsx("b",{children:p("fleet-key-section")}),c.jsx("span",{children:p(`fleet-credential-source-${S}`)})]}),c.jsxs("label",{className:"nc-field",children:[p("fleet-key-variable"),c.jsx("input",{value:b,readOnly:!0,"aria-label":p("fleet-key-variable")})]}),c.jsx("small",{children:y.length?p("fleet-key-used-by").replace("{engines}",y.join(", ")):p("fleet-key-used-by-none")}),y.length>0&&c.jsx("small",{children:p("fleet-key-shared-impact").replace("{key}",b).replace("{engines}",y.join(", "))}),c.jsxs("div",{className:"nc-fleet-key-input",children:[c.jsx("input",{type:a.credentialReveal?"text":"password",value:a.credentialValue||"","aria-label":p("fleet-key-value").replace("{key}",b),autoComplete:"new-password",spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",placeholder:v!=null&&v.authConfigured||e.mode==="edit"?p("fleet-key-blank-keeps"):p("fleet-key-enter"),onChange:E=>u({credentialValue:E.target.value,allowMissingCredential:E.target.value?!1:a.allowMissingCredential})}),c.jsx("button",{type:"button",className:"nc-btn ghost","aria-label":p(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal"),onClick:()=>u({credentialReveal:!a.credentialReveal}),children:p(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal")})]}),c.jsx("small",{children:p("fleet-key-local-help")}),e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&c.jsxs("label",{className:"nc-check nc-fleet-key-missing",children:[c.jsx("input",{type:"checkbox",checked:!!a.allowMissingCredential,onChange:E=>u({allowMissingCredential:E.target.checked})}),p("fleet-key-create-missing")]}),(v==null?void 0:v.notice)&&c.jsx("small",{className:"nc-fleet-provider-notice",children:p(`fleet-provider-notice-${v.notice}`)})]}),(v==null?void 0:v.notice)&&!b&&c.jsx("small",{className:"nc-fleet-provider-notice",children:p(`fleet-provider-notice-${v.notice}`)}),a.provider==="custom"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.displayName,placeholder:p("fleet-provider-display"),onChange:E=>u({displayName:E.target.value})}),c.jsx("input",{value:a.baseUrl,placeholder:"https://api.example.com/v1",onChange:E=>u({baseUrl:E.target.value})}),((v==null?void 0:v.protocols)||[]).length>1&&c.jsx("select",{value:a.protocol,onChange:E=>u({protocol:E.target.value}),children:v.protocols.map(E=>c.jsx("option",{value:E,children:E},E))}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.envKey,placeholder:p("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("input",{value:a.providerId,placeholder:p("fleet-provider-id"),onChange:E=>u({providerId:E.target.value})})]}),c.jsxs("small",{children:[a.protocol," · ",p("fleet-custom-secret-help")]})]}),c.jsx("small",{children:p(a.client==="shell"?"fleet-shell-engine-help":"fleet-managed-help")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.command,placeholder:p("command-path"),onChange:E=>u({command:E.target.value})}),c.jsx("textarea",{value:a.argsText,placeholder:p("args-lines"),onChange:E=>u({argsText:E.target.value})}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:a.rc,onChange:E=>u({rc:E.target.checked})})," remote control"]}),c.jsxs("select",{value:a.promptMode,onChange:E=>u({promptMode:E.target.value}),children:[c.jsx("option",{value:"send-keys",children:"send-keys"}),c.jsx("option",{value:"flag",children:"flag"})]}),a.promptMode==="flag"&&c.jsx("input",{value:a.promptFlag,placeholder:"prompt flag",onChange:E=>u({promptFlag:E.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.modelFlag,placeholder:"model flag",onChange:E=>u({modelFlag:E.target.value})}),c.jsx("input",{value:a.modelValue,placeholder:"model default",onChange:E=>u({modelValue:E.target.value})})]}),c.jsx("small",{children:p("env-write-only")}),h.map((E,F)=>c.jsxs("div",{className:"nc-fleet-env",children:[c.jsx("input",{value:E.key,disabled:E.configured,placeholder:"ENV_KEY",onChange:D=>{const V=h.slice();V[F]={...E,key:D.target.value},u({envRows:V})}}),c.jsx("input",{type:"password",value:E.value,placeholder:E.configured?"•••••• (unchanged)":"value",onChange:D=>{const V=h.slice();V[F]={...E,value:D.target.value},u({envRows:V})}}),c.jsx("button",{className:"nc-btn danger",onClick:()=>u({envRows:h.filter((D,V)=>V!==F)}),children:"×"})]},`${E.key}-${F}`)),c.jsx("button",{className:"nc-btn ghost",onClick:()=>u({envRows:[...h,{key:"",value:"",configured:!1}]}),children:"+ env"})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>t(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:n||!a.id||x||a.kind==="custom"&&!a.command||a.kind==="managed"&&(v==null?void 0:v.requiresModel)&&!a.managedModel||a.kind==="managed"&&(v==null?void 0:v.credentialEnv)===!0&&!a.envKey||a.kind==="managed"&&a.provider==="custom"&&(!a.displayName||!a.baseUrl||!a.envKey||!a.providerId),onClick:s,children:p("save")})]})]})}function ej({token:e,route:t,targets:n=[],location:s,setLocation:o,state:a,setState:u,engines:h,busy:f,onSave:m}){var G;const[v,b]=N.useState(null),[y,S]=N.useState(""),w=a.form,x=z=>u({...a,form:{...w,...z}}),k=h.find(z=>z.id===w.engine),P=((G=k==null?void 0:k.managed)==null?void 0:G.client)==="shell",E=z=>{var Q,O,I,C;const Z=h.find(T=>T.id===z),X={...w.commands||{}};((Q=k==null?void 0:k.managed)==null?void 0:Q.client)==="shell"&&(w.command?X[w.engine]=w.command:delete X[w.engine]),x({engine:z,model:((O=w.models)==null?void 0:O[z])||((I=Z==null?void 0:Z.managed)==null?void 0:I.model)||((C=Z==null?void 0:Z.model)==null?void 0:C.value)||"",commands:X,command:X[z]||""})},F=z=>{const Z={...w.commands||{}};z?Z[w.engine]=z:delete Z[w.engine],x({command:z,commands:Z})},D=P&&/[|&;<>()`$*?{}\[\]~]/.test(w.command||""),V=async z=>{try{const Z=await Qh(e,z,t);b(Z),x({cwd:Z.path}),S("")}catch(Z){S(String(Z.message||Z))}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:a.mode==="new"?p("fleet-new-cell"):`${p("edit")} ${w.id}`}),a.mode==="new"&&c.jsxs("label",{className:"nc-field",children:[p("location"),c.jsx("span",{className:"nc-req",children:" *"}),c.jsxs("select",{value:s,onChange:z=>{o(z.target.value),x({engine:""})},children:[c.jsx("option",{value:"",children:p("local")}),n.map(z=>c.jsxs("option",{value:z.route.join("/"),disabled:z.status&&z.status!=="up",children:[z.label,z.status&&z.status!=="up"?` · ${p("node-offline")}`:""]},z.route.join("/")))]})]}),c.jsx("input",{value:w.id,disabled:a.mode!=="new",placeholder:"id",onChange:z=>x({id:z.target.value})}),c.jsx("input",{value:w.label||"",maxLength:64,placeholder:p("fleet-cell-label"),onChange:z=>x({label:z.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:w.cwd,placeholder:p("cwd"),onChange:z=>x({cwd:z.target.value})}),c.jsx("button",{className:"nc-btn ghost",onClick:()=>v?b(null):V(w.cwd),children:p("browse")})]}),v&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:v.path}),c.jsxs("div",{className:"nc-fs-list",children:[v.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>V(v.parent),children:["↑ ",p("fs-parent")]}),(v.dirs||[]).map(z=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>V(`${v.path.replace(/\/$/,"")}/${z}`),children:["📁 ",z]},z))]})]}),y&&c.jsx("div",{className:"nc-err",children:y}),c.jsx("select",{value:w.engine,onChange:z=>E(z.target.value),children:h.map(z=>c.jsx("option",{value:z.id,children:z.label},z.id))}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!w.boot,onChange:z=>x({boot:z.target.checked})})," boot"]}),P?c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.command||"",maxLength:4096,placeholder:p("fleet-shell-command-placeholder"),onChange:z=>F(z.target.value)}),c.jsx("small",{children:w.command?p("fleet-shell-command-help"):p("fleet-shell-interactive")}),D&&c.jsx("small",{className:"nc-note",children:p("fleet-shell-command-metachar")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.model||"",list:"nc-cell-models",placeholder:p("fleet-model-override"),onChange:z=>x({model:z.target.value})}),c.jsx("datalist",{id:"nc-cell-models",children:((k==null?void 0:k.availableModels)||[]).map(z=>c.jsx("option",{value:z},z))}),c.jsx("textarea",{value:w.prompt||"",placeholder:"prompt",onChange:z=>x({prompt:z.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>u(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:f||!w.id||!w.cwd||!w.engine,onClick:m,children:p("save")})]})]})}function B_({token:e,route:t=[],state:n,setState:s,busy:o,onSave:a}){const[u,h]=N.useState(null),[f,m]=N.useState([]),[v,b]=N.useState(""),y=Array.isArray(t)?t.join("/"):"";N.useEffect(()=>{let P=!0;return Gh(e,y?y.split("/"):[]).then(E=>{P&&(m(E.engines||[]),b(""))}).catch(E=>{P&&(m([]),b(String(E.message||E)))}),()=>{P=!1}},[e,y]);const S=n.form,w=P=>s({...n,form:{...S,...P}}),x=async P=>{try{const E=await Qh(e,P,t);h(E),w({cwd:E.path})}catch{}},k=!S.id&&S.tmuxSession?S.tmuxSession.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32):S.id;return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsxs("b",{children:[p("import-as-cell")," · ",S.tmuxSession]}),c.jsx("small",{children:p("import-help")}),c.jsx("input",{value:S.tmuxSession,disabled:!0,placeholder:"tmux session",readOnly:!0}),c.jsx("input",{value:S.id,placeholder:p("name"),onChange:P=>w({id:P.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:S.cwd,placeholder:p("cwd"),onChange:P=>w({cwd:P.target.value})}),c.jsx("button",{className:"nc-btn ghost",type:"button",onClick:()=>u?h(null):x(S.cwd),children:p("browse")})]}),u&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:u.path}),c.jsxs("div",{className:"nc-fs-list",children:[u.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>x(u.parent),children:["↑ ",p("fs-parent")]}),(u.dirs||[]).map(P=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>x(`${u.path.replace(/\/$/,"")}/${P}`),children:["📁 ",P]},P))]})]}),c.jsxs("select",{value:S.engine,onChange:P=>w({engine:P.target.value}),children:[c.jsx("option",{value:"",children:p("import-engine-required")}),f.map(P=>c.jsx("option",{value:P.id,children:P.label},P.id))]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!S.boot,onChange:P=>w({boot:P.target.checked})})," boot"]}),(n.err||v)&&c.jsx("div",{className:"nc-err",children:n.err||v}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>s(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:o||!S.tmuxSession||!S.engine||!f.length,onClick:a,children:p(k?"import-as-cell":"save")})]})]})}function El(e){const t=Ks(e);return t===null?`~/${e}`:t?`~/${t}`:"~"}function tj(e){if(!e||typeof e.path!="string"||typeof e.home!="string")return"";const{path:t,home:n}=e;return!n||t===n||!t.startsWith(n+"/")?"":t.slice(n.length+1).replace(/\/+$/,"")}function nj({token:e,route:t,cell:n,busy:s=!1,onSaved:o,onClose:a}){const[u,h]=N.useState(""),[f,m]=N.useState(null),[v,b]=N.useState(!1),[y,S]=N.useState(""),w=typeof(n==null?void 0:n.cwdSuggestion)=="string"&&Ks(n.cwdSuggestion)!==null?Ks(n.cwdSuggestion):null,[x,k]=N.useState(w),P=n==null?void 0:n.id,E=s||v,F=async X=>{const Q=Ks(X);if(Q===null){m({rel:"",dirs:[],loading:!1,err:p("fleet-cwd-repair-invalid")});return}m({rel:Q,dirs:[],loading:!0,err:""});try{const O=await Qh(e,Q,t),I=tj(O);m({rel:I,dirs:Array.isArray(O.dirs)?O.dirs:[],loading:!1,err:""})}catch(O){m({rel:Q,dirs:[],loading:!1,err:String(O&&O.message||O)})}},D=X=>{if(!f)return;const Q=f.rel?`${f.rel}/${X}`:X;F(Q)},V=()=>{f!=null&&f.rel&&F(f.rel.split("/").slice(0,-1).join("/"))},G=()=>{f&&(h(f.rel||""),m(null),S(""),k(null))},z=()=>{x!==null&&(h(x),k(null),S(""))},Z=async()=>{if(E)return;const X=Ks(u);if(X===null){S(p("fleet-cwd-repair-invalid"));return}const Q=El(X);let O=!0;try{O=window.confirm(p("fleet-cwd-repair-confirm").replace("{id}",String(P||"")).replace("{path}",Q))}catch{O=!1}if(O){b(!0),S(""),k(null);try{const I=await Z_(e,P,{cwdRel:X},t);o==null||o(I)}catch(I){const C=I&&I.data||{};if(C.code==="unportable-cwd"){S(p("fleet-cwd-repair-unportable"));const T=Array.isArray(C.cells)?C.cells.find($=>$&&$.id===P):null,A=T&&typeof T.suggestion=="string"?T.suggestion:null;A!==null&&Ks(A)!==null&&k(A)}else S(String(I&&I.message||I))}finally{b(!1)}}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-cwd-repair",children:[c.jsx("b",{children:p("fleet-cwd-repair-title").replace("{id}",String(P||""))}),c.jsx("small",{className:"nc-set-info",children:p("fleet-cwd-repair-help")}),c.jsx("small",{className:"nc-cwd-no-source",children:p("fleet-cwd-repair-no-source-path")}),c.jsxs("label",{className:"nc-field",children:[p("cwd"),c.jsxs("div",{className:"nc-cwd-rel-row",children:[c.jsx("span",{className:"nc-cwd-rel-prefix",children:"~/"}),c.jsx("input",{value:u,placeholder:p("fleet-cwd-repair-placeholder"),autoComplete:"off",spellCheck:"false",autoCapitalize:"none",onChange:X=>h(X.target.value)}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:E,onClick:()=>f?m(null):F(""),children:p(f?"close":"fleet-cwd-repair-browse")})]})]}),c.jsx("div",{className:"nc-cwd-preview",children:p("fleet-cwd-repair-preview").replace("{path}",El(u))}),f&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:El(f.rel)}),c.jsxs("div",{className:"nc-fs-list",children:[f.rel&&c.jsxs("button",{type:"button",className:"nc-fs-item nc-fs-nav",onClick:V,children:["↑ ",p("fs-parent")]}),f.loading&&c.jsx("div",{className:"nc-fs-empty",children:"…"}),!f.loading&&f.dirs.length===0&&c.jsx("div",{className:"nc-fs-empty",children:p("fleet-cwd-repair-fs-empty")}),!f.loading&&f.dirs.map(X=>c.jsxs("button",{type:"button",className:"nc-fs-item",onClick:()=>D(X),children:["📁 ",X]},X))]}),f.err&&c.jsx("div",{className:"nc-err",children:f.err}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E||f.loading||!!f.err,onClick:G,children:p("fleet-cwd-repair-use-current")})})]}),y&&c.jsx("div",{className:"nc-err",role:"alert",children:y}),x!==null&&c.jsxs("div",{className:"nc-cwd-suggestion",role:"status",children:[c.jsx("span",{children:p("fleet-cwd-repair-suggestion")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:z,children:p("fleet-cwd-repair-use-suggestion").replace("{path}",El(x))})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:v,onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E,onClick:Z,children:v?"…":p("save")})]})]})}function ij({token:e,readonly:t,targets:n=[],startNewCell:s=!1,initialLocation:o=""}){const[a,u]=N.useState({engines:[],cells:[],managedCatalog:[]}),[h,f]=N.useState({available:!1,capabilities:[]}),[m,v]=N.useState(!1),[b,y]=N.useState(null),[S,w]=N.useState(null),[x,k]=N.useState(!1),[P,E]=N.useState(""),[F,D]=N.useState(""),[V,G]=N.useState(o),[z,Z]=N.useState(!1),[X,Q]=N.useState(null),[O,I]=N.useState(null),[C,T]=N.useState(null),[A,$]=N.useState(!1),[U,R]=N.useState([]),[W,B]=N.useState(null),[j,M]=N.useState("manage"),K=N.useRef(!1),ne=V?V.split("/"):[],le=N.useCallback(async()=>{try{const re=await ws(e,ne);f(re);try{const xe=await Zh(e,ne);Z(!!xe.readonlyDefault)}catch{Z(!1)}if(re.provider==="builtin"&&(re.capabilities||[]).includes("definitions")){const xe=await Gh(e,ne),Oe=new Map((re.engines||[]).map(Fe=>[Fe.id,Fe]));if(xe.engines=(xe.engines||[]).map(Fe=>{var de;return{...Fe,availableModels:((de=Oe.get(Fe.id))==null?void 0:de.models)||[]}}),u(xe),(re.capabilities||[]).includes("credentials"))try{R((await m0(e,ne)).credentials||[])}catch{R([])}else R([])}E("")}catch(re){E(String(re.message||re))}finally{v(!0)}},[e,V]);N.useEffect(()=>{le();const re=setInterval(le,5e3);return()=>clearInterval(re)},[le]);const fe=new Set((h.cells||[]).filter(re=>re.active).map(re=>re.cell)),ge=h.provider==="builtin"&&(h.capabilities||[]).includes("edit"),pe=(h.capabilities||[]).includes("restore");N.useEffect(()=>{!s||K.current||!ge||!a.engines.length||(K.current=!0,w({mode:"new",form:O_(a.engines[0].id)}))},[s,ge,a.engines]);const we=async re=>{k(!0),E(""),D("");try{await re(),await le()}catch(xe){E(String(xe.message||xe))}k(!1)},He=()=>we(async()=>{var me;const re=b.mode==="new",xe=b.form,Oe=a.managedCatalog||[],Fe=xe.kind==="managed"?Zo(Oe,xe):null,de=typeof(Fe==null?void 0:Fe.credentialEnv)=="string"?Fe.credentialEnv:"",ze=de&&xe.credentialValue||"",q=Q2(xe,re,Oe);!re&&b.form.kind==="custom"&&!b.form.modelFlag&&(q.model=null),!re&&b.form.kind==="custom"&&b.form.promptMode!=="flag"&&(q.promptFlag=null);let te;if(re)te=await v0(e,q,ne);else{const Te=b.original,_e=new Set(b.form.envRows.filter(ot=>!ot.remove).map(ot=>ot.key)),Ce=(Te.envKeys||[]).filter(ot=>!_e.has(ot)),nt=Object.fromEntries(b.form.envRows.filter(ot=>!ot.remove&&ot.key&&(!ot.configured||ot.value!=="")).map(ot=>[ot.key,ot.value]));te=await _0(e,Te.id,q,b.form.kind==="custom"?{set:nt,remove:Ce}:void 0,ne)}let H=null;if(de&&ze)try{H=await yg(e,de,ze,ne),R(H.credentials||[])}catch{throw await le(),re&&y({mode:"edit",original:{...q,id:xe.id},form:{...xe,credentialReveal:!1}}),new Error(p(re?"fleet-key-partial-create":"fleet-key-partial-edit"))}await le(),y(null),D(p("fleet-saved"));const ae=((me=((H==null?void 0:H.credentials)||[]).find(Te=>Te.envKey===de))==null?void 0:me.activeCells)||[],ce=[...new Set([...(te==null?void 0:te.activeCells)||[],...ae])];if(ce.length&&window.confirm(p("fleet-restart-confirm").replace("{cells}",ce.join(", "))))for(const Te of ce)await Fo(e,Te,ne)}),ht=()=>we(async()=>{var H,ae,ce,me,Te,_e;const re=S.mode==="new",xe=S.form,Oe={...re?{id:xe.id}:{},cwd:xe.cwd,engine:xe.engine,boot:!!xe.boot},Fe={...xe.commands||{}},de=a.engines.find(Ce=>Ce.id===xe.engine);((H=de==null?void 0:de.managed)==null?void 0:H.client)==="shell"&&typeof xe.command=="string"&&xe.command.length?Fe[xe.engine]=xe.command:((ae=de==null?void 0:de.managed)==null?void 0:ae.client)==="shell"&&delete Fe[xe.engine],(Object.keys(Fe).length||!re)&&(Oe.commands=Fe);const ze=(xe.label||"").trim();re?ze&&(Oe.label=ze):Oe.label=ze||null,re?(((ce=de==null?void 0:de.managed)==null?void 0:ce.client)!=="shell"&&xe.model&&(Oe.model=xe.model),((me=de==null?void 0:de.managed)==null?void 0:me.client)!=="shell"&&xe.prompt&&(Oe.prompt=xe.prompt)):(Oe.model=((Te=de==null?void 0:de.managed)==null?void 0:Te.client)==="shell"?null:xe.model||null,((_e=de==null?void 0:de.managed)==null?void 0:_e.client)!=="shell"&&(Oe.prompt=xe.prompt||null));const q=re?await w0(e,Oe,ne):await Z_(e,S.original.id,Oe,ne),te=re?xe.id:S.original.id;w(null),D(p("fleet-saved")),!re&&(q!=null&&q.active)&&window.confirm(p("fleet-restart-confirm").replace("{cells}",te))&&await Fo(e,te,ne)}),Ye=t||z,Ae=re=>U.find(xe=>{var Oe;return(Oe=xe.engines)==null?void 0:Oe.includes(re.id)})||null,Ne=()=>we(async()=>{var Oe;const re=await yg(e,W.envKey,W.value,ne);R(re.credentials||[]),B(null),D(p("fleet-credential-saved"));const xe=((Oe=(re.credentials||[]).find(Fe=>Fe.envKey===W.envKey))==null?void 0:Oe.activeCells)||[];if(xe.length&&window.confirm(p("fleet-restart-confirm").replace("{cells}",xe.join(", "))))for(const Fe of xe)await Fo(e,Fe,ne)}),ut=re=>we(async()=>{if(!window.confirm(p("fleet-credential-remove-confirm").replace("{key}",re.envKey)))return;const xe=await g0(e,re.envKey,ne);R(xe.credentials||[]),D(p("fleet-credential-removed"))}),Pe=re=>Q({...re,route:Array.isArray(re==null?void 0:re.route)?re.route:ne}),Ut=async re=>{if(!X)return;const xe=X.cell||X.id,Oe=Array.isArray(X.route)?X.route:ne;if(re.action==="up"){const Fe=await Yh(e,{cell:xe,boot:!!re.boot,...re.engine?{engine:re.engine}:{},...re.model!==void 0?{model:re.model}:{},...re.permissionPolicy?{permissionPolicy:re.permissionPolicy}:{}},Oe),de=uf(Fe);de&&D(de.text)}else await Il(e,{cell:xe,boot:!!re.boot},Oe)},Rt=(re,xe)=>{E(""),I({mode:"new",route:Array.isArray(xe)?xe:ne,form:{tmuxSession:re.name,id:"",engine:"",cwd:"",boot:!1},err:""})},Dt=()=>we(async()=>{const re=O.form;if(!re.engine){I({...O,err:p("import-engine-required")});return}await b0(e,{tmuxSession:re.tmuxSession,id:re.id||void 0,engine:re.engine,cwd:re.cwd||void 0,boot:!!re.boot},re.route||ne),I(null),D(p("fleet-saved"))}),vt=({engineRows:re=[],cellRows:xe=[]})=>we(async()=>{const Oe=re.filter(me=>me.selected),Fe=Oe.map(me=>rb(me.engine));if(Fe.some(me=>!me))throw new Error(p("fleet-backup-invalid-engine"));const de=Oe.filter(me=>me.exists).map(me=>me.engine.id);if(de.length&&!window.confirm(p("fleet-backup-confirm-engine-overwrite").replace("{engines}",de.join(", "))))return;const ze=[...new Set([...a.engines.map(me=>me.id),...Fe.map(me=>me.id)])],q=[];for(const me of xe.filter(Te=>Te.selected)){const Te=V2(me.cell,me.engine,ze);if(!Te)throw new Error(`${me.cell.id}: ${p("fleet-backup-engine-missing")}`);q.push(Te)}const te=xe.filter(me=>me.selected&&me.exists).map(me=>me.cell.id);if(te.length&&!window.confirm(p("fleet-backup-confirm-overwrite").replace("{cells}",te.join(", "))))return;const H=Fe.length?await x0(e,Fe,de.length>0,ne):{needsRestart:[]},ae=q.length?await S0(e,q,ne):{needsRestart:[]},ce=[...new Set([...H.needsRestart||[],...ae.needsRestart||[]])];$(!1),D(`${p("fleet-backup-restored").replace("{n}",String(q.length))}${Fe.length?` · ${Fe.length} ${p("fleet-engines").toLowerCase()}`:""}${ce.length?` · ${p("fleet-backup-needs-restart").replace("{cells}",ce.join(", "))}`:""}`)}),ft=c.jsxs("label",{className:"nc-field",children:[p("location"),c.jsxs("select",{value:V,onChange:re=>{G(re.target.value),y(null),w(null),E(""),D(""),Z(!1),v(!1),f({available:!1,capabilities:[]}),u({engines:[],cells:[],managedCatalog:[]}),R([]),B(null)},children:[c.jsx("option",{value:"",children:p("local")}),n.map(re=>c.jsxs("option",{value:re.route.join("/"),disabled:re.status&&re.status!=="up",children:[re.label,re.status&&re.status!=="up"?` · ${p("node-offline")}`:""]},re.route.join("/")))]})]}),dt=c.jsxs("div",{className:"nc-fleet-view-tabs",role:"tablist","aria-label":p("tab-fleet"),children:[c.jsx("button",{type:"button",role:"tab","aria-selected":j==="manage",className:`nc-set-tabbtn${j==="manage"?" on":""}`,onClick:()=>M("manage"),children:p("fleet-manage-location")}),c.jsx("button",{type:"button",role:"tab","aria-selected":j==="overview",className:`nc-set-tabbtn${j==="overview"?" on":""}`,onClick:()=>M("overview"),children:p("fleet-network-overview")})]});return m?ge?c.jsxs("div",{className:"nc-set-tab nc-fleet-editor",children:[dt,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Pe,onImport:Rt})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-manage-help")}),ft,c.jsxs("div",{className:"nc-set-row nc-fleet-backup-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>{E(""),$(!0)},children:p("fleet-backup")}),c.jsx("small",{children:p("fleet-backup-help")})]}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("span",{className:"nc-fleet-head-actions",children:c.jsxs("button",{className:"nc-btn primary",disabled:Ye||x||!a.engines.length,onClick:()=>{var re;E(""),w({mode:"new",form:O_((re=a.engines[0])==null?void 0:re.id)})},children:["+ ",p("add")]})})]}),a.cells.map(re=>{const xe=fe.has(re.id),Oe=h.capabilities||[],Fe=re.needsRepair===!0;return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:re.id}),re.label?c.jsxs("small",{className:"nc-fleet-label",children:[" ",re.label]}):null,c.jsxs("small",{children:[re.engine," · ",Fe?c.jsx("span",{className:"nc-fleet-tag nc-fleet-tag-warn",children:p("fleet-cwd-needs-repair")}):re.cwd,xe?` · ${p("service-active")}`:` · ${p("cell-off")}`]})]}),c.jsxs("span",{children:[xe&&Oe.includes("down")&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>we(()=>Il(e,{cell:re.id},ne)),children:p("stop")}),!xe&&Oe.includes("up")&&c.jsx("button",{className:"nc-btn primary",disabled:Ye||x,onClick:()=>Pe({cell:re.id,id:re.id,engine:re.engine,model:re.model,models:re.models,permissionPolicies:re.permissionPolicies,active:!1,boot:re.boot}),children:p("start")}),xe&&Oe.includes("restart")&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>we(()=>Fo(e,re.id,ne)),children:p("restart")}),Fe?c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>{E(""),T(re)},children:p("fleet-cwd-repair")}):c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>{var de;E(""),w({mode:"edit",original:re,form:{...re,commands:{...re.commands||{}},command:((de=re.commands)==null?void 0:de[re.engine])||""}})},children:p("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Ye||x,onClick:()=>we(async()=>{window.confirm(p("fleet-remove-cell").replace("{id}",re.id))&&await ey(e,re.id,!0,ne)}),children:"×"})]})]},re.id)}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-engines")}),c.jsxs("button",{className:"nc-btn primary",disabled:Ye||x,onClick:()=>{E(""),y({mode:"new",form:Y2()})},children:["+ ",p("add")]})]}),a.engines.map(re=>{var Oe,Fe;const xe=Ae(re);return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:re.label}),c.jsx("small",{children:re.managed?`${re.id} · ${re.managed.client} / ${re.managed.provider} · ${(Oe=re.managedInfo)!=null&&Oe.configured?p("fleet-ready"):((Fe=re.managedInfo)==null?void 0:Fe.reason)||p("fleet-not-ready")}`:`${re.id} · ${re.command}`}),xe&&c.jsxs("small",{children:[xe.envKey," · ",p(`fleet-credential-source-${xe.source||"missing"}`)]})]}),c.jsxs("span",{children:[xe&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>{E(""),B({envKey:xe.envKey,value:""})},children:xe.configured?p("fleet-credential-change"):p("fleet-credential-set")}),(xe==null?void 0:xe.source)==="local"&&c.jsx("button",{className:"nc-btn danger",disabled:Ye||x,onClick:()=>ut(xe),children:p("fleet-credential-forget")}),c.jsx("button",{className:"nc-btn ghost",disabled:Ye||x,onClick:()=>{E(""),y({mode:"edit",original:re,form:X2(re)})},children:p("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Ye||x,onClick:()=>we(async()=>{window.confirm(p("fleet-remove-engine").replace("{id}",re.id))&&await y0(e,re.id,ne)}),children:"×"})]})]},re.id)})]}),b&&c.jsx($s,{onClose:()=>y(null),label:p("fleet-new-engine"),error:P,children:c.jsx(Z2,{state:b,setState:y,busy:x,onSave:He,catalog:a.managedCatalog||[]})}),S&&c.jsx($s,{onClose:()=>w(null),label:p("fleet-new-cell"),error:P,children:c.jsx(ej,{token:e,route:ne,targets:n,location:V,setLocation:G,state:S,setState:w,engines:a.engines,busy:x,onSave:ht})}),C&&c.jsx($s,{onClose:()=>T(null),label:p("fleet-cwd-repair-title").replace("{id}",C.id),error:"",children:c.jsx(nj,{token:e,route:ne,cell:C,busy:x,onSaved:async()=>{T(null),D(p("fleet-cwd-repaired")),await le()},onClose:()=>T(null)})}),F&&c.jsx("div",{className:"nc-set-note",children:F}),P&&c.jsx("div",{className:"nc-err",children:P}),A&&c.jsx($s,{onClose:()=>$(!1),label:p("fleet-backup"),error:P,children:c.jsx(J2,{cells:a.cells,engines:a.engines,busy:x,canRestore:pe,onRestore:vt,onClose:()=>$(!1)})}),W&&c.jsx($s,{onClose:()=>B(null),label:p("fleet-credential-title"),error:P,children:c.jsxs("div",{className:"nc-fleet-form nc-credential-form",children:[c.jsx("b",{children:p("fleet-credential-title")}),c.jsx("small",{children:p("fleet-credential-help")}),c.jsxs("label",{className:"nc-field",children:[W.envKey,c.jsx("input",{type:"password",autoComplete:"off",spellCheck:"false",autoCapitalize:"none",value:W.value,onChange:re=>B({...W,value:re.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>B(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:x||!W.value,onClick:Ne,children:p("save")})]})]})}),O&&c.jsx($s,{onClose:()=>I(null),label:p("import-as-cell"),error:P,children:c.jsx(B_,{token:e,route:O.route||ne,state:O,setState:I,busy:x,onSave:Dt})}),X&&c.jsx(Bl,{cell:X,token:e,route:Array.isArray(X.route)?X.route:ne,onConfirm:async re=>{try{await Ut(re)}finally{await le()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[dt,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Pe,onImport:Rt})]}):c.jsxs(c.Fragment,{children:[ft,c.jsxs("div",{className:"nc-set-info",children:[p(P?"fleet-editor-load-error":"fleet-editor-unavailable"),!P&&h.reason?` ${h.reason}`:""]})]}),P&&c.jsx("div",{className:"nc-err",children:P}),O&&c.jsx($s,{onClose:()=>I(null),label:p("import-as-cell"),error:P,children:c.jsx(B_,{token:e,route:O.route||ne,state:O,setState:I,busy:x,onSave:Dt})}),X&&c.jsx(Bl,{cell:X,token:e,route:Array.isArray(X.route)?X.route:ne,onConfirm:async re=>{try{await Ut(re)}finally{await le()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[dt,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Pe,onImport:Rt})]}):c.jsxs(c.Fragment,{children:[ft,c.jsx("div",{className:"nc-set-info",children:p("fleet-editor-loading")})]})]})}const Of="nc_notification_speech_v1",Nl="nc-notification-speech",Fh="nc-notification-speech-preview",sj=320,rj=2,oj=3e4,aj=1e4,lj=6e4,cj=64,z_=Object.freeze({enabled:!1}),uj=Object.freeze({it:"it-IT",en:"en-US",es:"es-ES"}),dj=Object.freeze({it:new Set(["che","con","correzione","della","delle","difetto","il","lavoro","nessun","non","per","pronto","pubblicata","pubblicato","rilascio","sono","stato","tutti","verificata","verificato","versione","completata","completato","riepilogo"]),en:new Set(["all","and","completed","fix","for","issue","no","published","ready","release","summary","the","verified","version","with","work"]),es:new Set(["con","correccion","defecto","el","esta","para","publicada","publicado","resumen","sin","todos","trabajo","verificada","verificado","version","y"])}),Bf=new WeakSet;function zf(e){return{enabled:(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).enabled===!0}}function ab(){try{return typeof localStorage<"u"?localStorage:null}catch{return null}}function F_(e=ab()){if(!e)return{...z_};try{return zf(JSON.parse(e.getItem(Of)||"null"))}catch{return{...z_}}}function hj(e,t=ab()){const n=zf(e);if(t)try{t.setItem(Of,JSON.stringify(n))}catch{}return n}function Ur(){try{return typeof window<"u"?window:null}catch{return null}}function ea(e=Ur()){try{return!!(e&&e.speechSynthesis&&typeof e.speechSynthesis.speak=="function"&&typeof e.SpeechSynthesisUtterance=="function")}catch{return!1}}function lb(e=Ur()){return!!(e&&(typeof e=="object"||typeof e=="function")&&Bf.has(e))}function $h(e=Ur()){e&&(typeof e=="object"||typeof e=="function")&&Bf.delete(e)}function Ar(e){const t=String(e||"").trim().toLowerCase().split("-")[0];return uj[t]||""}function cc(e){return String(e||"").normalize("NFC").replace(/[\p{Cc}\p{Cf}]+/gu," ").replace(/\s+/g," ").trim()}function fj(e){const t=cc(e).normalize("NFD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase(),n=new Set(t.match(new RegExp("\\p{L}+","gu"))||[]);if(n.size<4)return"";const s=Object.entries(dj).map(([o,a])=>({lang:o,score:[...n].reduce((u,h)=>u+(a.has(h)?1:0),0)})).sort((o,a)=>a.score-o.score);return s[0].score>=3&&s[0].score-s[1].score>=2?s[0].lang:""}function pj(e,t){const n=Ar(e&&e.lang);return n||Ar(fj(e&&e.body))||Ar(t)}function cb(e){try{const t=e&&e.speechSynthesis&&e.speechSynthesis.getVoices;return typeof t=="function"?Array.from(t.call(e.speechSynthesis)||[]).filter(Boolean):[]}catch{return[]}}function ub(e,t){const n=Ar(t);if(!n)return null;const s=Array.from(e||[]).filter(h=>h&&typeof h.lang=="string"&&h.lang.trim()),o=s.filter(h=>h.lang.trim().toLowerCase()===n.toLowerCase()),a=n.slice(0,2).toLowerCase(),u=s.filter(h=>h.lang.trim().toLowerCase().split("-")[0]===a);return o.find(h=>h.default===!0)||o[0]||u.find(h=>h.default===!0)||u[0]||null}function $_(e){return cc(e).replace(/\bBearer\s+\S+/gi,"Bearer [redacted]").replace(/\b(?:sk|hf|zai|xox[baprs]|gh[pousr]|npm)[_-][A-Za-z0-9._-]{8,}\b/gi,"[redacted]").replace(/\b(?:token|password|secret|credential|api[_-]?key)\s*[=:]\s*(?:"[^"]*"|'[^']*'|\S+)/gi,"[redacted]").replace(/\b[A-Z][A-Z0-9_]{2,}\s*=\s*(?:"[^"]*"|'[^']*'|\S+)/g,"[redacted]").replace(/(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|\/data\/(?:data|user\/\d+)\/[^/\s]+)(?:\/[^\s]*)?/g,"[private path]").replace(/\b[A-Za-z]:\\Users\\[^\\\s]+(?:\\[^\s]*)?/g,"[private path]")}function mj(e,t=sj){const n=$_(e&&e.title),s=$_(e&&e.body),o=[n,s&&s!==n?s:""].filter(Boolean).join(". "),a=Array.from(o);return a.length<=t?o:`${a.slice(0,Math.max(0,t-1)).join("").trimEnd()}…`}function gj(e){try{return!!(e&&e.visibilityState==="visible"&&typeof e.hasFocus=="function"&&e.hasFocus())}catch{return!1}}function db(e=Ur()){if(!ea(e))return!1;try{return e.speechSynthesis.cancel(),!0}catch{return!1}}function vj(e){try{e&&typeof e.dispatchEvent=="function"&&typeof e.Event=="function"&&e.dispatchEvent(new e.Event(Fh))}catch{}}function _j(e,t,n=Ur(),s={}){var m;if($h(n),!ea(n))return Promise.resolve(!1);const o=cc(e);if(!o||(m=s.signal)!=null&&m.aborted)return Promise.resolve(!1);const a=Number.isFinite(s.timeoutMs)&&s.timeoutMs>0?s.timeoutMs:aj,u=s.setTimer||((v,b)=>setTimeout(v,b)),h=s.clearTimer||(v=>clearTimeout(v)),f=s.signal;return vj(n),new Promise(v=>{let b=!1,y=!1,S=null,w=null;const x=k=>{if(!b){if(b=!0,f&&w&&f.removeEventListener("abort",w),S!==null&&h(S),k)Bf.add(n);else try{n.speechSynthesis.cancel()}catch{}v(k)}};w=()=>x(!1),f&&f.addEventListener("abort",w,{once:!0});try{n.speechSynthesis.cancel();const k=new n.SpeechSynthesisUtterance(o);k.lang=Ar(t);const P=ub(cb(n),k.lang);P&&(k.voice=P),k.onstart=()=>{y=!0},k.onend=()=>x(y),k.onerror=()=>x(!1),S=u(()=>x(!1),a),n.speechSynthesis.speak(k)}catch{x(!1)}})}function yj(e={}){const t=e.scope||Ur(),n=e.document||t&&t.document,s=Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:rj,o=Number.isFinite(e.watchdogMs)&&e.watchdogMs>0?e.watchdogMs:oj,a=Number.isFinite(e.dedupWindowMs)&&e.dedupWindowMs>0?e.dedupWindowMs:lj,u=Number.isInteger(e.maxDedup)&&e.maxDedup>0?e.maxDedup:cj,h=e.now||Date.now,f=e.setTimer||((O,I)=>setTimeout(O,I)),m=e.clearTimer||(O=>clearTimeout(O)),v=e.isPrimed||(()=>lb(t)),b=t&&t.speechSynthesis;let y=null,S=null,w=[],x=[],k=()=>{};const P=new Map,E=()=>{x=cb(t)};if(E(),b&&typeof b.addEventListener=="function")b.addEventListener("voiceschanged",E),k=()=>b.removeEventListener("voiceschanged",E);else if(b&&"onvoiceschanged"in b){const O=b.onvoiceschanged,I=(...C)=>{E(),typeof O=="function"&&O.apply(b,C)};b.onvoiceschanged=I,k=()=>{b.onvoiceschanged===I&&(b.onvoiceschanged=O)}}const F=O=>{if(O&&typeof O.id=="string"&&O.id)return`id:${O.id}`;const I=Number(O&&O.ts),C=cc(O&&O.title);return Number.isFinite(I)&&C?`frame:${I}:${C}`:""},D=O=>{if(!O)return!0;const I=h();for(const[C,T]of P)I-T>=a&&P.delete(C);if(P.has(O))return!1;for(P.set(O,I);P.size>u;)P.delete(P.keys().next().value);return!0},V=()=>{S!==null&&m(S),S=null},G=()=>{V(),y&&(y.onend=null,y.onerror=null,y=null),db(t)},z=O=>{if(!ea(t))return w=[],"unsupported";let I;try{I=new t.SpeechSynthesisUtterance(O.text),I.lang=Ar(O.lang);const T=ub(x,I.lang);T&&(I.voice=T)}catch{return w=[],"error"}y=I;const C=()=>{if(y!==I)return;V(),y=null,I.onend=null,I.onerror=null;const T=w.shift();T&&z(T)};I.onend=C,I.onerror=C;try{return S=f(()=>{if(y!==I)return;y=null,I.onend=null,I.onerror=null;try{t.speechSynthesis.cancel()}catch{}V();const T=w.shift();T&&z(T)},o),t.speechSynthesis.speak(I),"speaking"}catch{return C(),"error"}},Z=(O,I)=>{if(!ea(t))return"unsupported";const C=mj(O);if(!C)return"empty";if(!D(F(O)))return"duplicate";if(!gj(n))return"inactive";if(!v())return"unprimed";const T={text:C,lang:I};return O&&O.urgency==="high"?(w=[],G(),z(T)):y?s===0?"dropped":(w.length>=s&&w.shift(),w.push(T),"queued"):z(T)},X=()=>{w=[],G()};return{enqueue:Z,stop:X,dispose:()=>{X(),k(),k=()=>{}}}}function hb(){const[e,t]=N.useState(F_);N.useEffect(()=>{const s=o=>{if((o==null?void 0:o.type)==="storage"&&o.key!==Of&&o.key!==null)return;const a=(o==null?void 0:o.type)===Nl?zf(o.detail):F_();t(a)};return window.addEventListener(Nl,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Nl,s),window.removeEventListener("storage",s)}},[]);const n=N.useCallback(s=>{const o=hj({enabled:s===!0});return t(o),window.dispatchEvent(new CustomEvent(Nl,{detail:o})),o.enabled},[]);return[e.enabled,n]}function wj({text:e}){const[t,n]=N.useState(!1),s=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return c.jsxs("div",{className:"nc-set-copyline",children:[c.jsx("code",{children:e}),c.jsxs("button",{type:"button",className:"nc-btn ghost",onClick:s,children:[c.jsx(Ze,{name:"copy",size:14})," ",p(t?"copied":"copy")]})]})}function bj({value:e}){const[t,n]=N.useState("");return N.useEffect(()=>{let s=!0;return t2.toDataURL(e,{margin:1,width:220}).then(o=>{s&&n(o)}).catch(()=>{}),()=>{s=!1}},[e]),t?c.jsx("img",{src:t,width:"220",height:"220",alt:"NexusCrew pairing QR"}):null}function Sj({token:e,nodes:t,roster:n,settings:s,readonly:o,refresh:a,refreshAliases:u,vlUnavailable:h=[]}){const[f,m]=N.useState(null),[v,b]=N.useState(null),[y,S]=N.useState(null),[w,x]=N.useState({ssh:"",sshPort:"",name:""}),[k,P]=N.useState(""),[E,F]=N.useState(""),[D,V]=N.useState(""),[G,z]=N.useState(!1),[Z,X]=N.useState(null),Q=Date.now(),O=s&&s.deviceName||"",I=(t||[]).filter(j=>j&&j.direction==="outbound"&&j.name&&j.ssh),C=I.find(j=>j.name===k)||I[0]||null,T=I.find(j=>j.name===E)||I[0]||null,A=T?Yd(T.tunnel,Q):null,$=T!=null&&T.shared?A!=null&&A.up?"share-local-active":"share-local-pending":A!=null&&A.up?"share-local-private":"share-local-private-down",U=[{key:"peer-group-hubs",rows:(t||[]).filter(j=>j.kind!=="transitive"&&j.kind!=="vl"&&j.relation!=="client")},{key:"peer-group-clients",rows:(t||[]).filter(j=>j.kind!=="transitive"&&j.kind!=="vl"&&j.relation==="client")},{key:"peer-group-routed",rows:(t||[]).filter(j=>j.kind==="transitive")},{key:"peer-group-vl",rows:(t||[]).filter(j=>j.kind==="vl")}],R=Z&&(t||[]).find(j=>`${j.kind||"direct"}:${j.nodeId||j.name}`===Z)||null,W=async j=>{if(T){m(null),b(`${T.name}:share`);try{const M=await T0(e,T.name,j);await a(),M&&M.reversePoolPending===!0&&m(`${T.name}: ${p("share-reverse-pool-pending")}`)}catch(M){const K=M!=null&&M.data&&M.data.shared===!1?M.data:null;if(K)try{await a()}catch{}const ne=M!=null&&M.data&&typeof M.data.hint=="string"?M.data.hint:"",le=(K==null?void 0:K.revoked)===!0&&(K==null?void 0:K.localReconcilePending)===!0?p("share-off-local-reconcile-pending"):(K==null?void 0:K.revoked)===!1&&(K==null?void 0:K.reconcilePending)===!0?p("share-off-hub-reconcile-pending"):"",fe=M!=null&&M.data&&M.data.reversePoolPending===!0?p("share-reverse-pool-pending"):"",ge=M!=null&&M.data&&typeof M.data.code=="string"?M.data.code:"",pe=M!=null&&M.data&&typeof M.data.detail=="string"?M.data.detail.trim():"",we=pe&&pe!==String(M.message||"")?pe:"";m(`${T.name}: ${String(M.message||M)}${ge?` [${ge}]`:""}${we?` — ${we}`:""}${ne?` — ${ne}`:""}${le?` — ${le}`:""}${fe?` — ${fe}`:""}`)}b(null)}},B=async()=>{if(m(null),C){const K=Og({name:C.name,ssh:C.ssh,sshPort:C.sshPort||""});if(!K.ok){m(p(K.error));return}b("invite");try{S(await Sg(e,{ssh:K.value.ssh,...K.value.sshPort?{sshPort:K.value.sshPort}:{}},[C.name]))}catch(ne){m(ne&&ne.status===404?p("invite-hub-only"):String(ne.message||ne))}b(null);return}const j=vs(w.name||D||O||"NexusCrew"),M=Og({name:j,ssh:w.ssh,sshPort:w.sshPort});if(!M.ok){m(p(M.error));return}b("invite");try{S(await Sg(e,{...D||O?{label:D||O}:{},name:j,ssh:M.value.ssh,...M.value.sshPort?{sshPort:M.value.sshPort}:{}}))}catch(K){m(String(K.message||K))}b(null)};return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-sheet-label",children:p("peer-inventory-title")}),(t||[]).length===0&&c.jsx("div",{className:"nc-empty",children:p("no-nodes")}),U.map(j=>j.rows.length>0&&c.jsxs("div",{className:"nc-peer-group",children:[c.jsxs("div",{className:"nc-peer-group-title",children:[p(j.key)," ",c.jsx("span",{children:j.rows.length})]}),j.rows.map(M=>{const K=f2(M);if(!K)return null;const ne=`${M.kind||"direct"}:${M.nodeId||M.name}`,le=K.routed?{up:K.reach.up,since:null}:Yd(M.tunnel,Q);return c.jsxs("button",{type:"button",className:`nc-set-node nc-node-row${K.routed?" routed":""}`,"aria-label":`${K.title} — ${p("node-detail-open")}`,onClick:()=>X(ne),children:[c.jsx("span",{className:`nc-dot ${K.reach.up?"on":""}`}),c.jsxs("span",{className:"nc-node-row-text",children:[c.jsx("b",{children:K.title}),c.jsxs("small",{children:[K.routed?K.routeLabel:`${K.subtitle} · ${p(K.exposure.shortKey)}`,!K.routed&&K.exposure.shortKey==="visibility-selected"?` (${K.exposure.count})`:""]})]}),c.jsxs("span",{className:`nc-set-tunnel${K.reach.up?" up":""}`,children:[p(K.reach.key),le.since?` · ${le.since}`:""]}),c.jsx("span",{className:"nc-node-row-more",children:c.jsx(Ze,{name:"chevronDown",size:14})})]},ne)})]},j.key)),h.length>0&&c.jsxs("div",{className:"nc-err",children:[p("vl-owners-unavailable"),": ",h.map(j=>j.label||j.route.join("/")).join(", ")]}),R&&c.jsx(E2,{node:R,nodes:t||[],token:e,readonly:o,refresh:a,onClose:()=>X(null)}),(n||[]).some(j=>!j.direct&&j.instanceId)&&c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("routed-node-aliases")}),c.jsx("small",{className:"nc-set-hint",children:p("routed-node-aliases-help")}),(n||[]).filter(j=>!j.direct&&j.instanceId).map(j=>c.jsxs("div",{className:"nc-set-node",children:[c.jsxs("div",{className:"nc-set-node-head",children:[c.jsx("span",{className:`nc-dot ${j.status==="up"?"on":""}`}),c.jsx("b",{children:j.label||j.name}),c.jsx("small",{children:(j.route||[]).join(" › ")})]}),c.jsxs("div",{className:"nc-set-node-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{const M=window.prompt(p("node-local-alias"),j.alias||"");if(M!=null){if(M.trim()&&!Mr(M.normalize("NFC"))){m(p("err-label"));return}b(`${j.instanceId}:alias`),m(null);try{M.trim()?await P0(e,j.instanceId,M):await xg(e,j.instanceId),u()}catch(K){m(String(K.message||K))}b(null)}},children:p("alias-on-device")}),j.alias&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{b(`${j.instanceId}:alias-reset`),m(null);try{await xg(e,j.instanceId),u()}catch(M){m(String(M.message||M))}b(null)},children:p("reset-alias")})]})]},j.instanceId))]}),T&&c.jsxs("div",{className:"nc-set-form nc-local-share",children:[c.jsx("div",{className:"nc-sheet-label",children:p("share-local-heading")}),I.length>1&&c.jsxs("label",{className:"nc-field",children:[p("share-local-hub"),c.jsx("select",{value:T.name,disabled:o||!!v,onChange:j=>F(j.target.value),children:I.map(j=>c.jsx("option",{value:j.name,children:j.label||j.name},j.name))})]}),c.jsxs("label",{className:"nc-check nc-node-share",children:[c.jsx("input",{type:"checkbox",checked:T.shared===!0,disabled:o||!!v,onChange:j=>W(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("share-local-through").replace("{device}",O||p("local")).replace("{hub}",T.label||T.name)}),c.jsx("small",{children:p(T.shared?"share-node-on-desc":"share-node-off-desc")})]})]}),c.jsx("div",{className:`nc-set-test${T.shared&&(A!=null&&A.up)?" ok":A!=null&&A.up?"":" ko"}`,children:p($)}),!(A!=null&&A.up)&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:()=>W(T.shared===!0),children:p("share-local-reconnect")})]}),c.jsx(Xw,{token:e,deviceDefault:O,localNodeId:s&&s.nodeId||"",localNameDefault:s&&s.localName||"",readonly:o,onSuccess:a}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("invite-node")}),c.jsx("small",{className:"nc-set-hint",children:p(C?"invite-network-hint":"invite-v2-hint")}),C?c.jsxs(c.Fragment,{children:[I.length>1&&c.jsxs("label",{className:"nc-field",children:[p("invite-network-label"),c.jsx("select",{value:C.name,disabled:o||!!v,onChange:j=>{P(j.target.value),S(null)},children:I.map(j=>c.jsx("option",{value:j.name,children:j.label||j.name},j.name))})]}),c.jsxs("div",{className:"nc-set-info nc-invite-endpoint",children:[p("invite-network-via"),": ",c.jsx("b",{children:C.label||C.name})," · ",C.ssh,C.sshPort?`:${C.sshPort}`:""]}),c.jsx("small",{className:"nc-set-hint",children:p("invite-network-route")})]}):c.jsxs("label",{className:"nc-field",children:[p("invite-endpoint-label"),c.jsx("input",{placeholder:"user@host",value:w.ssh,disabled:o,onChange:j=>x({...w,ssh:j.target.value})}),c.jsx("small",{className:"nc-set-hint",children:p("invite-endpoint-needed")})]}),!C&&G&&c.jsxs("div",{className:"nc-invite-advanced",children:[c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",placeholder:"22",value:w.sshPort,disabled:o,onChange:j=>x({...w,sshPort:j.target.value.replace(/[^0-9]/g,"").slice(0,5)})})]}),c.jsxs("label",{className:"nc-field",children:[p("device-name-label"),c.jsx("input",{placeholder:O||"NexusCrew",value:D,disabled:o,onChange:j=>V(j.target.value)}),c.jsx("small",{className:"nc-set-hint",children:p("device-name-hint")})]}),c.jsxs("label",{className:"nc-field",children:[p("node-name-label"),c.jsx("input",{placeholder:vs(D||O||p("node-name-ph")),value:w.name,disabled:o,onChange:j=>x({...w,name:j.target.value?vs(j.target.value):""})})]})]}),c.jsxs("div",{className:"nc-set-row nc-invite-actions",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:o||!!v||!C&&!w.ssh.trim(),onClick:B,children:p("create-pairing-link")}),!C&&c.jsxs("button",{type:"button",className:"nc-btn ghost",disabled:!!v,onClick:()=>z(j=>!j),children:[G?"▾":"▸"," ",p("pair-advanced")]})]}),y&&c.jsxs(c.Fragment,{children:[c.jsx(bj,{value:y.pairingUrl}),c.jsx(wj,{text:y.pairingUrl}),c.jsx("div",{className:"nc-set-info",children:p("invite-next-steps")})]})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function xj({token:e,readonly:t}){const[n,s]=N.useState("idle"),[o,a]=N.useState(!1),[u,h]=N.useState(null);N.useEffect(()=>{let m=!1;return j2().then(v=>{m||s(v)}),()=>{m=!0}},[]);const f=async()=>{h(null),a(!0);try{n==="subscribed"?(await P2(e),s("idle")):(await R2(e),s("subscribed"))}catch(m){const v=String(m.message||m);v==="push-denied"?(s("denied"),h(p("push-denied"))):v==="push-unsupported"?(s("unsupported"),h(p("push-unsupported"))):h(v)}a(!1)};return n==="unsupported"?c.jsx("div",{className:"nc-set-info",children:p("push-unsupported")}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||o||n==="denied",title:t?p("settings-readonly"):"",onClick:f,children:p(n==="subscribed"?"push-disable":"push-enable")}),c.jsx("span",{className:"nc-set-info",children:p(n==="subscribed"?"push-on":n==="denied"?"push-denied":"push-off")})]}),u&&c.jsx("div",{className:"nc-err",children:u})]})}function kj(){const[e,t]=hb(),[n,s]=N.useState(""),[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(lb),v=N.useRef(0),b=N.useRef(!1),y=N.useRef(null),S=ea();N.useEffect(()=>()=>{var k;v.current+=1,b.current&&((k=y.current)==null||k.abort(),y.current=null,b.current=!1,$h())},[]);const w=async()=>{const k=v.current+=1,P=typeof AbortController=="function"?new AbortController:null;s(""),a(""),h(!0),m(!1),b.current=!0,y.current=P;const E=await _j(p("notification-speech-preview"),Ol(),void 0,P?{signal:P.signal}:{});return k!==v.current||(y.current=null,b.current=!1,h(!1),m(E),E?a(p("notification-speech-preview-ok")):s(p("notification-speech-preview-failed"))),E},x=k=>{var P;if(t(k),s(""),a(""),k)w();else{v.current+=1;const E=b.current;(P=y.current)==null||P.abort(),y.current=null,b.current=!1,h(!1),m(!1),$h(),E||db()}};return c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("notification-speech-enable"),checked:e,disabled:!S,onChange:k=>x(k.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("notification-speech-enable")}),c.jsx("small",{children:p("notification-speech-help")})]})]}),S?c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!e||u,onClick:()=>{w()},children:p(u?"notification-speech-testing":"notification-speech-test")})}):c.jsx("div",{className:"nc-set-info",children:p("notification-speech-unsupported")}),e&&!f&&!u&&!n&&c.jsx("div",{className:"nc-set-info",children:p("notification-speech-needs-test")}),o&&c.jsx("div",{className:"nc-set-info",role:"status",children:o}),n&&c.jsx("div",{className:"nc-err",children:n})]})}function Cj({token:e,readonly:t,nodes:n=[],settings:s=null}){const[o,a]=N.useState(null),[u,h]=N.useState([]),[f,m]=N.useState({name:"",mode:"primary-failover",targets:[]}),[v,b]=N.useState(null),[y,S]=N.useState(!1),[w,x]=N.useState(null),[k,P]=N.useState(""),E=N.useCallback(async()=>{try{const[U,R]=await Promise.all([M0(e),z0(e)]);a(U),h(Array.isArray(R==null?void 0:R.groups)?R.groups:[]),P("")}catch(U){P(String(U.message||U))}},[e]);N.useEffect(()=>{E()},[E]);const F=async U=>{S(!0),x(null),P("");try{a(await I0(e,U))}catch(R){P(String(R.message||R))}S(!1)},D=async()=>{S(!0),x(null),P("");try{x({kind:"test",...await O0(e)})}catch(U){P(String(U.message||U))}S(!1)},V=async()=>{S(!0),x(null),P("");try{x({kind:"stop",...await B0(e)})}catch(U){P(String(U.message||U))}S(!1)},G=[],z=new Set,Z=(U,R)=>{const W=typeof U=="string"?U.toLowerCase():"";!/^[a-f0-9]{32}$/.test(W)||z.has(W)||(z.add(W),G.push({id:W,label:R||W}))};Z(s==null?void 0:s.nodeId,p("audio-group-local"));for(const U of n||[])Z((U==null?void 0:U.nodeId)||(U==null?void 0:U.instanceId),(U==null?void 0:U.label)||(U==null?void 0:U.name)||(U==null?void 0:U.nodeId));for(const U of f.targets)Z(U,`${U} (${p("audio-group-unavailable-target")})`);const X=(U=null)=>{P(""),U?(b(U.name),m({name:U.name,mode:U.mode,targets:[...U.targets||[]]})):(b(null),m({name:"",mode:"primary-failover",targets:[]}))},Q=(U,R)=>m(W=>({...W,targets:R?[...new Set([...W.targets,U])]:W.targets.filter(B=>B!==U)})),O=async()=>{const U=f.name.trim().toLowerCase();if(!/^[a-z0-9][a-z0-9-]{0,31}$/.test(U)||f.targets.length<1){P(p("audio-group-invalid"));return}S(!0),P("");try{const R=await F0(e,U,{targets:f.targets,mode:f.mode}),W=R==null?void 0:R.group;if(!W||!W.name)throw new Error(p("audio-group-save-failed"));h(B=>[...B.filter(j=>j.name!==W.name),W].sort((j,M)=>j.name.localeCompare(M.name))),X(null)}catch(R){P(String(R.message||R))}S(!1)},I=async U=>{S(!0),P("");try{await $0(e,U),h(R=>R.filter(W=>W.name!==U)),v===U&&X(null)}catch(R){P(String(R.message||R))}S(!1)},C=(o==null?void 0:o.installed)===!0,T=(o==null?void 0:o.liveness)==="ready",A=(o==null?void 0:o.consent)===!0&&C&&T,$=w?w.kind==="stop"?p(w.stopped?"audio-stop-stopped":"audio-stop-idle"):w.status==="accepted"||w.status==="spoken"?p("audio-test-accepted"):w.status==="unknown"?p("audio-test-unknown"):`${p("audio-test-refused")}${w.reason?` (${w.reason})`:""}`:"";return c.jsxs("div",{className:"nc-set-tab nc-audio-settings",children:[c.jsxs("div",{className:"nc-set-info",children:[c.jsx("b",{children:p("audio-title")}),c.jsx("br",{}),p("audio-help")]}),o?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("audio-consent"),checked:o.consent===!0,disabled:t||y,onChange:U=>{F(U.target.checked)}}),c.jsxs("span",{children:[c.jsx("b",{children:p("audio-consent")}),c.jsx("small",{children:p("audio-consent-help")})]})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("audio-capability")}),c.jsxs("div",{className:"nc-set-info",children:[p("audio-adapter"),": ",o.adapter||p("audio-adapter-none"),c.jsx("br",{}),p("audio-installed"),": ",p(C?"audio-installed-yes":"audio-installed-no"),c.jsx("br",{}),p("audio-liveness"),": ",p(T?"audio-liveness-ready":"audio-liveness-unavailable"),Array.isArray(o.languages)&&o.languages.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),p("audio-languages"),": ",o.languages.join(", ")]})]}),o.limits&&c.jsxs("small",{className:"nc-set-hint",children:[p("audio-limits"),": ",o.limits]})]}),!o.consent&&c.jsx("div",{className:"nc-set-info",children:p("audio-test-needs-consent")}),!C&&c.jsx("div",{className:"nc-set-info",children:p("audio-unavailable")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y||!A,title:t?p("settings-readonly"):"",onClick:()=>{D()},children:p(y?"audio-testing":"audio-test")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{V()},children:p(y?"audio-stopping":"audio-stop")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{E()},children:p("refresh")})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("audio-groups-title")}),c.jsx("small",{className:"nc-set-hint",children:p("audio-groups-help")}),u.length===0&&c.jsx("div",{className:"nc-set-info",children:p("audio-groups-empty")}),u.map(U=>{var R;return c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("span",{children:[c.jsx("b",{children:U.name})," ",c.jsxs("small",{children:["· ",U.mode==="fanout"?p("audio-group-fanout"):p("audio-group-primary")," · ",((R=U.targets)==null?void 0:R.length)||0]})]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>X(U),children:p("audio-group-edit")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>{I(U.name)},children:p("audio-group-delete")})]},U.name)}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>X(null),children:p("audio-group-new")})}),c.jsxs("label",{className:"nc-field",children:[p("audio-group-name"),c.jsx("input",{"aria-label":p("audio-group-name"),value:f.name,maxLength:"32",disabled:t||y,onChange:U=>m(R=>({...R,name:U.target.value}))})]}),c.jsxs("label",{className:"nc-field",children:[p("audio-group-mode"),c.jsxs("select",{"aria-label":p("audio-group-mode"),value:f.mode,disabled:t||y,onChange:U=>m(R=>({...R,mode:U.target.value})),children:[c.jsx("option",{value:"primary-failover",children:p("audio-group-primary")}),c.jsx("option",{value:"fanout",children:p("audio-group-fanout")})]})]}),c.jsx("div",{className:"nc-set-info",children:p("audio-group-targets")}),G.length===0?c.jsx("small",{className:"nc-set-hint",children:p("audio-group-no-targets")}):G.map(U=>c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:f.targets.includes(U.id),disabled:t||y,onChange:R=>Q(U.id,R.target.checked)}),c.jsxs("span",{children:[U.label,c.jsx("small",{children:U.id})]})]},U.id)),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y,onClick:()=>{O()},children:p("audio-group-save")}),v&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>X(null),children:p("audio-group-cancel")})]})]})]}):c.jsx("div",{className:"nc-set-info",children:p("audio-loading")}),$&&c.jsx("div",{className:"nc-set-note",role:"status",children:$}),k&&c.jsx("div",{className:"nc-err",children:k})]})}function Ej(){const[e,t]=kf();return c.jsxs("div",{className:"nc-set-tab nc-input-settings",children:[c.jsx("div",{className:"nc-set-info",children:p("input-settings-local")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-field",children:[p("terminal-keyboard-gesture"),c.jsx("select",{"aria-label":p("terminal-keyboard-gesture"),value:e.terminalKeyboardGesture,onChange:n=>t({terminalKeyboardGesture:n.target.value}),children:jw.map(n=>c.jsx("option",{value:n,children:p(`terminal-keyboard-${n}`)},n))}),c.jsx("small",{children:p("terminal-keyboard-gesture-help")})]}),c.jsxs("label",{className:"nc-field",children:[p("keybar-layout"),c.jsx("select",{"aria-label":p("keybar-layout"),value:e.keybarLayout,onChange:n=>t({keybarLayout:n.target.value}),children:Rw.map(n=>c.jsx("option",{value:n,children:p(`keybar-layout-${n}`)},n))}),c.jsx("small",{children:p("keybar-layout-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.keybarKeepsKeyboardClosed,onChange:n=>t({keybarKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("keybar-ime-lock")}),c.jsx("small",{children:p("keybar-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.voiceKeepsKeyboardClosed,onChange:n=>t({voiceKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("voice-ime-lock")}),c.jsx("small",{children:p("voice-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.showKeybarEnter,onChange:n=>t({showKeybarEnter:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("keybar-enter-show")}),c.jsx("small",{children:p("keybar-enter-show-help")})]})]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>t(ps),children:p("input-settings-reset")})})]})}function Nj({token:e,roster:t=[],readonly:n}){const s=[{key:"local",route:[],label:p("diagnostics-local"),status:"up"},...t.filter(A=>Array.isArray(A.route)&&A.route.length).map(A=>({key:A.route.join("/"),route:A.route,label:A.label||A.name,status:A.status}))],[o,a]=N.useState("local"),u=s.find(A=>A.key===o)||s[0],[h,f]=N.useState(null),[m,v]=N.useState([]),[b,y]=N.useState(""),[S,w]=N.useState(!1),[x,k]=N.useState(!0),[P,E]=N.useState(900),[F,D]=N.useState("all"),[V,G]=N.useState(""),z=N.useRef(0),Z=N.useRef(null),X=N.useCallback(async()=>{try{const A=await K0(e,u.route);if(f(A),y(""),!S){const $=await q0(e,{after:z.current,limit:200},u.route);Array.isArray($.records)&&$.records.length&&(z.current=$.cursor,v(U=>[...U,...$.records].slice(-500)))}}catch(A){y(A&&A.status===404?p("diagnostics-unsupported"):String(A.message||A))}},[e,u.key,S]);N.useEffect(()=>{z.current=0,v([]),f(null),y("")},[u.key]),N.useEffect(()=>{let A=null,$=!0;const U=()=>{!$||document.visibilityState==="hidden"||X()},R=()=>{A&&clearInterval(A),A=document.visibilityState==="hidden"?null:setInterval(U,2e3),document.visibilityState!=="hidden"&&U()};return document.addEventListener("visibilitychange",R),R(),()=>{$=!1,A&&clearInterval(A),document.removeEventListener("visibilitychange",R)}},[X]),N.useEffect(()=>{x&&Z.current&&(Z.current.scrollTop=Z.current.scrollHeight)},[m,x]);const Q=m.filter(A=>(F==="all"||A.level===F)&&(!V||String(A.component||"").toLowerCase().includes(V.toLowerCase()))),O=Q.map(A=>`${A.ts} ${A.level.toUpperCase()} ${A.component} ${A.code} ${A.message}${Object.keys(A.meta||{}).length?` ${JSON.stringify(A.meta)}`:""}`).join(`
|
|
92
92
|
`),I=async A=>{y("");try{const $=await A();f($),await X()}catch($){y(String($.message||$))}},C=async()=>{try{await navigator.clipboard.writeText(O)}catch{y(p("copy-manual"))}},T=()=>{try{const A=new Blob([`${JSON.stringify(Q,null,2)}
|
|
93
|
-
`],{type:"application/json"}),$=URL.createObjectURL(A),U=document.createElement("a");U.href=$,U.download="nexuscrew-diagnostics.json",U.click(),URL.revokeObjectURL($)}catch{y(p("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[p("diagnostics-target"),c.jsx("select",{value:u.key,onChange:A=>a(A.target.value),children:s.map(A=>c.jsxs("option",{value:A.key,children:[A.label,A.status!=="up"?` · ${A.status}`:""]},A.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:p("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":p("diagnostics-duration"),value:P,onChange:A=>E(Number(A.target.value)),disabled:n,children:[300,900,1800,3600].map(A=>c.jsxs("option",{value:A,children:[A/60," min"]},A))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>kg(e,!0,P,u.route)),children:p("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>kg(e,!1,P,u.route)),children:p("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?p("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):p("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":p("diagnostics-level"),value:F,onChange:A=>D(A.target.value),children:[c.jsx("option",{value:"all",children:p("diagnostics-all-levels")}),["debug","info","warn","error"].map(A=>c.jsx("option",{value:A,children:A},A))]}),c.jsx("input",{"aria-label":p("diagnostics-component"),placeholder:p("diagnostics-component"),value:V,onChange:A=>G(A.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:S,onChange:A=>w(A.target.checked)})," ",p("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:x,onChange:A=>k(A.target.checked)})," ",p("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":p("diagnostics-log"),children:O||p("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:C,children:p("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:p("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(p("diagnostics-clear-confirm"))&&I(async()=>{const A=await V0(e,u.route);return z.current=0,v([]),A})},children:p("diagnostics-clear")})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})}function jj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState(null),[P,E]=N.useState(!0),[F,D]=N.useState(!1);N.useEffect(()=>{k(t&&t.update||null),E(!t||t.autoUpdate!==!1),D(!!(t&&t.alternateScreen))},[t]);const V=async()=>{f(null),v(null),w(!0);try{const C=await N0(e);v(C.note||"ok"),y(!1)}catch(C){f(String(C.message||C))}w(!1)},G=async()=>{f(null),v(null),w(!0);try{const C=await H0(e);v(`${C.note||"ok"}${C.target?` (${C.target})`:""}`)}catch(C){f(String(C.message||C))}w(!1)},z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{autoUpdate:C}),E(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},Z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{alternateScreen:C}),D(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},X=async()=>{f(null),v(null),w(!0);try{k(await U0(e))}catch(C){f(String(C.message||C))}w(!1)},Q=async()=>{f(null),v(null),w(!0);try{const C=await W0(e);k(C),v(p("npm-update-restarting"))}catch(C){f(String(C.message||C))}w(!1)},O=()=>{window.confirm(p("composer-clear-confirm"))&&(f(null),WE()?(window.dispatchEvent(new Event(Dh)),v(p("composer-clear-done"))):f(p("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":p("tab-system"),children:["general","diagnostics"].map(C=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===C,className:`nc-set-tabbtn${a===C?" on":""}`,onClick:()=>u(C),children:p(`system-${C}`)},C))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?p("service-installed"):p("service-missing"),I&&I.installed?` · ${I.active?p("service-active"):p("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:G,children:p("service-regenerate")})}),c.jsx(xj,{token:e,readonly:n}),c.jsx(kj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:n||S||x&&!x.supported,onChange:C=>z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("npm-auto-update")}),c.jsx("small",{children:p("npm-auto-update-help")})]})]}),x&&c.jsxs("div",{className:"nc-set-info",children:[p("npm-update-current")," v",x.current,x.latest?` · ${p("npm-update-latest")} v${x.latest}`:""," · ",p(`npm-update-${x.supported?x.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S||!x||!x.supported,onClick:X,children:p("npm-update-check")}),x&&x.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||S||x.phase==="installing",onClick:Q,children:p("npm-update-install")})]}),x&&x.lastError&&c.jsx("div",{className:"nc-err",children:x.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:()=>{f(null),v(null),y(!0)},children:p("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:p("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:O,children:p("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:p("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:p("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("alternate-screen"),checked:F,disabled:n||S,onChange:C=>Z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("alternate-screen")}),c.jsx("small",{children:p("alternate-screen-help")})]})]})]}),c.jsx(Nj,{token:e,roster:o,readonly:n})]}),b&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:p("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:S,onClick:()=>y(!1),children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:S,onClick:V,children:p("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function Rj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),f=N.useRef(null),m=N.useRef(null),[v,b]=N.useState({start:!1,end:!1}),[y,S]=N.useState(a),[w,x]=N.useState(null),[k,P]=N.useState([]),[E,F]=N.useState([]),[D,V]=N.useState(!1),[G,z]=N.useState(null),[Z,X]=N.useState(0),Q=nf(e,!0,Z),O=N.useCallback(()=>{const C=f.current;if(!C)return;const T=C.scrollWidth>C.clientWidth+1,A={start:T&&C.scrollLeft>1,end:T&&C.scrollLeft+C.clientWidth<C.scrollWidth-1};b($=>$.start===A.start&&$.end===A.end?$:A)},[]);N.useEffect(()=>{const C=f.current;if(!C)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(O):null;return T==null||T.observe(C),window.addEventListener("resize",O),O(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",O)}},[O]),N.useEffect(()=>{var T,A;(A=(T=m.current)==null?void 0:T.scrollIntoView)==null||A.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const C=window.requestAnimationFrame?window.requestAnimationFrame(O):setTimeout(O,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(C):clearTimeout(C)}},[u,O]);const I=N.useCallback(async()=>{var C;try{const T=await ny(e);x(T),z(null)}catch(T){z(String(T.message||T))}try{const A=(await C0(e)).peers||[];let $=[],U=[];try{const[R,W]=await Promise.all([Ht("/api/config",e).then(K=>K.json()).catch(()=>null),sy(e).catch(()=>null)]),B=R&&typeof R.instanceId=="string"?R.instanceId:"",j=[{instanceId:B||null,route:[],label:null},...fy(W,B)],M=await Promise.all(j.map(async K=>{try{return{ok:!0,peers:((await iy(e,K.route)).nodes||[]).map(fe=>hy(fe,K)).filter(Boolean)}}catch(ne){return{ok:!1,owner:K,error:ne}}}));for(const K of M){if(K.ok){$.push(...K.peers);continue}K.owner.route.length!==0&&U.push({instanceId:K.owner.instanceId,label:K.owner.label,route:K.owner.route,failure:/timeout/i.test(String(((C=K.error)==null?void 0:C.message)||K.error))?"timeout":"unreachable"})}}catch{}F(U),P([...A,...$])}catch(T){z(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const C=setInterval(I,5e3);return()=>clearInterval(C)},[I]),N.useEffect(()=>{let C=!1;return Ht("/api/config",e).then(T=>T.json()).then(T=>{C||V(!!T.readonlyDefault)}).catch(()=>{}),()=>{C=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:C=>C.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Ze,{name:"gear",size:18}),c.jsx("b",{children:p("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:p("close"),children:c.jsx(Ze,{name:"x",size:18})})]}),D&&c.jsx("div",{className:"nc-set-readonly",children:p("settings-readonly")}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:f,onScroll:O,children:["nodes","fleet","audio","input","system"].map(C=>c.jsx("button",{ref:u===C?m:null,type:"button",className:`nc-set-tabbtn${u===C?" on":""}`,onClick:()=>h(C),children:p(`tab-${C}`)},C))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(Sj,{token:e,nodes:k,roster:Q,settings:w,readonly:D,vlUnavailable:E,refresh:I,refreshAliases:()=>X(C=>C+1)}),u==="fleet"&&c.jsx(ij,{token:e,readonly:D,startNewCell:o,initialLocation:s,targets:Q.map(C=>({route:C.route,label:C.label||C.name,status:C.status}))}),u==="audio"&&c.jsx(Cj,{token:e,readonly:D,nodes:k,settings:w}),u==="input"&&c.jsx(Ej,{}),u==="system"&&c.jsx(jj,{token:e,settings:w,readonly:D,refresh:I,roster:Q,section:y,setSection:S})]})]})})}function Pj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,f]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[b,y]=N.useState(null),S=async()=>{v(!0),y(null);try{await Ud(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:p("wizard-title")}),c.jsx("small",{children:p("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:S,children:p("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>f("pair"),children:p("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(Xw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),f("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),f("welcome")},children:p("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:S,children:p("finish")})})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})})}function Lj(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Aj=6e3,Tj=12e3;function Dj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:p("close"),children:c.jsx(Ze,{name:"x",size:14})})]})}function Mj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(null),[v,b]=N.useState(!1),y=async w=>{const x=String(w||"").trim();if(!(!x||u)){m(null),h(!0);try{await G0(t,e.id,x),n(e.id)}catch(k){m(String(k.message||k))}h(!1)}},S=async()=>{if(!v){b(!0);try{await X0(t,e.id),s(e.id)}catch{b(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:p("ask-dismiss"),"aria-label":p("ask-dismiss"),disabled:v,onClick:S,children:c.jsx(Ze,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:p("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:p("send")})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Ij({token:e}){const[t]=kn(),[n]=hb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,f]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=yj());const b=N.useRef({enabled:n,lang:t});b.current={enabled:n,lang:t};const y=N.useCallback(k=>{o(P=>P.filter(E=>E.key!==k))},[]),S=N.useCallback(k=>{const P=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...k,key:P}]),setTimeout(()=>y(P),k.urgency==="high"?Tj:Aj);const E=b.current;if(E.enabled)try{v.current.enqueue(k,pj(k,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const k=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},P=()=>v.current.stop();return document.addEventListener("visibilitychange",k),window.addEventListener("blur",k),window.addEventListener(Fh,P),()=>{document.removeEventListener("visibilitychange",k),window.removeEventListener("blur",k),window.removeEventListener(Fh,P),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let k=!1;Y0(e).then(E=>{k||u(E.asks||[])}).catch(()=>{});const P=Lj(e,E=>{E.type==="notify"?S(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(D=>D.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(D=>D.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(D=>D.id!==E.id))});return()=>{k=!0,P()}},[e,S]);const w=k=>u(P=>P.filter(E=>E.id!==k)),x=k=>u(P=>P.filter(E=>E.id!==k));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(k=>c.jsx(Dj,{n:k,onClose:()=>y(k.key)},k.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>f(!0),title:p("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:p("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>f(!1),title:p("close"),children:c.jsx(Ze,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(k=>c.jsx(Mj,{ask:k,token:e,onAnswered:w,onDismiss:x},k.id))})]})]})}const Oj=4e3;async function Bj(e){const t=await Ht("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function Fd(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):Bj(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function fb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function zj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],f="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const b=m.get(v.tmuxSession)||{},y=of(v,b),S=fb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:f,live:S,selectable:S,verified:u===!0,working:y.working,degraded:!!v.degraded,activity:b.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[])s(o.cells,o.sessions,o.switcherFresh===!0,Array.isArray(o.route)?o.route:[],o.label||o.name||"");return n}function Fj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(!h.length)continue;const f=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(f.map(b=>b.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:f,sessions:m,unmanaged:m.filter(b=>!v.has(b.name))}).rawItems)}return t}function $j(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),f=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const b=h.get(v.key);return{...v,label:(b==null?void 0:b.label)||v.label,live:(b==null?void 0:b.live)??v.live,fresh:(b==null?void 0:b.fresh)===!0,activity:(b==null?void 0:b.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>f.get(v.key))})}function Hj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Bg),[u,h]=N.useState(!1),[f,m]=N.useState(!1),[v,b]=N.useState(""),[y,S]=N.useState(""),[w,x]=N.useState(""),k=N.useRef(null),P=N.useRef(null),E=N.useMemo(()=>zj(o),[o]),F=N.useMemo(()=>Fj(o),[o]),{pins:D,orders:V,canMoveRoster:G,moveRoster:z,stepRoster:Z}=rf(),X=N.useMemo(()=>$j(E,F,D,V),[E,F,D,V]),Q=N.useMemo(()=>u?X:X.filter(A=>A.selectable||A.degraded),[X,u]),O=N.useMemo(()=>E.find(A=>A.key===y&&A.selectable),[E,y]);N.useEffect(()=>{var U;const A=document.activeElement;(U=P.current)==null||U.focus();const $=R=>{R.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var R;document.removeEventListener("keydown",$),(R=A==null?void 0:A.focus)==null||R.call(A)}},[s]),N.useEffect(()=>{let A=!0,$=!1;const U=async()=>{if($)return;$=!0;const W=Bg(),B=Array.isArray(W.nodeGroups)?W.nodeGroups:[],j=Fd(e),M=await Promise.all(B.map(async ge=>{const pe=Array.isArray(ge.route)?ge.route:[];return pe.length?{group:ge,result:await Fd(e,pe)}:{group:ge,result:{fresh:!1,sessions:null,cells:null}}})),K=await j;if(!A)return;const ne=new Map(M.map(({group:ge,result:pe})=>[JSON.stringify(ge.route||[]),pe])),le=B.map(ge=>{const pe=ne.get(JSON.stringify(ge.route||[]));return pe?{...ge,sessions:pe.sessions||ge.sessions||[],cells:pe.cells||ge.cells||[],switcherFresh:pe.fresh}:{...ge,switcherFresh:!1}}),fe=xy({...W,sessions:K.sessions||W.sessions||[],cells:K.cells||W.cells||[],localFresh:K.fresh,nodeGroups:le,refreshedAt:Date.now()});a(fe),m(!0),$=!1};U();const R=setInterval(U,Oj);return()=>{A=!1,clearInterval(R)}},[e]);const I=A=>A.degraded?p("cell-degraded"):A.verified?A.selectable?A.working?p("cell-working"):p("cell-idle"):p("cell-off"):p("cell-switcher-not-confirmed"),C=A=>{if(b(""),!A.selectable){b(p("cell-switcher-not-active"));return}S(A.key)},T=async()=>{const A=O;if(!A){b(p("cell-switcher-select"));return}b(""),x(A.key);try{const $=await Fd(e,A.route),U=($.cells||[]).find(R=>(R==null?void 0:R.cell)===A.cellName&&(R==null?void 0:R.tmuxSession)===A.session);if(!fb(U,$.sessions,$.fresh)){b(p("cell-switcher-not-active"));return}n({session:A.session,...A.node?{node:A.node}:{},cellName:A.cellName}),s()}catch{b(p("cell-switcher-not-active"))}finally{x("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:k,className:"nc-cell-switcher",role:"dialog","aria-label":p("fleet-cells"),tabIndex:-1,onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!f&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-refreshing")}),f&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-empty-active")}),Q.map(A=>{const $=(t==null?void 0:t.session)===A.session&&((t==null?void 0:t.node)||"")===A.node,U=y===A.key,R=I(A),W=A.node||"local",B=F.get(W)||E.filter(j=>(j.node||"local")===W);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${U?" selected":""}${A.selectable?"":" off"}`,"data-roster-key":A.key,"data-position":W,children:[c.jsx(bi,{position:W,itemKey:A.key,label:A.cellName,canMove:G,onMove:(j,M)=>z(W,j,M,B),onStep:j=>Z(W,A.key,j,B)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":U,"aria-disabled":!A.selectable,disabled:w===A.key,onClick:()=>C(A),children:[c.jsx("span",{className:`nc-cell-switcher-dot${A.degraded?" warn":A.live?` on${A.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:A.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:R}),c.jsx("small",{children:[A.nodeLabel,A.subtitle].filter(Boolean).join(" · ")})]})]})]},A.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!O||!!w,onClick:T,children:O?`${p("cell-switcher-open")}: ${O.cellName}`:p("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{b(""),h(A=>!A)},children:p(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:P,type:"button",className:"nc-cell-switcher-close","aria-label":p("cell-switcher-close"),title:p("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const Uj=2e3;function Wj(e){if(e.kind==="gap")return`${p("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return p("vl-events-truncated");if(e.kind==="turn_end")return p("vl-events-turn-end");if(e.kind==="done")return p("vl-events-done");if(e.kind==="writer_epoch")return p("vl-events-writer-epoch");if(e.kind==="tool_start")return`${p("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?p("vl-events-tool-failed"):p("vl-events-tool-ok");return`${p("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||p("vl-events-usage"):e.text||""}function Kj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0);return N.useEffect(()=>{let f=!0;h.current=0,o([]);const m=async()=>{try{const y=await E0(e,t,h.current,n);if(!f)return;u(!1);const S=Array.isArray(y==null?void 0:y.events)?y.events:[];S.length&&(o(w=>w.concat(S).slice(-500)),h.current=S[S.length-1].seq),Number.isSafeInteger(y==null?void 0:y.cursor)&&y.cursor>h.current&&(h.current=y.cursor)}catch{f&&u(!0)}},v=()=>{m().catch(()=>{})};v();const b=setInterval(v,Uj);return()=>{f=!1,clearInterval(b)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:p("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:p("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(f=>c.jsx("li",{"data-testid":`vl-ev-${f.seq}`,className:`nc-vl-ev nc-vl-ev-${f.kind}${f.isError?" error":""}${f.kind==="gap"?" gap":""}`,children:Wj(f)},`${f.seq}-${f.kind}`))})]})}function H_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:p("back"),children:[c.jsx(Ze,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",p("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Kj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const $d=e=>ki(Ys(e)).length===0,Hd=e=>Array.isArray(e)?e.join("/"):"";function qj(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Lr(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Ih(e.layout,a,n)}}function Vj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,f]=N.useState(!1),[m,v]=N.useState("idle"),[b,y]=N.useState(""),[S,w]=N.useState(""),x=N.useRef([]),k=N.useRef([]),P=N.useRef(""),E=N.useRef(t),F=N.useRef(n),D=N.useRef(!1),V=N.useRef(!0),G=N.useRef(""),z=N.useMemo(()=>qj(o),[o]),Z=z.map(B=>`${B.instanceId}:${Hd(B.route)}:${B.status}:${B.label}`).join("|");k.current=z,F.current=n,E.current=t,x.current=a;const X=N.useCallback(B=>Oh(B.layout,P.current,k.current),[]),Q=N.useCallback((B,j=!0,M=E.current)=>{const K=Yv(B,xl()),ne=x.current.some(fe=>fe.id===M);x.current=K,u(K);const le=K.find(fe=>fe.id===M);if(j&&le){V.current=!0;const fe=X(le);s(fe),le.local&&pN(le.name,fe)}else ne&&!le&&(V.current=!0,s(Pr()),y("deck non più condiviso dal nodo owner"));uN(K.filter(fe=>fe.local).map(fe=>fe.name))},[s,X]),O=N.useCallback(async B=>{let j=await pl(e);const M=j.decks.find(K=>K.name==="main");if(j.decks.length===1&&M&&M.revision===0&&$d(M.layout)){const K=cN(),ne=Ys(Bh("main")||Pr());if(!$d(ne)){const le=Ih(ne,B,[]);j.decks[0]=await ml(e,"main",le,0,[])}for(const le of K.filter(fe=>fe!=="main"))try{let fe=await Cg(e,le,[]);const ge=Ys(Bh(le)||Pr());$d(ge)||(fe=await ml(e,le,Ih(ge,B,[]),fe.revision,[]))}catch{}j=await pl(e)}return j},[e]),I=N.useCallback(async({migrate:B=!1}={})=>{const j=await Zh(e,[]),M=Hn.test(String(j.instanceId||""))?j.instanceId:"";if(!M)throw new Error("instanceId locale non disponibile");P.current=M,w(M);const[K,ne]=await Promise.all([B?O(M):pl(e),bg(e,[]).catch(()=>({nodes:[]}))]),le={instanceId:M,route:[],label:"Local"},fe=K.decks.map(pe=>Hs(pe,le,ne.nodes,!0,!0)),ge=x.current;return await Promise.all(k.current.map(async pe=>{if(pe.status!=="up"){fe.push(...ge.filter(we=>!we.local&&we.ownerId===pe.instanceId).map(we=>({...we,ownerRoute:[...pe.route],ownerLabel:pe.label,available:!1})));return}try{const[we,He]=await Promise.all([pl(e,pe.route),bg(e,pe.route).catch(()=>({nodes:[]}))]);fe.push(...we.decks.map(ht=>Hs(ht,pe,He.nodes,!1,!0)))}catch{fe.push(...ge.filter(He=>!He.local&&He.ownerId===pe.instanceId).map(He=>({...He,ownerRoute:[...pe.route],ownerLabel:pe.label,available:!1})))}})),fe.sort((pe,we)=>pe.local===we.local?pe.ownerLabel.localeCompare(we.ownerLabel)||(pe.name==="main"?-1:we.name==="main"?1:pe.name.localeCompare(we.name)):pe.local?-1:1),fe},[e,O,Z]);N.useEffect(()=>{if(!e)return;let B=!1;const j=G.current!==e;return G.current=e,I({migrate:j}).then(M=>{if(B)return;const K=x.current.find(fe=>fe.id===E.current),ne=M.find(fe=>fe.id===E.current),le=ne&&(!K||ne.revision>K.revision||K.available!==ne.available||Hd(K.ownerRoute)!==Hd(ne.ownerRoute));Q(M,j||!!le&&!D.current),f(!0),ne&&y("")}).catch(M=>{B||(f(!0),y(String(M.message||M)))}),()=>{B=!0}},[Q,I,Z,e]);const C=N.useCallback(async(B=E.current)=>{if(!h||!D.current)return!0;const j=x.current.find(M=>M.id===B);if(!j)return y(`deck inesistente: ${B}`),!1;if(j.available===!1)return y(`nodo owner offline: ${j.ownerLabel}`),!1;v("saving");try{const M=qv(Ys(F.current),j.ownerId,j.ownerTopology),K=await ml(e,j.name,M,j.revision,j.ownerRoute),ne=Hs(K,zo(j),j.ownerTopology,j.local,!0);return Q(x.current.map(le=>le.id===B?ne:le),!1),D.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(M){if(v("error"),y(String(M.message||M)),M.status===409&&M.data&&M.data.current){const K=x.current.find(le=>le.id===B),ne=Hs(M.data.current,zo(K),K.ownerTopology,K.local,!0);Q(x.current.map(le=>le.id===B?ne:le),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(V.current){V.current=!1;return}D.current=!0,v("saving");const B=setTimeout(C,650);return()=>clearTimeout(B)},[n,h,C]),N.useEffect(()=>{if(!h)return;const B=setInterval(async()=>{try{const j=await I(),M=x.current.find(le=>le.id===E.current),K=j.find(le=>le.id===E.current),ne=K&&(!M||K.revision>M.revision||M.available!==K.available);Q(j,ne&&!D.current)}catch{}},5e3);return()=>clearInterval(B)},[h,I,Q]),{decks:a,records:a,localNodeId:S,ready:h,saveState:m,error:b,setError:y,saveNow:C,select:async B=>{if(D.current&&!await C(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const j=x.current.find(M=>M.id===B);if(!j)throw new Error(`deck inesistente: ${B}`);return D.current=!1,V.current=!0,X(j)},add:async(B,j=null)=>{const M=j===Si?x.current.find(le=>le.local):j?x.current.find(le=>le.ownerId===j):null;if(!M||M.available===!1)throw new Error("nodo owner non disponibile");const K=await Cg(e,B,M.ownerRoute),ne=Hs(K,zo(M),M.ownerTopology,M.local,!0);return Q([...x.current,ne],!1),ne},rename:async(B,j)=>{const M=x.current.find(ge=>ge.id===B);if(!M)throw new Error("deck inesistente");if(B===E.current&&D.current&&!await C(B))throw new Error(`salvataggio di "${M.name}" fallito: rinomina annullata`);const K=x.current.find(ge=>ge.id===B);if(!K)throw new Error("deck inesistente");const ne=await Q0(e,K.name,j,K.revision,K.ownerRoute),le=Hs(ne,zo(K),K.ownerTopology,K.local,!0),fe=K.local?Si:K.ownerId;return pd(hN(xl(),fe,B,le.id)),Q(x.current.map(ge=>ge.id===B?le:ge),!1),le},remove:async B=>{const j=x.current.find(K=>K.id===B);if(!j)throw new Error("deck inesistente");B===E.current&&(D.current=!1),await J0(e,j.name,j.revision,j.ownerRoute);const M=j.local?Si:j.ownerId;pd(fN(xl(),M,B)),Q(x.current.filter(K=>K.id!==B),!1)},reorder:(B,j)=>{const M=x.current.find(pe=>pe.id===B),K=x.current.find(pe=>pe.id===j);if(!M||!K)return!1;const ne=M.local?Si:M.ownerId,le=K.local?Si:K.ownerId;if(ne!==le)return!1;const fe=x.current.filter(pe=>(pe.local?Si:pe.ownerId)===ne).map(pe=>pe.id),ge=pd(dN(xl(),ne,B,j,fe));return Q(Yv(x.current,ge),!1),!0},addTileTo:async(B,j)=>{const M=x.current.find(pe=>pe.id===B);if(!M)throw new Error("deck inesistente");if(M.available===!1)throw new Error(`nodo owner offline: ${M.ownerLabel}`);const K=Aw(j,P.current,k.current);if(!K)throw new Error("riferimento sessione non valido");const ne=X(M),le=qv(wy(ne,K),M.ownerId,M.ownerTopology),fe=await ml(e,M.name,le,M.revision,M.ownerRoute),ge=Hs(fe,zo(M),M.ownerTopology,M.local,!0);return Q(x.current.map(pe=>pe.id===B?ge:pe),!1),ge},localMainId:Lr(null,"main"),parseDeckId:sc}}const Yj="/sw.js",Hh="nc-sw-update";let Uh=null,Wh=!1,Kh=null,pb=Object.freeze({needed:!1,kind:null,version:""}),mb=!1;function gb(){typeof window<"u"&&window.dispatchEvent(new Event(Hh))}function vb(){const e=Kh||(Wh?{kind:"reload",version:""}:null);pb=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function U_(){return pb}function Gj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Hh,e),()=>window.removeEventListener(Hh,e))}function Ff(e){Wh!==e&&(Wh=e,vb(),gb())}function Xj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(Kh);Kh=s,vb(),o||gb()}function Qj(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function Jj(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{mb&&location.reload()}),navigator.serviceWorker.register(Yj).then(e=>{Uh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&Qj(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function Zj(){mb=!0,Ff(!1);const e=Uh&&Uh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function eR({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",f=u.get("pair")||"",m=f?`${t||""}${n||""}#pair=${f}`:"";return{token:h,pair:m,nextUrl:a}}const _b=9,yb=24,wb="nc_side_w",W_="nc_side_min",tR=240,K_="(min-width:1024px) and (pointer:fine)";function nR(){const e=Number(localStorage.getItem(wb));return e>=180&&e<=480?e:tR}function iR(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=_b&&e<=yb?e:13}function sR(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=eR({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function rR(e){try{return Ys(Bh(e))}catch{return Pr()}}function q_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function oR(){const[e,t]=N.useState(()=>window.matchMedia(K_).matches);return N.useEffect(()=>{const n=window.matchMedia(K_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function V_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:f=!1}){kn();const[m]=kf(),[v,b]=N.useState(!1),[y,S]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,x]=N.useState(null),[k,P]=N.useState(iR),[E,F]=N.useState(s||e),[D,V]=N.useState(""),G=$=>P(U=>{const R=Math.max(_b,Math.min(yb,U+$));return localStorage.setItem("nc_fontsize",String(R)),R}),z=N.useRef(()=>{}),Z=N.useRef(()=>!1),X=N.useRef(()=>{}),Q=N.useRef(!1),[O,I]=N.useState(!1),[C,T]=N.useState(!1),A=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const U=t?t.split("/"):[],R=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function W(){let j=null,M=null;try{const le=await(await Ht(`${R}/sessions`,o)).json();Array.isArray(le.sessions)&&(j=le.sessions.find(fe=>fe.name===e))}catch{}try{const ne=await ws(o,U);ne.available&&Array.isArray(ne.cells)&&(M=ne.cells.find(le=>le.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:M||(s?{cell:s}:null)}));let K="";M?K=`${M.engine}${M.key?`·${M.key}`:""}`:j&&(K=j.attached?`attached · ${q_(j.activity)}`:j.activity?q_(j.activity):""),V(K)}W();const B=setInterval(W,4e3);return()=>{$=!1,clearInterval(B)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:p("sessions"),children:[c.jsx(Ze,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),D&&c.jsx("small",{className:"nc-bar-sub",children:D})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>G(-1),title:p("zoom-out"),children:c.jsx(Ze,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>G(1),title:p("zoom-in"),children:c.jsx(Ze,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>S($=>!$),title:p("composer"),children:c.jsx(Ze,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>b($=>!$),title:p("files"),children:c.jsx(Ze,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(vw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:z,composerRef:Z,actionRef:X,ctrlRef:Q,setCtrlArmed:I,onFiles:x,fontSize:k,selectionMode:C,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(TE,{onKeyboard:()=>S($=>!$),onCellSwitcher:h,cellSwitcherOpen:f,send:$=>z.current($),action:$=>X.current($),ctrlArmed:O,onCtrl:A,selectionMode:C,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(Nw,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(_w,{session:e,node:t,token:o,filesEvent:w,onClose:()=>b(!1)})]})}function aR(){kn();const[e]=N.useState(sR),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),f=oR(),[m]=N.useState(()=>lN(typeof location<"u"?location.pathname:"/")),[v,b]=N.useState(m.id),y=v===Lr(null,Un),[S,w]=N.useState(null),x=ue=>{const je=ys(ue);w(je?{...je,...typeof(ue==null?void 0:ue.cellName)=="string"&&ue.cellName?{cellName:ue.cellName}:{}}:null)},[k,P]=N.useState([]),[E,F]=N.useState([]),[D,V]=N.useState([]),[G,z]=N.useState(()=>m.ownerId?Pr():rR(m.name)),[Z,X]=N.useState(null),[Q,O]=N.useState(null),I=ue=>O(ys(ue)),[C,T]=N.useState(null),A=nf(t,f),$=N.useMemo(()=>(A||[]).filter(ue=>ue.instanceId).map(ue=>({instanceId:ue.instanceId,route:ue.route,label:ue.label,status:ue.status})),[A]),U=Vj(t,v,G,z,$),R=U.decks;N.useEffect(()=>{const ue=new Map;for(const je of A||[]){const qe=(je.route||[je.name]).join("/"),pt=new Set((je.sessions||[]).map(_t=>_t.name));for(const _t of je.cells||[])!_t.cell||!_t.tmuxSession||_t.cell===_t.tmuxSession||pt.has(_t.cell)||ue.set(`${qe}:${_t.cell}`,`${qe}:${_t.tmuxSession}`)}z(je=>Nx(je,ue))},[A]),N.useEffect(()=>{U.localNodeId&&z(ue=>{const je=Oh(ue,U.localNodeId,$);return JSON.stringify(je)===JSON.stringify(ue)?ue:je})},[$,U.localNodeId]);const[W,B]=N.useState(null),[j,M]=N.useState(null),K=N.useRef(0),[ne,le]=N.useState(!1),[fe,ge]=N.useState(nR),[pe,we]=N.useState(!y),[He,ht]=N.useState(()=>y?localStorage.getItem(W_)==="1":!0),[Ye,Ae]=N.useState(!1),[Ne,ut]=N.useState("nodes"),[Pe,Ut]=N.useState(!1),[Rt,Dt]=N.useState(""),[vt,ft]=N.useState(!1),dt=(ue="nodes",je=!1,qe="")=>{ut(ue),Ut(je),Dt(qe),Ae(!0)},[re,xe]=N.useState(!1),[Oe,Fe]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[de,ze]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(wb,String(fe))}catch{}},[fe]),N.useEffect(()=>{try{localStorage.setItem(W_,He?"1":"")}catch{}},[He]),N.useEffect(()=>{if(!t)return;let ue=!1;return Promise.all([ny(t),Ht("/api/config",t).then(je=>je.json())]).then(([je,qe])=>{ue||(Fe({deviceDefault:je.deviceName||"",localNodeId:je.nodeId||"",localNameDefault:je.localName||""}),ze(!!qe.readonlyDefault),(je.firstRun===!0&&!qe.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{ue=!0}},[t,s]);const q=N.useCallback(async()=>{try{const je=await(await Ht("/api/sessions",t)).json();je.error||P(je.sessions||[])}catch{}try{const ue=await ws(t);F(ue.available?ue.cells||[]:[]),V(ue.available?ue.capabilities||[]:[])}catch{F([]),V([])}},[t]);N.useEffect(()=>{if(!f)return;q();const ue=setInterval(q,4e3);return()=>clearInterval(ue)},[f,q]),N.useEffect(()=>{let ue=!1;return Ht("/api/config",t).then(je=>je.json()).then(je=>{ue||Xj(je.version,je.uiVersion,"0.8.52-rc.7")}).catch(()=>{}),()=>{ue=!0}},[t]);const te=new Set([...k.map(ue=>ue.name),...A.flatMap(ue=>ue.sessions.map(je=>je.key))]),H=ki(G),ae=ue=>z(je=>{const qe=Aw(ue,U.localNodeId,$)||ue,pt=wy(je,qe);return pt===je&&ki(je).length>=9&&U.setError(p("grid-full")),pt}),ce=async(ue,je=[])=>{try{await Xh(t,ue,je)}catch{return}const qe=je.length?`${je.join("/")}:${ue}`:ue;z(pt=>Hl(pt,qe)),q()},me=async(ue,je,qe=[])=>{try{await ty(t,ue,je,qe)}catch{return}q()},Te=async(ue,je,qe=[])=>{await J_(t,{cell:ue,enabled:!!je},qe),q()},_e=async ue=>{if(!W)return;const{cell:je}=W,qe=Array.isArray(W.route)?W.route:[];if(ue.action==="up"){const _t=await Yh(t,{cell:je,boot:!!ue.boot,...ue.engine?{engine:ue.engine}:{},...ue.model!==void 0?{model:ue.model}:{},...ue.permissionPolicy?{permissionPolicy:ue.permissionPolicy}:{}},qe),bs=uf(_t);bs&&U.setError(bs.text)}else await Il(t,{cell:je,boot:!!ue.boot},qe);const pt=ue.action==="up"?!!ue.boot:ue.boot?!1:!!W.boot;M({id:++K.current,cell:je,route:qe,enabled:pt}),q()},Ce=N.useCallback(ue=>{M(je=>(je==null?void 0:je.id)===ue?null:je)},[]),nt=async ue=>{if(!(!(ue!=null&&ue.direct)||ne)){le(!0);try{await ef(t,ue.name,ue.tunnelStatus==="up"?"down":"up")}finally{le(!1)}}},ot=async(ue,je)=>{const qe=String(je||"").trim();return!(ue!=null&&ue.direct)||!Mr(qe)?!1:(await ry(t,ue.name,qe),!0)},Je=ue=>{const je=R.find(qe=>qe.id===ue);if(!je)return!1;try{const qe=window.open(fd(je,t),"_blank");return qe&&(qe.opener=null),!!qe}catch{return!1}},Mt=async ue=>{if(!ue||ue===v)return;const je=await U.select(ue),qe=U.records.find(pt=>pt.id===ue);b(ue),z(je),X(null),O(null);try{history.replaceState(null,"",fd(qe||ue,null))}catch{}},lt=async(ue,je)=>{const qe=await U.add(ue,je);await Mt(qe.id)},et=async(ue,je)=>{const qe=await U.rename(ue,je);if(ue===v){b(qe.id),z(Oh(qe.layout,U.localNodeId,$)),X(null),O(null);try{history.replaceState(null,"",fd(qe,null))}catch{}}},Zt=async ue=>{await U.remove(ue),ue===v&&await Mt(U.localMainId)},ni=async(ue,je)=>{!je||je===v||(await U.addTileTo(je,ue),z(qe=>Hl(qe,ue)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:p("auth-prompt")}),c.jsx("input",{onChange:ue=>n(ue.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:ue=>h(ue.target.checked)})," ",p("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Ye&&c.jsx(Rj,{token:t,initialTab:Ne,initialLocation:Rt,startNewCell:Pe,onClose:()=>{Ae(!1),Ut(!1),Dt("")}}),re&&c.jsx(Pj,{token:t,initialPair:s,...Oe,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(Ij,{token:t})]});if(!f)return C?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx(H_,{peer:C,token:t,onBack:()=>T(null)})}),Wn]}):S?c.jsxs(c.Fragment,{children:[c.jsx(V_,{session:S.session,node:S.node,ownerId:S.ownerId,cellName:S.cellName,token:t,readonly:de,onBack:()=>w(null),onCellSwitcher:()=>ft(!0),cellSwitcherOpen:vt}),vt&&c.jsx(Hj,{token:t,current:S,onPick:ue=>{x(ue),ft(!1)},onClose:()=>ft(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx(Wx,{onPick:x,token:t,onSettings:dt,onOpenVlSession:T}),Wn]});const ui=y||!pe;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(XE,{sessions:k,cells:E,activeSessions:H,nodeGroups:A,fleetCapabilities:D,bootSettlement:j,onBootSettlementApplied:Ce,localNodeId:U.localNodeId,onPick:I,onAddTile:ae,onPower:B,onBoot:Te,onBootError:ue=>U.setError(String((ue==null?void 0:ue.message)||ue)),onNodePower:nt,onNodeRename:ot,onKill:ce,onVisibility:me,onNew:()=>dt("fleet",!0),onSettings:dt,onOpenVlSession:T,width:fe,collapsed:He,onResize:ge,onToggleCollapse:()=>ht(ue=>!ue)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(LN,{decks:R,currentDeck:v,onCreate:lt,onRename:et,onDelete:Zt,onReorder:U.reorder,onOpenWindow:Je,onNavigate:Mt,saveState:U.saveState,error:U.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>we(ue=>!ue)}),c.jsx(iN,{layout:G,onLayoutChange:z,token:t,readonly:de,sessionsAlive:te,focusSession:Z,onFocus:X,onOpenSingle:I,decks:R,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:A})]}),C&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(H_,{peer:C,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(V_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:A}),token:t,readonly:de,onBack:()=>O(null)})}),W&&c.jsx(Bl,{cell:W,token:t,route:Array.isArray(W.route)?W.route:[],onConfirm:_e,onClose:()=>B(null)}),Wn]})}function lR(){kn();const e=N.useSyncExternalStore(Gj,U_,U_);if(!e.needed)return null;const t=e.kind==="install"?p("install-version-mismatch").replace("{v}",e.version):p("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:Zj,children:p("reload")})]})}Jj();p0.createRoot(document.getElementById("root")).render(c.jsxs(a0.StrictMode,{children:[c.jsx(aR,{}),c.jsx(lR,{})]}));
|
|
93
|
+
`],{type:"application/json"}),$=URL.createObjectURL(A),U=document.createElement("a");U.href=$,U.download="nexuscrew-diagnostics.json",U.click(),URL.revokeObjectURL($)}catch{y(p("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[p("diagnostics-target"),c.jsx("select",{value:u.key,onChange:A=>a(A.target.value),children:s.map(A=>c.jsxs("option",{value:A.key,children:[A.label,A.status!=="up"?` · ${A.status}`:""]},A.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:p("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":p("diagnostics-duration"),value:P,onChange:A=>E(Number(A.target.value)),disabled:n,children:[300,900,1800,3600].map(A=>c.jsxs("option",{value:A,children:[A/60," min"]},A))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>kg(e,!0,P,u.route)),children:p("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>kg(e,!1,P,u.route)),children:p("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?p("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):p("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":p("diagnostics-level"),value:F,onChange:A=>D(A.target.value),children:[c.jsx("option",{value:"all",children:p("diagnostics-all-levels")}),["debug","info","warn","error"].map(A=>c.jsx("option",{value:A,children:A},A))]}),c.jsx("input",{"aria-label":p("diagnostics-component"),placeholder:p("diagnostics-component"),value:V,onChange:A=>G(A.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:S,onChange:A=>w(A.target.checked)})," ",p("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:x,onChange:A=>k(A.target.checked)})," ",p("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":p("diagnostics-log"),children:O||p("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:C,children:p("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:p("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(p("diagnostics-clear-confirm"))&&I(async()=>{const A=await V0(e,u.route);return z.current=0,v([]),A})},children:p("diagnostics-clear")})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})}function jj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState(null),[P,E]=N.useState(!0),[F,D]=N.useState(!1);N.useEffect(()=>{k(t&&t.update||null),E(!t||t.autoUpdate!==!1),D(!!(t&&t.alternateScreen))},[t]);const V=async()=>{f(null),v(null),w(!0);try{const C=await N0(e);v(C.note||"ok"),y(!1)}catch(C){f(String(C.message||C))}w(!1)},G=async()=>{f(null),v(null),w(!0);try{const C=await H0(e);v(`${C.note||"ok"}${C.target?` (${C.target})`:""}`)}catch(C){f(String(C.message||C))}w(!1)},z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{autoUpdate:C}),E(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},Z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{alternateScreen:C}),D(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},X=async()=>{f(null),v(null),w(!0);try{k(await U0(e))}catch(C){f(String(C.message||C))}w(!1)},Q=async()=>{f(null),v(null),w(!0);try{const C=await W0(e);k(C),v(p("npm-update-restarting"))}catch(C){f(String(C.message||C))}w(!1)},O=()=>{window.confirm(p("composer-clear-confirm"))&&(f(null),WE()?(window.dispatchEvent(new Event(Dh)),v(p("composer-clear-done"))):f(p("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":p("tab-system"),children:["general","diagnostics"].map(C=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===C,className:`nc-set-tabbtn${a===C?" on":""}`,onClick:()=>u(C),children:p(`system-${C}`)},C))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?p("service-installed"):p("service-missing"),I&&I.installed?` · ${I.active?p("service-active"):p("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:G,children:p("service-regenerate")})}),c.jsx(xj,{token:e,readonly:n}),c.jsx(kj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:n||S||x&&!x.supported,onChange:C=>z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("npm-auto-update")}),c.jsx("small",{children:p("npm-auto-update-help")})]})]}),x&&c.jsxs("div",{className:"nc-set-info",children:[p("npm-update-current")," v",x.current,x.latest?` · ${p("npm-update-latest")} v${x.latest}`:""," · ",p(`npm-update-${x.supported?x.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S||!x||!x.supported,onClick:X,children:p("npm-update-check")}),x&&x.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||S||x.phase==="installing",onClick:Q,children:p("npm-update-install")})]}),x&&x.lastError&&c.jsx("div",{className:"nc-err",children:x.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:()=>{f(null),v(null),y(!0)},children:p("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:p("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:O,children:p("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:p("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:p("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("alternate-screen"),checked:F,disabled:n||S,onChange:C=>Z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("alternate-screen")}),c.jsx("small",{children:p("alternate-screen-help")})]})]})]}),c.jsx(Nj,{token:e,roster:o,readonly:n})]}),b&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:p("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:S,onClick:()=>y(!1),children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:S,onClick:V,children:p("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function Rj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),f=N.useRef(null),m=N.useRef(null),[v,b]=N.useState({start:!1,end:!1}),[y,S]=N.useState(a),[w,x]=N.useState(null),[k,P]=N.useState([]),[E,F]=N.useState([]),[D,V]=N.useState(!1),[G,z]=N.useState(null),[Z,X]=N.useState(0),Q=nf(e,!0,Z),O=N.useCallback(()=>{const C=f.current;if(!C)return;const T=C.scrollWidth>C.clientWidth+1,A={start:T&&C.scrollLeft>1,end:T&&C.scrollLeft+C.clientWidth<C.scrollWidth-1};b($=>$.start===A.start&&$.end===A.end?$:A)},[]);N.useEffect(()=>{const C=f.current;if(!C)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(O):null;return T==null||T.observe(C),window.addEventListener("resize",O),O(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",O)}},[O]),N.useEffect(()=>{var T,A;(A=(T=m.current)==null?void 0:T.scrollIntoView)==null||A.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const C=window.requestAnimationFrame?window.requestAnimationFrame(O):setTimeout(O,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(C):clearTimeout(C)}},[u,O]);const I=N.useCallback(async()=>{var C;try{const T=await ny(e);x(T),z(null)}catch(T){z(String(T.message||T))}try{const A=(await C0(e)).peers||[];let $=[],U=[];try{const[R,W]=await Promise.all([Ht("/api/config",e).then(K=>K.json()).catch(()=>null),sy(e).catch(()=>null)]),B=R&&typeof R.instanceId=="string"?R.instanceId:"",j=[{instanceId:B||null,route:[],label:null},...fy(W,B)],M=await Promise.all(j.map(async K=>{try{return{ok:!0,peers:((await iy(e,K.route)).nodes||[]).map(fe=>hy(fe,K)).filter(Boolean)}}catch(ne){return{ok:!1,owner:K,error:ne}}}));for(const K of M){if(K.ok){$.push(...K.peers);continue}K.owner.route.length!==0&&U.push({instanceId:K.owner.instanceId,label:K.owner.label,route:K.owner.route,failure:/timeout/i.test(String(((C=K.error)==null?void 0:C.message)||K.error))?"timeout":"unreachable"})}}catch{}F(U),P([...A,...$])}catch(T){z(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const C=setInterval(I,5e3);return()=>clearInterval(C)},[I]),N.useEffect(()=>{let C=!1;return Ht("/api/config",e).then(T=>T.json()).then(T=>{C||V(!!T.readonlyDefault)}).catch(()=>{}),()=>{C=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:C=>C.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Ze,{name:"gear",size:18}),c.jsx("b",{children:p("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:p("close"),children:c.jsx(Ze,{name:"x",size:18})})]}),D&&c.jsx("div",{className:"nc-set-readonly",children:p("settings-readonly")}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:f,onScroll:O,children:["nodes","fleet","audio","input","system"].map(C=>c.jsx("button",{ref:u===C?m:null,type:"button",className:`nc-set-tabbtn${u===C?" on":""}`,onClick:()=>h(C),children:p(`tab-${C}`)},C))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(Sj,{token:e,nodes:k,roster:Q,settings:w,readonly:D,vlUnavailable:E,refresh:I,refreshAliases:()=>X(C=>C+1)}),u==="fleet"&&c.jsx(ij,{token:e,readonly:D,startNewCell:o,initialLocation:s,targets:Q.map(C=>({route:C.route,label:C.label||C.name,status:C.status}))}),u==="audio"&&c.jsx(Cj,{token:e,readonly:D,nodes:k,settings:w}),u==="input"&&c.jsx(Ej,{}),u==="system"&&c.jsx(jj,{token:e,settings:w,readonly:D,refresh:I,roster:Q,section:y,setSection:S})]})]})})}function Pj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,f]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[b,y]=N.useState(null),S=async()=>{v(!0),y(null);try{await Ud(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:p("wizard-title")}),c.jsx("small",{children:p("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:S,children:p("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>f("pair"),children:p("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(Xw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),f("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),f("welcome")},children:p("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:S,children:p("finish")})})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})})}function Lj(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Aj=6e3,Tj=12e3;function Dj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:p("close"),children:c.jsx(Ze,{name:"x",size:14})})]})}function Mj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(null),[v,b]=N.useState(!1),y=async w=>{const x=String(w||"").trim();if(!(!x||u)){m(null),h(!0);try{await G0(t,e.id,x),n(e.id)}catch(k){m(String(k.message||k))}h(!1)}},S=async()=>{if(!v){b(!0);try{await X0(t,e.id),s(e.id)}catch{b(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:p("ask-dismiss"),"aria-label":p("ask-dismiss"),disabled:v,onClick:S,children:c.jsx(Ze,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:p("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:p("send")})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Ij({token:e}){const[t]=kn(),[n]=hb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,f]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=yj());const b=N.useRef({enabled:n,lang:t});b.current={enabled:n,lang:t};const y=N.useCallback(k=>{o(P=>P.filter(E=>E.key!==k))},[]),S=N.useCallback(k=>{const P=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...k,key:P}]),setTimeout(()=>y(P),k.urgency==="high"?Tj:Aj);const E=b.current;if(E.enabled)try{v.current.enqueue(k,pj(k,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const k=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},P=()=>v.current.stop();return document.addEventListener("visibilitychange",k),window.addEventListener("blur",k),window.addEventListener(Fh,P),()=>{document.removeEventListener("visibilitychange",k),window.removeEventListener("blur",k),window.removeEventListener(Fh,P),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let k=!1;Y0(e).then(E=>{k||u(E.asks||[])}).catch(()=>{});const P=Lj(e,E=>{E.type==="notify"?S(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(D=>D.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(D=>D.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(D=>D.id!==E.id))});return()=>{k=!0,P()}},[e,S]);const w=k=>u(P=>P.filter(E=>E.id!==k)),x=k=>u(P=>P.filter(E=>E.id!==k));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(k=>c.jsx(Dj,{n:k,onClose:()=>y(k.key)},k.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>f(!0),title:p("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:p("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>f(!1),title:p("close"),children:c.jsx(Ze,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(k=>c.jsx(Mj,{ask:k,token:e,onAnswered:w,onDismiss:x},k.id))})]})]})}const Oj=4e3;async function Bj(e){const t=await Ht("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function Fd(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):Bj(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function fb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function zj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],f="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const b=m.get(v.tmuxSession)||{},y=of(v,b),S=fb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:f,live:S,selectable:S,verified:u===!0,working:y.working,degraded:!!v.degraded,activity:b.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[])s(o.cells,o.sessions,o.switcherFresh===!0,Array.isArray(o.route)?o.route:[],o.label||o.name||"");return n}function Fj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(!h.length)continue;const f=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(f.map(b=>b.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:f,sessions:m,unmanaged:m.filter(b=>!v.has(b.name))}).rawItems)}return t}function $j(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),f=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const b=h.get(v.key);return{...v,label:(b==null?void 0:b.label)||v.label,live:(b==null?void 0:b.live)??v.live,fresh:(b==null?void 0:b.fresh)===!0,activity:(b==null?void 0:b.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>f.get(v.key))})}function Hj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Bg),[u,h]=N.useState(!1),[f,m]=N.useState(!1),[v,b]=N.useState(""),[y,S]=N.useState(""),[w,x]=N.useState(""),k=N.useRef(null),P=N.useRef(null),E=N.useMemo(()=>zj(o),[o]),F=N.useMemo(()=>Fj(o),[o]),{pins:D,orders:V,canMoveRoster:G,moveRoster:z,stepRoster:Z}=rf(),X=N.useMemo(()=>$j(E,F,D,V),[E,F,D,V]),Q=N.useMemo(()=>u?X:X.filter(A=>A.selectable||A.degraded),[X,u]),O=N.useMemo(()=>E.find(A=>A.key===y&&A.selectable),[E,y]);N.useEffect(()=>{var U;const A=document.activeElement;(U=P.current)==null||U.focus();const $=R=>{R.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var R;document.removeEventListener("keydown",$),(R=A==null?void 0:A.focus)==null||R.call(A)}},[s]),N.useEffect(()=>{let A=!0,$=!1;const U=async()=>{if($)return;$=!0;const W=Bg(),B=Array.isArray(W.nodeGroups)?W.nodeGroups:[],j=Fd(e),M=await Promise.all(B.map(async ge=>{const pe=Array.isArray(ge.route)?ge.route:[];return pe.length?{group:ge,result:await Fd(e,pe)}:{group:ge,result:{fresh:!1,sessions:null,cells:null}}})),K=await j;if(!A)return;const ne=new Map(M.map(({group:ge,result:pe})=>[JSON.stringify(ge.route||[]),pe])),le=B.map(ge=>{const pe=ne.get(JSON.stringify(ge.route||[]));return pe?{...ge,sessions:pe.sessions||ge.sessions||[],cells:pe.cells||ge.cells||[],switcherFresh:pe.fresh}:{...ge,switcherFresh:!1}}),fe=xy({...W,sessions:K.sessions||W.sessions||[],cells:K.cells||W.cells||[],localFresh:K.fresh,nodeGroups:le,refreshedAt:Date.now()});a(fe),m(!0),$=!1};U();const R=setInterval(U,Oj);return()=>{A=!1,clearInterval(R)}},[e]);const I=A=>A.degraded?p("cell-degraded"):A.verified?A.selectable?A.working?p("cell-working"):p("cell-idle"):p("cell-off"):p("cell-switcher-not-confirmed"),C=A=>{if(b(""),!A.selectable){b(p("cell-switcher-not-active"));return}S(A.key)},T=async()=>{const A=O;if(!A){b(p("cell-switcher-select"));return}b(""),x(A.key);try{const $=await Fd(e,A.route),U=($.cells||[]).find(R=>(R==null?void 0:R.cell)===A.cellName&&(R==null?void 0:R.tmuxSession)===A.session);if(!fb(U,$.sessions,$.fresh)){b(p("cell-switcher-not-active"));return}n({session:A.session,...A.node?{node:A.node}:{},cellName:A.cellName}),s()}catch{b(p("cell-switcher-not-active"))}finally{x("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:k,className:"nc-cell-switcher",role:"dialog","aria-label":p("fleet-cells"),tabIndex:-1,onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!f&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-refreshing")}),f&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-empty-active")}),Q.map(A=>{const $=(t==null?void 0:t.session)===A.session&&((t==null?void 0:t.node)||"")===A.node,U=y===A.key,R=I(A),W=A.node||"local",B=F.get(W)||E.filter(j=>(j.node||"local")===W);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${U?" selected":""}${A.selectable?"":" off"}`,"data-roster-key":A.key,"data-position":W,children:[c.jsx(bi,{position:W,itemKey:A.key,label:A.cellName,canMove:G,onMove:(j,M)=>z(W,j,M,B),onStep:j=>Z(W,A.key,j,B)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":U,"aria-disabled":!A.selectable,disabled:w===A.key,onClick:()=>C(A),children:[c.jsx("span",{className:`nc-cell-switcher-dot${A.degraded?" warn":A.live?` on${A.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:A.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:R}),c.jsx("small",{children:[A.nodeLabel,A.subtitle].filter(Boolean).join(" · ")})]})]})]},A.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!O||!!w,onClick:T,children:O?`${p("cell-switcher-open")}: ${O.cellName}`:p("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{b(""),h(A=>!A)},children:p(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:P,type:"button",className:"nc-cell-switcher-close","aria-label":p("cell-switcher-close"),title:p("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const Uj=2e3;function Wj(e){if(e.kind==="gap")return`${p("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return p("vl-events-truncated");if(e.kind==="turn_end")return p("vl-events-turn-end");if(e.kind==="done")return p("vl-events-done");if(e.kind==="writer_epoch")return p("vl-events-writer-epoch");if(e.kind==="tool_start")return`${p("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?p("vl-events-tool-failed"):p("vl-events-tool-ok");return`${p("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||p("vl-events-usage"):e.text||""}function Kj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0);return N.useEffect(()=>{let f=!0;h.current=0,o([]);const m=async()=>{try{const y=await E0(e,t,h.current,n);if(!f)return;u(!1);const S=Array.isArray(y==null?void 0:y.events)?y.events:[];S.length&&(o(w=>w.concat(S).slice(-500)),h.current=S[S.length-1].seq),Number.isSafeInteger(y==null?void 0:y.cursor)&&y.cursor>h.current&&(h.current=y.cursor)}catch{f&&u(!0)}},v=()=>{m().catch(()=>{})};v();const b=setInterval(v,Uj);return()=>{f=!1,clearInterval(b)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:p("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:p("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(f=>c.jsx("li",{"data-testid":`vl-ev-${f.seq}`,className:`nc-vl-ev nc-vl-ev-${f.kind}${f.isError?" error":""}${f.kind==="gap"?" gap":""}`,children:Wj(f)},`${f.seq}-${f.kind}`))})]})}function H_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:p("back"),children:[c.jsx(Ze,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",p("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Kj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const $d=e=>ki(Ys(e)).length===0,Hd=e=>Array.isArray(e)?e.join("/"):"";function qj(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Lr(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Ih(e.layout,a,n)}}function Vj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,f]=N.useState(!1),[m,v]=N.useState("idle"),[b,y]=N.useState(""),[S,w]=N.useState(""),x=N.useRef([]),k=N.useRef([]),P=N.useRef(""),E=N.useRef(t),F=N.useRef(n),D=N.useRef(!1),V=N.useRef(!0),G=N.useRef(""),z=N.useMemo(()=>qj(o),[o]),Z=z.map(B=>`${B.instanceId}:${Hd(B.route)}:${B.status}:${B.label}`).join("|");k.current=z,F.current=n,E.current=t,x.current=a;const X=N.useCallback(B=>Oh(B.layout,P.current,k.current),[]),Q=N.useCallback((B,j=!0,M=E.current)=>{const K=Yv(B,xl()),ne=x.current.some(fe=>fe.id===M);x.current=K,u(K);const le=K.find(fe=>fe.id===M);if(j&&le){V.current=!0;const fe=X(le);s(fe),le.local&&pN(le.name,fe)}else ne&&!le&&(V.current=!0,s(Pr()),y("deck non più condiviso dal nodo owner"));uN(K.filter(fe=>fe.local).map(fe=>fe.name))},[s,X]),O=N.useCallback(async B=>{let j=await pl(e);const M=j.decks.find(K=>K.name==="main");if(j.decks.length===1&&M&&M.revision===0&&$d(M.layout)){const K=cN(),ne=Ys(Bh("main")||Pr());if(!$d(ne)){const le=Ih(ne,B,[]);j.decks[0]=await ml(e,"main",le,0,[])}for(const le of K.filter(fe=>fe!=="main"))try{let fe=await Cg(e,le,[]);const ge=Ys(Bh(le)||Pr());$d(ge)||(fe=await ml(e,le,Ih(ge,B,[]),fe.revision,[]))}catch{}j=await pl(e)}return j},[e]),I=N.useCallback(async({migrate:B=!1}={})=>{const j=await Zh(e,[]),M=Hn.test(String(j.instanceId||""))?j.instanceId:"";if(!M)throw new Error("instanceId locale non disponibile");P.current=M,w(M);const[K,ne]=await Promise.all([B?O(M):pl(e),bg(e,[]).catch(()=>({nodes:[]}))]),le={instanceId:M,route:[],label:"Local"},fe=K.decks.map(pe=>Hs(pe,le,ne.nodes,!0,!0)),ge=x.current;return await Promise.all(k.current.map(async pe=>{if(pe.status!=="up"){fe.push(...ge.filter(we=>!we.local&&we.ownerId===pe.instanceId).map(we=>({...we,ownerRoute:[...pe.route],ownerLabel:pe.label,available:!1})));return}try{const[we,He]=await Promise.all([pl(e,pe.route),bg(e,pe.route).catch(()=>({nodes:[]}))]);fe.push(...we.decks.map(ht=>Hs(ht,pe,He.nodes,!1,!0)))}catch{fe.push(...ge.filter(He=>!He.local&&He.ownerId===pe.instanceId).map(He=>({...He,ownerRoute:[...pe.route],ownerLabel:pe.label,available:!1})))}})),fe.sort((pe,we)=>pe.local===we.local?pe.ownerLabel.localeCompare(we.ownerLabel)||(pe.name==="main"?-1:we.name==="main"?1:pe.name.localeCompare(we.name)):pe.local?-1:1),fe},[e,O,Z]);N.useEffect(()=>{if(!e)return;let B=!1;const j=G.current!==e;return G.current=e,I({migrate:j}).then(M=>{if(B)return;const K=x.current.find(fe=>fe.id===E.current),ne=M.find(fe=>fe.id===E.current),le=ne&&(!K||ne.revision>K.revision||K.available!==ne.available||Hd(K.ownerRoute)!==Hd(ne.ownerRoute));Q(M,j||!!le&&!D.current),f(!0),ne&&y("")}).catch(M=>{B||(f(!0),y(String(M.message||M)))}),()=>{B=!0}},[Q,I,Z,e]);const C=N.useCallback(async(B=E.current)=>{if(!h||!D.current)return!0;const j=x.current.find(M=>M.id===B);if(!j)return y(`deck inesistente: ${B}`),!1;if(j.available===!1)return y(`nodo owner offline: ${j.ownerLabel}`),!1;v("saving");try{const M=qv(Ys(F.current),j.ownerId,j.ownerTopology),K=await ml(e,j.name,M,j.revision,j.ownerRoute),ne=Hs(K,zo(j),j.ownerTopology,j.local,!0);return Q(x.current.map(le=>le.id===B?ne:le),!1),D.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(M){if(v("error"),y(String(M.message||M)),M.status===409&&M.data&&M.data.current){const K=x.current.find(le=>le.id===B),ne=Hs(M.data.current,zo(K),K.ownerTopology,K.local,!0);Q(x.current.map(le=>le.id===B?ne:le),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(V.current){V.current=!1;return}D.current=!0,v("saving");const B=setTimeout(C,650);return()=>clearTimeout(B)},[n,h,C]),N.useEffect(()=>{if(!h)return;const B=setInterval(async()=>{try{const j=await I(),M=x.current.find(le=>le.id===E.current),K=j.find(le=>le.id===E.current),ne=K&&(!M||K.revision>M.revision||M.available!==K.available);Q(j,ne&&!D.current)}catch{}},5e3);return()=>clearInterval(B)},[h,I,Q]),{decks:a,records:a,localNodeId:S,ready:h,saveState:m,error:b,setError:y,saveNow:C,select:async B=>{if(D.current&&!await C(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const j=x.current.find(M=>M.id===B);if(!j)throw new Error(`deck inesistente: ${B}`);return D.current=!1,V.current=!0,X(j)},add:async(B,j=null)=>{const M=j===Si?x.current.find(le=>le.local):j?x.current.find(le=>le.ownerId===j):null;if(!M||M.available===!1)throw new Error("nodo owner non disponibile");const K=await Cg(e,B,M.ownerRoute),ne=Hs(K,zo(M),M.ownerTopology,M.local,!0);return Q([...x.current,ne],!1),ne},rename:async(B,j)=>{const M=x.current.find(ge=>ge.id===B);if(!M)throw new Error("deck inesistente");if(B===E.current&&D.current&&!await C(B))throw new Error(`salvataggio di "${M.name}" fallito: rinomina annullata`);const K=x.current.find(ge=>ge.id===B);if(!K)throw new Error("deck inesistente");const ne=await Q0(e,K.name,j,K.revision,K.ownerRoute),le=Hs(ne,zo(K),K.ownerTopology,K.local,!0),fe=K.local?Si:K.ownerId;return pd(hN(xl(),fe,B,le.id)),Q(x.current.map(ge=>ge.id===B?le:ge),!1),le},remove:async B=>{const j=x.current.find(K=>K.id===B);if(!j)throw new Error("deck inesistente");B===E.current&&(D.current=!1),await J0(e,j.name,j.revision,j.ownerRoute);const M=j.local?Si:j.ownerId;pd(fN(xl(),M,B)),Q(x.current.filter(K=>K.id!==B),!1)},reorder:(B,j)=>{const M=x.current.find(pe=>pe.id===B),K=x.current.find(pe=>pe.id===j);if(!M||!K)return!1;const ne=M.local?Si:M.ownerId,le=K.local?Si:K.ownerId;if(ne!==le)return!1;const fe=x.current.filter(pe=>(pe.local?Si:pe.ownerId)===ne).map(pe=>pe.id),ge=pd(dN(xl(),ne,B,j,fe));return Q(Yv(x.current,ge),!1),!0},addTileTo:async(B,j)=>{const M=x.current.find(pe=>pe.id===B);if(!M)throw new Error("deck inesistente");if(M.available===!1)throw new Error(`nodo owner offline: ${M.ownerLabel}`);const K=Aw(j,P.current,k.current);if(!K)throw new Error("riferimento sessione non valido");const ne=X(M),le=qv(wy(ne,K),M.ownerId,M.ownerTopology),fe=await ml(e,M.name,le,M.revision,M.ownerRoute),ge=Hs(fe,zo(M),M.ownerTopology,M.local,!0);return Q(x.current.map(pe=>pe.id===B?ge:pe),!1),ge},localMainId:Lr(null,"main"),parseDeckId:sc}}const Yj="/sw.js",Hh="nc-sw-update";let Uh=null,Wh=!1,Kh=null,pb=Object.freeze({needed:!1,kind:null,version:""}),mb=!1;function gb(){typeof window<"u"&&window.dispatchEvent(new Event(Hh))}function vb(){const e=Kh||(Wh?{kind:"reload",version:""}:null);pb=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function U_(){return pb}function Gj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Hh,e),()=>window.removeEventListener(Hh,e))}function Ff(e){Wh!==e&&(Wh=e,vb(),gb())}function Xj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(Kh);Kh=s,vb(),o||gb()}function Qj(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function Jj(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{mb&&location.reload()}),navigator.serviceWorker.register(Yj).then(e=>{Uh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&Qj(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function Zj(){mb=!0,Ff(!1);const e=Uh&&Uh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function eR({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",f=u.get("pair")||"",m=f?`${t||""}${n||""}#pair=${f}`:"";return{token:h,pair:m,nextUrl:a}}const _b=9,yb=24,wb="nc_side_w",W_="nc_side_min",tR=240,K_="(min-width:1024px) and (pointer:fine)";function nR(){const e=Number(localStorage.getItem(wb));return e>=180&&e<=480?e:tR}function iR(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=_b&&e<=yb?e:13}function sR(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=eR({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function rR(e){try{return Ys(Bh(e))}catch{return Pr()}}function q_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function oR(){const[e,t]=N.useState(()=>window.matchMedia(K_).matches);return N.useEffect(()=>{const n=window.matchMedia(K_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function V_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:f=!1}){kn();const[m]=kf(),[v,b]=N.useState(!1),[y,S]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,x]=N.useState(null),[k,P]=N.useState(iR),[E,F]=N.useState(s||e),[D,V]=N.useState(""),G=$=>P(U=>{const R=Math.max(_b,Math.min(yb,U+$));return localStorage.setItem("nc_fontsize",String(R)),R}),z=N.useRef(()=>{}),Z=N.useRef(()=>!1),X=N.useRef(()=>{}),Q=N.useRef(!1),[O,I]=N.useState(!1),[C,T]=N.useState(!1),A=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const U=t?t.split("/"):[],R=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function W(){let j=null,M=null;try{const le=await(await Ht(`${R}/sessions`,o)).json();Array.isArray(le.sessions)&&(j=le.sessions.find(fe=>fe.name===e))}catch{}try{const ne=await ws(o,U);ne.available&&Array.isArray(ne.cells)&&(M=ne.cells.find(le=>le.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:M||(s?{cell:s}:null)}));let K="";M?K=`${M.engine}${M.key?`·${M.key}`:""}`:j&&(K=j.attached?`attached · ${q_(j.activity)}`:j.activity?q_(j.activity):""),V(K)}W();const B=setInterval(W,4e3);return()=>{$=!1,clearInterval(B)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:p("sessions"),children:[c.jsx(Ze,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),D&&c.jsx("small",{className:"nc-bar-sub",children:D})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>G(-1),title:p("zoom-out"),children:c.jsx(Ze,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>G(1),title:p("zoom-in"),children:c.jsx(Ze,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>S($=>!$),title:p("composer"),children:c.jsx(Ze,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>b($=>!$),title:p("files"),children:c.jsx(Ze,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(vw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:z,composerRef:Z,actionRef:X,ctrlRef:Q,setCtrlArmed:I,onFiles:x,fontSize:k,selectionMode:C,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(TE,{onKeyboard:()=>S($=>!$),onCellSwitcher:h,cellSwitcherOpen:f,send:$=>z.current($),action:$=>X.current($),ctrlArmed:O,onCtrl:A,selectionMode:C,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(Nw,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(_w,{session:e,node:t,token:o,filesEvent:w,onClose:()=>b(!1)})]})}function aR(){kn();const[e]=N.useState(sR),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),f=oR(),[m]=N.useState(()=>lN(typeof location<"u"?location.pathname:"/")),[v,b]=N.useState(m.id),y=v===Lr(null,Un),[S,w]=N.useState(null),x=ue=>{const je=ys(ue);w(je?{...je,...typeof(ue==null?void 0:ue.cellName)=="string"&&ue.cellName?{cellName:ue.cellName}:{}}:null)},[k,P]=N.useState([]),[E,F]=N.useState([]),[D,V]=N.useState([]),[G,z]=N.useState(()=>m.ownerId?Pr():rR(m.name)),[Z,X]=N.useState(null),[Q,O]=N.useState(null),I=ue=>O(ys(ue)),[C,T]=N.useState(null),A=nf(t,f),$=N.useMemo(()=>(A||[]).filter(ue=>ue.instanceId).map(ue=>({instanceId:ue.instanceId,route:ue.route,label:ue.label,status:ue.status})),[A]),U=Vj(t,v,G,z,$),R=U.decks;N.useEffect(()=>{const ue=new Map;for(const je of A||[]){const qe=(je.route||[je.name]).join("/"),pt=new Set((je.sessions||[]).map(_t=>_t.name));for(const _t of je.cells||[])!_t.cell||!_t.tmuxSession||_t.cell===_t.tmuxSession||pt.has(_t.cell)||ue.set(`${qe}:${_t.cell}`,`${qe}:${_t.tmuxSession}`)}z(je=>Nx(je,ue))},[A]),N.useEffect(()=>{U.localNodeId&&z(ue=>{const je=Oh(ue,U.localNodeId,$);return JSON.stringify(je)===JSON.stringify(ue)?ue:je})},[$,U.localNodeId]);const[W,B]=N.useState(null),[j,M]=N.useState(null),K=N.useRef(0),[ne,le]=N.useState(!1),[fe,ge]=N.useState(nR),[pe,we]=N.useState(!y),[He,ht]=N.useState(()=>y?localStorage.getItem(W_)==="1":!0),[Ye,Ae]=N.useState(!1),[Ne,ut]=N.useState("nodes"),[Pe,Ut]=N.useState(!1),[Rt,Dt]=N.useState(""),[vt,ft]=N.useState(!1),dt=(ue="nodes",je=!1,qe="")=>{ut(ue),Ut(je),Dt(qe),Ae(!0)},[re,xe]=N.useState(!1),[Oe,Fe]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[de,ze]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(wb,String(fe))}catch{}},[fe]),N.useEffect(()=>{try{localStorage.setItem(W_,He?"1":"")}catch{}},[He]),N.useEffect(()=>{if(!t)return;let ue=!1;return Promise.all([ny(t),Ht("/api/config",t).then(je=>je.json())]).then(([je,qe])=>{ue||(Fe({deviceDefault:je.deviceName||"",localNodeId:je.nodeId||"",localNameDefault:je.localName||""}),ze(!!qe.readonlyDefault),(je.firstRun===!0&&!qe.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{ue=!0}},[t,s]);const q=N.useCallback(async()=>{try{const je=await(await Ht("/api/sessions",t)).json();je.error||P(je.sessions||[])}catch{}try{const ue=await ws(t);F(ue.available?ue.cells||[]:[]),V(ue.available?ue.capabilities||[]:[])}catch{F([]),V([])}},[t]);N.useEffect(()=>{if(!f)return;q();const ue=setInterval(q,4e3);return()=>clearInterval(ue)},[f,q]),N.useEffect(()=>{let ue=!1;return Ht("/api/config",t).then(je=>je.json()).then(je=>{ue||Xj(je.version,je.uiVersion,"0.8.52-rc.8")}).catch(()=>{}),()=>{ue=!0}},[t]);const te=new Set([...k.map(ue=>ue.name),...A.flatMap(ue=>ue.sessions.map(je=>je.key))]),H=ki(G),ae=ue=>z(je=>{const qe=Aw(ue,U.localNodeId,$)||ue,pt=wy(je,qe);return pt===je&&ki(je).length>=9&&U.setError(p("grid-full")),pt}),ce=async(ue,je=[])=>{try{await Xh(t,ue,je)}catch{return}const qe=je.length?`${je.join("/")}:${ue}`:ue;z(pt=>Hl(pt,qe)),q()},me=async(ue,je,qe=[])=>{try{await ty(t,ue,je,qe)}catch{return}q()},Te=async(ue,je,qe=[])=>{await J_(t,{cell:ue,enabled:!!je},qe),q()},_e=async ue=>{if(!W)return;const{cell:je}=W,qe=Array.isArray(W.route)?W.route:[];if(ue.action==="up"){const _t=await Yh(t,{cell:je,boot:!!ue.boot,...ue.engine?{engine:ue.engine}:{},...ue.model!==void 0?{model:ue.model}:{},...ue.permissionPolicy?{permissionPolicy:ue.permissionPolicy}:{}},qe),bs=uf(_t);bs&&U.setError(bs.text)}else await Il(t,{cell:je,boot:!!ue.boot},qe);const pt=ue.action==="up"?!!ue.boot:ue.boot?!1:!!W.boot;M({id:++K.current,cell:je,route:qe,enabled:pt}),q()},Ce=N.useCallback(ue=>{M(je=>(je==null?void 0:je.id)===ue?null:je)},[]),nt=async ue=>{if(!(!(ue!=null&&ue.direct)||ne)){le(!0);try{await ef(t,ue.name,ue.tunnelStatus==="up"?"down":"up")}finally{le(!1)}}},ot=async(ue,je)=>{const qe=String(je||"").trim();return!(ue!=null&&ue.direct)||!Mr(qe)?!1:(await ry(t,ue.name,qe),!0)},Je=ue=>{const je=R.find(qe=>qe.id===ue);if(!je)return!1;try{const qe=window.open(fd(je,t),"_blank");return qe&&(qe.opener=null),!!qe}catch{return!1}},Mt=async ue=>{if(!ue||ue===v)return;const je=await U.select(ue),qe=U.records.find(pt=>pt.id===ue);b(ue),z(je),X(null),O(null);try{history.replaceState(null,"",fd(qe||ue,null))}catch{}},lt=async(ue,je)=>{const qe=await U.add(ue,je);await Mt(qe.id)},et=async(ue,je)=>{const qe=await U.rename(ue,je);if(ue===v){b(qe.id),z(Oh(qe.layout,U.localNodeId,$)),X(null),O(null);try{history.replaceState(null,"",fd(qe,null))}catch{}}},Zt=async ue=>{await U.remove(ue),ue===v&&await Mt(U.localMainId)},ni=async(ue,je)=>{!je||je===v||(await U.addTileTo(je,ue),z(qe=>Hl(qe,ue)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:p("auth-prompt")}),c.jsx("input",{onChange:ue=>n(ue.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:ue=>h(ue.target.checked)})," ",p("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Ye&&c.jsx(Rj,{token:t,initialTab:Ne,initialLocation:Rt,startNewCell:Pe,onClose:()=>{Ae(!1),Ut(!1),Dt("")}}),re&&c.jsx(Pj,{token:t,initialPair:s,...Oe,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(Ij,{token:t})]});if(!f)return C?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx(H_,{peer:C,token:t,onBack:()=>T(null)})}),Wn]}):S?c.jsxs(c.Fragment,{children:[c.jsx(V_,{session:S.session,node:S.node,ownerId:S.ownerId,cellName:S.cellName,token:t,readonly:de,onBack:()=>w(null),onCellSwitcher:()=>ft(!0),cellSwitcherOpen:vt}),vt&&c.jsx(Hj,{token:t,current:S,onPick:ue=>{x(ue),ft(!1)},onClose:()=>ft(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx(Wx,{onPick:x,token:t,onSettings:dt,onOpenVlSession:T}),Wn]});const ui=y||!pe;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(XE,{sessions:k,cells:E,activeSessions:H,nodeGroups:A,fleetCapabilities:D,bootSettlement:j,onBootSettlementApplied:Ce,localNodeId:U.localNodeId,onPick:I,onAddTile:ae,onPower:B,onBoot:Te,onBootError:ue=>U.setError(String((ue==null?void 0:ue.message)||ue)),onNodePower:nt,onNodeRename:ot,onKill:ce,onVisibility:me,onNew:()=>dt("fleet",!0),onSettings:dt,onOpenVlSession:T,width:fe,collapsed:He,onResize:ge,onToggleCollapse:()=>ht(ue=>!ue)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(LN,{decks:R,currentDeck:v,onCreate:lt,onRename:et,onDelete:Zt,onReorder:U.reorder,onOpenWindow:Je,onNavigate:Mt,saveState:U.saveState,error:U.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>we(ue=>!ue)}),c.jsx(iN,{layout:G,onLayoutChange:z,token:t,readonly:de,sessionsAlive:te,focusSession:Z,onFocus:X,onOpenSingle:I,decks:R,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:A})]}),C&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(H_,{peer:C,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(V_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:A}),token:t,readonly:de,onBack:()=>O(null)})}),W&&c.jsx(Bl,{cell:W,token:t,route:Array.isArray(W.route)?W.route:[],onConfirm:_e,onClose:()=>B(null)}),Wn]})}function lR(){kn();const e=N.useSyncExternalStore(Gj,U_,U_);if(!e.needed)return null;const t=e.kind==="install"?p("install-version-mismatch").replace("{v}",e.version):p("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:Zj,children:p("reload")})]})}Jj();p0.createRoot(document.getElementById("root")).render(c.jsxs(a0.StrictMode,{children:[c.jsx(aR,{}),c.jsx(lR,{})]}));
|