herdr-remote-relay 0.2.11 → 0.2.13
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.
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var Vg=Object.defineProperty;var Zg=(o,s,r)=>s in o?Vg(o,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[s]=r;var Fe=(o,s,r)=>Zg(o,typeof s!="symbol"?s+"":s,r);import{r as Fh,g as Jh,a as Ih}from"./vendor-react-CYSfZuHu.js";import{r as Qg,a as Fg,b as Jg,c as Ig}from"./vendor-xterm-Bldps5fz.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const b of m.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&c(b)}).observe(document,{childList:!0,subtree:!0});function r(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(f){if(f.ep)return;f.ep=!0;const m=r(f);fetch(f.href,m)}})();var Xc={exports:{}},Ji={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var uh;function Wg(){if(uh)return Ji;uh=1;var o=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,f,m){var b=null;if(m!==void 0&&(b=""+m),f.key!==void 0&&(b=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:o,type:c,key:b,ref:f!==void 0?f:null,props:m}}return Ji.Fragment=s,Ji.jsx=r,Ji.jsxs=r,Ji}var dh;function $g(){return dh||(dh=1,Xc.exports=Wg()),Xc.exports}var u=$g(),x=Fh();const Sl=Jh(x);var Vc={exports:{}},Ii={},Zc={exports:{}},Qc={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* scheduler.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var fh;function Pg(){return fh||(fh=1,(function(o){function s(M,X){var W=M.length;M.push(X);e:for(;0<W;){var ue=W-1>>>1,K=M[ue];if(0<f(K,X))M[ue]=X,M[W]=K,W=ue;else break e}}function r(M){return M.length===0?null:M[0]}function c(M){if(M.length===0)return null;var X=M[0],W=M.pop();if(W!==X){M[0]=W;e:for(var ue=0,K=M.length,Me=K>>>1;ue<Me;){var ze=2*(ue+1)-1,Ce=M[ze],Oe=ze+1,we=M[Oe];if(0>f(Ce,W))Oe<K&&0>f(we,Ce)?(M[ue]=we,M[Oe]=W,ue=Oe):(M[ue]=Ce,M[ze]=W,ue=ze);else if(Oe<K&&0>f(we,W))M[ue]=we,M[Oe]=W,ue=Oe;else break e}}return X}function f(M,X){var W=M.sortIndex-X.sortIndex;return W!==0?W:M.id-X.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;o.unstable_now=function(){return m.now()}}else{var b=Date,p=b.now();o.unstable_now=function(){return b.now()-p}}var y=[],S=[],g=1,T=null,B=3,O=!1,L=!1,V=!1,k=!1,Q=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function oe(M){for(var X=r(S);X!==null;){if(X.callback===null)c(S);else if(X.startTime<=M)c(S),X.sortIndex=X.expirationTime,s(y,X);else break;X=r(S)}}function ce(M){if(V=!1,oe(M),!L)if(r(y)!==null)L=!0,Y||(Y=!0,me());else{var X=r(S);X!==null&&Te(ce,X.startTime-M)}}var Y=!1,_=-1,R=5,ae=-1;function Ee(){return k?!0:!(o.unstable_now()-ae<R)}function Se(){if(k=!1,Y){var M=o.unstable_now();ae=M;var X=!0;try{e:{L=!1,V&&(V=!1,P(_),_=-1),O=!0;var W=B;try{t:{for(oe(M),T=r(y);T!==null&&!(T.expirationTime>M&&Ee());){var ue=T.callback;if(typeof ue=="function"){T.callback=null,B=T.priorityLevel;var K=ue(T.expirationTime<=M);if(M=o.unstable_now(),typeof K=="function"){T.callback=K,oe(M),X=!0;break t}T===r(y)&&c(y),oe(M)}else c(y);T=r(y)}if(T!==null)X=!0;else{var Me=r(S);Me!==null&&Te(ce,Me.startTime-M),X=!1}}break e}finally{T=null,B=W,O=!1}X=void 0}}finally{X?me():Y=!1}}}var me;if(typeof J=="function")me=function(){J(Se)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,pe=Z.port2;Z.port1.onmessage=Se,me=function(){pe.postMessage(null)}}else me=function(){Q(Se,0)};function Te(M,X){_=Q(function(){M(o.unstable_now())},X)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(M){M.callback=null},o.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<M?Math.floor(1e3/M):5},o.unstable_getCurrentPriorityLevel=function(){return B},o.unstable_next=function(M){switch(B){case 1:case 2:case 3:var X=3;break;default:X=B}var W=B;B=X;try{return M()}finally{B=W}},o.unstable_requestPaint=function(){k=!0},o.unstable_runWithPriority=function(M,X){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var W=B;B=M;try{return X()}finally{B=W}},o.unstable_scheduleCallback=function(M,X,W){var ue=o.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ue+W:ue):W=ue,M){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=W+K,M={id:g++,callback:X,priorityLevel:M,startTime:W,expirationTime:K,sortIndex:-1},W>ue?(M.sortIndex=W,s(S,M),r(y)===null&&M===r(S)&&(V?(P(_),_=-1):V=!0,Te(ce,W-ue))):(M.sortIndex=K,s(y,M),L||O||(L=!0,Y||(Y=!0,me()))),M},o.unstable_shouldYield=Ee,o.unstable_wrapCallback=function(M){var X=B;return function(){var W=B;B=X;try{return M.apply(this,arguments)}finally{B=W}}}})(Qc)),Qc}var mh;function ey(){return mh||(mh=1,Zc.exports=Pg()),Zc.exports}/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom-client.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var hh;function ty(){if(hh)return Ii;hh=1;var o=ey(),s=Fh(),r=Ih();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function b(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(m(e)!==e)throw Error(c(188))}function S(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return y(a),e;if(i===l)return y(a),t;i=i.sibling}throw Error(c(188))}if(n.return!==l.return)n=a,l=i;else{for(var d=!1,h=a.child;h;){if(h===n){d=!0,n=a,l=i;break}if(h===l){d=!0,l=a,n=i;break}h=h.sibling}if(!d){for(h=i.child;h;){if(h===n){d=!0,n=i,l=a;break}if(h===l){d=!0,l=i,n=a;break}h=h.sibling}if(!d)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,B=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),J=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),Ee=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=Se&&e[Se]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function pe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case Q:return"Profiler";case k:return"StrictMode";case ce:return"Suspense";case Y:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case J:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case oe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var Te=Array.isArray,M=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},ue=[],K=-1;function Me(e){return{current:e}}function ze(e){0>K||(e.current=ue[K],ue[K]=null,K--)}function Ce(e,t){K++,ue[K]=e.current,e.current=t}var Oe=Me(null),we=Me(null),xe=Me(null),$e=Me(null);function bt(e,t){switch(Ce(xe,t),Ce(we,e),Ce(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?km(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=km(t),e=Dm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ze(Oe),Ce(Oe,e)}function je(){ze(Oe),ze(we),ze(xe)}function ct(e){e.memoizedState!==null&&Ce($e,e);var t=Oe.current,n=Dm(t,e.type);t!==n&&(Ce(we,e),Ce(Oe,n))}function lt(e){we.current===e&&(ze(Oe),ze(we)),$e.current===e&&(ze($e),Vi._currentValue=W)}var ut,wt;function st(e){if(ut===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ut=t&&t[1]||"",wt=-1<n.stack.indexOf(`
|
|
26
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
27
|
-
`+ut+e+wt}var dt=!1;function kt(e,t){if(!e||dt)return"";dt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(z){var j=z}Reflect.construct(e,[],q)}else{try{q.call()}catch(z){j=z}e.call(q.prototype)}}else{try{throw Error()}catch(z){j=z}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(z){if(z&&j&&typeof z.stack=="string")return[z.stack,j.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],h=i[1];if(d&&h){var v=d.split(`
|
|
28
|
-
`),A=h.split(`
|
|
29
|
-
`);for(a=l=0;l<v.length&&!v[l].includes("DetermineComponentFrameRoot");)l++;for(;a<A.length&&!A[a].includes("DetermineComponentFrameRoot");)a++;if(l===v.length||a===A.length)for(l=v.length-1,a=A.length-1;1<=l&&0<=a&&v[l]!==A[a];)a--;for(;1<=l&&0<=a;l--,a--)if(v[l]!==A[a]){if(l!==1||a!==1)do if(l--,a--,0>a||v[l]!==A[a]){var U=`
|
|
30
|
-
`+v[l].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=l&&0<=a);break}}}finally{dt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?st(n):""}function Qt(e,t){switch(e.tag){case 26:case 27:case 5:return st(e.type);case 16:return st("Lazy");case 13:return e.child!==t&&t!==null?st("Suspense Fallback"):st("Suspense");case 19:return st("SuspenseList");case 0:case 15:return kt(e.type,!1);case 11:return kt(e.type.render,!1);case 1:return kt(e.type,!0);case 31:return st("Activity");default:return""}}function gt(e){try{var t="",n=null;do t+=Qt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
31
|
-
Error generating stack: `+l.message+`
|
|
32
|
-
`+l.stack}}var mn=Object.prototype.hasOwnProperty,Ft=o.unstable_scheduleCallback,yt=o.unstable_cancelCallback,Wn=o.unstable_shouldYield,Gt=o.unstable_requestPaint,ee=o.unstable_now,ve=o.unstable_getCurrentPriorityLevel,_e=o.unstable_ImmediatePriority,He=o.unstable_UserBlockingPriority,an=o.unstable_NormalPriority,$n=o.unstable_LowPriority,qt=o.unstable_IdlePriority,Hn=o.log,Yn=o.unstable_setDisableYieldValue,Kn=null,Ot=null;function hn(e){if(typeof Hn=="function"&&Yn(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(Kn,e)}catch{}}var Ut=Math.clz32?Math.clz32:ga,ii=Math.log,si=Math.LN2;function ga(e){return e>>>=0,e===0?32:31-(ii(e)/si|0)|0}var Pn=256,zn=262144,Gn=4194304;function Jt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function el(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~i,l!==0?a=Jt(l):(d&=h,d!==0?a=Jt(d):n||(n=h&~e,n!==0&&(a=Jt(n))))):(h=l&~i,h!==0?a=Jt(h):d!==0?a=Jt(d):n||(n=l&~e,n!==0&&(a=Jt(n)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function H(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function D(){var e=Gn;return Gn<<=1,(Gn&62914560)===0&&(Gn=4194304),e}function I(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function te(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function he(e,t,n,l,a,i){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var h=e.entanglements,v=e.expirationTimes,A=e.hiddenUpdates;for(n=d&~n;0<n;){var U=31-Ut(n),q=1<<U;h[U]=0,v[U]=-1;var j=A[U];if(j!==null)for(A[U]=null,U=0;U<j.length;U++){var z=j[U];z!==null&&(z.lane&=-536870913)}n&=~q}l!==0&&F(e,l,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function F(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Ut(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Ut(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function De(e,t){var n=t&-t;return n=(n&42)!==0?1:ot(n),(n&(e.suspendedLanes|t))!==0?0:n}function ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ct(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:lh(e.type))}function _n(e,t){var n=X.p;try{return X.p=e,t()}finally{X.p=n}}var pn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+pn,Xt="__reactProps$"+pn,wl="__reactContainer$"+pn,Vt="__reactEvents$"+pn,Lo="__reactListeners$"+pn,Oo="__reactHandles$"+pn,Cl="__reactResources$"+pn,It="__reactMarker$"+pn;function ya(e){delete e[Mt],delete e[Xt],delete e[Vt],delete e[Lo],delete e[Oo]}function tl(e){var t=e[Mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wl]||n[Mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Km(e);e!==null;){if(n=e[Mt])return n;e=Km(e)}return t}e=n,n=e.parentNode}return null}function kn(e){if(e=e[Mt]||e[wl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Dn(e){var t=e[Cl];return t||(t=e[Cl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[It]=!0}var oi=new Set,ne={};function de(e,t){qe(e,t),qe(e+"Capture",t)}function qe(e,t){for(ne[e]=t,e=0;e<t.length;e++)oi.add(t[e])}var bn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gn={},Xn={};function be(e){return mn.call(Xn,e)?!0:mn.call(gn,e)?!1:bn.test(e)?Xn[e]=!0:(gn[e]=!0,!1)}function Dt(e,t,n){if(be(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Tt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uo(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function va(e){if(!e._valueTracker){var t=Vn(e)?"checked":"value";e._valueTracker=Uo(e,t,""+e[t])}}function Nu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Vn(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function us(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Hp=/[\n"\\]/g;function yn(e){return e.replace(Hp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bo(e,t,n,l,a,i,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Ho(e,d,Nt(t)):n!=null?Ho(e,d,Nt(n)):l!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+Nt(h):e.removeAttribute("name")}function Eu(e,t,n,l,a,i,d,h){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){va(e);return}n=n!=null?""+Nt(n):"",t=t!=null?""+Nt(t):n,h||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=h?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),va(e)}function Ho(e,t,n){t==="number"&&us(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function xa(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Nt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Au(e,t,n){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nt(n):""}function ju(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(Te(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Nt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),va(e)}function Sa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ru(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Yp.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Mu(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&Ru(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&Ru(e,i,t[i])}function Yo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Gp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ds(e){return Gp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nl(){}var Ko=null;function Go(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wa=null,Ca=null;function zu(e){var t=kn(e);if(t&&(e=t.stateNode)){var n=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Bo(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+yn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[Xt]||null;if(!a)throw Error(c(90));Bo(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Nu(l)}break e;case"textarea":Au(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&xa(e,!!n.multiple,t,!1)}}}var qo=!1;function _u(e,t,n){if(qo)return e(t,n);qo=!0;try{var l=e(t);return l}finally{if(qo=!1,(wa!==null||Ca!==null)&&($s(),wa&&(t=wa,e=Ca,Ca=wa=null,zu(t),e)))for(t=0;t<e.length;t++)zu(e[t])}}function ri(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Xt]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var ll=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xo=!1;if(ll)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Xo=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Xo=!1}var Tl=null,Vo=null,fs=null;function ku(){if(fs)return fs;var e,t=Vo,n=t.length,l,a="value"in Tl?Tl.value:Tl.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===a[i-l];l++);return fs=a.slice(e,1<l?1-l:void 0)}function ms(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hs(){return!0}function Du(){return!1}function $t(e){function t(n,l,a,i,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hs:Du,this.isPropagationStopped=Du,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ps=$t(Il),ui=T({},Il,{view:0,detail:0}),qp=$t(ui),Zo,Qo,di,bs=T({},ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==di&&(di&&e.type==="mousemove"?(Zo=e.screenX-di.screenX,Qo=e.screenY-di.screenY):Qo=Zo=0,di=e),Zo)},movementY:function(e){return"movementY"in e?e.movementY:Qo}}),Lu=$t(bs),Xp=T({},bs,{dataTransfer:0}),Vp=$t(Xp),Zp=T({},ui,{relatedTarget:0}),Fo=$t(Zp),Qp=T({},Il,{animationName:0,elapsedTime:0,pseudoElement:0}),Fp=$t(Qp),Jp=T({},Il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ip=$t(Jp),Wp=T({},Il,{data:0}),Ou=$t(Wp),$p={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pp={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"},eb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eb[e])?!!t[e]:!1}function Jo(){return tb}var nb=T({},ui,{key:function(e){if(e.key){var t=$p[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jo,charCode:function(e){return e.type==="keypress"?ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lb=$t(nb),ab=T({},bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uu=$t(ab),ib=T({},ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jo}),sb=$t(ib),ob=T({},Il,{propertyName:0,elapsedTime:0,pseudoElement:0}),rb=$t(ob),cb=T({},bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ub=$t(cb),db=T({},Il,{newState:0,oldState:0}),fb=$t(db),mb=[9,13,27,32],Io=ll&&"CompositionEvent"in window,fi=null;ll&&"documentMode"in document&&(fi=document.documentMode);var hb=ll&&"TextEvent"in window&&!fi,Bu=ll&&(!Io||fi&&8<fi&&11>=fi),Hu=" ",Yu=!1;function Ku(e,t){switch(e){case"keyup":return mb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ta=!1;function pb(e,t){switch(e){case"compositionend":return Gu(t);case"keypress":return t.which!==32?null:(Yu=!0,Hu);case"textInput":return e=t.data,e===Hu&&Yu?null:e;default:return null}}function bb(e,t){if(Ta)return e==="compositionend"||!Io&&Ku(e,t)?(e=ku(),fs=Vo=Tl=null,Ta=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bu&&t.locale!=="ko"?null:t.data;default:return null}}var gb={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 qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gb[e.type]:t==="textarea"}function Xu(e,t,n,l){wa?Ca?Ca.push(l):Ca=[l]:wa=l,t=io(t,"onChange"),0<t.length&&(n=new ps("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var mi=null,hi=null;function yb(e){Am(e,0)}function gs(e){var t=qn(e);if(Nu(t))return e}function Vu(e,t){if(e==="change")return t}var Zu=!1;if(ll){var Wo;if(ll){var $o="oninput"in document;if(!$o){var Qu=document.createElement("div");Qu.setAttribute("oninput","return;"),$o=typeof Qu.oninput=="function"}Wo=$o}else Wo=!1;Zu=Wo&&(!document.documentMode||9<document.documentMode)}function Fu(){mi&&(mi.detachEvent("onpropertychange",Ju),hi=mi=null)}function Ju(e){if(e.propertyName==="value"&&gs(hi)){var t=[];Xu(t,hi,e,Go(e)),_u(yb,t)}}function vb(e,t,n){e==="focusin"?(Fu(),mi=t,hi=n,mi.attachEvent("onpropertychange",Ju)):e==="focusout"&&Fu()}function xb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gs(hi)}function Sb(e,t){if(e==="click")return gs(t)}function wb(e,t){if(e==="input"||e==="change")return gs(t)}function Cb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:Cb;function pi(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!mn.call(t,a)||!sn(e[a],t[a]))return!1}return!0}function Iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wu(e,t){var n=Iu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Iu(n)}}function $u(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$u(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=us(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=us(e.document)}return t}function Po(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Tb=ll&&"documentMode"in document&&11>=document.documentMode,Na=null,er=null,bi=null,tr=!1;function ed(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tr||Na==null||Na!==us(l)||(l=Na,"selectionStart"in l&&Po(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),bi&&pi(bi,l)||(bi=l,l=io(er,"onSelect"),0<l.length&&(t=new ps("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Na)))}function Wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ea={animationend:Wl("Animation","AnimationEnd"),animationiteration:Wl("Animation","AnimationIteration"),animationstart:Wl("Animation","AnimationStart"),transitionrun:Wl("Transition","TransitionRun"),transitionstart:Wl("Transition","TransitionStart"),transitioncancel:Wl("Transition","TransitionCancel"),transitionend:Wl("Transition","TransitionEnd")},nr={},td={};ll&&(td=document.createElement("div").style,"AnimationEvent"in window||(delete Ea.animationend.animation,delete Ea.animationiteration.animation,delete Ea.animationstart.animation),"TransitionEvent"in window||delete Ea.transitionend.transition);function $l(e){if(nr[e])return nr[e];if(!Ea[e])return e;var t=Ea[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in td)return nr[e]=t[n];return e}var nd=$l("animationend"),ld=$l("animationiteration"),ad=$l("animationstart"),Nb=$l("transitionrun"),Eb=$l("transitionstart"),Ab=$l("transitioncancel"),id=$l("transitionend"),sd=new Map,lr="abort auxClick beforeToggle 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(" ");lr.push("scrollEnd");function Ln(e,t){sd.set(e,t),de(t,[e])}var ys=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],Aa=0,ar=0;function vs(){for(var e=Aa,t=ar=Aa=0;t<e;){var n=vn[t];vn[t++]=null;var l=vn[t];vn[t++]=null;var a=vn[t];vn[t++]=null;var i=vn[t];if(vn[t++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}i!==0&&od(n,a,i)}}function xs(e,t,n,l){vn[Aa++]=e,vn[Aa++]=t,vn[Aa++]=n,vn[Aa++]=l,ar|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ir(e,t,n,l){return xs(e,t,n,l),Ss(e)}function Pl(e,t){return xs(e,null,null,t),Ss(e)}function od(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,l=i.alternate,l!==null&&(l.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-Ut(n),e=i.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),i):null}function Ss(e){if(50<Bi)throw Bi=0,hc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ja={};function jb(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function on(e,t,n,l){return new jb(e,t,n,l)}function sr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function al(e,t){var n=e.alternate;return n===null?(n=on(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function rd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ws(e,t,n,l,a,i){var d=0;if(l=e,typeof e=="function")sr(e)&&(d=1);else if(typeof e=="string")d=kg(e,n,Oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=on(31,n,t,a),e.elementType=ae,e.lanes=i,e;case V:return ea(n.children,a,i,t);case k:d=8,a|=24;break;case Q:return e=on(12,n,t,a|2),e.elementType=Q,e.lanes=i,e;case ce:return e=on(13,n,t,a),e.elementType=ce,e.lanes=i,e;case Y:return e=on(19,n,t,a),e.elementType=Y,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:d=10;break e;case P:d=9;break e;case oe:d=11;break e;case _:d=14;break e;case R:d=16,l=null;break e}d=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=on(d,n,t,a),t.elementType=e,t.type=l,t.lanes=i,t}function ea(e,t,n,l){return e=on(7,e,l,t),e.lanes=n,e}function or(e,t,n){return e=on(6,e,null,t),e.lanes=n,e}function cd(e){var t=on(18,null,null,0);return t.stateNode=e,t}function rr(e,t,n){return t=on(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ud=new WeakMap;function xn(e,t){if(typeof e=="object"&&e!==null){var n=ud.get(e);return n!==void 0?n:(t={value:e,source:t,stack:gt(t)},ud.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var Ra=[],Ma=0,Cs=null,gi=0,Sn=[],wn=0,Nl=null,Zn=1,Qn="";function il(e,t){Ra[Ma++]=gi,Ra[Ma++]=Cs,Cs=e,gi=t}function dd(e,t,n){Sn[wn++]=Zn,Sn[wn++]=Qn,Sn[wn++]=Nl,Nl=e;var l=Zn;e=Qn;var a=32-Ut(l)-1;l&=~(1<<a),n+=1;var i=32-Ut(t)+a;if(30<i){var d=a-a%5;i=(l&(1<<d)-1).toString(32),l>>=d,a-=d,Zn=1<<32-Ut(t)+a|n<<a|l,Qn=i+e}else Zn=1<<i|n<<a|l,Qn=e}function cr(e){e.return!==null&&(il(e,1),dd(e,1,0))}function ur(e){for(;e===Cs;)Cs=Ra[--Ma],Ra[Ma]=null,gi=Ra[--Ma],Ra[Ma]=null;for(;e===Nl;)Nl=Sn[--wn],Sn[wn]=null,Qn=Sn[--wn],Sn[wn]=null,Zn=Sn[--wn],Sn[wn]=null}function fd(e,t){Sn[wn++]=Zn,Sn[wn++]=Qn,Sn[wn++]=Nl,Zn=t.id,Qn=t.overflow,Nl=e}var Bt=null,at=null,Ge=!1,El=null,Cn=!1,dr=Error(c(519));function Al(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yi(xn(t,e)),dr}function md(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Mt]=e,t[Xt]=l,n){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(n=0;n<Yi.length;n++)Be(Yi[n],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),Eu(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),ju(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||zm(t.textContent,n)?(l.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),l.onScroll!=null&&Be("scroll",t),l.onScrollEnd!=null&&Be("scrollend",t),l.onClick!=null&&(t.onclick=nl),t=!0):t=!1,t||Al(e,!0)}function hd(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Bt=Bt.return}}function za(e){if(e!==Bt)return!1;if(!Ge)return hd(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Rc(e.type,e.memoizedProps)),n=!n),n&&at&&Al(e),hd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));at=Ym(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));at=Ym(e)}else t===27?(t=at,Kl(e.type)?(e=Dc,Dc=null,at=e):at=t):at=Bt?Nn(e.stateNode.nextSibling):null;return!0}function ta(){at=Bt=null,Ge=!1}function fr(){var e=El;return e!==null&&(nn===null?nn=e:nn.push.apply(nn,e),El=null),e}function yi(e){El===null?El=[e]:El.push(e)}var mr=Me(null),na=null,sl=null;function jl(e,t,n){Ce(mr,t._currentValue),t._currentValue=n}function ol(e){e._currentValue=mr.current,ze(mr)}function hr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function pr(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var d=a.child;i=i.firstContext;e:for(;i!==null;){var h=i;i=a;for(var v=0;v<t.length;v++)if(h.context===t[v]){i.lanes|=n,h=i.alternate,h!==null&&(h.lanes|=n),hr(i.return,n,e),l||(d=null);break e}i=h.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(c(341));d.lanes|=n,i=d.alternate,i!==null&&(i.lanes|=n),hr(d,n,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function _a(e,t,n,l){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var h=a.type;sn(a.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(a===$e.current){if(d=a.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Vi):e=[Vi])}a=a.return}e!==null&&pr(t,e,n,l),t.flags|=262144}function Ts(e){for(e=e.firstContext;e!==null;){if(!sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function la(e){na=e,sl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return pd(na,e)}function Ns(e,t){return na===null&&la(e),pd(e,t)}function pd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sl===null){if(e===null)throw Error(c(308));sl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sl=sl.next=t;return n}var Rb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Mb=o.unstable_scheduleCallback,zb=o.unstable_NormalPriority,Et={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function br(){return{controller:new Rb,data:new Map,refCount:0}}function vi(e){e.refCount--,e.refCount===0&&Mb(zb,function(){e.controller.abort()})}var xi=null,gr=0,ka=0,Da=null;function _b(e,t){if(xi===null){var n=xi=[];gr=0,ka=xc(),Da={status:"pending",value:void 0,then:function(l){n.push(l)}}}return gr++,t.then(bd,bd),t}function bd(){if(--gr===0&&xi!==null){Da!==null&&(Da.status="fulfilled");var e=xi;xi=null,ka=0,Da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kb(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var gd=M.S;M.S=function(e,t){tm=ee(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_b(e,t),gd!==null&&gd(e,t)};var aa=Me(null);function yr(){var e=aa.current;return e!==null?e:nt.pooledCache}function Es(e,t){t===null?Ce(aa,aa.current):Ce(aa,t.pool)}function yd(){var e=yr();return e===null?null:{parent:Et._currentValue,pool:e}}var La=Error(c(460)),vr=Error(c(474)),As=Error(c(542)),js={then:function(){}};function vd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nl,nl),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wd(e),e;default:if(typeof t.status=="string")t.then(nl,nl);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wd(e),e}throw sa=t,La}}function ia(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(sa=n,La):n}}var sa=null;function Sd(){if(sa===null)throw Error(c(459));var e=sa;return sa=null,e}function wd(e){if(e===La||e===As)throw Error(c(483))}var Oa=null,Si=0;function Rs(e){var t=Si;return Si+=1,Oa===null&&(Oa=[]),xd(Oa,e,t)}function wi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ms(e,t){throw t.$$typeof===B?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cd(e){function t(N,w){if(e){var E=N.deletions;E===null?(N.deletions=[w],N.flags|=16):E.push(w)}}function n(N,w){if(!e)return null;for(;w!==null;)t(N,w),w=w.sibling;return null}function l(N){for(var w=new Map;N!==null;)N.key!==null?w.set(N.key,N):w.set(N.index,N),N=N.sibling;return w}function a(N,w){return N=al(N,w),N.index=0,N.sibling=null,N}function i(N,w,E){return N.index=E,e?(E=N.alternate,E!==null?(E=E.index,E<w?(N.flags|=67108866,w):E):(N.flags|=67108866,w)):(N.flags|=1048576,w)}function d(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function h(N,w,E,G){return w===null||w.tag!==6?(w=or(E,N.mode,G),w.return=N,w):(w=a(w,E),w.return=N,w)}function v(N,w,E,G){var fe=E.type;return fe===V?U(N,w,E.props.children,G,E.key):w!==null&&(w.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===R&&ia(fe)===w.type)?(w=a(w,E.props),wi(w,E),w.return=N,w):(w=ws(E.type,E.key,E.props,null,N.mode,G),wi(w,E),w.return=N,w)}function A(N,w,E,G){return w===null||w.tag!==4||w.stateNode.containerInfo!==E.containerInfo||w.stateNode.implementation!==E.implementation?(w=rr(E,N.mode,G),w.return=N,w):(w=a(w,E.children||[]),w.return=N,w)}function U(N,w,E,G,fe){return w===null||w.tag!==7?(w=ea(E,N.mode,G,fe),w.return=N,w):(w=a(w,E),w.return=N,w)}function q(N,w,E){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=or(""+w,N.mode,E),w.return=N,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case O:return E=ws(w.type,w.key,w.props,null,N.mode,E),wi(E,w),E.return=N,E;case L:return w=rr(w,N.mode,E),w.return=N,w;case R:return w=ia(w),q(N,w,E)}if(Te(w)||me(w))return w=ea(w,N.mode,E,null),w.return=N,w;if(typeof w.then=="function")return q(N,Rs(w),E);if(w.$$typeof===J)return q(N,Ns(N,w),E);Ms(N,w)}return null}function j(N,w,E,G){var fe=w!==null?w.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return fe!==null?null:h(N,w,""+E,G);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case O:return E.key===fe?v(N,w,E,G):null;case L:return E.key===fe?A(N,w,E,G):null;case R:return E=ia(E),j(N,w,E,G)}if(Te(E)||me(E))return fe!==null?null:U(N,w,E,G,null);if(typeof E.then=="function")return j(N,w,Rs(E),G);if(E.$$typeof===J)return j(N,w,Ns(N,E),G);Ms(N,E)}return null}function z(N,w,E,G,fe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return N=N.get(E)||null,h(w,N,""+G,fe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case O:return N=N.get(G.key===null?E:G.key)||null,v(w,N,G,fe);case L:return N=N.get(G.key===null?E:G.key)||null,A(w,N,G,fe);case R:return G=ia(G),z(N,w,E,G,fe)}if(Te(G)||me(G))return N=N.get(E)||null,U(w,N,G,fe,null);if(typeof G.then=="function")return z(N,w,E,Rs(G),fe);if(G.$$typeof===J)return z(N,w,E,Ns(w,G),fe);Ms(w,G)}return null}function se(N,w,E,G){for(var fe=null,Xe=null,re=w,Ae=w=0,Ke=null;re!==null&&Ae<E.length;Ae++){re.index>Ae?(Ke=re,re=null):Ke=re.sibling;var Ve=j(N,re,E[Ae],G);if(Ve===null){re===null&&(re=Ke);break}e&&re&&Ve.alternate===null&&t(N,re),w=i(Ve,w,Ae),Xe===null?fe=Ve:Xe.sibling=Ve,Xe=Ve,re=Ke}if(Ae===E.length)return n(N,re),Ge&&il(N,Ae),fe;if(re===null){for(;Ae<E.length;Ae++)re=q(N,E[Ae],G),re!==null&&(w=i(re,w,Ae),Xe===null?fe=re:Xe.sibling=re,Xe=re);return Ge&&il(N,Ae),fe}for(re=l(re);Ae<E.length;Ae++)Ke=z(re,N,Ae,E[Ae],G),Ke!==null&&(e&&Ke.alternate!==null&&re.delete(Ke.key===null?Ae:Ke.key),w=i(Ke,w,Ae),Xe===null?fe=Ke:Xe.sibling=Ke,Xe=Ke);return e&&re.forEach(function(Zl){return t(N,Zl)}),Ge&&il(N,Ae),fe}function ge(N,w,E,G){if(E==null)throw Error(c(151));for(var fe=null,Xe=null,re=w,Ae=w=0,Ke=null,Ve=E.next();re!==null&&!Ve.done;Ae++,Ve=E.next()){re.index>Ae?(Ke=re,re=null):Ke=re.sibling;var Zl=j(N,re,Ve.value,G);if(Zl===null){re===null&&(re=Ke);break}e&&re&&Zl.alternate===null&&t(N,re),w=i(Zl,w,Ae),Xe===null?fe=Zl:Xe.sibling=Zl,Xe=Zl,re=Ke}if(Ve.done)return n(N,re),Ge&&il(N,Ae),fe;if(re===null){for(;!Ve.done;Ae++,Ve=E.next())Ve=q(N,Ve.value,G),Ve!==null&&(w=i(Ve,w,Ae),Xe===null?fe=Ve:Xe.sibling=Ve,Xe=Ve);return Ge&&il(N,Ae),fe}for(re=l(re);!Ve.done;Ae++,Ve=E.next())Ve=z(re,N,Ae,Ve.value,G),Ve!==null&&(e&&Ve.alternate!==null&&re.delete(Ve.key===null?Ae:Ve.key),w=i(Ve,w,Ae),Xe===null?fe=Ve:Xe.sibling=Ve,Xe=Ve);return e&&re.forEach(function(Xg){return t(N,Xg)}),Ge&&il(N,Ae),fe}function tt(N,w,E,G){if(typeof E=="object"&&E!==null&&E.type===V&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case O:e:{for(var fe=E.key;w!==null;){if(w.key===fe){if(fe=E.type,fe===V){if(w.tag===7){n(N,w.sibling),G=a(w,E.props.children),G.return=N,N=G;break e}}else if(w.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===R&&ia(fe)===w.type){n(N,w.sibling),G=a(w,E.props),wi(G,E),G.return=N,N=G;break e}n(N,w);break}else t(N,w);w=w.sibling}E.type===V?(G=ea(E.props.children,N.mode,G,E.key),G.return=N,N=G):(G=ws(E.type,E.key,E.props,null,N.mode,G),wi(G,E),G.return=N,N=G)}return d(N);case L:e:{for(fe=E.key;w!==null;){if(w.key===fe)if(w.tag===4&&w.stateNode.containerInfo===E.containerInfo&&w.stateNode.implementation===E.implementation){n(N,w.sibling),G=a(w,E.children||[]),G.return=N,N=G;break e}else{n(N,w);break}else t(N,w);w=w.sibling}G=rr(E,N.mode,G),G.return=N,N=G}return d(N);case R:return E=ia(E),tt(N,w,E,G)}if(Te(E))return se(N,w,E,G);if(me(E)){if(fe=me(E),typeof fe!="function")throw Error(c(150));return E=fe.call(E),ge(N,w,E,G)}if(typeof E.then=="function")return tt(N,w,Rs(E),G);if(E.$$typeof===J)return tt(N,w,Ns(N,E),G);Ms(N,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,w!==null&&w.tag===6?(n(N,w.sibling),G=a(w,E),G.return=N,N=G):(n(N,w),G=or(E,N.mode,G),G.return=N,N=G),d(N)):n(N,w)}return function(N,w,E,G){try{Si=0;var fe=tt(N,w,E,G);return Oa=null,fe}catch(re){if(re===La||re===As)throw re;var Xe=on(29,re,null,N.mode);return Xe.lanes=G,Xe.return=N,Xe}finally{}}}var oa=Cd(!0),Td=Cd(!1),Rl=!1;function xr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ze&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=Ss(e),od(e,null,n),t}return xs(e,l,t,n),Ss(e)}function Ci(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Je(e,n)}}function wr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=d:i=i.next=d,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Cr=!1;function Ti(){if(Cr){var e=Da;if(e!==null)throw e}}function Ni(e,t,n,l){Cr=!1;var a=e.updateQueue;Rl=!1;var i=a.firstBaseUpdate,d=a.lastBaseUpdate,h=a.shared.pending;if(h!==null){a.shared.pending=null;var v=h,A=v.next;v.next=null,d===null?i=A:d.next=A,d=v;var U=e.alternate;U!==null&&(U=U.updateQueue,h=U.lastBaseUpdate,h!==d&&(h===null?U.firstBaseUpdate=A:h.next=A,U.lastBaseUpdate=v))}if(i!==null){var q=a.baseState;d=0,U=A=v=null,h=i;do{var j=h.lane&-536870913,z=j!==h.lane;if(z?(Ye&j)===j:(l&j)===j){j!==0&&j===ka&&(Cr=!0),U!==null&&(U=U.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var se=e,ge=h;j=t;var tt=n;switch(ge.tag){case 1:if(se=ge.payload,typeof se=="function"){q=se.call(tt,q,j);break e}q=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=ge.payload,j=typeof se=="function"?se.call(tt,q,j):se,j==null)break e;q=T({},q,j);break e;case 2:Rl=!0}}j=h.callback,j!==null&&(e.flags|=64,z&&(e.flags|=8192),z=a.callbacks,z===null?a.callbacks=[j]:z.push(j))}else z={lane:j,tag:h.tag,payload:h.payload,callback:h.callback,next:null},U===null?(A=U=z,v=q):U=U.next=z,d|=j;if(h=h.next,h===null){if(h=a.shared.pending,h===null)break;z=h,h=z.next,z.next=null,a.lastBaseUpdate=z,a.shared.pending=null}}while(!0);U===null&&(v=q),a.baseState=v,a.firstBaseUpdate=A,a.lastBaseUpdate=U,i===null&&(a.shared.lanes=0),Ol|=d,e.lanes=d,e.memoizedState=q}}function Nd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Ed(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Nd(n[e],t)}var Ua=Me(null),zs=Me(0);function Ad(e,t){e=bl,Ce(zs,e),Ce(Ua,t),bl=e|t.baseLanes}function Tr(){Ce(zs,bl),Ce(Ua,Ua.current)}function Nr(){bl=zs.current,ze(Ua),ze(zs)}var rn=Me(null),Tn=null;function _l(e){var t=e.alternate;Ce(xt,xt.current&1),Ce(rn,e),Tn===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Tn=e)}function Er(e){Ce(xt,xt.current),Ce(rn,e),Tn===null&&(Tn=e)}function jd(e){e.tag===22?(Ce(xt,xt.current),Ce(rn,e),Tn===null&&(Tn=e)):kl()}function kl(){Ce(xt,xt.current),Ce(rn,rn.current)}function cn(e){ze(rn),Tn===e&&(Tn=null),ze(xt)}var xt=Me(0);function _s(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_c(n)||kc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rl=0,Ne=null,Pe=null,At=null,ks=!1,Ba=!1,ra=!1,Ds=0,Ei=0,Ha=null,Db=0;function ht(){throw Error(c(321))}function Ar(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function jr(e,t,n,l,a,i){return rl=i,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?ff:qr,ra=!1,i=n(l,a),ra=!1,Ba&&(i=Md(t,n,l,a)),Rd(e),i}function Rd(e){M.H=Ri;var t=Pe!==null&&Pe.next!==null;if(rl=0,At=Pe=Ne=null,ks=!1,Ei=0,Ha=null,t)throw Error(c(300));e===null||jt||(e=e.dependencies,e!==null&&Ts(e)&&(jt=!0))}function Md(e,t,n,l){Ne=e;var a=0;do{if(Ba&&(Ha=null),Ei=0,Ba=!1,25<=a)throw Error(c(301));if(a+=1,At=Pe=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}M.H=mf,i=t(n,l)}while(Ba);return i}function Lb(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Ai(t):t,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(Ne.flags|=1024),t}function Rr(){var e=Ds!==0;return Ds=0,e}function Mr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function zr(e){if(ks){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ks=!1}rl=0,At=Pe=Ne=null,Ba=!1,Ei=Ds=0,Ha=null}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?Ne.memoizedState=At=e:At=At.next=e,At}function St(){if(Pe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=At===null?Ne.memoizedState:At.next;if(t!==null)At=t,Pe=e;else{if(e===null)throw Ne.alternate===null?Error(c(467)):Error(c(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},At===null?Ne.memoizedState=At=e:At=At.next=e}return At}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ai(e){var t=Ei;return Ei+=1,Ha===null&&(Ha=[]),e=xd(Ha,e,t),t=Ne,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?ff:qr),e}function Os(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ai(e);if(e.$$typeof===J)return Ht(e)}throw Error(c(438,String(e)))}function _r(e){var t=null,n=Ne.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ne.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ls(),Ne.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Ee;return t.index++,n}function cl(e,t){return typeof t=="function"?t(e):t}function Us(e){var t=St();return kr(t,Pe,e)}function kr(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(i!==null){if(a!==null){var d=a.next;a.next=i.next,i.next=d}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var h=d=null,v=null,A=t,U=!1;do{var q=A.lane&-536870913;if(q!==A.lane?(Ye&q)===q:(rl&q)===q){var j=A.revertLane;if(j===0)v!==null&&(v=v.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),q===ka&&(U=!0);else if((rl&j)===j){A=A.next,j===ka&&(U=!0);continue}else q={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},v===null?(h=v=q,d=i):v=v.next=q,Ne.lanes|=j,Ol|=j;q=A.action,ra&&n(i,q),i=A.hasEagerState?A.eagerState:n(i,q)}else j={lane:q,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},v===null?(h=v=j,d=i):v=v.next=j,Ne.lanes|=q,Ol|=q;A=A.next}while(A!==null&&A!==t);if(v===null?d=i:v.next=h,!sn(i,e.memoizedState)&&(jt=!0,U&&(n=Da,n!==null)))throw n;e.memoizedState=i,e.baseState=d,e.baseQueue=v,l.lastRenderedState=i}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Dr(e){var t=St(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do i=e(i,d.action),d=d.next;while(d!==a);sn(i,t.memoizedState)||(jt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function zd(e,t,n){var l=Ne,a=St(),i=Ge;if(i){if(n===void 0)throw Error(c(407));n=n()}else n=t();var d=!sn((Pe||a).memoizedState,n);if(d&&(a.memoizedState=n,jt=!0),a=a.queue,Ur(Dd.bind(null,l,a,e),[e]),a.getSnapshot!==t||d||At!==null&&At.memoizedState.tag&1){if(l.flags|=2048,Ya(9,{destroy:void 0},kd.bind(null,l,a,n,t),null),nt===null)throw Error(c(349));i||(rl&127)!==0||_d(l,t,n)}return n}function _d(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t=Ls(),Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function kd(e,t,n,l){t.value=n,t.getSnapshot=l,Ld(t)&&Od(e)}function Dd(e,t,n){return n(function(){Ld(t)&&Od(e)})}function Ld(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function Od(e){var t=Pl(e,2);t!==null&&ln(t,e,2)}function Lr(e){var t=Wt();if(typeof e=="function"){var n=e;if(e=n(),ra){hn(!0);try{n()}finally{hn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:e},t}function Ud(e,t,n,l){return e.baseState=n,kr(e,Pe,typeof l=="function"?l:cl)}function Ob(e,t,n,l,a){if(Ys(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};M.T!==null?n(!0):i.isTransition=!1,l(i),n=t.pending,n===null?(i.next=t.pending=i,Bd(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Bd(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var i=M.T,d={};M.T=d;try{var h=n(a,l),v=M.S;v!==null&&v(d,h),Hd(e,t,h)}catch(A){Or(e,t,A)}finally{i!==null&&d.types!==null&&(i.types=d.types),M.T=i}}else try{i=n(a,l),Hd(e,t,i)}catch(A){Or(e,t,A)}}function Hd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Yd(e,t,l)},function(l){return Or(e,t,l)}):Yd(e,t,n)}function Yd(e,t,n){t.status="fulfilled",t.value=n,Kd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Bd(e,n)))}function Or(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Kd(t),t=t.next;while(t!==l)}e.action=null}function Kd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Gd(e,t){return t}function qd(e,t){if(Ge){var n=nt.formState;if(n!==null){e:{var l=Ne;if(Ge){if(at){t:{for(var a=at,i=Cn;a.nodeType!==8;){if(!i){a=null;break t}if(a=Nn(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){at=Nn(a.nextSibling),l=a.data==="F!";break e}}Al(l)}l=!1}l&&(t=n[0])}}return n=Wt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gd,lastRenderedState:t},n.queue=l,n=cf.bind(null,Ne,l),l.dispatch=n,l=Lr(!1),i=Gr.bind(null,Ne,!1,l.queue),l=Wt(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=Ob.bind(null,Ne,a,i,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function Xd(e){var t=St();return Vd(t,Pe,e)}function Vd(e,t,n){if(t=kr(e,t,Gd)[0],e=Us(cl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ai(t)}catch(d){throw d===La?As:d}else l=t;t=St();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Ne.flags|=2048,Ya(9,{destroy:void 0},Ub.bind(null,a,n),null)),[l,i,e]}function Ub(e,t){e.action=t}function Zd(e){var t=St(),n=Pe;if(n!==null)return Vd(t,n,e);St(),t=t.memoizedState,n=St();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ya(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Ls(),Ne.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Qd(){return St().memoizedState}function Bs(e,t,n,l){var a=Wt();Ne.flags|=e,a.memoizedState=Ya(1|t,{destroy:void 0},n,l===void 0?null:l)}function Hs(e,t,n,l){var a=St();l=l===void 0?null:l;var i=a.memoizedState.inst;Pe!==null&&l!==null&&Ar(l,Pe.memoizedState.deps)?a.memoizedState=Ya(t,i,n,l):(Ne.flags|=e,a.memoizedState=Ya(1|t,i,n,l))}function Fd(e,t){Bs(8390656,8,e,t)}function Ur(e,t){Hs(2048,8,e,t)}function Bb(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Ls(),Ne.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Jd(e){var t=St().memoizedState;return Bb({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Id(e,t){return Hs(4,2,e,t)}function Wd(e,t){return Hs(4,4,e,t)}function $d(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Pd(e,t,n){n=n!=null?n.concat([e]):null,Hs(4,4,$d.bind(null,t,e),n)}function Br(){}function ef(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Ar(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function tf(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Ar(t,l[1]))return l[0];if(l=e(),ra){hn(!0);try{e()}finally{hn(!1)}}return n.memoizedState=[l,t],l}function Hr(e,t,n){return n===void 0||(rl&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=lm(),Ne.lanes|=e,Ol|=e,n)}function nf(e,t,n,l){return sn(n,t)?n:Ua.current!==null?(e=Hr(e,n,l),sn(e,t)||(jt=!0),e):(rl&42)===0||(rl&1073741824)!==0&&(Ye&261930)===0?(jt=!0,e.memoizedState=n):(e=lm(),Ne.lanes|=e,Ol|=e,t)}function lf(e,t,n,l,a){var i=X.p;X.p=i!==0&&8>i?i:8;var d=M.T,h={};M.T=h,Gr(e,!1,t,n);try{var v=a(),A=M.S;if(A!==null&&A(h,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var U=kb(v,l);ji(e,t,U,fn(e))}else ji(e,t,l,fn(e))}catch(q){ji(e,t,{then:function(){},status:"rejected",reason:q},fn())}finally{X.p=i,d!==null&&h.types!==null&&(d.types=h.types),M.T=d}}function Hb(){}function Yr(e,t,n,l){if(e.tag!==5)throw Error(c(476));var a=af(e).queue;lf(e,a,t,W,n===null?Hb:function(){return sf(e),n(l)})}function af(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:W},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sf(e){var t=af(e);t.next===null&&(t=e.alternate.memoizedState),ji(e,t.next.queue,{},fn())}function Kr(){return Ht(Vi)}function of(){return St().memoizedState}function rf(){return St().memoizedState}function Yb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fn();e=Ml(n);var l=zl(t,e,n);l!==null&&(ln(l,t,n),Ci(l,t,n)),t={cache:br()},e.payload=t;return}t=t.return}}function Kb(e,t,n){var l=fn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ys(e)?uf(t,n):(n=ir(e,t,n,l),n!==null&&(ln(n,e,l),df(n,t,l)))}function cf(e,t,n){var l=fn();ji(e,t,n,l)}function ji(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ys(e))uf(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,h=i(d,n);if(a.hasEagerState=!0,a.eagerState=h,sn(h,d))return xs(e,t,a,0),nt===null&&vs(),!1}catch{}finally{}if(n=ir(e,t,a,l),n!==null)return ln(n,e,l),df(n,t,l),!0}return!1}function Gr(e,t,n,l){if(l={lane:2,revertLane:xc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ys(e)){if(t)throw Error(c(479))}else t=ir(e,n,l,2),t!==null&&ln(t,e,2)}function Ys(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function uf(e,t){Ba=ks=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function df(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Je(e,n)}}var Ri={readContext:Ht,use:Os,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Ri.useEffectEvent=ht;var ff={readContext:Ht,use:Os,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Fd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Bs(4194308,4,$d.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=Wt();t=t===void 0?null:t;var l=e();if(ra){hn(!0);try{e()}finally{hn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Wt();if(n!==void 0){var a=n(t);if(ra){hn(!0);try{n(t)}finally{hn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Kb.bind(null,Ne,e),[l.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:function(e){e=Lr(e);var t=e.queue,n=cf.bind(null,Ne,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Br,useDeferredValue:function(e,t){var n=Wt();return Hr(n,e,t)},useTransition:function(){var e=Lr(!1);return e=lf.bind(null,Ne,e.queue,!0,!1),Wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ne,a=Wt();if(Ge){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),nt===null)throw Error(c(349));(Ye&127)!==0||_d(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Fd(Dd.bind(null,l,i,e),[e]),l.flags|=2048,Ya(9,{destroy:void 0},kd.bind(null,l,i,n,t),null),n},useId:function(){var e=Wt(),t=nt.identifierPrefix;if(Ge){var n=Qn,l=Zn;n=(l&~(1<<32-Ut(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ds++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Db++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kr,useFormState:qd,useActionState:qd,useOptimistic:function(e){var t=Wt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Gr.bind(null,Ne,!0,n),n.dispatch=t,[e,t]},useMemoCache:_r,useCacheRefresh:function(){return Wt().memoizedState=Yb.bind(null,Ne)},useEffectEvent:function(e){var t=Wt(),n={impl:e};return t.memoizedState=n,function(){if((Ze&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},qr={readContext:Ht,use:Os,useCallback:ef,useContext:Ht,useEffect:Ur,useImperativeHandle:Pd,useInsertionEffect:Id,useLayoutEffect:Wd,useMemo:tf,useReducer:Us,useRef:Qd,useState:function(){return Us(cl)},useDebugValue:Br,useDeferredValue:function(e,t){var n=St();return nf(n,Pe.memoizedState,e,t)},useTransition:function(){var e=Us(cl)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:zd,useId:of,useHostTransitionStatus:Kr,useFormState:Xd,useActionState:Xd,useOptimistic:function(e,t){var n=St();return Ud(n,Pe,e,t)},useMemoCache:_r,useCacheRefresh:rf};qr.useEffectEvent=Jd;var mf={readContext:Ht,use:Os,useCallback:ef,useContext:Ht,useEffect:Ur,useImperativeHandle:Pd,useInsertionEffect:Id,useLayoutEffect:Wd,useMemo:tf,useReducer:Dr,useRef:Qd,useState:function(){return Dr(cl)},useDebugValue:Br,useDeferredValue:function(e,t){var n=St();return Pe===null?Hr(n,e,t):nf(n,Pe.memoizedState,e,t)},useTransition:function(){var e=Dr(cl)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:zd,useId:of,useHostTransitionStatus:Kr,useFormState:Zd,useActionState:Zd,useOptimistic:function(e,t){var n=St();return Pe!==null?Ud(n,Pe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:_r,useCacheRefresh:rf};mf.useEffectEvent=Jd;function Xr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vr={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=fn(),a=Ml(l);a.payload=t,n!=null&&(a.callback=n),t=zl(e,a,l),t!==null&&(ln(t,e,l),Ci(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=fn(),a=Ml(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=zl(e,a,l),t!==null&&(ln(t,e,l),Ci(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fn(),l=Ml(n);l.tag=2,t!=null&&(l.callback=t),t=zl(e,l,n),t!==null&&(ln(t,e,n),Ci(t,e,n))}};function hf(e,t,n,l,a,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!pi(n,l)||!pi(a,i):!0}function pf(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Vr.enqueueReplaceState(t,t.state,null)}function ca(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=T({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function bf(e){ys(e)}function gf(e){console.error(e)}function yf(e){ys(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function vf(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Zr(e,t,n){return n=Ml(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function xf(e){return e=Ml(e),e.tag=3,e}function Sf(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=l.value;e.payload=function(){return a(i)},e.callback=function(){vf(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){vf(t,n,l),typeof a!="function"&&(Ul===null?Ul=new Set([this]):Ul.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function Gb(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&_a(t,n,a,!0),n=rn.current,n!==null){switch(n.tag){case 31:case 13:return Tn===null?Ps():n.alternate===null&&pt===0&&(pt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===js?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),gc(e,l,a)),!1;case 22:return n.flags|=65536,l===js?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),gc(e,l,a)),!1}throw Error(c(435,n.tag))}return gc(e,l,a),Ps(),!1}if(Ge)return t=rn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==dr&&(e=Error(c(422),{cause:l}),yi(xn(e,n)))):(l!==dr&&(t=Error(c(423),{cause:l}),yi(xn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=xn(l,n),a=Zr(e.stateNode,l,a),wr(e,a),pt!==4&&(pt=2)),!1;var i=Error(c(520),{cause:l});if(i=xn(i,n),Ui===null?Ui=[i]:Ui.push(i),pt!==4&&(pt=2),t===null)return!0;l=xn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zr(n.stateNode,l,e),wr(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ul===null||!Ul.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=xf(a),Sf(a,e,n,l),wr(n,a),!1}n=n.return}while(n!==null);return!1}var Qr=Error(c(461)),jt=!1;function Yt(e,t,n,l){t.child=e===null?Td(t,null,n,l):oa(t,e.child,n,l)}function wf(e,t,n,l,a){n=n.render;var i=t.ref;if("ref"in l){var d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}else d=l;return la(t),l=jr(e,t,n,d,i,a),h=Rr(),e!==null&&!jt?(Mr(e,t,a),ul(e,t,a)):(Ge&&h&&cr(t),t.flags|=1,Yt(e,t,l,a),t.child)}function Cf(e,t,n,l,a){if(e===null){var i=n.type;return typeof i=="function"&&!sr(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,Tf(e,t,i,l,a)):(e=ws(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!tc(e,a)){var d=i.memoizedProps;if(n=n.compare,n=n!==null?n:pi,n(d,l)&&e.ref===t.ref)return ul(e,t,a)}return t.flags|=1,e=al(i,l),e.ref=t.ref,e.return=t,t.child=e}function Tf(e,t,n,l,a){if(e!==null){var i=e.memoizedProps;if(pi(i,l)&&e.ref===t.ref)if(jt=!1,t.pendingProps=l=i,tc(e,a))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,ul(e,t,a)}return Fr(e,t,n,l,a)}function Nf(e,t,n,l){var a=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~i}else l=0,t.child=null;return Ef(e,t,i,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Es(t,i!==null?i.cachePool:null),i!==null?Ad(t,i):Tr(),jd(t);else return l=t.lanes=536870912,Ef(e,t,i!==null?i.baseLanes|n:n,n,l)}else i!==null?(Es(t,i.cachePool),Ad(t,i),kl(),t.memoizedState=null):(e!==null&&Es(t,null),Tr(),kl());return Yt(e,t,a,n),t.child}function Mi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ef(e,t,n,l,a){var i=yr();return i=i===null?null:{parent:Et._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&Es(t,null),Tr(),jd(t),e!==null&&_a(e,t,l,!0),t.childLanes=a,null}function Gs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Af(e,t,n){return oa(t,e.child,null,n),e=Gs(t,t.pendingProps),e.flags|=2,cn(t),t.memoizedState=null,e}function qb(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(l.mode==="hidden")return e=Gs(t,l),t.lanes=536870912,Mi(null,e);if(Er(t),(e=at)?(e=Hm(e,Cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nl!==null?{id:Zn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},n=cd(e),n.return=t,t.child=n,Bt=t,at=null)):e=null,e===null)throw Al(t);return t.lanes=536870912,null}return Gs(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(Er(t),a)if(t.flags&256)t.flags&=-257,t=Af(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(jt||_a(e,t,n,!1),a=(n&e.childLanes)!==0,jt||a){if(l=nt,l!==null&&(d=De(l,n),d!==0&&d!==i.retryLane))throw i.retryLane=d,Pl(e,d),ln(l,e,d),Qr;Ps(),t=Af(e,t,n)}else e=i.treeContext,at=Nn(d.nextSibling),Bt=t,Ge=!0,El=null,Cn=!1,e!==null&&fd(t,e),t=Gs(t,l),t.flags|=4096;return t}return e=al(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Fr(e,t,n,l,a){return la(t),n=jr(e,t,n,l,void 0,a),l=Rr(),e!==null&&!jt?(Mr(e,t,a),ul(e,t,a)):(Ge&&l&&cr(t),t.flags|=1,Yt(e,t,n,a),t.child)}function jf(e,t,n,l,a,i){return la(t),t.updateQueue=null,n=Md(t,l,n,a),Rd(e),l=Rr(),e!==null&&!jt?(Mr(e,t,i),ul(e,t,i)):(Ge&&l&&cr(t),t.flags|=1,Yt(e,t,n,i),t.child)}function Rf(e,t,n,l,a){if(la(t),t.stateNode===null){var i=ja,d=n.contextType;typeof d=="object"&&d!==null&&(i=Ht(d)),i=new n(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Vr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},xr(t),d=n.contextType,i.context=typeof d=="object"&&d!==null?Ht(d):ja,i.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Xr(t,n,d,l),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Vr.enqueueReplaceState(i,i.state,null),Ni(t,l,i,a),Ti(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var h=t.memoizedProps,v=ca(n,h);i.props=v;var A=i.context,U=n.contextType;d=ja,typeof U=="object"&&U!==null&&(d=Ht(U));var q=n.getDerivedStateFromProps;U=typeof q=="function"||typeof i.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,U||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(h||A!==d)&&pf(t,i,l,d),Rl=!1;var j=t.memoizedState;i.state=j,Ni(t,l,i,a),Ti(),A=t.memoizedState,h||j!==A||Rl?(typeof q=="function"&&(Xr(t,n,q,l),A=t.memoizedState),(v=Rl||hf(t,n,v,l,j,A,d))?(U||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=A),i.props=l,i.state=A,i.context=d,l=v):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,Sr(e,t),d=t.memoizedProps,U=ca(n,d),i.props=U,q=t.pendingProps,j=i.context,A=n.contextType,v=ja,typeof A=="object"&&A!==null&&(v=Ht(A)),h=n.getDerivedStateFromProps,(A=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==q||j!==v)&&pf(t,i,l,v),Rl=!1,j=t.memoizedState,i.state=j,Ni(t,l,i,a),Ti();var z=t.memoizedState;d!==q||j!==z||Rl||e!==null&&e.dependencies!==null&&Ts(e.dependencies)?(typeof h=="function"&&(Xr(t,n,h,l),z=t.memoizedState),(U=Rl||hf(t,n,U,l,j,z,v)||e!==null&&e.dependencies!==null&&Ts(e.dependencies))?(A||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,z,v),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,z,v)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=z),i.props=l,i.state=z,i.context=v,l=U):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,qs(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=oa(t,e.child,null,a),t.child=oa(t,null,n,a)):Yt(e,t,n,a),t.memoizedState=i.state,e=t.child):e=ul(e,t,a),e}function Mf(e,t,n,l){return ta(),t.flags|=256,Yt(e,t,n,l),t.child}var Jr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ir(e){return{baseLanes:e,cachePool:yd()}}function Wr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=dn),e}function zf(e,t,n){var l=t.pendingProps,a=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(a?_l(t):kl(),(e=at)?(e=Hm(e,Cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nl!==null?{id:Zn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},n=cd(e),n.return=t,t.child=n,Bt=t,at=null)):e=null,e===null)throw Al(t);return kc(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,a?(kl(),a=t.mode,h=Xs({mode:"hidden",children:h},a),l=ea(l,a,n,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=Ir(n),l.childLanes=Wr(e,d,n),t.memoizedState=Jr,Mi(null,l)):(_l(t),$r(t,h))}var v=e.memoizedState;if(v!==null&&(h=v.dehydrated,h!==null)){if(i)t.flags&256?(_l(t),t.flags&=-257,t=Pr(e,t,n)):t.memoizedState!==null?(kl(),t.child=e.child,t.flags|=128,t=null):(kl(),h=l.fallback,a=t.mode,l=Xs({mode:"visible",children:l.children},a),h=ea(h,a,n,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,oa(t,e.child,null,n),l=t.child,l.memoizedState=Ir(n),l.childLanes=Wr(e,d,n),t.memoizedState=Jr,t=Mi(null,l));else if(_l(t),kc(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var A=d.dgst;d=A,l=Error(c(419)),l.stack="",l.digest=d,yi({value:l,source:null,stack:null}),t=Pr(e,t,n)}else if(jt||_a(e,t,n,!1),d=(n&e.childLanes)!==0,jt||d){if(d=nt,d!==null&&(l=De(d,n),l!==0&&l!==v.retryLane))throw v.retryLane=l,Pl(e,l),ln(d,e,l),Qr;_c(h)||Ps(),t=Pr(e,t,n)}else _c(h)?(t.flags|=192,t.child=e.child,t=null):(e=v.treeContext,at=Nn(h.nextSibling),Bt=t,Ge=!0,El=null,Cn=!1,e!==null&&fd(t,e),t=$r(t,l.children),t.flags|=4096);return t}return a?(kl(),h=l.fallback,a=t.mode,v=e.child,A=v.sibling,l=al(v,{mode:"hidden",children:l.children}),l.subtreeFlags=v.subtreeFlags&65011712,A!==null?h=al(A,h):(h=ea(h,a,n,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,Mi(null,l),l=t.child,h=e.child.memoizedState,h===null?h=Ir(n):(a=h.cachePool,a!==null?(v=Et._currentValue,a=a.parent!==v?{parent:v,pool:v}:a):a=yd(),h={baseLanes:h.baseLanes|n,cachePool:a}),l.memoizedState=h,l.childLanes=Wr(e,d,n),t.memoizedState=Jr,Mi(e.child,l)):(_l(t),n=e.child,e=n.sibling,n=al(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function $r(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=on(22,e,null,t),e.lanes=0,e}function Pr(e,t,n){return oa(t,e.child,null,n),e=$r(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _f(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),hr(e.return,t,n)}function ec(e,t,n,l,a,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=i)}function kf(e,t,n){var l=t.pendingProps,a=l.revealOrder,i=l.tail;l=l.children;var d=xt.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,Ce(xt,d),Yt(e,t,l,n),l=Ge?gi:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_f(e,n,t);else if(e.tag===19)_f(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&_s(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ec(t,!1,a,n,i,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&_s(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ec(t,!0,n,null,i,l);break;case"together":ec(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ol|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(_a(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=al(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=al(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ts(e)))}function Xb(e,t,n){switch(t.tag){case 3:bt(t,t.stateNode.containerInfo),jl(t,Et,e.memoizedState.cache),ta();break;case 27:case 5:ct(t);break;case 4:bt(t,t.stateNode.containerInfo);break;case 10:jl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Er(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(_l(t),t.flags|=128,null):(n&t.child.childLanes)!==0?zf(e,t,n):(_l(t),e=ul(e,t,n),e!==null?e.sibling:null);_l(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(_a(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return kf(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ce(xt,xt.current),l)break;return null;case 22:return t.lanes=0,Nf(e,t,n,t.pendingProps);case 24:jl(t,Et,e.memoizedState.cache)}return ul(e,t,n)}function Df(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!tc(e,n)&&(t.flags&128)===0)return jt=!1,Xb(e,t,n);jt=(e.flags&131072)!==0}else jt=!1,Ge&&(t.flags&1048576)!==0&&dd(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ia(t.elementType),t.type=e,typeof e=="function")sr(e)?(l=ca(e,l),t.tag=1,t=Rf(null,t,e,l,n)):(t.tag=0,t=Fr(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===oe){t.tag=11,t=wf(null,t,e,l,n);break e}else if(a===_){t.tag=14,t=Cf(null,t,e,l,n);break e}}throw t=pe(e)||e,Error(c(306,t,""))}}return t;case 0:return Fr(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=ca(l,t.pendingProps),Rf(e,t,l,a,n);case 3:e:{if(bt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,Sr(e,t),Ni(t,l,null,n);var d=t.memoizedState;if(l=d.cache,jl(t,Et,l),l!==i.cache&&pr(t,[Et],n,!0),Ti(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Mf(e,t,l,n);break e}else if(l!==a){a=xn(Error(c(424)),t),yi(a),t=Mf(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(at=Nn(e.firstChild),Bt=t,Ge=!0,El=null,Cn=!0,n=Td(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ta(),l===a){t=ul(e,t,n);break e}Yt(e,t,l,n)}t=t.child}return t;case 26:return qs(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,l=so(xe.current).createElement(n),l[Mt]=t,l[Xt]=e,Kt(l,n,e),vt(l),t.stateNode=l):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ct(t),e===null&&Ge&&(l=t.stateNode=Gm(t.type,t.pendingProps,xe.current),Bt=t,Cn=!0,a=at,Kl(t.type)?(Dc=a,at=Nn(l.firstChild)):at=a),Yt(e,t,t.pendingProps.children,n),qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((a=l=at)&&(l=xg(l,t.type,t.pendingProps,Cn),l!==null?(t.stateNode=l,Bt=t,at=Nn(l.firstChild),Cn=!1,a=!0):a=!1),a||Al(t)),ct(t),a=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,Rc(a,i)?l=null:d!==null&&Rc(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=jr(e,t,Lb,null,null,n),Vi._currentValue=a),qs(e,t),Yt(e,t,l,n),t.child;case 6:return e===null&&Ge&&((e=n=at)&&(n=Sg(n,t.pendingProps,Cn),n!==null?(t.stateNode=n,Bt=t,at=null,e=!0):e=!1),e||Al(t)),null;case 13:return zf(e,t,n);case 4:return bt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=oa(t,null,l,n):Yt(e,t,l,n),t.child;case 11:return wf(e,t,t.type,t.pendingProps,n);case 7:return Yt(e,t,t.pendingProps,n),t.child;case 8:return Yt(e,t,t.pendingProps.children,n),t.child;case 12:return Yt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,jl(t,t.type,l.value),Yt(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,la(t),a=Ht(a),l=l(a),t.flags|=1,Yt(e,t,l,n),t.child;case 14:return Cf(e,t,t.type,t.pendingProps,n);case 15:return Tf(e,t,t.type,t.pendingProps,n);case 19:return kf(e,t,n);case 31:return qb(e,t,n);case 22:return Nf(e,t,n,t.pendingProps);case 24:return la(t),l=Ht(Et),e===null?(a=yr(),a===null&&(a=nt,i=br(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},xr(t),jl(t,Et,a)):((e.lanes&n)!==0&&(Sr(e,t),Ni(t,null,null,n),Ti()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),jl(t,Et,l)):(l=i.cache,jl(t,Et,l),l!==a.cache&&pr(t,[Et],n,!0))),Yt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function dl(e){e.flags|=4}function nc(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(om())e.flags|=8192;else throw sa=js,vr}else e.flags&=-16777217}function Lf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Im(t))if(om())e.flags|=8192;else throw sa=js,vr}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?D():536870912,e.lanes|=t,Xa|=t)}function zi(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Vb(e,t,n){var l=t.pendingProps;switch(ur(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ol(Et),je(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(za(t)?dl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fr())),it(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(dl(t),i!==null?(it(t),Lf(t,i)):(it(t),nc(t,a,null,l,n))):i?i!==e.memoizedState?(dl(t),it(t),Lf(t,i)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&dl(t),it(t),nc(t,a,e,l,n)),null;case 27:if(lt(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&dl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return it(t),null}e=Oe.current,za(t)?md(t):(e=Gm(a,l,n),t.stateNode=e,dl(t))}return it(t),null;case 5:if(lt(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&dl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return it(t),null}if(i=Oe.current,za(t))md(t);else{var d=so(xe.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}i[Mt]=t,i[Xt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(Kt(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&dl(t)}}return it(t),nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&dl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=xe.current,za(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Bt,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||zm(e.nodeValue,n)),e||Al(t,!0)}else e=so(e).createTextNode(l),e[Mt]=t,t.stateNode=e}return it(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=za(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Mt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else n=fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(cn(t),t):(cn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return it(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=za(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(c(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[Mt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),a=!1}else a=fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(cn(t),t):(cn(t),null)}return cn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vs(t,t.updateQueue),it(t),null);case 4:return je(),e===null&&Tc(t.stateNode.containerInfo),it(t),null;case 10:return ol(t.type),it(t),null;case 19:if(ze(xt),l=t.memoizedState,l===null)return it(t),null;if(a=(t.flags&128)!==0,i=l.rendering,i===null)if(a)zi(l,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=_s(e),i!==null){for(t.flags|=128,zi(l,!1),e=i.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)rd(n,e),n=n.sibling;return Ce(xt,xt.current&1|2),Ge&&il(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ee()>Is&&(t.flags|=128,a=!0,zi(l,!1),t.lanes=4194304)}else{if(!a)if(e=_s(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),zi(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Ge)return it(t),null}else 2*ee()-l.renderingStartTime>Is&&n!==536870912&&(t.flags|=128,a=!0,zi(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ee(),e.sibling=null,n=xt.current,Ce(xt,a?n&1|2:n&1),Ge&&il(t,l.treeForkCount),e):(it(t),null);case 22:case 23:return cn(t),Nr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&Vs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&ze(aa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ol(Et),it(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Zb(e,t){switch(ur(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ol(Et),je(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(cn(t),t.alternate===null)throw Error(c(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(xt),null;case 4:return je(),null;case 10:return ol(t.type),null;case 22:case 23:return cn(t),Nr(),e!==null&&ze(aa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ol(Et),null;case 25:return null;default:return null}}function Of(e,t){switch(ur(t),t.tag){case 3:ol(Et),je();break;case 26:case 27:case 5:lt(t);break;case 4:je();break;case 31:t.memoizedState!==null&&cn(t);break;case 13:cn(t);break;case 19:ze(xt);break;case 10:ol(t.type);break;case 22:case 23:cn(t),Nr(),e!==null&&ze(aa);break;case 24:ol(Et)}}function _i(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var i=n.create,d=n.inst;l=i(),d.destroy=l}n=n.next}while(n!==a)}}catch(h){We(t,t.return,h)}}function Dl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var i=a.next;l=i;do{if((l.tag&e)===e){var d=l.inst,h=d.destroy;if(h!==void 0){d.destroy=void 0,a=t;var v=n,A=h;try{A()}catch(U){We(a,v,U)}}}l=l.next}while(l!==i)}}catch(U){We(t,t.return,U)}}function Uf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ed(t,n)}catch(l){We(e,e.return,l)}}}function Bf(e,t,n){n.props=ca(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){We(e,t,l)}}function ki(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){We(e,t,a)}}function Fn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){We(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){We(e,t,a)}else n.current=null}function Hf(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){We(e,e.return,a)}}function lc(e,t,n){try{var l=e.stateNode;hg(l,e.type,n,t),l[Xt]=t}catch(a){We(e,e.return,a)}}function Yf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kl(e.type)||e.tag===4}function ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ic(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nl));else if(l!==4&&(l===27&&Kl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function Zs(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Kl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zs(e,t,n),e=e.sibling;e!==null;)Zs(e,t,n),e=e.sibling}function Kf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Kt(t,l,n),t[Mt]=e,t[Xt]=n}catch(i){We(e,e.return,i)}}var fl=!1,Rt=!1,sc=!1,Gf=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function Qb(e,t){if(e=e.containerInfo,Ac=ho,e=Pu(e),Po(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var d=0,h=-1,v=-1,A=0,U=0,q=e,j=null;t:for(;;){for(var z;q!==n||a!==0&&q.nodeType!==3||(h=d+a),q!==i||l!==0&&q.nodeType!==3||(v=d+l),q.nodeType===3&&(d+=q.nodeValue.length),(z=q.firstChild)!==null;)j=q,q=z;for(;;){if(q===e)break t;if(j===n&&++A===a&&(h=d),j===i&&++U===l&&(v=d),(z=q.nextSibling)!==null)break;q=j,j=q.parentNode}q=z}n=h===-1||v===-1?null:{start:h,end:v}}else n=null}n=n||{start:0,end:0}}else n=null;for(jc={focusedElem:e,selectionRange:n},ho=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var se=ca(n.type,a);e=l.getSnapshotBeforeUpdate(se,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){We(n,n.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)zc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function qf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),l&4&&_i(5,n);break;case 1:if(hl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){We(n,n.return,d)}else{var a=ca(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){We(n,n.return,d)}}l&64&&Uf(n),l&512&&ki(n,n.return);break;case 3:if(hl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ed(e,t)}catch(d){We(n,n.return,d)}}break;case 27:t===null&&l&4&&Kf(n);case 26:case 5:hl(e,n),t===null&&l&4&&Hf(n),l&512&&ki(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),l&4&&Zf(e,n);break;case 13:hl(e,n),l&4&&Qf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ng.bind(null,n),wg(e,n))));break;case 22:if(l=n.memoizedState!==null||fl,!l){t=t!==null&&t.memoizedState!==null||Rt,a=fl;var i=Rt;fl=l,(Rt=t)&&!i?pl(e,n,(n.subtreeFlags&8772)!==0):hl(e,n),fl=a,Rt=i}break;case 30:break;default:hl(e,n)}}function Xf(e){var t=e.alternate;t!==null&&(e.alternate=null,Xf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ya(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Pt=!1;function ml(e,t,n){for(n=n.child;n!==null;)Vf(e,t,n),n=n.sibling}function Vf(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Kn,n)}catch{}switch(n.tag){case 26:Rt||Fn(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Rt||Fn(n,t);var l=rt,a=Pt;Kl(n.type)&&(rt=n.stateNode,Pt=!1),ml(e,t,n),Gi(n.stateNode),rt=l,Pt=a;break;case 5:Rt||Fn(n,t);case 6:if(l=rt,a=Pt,rt=null,ml(e,t,n),rt=l,Pt=a,rt!==null)if(Pt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(i){We(n,t,i)}else try{rt.removeChild(n.stateNode)}catch(i){We(n,t,i)}break;case 18:rt!==null&&(Pt?(e=rt,Um(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),$a(e)):Um(rt,n.stateNode));break;case 4:l=rt,a=Pt,rt=n.stateNode.containerInfo,Pt=!0,ml(e,t,n),rt=l,Pt=a;break;case 0:case 11:case 14:case 15:Dl(2,n,t),Rt||Dl(4,n,t),ml(e,t,n);break;case 1:Rt||(Fn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Bf(n,t,l)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:Rt=(l=Rt)||n.memoizedState!==null,ml(e,t,n),Rt=l;break;default:ml(e,t,n)}}function Zf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$a(e)}catch(n){We(t,t.return,n)}}}function Qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$a(e)}catch(n){We(t,t.return,n)}}function Fb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gf),t;default:throw Error(c(435,e.tag))}}function Qs(e,t){var n=Fb(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=lg.bind(null,e,l);l.then(a,a)}})}function en(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],i=e,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(Kl(h.type)){rt=h.stateNode,Pt=!1;break e}break;case 5:rt=h.stateNode,Pt=!1;break e;case 3:case 4:rt=h.stateNode.containerInfo,Pt=!0;break e}h=h.return}if(rt===null)throw Error(c(160));Vf(i,d,a),rt=null,Pt=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ff(t,e),t=t.sibling}var On=null;function Ff(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:en(t,e),tn(e),l&4&&(Dl(3,e,e.return),_i(3,e),Dl(5,e,e.return));break;case 1:en(t,e),tn(e),l&512&&(Rt||n===null||Fn(n,n.return)),l&64&&fl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=On;if(en(t,e),tn(e),l&512&&(Rt||n===null||Fn(n,n.return)),l&4){var i=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":i=a.getElementsByTagName("title")[0],(!i||i[It]||i[Mt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),Kt(i,l,n),i[Mt]=e,vt(i),l=i;break e;case"link":var d=Fm("link","href",a).get(l+(n.href||""));if(d){for(var h=0;h<d.length;h++)if(i=d[h],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(h,1);break t}}i=a.createElement(l),Kt(i,l,n),a.head.appendChild(i);break;case"meta":if(d=Fm("meta","content",a).get(l+(n.content||""))){for(h=0;h<d.length;h++)if(i=d[h],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(h,1);break t}}i=a.createElement(l),Kt(i,l,n),a.head.appendChild(i);break;default:throw Error(c(468,l))}i[Mt]=e,vt(i),l=i}e.stateNode=l}else Jm(a,e.type,e.stateNode);else e.stateNode=Qm(a,l,e.memoizedProps);else i!==l?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,l===null?Jm(a,e.type,e.stateNode):Qm(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&lc(e,e.memoizedProps,n.memoizedProps)}break;case 27:en(t,e),tn(e),l&512&&(Rt||n===null||Fn(n,n.return)),n!==null&&l&4&&lc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(en(t,e),tn(e),l&512&&(Rt||n===null||Fn(n,n.return)),e.flags&32){a=e.stateNode;try{Sa(a,"")}catch(se){We(e,e.return,se)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,lc(e,a,n!==null?n.memoizedProps:a)),l&1024&&(sc=!0);break;case 6:if(en(t,e),tn(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(se){We(e,e.return,se)}}break;case 3:if(co=null,a=On,On=oo(t.containerInfo),en(t,e),On=a,tn(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{$a(t.containerInfo)}catch(se){We(e,e.return,se)}sc&&(sc=!1,Jf(e));break;case 4:l=On,On=oo(e.stateNode.containerInfo),en(t,e),tn(e),On=l;break;case 12:en(t,e),tn(e);break;case 31:en(t,e),tn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 13:en(t,e),tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Js=ee()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 22:a=e.memoizedState!==null;var v=n!==null&&n.memoizedState!==null,A=fl,U=Rt;if(fl=A||a,Rt=U||v,en(t,e),Rt=U,fl=A,tn(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||v||fl||Rt||ua(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){v=n=t;try{if(i=v.stateNode,a)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=v.stateNode;var q=v.memoizedProps.style,j=q!=null&&q.hasOwnProperty("display")?q.display:null;h.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(se){We(v,v.return,se)}}}else if(t.tag===6){if(n===null){v=t;try{v.stateNode.nodeValue=a?"":v.memoizedProps}catch(se){We(v,v.return,se)}}}else if(t.tag===18){if(n===null){v=t;try{var z=v.stateNode;a?Bm(z,!0):Bm(v.stateNode,!1)}catch(se){We(v,v.return,se)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Qs(e,n))));break;case 19:en(t,e),tn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 30:break;case 21:break;default:en(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Yf(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var a=n.stateNode,i=ac(e);Zs(e,i,a);break;case 5:var d=n.stateNode;n.flags&32&&(Sa(d,""),n.flags&=-33);var h=ac(e);Zs(e,h,d);break;case 3:case 4:var v=n.stateNode.containerInfo,A=ac(e);ic(e,A,v);break;default:throw Error(c(161))}}catch(U){We(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qf(e,t.alternate,t),t=t.sibling}function ua(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Dl(4,t,t.return),ua(t);break;case 1:Fn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Bf(t,t.return,n),ua(t);break;case 27:Gi(t.stateNode);case 26:case 5:Fn(t,t.return),ua(t);break;case 22:t.memoizedState===null&&ua(t);break;case 30:ua(t);break;default:ua(t)}e=e.sibling}}function pl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:pl(a,i,n),_i(4,i);break;case 1:if(pl(a,i,n),l=i,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(A){We(l,l.return,A)}if(l=i,a=l.updateQueue,a!==null){var h=l.stateNode;try{var v=a.shared.hiddenCallbacks;if(v!==null)for(a.shared.hiddenCallbacks=null,a=0;a<v.length;a++)Nd(v[a],h)}catch(A){We(l,l.return,A)}}n&&d&64&&Uf(i),ki(i,i.return);break;case 27:Kf(i);case 26:case 5:pl(a,i,n),n&&l===null&&d&4&&Hf(i),ki(i,i.return);break;case 12:pl(a,i,n);break;case 31:pl(a,i,n),n&&d&4&&Zf(a,i);break;case 13:pl(a,i,n),n&&d&4&&Qf(a,i);break;case 22:i.memoizedState===null&&pl(a,i,n),ki(i,i.return);break;case 30:break;default:pl(a,i,n)}t=t.sibling}}function oc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&vi(n))}function rc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vi(e))}function Un(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)If(e,t,n,l),t=t.sibling}function If(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,n,l),a&2048&&_i(9,t);break;case 1:Un(e,t,n,l);break;case 3:Un(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vi(e)));break;case 12:if(a&2048){Un(e,t,n,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,h=i.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){We(t,t.return,v)}}else Un(e,t,n,l);break;case 31:Un(e,t,n,l);break;case 13:Un(e,t,n,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?Un(e,t,n,l):Di(e,t):i._visibility&2?Un(e,t,n,l):(i._visibility|=2,Ka(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&oc(d,t);break;case 24:Un(e,t,n,l),a&2048&&rc(t.alternate,t);break;default:Un(e,t,n,l)}}function Ka(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,h=n,v=l,A=d.flags;switch(d.tag){case 0:case 11:case 15:Ka(i,d,h,v,a),_i(8,d);break;case 23:break;case 22:var U=d.stateNode;d.memoizedState!==null?U._visibility&2?Ka(i,d,h,v,a):Di(i,d):(U._visibility|=2,Ka(i,d,h,v,a)),a&&A&2048&&oc(d.alternate,d);break;case 24:Ka(i,d,h,v,a),a&&A&2048&&rc(d.alternate,d);break;default:Ka(i,d,h,v,a)}t=t.sibling}}function Di(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Di(n,l),a&2048&&oc(l.alternate,l);break;case 24:Di(n,l),a&2048&&rc(l.alternate,l);break;default:Di(n,l)}t=t.sibling}}var Li=8192;function Ga(e,t,n){if(e.subtreeFlags&Li)for(e=e.child;e!==null;)Wf(e,t,n),e=e.sibling}function Wf(e,t,n){switch(e.tag){case 26:Ga(e,t,n),e.flags&Li&&e.memoizedState!==null&&Dg(n,On,e.memoizedState,e.memoizedProps);break;case 5:Ga(e,t,n);break;case 3:case 4:var l=On;On=oo(e.stateNode.containerInfo),Ga(e,t,n),On=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Li,Li=16777216,Ga(e,t,n),Li=l):Ga(e,t,n));break;default:Ga(e,t,n)}}function $f(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Oi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Lt=l,em(l,e)}$f(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pf(e),e=e.sibling}function Pf(e){switch(e.tag){case 0:case 11:case 15:Oi(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:Oi(e);break;case 12:Oi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fs(e)):Oi(e);break;default:Oi(e)}}function Fs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Lt=l,em(l,e)}$f(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),Fs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fs(t));break;default:Fs(t)}e=e.sibling}}function em(e,t){for(;Lt!==null;){var n=Lt;switch(n.tag){case 0:case 11:case 15:Dl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:vi(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Lt=l;else e:for(n=e;Lt!==null;){l=Lt;var a=l.sibling,i=l.return;if(Xf(l),l===n){Lt=null;break e}if(a!==null){a.return=i,Lt=a;break e}Lt=i}}}var Jb={getCacheForType:function(e){var t=Ht(Et),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ht(Et).controller.signal}},Ib=typeof WeakMap=="function"?WeakMap:Map,Ze=0,nt=null,Ue=null,Ye=0,Ie=0,un=null,Ll=!1,qa=!1,cc=!1,bl=0,pt=0,Ol=0,da=0,uc=0,dn=0,Xa=0,Ui=null,nn=null,dc=!1,Js=0,tm=0,Is=1/0,Ws=null,Ul=null,zt=0,Bl=null,Va=null,gl=0,fc=0,mc=null,nm=null,Bi=0,hc=null;function fn(){return(Ze&2)!==0&&Ye!==0?Ye&-Ye:M.T!==null?xc():Ct()}function lm(){if(dn===0)if((Ye&536870912)===0||Ge){var e=zn;zn<<=1,(zn&3932160)===0&&(zn=262144),dn=e}else dn=536870912;return e=rn.current,e!==null&&(e.flags|=32),dn}function ln(e,t,n){(e===nt&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(Za(e,0),Hl(e,Ye,dn,!1)),te(e,n),((Ze&2)===0||e!==nt)&&(e===nt&&((Ze&2)===0&&(da|=n),pt===4&&Hl(e,Ye,dn,!1)),Jn(e))}function am(e,t,n){if((Ze&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||H(e,t),a=l?Pb(e,t):bc(e,t,!0),i=l;do{if(a===0){qa&&!l&&Hl(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!Wb(n)){a=bc(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;a=Ui;var v=h.current.memoizedState.isDehydrated;if(v&&(Za(h,d).flags|=256),d=bc(h,d,!1),d!==2){if(cc&&!v){h.errorRecoveryDisabledLanes|=i,da|=i,a=4;break e}i=nn,nn=a,i!==null&&(nn===null?nn=i:nn.push.apply(nn,i))}a=d}if(i=!1,a!==2)continue}}if(a===1){Za(e,0),Hl(e,t,0,!0);break}e:{switch(l=e,i=a,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Hl(l,t,dn,!Ll);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(a=Js+300-ee(),10<a)){if(Hl(l,t,dn,!Ll),el(l,0,!0)!==0)break e;gl=t,l.timeoutHandle=Lm(im.bind(null,l,n,nn,Ws,dc,t,dn,da,Xa,Ll,i,"Throttled",-0,0),a);break e}im(l,n,nn,Ws,dc,t,dn,da,Xa,Ll,i,null,-0,0)}}break}while(!0);Jn(e)}function im(e,t,n,l,a,i,d,h,v,A,U,q,j,z){if(e.timeoutHandle=-1,q=t.subtreeFlags,q&8192||(q&16785408)===16785408){q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nl},Wf(t,i,q);var se=(i&62914560)===i?Js-ee():(i&4194048)===i?tm-ee():0;if(se=Lg(q,se),se!==null){gl=i,e.cancelPendingCommit=se(mm.bind(null,e,t,i,n,l,a,d,h,v,U,q,null,j,z)),Hl(e,i,d,!A);return}}mm(e,t,i,n,l,a,d,h,v)}function Wb(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],i=a.getSnapshot;a=a.value;try{if(!sn(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hl(e,t,n,l){t&=~uc,t&=~da,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var i=31-Ut(a),d=1<<i;l[i]=-1,a&=~d}n!==0&&F(e,n,t)}function $s(){return(Ze&6)===0?(Hi(0),!1):!0}function pc(){if(Ue!==null){if(Ie===0)var e=Ue.return;else e=Ue,sl=na=null,zr(e),Oa=null,Si=0,e=Ue;for(;e!==null;)Of(e.alternate,e),e=e.return;Ue=null}}function Za(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,gg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gl=0,pc(),nt=e,Ue=n=al(e.current,null),Ye=t,Ie=0,un=null,Ll=!1,qa=H(e,t),cc=!1,Xa=dn=uc=da=Ol=pt=0,nn=Ui=null,dc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-Ut(l),i=1<<a;t|=e[a],l&=~i}return bl=t,vs(),n}function sm(e,t){Ne=null,M.H=Ri,t===La||t===As?(t=Sd(),Ie=3):t===vr?(t=Sd(),Ie=4):Ie=t===Qr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,un=t,Ue===null&&(pt=1,Ks(e,xn(t,e.current)))}function om(){var e=rn.current;return e===null?!0:(Ye&4194048)===Ye?Tn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Tn:!1}function rm(){var e=M.H;return M.H=Ri,e===null?Ri:e}function cm(){var e=M.A;return M.A=Jb,e}function Ps(){pt=4,Ll||(Ye&4194048)!==Ye&&rn.current!==null||(qa=!0),(Ol&134217727)===0&&(da&134217727)===0||nt===null||Hl(nt,Ye,dn,!1)}function bc(e,t,n){var l=Ze;Ze|=2;var a=rm(),i=cm();(nt!==e||Ye!==t)&&(Ws=null,Za(e,t)),t=!1;var d=pt;e:do try{if(Ie!==0&&Ue!==null){var h=Ue,v=un;switch(Ie){case 8:pc(),d=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(t=!0);var A=Ie;if(Ie=0,un=null,Qa(e,h,v,A),n&&qa){d=0;break e}break;default:A=Ie,Ie=0,un=null,Qa(e,h,v,A)}}$b(),d=pt;break}catch(U){sm(e,U)}while(!0);return t&&e.shellSuspendCounter++,sl=na=null,Ze=l,M.H=a,M.A=i,Ue===null&&(nt=null,Ye=0,vs()),d}function $b(){for(;Ue!==null;)um(Ue)}function Pb(e,t){var n=Ze;Ze|=2;var l=rm(),a=cm();nt!==e||Ye!==t?(Ws=null,Is=ee()+500,Za(e,t)):qa=H(e,t);e:do try{if(Ie!==0&&Ue!==null){t=Ue;var i=un;t:switch(Ie){case 1:Ie=0,un=null,Qa(e,t,i,1);break;case 2:case 9:if(vd(i)){Ie=0,un=null,dm(t);break}t=function(){Ie!==2&&Ie!==9||nt!==e||(Ie=7),Jn(e)},i.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:vd(i)?(Ie=0,un=null,dm(t)):(Ie=0,un=null,Qa(e,t,i,7));break;case 5:var d=null;switch(Ue.tag){case 26:d=Ue.memoizedState;case 5:case 27:var h=Ue;if(d?Im(d):h.stateNode.complete){Ie=0,un=null;var v=h.sibling;if(v!==null)Ue=v;else{var A=h.return;A!==null?(Ue=A,eo(A)):Ue=null}break t}}Ie=0,un=null,Qa(e,t,i,5);break;case 6:Ie=0,un=null,Qa(e,t,i,6);break;case 8:pc(),pt=6;break e;default:throw Error(c(462))}}eg();break}catch(U){sm(e,U)}while(!0);return sl=na=null,M.H=l,M.A=a,Ze=n,Ue!==null?0:(nt=null,Ye=0,vs(),pt)}function eg(){for(;Ue!==null&&!Wn();)um(Ue)}function um(e){var t=Df(e.alternate,e,bl);e.memoizedProps=e.pendingProps,t===null?eo(e):Ue=t}function dm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jf(n,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=jf(n,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:zr(t);default:Of(n,t),t=Ue=rd(t,bl),t=Df(n,t,bl)}e.memoizedProps=e.pendingProps,t===null?eo(e):Ue=t}function Qa(e,t,n,l){sl=na=null,zr(t),Oa=null,Si=0;var a=t.return;try{if(Gb(e,a,t,n,Ye)){pt=1,Ks(e,xn(n,e.current)),Ue=null;return}}catch(i){if(a!==null)throw Ue=a,i;pt=1,Ks(e,xn(n,e.current)),Ue=null;return}t.flags&32768?(Ge||l===1?e=!0:qa||(Ye&536870912)!==0?e=!1:(Ll=e=!0,(l===2||l===9||l===3||l===6)&&(l=rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),fm(t,e)):eo(t)}function eo(e){var t=e;do{if((t.flags&32768)!==0){fm(t,Ll);return}e=t.return;var n=Vb(t.alternate,t,bl);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);pt===0&&(pt=5)}function fm(e,t){do{var n=Zb(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);pt=6,Ue=null}function mm(e,t,n,l,a,i,d,h,v){e.cancelPendingCommit=null;do to();while(zt!==0);if((Ze&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=ar,he(e,n,i,d,h,v),e===nt&&(Ue=nt=null,Ye=0),Va=t,Bl=e,gl=n,fc=i,mc=a,nm=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ag(an,function(){return ym(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,a=X.p,X.p=2,d=Ze,Ze|=4;try{Qb(e,t,n)}finally{Ze=d,X.p=a,M.T=l}}zt=1,hm(),pm(),bm()}}function hm(){if(zt===1){zt=0;var e=Bl,t=Va,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=X.p;X.p=2;var a=Ze;Ze|=4;try{Ff(t,e);var i=jc,d=Pu(e.containerInfo),h=i.focusedElem,v=i.selectionRange;if(d!==h&&h&&h.ownerDocument&&$u(h.ownerDocument.documentElement,h)){if(v!==null&&Po(h)){var A=v.start,U=v.end;if(U===void 0&&(U=A),"selectionStart"in h)h.selectionStart=A,h.selectionEnd=Math.min(U,h.value.length);else{var q=h.ownerDocument||document,j=q&&q.defaultView||window;if(j.getSelection){var z=j.getSelection(),se=h.textContent.length,ge=Math.min(v.start,se),tt=v.end===void 0?ge:Math.min(v.end,se);!z.extend&&ge>tt&&(d=tt,tt=ge,ge=d);var N=Wu(h,ge),w=Wu(h,tt);if(N&&w&&(z.rangeCount!==1||z.anchorNode!==N.node||z.anchorOffset!==N.offset||z.focusNode!==w.node||z.focusOffset!==w.offset)){var E=q.createRange();E.setStart(N.node,N.offset),z.removeAllRanges(),ge>tt?(z.addRange(E),z.extend(w.node,w.offset)):(E.setEnd(w.node,w.offset),z.addRange(E))}}}}for(q=[],z=h;z=z.parentNode;)z.nodeType===1&&q.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<q.length;h++){var G=q[h];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}ho=!!Ac,jc=Ac=null}finally{Ze=a,X.p=l,M.T=n}}e.current=t,zt=2}}function pm(){if(zt===2){zt=0;var e=Bl,t=Va,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=X.p;X.p=2;var a=Ze;Ze|=4;try{qf(e,t.alternate,t)}finally{Ze=a,X.p=l,M.T=n}}zt=3}}function bm(){if(zt===4||zt===3){zt=0,Gt();var e=Bl,t=Va,n=gl,l=nm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?zt=5:(zt=0,Va=Bl=null,gm(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Ul=null),Qe(n),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Kn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,a=X.p,X.p=2,M.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var h=l[d];i(h.value,{componentStack:h.stack})}}finally{M.T=t,X.p=a}}(gl&3)!==0&&to(),Jn(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===hc?Bi++:(Bi=0,hc=e):Bi=0,Hi(0)}}function gm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vi(t)))}function to(){return hm(),pm(),bm(),ym()}function ym(){if(zt!==5)return!1;var e=Bl,t=fc;fc=0;var n=Qe(gl),l=M.T,a=X.p;try{X.p=32>n?32:n,M.T=null,n=mc,mc=null;var i=Bl,d=gl;if(zt=0,Va=Bl=null,gl=0,(Ze&6)!==0)throw Error(c(331));var h=Ze;if(Ze|=4,Pf(i.current),If(i,i.current,d,n),Ze=h,Hi(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Kn,i)}catch{}return!0}finally{X.p=a,M.T=l,gm(e,t)}}function vm(e,t,n){t=xn(n,t),t=Zr(e.stateNode,t,2),e=zl(e,t,2),e!==null&&(te(e,2),Jn(e))}function We(e,t,n){if(e.tag===3)vm(e,e,n);else for(;t!==null;){if(t.tag===3){vm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ul===null||!Ul.has(l))){e=xn(n,e),n=xf(2),l=zl(t,n,2),l!==null&&(Sf(n,l,t,e),te(l,2),Jn(l));break}}t=t.return}}function gc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Ib;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(cc=!0,a.add(n),e=tg.bind(null,e,t,n),t.then(e,e))}function tg(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nt===e&&(Ye&n)===n&&(pt===4||pt===3&&(Ye&62914560)===Ye&&300>ee()-Js?(Ze&2)===0&&Za(e,0):uc|=n,Xa===Ye&&(Xa=0)),Jn(e)}function xm(e,t){t===0&&(t=D()),e=Pl(e,t),e!==null&&(te(e,t),Jn(e))}function ng(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xm(e,n)}function lg(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),xm(e,n)}function ag(e,t){return Ft(e,t)}var no=null,Fa=null,yc=!1,lo=!1,vc=!1,Yl=0;function Jn(e){e!==Fa&&e.next===null&&(Fa===null?no=Fa=e:Fa=Fa.next=e),lo=!0,yc||(yc=!0,sg())}function Hi(e,t){if(!vc&&lo){vc=!0;do for(var n=!1,l=no;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var i=0;else{var d=l.suspendedLanes,h=l.pingedLanes;i=(1<<31-Ut(42|e)+1)-1,i&=a&~(d&~h),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Tm(l,i))}else i=Ye,i=el(l,l===nt?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||H(l,i)||(n=!0,Tm(l,i));l=l.next}while(n);vc=!1}}function ig(){Sm()}function Sm(){lo=yc=!1;var e=0;Yl!==0&&bg()&&(e=Yl);for(var t=ee(),n=null,l=no;l!==null;){var a=l.next,i=wm(l,t);i===0?(l.next=null,n===null?no=a:n.next=a,a===null&&(Fa=n)):(n=l,(e!==0||(i&3)!==0)&&(lo=!0)),l=a}zt!==0&&zt!==5||Hi(e),Yl!==0&&(Yl=0)}function wm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-Ut(i),h=1<<d,v=a[d];v===-1?((h&n)===0||(h&l)!==0)&&(a[d]=C(h,t)):v<=t&&(e.expiredLanes|=h),i&=~h}if(t=nt,n=Ye,n=el(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&yt(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||H(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&yt(l),Qe(n)){case 2:case 8:n=He;break;case 32:n=an;break;case 268435456:n=qt;break;default:n=an}return l=Cm.bind(null,e),n=Ft(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&yt(l),e.callbackPriority=2,e.callbackNode=null,2}function Cm(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(to()&&e.callbackNode!==n)return null;var l=Ye;return l=el(e,e===nt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(am(e,l,t),wm(e,ee()),e.callbackNode!=null&&e.callbackNode===n?Cm.bind(null,e):null)}function Tm(e,t){if(to())return null;am(e,t,!0)}function sg(){yg(function(){(Ze&6)!==0?Ft(_e,ig):Sm()})}function xc(){if(Yl===0){var e=ka;e===0&&(e=Pn,Pn<<=1,(Pn&261888)===0&&(Pn=256)),Yl=e}return Yl}function Nm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ds(""+e)}function Em(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function og(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var i=Nm((a[Xt]||null).action),d=l.submitter;d&&(t=(t=d[Xt]||null)?Nm(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var h=new ps("action","action",null,l,a);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Yl!==0){var v=d?Em(a,d):new FormData(a);Yr(n,{pending:!0,data:v,method:a.method,action:i},null,v)}}else typeof i=="function"&&(h.preventDefault(),v=d?Em(a,d):new FormData(a),Yr(n,{pending:!0,data:v,method:a.method,action:i},i,v))},currentTarget:a}]})}}for(var Sc=0;Sc<lr.length;Sc++){var wc=lr[Sc],rg=wc.toLowerCase(),cg=wc[0].toUpperCase()+wc.slice(1);Ln(rg,"on"+cg)}Ln(nd,"onAnimationEnd"),Ln(ld,"onAnimationIteration"),Ln(ad,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(Nb,"onTransitionRun"),Ln(Eb,"onTransitionStart"),Ln(Ab,"onTransitionCancel"),Ln(id,"onTransitionEnd"),qe("onMouseEnter",["mouseout","mouseover"]),qe("onMouseLeave",["mouseout","mouseover"]),qe("onPointerEnter",["pointerout","pointerover"]),qe("onPointerLeave",["pointerout","pointerover"]),de("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),de("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),de("onBeforeInput",["compositionend","keypress","textInput","paste"]),de("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),de("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),de("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yi="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(" "),ug=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yi));function Am(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var h=l[d],v=h.instance,A=h.currentTarget;if(h=h.listener,v!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=A;try{i(a)}catch(U){ys(U)}a.currentTarget=null,i=v}else for(d=0;d<l.length;d++){if(h=l[d],v=h.instance,A=h.currentTarget,h=h.listener,v!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=A;try{i(a)}catch(U){ys(U)}a.currentTarget=null,i=v}}}}function Be(e,t){var n=t[Vt];n===void 0&&(n=t[Vt]=new Set);var l=e+"__bubble";n.has(l)||(jm(t,e,2,!1),n.add(l))}function Cc(e,t,n){var l=0;t&&(l|=4),jm(n,e,l,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[ao]){e[ao]=!0,oi.forEach(function(n){n!=="selectionchange"&&(ug.has(n)||Cc(n,!1,e),Cc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,Cc("selectionchange",!1,t))}}function jm(e,t,n,l){switch(lh(t)){case 2:var a=Bg;break;case 8:a=Hg;break;default:a=Hc}n=a.bind(null,t,n,e),a=void 0,!Xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Nc(e,t,n,l,a){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var h=l.stateNode.containerInfo;if(h===a)break;if(d===4)for(d=l.return;d!==null;){var v=d.tag;if((v===3||v===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;h!==null;){if(d=tl(h),d===null)return;if(v=d.tag,v===5||v===6||v===26||v===27){l=i=d;continue e}h=h.parentNode}}l=l.return}_u(function(){var A=i,U=Go(n),q=[];e:{var j=sd.get(e);if(j!==void 0){var z=ps,se=e;switch(e){case"keypress":if(ms(n)===0)break e;case"keydown":case"keyup":z=lb;break;case"focusin":se="focus",z=Fo;break;case"focusout":se="blur",z=Fo;break;case"beforeblur":case"afterblur":z=Fo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":z=Lu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=Vp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=sb;break;case nd:case ld:case ad:z=Fp;break;case id:z=rb;break;case"scroll":case"scrollend":z=qp;break;case"wheel":z=ub;break;case"copy":case"cut":case"paste":z=Ip;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Uu;break;case"toggle":case"beforetoggle":z=fb}var ge=(t&4)!==0,tt=!ge&&(e==="scroll"||e==="scrollend"),N=ge?j!==null?j+"Capture":null:j;ge=[];for(var w=A,E;w!==null;){var G=w;if(E=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||E===null||N===null||(G=ri(w,N),G!=null&&ge.push(Ki(w,G,E))),tt)break;w=w.return}0<ge.length&&(j=new z(j,se,null,n,U),q.push({event:j,listeners:ge}))}}if((t&7)===0){e:{if(j=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",j&&n!==Ko&&(se=n.relatedTarget||n.fromElement)&&(tl(se)||se[wl]))break e;if((z||j)&&(j=U.window===U?U:(j=U.ownerDocument)?j.defaultView||j.parentWindow:window,z?(se=n.relatedTarget||n.toElement,z=A,se=se?tl(se):null,se!==null&&(tt=m(se),ge=se.tag,se!==tt||ge!==5&&ge!==27&&ge!==6)&&(se=null)):(z=null,se=A),z!==se)){if(ge=Lu,G="onMouseLeave",N="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Uu,G="onPointerLeave",N="onPointerEnter",w="pointer"),tt=z==null?j:qn(z),E=se==null?j:qn(se),j=new ge(G,w+"leave",z,n,U),j.target=tt,j.relatedTarget=E,G=null,tl(U)===A&&(ge=new ge(N,w+"enter",se,n,U),ge.target=E,ge.relatedTarget=tt,G=ge),tt=G,z&&se)t:{for(ge=dg,N=z,w=se,E=0,G=N;G;G=ge(G))E++;G=0;for(var fe=w;fe;fe=ge(fe))G++;for(;0<E-G;)N=ge(N),E--;for(;0<G-E;)w=ge(w),G--;for(;E--;){if(N===w||w!==null&&N===w.alternate){ge=N;break t}N=ge(N),w=ge(w)}ge=null}else ge=null;z!==null&&Rm(q,j,z,ge,!1),se!==null&&tt!==null&&Rm(q,tt,se,ge,!0)}}e:{if(j=A?qn(A):window,z=j.nodeName&&j.nodeName.toLowerCase(),z==="select"||z==="input"&&j.type==="file")var Xe=Vu;else if(qu(j))if(Zu)Xe=wb;else{Xe=xb;var re=vb}else z=j.nodeName,!z||z.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?A&&Yo(A.elementType)&&(Xe=Vu):Xe=Sb;if(Xe&&(Xe=Xe(e,A))){Xu(q,Xe,n,U);break e}re&&re(e,j,A),e==="focusout"&&A&&j.type==="number"&&A.memoizedProps.value!=null&&Ho(j,"number",j.value)}switch(re=A?qn(A):window,e){case"focusin":(qu(re)||re.contentEditable==="true")&&(Na=re,er=A,bi=null);break;case"focusout":bi=er=Na=null;break;case"mousedown":tr=!0;break;case"contextmenu":case"mouseup":case"dragend":tr=!1,ed(q,n,U);break;case"selectionchange":if(Tb)break;case"keydown":case"keyup":ed(q,n,U)}var Ae;if(Io)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Ta?Ku(e,n)&&(Ke="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ke="onCompositionStart");Ke&&(Bu&&n.locale!=="ko"&&(Ta||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Ta&&(Ae=ku()):(Tl=U,Vo="value"in Tl?Tl.value:Tl.textContent,Ta=!0)),re=io(A,Ke),0<re.length&&(Ke=new Ou(Ke,e,null,n,U),q.push({event:Ke,listeners:re}),Ae?Ke.data=Ae:(Ae=Gu(n),Ae!==null&&(Ke.data=Ae)))),(Ae=hb?pb(e,n):bb(e,n))&&(Ke=io(A,"onBeforeInput"),0<Ke.length&&(re=new Ou("onBeforeInput","beforeinput",null,n,U),q.push({event:re,listeners:Ke}),re.data=Ae)),og(q,e,A,n,U)}Am(q,t)})}function Ki(e,t,n){return{instance:e,listener:t,currentTarget:n}}function io(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=ri(e,n),a!=null&&l.unshift(Ki(e,a,i)),a=ri(e,t),a!=null&&l.push(Ki(e,a,i))),e.tag===3)return l;e=e.return}return[]}function dg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rm(e,t,n,l,a){for(var i=t._reactName,d=[];n!==null&&n!==l;){var h=n,v=h.alternate,A=h.stateNode;if(h=h.tag,v!==null&&v===l)break;h!==5&&h!==26&&h!==27||A===null||(v=A,a?(A=ri(n,i),A!=null&&d.unshift(Ki(n,A,v))):a||(A=ri(n,i),A!=null&&d.push(Ki(n,A,v)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var fg=/\r\n?/g,mg=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace(fg,`
|
|
33
|
-
`).replace(mg,"")}function zm(e,t){return t=Mm(t),Mm(e)===t}function et(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Sa(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Sa(e,""+l);break;case"className":ft(e,"class",l);break;case"tabIndex":ft(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ft(e,n,l);break;case"style":Mu(e,l,i);break;case"data":if(t!=="object"){ft(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ds(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&et(e,t,"name",a.name,a,null),et(e,t,"formEncType",a.formEncType,a,null),et(e,t,"formMethod",a.formMethod,a,null),et(e,t,"formTarget",a.formTarget,a,null)):(et(e,t,"encType",a.encType,a,null),et(e,t,"method",a.method,a,null),et(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ds(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=nl);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=ds(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Be("beforetoggle",e),Be("toggle",e),Dt(e,"popover",l);break;case"xlinkActuate":Tt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Tt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Tt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Tt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Tt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Tt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Tt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Tt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Tt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Dt(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Kp.get(n)||n,Dt(e,n,l))}}function Ec(e,t,n,l,a,i){switch(n){case"style":Mu(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Sa(e,l):(typeof l=="number"||typeof l=="bigint")&&Sa(e,""+l);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("scrollend",e);break;case"onClick":l!=null&&(e.onclick=nl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ne.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[Xt]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Dt(e,n,l)}}}function Kt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:et(e,t,i,d,n,null)}}a&&et(e,t,"srcSet",n.srcSet,n,null),l&&et(e,t,"src",n.src,n,null);return;case"input":Be("invalid",e);var h=i=d=a=null,v=null,A=null;for(l in n)if(n.hasOwnProperty(l)){var U=n[l];if(U!=null)switch(l){case"name":a=U;break;case"type":d=U;break;case"checked":v=U;break;case"defaultChecked":A=U;break;case"value":i=U;break;case"defaultValue":h=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:et(e,t,l,U,n,null)}}Eu(e,i,h,v,A,d,a,!1);return;case"select":Be("invalid",e),l=d=i=null;for(a in n)if(n.hasOwnProperty(a)&&(h=n[a],h!=null))switch(a){case"value":i=h;break;case"defaultValue":d=h;break;case"multiple":l=h;default:et(e,t,a,h,n,null)}t=i,n=d,e.multiple=!!l,t!=null?xa(e,!!l,t,!1):n!=null&&xa(e,!!l,n,!0);return;case"textarea":Be("invalid",e),i=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(h=n[d],h!=null))switch(d){case"value":l=h;break;case"defaultValue":a=h;break;case"children":i=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:et(e,t,d,h,n,null)}ju(e,l,a,i);return;case"option":for(v in n)if(n.hasOwnProperty(v)&&(l=n[v],l!=null))switch(v){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:et(e,t,v,l,n,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(l=0;l<Yi.length;l++)Be(Yi[l],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in n)if(n.hasOwnProperty(A)&&(l=n[A],l!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:et(e,t,A,l,n,null)}return;default:if(Yo(t)){for(U in n)n.hasOwnProperty(U)&&(l=n[U],l!==void 0&&Ec(e,t,U,l,n,void 0));return}}for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!=null&&et(e,t,h,l,n,null))}function hg(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,d=null,h=null,v=null,A=null,U=null;for(z in n){var q=n[z];if(n.hasOwnProperty(z)&&q!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":v=q;default:l.hasOwnProperty(z)||et(e,t,z,null,l,q)}}for(var j in l){var z=l[j];if(q=n[j],l.hasOwnProperty(j)&&(z!=null||q!=null))switch(j){case"type":i=z;break;case"name":a=z;break;case"checked":A=z;break;case"defaultChecked":U=z;break;case"value":d=z;break;case"defaultValue":h=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:z!==q&&et(e,t,j,z,l,q)}}Bo(e,d,h,v,A,U,i,a);return;case"select":z=d=h=j=null;for(i in n)if(v=n[i],n.hasOwnProperty(i)&&v!=null)switch(i){case"value":break;case"multiple":z=v;default:l.hasOwnProperty(i)||et(e,t,i,null,l,v)}for(a in l)if(i=l[a],v=n[a],l.hasOwnProperty(a)&&(i!=null||v!=null))switch(a){case"value":j=i;break;case"defaultValue":h=i;break;case"multiple":d=i;default:i!==v&&et(e,t,a,i,l,v)}t=h,n=d,l=z,j!=null?xa(e,!!n,j,!1):!!l!=!!n&&(t!=null?xa(e,!!n,t,!0):xa(e,!!n,n?[]:"",!1));return;case"textarea":z=j=null;for(h in n)if(a=n[h],n.hasOwnProperty(h)&&a!=null&&!l.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:et(e,t,h,null,l,a)}for(d in l)if(a=l[d],i=n[d],l.hasOwnProperty(d)&&(a!=null||i!=null))switch(d){case"value":j=a;break;case"defaultValue":z=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==i&&et(e,t,d,a,l,i)}Au(e,j,z);return;case"option":for(var se in n)if(j=n[se],n.hasOwnProperty(se)&&j!=null&&!l.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:et(e,t,se,null,l,j)}for(v in l)if(j=l[v],z=n[v],l.hasOwnProperty(v)&&j!==z&&(j!=null||z!=null))switch(v){case"selected":e.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:et(e,t,v,j,l,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in n)j=n[ge],n.hasOwnProperty(ge)&&j!=null&&!l.hasOwnProperty(ge)&&et(e,t,ge,null,l,j);for(A in l)if(j=l[A],z=n[A],l.hasOwnProperty(A)&&j!==z&&(j!=null||z!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(137,t));break;default:et(e,t,A,j,l,z)}return;default:if(Yo(t)){for(var tt in n)j=n[tt],n.hasOwnProperty(tt)&&j!==void 0&&!l.hasOwnProperty(tt)&&Ec(e,t,tt,void 0,l,j);for(U in l)j=l[U],z=n[U],!l.hasOwnProperty(U)||j===z||j===void 0&&z===void 0||Ec(e,t,U,j,l,z);return}}for(var N in n)j=n[N],n.hasOwnProperty(N)&&j!=null&&!l.hasOwnProperty(N)&&et(e,t,N,null,l,j);for(q in l)j=l[q],z=n[q],!l.hasOwnProperty(q)||j===z||j==null&&z==null||et(e,t,q,j,l,z)}function _m(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,d=a.initiatorType,h=a.duration;if(i&&h&&_m(d)){for(d=0,h=a.responseEnd,l+=1;l<n.length;l++){var v=n[l],A=v.startTime;if(A>h)break;var U=v.transferSize,q=v.initiatorType;U&&_m(q)&&(v=v.responseEnd,d+=U*(v<h?1:(h-A)/(v-A)))}if(--l,t+=8*(i+d)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ac=null,jc=null;function so(e){return e.nodeType===9?e:e.ownerDocument}function km(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mc=null;function bg(){var e=window.event;return e&&e.type==="popstate"?e===Mc?!1:(Mc=e,!0):(Mc=null,!1)}var Lm=typeof setTimeout=="function"?setTimeout:void 0,gg=typeof clearTimeout=="function"?clearTimeout:void 0,Om=typeof Promise=="function"?Promise:void 0,yg=typeof queueMicrotask=="function"?queueMicrotask:typeof Om<"u"?function(e){return Om.resolve(null).then(e).catch(vg)}:Lm;function vg(e){setTimeout(function(){throw e})}function Kl(e){return e==="head"}function Um(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),$a(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Gi(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Gi(n);for(var i=n.firstChild;i;){var d=i.nextSibling,h=i.nodeName;i[It]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=d}}else n==="body"&&Gi(e.ownerDocument.body);n=a}while(n);$a(t)}function Bm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function zc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":zc(n),ya(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function xg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[It])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function Sg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Nn(e.nextSibling),e===null))return null;return e}function Hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Nn(e.nextSibling),e===null))return null;return e}function _c(e){return e.data==="$?"||e.data==="$~"}function kc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function wg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Dc=null;function Ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Nn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Km(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Gm(e,t,n){switch(t=so(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Gi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ya(e)}var En=new Map,qm=new Set;function oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yl=X.d;X.d={f:Cg,r:Tg,D:Ng,C:Eg,L:Ag,m:jg,X:Mg,S:Rg,M:zg};function Cg(){var e=yl.f(),t=$s();return e||t}function Tg(e){var t=kn(e);t!==null&&t.tag===5&&t.type==="form"?sf(t):yl.r(e)}var Ja=typeof document>"u"?null:document;function Xm(e,t,n){var l=Ja;if(l&&typeof t=="string"&&t){var a=yn(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),qm.has(a)||(qm.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Kt(t,"link",e),vt(t),l.head.appendChild(t)))}}function Ng(e){yl.D(e),Xm("dns-prefetch",e,null)}function Eg(e,t){yl.C(e,t),Xm("preconnect",e,t)}function Ag(e,t,n){yl.L(e,t,n);var l=Ja;if(l&&e&&t){var a='link[rel="preload"][as="'+yn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+yn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+yn(n.imageSizes)+'"]')):a+='[href="'+yn(e)+'"]';var i=a;switch(t){case"style":i=Ia(e);break;case"script":i=Wa(e)}En.has(i)||(e=T({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),En.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(qi(i))||t==="script"&&l.querySelector(Xi(i))||(t=l.createElement("link"),Kt(t,"link",e),vt(t),l.head.appendChild(t)))}}function jg(e,t){yl.m(e,t);var n=Ja;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+yn(l)+'"][href="'+yn(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Wa(e)}if(!En.has(i)&&(e=T({rel:"modulepreload",href:e},t),En.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Xi(i)))return}l=n.createElement("link"),Kt(l,"link",e),vt(l),n.head.appendChild(l)}}}function Rg(e,t,n){yl.S(e,t,n);var l=Ja;if(l&&e){var a=Dn(l).hoistableStyles,i=Ia(e);t=t||"default";var d=a.get(i);if(!d){var h={loading:0,preload:null};if(d=l.querySelector(qi(i)))h.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},n),(n=En.get(i))&&Lc(e,n);var v=d=l.createElement("link");vt(v),Kt(v,"link",e),v._p=new Promise(function(A,U){v.onload=A,v.onerror=U}),v.addEventListener("load",function(){h.loading|=1}),v.addEventListener("error",function(){h.loading|=2}),h.loading|=4,ro(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:h},a.set(i,d)}}}function Mg(e,t){yl.X(e,t);var n=Ja;if(n&&e){var l=Dn(n).hoistableScripts,a=Wa(e),i=l.get(a);i||(i=n.querySelector(Xi(a)),i||(e=T({src:e,async:!0},t),(t=En.get(a))&&Oc(e,t),i=n.createElement("script"),vt(i),Kt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function zg(e,t){yl.M(e,t);var n=Ja;if(n&&e){var l=Dn(n).hoistableScripts,a=Wa(e),i=l.get(a);i||(i=n.querySelector(Xi(a)),i||(e=T({src:e,async:!0,type:"module"},t),(t=En.get(a))&&Oc(e,t),i=n.createElement("script"),vt(i),Kt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function Vm(e,t,n,l){var a=(a=xe.current)?oo(a):null;if(!a)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ia(n.href),n=Dn(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ia(n.href);var i=Dn(a).hoistableStyles,d=i.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=a.querySelector(qi(e)))&&!i._p&&(d.instance=i,d.state.loading=5),En.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},En.set(e,n),i||_g(a,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wa(n),n=Dn(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Ia(e){return'href="'+yn(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function Zm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function _g(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Kt(t,"link",n),vt(t),e.head.appendChild(t))}function Wa(e){return'[src="'+yn(e)+'"]'}function Xi(e){return"script[async]"+e}function Qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+yn(n.href)+'"]');if(l)return t.instance=l,vt(l),l;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),vt(l),Kt(l,"style",a),ro(l,n.precedence,e),t.instance=l;case"stylesheet":a=Ia(n.href);var i=e.querySelector(qi(a));if(i)return t.state.loading|=4,t.instance=i,vt(i),i;l=Zm(n),(a=En.get(a))&&Lc(l,a),i=(e.ownerDocument||e).createElement("link"),vt(i);var d=i;return d._p=new Promise(function(h,v){d.onload=h,d.onerror=v}),Kt(i,"link",l),t.state.loading|=4,ro(i,n.precedence,e),t.instance=i;case"script":return i=Wa(n.src),(a=e.querySelector(Xi(i)))?(t.instance=a,vt(a),a):(l=n,(a=En.get(i))&&(l=T({},n),Oc(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),vt(a),Kt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ro(l,n.precedence,e));return t.instance}function ro(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,d=0;d<l.length;d++){var h=l[d];if(h.dataset.precedence===t)i=h;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Lc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var co=null;function Fm(e,t,n){if(co===null){var l=new Map,a=co=new Map;a.set(n,l)}else a=co,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[It]||i[Mt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var h=l.get(d);h?h.push(i):l.set(d,[i])}}return l}function Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function kg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Im(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ia(l.href),i=t.querySelector(qi(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=uo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,vt(i);return}i=t.ownerDocument||t,l=Zm(l),(a=En.get(a))&&Lc(l,a),i=i.createElement("link"),vt(i);var d=i;d._p=new Promise(function(h,v){d.onload=h,d.onerror=v}),Kt(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=uo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Uc=0;function Lg(e,t){return e.stylesheets&&e.count===0&&mo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&mo(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Uc===0&&(Uc=62500*pg());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mo(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Uc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fo=null;function mo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fo=new Map,t.forEach(Og,e),fo=null,uo.call(e))}function Og(e,t){if(!(t.state.loading&4)){var n=fo.get(e);if(n)var l=n.get(null);else{n=new Map,fo.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var d=a[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=t.instance,d=a.getAttribute("data-precedence"),i=n.get(d)||l,i===l&&n.set(null,a),n.set(d,a),this.count++,l=uo.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Vi={$$typeof:J,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function Ug(e,t,n,l,a,i,d,h,v){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=I(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I(0),this.hiddenUpdates=I(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function Wm(e,t,n,l,a,i,d,h,v,A,U,q){return e=new Ug(e,t,n,d,v,A,U,q,h),t=1,i===!0&&(t|=24),i=on(3,null,null,t),e.current=i,i.stateNode=e,t=br(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},xr(i),e}function $m(e){return e?(e=ja,e):ja}function Pm(e,t,n,l,a,i){a=$m(a),l.context===null?l.context=a:l.pendingContext=a,l=Ml(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=zl(e,l,t),n!==null&&(ln(n,e,t),Ci(n,e,t))}function eh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bc(e,t){eh(e,t),(e=e.alternate)&&eh(e,t)}function th(e){if(e.tag===13||e.tag===31){var t=Pl(e,67108864);t!==null&&ln(t,e,67108864),Bc(e,67108864)}}function nh(e){if(e.tag===13||e.tag===31){var t=fn();t=ot(t);var n=Pl(e,t);n!==null&&ln(n,e,t),Bc(e,t)}}var ho=!0;function Bg(e,t,n,l){var a=M.T;M.T=null;var i=X.p;try{X.p=2,Hc(e,t,n,l)}finally{X.p=i,M.T=a}}function Hg(e,t,n,l){var a=M.T;M.T=null;var i=X.p;try{X.p=8,Hc(e,t,n,l)}finally{X.p=i,M.T=a}}function Hc(e,t,n,l){if(ho){var a=Yc(l);if(a===null)Nc(e,t,l,po,n),ah(e,l);else if(Kg(a,e,t,n,l))l.stopPropagation();else if(ah(e,l),t&4&&-1<Yg.indexOf(e)){for(;a!==null;){var i=kn(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=Jt(i.pendingLanes);if(d!==0){var h=i;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var v=1<<31-Ut(d);h.entanglements[1]|=v,d&=~v}Jn(i),(Ze&6)===0&&(Is=ee()+500,Hi(0))}}break;case 31:case 13:h=Pl(i,2),h!==null&&ln(h,i,2),$s(),Bc(i,2)}if(i=Yc(l),i===null&&Nc(e,t,l,po,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else Nc(e,t,l,null,n)}}function Yc(e){return e=Go(e),Kc(e)}var po=null;function Kc(e){if(po=null,e=tl(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=b(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return po=e,null}function lh(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case _e:return 2;case He:return 8;case an:case $n:return 32;case qt:return 268435456;default:return 32}default:return 32}}var Gc=!1,Gl=null,ql=null,Xl=null,Zi=new Map,Qi=new Map,Vl=[],Yg="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".split(" ");function ah(e,t){switch(e){case"focusin":case"focusout":Gl=null;break;case"dragenter":case"dragleave":ql=null;break;case"mouseover":case"mouseout":Xl=null;break;case"pointerover":case"pointerout":Zi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qi.delete(t.pointerId)}}function Fi(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=kn(t),t!==null&&th(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Kg(e,t,n,l,a){switch(t){case"focusin":return Gl=Fi(Gl,e,t,n,l,a),!0;case"dragenter":return ql=Fi(ql,e,t,n,l,a),!0;case"mouseover":return Xl=Fi(Xl,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return Zi.set(i,Fi(Zi.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,Qi.set(i,Fi(Qi.get(i)||null,e,t,n,l,a)),!0}return!1}function ih(e){var t=tl(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=b(n),t!==null){e.blockedOn=t,_n(e.priority,function(){nh(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,_n(e.priority,function(){nh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function bo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Ko=l,n.target.dispatchEvent(l),Ko=null}else return t=kn(n),t!==null&&th(t),e.blockedOn=n,!1;t.shift()}return!0}function sh(e,t,n){bo(e)&&n.delete(t)}function Gg(){Gc=!1,Gl!==null&&bo(Gl)&&(Gl=null),ql!==null&&bo(ql)&&(ql=null),Xl!==null&&bo(Xl)&&(Xl=null),Zi.forEach(sh),Qi.forEach(sh)}function go(e,t){e.blockedOn===t&&(e.blockedOn=null,Gc||(Gc=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Gg)))}var yo=null;function oh(e){yo!==e&&(yo=e,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){yo===e&&(yo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Kc(l||n)===null)continue;break}var i=kn(n);i!==null&&(e.splice(t,3),t-=3,Yr(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function $a(e){function t(v){return go(v,e)}Gl!==null&&go(Gl,e),ql!==null&&go(ql,e),Xl!==null&&go(Xl,e),Zi.forEach(t),Qi.forEach(t);for(var n=0;n<Vl.length;n++){var l=Vl[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Vl.length&&(n=Vl[0],n.blockedOn===null);)ih(n),n.blockedOn===null&&Vl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],d=a[Xt]||null;if(typeof i=="function")d||oh(n);else if(d){var h=null;if(i&&i.hasAttribute("formAction")){if(a=i,d=i[Xt]||null)h=d.formAction;else if(Kc(a)!==null)continue}else h=d.action;typeof h=="function"?n[l+1]=h:(n.splice(l,3),l-=3),oh(n)}}}function rh(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function qc(e){this._internalRoot=e}vo.prototype.render=qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=fn();Pm(n,l,e,t,null,null)},vo.prototype.unmount=qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Pm(e.current,2,null,e,null,null),$s(),t[wl]=null}};function vo(e){this._internalRoot=e}vo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vl.length&&t!==0&&t<Vl[n].priority;n++);Vl.splice(n,0,e),n===0&&ih(e)}};var ch=s.version;if(ch!=="19.2.8")throw Error(c(527,ch,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=S(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var qg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xo.isDisabled&&xo.supportsFiber)try{Kn=xo.inject(qg),Ot=xo}catch{}}return Ii.createRoot=function(e,t){if(!f(e))throw Error(c(299));var n=!1,l="",a=bf,i=gf,d=yf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wm(e,1,!1,null,null,n,l,null,a,i,d,rh),e[wl]=t.current,Tc(e),new qc(t)},Ii.hydrateRoot=function(e,t,n){if(!f(e))throw Error(c(299));var l=!1,a="",i=bf,d=gf,h=yf,v=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(h=n.onRecoverableError),n.formState!==void 0&&(v=n.formState)),t=Wm(e,1,!0,t,n??null,l,a,v,i,d,h,rh),t.context=$m(null),n=t.current,l=fn(),l=ot(l),a=Ml(l),a.callback=null,zl(n,a,l),n=l,t.current.lanes=n,te(t,n),Jn(t),e[wl]=t.current,Tc(e),new vo(t)},Ii.version="19.2.8",Ii}var ph;function ny(){if(ph)return Vc.exports;ph=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(s){console.error(s)}}return o(),Vc.exports=ty(),Vc.exports}var ly=ny();const ay=Jh(ly),ye={ESC:"\x1B",TAB:" ",ENTER:"\r",BACKSPACE:"",UP:"\x1B[A",DOWN:"\x1B[B",RIGHT:"\x1B[C",LEFT:"\x1B[D",HOME:"\x1B[H",END:"\x1B[F",PAGE_UP:"\x1B[5~",PAGE_DOWN:"\x1B[6~",INSERT:"\x1B[2~",DELETE:"\x1B[3~",CTRL_C:"",CTRL_D:"",CTRL_Z:"",CTRL_L:"\f",CTRL_A:"",CTRL_E:"",CTRL_K:"\v",CTRL_R:"",CTRL_W:"",CTRL_U:"",CTRL_X:"",CTRL_N:"",CTRL_P:"",F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"},iy=new TextEncoder;function Wh(o){return iy.encode(o)}function sy(o){if(!o||o.length===0)return"";const r=o.toUpperCase().charCodeAt(0);return r>=65&&r<=90?String.fromCharCode(r-64):o==="@"||o===" "?"\0":o==="["?"\x1B":o==="\\"?"":o==="]"?"":o==="^"?"":o==="_"?"":o==="?"?"":o}function oy(o){return`\x1B${o}`}function ry(o,s){let r=o;return s.shift&&o.length===1&&!s.ctrl&&(r=o.toUpperCase()),s.ctrl&&(r=sy(r)),s.alt&&(r=oy(r)),r}class cy{constructor(s){Fe(this,"ws",null);Fe(this,"config");Fe(this,"state","disconnected");Fe(this,"currentRole","viewer");Fe(this,"controllerId");Fe(this,"hostId");Fe(this,"assignedClientId");Fe(this,"reconnectAttempts",0);Fe(this,"reconnectTimer",null);Fe(this,"pingTimer",null);Fe(this,"pingTimestamp",null);Fe(this,"isManuallyClosed",!1);Fe(this,"authFailureDetail",null);Fe(this,"authFailureCode",null);Fe(this,"temporaryFailureCode",null);Fe(this,"listeners",{stateChange:new Set,roleChange:new Set,ready:new Set,paired:new Set,controlState:new Set,controlRevoked:new Set,sessionReady:new Set,exit:new Set,controlGranted:new Set,controlDenied:new Set,status:new Set,peerCount:new Set,hostReconnecting:new Set,sessionRestarted:new Set,error:new Set,binaryData:new Set,rttUpdate:new Set,pasteFileReady:new Set});Fe(this,"terminalCols",80);Fe(this,"terminalRows",24);this.config={...s}}updateConfig(s){this.config={...this.config,...s}}getConfig(){return{...this.config}}getState(){return this.state}getRole(){return this.currentRole}getControllerId(){return this.controllerId}getHostId(){return this.hostId}getAssignedClientId(){return this.assignedClientId}on(s,r){return this.listeners[s].add(r),()=>{this.listeners[s].delete(r)}}emit(s,...r){this.listeners[s].forEach(f=>{try{f(...r)}catch(m){console.error(`Error in event listener for ${s}:`,m)}})}setState(s,r,c){this.state!==s&&(this.state=s,this.emit("stateChange",s,r,c))}connect(s){if(s&&(this.terminalCols=s.cols,this.terminalRows=s.rows),!(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))){this.teardownSocket(1e3,"Replaced by a new connection"),this.isManuallyClosed=!1,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.clearTimers(),this.setState("connecting");try{const r=this.resolveWsUrl(this.config.wsUrl),c=new WebSocket(r);this.ws=c,c.binaryType="arraybuffer",c.onopen=()=>{this.isStaleSocket(c)||this.handleOpen()},c.onmessage=f=>{this.isStaleSocket(c)||this.handleMessage(f)},c.onerror=f=>{this.isStaleSocket(c)||this.handleError(f)},c.onclose=f=>{this.isStaleSocket(c)||this.handleClose(f)}}catch(r){this.setState("error",r instanceof Error?r.message:"Connection failed","connection_failed"),this.scheduleReconnect()}}}isStaleSocket(s){return this.ws!==s}teardownSocket(s=1e3,r="Client closed the connection"){const c=this.ws;if(c){this.ws=null,c.onopen=null,c.onmessage=null,c.onerror=null,c.onclose=null;try{(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING)&&c.close(s,r)}catch{}}}disconnect(){this.isManuallyClosed=!0,this.clearTimers(),this.teardownSocket(1e3,"User initiated disconnect"),this.setState("disconnected")}reconnectWith(s){this.updateConfig(s),this.clearTimers(),this.teardownSocket(1e3,"Reconnecting with new credentials"),this.isManuallyClosed=!1,this.reconnectAttempts=0,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.connect()}handleOpen(){this.sendHello(),this.startHeartbeat()}async handleMessage(s){if(typeof s.data=="string")try{const r=JSON.parse(s.data);this.processJsonMessage(r)}catch(r){console.warn("Received unparseable text frame from server:",r)}else if(s.data instanceof ArrayBuffer)this.emit("binaryData",new Uint8Array(s.data));else if(typeof Blob<"u"&&s.data instanceof Blob)try{const r=await s.data.arrayBuffer();this.emit("binaryData",new Uint8Array(r))}catch(r){console.error("Failed to convert Blob to ArrayBuffer:",r)}}processJsonMessage(s){switch(s.type){case"ready":{this.reconnectAttempts=0,this.setState("connected"),this.currentRole=s.role,this.controllerId=s.controllerId,this.hostId=s.hostId,this.assignedClientId=s.clientId,this.emit("ready",s),this.emit("roleChange",s.role,s.controllerId,s.hostId,s.clientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"paired":{this.emit("paired",{token:s.token,deviceId:s.deviceId,hostId:s.hostId,expiresAt:s.expiresAt});break}case"control_state":{this.currentRole=s.role,this.controllerId=s.controllerId,this.emit("controlState",s.role,s.controllerId),this.emit("roleChange",s.role,s.controllerId,this.hostId,this.assignedClientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"host_reconnecting":{this.temporaryFailureCode="host_reconnecting",this.setState("reconnecting","Herdr host is reconnecting",s.code||"host_reconnecting"),this.emit("hostReconnecting",s.code);break}case"session_restarted":{this.setState("reconnecting","Herdr session is restarting","session_restarted"),this.emit("sessionRestarted",s.cols,s.rows,s.terminalPalette,s.hostname);break}case"control_revoked":{this.currentRole="viewer",this.emit("controlRevoked",s.reason),this.emit("roleChange","viewer",this.controllerId,this.hostId,this.assignedClientId);break}case"session_ready":{this.setState("connected"),this.emit("sessionReady",s);break}case"exit":{this.emit("exit",s.code,s.reason);break}case"control_granted":{this.currentRole="controller",this.controllerId=this.assignedClientId||this.config.clientId,this.emit("controlGranted"),this.emit("roleChange","controller",this.controllerId,this.hostId,this.assignedClientId);break}case"control_denied":{this.emit("controlDenied",s.message);break}case"status":{this.emit("status",s);break}case"error":{s.code==="host_offline"||s.code==="host_reconnecting"||s.code==="host_reconnect_timeout"||s.code==="rate_limited"?(this.temporaryFailureCode=String(s.code),this.setState("reconnecting",s.message,String(s.code))):(s.code==="auth_required"||s.code==="unauthorized"||s.code==="device_revoked"||s.code==="invalid_handshake"||s.code==="too_many_hosts"||s.code===401||s.code===403)&&(this.authFailureDetail=s.message,this.authFailureCode=String(s.code),this.setState("error",s.message,this.authFailureCode)),this.emit("error",{code:s.code,message:s.message});break}case"pong":{if(this.pingTimestamp){const r=Math.max(0,performance.now()-this.pingTimestamp);this.pingTimestamp=null,this.emit("rttUpdate",Math.round(r))}break}case"paste_file_ready":{this.emit("pasteFileReady",s.path);break}}}handleError(s){console.error("WebSocket error:",s),this.emit("error",{code:"WS_ERROR",message:"WebSocket connection error"})}handleClose(s){if(this.clearTimers(),this.ws=null,this.authFailureDetail){this.setState("error",this.authFailureDetail,this.authFailureCode??void 0);return}if(s.code===1008&&this.temporaryFailureCode){this.setState("reconnecting",s.reason||"The relay is temporarily unavailable",this.temporaryFailureCode),this.scheduleReconnect();return}if(s.code===1008){this.setState("error",s.reason||"The relay rejected the connection",String(s.code));return}!this.isManuallyClosed&&this.config.autoReconnect?(this.setState("reconnecting",`Connection closed (${s.code}). Retrying...`,"connection_closed"),this.scheduleReconnect()):this.setState("disconnected",`Closed: ${s.reason||s.code}`,"connection_closed")}scheduleReconnect(){if(this.isManuallyClosed||!this.config.autoReconnect)return;if(this.config.maxReconnectAttempts>0&&this.reconnectAttempts>=this.config.maxReconnectAttempts){this.setState("error","Max reconnect attempts reached");return}this.reconnectAttempts++;const s=this.config.reconnectIntervalMs||2e3,c=Math.min(3e4,Math.floor(s*Math.pow(1.5,this.reconnectAttempts-1)+Math.random()*500));this.reconnectTimer=setTimeout(()=>{this.connect()},c)}startHeartbeat(){this.pingTimer&&clearInterval(this.pingTimer);const s=this.config.pingIntervalMs||1e4;this.pingTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.sendPing()},s)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}sendHello(){const s={type:"hello",protocol:1,clientId:this.config.clientId,cols:this.terminalCols,rows:this.terminalRows,capabilities:["host_handoff"]};this.config.token&&(s.token=this.config.token),this.config.pairCode&&(s.pairCode=this.config.pairCode),this.sendJson(s)}claimControl(s=!1){const r={type:"claim_control",...s?{force:!0}:{}};this.sendJson(r)}releaseControl(){const s={type:"release_control"};this.sendJson(s)}sendResize(s,r){this.terminalCols=s,this.terminalRows=r;const c={type:"resize",cols:s,rows:r};this.sendJson(c)}sendPing(){this.pingTimestamp=performance.now();const s={type:"ping"};this.sendJson(s)}sendPasteFile(s,r){this.sendJson({type:"paste_file",mime:s,dataBase64:r})}sendJson(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(s))}sendBinary(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(s)}sendText(s){const r=Wh(s);this.sendBinary(r)}resolveWsUrl(s){if(/^wss?:\/\//i.test(s))return s;if(/^https?:\/\//i.test(s)){const r=new URL(s);return r.protocol=r.protocol==="https:"?"wss:":"ws:",(!r.pathname||r.pathname==="/")&&(r.pathname="/ws/client"),r.toString()}if(typeof window<"u"&&window.location){const c=window.location.protocol==="https:"?"wss:":"ws:",f=window.location.host,m=s.startsWith("/")?s:`/${s}`;return`${c}//${f}${m}`}return"ws://127.0.0.1:8787/ws/client"}}const $h=27,Ph=91,uy=60,bh=59,ep=77,tp=48,dy=57,fy=64,my=-30,Fc=32,gh=255;function np(o){return Number.isInteger(o)&&(o&my)===fy}function hy(o){return o>=tp&&o<=dy}function Jc(o,s){let r=s,c=0;for(;r<o.length&&hy(o[r]);){if(c=c*10+(o[r]-tp),c>65535)return null;r+=1}return r===s?null:{value:c,next:r}}function py(o,s){if(o[s]!==$h||o[s+1]!==Ph||o[s+2]!==uy)return-1;const r=Jc(o,s+3);if(!r||!np(r.value)||o[r.next]!==bh)return-1;const c=Jc(o,r.next+1);if(!c||o[c.next]!==bh)return-1;const f=Jc(o,c.next+1);return!f||o[f.next]!==ep?-1:f.next+1}function by(o,s){if(o[s]!==$h||o[s+1]!==Ph||o[s+2]!==ep||s+6>o.length)return-1;const r=o[s+3]-Fc,c=o[s+4],f=o[s+5];return!np(r)||c<Fc||c>gh||f<Fc||f>gh?-1:s+6}function lu(o){if(!o)return!1;const s=o instanceof Uint8Array?o:new Uint8Array(o);if(s.length===0)return!1;let r=0;for(;r<s.length;){const c=py(s,r);if(c>r){r=c;continue}const f=by(s,r);if(f>r){r=f;continue}return!1}return!0}const gy=10,yy=24,_o=15,fu=13,mu=640;function vy(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches))return!0}catch{}return ei()<mu}function ei(){return typeof window>"u"?1024:window.visualViewport&&typeof window.visualViewport.width=="number"&&window.visualViewport.width>0?window.visualViewport.width:window.innerWidth||1024}function Ic(){return typeof window>"u"?768:window.visualViewport&&typeof window.visualViewport.height=="number"&&window.visualViewport.height>0?window.visualViewport.height:window.innerHeight||768}function jo(o,s=_o){const r=typeof o=="number"?o:Number(o);return!Number.isFinite(r)||r<=0?s:Math.min(yy,Math.max(gy,Math.round(r)))}function yh(o,s=ei()){if(s<mu){const c=jo(o,fu);return Math.min(15,Math.max(12,c))}return jo(o,_o)}const lp=[{id:"esc",label:"ESC",code:ye.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:ye.TAB,type:"key",enabled:!0,title:"Tab"},{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"left",label:"←",code:ye.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:ye.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:ye.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:ye.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"drawer_chords",label:"^C",code:"",type:"drawer",enabled:!0,drawerType:"chords",title:"Quick Ctrl Chords"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"enter",label:"Enter",code:ye.ENTER,type:"key",enabled:!0,title:"Enter / Return"}],xy=[{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"shift",label:"SHIFT",code:"",type:"modifier",enabled:!0,modifierType:"shift",title:"Toggle Shift modifier latch"},{id:"meta",label:"META",code:"\x1B",type:"modifier",enabled:!0,modifierType:"meta",title:"Meta / Cmd key"},{id:"esc",label:"ESC",code:ye.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:ye.TAB,type:"key",enabled:!0,title:"Tab"},{id:"enter",label:"Enter",code:ye.ENTER,type:"key",enabled:!0,title:"Enter / Return"},{id:"backspace",label:"⌫",code:ye.BACKSPACE,type:"key",enabled:!0,title:"Backspace"},{id:"delete",label:"Del",code:ye.DELETE,type:"key",enabled:!0,title:"Delete"},{id:"left",label:"←",code:ye.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:ye.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:ye.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:ye.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"home",label:"Home",code:ye.HOME,type:"key",enabled:!0,title:"Home"},{id:"end",label:"End",code:ye.END,type:"key",enabled:!0,title:"End"},{id:"page_up",label:"PgUp",code:ye.PAGE_UP,type:"key",enabled:!0,title:"Page Up"},{id:"page_down",label:"PgDn",code:ye.PAGE_DOWN,type:"key",enabled:!0,title:"Page Down"},{id:"insert",label:"Ins",code:ye.INSERT,type:"key",enabled:!0,title:"Insert"},{id:"ctrl_c",label:"^C",code:ye.CTRL_C,type:"chord",enabled:!0,title:"Ctrl+C (SIGINT)"},{id:"ctrl_d",label:"^D",code:ye.CTRL_D,type:"chord",enabled:!0,title:"Ctrl+D (EOF/Exit)"},{id:"ctrl_z",label:"^Z",code:ye.CTRL_Z,type:"chord",enabled:!0,title:"Ctrl+Z (SIGTSTP)"},{id:"ctrl_l",label:"^L",code:ye.CTRL_L,type:"chord",enabled:!0,title:"Ctrl+L (Clear Screen)"},{id:"ctrl_a",label:"^A",code:ye.CTRL_A,type:"chord",enabled:!0,title:"Ctrl+A (Beginning of Line)"},{id:"ctrl_e",label:"^E",code:ye.CTRL_E,type:"chord",enabled:!0,title:"Ctrl+E (End of Line)"},{id:"ctrl_k",label:"^K",code:ye.CTRL_K,type:"chord",enabled:!0,title:"Ctrl+K (Kill to End)"},{id:"ctrl_r",label:"^R",code:ye.CTRL_R,type:"chord",enabled:!0,title:"Ctrl+R (Reverse Search)"},{id:"f1",label:"F1",code:ye.F1,type:"fn",enabled:!0,title:"F1"},{id:"f2",label:"F2",code:ye.F2,type:"fn",enabled:!0,title:"F2"},{id:"f3",label:"F3",code:ye.F3,type:"fn",enabled:!0,title:"F3"},{id:"f4",label:"F4",code:ye.F4,type:"fn",enabled:!0,title:"F4"},{id:"f5",label:"F5",code:ye.F5,type:"fn",enabled:!0,title:"F5"},{id:"f6",label:"F6",code:ye.F6,type:"fn",enabled:!0,title:"F6"},{id:"f7",label:"F7",code:ye.F7,type:"fn",enabled:!0,title:"F7"},{id:"f8",label:"F8",code:ye.F8,type:"fn",enabled:!0,title:"F8"},{id:"f9",label:"F9",code:ye.F9,type:"fn",enabled:!0,title:"F9"},{id:"f10",label:"F10",code:ye.F10,type:"fn",enabled:!0,title:"F10"},{id:"f11",label:"F11",code:ye.F11,type:"fn",enabled:!0,title:"F11"},{id:"f12",label:"F12",code:ye.F12,type:"fn",enabled:!0,title:"F12"},{id:"drawer_chords",label:"^C",code:"",type:"drawer",enabled:!0,drawerType:"chords",title:"Quick Ctrl Chords"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"sym_pipe",label:"|",code:"|",type:"symbol",enabled:!0,isPlainChar:!0,title:"Pipe (|)"},{id:"sym_tilde",label:"~",code:"~",type:"symbol",enabled:!0,isPlainChar:!0,title:"Tilde (~)"},{id:"sym_slash",label:"/",code:"/",type:"symbol",enabled:!0,isPlainChar:!0,title:"Slash (/)"},{id:"sym_backslash",label:"\\",code:"\\",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backslash (\\)"},{id:"sym_dash",label:"-",code:"-",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dash (-)"},{id:"sym_underscore",label:"_",code:"_",type:"symbol",enabled:!0,isPlainChar:!0,title:"Underscore (_)"},{id:"sym_dollar",label:"$",code:"$",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dollar ($)"},{id:"sym_ampersand",label:"&",code:"&",type:"symbol",enabled:!0,isPlainChar:!0,title:"Ampersand (&)"},{id:"sym_quote",label:'"',code:'"',type:"symbol",enabled:!0,isPlainChar:!0,title:'Double Quote (")'},{id:"sym_backtick",label:"`",code:"`",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backtick (`)"}];function os(){return JSON.parse(JSON.stringify(lp))}const vh=["esc","tab","ctrl","alt","left","up","down","right","enter","drawer_chords","drawer_symbols","drawer_fn"];function Sy(o){return o.length!==vh.length?!1:o.every((s,r)=>s.id===vh[r]&&s.enabled!==!1)}function wy(o){if(!Array.isArray(o)||o.length===0)return os();const s=o.filter(r=>typeof r=="object"&&r!==null&&typeof r.id=="string"&&typeof r.label=="string"&&typeof r.code=="string");return Sy(s)?os():s}function au(o,s){if(s){const r=`keyTitles.${o.id}`,c=s(r);if(c&&c!==r)return c}return o.title||o.label}const iu='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace',Cy='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',xh="JetBrains Mono, Menlo, Monaco, Consolas, monospace",ti="herdr_remote_settings_v1",ss="herdr_remote_session_view_v1",ap=64,rs=4096,su={local:{},session:{}};function Ro(o,s){if(typeof window>"u")return su[o][s]||null;try{return(o==="local"?window.localStorage:window.sessionStorage).getItem(s)}catch{return su[o][s]||null}}function ma(o,s,r){if(su[o][s]=r,!(typeof window>"u"))try{(o==="local"?window.localStorage:window.sessionStorage).setItem(s,r)}catch(c){console.warn(`Failed to write to ${o}Storage:`,c)}}function Ty(){return`client-${Math.random().toString(36).substring(2,8)}`}function hu(){const o=Math.random().toString(36).substring(2,10);return`profile-${Date.now().toString(36)}-${o}`}function Ny(o,s){return(typeof o=="string"?o.trim().slice(0,ap):"")||s}function Mo(o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;const r=o,c=typeof r.wsUrl=="string"?r.wsUrl.trim().slice(0,2048):"",f=typeof r.token=="string"?r.token.slice(0,rs):"",m=typeof r.pairCode=="string"?r.pairCode.trim().toUpperCase().slice(0,32):"";if(!c||!c.startsWith("/")&&!/^(?:wss?|https?):\/\//i.test(c)||!f&&!m)return null;const b=Date.now(),p=typeof r.id=="string"&&r.id.length>0?r.id.slice(0,128):hu(),y=typeof r.hostname=="string"&&r.hostname.trim()?r.hostname.trim().slice(0,ap):`Herdr ${s+1}`;return{id:p,displayName:Ny(r.displayName,y),wsUrl:c,token:f,...m?{pairCode:m}:{},...typeof r.hostId=="string"&&r.hostId.trim()?{hostId:r.hostId.trim().slice(0,128)}:{},...typeof r.hostname=="string"&&r.hostname.trim()?{hostname:r.hostname.trim().slice(0,128)}:{},...typeof r.deviceId=="string"&&r.deviceId.trim()?{deviceId:r.deviceId.trim().slice(0,128)}:{},autoReconnect:r.autoReconnect!==!1,createdAt:Number.isFinite(r.createdAt)?Number(r.createdAt):b,lastUsedAt:Number.isFinite(r.lastUsedAt)?Number(r.lastUsedAt):b}}function Sh(o,s=0){const r=Mo({...o,id:o.id||hu()},s);if(!r)throw new Error("a connection profile requires a relay URL and token or pairing code");return r}function wh(o){let s=o.wsUrl.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"").toLowerCase();if(typeof window<"u")try{const r=new URL(o.wsUrl,window.location.origin);r.protocol=r.protocol==="wss:"?"https:":"http:",r.pathname=r.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"")||"/",r.search="",r.hash="",s=r.toString().replace(/\/$/,"").toLowerCase()}catch{}return`${s}::${o.hostId||""}`}function ip(){return typeof navigator<"u"&&navigator.language&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function sp(){const o=typeof window<"u"&&window.innerWidth<640;return{wsUrl:"/ws/client",token:"",pairCode:"",clientId:Ty(),autoReconnect:!0,profiles:[],activeProfileId:"",fontSize:o?fu:_o,fontFamily:iu,toolbarVisible:!0,toolbarPosition:"bottom",vibrateOnKeyPress:!0,language:ip(),virtualKeys:os(),adminToken:"",adminTokens:{}}}const Ey=["wsUrl","token","pairCode","clientId","autoReconnect","language"],Ay=["wsUrl","token","pairCode","autoReconnect"],pu=["fontSize","fontFamily","toolbarVisible","toolbarPosition","vibrateOnKeyPress","virtualKeys","adminToken","adminTokens"],jy=pu.filter(o=>o!=="adminToken"&&o!=="adminTokens"),Ch=["theme","colorMode"];function ou(o){const s=o;if(!Ch.some(f=>s[f]!==void 0))return{data:o,changed:!1};const c={...s};for(const f of Ch)delete c[f];return{data:c,changed:!0}}function op(o){if(!o||typeof o!="object"||Array.isArray(o))return{};const s={};for(const[r,c]of Object.entries(o).slice(0,32))typeof c!="string"||c.length===0||(s[r.slice(0,512)]=c.slice(0,rs));return s}function rp(o){var m;const s=[];if((Array.isArray(o.profiles)?o.profiles.slice(0,64):[]).forEach((b,p)=>{const y=Mo(b,p);y&&!s.some(S=>S.id===y.id)&&s.push(y)}),s.length===0&&(typeof o.token=="string"&&o.token||typeof o.pairCode=="string"&&o.pairCode)){const b=Mo({id:"profile-migrated",displayName:"Herdr 1",wsUrl:typeof o.wsUrl=="string"&&o.wsUrl.trim()?o.wsUrl:"/ws/client",token:o.token||"",pairCode:o.pairCode||"",autoReconnect:o.autoReconnect!==!1},0);b&&s.push(b)}const c=typeof o.activeProfileId=="string"?o.activeProfileId:"",f=s.some(b=>b.id===c)?c:((m=s[0])==null?void 0:m.id)||"";return{profiles:s,activeProfileId:f}}function cp(){const o=sp();if(typeof window>"u")return o;let s={};const r=Ro("local",ti);if(r)try{s=JSON.parse(r)}catch(_){console.warn("Failed to parse localStorage settings:",_)}const c=ou(s);c.changed&&(s=c.data,ma("local",ti,JSON.stringify(s)));let f=null;const m=Ro("session",ss);if(m)try{f=JSON.parse(m)}catch(_){console.warn("Failed to parse sessionStorage settings:",_)}if(!f){const _={};for(const R of pu)s[R]!==void 0&&(_[R]=s[R]);f=_,ma("session",ss,JSON.stringify(f))}let b=f.fontFamily??s.fontFamily??o.fontFamily;(!b||b===xh||b===Cy)&&(b=iu);const p=window.innerWidth<640?fu:_o,y=f.fontSize??s.fontSize??o.fontSize,S=jo(y,p),g=f.virtualKeys??s.virtualKeys??o.virtualKeys,T=wy(g),B=s.language??o.language,O=B==="zh"||B==="en"?B:ip(),L=rp(s),V=L.profiles.find(_=>_.id===L.activeProfileId),k=ou(f);k.changed&&(f=k.data,ma("session",ss,JSON.stringify(f)));const Q=f.toolbarVisible??s.toolbarVisible??o.toolbarVisible,P=f.toolbarPosition??s.toolbarPosition??o.toolbarPosition,J=f.vibrateOnKeyPress??s.vibrateOnKeyPress??o.vibrateOnKeyPress,oe=typeof f.adminToken=="string"?f.adminToken.slice(0,rs):typeof s.adminToken=="string"?s.adminToken.slice(0,rs):o.adminToken,ce=op(f.adminTokens),Y={...o,...s,...f,wsUrl:(V==null?void 0:V.wsUrl)||(typeof s.wsUrl=="string"?s.wsUrl:o.wsUrl),token:(V==null?void 0:V.token)||"",pairCode:(V==null?void 0:V.pairCode)||"",autoReconnect:(V==null?void 0:V.autoReconnect)??o.autoReconnect,profiles:L.profiles,activeProfileId:L.activeProfileId,clientId:typeof s.clientId=="string"&&s.clientId.trim()?s.clientId.trim().slice(0,128):o.clientId,fontFamily:b,fontSize:S,toolbarVisible:Q,toolbarPosition:P,vibrateOnKeyPress:J,virtualKeys:T,language:O,adminToken:oe,adminTokens:ce};return s.fontFamily===xh&&(s.fontFamily=iu,ma("local",ti,JSON.stringify(s))),Y}function Ql(o){var B;const r={...cp(),...o};r.adminTokens=op(r.adminTokens),typeof r.adminToken=="string"&&(r.adminToken=r.adminToken.slice(0,rs)),o.fontSize!==void 0&&(r.fontSize=jo(o.fontSize));const c=rp(r);let f=c.profiles,m=c.activeProfileId;if(Ay.some(O=>o[O]!==void 0)){const O=f.findIndex(k=>k.id===m),L=O>=0?{...f[O]}:{id:hu(),displayName:`Herdr ${f.length+1}`,wsUrl:r.wsUrl,token:"",autoReconnect:!0,createdAt:Date.now(),lastUsedAt:Date.now()};L.wsUrl=r.wsUrl,L.token=r.token,L.pairCode=r.pairCode||void 0,L.autoReconnect=r.autoReconnect,L.lastUsedAt=Date.now();const V=Mo(L,Math.max(O,0));V?O>=0?f[O]=V:(f.push(V),m=V.id):O>=0&&(f=f.filter(k=>k.id!==m),m=((B=f[0])==null?void 0:B.id)||"")}f.length>0&&!f.some(O=>O.id===m)&&(m=f[0].id);const p=f.find(O=>O.id===m);r.profiles=f,r.activeProfileId=m,r.wsUrl=(p==null?void 0:p.wsUrl)||r.wsUrl||"/ws/client",r.token=(p==null?void 0:p.token)||"",r.pairCode=(p==null?void 0:p.pairCode)||"",r.autoReconnect=(p==null?void 0:p.autoReconnect)??r.autoReconnect;const y=Ro("local",ti);let S={};if(y)try{S=JSON.parse(y)}catch{}S=ou(S).data;for(const O of Ey)r[O]!==void 0&&(S[O]=r[O]);S.profiles=f,S.activeProfileId=m,ma("local",ti,JSON.stringify(S));const g=Ro("session",ss);let T={};if(g)try{T=JSON.parse(g)}catch{}for(const O of pu)r[O]!==void 0&&(T[O]=r[O]);ma("session",ss,JSON.stringify(T));for(const O of jy)r[O]!==void 0&&(S[O]=r[O]);return ma("local",ti,JSON.stringify(S)),r}const Ry={header:{appName:"Herdr",tagline:"remote terminal client",terminalTab:"Terminal",adminTab:"Admin",rttMs:"{rtt}ms",hostLabel:"Host",clientIdLabel:"ID:",copyClientIdTitle:"Click to copy Client ID",languageToggleTitle:"Switch language (EN / 中文)",pairingTitle:"Connection & pairing",settingsTitle:"Terminal settings",virtualKeyboardTitle:"Quick command helper",latencyTitle:"Round-trip latency (RTT)",mainNavigationAria:"Main Navigation",actionKeyboard:"cmd",actionPairing:"link",actionSettings:"cfg",languageShort:"en"},common:{connecting:"Connecting...",connected:"Connected",reconnecting:"Reconnecting...",disconnected:"Disconnected",error:"Error",save:"Save",cancel:"Cancel",close:"Close",done:"Done",retry:"Retry",connect:"Connect",disconnect:"Disconnect",copy:"Copy",copied:"Copied",loading:"Loading...",offline:"Offline",role:"Role",host:"Host",status:"Status",settings:"Settings",admin:"Admin",terminal:"Terminal",pairing:"Pairing",keyBar:"Key bar",quickInput:"Quick input",dismissNotification:"Dismiss notification",closeDialog:"Close dialog",clickToCopy:"Click to copy",controller:"Controller",viewer:"Viewer",live:"Live"},connection:{live:"Live",connecting:"Connecting",reconnecting:"Reconnecting",reconnectNow:"Reconnect now",error:"Error",offline:"Offline",connect:"Connect",retry:"Retry"},role:{controllerMode:"Controller mode active",viewerMode:"Viewer mode",controlActive:"Full Control",viewerReadOnly:"Viewer",viewerWithController:"Viewer (Active: {controllerId})",sharedControl:"Full control",sharedControlDesc:"Every paired window shares this terminal and may type into it.",sharedWindows:"{count} windows",thisWindow:"Window",claimControl:"Claim Control",claimControlTitle:"Claim terminal control",releaseControl:"Release",releaseControlTitle:"Switch to viewer mode",takeoverControl:"Takeover",takeoverControlTitle:"Take over control from {controllerId}",takeoverModalTitle:"Confirm Control Takeover",takeoverModalDesc:"Another client is controlling this terminal.",takeoverModalWarning:"Input focus will transfer to this window.",confirmTakeover:"Confirm Takeover"},statusBanner:{connecting:"Connecting to relay...",reconnectingDefault:"Connection lost. Reconnecting...",reconnectNow:"Reconnect Now",errorDefault:"Unable to connect to relay",disconnected:"Terminal disconnected"},onboarding:{title:"Pair with Herdr Remote",subtitle:"Connect your mobile or browser to your local terminal session",description:"Control Herdr sessions from any browser or phone.",firstTimeSetup:"First-time Setup",authRequired:"Authorization Required",authRequiredDesc:"Pair your device or provide a valid access token.",step1Title:"Generate Pairing Code on Host",step1Desc:"Run on the host running Herdr:",step1CopyPlugin:"Using Herdr Plugin:",step1CopyCli:"Copy CLI Command",step1TuiNote:"Interactive TUI config:",step2Title:"Enter 6-character Pairing Code",step2Placeholder:"e.g. 7X9K2A",step2Note:"Pairing code expires in 5 minutes; credentials are saved automatically.",connectAndPair:"Connect & Pair",connectingAndPairing:"Pairing with Relay...",advancedTitle:"Advanced Options",manualTokenLabel:"Authentication Token",manualTokenPlaceholder:"Optional token (skips pairing code)",wsEndpointLabel:"Relay WebSocket Endpoint",wsEndpointPlaceholder:"/ws/client or wss://your-relay-host/ws/client",clientIdLabel:"Device Client Identifier"},pairing:{title:"Relay Connection & Pairing",addTitle:"Add Herdr Instance",displayNameLabel:"Host Name",displayNamePlaceholder:"e.g. Workstation",displayNameHelp:"This name is stored only in this browser.",credentialsRequired:"Enter a pairing code or device token.",subtitle:"Manage WebSocket endpoints and credentials",pairCodeLabel:"Pairing Code",pairCodeNote:"(6-char code)",pairCodePlaceholder:"e.g. A1B2C3",pairCodeHelp:'Run "herdr-remote pair" on host.',tokenLabel:"Access Token",tokenNote:"(Device secret)",tokenPlaceholder:"Device token...",wsUrlLabel:"Relay WebSocket Endpoint URL",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:"Defaults to same-origin /ws/client",clientIdLabel:"Client Identifier",newIdButton:"New ID",regenerateClientIdTitle:"Regenerate client ID",autoReconnectLabel:"Auto-reconnect",autoReconnectDesc:"Automatically reconnect when disconnected",copyDirectLink:"Copy direct pairing link",saveAndConnect:"Save & Connect"},settings:{title:"Terminal Preferences",subtitle:"Font, size, and touch settings",tabGeneral:"General",tabAppearance:"Appearance & Font",tabVirtualKeys:"Virtual Keys",fontFamilyLabel:"Monospace Font",fontSizeLabel:"Terminal Text Size ({size}px)",fontSizeCompact:"10px (Compact)",fontSizeDefault:"15px (Default)",fontSizeLarge:"24px (Large)",mobileFontNote:"Terminal font scales automatically on small screens for 80-column layout.",colorPassthroughNote:"Terminal colors and cursor style pass through from the host.",touchKeyToolbar:"Touch Key Toolbar",touchKeyToolbarDesc:"Show modifier and navigation keys",touchHaptics:"Haptic Feedback",touchHapticsDesc:"Vibrate on key press",languageLabel:"Language",languageDesc:"Choose English or 简体中文",resetDefaults:"Reset to Defaults",resetDefaultsToast:"Settings reset to defaults",windowZoomSharedNote:"Host view isolation is not active; zoom applies locally.",fontSizeZoomHelp:"Adjusts font size in this window only."},virtualKeyboard:{collapseToolbar:"Collapse Toolbar",expandToolbar:"Expand Toolbar",helperTitle:"Quick Commands",closeHelper:"Close Helper",placeholder:"Type command and press Enter...",sendButton:"Send",clearInput:"Clear Input",customizeTitle:"Custom Key Toolbar",customizeDesc:"Reorder, enable, or disable keys for your toolbar.",enabledKeysCount:"{count} keys enabled",resetLayout:"Reset to Default",addKey:"Add Key",availableKeys:"Available Keys",moveUp:"Move Up",moveDown:"Move Down",enableKey:"Enable Key",disableKey:"Disable Key",deleteKeyTitle:"Remove Key",keyTypeModifier:"Modifier",keyTypeNav:"Navigation",keyTypeAction:"Action",keyTypeChord:"Chord",keyTypeFn:"Function",keyTypeSymbol:"Symbol",fnDrawerTitle:"Function Keys (F1-F12)",chordsDrawerTitle:"Control Chords (^C, ^D, ^Z)",symbolsDrawerTitle:"Symbols (~, |, /, \\)",touchKeyboardShortcuts:"Shortcuts Toolbar",ctrlCTitle:"Ctrl+C (SIGINT)",ctrlDTitle:"Ctrl+D (EOF)",ctrlZTitle:"Ctrl+Z (SIGTSTP)",ctrlLTitle:"Ctrl+L (Clear)",ctrlRTitle:"Ctrl+R (Search)",ctrlATitle:"Ctrl+A (Start of line)",ctrlETitle:"Ctrl+E (End of line)",ctrlKTitle:"Ctrl+K (Kill to end)",badgeSigint:"SIGINT",badgeEof:"EOF",badgeTstp:"SIGTSTP",badgeClear:"CLEAR",badgeSearch:"SEARCH",badgeStart:"START",badgeEnd:"END",badgeKill:"KILL",keyEnter:"Enter"},profiles:{title:"Herdr instances",switcherLabel:"Switch Herdr instance",current:"current",empty:"No paired Herdr instances yet.",addHost:"Add Herdr instance",rename:"Rename instance",remove:"Remove locally",removeConfirm:"Remove this saved connection from this browser?"},mobile:{sessionControls:"Session controls",closeSessionControls:"Close session controls",connectionStatusAria:"Connection status",terminalControlAria:"Terminal control",inputControl:"Input control",settingsAria:"Terminal settings",adminAria:"Admin dashboard",pairingAria:"Connection & pairing",keybarAria:"Toggle key toolbar",quickInputAria:"Toggle quick commands",menu:"Menu",statusBarAria:"Session status bar"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"Connected to Herdr session.",windowAriaLabel:"Terminal Window",bufferAriaLabel:"Terminal Buffer",offlineStatusAria:"Offline Status",releaseControlAria:"Release Control",takeoverControlAria:"Takeover Control",claimControlAria:"Claim Control"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",ctrl:"Toggle Ctrl Lock",alt:"Toggle Alt Lock",shift:"Toggle Shift Lock",meta:"Meta / Cmd",enter:"Enter",backspace:"Backspace",delete:"Delete",left:"Left (←)",up:"Up (↑)",down:"Down (↓)",right:"Right (→)",home:"Home",end:"End",page_up:"Page Up",page_down:"Page Down",insert:"Insert",drawer_chords:"Ctrl Chords",drawer_symbols:"Symbols",drawer_fn:"Function Keys (F1-F12)",ctrl_c:"Ctrl+C (SIGINT)",ctrl_d:"Ctrl+D (EOF)",ctrl_z:"Ctrl+Z (SIGTSTP)",ctrl_l:"Ctrl+L (Clear)",ctrl_a:"Ctrl+A (Start of line)",ctrl_e:"Ctrl+E (End of line)",ctrl_k:"Ctrl+K (Kill to end)",ctrl_r:"Ctrl+R (Search history)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"Pipe (|)",sym_tilde:"Tilde (~)",sym_slash:"Slash (/)",sym_backslash:"Backslash (\\)",sym_dash:"Dash (-)",sym_underscore:"Underscore (_)",sym_dollar:"Dollar ($)",sym_ampersand:"Ampersand (&)",sym_quote:'Quote (")',sym_backtick:"Backtick (`)"},admin:{title:"Admin Dashboard",subtitle:"Connected hosts, paired devices, and relay traffic",returnToTerminal:"Return to Terminal",terminalShells:"Terminal Shells",startedAt:"Started at {time}",accessPanel:"Access",acrossWindows:"across {count} windows",perSecond:"{value}/s",framesPerSecond:"{count} fps",unitDay:"d",unitHour:"h",unitMinute:"m",unitSecond:"s",startedRecently:"Started recently",updatedAt:"Updated at {time}",autoRefresh:"Auto Refresh:",paused:"Paused",refreshNow:"Refresh",connectedHosts:"Connected Hosts",activeUsers:"Active Users",activePtys:"Active PTYs",activeController:"Active Controller",uptime:"Uptime",none:"None",noHost:"No host connected",tabOverview:"Overview",tabClients:"Clients ({count})",tabPtys:"PTY Sessions ({count})",tabDevices:"Paired Devices ({count})",throughput:"Throughput",bytesInTotal:"Total Inbound:",bytesOutTotal:"Total Outbound:",frameRate:"Frame Rate:",hostsTitle:"Hosts ({count})",noHosts:"No hosts connected or paired",hostConnectedDevices:"{count} connected",hostPairedDevices:"{count} paired",hostStatusOnline:"Online",hostStatusBusy:"In use",hostStatusReconnecting:"Reconnecting",hostStatusOffline:"Offline",hostRosterOperatorOnly:"Device list is visible to the relay operator only.",connectedClientsTitle:"Connected Clients ({count})",noClients:"No clients connected",colClientId:"Client ID",colDevice:"Device",colDeviceId:"Device ID",colLastSeen:"Last Seen",colActions:"Actions",unknownDevice:"Unknown Device",pairedDevicesTitle:"Paired Devices ({count})",noDevices:"No paired devices",revokeDevice:"Revoke",revokeConfirm:"Confirm Revocation",revokeFailed:"Revocation failed",colRole:"Role",colIp:"IP Address",colConnectedAt:"Connected At",colTraffic:"Traffic (In/Out)",activePtysTitle:"Active PTY Sessions ({count})",noPtys:"No active PTY sessions",colPtyId:"PTY ID",colPid:"PID",colCommand:"Command",colGrid:"Grid",colCwd:"Working Directory",colViewers:"Windows",copiedJson:"Copied",unauthorizedTitle:"Unauthorized (401/403)",unauthorizedDesc:"GET /api/status requires an authorized device token.",pairingStepsTitle:"Device Pairing:",pairingStepsHelp:"Run pairing command on host to get a code, then enter it here.",enterPairCodeBtn:"Enter Pairing Code",retryFetchBtn:"Retry Status",errorConnecting:"Failed to fetch GET /api/status: {error}",loadingStatus:"Loading status from /api/status...",remoteRelayTitle:"Remote Relay Administration",remoteRelayBadge:"Connected to Remote Relay",remoteRelayNotice:"Connected to remote relay. For server metrics, access the operator dashboard.",remoteRelayEndpoint:"Remote WebSocket Endpoint:",remoteRelayAdminUrl:"Remote Admin URL:",openRemoteAdminBtn:"Open Remote Admin",remoteRelayHelp:"Open remote relay admin dashboard.",relayAdminTitle:"Relay Operator Dashboard",relayAdminTokenLabel:"Relay Admin Token (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"Enter RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"RELAY_ADMIN_TOKEN is not configured on this relay.",relayAdminLoginBtn:"Verify & View Metrics",relayAdminAuthError:"Invalid or unauthorized admin token.",remoteRelayClientNotice:"Terminal client connection. For server metrics, use the operator dashboard.",openOperatorPortal:"Open Operator Dashboard",localWorkstationBadge:"Local Relay",modeLocal:"Local Mode",modeRemote:"Remote Mode",hintTabs:"switch tabs",hintRefresh:"refresh status",hintBack:"return to terminal"},toasts:{connected:"Connected to relay",connectionError:"Connection error",controlGranted:"Control granted",controlDenied:"Request denied: another controller is active",controlRevoked:"Control transferred to another device",pairedSuccess:"Paired successfully",sessionEnded:"Session ended",controlReleased:"Control released",viewerModeWarning:'In viewer mode. Click "Claim Control" first.',clientIdCopied:"Client ID copied: {id}",pairingLinkCopied:"Pairing link copied",switchedLanguage:"Language switched to {lang}",settingsReset:"Settings reset to default",fontReset:"Font reset to default",commandCopied:"Command copied",keyLayoutReset:"Key layout reset"},shortcuts:{title:"Shortcuts",help:"Active outside terminal input area:",terminalInputNote:"Terminal shortcuts pass directly to host PTY."},serverErrors:{auth_required:"Pairing required: enter a pairing code, or a device token that is still valid.",unauthorized:"This device is not authorised for that workstation.",host_offline:"The paired workstation is not connected to this relay.",host_disconnected:"The workstation disconnected.",stale_host:"The workstation stopped answering and was dropped.",too_many_clients:"That workstation has reached its window limit.",rate_limited:"Too many pairing attempts. Wait a minute and try again.",invalid_handshake:"The relay rejected the handshake. Reload the page.",device_revoked:"This device was revoked by the relay operator.",connection_closed:"Connection closed. Reconnecting…",connection_failed:"Could not open a connection to the relay.",host_reconnecting:"The Herdr host is reconnecting.",host_reconnect_timeout:"The Herdr host did not reconnect in time.",host_replaced:"The Herdr host connection was replaced.",slow_client:"This browser was disconnected because it could not keep up.",client_send_failed:"The relay could not send data to this browser.",too_many_hosts:"This relay has reached its host limit.",paste_file_unsupported:"Unsupported image format for paste.",paste_file_too_large:"Pasted image exceeds 3 MB limit.",paste_file_write_failed:"Failed to save pasted image on host.",paste_file_empty:"Pasted image payload is empty.",paste_file_corrupt:"Pasted image data is corrupt or does not match declared MIME.",viewer_mode:"Viewer mode cannot paste to terminal.",no_session:"Terminal session is not ready."},fontPresets:{system:"System Default",apple:"SF Mono / Menlo",windows:"Consolas",linux:"Liberation Mono",courier:"Courier New",firacode:"Fira Code"},clipboard:{copySelection:"Copy Selection",copyLine:"Copy Line",copyScreen:"Copy Screen",paste:"Paste",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Failed to copy",pasteHint:"Long-press here to paste, then tap Send",pasteSend:"Send",pasteUnavailable:"Clipboard is empty or unavailable",pasteTitle:"Paste Content",pasted:"Pasted",chooseImage:"Choose Image",takePhoto:"Take Photo",imageTooLarge:"Image exceeds 3 MB limit and cannot be compressed further.",imageCompressedSize:"Compressed: {size}",fileEmpty:"File is empty.",decodeFailed:"Failed to decode image file.",unsupportedType:"Unsupported format. Only PNG, JPEG, WebP, and GIF are supported.",imageSectionTitle:"Image",textSectionTitle:"Text",imageCompressing:"Processing image...",removeImage:"Remove image"}},My={header:{appName:"Herdr",tagline:"远程终端客户端",terminalTab:"终端",adminTab:"管理面板",rttMs:"{rtt}ms",hostLabel:"主机",clientIdLabel:"客户端 ID:",copyClientIdTitle:"点击复制客户端 ID",languageToggleTitle:"切换语言 (EN / 中文)",pairingTitle:"连接与配对",settingsTitle:"终端设置",virtualKeyboardTitle:"快捷命令",latencyTitle:"网络延迟 (RTT)",mainNavigationAria:"主导航菜单",actionKeyboard:"命令",actionPairing:"配对",actionSettings:"设置",languageShort:"中"},common:{connecting:"连接中...",connected:"已连接",reconnecting:"重连中...",disconnected:"已断开",error:"错误",save:"保存",cancel:"取消",close:"关闭",done:"完成",retry:"重试",connect:"连接",disconnect:"断开连接",copy:"复制",copied:"已复制",loading:"加载中...",offline:"离线",role:"角色",host:"主机",status:"连接状态",settings:"设置",admin:"管理面板",terminal:"终端",pairing:"配对",keyBar:"按键条",quickInput:"快捷输入",dismissNotification:"关闭通知",closeDialog:"关闭对话框",clickToCopy:"点击复制",controller:"控制端",viewer:"观察者",live:"运行中"},connection:{live:"在线",connecting:"连接中",reconnecting:"正在重连",reconnectNow:"立即重连",error:"连接错误",offline:"离线",connect:"发起连接",retry:"重试"},role:{controllerMode:"控制模式",viewerMode:"观察者模式",controlActive:"控制端",viewerReadOnly:"观察者",viewerWithController:"观察者(控制者: {controllerId})",sharedControl:"完全控制",sharedControlDesc:"所有已配对窗口共享同一个终端,均可输入。",sharedWindows:"{count} 个窗口",thisWindow:"本窗口",claimControl:"获取控制权",claimControlTitle:"获取终端控制权",releaseControl:"释放控制权",releaseControlTitle:"切回观察者模式",takeoverControl:"强占控制权",takeoverControlTitle:"从 {controllerId} 接管控制权",takeoverModalTitle:"确认接管终端控制权?",takeoverModalDesc:"当前已有其他客户端控制该终端。",takeoverModalWarning:"接管后输入焦点切换至当前窗口。",confirmTakeover:"确认接管"},statusBanner:{connecting:"连接 Relay 服务中...",reconnectingDefault:"连接断开,正在重连...",reconnectNow:"立即重连",errorDefault:"无法连接 Relay 服务",disconnected:"会话已断开"},onboarding:{title:"配对 Herdr Remote",subtitle:"连接手机或浏览器至本地终端会话",description:"在浏览器或移动设备中控制 Herdr 会话。",firstTimeSetup:"首次配对",authRequired:"需要认证",authRequiredDesc:"使用配对码配对设备,或提供有效访问令牌。",step1Title:"在 Herdr 宿主机生成配对码",step1Desc:"在运行 Herdr 的主机终端执行:",step1CopyPlugin:"使用 Herdr 插件:",step1CopyCli:"复制 CLI 命令",step1TuiNote:"交互式 TUI 配置:",step2Title:"输入 6 位配对码",step2Placeholder:"例如:7X9K2A",step2Note:"配对码 5 分钟内有效,连接后自动保存凭据。",connectAndPair:"连接并完成配对",connectingAndPairing:"配对中...",advancedTitle:"高级选项",manualTokenLabel:"认证 Token",manualTokenPlaceholder:"可选 Token(跳过配对码)",wsEndpointLabel:"Relay WebSocket 端点",wsEndpointPlaceholder:"/ws/client 或 wss://relay-host/ws/client",clientIdLabel:"客户端标识 (Client ID)"},pairing:{title:"Relay 连接与配对",addTitle:"添加 Herdr 实例",displayNameLabel:"主机名称",displayNamePlaceholder:"例如:工作电脑",displayNameHelp:"名称仅保存在此浏览器中。",credentialsRequired:"请输入配对码或设备令牌。",subtitle:"管理 WebSocket 服务端点与凭证",pairCodeLabel:"配对码",pairCodeNote:"(6 位代码)",pairCodePlaceholder:"例如:A1B2C3",pairCodeHelp:'在主机运行 "herdr-remote pair" 获取。',tokenLabel:"访问 Token",tokenNote:"(设备凭据)",tokenPlaceholder:"设备 Token...",wsUrlLabel:"Relay WebSocket 端点",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:'默认同源端点 "/ws/client"',clientIdLabel:"客户端标识",newIdButton:"生成新 ID",regenerateClientIdTitle:"重新生成客户端 ID",autoReconnectLabel:"掉线自动重连",autoReconnectDesc:"连接断开时自动尝试重连",copyDirectLink:"复制配对链接(含配对码)",saveAndConnect:"保存并连接"},settings:{title:"终端设置",subtitle:"字体、字号与触控管理",tabGeneral:"常规设置",tabAppearance:"终端与字体",tabVirtualKeys:"虚拟按键",fontFamilyLabel:"等宽字体",fontSizeLabel:"终端字号 ({size}px)",fontSizeCompact:"10px (紧凑)",fontSizeDefault:"15px (默认)",fontSizeLarge:"24px (大字号)",mobileFontNote:"小屏设备自动适配字号,保持 80 列完整显示。",colorPassthroughNote:"终端配色与光标样式透传自宿主环境。",touchKeyToolbar:"底部触控按键条",touchKeyToolbarDesc:"显示移动端修饰键与方向键工具栏",touchHaptics:"触控振动反馈",touchHapticsDesc:"移动端按键时轻微震动",languageLabel:"显示语言",languageDesc:"选择 English 或 简体中文",resetDefaults:"恢复默认设置",resetDefaultsToast:"设置已恢复默认",windowZoomSharedNote:"当前宿主未启用视图隔离,字号调整仅影响本地窗口。",fontSizeZoomHelp:"仅调节当前窗口字号,不影响其他窗口。"},virtualKeyboard:{collapseToolbar:"收起按键栏",expandToolbar:"展开按键栏",helperTitle:"快捷命令",closeHelper:"关闭命令助手",placeholder:"输入终端命令并回车...",sendButton:"发送",clearInput:"清除输入内容",customizeTitle:"自定义虚拟按键",customizeDesc:"调整按键顺序与启禁用状态。",enabledKeysCount:"已启用 {count} 个按键",resetLayout:"恢复默认布局",addKey:"添加按键",availableKeys:"可选按键库",moveUp:"前移",moveDown:"后移",enableKey:"启用按键",disableKey:"禁用按键",deleteKeyTitle:"删除按键",keyTypeModifier:"修饰键",keyTypeNav:"导航键",keyTypeAction:"动作键",keyTypeChord:"组合键",keyTypeFn:"功能键",keyTypeSymbol:"符号",fnDrawerTitle:"功能键 (F1-F12)",chordsDrawerTitle:"控制组合键 (^C, ^D, ^Z)",symbolsDrawerTitle:"终端常用符号 (~, |, /, \\)",touchKeyboardShortcuts:"快捷键工具栏",ctrlCTitle:"Ctrl+C (中断)",ctrlDTitle:"Ctrl+D (退出)",ctrlZTitle:"Ctrl+Z (挂起)",ctrlLTitle:"Ctrl+L (清屏)",ctrlRTitle:"Ctrl+R (搜索)",ctrlATitle:"Ctrl+A (行首)",ctrlETitle:"Ctrl+E (行尾)",ctrlKTitle:"Ctrl+K (剪切)",badgeSigint:"中断",badgeEof:"退出",badgeTstp:"挂起",badgeClear:"清屏",badgeSearch:"搜索",badgeStart:"行首",badgeEnd:"行尾",badgeKill:"剪切",keyEnter:"回车"},profiles:{title:"Herdr 实例",switcherLabel:"切换 Herdr 实例",current:"当前",empty:"还没有已配对的 Herdr 实例。",addHost:"添加 Herdr 实例",rename:"重命名实例",remove:"仅本地移除",removeConfirm:"确认从此浏览器移除已保存的连接?"},mobile:{sessionControls:"会话控制",closeSessionControls:"关闭会话控制面板",connectionStatusAria:"连接状态",terminalControlAria:"终端控制权",inputControl:"输入控制权",settingsAria:"终端设置",adminAria:"打开管理面板",pairingAria:"连接与配对设置",keybarAria:"切换触控按键条",quickInputAria:"切换快捷命令",menu:"菜单",statusBarAria:"会话状态栏"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"已连接至 Herdr 会话。",windowAriaLabel:"远程终端窗口",bufferAriaLabel:"xterm 终端缓冲区",offlineStatusAria:"离线状态",releaseControlAria:"释放终端控制权",takeoverControlAria:"强占终端控制权",claimControlAria:"获取终端控制权"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",ctrl:"切换 Ctrl 锁定",alt:"切换 Alt 锁定",shift:"切换 Shift 锁定",meta:"Meta / 命令键",enter:"回车 (Enter)",backspace:"退格 (Backspace)",delete:"删除 (Delete)",left:"左箭头 (←)",up:"上箭头 (↑)",down:"下箭头 (↓)",right:"右箭头 (→)",home:"行首 (Home)",end:"行尾 (End)",page_up:"向上翻页 (Page Up)",page_down:"向下翻页 (Page Down)",insert:"插入 (Insert)",drawer_chords:"常用 Ctrl 组合键",drawer_symbols:"常用特殊符号",drawer_fn:"功能键 (F1-F12)",ctrl_c:"Ctrl+C (中断)",ctrl_d:"Ctrl+D (退出)",ctrl_z:"Ctrl+Z (挂起)",ctrl_l:"Ctrl+L (清屏)",ctrl_a:"Ctrl+A (行首)",ctrl_e:"Ctrl+E (行尾)",ctrl_k:"Ctrl+K (剪切)",ctrl_r:"Ctrl+R (历史搜索)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"管道符 (|)",sym_tilde:"波浪号 (~)",sym_slash:"正斜杠 (/)",sym_backslash:"反斜杠 (\\)",sym_dash:"连字符 (-)",sym_underscore:"下划线 (_)",sym_dollar:"美元符 ($)",sym_ampersand:"与符号 (&)",sym_quote:'双引号 (")',sym_backtick:"反引号 (`)"},admin:{title:"系统管理面板",subtitle:"接入主机、配对设备与中转流量",returnToTerminal:"返回终端",terminalShells:"个终端 Shell",startedAt:"启动于 {time}",accessPanel:"接入概览",acrossWindows:"共 {count} 个窗口",perSecond:"{value}/秒",framesPerSecond:"{count} 帧/秒",unitDay:" 天",unitHour:" 小时",unitMinute:" 分",unitSecond:" 秒",startedRecently:"最近启动",updatedAt:"更新于 {time}",autoRefresh:"自动刷新:",paused:"暂停刷新",refreshNow:"立即刷新",connectedHosts:"接入主机",activeUsers:"活跃用户",activePtys:"活动 PTY",activeController:"活跃控制者",uptime:"运行时间",none:"无",noHost:"未连接主机",tabOverview:"系统概览",tabClients:"客户端列表 ({count})",tabPtys:"PTY 会话 ({count})",tabDevices:"已配对设备 ({count})",throughput:"网络吞吐流量",bytesInTotal:"入站流量:",bytesOutTotal:"出站流量:",frameRate:"帧率统计:",hostsTitle:"主机 ({count})",noHosts:"暂无接入或配对的主机",hostConnectedDevices:"{count} 台在线",hostPairedDevices:"{count} 台已配对",hostStatusOnline:"在线",hostStatusBusy:"使用中",hostStatusReconnecting:"重连中",hostStatusOffline:"离线",hostRosterOperatorOnly:"设备清单仅 Relay 操作员可见。",connectedClientsTitle:"已连接客户端 ({count})",noClients:"当前暂无客户端连接",colClientId:"客户端 ID",colDevice:"设备",colDeviceId:"设备 ID",colLastSeen:"最近活动",colActions:"操作",unknownDevice:"未知设备",pairedDevicesTitle:"已配对设备 ({count})",noDevices:"尚未配对任何设备",revokeDevice:"撤销",revokeConfirm:"确认撤销",revokeFailed:"撤销失败",colRole:"角色",colIp:"IP 地址",colConnectedAt:"连接时间",colTraffic:"网络流量 (入/出)",activePtysTitle:"活动 PTY 终端会话 ({count})",noPtys:"当前无活跃的 PTY 会话",colPtyId:"PTY 标识",colPid:"进程 PID",colCommand:"运行命令",colGrid:"网格规格",colCwd:"工作目录",colViewers:"窗口数",copiedJson:"已复制",unauthorizedTitle:"管理接口未授权 (401/403)",unauthorizedDesc:"访问 GET /api/status 需要已授权的设备 Token。",pairingStepsTitle:"设备配对指引:",pairingStepsHelp:"在主机运行配对命令获取配对码后输入。",enterPairCodeBtn:"输入配对码",retryFetchBtn:"重新获取状态",errorConnecting:"连接 GET /api/status 失败:{error}",loadingStatus:"正在加载系统状态...",remoteRelayTitle:"远程 Relay 服务管理",remoteRelayBadge:"已连接远程 Relay 服务",remoteRelayNotice:"当前连接至远程独立 Relay 服务。如需查看服务端指标,请使用操作员后台。",remoteRelayEndpoint:"远程端点:",remoteRelayAdminUrl:"远程后台地址:",openRemoteAdminBtn:"前往远程管理后台",remoteRelayHelp:"直接访问远程 Relay 管理后台。",relayAdminTitle:"Relay 操作员管理后台",relayAdminTokenLabel:"Relay 管理员令牌 (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"请输入 RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"该 Relay 服务未配置 RELAY_ADMIN_TOKEN。",relayAdminLoginBtn:"验证并查看服务端指标",relayAdminAuthError:"管理员令牌无效或未授权。",remoteRelayClientNotice:"当前为终端客户端连接。如需查看服务端指标,请访问操作员后台。",openOperatorPortal:"打开服务端管理后台",localWorkstationBadge:"本地宿主 Relay",modeLocal:"本地模式",modeRemote:"远程模式",hintTabs:"切换标签页",hintRefresh:"刷新状态",hintBack:"返回终端"},toasts:{connected:"已连接至 Relay 服务",connectionError:"连接发生错误",controlGranted:"已获得控制权",controlDenied:"控制请求被拒绝:已有活跃控制者",controlRevoked:"控制权已转移",pairedSuccess:"设备配对成功,已保存凭证",sessionEnded:"终端会话已结束",controlReleased:"已释放控制权,切回观察者模式",viewerModeWarning:"处于观察者模式,请先获取控制权",clientIdCopied:"客户端 ID 已复制: {id}",pairingLinkCopied:"配对链接已复制",switchedLanguage:"语言已切换为 {lang}",settingsReset:"设置已恢复默认",fontReset:"字体已恢复默认",commandCopied:"命令已复制",keyLayoutReset:"虚拟按键布局已恢复默认"},shortcuts:{title:"WebUI 快捷键",help:"以下快捷键仅在非终端输入区域生效:",terminalInputNote:"终端操作快捷键直接透传至宿主 PTY。"},serverErrors:{auth_required:"需要配对:请输入配对码,或填写仍然有效的设备令牌。",unauthorized:"该设备无权访问此工作站。",host_offline:"已配对的工作站未连接到该 relay。",host_disconnected:"工作站已断开连接。",stale_host:"工作站长时间无响应,已被断开。",too_many_clients:"该工作站的窗口数量已达上限。",rate_limited:"配对尝试过于频繁,请稍后再试。",invalid_handshake:"relay 拒绝了握手,请刷新页面。",device_revoked:"该设备已被 relay 管理员撤销。",connection_closed:"连接已断开,正在重连…",connection_failed:"无法建立到 relay 的连接。",host_reconnecting:"Herdr 主机正在重连。",host_reconnect_timeout:"Herdr 主机未能及时恢复连接。",host_replaced:"Herdr 主机连接已被替换。",slow_client:"由于浏览器处理速度过慢,连接已关闭。",client_send_failed:"Relay 无法向此浏览器发送数据。",too_many_hosts:"此 relay 已达到主机数量上限。",paste_file_unsupported:"不支持的粘贴图片格式。",paste_file_too_large:"粘贴图片超过 3 MB 上限。",paste_file_write_failed:"工作站保存图片失败。",paste_file_empty:"粘贴图片内容为空。",paste_file_corrupt:"粘贴图片数据损坏或与声明格式不符。",viewer_mode:"观察者模式无法粘贴到终端。",no_session:"终端会话未准备就绪。"},fontPresets:{system:"系统默认",apple:"Apple SF Mono / Menlo",windows:"Windows Consolas",linux:"Linux Liberation Mono",courier:"Courier New",firacode:"Fira Code"},clipboard:{copySelection:"复制选中",copyLine:"复制本行",copyScreen:"复制整屏",paste:"粘贴",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteHint:"长按此处粘贴,然后按发送",pasteSend:"发送",pasteUnavailable:"剪贴板为空或不可用",pasteTitle:"粘贴内容",pasted:"已粘贴",chooseImage:"选择图片",takePhoto:"拍照",imageTooLarge:"图片超过 3 MB 限制且无法进一步压缩。",imageCompressedSize:"压缩后大小:{size}",fileEmpty:"文件内容为空。",decodeFailed:"无法解析图片文件。",unsupportedType:"不支持的图片格式,仅支持 PNG、JPEG、WebP 和 GIF。",imageSectionTitle:"图片",textSectionTitle:"文本",imageCompressing:"正在处理图片...",removeImage:"移除图片"}},Wc={en:Ry,zh:My};function bu(o,s,r){const c=Wc[o]||Wc.en,f=s.split(".");let m=c;for(const b of f)if(m&&typeof m=="object"&&b in m)m=m[b];else{let p=Wc.en;for(const y of f)if(p&&typeof p=="object"&&y in p)p=p[y];else return s;m=p;break}if(typeof m!="string")return s;if(r){let b=m;for(const[p,y]of Object.entries(r))b=b.replaceAll(`{${p}}`,String(y));return b}return m}const Th="#11111b",ru=[{id:"system",name:"System Default (Recommended)",font:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace'},{id:"apple",name:"Apple SF Mono / Menlo",font:'SFMono-Regular, Menlo, Monaco, "Symbols Nerd Font Mono", monospace'},{id:"windows",name:"Windows Consolas",font:'Consolas, "Lucida Console", "Symbols Nerd Font Mono", monospace'},{id:"linux",name:"Linux Liberation Mono",font:'"Liberation Mono", "DejaVu Sans Mono", "Symbols Nerd Font Mono", monospace'},{id:"courier",name:"Courier New",font:'"Courier New", Courier, "Symbols Nerd Font Mono", monospace'},{id:"firacode",name:"Fira Code (Ligatures)",font:'"Fira Code", "Symbols Nerd Font Mono", monospace'}];function Nh(o){if(!o||typeof o!="string")return ru[0].font;const s=o.trim();if(s.includes("Symbols Nerd Font"))return s;if(/^['"]?monospace['"]?$/i.test(s))return'"Symbols Nerd Font Mono", monospace';const r=/,\s*['"]?monospace['"]?\s*$/i;return r.test(s)?s.replace(r,', "Symbols Nerd Font Mono", monospace'):`${s}, "Symbols Nerd Font Mono", monospace`}function zy(o){if(!o)return null;const s={};return o.background&&(s.background=o.background,s.cursorAccent=o.background),o.foreground&&(s.foreground=o.foreground),o.cursor&&(s.cursor=o.cursor),o.ansi&&Object.assign(s,o.ansi),Object.keys(s).length===0?null:s}function up(){if(typeof document>"u")return;const o=document.querySelector('meta[name="theme-color"]');document.documentElement.style.colorScheme="dark",o==null||o.setAttribute("content",Th),document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),document.body.classList.add("dark"),document.body.classList.remove("light"),document.body.style.backgroundColor=Th}const _y=4e3,ky=3,Dy=4096,Ly=8*1024*1024,dp=x.createContext(null);function Pa(o){return{wsUrl:o.wsUrl,token:o.token||void 0,pairCode:o.pairCode||void 0,clientId:o.clientId,autoReconnect:o.autoReconnect,reconnectIntervalMs:2e3,maxReconnectAttempts:0,pingIntervalMs:1e4}}const Oy=({children:o})=>{const[s,r]=x.useState(cp),[c,f]=x.useState("disconnected"),[m,b]=x.useState(),[p,y]=x.useState(),[S,g]=x.useState("viewer"),[T,B]=x.useState(),[O,L]=x.useState(),[V,k]=x.useState(),[Q,P]=x.useState(null),[J,oe]=x.useState(),[ce,Y]=x.useState(null),[_,R]=x.useState(1),[ae,Ee]=x.useState(0),[Se,me]=x.useState(null),[Z,pe]=x.useState(null),[Te,M]=x.useState({cols:80,rows:24}),[X,W]=x.useState([]);x.useEffect(()=>{up()},[]);const ue=x.useRef(s);ue.current=s;const K=x.useRef(null),Me=x.useRef(!1),ze=x.useRef(Te);ze.current=Te;const Ce=x.useRef(new Set),Oe=x.useCallback((H,C)=>bu(s.language,H,C),[s.language]),we=x.useRef(Oe);we.current=Oe;const xe=x.useRef(null),$e=x.useRef([]),bt=x.useRef(0),je=x.useCallback(H=>{for($e.current.push(H),bt.current+=H.byteLength;$e.current.length>Dy||bt.current>Ly;){const C=$e.current.shift();if(!C)break;bt.current-=C.byteLength}},[]),ct=x.useCallback(H=>{const C=xe.current;if(C)try{C(H);return}catch(D){console.debug("Terminal output sink threw, buffering chunk instead:",D)}je(H)},[je]),lt=x.useRef(ct);lt.current=ct;const ut=x.useCallback(H=>{xe.current=H;const C=$e.current;$e.current=[],bt.current=0;for(let D=0;D<C.length;D++)try{H(C[D])}catch(I){console.debug("Terminal sink threw while flushing, re-buffering the tail:",I);for(let te=D;te<C.length;te++)je(C[te]);break}return()=>{xe.current===H&&(xe.current=null)}},[je]),wt=x.useCallback(()=>$e.current.length,[]),st=x.useCallback(()=>{$e.current=[],bt.current=0},[]),dt=x.useCallback((H=!0)=>{g("viewer"),B(void 0),L(void 0),k(void 0),P(null),oe(void 0),Y(null),R(1),me(null),st(),H&&Ee(C=>C+1)},[st]),kt=x.useRef([]),Qt=x.useRef(new Map),gt=x.useCallback(H=>{kt.current=H,W(H)},[]),mn=x.useCallback(H=>{const C=Qt.current.get(H);C&&(clearTimeout(C),Qt.current.delete(H)),gt(kt.current.filter(D=>D.id!==H))},[gt]),Ft=x.useRef(mn);Ft.current=mn;const yt=x.useCallback((H,C)=>{const D=Date.now(),I=kt.current,te=I.find(De=>De.type===H&&De.message===C),he=te?te.id:`${D}-${Math.random().toString(36).substring(2,6)}`;let F;if(te)F=I.map(De=>De.id===he?{...De,count:De.count+1,timestamp:D}:De);else for(F=[...I,{id:he,type:H,message:C,timestamp:D,count:1}];F.length>ky;){const[De,...ot]=F,Qe=Qt.current.get(De.id);Qe&&(clearTimeout(Qe),Qt.current.delete(De.id)),F=ot}gt(F);const Je=Qt.current.get(he);Je&&clearTimeout(Je),Qt.current.set(he,setTimeout(()=>Ft.current(he),_y))},[gt]),Wn=x.useCallback(H=>{Ft.current(H)},[]),Gt=x.useRef(!0);x.useEffect(()=>{S==="controller"&&(Gt.current=!0)},[S]);const ee=x.useCallback(()=>{Gt.current&&(Gt.current=!1,yt("warning",we.current("toasts.viewerModeWarning")))},[yt]);x.useEffect(()=>{const H=Qt.current;return()=>{for(const C of H.values())clearTimeout(C);H.clear()}},[]);const ve=x.useCallback(H=>{const C=Ql(H);ue.current=C,r(C)},[]),_e=x.useCallback(H=>{ve({language:H})},[ve]),He=x.useCallback(H=>{ue.current=H,r(H)},[]),an=x.useCallback(H=>{var te;const C=ue.current,D=Sh({...H,wsUrl:H.wsUrl||"/ws/client",token:H.token||"",displayName:H.displayName||`Herdr ${C.profiles.length+1}`,autoReconnect:H.autoReconnect!==!1},C.profiles.length),I=Ql({profiles:[...C.profiles,D],activeProfileId:D.id,wsUrl:D.wsUrl,token:D.token,pairCode:D.pairCode||"",autoReconnect:D.autoReconnect});He(I),dt(),(te=K.current)==null||te.reconnectWith(Pa(I))},[He,dt]),$n=x.useCallback(H=>{var te;const C=ue.current,D=C.profiles.find(he=>he.id===H);if(!D||D.id===C.activeProfileId)return;const I=Ql({activeProfileId:D.id,wsUrl:D.wsUrl,token:D.token,pairCode:D.pairCode||"",autoReconnect:D.autoReconnect,profiles:C.profiles.map(he=>he.id===D.id?{...he,lastUsedAt:Date.now()}:he)});He(I),dt(),(te=K.current)==null||te.reconnectWith(Pa(I))},[He,dt]),qt=x.useCallback((H,C)=>{const D=ue.current;if(!D.profiles.find(F=>F.id===H))return;const te=C.trim().slice(0,64);if(!te)return;const he=Ql({profiles:D.profiles.map(F=>F.id===H?{...F,displayName:te}:F)});He(he)},[He]),Hn=x.useCallback(H=>{var he;const C=ue.current;if(!C.profiles.some(F=>F.id===H))return;const D=C.profiles.filter(F=>F.id!==H),I=D.find(F=>F.id===C.activeProfileId)||D[0],te=Ql(I?{profiles:D,activeProfileId:I.id,wsUrl:I.wsUrl,token:I.token,pairCode:I.pairCode||"",autoReconnect:I.autoReconnect}:{profiles:[],activeProfileId:"",wsUrl:"/ws/client",token:"",pairCode:""});He(te),H===C.activeProfileId&&(dt(),(he=K.current)==null||he.reconnectWith(Pa(te)))},[He,dt]),Yn=x.useCallback(H=>{const C=ue.current,D=C.profiles.find(Ct=>Ct.id===C.activeProfileId),I=H.hostId?wh({wsUrl:C.wsUrl,hostId:H.hostId}):null,te=I?C.profiles.findIndex(Ct=>wh(Ct)===I):-1,he=te>=0?te:Math.max(0,C.profiles.findIndex(Ct=>Ct.id===C.activeProfileId)),Je={...C.profiles[he]||D||Sh({wsUrl:C.wsUrl||"/ws/client",token:"",pairCode:C.pairCode||"PENDING",displayName:`Herdr ${C.profiles.length+1}`},C.profiles.length),token:H.token,pairCode:void 0,...H.hostId?{hostId:H.hostId}:{},...H.deviceId?{deviceId:H.deviceId}:{},lastUsedAt:Date.now()};let De=[...C.profiles];he>=0&&he<De.length?De[he]=Je:De.push(Je);const ot=D==null?void 0:D.id;De=De.filter((Ct,_n)=>_n===he||Ct.id===Je.id?!0:!(te>=0&&ot&&Ct.id===ot));const Qe=Ql({profiles:De,activeProfileId:Je.id,wsUrl:Je.wsUrl,token:Je.token,pairCode:"",autoReconnect:Je.autoReconnect});return He(Qe),Qe},[He]),Kn=x.useCallback(H=>{const C=ue.current,D=C.profiles.find(F=>F.id===C.activeProfileId);if(!D||!H.hostId&&!H.hostname)return;const I=/^Herdr \d+$/.test(D.displayName),te={...D,...H.hostId?{hostId:H.hostId}:{},...H.hostname?{hostname:H.hostname}:{},...H.hostname&&I?{displayName:H.hostname}:{}},he=Ql({profiles:C.profiles.map(F=>F.id===D.id?te:F)});He(he)},[He]);if(!K.current){const H=new cy(Pa(s));K.current=H,H.on("stateChange",(C,D,I)=>{f(C),y(I);const te=I?`serverErrors.${I}`:null,he=te?we.current(te):null,F=he&&he!==te?he:D;b(F),C==="connected"?yt("success",we.current("toasts.connected")):C==="error"&&yt("error",F||we.current("toasts.connectionError"))}),H.on("ready",C=>{Me.current&&(st(),Ee(D=>D+1)),Me.current=!0,g(C.role),B(C.controllerId),L(C.hostId),k(C.hostname),Kn(C),C.clientId&&oe(C.clientId),P(C.terminalPalette||null)}),H.on("hostReconnecting",C=>{y(C||"host_reconnecting"),b(we.current(`serverErrors.${C||"host_reconnecting"}`)),g("viewer"),B(void 0),k(void 0),P(null),Y(null),R(1),me(null),st()}),H.on("sessionRestarted",(C,D,I,te)=>{st(),k(te),Kn({hostId:H.getHostId(),hostname:te}),P(I||null),Ee(he=>he+1)}),H.on("roleChange",(C,D,I,te)=>{g(C),B(D),I&&L(I),te&&oe(te)}),H.on("controlGranted",()=>{g("controller"),yt("success",we.current("toasts.controlGranted"))}),H.on("controlDenied",C=>{yt("warning",C||we.current("toasts.controlDenied"))}),H.on("controlRevoked",C=>{g("viewer"),yt("warning",C||we.current("toasts.controlRevoked"))}),H.on("paired",C=>{const D=Yn(C);yt("success",we.current("toasts.pairedSuccess")),pe(Date.now()),H.reconnectWith(Pa(D))}),H.on("exit",(C,D)=>{yt("info",`${we.current("toasts.sessionEnded")}${D?`: ${D}`:""}${C!==void 0?` (${C})`:""}`)}),H.on("status",C=>{me(C)}),H.on("error",C=>{const I=`serverErrors.${String(C.code)}`,te=we.current(I),he=te&&te!==I?te:C.message||`[${C.code}]`;yt("error",he)}),H.on("pasteFileReady",C=>{for(const D of Ce.current)try{D(C)}catch(I){console.error("Error in pasteFileReady listener:",I)}}),H.on("rttUpdate",C=>{Y(C)}),H.on("peerCount",C=>{R(Math.max(1,C))}),H.on("sessionReady",()=>{f("connected")}),H.on("binaryData",C=>{lt.current(C)})}const Ot=K.current,hn=s.profiles.find(H=>H.id===s.activeProfileId);x.useEffect(()=>{var H;(H=K.current)==null||H.updateConfig(Pa(s))},[s]);const Ut=x.useCallback(H=>{K.current&&(H&&K.current.updateConfig(H),K.current.connect(ze.current))},[]),ii=x.useCallback(()=>{K.current&&K.current.disconnect()},[]),si=x.useCallback((H=!1)=>{K.current&&K.current.claimControl(H)},[]),ga=x.useCallback(()=>{var H;(H=K.current)==null||H.releaseControl()},[]),Pn=x.useCallback(H=>{if(S!=="controller"){ee();return}K.current&&K.current.sendText(H)},[S,ee]),zn=x.useCallback(H=>{S!=="controller"&&!lu(H)||K.current&&K.current.sendBinary(H)},[S]),Gn=x.useCallback((H,C)=>{ze.current={cols:H,rows:C},M({cols:H,rows:C}),K.current&&K.current.sendResize(H,C)},[]),Jt=x.useCallback((H,C)=>S!=="controller"?(ee(),!1):K.current?(K.current.sendPasteFile(H,C),!0):!1,[S,ee]),el=x.useCallback(H=>(Ce.current.add(H),()=>{Ce.current.delete(H)}),[]);return u.jsx(dp.Provider,{value:{connectionState:c,stateDetail:m,stateCode:p,role:S,controllerId:T,hostId:O,hostname:V,assignedClientId:J,profiles:s.profiles,activeProfileId:s.activeProfileId,activeProfile:hn,isController:S==="controller",sharedWindowCount:_,terminalResetVersion:ae,rttMs:ce,statusPayload:Se,lastPairedAt:Z,settings:s,hostPalette:Q,terminalDimensions:Te,toasts:X,adapter:Ot,language:s.language,t:Oe,setLanguage:_e,connect:Ut,disconnect:ii,switchProfile:$n,addProfileAndConnect:an,renameProfile:qt,removeProfile:Hn,claimControl:si,releaseControl:ga,sendKey:Pn,sendBinary:zn,sendResize:Gn,updateSettings:ve,addToast:yt,removeToast:Wn,warnViewerMode:ee,subscribeToOutput:ut,getPendingOutputChunkCount:wt,sendPasteFile:Jt,subscribeToPasteFileReady:el},children:o})};function mt(){const o=x.useContext(dp);if(!o)throw new Error("useTerminal must be used within a TerminalProvider");return o}function fp(o){var s,r,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(s=0;s<f;s++)o[s]&&(r=fp(o[s]))&&(c&&(c+=" "),c+=r)}else for(r in o)o[r]&&(c&&(c+=" "),c+=r);return c}function Uy(){for(var o,s,r=0,c="",f=arguments.length;r<f;r++)(o=arguments[r])&&(s=fp(o))&&(c&&(c+=" "),c+=s);return c}const By=(o,s)=>{const r=new Array(o.length+s.length);for(let c=0;c<o.length;c++)r[c]=o[c];for(let c=0;c<s.length;c++)r[o.length+c]=s[c];return r},Hy=(o,s)=>({classGroupId:o,validator:s}),mp=(o=new Map,s=null,r)=>({nextPart:o,validators:s,classGroupId:r}),zo="-",Eh=[],Yy="arbitrary..",Ky=o=>{const s=qy(o),{conflictingClassGroups:r,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:b=>{if(b.startsWith("[")&&b.endsWith("]"))return Gy(b);const p=b.split(zo),y=p[0]===""&&p.length>1?1:0;return hp(p,y,s)},getConflictingClassGroupIds:(b,p)=>{if(p){const y=c[b],S=r[b];return y?S?By(S,y):y:S||Eh}return r[b]||Eh}}},hp=(o,s,r)=>{if(o.length-s===0)return r.classGroupId;const f=o[s],m=r.nextPart.get(f);if(m){const S=hp(o,s+1,m);if(S)return S}const b=r.validators;if(b===null)return;const p=s===0?o.join(zo):o.slice(s).join(zo),y=b.length;for(let S=0;S<y;S++){const g=b[S];if(g.validator(p))return g.classGroupId}},Gy=o=>o.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=o.slice(1,-1),r=s.indexOf(":"),c=s.slice(0,r);return c?Yy+c:void 0})(),qy=o=>{const{theme:s,classGroups:r}=o;return Xy(r,s)},Xy=(o,s)=>{const r=mp();for(const c in o){const f=o[c];gu(f,r,c,s)}return r},gu=(o,s,r,c)=>{const f=o.length;for(let m=0;m<f;m++){const b=o[m];Vy(b,s,r,c)}},Vy=(o,s,r,c)=>{if(typeof o=="string"){Zy(o,s,r);return}if(typeof o=="function"){Qy(o,s,r,c);return}Fy(o,s,r,c)},Zy=(o,s,r)=>{const c=o===""?s:pp(s,o);c.classGroupId=r},Qy=(o,s,r,c)=>{if(Jy(o)){gu(o(c),s,r,c);return}s.validators===null&&(s.validators=[]),s.validators.push(Hy(r,o))},Fy=(o,s,r,c)=>{const f=Object.entries(o),m=f.length;for(let b=0;b<m;b++){const[p,y]=f[b];gu(y,pp(s,p),r,c)}},pp=(o,s)=>{let r=o;const c=s.split(zo),f=c.length;for(let m=0;m<f;m++){const b=c[m];let p=r.nextPart.get(b);p||(p=mp(),r.nextPart.set(b,p)),r=p}return r},Jy=o=>"isThemeGetter"in o&&o.isThemeGetter===!0,Iy=o=>{if(o<1)return{get:()=>{},set:()=>{}};let s=0,r=Object.create(null),c=Object.create(null);const f=(m,b)=>{r[m]=b,s++,s>o&&(s=0,c=r,r=Object.create(null))};return{get(m){let b=r[m];if(b!==void 0)return b;if((b=c[m])!==void 0)return f(m,b),b},set(m,b){m in r?r[m]=b:f(m,b)}}},cu="!",Ah=":",Wy=[],jh=(o,s,r,c,f)=>({modifiers:o,hasImportantModifier:s,baseClassName:r,maybePostfixModifierPosition:c,isExternal:f}),$y=o=>{const{prefix:s,experimentalParseClassName:r}=o;let c=f=>{const m=[];let b=0,p=0,y=0,S;const g=f.length;for(let V=0;V<g;V++){const k=f[V];if(b===0&&p===0){if(k===Ah){m.push(f.slice(y,V)),y=V+1;continue}if(k==="/"){S=V;continue}}k==="["?b++:k==="]"?b--:k==="("?p++:k===")"&&p--}const T=m.length===0?f:f.slice(y);let B=T,O=!1;T.endsWith(cu)?(B=T.slice(0,-1),O=!0):T.startsWith(cu)&&(B=T.slice(1),O=!0);const L=S&&S>y?S-y:void 0;return jh(m,O,B,L)};if(s){const f=s+Ah,m=c;c=b=>b.startsWith(f)?m(b.slice(f.length)):jh(Wy,!1,b,void 0,!0)}if(r){const f=c;c=m=>r({className:m,parseClassName:f})}return c},Py=o=>{const s=new Map;return o.orderSensitiveModifiers.forEach((r,c)=>{s.set(r,1e6+c)}),r=>{const c=[];let f=[];for(let m=0;m<r.length;m++){const b=r[m],p=b[0]==="[",y=s.has(b);p||y?(f.length>0&&(f.sort(),c.push(...f),f=[]),c.push(b)):f.push(b)}return f.length>0&&(f.sort(),c.push(...f)),c}},ev=o=>({cache:Iy(o.cacheSize),parseClassName:$y(o),sortModifiers:Py(o),postfixLookupClassGroupIds:tv(o),...Ky(o)}),tv=o=>{const s=Object.create(null),r=o.postfixLookupClassGroups;if(r)for(let c=0;c<r.length;c++)s[r[c]]=!0;return s},nv=/\s+/,lv=(o,s)=>{const{parseClassName:r,getClassGroupId:c,getConflictingClassGroupIds:f,sortModifiers:m,postfixLookupClassGroupIds:b}=s,p=[],y=o.trim().split(nv);let S="";for(let g=y.length-1;g>=0;g-=1){const T=y[g],{isExternal:B,modifiers:O,hasImportantModifier:L,baseClassName:V,maybePostfixModifierPosition:k}=r(T);if(B){S=T+(S.length>0?" "+S:S);continue}let Q=!!k,P;if(Q){const _=V.substring(0,k);P=c(_);const R=P&&b[P]?c(V):void 0;R&&R!==P&&(P=R,Q=!1)}else P=c(V);if(!P){if(!Q){S=T+(S.length>0?" "+S:S);continue}if(P=c(V),!P){S=T+(S.length>0?" "+S:S);continue}Q=!1}const J=O.length===0?"":O.length===1?O[0]:m(O).join(":"),oe=L?J+cu:J,ce=oe+P;if(p.indexOf(ce)>-1)continue;p.push(ce);const Y=f(P,Q);for(let _=0;_<Y.length;++_){const R=Y[_];p.push(oe+R)}S=T+(S.length>0?" "+S:S)}return S},av=(...o)=>{let s=0,r,c,f="";for(;s<o.length;)(r=o[s++])&&(c=bp(r))&&(f&&(f+=" "),f+=c);return f},bp=o=>{if(typeof o=="string")return o;let s,r="";for(let c=0;c<o.length;c++)o[c]&&(s=bp(o[c]))&&(r&&(r+=" "),r+=s);return r},iv=(o,...s)=>{let r,c,f,m;const b=y=>{const S=s.reduce((g,T)=>T(g),o());return r=ev(S),c=r.cache.get,f=r.cache.set,m=p,p(y)},p=y=>{const S=c(y);if(S)return S;const g=lv(y,r);return f(y,g),g};return m=b,(...y)=>m(av(...y))},sv=[],_t=o=>{const s=r=>r[o]||sv;return s.isThemeGetter=!0,s},gp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ov=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=o=>ov.test(o),ke=o=>!!o&&!Number.isNaN(Number(o)),In=o=>!!o&&Number.isInteger(Number(o)),$c=o=>o.endsWith("%")&&ke(o.slice(0,-1)),vl=o=>rv.test(o),vp=()=>!0,mv=o=>cv.test(o)&&!uv.test(o),yu=()=>!1,hv=o=>dv.test(o),pv=o=>fv.test(o),bv=o=>!le(o)&&!ie(o),gv=o=>o.startsWith("@container")&&(o[10]==="/"&&o[11]!==void 0||o[11]==="s"&&o[16]!==void 0&&o.startsWith("-size/",10)||o[11]==="n"&&o[18]!==void 0&&o.startsWith("-normal/",10)),yv=o=>Jl(o,wp,yu),le=o=>gp.test(o),fa=o=>Jl(o,Cp,mv),Rh=o=>Jl(o,Ev,ke),vv=o=>Jl(o,Np,vp),xv=o=>Jl(o,Tp,yu),Mh=o=>Jl(o,xp,yu),Sv=o=>Jl(o,Sp,pv),So=o=>Jl(o,Ep,hv),ie=o=>yp.test(o),Wi=o=>ba(o,Cp),wv=o=>ba(o,Tp),zh=o=>ba(o,xp),Cv=o=>ba(o,wp),Tv=o=>ba(o,Sp),wo=o=>ba(o,Ep,!0),Nv=o=>ba(o,Np,!0),Jl=(o,s,r)=>{const c=gp.exec(o);return c?c[1]?s(c[1]):r(c[2]):!1},ba=(o,s,r=!1)=>{const c=yp.exec(o);return c?c[1]?s(c[1]):r:!1},xp=o=>o==="position"||o==="percentage",Sp=o=>o==="image"||o==="url",wp=o=>o==="length"||o==="size"||o==="bg-size",Cp=o=>o==="length",Ev=o=>o==="number",Tp=o=>o==="family-name",Np=o=>o==="number"||o==="weight",Ep=o=>o==="shadow",Av=()=>{const o=_t("color"),s=_t("font"),r=_t("text"),c=_t("font-weight"),f=_t("tracking"),m=_t("leading"),b=_t("breakpoint"),p=_t("container"),y=_t("spacing"),S=_t("radius"),g=_t("shadow"),T=_t("inset-shadow"),B=_t("text-shadow"),O=_t("drop-shadow"),L=_t("blur"),V=_t("perspective"),k=_t("aspect"),Q=_t("ease"),P=_t("animate"),J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ce=()=>[...oe(),ie,le],Y=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],R=()=>[ie,le,y],ae=()=>[Fl,"full","auto",...R()],Ee=()=>[In,"none","subgrid",ie,le],Se=()=>["auto",{span:["full",In,ie,le]},In,ie,le],me=()=>[In,"auto",ie,le],Z=()=>["auto","min","max","fr",ie,le],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Te=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...R()],X=()=>[Fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],W=()=>[Fl,"screen","full","dvw","lvw","svw","min","max","fit",...R()],ue=()=>[Fl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],K=()=>[o,ie,le],Me=()=>[...oe(),zh,Mh,{position:[ie,le]}],ze=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ce=()=>["auto","cover","contain",Cv,yv,{size:[ie,le]}],Oe=()=>[$c,Wi,fa],we=()=>["","none","full",S,ie,le],xe=()=>["",ke,Wi,fa],$e=()=>["solid","dashed","dotted","double"],bt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[ke,$c,zh,Mh],ct=()=>["","none",L,ie,le],lt=()=>["none",ke,ie,le],ut=()=>["none",ke,ie,le],wt=()=>[ke,ie,le],st=()=>[Fl,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vl],breakpoint:[vl],color:[vp],container:[vl],"drop-shadow":[vl],ease:["in","out","in-out"],font:[bv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vl],shadow:[vl],spacing:["px",ke],text:[vl],"text-shadow":[vl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fl,le,ie,k]}],container:["container"],"container-type":[{"@container":["","normal","size",ie,le]}],"container-named":[gv],columns:[{columns:[ke,le,ie,p]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ce()}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[In,"auto",ie,le]}],basis:[{basis:[Fl,"full","auto",p,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,Fl,"auto","initial","none",le]}],grow:[{grow:["",ke,ie,le]}],shrink:[{shrink:["",ke,ie,le]}],order:[{order:[In,"first","last","none",ie,le]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Se()}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Se()}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...Te(),"normal"]}],"justify-self":[{"justify-self":["auto",...Te()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...Te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Te(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...Te(),"baseline"]}],"place-self":[{"place-self":["auto",...Te()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[p,"screen",...X()]}],"min-w":[{"min-w":[p,"screen","none",...X()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[b]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",r,Wi,fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,Nv,vv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$c,le]}],"font-family":[{font:[wv,xv,s]}],"font-features":[{"font-features":[le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[f,ie,le]}],"line-clamp":[{"line-clamp":[ke,"none",ie,Rh]}],leading:[{leading:[m,...R()]}],"list-image":[{"list-image":["none",ie,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$e(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",ie,fa]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[ke,"auto",ie,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[In,ie,le]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Me()}],"bg-repeat":[{bg:ze()}],"bg-size":[{bg:Ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},In,ie,le],radial:["",ie,le],conic:[In,ie,le]},Tv,Sv]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:Oe()}],"gradient-via-pos":[{via:Oe()}],"gradient-to-pos":[{to:Oe()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:we()}],"rounded-s":[{"rounded-s":we()}],"rounded-e":[{"rounded-e":we()}],"rounded-t":[{"rounded-t":we()}],"rounded-r":[{"rounded-r":we()}],"rounded-b":[{"rounded-b":we()}],"rounded-l":[{"rounded-l":we()}],"rounded-ss":[{"rounded-ss":we()}],"rounded-se":[{"rounded-se":we()}],"rounded-ee":[{"rounded-ee":we()}],"rounded-es":[{"rounded-es":we()}],"rounded-tl":[{"rounded-tl":we()}],"rounded-tr":[{"rounded-tr":we()}],"rounded-br":[{"rounded-br":we()}],"rounded-bl":[{"rounded-bl":we()}],"border-w":[{border:xe()}],"border-w-x":[{"border-x":xe()}],"border-w-y":[{"border-y":xe()}],"border-w-s":[{"border-s":xe()}],"border-w-e":[{"border-e":xe()}],"border-w-bs":[{"border-bs":xe()}],"border-w-be":[{"border-be":xe()}],"border-w-t":[{"border-t":xe()}],"border-w-r":[{"border-r":xe()}],"border-w-b":[{"border-b":xe()}],"border-w-l":[{"border-l":xe()}],"divide-x":[{"divide-x":xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$e(),"hidden","none"]}],"divide-style":[{divide:[...$e(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...$e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,ie,le]}],"outline-w":[{outline:["",ke,Wi,fa]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",g,wo,So]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",T,wo,So]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[ke,fa]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":xe()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",B,wo,So]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[ke,ie,le]}],"mix-blend":[{"mix-blend":[...bt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":bt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[ie,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":oe()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Me()}],"mask-repeat":[{mask:ze()}],"mask-size":[{mask:Ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,le]}],filter:[{filter:["","none",ie,le]}],blur:[{blur:ct()}],brightness:[{brightness:[ke,ie,le]}],contrast:[{contrast:[ke,ie,le]}],"drop-shadow":[{"drop-shadow":["","none",O,wo,So]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",ke,ie,le]}],"hue-rotate":[{"hue-rotate":[ke,ie,le]}],invert:[{invert:["",ke,ie,le]}],saturate:[{saturate:[ke,ie,le]}],sepia:[{sepia:["",ke,ie,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,le]}],"backdrop-blur":[{"backdrop-blur":ct()}],"backdrop-brightness":[{"backdrop-brightness":[ke,ie,le]}],"backdrop-contrast":[{"backdrop-contrast":[ke,ie,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,ie,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,ie,le]}],"backdrop-invert":[{"backdrop-invert":["",ke,ie,le]}],"backdrop-opacity":[{"backdrop-opacity":[ke,ie,le]}],"backdrop-saturate":[{"backdrop-saturate":[ke,ie,le]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,ie,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",ie,le]}],ease:[{ease:["linear","initial",Q,ie,le]}],delay:[{delay:[ke,ie,le]}],animate:[{animate:["none",P,ie,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[V,ie,le]}],"perspective-origin":[{"perspective-origin":ce()}],rotate:[{rotate:lt()}],"rotate-x":[{"rotate-x":lt()}],"rotate-y":[{"rotate-y":lt()}],"rotate-z":[{"rotate-z":lt()}],scale:[{scale:ut()}],"scale-x":[{"scale-x":ut()}],"scale-y":[{"scale-y":ut()}],"scale-z":[{"scale-z":ut()}],"scale-3d":["scale-3d"],skew:[{skew:wt()}],"skew-x":[{"skew-x":wt()}],"skew-y":[{"skew-y":wt()}],transform:[{transform:[ie,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:ce()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:st()}],"translate-x":[{"translate-x":st()}],"translate-y":[{"translate-y":st()}],"translate-z":[{"translate-z":st()}],"translate-none":["translate-none"],zoom:[{zoom:[In,ie,le]}],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":K()}],"scrollbar-track-color":[{"scrollbar-track":K()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie,le]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[ke,Wi,fa,Rh]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jv=iv(Av);function $(...o){return jv(Uy(o))}var Rv=Ih();const Le={cursor:"▸",on:"●",off:"○",dot:"·",check:"✓",cross:"✗",warn:"!",arrowRight:"→",arrowLeft:"←",chevronDown:"▾",chevronRight:"▸",ellipsis:"…",meterFull:"█",meterEmpty:"░",tabDivider:"│"},An={ok:{text:"text-tui-ok",edgeL:"border-l-tui-ok",edgeB:"border-b-tui-ok"},warn:{text:"text-tui-warn",edgeL:"border-l-tui-warn",edgeB:"border-b-tui-warn"},bad:{text:"text-tui-bad",edgeL:"border-l-tui-bad",edgeB:"border-b-tui-bad"},idle:{text:"text-tui-faint",edgeL:"border-l-tui-border",edgeB:"border-b-tui-border"},accent:{text:"text-tui-accent",edgeL:"border-l-tui-accent",edgeB:"border-b-tui-accent"},alt:{text:"text-tui-alt",edgeL:"border-l-tui-alt",edgeB:"border-b-tui-alt"},info:{text:"text-tui-info",edgeL:"border-l-tui-info",edgeB:"border-b-tui-info"}},cs={ok:An.ok.text,warn:An.warn.text,bad:An.bad.text,idle:An.idle.text,accent:An.accent.text,alt:An.alt.text,info:An.info.text},Mn=({level:o,className:s})=>u.jsx("span",{"aria-hidden":"true",className:$("select-none leading-none",cs[o],s),children:o==="idle"?Le.off:Le.on}),Ap=({className:o})=>u.jsx("span",{"aria-hidden":"true",className:$("select-none text-tui-faint",o),children:Le.dot}),Zt=({title:o,aside:s,tone:r="accent",className:c,bodyClassName:f,children:m,...b})=>u.jsxs("fieldset",{className:$("tui-panel tui-block relative min-w-0 border border-tui-border bg-tui-base",o?"px-3 pb-3 pt-1":"p-3",c),...b,children:[o?u.jsx("legend",{className:$("flex items-center gap-2 text-tui font-bold",cs[r]),children:u.jsx("span",{children:o})}):null,s?u.jsx("span",{className:"pointer-events-none absolute -top-[10px] right-2 max-w-[60%] truncate bg-tui-base px-1 text-tui-sm text-tui-faint",children:s}):null,u.jsx("div",{className:$("min-w-0",f),children:m})]}),Bn=({label:o,labelWidth:s=16,className:r,children:c})=>u.jsxs("div",{className:$("flex items-baseline gap-2 text-tui",r),children:[u.jsx("span",{className:"shrink-0 truncate text-tui-muted",style:{width:`${s}ch`},title:typeof o=="string"?o:void 0,children:o}),u.jsx("span",{className:"min-w-0 flex-1 text-tui-text",children:c})]}),ni=({className:o,label:s})=>s?u.jsxs("div",{className:$("flex items-center gap-2",o),children:[u.jsx("span",{className:"h-px w-3 bg-tui-border-dim","aria-hidden":"true"}),u.jsx("span",{className:"text-tui-sm text-tui-faint",children:s}),u.jsx("span",{className:"h-px flex-1 bg-tui-border-dim","aria-hidden":"true"})]}):u.jsx("div",{className:$("h-px w-full bg-tui-border-dim",o),"aria-hidden":"true"}),Mv={default:"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",primary:"border-tui-accent text-tui-accent hover:bg-tui-accent hover:text-tui-crust active:bg-tui-accent-dim",danger:"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust active:bg-tui-bad",warn:"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust active:bg-tui-warn",ghost:"border-transparent text-tui-muted hover:text-tui-accent hover:border-tui-border active:bg-tui-selection"},Re=({variant:o="default",brackets:s=!0,glyph:r,block:c=!1,className:f,children:m,type:b="button",...p})=>u.jsxs("button",{type:b,className:$("tui-focusable inline-flex select-none items-center justify-center gap-1.5 border bg-transparent px-2 py-0.5 text-tui font-medium transition-colors","disabled:cursor-not-allowed disabled:border-tui-border-dim disabled:text-tui-faint disabled:hover:bg-transparent",Mv[o],c&&"w-full",f),...p,children:[s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"["}):null,r?u.jsx("span",{"aria-hidden":"true",className:"leading-none",children:r}):null,u.jsx("span",{className:"truncate",children:m}),s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"]"}):null]}),ko=({tone:o="accent",dot:s=!1,className:r,children:c})=>u.jsxs("span",{className:$("inline-flex select-none items-center gap-1 whitespace-nowrap text-tui font-bold uppercase",cs[o],r),children:[s?u.jsx(Mn,{level:o}):null,c]}),vu=({tabs:o,activeId:s,onSelect:r,ariaLabel:c,className:f,labelClassName:m})=>u.jsx("nav",{className:$("flex items-center gap-2",f),"aria-label":c,children:o.map((b,p)=>{const y=b.id===s;return u.jsxs(Sl.Fragment,{children:[p>0?u.jsx("span",{"aria-hidden":"true",className:"select-none text-tui-border",children:Le.tabDivider}):null,u.jsxs("button",{type:"button",onClick:()=>r(b.id),"aria-current":y?"page":void 0,"aria-label":b.ariaLabel??b.label,title:b.title,className:$("tui-focusable select-none whitespace-nowrap border-b px-0.5 pb-0.5 text-tui transition-colors",y?"border-tui-accent font-bold text-tui-accent":"border-transparent text-tui-muted hover:border-tui-border-bright hover:text-tui-text"),children:[b.index!==void 0?u.jsx("span",{"aria-hidden":"true",className:$("text-tui-faint",y&&"text-tui-accent"),children:b.index}):null,u.jsx("span",{"aria-hidden":"true",className:$("ml-1",m),children:b.label})]})]},b.id)})}),jp=({hints:o,className:s})=>u.jsx("div",{className:$("flex flex-wrap items-center gap-x-3 gap-y-0.5 text-tui-sm text-tui-faint",s),children:o.map((r,c)=>u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"border border-tui-border-dim px-1 not-italic text-tui-muted",children:r.keys}),u.jsx("span",{children:r.action})]},`${r.keys}-${c}`))}),jn=({htmlFor:o,hint:s,className:r,children:c})=>u.jsxs("label",{htmlFor:o,className:$("block text-tui-sm font-bold text-tui-muted",r),children:[c,s?u.jsx("span",{className:"ml-2 font-normal text-tui-faint",children:s}):null]}),Rn=Sl.forwardRef(({className:o,...s},r)=>u.jsx("input",{ref:r,className:$("tui-input w-full px-2 py-1 text-tui",o),...s}));Rn.displayName="Input";const xu=Sl.forwardRef(({className:o,children:s,...r},c)=>u.jsx("select",{ref:c,className:$("tui-input w-full px-2 py-1 text-tui",o),...r,children:s}));xu.displayName="Select";const uu=({checked:o,onChange:s,disabled:r=!1,label:c,description:f,className:m,id:b})=>u.jsxs("label",{className:$("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",r&&"cursor-not-allowed opacity-60",m),children:[u.jsx("input",{id:b,type:"checkbox",className:"sr-only",checked:o,disabled:r,onChange:p=>s(p.target.checked)}),u.jsx("span",{"aria-hidden":"true",className:$("mt-px shrink-0 font-bold leading-tight",o?"text-tui-ok":"text-tui-faint",!r&&"group-hover:text-tui-accent"),children:o?"[x]":"[ ]"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:$("block",o?"text-tui-text":"text-tui-muted"),children:c}),f?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:f}):null]})]}),_h=({checked:o,onChange:s,name:r,disabled:c=!1,label:f,description:m,className:b})=>u.jsxs("label",{className:$("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",c&&"cursor-not-allowed opacity-60",b),children:[u.jsx("input",{type:"radio",name:r,className:"sr-only",checked:o,disabled:c,onChange:s}),u.jsx("span",{"aria-hidden":"true",className:$("mt-px shrink-0 font-bold leading-tight",o?"text-tui-accent":"text-tui-faint",!c&&"group-hover:text-tui-accent"),children:o?"(•)":"( )"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:$("block",o?"text-tui-text":"text-tui-muted"),children:f}),m?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:m}):null]})]}),zv=({value:o,width:s=20,tone:r="accent",className:c})=>{const f=Number.isFinite(o)?Math.min(1,Math.max(0,o)):0,m=Math.round(f*s);return u.jsxs("span",{className:$("inline-flex select-none whitespace-pre font-mono leading-none",c),role:"presentation",children:[u.jsx("span",{className:cs[r],children:Le.meterFull.repeat(m)}),u.jsx("span",{className:"text-tui-border",children:Le.meterEmpty.repeat(Math.max(0,s-m))})]})};function Su({columns:o,items:s,rowKey:r,empty:c,className:f}){return s.length===0?u.jsx("div",{className:$("px-1 py-4 text-center text-tui text-tui-faint",f),children:c}):u.jsx("div",{className:$("w-full overflow-x-auto",f),children:u.jsxs("table",{className:"w-full border-collapse text-tui",children:[u.jsx("thead",{children:u.jsx("tr",{className:"border-b border-tui-border",children:o.map(m=>u.jsx("th",{scope:"col",style:m.width?{width:`${m.width}ch`}:void 0,className:$("whitespace-nowrap px-2 py-1 text-tui-sm font-bold text-tui-muted",m.align==="right"?"text-right":"text-left",m.className),children:m.header},m.key))})}),u.jsx("tbody",{children:s.map((m,b)=>u.jsx("tr",{className:"border-b border-tui-border-dim last:border-b-0 hover:bg-tui-selection",children:o.map(p=>u.jsx("td",{className:$("px-2 py-1 align-top text-tui-text",p.align==="right"?"text-right":"text-left",p.className),children:p.render(m,b)},p.key))},r(m,b)))})]})})}const wu=({isOpen:o,onClose:s,title:r,subtitle:c,closeLabel:f,footer:m,hints:b,size:p="md",className:y,children:S})=>{if(!o)return null;const g=p==="sm"?"max-w-md":p==="lg"?"max-w-3xl":"max-w-xl",T=`tui-modal-${r.replace(/\s+/g,"-").toLowerCase()}`,B=u.jsx("div",{className:"fixed inset-0 inset-x-0 z-50 grid place-items-center overflow-y-auto bg-tui-crust/85 p-3 sm:p-6",style:{height:"var(--app-height, 100dvh)",width:"100vw"},role:"dialog","aria-modal":"true","aria-labelledby":T,onMouseDown:O=>{O.target===O.currentTarget&&s()},children:u.jsxs("div",{className:$("flex w-full flex-col border border-tui-border bg-tui-base",g,y),style:{maxHeight:"calc(var(--app-height, 100dvh) - 1.5rem)"},children:[u.jsxs("header",{className:"flex shrink-0 items-center gap-2 border-b border-tui-border bg-tui-mantle px-3 py-1.5",children:[u.jsx("h2",{id:T,className:"truncate text-tui font-bold text-tui-accent",children:r}),c?u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-sm text-tui-faint",children:c}):u.jsx("span",{className:"flex-1"}),u.jsx(Re,{variant:"ghost",onClick:s,"aria-label":f,title:f,children:"esc"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:S}),m||b?u.jsxs("footer",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-tui-border bg-tui-mantle px-3 py-1.5",children:[b?u.jsx(jp,{hints:b}):u.jsx("span",{}),m?u.jsx("div",{className:"flex items-center gap-2",children:m}):null]}):null]})});return typeof document>"u"?B:Rv.createPortal(B,document.body)},Ao=({tone:o="accent",className:s,children:r,action:c})=>{const f=o==="ok"?Le.check:o==="bad"?Le.cross:o==="warn"?Le.warn:"›",m=An[o].edgeL;return u.jsxs("div",{className:$("flex items-start gap-2 border border-tui-border-dim border-l-2 bg-tui-mantle px-2 py-1.5 text-tui",m,s),children:[u.jsx("span",{"aria-hidden":"true",className:$("shrink-0 font-bold",cs[o]),children:f}),u.jsx("div",{className:"min-w-0 flex-1 leading-snug text-tui-text",children:r}),c?u.jsx("div",{className:"shrink-0",children:c}):null]})},_v=({active:o=!1,className:s,children:r})=>u.jsx("span",{className:$("inline-flex min-w-[2ch] select-none items-center justify-center border px-1 text-tui",o?"border-tui-accent bg-tui-accent text-tui-crust":"border-tui-border bg-tui-surface text-tui-muted",s),children:r}),kh=({items:o,className:s})=>{const r=o.filter(Boolean);return u.jsx("span",{className:$("flex min-w-0 items-center gap-1.5",s),children:r.map((c,f)=>u.jsxs(Sl.Fragment,{children:[f>0?u.jsx(Ap,{className:"shrink-0"}):null,c]},f))})},Rp=({left:o,right:s,className:r})=>u.jsxs("footer",{className:$("relative flex h-[var(--tui-row)] w-full shrink-0 items-center justify-between gap-3 overflow-visible border-t border-tui-border bg-tui-mantle px-2 text-tui-sm",r),children:[u.jsx("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-muted",children:o}),u.jsx("div",{className:"flex shrink-0 items-center gap-3",children:s})]}),kv=({name:o,tagline:s,aside:r,tabs:c,activeTabId:f,onSelectTab:m,tabsAriaLabel:b,hints:p,footerAside:y,bodyClassName:S,className:g,children:T})=>u.jsxs("div",{className:$("flex h-full min-h-0 w-full flex-col bg-tui-crust",g),children:[u.jsxs("div",{className:"flex h-[var(--tui-row)] shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[u.jsx("span",{className:"shrink-0 font-bold text-tui-accent",children:o}),s?u.jsx("span",{className:"hidden truncate text-tui-sm text-tui-faint sm:block",children:s}):null]}),r?u.jsx("span",{className:"flex shrink-0 items-center gap-2",children:r}):null]}),c&&c.length>0&&f!==void 0&&m?u.jsx("div",{className:"scrollbar-none shrink-0 overflow-x-auto border-b border-tui-border bg-tui-mantle px-2",children:u.jsx(vu,{tabs:c,activeId:f,onSelect:m,ariaLabel:b,className:"gap-3"})}):null,u.jsx("div",{className:$("min-h-0 flex-1 overflow-y-auto p-2",S),children:T}),p||y?u.jsx(Rp,{left:p?u.jsx(jp,{hints:p}):null,right:y}):null]}),Dh=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],li=({className:o,label:s})=>{const[r,c]=Sl.useState(0);return Sl.useEffect(()=>{const f=setInterval(()=>c(m=>(m+1)%Dh.length),90);return()=>clearInterval(f)},[]),u.jsxs("span",{className:$("inline-flex items-center gap-1.5",o),role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:Dh[r]}),s?u.jsx("span",{children:s}):null]})},Co="tui-focusable select-none border border-transparent px-1.5 text-tui uppercase transition-colors",To="text-tui-muted hover:border-tui-border hover:text-tui-accent",Dv="border-tui-accent bg-tui-accent text-tui-crust",Lv=({currentView:o,onNavigate:s,showAdminEntry:r=!0,onOpenPairing:c,onOpenSettings:f,onToggleVirtualKeyboard:m,isVirtualKeyboardOpen:b})=>{const{addToast:p,language:y,setLanguage:S,t:g}=mt(),T=()=>{const O=y==="zh"?"en":"zh";S(O),p("info",bu(O,"toasts.switchedLanguage",{lang:O==="zh"?"简体中文":"English"}))},B=[{id:"terminal",label:g("header.terminalTab"),index:1,ariaLabel:g("header.terminalTab")},...r||o==="admin"?[{id:"admin",label:g("header.adminTab"),index:2,ariaLabel:g("header.adminTab")}]:[]];return u.jsx("header",{role:"banner",className:"z-30 w-full shrink-0 select-none overflow-hidden border-b border-tui-border bg-tui-mantle px-2 pt-[max(env(safe-area-inset-top,0px),0.125rem)]",children:u.jsxs("div",{className:"scrollbar-none flex min-h-[var(--tui-row)] items-center gap-2 overflow-x-auto text-tui",children:[u.jsxs("span",{className:"flex shrink-0 items-baseline gap-2",children:[u.jsx("span",{className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("span",{className:"hidden text-tui-sm text-tui-faint sm:inline",children:g("header.tagline")})]}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsx(vu,{tabs:B,activeId:o,onSelect:O=>s(O),ariaLabel:g("header.mainNavigationAria"),className:"shrink-0 gap-3"}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[u.jsx("button",{type:"button",onClick:T,className:$(Co,To),title:g("header.languageToggleTitle"),"aria-label":g("header.languageToggleTitle"),children:g("header.languageShort")}),o==="terminal"&&u.jsx("button",{type:"button",onClick:m,className:$(Co,b?Dv:To),title:g("header.virtualKeyboardTitle"),"aria-label":g("header.virtualKeyboardTitle"),children:g("header.actionKeyboard")}),u.jsx("button",{type:"button",onClick:c,className:$(Co,To),title:g("header.pairingTitle"),"aria-label":g("header.pairingTitle"),children:g("header.actionPairing")}),u.jsx("button",{type:"button",onClick:f,className:$(Co,To),title:g("header.settingsTitle"),"aria-label":g("header.settingsTitle"),children:g("header.actionSettings")})]})]})})},No=({tone:o,glyph:s,message:r,assertive:c=!1,action:f})=>u.jsxs("aside",{className:$("flex w-full items-center justify-between gap-3 border-b bg-tui-mantle px-2 py-0.5 text-tui sm:px-3",An[o].edgeB),"aria-live":c?"assertive":"polite",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{"aria-hidden":"true",className:$("shrink-0",An[o].text),children:s}),u.jsx("span",{className:"truncate text-tui-text",children:r})]}),f]}),Ov=()=>{const{connectionState:o,stateDetail:s,connect:r,settings:c,t:f}=mt();return o==="connected"||!c.token&&!c.pairCode&&o==="disconnected"?null:o==="connecting"?u.jsx(No,{tone:"accent",glyph:u.jsx(li,{}),message:f("statusBanner.connecting")}):o==="reconnecting"?u.jsx(No,{tone:"warn",glyph:u.jsx(li,{}),assertive:!0,message:s||f("statusBanner.reconnectingDefault"),action:u.jsx(Re,{variant:"warn",onClick:()=>r(),className:"shrink-0",children:f("statusBanner.reconnectNow")})}):o==="error"?u.jsx(No,{tone:"bad",glyph:Le.cross,assertive:!0,message:s||f("statusBanner.errorDefault"),action:u.jsx(Re,{variant:"danger",onClick:()=>r(),className:"shrink-0",children:f("common.retry")})}):o==="disconnected"?u.jsx(No,{tone:"idle",glyph:Le.off,message:f("statusBanner.disconnected"),action:u.jsx(Re,{variant:"primary",onClick:()=>r(),className:"shrink-0",children:f("common.connect")})}):null};var Uv=Qg(),Bv=Fg();const Hv=20,Yv=6,Kv=500,Gv=300,ai=13,Mp=.602,zp=1.3;function xl(o,s){return Number.isFinite(o)&&o>0?o:s}function Lh(o,s,r){return Math.min(r,Math.max(s,o))}function Oh(o){const{width:s,height:r,cellWidth:c,cellHeight:f,minCols:m=Hv,minRows:b=Yv,maxCols:p=Kv,maxRows:y=Gv}=o,S=xl(c,ai*Mp),g=xl(f,ai*zp);return{cols:Lh(Math.floor(xl(s,0)/S),m,p),rows:Lh(Math.floor(xl(r,0)/g),b,y)}}function ha(o,s=ai){var c,f,m;if(o)try{const b=o._core,p=(m=(f=(c=b==null?void 0:b._renderService)==null?void 0:c.dimensions)==null?void 0:f.css)==null?void 0:m.cell;if(p&&p.width&&p.width>0&&p.height&&p.height>0)return{cellWidth:p.width,cellHeight:p.height,measured:!0}}catch{}const r=xl(s,ai);return{cellWidth:Math.round(r*Mp*100)/100,cellHeight:Math.round(r*zp*100)/100,measured:!1}}function qv(o){var c;const s=(c=o==null?void 0:o.querySelector)==null?void 0:c.call(o,".xterm-viewport");if(!s)return 0;const r=(s.offsetWidth||0)-(s.clientWidth||0);return Number.isFinite(r)&&r>0?r:0}function Pc(o,s,r){if(!o)return{width:s,height:r};let c=0,f=0;if(typeof o.getBoundingClientRect=="function"){const m=o.getBoundingClientRect();c=(m==null?void 0:m.width)||0,f=(m==null?void 0:m.height)||0}return{width:xl(c,xl(o.clientWidth,s)),height:xl(f,xl(o.clientHeight,r))}}function _p(o,s,r,c){const f=Number.isFinite(c)&&c>.01?c:1;return{clientX:r.left+(o-r.left)/f,clientY:r.top+(s-r.top)/f}}function $i(o){var s,r;if(!o)return!1;try{const c=o.modes;if(c&&typeof c.mouseTrackingMode=="string"&&c.mouseTrackingMode!=="none")return!0;const f=o._core;if((s=f==null?void 0:f._coreMouseService)!=null&&s.areMouseEventsActive||(r=f==null?void 0:f.coreMouseService)!=null&&r.areMouseEventsActive||f!=null&&f.mouseMode&&f.mouseMode!=="none")return!0}catch{}return!1}function Xv(o,s){const r=s.button??0,c=s.buttons??(o==="mouseup"?0:1);return new MouseEvent(o,{bubbles:!0,cancelable:!0,clientX:s.clientX,clientY:s.clientY,screenX:s.clientX,screenY:s.clientY,button:r,buttons:c})}function Uh(o,s,r){const c=Xv(s,r);return o.dispatchEvent(c)}class Vv{constructor(s){Fe(this,"options");Fe(this,"state","idle");Fe(this,"startX",0);Fe(this,"startY",0);Fe(this,"lastX",0);Fe(this,"lastY",0);Fe(this,"activeTarget",null);Fe(this,"longPressTimer",null);Fe(this,"capturedPointerId",null);Fe(this,"captureElement",null);Fe(this,"scrollRemainderY",0);this.options={longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,...s}}getState(){return this.state}setGestureState(s){var r,c;this.state!==s&&(this.state=s,(c=(r=this.options).onGestureStateChange)==null||c.call(r,s))}getActiveBuffer(s){var r;try{return((r=s.buffer)==null?void 0:r.active)||null}catch{return null}}getViewportY(s){var c;const r=(c=this.getActiveBuffer(s))==null?void 0:c.viewportY;return typeof r=="number"&&Number.isFinite(r)?r:null}blurTerminal(s){var r;try{(r=s.blur)==null||r.call(s)}catch{}}getLogicalCoordinates(s,r){const c=this.options.getScale?this.options.getScale():1,f=this.options.getSurfaceElement?this.options.getSurfaceElement():null;if(c!==1&&f&&typeof f.getBoundingClientRect=="function"){const m=f.getBoundingClientRect();return _p(s,r,m,c)}return{clientX:s,clientY:r}}getViewportElement(s){var f;const r=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(r==null?void 0:r.querySelector(".xterm-viewport"))||((f=s.element)==null?void 0:f.querySelector(".xterm-viewport"))||null}isInputLineHit(s,r){var P;const c=(P=r.buffer)==null?void 0:P.active,f=this.options.getSurfaceElement?this.options.getSurfaceElement():null,m=(f==null?void 0:f.querySelector(".xterm-screen"))||r.element||f,b=ha(r);if(!m||typeof m.getBoundingClientRect!="function"||b.cellHeight<=0)return!1;const p=m.getBoundingClientRect(),y=this.getLogicalCoordinates(s.clientX,s.clientY),S=p.width>0&&p.height>0;if(![c==null?void 0:c.cursorY,c==null?void 0:c.viewportY,c==null?void 0:c.baseY].every(J=>typeof J=="number"&&Number.isFinite(J)))return!1;const T=c==null?void 0:c.cursorY,B=c==null?void 0:c.viewportY,L=(c==null?void 0:c.baseY)+T-B,V=p.top+L*b.cellHeight,k=V+b.cellHeight,Q=Number(r.rows);return L>=0&&(!Number.isFinite(Q)||L<Q)&&y.clientY>=V-2&&y.clientY<=k+2&&(!S||y.clientX>=p.left&&y.clientX<=p.right)}resolveDispatchTarget(s,r){var p;const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,f=(c==null?void 0:c.querySelector(".xterm-screen"))||r.querySelector(".xterm-screen")||null,m=((p=f==null?void 0:f.closest)==null?void 0:p.call(f,".xterm"))||null;let b=null;return typeof document<"u"&&typeof document.elementFromPoint=="function"&&(b=document.elementFromPoint(s.clientX,s.clientY)),b&&m&&(b===m||m.contains(b))?b:f||c||r}getMouseReport(s,r){const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,f=(c==null?void 0:c.querySelector(".xterm-screen"))||r.element;if(!f||typeof f.getBoundingClientRect!="function")return null;const m=f.getBoundingClientRect(),b=this.getLogicalCoordinates(s.clientX,s.clientY),p=ha(r);if(p.cellWidth<=0||p.cellHeight<=0)return null;const y=Math.max(1,m.width||r.cols*p.cellWidth),S=Math.max(1,m.height||r.rows*p.cellHeight),g=Math.max(0,Math.min(y-1,b.clientX-m.left)),T=Math.max(0,Math.min(S-1,b.clientY-m.top)),B=Math.max(0,Math.min(r.cols-1,Math.floor(g/p.cellWidth))),O=Math.max(0,Math.min(r.rows-1,Math.floor(T/p.cellHeight)));return{col:B,row:O,x:Math.floor(g),y:Math.floor(T),button:0,action:0}}getCoreMouseService(s){var c,f;const r=s;return r.coreMouseService||((c=r._core)==null?void 0:c.coreMouseService)||((f=r._core)==null?void 0:f._coreMouseService)||null}getCoreService(s){var c;const r=s;return r.coreService||((c=r._core)==null?void 0:c.coreService)||null}getWheelDispatchTarget(s){const r=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(r==null?void 0:r.querySelector(".xterm"))||s.element||null}dispatchWheel(s,r,c,f){const m=this.getWheelDispatchTarget(c);if(!m||typeof WheelEvent>"u"||r===0)return!1;const b=this.getLogicalCoordinates(s.clientX,s.clientY),p=r<0?-1:1;let y=0;for(let S=0;S<Math.abs(r);S+=1)try{const g=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:b.clientX,clientY:b.clientY,deltaX:0,deltaY:p,deltaMode:1,ctrlKey:!!(f!=null&&f.ctrlKey),altKey:!!(f!=null&&f.altKey),shiftKey:!!(f!=null&&f.shiftKey)});m.dispatchEvent(g),y+=1}catch{return y>0}return y>0}emitWheel(s,r,c,f){if(r===0)return!1;if(this.dispatchWheel(s,r,c,f))return!0;const m=this.getCoreMouseService(c);if(!(m!=null&&m.triggerMouseEvent))return!1;let b=0;for(let p=0;p<Math.abs(r);p+=1){const y=this.getMouseReport(s,c);y&&(y.button=4,y.action=r<0?0:1,y.ctrl=!!(f!=null&&f.ctrlKey),y.alt=!!(f!=null&&f.altKey),y.shift=!!(f!=null&&f.shiftKey),m.triggerMouseEvent(y)&&(b+=1))}return b>0}scrollAlternateBuffer(s,r,c,f){var b;if(r===0)return"none";const m=$i(c);if(!m&&!this.options.getIsController())return"none";if(this.emitWheel(s,r,c,f))return m?"application-mouse":"application-keys";if(!m){const p=this.getCoreService(c);if(!(p!=null&&p.triggerDataEvent))return"none";const S=`\x1B${!!((b=p.decPrivateModes)!=null&&b.applicationCursorKeys)?"O":"["}${r<0?"A":"B"}`;return p.triggerDataEvent(S.repeat(Math.abs(r)),!0),"application-keys"}return"none"}emitMouse(s,r,c){const f=this.options.getTerminal();if(!f)return;const m=this.getCoreMouseService(f);if(m!=null&&m.triggerMouseEvent){const p=this.getMouseReport(r,f);p&&(p.action=s==="mousedown"?1:s==="mouseup"?0:32,p.ctrl=!!(c!=null&&c.ctrlKey),p.alt=!!(c!=null&&c.altKey),p.shift=!!(c!=null&&c.shiftKey),m.triggerMouseEvent(p));return}if(this.options.allowSyntheticMouseFallback===!1||!this.activeTarget)return;const b=this.getLogicalCoordinates(r.clientX,r.clientY);Uh(this.activeTarget,s,{clientX:b.clientX,clientY:b.clientY,button:0,buttons:s==="mouseup"?0:1})}beginGesture(s,r){this.startX=s.clientX,this.startY=s.clientY,this.lastX=s.clientX,this.lastY=s.clientY,this.setGestureState("pending"),this.scrollRemainderY=0,this.activeTarget=this.resolveDispatchTarget(s,r),this.clearLongPressTimer(),this.longPressTimer=setTimeout(()=>{var c,f;this.state==="pending"&&(this.setGestureState("longpress"),(f=(c=this.options).onLongPress)==null||f.call(c,{clientX:this.startX,clientY:this.startY}))},this.options.longPressDelayMs)}moveGesture(s,r){var S,g,T,B;if(this.state==="longpress"){(g=(S=this.options).onSelectionExtend)==null||g.call(S,{clientX:s.clientX,clientY:s.clientY}),r!=null&&r.cancelable&&((T=r.preventDefault)==null||T.call(r));return}if(this.state==="idle")return;const c=s.clientX-this.startX,f=s.clientY-this.startY,m=Math.hypot(c,f);if(this.state==="scrolling"){this.scrollGesture(s,r);return}const b=this.options.getTerminal(),p=this.options.getIsController(),y=$i(b);if(!(m<=(this.options.dragThresholdPx||8))){if(this.clearLongPressTimer(),Math.abs(f)>=Math.abs(c)||!y||!p){this.setGestureState("scrolling"),b&&this.blurTerminal(b),this.lastX=s.clientX,this.lastY=this.startY,this.scrollRemainderY=0,this.scrollGesture(s,r);return}if(y&&p){this.state==="pending"&&(this.setGestureState("dragging"),this.emitMouse("mousedown",{clientX:this.startX,clientY:this.startY},r)),this.state==="dragging"&&(this.lastX=s.clientX,this.lastY=s.clientY,this.emitMouse("mousemove",s,r),r!=null&&r.cancelable&&((B=r.preventDefault)==null||B.call(r)));return}this.lastX=s.clientX,this.lastY=s.clientY}}scrollGesture(s,r){var L,V,k;const c=this.options.getTerminal();if(!c)return;const f=s.clientY-this.lastY;this.lastX=s.clientX,this.lastY=s.clientY;const m=ha(c),b=m.measured?m.cellHeight:this.options.scrollLineHeightPx||m.cellHeight||18;this.scrollRemainderY+=f;const p=Math.trunc(this.scrollRemainderY/b),y=-p;let S=!1,g="none";const T=this.getActiveBuffer(c),B=$i(c);if(y!==0){if((T==null?void 0:T.type)==="alternate")g=this.scrollAlternateBuffer(s,y,c,r),S=g!=="none";else{const Q=this.getViewportY(c);c.scrollLines(y);const P=this.getViewportY(c);g="buffer",S=Q===null||P===null||Q!==P}this.scrollRemainderY-=p*b}const O=this.getViewportElement(c);(V=(L=this.options).onGestureScroll)==null||V.call(L,{deltaY:f,lines:y,viewportY:this.getViewportY(c),scrollTop:(O==null?void 0:O.scrollTop)??null,scrollHeight:(O==null?void 0:O.scrollHeight)??null,clientHeight:(O==null?void 0:O.clientHeight)??null,moved:S,bufferType:(T==null?void 0:T.type)||null,baseY:typeof(T==null?void 0:T.baseY)=="number"?T.baseY:null,cursorY:typeof(T==null?void 0:T.cursorY)=="number"?T.cursorY:null,hasScrollback:typeof(T==null?void 0:T.hasScrollback)=="boolean"?T.hasScrollback:null,mouseTracking:B,scrollMode:g}),r!=null&&r.cancelable&&((k=r.preventDefault)==null||k.call(r))}endGesture(s,r){var b,p,y;this.clearLongPressTimer();const c=this.options.getTerminal(),f=this.options.getIsController(),m=$i(c);if(this.state==="pending"){if(m&&f){const g={clientX:this.startX,clientY:this.startY};this.emitMouse("mousedown",g,r),this.emitMouse("mouseup",g,r)}const S={clientX:this.startX,clientY:this.startY};f&&c&&this.isInputLineHit(S,c)&&((p=(b=this.options).onFocus)==null||p.call(b))}else if(this.state==="dragging"&&m&&f){const S=s??{clientX:this.lastX,clientY:this.lastY};this.emitMouse("mouseup",S,r),r!=null&&r.cancelable&&((y=r.preventDefault)==null||y.call(r))}this.reset()}handlePointerDown(s,r){if(s.pointerType==="mouse")return!1;if(!s.isPrimary)return this.releasePointerCapture(),this.reset(),!1;if(s.cancelable&&s.preventDefault(),this.beginGesture(s,r),s.pointerType!=="touch")try{typeof r.setPointerCapture=="function"&&(r.setPointerCapture(s.pointerId),this.capturedPointerId=s.pointerId,this.captureElement=r)}catch{}return!0}handlePointerMove(s){s.pointerType==="mouse"||this.state==="idle"||this.moveGesture(s,s)}handlePointerUp(s){s.pointerType==="mouse"||this.state==="idle"||(this.releasePointerCapture(),this.endGesture(s,s))}handlePointerCancel(s){s&&s.pointerType==="mouse"||(this.releasePointerCapture(),this.cancelGesture())}handleTouchStart(s,r){if(s.touches.length!==1){this.reset();return}s.cancelable&&s.preventDefault(),this.beginGesture(s.touches[0],r)}handleTouchMove(s){s.touches.length===1&&this.moveGesture(s.touches[0],s)}handleTouchEnd(s){s.cancelable&&s.preventDefault(),this.endGesture(null,s)}handleTouchCancel(){this.cancelGesture()}cancelGesture(){this.clearLongPressTimer();const s=this.options.getTerminal(),r=this.options.getIsController(),c=$i(s);if(this.state==="dragging"&&c&&r&&this.activeTarget){const f=this.getLogicalCoordinates(this.lastX,this.lastY);Uh(this.activeTarget,"mouseup",{clientX:f.clientX,clientY:f.clientY,button:0,buttons:0})}this.reset()}releasePointerCapture(){const s=this.captureElement,r=this.capturedPointerId;if(this.captureElement=null,this.capturedPointerId=null,!(!s||r===null))try{typeof s.releasePointerCapture=="function"&&(typeof s.hasPointerCapture!="function"||s.hasPointerCapture(r))&&s.releasePointerCapture(r)}catch{}}clearLongPressTimer(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}reset(){this.clearLongPressTimer(),this.releasePointerCapture(),this.setGestureState("idle"),this.activeTarget=null}}var Bh=Jg(),Zv=Ig();function Qv(o,s){if(s.coarsePointer)return{kind:"dom",dispose:()=>{}};try{const r=new Zv.WebglAddon;let c=null;return r.onContextLoss(()=>{var f;try{r.dispose()}catch{}try{c=new Bh.CanvasAddon,o.loadAddon(c)}catch(m){console.debug("Canvas fallback failed after WebGL context loss:",m)}(f=s.onRendererSwapped)==null||f.call(s)}),o.loadAddon(r),{kind:"webgl",dispose:()=>{for(const f of[c,r])try{f==null||f.dispose()}catch{}}}}catch(r){console.debug("WebGL renderer unavailable, falling back to canvas:",r)}try{const r=new Bh.CanvasAddon;return o.loadAddon(r),{kind:"canvas",dispose:()=>{try{r.dispose()}catch{}}}}catch(r){console.debug("Canvas renderer unavailable, using the DOM renderer:",r)}return{kind:"dom",dispose:()=>{}}}function Hh(o,s){const r=typeof window<"u"?window:void 0,c=r&&typeof r.devicePixelRatio=="number"&&r.devicePixelRatio>0?r.devicePixelRatio:1,f=r&&r.visualViewport&&typeof r.visualViewport.scale=="number"&&r.visualViewport.scale>0?r.visualViewport.scale:1,m=Math.max(0,o.width),b=Math.max(0,o.height),p=Math.round(m*c*100)/100,y=Math.round(b*c*100)/100;return{dpr:c,scale:f,cssWidth:m,cssHeight:b,physicalWidth:p,physicalHeight:y}}function Fv(o){const{lastSnapshot:s,currentSnapshot:r,physicalTolerancePx:c=6}=o;if(!s)return{shouldIgnore:!1,isVisualZoom:!1,reason:"initial"};const f=Math.abs(r.scale-s.scale)>.01,m=Math.abs(r.scale-1)>.01;if(f||m)return{shouldIgnore:!0,isVisualZoom:!0,reason:"visual_pinch_zoom"};if(Math.abs(r.dpr-s.dpr)>.01){const S=Math.abs(r.physicalWidth-s.physicalWidth),g=Math.abs(r.physicalHeight-s.physicalHeight);if(S<=c&&g<=c)return{shouldIgnore:!0,isVisualZoom:!0,reason:"dpr_zoom"}}const p=Math.abs(r.cssWidth-s.cssWidth),y=Math.abs(r.cssHeight-s.cssHeight);return p<1&&y<1?{shouldIgnore:!0,isVisualZoom:!1,reason:"no_box_change"}:{shouldIgnore:!1,isVisualZoom:!1,reason:"genuine_resize"}}const Jv=" ()[]{}'\"\\`";function Yh(o,s,r,c=1){var k,Q;if(!s||!((k=s.buffer)!=null&&k.active)||s.cols<=0||s.rows<=0)return null;const f=r||((Q=s.element)==null?void 0:Q.querySelector(".xterm-screen"))||s.element;if(!f||typeof f.getBoundingClientRect!="function")return null;const m=f.getBoundingClientRect(),b=_p(o.clientX,o.clientY,m,c),p=ha(s);if(p.cellWidth<=0||p.cellHeight<=0)return null;const y=Math.max(1,m.width||s.cols*p.cellWidth),S=Math.max(1,m.height||s.rows*p.cellHeight),g=Math.max(0,Math.min(y-1,b.clientX-m.left)),T=Math.max(0,Math.min(S-1,b.clientY-m.top)),B=Math.max(0,Math.min(s.cols-1,Math.floor(g/p.cellWidth))),O=Math.max(0,Math.min(s.rows-1,Math.floor(T/p.cellHeight))),V=(s.buffer.active.viewportY??0)+O;return{col:B,bufferRow:V}}function Iv(o,s){if(!o||o.length===0||o==="\0")return!0;for(const r of o)if(r==="\0"||/\s/.test(r)||s.includes(r))return!0;return!1}function Wv(o,s,r){var B,O;if(!o||!((B=o.buffer)!=null&&B.active)||s<0||s>=o.cols)return null;const c=o.buffer.active.getLine(r);if(!c)return null;const f=((O=o.options)==null?void 0:O.wordSeparator)??Jv,m=new Array(o.cols).fill(null),b=Math.min(o.cols,c.length);let p=0;for(;p<b;){const L=c.getCell(p);if(!L){m[p]={startCol:p,endCol:p+1,isSeparator:!0},p++;continue}const V=L.getWidth();if(V===0){m[p]||(m[p]={startCol:p,endCol:p+1,isSeparator:!0}),p++;continue}const k=L.getChars(),Q=Iv(k,f),P=Math.min(o.cols,p+V),J={startCol:p,endCol:P,isSeparator:Q};for(let oe=p;oe<P;oe++)m[oe]=J;p+=Math.max(1,V)}for(let L=b;L<o.cols;L++)m[L]||(m[L]={startCol:L,endCol:L+1,isSeparator:!0});const y=m[s];if(!y||y.isSeparator)return null;let S=y.startCol;for(;S>0;){const L=m[S-1];if(L&&!L.isSeparator)S=L.startCol;else break}let g=y.endCol;for(;g<o.cols;){const L=m[g];if(L&&!L.isSeparator)g=L.endCol;else break}const T=g-S;return T<=0?null:{startCol:S,length:T}}function $v(o){var m;if(!o||!((m=o.buffer)!=null&&m.active))return"";const s=o.buffer.active,r=s.viewportY??0,c=o.rows,f=[];for(let b=0;b<c;b++){const p=s.getLine(r+b);f.push(p?p.translateToString(!0):"")}for(;f.length>0&&f[f.length-1]==="";)f.pop();return f.join(`
|
|
34
|
-
`)}const Kh=new Set(["│","┃","╎","╏","┆","┇","┊","┋","║","▏","▕","|"]),Pv=.6,ex=new Set(["─","━","═","┄","┅","┈","┉","-"]),tx=.8;function eu(o,s){if(!o)return!1;let r=0;const c=Math.min(s,o.length);for(let f=0;f<c;f++){const m=o.getCell(f);if(m){const b=m.getChars();b&&ex.has(b)&&r++}}return r>=Math.max(5,Math.min(s*.25,10))}function tu(o,s,r){var O;if(!o||!((O=o.buffer)!=null&&O.active)||o.cols<=0)return{startCol:0,endCol:0};const c=o.buffer.active,f=o.cols,m=Math.max(0,Math.min(f-1,s)),b=c.viewportY??0,p=o.rows>0?o.rows:1,y=new Int32Array(f);let S=0;for(let L=0;L<p;L++){const V=c.getLine(b+L);if(S++,!V)continue;const k=Math.min(f,V.length);for(let Q=0;Q<k;Q++){const P=V.getCell(Q);if(P){const J=P.getChars();J&&Kh.has(J)&&y[Q]++}}}if(S===0)return{startCol:0,endCol:f-1};const g=S*Pv,T=L=>y[L]>=g;let B=!1;for(let L=0;L<f;L++)if(T(L)){B=!0;break}if(B){if(T(m))return{startCol:m,endCol:m};let L=-1;for(let k=m-1;k>=0;k--)if(T(k)){L=k;break}let V=f;for(let k=m+1;k<f;k++)if(T(k)){V=k;break}return{startCol:L+1,endCol:V-1}}if(r!==void 0){const L=Math.max(b,Math.min(b+p-1,r)),V=c.getLine(L);if(!eu(V,f)){let k=b;for(let J=L-1;J>=b;J--)if(eu(c.getLine(J),f)){k=J+1;break}let Q=b+p-1;for(let J=L+1;J<=b+p-1;J++)if(eu(c.getLine(J),f)){Q=J-1;break}const P=Q-k+1;if(P>=2){const J=new Int32Array(f);for(let _=k;_<=Q;_++){const R=c.getLine(_);if(!R)continue;const ae=Math.min(f,R.length);for(let Ee=0;Ee<ae;Ee++){const Se=R.getCell(Ee);if(Se){const me=Se.getChars();me&&Kh.has(me)&&J[Ee]++}}}const oe=P*tx,ce=_=>J[_]>=oe;let Y=!1;for(let _=0;_<f;_++)if(ce(_)){Y=!0;break}if(Y){if(ce(m))return{startCol:m,endCol:m};let _=-1;for(let ae=m-1;ae>=0;ae--)if(ce(ae)){_=ae;break}let R=f;for(let ae=m+1;ae<f;ae++)if(ce(ae)){R=ae;break}return{startCol:_+1,endCol:R-1}}}}}return{startCol:0,endCol:f-1}}function Gh(o,s){const r=Math.min(o.startCol,o.endCol),c=Math.max(o.startCol,o.endCol),f=Math.min(o.startRow,o.endRow),m=Math.max(o.startRow,o.endRow);return{startCol:Math.max(s.startCol,Math.min(s.endCol,r)),endCol:Math.max(s.startCol,Math.min(s.endCol,c)),startRow:f,endRow:m}}function nu(o,s){var S;if(!o||!((S=o.buffer)!=null&&S.active)||o.cols<=0)return"";const r=o.buffer.active,c=o.cols,f=Math.min(s.startRow,s.endRow),m=Math.max(s.startRow,s.endRow),b=Math.max(0,Math.min(s.startCol,s.endCol)),p=Math.min(c-1,Math.max(s.startCol,s.endCol));if(b>p||f>m)return"";const y=[];for(let g=f;g<=m;g++){const T=r.getLine(g);if(!T){y.push("");continue}const B=T.translateToString(!0,b,p+1);y.push(B.trimEnd())}return y.join(`
|
|
35
|
-
`)}async function pa(o){if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")try{return await navigator.clipboard.writeText(o),"clipboard"}catch{}if(typeof document<"u"&&typeof document.execCommand=="function"){let s=null,r=null,c=null;try{if(s=document.createElement("textarea"),s.style.userSelect="text",s.style.webkitUserSelect="text",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="1px",s.style.height="1px",s.style.padding="0",s.style.border="none",s.style.outline="none",s.style.boxShadow="none",s.style.background="transparent",s.style.opacity="0",s.style.fontSize="16px",s.setAttribute("readonly",""),s.setAttribute("aria-hidden","true"),s.value=o,typeof window<"u"&&typeof window.getSelection=="function"&&(c=window.getSelection(),c&&c.rangeCount>0&&(r=c.getRangeAt(0))),document.body.appendChild(s),typeof navigator<"u"&&(/iPad|iPhone|iPod/.test(navigator.userAgent||"")||navigator.platform==="MacIntel"&&(navigator.maxTouchPoints||0)>1)){const b=document.createRange();b.selectNodeContents(s),c&&(c.removeAllRanges(),c.addRange(b)),s.setSelectionRange(0,o.length)}else s.focus({preventScroll:!0}),s.select();if(document.execCommand("copy"))return"exec"}catch{}finally{s&&s.parentNode&&s.parentNode.removeChild(s),c&&(c.removeAllRanges(),r&&c.addRange(r))}}return"failed"}async function nx(){if(!(typeof window>"u"||window.isSecureContext!==!1)||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")return{ok:!1,reason:"insecure"};try{const s=await navigator.clipboard.readText();return!s||s.length===0?{ok:!1,reason:"empty"}:{ok:!0,text:s}}catch(s){return typeof window<"u"&&window.isSecureContext===!1?{ok:!1,reason:"insecure"}:(s==null?void 0:s.name)==="SecurityError"?{ok:!1,reason:"insecure"}:{ok:!1,reason:"denied"}}}async function lx(){if(!(typeof window>"u"||window.isSecureContext!==!1)||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.read!="function")return{ok:!1,reason:"insecure"};try{const s=await navigator.clipboard.read();if(!s||s.length===0)return{ok:!1,reason:"empty"};for(const r of s){const c=r.types.find(f=>f.startsWith("image/"));if(c){const f=await r.getType(c);if(f&&f.size>0)return{ok:!0,blob:f}}}return{ok:!1,reason:"empty"}}catch(s){if(typeof window<"u"&&window.isSecureContext===!1)return{ok:!1,reason:"insecure"};const r=s==null?void 0:s.name;return r==="SecurityError"?{ok:!1,reason:"insecure"}:r==="NotAllowedError"?{ok:!1,reason:"denied"}:{ok:!1,reason:"empty"}}}function kp(o){const s=o.clipboardData;if(!s)return null;if(s.files&&s.files.length>0)for(let r=0;r<s.files.length;r++){const c=s.files[r];if(c&&c.type.startsWith("image/"))return c}if(s.items&&s.items.length>0)for(let r=0;r<s.items.length;r++){const c=s.items[r];if(c&&c.type.startsWith("image/")){const f=c.getAsFile();if(f)return f}}return null}function ax(o){if(!o||o.length===0)return null;for(let s=0;s<o.length;s++){const r=o[s];if(r&&(r.type.startsWith("image/")||/\.(png|jpe?g|webp|gif)$/i.test(r.name)))return r}return null}const Dp=1568,ix=3*1024*1024,sx=[.85,.7,.55,.4];function ox(o,s,r=Dp){if(o<=0||s<=0)return{width:Math.max(1,o),height:Math.max(1,s)};const c=Math.max(o,s);if(c<=r)return{width:o,height:s};const f=r/c;return{width:Math.max(1,Math.round(o*f)),height:Math.max(1,Math.round(s*f))}}function rx(o){if(typeof o!="string"||o.length===0)return 0;const s=o.length;let r=0;o.endsWith("==")?r=2:o.endsWith("=")&&(r=1);const c=Math.floor(s*3/4)-r;return Number.isFinite(c)&&c>0?c:0}function cx(o){return o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`}async function ux(o){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(o,{imageOrientation:"from-image"});return{source:s,width:s.width,height:s.height,cleanup:()=>{typeof s.close=="function"&&s.close()}}}catch{try{const s=await createImageBitmap(o);return{source:s,width:s.width,height:s.height,cleanup:()=>{typeof s.close=="function"&&s.close()}}}catch{}}return new Promise((s,r)=>{if(typeof Image>"u")return r(new Error("Image decoding not supported in this environment"));const c=new Image,f=URL.createObjectURL(o);c.onload=()=>{s({source:c,width:c.naturalWidth||c.width,height:c.naturalHeight||c.height,cleanup:()=>{try{URL.revokeObjectURL(f)}catch{}}})},c.onerror=()=>{try{URL.revokeObjectURL(f)}catch{}r(new Error("Failed to decode image source"))},c.src=f})}async function du(o,s=Dp,r=ix){var f;if(!o||o.size===0||o.type&&!o.type.startsWith("image/"))return null;let c;try{c=await ux(o)}catch(m){return console.warn("Failed to decode image for paste:",m),null}try{const{width:m,height:b}=ox(c.width,c.height,s),p=document.createElement("canvas");p.width=m,p.height=b;const y=p.getContext("2d");if(!y)return null;y.drawImage(c.source,0,0,m,b);let S="image/webp";try{p.toDataURL("image/webp",.85).startsWith("data:image/webp")||(S="image/jpeg")}catch{S="image/jpeg"}for(const g of sx){let T;try{T=p.toDataURL(S,g)}catch{continue}if(!T||!T.startsWith("data:"))continue;const B=T.indexOf(","),O=B!==-1?T.slice(B+1):"",L=rx(O);if(L<=r)return{mime:S,dataBase64:O,dataUrl:T,byteLength:L,width:m,height:b}}return null}finally{(f=c.cleanup)==null||f.call(c)}}const Pi="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",es="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",dx=({anchorPoint:o,hasSelection:s,isController:r,vibrateOnKeyPress:c=!1,onCopySelection:f,onCopyLine:m,onCopyScreen:b,onPaste:p,onClose:y})=>{const{t:S}=mt(),g=x.useRef(null),[T,B]=x.useState(null);x.useEffect(()=>{if(c&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[c]),x.useLayoutEffect(()=>{const k=g.current;if(!k||!k.parentElement)return;const Q=k.parentElement.getBoundingClientRect(),P=k.getBoundingClientRect(),J=P.width||208,oe=P.height||220,ce=Q.width,Y=Q.height;let _=o.x-J/2;_=Math.max(8,Math.min(Math.max(8,ce-J-8),_));let R=o.y-oe-8;R<8&&(R=o.y+8),R=Math.max(8,Math.min(Math.max(8,Y-oe-8),R)),B({x:_,y:R})},[o.x,o.y,s,r]);const O=Math.max(8,o.x-104),L=Math.max(8,o.y-200),V={position:"absolute",left:`${T?T.x:O}px`,top:`${T?T.y:L}px`,visibility:T?"visible":"hidden"};return u.jsx("div",{ref:g,role:"menu","aria-label":"终端选择操作",className:"z-50 w-52 select-none font-mono",style:V,onMouseDown:k=>k.stopPropagation(),onTouchStart:k=>k.stopPropagation(),onPointerDown:k=>k.stopPropagation(),children:u.jsxs(Zt,{tone:"accent",className:"border border-tui-border bg-tui-base p-1.5 shadow-lg",bodyClassName:"flex flex-col gap-1",children:[s&&u.jsxs("button",{type:"button",role:"menuitem",className:$(Pi,es),onClick:()=>{f(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Le.cursor}),u.jsx("span",{className:"truncate",children:S("clipboard.copySelection")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:$(Pi,es),onClick:()=>{m(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Le.cursor}),u.jsx("span",{className:"truncate",children:S("clipboard.copyLine")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:$(Pi,es),onClick:()=>{b(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Le.cursor}),u.jsx("span",{className:"truncate",children:S("clipboard.copyScreen")})]}),r&&u.jsxs("button",{type:"button",role:"menuitem",className:$(Pi,es),onClick:()=>{p(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Le.cursor}),u.jsx("span",{className:"truncate",children:S("clipboard.paste")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:$(Pi,es),onClick:y,children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Le.cursor}),u.jsx("span",{className:"truncate",children:S("clipboard.cancel")})]})]})})},fx=({isOpen:o,onClose:s,onSend:r,onSendImage:c})=>{const{t:f,addToast:m}=mt(),[b,p]=x.useState(""),[y,S]=x.useState(null),[g,T]=x.useState(!1),B=x.useRef(null),O=x.useRef(null),L=x.useRef(null);x.useEffect(()=>{o&&(p(""),S(null),T(!1),B.current&&(B.current.value=""),O.current&&(O.current.value=""))},[o]);const V=async Y=>{if(Y.size===0){m("error",f("clipboard.fileEmpty"));return}T(!0);try{const _=await du(Y);_?(S(_),p("")):m("error",f("clipboard.imageTooLarge"))}catch(_){console.error("Failed to process image:",_),m("error",f("clipboard.imageTooLarge"))}finally{T(!1)}},k=async Y=>{const _=kp(Y);_&&(Y.preventDefault(),await V(_))},Q=async Y=>{const _=ax(Y.target.files);Y.target.value="",_&&await V(_)},P=Y=>{const _=Y.target.value;p(_),_&&y&&S(null)},J=()=>{S(null),B.current&&(B.current.value=""),O.current&&(O.current.value="")},oe=()=>{y?(c==null||c(y),s()):b.trim()&&(r(b),s())},ce=!!(b.trim()||y);return u.jsx(wu,{isOpen:o,onClose:s,title:f("clipboard.pasteTitle"),closeLabel:f("clipboard.cancel"),size:"sm",footer:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Re,{variant:"ghost",onClick:s,children:f("clipboard.cancel")}),u.jsx(Re,{variant:"primary",onClick:oe,disabled:!ce||g,children:f("clipboard.pasteSend")})]}),children:u.jsxs("div",{className:"flex flex-col gap-3 p-3 font-mono select-text",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"paste-fallback-input",className:"text-tui-sm text-tui-muted font-sans font-medium",children:f("clipboard.pasteHint")}),u.jsx("textarea",{ref:L,id:"paste-fallback-input","data-testid":"paste-fallback-input",rows:4,autoFocus:!0,placeholder:f("clipboard.pasteHint"),value:b,onChange:P,onPaste:k,disabled:!!y||g,className:"tui-input min-h-[90px] w-full resize-none p-2 text-tui font-mono rounded border border-tui-border bg-tui-bg focus:outline-none focus:ring-1 focus:ring-tui-accent disabled:opacity-50"})]}),u.jsxs("div",{className:"relative my-1",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full border-t border-tui-border"})}),u.jsx("div",{className:"relative flex justify-center text-tui-xs uppercase",children:u.jsx("span",{className:"bg-tui-bg px-2 text-tui-muted font-sans",children:f("clipboard.imageSectionTitle")})})]}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("input",{ref:B,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",className:"hidden","data-testid":"paste-fallback-file-input",onChange:Q}),u.jsx("input",{ref:O,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",capture:"environment",className:"hidden","data-testid":"paste-fallback-camera-input",onChange:Q}),y?u.jsxs("div",{className:"flex flex-col items-center gap-2 p-3 border border-tui-border bg-tui-bg rounded",children:[u.jsx("img",{src:y.dataUrl,alt:"Pasted preview","data-testid":"pasted-image-preview",className:"max-h-40 max-w-full object-contain rounded border border-tui-border"}),u.jsxs("div",{className:"flex items-center justify-between w-full text-tui-xs text-tui-muted pt-1",children:[u.jsx("span",{children:f("clipboard.imageCompressedSize",{size:cx(y.byteLength)})}),u.jsx(Re,{variant:"ghost",onClick:J,"aria-label":f("clipboard.removeImage"),children:f("clipboard.cancel")})]})]}):u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Re,{variant:"default",onClick:()=>{var Y;return(Y=B.current)==null?void 0:Y.click()},disabled:g||!!b.trim(),className:"min-h-[44px] px-3 touch-manipulation text-tui-sm font-sans flex-1","aria-label":f("clipboard.chooseImage"),children:f("clipboard.chooseImage")}),u.jsx(Re,{variant:"default",onClick:()=>{var Y;return(Y=O.current)==null?void 0:Y.click()},disabled:g||!!b.trim(),className:"min-h-[44px] px-3 touch-manipulation text-tui-sm font-sans flex-1","aria-label":f("clipboard.takePhoto"),children:f("clipboard.takePhoto")})]}),g&&u.jsx("div",{className:"flex items-center gap-2 text-tui-xs text-tui-muted animate-pulse",children:u.jsx("span",{children:f("clipboard.imageCompressing")})})]})]})})},mx=250,hx=({onTerminalFocus:o,isActive:s=!0})=>{const r=x.useRef(null),c=x.useRef(null),f=x.useRef(null),m=x.useRef(null),b=x.useRef(1),p=x.useRef({cols:0,rows:0}),y=x.useRef(null),S=x.useRef(null),g=x.useRef(null),T=x.useRef(null),B=x.useRef({width:0,height:0}),O=x.useRef(null),L=vy(),V=L||typeof navigator<"u"&&navigator.maxTouchPoints>0||typeof window<"u"&&"ontouchstart"in window,k=typeof window<"u"&&new URLSearchParams(window.location.search).get("debug")==="1",[Q,P]=x.useState({state:"idle",deltaY:0,lines:0,viewportY:null,scrollTop:null,scrollHeight:null,clientHeight:null,moved:!1,focused:!1,bufferType:null,baseY:null,cursorY:null,hasScrollback:null,mouseTracking:!1,scrollMode:"none",scrollCalls:0,lastScrollLines:null,lastInputEvent:"",pointerEvents:0,touchEvents:0}),{isController:J,connectionState:oe,settings:ce,hostPalette:Y,terminalResetVersion:_,sendResize:R,sendBinary:ae,addToast:Ee,warnViewerMode:Se,connect:me,subscribeToOutput:Z,sendPasteFile:pe,subscribeToPasteFileReady:Te,t:M}=mt(),X=Sl.useMemo(()=>zy(Y),[Y]),W=x.useRef(X);W.current=X;const ue=x.useRef(J);ue.current=J;const K=x.useRef(ae);K.current=ae;const Me=x.useRef(Ee);Me.current=Ee;const ze=x.useRef(Se);ze.current=Se;const Ce=x.useRef(R);Ce.current=R;const Oe=x.useRef(pe);Oe.current=pe;const we=x.useRef(s);we.current=s;const xe=x.useRef(M);xe.current=M;const $e=x.useRef(null),[bt,je]=x.useState(null),ct=x.useRef(null);ct.current=bt;const[lt,ut]=x.useState(null),wt=x.useRef(null);wt.current=lt;const[st,dt]=x.useState(""),kt=x.useRef("");kt.current=st;const[Qt,gt]=x.useState(!1),mn=x.useRef(!1);mn.current=Qt;const Ft=x.useRef(!1),[yt,Wn]=x.useState(0),Gt=x.useRef(null),ee=x.useRef(null),ve=x.useRef(null),_e=x.useRef(null),[He,an]=x.useState(!1),$n=x.useCallback(C=>{var he;const D=m.current;if(!D)return;const I=((he=f.current)==null?void 0:he.querySelector(".xterm-screen"))||f.current,te=Yh(C,D,I,b.current);if(te){ve.current=te;const F=tu(D,te.col,te.bufferRow);_e.current=F;const Je=Wv(D,te.col,te.bufferRow);if(Je){const De={startCol:Je.startCol,endCol:Je.startCol+Je.length-1,startRow:te.bufferRow,endRow:te.bufferRow},ot=Gh(De,F),Qe=nu(D,ot);ut(ot),dt(Qe),gt(!0)}else ut(null),dt(""),gt(!1),ve.current=null,_e.current=null}else ut(null),dt(""),gt(!1),ve.current=null,_e.current=null;Gt.current=C,ee.current=null},[]),qt=x.useCallback(C=>{var Qe;const D=m.current,I=ve.current;if(!D||!I)return;ee.current=C;const te=((Qe=f.current)==null?void 0:Qe.querySelector(".xterm-screen"))||f.current,he=Yh(C,D,te,b.current);if(!he)return;const F=_e.current??tu(D,I.col,I.bufferRow),Je={startCol:Math.min(I.col,he.col),endCol:Math.max(I.col,he.col),startRow:Math.min(I.bufferRow,he.bufferRow),endRow:Math.max(I.bufferRow,he.bufferRow)},De=Gh(Je,F),ot=nu(D,De);ut(De),dt(ot),gt(!0)},[]),Hn=x.useRef($n);Hn.current=$n;const Yn=x.useRef(qt);Yn.current=qt;const Kn=x.useCallback(async()=>{const C=kt.current;if(!C)return;await pa(C)==="failed"?Me.current("error",xe.current("clipboard.copyFailed")):Me.current("success",xe.current("clipboard.copied"))},[]),Ot=x.useCallback(async()=>{var De,ot,Qe,Ct;const C=m.current;if(!C)return;const D=(De=C.buffer)==null?void 0:De.active;if(!D)return;const I=((ot=wt.current)==null?void 0:ot.startRow)??((Qe=ve.current)==null?void 0:Qe.bufferRow)??D.viewportY,te=_e.current??tu(C,((Ct=ve.current)==null?void 0:Ct.col)??0,I),he={startCol:te.startCol,endCol:te.endCol,startRow:I,endRow:I},F=nu(C,he);await pa(F)==="failed"?Me.current("error",xe.current("clipboard.copyFailed")):Me.current("success",xe.current("clipboard.copied"))},[]),hn=x.useCallback(async()=>{const C=m.current;if(!C)return;const D=$v(C);await pa(D)==="failed"?Me.current("error",xe.current("clipboard.copyFailed")):Me.current("success",xe.current("clipboard.copied"))},[]),Ut=x.useCallback(async()=>{const C=m.current;if(C){if(!ue.current){ze.current();return}try{const D=await lx();if(D.ok){const I=await du(D.blob);if(!I){Me.current("error",xe.current("clipboard.imageTooLarge"));return}Oe.current(I.mime,I.dataBase64);return}}catch{}try{const D=await nx();if(D.ok){C.paste(D.text),Me.current("success",xe.current("clipboard.pasted"));return}else if(D.reason==="empty"){Me.current("info",xe.current("clipboard.pasteUnavailable"));return}}catch{}an(!0)}},[]),ii=x.useCallback(C=>{const D=m.current;if(D){if(!ue.current){ze.current();return}D.paste(C),Me.current("success",xe.current("clipboard.pasted"))}},[]),si=x.useCallback(C=>{if(m.current){if(!ue.current){ze.current();return}Oe.current(C.mime,C.dataBase64)}},[]);x.useEffect(()=>Te(D=>{const I=m.current;I&&(I.paste(D),Me.current("success",xe.current("clipboard.pasted")))}),[Te]);const ga=x.useCallback((C,D)=>{!Number.isFinite(C)||!Number.isFinite(D)||C<=0||D<=0||C===p.current.cols&&D===p.current.rows||(y.current={cols:C,rows:D},!S.current&&(S.current=setTimeout(()=>{S.current=null;const I=y.current;y.current=null,I&&(I.cols===p.current.cols&&I.rows===p.current.rows||(p.current=I,Ce.current(I.cols,I.rows)))},mx)))},[]),Pn=x.useCallback((C=!1)=>{const D=m.current,I=r.current,te=f.current,he=c.current;if(!D||!I||!te||!he)return;const F=Pc(I,ei(),Ic());if(F.width<=0||F.height<=0)return;he.style.width="100%",he.style.height="100%",te.style.width="100%",te.style.height="100%",te.style.transform="none",te.style.transformOrigin="top left",b.current=1;const Je=Hh(F),De=Fv({lastSnapshot:O.current,currentSnapshot:Je});if(De.isVisualZoom&&!C){O.current=Je;try{D.refresh(0,Math.max(0,D.rows-1))}catch{}return}if(De.shouldIgnore&&!C)return;O.current=Je;const ot=ha(D,ai),Qe=Oh({width:F.width-qv(te),height:F.height,cellWidth:ot.cellWidth,cellHeight:ot.cellHeight}),Ct=Math.abs(F.width-B.current.width)>1||Math.abs(F.height-B.current.height)>1;if(D.cols!==Qe.cols||D.rows!==Qe.rows)try{D.resize(Qe.cols,Qe.rows)}catch(pn){console.debug("Error resizing terminal grid:",pn)}const _n=Qe.cols!==p.current.cols||Qe.rows!==p.current.rows;we.current&&(Ct||C||_n)&&(B.current={width:F.width,height:F.height},ga(Qe.cols,Qe.rows));try{D.refresh(0,Math.max(0,D.rows-1))}catch{}},[ga]),zn=x.useRef(Pn);zn.current=Pn;const Gn=x.useCallback(()=>{if(g.current===null){if(typeof requestAnimationFrame!="function"){zn.current();return}g.current=requestAnimationFrame(()=>{g.current=null,zn.current()})}},[]),Jt=x.useCallback((C=30)=>{T.current!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(T.current),T.current=null);let D=0;const I=()=>{T.current=null,D++;const te=D>=C;zn.current(!0),!te&&D<2&&typeof requestAnimationFrame=="function"&&(T.current=requestAnimationFrame(I))};typeof requestAnimationFrame=="function"?T.current=requestAnimationFrame(I):I()},[]);x.useEffect(()=>{var vt,oi;if(!r.current||!f.current)return;const C=r.current,D=Pc(C,ei(),Ic()),I=ha(null,ai),te=Oh({width:D.width,height:D.height,cellWidth:I.cellWidth,cellHeight:I.cellHeight});Ce.current(te.cols,te.rows),B.current={width:D.width,height:D.height},O.current=Hh(D);const he=yh(ce.fontSize,D.width),F=new Uv.Terminal({fontSize:he,fontFamily:Nh(ce.fontFamily),lineHeight:1.15,...W.current?{theme:{...W.current}}:{},allowProposedApi:!0,convertEol:!0,scrollback:5e3,cols:te.cols,rows:te.rows,screenReaderMode:!1});try{const ne=new Bv.Unicode11Addon;F.loadAddon(ne),F.unicode.activeVersion="11"}catch(ne){console.debug("Unicode11 addon unavailable, using default width table:",ne)}F.open(f.current),m.current=F,L&&F.textarea&&(F.textarea.readOnly=!1,F.textarea.tabIndex=0,F.textarea.inputMode="text");let Je=()=>{};if(k&&F.textarea){const ne=()=>{P(de=>({...de,focused:document.activeElement===F.textarea}))};F.textarea.addEventListener("focus",ne),F.textarea.addEventListener("blur",ne),Je=()=>{var de,qe;(de=F.textarea)==null||de.removeEventListener("focus",ne),(qe=F.textarea)==null||qe.removeEventListener("blur",ne)},ne()}const De=async ne=>{const de=kp(ne);if(de){if(ne.preventDefault(),ne.stopPropagation(),!ue.current){ze.current();return}const qe=await du(de);if(!qe){Me.current("error",xe.current("clipboard.imageTooLarge"));return}Oe.current(qe.mime,qe.dataBase64)}};(vt=F.textarea)==null||vt.addEventListener("paste",De),C.addEventListener("paste",De);const ot=Qv(F,{coarsePointer:L,onRendererSwapped:()=>{try{F.refresh(0,Math.max(0,F.rows-1))}catch{}}});C&&(C.dataset.renderer=ot.kind);const Qe=xe.current("terminal.bannerTitle"),Ct=xe.current("terminal.bannerSubtitle");if(F.writeln(" ___ ___ .___ "),F.writeln(` / | \\ ____ _______| _/______ \x1B[1m${Qe}\x1B[0m`),F.writeln(`/ ~ \\/ __ \\\\_ __ \\ __/ ___/ \x1B[2m${Ct}\x1B[0m`),F.writeln("\\ Y / ___/ | | \\/|_ \\___ \\ "),F.writeln(" \\___|_ / \\___ >|__| /___/____ >"),F.writeln(" \\/ \\/ \\/ "),F.writeln(""),!L)try{F.focus()}catch{}typeof document<"u"&&"fonts"in document&&typeof((oi=document.fonts)==null?void 0:oi.load)=="function"&&document.fonts.load('13px "Symbols Nerd Font Mono"').then(()=>{if(m.current){try{m.current.refresh(0,Math.max(0,m.current.rows-1))}catch{}Jt(5)}}).catch(()=>{});const _n=F.onData(ne=>{const de=Wh(ne);if(!ue.current&&!lu(de)){ze.current();return}K.current(de)}),pn=F.onBinary(ne=>{const de=new Uint8Array(ne.length);for(let qe=0;qe<ne.length;qe++)de[qe]=ne.charCodeAt(qe)&255;!ue.current&&!lu(de)||K.current(de)}),Mt=typeof F.onWriteParsed=="function"?F.onWriteParsed(()=>{Ft.current=!0}):{dispose:()=>{}},Xt=typeof F.onRender=="function"?F.onRender(ne=>{const de=F.buffer.active.viewportY??0;Wn(de);const qe=wt.current;if(qe&&mn.current){const bn=qe.startRow-de,gn=qe.endRow-de;Ft.current&&ne.start<=gn&&ne.end>=bn&&(gt(!1),Ft.current=!1)}else Ft.current=!1}):{dispose:()=>{}},wl=typeof F.onScroll=="function"?F.onScroll(()=>{const ne=F.buffer.active.viewportY??0;Wn(ne)}):{dispose:()=>{}},Vt=new Vv({getTerminal:()=>m.current,getIsController:()=>ue.current,getScale:()=>b.current,getSurfaceElement:()=>f.current,allowSyntheticMouseFallback:!1,onFocus:()=>{try{F.focus()}catch{}k&&P(ne=>({...ne,focused:document.activeElement===F.textarea})),o==null||o()},onGestureStateChange:ne=>{k&&P(de=>({...de,state:ne}))},onGestureScroll:({deltaY:ne,lines:de,viewportY:qe,scrollTop:bn,scrollHeight:gn,clientHeight:Xn,moved:be,bufferType:Dt,baseY:ft,cursorY:Tt,hasScrollback:Nt,mouseTracking:Vn,scrollMode:Uo})=>{k&&P(va=>({...va,deltaY:ne,lines:de,viewportY:qe,scrollTop:bn,scrollHeight:gn,clientHeight:Xn,moved:be,focused:document.activeElement===F.textarea,bufferType:Dt,baseY:ft,cursorY:Tt,hasScrollback:Nt,mouseTracking:Vn,scrollMode:Uo,scrollCalls:va.scrollCalls+(de!==0?1:0),lastScrollLines:de}))},longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,onLongPress:L?(ne=>{var de;return(de=Hn.current)==null?void 0:de.call(Hn,ne)}):void 0,onSelectionExtend:L?(ne=>{var de;return(de=Yn.current)==null?void 0:de.call(Yn,ne)}):void 0}),Lo=typeof window<"u"&&"PointerEvent"in window,Oo=typeof TouchEvent<"u",Cl=[],It=(ne,de=!1)=>{const qe=ne.target;return qe instanceof Node&&C.contains(qe)||de&&Vt.getState()!=="idle"};if(Lo){const ne={passive:!1,capture:!0},de=be=>{k&&P(Dt=>({...Dt,pointerEvents:Dt.pointerEvents+1,lastInputEvent:be}))},qe=be=>{if(!It(be))return;if(de("pointerdown"),ct.current){je(null),ct.current=null,ut(null),wt.current=null,dt(""),kt.current="",gt(!1),Gt.current=null,ee.current=null,be.cancelable&&be.preventDefault(),be.stopPropagation();return}Vt.handlePointerDown(be,C)&&be.stopPropagation()},bn=be=>{It(be,!0)&&(de("pointermove"),Vt.handlePointerMove(be),be.pointerType!=="mouse"&&be.stopPropagation())},gn=be=>{if(!It(be,!0))return;if(de("pointerup"),Vt.getState()==="longpress"&&$e.current){const ft=ee.current??Gt.current;if(ft){const Tt=$e.current.getBoundingClientRect(),Nt=ft.clientX-Tt.left,Vn=ft.clientY-Tt.top;je({x:Nt,y:Vn}),ct.current={x:Nt,y:Vn}}}Vt.handlePointerUp(be),be.pointerType!=="mouse"&&be.stopPropagation()},Xn=be=>{It(be,!0)&&(de("pointercancel"),je(null),ct.current=null,ut(null),wt.current=null,dt(""),kt.current="",gt(!1),Gt.current=null,ee.current=null,Vt.handlePointerCancel(be),be.pointerType!=="mouse"&&be.stopPropagation())};if(document.addEventListener("pointerdown",qe,ne),document.addEventListener("pointermove",bn,ne),document.addEventListener("pointerup",gn,ne),document.addEventListener("pointercancel",Xn,ne),Cl.push(()=>{document.removeEventListener("pointerdown",qe,ne),document.removeEventListener("pointermove",bn,ne),document.removeEventListener("pointerup",gn,ne),document.removeEventListener("pointercancel",Xn,ne)}),Oo){const be=ft=>{It(ft,!0)&&(k&&P(Tt=>({...Tt,touchEvents:Tt.touchEvents+1})),ft.cancelable&&ft.preventDefault(),ft.stopPropagation())},Dt=["touchstart","touchmove","touchend","touchcancel"];for(const ft of Dt)document.addEventListener(ft,be,ne);Cl.push(()=>{for(const ft of Dt)document.removeEventListener(ft,be,ne)})}}else{const ne={passive:!1,capture:!0},de=be=>{k&&P(Dt=>({...Dt,touchEvents:Dt.touchEvents+1,lastInputEvent:be}))},qe=be=>{if(It(be)){if(de("touchstart"),ct.current){je(null),ct.current=null,ut(null),wt.current=null,dt(""),kt.current="",gt(!1),Gt.current=null,ee.current=null,be.cancelable&&be.preventDefault(),be.stopPropagation();return}be.touches.length===1&&be.stopPropagation(),Vt.handleTouchStart(be,C)}},bn=be=>{It(be,!0)&&(de("touchmove"),be.touches.length===1&&be.stopPropagation(),Vt.handleTouchMove(be))},gn=be=>{if(!It(be,!0))return;if(de("touchend"),Vt.getState()==="longpress"&&$e.current){const ft=ee.current??Gt.current;if(ft){const Tt=$e.current.getBoundingClientRect(),Nt=ft.clientX-Tt.left,Vn=ft.clientY-Tt.top;je({x:Nt,y:Vn}),ct.current={x:Nt,y:Vn}}}be.stopPropagation(),Vt.handleTouchEnd(be)},Xn=be=>{It(be,!0)&&(de("touchcancel"),je(null),ct.current=null,ut(null),wt.current=null,dt(""),kt.current="",gt(!1),Gt.current=null,ee.current=null,be.stopPropagation(),Vt.handleTouchCancel())};document.addEventListener("touchstart",qe,ne),document.addEventListener("touchmove",bn,ne),document.addEventListener("touchend",gn,ne),document.addEventListener("touchcancel",Xn,ne),Cl.push(()=>{document.removeEventListener("touchstart",qe,ne),document.removeEventListener("touchmove",bn,ne),document.removeEventListener("touchend",gn,ne),document.removeEventListener("touchcancel",Xn,ne)})}const ya=ne=>{ne.preventDefault()};C.addEventListener("contextmenu",ya),Cl.push(()=>{C.removeEventListener("contextmenu",ya)});const tl=new ResizeObserver(()=>{Gn()});tl.observe(C);const kn=()=>{Gn()},qn=()=>{var ne,de;if(document.visibilityState==="visible"){Jt(10);try{(de=m.current)==null||de.refresh(0,Math.max(0,(((ne=m.current)==null?void 0:ne.rows)||1)-1))}catch{}}};window.addEventListener("resize",kn),window.addEventListener("orientationchange",kn),document.addEventListener("visibilitychange",qn),window.addEventListener("pageshow",qn);const Dn=()=>{Gn()};return typeof window<"u"&&window.visualViewport&&(window.visualViewport.addEventListener("resize",Dn),window.visualViewport.addEventListener("scroll",Dn)),()=>{var ne;_n.dispose(),pn.dispose(),Xt.dispose(),wl.dispose(),Mt.dispose(),Vt.handlePointerCancel();for(const de of Cl)de();tl.disconnect(),window.removeEventListener("resize",kn),window.removeEventListener("orientationchange",kn),document.removeEventListener("visibilitychange",qn),window.removeEventListener("pageshow",qn),typeof window<"u"&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",Dn),window.visualViewport.removeEventListener("scroll",Dn)),S.current&&(clearTimeout(S.current),S.current=null),g.current!==null&&(cancelAnimationFrame(g.current),g.current=null),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),Je(),(ne=F.textarea)==null||ne.removeEventListener("paste",De),C.removeEventListener("paste",De),ot.dispose(),F.dispose(),m.current=null}},[]),x.useEffect(()=>{const C=m.current;if(!C)return;const D=Pc(r.current,ei(),Ic());C.options.fontSize=yh(ce.fontSize,D.width),C.options.fontFamily=Nh(ce.fontFamily);try{C.refresh(0,Math.max(0,C.rows-1))}catch{}Jt(10)},[ce.fontSize,ce.fontFamily]);const el=x.useRef(_);x.useEffect(()=>{var D;if(el.current===_)return;el.current=_;const C=m.current;if(C)try{(D=C.reset)==null||D.call(C),C.clear(),C.refresh(0,Math.max(0,C.rows-1))}catch{}},[_]),x.useEffect(()=>{const C=m.current;if(!(!C||!X)){C.options.theme={...X};try{C.refresh(0,Math.max(0,C.rows-1))}catch{}}},[X]),x.useEffect(()=>Z(D=>{const I=m.current;if(!I)throw new Error("terminal not ready");I.write(D)}),[Z]),x.useEffect(()=>{if(!s)return;Jt(10);const C=m.current;if(C){try{C.refresh(0,Math.max(0,C.rows-1))}catch{}if(!L)try{C.focus()}catch{}}},[s,L,Jt]),x.useEffect(()=>{oe==="disconnected"&&me()},[]);const H=C=>{C.preventDefault()};return u.jsxs("main",{ref:$e,className:"flex-1 w-full min-w-0 min-h-0 overflow-hidden relative flex flex-col",onContextMenu:H,"aria-label":M("terminal.windowAriaLabel"),children:[u.jsx("div",{id:"terminal-container",ref:r,className:"absolute inset-0 overflow-hidden cursor-text",style:{touchAction:V?"none":"auto"},tabIndex:0,onContextMenu:H,"aria-label":M("terminal.bufferAriaLabel"),role:"region",children:u.jsx("div",{id:"terminal-frame",ref:c,className:"relative overflow-hidden",style:{width:"100%",height:"100%"},children:u.jsx("div",{id:"terminal-surface",ref:f,className:"absolute top-0 left-0",style:{transformOrigin:"top left",width:"100%",height:"100%"}})})}),k&&u.jsxs("pre",{"data-testid":"terminal-touch-debug",className:"pointer-events-none absolute left-1 top-1 z-50 border border-tui-border bg-tui-crust/90 px-2 py-1 font-mono text-tui-sm leading-relaxed text-tui-muted","aria-hidden":"true",children:[`gesture: ${Q.state}
|
|
36
|
-
`,`deltaY: ${Q.deltaY} lines: ${Q.lines}
|
|
37
|
-
`,`viewportY: ${Q.viewportY??"-"} focus: ${Q.focused}
|
|
38
|
-
`,`buffer: ${Q.bufferType??"-"} base: ${Q.baseY??"-"} cursor: ${Q.cursorY??"-"} scrollback: ${Q.hasScrollback??"-"}
|
|
39
|
-
`,`scroll: ${Q.scrollTop??"-"} / ${Q.scrollHeight??"-"} (h ${Q.clientHeight??"-"}) moved: ${Q.moved}
|
|
40
|
-
`,`mode: ${Q.scrollMode} calls: ${Q.scrollCalls} lines: ${Q.lastScrollLines??"-"} mouse: ${Q.mouseTracking}
|
|
41
|
-
`,`event: ${Q.lastInputEvent||"-"} pointer: ${Q.pointerEvents} touch: ${Q.touchEvents}`]}),L&<&&Qt&&(()=>{var _n;const C=m.current;if(!C||!$e.current)return null;const D=ha(C);if(D.cellWidth<=0||D.cellHeight<=0)return null;const I=((_n=f.current)==null?void 0:_n.querySelector(".xterm-screen"))||f.current;if(!I)return null;const te=I.getBoundingClientRect(),he=$e.current.getBoundingClientRect(),F=lt.startRow-yt;if(lt.endRow-yt<0||F>=C.rows)return null;const De=te.top-he.top+F*D.cellHeight,ot=te.left-he.left+lt.startCol*D.cellWidth,Qe=(lt.endCol-lt.startCol+1)*D.cellWidth,Ct=(lt.endRow-lt.startRow+1)*D.cellHeight;return u.jsx("div",{"data-testid":"terminal-selection-overlay",className:"pointer-events-none absolute z-20 bg-tui-accent/35",style:{top:`${De}px`,left:`${ot}px`,width:`${Qe}px`,height:`${Ct}px`}})})(),L&&bt&&u.jsx(dx,{anchorPoint:bt,hasSelection:!!st,isController:J,vibrateOnKeyPress:ce.vibrateOnKeyPress,onCopySelection:Kn,onCopyLine:Ot,onCopyScreen:hn,onPaste:Ut,onClose:()=>{je(null),ct.current=null,ut(null),wt.current=null,dt(""),kt.current="",gt(!1)}}),L&&u.jsx(fx,{isOpen:He,onClose:()=>an(!1),onSend:ii,onSendImage:si})]})},px=({onPairedSuccess:o})=>{const{settings:s,updateSettings:r,connect:c,connectionState:f,stateDetail:m,addToast:b,t:p}=mt(),[y,S]=x.useState(""),[g,T]=x.useState(null),[B,O]=x.useState(!1),[L,V]=x.useState(s.wsUrl||"/ws/client"),[k,Q]=x.useState(s.token||""),[P,J]=x.useState(s.clientId||""),oe="node bin/service.js pair",ce="node bin/config-tui.js",Y="herdr plugin pane open --plugin herdr.remote.web --entrypoint config --placement zoomed --focus",_=Se=>{pa(Se).then(me=>{if(me==="failed"){b("error",p("clipboard.copyFailed"));return}T(Se),b("success",p("toasts.commandCopied")),setTimeout(()=>T(null),2e3)})},R=Se=>{Se.preventDefault();const me=y.trim().toUpperCase();if(!me&&!k.trim()){b("warning",p("toasts.connectionError"));return}const Z={pairCode:me,wsUrl:L.trim()||"/ws/client",clientId:P.trim()||s.clientId};k.trim()&&(Z.token=k.trim()),r(Z),c({pairCode:me||void 0,token:k.trim()||void 0,wsUrl:L.trim()||"/ws/client",clientId:P.trim()||s.clientId}),o&&o()},ae=f==="connecting"||f==="reconnecting",Ee=({n:Se})=>u.jsxs("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:["[",Se,"]"]});return u.jsx("div",{className:"flex h-full w-full flex-1 justify-center overflow-y-auto bg-tui-crust p-2 sm:p-4",children:u.jsxs("div",{className:"my-auto w-full max-w-3xl space-y-3",children:[u.jsxs("div",{className:"border border-tui-border bg-tui-base px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[u.jsx("span",{"aria-hidden":"true",className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("h1",{className:"text-tui font-bold text-tui-text",children:p("onboarding.title")}),u.jsx("span",{className:"text-tui uppercase text-tui-warn",children:p("onboarding.firstTimeSetup")})]}),u.jsx("p",{className:"mt-0.5 text-tui leading-snug text-tui-muted",children:p("onboarding.description")})]}),f==="error"&&u.jsxs(Ao,{tone:"warn",action:u.jsx(Re,{variant:"warn",onClick:()=>c(),children:p("common.retry")}),children:[u.jsx("span",{className:"block font-bold",children:p("onboarding.authRequired")}),u.jsx("span",{className:"block text-tui-muted",children:m||p("onboarding.authRequiredDesc")})]}),u.jsxs("form",{onSubmit:R,className:"grid gap-3",children:[u.jsx(Zt,{title:p("onboarding.step1Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("p",{className:"flex items-start gap-2 text-tui text-tui-muted",children:[u.jsx(Ee,{n:1}),u.jsx("span",{className:"leading-snug",children:p("onboarding.step1Desc")})]}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-mantle px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui text-tui-text",children:oe}),u.jsx(Re,{onClick:()=>_(oe),glyph:g===oe?Le.check:"⧉",className:$("shrink-0",g===oe&&"border-tui-ok text-tui-ok"),children:p(g===oe?"common.copied":"common.copy")})]}),u.jsxs("div",{className:"space-y-0.5 text-tui-sm",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:p("onboarding.step1CopyPlugin")}),u.jsx("button",{type:"button",onClick:()=>_(Y),className:"tui-focusable shrink-0 text-tui-accent underline-offset-2 hover:underline",children:p(g===Y?"common.copied":"onboarding.step1CopyCli")})]}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:p("onboarding.step1TuiNote")}),u.jsx("code",{onClick:()=>_(ce),className:"shrink-0 cursor-pointer border border-tui-border-dim px-1 text-tui-muted hover:border-tui-accent hover:text-tui-accent",title:p("common.clickToCopy"),children:ce})]})]})]})}),u.jsx(Zt,{title:p("onboarding.step2Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ee,{n:2}),u.jsx(Rn,{type:"text",value:y,onChange:Se=>S(Se.target.value.toUpperCase()),placeholder:p("onboarding.step2Placeholder"),maxLength:12,autoFocus:!0,"aria-label":p("onboarding.step2Title"),className:"font-bold uppercase"})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("onboarding.step2Note")})]})}),u.jsx(Re,{variant:"primary",type:"submit",block:!0,disabled:ae,className:"py-1.5",children:ae?u.jsx(li,{label:p("onboarding.connectingAndPairing")}):p("onboarding.connectAndPair")}),u.jsxs("div",{className:"border border-tui-border bg-tui-base",children:[u.jsxs("button",{type:"button",onClick:()=>O(!B),"aria-expanded":B,className:"tui-focusable flex w-full items-center gap-2 px-2 py-1 text-left text-tui text-tui-muted transition-colors hover:text-tui-accent",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:B?Le.chevronDown:Le.chevronRight}),u.jsx("span",{className:"uppercase",children:p("onboarding.advancedTitle")})]}),B&&u.jsxs("div",{className:"space-y-2.5 border-t border-tui-border-dim px-2 py-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"onboarding-token",children:p("onboarding.manualTokenLabel")}),u.jsx(Rn,{id:"onboarding-token",type:"password",value:k,onChange:Se=>Q(Se.target.value),placeholder:p("onboarding.manualTokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"onboarding-ws",children:p("onboarding.wsEndpointLabel")}),u.jsx(Rn,{id:"onboarding-ws",type:"text",value:L,onChange:Se=>V(Se.target.value),placeholder:p("onboarding.wsEndpointPlaceholder")})]}),u.jsx(ni,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"onboarding-client-id",children:p("onboarding.clientIdLabel")}),u.jsx(Rn,{id:"onboarding-client-id",type:"text",value:P,onChange:Se=>J(Se.target.value)})]})]})]})]})]})})},ts="tui-focusable inline-flex shrink-0 select-none items-center justify-center border text-tui font-medium transition-colors",Eo="border-tui-border bg-tui-surface text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",bx="border-tui-accent bg-tui-accent text-tui-crust font-bold",gx="border-tui-ok bg-transparent text-tui-ok hover:bg-tui-ok hover:text-tui-crust font-bold",yx=({compact:o=!1})=>{const{sendKey:s,settings:r,updateSettings:c,isController:f,warnViewerMode:m,t:b}=mt(),p="h-9 min-w-[2.25rem] px-2",y="h-9 w-9",S="h-9 px-2",[g,T]=x.useState(!1),[B,O]=x.useState(!1),[L,V]=x.useState(!1),[k,Q]=x.useState(!1),[P,J]=x.useState(!1),[oe,ce]=x.useState(!1),Y=x.useCallback(()=>{if(r.vibrateOnKeyPress&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[r.vibrateOnKeyPress]),_=x.useCallback((Z,pe=!1)=>{if(Y(),!f){m();return}let Te=Z;pe&&(g||B||L)&&(Te=ry(Z,{ctrl:g,alt:B,shift:L})),s(Te),g&&T(!1),B&&O(!1),L&&V(!1)},[f,g,B,L,s,m,Y,b]);if(!r.toolbarVisible)return u.jsx("div",{"data-testid":"key-toolbar-collapsed",className:"z-20 flex shrink-0 justify-center border-t border-tui-border bg-tui-mantle pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]",children:u.jsxs("button",{type:"button",onClick:()=>c({toolbarVisible:!0}),className:"tui-focusable flex h-6 w-28 items-center justify-center gap-1 text-tui uppercase text-tui-faint transition-colors hover:text-tui-accent",title:b("virtualKeyboard.expandToolbar"),"aria-label":b("virtualKeyboard.expandToolbar"),"aria-expanded":!1,children:[u.jsx("span",{"aria-hidden":"true",children:"▴"}),u.jsx("span",{"aria-hidden":"true",children:b("common.keyBar")})]})});const R=r.virtualKeys&&r.virtualKeys.length>0?r.virtualKeys.filter(Z=>Z.enabled):lp,ae=Z=>Z.id==="left"?u.jsx("span",{"aria-hidden":"true",children:"←"}):Z.id==="up"?u.jsx("span",{"aria-hidden":"true",children:"↑"}):Z.id==="down"?u.jsx("span",{"aria-hidden":"true",children:"↓"}):Z.id==="right"?u.jsx("span",{"aria-hidden":"true",children:"→"}):Z.id==="enter"?u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{"aria-hidden":"true",children:"⏎"}),u.jsx("span",{className:"hidden sm:inline",children:b("virtualKeyboard.keyEnter")})]}):Z.id==="drawer_chords"?u.jsx("span",{children:"^C"}):Z.id==="drawer_fn"?u.jsxs("span",{className:"flex items-center gap-0.5",children:[u.jsx("span",{children:"Fn"}),u.jsx("span",{"aria-hidden":"true",children:k?"▾":"▴"})]}):u.jsx("span",{children:Z.label}),Ee=Z=>{if(Y(),Z.type==="modifier"){Z.modifierType==="ctrl"?T(!g):Z.modifierType==="alt"?O(!B):Z.modifierType==="shift"?V(!L):Z.modifierType==="meta"&&_(ye.ESC);return}if(Z.type==="drawer"){Z.drawerType==="fn"?(Q(!k),J(!1),ce(!1)):Z.drawerType==="chords"?(ce(!oe),Q(!1),J(!1)):Z.drawerType==="symbols"&&(J(!P),Q(!1),ce(!1));return}_(Z.code,Z.isPlainChar||Z.type==="symbol")},Se=Z=>{if(Z.type==="modifier"){if(Z.modifierType==="ctrl")return g;if(Z.modifierType==="alt")return B;if(Z.modifierType==="shift")return L}if(Z.type==="drawer"){if(Z.drawerType==="fn")return k;if(Z.drawerType==="chords")return oe;if(Z.drawerType==="symbols")return P}return!1},me=(Z,pe,Te,M,X="default")=>u.jsxs("button",{type:"button",onClick:()=>_(Z),className:$(ts,"h-8 gap-1.5 px-2",X==="bad"?"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust":X==="warn"?"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust":Eo),title:Te,children:[u.jsx("span",{className:"font-bold",children:pe}),u.jsx("span",{className:"text-tui-sm opacity-70",children:M})]});return u.jsxs("div",{"data-testid":"key-toolbar",className:$("z-20 flex shrink-0 select-none flex-col border-t border-tui-border bg-tui-mantle",o?"pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]":"pb-[max(env(safe-area-inset-bottom,0px),0.25rem)]"),role:"toolbar","aria-label":b("virtualKeyboard.touchKeyboardShortcuts"),children:[k&&u.jsx("div",{className:"grid grid-cols-6 gap-1 border-b border-tui-border-dim bg-tui-crust p-1.5 sm:grid-cols-12",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(Z=>{const pe=`F${Z}`;return u.jsxs("button",{type:"button",onClick:()=>_(ye[pe]),className:$(ts,Eo,"h-8"),children:["F",Z]},pe)})}),oe&&u.jsxs("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:[me(ye.CTRL_C,"^C",b("virtualKeyboard.ctrlCTitle"),b("virtualKeyboard.badgeSigint"),"bad"),me(ye.CTRL_D,"^D",b("virtualKeyboard.ctrlDTitle"),b("virtualKeyboard.badgeEof")),me(ye.CTRL_Z,"^Z",b("virtualKeyboard.ctrlZTitle"),b("virtualKeyboard.badgeTstp"),"warn"),me(ye.CTRL_L,"^L",b("virtualKeyboard.ctrlLTitle"),b("virtualKeyboard.badgeClear")),me(ye.CTRL_R,"^R",b("virtualKeyboard.ctrlRTitle"),b("virtualKeyboard.badgeSearch")),me(ye.CTRL_A,"^A",b("virtualKeyboard.ctrlATitle"),b("virtualKeyboard.badgeStart")),me(ye.CTRL_E,"^E",b("virtualKeyboard.ctrlETitle"),b("virtualKeyboard.badgeEnd")),me(ye.CTRL_K,"^K",b("virtualKeyboard.ctrlKTitle"),b("virtualKeyboard.badgeKill"))]}),P&&u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:["|","~","/","\\","-","_","$","&",";",":","`",'"',"'",">","<","=","#","@","{","}","[","]"].map(Z=>u.jsx("button",{type:"button",onClick:()=>_(Z,!0),className:$(ts,Eo,"h-8 w-8 font-bold"),children:Z},Z))}),u.jsxs("div",{"data-testid":"key-toolbar-row",className:$("flex flex-wrap items-center justify-center gap-1",o?"px-1.5 py-1":"px-2 py-1.5"),children:[u.jsx("button",{type:"button",onClick:()=>c({toolbarVisible:!1}),className:$(ts,y,"mr-1 border-tui-border-dim bg-transparent text-tui-faint hover:border-tui-border hover:text-tui-text"),title:b("virtualKeyboard.collapseToolbar"),"aria-label":b("virtualKeyboard.collapseToolbar"),"aria-expanded":!0,children:u.jsx("span",{"aria-hidden":"true",children:"▾"})}),R.map(Z=>{const pe=Se(Z),Te=Z.id==="enter",M=["left","up","down","right"].includes(Z.id),X=Z.type==="drawer",W=au(Z,b);return u.jsx("button",{type:"button",onClick:()=>Ee(Z),className:$(ts,M?y:X?S:p,Te?gx:pe?bx:Eo),title:W,"aria-label":W,"aria-pressed":pe,children:ae(Z)},Z.id)})]})]})},vx=["ls -la","clear","git status","pwd","top","exit","cat"],xx=({isOpen:o,onClose:s})=>{const{sendKey:r,isController:c,warnViewerMode:f,t:m}=mt(),[b,p]=x.useState("");if(!o)return null;const y=g=>{if(g&&g.preventDefault(),!c){f();return}b.length>0?(r(b+"\r"),p("")):r("\r")},S=g=>{if(!c){f();return}r(g+"\r")};return u.jsxs("div",{className:"z-20 flex flex-col gap-1.5 border-t border-tui-border bg-tui-mantle p-2",role:"region","aria-label":m("virtualKeyboard.helperTitle"),children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-tui font-bold uppercase text-tui-accent",children:m("virtualKeyboard.helperTitle")}),u.jsx(Re,{variant:"ghost",onClick:s,"aria-label":m("virtualKeyboard.closeHelper"),children:"esc"})]}),u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto py-0.5",children:vx.map(g=>u.jsx("button",{type:"button",onClick:()=>S(g),className:"tui-focusable shrink-0 select-none border border-tui-border bg-tui-surface px-2 py-0.5 text-tui-sm text-tui-muted transition-colors hover:border-tui-accent hover:text-tui-accent",children:g},g))}),u.jsxs("form",{onSubmit:y,className:"flex items-center gap-1.5",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none font-bold text-tui-ok",children:"$"}),u.jsxs("div",{className:"relative flex-1",children:[u.jsx("label",{htmlFor:"virtual-keyboard-input",className:"sr-only",children:m("virtualKeyboard.placeholder")}),u.jsx(Rn,{id:"virtual-keyboard-input",name:"terminal-input",type:"text",value:b,onChange:g=>p(g.target.value),placeholder:m("virtualKeyboard.placeholder"),inputMode:"text",enterKeyHint:"send",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,className:"select-text pr-7"}),b.length>0&&u.jsx("button",{type:"button",onClick:()=>p(""),className:"tui-focusable absolute right-1 top-1/2 -translate-y-1/2 px-1 text-tui-faint hover:text-tui-bad","aria-label":m("virtualKeyboard.clearInput"),children:u.jsx("span",{"aria-hidden":"true",children:Le.cross})})]}),u.jsx(Re,{variant:"primary",type:"submit",title:m("virtualKeyboard.sendButton"),glyph:"⏎",className:"h-9 shrink-0",children:u.jsx("span",{className:"hidden sm:inline",children:m("virtualKeyboard.sendButton")})})]})]})};function Do(o,s){const r=(c,f)=>s?s(c):f;switch(o){case"connected":return{label:r("connection.live","Live"),level:"ok",needsAttention:!1};case"connecting":return{label:r("connection.connecting","Connecting"),level:"warn",needsAttention:!0};case"reconnecting":return{label:r("connection.reconnecting","Reconnecting"),level:"warn",needsAttention:!0,actionLabel:r("connection.reconnectNow","Reconnect now")};case"error":return{label:r("connection.error","Error"),level:"bad",needsAttention:!0,actionLabel:r("connection.retry","Retry")};default:return{label:r("connection.offline","Offline"),level:"idle",needsAttention:!0,actionLabel:r("connection.connect","Connect")}}}const Sx={connected:"ok",connecting:"warn",reconnecting:"warn",error:"bad",disconnected:"idle"},wx=({isOpen:o,onClose:s,isAddMode:r=!1})=>{const{settings:c,updateSettings:f,connect:m,disconnect:b,connectionState:p,hostId:y,addToast:S,t:g,activeProfile:T,activeProfileId:B,addProfileAndConnect:O,renameProfile:L}=mt(),[V,k]=x.useState(c.wsUrl),[Q,P]=x.useState(c.token),[J,oe]=x.useState(c.pairCode),[ce,Y]=x.useState(c.clientId),[_,R]=x.useState((T==null?void 0:T.displayName)||""),[ae,Ee]=x.useState(c.autoReconnect),[Se,me]=x.useState(!1);if(x.useEffect(()=>{o&&(k(c.wsUrl),P(r?"":c.token),oe(r?"":c.pairCode),Y(c.clientId),R(r?"":(T==null?void 0:T.displayName)||""),Ee(c.autoReconnect))},[o,r,c,T]),!o)return null;const Z=X=>{X.preventDefault();const W={wsUrl:V.trim()||"/ws/client",token:Q.trim(),pairCode:J.trim().toUpperCase(),clientId:ce.trim()||c.clientId,autoReconnect:ae};if(!W.token&&!W.pairCode){S("warning",g("pairing.credentialsRequired"));return}r?O({...W,displayName:_.trim()||void 0}):(f(W),B&&_.trim()&&L(B,_),b(),m({wsUrl:W.wsUrl,token:W.token||void 0,pairCode:W.pairCode||void 0,clientId:W.clientId,autoReconnect:ae})),s()},pe=()=>{const X=`client-${Math.random().toString(36).substring(2,8)}`;Y(X)},Te=()=>{const X=new URL(window.location.href);X.search="",J.trim()&&X.searchParams.set("pairCode",J.trim().toUpperCase()),pa(X.toString()).then(W=>{if(W==="failed"){S("error",g("clipboard.copyFailed"));return}me(!0),S("success",g("toasts.pairingLinkCopied")),setTimeout(()=>me(!1),2e3)})},M=Sx[p]??"idle";return u.jsxs(wu,{isOpen:o,onClose:s,title:g(r?"pairing.addTitle":"pairing.title"),subtitle:g("pairing.subtitle"),closeLabel:g("common.closeDialog"),hints:[{keys:"esc",action:g("common.close")},{keys:"⏎",action:g("pairing.saveAndConnect")}],footer:u.jsxs(u.Fragment,{children:[p==="connected"&&u.jsx(Re,{variant:"danger",onClick:()=>{b(),s()},children:g("common.disconnect")}),u.jsx(Re,{variant:"primary",type:"submit",form:"pairing-form",children:g("pairing.saveAndConnect")})]}),children:[u.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 border-b border-tui-border-dim pb-2 text-tui",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Mn,{level:M}),u.jsx("span",{className:"text-tui-muted",children:g("common.status")}),u.jsx("span",{className:$(M==="ok"?"text-tui-ok":M==="bad"?"text-tui-bad":M==="warn"?"text-tui-warn":"text-tui-faint"),children:Do(p,g).label})]}),y&&u.jsxs("span",{className:"flex items-center gap-1.5 text-tui-muted",children:[g("common.host")," ",u.jsx("span",{className:"text-tui-text",children:y})]})]}),u.jsxs("form",{id:"pairing-form",onSubmit:Z,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"pairing-name",children:g("pairing.displayNameLabel")}),u.jsx(Rn,{id:"pairing-name",type:"text",value:_,onChange:X=>R(X.target.value),placeholder:g("pairing.displayNamePlaceholder"),maxLength:64,autoComplete:"off"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:g("pairing.displayNameHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"pairing-code",hint:g("pairing.pairCodeNote"),children:g("pairing.pairCodeLabel")}),u.jsx(Rn,{id:"pairing-code",type:"text",value:J,onChange:X=>oe(X.target.value.toUpperCase()),placeholder:g("pairing.pairCodePlaceholder"),maxLength:12,className:"uppercase"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:g("pairing.pairCodeHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"pairing-token",hint:g("pairing.tokenNote"),children:g("pairing.tokenLabel")}),u.jsx(Rn,{id:"pairing-token",type:"password",value:Q,onChange:X=>P(X.target.value),placeholder:g("pairing.tokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"pairing-ws",children:g("pairing.wsUrlLabel")}),u.jsx(Rn,{id:"pairing-ws",type:"text",value:V,onChange:X=>k(X.target.value),placeholder:g("pairing.wsUrlPlaceholder")}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:g("pairing.wsUrlDefaultNote")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"pairing-client-id",children:g("pairing.clientIdLabel")}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Rn,{id:"pairing-client-id",type:"text",value:ce,onChange:X=>Y(X.target.value),className:"flex-1"}),u.jsx(Re,{onClick:pe,title:g("pairing.regenerateClientIdTitle"),className:"shrink-0",children:g("pairing.newIdButton")})]})]}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(uu,{checked:ae,onChange:Ee,label:g("pairing.autoReconnectLabel"),description:g("pairing.autoReconnectDesc")})}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Re,{onClick:Te,block:!0,glyph:Se?Le.check:"⧉",className:$(Se&&"border-tui-ok text-tui-ok"),children:g("pairing.copyDirectLink")})})]})]})},Cx=({isOpen:o,onClose:s})=>{const{settings:r,updateSettings:c,addToast:f,language:m,setLanguage:b,t:p}=mt(),[y,S]=x.useState("appearance"),[g,T]=x.useState(!1);if(!o)return null;const B=ru.find(Y=>Y.font===r.fontFamily),O=r.virtualKeys&&r.virtualKeys.length>0?r.virtualKeys:os(),L=()=>{const Y=sp();c({fontSize:Y.fontSize,fontFamily:Y.fontFamily,toolbarVisible:Y.toolbarVisible,vibrateOnKeyPress:Y.vibrateOnKeyPress,language:Y.language,virtualKeys:Y.virtualKeys}),f("info",p("settings.resetDefaultsToast"))},V=Y=>{const _=O.map(R=>R.id===Y?{...R,enabled:!R.enabled}:R);c({virtualKeys:_})},k=(Y,_)=>{const R=_==="up"?Y-1:Y+1;if(R<0||R>=O.length)return;const ae=[...O],Ee=ae[Y];ae[Y]=ae[R],ae[R]=Ee,c({virtualKeys:ae})},Q=Y=>{if(O.some(R=>R.id===Y.id)){const R=O.map(ae=>ae.id===Y.id?{...ae,enabled:!0}:ae);c({virtualKeys:R})}else{const R=[...O,{...Y,enabled:!0}];c({virtualKeys:R})}T(!1)},P=Y=>{const _=O.filter(R=>R.id!==Y);c({virtualKeys:_})},J=()=>{c({virtualKeys:os()}),f("info",p("toasts.keyLayoutReset"))},oe=10,ce=24;return u.jsxs(wu,{isOpen:o,onClose:s,title:p("settings.title"),subtitle:p("settings.subtitle"),closeLabel:p("common.closeDialog"),size:"lg",hints:[{keys:"esc",action:p("common.close")}],footer:u.jsxs(u.Fragment,{children:[u.jsx(Re,{variant:"ghost",onClick:L,children:p("settings.resetDefaults")}),u.jsx(Re,{variant:"primary",onClick:s,children:p("common.done")})]}),children:[u.jsx(vu,{tabs:[{id:"appearance",label:p("settings.tabAppearance"),index:1},{id:"virtualKeys",label:p("settings.tabVirtualKeys"),index:2}],activeId:y,onSelect:Y=>S(Y),className:"mb-3 border-b border-tui-border-dim pb-1"}),y==="appearance"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{children:p("settings.languageLabel")}),u.jsxs("div",{className:"grid gap-0.5 sm:grid-cols-2",children:[u.jsx(_h,{name:"ui-language",checked:m==="zh",onChange:()=>b("zh"),label:"简体中文"}),u.jsx(_h,{name:"ui-language",checked:m==="en",onChange:()=>b("en"),label:"English"})]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"terminal-font-select",children:p("settings.fontFamilyLabel")}),u.jsxs(xu,{id:"terminal-font-select",value:r.fontFamily,onChange:Y=>c({fontFamily:Y.target.value}),"aria-label":p("settings.fontFamilyLabel"),children:[!B&&u.jsx("option",{value:r.fontFamily,children:r.fontFamily}),ru.map(Y=>u.jsx("option",{value:Y.font,children:p(`fontPresets.${Y.id}`)||Y.name},Y.id))]}),u.jsxs("div",{className:"overflow-x-auto whitespace-nowrap border border-tui-border bg-tui-mantle px-2 py-1.5 leading-snug text-tui-text",style:{fontFamily:r.fontFamily,fontSize:`${r.fontSize}px`},children:[u.jsx("span",{className:"text-tui-ok",children:"$"}),' echo "Herdr 0O 1lI ',' [] () -> => !="']})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"terminal-font-size",children:p("settings.fontSizeLabel",{size:r.fontSize})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zv,{value:(r.fontSize-oe)/(ce-oe),width:24,className:"hidden shrink-0 sm:inline-flex"}),u.jsx("input",{id:"terminal-font-size",type:"range",min:oe,max:ce,step:1,value:r.fontSize,onChange:Y=>c({fontSize:Number(Y.target.value)}),className:"h-1 w-full cursor-pointer appearance-none bg-tui-border accent-tui-accent"})]}),u.jsxs("div",{className:"flex justify-between text-tui-sm text-tui-faint",children:[u.jsx("span",{children:p("settings.fontSizeCompact")}),u.jsx("span",{children:p("settings.fontSizeDefault")}),u.jsx("span",{children:p("settings.fontSizeLarge")})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.mobileFontNote")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.windowZoomSharedNote")})]}),u.jsx(ni,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(uu,{checked:r.toolbarVisible,onChange:Y=>c({toolbarVisible:Y}),label:p("settings.touchKeyToolbar"),description:p("settings.touchKeyToolbarDesc")}),u.jsx(uu,{checked:r.vibrateOnKeyPress,onChange:Y=>c({vibrateOnKeyPress:Y}),label:p("settings.touchHaptics"),description:p("settings.touchHapticsDesc")})]}),u.jsx(ni,{}),u.jsxs("p",{className:"text-tui-sm leading-snug text-tui-faint",children:[u.jsx("span",{"aria-hidden":"true",className:"mr-1",children:Le.arrowRight}),p("settings.colorPassthroughNote")]})]}),y==="virtualKeys"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-tui font-bold uppercase text-tui-accent",children:p("virtualKeyboard.customizeTitle")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("virtualKeyboard.customizeDesc")})]}),u.jsx(Re,{variant:"ghost",onClick:J,className:"shrink-0",children:p("virtualKeyboard.resetLayout")})]}),u.jsx("div",{className:"max-h-72 overflow-y-auto border border-tui-border bg-tui-mantle",children:O.map((Y,_)=>u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border-dim px-2 py-1 last:border-b-0 hover:bg-tui-selection",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("input",{type:"checkbox",checked:Y.enabled,onChange:()=>V(Y.id),className:"sr-only",id:`toggle-${Y.id}`}),u.jsx("label",{htmlFor:`toggle-${Y.id}`,className:$("shrink-0 cursor-pointer select-none font-bold",Y.enabled?"text-tui-ok":"text-tui-faint"),"aria-hidden":"true",children:Y.enabled?"[x]":"[ ]"}),u.jsx(_v,{className:$(!Y.enabled&&"opacity-50"),children:Y.label}),u.jsx("span",{className:"truncate text-tui-sm text-tui-muted",children:au(Y,p)})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Re,{variant:"ghost",brackets:!1,disabled:_===0,onClick:()=>k(_,"up"),title:p("virtualKeyboard.moveUp"),"aria-label":p("virtualKeyboard.moveUp"),className:"px-1",children:"↑"}),u.jsx(Re,{variant:"ghost",brackets:!1,disabled:_===O.length-1,onClick:()=>k(_,"down"),title:p("virtualKeyboard.moveDown"),"aria-label":p("virtualKeyboard.moveDown"),className:"px-1",children:"↓"}),u.jsx(Re,{variant:"ghost",brackets:!1,onClick:()=>P(Y.id),title:p("virtualKeyboard.deleteKeyTitle"),"aria-label":p("virtualKeyboard.deleteKeyTitle"),className:"px-1 text-tui-bad hover:text-tui-bad",children:Le.cross})]})]},Y.id))}),u.jsx(Re,{block:!0,glyph:"+",onClick:()=>T(!g),className:"border-dashed",children:p("virtualKeyboard.addKey")}),g&&u.jsxs("div",{className:"space-y-2 border border-tui-border bg-tui-mantle p-2",children:[u.jsx(ni,{label:p("virtualKeyboard.availableKeys")}),u.jsx("div",{className:"flex max-h-48 flex-wrap gap-1 overflow-y-auto",children:xy.map(Y=>{const _=O.some(R=>R.id===Y.id);return u.jsxs("button",{type:"button",onClick:()=>Q(Y),title:au(Y,p),className:$("tui-focusable flex select-none items-center gap-1 border px-1.5 py-0.5 text-tui-sm transition-colors",_?"border-tui-border-dim text-tui-faint":"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent"),children:[u.jsx("span",{children:Y.label}),u.jsx("span",{"aria-hidden":"true",className:_?"text-tui-ok":"text-tui-accent",children:_?Le.check:"+"})]},Y.id)})})]})]})]})},Tx={success:"ok",warning:"warn",error:"bad",info:"accent"},Nx={success:Le.check,warning:Le.warn,error:Le.cross,info:"›"},Ex=()=>{const{toasts:o,removeToast:s,t:r}=mt();return o.length===0?null:u.jsx("div",{className:"pointer-events-none fixed right-2 top-12 z-50 flex w-[calc(100vw-16px)] max-w-sm flex-col gap-1","aria-live":"polite","aria-atomic":"true",children:o.map(c=>{const f=Tx[c.type];return u.jsxs("div",{className:$("pointer-events-auto flex items-start gap-2 border border-tui-border border-l-2 bg-tui-base px-2 py-1 text-tui",An[f].edgeL),role:"alert",children:[u.jsx("span",{"aria-hidden":"true",className:$("shrink-0 font-bold",An[f].text),children:Nx[c.type]}),u.jsx("div",{className:"min-w-0 flex-1 break-words leading-snug text-tui-text",children:c.message}),c.count>1&&u.jsxs("span",{className:"shrink-0 border border-tui-border-dim px-1 text-tui-sm text-tui-muted","aria-label":`×${c.count}`,children:["×",c.count]}),u.jsx("button",{type:"button",onClick:()=>s(c.id),className:"tui-focusable shrink-0 select-none px-0.5 text-tui-faint transition-colors hover:text-tui-bad","aria-label":r("common.dismissNotification"),children:u.jsx("span",{"aria-hidden":"true",children:Le.cross})})]},c.id)})})},Cu=({onAddProfile:o,mobile:s=!1,statusBar:r=!1})=>{const{profiles:c,activeProfileId:f,activeProfile:m,connectionState:b,switchProfile:p,renameProfile:y,removeProfile:S,t:g}=mt(),[T,B]=x.useState(!1),[O,L]=x.useState(null),[V,k]=x.useState(""),Q=x.useRef(null);x.useEffect(()=>{if(!T)return;const _=R=>{Q.current&&!Q.current.contains(R.target)&&B(!1)};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[T]);const P=(_,R)=>{L(_),k(R)},J=_=>{const R=V.trim();R&&y(_,R),L(null)},oe=_=>{typeof window<"u"&&!window.confirm(g("profiles.removeConfirm"))||(S(_),L(null))},ce=(m==null?void 0:m.displayName)||g("profiles.addHost"),Y=b==="connected"?"ok":b==="connecting"||b==="reconnecting"?"warn":b==="error"?"bad":"idle";return u.jsxs("div",{ref:Q,className:$("relative min-w-0",s&&"w-full",r&&"flex-1"),children:[u.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":T,"aria-label":g("profiles.switcherLabel"),onClick:()=>B(_=>!_),className:$("tui-focusable flex min-w-0 items-center gap-1.5 border border-transparent text-left text-tui-muted transition-colors hover:border-tui-border hover:text-tui-accent",r?"min-h-11 w-full max-w-none px-2":s?"min-h-11 w-full px-2":"min-h-[24px] max-w-[18rem] px-1"),children:[u.jsx(Mn,{level:Y}),u.jsx("span",{className:$("truncate text-tui-text",r&&"min-w-0 flex-1"),children:ce}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:T?Le.chevronDown:Le.chevronRight})]}),T&&u.jsxs("div",{role:"menu","aria-label":g("profiles.switcherLabel"),className:$("absolute bottom-full left-0 z-[100] mb-1 max-h-[min(70vh,24rem)] overflow-y-auto border border-tui-border bg-tui-base p-1 shadow-lg",r?"w-80 max-w-[calc(100vw-1rem)]":s?"inset-x-0 bottom-auto top-full mt-1 mb-0 w-full":"w-80 max-w-[calc(100vw-1rem)]"),children:[u.jsx("div",{className:"border-b border-tui-border-dim px-2 py-1 text-tui-sm uppercase text-tui-faint",children:g("profiles.title")}),c.length===0?u.jsx("p",{className:"px-2 py-2 text-tui-sm text-tui-muted",children:g("profiles.empty")}):c.map(_=>{const R=_.id===f,ae=_.id===O;return u.jsxs("div",{role:"none",className:"border-b border-tui-border-dim last:border-b-0",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs("button",{type:"button",role:"menuitem","aria-current":R?"true":void 0,onClick:()=>{p(_.id),B(!1)},className:$("tui-focusable flex min-h-11 min-w-0 flex-1 items-center gap-2 px-2 text-left text-tui transition-colors hover:bg-tui-selection",R?"text-tui-accent":"text-tui-text"),children:[u.jsx("span",{"aria-hidden":"true",className:"w-3 shrink-0",children:R?Le.cursor:""}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate font-bold",children:_.displayName}),u.jsx("span",{className:"block truncate text-tui-sm text-tui-faint",title:_.hostname||_.hostId,children:_.hostname||_.hostId||_.wsUrl})]}),R&&u.jsx("span",{className:"shrink-0 text-tui-sm text-tui-ok",children:g("profiles.current")})]}),u.jsx("button",{type:"button",role:"menuitem","aria-label":g("profiles.rename"),title:g("profiles.rename"),onClick:()=>P(_.id,_.displayName),className:"tui-focusable min-h-11 min-w-11 px-2 text-tui-muted hover:text-tui-accent",children:Le.ellipsis})]}),ae&&u.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[u.jsx("input",{autoFocus:!0,value:V,maxLength:64,onChange:Ee=>k(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&J(_.id),Ee.key==="Escape"&&L(null)},"aria-label":g("profiles.rename"),className:"tui-input min-w-0 flex-1 px-2 py-1 text-tui"}),u.jsx(Re,{onClick:()=>J(_.id),variant:"primary",className:"min-h-11",children:g("common.save")}),u.jsx(Re,{onClick:()=>oe(_.id),variant:"danger",className:"min-h-11",children:g("profiles.remove")})]})]},_.id)}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{B(!1),o()},className:"tui-focusable flex min-h-11 w-full items-center gap-2 px-2 text-left text-tui-accent hover:bg-tui-selection",children:[u.jsx("span",{"aria-hidden":"true",children:"+"}),u.jsx("span",{children:g("profiles.addHost")})]})]})]})},Ax=({onAddProfile:o=()=>{}})=>{const{connectionState:s,role:r,hostId:c,assignedClientId:f,sharedWindowCount:m,settings:b,rttMs:p,t:y}=mt(),S=Do(s,y),g=s==="connected";return u.jsx(Rp,{left:u.jsxs(u.Fragment,{children:[u.jsx(Cu,{onAddProfile:o}),u.jsx(kh,{items:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Mn,{level:S.level}),u.jsx("span",{className:"text-tui-text",children:S.label})]},"status"),g?u.jsx(ko,{tone:r==="controller"?"ok":"warn",children:y(r==="controller"?"role.sharedControl":"common.viewer")},"role"):null,g&&m>1?u.jsx("span",{className:"text-tui-muted",children:y("role.sharedWindows",{count:m})},"windows"):null,c?u.jsxs("span",{children:[u.jsxs("span",{className:"text-tui-faint",children:[y("common.host"),":"]})," ",u.jsx("span",{className:"text-tui-text",children:c})]},"host"):null,u.jsxs("span",{children:[u.jsx("span",{className:"text-tui-faint",children:y("header.clientIdLabel")})," ",u.jsx("span",{className:"text-tui-text",children:f||b.clientId})]},"client")]})]}),right:u.jsx(kh,{items:[p!==null?u.jsxs("span",{className:"text-tui-muted",children:[y("header.latencyTitle"),": ",u.jsxs("span",{className:"text-tui-text",children:[p,"ms"]})]},"rtt"):null,u.jsx("span",{className:"hidden text-tui-faint sm:inline",children:y("header.tagline")},"mode")]})})},jx=[[/\biPhone\b/i,"iPhone"],[/\biPad\b/i,"iPad"],[/\biPod\b/i,"iPod"],[/\bAndroid\b/i,"Android"],[/\bCrOS\b/i,"ChromeOS"],[/\bWindows NT\b/i,"Windows"],[/\bMac OS X\b|\bMacintosh\b/i,"macOS"],[/\bLinux\b/i,"Linux"]],Rx=[[/\bEdgA?\/|\bEdge\//i,"Edge"],[/\bOPR\/|\bOpera\//i,"Opera"],[/\bSamsungBrowser\//i,"Samsung Internet"],[/\bFirefox\/|\bFxiOS\//i,"Firefox"],[/\bCriOS\//i,"Chrome"],[/\bChrome\//i,"Chrome"],[/\bSafari\//i,"Safari"]];function qh(o,s){for(const[r,c]of o)if(r.test(s))return c;return null}function Tu(o){const s=typeof o=="string"?o.trim():"";if(!s)return{label:"",raw:""};const r=qh(jx,s),c=qh(Rx,s);return r&&c?{label:`${r} · ${c}`,raw:s}:r?{label:r,raw:s}:c?{label:c,raw:s}:{label:s.length>32?`${s.slice(0,32)}…`:s,raw:s}}function Xh(o){if(o===0)return"0 B";const s=1024,r=["B","KB","MB","GB"],c=Math.floor(Math.log(o)/Math.log(s));return`${(o/Math.pow(s,c)).toFixed(1)} ${r[c]}`}const Mx=({clients:o})=>{const{t:s}=mt(),r=[{key:"id",header:s("admin.colClientId"),render:c=>u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Mn,{level:"ok"}),u.jsx("span",{className:"font-bold text-tui-text",children:c.id})]})},{key:"role",header:s("admin.colRole"),width:12,render:c=>{const f=c.role==="controller";return u.jsx(ko,{tone:f?"ok":"warn",children:s(f?"common.controller":"common.viewer")})}},{key:"device",header:s("admin.colDevice"),render:c=>{const f=Tu(c.userAgent);return f.label?u.jsx("span",{className:"text-tui-muted",title:f.raw,children:f.label}):u.jsx("span",{className:"text-tui-faint",children:s("admin.unknownDevice")})}},{key:"ip",header:s("admin.colIp"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.ip||"127.0.0.1"})},{key:"connectedAt",header:s("admin.colConnectedAt"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.connectedAt?new Date(c.connectedAt).toLocaleTimeString():s("admin.startedRecently")})},{key:"traffic",header:s("admin.colTraffic"),align:"right",render:c=>u.jsxs("span",{className:"whitespace-nowrap",children:[u.jsx("span",{className:"text-tui-accent",children:Xh(c.bytesReceived||0)}),u.jsx("span",{"aria-hidden":"true",className:"mx-1 text-tui-faint",children:"/"}),u.jsx("span",{className:"text-tui-ok",children:Xh(c.bytesSent||0)})]})}];return u.jsx(Zt,{title:s("admin.connectedClientsTitle",{count:o.length}),bodyClassName:"-mx-1",children:u.jsx(Su,{columns:r,items:o,rowKey:c=>c.id,empty:s("admin.noClients")})})},Vh={online:"ok",busy:"ok",reconnecting:"warn",offline:"idle"};function zx(o=[],s=[]){const r=new Map;for(const m of s){if(!(m!=null&&m.hostId))continue;const b=r.get(m.hostId);b?b.push(m):r.set(m.hostId,[m])}const c=o.map(m=>{const b=r.get(m.id)||[];return{id:m.id,hostname:m.hostname||m.id,status:m.status||"online",connectedDeviceCount:m.connectedDeviceCount??0,pairedDeviceCount:m.pairedDeviceCount??b.length,devices:b,fromRosterOnly:!1}}),f=new Set(c.map(m=>m.id));for(const[m,b]of r)f.has(m)||c.push({id:m,hostname:m,status:"offline",connectedDeviceCount:0,pairedDeviceCount:b.length,devices:b,fromRosterOnly:!0});return c.sort((m,b)=>m.fromRosterOnly!==b.fromRosterOnly?m.fromRosterOnly?1:-1:m.hostname.localeCompare(b.hostname))}const _x=({hosts:o,devices:s})=>{const{t:r}=mt(),c=zx(o,s),f={online:r("admin.hostStatusOnline"),busy:r("admin.hostStatusBusy"),reconnecting:r("admin.hostStatusReconnecting"),offline:r("admin.hostStatusOffline")};return u.jsx(Zt,{title:r("admin.hostsTitle",{count:c.length}),bodyClassName:"space-y-2",children:c.length===0?u.jsx("p",{className:"px-1 py-2 text-tui text-tui-faint",children:r("admin.noHosts")}):c.map(m=>u.jsxs("div",{className:"border border-tui-border-dim bg-tui-mantle",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-tui-border-dim px-2 py-1",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-tui",children:[u.jsx(Mn,{level:Vh[m.status]}),u.jsx("span",{className:"truncate font-bold text-tui-text",children:m.hostname}),m.hostname!==m.id?u.jsx("code",{className:"truncate text-tui-sm text-tui-faint",children:m.id}):null]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-3 text-tui-sm",children:[u.jsx(ko,{tone:Vh[m.status],children:f[m.status]}),u.jsx("span",{className:"text-tui-accent",children:r("admin.hostConnectedDevices",{count:m.connectedDeviceCount})}),u.jsx("span",{className:"text-tui-muted",children:r("admin.hostPairedDevices",{count:m.pairedDeviceCount})})]})]}),m.devices.length>0?u.jsx("ul",{className:"divide-y divide-tui-border-dim",children:m.devices.map(b=>{const p=Tu(b.userAgent);return u.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-2 py-0.5 text-tui",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:"·"}),u.jsx("span",{className:"truncate text-tui-text",title:p.raw,children:p.label||r("admin.unknownDevice")}),u.jsx("code",{className:"truncate text-tui-sm text-tui-muted",children:b.deviceId}),u.jsx("span",{className:"ml-auto shrink-0 text-tui-sm text-tui-faint",children:b.lastIp||"—"})]},b.deviceId)})}):u.jsx("p",{className:"px-2 py-1 text-tui-sm text-tui-faint",children:m.pairedDeviceCount>0?r("admin.hostRosterOperatorOnly"):r("admin.noDevices")})]},m.id))})},kx=({ptys:o})=>{const{t:s}=mt(),r=[{key:"id",header:s("admin.colPtyId"),render:c=>u.jsx("span",{className:"font-bold text-tui-accent",children:c.id})},{key:"pid",header:s("admin.colPid"),width:9,render:c=>u.jsx("span",{className:"text-tui-muted",children:c.pid})},{key:"command",header:s("admin.colCommand"),render:c=>u.jsx("code",{className:"border border-tui-border-dim bg-tui-mantle px-1 text-tui-text",children:c.command})},{key:"grid",header:s("admin.colGrid"),width:11,render:c=>u.jsxs("span",{className:"whitespace-nowrap text-tui-muted",children:[c.cols,u.jsx("span",{"aria-hidden":"true",className:"mx-0.5 text-tui-faint",children:"×"}),c.rows]})},{key:"cwd",header:s("admin.colCwd"),className:"max-w-xs truncate",render:c=>u.jsx("span",{className:"text-tui-muted",children:c.cwd||"~"})},{key:"viewers",header:s("admin.colViewers"),align:"right",width:9,render:c=>u.jsx("span",{className:"font-bold text-tui-ok",children:c.activeClients})}];return u.jsx(Zt,{title:s("admin.activePtysTitle",{count:o.length}),bodyClassName:"-mx-1",children:u.jsx(Su,{columns:r,items:o,rowKey:c=>c.id,empty:s("admin.noPtys")})})};function Dx(o){if(!o)return"—";const s=new Date(o);return Number.isNaN(s.getTime())?"—":s.toLocaleString()}const Lx=({devices:o,onRevoke:s})=>{const{t:r}=mt(),[c,f]=x.useState(null),[m,b]=x.useState(null),p=async S=>{if(c!==S){f(S);return}b(S);try{await s(S)}finally{b(null),f(null)}},y=[{key:"device",header:r("admin.colDevice"),render:S=>{const g=Tu(S.userAgent);return u.jsx("span",{className:"text-tui-text",title:g.raw,children:g.label||r("admin.unknownDevice")})}},{key:"deviceId",header:r("admin.colDeviceId"),render:S=>u.jsx("span",{className:"text-tui-muted",children:S.deviceId})},{key:"ip",header:r("admin.colIp"),render:S=>u.jsx("span",{className:"text-tui-muted",children:S.lastIp||"—"})},{key:"lastSeen",header:r("admin.colLastSeen"),render:S=>u.jsx("span",{className:"whitespace-nowrap text-tui-muted",children:Dx(S.lastSeenAt)})},{key:"actions",header:r("admin.colActions"),align:"right",render:S=>{const g=c===S.deviceId,T=m===S.deviceId;return u.jsx(Re,{variant:"danger",disabled:T,onClick:()=>void p(S.deviceId),onBlur:()=>f(B=>B===S.deviceId?null:B),"aria-label":r("admin.revokeDevice"),className:g?"bg-tui-bad text-tui-crust":void 0,children:T?u.jsx(li,{}):r(g?"admin.revokeConfirm":"admin.revokeDevice")})}}];return u.jsx(Zt,{title:r("admin.pairedDevicesTitle",{count:o.length}),bodyClassName:"-mx-1",children:u.jsx(Su,{columns:y,items:o,rowKey:S=>S.deviceId,empty:r("admin.noDevices")})})};function Lp(o){if(typeof window>"u"||!o||o.startsWith("/"))return"";try{const s=new URL(o.replace(/^ws/,"http")),r=s.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"");return s.origin===window.location.origin&&!r?"":`${s.origin}${r}`}catch{return""}}function ns(o,s){const r=Lp(o);return r?`${r}${s.startsWith("/")?s:`/${s}`}`:s}const Ox=({onBackToTerminal:o,onOpenPairing:s})=>{var ct,lt,ut,wt,st,dt,kt,Qt,gt,mn,Ft,yt,Wn,Gt;const{settings:r,updateSettings:c,addToast:f,t:m}=mt(),b=Lp(r.wsUrl)||(typeof window<"u"?window.location.origin:"local"),p=((ct=r.adminTokens)==null?void 0:ct[b])||(b===(typeof window<"u"?window.location.origin:"local")?r.adminToken:"")||"",[y,S]=x.useState(null),[g,T]=x.useState(null),[B,O]=x.useState(!1),[L,V]=x.useState(!0),[k,Q]=x.useState(null),[P,J]=x.useState(!1),[oe,ce]=x.useState(3e3),[Y,_]=x.useState(null),[R,ae]=x.useState("overview"),[Ee,Se]=x.useState(!1),[me,Z]=x.useState(p),[pe,Te]=x.useState(!!p),M="node bin/service.js pair";x.useEffect(()=>{Z(p),Te(!!p),S(null),T(null),O(!1)},[b]);const X=()=>{pa(M).then(ee=>{if(ee==="failed"){f("error",m("clipboard.copyFailed"));return}Se(!0),f("success",m("toasts.commandCopied")),setTimeout(()=>Se(!1),2e3)})};x.useEffect(()=>{let ee=!0;V(!0);async function ve(){try{const _e=await fetch(ns(r.wsUrl,"/api/info"),{headers:{Accept:"application/json"}});if(_e.ok){const He=await _e.json();ee&&(T(He),O(!0));return}}catch{}if(ee){const _e=!!(r.wsUrl&&!r.wsUrl.startsWith("/")&&!r.wsUrl.includes("localhost")&&!r.wsUrl.includes("127.0.0.1")&&typeof window<"u"&&!r.wsUrl.startsWith(window.location.origin.replace("http","ws")));T({ok:!0,version:"0.1.0",protocol:1,relayMode:_e?"remote":"local",adminConfigured:!1,adminPath:"/admin",adminStatusPath:"/api/admin/status"}),O(!0)}}return ve(),()=>{ee=!1}},[r.wsUrl,b]);const W=(g==null?void 0:g.relayMode)==="remote",ue=()=>{if(g!=null&&g.adminPath)return g.publicUrl?`${g.publicUrl.replace(/\/$/,"")}${g.adminPath}`:ns(r.wsUrl,g.adminPath);if(y!=null&&y.remoteAdminUrl)return y.remoteAdminUrl;if(r.wsUrl)try{return ns(r.wsUrl,"/admin")}catch{}return"/admin"},K=x.useCallback(async()=>{if(B){if(W){if(!pe&&!me){S(null),V(!1),Q(null),J(!1);return}try{V(!0);const ee=ns(r.wsUrl,(g==null?void 0:g.adminStatusPath)||"/api/admin/status"),_e=await fetch(ee,{headers:{Accept:"application/json","X-Relay-Admin-Token":me}});if(_e.status===401||_e.status===403){J(!0),Q(m("admin.relayAdminAuthError")),S(null);return}if(!_e.ok)throw new Error(`HTTP ${_e.status}: ${_e.statusText}`);const He=await _e.json();S(He),Q(null),J(!1),_(new Date)}catch(ee){console.warn("GET /api/admin/status request failed:",ee),J(!1),Q(ee instanceof Error?ee.message:"Failed to fetch remote admin status"),S(null)}finally{V(!1)}return}try{V(!0);const ee={Accept:"application/json"};r.token&&(ee.Authorization=`Bearer ${r.token}`);const ve=await fetch("/api/status",{headers:ee});if(ve.status===401||ve.status===403){J(!0),Q(`Authentication failed (HTTP ${ve.status}): Access denied. Please configure an authorized token or pair with the host.`),S(null);return}if(!ve.ok)throw new Error(`HTTP ${ve.status}: ${ve.statusText}`);const _e=await ve.json();S(_e),Q(null),J(!1),_(new Date)}catch(ee){console.warn("GET /api/status request failed:",ee),J(!1),Q(ee instanceof Error?ee.message:"Failed to fetch status"),S(null)}finally{V(!1)}}},[B,W,pe,me,g,r.token,r.wsUrl,b,m]),Me=x.useCallback(async ee=>{try{if(!(await fetch(ns(r.wsUrl,`/api/admin/devices/${encodeURIComponent(ee)}`),{method:"DELETE",headers:{Accept:"application/json","X-Relay-Admin-Token":me}})).ok){Q(m("admin.revokeFailed"));return}await K()}catch{Q(m("admin.revokeFailed"))}},[me,K,r.wsUrl,m]);x.useEffect(()=>{if(!B)return;K();let ee=null;const ve=()=>{oe>0&&!ee&&(ee=setInterval(()=>{document.visibilityState==="visible"&&K()},oe))},_e=()=>{ee&&(clearInterval(ee),ee=null)},He=()=>{document.visibilityState==="visible"?(K(),ve()):_e()};return ve(),document.addEventListener("visibilitychange",He),()=>{_e(),document.removeEventListener("visibilitychange",He)}},[B,K,oe]);const ze=ee=>{ee.preventDefault();const ve=me.trim();c({adminToken:ve,adminTokens:{...r.adminTokens||{},[b]:ve}}),Te(!!ve)},Ce=ee=>{const ve=Math.max(0,Math.floor(ee)),_e=Math.floor(ve/86400),He=Math.floor(ve%86400/3600),an=Math.floor(ve%3600/60),$n=ve%60,qt=(Hn,Yn)=>`${Hn}${m(`admin.unit${Yn}`)}`;return _e>0?[qt(_e,"Day"),qt(He,"Hour"),qt(an,"Minute")].join(" "):He>0?[qt(He,"Hour"),qt(an,"Minute"),qt($n,"Second")].join(" "):[qt(an,"Minute"),qt($n,"Second")].join(" ")},Oe=ee=>{if(!ee||ee===0)return"0 B";const ve=1024,_e=["B","KB","MB","GB"],He=Math.floor(Math.log(ee)/Math.log(ve));return`${(ee/Math.pow(ve,He)).toFixed(1)} ${_e[He]}`},we=()=>{const ee=ue();window.open(ee,"_blank","noopener,noreferrer")},xe=y?y.activeUserCount??((lt=y.clients)==null?void 0:lt.length)??0:0,$e=y?[{id:"overview",label:m("admin.tabOverview"),index:1},{id:"clients",label:m("admin.tabClients",{count:((ut=y.clients)==null?void 0:ut.length)||0}),index:2},{id:"ptys",label:m("admin.tabPtys",{count:((wt=y.ptys)==null?void 0:wt.length)||0}),index:3},...y.devices?[{id:"devices",label:m("admin.tabDevices",{count:y.devices.length}),index:4}]:[]]:[],bt=$e.map(ee=>ee.id);x.useEffect(()=>{const ee=ve=>{if(ve.ctrlKey||ve.altKey||ve.metaKey)return;const _e=ve.target;if(_e instanceof HTMLInputElement||_e instanceof HTMLTextAreaElement||_e instanceof HTMLSelectElement||_e!=null&&_e.isContentEditable||document.querySelector('[role="dialog"]'))return;if(ve.key==="Escape"&&o){ve.preventDefault(),o();return}if(ve.key.toLowerCase()==="r"){ve.preventDefault(),K();return}const He=Number.parseInt(ve.key,10)-1;Number.isInteger(He)&&He>=0&&He<bt.length&&(ve.preventDefault(),ae(bt[He]))};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[K,bt.join("|")]);const je=u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[o&&u.jsx(Re,{variant:"ghost",onClick:o,title:m("admin.returnToTerminal"),"aria-label":m("admin.returnToTerminal"),glyph:Le.arrowLeft,brackets:!1,className:"shrink-0",children:u.jsx("span",{className:"sr-only",children:m("admin.returnToTerminal")})}),u.jsxs("span",{className:"hidden text-tui-sm text-tui-accent sm:inline",children:["v",(g==null?void 0:g.version)||(y==null?void 0:y.version)||"0.1.0"]}),u.jsx(ko,{tone:W?"alt":"ok",children:m(W?"admin.modeRemote":"admin.localWorkstationBadge")}),u.jsxs("label",{className:"hidden items-center gap-1.5 text-tui-sm text-tui-muted md:flex",children:[u.jsx("span",{children:m("admin.autoRefresh")}),u.jsxs(xu,{value:oe,onChange:ee=>ce(Number(ee.target.value)),"aria-label":m("admin.autoRefresh"),className:"w-auto",children:[u.jsx("option",{value:0,children:m("admin.paused")}),u.jsx("option",{value:1e3,children:"1s"}),u.jsx("option",{value:3e3,children:"3s"}),u.jsx("option",{value:5e3,children:"5s"}),u.jsx("option",{value:1e4,children:"10s"})]})]}),u.jsx(Re,{variant:"primary",onClick:K,disabled:L,title:m("admin.refreshNow"),children:L?u.jsx(li,{}):m("admin.refreshNow")})]});return u.jsxs(kv,{name:m("admin.title"),tagline:m("admin.subtitle"),aside:je,tabs:$e,activeTabId:R,onSelectTab:ee=>ae(ee),tabsAriaLabel:m("header.mainNavigationAria"),hints:[{keys:"1–4",action:m("admin.hintTabs")},{keys:"r",action:m("admin.hintRefresh")},...o?[{keys:"esc",action:m("admin.hintBack")}]:[]],footerAside:Y?u.jsx("span",{className:"text-tui-faint",children:m("admin.updatedAt",{time:Y.toLocaleTimeString()})}):null,bodyClassName:"space-y-3 pb-2",children:[!B&&u.jsx("div",{className:"flex items-center justify-center gap-2 border border-tui-border bg-tui-base px-3 py-8 text-tui text-tui-muted",children:u.jsx(li,{label:m("admin.loadingStatus")})}),B&&W&&!pe&&u.jsxs(Zt,{title:m("admin.remoteRelayTitle"),aside:m("admin.remoteRelayBadge"),bodyClassName:"space-y-2",children:[u.jsx("p",{className:"text-tui leading-snug text-tui-muted",children:m("admin.remoteRelayNotice")}),u.jsxs("div",{className:"space-y-0.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx(Bn,{label:m("admin.remoteRelayEndpoint"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-accent",children:r.wsUrl})}),u.jsx(Bn,{label:m("admin.remoteRelayAdminUrl"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-ok",children:ue()})})]}),u.jsx(ni,{}),u.jsxs("div",{className:"flex flex-col items-start justify-between gap-2 sm:flex-row sm:items-center",children:[u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("admin.remoteRelayHelp")}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(Re,{onClick:()=>Te(!0),children:m("admin.relayAdminLoginBtn")}),u.jsx(Re,{variant:"primary",onClick:we,glyph:Le.arrowRight,children:m("admin.openRemoteAdminBtn")})]})]})]}),B&&W&&pe&&!y&&u.jsxs(Zt,{title:m("admin.relayAdminTitle"),bodyClassName:"space-y-2",children:[u.jsx(Ao,{tone:(g==null?void 0:g.adminConfigured)===!1?"warn":"bad",children:(g==null?void 0:g.adminConfigured)===!1?m("admin.relayAdminNotConfigured"):m("admin.relayAdminAuthError")}),u.jsxs("form",{onSubmit:ze,className:"space-y-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(jn,{htmlFor:"relay-admin-token",children:m("admin.relayAdminTokenLabel")}),u.jsx(Rn,{id:"relay-admin-token",type:"password",value:me,onChange:ee=>Z(ee.target.value),placeholder:m("admin.relayAdminTokenPlaceholder")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Re,{variant:"primary",type:"submit",children:m("admin.relayAdminLoginBtn")}),u.jsx(Re,{variant:"ghost",onClick:()=>Te(!1),children:m("common.cancel")})]})]})]}),B&&!W&&P&&u.jsxs(Zt,{title:m("admin.unauthorizedTitle"),tone:"bad",bodyClassName:"space-y-2",children:[u.jsx(Ao,{tone:"bad",children:m("admin.unauthorizedDesc")}),u.jsxs("div",{className:"space-y-1.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx("span",{className:"block text-tui-sm uppercase text-tui-muted",children:m("admin.pairingStepsTitle")}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-crust px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui-text",children:M}),u.jsx(Re,{onClick:X,glyph:Ee?Le.check:"⧉",className:$("shrink-0",Ee&&"border-tui-ok text-tui-ok"),children:m(Ee?"admin.copiedJson":"common.copy")})]}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:m("admin.pairingStepsHelp")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[s&&u.jsx(Re,{variant:"primary",onClick:s,children:m("admin.enterPairCodeBtn")}),u.jsx(Re,{onClick:K,children:m("admin.retryFetchBtn")})]})]}),B&&k&&!P&&!(!W&&P)&&u.jsx(Ao,{tone:"warn",action:u.jsx(Re,{variant:"warn",onClick:K,children:m("common.retry")}),children:m("admin.errorConnecting",{error:k})}),y&&u.jsxs(u.Fragment,{children:[R==="overview"&&u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[u.jsxs(Zt,{title:m("admin.accessPanel"),aside:Ce(y.uptimeSeconds||0),bodyClassName:"space-y-0.5",children:[u.jsx(Bn,{label:m("admin.connectedHosts"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Mn,{level:(st=y.hosts)!=null&&st.length?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:((dt=y.hosts)==null?void 0:dt.length)||0})]})}),u.jsx(Bn,{label:m("admin.activeUsers"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(Mn,{level:xe?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:xe}),u.jsx("span",{className:"text-tui-faint",children:m("admin.acrossWindows",{count:((kt=y.clients)==null?void 0:kt.length)||0})})]})}),u.jsxs(Bn,{label:m("admin.activePtys"),labelWidth:14,children:[u.jsx("span",{className:"font-bold",children:((Qt=y.ptys)==null?void 0:Qt.length)||0}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:m("admin.terminalShells")})]}),u.jsx(Bn,{label:m("admin.uptime"),labelWidth:14,children:u.jsx("span",{className:"text-tui-muted",children:y.startTime?m("admin.startedAt",{time:new Date(y.startTime).toLocaleTimeString()}):m("admin.startedRecently")})})]}),u.jsxs(Zt,{title:m("admin.throughput"),aside:m("admin.perSecond",{value:Oe(((gt=y.throughput)==null?void 0:gt.bytesOutPerSec)||0)}),bodyClassName:"space-y-0.5",children:[u.jsxs(Bn,{label:m("admin.bytesInTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-accent",children:Oe(((mn=y.throughput)==null?void 0:mn.bytesIn)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:m("admin.perSecond",{value:Oe(((Ft=y.throughput)==null?void 0:Ft.bytesInPerSec)||0)})})]}),u.jsxs(Bn,{label:m("admin.bytesOutTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-ok",children:Oe(((yt=y.throughput)==null?void 0:yt.bytesOut)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:m("admin.perSecond",{value:Oe(((Wn=y.throughput)==null?void 0:Wn.bytesOutPerSec)||0)})})]}),u.jsx(ni,{}),u.jsx(Bn,{label:m("admin.frameRate"),labelWidth:13,children:u.jsx("span",{className:"font-bold",children:m("admin.framesPerSecond",{count:(((Gt=y.throughput)==null?void 0:Gt.framesOutPerSec)||0).toFixed(0)})})})]})]}),u.jsx(_x,{hosts:y.hosts||[],devices:y.devices})]}),R==="clients"&&u.jsx(Mx,{clients:y.clients||[]}),R==="ptys"&&u.jsx(kx,{ptys:y.ptys||[]}),R==="devices"&&u.jsx(Lx,{devices:y.devices||[],onRevoke:Me})]})]})},Ux=({compact:o=!1})=>{const{role:s,connectionState:r,sharedWindowCount:c,assignedClientId:f,t:m}=mt();if(!(r==="connected"))return u.jsxs("div",{className:"inline-flex select-none items-center gap-1.5 text-tui uppercase text-tui-faint",role:"status","aria-label":m("terminal.offlineStatusAria"),children:[u.jsx(Mn,{level:"idle"}),u.jsx("span",{children:m("common.offline")})]});const p=s==="controller",y=c>1,S=u.jsxs("div",{className:$("inline-flex min-w-0 select-none items-center gap-1.5 text-tui uppercase",p?"text-tui-ok":"text-tui-warn"),role:"status","aria-label":m(p?"role.controllerMode":"role.viewerMode"),children:[u.jsx(Mn,{level:p?"ok":"warn"}),u.jsx("span",{className:"truncate",children:m(p?"role.sharedControl":"role.viewerReadOnly")}),y?u.jsx("span",{className:"shrink-0 normal-case text-tui-muted",children:m("role.sharedWindows",{count:c})}):null]});return o?S:u.jsxs("div",{className:"flex w-full flex-col gap-1",children:[S,u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("role.sharedControlDesc")}),f?u.jsx(Bn,{label:m("role.thisWindow"),labelWidth:9,className:"text-tui-sm",children:u.jsx("span",{className:"truncate text-tui-muted",children:f})}):null]})},ls="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",as="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",Bx="border-tui-accent bg-tui-selection text-tui-accent",is=({active:o=!1})=>u.jsx("span",{"aria-hidden":"true",className:$("shrink-0",o?"text-tui-accent":"text-tui-faint group-hover:text-tui-accent"),children:Le.cursor}),Hx=({onClose:o,onNavigateAdmin:s,showAdminEntry:r=!0,onOpenPairing:c,onOpenSettings:f,onAddProfile:m=()=>{}})=>{const{connectionState:b,stateDetail:p,rttMs:y,hostId:S,settings:g,updateSettings:T,connect:B,addToast:O,language:L,setLanguage:V,t:k}=mt(),[Q,P]=Sl.useState(!1),J=Do(b,k),oe=_=>()=>{var ae;const R=document.activeElement;(ae=R==null?void 0:R.blur)==null||ae.call(R),_()},ce=()=>{pa(g.clientId).then(_=>{if(_==="failed"){O("error",k("clipboard.copyFailed"));return}P(!0),O("info",k("toasts.clientIdCopied",{id:g.clientId})),setTimeout(()=>P(!1),2e3)})},Y=()=>{const _=L==="zh"?"en":"zh";V(_),O("info",bu(_,"toasts.switchedLanguage",{lang:_==="zh"?"简体中文":"English"}))};return u.jsxs("div",{className:"flex flex-col gap-3 px-3 pb-2 pt-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border pb-1.5",children:[u.jsx("h2",{className:"text-tui font-bold uppercase text-tui-accent",children:k("mobile.sessionControls")}),u.jsx(Re,{variant:"ghost",onClick:o,"aria-label":k("mobile.closeSessionControls"),children:"esc"})]}),u.jsx(Zt,{title:k("profiles.title"),tone:"accent",bodyClassName:"space-y-1",children:u.jsx(Cu,{mobile:!0,onAddProfile:m})}),u.jsxs(Zt,{title:k("common.status"),tone:J.level==="ok"?"ok":J.level==="bad"?"bad":"warn",bodyClassName:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2","aria-label":k("mobile.connectionStatusAria"),children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(Mn,{level:J.level}),u.jsx("span",{className:"truncate text-tui uppercase text-tui-text",children:J.label}),b==="connected"&&y!==null&&u.jsxs("span",{className:"text-tui-sm text-tui-muted",children:[y,"ms"]})]}),J.actionLabel&&u.jsx(Re,{variant:"primary",onClick:()=>B(),className:"shrink-0",children:J.actionLabel})]}),J.needsAttention&&p&&u.jsx("p",{className:"text-tui-sm leading-snug text-tui-muted",children:p}),S&&u.jsx(Bn,{label:k("common.host"),labelWidth:9,children:S}),u.jsxs("button",{type:"button",onClick:ce,className:"tui-focusable flex w-full items-baseline gap-2 text-left text-tui",title:k("header.copyClientIdTitle"),children:[u.jsx("span",{className:"shrink-0 text-tui-muted",style:{width:"9ch"},children:k("header.clientIdLabel")}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-text",children:g.clientId}),u.jsx("span",{"aria-hidden":"true",className:$("shrink-0",Q?"text-tui-ok":"text-tui-faint"),children:Q?Le.check:"⧉"})]})]}),u.jsx(Zt,{title:k("mobile.inputControl"),tone:"accent","aria-label":k("mobile.terminalControlAria"),children:u.jsx(Ux,{})}),u.jsxs(Zt,{title:k("mobile.menu"),tone:"accent",bodyClassName:"flex flex-col gap-1",children:[u.jsxs("button",{type:"button",onClick:Y,className:$(ls,as),"aria-label":k("header.languageToggleTitle"),children:[u.jsx(is,{}),u.jsx("span",{className:"truncate",children:L==="zh"?"English":"中文"})]}),u.jsxs("button",{type:"button",onClick:oe(f),className:$(ls,as),"aria-label":k("mobile.settingsAria"),children:[u.jsx(is,{}),u.jsx("span",{className:"truncate",children:k("common.settings")})]}),u.jsxs("button",{type:"button",onClick:oe(c),className:$(ls,as),"aria-label":k("mobile.pairingAria"),children:[u.jsx(is,{}),u.jsx("span",{className:"truncate",children:k("common.pairing")})]}),r&&u.jsxs("button",{type:"button",onClick:oe(s),className:$(ls,as),"aria-label":k("mobile.adminAria"),children:[u.jsx(is,{}),u.jsx("span",{className:"truncate",children:k("common.admin")})]}),u.jsxs("button",{type:"button",onClick:()=>T({toolbarVisible:!g.toolbarVisible}),className:$(ls,g.toolbarVisible?Bx:as),"aria-label":k("mobile.keybarAria"),"aria-pressed":g.toolbarVisible,children:[u.jsx(is,{active:g.toolbarVisible}),u.jsx("span",{className:"truncate",children:k("common.keyBar")}),u.jsx("span",{"aria-hidden":"true",className:"ml-auto shrink-0 text-tui-sm",children:g.toolbarVisible?"[x]":"[ ]"})]})]})]})},Yx=({onAddProfile:o})=>{const{rttMs:s,t:r}=mt();return u.jsxs("footer",{"data-testid":"mobile-status-bar",role:"status","aria-label":r("mobile.statusBarAria"),className:"absolute inset-x-0 bottom-0 z-40 flex h-11 shrink-0 items-center gap-2 border-t border-tui-border bg-tui-mantle px-1 text-tui-sm",children:[u.jsx(Cu,{statusBar:!0,onAddProfile:o}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-border",children:"│"}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 px-1 text-tui-muted",title:r("header.latencyTitle"),children:[u.jsx("span",{className:"text-tui-faint",children:"RTT"}),u.jsx("span",{className:$(s===null?"text-tui-faint":"text-tui-text"),children:s===null?"—":`${s}ms`})]})]})},Kx=({onNavigateAdmin:o,showAdminEntry:s=!0,onOpenPairing:r,onOpenSettings:c,onAddProfile:f=()=>{}})=>{const{connectionState:m,isController:b,t:p}=mt(),[y,S]=x.useState(!1),g=x.useRef(null),T=x.useCallback(()=>S(!1),[]);x.useEffect(()=>{if(!y)return;const O=L=>{if(!(L.ctrlKey||L.altKey||L.metaKey)&&L.key==="Escape"){const V=L.target;V&&typeof V.closest=="function"&&!!V.closest("#terminal-container")||(L.stopPropagation(),L.preventDefault(),T())}};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[y,T]),x.useEffect(()=>{var O;y&&((O=g.current)==null||O.focus({preventScroll:!0}))},[y]);const B=Do(m,p);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{"data-testid":"mobile-topbar",role:"toolbar","aria-label":p("mobile.sessionControls"),className:"pointer-events-none absolute inset-x-0 top-0 z-40 flex h-12 items-center justify-between gap-2 border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-sm text-tui-muted",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:"herdr"}),u.jsx(Ap,{className:"shrink-0"}),u.jsx(Mn,{level:B.level}),u.jsx("span",{className:"truncate uppercase",children:B.label})]}),u.jsxs("button",{type:"button","data-testid":"mobile-chrome-trigger",onClick:()=>S(!0),"aria-label":p("mobile.sessionControls"),"aria-expanded":y,"aria-haspopup":"dialog",className:$("tui-focusable pointer-events-auto flex h-9 shrink-0 select-none items-center gap-1.5 border px-2 text-tui uppercase transition-colors",B.needsAttention?"border-tui-warn text-tui-warn":b?"border-tui-border text-tui-muted":"border-tui-accent text-tui-accent"),children:[!b&&!B.needsAttention&&u.jsx("span",{className:"max-w-[8rem] truncate",children:p("common.viewer")}),u.jsx("span",{"aria-hidden":"true",className:"text-tui",children:Le.chevronDown}),u.jsx("span",{"aria-hidden":"true",children:p("mobile.menu")})]})]}),y&&u.jsxs(u.Fragment,{children:[u.jsx("div",{"data-testid":"mobile-sheet-scrim",className:"absolute inset-0 z-40 bg-tui-crust/70",onClick:T,"aria-hidden":"true"}),u.jsx("div",{ref:g,"data-testid":"mobile-control-sheet",role:"dialog","aria-modal":"true","aria-label":p("mobile.sessionControls"),tabIndex:-1,className:"herdr-sheet absolute inset-x-0 bottom-0 z-50 max-h-[85%] overflow-y-auto border-t border-tui-border bg-tui-base pb-3 focus:outline-none",children:u.jsx(Hx,{onClose:T,showAdminEntry:s,onNavigateAdmin:()=>{T(),o()},onOpenPairing:()=>{T(),r()},onOpenSettings:()=>{T(),c()},onAddProfile:()=>{T(),f()}})})]}),u.jsx(Yx,{onAddProfile:f})]})},Op="--app-height",Up="--keyboard-inset",Gx=80;function qx(){if(typeof window>"u")return{height:768,keyboardInset:0};const o=window.innerHeight||768,s=window.visualViewport;if(s&&typeof s.height=="number"&&s.height>0){const r=o-s.height-(s.offsetTop||0),c=r>=Gx?Math.round(r):0;return{height:Math.round(s.height),keyboardInset:c}}return{height:o,keyboardInset:0}}function Zh(o,s=qx()){return o.style.setProperty(Op,`${s.height}px`),o.style.setProperty(Up,`${s.keyboardInset}px`),s}function Xx(o=typeof document<"u"?document.documentElement:null){if(!o||typeof window>"u")return()=>{};let s=null;const r=()=>{s=null,Zh(o)},c=()=>{if(s===null){if(typeof requestAnimationFrame!="function"){r();return}s=requestAnimationFrame(r)}};Zh(o);const f=window.visualViewport;return f==null||f.addEventListener("resize",c),f==null||f.addEventListener("scroll",c),window.addEventListener("resize",c),window.addEventListener("orientationchange",c),()=>{s!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(s),s=null),f==null||f.removeEventListener("resize",c),f==null||f.removeEventListener("scroll",c),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),o.style.removeProperty(Op),o.style.removeProperty(Up)}}const Vx=900;function Qh(){if(typeof window>"u")return!1;const o=ei();return o<mu?!0:o<=Vx}function Zx(){const[o,s]=x.useState(Qh);return x.useEffect(()=>{var f,m;const r=()=>{const b=Qh();s(p=>p===b?p:b)};r();let c=null;try{c=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null}catch{c=null}return(f=c==null?void 0:c.addEventListener)==null||f.call(c,"change",r),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),(m=window.visualViewport)==null||m.addEventListener("resize",r),()=>{var b,p;(b=c==null?void 0:c.removeEventListener)==null||b.call(c,"change",r),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),(p=window.visualViewport)==null||p.removeEventListener("resize",r)}},[]),o}function Qx(o){const s=o.target;if(!s)return!1;if(s.id==="terminal-container"||s.id==="terminal-frame"||s.id==="terminal-surface"||s.classList.contains("xterm-helper-textarea")||s.classList.contains("xterm")||s.closest("#terminal-container")||s.closest(".xterm"))return!0;if(typeof document<"u"&&document.activeElement){const r=document.activeElement;if(r.id==="terminal-container"||r.classList.contains("xterm-helper-textarea")||r.closest("#terminal-container")||r.closest(".xterm"))return!0}return!1}function Fx(o,s={}){if(typeof window>"u")return()=>{};const r=c=>{var f;c.ctrlKey||c.altKey||c.metaKey||c.key==="Escape"&&(s.isModalOpen||s.isSheetOpen)&&(Qx(c)||(c.preventDefault(),c.stopPropagation(),(f=o.onCloseModals)==null||f.call(o)))};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}}function Jx(){const[o,s]=x.useState("terminal"),[r,c]=x.useState(!1),[f,m]=x.useState(!1),[b,p]=x.useState(!1),[y,S]=x.useState(!1),{updateSettings:g,settings:T,connectionState:B,stateDetail:O,stateCode:L,lastPairedAt:V}=mt(),k=Zx();x.useEffect(()=>Xx(),[]);const[Q,P]=x.useState(!0);x.useEffect(()=>{let Z=!1;return fetch("/api/info",{headers:{Accept:"application/json"}}).then(pe=>pe.ok?pe.json():null).then(pe=>{Z||!pe||P(!pe.isRemoteRelay)}).catch(()=>{}),()=>{Z=!0}},[]),x.useEffect(()=>{up()},[]),x.useEffect(()=>{const Z=r||b||y;if(Z)return Fx({onCloseModals:()=>{c(!1),p(!1),S(!1)}},{isModalOpen:Z})},[r,b,y]),x.useEffect(()=>{const Z=()=>{const pe=window.location.pathname,Te=window.location.hash;s(pe==="/admin"||Te==="#admin"?"admin":"terminal")};Z(),window.addEventListener("popstate",Z),window.addEventListener("hashchange",Z);try{const pe=new URL(window.location.href),Te=pe.searchParams.get("token"),M=pe.searchParams.get("pairCode"),X=pe.searchParams.get("ws")||pe.searchParams.get("wsUrl"),W={};Te&&(W.token=Te),M&&(W.pairCode=M.toUpperCase()),X&&(W.wsUrl=X),Object.keys(W).length>0&&g(W);let ue=!1;if(pe.searchParams.has("token")&&(pe.searchParams.delete("token"),ue=!0),pe.searchParams.has("pairCode")&&(pe.searchParams.delete("pairCode"),ue=!0),ue){const K=pe.searchParams.toString(),Me=pe.pathname+(K?`?${K}`:"")+pe.hash;window.history.replaceState({},"",Me)}}catch(pe){console.warn("Failed to parse URL query params:",pe)}return()=>{window.removeEventListener("popstate",Z),window.removeEventListener("hashchange",Z)}},[]);const J=(Z=!1)=>{m(Z),c(!0)},oe=()=>{c(!1),m(!1)},ce=Z=>{s(Z),Z==="admin"?window.history.pushState({},"","/admin"):window.history.pushState({},"","/")},Y=!T.token&&!T.pairCode&&B!=="connected",_=B==="error"&&(["auth_required","unauthorized","device_revoked"].includes(L||"")||/auth|unauthor|forbidden|permission|token|pair/i.test(O||"")),R=Y||_,[ae,Ee]=x.useState(!R);x.useEffect(()=>{R||Ee(!0)},[R]),x.useEffect(()=>{V&&(c(!1),Ee(!0),s("terminal"))},[V]);const Se=o==="terminal"&&!R,me=Z=>({visibility:Z?"visible":"hidden",opacity:Z?1:0,pointerEvents:Z?"auto":"none",zIndex:Z?1:0});return u.jsxs("div",{"data-testid":"app-shell",style:k?{paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"}:void 0,className:"flex h-full w-full select-none flex-col overflow-hidden bg-tui-crust font-mono text-tui text-tui-text",onContextMenu:Z=>{Z.preventDefault(),Z.stopPropagation()},children:[!k&&u.jsx(Lv,{currentView:o,onNavigate:ce,showAdminEntry:Q,onOpenPairing:()=>J(!1),onOpenSettings:()=>p(!0),onToggleVirtualKeyboard:()=>S(!y),isVirtualKeyboardOpen:y}),!k&&!R&&u.jsx(Ov,{}),u.jsxs("div",{className:"flex-1 min-h-0 w-full overflow-hidden relative",children:[ae&&u.jsxs("div",{"data-testid":"terminal-layer",className:`absolute ${k?"inset-x-0 top-12 bottom-11":"inset-0"} flex flex-col min-h-0 w-full overflow-hidden`,style:me(Se),"aria-hidden":!Se,children:[u.jsx(hx,{isActive:Se}),!k&&u.jsx(xx,{isOpen:y,onClose:()=>S(!1)}),u.jsx(yx,{compact:k})]}),o==="terminal"&&R&&u.jsx("div",{"data-testid":"onboarding-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-10",children:u.jsx(px,{onPairedSuccess:()=>{}})}),o==="admin"&&u.jsx("div",{"data-testid":"admin-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-20",children:u.jsx(Ox,{onBackToTerminal:()=>ce("terminal"),onOpenPairing:()=>J(!1)})}),k&&Se&&u.jsx(Kx,{onNavigateAdmin:()=>ce("admin"),showAdminEntry:Q,onOpenPairing:()=>J(!1),onOpenSettings:()=>p(!0),onAddProfile:()=>J(!0)})]}),!k&&o!=="admin"&&u.jsx(Ax,{onAddProfile:()=>J(!0)}),u.jsx(wx,{isOpen:r,isAddMode:f,onClose:oe}),u.jsx(Cx,{isOpen:b,onClose:()=>p(!1)}),u.jsx(Ex,{})]})}function Ix(){return u.jsx(Oy,{children:u.jsx(Jx,{})})}const Bp=document.getElementById("root");if(!Bp)throw new Error("Root element not found");ay.createRoot(Bp).render(u.jsx(Sl.StrictMode,{children:u.jsx(Ix,{})}));
|